query_id
string
corpus_id
string
query
string
code
string
label
int64
67fb8fabc09df10acbdceee7b2aceede
19ef33901bb976336335958ec581a6c0
Visualiza todos los toques en pantalla y su posición
{ foreach(Touch touch in Input.touches) { Rect rect = new Rect(touch.position.x, Screen.height - touch.position.y, cursorSize, cursorSize); GUI.DrawTexture(rect, cursorTexture); } }
1
6aab8ab3a805733fee3bd399a8469923
b85f93a9f2ce17455f0f72cefa12bc9a
通过资产备注查询资产
{ return $this->search(function($item, $key) use ($id){ if($item['RemarkName'] === $id){ return true; } }); }
1
b87ec4148f212f2c001b47cb6825ed47
ec50f5fa22e509393993c96dabff5004
Fills all holes of every blob in a binary image. For more info see the following link: https://www.learnopencv.com/filling-holes-in-an-image-using-opencv-python-c/
def CreateTestingSet(filepath, filename): def FillHoles(binary_image): im_floodfill = binary_image.copy() h, w = binary_image.shape[:2] mask = np.zeros((h+2, w+2), np.uint8) cv2.floodFill(im_floodfill, mask, (0,0), 255); im_floodfill_inv = cv2.bitwise_not(im_floodfill) bi...
1
e1f02621669ff36ed74cdf955e6f522f
7b440769b6e79d7dbffaccc7bcca51e3
提交信息到服务器,如果用户选择了活动封面,则先提交封面
function saveEvent() { var titleimg=""; var img="" ; if(session_loginId=="" || session_loginId==null) { alert("创建活动请先登录!") ; return; } var str1 = $("input[name=start]").val(); $("input[name=opendate1]").val(desDate(str1)); var str2 = $("input[name=end]").val(); $("input[name=enddate1]").val(desDat...
1
5aaee2aba28485a849790f2e030f0c36
f4653a09fc349d5c5d57587767e07e21
@brief open selected USB device
{ DeviceHandle = hid_open(MY_VID, MY_PID, NULL); if(DeviceHandle == NULL) { USBConnected = 0; return -1; } USBConnected = 1; return 0; }
1
73df85f0da87e81e612298bf5ca4edc4
17b4c3a1d33a783d6db5be947dad03cb
画面の左上の位置座標を返す
namespace PlanetTerror.Util public static class FrameworkElementExtMethod public static Point GetLeftTop(this FrameworkElement e) { return new Point(Canvas.GetLeft(e), Canvas.GetTop(e)); }
1
07a29f9e4f44f6ccaaba156da9195af2
aa7d1e189becb48ce6a58633d34acea0
リソースの延長処理
{ var url = string.Format("https://live2.nicovideo.jp/watch/{0}/extension", NicoliveProgramId); using var uwr = UnityWebRequest.Post(url, "POST"); var data = Encoding.UTF8.GetBytes("{\"minutes\":" + minutes + "}"); uwr.uploadHandler = new UploadHandlerRaw(data); ...
1
07d8eb8c623b7ed16a2d171f4c2e69f8
9313531dea39740d9285654278e0164f
查找指定课程的所有课表
TeachplanNode findTeachPlanList(String courseId);
1
1c8e1642b219e00e51c307be74e20ba0
e97349fc4f323a02490f48c0c4d0176f
Accion para redireccionar a la vista para agragar una nueva pelicula
class PeliculaController extends Controller public function create() { return view('dashboard.pelicula.create'); }
1
422b459b04c3c67227111af5d0ff49d9
41e7762a176347f52612b8eab95c04ce
向映射表项中增加新的映射对,如果IP对应表项已存在,则对mac地址和时间戳进行更新
void update_arp_table(uint32_t ip, u_char mac[]) { FILE *fp = fopen("arp_table.txt", "a"); if(fp == NULL) { printf("Error...\n"); exit(1); } struct in_addr ip_addr; ip_addr.s_addr = ntohl(ip); char string_mac[18]; arp_table = (struct arp_entry*)realloc(arp_table, (arp_table_len + 6) * sizeof(struct a...
0
05870f774833a5f2cfd4ef307ccb3859
895f259766c2a15dbf6bc7e4c41d6a26
获取用户及订单(读取来自不同的数据库)
UserAndOrderInfoDTO selectUserAndOrderInfoTwo(Integer userId);
1
472f5ba90ac4e419c1d05844341ba591
4b3dc033259ba7d065f76dcd2c5bf917
This function gets the size of the page in the file.
func Getpagesize() int
0
f392a6aef21c71cdc17350ceba4846f4
f7396ca62a0a4e0c7080848ea263f130
Подсчитывает среднюю оценку конкретного пользователя в конкретном жанре фильмов
movie_info = caches[0] user_info = caches[1] avg_movie_rating = get_movie_rating(movie_info, movie_id) avg_customer_rating = get_customer_rating(user_info, customer_id) movie_decade = movie_info[movie_id]['premiere'] - (movie_info[movie_id]['premiere'] % 10) decade_info = user_info[customer_id][...
0
3acde4d039be9a082d2c2f8cf5da39c9
4e3df204d66b55034bf6bbb520b8dfd8
Đọc danh sách các câu hỏi tính toán một phép toán
{ $ketQuaTachCau = explode(".", $tuKhoa); foreach($ketQuaTachCau as $key => $value) { echo ("<br/>".$value); } echo '<br/>'.'so cau la'.count($ketQuaTachCau); }
0
ca0612ad11227014c6d12358a9ba713e
6a3541a7ec0ca4904aefe1dd4eac3ed5
The optimization passes we use are somewhat ad-hoc, but were found to provide a nice balance of performance and compilation times. We use an aggressive function inlining pass followed by a CFG simplification pass that should clean up work done during earlier inlining and DCE work.
void TargetPassConfig::addMachineLateOptimization() { addPass(&MachineLateInstrsCleanupID); addPass(&BranchFolderPassID); if (!TM->requiresStructuredCFG()) addPass(&TailDuplicateID); addPass(&MachineCopyPropagationID); }
0
783dd07869820eaa47563d0aae53b1f6
46a6b56247abbcfe67288d392ad5241c
清理已完成的子进程
class Daemon protected function cleanUpFinishedWorkers() { do { $status = 0; $pid = pcntl_waitpid(-1, $status, WNOHANG); if ($pid <= 0) { break; } unset($this->pids[array_search($pid, $this->pids)]); } while (true); }
1
3b79715f6a418ecbcd6de1d7a349fa36
737cf7d4bd51a18b86800cd997ff4490
要素xを含む集合の要素数を求める
int UnionFindTree::size(int x) { return sizes[find(x)]; }
1
9abf72db43f7304d427e758349cc8131
d51303f19a886456fc66a676b6471449
Get ListeleCokluResult value
{ try { if (Idx == 2) { try { string[] pureStr = doc.DocumentNode.SelectSingleNode(xpath).InnerText.Split(','); listItems[Idx] = pureStr[1].TrimStart(); ...
0
d85bdc9a3d877eaa8cd987182964a35d
963458f2bf095cab68de3b2cc8fc0fd2
获取插入参数格式(?,?...)
class Db public static function strIN(array $params) { return str_repeat('?,', count($params) - 1) . '?'; }
1
bf3bf49fdd75af336c47c200d8911f75
8eb6ca8e2bbfd432094f56b97c3464eb
失败截图装饰器
def decorator(func): @functools.wraps(func) def wrapper(*args, **kwargs): browser_driver = kwargs.get('browser') func_name = func.__name__ start_time = datetime.datetime.now() LOGGER.debug(f'用例({func_name})执行时间:{start_time}') try: ...
1
ac253767a6f7fdafaa0edcd37b37a5f7
b5190e283f57f41c8fab1ca5be97b8bb
A transaction processor for CreateMembershipOrder
function createFromTransaction(transactionId: string) { return async (repos: { action: ActionRepo; order: OrderRepo; transaction: TransactionRepo; task: TaskRepo; }) => { const transaction = await repos.transaction.findById(factory.transactionType.PlaceOrder, transactionI...
0
5c58409f83adda4a340fc9b1b4cc57f7
52b7955a4e63642989ada5aa57797c5e
Used to update the discriminator
self.opt_d.zero_grad() y_real = self.d_model(real_data) err_real = self.loss_func(y_real, torch.ones_like(y_real)) y_fake = self.d_model(fake_data) err_fake = self.loss_func(y_fake, torch.zeros_like(y_real)) err_d = err_fake + err_real err_d.backward() sel...
1
eb42c81e600c6019b7e6851645fd94f2
235c78159f48ae92db1e8602d8939e6f
判断该主键是否存在
@SpringBootTest(classes = StartApplication.class) @RunWith(SpringRunner.class) public class TKMybatisApplicationTests @Test public void testExistsWithPrimaryKey() { Integer userId = 13; boolean b = userMapper.existsWithPrimaryKey(userId); System.out.println(b); }
1
59cc8483d5d0486fc5f36178b4c90229
4ca428446d60fd37f508ba70fc5ddf6c
isObject - Returns `true` if `input` is an Object and not an Array, or `false` if otherwise.
function isObject(input) { return input instanceof Object && input.constructor === Object; }
0
a29f4091f155b8aafd91baa7cdb39427
93d2f7afefc29bd656eed759488925ff
Obtiene el datasource a la BD Siga Consulta o Transaccional.
public DataSource get() { LOGGER.info(MessageCodes.DG010, dbName, SimpleDataSource.class); if (transactionBinding == TransactionBinding.NONE) { return dataSource; } return new LocalTransactionalDataSource(dataSource); }
1
5cae528d815e0560b96212cce18a0b43
4aec93ffb27084276fb81a258ef778ce
Calculate the difference between the fit function at time points t and given values target_vals
class FitMPFit(FitLc): def best_curves_gp(self, curves_m, curves_o, dt0=None, dm0=None, Npoints=None, At=0., err_mdl=0.): def least_sq(p, fjac): total = [] for lc_m in curves_m: lc_o = curves_o.get(lc_m.Band.Name) lc_o.tshift = dt_init[l...
1
87410b5211f1b6321810557f33441cdb
b3794489928a7a7835a5f04e8c256083
Constructor method for ExternalRememberMeOptOutReq
self._reqfile = None self._keyfile = None self._fipskeyname = None self._keyform = None self._pempassphrase = None self._countryname = None self._statename = None self._organizationname = None self._organizationunitname = None self._localityname = None self._commonname = None self._emailaddress ...
0
1c4b2c2eabf4dd01fb3ad6ccf710e8e5
69580fccef6dbcde6d52de3d36bf0134
Returns the Oracle Text where clause with bind variable.
public class Validator public String getWhere () { return Joiner.on(" : ").join(_wheres); }
0
cb3304677abe970b481eb8d8ba94ec4f
506ef0bf9e94ca24d7372a31606b0954
Replace newline characters with spaces
void replaceNewLine(char buffer[]){ int len = strlen(buffer); for (int i = 0; i < len; i++){ if(buffer[i] == '\n') buffer[i] = ' '; } }
1
ce6ae00e216ad32a3bde2470eea51d09
0729573120334855dcbfaafef9852b26
Get/Set the Tx Attenuator state for the associated channel
class adar1000(attribute, context_manager): def ch2_tx_gain(self): return self._get_iio_attr("voltage1", "hardwaregain", True, self._ctrl)
0
ffbc0fe944e25eaee19c114383a869c9
2013a7662d6d2620f8f6bc9ad858b3ed
Sets the option A Allowance
@XmlRootElement(namespace ="http://bp.comverse.com/data") @XmlAccessorType (XmlAccessType.PROPERTY) public class ContractDiscountObjectData extends BaseObjectData implements Serializable public boolean issetAllowAccount () { return this._AllowAccountSet; }
0
bb393ae7c47db6ccb29b387e804fd82e
b2ea8b1815a236dc5ccc8a7f2a7a2a18
是否需要平仓
realbody_rate = abs(data["close_price"] - data["open_price"] ) / (data["high_price"]-data["low_price"]) increase_rate = data["close_price"] / data["open_price"] - 1 if side == "buy": if data["close_price"] < data["open_price"]: return False elif increase_rate < 0.0003: return False e...
0
411f63e5acd324d7f1e28a2eb6caf1a0
cff67687b0642c2e503bc71420880d84
Write the contents of the surface proxy to a PNG. Returns true if successful.
class Image(object): def save(self, filename=None): return self.surface.write_to_png(filename)
0
9e1312dd1cdfec997a03cb8b80bc2ad5
15b3c2177ca6329f3b2acb0873321849
Remove precompiled LESS files
{ $jobFiles = glob($this->getLocation() . '*.js'); foreach ($jobFiles as $file) { unlink($file); } }
0
38291cff7b3cc931f69d58dcc145bb59
08263abc099e153e309f8d0f2c775aff
Setup the Dusk environment.
abstract class TestCase extends \Orchestra\Testbench\TestCase protected function getEnvironmentSetUp($app) { $app->register(JsonApiServiceProvider::class); $app['config']->set('database.default', 'testbench'); $app['config']->set('database.connections.testbench', [ 'driver' => ...
0
b0e51f49d55fafce85806f38d160581c
f213c79493a4b579f297f482b208bb61
Enable share autosubscribe.
class VerseSceneData(vrsent.VerseNode): def _auto_subscribe(self): try: auto_subscribe = self._autosubscribe except AttributeError: auto_subscribe = False return auto_subscribe
0
0e90c5f11f10b6130ba9a97a563df95a
88b2b7be59218982ad769b86d6bdef2d
需要反复把已排序元素逐步向后挪位,为最新元素提供插入空间。
public class InsertionSortDemo02 public static void sort(int[] arr) { if (arr.length <= 1) return; for (int i = 1; i < arr.length; i++) { int val = arr[i]; int j = i - 1; for (; j >= 0; j--) { if (arr[j] > val) { arr[j + 1] = arr[j]...
1
2304173c04c2d11440a7f00e362aad3a
ba120157940bd89ea0b84b99faf076f4
Get the type of key a database column has.
{ static $typeMap = [ 'smallint' => 'integer', 'integer' => 'integer', 'bigint' => 'integer', 'boolean' => 'boolean', 'float' => 'double', 'double' => 'double', 'binary' => 'resource', ]; if (isset($typeMap[$...
1
8914668d7b2babab67d9d251e9e1384c
df61a621091f9e69559c8478593e7d81
按文件名解锁录像文件
{ string vFileName = strfilepath; if (!System.IO.File.Exists(vFileName)) { return -1; } IntPtr vHandle = _lopen(vFileName, OF_READWRITE | OF_SHARE_DENY_NONE); if (vHandle == HFILE_ERROR) { ...
0
23a49f4d707b00e685811c302daae494
e162769778f1728f53f7dd7bb1733fa9
Get the total time of the video in seconds :attr:`shapeflow.api._VideoAnalyzerDispatcher.get_total_time`
class ObjectDetectionReader(BaseReader): def get_total(self):
0
b58c339fca3f99c549b2f154ae4e836d
85e0754658e5314078e23114bad9fa27
Get logged admin details
class WHMCS_Misc extends WHMCS_Api public static function get_admin_details() { return self::send_request(array('action' => 'getadmindetails')); }
1
7727b9ef650e2d7db114e73d5c4824d6
0b77d5baf69547b81bedfac717b6bcd4
of bit changes required to convert one number to the other
class FlipBits static int bitSwapRequired(int a, int b) { int x = (a ^ b); int res = 0; while (x) { ++res; x = (x - 1) & x; } return res; }
1
51ff33685b62c4604f0d5056a6c4fe0d
2bbdf8421129bb64bdb85ba385a4d9dd
Create server capability.
namespace Microsoft.Protocols.TestSuites.Rdpbcgr Collection<ITsCapsSet> GenerateServerCapSet();
1
e0d6ab4c98fce42d6ce11a5df8c7e920
f09e3cc9aeb7b3c76c224590c816732a
Append features to an existing table. A single batchInsert request can create: - Up to 50 features. - A combined total of 10 000 vertices. Feature limits are documented in the Supported data formats and limits article of the Google Maps Engine help center. Note that free and paid accounts have different limits. For ...
com.google.cloud.aiplatform.v1beta1.BatchCreateFeaturesRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getBatchCreateFeaturesMethod(), getCallOptions(), request); }
0
48605749e73fe06223f76bf006f072ec
b9cc9d71b409e836a0a717c9b230786c
Initializes contacts' roles. After deduplication contact may have several roles.
params = create_fields(contact, **kwargs) return create_association( ContactRole, contact=contact, role=role, **params)
1
7613835079dd3793ebf36ebd6da39035
adceaae0061df7953d381fad70a3c1c4
Test that we don't create entity id that are already registered.
await setup_platform(hass, LOCK_DOMAIN) entity_registry = er.async_get(hass) entry = entity_registry.async_get(DEVICE_ID) assert entry.unique_id == "51cab3b545d2o34ed7fz02731bda5324"
1
60b9e6dbcc2e5406df61d36238880e76
3230db541a9ecc6747ddbc60ecc88a1c
Runs freesurfer recon-all for surface reconstruction.
def run_fs_if_not_available(bids_dir, freesurfer_dir, subject_label, license_key, n_cpus, sessions=[], skip_missing=False): freesurfer_subjects = [] if sessions: for session_label in sessions: freesurfer_subjects.append("sub-{sub}_ses-{ses}".format(sub=subject_label, ses=session_label)) ...
1
afd25dd186c34b1c08b1d2a14df4305b
808222b8e22bd8d03fa8da20314f6c94
Add hypernym to graph
hypernym_list = [] synset = wn.synsets(term) if len(synset)==0: pass else: synset = synset[0] hypernym_list = synset.hypernym_paths() while type(hypernym_list[0])==list: hypernym_list = hypernym_list[0] hypernym_list = return_hypernym_codes(hypernym_li...
0
b52169b59286a20e1780a44e849fb96a
7a66f29a68ba8991adbd316c9b9689db
make the dot a little bigger when the mouse is over it
public class OXQuizTile : MonoBehaviour void OnMouseOver() { renderer.material.color = new Color(2f, 2f, 2f); }
0
efb8d0cf932357f26f5cb64e788fbf51
99a4d67b93289a59931d911e93a6c88c
喂养宠物
launchUI( { val result = withContext(Dispatchers.IO){ remoteRepo.feedAnimals(map) } result.checkSuccess { toast("喂养成功") val map = HashMap<String,Any>() ...
1
fbdafebe6de71c34698a8e10174404b8
acb861510ec29827764d0e865c8e3179
main function for drawing the Binary Heap Tree onto the canvas.
int offset = starIncrease*2*numOfTreeCombinations+1; for (int i = 0; i < treeCombinations.size(); i++) { treeCombinations.get(i).display(offset); offset -= whiteSpaceDecrease; } offset += whiteSpaceDecrease; myTrunk.display(offset); }
0
fd1b7af3985e729e0a1716c332897f8e
1466b2986e2dbe55ea1e57c16f4f435c
修改一个章节的音乐资源路径
for i in range(len(chapter_info)): chapter_info[i]['sections'] = None for j in range(len(res_list)): if chapter_info[i]['id'] == res_list[j]['chapter_id']: if chapter_info[i]['sections']: chapter_info[i]['sections'].append({"section_name": res_list[j][...
0
8f08d26c6eb482a567653d89b017f603
f5ad953791f4bcb2fa583326756d13be
GET: api/<EspecialidadController>
{ var especialidades = from e in mDb.especialidad select e; ViewData["especialidad"] = new SelectList(especialidades.ToList(), "id", "nombre"); return View(); }
0
ebb81559660566728519cb9b1b16e102
704159fee11a2bc5fbb0005cd344975c
频域转时域
class Signal: def ifft(self): if self._domain == 'freq': if self.signalType == "power": scale_factor = self.nSamples elif self.signalType == "energy": scale_factor = 1 else: self.logger.error('fft: Unknown signalType: {}. Choos...
1
fdd53d85af79b50764a20101291c0fec
6e6a03cc1b8fb99c56f9cef1c23a47a1
@brief オドメトリでパーティクルの予測(移動)
void ParticleFilter::prediction(double delta_t, double std_pos[], double velocity, double yaw_rate) { for (int i = 0; i < num_particles; i++){ double pre_x = particles[i].x; double pre_y = particles[i].y; double pre_theta = particles[i].theta; double x_pred, y_pred, theta_pred; ...
1
c7e757819c93799fa8e59e3f0714118f
576b27c4ed31c1fd8d1fb321858530e6
获取列表头部的一个值
List<String> vl = headers.get(key); if( null == vl ){ return null; }else { return vl.get(0); } }
1
02f08987bf785d44f2acc36be60306cd
7934fad7d8264aa0c4ee4d594eba8bbd
NewContext 创建一个Context实例
func New() Context { return Context{ values: map[interface{}]interface{}{}, } }
1
eed77e130ebbefc9eda8543dc30bdffe
35ec549a85da4d85d28673414ccbbb18
The first city.
class World: def north_pole(self): return self.cities[0]
1
6146dbb21731a2e927c3873b147fc4e8
ef73b3c5b44f97dd97958429f932e137
Update video output. Takes pre-filled emulator screen bitmap as parameter and converts it to SDL surface of specified properties. Does centering and scaling if emulator changes viewport/resolution and also immediate bliting.
if( SDL_MUSTLOCK( inScreen ) ) { SDL_UnlockSurface( inScreen ); } if( ( inScreen->flags & SDL_DOUBLEBUF ) == SDL_DOUBLEBUF ) { SDL_Flip( inScreen ); } else if( !blowUpChanged ) { int yOffset = ( inScreen->h - totalImageHeight * blowUpFactor ) / 2; int xOffset...
1
92db3abd6326f39831986b162eb79b9c
c792a543cde9843176272b5b0361083f
Пошук послідовності елементів
{ int signal = 0; Prog3A::Sequence ptr; if (cnt < 3) throw std::length_error("Sequence too small!"); for (int i = 0; i < cnt; i++) { if (signal) break; ptr.sq[ptr.cnt] = sq[i]; ptr.cnt++; if (opt == 1...
1
8ea62ecd68d52342ee87a23f62539142
a0bb3f4c3b212b7030d48537cda88d9a
პაციენტის დამატება/რედაქტირება
def createOrModify(request, id): if request.method == 'GET': try: person = models.Person.objects.get(id=id) return _reply([person]) except: return _reply(status=404) elif request.method == 'POST' or request.method == 'PUT' or request.method == 'PATCH': ...
1
47b71fc2f4fb39d75beca2ee1aaa2ced
6763de83c77979fefa567a5ec7f89c3b
Returns the datetime this celestial object was first persisted to the database.
Calendar getCreatedAt();
1
de9806f024307380625dfc5e6c6d572a
5dc37ffa25661205ef236def4e1412f7
회원정보입력에 명시된 내용만으로 회원아이디를 입력받아 리턴하는 함수 (로그인시 사용)
public String findID(HashMap<String, String> paraMap) { String userid = sqlsession.selectOne("finalproject4.findID", paraMap); return userid; }
1
4d1ea34b19e81ef85f335d14b9ac1e11
1f58bde38cd281544def7730b5c08453
Нажимает кнопку доабвления нового товара
class AddNewProductPage public function clickOnSaveNewProductButton(): void { $this->tester->click(self::SAVE_NEW_PRODUCT_BUTTON); }
1
7d342501de596b39a2753a2b61269720
e9bc31d1a8bc6a9a596088f25d7fab81
url参数转成SortedDictionary
{ SortedDictionary<string, string> sArray = new SortedDictionary<string, string>(); string query = Request.Url.Query.Replace("?", ""); if (!string.IsNullOrEmpty(query)) { string[] coll = query.Split('&'); string[] temp = { }; ...
1
439e57f213f54fa6ddfbe8e9d7200828
f1b28426ca65eca6e524e045c6cf06c7
清空所有歌曲的count值
func clearCount() { sql := "update music set count=0" db.Exec(sql) }
1
f0a96f9fc289283c79187709a964dc90
4b2c93aef2880642e87de924ae3fb09b
Test with negative number in list
class TestLab1(unittest.TestCase): def test_max_list_iter_negatives(self): list3 = [-113, -50, -9, -45, -89, -1235, -35] self.assertEqual(max_list_iter(list3), -9)
1
8dd36d51131a194b6bdb1dada1c30b6b
c16ea5734bab5e50be5397af705e5762
Rotates the active piece left (counterclockwise) by 90 degrees.!--
class Tetris: def rotateActiveCounterclockwise(self): if self.rotatable(): error = False for i in range(self.pieceBounds[0], self.pieceBounds[2] + 1): for j in range(self.pieceBounds[1], self.pieceBounds[3] + 1): if self.grid[i][j].isActive(): ...
1
c8f04806f9dbe774ece102f227820a73
86ab4ca6d9d882cb3fc20240f9c7fcc0
调用电脑摄像头检测人脸并截图
def detect(): face_cascade = cv2.CascadeClassifier(r'.\cascades\haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier(r'.\cascades\haarcascade_eye.xml') camera = cv2.VideoCapture(0) while True: ret, frame = camera.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) ...
1
7432a6a14807722c38e86d7049a2eae0
6c508d150330caae6d6fc0bf879585c1
Este metodo indica las dimensiones de la matriz; regresa una lista
def get_dimensions(matrix): return [len(matrix), len(matrix[0])]
1
5098d17fb6dd48832de70d0816c52cb1
43cfe917b591bf4027b6faa59f844e04
Render a form to update an existing especial.
{ if (!Gate::allows('is-admin')) { return redirect('/')->with('error', '¡Usuario no autorizado!'); } return view('especialidad.create'); }
0
50d0d8be3769bd9fa9de2c5daa3ca2da
09eb8d0f716d434e41d4a322c9ef46cd
Bind the target component as a message producer to the logical entity identified by the name.
public class JmsWrapper public synchronized void initProducer() throws JMSException, NamingException { initSession(); if (_destination == null) { __log.info("Looking up destination [" + _destinationName + "]..."); if (_destinationIsTopic) _destination = _session.createTopic(_des...
1
67acf63e2c4ac8758e207548a66451a1
4c5e724f908f747de85eb25abc274ed1
Get best metric using early stopping policy in validation metric history.
patience = self._patience + 1 best_fn = min if should_decrease else max best_score = best_fn(metric_history) if best_score == cur_score: best_so_far = metric_history.index(best_score) == len(metric_history) - 1 else: best_so_far = False out_of_pati...
1
64345e6b51035f960e78d37898170690
2bd54e21fb634f0800241ab31d938070
判断文章是否被阅读过
public class Article implements Parcelable public boolean isRead() { return PkRSS.getInstance() == null ? false : PkRSS.getInstance().isRead(id); }
1
e350bc7b7d93a078797d022701099ad4
33e6e9534a7e6a42062aa9026a8e715b
A convenience method that tries a number of approaches to getting a token stream. The cost of finding there are no termVectors in the index is minimal (1000 invocations still registers 0 ms). So this "lazy" (flexible?) approach to coding is probably acceptable
namespace NCI.OCPL.Api.BestBets.Services public class ESBestBetsMatchService : IBestBetsMatchService private IEnumerable<BestBetsMatch> GetBestBetMatches(string cleanedTerm, string language, int numTokens) { string templateFileName = "bestbets_bestbets_cgov_" + language; for (int i =...
0
76a2a90e203ebd82101625218960ed3e
0f9f9dd9f1ee9447509f40ceabd75a73
Test of temp_parse method, of class Interpreter.
class TestParserFromFunction(unittest.TestCase): def test_parser_from_function(self): def fpars(anint: int, bstring="r", creal: float = None): return f"'{anint}' - '{bstring}' - '{creal}'"
0
61a0f1e61e3600d8c1182cd1fc7d84c2
b8b5040b6c5c7e6be237ea6bbb673c40
根据index获取某个任务的一个完成进度
{ if (index >= _threadCount || index < 0) { return 0; } if (_isWorking[index] == true) { double costTime = (DateTime.Now.Ticks - _lastWorkTime[index]) / 10000; return costTime; } r...
0
caa3c17ae688dccff6888cd046e675c1
db4c29bc188fa6d648d192dd67d81059
Test for Problem 3
def problemTwoThree(): raise NotImplementedError("Problem 2.3 Incomplete")
0
01430c9aa32756108064d961ab46ced8
483365904dac9bb8326e9926ff3fb6b1
Clean up memory initialized with fence_init. This is meant to be used after a fence release callback.
{ struct drm_nouveau_private *dev_priv = dev->dev_private; nouveau_fifo_cleanup(dev, file_priv); nouveau_mem_release(file_priv,dev_priv->fb_heap); nouveau_mem_release(file_priv,dev_priv->agp_heap); nouveau_mem_release(file_priv,dev_priv->pci_heap); }
0
b11c645d84f190d8b073998d0b33bdee
d5b5b3f9deedba468c87086ffeaf43f9
Builds test contributor team view model
{ return SPMeta2Model.NewWebModel(Web => { Web .AddWelcomePage(new WelcomePageDefinition { Url = ListsInfo.Contacts().CustomUrl }) .AddWebFeature(FeaturesInfo.DisableMi...
0
48a2ef96a4229a69fa3f783632f07eb5
955af30b1ee2a9d503f23bd2ec7a1f4f
返回授权失败的HTTP错误码
class PermissionException extends Exception implements ExceptionInterface public function getHttpStatusCode(): int { return 403; }
1
3b85e6ffb8763e466ae19e10191d97cf
13ac9b411c2c5b0d0b4bc51cf3dcb721
Fn to find a dx using a simple formula to simplify main code
double Grid2D::dx_forward(vector<double> &function, int n){ try { if (n % N <= 10e-7) { return 0.0; } else{ double dxF = function.at(n)-function.at(n-1); return dxF/dx; } } catch (const std::exception& e) { cout<<"Exception! n out ...
1
9fa43805a8e5b172c91394c3883f393f
9f87f2009dfe0eff5c9d4e283e823059
Compute gradients in x, y and t direction between images
class DCGAN(tf.keras.Model): def pix_gradient(self,x): x = tf.reshape(x,shape=[1,64,64,1]) dx,dy = tf.image.image_gradients(x) return dx,dy
0
8082d60eb9e979562b7af6ecbc341250
5d46acf2fc7695c5dc609f55d7a9e47a
Get the logger. (Standard log4net get logger call)
namespace Forge.Logging.Log4net public class Log4NetManager : ILoggerWrapper public ILog GetLogger(Assembly repositoryAssembly, string name) { return new Log4NetLog(log4net.LogManager.GetLogger(repositoryAssembly, name)); }
1
a9dee7a2a31b0c2a59399a99bb091e1b
f2e2c28e4c36e2de2e4ef82c46b1ed1f
向容器中添加一个子控件,同时指定该子控件的布局条件。 要添加的子控件 新添加的子控件在兄弟子控件中的位置序号,该序号是从0开始计数的。
void attach(int position, FrameLayout parent);
1
3e8a3edeca7682582de20d723ef6c675
a47720eed01883d226eb70c337f1530f
将原始文件名更改成模型能够推理的文件名格式 并将其映射关系记录到json文件中
def transformLabelJson_another(root_subdialogs): utter_index_dct = defaultdict() pattern = '<.+?>' flist = glob.glob(os.path.join(root_subdialogs, '*/log.json')) for fname in flist: fname=fname.replace('\\','/') subdialog_id = fname.rsplit('/', 2)[1] subdialog_id='0'+subdialog_id...
0
c872e85e566f3bd8bfd5321f10667895
41f44da32ebc88380ab55eecec7d44a3
# busca en la bd si el usuario realizo una denuncia sobre el post que esta viendo o no
$con=connection(); $q = mysqli_query($con, 'SELECT * FROM vote_post'); while($tab = mysqli_fetch_assoc($q)){ if($id_user == $tab['id_user'] && $id_post== $tab['id_post'] && $type == $tab['type'] ){ mysqli_free_result($q); mysqli_close($con); return 1; } } mysqli_free_result($q); my...
1
4593ee5edf7abfc395eb4d7914e06b94
b56f9f1cb6fc5616faaf46997599d3e0
Tarefa de controle chamada pela função main().
{ setvbuf(stdout, 0, _IONBF, 0); PingPongMain = malloc(sizeof(task_t)); PingPongMain->task_id = 0; PingPongMain->prio_dim = 0; PingPongMain->prio_est = 0; PingPongMain->quantum = QUANTUM; PingPongMain->status = pronta; PingPongMain->time_exec = 0; PingPongMain->time_proc = 0; PingPongMain->n_...
1
ae8840a391ab413efa2f873ef176fd67
9e17e7f0c4f8cfa5c11bf039e4ee9945
(3):查看各区域的二手房平均每平米单价
cursor = self.conn.cursor() sql = """ Select zf.address,COUNT(id) as `房屋数量`, CONVERT(SUM(rent)/SUM(area),DECIMAL(10,2)) as `单位面积租金价格` from zf where zf.rent < 10000 and zf.area < 1000 GROUP BY zf.address """ cursor.execute(sql) ...
1
5aec375ee113e63af5501b27da16881d
32532229ff06bef5339aa4509f77e88c
echoMovie echos the movie object as a human-readable HTML output.
int i = 0; printf("NAME: %s\n", movie->name); for (i = 0; i < movie->actorsCounter; i++) { printf("Actor %d: %s\n", i+1, movie->actors[i]); } }
0
e26732e7435989d2c89a82b8df529af2
ddbdb9f1906eb0cc6da49c0e84b44872
A sintaxe abaixo demonstra os comandos para limpar as informações dos elementos html.
function cleaning() { var temp=0; while(temp<=36) { $aux3 = $('#esp'+temp); $aux3.html(''); $aux3 = $('#in'+temp); $aux3.text(''); temp++; } temp=0; }
1
66bedfb1b2fbaabcb19425f7482ebe66
667dd7fd83772af372ccef72ba9b17ae
Randomly spawns cards for CardSelect
this.attackValue = UnityEngine.Random.Range(1,6); this.healthValue = UnityEngine.Random.Range(2,10); selectionBorder.GetComponent<Renderer>().enabled = false; this.fullCard.GetComponent<Renderer>().sortingOrder = 100; if (this.isEnemyPlayer) { Destroy(GetComponent<Rigidbody2D>()); } this.originalPositi...
1
61cf4d94bd6242f20c303c3e82d57f44
4388f1dc9303bcbee4443726e80feced
Test the base 83(b) signal markers handler
static int SigParseTest09(void) { int result = 1; DetectEngineCtx *de_ctx = DetectEngineCtxInit(); if (de_ctx == NULL) goto end; DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\"; sid:1; rev:1;)"); DetectEngineAppendSig(de_ctx, "alert tcp any any -> any any (msg:\"boo\...
0
ab4e2973ef5c23dee3307300963cab88
fdb484382be4152db2cdcefd546c856b
Passed to st_foreach to free the layer structures associated with a buffer.
static void _layout_free(void* item) { layout_t* layout = (layout_t*) item; layout_free(layout); xfree(layout); }
1
a63660fd844f574820d1c554b7bb8829
4a186dd676683179311df58a6292b38c
Data type of a timestamp WITH LOCAL time zone. This is a synonym for {@link DataTypes#TIMESTAMP_WITH_LOCAL_TIME_ZONE(int)}.
@PublicEvolving public final class DataTypes public static DataType TIMESTAMP_LTZ(int precision) { return new AtomicDataType(new LocalZonedTimestampType(precision)); }
1
cc9f54708b8aacd5de61ffdc6b54f6e3
7aff7529c268b5aa4721db154e2c9773
Takes care of intializing and setting up the required number of aggregators
class BaseAggregator(object): def start(self): pass
0
a3a36ce36cd54029581c31e38ce13c13
a0875ccd0079eec2d91d2b4466ef5f2d
根据Name移除事件
namespace Swift public class Timer : Component, IFrameDrived public void RemoveEvent(string name) { if (events.ContainsKey(name)) { events.Remove(name); } }
1
009664b0dc50995602db0247ad3f44d6
34d0bf1881fd5d4e3b0c099e71718f5c
Button 10 on any joystick.
class KeyCode get Joystick3Button1() {}
0
ec0490d588a61b6c81d8665cc521c9c3
0ee61f6ec5b12a2807d61bbec3c6fa08
*TANGO is_allowed method*: filter the external request depending on the \ current device state.\n Check if the Scan method can be issued on the subarray.\n The Scan() method can be issue on a subarray if its *State* is *ON*. Returns: True if the command can be executed, otherwise False
namespace SurfaceConceptTDC_ns bool SurfaceConceptTDC::is_DeviceID_allowed(TANGO_UNUSED(Tango::AttReqType type)) { return true; }
0
1d13cc935aaf1194f4f96490bd5c36fb
c601ab0b38673de998fab37da2d78b11
Delete the storage config object for the given storage config id.
def controller_delete_by_storage(context, storage_id): return IMPL.controller_delete_by_storage(context, storage_id)
1