query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0b17c9d9670d895a77f53885be58cb44 | 225a06cb002aa7191737edc278a76d19 | A convenience method to translate a string and format it
with the intl extension's MessageFormatter object. | {
if ($message === '') {
return $message;
}
try {
$formatter = new MessageFormatter($locale, $message);
} catch (IntlException $exception) {
throw new CannotInstantiateFormatterException(
$exception->getMessage(),
$e... | 1 |
b003e8ca78beb98d81a30b9bf5a2c098 | e061a0c65e8adee1bd54c3116d3052ae | 单条区块扫描记录入库; | @Component
public class UsdtWatcher extends Watcher
public void insertBlockRecord(Map<String, Object> map) {
BlockRecordBtc blockRecordBtc = new BlockRecordBtc();
blockRecordBtc.setBlockHash(map.get("blockhash").toString());
blockRecordBtc.setBlockHeight(map.get("block").toString());
blo... | 1 |
666a2f2728f3e5cfef44b0caff737aad | 2feede950c2215100ad6e15b76114348 | 查询店铺当天各个来源的访客数量 | {
string sql = string.Format("SELECT SUM(visitcountperday) visitCount from YiHui_DistributorVisitInfo where DistributorId={0} ", distributorId);
if (memberId != -1)
{
sql += " and memberId=" + memberId;
}
if (date != "")
{
... | 0 |
e1436163c507dc94ed9f9c81536e8939 | 99c8c8a8a2d628eae6fd23f72a1d8561 | Gets detailed information about an in-wallet transaction.
https://bitcoin.org/en/developer-reference#gettransaction | def get_raw_transaction(txid, verbose=True):
return execute_rpc("getrawtransaction", [txid, 1 if verbose else 0]) | 0 |
d2ad252192fe0dbfa17451aae7bcc1bf | 21c15c4e1aa1aa05296ffcdf3de03e53 | 查询未被推荐的音视频资源信息 | @Controller
@Scope("prototype")
public class advertVideoAction1 extends PageAwareActionSupport<AdvertVideo1>
public void unAdvertVideoList(){
try{
Pagination<Song> result = this.advertVideoService.unAdvertVideoList(song, page, rows);
List<Song> resultList = result.getResultList();
JSONArray jsonArray = new... | 1 |
677be12bb04e24c46915236f9b09ed70 | 103a007934b0dcb5f6bcf6fca8e6bc11 | Adds a vec2 uniform to the material. | namespace SFGenericModel.Materials
public sealed class GenericMaterial
public void AddVector2(string uniformName, Vector2 value)
{
vec2UniformsByName.Add(uniformName, value);
} | 1 |
820dc11ea5031b0d8890350c2dc0bb4c | 56498d5d8bdc6021cd9a465d48473659 | Simulate user configuration of default profile. | def fake_user() -> CachedUserConfig:
return {
"user_id": "1000",
"username": "Me",
"frequency": "hourly",
"language": "en",
"delivery": "pm",
"last_notified_timestamp": 0,
"manual_subs": [],
"auto_subs": [],
} | 1 |
6a228ecf57c7124b5dac6324e073bd58 | 2edfbf4519b5cb2342bd7e344be44dee | 获取cookie键 | {
if (this.m_skey.Length > 0 && cookie.Length < 10) return this.m_skey;
cookie = h.GetCookie();
int p = cookie.IndexOf("skey");
if (p >= 0)
{
this.m_skey = cookie.Substring(p + 5, 10);
}
return this.m_skey;
... | 0 |
86e68b59601738b17f6f712f48168961 | 127f63e39392e66bba8dd3ff90df0d27 | Restore the algo instance stored in __enter__. | class MockRestore():
def __exit__(self, exc_type, exc_val, exc_tb):
setattr(self._obj, self._meth, self._saved) | 1 |
051a8da5d214e72e43ce7c63d65d7d2f | 2c24d9c3ce5f42c4e1f0a484f1833219 | Reads from this buffer until the destination's position reaches its limit, and increases the
read position by the number of the transferred bytes. | public int read(final byte[] destination, final int offset, final int length) throws IOException {
Function read0 = new Function() {
@Override
public int apply(int off, int len) {
int bufferPos = BUFFER_SIZE > position ? position : position % BUFFER_SIZE;
... | 1 |
48d083942ad88dba47091ecc35e29f0f | c523d50bc6bde2d3c0b67e1356c74214 | 确认还书按钮槽函数 | void MainWindow::on_return_book_clicked()
{
if(user_type == tourist){
QMessageBox::about(0,QObject::tr("Wrong"),"游客模式下不能使用还书功能");
return;
}
int row = ui->check_table->rowCount();
int select_flag = 0;
QString BookId;
QSqlQuery query;
QString Cardid = ui->card_id->text();
f... | 1 |
c0901000058cfa463e22a363abd09c0d | 17b8c0ff5a3b340c06cfaffb4b1cc9b8 | 获取退避时长 | int eminute = SharedPreferencesUtil
.getInt(conte,
SharedPreferencesUtil.KEY_DISTURBEM
+ SharedPreferencesUtil.getLoginUserId(conte),
-1);
eminute = eminute < 0 ? 0 : eminute;
return eminute;
} | 1 |
6a0478d1b39df4ae2a2133e83d365f5f | 1ed33cdb4e5ad3478207c35f8d59e06c | Vérifie que l'utilisateur est authentifié et renvoie à la page de connexion si non | function checkConnexion()
{
if (!isConnected()) {
$_COOKIE["redirect"] = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
setcookie("redirect", "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]");
header("location: login.php");
exit;
}
} | 1 |
9073bef8c32bf24a3fd0c9fab741c2b2 | ddb46d9827c3dc0b719e70b56ca5de32 | Supprimer toutes les éditions | class EnsembleSuiviService extends CI_Model
public function supprimerEditeur($idEditeur){
$suiviCollection = $this->suiviDAO->getSuiviByIdEditeur($idEditeur);
foreach ($suiviCollection as $suiviDTO){
$this->suiviDAO->deleteSuivi($suiviDTO);
}
$jeuCollection = $this->jeuDAO->g... | 0 |
7257749fa3cf9636d34c59663abdd4cd | 058f2e2f142d44fff37dd61ee5f3cc86 | UTILISATEURS CONNECTÉS | class OwncloudConnectModelConnexion extends JModelList
public function getUtilisateur()
{
$user = JFactory::getUser();
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select('*')
->from($db->quoteName('#__owncloudconnect_utilisateurs', 'a'))
... | 1 |
996384e8d90824041e84ae4af7bc358a | 7c906f2459c80baccc9d3da7aea41920 | Returns a pointer to the node at the given `index' in the `store'.
Assumes that `index' is a valid index in `store'. | store_get_object (ClutterModel *store,
unsigned index)
{
ClutterModelIter *iter;
FooTestObject *object = NULL;
iter = clutter_model_get_iter_at_row (store, index);
if (iter &&
!clutter_model_iter_is_last (iter))
{
clutter_model_iter_get (iter,
... | 1 |
113110b646520b316c54db34331521ad | 10b5326e51d099a206200f8ad7002c0b | Runs a query inside a read-only transaction context, with retry-logic. | try {
await txnFunc(session);
} catch (error) {
debug('Transaction aborted. Caught exception during transaction.');
if (error.errorLabels && error.errorLabels.indexOf('TransientTransactionError') >= 0) {
debug('TransientTransactionError, retrying transaction ...');
... | 1 |
dfbbe6cfef1f85ea08724831ac1ea982 | 189ea85f8c16039db3451fee82bd3390 | Convenience function. Returns the path of the \*.sikuli bundle. | def getImagePath():
return [getBundlePath()] + Settings.ImagePaths | 0 |
9627b3a60b53ff4580f939fc999e71f8 | caf2d43a15651e5d05af68b018689e8b | fungsi yang akan menanyakan user unutk bermain lagi atau keluar dari permainan | {
char key1;
int sw1=0;
gotoxy(101,24);
printf("If you want to quit ?");
gotoxy(101,26);
printf("Please enter the 'q' ");
gotoxy(101,28);
printf("If you want to play again?");
gotoxy(101,30);
printf("Please enter the 'r' ");
while (!sw1)
{
key1 = _getch();
... | 1 |
ebc37d4edfe42e3d7070b294b20b4cce | 9a21f8c35d8cced7da19af2dbb80bc9a | 测试分页响应头的设置 | TestHttpClient client=new TestHttpClient();
try {
final EncodingHandler handler=new EncodingHandler(new ContentEncodingRepository().addEncodingHandler("compress",ContentEncodingProvider.IDENTITY,50).addEncodingHandler("bzip",ContentEncodingProvider.IDENTITY,100)).setNext(new HttpHandler(){
@Override publi... | 0 |
ec0e76f6a1c4138731b9c83fd4b9ad72 | 41fe1e617d1387aaf48a356e964f7c8b | Unsets the "billingAccounts" element | @XmlRootElement(namespace ="http://bp.comverse.com/data")
@XmlAccessorType (XmlAccessType.PROPERTY)
public class ProductChargeMapObjectData extends BaseObjectData implements Serializable
public void unsetNoBill () {
this._NoBillSet = false;
} | 0 |
8fd69a1d936eda98c4a1d0be316ed1b3 | c743573d1243826a4316c848aff117fe | Hauptfunktion des Astern-Algorithmus. Es wird iterativ der naechstbeste Wegpunkt berechnet,
bis das gesuchte Ziel erreicht wurde. | self.history.append(copy.deepcopy(self.segments))
if self.isReachable(targetX, targetY):
while not self.inMarginOfError(targetX, targetY):
self.iterate(targetX, targetY)
self.history.append(copy.deepcopy(self.segments))
else:
print('Target ... | 1 |
b7da75adf566aa63613ebaf38256a54e | d6ff88e1bebafe7120eb8c4f6c987339 | Funktion som slumpar om en power-up ska ges när ett spöke skjutits ner | spawnChoice = Mathf.Abs(Random.Range(1,6));
Transform location;
if(spawnChoice == 1)
{
powerupPosition = new Vector3(29.88717f,21.03424f,32.68854f);
PowerupChoice(powerupPosition);
}
else if(spawnChoice == 2)
{
powerupPosition = new Vector3(39.50623f,35.38276f,2.367467f);
PowerupChoice(p... | 1 |
a0529ccc6249666e99240208f591bede | 3976eb84b9609ec814f7e9ec5d776c8b | Retourne l'identifiant du disque supérieur de la tour demandée | final class Board
int getPegTop(int p) {
return pegTop[p] ;
} | 1 |
097f4efe3b25cf2db5ae2792b257bc98 | b11d59d342710a6631435e32036d681d | Create one projectile given x and y | {
if (m_type == "hard")
m_projectile.insert(new Projectile(m_x +20,m_y +30,-5,0,3));
else if(m_type == "medium")
m_projectile.insert(new Projectile(m_x +20, m_y +30, -5, 0, 2));
else
m_projectile.insert(new Projectile(m_x +20, m_y + 30, -5, 0, 1));
} | 1 |
065e696d6b280f2d931d6142b303d962 | 3e9605b9b8ad25de4a278df916e2ed7a | 清除nodejs中的缓存 | export default class SandboxWorker
public clearCache(path: Nullable<string> = null): void {
if (path === null) {
require.cache = { };
return;
}
for (const c in require.cache) {
const cachePath = c.replace(/\\/g, "/");
if (cachePath.indexOf("node_mo... | 1 |
36b53f92a6d98d020831feec100dce24 | dcb4b000da9a899db7f0f5a50c44a7d9 | make a colors array as per input | function setColors(n) {
var result = [];
for (var i = 0; i < n; i++) {
var index = i % palette.length,
c = palette[ index ];
result.push(c);
}
return result;
} | 1 |
e4deb8ae1258ea91d8fed66e9c95869d | aee20fe5acc216242c9e49a56a3b8319 | Load a config file and its `.local` file if it exists. | class Config
public function __construct()
{
$yamlPath = __DIR__ . '/../config/config_local.yaml';
if (false === file_exists($yamlPath)) {
throw new \Exception(
'Couldn\'t load config file! Please create a "config_local.yaml" that extends the "config.yaml" file.'
... | 1 |
2fbeec17a4d47d1032cee2b78f4e7c25 | bbb957a6ab8398413326dd4bb67d67b7 | Get the correct codec for this image based on the type of image that has been uploaded | namespace GSAKWrapper.Utils
public static class ImageUtilities
public static ImageCodecInfo GetEncoderInfo(string mimeType)
{
string lookupKey = mimeType.ToLower();
ImageCodecInfo foundCodec = null;
if (Encoders.ContainsKey(lookupKey))
{
foundC... | 1 |
ffd909e9c1c22f0262e74b104f654259 | 0228e0d622d0a9851ebdf43ce62126ac | 检查Memcached的状态码
如果状态码不是成功或key不存在的状态,可能服务器有问题,抛出异常。 | try {
return client.get(key);
} catch (TimeoutException e) {
logger.error("TimeoutException: " + e.getMessage());
throw e;
} catch (InterruptedException e) {
logger.error("InterruptedException: " + e.getMessage());
throw e;
} catch (MemcachedException e) {
logger.error("MemcachedException: " +... | 0 |
e021979bd56e853cbfdb5b0c447ceffe | 223b788615c3912c9f680343898be715 | Skal slette et Salg. | boolean slettCD(int CDNummer); | 0 |
53f831a2505430c73b49af473eefdf2b | 2ff38887e2701b173d6a46a28ad98463 | 获得符合指定前缀名称的RMS | try {
return Files.walk(root)
.filter(p -> p.toFile().isFile())
.map(p -> p.getFileName().toString().trim())
.filter(SerialPrefixAggregateTool::isValidExtName)
.map(SerialPrefixAggregateTool::extractPrefix)
... | 0 |
10418f46547627f1327762cf59e5ef66 | 2be8714b01ea9947158ecf4f7d20c78b | Contributors should be able to view other users' private exhibits. | class AclTest_ContributorExhibitsPrivateAllow
extends Neatline_Case_Default
public function testCanViewOwnPrivateExhibits()
{
$this->dispatch('neatline/show/slug2');
$this->assertNotAction('forbidden');
} | 0 |
b4aee9615b23f839337ff8fd8647ab70 | 193352b40e0d6e7c572031d1b698dc3c | Creates a Credential Acknowledgement Message async. | ValueTask<object> CreateAsync(
ClaimsIdentity identity, string subject, string client,
string type, ImmutableArray<string> scopes, CancellationToken cancellationToken = default); | 0 |
c1c1be332ecaf66c0f9bc4c3da9986ba | dcb3aeb6aa1ef7b0410675aa7dd4f834 | Build graph, 8 connected | func main() {
gm := graph.New(6)
gm.AddBoth(0, 1)
gm.AddBoth(0, 3)
gm.AddBoth(1, 2)
gm.AddBoth(1, 4)
gm.AddBoth(2, 5)
gm.AddBoth(3, 4)
g := graph.Sort(gm)
dist := make([]int, g.Order())
graph.BFS(g, 0, func(v, w int, _ int64) {
fmt.Println(v, "to", w)
dist[w] = dist[v] + 1
})
fmt.Println("dist:", dis... | 0 |
264652e85b10e295ef682dbeb0eadda1 | 9625713ed11eb410421731af4f373878 | View座標変換の設定 | void
setup_view(DisplaySet *ds) {
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, ds->width, ds->height, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.375, 0.375, 0);
glEnable(GL_LINE_SMOOTH);
glLineWidth(2.0f);
} | 1 |
4e3cde79c0c8e310ed931a1da4584f02 | d3b73a298676383df3ad954d42fddcdc | Creates a new shared register. | constructor(name: string) {
this._dataSharedName = name;
} | 0 |
deda70a1b13a8fe79e2502880fe50e27 | a36f17a11b2cb973f419b6221db18902 | 生成交易明细请求Excel | import("Organ2.Util.Tlinx");
$Tlinx=new \Tlinx();
$admin=$Tlinx->check_auth(94);
$this->admin=$admin;
$map=I('');
$fileName=$save_path=C('STATEMENT_PATH').'Merchant-'.$admin['org_no'].'-'.intval($admin['agent_no']).'-'.implode('-',$map).'.xls';
if(file_exists($fileName)){
if(date('Ymdh')==date('Ymdh',... | 1 |
e77616747da36f1f4d988a53bc9f7454 | 2ec02a7c56b2d396d6464c09df140496 | retrieve the SSRC of each participant | public class AudioMixerMediaDevice
extends AbstractMediaDevice
implements MediaDeviceWrapper
private static class MediaStreamMediaDeviceSession
extends AudioMediaDeviceSession
implements PropertyChangeListener
@Override
public long[] getRemoteSSRCList()
{
return a... | 1 |
2b1bdf0253b37e172bfdbd821776c779 | c2ed086c1bd776d418a7aa4e93259277 | For debugging, view the source HTML of the text browser widget. | class WebTestCase extends SimpleTestCase
function showSource() {
$this->dump($this->_browser->getContent());
} | 1 |
6d5b04216a8b8f0fd8ff5ac42bdc3d59 | 358522ece694edcd3ea7d6b76f491c0a | 合并左倾堆 | function Heap(&$arr,$idx)
{
$left = ($idx << 1) + 1;
$right = ($idx << 1) + 2;
if (!$arr[$left]){
return;
}
if($arr[$right] && $arr[$right] < $arr[$left]){
$l = $right;
}else{
$l = $left;
}
if ($arr[$idx] > $arr[$l]){ ... | 0 |
e21892091706573bafbdcdd8c54eed57 | bd8b50453e0289bb3d1a4abb83b76c81 | Get Clsid of the filter associated with a media type (by type's name) | {
IntPtr dllHandle = loader.GetDLLHandle(dllName);
Object unk;
IntPtr dllGetClassObjectPtr = GetProcAddress(dllHandle, "DllGetClassObject");
if (dllGetClassObjectPtr == IntPtr.Zero)
return null;
Guid IClassFa... | 0 |
5f61f9f52108aca438ca0d38d456d174 | 069dd2abf80b5a1dde43617ba9e1174d | Only select executions which contain an activity with the given id. * | public void testQueryExecutionActivityId() {
String activityId = "sid-43D1D00A-A9A6-4D4E-88CF-7CA2CCC359FD";
Execution execution = runtimeService.createExecutionQuery().activityId(activityId).singleResult();
System.out.println(execution.getId());
} | 1 |
25c025a6f0dbd454070ba94f02b50101 | 148968a4ab495601c2fd29ff6cd7504e | Step size of temperature units. | class GenericThermostat(ClimateEntity, RestoreEntity):
def target_temperature_step(self):
if self._temp_target_temperature_step is not None:
return self._temp_target_temperature_step
return self.precision | 1 |
bef62499d669dac640d302426feb9b22 | 388a1a2548639c0e5defa82e961d618a | Test replica trajectory writer (dcd): | name = 'barstar_md_traj'
out_run_dir = str(tmpdir)
output_fname = name + '.PB.fasta'
call_list = ['PBassign',
'-x', os.path.join(REFDIR, name + '.xtc'),
'-g', os.path.join(REFDIR, name + '.gro'),
'-o', os.path.join(out_run_di... | 0 |
cb0291355084cf0bb276af550027093f | 307d9c3069737cf8a0868facae3771ce | Tire dans la direction demandée | public class Fourmi
public void go() {
this.posX += this.direction.getDirX();
this.posY += this.direction.getDirY();
} | 1 |
3930df59e478a9780e6a4afaee88a786 | 9a6e347a680b7824b5569e53920dcfe4 | Clears the chat history. | export class ChatService
clearChat() {
this.dataService.chatLogMessages().remove();
} | 1 |
4b0dcaed3622beeb2ff617bd83fe1f10 | 5f37bd8f9a5b5bb5d231ed2f1a6fbbcc | Tells the inventory button whether to glow or not. | public class InventoryGui implements Listener
public void setSilent(boolean silent) {
this.silent = silent;
} | 0 |
5284920885ca389df1c04a952453fe77 | f298d299c0e56a89e55a758b9db6289f | Draw randomly positioned and colored ellipses. | {
Random random = new Random();
for (int i = 0; i < count; i++)
{
ellipseInfo newElement = new ellipseInfo();
newElement.x = random.Next(20, (int)Width - 20);
newElement.y = random.Next(20, (int)Height - 20);
Ell... | 1 |
a9cba2562c78a7e0a404c80b22f6f87d | 2392e7b0aa6112e7ab515380779ac08d | Helper for accessing protected fields. | IllegalArgumentException, InvocationTargetException {
Object value = null;
if (obj != null) {
Method accessor = getAccessor(obj.getClass(), fieldName, false);
if (accessor == null) {
IllegalAccessException ae = new IllegalAccessException("No accessor available for field \"" + fieldName
+ "\" on "... | 1 |
759366e3123f8c105ff382fa183fcca8 | a94c4a6d611fee132fd75e28bd13e4d1 | Controles cuando interactuamos con los sliders de la duración de la canción | public class Scriptqueso : MonoBehaviour
void Update()
{
SliderRedondo.value += Time.deltaTime ;
if (SliderRedondo.value <= 49)
{
RatController.Speed = 5f;
}
if (SliderRedondo.value >= 50)
{
RatController.Speed = 2.8f;
}
if (... | 0 |
febb0f3e892361d43a51a058bf6a777e | 026a5865b2b699276e82d4ef3805c38c | 销毁逻辑设备的方法 | abstract class AbstractDevicesManager{
void destroyOtherThread(DeviceInfo di){
ThreadListManger.destroyOtherThread(di);
} | 0 |
8aff6d6a761db6f1f61938dcca091ddb | 856d1a548763d492856cf79aadc34446 | Hàm kiểm tra năm nhuận | namespace DAL
public class DAL_YC4 : DBConnect
public bool KTNhuan(int year)
{
if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) return true;
return false;
} | 1 |
14f9b087717995392b32ae4bf8d50c41 | e0b96a4c8cead1396bdd14424f8f45de | 同步个人信息到同学录的函数 | msg = self.userID + "同学:" + self.inputEdit.text()
message = msg.encode("utf-8")
self.s.sendto(message, self.addr)
self.inputEdit.clear() | 0 |
96bed8a33e3d4d18721153121fc85afa | fde66d1cddc475cfe700ac73cbffa443 | initializes CognacError. | if (context != null) {
default_error = context.getString(R.string.LocalError_C0);
}
} | 0 |
5b8e8c4a5d38b13d0777e49531e121bc | 1bd5de0557b2f638c94d50ac83b3b3c4 | Returns the bug page for the history listing | class AutowaveCoreDokuwikiPlugin extends AutowaveCoreWikiPlugin
function link_bug( $p_event, $p_bug_id ) {
return $this->base_url( bug_get_field( $p_bug_id, 'project_id' ) ) . 'issue:' . (int)$p_bug_id;
} | 1 |
007302d52ce55568032813b7469cbb34 | 50c84fbb25c626745824f53d6565186d | Instantiates the U-Net model according to the paper
"U-Net: Convolutional Networks for Biomedical Image Segmentation" (https://arxiv.org/pdf/1505.04597.pdf) | def U_net(image_rows, image_cols, img_channels):
inputs = Input((image_rows, image_cols, img_channels))
conv1 = Conv2D(32, (3, 3), activation='relu', padding='same')(inputs)
conv1 = Conv2D(32, (3, 3), activation='relu', padding='same')(conv1)
pool1 = MaxPoolin... | 1 |
8d86b0e60cbb3e27ae56bb79ecb5d0f0 | 1cb6219a0215f64b79e9923b9570a82a | 从一个主键为string的Dictionary获取元素,忽略大小写 | {
if (dictionary.ContainsKey(key))
{
return dictionary[key];
}
return string.Empty;
} | 0 |
0efb2d9262e7d39813d26a730bb4634e | 25b9564ea1dceb96efe29ccf3864c2c1 | Get all the offers on this request
If status is None this will return all the offers
Otherwise return offers with the given status | {
ObjRequestActiveOffers variable = new ObjRequestActiveOffers(Nonce);
string response = this.Request(variable, "POST");
ObjOfferStatus[] result = JsonConvert.DeserializeObject<ObjOfferStatus[]>(response);
return result;
} | 0 |
3473e07f594d799f71bd576fe03da85b | 516ed2f7c5288833240107b3f95ec753 | Calculate T(rho,u) for a material. As an approximation
we use u(rho,T) = uc(rho) + cv*T. | self.T = (self.mat_energy / self.rho - \
0.5 * (self.momentum / self.rho)**2) \
/ self.mat.C_v | 1 |
ec1374c546b6e4aad9d219e05a20f753 | c939726e39f6c0a685184058fcf7d1fa | given a string (presumed to be a person's name), try to return
just the person's first and last name without cruft
e.g. 'Megan E. Green' => 'Megan Green'
'Freeman Bosley Sr.' => 'Freeman Bosley | class Person(Notable, DateRange):
def firstname_last(self):
names = self.authorized_name.split(', ', 1)
return ' '.join(reversed(names)) | 0 |
99de5ff3385c578e9c49ed8d13e9cf58 | e077d344aaa195fda3a483f655d8ea61 | Setter for CMP Field asid | void setAsdSpec(ASDspec value); | 0 |
435e5c9a95e117d8ea601a6c60da7330 | 6a253ed1185660eccbfeb8f0312859f7 | 根据评价ID查询评价商品信息 | class queueLogic
public function updateGoodsEvaluate($goods_id){
Model('evaluate_goods')->getEvaluateGoodsInfoByGoodsID($goods_id);
} | 0 |
d4f2ecf05c22942791031dede9bd3ba9 | d81de2c742f8ca8b5351bd3c93cf71bb | Takes cpe and gives CVEs - Product to Vulnerability | def parse_CPE(cpe):
tmp = {'CPE': '', 'FROM': '', 'UPTO': ''}
tmp['CPE'] = cpe[0]
if len(cpe) > 1:
for i in cpe[1:]:
if 'From ' in i:
tmp['FROM'] = i[16:]
elif 'Up to ' in i:
tmp['UPTO'] = i[17:]
return tmp | 0 |
861e761190cb2fa6524103b29de53a1c | 4aacb323797a55c91d668ccf65863713 | Just copy 10MB of random data. | class TestServer(unittest.TestCase):
def test_random(self):
filename = "myfile"
file_copy = b""
files = {}
for i in range(10):
file = self.tempdir/f"file-{i:02d}"
data = random.randbytes(2**10)
file.write_bytes(data)
files[file] = data
... | 0 |
de5a335dba4ba927e73705ae299b39c0 | e3c0b420093075cf2db4f68c5739a061 | Use MIDI messages to update KK's Light Guide | midi_signal_type = midi_signal.type
if midi_signal_type == 'note_on':
note = midi_signal.note
if note in self.ignore_notes:
return
print('PROCESSING NOTE: {0}'.format(note))
LedOnMessage(
self.strip,
self._g... | 1 |
31804d0315fed4335887e768e9543548 | 5e15ec92d87946ae2218f335ebf90bad | 高德定位回调 | public void onLocationSuccess(AMapLocation aMapLocation) {
LogAndToastUtil.errorLog(TAG, "longti:" + aMapLocation.getLongitude() + ",lati:" + aMapLocation.getLatitude());
if (!CameraApplication.getmInstance().ismNetworkConnected()) {
dismissProgress();
LogAndToastUtil.shortTo... | 1 |
fe56b403b9f8d9202aab13ef524a6c7d | 8a175f499c1869b0ce460d7ab27907f0 | This function implements the callback for the HDMI TX Video Sync event.
Transmitter. | void XV_HdmiTxSS_HdmiTxIntrHandler(XV_HdmiTxSs *InstancePtr)
{
XV_HdmiTx_IntrHandler(InstancePtr->HdmiTxPtr);
} | 1 |
3bd098a4321f73db637af711893a0120 | c21ea38a35878aa55bf0e164ebd9df8e | Sprema instancu karte u bazu zajedno sa vanjskim ključevima. | public class BookInstanceDao implements BookInstanceDaoInterface
@Override
public void save(BookInstance bookInstance) {
String query = "INSERT INTO book_instance (is_available, id_book) VALUE (?, ?)";
try (PreparedStatement preparedStatement = connection.prepareStatement(query, Statement.RETURN_GEN... | 1 |
72e1f5f9b36e7b3ab53a6246416bc859 | 9a4e5d80ba0a8ad551924efc5cf08fe4 | Internal query to resolve the "items" to-many relationship of Hero. | class HeroController extends Controller
public function index()
{
return response(Hero::all()->jsonSerialize(), Response::HTTP_OK);
} | 0 |
4cbab800df6724669a37e70e1a8ee9d0 | c734fa6fcfc13286982be0fdc790685a | проверка сделать ли кнопку перехода к следующему уровню активной | public class CanvasManager : MonoBehaviourHelper
public void ButtonLogic()
{
SetButtonActive(buttonLastLevel, Util.ActivateButtonLast());
SetButtonActive(buttonNextLevel, Util.ActivateButtonNext());
} | 1 |
610e50ab10c6116713357ef3673ecabf | b22cdc761596a3c2cadd884ee28a3161 | Initialize/sync a monitor component.
This method will initialize a monitor component.
As a part of this init, this method will read existing entries in api
server and populate the local db. | url = self.get_component_url()
self._log("%s - Start init url=%s resource_version=%s"
% (self.name, url, self.resource_version))
resource_version = self.resource_version
params = None
if resource_version:
params = {"resourceVersion": resource_version... | 1 |
7fcc5f61da1e4f0542b94d72e2066b62 | f3c1fd0b92768aaf5d2a77e03ca53288 | Render data using D3 | stack(data);
tip = d3.tip()
.attr('class', 'd3-tip')
.html( d => {
var index = color.range().indexOf(color(d.ticket));
return '<span class="type type-'+index+'">'+ d.ticket +'</span>\
<br/><span class="value">'+numeral(d.y).format('$0,0') + '</span>\
<br/><span class="number">'+numeral(d.values.leng... | 1 |
ff6806b642aa4eef7984983388552a0d | b8314f91de75d2e5a7c4c4a0323eb650 | Gets the max substring length. | public class FilterString implements FormatStringInterface
public int getMaxLenght() {
return maxLenght;
} | 1 |
d38dde3dbfbe79a1bb55e73e104a7ea4 | d2414a7c09b6c34a0902b858cd6763e6 | Determines what happens when a symbol is pressed. | self.selectedSymbolName = ""
info = event.GetText()
self.selectedSymbolName = info
def do_select():
map(lambda x: self.symbol_selection.Select(x, 1), set(self.selectedSymbolName))
wx.CallLater(100, do_select)
self.selectedSymbol = self.symbols[self.choices.ind... | 1 |
07139d19c2cfd239c1e3b7bb1961f6e8 | 73b3461d5bb385ab791a705a18989e64 | 新增图文自动回复 | {
if ($type == 'text') {
return $this->addTextAutoReply($data);
} elseif ($type == 'news') {
return $this->addNewsAutoReply($data);
} else {
return ['status' => -1, 'msg' => '自动回复类型不存在'];
}
} | 0 |
24c64174292a2bf6d0f89dff693950fa | 80d2aedbb008a42e8e4bac2d79d383f4 | Fx15 - LD DT, Vx - Set delay timer = Vx. | class Cpu:
def LD_Vx_DT(self, x: int):
self.memory.set_V(x, self.delay_timer) | 0 |
94981b4f4aee031912490567b58151cb | 03e6d657aa129b7f2fd66fced38caba0 | 批量删除队列元素 | function batch_del(data) {
return fetch({
url: port_redis.batch_del,
method: 'post',
data
})
} | 1 |
e365e9f34e406a6bcd19aa6ac15a7cfa | bcac6493eef3a1d3e5bbab42ca60b223 | 定义方法计算该长方形的面积 | class Rectangle:
# 成员变量,也称字段,描述对象的特征
def get_area(self):
return self.length * self.width | 1 |
b4aaf8d21db822f1ad77207c09ff7598 | 367e5b6f92892b41aad6ab89e6a1fb80 | 判断当前页面是否是购物车页面 | MallCtr.getPageCarProduct({
start: 1,
limit: 1,
}).then((data)=>{
if(data.list.length){
$(".mallfloatWrap .shoppingCar").addClass('active')
}
})
} | 0 |
110e5f83b338803d4f31e52f3ea978ca | 712cf0da32c93b8058816d5add7e7934 | Convert a JavaScript Date object to a string of form YYYY-MM-DD e.g. 2018-01-27 | if (!(date instanceof Date)) {
date = new Date(date);
}
return `${date.getUTCFullYear()}-${zero(date.getUTCMonth() + 1)}-${zero(date.getUTCDate())}`;
} | 1 |
d0cacc5fedfd3f0820d52dfb83193b17 | f269d04f96f4588fb1a7da6050e36c54 | How long should the mock chat last, given its speed. | int mockTime = random.nextInt(500);
if (mockTime < 100) {
mockTime += 100;
}
return mockTime;
} | 0 |
14a53605ec82fcd472a49bfcd34564b8 | cbbb6b461cd7c3ab578c444b559a4886 | Get multi-character entries, terminating with RET or ESC | {
int i;
char c;
i=0;
do {
c=U0getchar();
if(c==0x7f) c=8;
if(c==8) {
if(i) {
U0putchar(c); i--;
U0putchar(' '); U0putchar(8);
}
}
else {
if(c>=' ') s[i++]=c; U0putchar(c);
}
if(c=='\x1b') { *s='\0'; return 1; }
} while(c!=10 && c!=13 && i < n);
if(c==13) U0putchar('\n');
s[i]=0;
return i;... | 1 |
0446e624ac8fd56d472f5eb62e8c2cbc | 6fe26d42e27f65a5b1d07917684849d0 | Check if the file exists in hatrac | _file = Path(file)
if not (_file.exists() and _file.is_file()):
return False
if not _file.name.endswith('.h5'):
return False
return True | 0 |
69d00a48482b7f9887c4a3636c9bf541 | f702d1341e0467872b20125e192197b2 | if enter is pressed moves focus from username field area to password field | namespace Login
public partial class loginGUI : Form
private void txtPassword_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
login.PerformClick();
}
} | 0 |
a2651b1c17dbd730a0900571b71cebd5 | 6bedabaa7ea20382eb24a9a7d223030d | Allocates and returns a string with the given UTF-32 byte sequence. Given characters have to be in UTF-32. | {
static Tcl_DString tmpds;
static int allocated = 0;
if(allocated) Tcl_DStringFree(&tmpds);
allocated = 1;
return Tcl_UtfToExternalDString(utf8encoding, utfString, -1, &tmpds);
} | 0 |
1095327523c16258e1d18cd6ab930252 | 782e658e4ff8db2a870d3d4da37297cc | Open命令的CanExecuted事件处理函数 | namespace TKLCAF
void XTDocStd_Document::OpenCommand() {
NativeHandle()->OpenCommand();
} | 0 |
cb355e14be570b9b152191fa8b38f4e8 | 959cdf8fac75557493d0f38bbaf507f9 | - List of Kubernetes namespaces that should be configured to run Spark applications, in addition to the default Spark application namespace `spark-apps`. | class ScheduleSpecTemplateArgs:
def included_namespaces(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
return pulumi.get(self, "included_namespaces") | 1 |
5438f7d47d58268d093b6ed570c398d6 | 876a9592936d8a3546ebd455c88e9692 | 短链接还原 | {
$url = $this->apiUrl
.'/cgi-bin/shorturl?access_token='
.$this->getAccessToken();
$param = [
'action' => 'long2short',
'long_url' => $longUrl,
];
$content = Curl::post($url,
json_encode($param, JSON_UNESCAPED_UNICODE))... | 0 |
3330a20b925acce27fa9d8b3fb8567f4 | d11c783ef9d3318c8a775eb17546c2b9 | Listener para controlar cuando se recibe la caracteristica de la CPU. | ISR (USART_RXC_vect) {
caracter_uart = UDR;
fl_caracter_recibido = 1;
} | 1 |
daddcf5c4dc43eb453a9714c9dc5118b | b508d85ad4e080f8c0af61882f32b079 | Extract the options from the original select element in the page and convert them into an array of Javascript objects | var events = {};
var optionLabels = $('.activities label');
for (var i = 0; i < optionLabels.length; i++) {
var htmlData = optionLabels.eq(i).html();
var eventName = htmlData.match(/name="(.+)"/)[1];
var eventData= {
description: htmlData.match(/> (.+) —/)[1],
price: htmlData.match(/\$(.+... | 0 |
c1d84b2402a40a738d7dabe5815f061f | 390adad7151091b6f5fe352027234037 | Simple utility for computing redshift bins that delivers a consistent
number of spectroscopic objects per bin. | class ClusterRedshift(Updatable):
def gen_bins_by_array(self, z_bins: np.ndarray) -> List[ClusterRedshiftArgument]: | 0 |
6bc732cdeac4338971a866b47bf7e664 | 5424b5faeccf05e0798b341147685995 | 根据勾选生成对象 | {
if (this.gridView1.GetSelectedRows().Count() < 0)
return;
CreateSetting cs = new CreateSetting();
cs.ShowDialog();
if (cs.rfpatch == null)
return;
DB_DAO_Facade dbfacade = new DB_DAO_Facade(Login.dao);
fore... | 1 |
34908204a6fc33796318a19ea729bcd0 | 8c5c787beed7ad5df84fb814f1639a0a | Entry point for the scheduler. | def start():
scheduler.start() | 1 |
3cdfda114a8997345664b1849a996848 | 6ceaea7f91d393ee4f84584281f694f5 | # get the selected entity lists and "highlight" their ents | for tag in self.__selectionDict:
obj = self.__selectionDict[tag][1]
self.__selectedEntityBoxDict[tag] = self.__dc.create_rectangle(
obj.getbbox(), width=3,
outline='green', dash=(2,2)) | 1 |
7d8e6d6ba5b81916271f846893f02900 | 3bba979e89d8b6c0a8c12552a8cc0e58 | Compute the initial IPsec topology | @ParametersAreNonnullByDefault
public class IpsecUtil
public static IpsecTopology initIpsecTopology(Map<String, Configuration> configurations) {
NetworkConfigurations networkConfigurations = NetworkConfigurations.of(configurations);
Map<Ip, Set<IpsecPeerConfigId>> localIpIpsecPeerConfigIds = new HashMap<>();
... | 1 |
f300a756553932a1e7528ec427c9f51e | 081f7d13063bedcd062e2d2bbbdd9676 | Sets parameters and their types of all functions. | class TransferFunction(ScientificObject, Log, PersonalisedStamp):
def _set_function_parameters(self, p_args:dict) -> bool:
if self.get_type() == self.C_TRF_FUNC_LINEAR:
try:
self.m = p_args['m']
except:
raise NotImplementedError('Parameter m for linear fun... | 1 |
541d22fc3f0a0b66affd760c139c0cb2 | ccd7516f6fbde8ef34e578d597d6e168 | Retorna el código del mapa | public class MainActivity extends FragmentActivity implements OnMapReadyCallback, AppManagerListener, LocationListener, App.AppListener, MapListener
public int getMap() {
if(opt_carte==99){
return 0;
}else {
return opt_carte;
}
} | 1 |
03926a1bc93cb9ac458d742c41885ab4 | 9b33140443dd2b2d297a4a4c127b6e55 | 対象フィールドのセッターメソッドをコールします | try {
if ( !Modifier.isPublic(targetField.getModifiers()) ) {
targetField.setAccessible(true);
}
targetField.set(target, ConvertUtil.convert(value, targetField.getType()));
} catch (IllegalArgumentException | IllegalAccessException e) {
thr... | 0 |
e0bb3d6d95bb0f29ad11c6f99b09900d | 92e593351a1852db0bf0c88b1e29e587 | 自动解密ID | if(!$id) return $id;
$hashId = new Hashids();
$ids = $hashId->decode($id);
if(isset($ids[0])) {
return $ids[0];
} else {
throw new Exception('解密失败',2);
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.