query_id
string
corpus_id
string
query
string
code
string
label
int64
6756be7791ba8a894e877797cbb6f6f1
fba47bf8cfe02abb4f557b149b18108a
Assert that the index of this DataFrame consists of unique IDs.
class DivExt(base.AbstractTable[events.UpdateDivCommand]): def _validate_new_df(self, df_new: pd.DataFrame) -> None: base.check_unique_increasing_index(df_new)
1
266dbb4bbf499e12c3a3d2fb5ad55099
6b9ad9250811d4781751793beb9ef8f0
找出一个数组中不是-1的最小数
int findLeastEmptyIndex(int arr[]) { int i = 0; for(i = 0; i < MAX_SIZE && arr[i] != -1; i++) { } return i; }
0
061f7be99dec9d5967268827e35cdefc
eeafbadbd1ed6adb261a948b7e08f0bd
一个完整的卷积块:Conv+BN+ReLU
def bn_relu_conv(x,out_depth,scope='dense_basic_conv',reuse=None): with tf.variable_scope(scope,reuse=reuse): net=slim.batch_norm(x,activation_fn=None,scope='bn') net=tf.nn.relu(net,name='activation') net=slim.conv2d(net,out_depth,3,activation_fn=None,normalizer_fn=None,biases_initializer=No...
1
0139c29ede5430437868e80474ff6a41
6d2fe374f9174a3efbbcd8420fae2d26
Benchmarks
def benchmark(): samples = 100 print("Average Benchmarking Results ({s} samples):".format(s=samples)) s2d_t = benchmark_func(samples, sneakymaze.Simple2D, (79, 9)) print("Simple2D (79x9): {t}s".format(t=round(s2d_t, 6))) p2d_t = benchmark_func(samples, sneakymaze.Prim2D, (79, 9)) print("Prim2D (...
1
5a08825e64d64e9489c820a543b6d40e
c45db18a994d3790ee65e7cefcd626f0
替换坐标文本,为超链接文本
var href = document.getElementsByTagName('a'); for(var i=0; i<href.length; i++){ if(href[i]==t){ href[i].href=bwaf_pre_href[i]; } } }
0
7d6c087303dbc528e62a1205edef57bf
c65533c2c139a1107f53fc7920cac7c2
Initializes a new instance of the table monitor
self.connector = connector self.tableFrame.after(GUIUPDATEPERIOD,self._updateTable) self.notifThread = NotifThread( self.connector, self._connectionFrameCb_disconnected ) self.snapshotThread = SnapshotThread( self.connector, )
1
3ab32d41f40751a99ac859cd79c01d5e
050bc82b31be9ea2582f6bacb13eab8d
Returns the '<em><b>Property Category Type</b></em>' literal with the specified name. <!-- begin-user-doc --> <!-- end-user-doc -->
public static PropType getType(String name) { return name2TypeMap.get(name); }
1
e03fd5964556c45144f3912c4da0cc0c
c86466c4935125ac88790a22a4ffd895
Returns the value of the `styles` property.
public final class Configuration implements PropertyHolder public Styles getStyles() { return styles; }
1
68a6ac7beafc0c188cef08112517cf5b
4f10af156fbd23fc7a680587b6c02808
Test that hydrogen addition to benzene (w/ benzene bonds) returns kekulized product.
mol = Molecule().from_adjacency_list(""" 1 C u2 p0 {2,S} 2 C u0 p1 {1,S} """, saturate_h=True) self.assertEqual(mol.get_radical_count(), 2) self.assertEqual(mol.get_singlet_carbene_count(), 1)
0
d17107c4ebc6d2351098ebb12d4913f2
0e3c0d545c77577bb97d7da5bacc154d
先检测模型是否已训练完成
def main(): if check_and_create(_config.checkpoint_path): transformer, _, tokenizer_source, tokenizer_target = nmt_model.load_model() _calc_bleu(_config.path_to_eval_file, transformer, tokenizer_source, tokenizer_target) else: print('没有发现训练好的模型,请先训练模型.')
1
11c62d4bd9db51ae6b02f1eae2a3511a
c8777ed8e407b461b776217ff44ce081
Functions used to update custom delivery date in cart
class Woocommerce_product_calendar function wdm_add_item_data($cart_item_data,$product_id) { global $woocommerce; session_start(); $new_value = array(); if ( isset( $_SESSION['user_custom_deliveryDate'] ) ) { $new_value['user_custom_deliveryDate'] = $_SESSION['user_custom_deliveryDate'...
1
0f071cd9f1505b23bc3744c9ef49fa05
a55b65431ce309b92310b76c1f7e8af7
Give this maintainer a high priority in the stack to ensure that Laravel is bootstrapped early.
public function boot($app);
0
ca0f42348cd14f779184a033eb9fd3c0
64f57841a0af945c22ba56d8068bea12
Crtanje kutije
void crtanjeLoptice(){ glDisable(GL_LIGHTING); GLfloat light_position[] = { 2, 2, 5, 1 }; GLfloat light_diffuse[] = { 0.7, 0.7, 0.7, 1 }; GLfloat light_ambient[] = { 0.1, 0.1, 0.1, 1 }; GLfloat light_specular[] = { 0.9, 0.9, 0.9, 1 }; glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glLightfv...
0
be688a4e553c809925f1e1ea7cd0126e
5f387170b62b4ca5dbdab80a9c7b295a
Returns the Available LocaleEnums CacheKey.
namespace MDM.BusinessObjects public sealed class CacheKeyGenerator public static String GetAvailableLocaleEnumsCacheKey() { return "RS_LocaleEnums"; }
1
aba0e2aa0334711365e94ec93a256aad
153128f6f7f8b5970783d7b035680277
Renders the valley SE tile.
{ float f = 0.00390625F; float f1 = 0.00390625F; Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par6), (double) this.zLevel, (double) ((float) (par3 + 0) * f), (double) ((float) (par4 + par6) * f1)); tessell...
0
c8377efce739bef5f8a318e4eeb8a744
f9effa51b63378a9e3c4fb6577ccb046
POST /plugins POST /plugins.json
class plgProjectsFiles extends \Hubzero\Plugin\Plugin protected function _save() { if (!$this->model->access('content')) { App::abort(403, Lang::txt('ALERTNOTAUTH')); } $json = Request::getInt('json', 0); $no_html = Request::getInt('no_html', 0); $view = Request::getString('view', 'view')...
0
0749845bff00691eaffb9220b52029cd
858aecde693f347a762e94dc294d8a3e
Renders a batch of sprites that share a texture
{ m_outputTexture.SetRenderTarget(); m_spriteQuad.SetConstants(GetConstantData()); var textureList = new IntPtr[MAX_TEXTURE_INSTANCES]; int textureCount = 0; int index = 0; int drawDataCount = 0; for (index = 0; index < m_drawDa...
1
ed7e079e63992f600876c4eb85730c0e
1f160de7af3947ee7aeebc4ee31dc6d0
Получить url только что загруженного изображения
public function getCachedUrl(ImageInterface $cachedImage);
0
0fda73fd7dbd853cfbae00c060b0deef
a59d45dae37c781465c2f7c633384a07
Add a web service to the list of web services.
public class WebApp extends org.netbeans.modules.schema2beans.BaseBean public int addService(org.netbeans.modules.j2ee.geronimo2.config.gen.AbstractServiceType value) { int positionOfNewItem = this.addValue(SERVICE, value); return positionOfNewItem; }
1
f60fcfbf2fb46899bf478477660f35f8
a9b2cd8a5e5ea2719eee685ede11a4a7
Returns the classname from a given file. At the moment it just uses the file name
def get_classname(headerfile): filename = os.path.basename(headerfile) return os.path.splitext(filename)[0]
1
9b68ece69d1c113ad1a5630d368bbed9
b47ac7fc9a754bd175d21e8314f711d7
GET: ClientContacts
{ var clientArea = db.ClientArea.Include(c => c.Client); return View(await clientArea.ToListAsync()); }
0
60d1cadc939e8cf8783cfcf2fff7ba28
6d74abeb21b202afd996ad342dda4c1e
Checks whether the given file exists or not in the solution directory
namespace ATP2016Project.Model class MyModel : IModel public bool solutionExist(string mazeName) { return m_mazesSolution.ContainsKey(mazeName.ToLower()); }
0
36c83decfb4742593080a6a2f5aa9b5f
94ed6d969ee75fa69d69deabfddb4037
Retrieves all active routes of an airport. Results are cached.
class DefaultController extends Controller protected function getAirportList() { $cache = new FilesystemAdapter(); $airportCache = $cache->getItem('airportcache.list'); if (!$airportCache->isHit()) { $client = $this->container->get('guzzle.avinor.client'); $response...
0
dd10ac6eb94e07c872efb4e1032fd371
0adfab45f5c9791741967c1acce1e41a
Returns the meta object for the containment reference '{@link it.xtypes.typesystem.EnvironmentDecrement#getRight <em>Right</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getRight();
1
2d29b1fbbdff5f5b918c6fc3be970131
f3d105678f2223ce2f529ce469a637ab
通过路径获取媒体的uri
if (AbStrUtil.isEmpty(uri.getAuthority())) { return null; } String[] projection = {MediaStore.Images.Media.DATA}; Cursor cursor = managedQuery(uri, projection, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cu...
0
e08db1532eca301716ac2385282ece71
450d292b9057add22161c6e886594173
判断网格dgv的列colname中的所有值是否都是日期型的,如果不是则返回false
namespace LSShipMis_Land.Common.Classes public class CommonOpt public bool IsDateTime(DataGridView dgv, string colname) { bool blnResult = true; DateTime dateValidate = new DateTime(); foreach (DataGridViewRow dgvRow in dgv.Rows) { string sCurC...
1
fce8b059b7c2c9110c290a55b783a4db
46d89ded5af004277d06bedb5e2a828e
Free-Free
sf_free_header *prevHead,*nextHead,*ptr; sf_footer *prevFoot,*nextFoot,*myFoot; ptr=ptrr -8; myFoot=(void*)ptr+(ptr->header.block_size<<4)-8; myFoot->alloc=1; myFoot->block_size=ptr->header.block_size; prevFoot=(void*)ptr-8; prevHead=(void*)prevFoot+8-(prevFoot->block_size<<4); nextHead=(void*)ptr+(ptr->header...
1
cecae34dccc1c860074cb643335c92d5
5ecd4ca93903fa9277a470ff85e60295
initialise components of an entity along with its sub-entities
var nextUniqueComponentIdentifier = 0; this.registerComponent = function(componentConstructor){ componentConstructor.prototype._componentIdentifier = nextUniqueComponentIdentifier++; for(var i=0; i<entities.length; ++i){ if(entities[i]){ entities[i]._components.push(n...
0
bb7637dbb564c73e4b911c495574bf31
59f90c9c23d294d7bd194f3d232adf64
IsD3DDebugRuntime
BOOL IsDdbgPresent() { return IsDebuggerPresent(); }
0
bfdf32237171607da72030daf4166e2b
8defdebe52d8bc2dab0a8308fe19d5fe
Adds the Actions and Filters for the UPF_Admin_Class
class UpStream_Admin public function __construct() { add_action('init', [$this, 'includes']); add_action('init', [$this, 'init'], 13); add_filter('admin_body_class', [$this, 'admin_body_class']); add_filter('ajax_query_attachments_args', [$this, 'filter_user_attachments'], 10, 1); ...
0
ea08c41d678f484f909b81e9b2992c3f
5671c97e578139f105d82e784f175621
обработка ответа ККТ
{ var str = new Buffer(data.length); var i = 0,j = 0; while(!((data[i] == 0x10) && (data[i+1] == 0x02))) { i++; } { i+=2; if((data[i] == 0x01) && (data[i+1] == 0x11)) { i+=2;j=0; var len = data[i]; i++; while(l...
1
117e5440def3499d3231677bb7bbcd2c
f4ce5e717f2df5c7e973ed3b7c5f0865
Saves the drop out data, if any changed
void saveIfChanged(boolean unload);
1
c0967fd53dc6bf10f59f7e9a348cc570
c4540875eb936ab16bc40142c34d9c04
Program entry pointer function @brief Entrypoint
int main() { RunProgram(); return 0; }
1
cd6994493e418b408829c1a6254cd118
341cf1a705312bda49bcbd43abfb3b07
Ajoute une porte à l'enclo.
if (this.doors.containsKey(direction)) { this.doors.replace(direction, door); } else { this.doors.put(direction, door); } }
1
a954900318cb653a3b671516a6453b3a
7fea9522e5f0a10b1352b631690c6318
保存BusinessRoleEstate数据
@Repository("BusinessRoleEstateDao") @Transactional public class BusinessRoleEstateDaoImpl implements BusinessRoleEstateDao public void save(final BusinessRoleEstate entity) throws DaoException { this.sqlSessionTemplate.insert("com.community.app.app.dao.BusinessRoleEstateDao.save",entity); }
1
29e6e4d88d3d0365ded9c35a0b6a51e0
64b93600d44c5c1a8e0bda184ecf3197
Fournir une url de retour pour l'inscription par OpenID pour finir l'inscription
class Compassites_Plugin_LoginUtility extends Zend_Controller_Plugin_Abstract public function buildOpenId($username) { $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); return Zend_OpenId::absoluteURL( $baseUrl. '/user/index/index/openid/'.str_replace('@', '-', $username)); }
1
efdd3f8fc59157f7ae5337363f7fa633
0a42f37275d27f431de43727dd707943
Set zero initial state (zero vector).
namespace Box2D.Common public void SetZero() { ex.SetZero(); ey.SetZero(); ez.SetZero(); }
1
24215305933b68d0f2e1a355a99d5923
b1f0037e6aee89e8dbde956ee3f12bab
메인카메라 움직임에따라 박스카메라가 움직임
[RequireComponent(typeof(Animator))] public class UnityChanController : MonoBehaviour void CameraMove(){ if(damagedNow == false){ if(skillNow == false){ if (Input.GetKey (KeyCode.A)) { if (Input.GetKey (KeyCode.W)== false && damagedNow==false) { animator.SetBool ("rotation_foot", true); } Yrota...
0
8a5d6b766d2e1c4bc02f4271d69c1854
faefd0326be31e37c7eccf791a391f67
Performs the listed transformation on a 4D input structure set.
def func3d(dim): return map_over_axis(dim, func2d, axis=2) def func4d(dim): return map_over_axis(dim, func3d, axis=0) output = func4d(data) return output
1
dd2722ac5ef724d237172d623adc6970
4a101fbd9e4cbaba04f9e052be52da44
`websocket_connection_factory` returns a generated MessageConnection class with the provided pubsub instance and authenticator class.
fabconnect = FabConnection( self.host, user=self.username, port=self.port, connect_kwargs={'password': self.password} ) return fabconnect
0
94cc0f91658e67ae23295e09709ffb44
50a2dd6045b05447a9055f34bbbf3596
Set the possible values for the primary key.
{ $keys = (array) $keys; $this->primaryKey = $keys; foreach ($this->columns as $column) { $column->isPrimaryKey = false; } foreach ($keys as $key) { if (isset($this->columns[$key])) { $this->columns[$key]->isPrimaryKey = true; ...
0
b49eca0117675194171e62b0aa9c1d32
eeb62afb66975f900cbec8656e6f40a5
一个长度为n的数组里,所有数字都在0~n-1范围内,数组中某些数字是重复的; 找出任意一个重复数字;
int[] num = new int[]{1, 9, 9, 5, 4, 5, 4, 1, 3, 7, 3}; findnumber(num); }
0
8b6187a89b2bbf55111ff5bd4c5af2f2
85b13543a0f041f030fa20ec94b0623c
Finds maximum value at each element between two lists.
def list_max(a, b): with np.errstate(invalid='ignore'): return np.max(consistent_dims(a, b), axis=0)
1
1e73246a842336e7bd5e3685c05cd038
96cf9f72ff86a5a5f3e85d5111a017c5
開始タグ適用
function init_tag() { $('.apply-part').removeClass('active'); }
0
2aa58fe472f4eb50c0e49c1f68282f23
2a987cb4e53d517bec18eaafa50c2eab
get the short (8-bit) acceleration in a given direction
double accel; if(val < 0x20) { accel = (double) (val & 0xFF) * 1.5 / 32; } else { accel = ((double)(val & 0xFF) - 64) * 1.5 / 32; } return accel; }
1
c6be9fe416fae701a842911d2422352f
9f264e3d1e336988edf6094f38316597
Enter a parse tree produced by VerexParser#par_block.
class PandoraVisitor(ParseTreeVisitor): # Visit a parse tree produced by PandoraParser#chunk. def visitParlist(self, ctx:PandoraParser.ParlistContext): return self.visitChildren(ctx)
0
a5c8e4527e310c1f87d259b964671a35
9d9a5ea3427f94e48ba0c8b10e78c352
Find substance by ID
class SubstanceController extends Controller public function viewS($id) { return view('s.view', [ 'id' => $id ]); }
0
a1a91ffd4f0e472f905e61acdc485c3d
aaa700a2aa97f0c93785727fdf9dd2bf
Levi-Civita symbol
a=Symbol('a') b=Symbol('b') c=Symbol('c') f=Symbol('f') g=Symbol('g') h=Symbol('h') p=Symbol('p') q=Symbol('q') r=Symbol('r') d=Symbol('d') return Matrix([a,b,c,f,g,h,p,q,r,d])
0
efa06b5f2d09688c32264e581dca4661
495d99ddacb8754df9007cdf68b80d64
得到当前合适的列车编号
public String getTrainCode(Train Train) ;
1
170d63ff00774743b112bf5fce8b1ffb
d8ed467cc5217b3c3b2e20027c9ea4c9
노트 내용에 포커스 가지 않도록 하는 메소드
public class PostCommentActivity extends BaseActivity public View getView(final int position) public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { postContentEt = picDescriptionEt; } }
0
7842fbe788ef1c3824fc79db001925b7
1c2c40971b249382aa61ad729897164d
显示等待设备返回结果
u8 waitResponse(void) { u32 count = 0; u8 result = 0; fSlaveRes = false; while((!fSlaveRes) && count < 0xFFFFF) { count ++; } if(count >= 0xFFFFF) { createLog(MAIN_MODULE,ERROR_LOG,"Display not response!"); result = 1; } else { fSlaveRes = false; switch(slaveResValue) { case DPL_RES_OK: ...
1
796266aba859166d1d988a8871129bbd
673daf0b7e735bcad768a5092cf1be1a
Testing concat with differing lengths.
def test_concat(delete=True): df1 = make_df() df2 = pd.DataFrame([[1, 2, 3, 4, 'hi', 'there']], columns=df1.columns) job = fyrd.Job(merge_two, (df1, df2)).submit() df = job.get(cleanup=delete, delete_outfiles=delete) assert len(df) == 101
1
03056601c2f36b31bee27e747ac54873
2e1e83e792966ce0119418ca59acb2ec
スキルフィルタ用optionを生成します。
class FilterMakeCommand extends GeneratorCommand protected function getOptions() { return [ ]; }
0
7a090656d85bfb07611a28ec9b1af0ac
f50863a28dac7d940ed1e49460a0a7b5
Obtain the integer number of indices in a feature vector produced from a given HOGDescriptor
namespace fe_gradient int featureCount() { return 2*(fe_haralick::featureCount() + fe_histogram::featureCount()); }
0
a896ba37271e2de7a58420bc00101d4d
e238e7c5110bbba7a989b06bc41aad4e
MvoDto の遅延初期化属性の値を取得します.
public class Rcv0003s0102Entity implements BaseEntity public String getDelayedStartDateClass() { return delayedStartDateClass; }
0
df36e83af8ad544d660e01ef379e9a10
47c3b75f54f421b7e6441d8427078060
返回用户中心退出地址
String getLogoutUrl(HttpServletRequest request);
1
7c0bb392e352201b92968d2c560e19bc
f809d91cc225e6f8676176b617ac184a
Handles event when route is changed.
namespace ClimbersHangout.UI.Common.Views public class RouteSetupView : SKCanvasView private static void OnRouteChanged(BindableObject bindable, object oldvalue, object newvalue) { RouteSetupView view = ((RouteSetupView)bindable); view.InitImage(); view.InvalidateSurface(); }
1
89fb1111f290cbc8064fbb97e4c7dc4f
564788e35f041a176491176ce1c15f9a
删除外包单
{ if(!$id) $id = (int)$_GET['id']; if(!$id) $this -> success("数据访问错误,请重试。", 3); $DB_Order = D('Split'); $data = $DB_Order -> find("`id`='{$id}'"); $can_do = $this -> get('can_do'); if(!($data['uid'] == Session::get('uid') && $data['audit'] <= 0) && !isset($can_do[$thi...
1
71b4f007b5effe7c9864b804a822632c
c77b23ad910dc227971626afc52a5cda
客户动态添加
return fetchWithToken({ url: api.customerAdd, methods: 'get', params: data }, token) }
0
04f3fb5a41c35215fdfcab5d37115125
f88b9dcb2ca30808f45dd293420abb9d
Generate Entities from the id list.
ents = [] for e in entities: ents.append(create_ent(name=e.decode('utf-8'))) return ents
0
68c8b4257a00d51765122551c51d176f
c682b7466b22f4a41eb0d6a2664dcdf9
function that takes a picture and returns a tuple of scaled and cropped versions
imageArray = [] loadpath = os.path.join(scriptPath, 'haarcascade_frontalface_alt.xml') faceCascade = cv.Load(loadpath) cv_im=pil2cvGrey(pil_im) faces=DetectFace(cv_im,faceCascade) if faces: print str(len(faces)) + " faces found" for face in faces: print face croppedImage=imgCrop(pil_im, face[0],boxScal...
0
26fb5a41cbc4d1e15132b83af42e8d9d
fe86e091704ae03b20502b15ba0c3724
This method calls the procedure to commit cellular configuration values to flash.
void StoreToFlash() { s32 sReturn = -1; g_current_fix_32.lat_32 = 0x00; g_current_fix_32.long_32 = 0x00; sReturn = FlashSubscribe((ascii *)g_configStructHandle, 1); sReturn = FlashWrite((ascii *)g_configStructHandle, FLASH_ID, sizeof (CONFIG), (u8 *)(&g_config)); sReturn = FlashSubscribe((ascii *)g_fencesHandle, ...
1
0576d3eb6e2700c46ec4f6db4a7eff3d
1ec762a2d2c1420e79602ce062915771
Returns the mark of the winner if there' one.
class Board: def get_winning_mark(self) -> str: winning_cells = self._get_winning_cells() winning_mark = min( winning_cells.present_marks ) return winning_mark
1
6d6689f83780339aa4ba3a9c880dbe1c
00156380a07944d8a0533efbf9c03e1c
Gets the "INSTALL_ST_CATG_A" attribute
{ synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(INSTALLSTCATGA$98); ...
1
9f8216391271aaf955164cc34786c547
d10e684eb7d49d9caa70dc788e50692a
This field represents space used by quota metafiles in bytes.
class QuotaInfo(NetAppObject): def files_used(self): return self._files_used
0
2c83920955dab2b66e4933ef414aced9
8a22cb5ea4d9e93c46dcedf2aaeded77
Returns all number keys of a number-enum.
class Utils enumToArray(enumm: any): any[] { return Object.values(enumm) .filter(k => isNaN(Number(k)) ); }
0
c8bd0a67dbe45c006863f5938127351b
c147157f3ea52d531aa6f68047e3ab0a
根据v节点,来更新堆中数据
void decreaseKey(struct Min_Heap* mh, int v, int dis){ int i = mh->pos[v]; mh->array[i]->dis = dis; while(i && mh->array[i]->dis < mh->array[(i-1)/2]->dis){ mh->pos[mh->array[i]->v] = (i-1)/2; mh->pos[mh->array[(i-1)/2]->v] = i; swapNode(&mh->array[i], &mh->array[(i-1)/2]); ...
1
395dd448c24893ee9a02acf8dce18036
15227ea8261bb5bf0ec6fa90bf711e76
计算100!
fact = n -> n <= 0 ? 1 : n * fact.call(n - 1); for (int i = 0; i <= 10; i++) { System.out.println(fact.call(i)); } }
0
bd5da5aac1b4907752b55998fc1a659e
80b562030b3f40f0099acd3d636f5e32
H2 Raw Signal in ticks
{ uint8_t rBuf[3]; uint8_t wBuf[] = {ENS210_REG_H_VAL}; int status; assert(hraw != NULL); status = I2C_Read(ENS210_I2C_SLAVE_ADDRESS, wBuf, sizeof wBuf, rBuf, sizeof rBuf); *hraw = ((uint32_t)rBuf[2]) << 16 | ((uint32_t)rBuf[1]) << 8 | ((uint32_t)rBuf[0]) << 0; return status; }
1
7c624d0c3d8bfe9578fbe696c82b9fc7
e2a62f9b0a1a7b72f97e672ca1712f3f
kitchen_view: renders the page for the kitchen to view while preparing orders
def kitchen_index(): pass
0
8d2b55b59572dec88b511e8f6b2be435
f537d067ada48ab7a611ef5622ebc945
Prevent multiple clicks of submit buttons.
$('.disableOnClick').on('click', (function() { const clickedItems = {}; return function() { if (clickedItems[this]) return false; clickedItems[this] = true; $(this).addClass('disabled'); return true; }; }())); }
1
ff575a41336b828b1a01b0c3a1580567
7563363a8364d8c8bf1c55d3bba14685
# Test if the cache is null
$expected = null; return $this->assert($result === null, $message, compact('expected', 'result')); }
1
e5a06dc9d7e7539886945874539c17ed
b7d37e03c1114d5c282b8bdacc6249b8
Returns the index in the alphabet (one based)
int getIndex(char c) { return c - 'a'; }
0
3bc2236af677cbf1f300b46ec5b798c9
0f8ff89cca6ef0de519e20ee7eb3af35
根据用户id查询此用户全部信息并返回全部信息
@Transactional(isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED) public UserMember getAll(Long id) { UserMember userMember = userMemberMapper.selectAllByMemberId(id); return userMember; }
1
07015e7d73cdc4cc09f10f408b0f10e0
1b8366a2ed95ef31928ec8ab057e84d7
Обнуляет цены в заказе
public class DBHandler implements DBHandlerInterface @Override public int setNullCost(int orderId) throws SQLException { int res; try (PreparedStatement pstmt = connection.prepareStatement(SET_NULL_COST)) { pstmt.setInt(1, orderId); res = pstmt.executeUpdate(); } ...
1
5ff8387751227f7172005754892eacf0
152414872a08a0b78a1298a929550fae
Atomically gets the number of permits that are available to hand out.
public class OSSemaphore extends OS public int numAvailablePermits() { verifySet(); return semaphore.availablePermits(); }
1
16ed0cd3f925577a1ac345f85b76665a
aa878c1e0f7c60428d4e5751e85bfad1
Passes the {@code Quad} field to the specified {@link java.util.function.Consumer Consumer}.
void accept(T t, U u, V v);
0
b3bebaca9a79dc427cb7cd15780b9dbc
0d16d45584daf52bf0898993fc9fd712
Serialises a protobuf object as json
json_dict = {} for fieldDesc, fieldVal in pb_obj.ListFields(): if fieldDesc.type == fieldDesc.TYPE_MESSAGE: if fieldDesc.label == fieldDesc.LABEL_REPEATED: json_dict[fieldDesc.name] = [] for val in fieldVal: json_dict[fieldDesc.name].append...
1
6cb8af06be69102307ffc8784c8a88db
11e8db696fa6c1dcc0fecb2bacc7b084
将期权合约列表按到期时间升序排序
return list.stream().sorted((x, y) -> { if (x.get("opTime") != null && y.get("opTime") != null) { Date xDate = DateUtil.parseDate(String.valueOf(x.get("opTime")), DateUtil.FORMAT_YYYY_MM_DD_H_HMMSS); Date yDate = DateUtil.parseDate(String.valueOf(y.get("opTime")), Dat...
1
54fb0d556d1b07f013b4d4b35ee4740b
fdf9f1ac8c5d0e6e15ede7ede4f21865
Check edge cases regarding safety when fixing stdin.
for x in range(1, 8): input_token = 'x' * x expected = '•' * x self.assertEqual(Environment.make_log_safe(input_token), expected)
0
56c0c4dd219cd900f772fde0392c4287
e4d5b70e2f52c694f1aecf488b3cade9
\brief Applies the pre-computed projection matrix on a 3D point in Euclidean coordinates.
rf_public rf_vec3 rf_unproject(rf_vec3 source, rf_mat proj, rf_mat view) { rf_vec3 result = {0.0f, 0.0f, 0.0f}; rf_mat mat_viewProj = rf_mat_mul(view, proj); mat_viewProj = rf_mat_invert(mat_viewProj); rf_quaternion quat = {source.x, source.y, source.z, 1.0f}; quat = rf_quaternion_transform(quat, ma...
0
900c587e01684f9e724b0426023b8f21
883d0e2ae803ec1d14ee3977bb2da5e2
Determines whether a fixup segment should end based on the provided source and destination text-formatting.
{ return null != target && null != endTransform; }
0
40d08fb09201eafab19818310535c9a4
d30f4b62822676cc0f9c9b385799c639
根据周数,获取开始日期、结束日期 java8
Map<String,String> map = new HashMap(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = Calendar.getInstance(); cal.setFirstDayOfWeek(Calendar.MONDAY); int dayWeek = cal.get(Calendar.DAY_OF_WEEK); if(dayWeek==1){ dayWeek = 8; ...
0
361d75fa9ede7374ad48b91fbae27834
285ea5d700271c676dfc96c8b7c4334c
>>出国生子文章详情页
public ModelAndView good_article_page(){ ModelAndView model = new ModelAndView("/study/good_article_more"); return model; }
0
d68ec47df1f1b16b7a56f4467ad87dee
85b95d884dd3255efdfb091cbfd1c821
Funcion que recibe el id de una Unidad de Matricula y genera un dialog para crear un nuevo módulo asociado a dicha Unidad.
class muduloRfidConroller extends Controller public function registrarmoduloRFID(){ return view('administracion.modulorfid.modalregistrarmodulo'); }
0
270acd90453310348a00ec086acea148
7f61448ad6da3ef0f9cb03f40c5be655
https://github.com/miguelgrinberg/flack/blob/master/flack/events.py
cases like (1)
0
156f40117a15fe81ec5f63fd1afd55cd
9bb70b5ee761acbee23a6f2336bcf2f6
login page: contains login form for users. If user was redirected to login by AclManager the user is redirected back to the page that was requested originally, if user is already logged in redirects them to account/index page. Writes login attemps to a log file.
def login(request): base = base_config(request) if request.method == 'POST': form = LoginForm(request.POST or None) if form is not None: username = request.POST.get('username') password = request.POST.get('password') user = authenticate(username=username, pass...
0
6c23d07f4131b0d993336d9c66f8311c
a66d321b1ebbf69e015e96358d0d55b7
Samples the y location for a given object
anchor_pos, anchor_lb, anchor_ub, other_obj_size): xs, ys, zs = [(other_obj_size[i]+0.01)/2.0 for i in range(3)] sample_region_x = (anchor_lb[0]-0.06, anchor_ub[0]+0.06) sample_region_y = (anchor_lb[1]-0.06, anchor_ub[1]+0.06) sample_region_z = (anchor_lb[2], anchor_ub[2]+ zs + 0...
1
19d877a53ea731c4ac08349fd62694de
5436aa942b58d01f02b8ffe72b3f1de8
Events when in "ready-to-seek" mode are ignored, except those which influence the seek mode itself -- these are handled further up the inheritance hierarchy.
medium_seek(uint32 pos, struct _smedium_s *ps) REENTRANT { UNREFERENCED_PARAMETER(ps); UNREFERENCED_PARAMETER(pos); return FALSE; }
0
881280818f559c8c2100ca10945af31e
e788a44160e5ebe037e38724de7e77ba
隐藏用户密码
class TestSeq(QMainWindow): def change_user(self): global user user.le_pwd.setText('') user.show()
0
39276caaced75e68f7a34711e23c6627
6c7940a6af3974f82a24d0ccddcc4f0a
数独二维数组转字符串
result = numpy.zeros(shape=(9, 9), dtype=int) for row in range(9): result[row] = [i.value for i in self._grid if (i.row == row)] return str(result)
1
f0dcca759c5e8378f96fe2ed8e210d3e
fc5dc494cac4289aace8457768d6a9c4
파일 경로로부터 비트맵 생성
try { FileInputStream fis = new FileInputStream(path); return BitmapFactory.decodeStream(fis); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } }
1
6a9db63609b6173d39bc3f65635494e9
54be2019a9340b414b87abcc1a6f8e76
查询公司简介信息
{ $this->addResult(self::RS_SUCCESS, 'json'); $where = "1=1"; $content = System_Model_Manage::instance()->fetchByWhere($where); $data['content'] = $content[0]; $this->setData('data', $data); $this->addResult(self::RS_SUCCESS, 'php', 'company.introduce'); retur...
1
3c49cd0d61ad8f33902bf363a65e7d70
532939fcaa5cee78187b51cb6de7951f
随机生成结点数为n的二叉树
srand(time(0)); int cnt = 1; unsigned head = 0, rear = 0; BinaryTreeNode *queue[100]; BinaryTreeNode *new = (BinaryTreeNode *) malloc(sizeof(BinaryTreeNode)); new->left = new->right = null; new->data = cnt; queue[head] = new; rear++; while (cnt < n) { if (queue[head]->lef...
0
5e32234bdae0f163fe4c8eb3be1f18f3
c325d962d3684ef0dd9fa516ae73dc58
Extract content of an OpenXML file.
if ( ! extension_loaded('zip') ) return ''; if ( ! file_exists($filename) ) return ''; try { $doc = Zend_Search_Lucene_Document_Xlsx::loadXlsxFile( $filename, true ); } catch (Exception $e) { return ''; } ...
1
bdcf7ea7a76c4811007aa9cca948fd57
e751547afe1aa523bb0ac7e3b7c6ef79
true if the channel has been created on the bounceproxy
class CUserMsg_SayTextChannel extends \DrSlump\Protobuf\Message public function hasChannel(){ return $this->_has(2); }
0
a44b04a8d1e7b614fec761dd73863580
6b4109b9e516df70ea20a1a19f8ee872
Adds lava to the floor and deforms it as necessary.
public class LavaSetup : MonoBehaviour void Update () { }
0
7868066207e0d8fdc6193a865d67f991
c720179fe38f661c5a96fc3f0e4303c5
The main Q-learning method.
public class Environment public void runQLearning() { Random random = new Random(); for (int i = 0; i < num_iterations; i++) { State state = states.get(random.nextInt(states.size())); while (!state.isGoalState()) { Action action; if (random.nextDouble() > epsilon) { action = state.get...
1
64f4c41de77f3f751dfda9dd50bd972f
ed0f012acae1b947258f41c7cdc80056
#calculate measure of "tailedness" of probability dist. of a random variable
Sum<-function(U, CovS){ if (all(abs(sum(U))<1e-20)) pTsum<-1 else{ a<-rep(1, length(U)) Tsum<- sum(U)/(sqrt(as.numeric(t(a) %*% CovS %*% (a)))) pTsum <- as.numeric( 1-pchisq(Tsum^2, 1) ) } pTsum }
0
ce7d4d7d1de914e0be53110ad16463ae
4667892dc6d96daa79a6f810b47ff601
call mem_reset_brk.
static void brk_init(void) { intr_setintr(INTR_BRK, brk_intr); }
0