query_id
string
corpus_id
string
query
string
code
string
label
int64
9945e011df114d8046ea2b6fc0822574
553da748891dba95dda00dacc6cdbad1
Returns current color as HSL array
class KNXLight(KnxEntity, LightEntity): def hs_color(self) -> tuple[float, float] | None: return self._device.current_hs_color
1
44e5b177b5791dba65d04b02ebfe6206
a631ce2b66762446fc514f6455ae07f1
Gets the latest available price for given assets as of end_time.
class Asset(object): def getHistoricalPriceFromSource(self,startDate,endDate): raise NotImplementedError("Should have implemented this")
0
e422778400e6c860bfbd5f7ed1fcaa29
3f5674393a9284b2b9e9b61fac30eefe
helper - call function 'func', and return the captured stderr
try: returncode = func(*arguments) sys.stdout.flush() except BrokenPipeError: devnull = os.open(os.devnull, os.O_WRONLY) os.dup2(devnull, sys.stdout.fileno()) returncode = 128 + 1 return returncode
0
15eb04421ed4257d5649ae4265faab85
5326c991aff3520dc573b84104215501
Sprawdza poprawność lematyzacji.
public class LemmatizerEvaluatorTest @Test void testEvaluator() throws IOException { String inPredicted = "opennlp/tools/lemmatizer/output.txt"; String inExpected = "opennlp/tools/lemmatizer/output.txt"; String encoding = StandardCharsets.UTF_8.name(); DummyLemmaSampleStream predictedSample = new Dumm...
1
1686ff8022edb7c9091ff9612abe793b
48b7f9ea294cdbe2153e46bc2076a15f
Loads course level data. Course level data has a bunch of data that could correlate with performance (fairway width, firmness, grass height, stimpmeter, as well as recorded wind data that we might be able to use in comparison to the wind data we get separately.
loadCompetencyPerformanceData() { let component = this; return Ember.RSVP.hash({ collectionPerformances: component.fetchUserCompetencyPerformance() }) .then(({collectionPerformances}) => { component.set('collectionPerformances', collectionPerformances); }); }
0
97cd54ef1778dd90f5b70bb2707606e6
e4461b27302d1374ad1c0ef65f5a1a83
Uppdaterar inställningen "difficulty" och startar ett nytt spel.
public void handleDifficultySelection(String newDifficulty) { DifficultyManager.makeDifficultyChangedToast(this, newDifficulty).show(); this.finish(); Intent restartIntent = new Intent(this, GamePlayActivity.class); restartIntent.setData(getIntent().getData()); startActivity(restartIntent);...
1
69ef1801017c94017a56193da6b927ea
1c9f8f4f4ecc996dbb53a9681f6d483e
Callback when the edge has been picked.
public class CNaviEdgeListenerAdapter implements INaviEdgeCommentListener @Override public void changedSelection(final IViewEdge<?> edge, final boolean selected) { }
1
a7d2f5ebb5cff9d6ed4e574440d10c4e
b5042c62465ec11039cb737aa0f5b739
find # of n/d, 1/3 < n/d < 1/2, d <= 12 000 and n/d is reduced and proper
chain = {1:1, 145:1, 169:3, 363601:3, 1454:3, 45361:2, 45362:2, 871:2, 872:2} ft = [factorial(x) for x in range(10)] fd = lambda x: sum(map(ft.__getitem__, i2l(x))) total = 0 for a in range(1,n): x = a l = 0 temp = [] while x not in chain: temp += [x] ...
0
f909b04bd6b8b67920b1ac8917c5d27f
cd2c7314bb0044ff6de1d62a4d992f06
Load teachers into database.
{ DB::table('teachers')->insert([ [ 'name' => 'Katie', 'created_at' => Carbon::now(), 'updated_at'=>Carbon::now(), ], [ 'name' => 'Max', 'created_at' => Carbon::now(), 'updated...
1
4529b2e1f32fb696abe9c03198a6ad7c
400080e76873e18bc31b1d99d7120324
Used to notify the {@link ThreadedShader} that all vertices have been shaded and it should wait until the queue is empty. No implementation is required.
public class EGLSurfaceDrawingThread protected void onStopped() { }
0
3c7b75383960edc065c8c2f876a9b49f
757f0b74a63882e0fed0344c019f8c7b
Check user RAM and virtual memory for minimum specs
bool KhaosApp::InitInstance(HINSTANCE hinstance, LPWSTR command_line, HWND hwnd, int screen_width, int screen_height) { bool resource_check = false; while(!resource_check) { try { const DWORDLONG pr = 32 * MEGABYTE; const DWORDLONG vr = 64 * MEGABYTE; CheckMemory(pr, vr); const DWO...
1
d4cc76188c5bee098f6314b2be89343f
d239d4d415e25d2ec75d2bee890782b2
On échange les Joueurs actifs et inactifs
if(j1 != actif){ actif = j1; } else { actif = j2; } }
0
ed8ad5dc505b6579ecc11e3a00c6678a
a076ff25e6e19a9526911492b1e919de
Do nothing, let descendants respond if they wish
class AttendeeManager extends ContentManager<Attendee, Attendee.Builder, MessageLite, MessageLite.Builder> @Override protected void clearChildren(Attendee.Builder builder) { }
1
9b2b227dce74481523a8af0cd64617cc
7acb1ef050387b0fec890a49149ff843
Opportunità di controllare (per le nuove schede) che la key unica non esista già. Invocato appena prima del save(), solo per una nuova entity
{ $select = $this->_initCheckUrlKeySelect($object->getData('url_key')); if ($object->getId()) { $select->where('e.entity_id <> ?', $object->getId()); } if ($this->_getWriteAdapter()->fetchRow($select)) { return false; } return true; }
1
b7a23a4f0eebde53eed0347cf63a8774
378e6199945828a57ee4d06f0f296c39
Metodo che gestisce l'animator della main camera
{ pvr::uint64 deltaTime = getFrameTime(); if (!isPaused) { frameNumber += deltaTime * ApplicationConfiguration::FrameRate; if (frameNumber > mainScene->getNumFrames() - 1) { frameNumber = 0; } mainScene->setCurrentFrame(frameNumber); } glm::vec3 vTo, vUp; pvr::float32 fov; mainScene->getCameraProperties(ca...
1
910ec285aedc6fa06de81e601e76343c
4cab36fa43f612c87cbcad130c50e05b
check whether the gps is on
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); boolean on = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); return on; }
1
0e778f57e922ca6b09aecb349ed74c42
f3cd1e5dc44621da5f31d6541094682f
Activates your application using the offline activation response file.
const status = LexActivatorNative.ActivateLicenseOffline(filePath); switch (status) { case LexStatusCodes.LA_OK: return LexStatusCodes.LA_OK; case LexStatusCodes.LA_EXPIRED: return LexStatusCodes.LA_EXPIRED; case LexStatusCodes.LA_SUSPENDED: return LexStatusCodes.LA_SUSPENDED; case LexStatusCodes.L...
1
dcabfeaa789c91320fec31d060cee7db
175b8081f005d072e703d0667afb51e0
---------------------------------------------------------------------------------------- Name : KillBrick Desc : Instantiates the explosion ----------------------------------------------------------------------------------------
public class BlockExplosion : BlocksScript public override void Destroy() { var go = Instantiate(exEffect, transform.position, Quaternion.identity); var effect = go.GetComponent<ExplosionEffect>(); Destroy(go.gameObject, effect.DestoryEffectTime()); base.Destroy(); }
1
d18929a14f453eef3e170b15ef49fa3f
8807e48026ffc9a06cfdf34993357765
function to return the reply for a request of coursework deadline
$q="select req_id from course_bid where id='$id'"; $result=$this->db->query($q); $result=$result->row_array(); $req_id=$result['req_id']; $q="select *,r.u_email as request_u_email from course_bid b JOIN request r on b.req_id=r.id having b.req_id='$req_id'"; $result=$this->db->...
0
864b2d069ef2f3bcbed1a952db18b5ee
549b6bd3e2ea57fcf53c429edd4b8991
Xử lý bắn bóng State1
{ switch (ballstatus) { case BallStatus.waiting: if (Input.GetButtonDown("Throw")) { ballstatus = BallStatus.throwed; ballObj.GetComponent<BallManager>().ThrowInit(new Vector2(Random.Range(-throwSize.x / 2, throwSize...
1
7463213640fca3224fbe8b68cfb98386
5d464aee9c364ac1b9d74716c43412b4
スイッチのチェックを外して日時をクリアする
namespace SuperPotatoesPower public partial class ModifyTask : PhoneApplicationPage private void toggle_Unchecked(object sender, RoutedEventArgs e) { this.date2.Visibility = System.Windows.Visibility.Collapsed; this.datePicker2.Visibility = System.Windows.Visibility.Collapsed; ...
1
444d6c3352b2857d0c6d46355016d02c
f865e586712e6fa67baeccbf8fddc65a
查找对象,但不抛出异常
abstract class BaseServiceImpl implements BaseService public function findOrFail($id, $columns = ['*']) { return $this->repository->findOrFail($id, $columns); }
0
e42b085d3e834c3f732508a93bc56a2e
d0e59792dbdc7d81fdfcd0f213d7ff10
Test that setting types only refer to settings defined in setting types.
class TestExtension(Extension): pass extension = self.setup_extension(TestExtension) self.assertEqual(type(extension.settings), ExtensionSettings) self.assertEqual(extension, extension.settings.extension)
0
1b6062e5af8f252f227ca2dbd8527ded
1a57268a27510405edcdec3cb66d7d6f
Callable registry with a keyword parameter.
provider = providers.Callable(self.example, 1, 2, 3, 4) self.assertTupleEqual(provider(), (1, 2, 3, 4))
0
67a71c9b6ae8b6a311d938ef3ebde610
491dcd2e9a82b9004a8bb7d95d8062b7
Is the step the final step number?
export class StepsService isLastStep(): boolean { return this.currentStep$.value.stepIndex === this.steps$.value.length; }
1
0331ed54cdf300572b4e53305f13b7cd
86cf910492e1ccc6a517c9e9c06fffe2
FunctionName : mesh_SetSoftap Description : If the device failed to join mesh network, open the SoftAP interface for webserver The SSID should not be the same form as that of the device in mesh network
at_setupCmdCwsap(uint8_t id, char *pPara) { char temp[64]; int8_t len,passLen; struct softap_config apConfig; os_bzero(&apConfig, sizeof(struct softap_config)); wifi_softap_get_config(&apConfig); if(at_wifiMode == STATION_MODE) { at_backError; return; } pPara++; len = at_dataStrCpy(apConfig....
0
e75c58ed28e6b0952c18db3591b5a0c8
9f9a2c74f7e696a4a8f3f3d14a4c98ba
PHP5 Constructor method. Set properties on init
#[\AllowDynamicProperties] class _init_phpok public function __construct($iscmd=false) { $this->_iscmd = $iscmd; $this->init_constant(); $this->init_config(); require_once $this->dir_extension.'autoload.php'; }
1
eea9efdc9b7b51c922e55214376729c3
99b5133508afb9dbc02673862b68fe84
1店舗に対して応援しているユーザーリストを取得
class Shopplace extends ME_Controller public function get_user_list() { $params = $this->input->get(); $code_id = $params['code_id']; $data = $this->model->get_user_list($code_id); if (empty($data)) { $this->meret(NULL, MERET_EMPTY); } else { $this->meret($data); } }
1
2b6b24ae8b2cd6d3718857cd258810e4
ec6cc587337280514cdc4e491064591d
Called when the user selects to write depleted resource to file. If the user has selected one or more resources at the table only these are written, otherwise this method obtains further options and writes to file or to in.game notes file.
void WriteResourceEnd();
0
fbb1f5d63e6f6a81e600b9b6c15b91fb
c256781e9ce4df5926af929eaa3af17f
配置Struts
@ProviderType public class PortletWrapper implements Portlet, ModelWrapper<Portlet> @Override public void setStrutsPath(java.lang.String strutsPath) { _portlet.setStrutsPath(strutsPath); }
1
f9e1b665c895aeef18d7b51f453acb96
12a1c6ed6f39786c66a7ab03a29b99ea
Samples the 4 data wires and returns the values in the lower 4 bits
{ uint16_t result = 0; DDRB = 0; PORTB = 0; PORTD &= ~(1 << SW_A_READ_OUTPUTENABLE); asm volatile("nop"); result |= PINB; PORTD |= (1 << SW_A_READ_OUTPUTENABLE); PORTD &= ~(1 << SW_B_READ_OUTPUTENABLE); asm volatile("nop"); result |= (PINB << 8); PORTD |= (1 << SW_B_READ_OUTPUTENABLE); return ~result; }
0
e2525413c66d6fbd4b6014b30da1dade
bee698f1668cba1addc9ae3fe7e95e93
Test editing then discarding a Maya Reference. Add a Maya Reference using auto-edit, then discard the edits.
stage = self.copyTestFilesAndMakeEdits() cmds.optionVar(intValue=('mayaUsd_SerializedUsdEditsLocation', 1)) cmds.file(save=True, force=True) cmds.file(new=True, force=True) cmds.file(self._tempMayaFile, open=True) stage = mayaUsd.ufe.getStage( "|SerializationT...
0
777019fd626e0fec1278efd9e28663db
96d463d36b821f160e25d146656d403b
READ from DB and FILL categories into Spinner
public class StorageInitBoxInfoActivity extends AppCompatActivity implements OnClickListener public void initSpinner(){ ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,strCategoryNames); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropd...
0
70064372e3b2ead5f0ac0585367b02af
4b1810b654159a914216438c89895874
Initializes logging facility with severity level and observer(s). Private helper method.
if level not in range(10, 60, 10): raise ValueError('Invalid log level: %s' % level) logging.basicConfig( level=logging.DEBUG, filemode='w', filename=os.path.join(outdir, "simpleOrtho.log"), format="%(asctime)s - %(levelname)s - %(message)s", ) logger = logging.ge...
1
ca7ba6ea1d00710cc22305a202a8b29c
e4dd5356b4a54ff75a9618c7c4a77c80
Associates a Ldap server instance to the message handler
class IdentitySettings(object): def ldap(self, ldap): self._ldap = ldap
1
7b339a5f97fd37414b2220f8cc3e0fe4
555ff863b75e798f3d2f4e98140e65b2
该方法会异步执行,也就是说主线程会直接跳过该方法,而是使用线程池中的线程来执行该方法
@Service public class AsyncTestServiceImpl implements AsyncTestService @Async("function2") public void function1() throws InterruptedException { System.out.println("f1 : " + Thread.currentThread().getName() + " " + UUID.randomUUID().toString()); Thread.sleep(10000); System.out.println("EE...
1
47a4e5cc86e07733385ebe92d05097f3
a812d2f1f4f96523a6979e5666b68ec2
Initialize fmod busses.
int main(void) { AJ_WSL_ModuleInit(); toTarget.fakeWireCurr = toTarget.fakeWireBuffer; toTarget.fakeWireRead = toTarget.fakeWireBuffer; toTarget.fakeWireWrite = toTarget.fakeWireBuffer; fromTarget.fakeWireCurr = fromTarget.fakeWireBuffer; fromTarget.fakeWireRead = fromTarget.fakeWireBuffer; ...
0
847f44b8c9178025645860195932d2f2
643c94af2d0106576123e541de1f767a
Set the GameObject name to the class name for easy access from Java
class AdventureGameObjectRabbit(AdventureGameObject): def getName(self): return "Rabbit"
0
dccabab0d28c53d528fd58131d89063b
5128f091071c3b26ce9ca10dbd889e76
将charArray转16进制字符串打印用于查看数据
StringBuilder stringBuilder = new StringBuilder(""); if (src == null || src.length <= 0) { return null; } for (int i = 0; i < src.length; i++) { int v = src[i] & 0xFF; String hv = Integer.toHexString(v); if (hv.length() < 2) { stringBu...
1
d7352c5af7099d959a0b6de898c4c7a2
e4a5aed93fd708f470a4d771db51052b
Affichage de la liste des points de ventes
class PointVenteController extends Controller public function showAction(PointVente $pointVente) { $em = $this->getDoctrine()->getManager(); $session = $this->getRequest()->getSession(); $region=$session->get('region'); $startDate=$session->get('startDate',date('Y').'-04-20'); ...
0
d93870df921dd816d81a2635b1109909
cbc5eeabd02f6cf91fb185b3bc4ba4af
create "YYYY-MM-DDTHH:MM:SS" format str.
def dateTimeStr(dt): dt_str = "{:04}{:02}{:02}T{:02}{:02}{:02}".format( dt.tm_year, dt.tm_mon, dt.tm_mday, dt.tm_hour, dt.tm_min, dt.tm_sec) return dt_str
0
6ad7e5a0327d90c3961e0ed39b429e85
ac26f106299bbc472136b9484a5e01a5
Adds a temp pipeline plugin, saving it to the registry.
var o = util.create.apply(null, arguments); tlnpplugin[o.id] = o; return o; }
1
a9563efb6b9c1a6f739988ed8c42c3dd
a6040f43ee334687c9532f605e1248a0
Returns an identifier (index) of the source which is currently chosen from the list of sources defined in ``available_sources`` property.
class NewOrExistingWidget(QtWidgets.QComboBox): def get_current_source(self) -> str: return self.itemText(self.currentIndex())
0
d64d69b978b78b56487954c47f9d4a1b
de26700163c040a9cee68319d345a55a
Setup fuzzy rules, rules inserted on object to be used by _setup_fuzzy_controller
void FuzzyControl::createRules() { redRules.addRule(RuleNextPhase({Value::Small, Value::Small, Value::Small}, {Value::Small})); redRules.addRule(RuleNextPhase({Value::Small, Value::Small, Value::Medium}, {Value::Small})); redRules.addRule(RuleNextPhase({Value::Small, Value::Small, Value::Large}, {Value::Me...
1
f20254bba7cabd562d1a6ac9fef696e1
23595a2fdc8f5518054be427fab6dae3
工厂函数:读入文件的Command工厂函数
ifstream ifs; ifs.open(FILENAME, ios::in); int id; string name; string dept; int level = 0; int index = 0; while (ifs >> id && ifs >> name && ifs >> dept && ifs >> level) { Worker* wk = NULL; if (level == 1){ wk = new Employee(id, name, dept, level); }...
0
fe017f214703436e4b5f4017f647b731
96077b1ed2feb57e522798854574ba04
获取舆情词云图
comment = pd.read_excel('./'+dataname, sheet_name=sheetnames) comment1 = comment[comment['总体']<0] comment2 = comment[comment['总体']>0] word_fre1 = nltk.FreqDist(self.neat_text(comment1, cate)).most_common(1000) word_fre2 = nltk.FreqDist(self.neat_text(comment2, cate)).most_common(...
1
1417f2be1e5511dd6ed871a12f9c51ea
da261baa65c3a27e03f50b1dd8001f01
========================================= = ACTUALIZAR BANNER = =========================================
{ $input = Input::all(); $input_array = (array)$input; $input_array['active']=($input_array['active']=='true'||$input_array['active']==1); $doc_root = $_SERVER["DOCUMENT_ROOT"]; if(Input::hasfile('file')){ $file = Input::file('file'); $band=unlink($doc_root."/".$input_array['main_image']); $vector= exp...
1
14c2c52d94f172d59d026acf6ed7d164
01fc703adf8834f7b7b748aa4d05ec61
Discard all registered on-detach callbacks without executing them.
void reset_on_dsm_detach(void) { dlist_iter iter; dlist_foreach(iter, &dsm_segment_list) { dsm_segment *seg = dlist_container(dsm_segment, node, iter.cur); while (!slist_is_empty(&seg->on_detach)) { slist_node *node; dsm_segment_detach_callback *cb; node = slist_pop_head_node(&seg->on_detach); cb =...
1
962283bbb29c0a6a1436ae959b544968
90cea1adec75417d27beb9de7b02d55e
Returns itself for method chaining.
public class MultiPartSpecBuilder public MultiPartSpecBuilder and() { return this; }
1
ba40c939e98b5ac58920a8cfe20dad64
c73616397c491c1f3c267fd94e730ae8
Store the uploaded photo file and its thumbnail version and create a database record
$wp_upload_dir = wp_upload_dir(); $filename = basename( $url ) . uniqid() . ".jpg"; $filename = $wp_upload_dir['path'] . "/" . $filename; $image_data = AutoCurationAndScraper::getHttpBody($url); file_put_contents($filename,$image_data); $wp_filetype = wp_check_filetype($...
1
a9834266da27d0000b5b6d3df294fbbb
9bd249c98303a86b3017d8473065dd91
员工管理列表JSON
@ResponseBody public JSONObject getEmployeeList(Employee employee){ ListDocument.List<Employee> employeeList = employeeService.findEmployeesByCondition(employee); int total = employeeService.countEmployeesByCondition(employee); JSONObject jsonObject = new JSONObject(); jsonObject...
1
25a5d17c09eb3c2c66e44ac77cfa8fe8
5b8cae2d17d7e3a3e63cccc3137ac27e
Propagate listener options to the job.
self, request: cloudscheduler.GetJobRequest, metadata: Sequence[Tuple[str, str]] ) -> Tuple[cloudscheduler.GetJobRequest, Sequence[Tuple[str, str]]]: return request, metadata
0
19b4b6b721d362cfd97b1d1f94728f75
476624d8775a4deb115feed95a887ba1
Gets the top aggregate UDFs for the entry. It will fetch it if not cached or if the refresh option is set.
{ if (onGetTopKey == null) throw new ArgumentNullException(); ClientDataStructure.Client.QueryStream(GetTopKeyNode(), onGetTopKey); }
0
db488ccc83747c91f088a9c3737c0267
059bbf5b626ff5f3d033cd1f9b7eeff5
获取场次列表
sid = request.POST.get('sid', '').strip() if not sid: return SessionTable, account, uid, verfiySid = getInfoBySid(redis, sid) userTable = getUserByAccount(redis, account) if not redis.exists(userTable): return {'code': -5, 'msg': '该用户不存在'} groupId = redis.hget(userTable, 'parentA...
1
e239c9ff87c0a906affb9de18e775819
263dcab4512126273b51338ad2ddb385
converting inches to feet
function ftConversion(heightInput) { let inchesHeight = heightInput / 12 if (heightInput.indexOf('.') > 0) { const heightComponent = heightInput.split('.') inchesHeight = heightComponent[0] * 12 + parseInt(heightComponent[1]) } console.log(inchesHeight) return inchesHeight }
0
76c5fa44e0295a21ebf2c6a30e322e17
92d6d7b2ab1d8ffac97f9f9aad43aa22
从list.txt文件装载图像文件名
def read_image_list(pathToList): f = open(pathToList, 'r') filenames = [] for line in f: if line[-1] == '\n': filenames.append(line[:-1]) else: filenames.append(line) f.close() return filenames
1
93b19d60656463d6a21710e9b35537f8
2581655c867e00c74b11daa293772f8e
Get the atom covalent radius of an atom in Angstroms.
xyz = {'H': 0.710, 'He': 0.276, 'CNO': 0.014} mu = (xyz['H'] / phys.atomic_mass("H") * con.u + xyz['He'] / phys.atomic_mass("He") * con.u + xyz['CNO'] / 14.24) ** -1. m_atom = phys.atomic_mass(atom) / con.u return xyz[atom] * n_e * mu / m_atom
0
611ba2743a47cd9253609b5d18c2e1a3
5a8e6c8c942ed4f01cca834f727c2781
Ajoute ou écrase une valeur par clé au tableau des Paramètres de recherche récupérés
class Parameters implements \Countable public function appendTo($key, $value) { if(! array_key_exists($key, $this->params)) return false; return $this->append($key, $value); }
0
0ff02cb799617cb5cc24e51a34357134
4511c190ce751ec5027aa342e5a1e577
zeros in factorial
{ if(mpf_cmp_ui(n, 0) == 0) { mpf_set_ui(res, 1); return; } mpf_t fact; mpf_init2(fact, PRECISION); unsigned long i; unsigned long nn; nn = mpf_get_ui(n); mpf_set_ui(fact, 1); for (i = 1; i <= nn; i++) { mpf_mul_ui(fact, fact, i); } mpf_set(res, fact); mpf_clear(fact); return; }
0
25fb62f61e2477e7cc5ed8fee9946597
8c55b2cc13c56b6efd67bbeea9b5a741
保存系统功能权限信息服务器验证
IDataSet responseData = new DataSet(); try { FMENUAUTH001 fu = (FMENUAUTH001) lookupFunctionUnit(FMENUAUTH001.class); fu.fSaveMenuAuth(requestData, onlineCtx); responseData.setOkResultMessage("PSNM-I000", null); } catch (BizRuntimeException be) { throw be; } catch (Exception e) { throw new ...
1
4825b08a1f7aa1ad030ebe680c6be030
ed161aa22560da90c5c8cd5e3ac808cd
Funkcja otwierająca nowe okno aplikacji
public class GlownaActivity extends Activity public void uruchomAplikacje(View widok) { Intent launchIntent = new Intent("com.example.dawidperdek.myandroidapp1.ANOTHER_ACTIVITY"); startActivity(launchIntent); }
1
bea974309a78b13db40538daef3c917d
e8d96963258b04ca6d39d46d71ee964e
@brief Generates CMake file based on information was collected.
cmake = CMake(self, generator="Ninja") cmake.configure( defs=self.cmake_definitions(), source_folder="{}/build/cmake".format(self._source_subfolder), build_folder=self._build_subfolder) return cmake
1
8d3806fabd72647a1a0c74ac56960faf
f72fd78cdc145852f814d6fc1f85901a
remove popup from queue by queue index
this.queue.splice(index, 1); if (this.currentIndex == index) { this.currentIndex--; this.next(); } }
1
81d2861a842f24854a30e2d6278e7e15
65a4a19801135c607a8a14325c5a24b2
重新计算工作任务组关联的任务数量
void recalcGroup(String groupName, Id contextId);
1
13cc469e3c81c03c583fbcbdee077c90
c91231b55ea52a1a803f8a599e422458
! \fn TorcDB::LoadPreferences \brief Retrieve all persistent preferences stored in the database for the current user. Preferences are per user and hence this function MUST be called if the user is changed. \sa SetPreference \sa LoadSettings \sa SetSetting
void OFDb::loadSettings() { }
0
cf7b50be69f2afdca6a67cedcbbec4bf
844429257b312cd26aaa59af92bdcaa6
查询最近三月的支出
@Controller public class Foundation_Controller @RequestMapping("/selExpenditure") @ResponseBody public Map<String, Object> selExpenditure() { HashMap<String, Object> map = new HashMap<>(); Double expenditure = foundationServiceImpl.selExpenditure(); map.put("msg", expenditure); r...
0
0fb4bcea03a3773b2f9b42242817f4e7
421d84b6fd0408260fb47ad5c78b264b
draw text on applet's background
public class ShowText extends Applet{ public void paint(Graphics g){ g.drawString(text,30,getHeight()-30);}
1
4e9c715d56f10bd420f8cccdbaa896b6
c26eb3c178579a631400fa3f65ff29b1
Permanently delete the specified resource from storage
class HomeController extends Controller public function destroy($id) { $home = \App\Web\Home::findOrFail($id)->delete(); return redirect()->back()->with('success' , 'Done!'); }
1
e640a113a887e80a597017cd446b8506
e9e19f392d81ca2a4c141fbf918bcf61
设置预览状态
previewUrl(state,settings) { state.previewUrl = settings.url; state.isImg = settings.isImg state.fileContentType = settings.fileContentType console.log("isImg:?"+state.isImg) state.viewPreview = true }
1
4044fddba4e22af593c3b160c9d601c6
1a5b0d416c8a2f8fe33b7014602d4087
Verifies if a certain edge between nodes 1 and 2 has a positive level of pheromones.
G = self._graph neighbors = G.neighbors(h1) return 1 if h2 in neighbors else 0
0
32e6f39dd6cce805a543daf0462fdcce
0a191c856efc7f3847f77244ec9b9bc5
送入墓地时
class MudiController extends BaseController public function mudiInfo(){ $mudi_id = I("get.id"); $mudi = M('Mudi')->where("mudi_id = $mudi_id")->find(); if(empty($mudi)){ $this->tp404('此墓地不存在'); } $this->assign('mudi_id',$mudi['mudi_id']); $this->assign('mudi',$mu...
0
67c8da6174a9beec442e8ed82f6ff19d
757e4589d74b96921853694bea318c12
Get the amount of listings on this page
class Listing extends Document implements Iterator, Countable public function getTotal() { return $this->total; }
1
f0096ea322c1867a32db833ca1a8e4c8
afa74cf14cbc1acdc5c63759001b1e82
自动调节所有viewport的大小,使其均匀分布
function resizeVR(event) { for (var tempSizeNum = 0; tempSizeNum < Viewport_Total; tempSizeNum++) { if (openVR == true || openMPR == true) { for (var ll = 0; ll < o3DListLength; ll++) { var div1 = getByid("3DDiv" + ll); var WandH = 0; if (openVR) W...
1
7bf71c420a7520a1a91dccb3b8fd5e27
73dbba64204efe9c8232bd5f7bfde07d
Load headers from csv file and return a set of headers
def get_header_csv(filename): with open(filename, 'r') as f: reader = csv.reader(f) for row in reader: return row
0
3b132c9acc7d4ea36c457d6806f974b8
166df92b50f06e101d60f1c5c3314106
检查当前帧是否是关键帧,判断策略是检查相对参考帧(上一个关键帧)的运动是否足够大, 只有运动足够大才算关键帧
if distance < self.encoder_config.min_key_frame_interval { return Some(false); } if distance >= self.encoder_config.max_key_frame_interval { return Some(true); } None }
0
9473059c338b313ba5029072ab980ebb
a45d68fe5ceca78579327b7961a8f6e3
Magically pass methods to the default bot.
class BehaviourMapper def method_missing(meth, *args) @base.send meth, *args end
1
e151625bfeb82a70bad8f4ac9bfbcbaa
6ccff74a981a6bf3a6056c99abd8a774
Retorna um array correspondendo a cada linha do arquivo.
def lerArquivo(nomeDoArquivo): with open(nomeDoArquivo) as arquivo: conteudoArquivoEmLista = arquivo.read().splitlines() return conteudoArquivoEmLista
1
0e59fdeb7fe6c9b15d6a11c26d667dab
63129d43aafc3a408abb9b54487d56ff
Function to update the positon of a set of particles in an electromagnetic field over the time dt
void Particles1D::mover_relativistic(Grid* grid,VirtualTopology* vct, Field* EMf){ int ix; double qomdt = qom*dt,weight1, weight0,Exl; double gamma, px; for (register int i=0; i < nop; i++){ ix = 1 + int(floor((x[i]-grid->getXstart())/grid->getDX())); weight1 = ((x[i] - grid->getXN(ix,0,0))/grid->getDX(...
1
d61c86cddf2b26bfe855b70a6a1c6935
c00db60f520b15481e9b9da9b5f7b299
将实体对象传入到需要执行的任务线程中
Thread thread = new SendMsgToCoreThread(taskLogId, requestObjList); logger.info("新启动的线程(" + thread.getName() + ")"); executorService.execute(thread); }
1
9cbf110f0f3f5d94efac01afa03ca657
159411125cadc594244f18988c0b22e0
根据min_expire, max_expire生成expires列表
def generate_expires(expires, cluster_type): result = json.loads(expires) result[LIST_EXPIRE] = [] if result[MIN_EXPIRE] != -1: for days in EXPIRES_SUPPORT: if days >= result[MIN_EXPIRE]: if result[MAX_EXPIRE] == -1 or days <= result[MAX_EXPIRE]: resul...
1
f0d578324ff12f079f58e9c60fc2ebef
34b029e9e30b37ed6c1da574d1054a1a
Sends the alliance info.
{ var guild = Player.Guild; if (guild != null) { Player.ClientSocket.Send(new Models.Packets.Guilds.GuildAttributePacket { GuildId = (uint)guild.Id, Rank = Player.GuildMember.Rank, Enrol...
1
ba82b5b9a3946193828cb80f4895892d
fcfd1f60557edc59db1c0a685500238e
从 第一PPT 网站上把 no1ppt对象对应的包含PPT文件的压缩包下载到本地
String frontStr = ""; String extName = ""; String newFileName = ""; PrintWriter out = null; savePath = savePath + "\\trainingMaterialPpt\\"; HttpServletResponse response = ServletActionContext.getResponse(); response.setCharacterEncoding("utf-8"); frontStr = UtilCommon.createImgName(); if ...
0
32a1a622b915a2b3290af7c34e41e4e9
e0be62d2d37b9a4a99dcf180267f1156
添加用户(医生)
namespace HIS_c.Controllers public class UserController : ApiController [HttpPost] public ApiResult<List<UserModel>> addUser([FromBody]UserModel user) { return userService.addUser(user); }
1
ef6d7c3d22fc9233a2dacf7cde688629
b5e8567ec817f287a58fca2e77d90a1c
获取北京单场最新开奖期号
$transcode = ZunAoTicketClient::TRANSCODE_QUERY_ISSUE; $head = array('transcode' => $transcode); $body = array('issueNumber' => '','lotteryId'=>$lotteryId); $xml = $this->formXml($head, $body); $isSendOk = $this->sent($transcode, $xml); if (!$isSendOk) { return false; } $tmpResult = $this->analysisRe...
1
37448d778aa2137205256755ab4b4962
507521125aa00b9f9a29f1d2cd123b1e
Dynamic finder that find thread Id which has unread messages.
class MessagesController extends Controller protected function findThreadModel($id) { $model = MessengerThreads::findOne($id); if (is_null($model)) { throw new NotFoundHttpException(); } return $model; }
0
a25f46b84e2f23c7242db99291c47457
5967cefe63e88a0d32492540e861c86d
Sets trip deals.
Yii::$app->response->format = 'json'; $trips_ids = Yii::$app->request->post('trips'); $trips = Trip::find()->where(['IN', 'id', $trips_ids])->all(); if(count($trips) == null) { throw new ForbiddenHttpException('Рейсы не найдены'); } Trip::updateAll(['commercial' => true], ['IN', 'id', ArrayHelper::map($t...
1
5c760220a1e13da536912f64b16dd6bf
94fed780053aa3ee6ef329e8d99afefa
将带有CRC检验码的字符串进行CRC检验,判断生成的校验码是否等于字符串自带的验证码
{ user.checkCRC = 0; for (int i = 0; i < (receive.Length - 6); i++) { user.checkCRC = CRCtest.CRC(receive[i], user.checkCRC); } if ((receive[receive.Length - 6] == (byte)(user.checkCRC >> 8)) && ((byte)user.checkCRC == receive[receive.L...
1
635afea4f8730b3d4f604613104ffbcc
34a5080a811695dca1ece341b8fd4626
List-1 > make_ends Given an array of ints, return a new array length 2 containing the first and last elements from the original array. The original array will be length 1 or more.
public class MakeEnds public int[] makeEnds(int[] nums) { return new int[] {nums[0], nums[nums.length-1]}; }
1
4e4e5f35861911046c17388b0f2c4c90
dbe8f6dcdbe7c1fa0a691ca75835a258
Подписывает сообщение-ответ в СМЭВ
{ return new ResponseMessage { Result = new ResultMessage { RepliedMessageId = MessageId } }; }
0
ed102be969ded346e3a36700eae16596
9e04820c424bf47776ab2e955588a9ef
retorna a casa na posicao (linha, coluna)
def linha_pos(pos): return pos[0]
0
9753e02dc7f51f40a80920213a71039e
52ae144f2bc4d5c21ed4894423e903e6
Test that the hash table comstructor creates an empty table.
ht_hash_table* ht_constructor() { return ht_new_size(0); }
1
1bf71c57425881fba1802757b2095330
4575a0179791331ffd5c5b70353eff65
スクリーンショットの実行結果の変更された箇所リストを取得する。
{ if (modifyingHistory == null) return null; List<Position> ret = new List<Position>(); int numRow = CrtLevelConfig.NumRow; int numCol = CrtLevelConfig.NumCol; for (int r = 0; r < numRow; r++) { for (int c = ...
1
a90993b315ad2cc014b67d59b3baa1e4
27af94bdad194d2a6872351fbbdd6c84
根据省份ID查询所在其省份的学校
public ResponseResult getSchoolByProvinceId(@PathVariable String id) { Integer provinceId = StringUtils.toInteger(id); if(provinceId == -1) { return ResponseResult.failure(ResponseErrorCodeEnum.PARAMETER_ERROR); } List<DataSchool> schools = dataSchoolService.listByProvinc...
1
29b8f80cfe22a1f7ace423dc4fcb38a7
901bdc67a067c7910eb59bdb4e323c0b
Loads M-Tree instance from a pickle file
if os.path.isfile(filename): treeflie = open(filename) return pickle.load(treeflie) else: return None
1
a56bdc6414c3b5217622ac64403788a2
68bd1793658b4c73c2692bcb1536539e
Posts the diagnostic logs.
namespace TransactionMobile.Services Task PostDiagnosticLogs(String deviceIdentifier, List<LogMessage> logMessages, CancellationToken cancellationToken);
1
009e2a380cca5eeecaa8587cae78b999
fe751fc69b57adfff22b2dcc0da4ab9b
We always make sure that the transaction is rolled back after each test execution, so the database will remain in its initial state.
class BaseFileTransferServiceAPITest(unittest.TestCase): def tearDown(self): with self.app_context(): self._db_man.db.session.rollback()
1
4b48c94f67d8e835c480bd2a0624d6fa
4d334854f06148adddbd6b56cd75fd9f
Replace the instances in the group using updated launch configuration
self.__check_launch_configuration_exists() logging.info( "*** Creating new launch configuration {} ***".format(self.config.get("launch_configuration_name"))) try: self.client.create_launch_configuration( LaunchConfigurationName=self.config.get("launch_conf...
1
6219fb35b39ec5c97c0948f5cf75dd23
97a11cfab57159dffaf5a5d4313f7af0
根据备注查询订单
namespace Sk_B2BAPI.DAL public class OrderInfoDal public List<OrdersMt> OrderQueryDt(string entId, string userId, string order_No) { SqlParameter[] param = new SqlParameter[]{ new SqlParameter("@type","OrderQuery_Dt"), new SqlParameter("@entId",entId), ...
0
66c68b842ba879daf3fa85eb81e392f2
86a9edddfee7e760e1e64b56f379ae6c
createTheFleet method will ask for co-ordinates from the player to place the ship and will check whether the inputs are valid or not. It will then call the function to place the ship at the given location.
{ bool flyingShip = true; vector<string> flyMenu; promptPlayer(flyMenu); while (flyingShip) { int choice = askPlayer(flyMenu); switch (choice) { case WAYPOINT: break; case SHIPREADOUT: break; case MANPILOT: ...
0
110d7f64ddf6e4ed3b630b09e114c2fc
2926f9d8482a7ee58ac965a421210e58
Get forward driving distance in meters using LRF forward range.
namespace Robotics.Atani public class Pioneer3DXrobotState public double getDriveDistance() { return(getDriveDistance((double)_lrfForwardDistance / 1000.0)); }
1