query_id
string
corpus_id
string
query
string
code
string
label
int64
2338e9f9052b7418d123f5b8a42156ff
f2cd1d1f22e489d9a709d49ab3576acf
replaces operators with representative symbols
class BaseCompensation: def _replace_sign_of_operation(self, msg): return msg.replace("**", "^").replace('*', '\u00D7').replace('/', '\u00F7')
1
7abed6f4307326e9331d26d0caaa16a1
0d50def18b7db7b07be4a439e75a82a9
Find a vertex with odd degree
int i; int max_satur_degree = -1; int nxt_vert; for(i = 0; i < vertex_num; i++) { if (max_satur_degree < satur[i]) { max_satur_degree = satur[i]; nxt_vert = i; } } if (repeated(max_satur_degree, satur, vertex_num, nxt_vert)) nxt_vert = break_tie(deg_vert,graph,vertex_num-lower_bound)...
0
0849aad63a9ca7a66c981ceb8651e8f8
2b76671b2a7134a234c5a805801a3f9f
Clobber a subtree, replacing it with a terminal.
class BinaryTree(list): def replace_subtree(self, n, subtree): self._pad(n, subtree) self._fill_subtree(n, subtree)
0
6c9c99e17ddae7758f7c00207744469e
e561933bab312a3c71f96c3af3a6d127
根据指定的key,从全局properties对象中获取value
public final class PropertiesUtil public static String getValue(String key){ String rs = ""; if(GLOBAL_DATA!=null && GLOBAL_DATA.containsKey(key)){ rs = GLOBAL_DATA.getProperty(key, ""); } return rs; }
1
14df3b832eadd876d264a49360e5a9c5
21d1a4c04a684e7be0387a0fc9c95075
Select multiple invoice to print at a time, and check the prompt message
class InvoicePrint(HPBridgeFlow): def check_no_invoice_available_prompt(self): self.driver.wait_for_object("no_invoice_available_prompt", timeout=3) self.driver.wait_for_object("no_invoice_available_prompt", invisible=True)
0
cf906f194fb7320ba1235d853a5cd06b
fecbefe73e9e2d3336e3a900ffdc0f0e
Get the name of the singer
@Entity public class Song implements Serializable public String getName() { return name; }
0
8a2aabb0749ae49dbda2796218c9cce8
f8cf97b2c77fb811e250c9fbf2c8e81d
画一行文字
val rectF = RectF() val oneTextSize = getOneTextSize() for (i in text.indices) { rectF.left = (i * (oneTextSize + itemHorSpace)).toFloat() rectF.right = rectF.left + oneTextSize rectF.top = itemVerSpace.toFloat() rectF.bottom = rectF.top + oneTextS...
1
afebdedd004e83631440bcb2757921b0
f8bcfcb994bc4ec52d6048addd4b4632
线程处理层级加1
void ddlog_inc_indent(void){ ddlog_thread_indent_level++; }
1
94da6fd1fee8f4106e95d955397cabcd
5aab38908c147076b71d039b954b042b
Rearrange operands to ensure we only have a single division operation (and it is <u>always</u> outermost, i.e. (A/B)/(C/D) => (A*D)/(B*C)
match self { Expression::Binary(Operator::Div, numer, denom) => match denom.remove_div_in_denom() { Expression::Binary(Operator::Div, denom_numer, denom_denom) => Expression::Binary( Operator::Div, Box::new(Expression::Variadic( ...
1
1ac216222216e77155154bbdd5130ce6
056f4ba6071712f1d41cd399ba4b42e6
进入每个电子书的详情页,获取下载电子书的网盘地址;
download_urls = [] soup = BeautifulSoup(detail_page, 'lxml') download_items = soup.find_all(name='a', class_="dl_item", target="_blank", href=re.compile(r'http.+?\.pdf')) if download_items is None: return download_urls for item in download_items: download_...
1
38e76fe0b8e2ec0c8bbbe0ef954a71b6
3c129f10a3d89eea3cabf1b315a74189
保存密码的统一函数
function saveNewPassWord(){ var userId=$("#userId").val(); var twoPassWord=$("#twoPassWord").val(); $.ajax({ async:true, url:contextPath+"/user/saveUserPassWord.do?userId="+userId+"&password="+twoPassWord, type:"post", success:function(succ){ if(succ == "succ"){ $("#savePassWordSpan"...
1
b00cdf7dbfe71de1ee5335be81f12902
cc442a54cf793efccf94d46cee5baff5
SaveToPEMFile saves certificate data to a PEM file.
block := pem.Block{ Type: certutil.CertificateBlockType, Bytes: cert.Raw, } return pem.EncodeToMemory(&block) }
0
38f890557a725ef1dc9f1d75e64c1ce4
88b0534f95069fddeb160c91d199a1e7
Returns the array with the $_SERVER vars.
class StupidHttp_WebRequest public function getServerVariables() { if ($this->serverVariables === null) { $this->serverVariables = $this->buildServerVariables(); } return $this->serverVariables; }
1
d407d159f9b962379da72b0d69815bb4
fdd864c2cf4fb654e21af4f5ea8de5c7
Validate values against the bad word list. We don't want to accept phony information.
foreach($array as $v) { if(is_array($v)) { _josSpoofCheck($v,$badStrings); } else { foreach($badStrings as $v2) { if(stripos($v,$v2) !== false) { header('HTTP/1.0 403 Forbidden'); mosErrorAlert(_NOT_AUTH); exit(); } } } } }
1
b46973ab69dbb5995ff638bea9f01c8f
a729931613c3bf3dd57be284bfb5eb27
Creates a new adapter for an object of class '{@link org.worklang.work.TransitionInstance <em>Transition Instance</em>}'. <!-- begin-user-doc --> This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- end-user-doc ...
public class CaltropAdapterFactory extends AdapterFactoryImpl public Adapter createTransitionAdapter() { return null; }
1
b46810a1471d5fb1a142f40c668542cc
8cdb4d53378da6f2d053199d31d82653
Find all EmployeeDayoff from database. Has pagination.
public IActionResult EmployeePagination([FromQuery] string employeeFilter, [FromQuery] Guid? departmentId, [FromQuery] Guid? positionId, [FromQuery] int pageIndex, [FromQuery] int pageSize) { try { var serviceResponse = _employeeService.Pagination(employeeFilter, ...
0
5d4d29d619f5027ba0c79e1e0e26ff14
ba9bcf58c704f852697dbf5d4c5553ee
! Subdivides the mesh uniformly one step
void QGLBezierPatch::recursiveSubDivide (QGeometryData *prim, int depth, qreal xtex, qreal ytex, qreal wtex, qreal htex) { if (depth <= 1) { convertToTriangles(prim, xtex, ytex, wtex, htex); } else { QGLBezierPatch patch1, patch2, patch3, patch4; subDivide(patch1, patch2...
1
2d1454060e071a6c37ed037f131768f5
3f482e2184313d2497359a7e88f9ebaa
Callback method for Read UT330B
{ switch(UdataBuf[4]) { case MSP_SET_4CON: rcData[THROTTLE]=UdataBuf[6]<<8 | UdataBuf[5]; rcData[YAW]=UdataBuf[8]<<8 | UdataBuf[7]; rcData[PITCH]=UdataBuf[10]<<8 | UdataBuf[9]; rcData[ROLL]=UdataBuf[12]<<8 | UdataBuf[11]; break; case MSP_ARM_IT: armState=REQ_ARM; break; case MSP_D...
0
146edc11f67292be5504f7b1af3cb981
4e7c0fa2b5f2cc8772948b4f29c96e39
将list中的元素作为key,function 中的函数取出value
{ Dictionary<TKey,TVal> dict = new Dictionary<TKey, TVal>(); foreach (var item in list) { dict.Add(func(item),item); } return dict; }
0
4615cf961efc51efd9917e83432d0e05
f56b4bbc7843fa80f26977a1f22dc8ba
grab only unique values from a given roll.
local set = {} local new = {} for k, v in pairs(t) do if not set[v] then table.insert(new, v) set[v] = true end end return new end
1
5b8fca3f0560d6d872b911475f6cd175
1fd94209120b26d58b8fae002aaad312
simply stops all main drive motors.
class DriveController: def halt(self): self._left_motor.setVelocity(0.0) self._right_motor.setVelocity(0.0)
1
f9937e8d89b08e0b4d19e563fd8d46e3
d23170f4b6aabcf207960a891ae5bc67
Gets the information about the model without symmetries
class xyz: def get_info_wo_sym(self): if not self.sym: return self.get_info() else: return f"Ns={self.Ns},Ja={self.Ja:.2f},Jb={self.Jb:.2f},hx={self.hx:.2f},hz={self.hz:.2f},da={self.da:.2f},db={self.db:.2f},ea={self.ea:.2f},eb={self.eb:.2f},bc={self.bc}"
1
45d47013e77c34b8ab71c84aa852e9d0
4dd835399029c9c3c6bed5793cd73165
Test case for connect_core_v1_get_namespaced_pod_exec
class TestCoreV1Api(unittest.TestCase): def test_connect_core_v1_options_namespaced_pod_proxy_with_path(self): pass
0
550abc54da404cd294caad345fe7bad0
c4a7d870ec2bbd9dcab7e548ac4434d6
Takes Dictionary and translates to bits
class BitsAnalytics: def generate_pos_dictionary(self): dictionary = [0]*256 for i in self.byte_transitions: z = i.copy(); z.sort(key=int) z.reverse() for index,value in enumerate(z): dictionary[index]+=value; return dictionary;
0
8958ee564786b205bfa764968814b073
bf7c9c4909d793926173006a24b471f3
서버에서 가져온 유저의 방문 데이터를 전역변수에 셋팅함
export default class Livelist extends Component componentDidMount() { const database = fire.database().ref(`users/${this.props.visitorId}/search_list`); database.on('value', (snapshot) => { if (snapshot.val()) { this.setState({fav_list:snapshot.val()}); } ...
0
8450ae413e074f9ef9d3fc0e36ba9ddb
5c640bdd7ab8406ad82201a22c467083
Change a few points from parent cloud, update and check if different
scope.launch(Dispatchers.IO) { val newPointList = ArrayList<Point3f>() for (point in PointData.allCloudPoint) { val pointArray = floatArrayOf(point.x, point.y, point.z, 1.0f) Matrix.multiplyMV(pointArray, 0, mRenderer.getModelMatrix(), 0, pointArray, 0) ...
0
f774d5a9ac60b250f398c0fc5ad472d3
4c6f7ea0d0896d2747965fe9898362d9
Tests if the method validates a valid muscle test request
class GoniometryViewTestCase(TestCase): def test_missing_body_zone_validate_muscle_test_request(self): self.assertRaises(ValidationError, MuscleTestView.validate_muscle_test_request, MuscleTestDataRepository.get_missing_body_zone_muscle_test())
0
41c7f56b2bf5c64e9c19c63a77538f32
cad8547f6dc4887eba026088c48d5c4c
=========================================================================== DESCRIPTION ISR_ASYNC_RSP task context -- local isr callback DEPENDENCIES None RETURN VALUE None SIDE EFFECTS None ===========================================================================
idasync(register ipiq_t *q) { register unsigned int fac, slave; register id_ctlr_t *c; struct icparg icp; slave = IPI_SLAVE(q->q_addr); c = id_ctlr[slave]; if (slave >= IPI_NSLAVE || !c) { icp.arg = (void *)q->q_resp; icp.msg = "async response for unknown slave"; IDC_CONTROL(c, IPI_CTRL_PRINTRESP, &icp, 0)...
1
fa9cf407a32fb1f240268c2ded536b4d
4707c5a8c4c7595759ac47e8e11eb1eb
When moving, it should return 0 as number of items if no nodes are found.
abstract class AbstractPhpcrRepositoryTestCase extends \PHPUnit_Framework_TestCase public function testMoveZeroNodes() { $this->finder->find('/path/to/foo')->willReturn([]); $numberOfNodes = $this->getRepository()->move('/path/to/foo', '/bar/bar'); $this->assertEquals(0, $numberOfNodes); ...
1
7d78abd28d3031a81be7c2e866296131
d487feb90e1873fb753f35f97d3d4222
Fluent async DSL. Assert that no message is received for the specified time.
namespace Microsoft.Bot.Builder.Adapters public class TestFlow public TestFlow AssertNoReply([CallerMemberName] string description = null, uint timeout = 3000) { return new TestFlow( async () => { await _testTask.ConfigureAwait(false); ...
1
2413941a305f215526d79eb230739c70
803e2307e6cdea7e447baf15abdf6e8f
获取锦囊类型
getKind() { var that = this; wx.showLoading({ title: '渲染中', }) db.collection('kind').get({ success: function (res) { that.setData({ list: res.data }) wx.stopPullDownRefresh(); wx.hideLoading() } }) }
1
c58dc7f490cf5e84cf831c5eaaa72d2a
f519b0e13e63c489bb560b210f39a553
This function returns new offerNumber for created new offer.
global $SentData,$AbilityName,$APAbilities_str,$BossName,$SentData,$MediaObj,$offerlist,$originalData; $new_key = time()*10; while( array_key_exists("k".(string)$new_key,$offerlist['offered']) ){$new_key++;}; $AddObj=array( "IsAlready_CertificationReply" => false, "Player" => $MediaObj["Author"], "Abil...
0
01a1db0cedf4d9296747e1d94b3be76e
b7653a0da6b3436bb17339fbffafe2c0
Test response when bot is missing fundamental permissions.
user = self._authenticate_basic_tests(with_webapi_token=True) url = self.setup_basic_post_test(user, False, None, True)[0] rsp = self.api_post(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code)
1
4cbef9bd7dbe50fb139986571e8d2f20
c27ea230869463a98ac87637c00e3a8e
Fonction qui permet de dupliquer un tableau
var b = []; for (var i = 0; i < a.length; i++) b[i] = a[i].slice(); return b; }
1
c7e3857d32b3bfbdb17ef675adde3ab3
fd311b0d869f5e4f88f07bd924446c10
without items
self.client().post('/v1/api/bucketlists/', data=json.dumps(self.bucketlist1), headers={"Authorization": "Bearer " + self.access_token['access_token'], "Content-Type": "application/json"}) get_response_item = self.client().get('/v1/api/bucket...
1
0260e0562beb6061b89080a4ba35009b
968ee16bfcd327e3b7dbec6dd245e73e
Extract vertical profile from RHI.
assert os.path.exists(filepath) nc = netcdf.netcdf_file(filepath, 'r', mmap=False) br_map = nc.variables['br'][:] vr_map = nc.variables['vr'][:] * u.km / u.s phi = nc.variables['ph'][:] cotheta = nc.variables['cos(th)'][:] nc.close() phi = phi * u.rad theta = (np.pi / 2 - np.arccos(c...
0
108f243eab4c7dba0fb08752c40aba3c
82b4d648d82a285ad037504e5ecbb7d9
utility function to compute angle of attack based on state.
dotProduct = [ -self.attitudeVectorX.getValueOpt(i) * self.streamVelocityX.getValueOpt(i) - self.attitudeVectorY.getValueOpt(i) * self.streamVelocityY.getValueOpt(i) - self.attitudeVectorZ.getValueOpt(i) * self.streamVelocityZ.getValueOpt(i) for i in self.time ...
1
cfefdd249ca99f58245a3cc01426215e
ee215b95315d8c13e8735db8a8a6a78a
return a CSV of all of the current registrations
registration.find({}, function (err, registrations) { if (err) { return cb(err); } var buffer = '', cols = get_column_names(schema); buffer += get_csv_row(cols); cols = cols.slice(1); _.each(registrations, function (reg) { buffer += get_csv_row(get_registration_row(cols, reg)); }); cb(null, bu...
1
6b5e79b14c3140c1484374c5084d6571
0c71a91a1fe2bfe6b1193c7e1f89cd28
Find type of the task. Returns: Type of the task.
result = self._values.get("task_type") assert result is not None, "Required property 'task_type' is missing" return typing.cast(builtins.str, result)
1
3cbefb794cf7743aa5724cd74f545548
510458484ccc680a5b810016ab0a6ba2
Imports patients from DDE to the local database
void COnlineVisitsDlg::OnBnClickedImportButton() { if (IDNO == MessageBox("You are about to import all selected documents (regardless of the provider filter) and attach them to their respective patients.\n" "Are you sure you wish to continue?", "Practice", MB_YESNO | MB_ICONQUESTION)) { return; } NXDATALIST2Lib:...
0
1b0d1d9dda7284013c47a40910a49c55
e6003f0877c98fc83b7f6049d3840e9b
Test multiple consecutive packets.
msg1 = b"\x00\x01\x12\x34\x00\x04\xff\x02\x12" msg2 = b"\x34" self._tcp.add_to_frame(msg1) self.assertFalse(self._tcp.check_frame()) result = self._tcp.get_frame() self.assertEqual(msg1[7:], result) self._tcp.add_to_frame(msg2) self.assertTrue(self._tcp.ch...
1
69ce3d8749c2aa262352272eac6d2652
e14dc6d7c4ba5b05612502bcf2938da4
Public method that returns a dictionary of string values keyed by column name, with values from the corresponding column. Just the selected column values are returned.
def get_selections(screen_def, column_name ): if debug: logger.debug("Retrieving row selections from window {}".format(screen_def['hlist'])) hlist = screen_def['hlist'] try: selected_rows = hlist.info_selection() if debug: logger.debug('Row selections = {}'.format(select...
0
65452b276a8390866ed5aa23de72bc1b
be7ce6ddfae97298433960a3084293a3
Mean squared error between the gradient heatmap and image.
gx = tf_img_grad(x) gy = tf_img_grad(y) return tf.reduce_mean(tf.contrib.layers.flatten(tf.square(gx - gy)))
0
dde2b7f20bbd1414976fc75c5020fd84
9af43aee9e9e2b6ec10c8330322420fa
Connects to the internal RPC server and returns a new invoker for it
namespace ServiceFairy.Components public abstract class CoreAppServiceBase : TrayAppServiceBaseEx public CoreInvoker CreateInvoker(CommunicationOption option) { Contract.Requires(option != null); return CreateInvoker(Context.CreateServiceClient(option)); }
1
590c7eccc3d02041b5b60b175872e67c
2b9086b2df0088fcded7294ccf60c28b
Gets the EnumerationChanges Map.
public class ChangeHistoryDetailForm extends ActionForm public Collection getChanges() { return changes; }
0
1ae2f8332792cb97f7f518af0ea70b75
22553f37495cdedb6779f935a41f031e
Check connection state, connect if not connected.
func ping() { if xdb == nil || pdb == nil { connect() return } }
1
807a84d9ecf1bbc56b1f4391c90bef3a
00890e5e1be799b32d127898654daef5
renumeroteaza randurile tabelului
void randomize_map(char **matr, char **tabla, int scorj, int scorc,char **tab,int **b, int *ordine, int scormax, int *start, char **copie) { int i, j, x, y, n, m; int dir; int lung; char **copy; srand(time( NULL)); copy=malloc(10*sizeof(char*)); for(i=0;i<10;i++) { copy[i]=mal...
0
14ed1197c1d5320c182a0a970f482d65
925200775042a7e9a9aa4e38e9974885
递归方法获取文件大小
if (null != src && src.exists()) { if (src.isFile()) { size = size + src.length(); } else { for (File file : src.listFiles()) { countFile(file); } } } }
1
6422509eb687c22b499e924aed32fcba
3d276bdcf9bea1dc391844fcc19dfe21
定义单元的总数
class UnitService static async getTotal(conditions){ return await UnitModel.find(conditions).count(); }
1
31992274f064fb81aef74d1bef796789
9b6164a183a7b7af38141a8ad1fa345e
判断当前环境是否是debug环境
class BaseDebug public static function isDebug() { return env('APP_ENV') != self::APP_ENV_PRODUCTION || env('APP_DEBUG'); }
1
f3ac74ae27c93f625605abb41d1918a2
d4e16095b8cd6c19637713aa32fec2b8
Tries to find "Cancel" JButton in this dialog.
public class ConfirmUserDeleteDialog extends JDialog public JButton getcancel() { return confirmUserDeleteDialog.cancel; }
1
a48cf6cab5dd3a7fe74037561cc3b85b
c51ab5d9c422ac298e32a63e0888f3eb
returns the earliest day displayed (always appears in gray)
function findFirstDay(data) { let curDate = new Date(dateonly(new Date()) - (daysToShow-1) * msPerDay); let start; for (start = 0; start < data.length && data[start].date < curDate; start++); return start; }
1
554a50da5f5dd9563b80ea6378a042d2
cbdac2437aa94eae109c5bfd095983f9
mark the end of the html header
function XHTMLEnd() { print '</body>'; print '</html>'; }
0
489cd55dbbefad643a9b2f0cf6c1694a
babb76bf5f52122715fe59077cdf3f6b
Devolve a nota da terceira prova.
public class Mochila public int getItem3() { return item3; }
0
54359d0d9dce8a64730a6d90b3b2e4b8
2d5d7ba6ebdd1328b024eaf0a701ea3f
insert/update an OrganizationToDoList item
{ if(row.OrganizationMetaDataId == null) { return InsertNow(row); } else { return UpdateNow(row); } }
1
9bb37f38a499832b5f429e44ba45174a
c2f31d68dadfb5ffda963bc85fa1bfa3
Reads a complete memory page with CRC verification provided by the device with extra information. Not supported by all devices. The readContinue parameter is used to eliminate the overhead in re-accessing a part already being read from. For example, if pages 0 - 4 are to be read, readContinue would be set to false for...
namespace _1wireXamarinForms.DalSemi.OneWire.Container void ReadPageCRC(int page, Boolean readContinue, byte[] readBuf, int offset, byte[] extraInfo);
1
ba13b26e7a62838b36cbadc4eea39607
dc2da6484a807590d71998a4abb2c13f
获取上级菜单的属性值.
{ $value = $this->getByPk('attr_target', $menuId); return $value ? $value : ''; }
1
d2e80f66bd3b6841e7cddf20c28a580e
283bc777f16216f74c5d49392b145e29
Create a dashboard from a String
response = self.conn.create_dashboard(json.loads(json_content)) new_wave_id = response["id"] url = response["url"] folder_id = response["folder"]["id"] logger.info("Dashboard %s (%s) created successfully" % (response["name"], new_wave_id)) db_dashboard = self._entity_serv...
1
daca0546015bc3b70f57d82dd8418702
a5b98edd4acca633cf7f6b32a42f8ba6
すべての銘柄を0円で買う
def buy_initialize(): g.filter_holded = False g.order_style_str = 'by_market_cap_percent' g.order_style_value = 100
0
e6a0e814330bbda899a2b65c7331e2b8
0bf09cb0baa6b6cf458228c4403ac96e
练习9.5 —— 重写上一题,返回一个迭代器指向找到的元素,必须处理未找到给定值的情况
vector<int>::const_iterator finish, int number) { while(start != finish) { if(*start == number) return start; ++start; } return finish; }
1
81fb69a134de96f63447359c8a728193
4990d83169bd70453f8fa7da192908c0
Expectation: Type checks are only enforced on Arguments with hint. Argument without hints should be accepted
def test_function_11a(): @typesafe( {} ) def some_function(): pass some_function()
1
82b04cd696b8d5fe4a0230220090338f
c58f07acd7f78fb9d7d33c91f15b8a7a
From: [Sat Mar 11 00:19:44 2017] java invoked oom-killer: gfp_mask=0x26000c0, order=2, oom_score_adj=-17 To: 1489191584
{ const long size = (long)190L; const long count = (long)8192L / size; var keep = make_slice<ptr<byte>>(0L, (count + 1L) / 2L); var free = make_slice<System.UIntPtr>(0L, (count + 1L) / 2L); var zombies = make_slice<ptr<byte>>(0L, len(free)); ...
0
60d50af5e8dde7154f999da4816c47dd
d30c6e3245c41b7d3beff0c34742de5f
批量更新好友.
public class FriendInformationDao public void update(final List<FriendInformationBean> beanList) { try { friendDao.callBatchTasks(new Callable<Void>() { @Override public Void call() throws Exception { for (FriendInformationBean bean : beanList) { ...
1
52b9946a5e1f2a34b585ff41d9acd0db
133e3f00e7b49bda2963c26c30522353
Connect to the Jellyfin server and assert that the user can login.
class TestUserTakesTheTest(LiveServerTestCase): def test_user_login(self): self.driver.get(self.get_server_url()) assert self.driver.current_url == 'http://localhost:8943/'
0
43951a4415116847713cfcab7f46196c
c438ebaf4b2afc70cad9c04ab13892c4
手风琴样式的使用
$(elem + ">div:last-of-type").click(function(e) { e.stopPropagation() $(elem + ">ul").show() }) $(elem + ">ul li").each(function() { $(this).click(function(e) { $(this).parent().hide() $(elem + ">div:first-of-type").html($(this).html()) }) }) }
1
c92ec15fadfe17e2cfaa64449c2014ab
09840db0737a1707a8f7d0f662aebaeb
Specify whether the pin outputs a logic LOW or HIGH in low power mode.
boolean isLowPower();
0
0d3bb90791973086c0b131e93bbea7c1
e1071525b378cf0d6156526c5914e560
Checks to see if the <see cref="Microsoft.Xna.Framework.Graphics.GraphicsDevice"/> is still valid or needs a reset.
namespace StrayTech bool IsValid();
0
984602fbf542978840e4b3a60701f506
8bb525735cf061b7c892e2b7a683d06e
@brief Create a Mouse Button report from the mouse button state array.
uint16_t *p_report_len) { *p_report_ptr = usb_hid_mouse_report_desc; *p_report_len = sizeof(usb_hid_mouse_report_desc); }
0
5067a483d006411c6ef41a08fa765bf5
7733f24787d1e0ddf45686c04f9ac6f2
#converts ezvif or ezlasso results into formula
text <- lapply(text, function(x) { gsub(' n_', ' pop_state_', x, perl = TRUE) } ) names(text) <- gsub('^n_', 'pop_state_', names(text)) out <- .parse_vr_formulae(text, kernel_env, proto, main_env) return(out) }
1
945f3ba340883f240c88ab7eb97e3d13
0178e3b7f9ea32c4454662c77a87c237
La fonction va réaliser la croix blanche
{ SDL_LockSurface(surface); for (int y=0;y<surface->h;y++) { int AllWhite = 1; for (int x=0;x<surface->w;x++) { Uint32 pixel = getpixel(surface,x, y); Uint8 bleu; Uint8 rouge; Uint8 vert; SDL_GetRGB(pixel, surface->format, &rouge, &vert, &bleu); if(bleu!=255) ...
0
419b2592b37c46e3e53b5bfb98c7e180
eb38ae1348db0197a9fb1bcc89750c79
Replace PDG codes with generic particle names.
class SParticleNames: def initSUSY ( self ): self.susyIDs = { 1000001: "~d_L", 2000001: "~d_R", 1000002: "~u_L", 2000002: "~u_R", 1000003: "~s_L", 2000003: "~s_R", 1000004: "~c_L", 2000004: "~c_R", 1000005: "~b_1", 2000005: "~b_2", 1000006: "~t_1", 200...
1
1a9613bcae44446593df71786698ba06
b8af09114e155ba5c9add6b75cb52450
This functions returns the Mean Square Error between two pictures (normally an orignal and then a noisy/compressed version)
nofcells = A.shape[0]*A.shape[1] MSE = np.sum(np.square(A - reconstructed_A))/nofcells if ssq: return np.sum(np.square(A-reconstructed_A)) return MSE**0.5
1
f7b7453ce8aca94535884ee592a54459
5010e484a5468b8ba06e654c6a00fd10
圆与圆求交点
vector<Point> crosspoint_CC(Circle c1, Circle c2){ vector<Point> res; if(abs(c1-c2) < EPS) return vector<Point>(); double d = abs(c1-c2); double rc = (d*d+c1.r*c1.r-c2.r*c2.r)/(2*d); double rs = sqrt(c1.r*c1.r-rc*rc); Point diff = (c2 - c1) / d; res.push_back(Point(c1 + diff * Point(rc,rs))); r...
1
8fd14fa25ca8deb6bb696c336ba70499
a4d6f76fa9319d1f6b2dfcfdac365f8a
根据应用包名查询评论信息
public class AppStoreActionTest @Test public void testGetAppComment() { String url = SERVER_URL + "getAppComment.action"; List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("appCode", "xxxxx")); params.add(new BasicNameValuePair("start"...
1
57b571c436bc3b979b917639fdbe5c08
ce0c85ef41ea8c01ee07db773520eeb4
Draw line to (x, y) originating from the current graphic postion.
export class FG2dCanvasContext extends FG2dContext public lineTo(x, y) { this._handle.lineTo(x, y); }
1
cb3df1fcd8a2466d5c9fbfd9efecf5b2
67c5fc8d96e847b1c063420c353e00be
Method router
switch (req.method) { case 'GET': find(req, res, next); break; case 'POST': add(req, res, next); break; case 'DELETE': del(req, res, next); break; case 'UPDATE': update(req, res, next); break; case 'OPTIONS': next(); break; default: ...
1
759a954f7b5e330a58fcfc716f15c8e1
c494ddf5430dbf148a59dc54d1a4a12f
Exit action for state 'Resetting'.
public class Lizard_walking : StateMachineBehaviour override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { animator.ResetTrigger("Attack"); }
0
5a9c1f393c7a3e6f1f1d01bc05f2d199
6e912543c14011de2da193c568ea7aac
initializes the AVR USART for 1200 Baud with 8MHz clock
void init_USART(void) { UCSRC = 0xa6; UBRRL= (F_CPU/BAUDRATE/16-1)%256; UBRRH= (F_CPU/BAUDRATE/16-1)/256; UCSRA = 0x00; UCSRB = (1<<RXCIE)|(1<<RXEN)|(1<<TXEN); }
1
ef839ffd859737fbcfacd9bb6cfb1787
2d807662c11d2a17ae52f80c5186cc71
The output format of the data streamed to the Kinesis Firehose.
class WorkflowTemplateJobPrestoJob(dict): def output_format(self) -> Optional[str]: return pulumi.get(self, "output_format")
0
0b14353f7313d25bf64c9da76a303900
7fb73bf22bac7cb638eb726a7afb6384
dummy implementation writes 0's over the data to send, always returns false
BOOL CSacCommunicator::PokeSac() { return FALSE; }
1
1318aefe9857d3e8d30dcac8eb0e813e
872da111faff6e98953f3ef64567dceb
Deze functie maakt een scherm met meegegeven afmetingen en plaatst deze in het midden van het scherm en returnt deze voor verder gebruik
namespace memorygame2 public partial class TitelschermGoT : Form private void Titelscherm_Load(object sender, EventArgs e) { pb1.Left = (this.ClientSize.Width - pb1.Width) / 2; pb1.Top = (this.ClientSize.Height - pb1.Height) / 2; pb1.BackColor = Color.Transparent; ...
0
5e86b4f9f454fad5cb0047f5e28170ba
cc9d903b9f7a35776255002d460f315c
1분 주기로 현재 날짜를 조회한다.
{ while (_dataService.isConnected.Equals(true)) { await Task.Delay(10000); currentDateTime = await Task.FromResult<string>(DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString()); } }
0
6124ed46ad9b6518caa4829f81bd40bf
a057eef5d4a4b530a8b4904a05ee039e
获取会员卡已兑换商品提示
var tips= getGiftCardConfig(); if(tips !="" && !isAllNotSupportGiftCard()){ $("#giftCardNotSupport").show(); } }
0
f900a548cbc4a17b9439fd9ba5f05717
24926a286e4a25da19f56c5f3c864abf
返回查封未解封详细信息页面
@GET("toxicLock/{id}") Observable<ResponseBean<QiYeSuoDing_Detail_Info>> toxicLockDetail(@Path("id") int id);
1
62382de83375748bc1c0df8193c05618
b393f4fb8630a3bf3ab43872bd68cd0e
Inverse hex dot
export class Hex public dot(b: Hex): number { return (this.q * b.q +this.r +b.r + this.s * b.s); }
0
587aa4c0a56bf34d58f274c7cd10e8f2
1ec29227b017dff4d95f05338dfd77ed
zoom to the selected feature on click
function addressSelect( event, ui ) { var view = map.getView(); var feat = ui.item.feature; var geom = feat.getGeometry(); view.setCenter(geom.getFirstCoordinate()); view.setZoom(19); highlight.setStyle(flagStyle); var markerSource = highlight.getSource(); ...
1
d5d09366f2d2f858d15ac265aa2be57d
d807e6be367a91e6c548baa0647c4452
Build Feedforward controller.
class FeedForwardNet(nn.Module): def __init__(self, d_model, dim_feedforward, dropout=0.1): super().__init__() self.fc1 = nn.Linear(d_model, dim_feedforward) self.fc2 = nn.Linear(dim_feedforward, d_model) self.dropout = nn.Dropout(dropout)
1
fc3b8878306a0cfafca8b1b630a89760
0f3ebb1b32c7b11de13be6232bc977a2
Whether it is the default NAT IP ADDRESS. Valid values:`true` or `false`.`true`: is the default NAT IP ADDRESS. `false`: it is not the default NAT IP ADDRESS.
public class aaaparameter extends base_resource public String get_aaadnatip() throws Exception { return this.aaadnatip; }
0
dd908f96a1ab452f1c50f10bd18032b7
aecc3054ed9d2972d6ef48d9d1a4301c
<Summary> Paints all children visible in the current viewport. </Summary>
namespace Alsing.Windows.Forms.SyntaxBox.Painter void RenderAll();
1
d7023d47cd8d631dac0c06d075618570
c226cc1add1f2f146f133f13ee7b4faa
calcule le hash d'une chaîne de caractère et l'affiche
static void MD5String ( char* message ) { hdMD5 *myMD5 = new hdMD5(); hdMD5::MESSAGE isHashed; char* hashedMessage = ""; isHashed = myMD5->hash( message, hashedMessage ); if(isHashed == hdMD5::SUCCESS) { printf ( "MD5 of << %s >> is\n%X", message, hashedMessage ); printf ( "\n\n" );...
1
01d8f07ad1b5458689db72b06489502b
9d6e9cc1cfc3b026a28ca17353509152
Set the specified player's score based on their ID.
public abstract class JavaGameCommunicator public final void incrementScore(short aiId, int increment) { connector.incrementScore(aiId, increment); }
0
98ecb7813384efba2e4bbd70b119ba35
f0571ce1ac816ea456556f28c8336056
Simple degrees-to-radians converter
double degrees_to_radians(double value){ return 2*M_PI*value/360; }
1
290c542e7ed0a3a4d472c19069631a41
9d24ba4a6cc73c9fa375f82fda5bc558
Generate a canonical marker image
{ assert(markerImage.rows == markerImage.cols); assert(markerImage.type() == CV_8UC1); Mat grey = markerImage; threshold(grey,grey,125,255,THRESH_BINARY | THRESH_OTSU); #ifdef SHOW_DEBUG_IMAGES imwrite("Binary marker" + ".png",grey); #endif int cellSize = markerImage.rows/7; for(int y=0;y<7;y+...
1
e1ffd3e4f95a4f8e1c839eb73e82c223
c05347823aecb71c73adb72a6168cfe9
Create tools and set their default parameters.
sculpt_params *init_sculpt_tool(yocto::scene_model *ioscene, yocto::scene_camera *iocamera, std::string shapename, std::string texture_name, scene_material *material = nullptr) { sculpt_params *params = new sculpt_params(); scene_instance *shape_instance = add_instance(ioscene, "object"); scene_shape * ...
1
c9b966e71737fc7df65e8933c4a45f39
96e81696b01a832adf010b2106b06986
This function used to be just cal NSString's cString, however this cause some downstream character encoding issues. Especially in the Event class. The fix for this was to tell this function to encode the string using UTF-8. Todd Schavey - schaveyt@gmail.com
internal static partial class Interop internal static partial class CoreFoundation [LibraryImport(Interop.Libraries.CoreFoundationLibrary, StringMarshalling = StringMarshalling.Utf8)] private static partial SafeCreateHandle CFStringCreateWithCString( IntPtr allocator, IntPtr str, ...
1
ec72b7c8bcd85a808621075ad0086579
30e4c577fbe3d07b752dea9b04769245
路点运行过程中启动暂停测试
class QtPath(QtGui.QWidget): def btnRunTestClicked(self): if self.tmrRunPath.isActive(): if self.testing: self.tmrRunPath.stop() self.btnRunTest.setText('Test') icon = QtGui.QIcon.fromTheme('media-playback-start') self.btnRunTest.setIco...
1
e90d74399f530a329829b946ed4e025a
96b198dd8e0e1e5f08e46c15b6ba9fc6
Get the list of Java class directories.
public String[] getClassesPath();
1
c2b9c8cc2cb8ab2a4ec946a3c76bf07b
94a3aead400ced150311f6eb0503dd1f
Parses the token.lexeme to get a value, if the lexeme is a literal.
var literal = token.getText(); if (dataType == null) new LogError("Unexpected token \"" + literal + "\"", token); switch (dataType) { case INTEGER: try { return Integer.parseInt(literal); } catch (NumberFormatException e...
1
8f64294186f1e8a3b9c0d49a5e58c22b
6317c3c1011fe31ef4e4e11c845c0e7d
Prints collection of ports statuses as a table.
namespace webport_comport_scanner.Printer void PrintTable(IEnumerable<IPrintablePortStatus> portStatuses);
1
efafcd3fd4882652cc6053920c1f3fdd
64d4bce22f8b60fe9372b18250a1128c
Create 2D list with given width and height.
def initial_2d_list(w, h, value=None): return [[value]*h for _ in range(w)]
1