query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4e6968cf5abf01460baba9218e13f76e | db2fa077b8e598027e96ee2ab4e2ca77 | Calculate number of all symptoms per day for chart SymptomsPerDay | Map<String, Integer> getSymptoms(); | 0 |
97415a1b7cb169f15c0fa7ba17fc8ca2 | bfc86ad8102831d5f3551063851f772a | Generate {@link ContentValues} (for insertion and update) for similar {@link Artist}s. | public class MatchPlayer extends BaseEntity
public @NonNull
ContentValues getContentValues() {
ContentValues values = super.getContentValues();
values.put(TableMatchPlayer.COLUMN_ENTRY_MATCH_ID, matchId);
values.put(TableMatchPlayer.COLUMN_ENTRY_ACCOUNT_ID, accountId);
values.put(Tab... | 0 |
241c1ec1275e85a46edb6cf64219f8e3 | fbd993128469d684bece1cbf459d15f7 | Add a value to a header field, supplimenting any existing values | this.parse();
if(!this.index.headers[header]?.[key]) {
let index = this.index.headers[header];
!index ? this.index.headers[header] = {} : null;
value = this.index.headers[header][key] = value;
this.write();
return value;
}
let i... | 1 |
38b7a5357b3f884bcf477e471abca155 | 87cdf92708d86f893400ad9f3e82635b | Validates document signature, returns +true+ on success, +false+ otherwise. | public class DigestSignature extends Signature
public boolean verify() throws CipherException
{
messageDigest.init();
messageDigest.update(document);
messageDigest.computeCurrent();
return equals(cipher.decrypt(signatureBytes), messageDigest.digestBits);
} | 1 |
ca73d0dbc5ef5d9a81996c8ce872a7c6 | ecbc6204909ebff678a21c81778a07e1 | Start Caddy. | class Client
public function setCaddyHost(string $caddyHost)
{
$this->caddyHost = $caddyHost;
return $this;
} | 0 |
057735b32aa451a863e6b2f4745e5182 | 559fb3d30b5a295f123825ab023e7949 | check-function for reading input-ports | class Testbench:
def read_port(self, name):
def func():
return self.dut[name].value
return func | 1 |
33eb04e915c27159e1b396299471d9d2 | 916a6dad76c70ed95037a4c512dc956e | 将已赋值字段设为索引 | class Func
public static function setFieldIndex($list, $index)
{
if (empty($list)) {
return [];
}
$ret = [];
array_map(function ($val) use($index, &$ret) {
$ret[$val[$index]] = $val;
}, $list);
return $ret;
} | 1 |
48aa27a67f85bfae0b30276c90f1e6e3 | e95a9ee37a177288161a6a27be2c790f | Ensures the department pages do not require login. | class DepartmentPage(JanisBasePage):
def janis_urls(self):
if hasattr(self, 'department'):
return [f'/{self.slug_en}/']
return [] | 0 |
aefc6ce72ed9ca1a52c5e441bbbf30de | a25c206f76fac8520f8818e1140771cc | Returns a target-total bounded distribution sample. | def distributions(draw, pool=all_distributions):
return draw(sampled_from(pool)) | 0 |
4581c0d96d11f34929ce2a153dcd2f48 | 918fc0fd0963304da85123065401e474 | 设定整体校验结果. 1-未被判为转载,可以群发,2-被判为转载,可以群发,3-被判为转载,不能群发 | class IdCardCollectForHT extends ResponseSignedValue
public function setLicCodeResult(string $licCodeResult): IdCardCollectForHT
{
$this->licCodeResult = $licCodeResult;
return $this;
} | 0 |
5697f5fc39064962f4b905db0ad0da64 | 7d1e627bc9df9a4172814c6eca05695e | Add a new wish list for the given owner, ensuring a unique name | public class DatabaseHandler extends SQLiteOpenHelper implements WishlistObservable
public long addWish(Wish Wish){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(WISHLIST_KEY_MESSAGE, Wish.getMessage());
values.put(WISHLIST_KEY_CHECKED, Wish.getChecked())... | 0 |
ce2d1d421370e1b90f05afb4289a9350 | 68e422c2a6806d558090fea871d1f6dc | Sets the value of idhour. | public void setHrId(String hrId); | 0 |
9c76f12cfd694447a1f9364cc76d8c2a | bcbd2631f396cba7b2478fe760164547 | 自动发送选课请求 | public class FocuseFragment extends BaseFragment
private void LectureRequest() {
new Thread(new Runnable() {
@Override
public void run() {
try {
long lastLecureID = Utility.lastLetureinDB(mLectureDao);
String response = HttpUtil.LectureRequest(ConstantClass.ADDRESS, ConstantClass.LECTURE_REQUEST_C... | 1 |
3a9171f9a905a1f4796fbf902897bb48 | 9b0f2b98bcb810198564bab7a0171114 | Confirm the security warning override. | {
static boolean retval = FALSE;
static boolean fuse_checked = FALSE;
int fuse_value = 0;
if(FALSE == fuse_checked)
{
tzbsp_mem_map_device(TZBSP_MMP_SEC_CTRL_SECURITY_CONTROL);
#if DAL_CONFIG_TARGET_ID==0x8916 || DAL_CONFIG_TARGET_ID==0x8936 || DAL_CONFIG_TARGET_ID == 0x8929
fuse_value = HWIO_INM(O... | 1 |
6c88c51420c86a63546223051259163e | 028ff8a014a42b38b7cfa4baef8587b5 | 通过数据库信息判断是否支付成功 | Boolean queryPayResult(MallOrderInfo order) throws Exception; | 1 |
03d7de485e11038c92e4baf9273b4292 | 1d789af62bc01d02c13c3c9faa0ee233 | ステージ平均評価ランキングを取得する。 | let where = {};
if (headerIds) {
where['headerId'] = Array.isArray(headerIds) ? { [Op.in]: headerIds } : headerIds;
}
return await StageRating.scope("withheader").findAll<any>({
attributes: [
'headerId',
[Sequelize.fn('AVG', Sequelize.col('rating')), 'rating']
],
where,
group: ["headerId"... | 1 |
af5c7eb8d7ba4275e1a2605d86c0a0d2 | 11856bfb29fc3486f61c7a10d1dcf6a9 | bu metod sistemde tanımlı olan ve rezervasyon yapılabilecek maç saatlerini gönderir. | Reservations reservations = new Reservations();
reservations.setDate_start(startDate);
reservations.setDate_end(endDate);
reservations.setId_room(LoggedUser.getINSTANCE().getUser().getId_hotel());
reservations.setId_package(personsNumber);
Message message = new Message(... | 0 |
6be1a7adf126b1a59385081cd8c25c6e | 057b6ca248533690727adc4029f0e7fb | correspond au read | if(Variable::where('pclient_id',$idClient)
->where('name','read')->count() > 0)
{
$read = Variable::where('pclient_id',$idClient)
->where('name','read')->get();
$read = $read[0];
$read->value = "1";
$read->save();
... | 1 |
0e7b2bf468fc268e3dd25218fbab4129 | f1906f0024f68e4e5c6dfbfb07f85fc1 | Returns valid entities which are valid for given moment in time.
Valid entities have:
1. Begining is not NULL AND is LESS than given moment in time.
2. End is NULL OR is GREATER OR EQUAL than given moment in time. | condition = (
models.Q(
valid_datetime_start__lte=date_time,
valid_datetime_end__gte=date_time) |
models.Q(
valid_datetime_start__lte=date_time,
valid_datetime_end__isnull=True)
)
return self.filter(condition... | 1 |
a455eb2557c8c3fd677601c0e6b0745c | 0acbf40c959792d7b5ac8d6d5fbbd502 | Converts vertically integrated temperature advection into heat transport | class _EBM:
def diffusive_heat_transport( self ):
return ( 1E-15 * -2 * np.math.pi * np.cos(self.phi_stag) * clim.a**2 * self.K *
np.append( np.append( 0., np.diff( self.T ) ), 0.) / self.dphi ) | 0 |
c8cec1ff8b1ce7512b49d53b7b3fec01 | b0a8f95865c6552c04c3cbc77010bf3e | Write geopandas.GeoDataFrame with Point geometries to point xy files. | df["geometry"] = df.apply(
lambda row: Point(row.lon_lowestmode, row.lat_lowestmode), axis=1
)
GeoDF = gp.GeoDataFrame(df)
GeoDF = GeoDF.drop(columns=["lat_lowestmode", "lon_lowestmode"])
GeoDF.to_file(outfile, driver="GeoJSON") | 1 |
bee1e03a328846e538097b05625e3905 | e5e9678fd8133505d98d4e666bcf2909 | https://github.com/numpy/numpy/blob/4adc87dff15a247e417d50f10cc4def8e1c17a03/numpy/core/tests/test_numeric.py#L2456-L2458 # noqa: E501 | torch = sys.modules.get('torch', None)
if torch is not None and isinstance(dtype, torch.dtype):
_probably_float = dtype.is_floating_point
if hasattr(dtype, 'is_complex'):
_probably_float |= dtype.is_complex
else:
_probably_float |= dtype is torch.complex128
... | 0 |
0763194f19113ebbe0dd04c0916e2ea2 | f450b649c5e672e559b51d2a2ab58453 | コンソール読み書きテスト | func main() {
if _, err := io.Copy(os.Stdout, os.Stdin); err != nil {
fmt.Printf("err=%v", err.Error())
os.Exit(1)
}
f, err := os.Open("main.go")
if err != nil {
fmt.Printf("err=%v", err.Error())
os.Exit(1)
}
defer f.Close()
if _, err := io.Copy(os.Stdout, f); err != nil {
fmt.Printf("err=%v", err.Erro... | 1 |
5f78ac66ca1df3f2e853cbc0b52a8ea8 | 2e1582eb81ad97e94f260f1010d4751e | *INTERNAL FUNCTION*
Computes the degree matrix, D.
INPUT:
inputMatrix - adjacency matrix to be used for computation
OUTPUT:
degMat - degree matrix to be used to compute Laplacian matrix | if ss.isspmatrix(inc_mat) == False:
inc_mat = csr_matrix(inc_mat)
sqr_mat = inc_mat.power(2)
sqr_sum = ss.csr_matrix.sum(sqr_mat, 1)
deg_mat = ss.csr_matrix.multiply(ss.identity(sqr_sum.shape[0]), sqr_sum)
deg_mat = csr_matrix(deg_mat)
return deg_mat | 1 |
a3c5f2f94b3e74c2acd20e88d0eec192 | c7c8c127c04ff53f37f2ff33e5fdd9ac | Retorna un float con el valor de la operacion de los atributos valorA y valorB.
Utiliza una selectiva segun el simblo asignado a operador | {
double resultado = 0;
if (string.IsNullOrEmpty(operador))
{
operador = "+";
}
operador = ValidarOperador(operador[0]);
switch (operador[0])
{
case '+':
... | 1 |
3dd9fc4009146fdd93e5a211b8a2d6bd | 0ed4e8acbb4b985a43844ebf384a84ad | La función activar opciones se llama desde el boton opciones, su funcion es ocultar el canvas menú y mostrar
el canvas opciones. | public class TiltleMenu : MonoBehaviour
public void OptionsMenu() {
TitleCanvas.SetActive(false);
ControlsCanvas.SetActive(false);
VideoCanvas.SetActive(false);
AudioCanvas.SetActive(false);
OptionsCanvas.SetActive(true);
} | 1 |
8b806c3bf16118c65ca29c2a575da66a | 49f28438b68eea124e58ddfafd6875bd | 获取经纪人房源信息 | class Sell extends MY_Controller
public function lists($page = 1)
{
$broker_info = array();
$broker_info = $this->user_arr;
$broker_id = intval($broker_info['broker_id']);
$role_id = intval($broker_info['role_id']);
$data = array();
$data['city_id'] = intval($broker_info['city_id']);
$comp... | 1 |
ea790296784d8ca850300baccafbc588 | bcf5d6e38ccb9bf17fc8543763191015 | 포인트 내역 갯수(페이징용) | public int findPOListCNT(Map<String, Object> params); | 1 |
bc250c6b2c3df1785fcd8ca287cd21b5 | bb48ae03b813eb8a0cfd4e7255b88f81 | returns true if this entity is to be removed from the world completely | public abstract class Actor
public boolean shouldRemove() {
return death;
} | 1 |
9237f4dff6bc06b4ec6cd4529e7ff9d6 | 1506257e3be670b78bcaea632b824903 | Gets the value of the attribute {@link #keySelector}. | public ObjectPredicate getKeyPredicate (); | 0 |
a94f234b6a9580ab94c92e7c0033de6b | 870c69168370cacffac3fe6bcc33b614 | 一车一档信息分页查询 | @RestController
@RequestMapping("/admin/carSource")
public class CarSourceController
@AdminRole
@Valid
@PostMapping("/oneCarOwnerCarSourcePage")
public ServerResponse oneCarOwnerCarSourcePage(@RequestBody @Valid RequestParams<CarSourcePageDto> requestParams,
BindingResult result) {
Page page = requestParams.get... | 1 |
33e0544d42762e9a639a3675f408fbdd | d852c337bee861704924919feaa33a68 | :summary:同时检查多个包的更新状态 | data = self.package_status(pkg=service, pkg_type=pkg_type, timeout=timeout)
last_dict = {}
for id in data:
for service in data[id]:
tmp = {
'version': data[id][service]["version"],
'path': data[id][service]["path"],
... | 1 |
4750a54a455bcdf88ce570f48dd5b2f5 | 72fb2e2c48e7feae6f9d539f2053443b | GET /losts | class GuestController extends Controller
public function searchLost(Request $request)
{
$losts = Lost::search($request->input('key'))->orderBy('created_at','desc')->paginate(15);
return view('lost.home',compact('losts'));
} | 1 |
c16ce3ff574afe39b69b6c7d4685f765 | 2c123aed1ba9c99fbd361b4cc1f1a8dc | Retrieve sufficient statistics from the seed decoder. | class TopicAwareNMTEncoderDecoder(NMTEncoderDecoderWrapper):
def update_stats(self, stats, summary_writer, start_time, step_result):
(_, step_loss, step_predict_count, step_summary, global_step,
step_word_count, batch_size, grad_norm, learning_rate) = step_result
summary_writer.add_summary(step... | 0 |
ca1116190c974eb8bb82fc4330e6ac92 | 2e438bb2e3d782e8b374da1707145353 | 数据库结果验证 | ValidatorModel vm = new ValidatorModel();
ImportErrorMessage errorMessage = new ImportErrorMessage();
List<String> dqllist = dataSource.get(drlpzModel.getDrlmc());
String error = null;
if(dqllist != null && dqllist.size() < ImportConfig.Thresholds){
String sql = this.getSql(drpzModel, drlpzModel);
List<... | 1 |
ec33d6efcbc55072f1b906a9110b109a | c9b1e9760bb644d68171777f615e090b | Make empty intensity array. | IntensityMap.__init__(self)
self._nbins = nbins
self._cdf = self._bins = self.subset = None | 0 |
f9e23b63bf0f4b0107b48fa6888c0a8f | 6a6dfaad678737f87d5cccdbe5ff74ce | 百度搜索输入框的属性值 | class BaiduTest(unittest.TestCase):
def test_003(self):
t.sleep(5)
self.driver.find_element_by_id('kw').send_keys('webdriver')
self.assertEqual('webdriver', self.driver.find_element_by_id('kw').get_attribute('value')) | 1 |
e503d9db8fa58c5e2a9c7e3851148e68 | fdeb906c8a66f8bf0383a01af34a966e | moving pool objects into place | public class ForestGeneration : MonoBehaviour
private void OnEnable()
{
for (int i = 0, end = poolObjects.Count; i < end; ++i)
{
poolObjects[i].transform.position = new Vector3(transform.position.x,
poolObjects[i].transform.posi... | 1 |
9184d293e4d5e8f9cdb6b397805c5ea3 | 2989a439862cae58ef0e8c9a2b556aa7 | Retrieves a team object from slack. | class SlackAPI:
def teamInfo(self, **kwargs):
res = self.get('/team.info', kwargs)
return res.status_code, res.json() | 1 |
7544238551f66e4f8a8be1a130aed7a8 | 26d798b297fab1828ab09cfc814cb85f | !
Test case when there is no valid snmp related section | static void scan_confirm_null_test(void **state)
{
struct MLME_SCAN_confirm_pset scanTest = {0};
scanTest.ScanType = ENERGY_DETECT;
scanTest.ResultListSize = 5;
assert_null(MLME_SCAN_confirm_get_pandescriptor(0, &scanTest));
scanTest.ScanType = ORPHAN_SCAN;
assert_null(MLME_SCAN_confirm_get_pandescriptor(0,... | 0 |
994c9b75e2ece7d9a6d282ae5156fb24 | 58aff1fde4d5c34e7fccce2f15354bef | print the values of v in the list, starting at node n. | void print_node_list(node_ptr l)
{
for(;l;l=cdr(l)) {
print_node(tlvstdout,car(l));
fprintf(tlvstdout,"\n");
}
} | 1 |
baf438ec674dba0f7aa3ef2c30828ebe | 6c43740c15db2340baa83109997cccf7 | tests elements on transaction start page | class MiningViews(TestCase):
def test_start_mining_on_page(self):
self.client.post(reverse_lazy('login'), {
'username': 'bob',
'password': 'password'
}, follow=True)
response = self.client.get(reverse_lazy('mining_home'))
self.assertIn(b'Time to mine!', response.c... | 0 |
e37076993247539ce068c08b6fe2c01d | 9d3c287623cf53196131513ee817d2a8 | Método que devuelve un indicador booleano para determinar si el tipo de
gestión es comercial o no. | @Stateless(mappedName = "cl.teso.reca.pkgcutservicestrx.PkgCutServicesTrx")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class PkgCutServicesTrx implements PkgCutServicesTrxRemote,
PkgCutServicesTrxLocal
private boolean esFrmGiro(BigDecimal frmCode) throws Exception {
if (frmCode != null
&... | 0 |
f6e540bd5eaaa29743e5698b23cfb0a3 | 17c66054668ac1599a371a588d822ab5 | **********************Normal ******************************** | void Normal_Mode(int r){
if (c<r){
GPIO_PORTB_DATA_R = 0xE1;
delay(10000000);
GPIO_PORTB_DATA_R &= 0xC0;
c++;
}
else if(c<2*r){
GPIO_PORTB_DATA_R = 0xE2;
delay(10000000);
GPIO_PORTB_DATA_R &= 0xC0... | 1 |
dff23beea10d7e5873979a25b84ebcb6 | 3c5bfb4081825b6bb7ea65b293a3d05d | Sets the path leading linking nodes | class SectionCaseImplementation extends CaseImplementation
public function setNodePath($nodePath) {
$this->nodePath = $nodePath;
} | 1 |
b476e3ce1e7e1ce80b51a226f748fcd1 | 03cc14c2e597b330940d98533e17921e | Calculate the total file size in bytes for all files with file extension
of ext arg found in directory hierarchy | class MyGameFlowSaveGameTest(unittest.TestCase):
def __count_files_by_extension(self, extension):
_files_amount = 0;
for root, dirs, files in os.walk('.'):
for file in files:
if file.endswith(extension):
_files_amount += 1
return _files_amount | 0 |
c4db1d798031127ecaebdb120dcb1e9a | 21eee8022bd8d73fe5a799aaa75907d4 | Set Centrally maintained. Information maintained in System Element table | public class X_AD_Field extends PO
public void setIsCentrallyMaintained(boolean IsCentrallyMaintained) {
set_Value("IsCentrallyMaintained", new Boolean(IsCentrallyMaintained));
} | 1 |
265231dff760f14943557c85c14c5a56 | 01392a68d5412f77215bd3184498e6b2 | This internal method listens for authentication state changes and upon detecting a change, fires an AuthEvent | function onAuthChange(authData) {
AuthResultsManager.set('monitorState', authData);
} | 0 |
fcbe076abf0c25203cc2329e08a1a764 | c64b322f5ca869de728134f5202a0657 | 通过区域编码找到区域选择器需要的三级区域数据
参数:第三级区域编码 | let codes = [];
for (let i = 0; i < dsy.length; i++) {
var province = dsy[i];
if(province.children == null){
if(zoneCode == province.value){
codes.push(province.label);
return codes;
}
continue;
}
for (let j = 0; j < province.children.length; j++) {
var city =... | 1 |
fa1b4592562a9926f46aca84dcdf9916 | 31fafebee07cafd4867548049acab582 | Finds the index in the grid, using the number of bins,
and the max and mins for the categorical and numerical
data attributes | col = X[:, i]
if self._maxs[i] is None:
self._maxs[i] = col.max()
self._mins[i] = col.min()
col = col - self._mins[i]
col = col / (self._maxs[i] - self._mins[i]) * NUM_BINS
col = np.floor(col)
col[col < 0] = 0
col[col >= NUM_BINS] = NUM_BIN... | 1 |
dd7284901ab8911870741ebb1121ef71 | 5fbfc5f3f6e7d6631e031e6318730eed | Serialize a scene object to the 'xml2' format. | {
IRegionSerialiserModule serialiser = CurrentOrFirstScene.RequestModuleInterface<IRegionSerialiserModule>();
if (serialiser != null)
serialiser.SavePrimsToXml2(CurrentOrFirstScene, filename);
} | 1 |
b5921ba1f9dae6e89dd09a533f4d5644 | 237a5305cb77a8e158ccf095279dc0a5 | При выключении необходимо проверить, работает ли анимация. Если да, то кинуть остановить и сообщить об этом. | [RequireComponent(typeof(Animator))]
public class AnimationController : MonoBehaviour
void OnDisable()
{
_playableGraph.Destroy();
} | 0 |
440151edfff2e3d523a7a6e767791235 | 85f758041fd6428c81a3ca707fa5c252 | Drops a table from the JDBC database. | public void dropTable(String tableName) throws Exception; | 1 |
8d6a8ccb0f8e21a306d7cae16f7e39b3 | 152c410549a6310d643a2c9afff7db7e | module class and nessesary information | Q_H.__init__(self)
self.ex=100
self.i=0
self.n={"a1":5,"b1":5,"a2":5,"b2":5,"w_theta":5,"D0":5,"AN":5,"QN":5,"Bz":5}
self.g={"V1":5,"V2":5,"phi":30,"MWwidth":5,"MWfreq":5}
self.d=1000
self.a=0.75
self.resample_threshold=0.5
self.approx_ratio... | 1 |
edbcde9df07eeafd68d3156146788fc8 | a5953b0361d01a507fc7304ed6dc24d1 | the common usage of decorators, like doing some logging. | def logged(meth):
def wrapper(*args):
print("LOGGING {meth} {args}".format(**locals()))
return meth(*args)
return wrapper | 1 |
28af80bb036ff576ea7816c9f7d5955c | 8b67aff60174b4e8cc7bb08cfde8abfd | Test of setBank method, of class Agency. | {
$Account = new Account();
$value = "Heidelpay";
$Account->set("bank", $value);
$this->assertEquals($value, $Account->getBank());
} | 0 |
467d84af1450a9fe474cb8c0e93144a3 | 5b3ae9f4a82003ac9ec84390c87eb805 | This implementation will only work if elements occur exactly
once or twice in the input. | public class MajorityElement
public int vote(int[] nums) {
int count = 0;
int candidate = 0;
for (int num : nums) {
if (count == 0) {
candidate = num;
}
count += (candidate == num) ? 1 : -1;
}
return candidate;
} | 0 |
febb232916cba566cb8693fdac85f55a | 0c5029d3370e8a131003011045fd60af | Just enable the persistence for GatewaySender and see if it remote site receives all the
events. | @Category({WanTest.class})
public class ParallelWANPersistenceEnabledGatewaySenderDUnitTest extends WANTestBase
@Test
public void testPersistentPartitionedRegionWithGatewaySenderPersistenceEnabled() {
Integer lnPort = vm0.invoke(() -> WANTestBase.createFirstLocatorWithDSId(1));
Integer nyPort = vm1.invoke(() ... | 1 |
2217fb404b148da554f2de0dd79581e4 | ac7c671d5ef5e1e846e0fc4de56a3b8b | zdecyduj, gdzie użytkownik ma być przekierowany po zalogowaniu | namespace SerwisOgloszen.Controllers
public class UzytkownikController : Controller
[HttpPost]
public ActionResult ZewnetrzneLogowanie(string provider)
{
return new ChallengeResult(provider, Url.Action("ZewnetrzneLogowanieCallback"));
} | 0 |
4a50988f83f8f6bdfb9fc3dbee479d7e | f78cb10fbe6f0c195ef0b2db03842578 | 上架 | {
(new CurrencyValidate())->myGoCheck(['goods_id'], 'require');
(new CurrencyValidate())->myGoCheck(['goods_id'], 'positiveInt');
UserAuthority::checkAuthority(8);
$data['goods_id'] = request()->param('goods_id');
$upd_number = GlGoods::where($data)->update(['is_on_sale' => 1... | 1 |
ef8554d5db35d4e42b568ffd320e5025 | 0a2a55ed0510ced973ec38aa31e72b25 | Returns the richieste sequence with the primary key or returns <code>null</code> if it could not be found. | public final class SequenceManager
public Sequence getSequence(AutoIncrementMapping fieldDef, String dbKey) throws SQLException {
return getSequence(fieldDef, parent.selectTarget(dbKey));
} | 0 |
322593714495cad5bda30ea174102875 | c99e62265b4aca89781257f58b77ba99 | 根据C#类型返回对应的SQLite类型名称 | {
string reval = string.Empty;
switch (type.ToLower())
{
case "int":
reval = "int?";
break;
case "integer":
reval = "int?";
break;
case "text":
... | 0 |
3f8f83f3c394a823a6ad2a801d0c6a69 | 262d9159cf68ceed00182de27eef62d8 | 验证查看投票调查表权限(查看投票状态) | class BaseAction extends Action{
public function checkVote(){
if($this->user['right_vote']==1){
if($this->user['grade']==3){
$condition['status']=array('eq',1);
$condition['type']=array('eq',1);
$data=D('Election')->where($condition)->find();
if($data){
$no_vote=D('VoteMember')->where(array('v... | 1 |
b08d80de42761697cc9412d9d7c6c63f | 1f1f261b25f9735674f80a8bcce5c979 | copies working debugging points to real debugging points. prevents flickering. | static bool set_hwbpts(HANDLE hThread)
{
CONTEXT Context;
Context.ContextFlags = CONTEXT_DEBUG_REGISTERS | CONTEXT_CONTROL;
int ok = GetThreadContext(hThread, &Context);
if ( !ok )
{
deberr("GetThreadContext");
return false;
}
Context.Dr0 = hwbpt_ea[0];
Context.Dr1 = hwbpt_ea[1];
Context.Dr2 =... | 1 |
600bc342b62dfd03b1e567915d3453f7 | 9e1d258251448028d851900fb7bfaa4e | Creates a unique id using the <a href="https://en.wikipedia.org/wiki/Cantor_pairing_function">Cantor
pairing</a> function. | SecureRandom ng = numberGenerator;
return Long.toHexString(MSB | ng.nextLong()) + Long.toHexString(MSB | ng.nextLong());
} | 0 |
8d549e74f36009937771ab2392da010d | 2270f68cb3e22106903542bf20f1d041 | bitwise addition of numbers | public class Questions
public static void addBitwise(int x, int y ){
while(y!=0){
int carry = x & y;
x = x ^ y;
y = carry << 1;
}
System.out.println(x);
} | 1 |
99a3f97e06c1e66f452558a3cfe6b17b | 153cb1e0a1024027ac1e8ef264ead081 | 返回正常状态view | public class BaseController
protected String goSuccess() {
return SUCCESS_VIEW;
} | 1 |
f69cb33e856986ee60b02e96557e7a15 | bb46145398e91be63190c03deeb66774 | liga dois vertices simultaneamente (sem direcionamento) | void desligar_vertices(Grafo* a, int u, int v){
a->mat[u][v] = 0;
a->mat[v][u] = 0;
} | 0 |
10bc5bf82f5a722f87dc9f341e95bdcc | 8beb2213a938ab4c7802b6245794a47a | Creates a new virtual disk at the specified location on a file system. | public void Create(long size, VirtualDiskCreateOptions options) {
Create(VirtualDiskType.AutoDetect, size, options, 0, 0, false);
} | 0 |
aa0d866b5f71468bf645c1ec91460a20 | 260d2af77f17946454dc1066de158bd6 | 功能:将一个bool变量压入函数参数栈(函数调用传参) | void LuaFuncParamItem::SetBool(bool value) {
ReleaseValue();
m_type = LUA_TBOOLEAN;
m_bool = value;
} | 1 |
42e1ef8bca20bef76cc41777875c4825 | a77c510009ce57e36ae19baf10085a9a | 底部启动Activity动画 | public class BaseActivity extends SkinCompatActivity implements OnClickListener
protected void activityAnimationDown() {
overridePendingTransition(R.anim.activity_down_enter,
R.anim.activity_down_exit);
} | 1 |
2ffec3cc242f74f8f6ad2fb30beb40cc | f7f34029026d92cfc3f1860ba5f15554 | Searches through child objects in a one-to-many relationship. | CancellationToken cancellationToken = default)
{
return _convenience.SearchChildrenAsync(parentId, details, offset, limit, cancellationToken);
} | 1 |
ed33a87f003f65a264b6de76516a07b9 | e637372774d3474cba54b6a55c7f5156 | 二叉搜索树的第k个结点 | class Solution{
TreeNode* KthNode(TreeNode* pRoot, int k){
if(pRoot == NULL || k <= 0)
return NULL;
TreeNode* p = pRoot;
stack<TreeNode*> s;
int cur = 0;
while (p || !s.empty()){
while (p){
s.push(p);
p = p->left;
... | 1 |
06ba7d6d0078b89bd7b4153684e9cdbe | 92903629dacd7b5e300f3e9fa59c4bd3 | No per VA invalidate on Kepler, redirect to invalidate all. | class VEGA3dDevice
#ifdef VEGA_BACKENDS_USE_BLOCKLIST
: public VEGABlocklistDevice
#endif // VEGA_BACKENDS_USE_BLOCKLIST
void VEGARenderTarget::invalidate()
{
backingstore->Invalidate();
} | 0 |
7b005231639dbeed463451d5ee3ac61e | d717be1565312c071353cd59dae97cf7 | 获取多媒体文件 - 后缀(包含.) | let suffixName = ''
if (typeof files === 'object' && files.name) {
const extendsNameReg = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/
suffixName = extendsNameReg.exec(files.name).pop().toLocaleLowerCase()
}
return suffixName
} | 1 |
f22a752eeabf22da384038d0cb13792a | 3a961253914542d8e87d6403c57df23d | 対象が全角記号かどうかを判定します.
ASCIIコード内の記号はtrueになりません. | final class StringUtils
public static function isFullWidthCharacters($char)
{
return !preg_match("/[^A-Za-z0-9\・\ー\=\/\!\?\$\¥\ \.]/", $char);
} | 1 |
ef098342d5878b7b7bf3173bec77c37f | 30535933d9116faab8d098f528deba5f | # Creates data with conversion rates at two time points
# Requires exchange rates with the same base | A <- data.frame(Date = dates, max = maxi, min = mini, normal = normal)
B <- data_set[, 1 : 2]
df <- merge(A, B, by = "Date", all = TRUE)
return(df)
} | 0 |
5a0ab4ef1f95b70ad67fde8ee40f3b88 | e6226b221fc36f11c3960ceec8c2d2b8 | 展示未知来源安装 | try {
InstallSourceInfo installSourceInfo = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
installSourceInfo = context.getPackageManager()
.getInstallSourceInfo(context.getPackageName());
}
if (Build.VERSION.SDK... | 0 |
ae526a49aaf5ccca5d62a761ebb72247 | 7ae824776c4ee4f639b39f51c8bb4d93 | Tab-complete an EmPyre stager module path. | class MainMenu(cmd.Cmd):
def complete_load(self, text, line, begidx, endidx):
return helpers.complete_path(text,line) | 1 |
40440bb374966d04a7a6e2c2314e7d3a | 29f918e24daccd1f03af39e9c34ab333 | Checks if a data collector has been added | public abstract class Collector
public boolean isDataExists(String contentId) {
return false;
} | 0 |
fc33da4edb93f05dd41657f3e6c5bc59 | 5b73bd1adc36a93b187472cbfdb4fac0 | Clear the current list and add new planning periods to it | processing_rows = [
LC.SCHEDULE_PLAN,
LC.SCHEDULE_PAYMENT,
LC.SCHEDULE_OPEN_DELAY,
LC.SCHEDULE_DELAY,
LC.SCHEDULE_CORRECTION,
]
plan_row = period_rows[LC.SCHEDULE_PLAN][0] if period_rows[LC.SCHEDULE_PLAN] else None
open_delay_ro... | 0 |
4e8a87d3d6431f0c125ee21402d5d82c | 5ac3954af0dbd1d7a2f0494301277716 | 主キー列の値を指定して個別配信メールキューを削除します。 | if (sendMail == null) return;
if (attachments == null || attachments.length == 0) {
sendMail.setAttachedKeyList(null);
this.send(sendMail);
return;
}
BlobFileService fileService = BlobFileService.getInstance();
List<BlobKey> attachedKeyList = new ArrayList<BlobKey>(attachme... | 0 |
370890a397102f7e75c0b56cd146b597 | 2e1336d2c83116eaf922a679e5a38f32 | 批量删商品的种类 | class ProductController extends Controller
public function product_type_del(){
if($_POST['upload']){
$type=M('gtype');
$goods=M('goods');
$ddate=json_decode($_POST['upload']);
foreach($ddate as $val){
$typen=$type->where("pid=$val")->select();
$goodn=$goods->where("typeid=$val")->select();
... | 1 |
568d135fb0bed0e2dfb15dd5c5faa64a | 7dbcf70d32d805b4ba12db7f018ad7e0 | Should be called when the player enters a Tile so that the graphics can be adjusted. | class Help(location: Point, uniqueId: Id) : Tile(helpImage, HELP_TYPE_ID, location, uniqueId)
override fun onEnter(interactor: UnitBase, direction: Direction, engine: Engine) {
if (interactor is Player) {
}
} | 1 |
061d21ee0531318d96f2503531b61e0d | b5b932ecdf8499c9a9280f938567ca06 | <code>
<![CDATA[
senses ::= ( NIL | "(" ( NAME | <full-sense> )+ ")" )
]]>
</code>
If NIL is given, an empty list is returned. | class BehaviourDict:
def getSenseNames(self):
return self._senses.keys() | 0 |
0b0452f1969459c72f5f1958a29d5377 | 3b37825dd0ec16baa1f31a72ef4dd8c4 | Function for compensating the change in focus caused by x-y movement. | af_alg_PDAF_internal_t* pd,
af_pdaf_input_t* input,
INT defocus)
{
if (NULL == pd || NULL == input)
{
return -1.0f;
}
FLOAT delta_x, delta_y, focus_pcnt;
INT i, num_entries;
const chromatixPDFocusTableType* focus_table_tuning = &pd->pTuningInfo->pPDAFTuningData->focusTable;
... | 1 |
99c38c064a651cf346969362101a0aa7 | 16dc137dedf61cb1ee190c56775bad4b | Initiates the asynchronous execution of the CreateProfileJob operation. | {
ValidateInputParameters(importProfile, callerContext);
importProfile.Action = ObjectAction.Create;
return Process(importProfile, callerContext);
} | 0 |
49bb476665d3f091d420cba01074fe7c | 7146b78ee487c1db6d25acae97f9ef42 | Process event log file and insert records into db | with open(log, 'r') as logs:
while True:
line = logs.readline()
if line:
dct = LogToDct(line)
InsertToDB(dct, cnx, cursor)
else:
time.sleep(0.1) | 1 |
236b443f31930685afa2264bf15e6ca3 | 1dc7c95914f1d6427d394346aa18178c | slot called when user modifies the color tolerance line edit text. It will update the slider
to match the new entry. | namespace nmp
void DkDocAnalysisToolBar::on_toleranceBox_valueChanged(int value) {
emit toleranceChanged(value);
} | 0 |
a948c7534b50177ce0efc5b8c9f64d68 | 04e6987dcaf3b72068f9cbfdb2d044eb | deducts the energy when poisoned | {
float Damage = Random.Range(80.0f, 120.0f);
Energy -= Damage;
} | 1 |
70b6e10f0a9aeec00b7ac6b91ca6d2cd | fe54344c3f7d55fe326f0b43088b578f | When a unit is hit, this tells the current location and all
surrounding locations that they are on fire | if (this.hexLocation == combatUnit.currentLocation) {
this.isPassable = false;
this.tileCombatUnit = combatUnit;
}
} | 0 |
2e7d191b68ad97a9d871981e189d2651 | 1db250bae7886221c0dd3cd25281761d | 计算间隔毫秒 | function runTime:cmpTime()
local diff=(os.milliTime()-self.startTime)
printf("间隔:%s 秒",diff/1000)
return diff
end | 1 |
f95df9763d999d32f2a13c4ecf3964d8 | aed0ca9909dfa77c41e5b5d074cbf761 | Gets rows from the datasource based on the PointBalanceDetail_PK index. | {
int count = -1;
return GetByID(transactionManager, iD, start, pageLength, out count);
} | 1 |
0d5c42c207db0ae82e3049ca3682f10d | b33a20448927613f8f50e0f2c6482d2a | 房间编号 | namespace _11111
public partial class Main_Windows : Form
private int RoomNumber()
{
Random random = new Random();
return random.Next(100000, 999999);
} | 1 |
f600f6376a7af1312e847fabd19b5619 | bf16c97787f28c90500cf9ec2d3199d5 | Cette fonction permet de recupérer l'emplacement d'un fichier texte
ouvert à l'aide de l'interface graphique | public class NavigationFichier extends JFrame
private File getFichierFromUser(){
JFileChooser fc = new JFileChooser();
FileNameExtensionFilter filter = new FileNameExtensionFilter(".txt", "txt");
fc.setFileFilter(filter);
if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
... | 1 |
bc38254b3f686c1fee87f9aff65e8380 | 9f29846dd060df550ddb86d9ec7a37b6 | Sets a different color to all the company services. | Drawable myIcon = ResourcesCompat.getDrawable(getResources(),R.drawable.ic_action_person, null);
if (myIcon != null) {myIcon.setColorFilter(filter);}
myIcon = ResourcesCompat.getDrawable(getResources(),R.drawable.ic_action_storage, null);
if (myIcon != null) {myIcon.setColorFilter(filter... | 1 |
18f844497244619a011c4ecf250b5f34 | 842f48e465bcf0fc7c979183c2d02f24 | 向整数集合中插入元素value,success表示插入成功或失败 | bool success;
if(!(pSet->Data)){
if((success = CSet_Init(pSet, DEFAULT_CAPACITY))){
return CSet_Insert_(pSet, Value);
}
else{
return false;
}
}
else if((pSet->Usage) == (pSet->Capacity - 1)){
success = Extend_CSet_Data_Array(pSet, (pSet->Capacity * 2));
if(success){
return CSet_Insert_(pSet, Va... | 1 |
6b862cf3d5750a2747c4fb4626792242 | b45736520f0eb935c7e04d5014b3aac3 | 获取下次开赛剩余时间 | local time = 0
local next_time = 0
local activity = self:GetActivityStatuByType(act_type)
if activity then
next_time = activity.next_time
time = activity.next_time - TimeCtrl.Instance:GetServerTime()
end
return time, next_time
end | 1 |
5721bab7b1710dd1e6b6735fde5a7c61 | 327c7e7d593930d72091fb87abe89368 | onCTSDisable This method is called when the CTS changes from enabled to
disabled | void `$INSTANCE_NAME`_UartDisableCts(void)
{
`$INSTANCE_NAME`_UART_FLOW_CTRL_REG &= (uint32) ~`$INSTANCE_NAME`_UART_FLOW_CTRL_CTS_ENABLE;
} | 1 |
2ba5fd0ae29c04463ba86d3bee952df4 | 25b103895e7b5140b6c4fa65d8f52d44 | 生成私钥,传入 公钥 和 欧拉函数φ(n)。 | def gensk(pk,upuk):
puk = serialization.load_pem_public_key(upuk,backend=default_backend())
sk = pk.exchange(ec.ECDH(), puk)
sk = scrypt.hash(sk,sk,buflen = 32)
return sk | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.