query_id
string
corpus_id
string
query
string
code
string
label
int64
7ef6511d3dc2217d088695615a1a4a4e
83289cd2ab7a7782a28298b360764786
Define all options modules with 'True'.
class StatusModule(OptionsModule): def __init__(self): self.options = { 'inactive': 'Inactive', 'active': 'Active', 'deleted': 'Deleted', } OptionsModule.__init__(self, options=self.options, disabled=True)
0
0fe9b0b9178fae2bb7d7a28ce80edee7
60e03f46468af7b43baf56e66ac1c2b4
生成插件框架下的AOP Advisor类
public DefaultAdvisorAutoProxyCreator defaultAdvisorAutoProxyCreator() { DefaultAdvisorAutoProxyCreator proxyCreator = new DefaultAdvisorAutoProxyCreator(); proxyCreator.setProxyTargetClass(true); return proxyCreator; }
0
8b5fedd4966e5747e16215705b1c51f6
9a7a77ec581ba301f18b52c3b0f96764
解析微信链接界面
class SpiderMain(object): def parser(self,driver): itemslist = driver.find_elements_by_xpath('//div[@class="news-box"]/ul[@class="news-list2"]//li') print(itemslist) for i in itemslist: try: wechatid = WebDriverWait(driver,10).until(EC.presence_of_element_located((By....
1
1b1f867f3f01071aa07d2a72591d10d3
b2e19a720c12c54e46487b1247a87089
receive commands from remote server and run on local machine
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) remote_host = '192.168.2.5' remote_port = 8881 sock.connect((remote_host,remote_port)) print("Host by name", socket.gethostbyname(socket.gethostname())) print("Hostname", socket.gethostname()) try: while(True): s = g...
0
73e951cd04e0d8b1069aa7b39463d08e
4619631b41300e9c437104a7e8690b1a
Build a constraint matrix for this sudokue problem. A sudoku board is converted to a convex optimization problem by treating each cell as a size n binary vector, where a value of 1 at position k indicates that cell's value is k. There are n^2 cells on the board so a vector of size n*n^2=n^3 is needed to encode all cell...
class DirectGraphSquareLoss(): def build_mats(self, verbose=False): mat_q_triples = self._cal_qmat() cc = self._cal_cc() if verbose: rows = [triple[0] for triple in mat_q_triples] cols = [triple[1] for triple in mat_q_triples] vals = [triple[2] for triple in m...
0
ac108ec2eb116f6cf520a0f7a0b6336e
630263db3c442e4d77b201bc1cc52e07
Return the angle (in degrees) of this vector.
class Vec2: def angle(self): return math.degrees(math.atan2(self.y, self.x))
1
df9342a275b3b0a6ba7b5253070869c8
01376095e0b1ffebca931ef6c19ace99
Write the XML-document to a given file. Keywords arguments: xml_fp -- An open filehandle.
Object xml_write_file(document,path) Object document, path; { x_note_fn_call(191,54); return c_xml_write_file(ISVREF(document,(SI_Long)1L),path); }
0
73eb61f528a5c36e98da7d7bd5592db0
214f3043e2fc2653f9b956848020054b
this function is passed to start_graphics. It clears the window and draws the paddles.
int windowWidth, windowHeight, i; SDL_Rect ball_rect; SDL_Rect background_rect; struct Point2D paddleStart; struct Point2D paddleEnd; struct Point2D pointBall; int radius; SDL_GetWindowSize( sdlWindow, &windowWidth, &windowHeight ); background_rect.x = 0 ; backgr...
1
b51370b1ac53feb1994b13c21cc55588
0dd3c8c4ab93792e8d3d85223a9436c2
SwapPanel will set the given panel visible and put the others to the background.
if (paneToHide != null) { moveSubScene(paneToHide); } moveSubScene(pane); paneToHide = pane; }
0
90bed68a2ed951ad4b9d4f6ca62c422a
a046f5f30a727c635f5c9e37bfb14a89
设置中心X的值
public class ImageInformationWithUrl extends WhiteObject public void setCenterX(double centerX) { this.centerX = centerX; }
1
39e5faf5238a865cc0b5b7032b7fafa4
de184af3ec6e4aa81138986049e793bc
ssssss形式の時間を"hh:mm:ss"形式へ変換する.
public class Common static public String formatHHMMSS(String s) { if (s!=null && s.length()==6) { return s.substring(0,2)+":"+s.substring(2,4)+":"+s.substring(4); } return get(s); }
1
2fde8dbddc5640241e95734ed2661e7f
b9814a79be7f84f137ba67655532b588
根据videoId获取审核视频管理表
{ if(empty($field)){ $field = $this->field; } $where = [ 'video_id'=>['symbol' => '=','value' => $video_id] ]; try { $data = yield $this->objPool->getList($field, $where); }catch(\Exception $e){ return []; } ...
1
770bebfb96e98afc4ea2062c9f50b623
83353bda0bab294e7d29c19ec276a798
2. Read presentaciones de un grupo
{ $cuotai = $grupo->cuotainscripcion_id === 0 ? 0 : Cuota::find($grupo->cuotainscripcion_id)->cantidad; $cuotac = $grupo->cuotacolegiatura_id === 0 ? 0 : Cuota::find($grupo->cuotacolegiatura_id)->cantidad; return view('grupos.show',[ 'grupo' => $grupo, 'escuela' => Escuel...
0
7874bf62d4692b72b741955d74392365
e84318573fb909d6a2486261ab4dbd83
Delete all keys from config file.
{ int ret; ret = storage_backend_clear(&g_config_storage[0], sizeof(g_config_storage)); if (ret) { dprintf("storage_backend_clear() failed\n"); return -1; } lprintf("\n"); return 0; }
1
0e739f6335b8f0bbc0f854a7ead46470
4a11a39e6c22a25a581390d88106e740
删除线性表,如果成功返回OK
LinkedList p,q; p = (*L); while (p){ q = p->next; free(p); p = q; } *L = NULL; printf("整表删除成功!\n"); }
0
6c686a0cd5046580f9b9b08f479b4a42
d318e4e0d63d05335f954e9f1449e5ba
修复三星系统剪贴板系统泄漏bug
try { if (Build.MANUFACTURER.equals("samsung") && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) { Object clipboardManager = context.getSystemService(Class.forName("com.samsung.android.content.clipboard.SemClipboa...
1
d3973981aed0019d06f64d87314ca9f4
d735d7034e467c19b09fe418df07e93d
撤销离职
function reconfirmQuit(){ var quitTime=$("#quitTime").val(); if(quitTime=="" || quitTime==null){ JEND.page.alert({type:"error", message:"离职日期不能为空"}); return; } $("#zcqr").attr("class","grey-but"); $('#zcqr').attr("disabled",true); $('#zcqx').attr("disabled",true); $("#deleteDiv2").show(); }
0
d7e1564675e1f48344bfe7d854c37674
61c6850348dd13e256cd304179bf8db1
Returns the list of playback indeces that are used to traverse the cursor object.
def list_indices(): pass
0
415e49d8dca4250ca725bf90e2d37a4d
95c86a68dcfcef1fc7ec3db752eae487
日志读取器
namespace XLugia.Lib.XLog public class LogReader public static LogReader getIns() { return instance; }
1
54eb6f6f3fbf4f71f9bf3d26195ee341
b3c66f81af6df25a1882aa98bb747bd9
# 根据给定的attrId获取float的值
{ if(el != null) { return NumberUtil.parseFloat(el.attr(dataAttr)); } return 0.0f; }
1
118697f2dcb3da8eefa9421e7ce02b49
588d052ac966b69d4b18dc043a69423a
通过教师的ID得到教师的名字
public String getTeacherName(String teacherID) { TeacherDataService teacherData = (TeacherDataService) remote.getData("Teacher"); try { TeacherPO tp = teacherData.find(teacherID); if(tp!= null){ return tp.getName(); } else { return "不存在该工号的教师"; } } catch (RemoteException e) { e.printSta...
1
abc6661ecd6557b936b0e935948d06c4
39e1b4cb4e8c94176d74737a05e3d0c3
converts deprecated prometheus configs to plugin configs
func convertToEnvoyFilterWrapper(local *Config) *EnvoyFilterWrapper { localEnvoyFilter := local.Spec.(*networking.EnvoyFilter) out := &EnvoyFilterWrapper{} if localEnvoyFilter.WorkloadSelector != nil { out.workloadSelector = localEnvoyFilter.WorkloadSelector.Labels } else { out.workloadSelector = localEnvoyFilt...
0
cd14679d999c0fab7f0d0dbb1b163b46
797756f54b99b3a3dfbeecd046be6376
set initial permissions for each part
{ $base = $this->app['path.base'].'/'; $app = str_replace($base, null, $this->app['path']); $storage = str_replace($base, null, $this->app['path.storage']); $public = str_replace($base, null, $this->app['path.public']); $this->setPermissions($app.'/database/production.sqlite'); $this->setPermission...
1
4e6b4b17924f83260a581905ad82c9cb
8ee9103fdc53397e947240b177a510ed
Resets the underlying unloaded criteria object with a new one. Used my HABTM associations to keep the underlying array in sync.
class HasMany class Proxy def nullify criteria.update_all(foreign_key => nil) _target.clear do |doc| unbind_one(doc) doc.changed_attributes.delete(foreign_key) end end
0
fd0a94373a1458512d20c8fdba3a0367
3dd6d792a842446ae00dff0eabba8247
默认上传到七牛云中的文件名为:(年)(月)(日)(小时)(分钟)(秒).(文件后缀)
public final class Helper public static String getUploadFileName(String ext , String s){ if(ext==null)return null; Calendar calendar = Calendar.getInstance(); int m = (calendar.get(Calendar.MONTH)+1); String month = null; if(m<10)month="0"+m; else month=m+""; int d = calendar.get(Calendar.DAY_OF_MONTH); ...
0
30071510f5c18286bab834266f85b9cb
0098d1e32dabca1c9098a0f9f023279f
温度转换类
namespace Browser public partial class SK_m_0 : Form private void temperatureToolStripMenuItem_Click(object sender, EventArgs e) { TemperatureConverter temp = new TemperatureConverter(); temp.ShowDialog(); temp.Close(); }
1
c44ee7d9e246b1d188d6c84b9763742f
cff39265737bc95be2a263f55ddaa6d0
处理mysql环境下备份菜单的合并问题
if (IS_POST) { $path = C ( 'DATA_BACKUP_PATH' ); if (! is_dir ( $path )) { mkdir ( $path, 0755, true ); } $path = realpath ( $path ); $flag = \FilesystemIterator::KEY_AS_FILENAME; $glob = new \FilesystemIterator ( $path, $flag ); $list = array (); foreach ( $glob as $name => $file ) { ...
1
7ac825b3d5a6115fdbc6d4864238e860
9736df368fe54a52969157a7dd76ea3f
Get the analytics domains for what clicks should be logged
class Regions public function getAnalytics() { return $this->analytics; }
0
e283052c9fe3a4765ab73a96130a568c
51d13f49ded5dfa10dca0b7e50fccc2e
Specifies the storage account id.
class AutoStoragePropertiesResponse(dict): def storage_account_id(self) -> str: return pulumi.get(self, "storage_account_id")
1
5e84e403995c0696497fde657ecbf873
08e627e32d88879d840407342f737686
Confirm submit final version
class TestRevisions(TestCase): def test_final_check(self): reg = RegistrationFactory(event=self.event, user=self.user, preparation_complete=True) url = reverse('registrations:step_final_check', args=(reg.pk,)) data = {'agree': True} response = self.client.post(url, data) self.ass...
1
6bbbc76e9af4932c2fc9f28b9d8c87ed
fde5e9e93b6e68314310fd75d8c0990d
Reusable Fade Out Function
el.style.opacity = 1; (function fade() { if ((el.style.opacity -= .1) < 0) { el.style.display = "none"; } else { requestAnimationFrame(fade); } })(); }
1
30f425c597f9f854b3fbfdeefe3fc3fb
d13ce830e371f99f26a9521d919c8b8c
Add special attributes of visual composer to all theme specific shortcodes
class TitanFrameworkShortcode private function addToVisualComposer( $shortcode ) { if ( ! defined( 'WPB_VC_VERSION' ) || ! function_exists( 'wpb_map' ) ) { return; } if ( ! is_array( $shortcode['attributes'] ) ) { return; } $params = array(); foreach ( $shortcode['attributes'] as $attribute =>...
1
52d75badbf865312c7cf36b815ec1fb4
7f61448ad6da3ef0f9cb03f40c5be655
Just keep slicing it until we find something that matches. It's good enough.
cases like (1)
0
8de6f43635b65471c97e1f597cf7ab9e
e51b973a9ec956a866c87afee9d7188c
Wis het het huidige model en zet alle parameters terug naar hun beginwaardes
{ tx_config.modell_Nr=0; tx_config.stic_mode=STICK_MODE_DEFAULT; tx_config.ID=TX_CONFIG_ID; tx_config.options=DEFAULT_TX_OPTIONS; tx_config.Stick_Calibaration[IN_LEFT_VERT_CH][CONFIG_CALIB_MIN]=ADC_MIN; tx_config.Stick_Calibaration[IN_LEFT_HRIZ_CH][CONFIG_CALIB_MIN]=ADC_MIN; tx_config.Stick_Calibaration[IN_RIGHT_VERT_...
1
1c1dca099c6dc6b336378ff86897f00a
4225d62be38202951c44c92f9841031e
Toggle the presence of a mine
public class MineModel extends Observable public void turn(int i, int j) { mine.turn(i, j); setChanged(); notifyObservers(); }
0
e5855f44080bd60da663ff35d2f1932c
5d2bce3b9066bf3ec6c443ca560133a8
Get hotfixes as a list.
def get_hacks(): return collections.OrderedDict(sorted( lnp.config.get_dict('dfhack').items(), key=lambda t: t[0]))
0
c1440757d93994d8d66c72a61794ae1b
fb1fa0cc003cc58973aaf6552f465a4a
Test finding all unused tags.
finder, err := createTagFinder() assert.NoError(t, err) tags := findTags(finder, "foo #bar baz #qux") assert.Len(t, tags, 2) assert.Contains(t, tags, "bar") assert.Contains(t, tags, "qux") }
0
5324492ce973ab92212c767c89a67d5d
b7b4267e1e142747b5eaf74bd466c295
fill array with values from the stdin
void ArrayList::fillArrayList() { std::cout << std::endl << "Input valuse:" << std::endl; for (int i = 0; i < length; i++) { std::cin >> array[i]; } }
1
665baf3c0b93d7b401468c666162a0b6
faef55b5674a164c4f188dc40bcb6c74
Clear all cache items via memcache_adapter. This method is for testing purpose since each integration test should have empty cache in the beginning.
class ResponsiveBreakpointsCache: def flush_all(self): return self._cache_adapter.flush_all()
1
025aebd85a24d515223df6e697b8fa85
86e8ec449663073328b4b1832070f146
Generate a password synchronously.
CompletableFuture<Secret> desiredPasswordPromise; if (user.isUserWithDesiredPassword()) { desiredPasswordPromise = getRequiredSecret( reconciliation.namespace(), user.desiredPasswordSecretName(), InvalidResourceException::new) ...
0
d12c2102ab9cf1ff842dbbcdc7e88362
e95a39af0f5984394e72d70a7de4ef6d
Return reference to the value within the tuple struct. `deref` returns a reference to a value instead of the value directly to ensure the value is owned by self. Returning the value directly would move the value out of self to be owned inside MyBox<T>.
impl <T> Deref for MyBox<T> fn deref(&self) -> &T { &self.0 }
1
c1ebd354a64c45b4c4b23ca8e4580c88
9d0b24e542b3458577c4cd0835027123
nothing to do. it has been moved.
void client::move_received(move_result* r) { }
1
d0598d4a49c5045b954a56da800811b5
3d1c778171f2826feb7334b98354b68c
converts RGB to HSV
def convert_to_hsv(r, g, b): r, g, b = r/255.0, g/255.0, b/255.0 mx = max(r, g, b) mn = min(r, g, b) df = mx-mn if mx == mn: h = 0 elif mx == r: h = (60 * ((g-b)/df) + 360) % 360 elif mx == g: h = (60 * ((b-r)/df) + 120) % 360 elif mx == b: h = (60 * ((r-g...
1
6c45026b0f08a940831402102810bbd6
48a2ec26e60dd1f1435a4e65a2c02511
Returns all of the request type permissions for the specified DataMart
public async Task<DataMartDTO> GetByRoute(Guid requestDataMartID) { return await DataContext.Secure<DataMart>(Identity).Where(dm => dm.Requests.Any(rdm => rdm.ID == requestDataMartID)).Map<DataMart, DataMartDTO>().FirstOrDefaultAsync(); }
0
353251b8e05fdcaa2031171f953f54db
40415eee19a0a5cce54f5af10350b8f5
同一組合企業のインタビューのうち、 インタビューStatusが1(完了)のものを表示
{ $result = \DB::select( 'entry.entry_id', array('company.name', 'c_name'), 'entry.job_detail', array('entry.emp_status', 'e_status'), 'entry.salary', 'entry.job_type', 'entry.reception_name', 'entry.reception_tel', 'entry.reception_mail', 'company.company_id', 'company.im...
0
fc3d745b2759e3e66e978f45a453c2d5
7d7aa6550996fd9d34e89087d92de91e
Method to set the adapters for the view
public class MainActivity extends ActionBarActivity implements View.OnClickListener{ protected void setAdapters(){ adapter = new SampleAdapter(mActivity,R.layout.row, list); listView.setAdapter(adapter); }
1
0860707de4c7c3ec05f581b5cf94ebda
7e001c009a9c8c2919084c87b8e2b4e0
Trae las tareas de un plan de accion por el codigo del plan
{ string where = string.Format(" AND PP_PlanCode='{0}' ", code); return ppaInstance.GetListByWhere(where); }
1
3c7a6c1e7a52a4f0c4f7b86429ec3797
52a3aa2414b6f75b60630a7c4927e869
Sets the panels for executing queries and displaying results
JPanel Textplace=new JPanel(); JPanel Results=new JPanel(); Textplace.add(EnterQuery); Textplace.add(RunQuery); Results.add(ReturnScroll); AddCode.add(Textplace); AddCode.add(Results); }
1
26ef9bb5432620d3f20be171ca5e9fe2
593b7844975ced2b4d4e088ed7a0aa2c
Get last log insertion in Piwik to avoid duplicates
global $TYPO3_DB; $result = 0; $records = $TYPO3_DB->exec_SELECTgetRows('MAX(crmsec) AS crmsec', 'tx_devlog', ''); if (isset($records[0]['crmsec'])) { $result = $records[0]['crmsec']; } echo $result; }
0
ddcb8dae6dd375d7903c09c85e3e17a9
4a2f05a32094c1afa9d15ea699cc8cbe
List of possible periods
class Statistics protected function getPeriodList() { $list = array( Filter::PERIOD_WEEK, Filter::PERIOD_MONTH, Filter::PERIOD_MONTH_3, Filter::PERIOD_MONTH_6, Filter::PERIOD_MONTH_12 ); $result = array(); foreach ($list as $period) { $result[] = array( 'ID' => $period, 'NAME' => Lo...
1
15a724ad3bc73347024cf536a7548c2e
1e271883c021c47bfb74bb5ef2beeac7
Generate a list of related entity names that we expect to see in the Person DeleteView.
$entitiesWithoutGet = array( 'MailingEventSubscribe', 'MailingEventConfirm', 'MailingEventResubscribe', 'MailingEventUnsubscribe', 'Location', ); if ($sequential === TRUE) { return $entitiesWithoutGet; } $entities = array(); foreach ($entitiesWithoutGet as $e)...
0
e0b5a7c1c288bf1e0cbcd33230ad2a4c
e0e3a58f45d1747a4c4cd7ebe91c1297
Method to set new pay for one lesson
{ $payeds = payed::all()->where('payid', $request->input('pay'))->where('studentid', $request->input('student'))->where('classid', $request->input('clas'))->where('status', 'Active'); if(count($payeds) > 0){ foreach ($payeds as $payed) { $payed->amount_payed = $request->i...
1
aaa58e2a969d5aa61dbc2f80167256da
429da9f88dcf85adeb5f38cd7506bb99
Расчет моды
{ $count_values = $this->numbers_repetiotions; if (count($count_values) === $this->count_numbers) { return; } arsort($count_values); $count_modes_slice = array_slice(array_count_values($count_values), 0, 1, true); $modes = []; $max_val_from_array =...
1
cc8c2ed64cbb72b8fa6d8a7baccb5214
8e0139c58a063a444d7d464fbe6d02a2
调用store中的getState获取数据, 将数据设置给state
class Antd extends Component handleStoreChange(){ this.setState(store.getState()); console.log('监听store事件,获取store中的数据并传给组件state') }
1
afdcda7bc9e85912b7b8bcda41fe39fc
05db144a336168851d9b1312589ad384
Method for search a document classes by last modified date in FileNet Engine
class DMSSearchManager(object): def search_results_by_date(self, documents): newlist = sorted(documents, key=itemgetter('metadata_created_date')) return newlist
0
a1d3892a560a3357258a51b739366963
b610e8f62c51bf67fd3346da6ad82d12
回归的alpha系数
def alpha(p_R,m_R,beta,f_R=0.03): return p_R-(f_R+beta*(m_R-f_R))
1
f93245e2f3dd008bbfe9c81e6c8b1290
401471f1d2e694c3c1112fc1e99838c7
Just ensures that the SensorType column in the computerpref table has length of 255 (since older code used a length of 256, which is invalid in MySQL version 4.1).
if (ShapeType != null && ShapeType.length() > 1) { log.warning("Length > 1 - truncated"); ShapeType = ShapeType.substring(0, 0); } set_Value("ShapeType", ShapeType); }
0
334efd1b5b1d09cf5c7749e475013046
94a39b93455d74a0aea12094546bc0f7
批量删除CustomerOrder
namespace LMS.Services.CustomerOrderServices bool BatchDelete(List<int> ids);
1
fc98eca3d02461585a25f4e9678e852b
be76415817035200beba2b3b935b8460
Conjunto de testes que verifica a validade na criacao de grafos.
$graph = new Graph(); $graph->createVertex()->createEdgeTo($graph->createVertex())->setFlow(1); $alg = new ResidualGraph($graph); $alg->createGraph(); }
0
d32f7a5d3a5e4e134aac8ceef6841efc
9a85c4f533f9410fe39605845d5b939a
Нанести урон врагу
namespace Lunohod.Objects [XmlType("Enemy")] public class XEnemy : XElement, IExploding, IHasPoints public void Attack() { var hero = ((LevelEngine)this.GetScreen().ScreenEngine).Hero; hero.InflictDamage(this.Damage); }
0
b32e54fd9ef0f86340062c7f86a08093
f90dee8e46223ae5c66252c095825f0b
Helper function that reads the book name file and returns a dictionary mapping the book id to the book name
class UserShow: def loadBookMess(self): book_mess = dict() for line in open(self.file_book, "r", encoding="ISO-8859-1"): if line.startswith("\"ISBN\""): continue isbn, book_name = line.replace("\"", "").split(";")[:2] book_mess[isbn] = book_name return book_me...
1
bcb7d73d861002fc0fb56c3c02206635
228a29eb478bbb03982f3760cc649808
Merges the field definitions.
namespace SIL.FieldWorks.LexText.Controls public class FlexLiftMerger : LiftIO.Parsing.ILexiconMerger<LiftObject, LiftEntry, LiftSense, LiftExample> void ILexiconMerger<LiftObject, LiftEntry, LiftSense, LiftExample>.ProcessFieldDefinition( string tag, LiftMultiText description) { m_dictFieldDef.Add(tag, descri...
1
f5b18e67c7a65fb526ae7aa03ee878c6
6f2cce84dee356368ad175ba8ea4d21d
# likelihood-ratio test
LRtest<-function(x){ nMC=1000 Nx = length(x) MCsample=rep(0,nMC) xsimuAll = rgmm(model,Nx*nMC) for (i in 1:nMC){ xsimu = xsimuAll[((i-1)*Nx+1):(i*Nx)] MCsample[i]= - sum(log(likelihoodgmm(model,xsimu))) + sum(log(likelihoodgmm(model2,xsimu))); dlogp = -sum(log(likelihoodgmm(model,x)))+sum(log(li...
1
c3f054f1f114fe8edee50d4e2750ed3b
b7dc09b77c125594706ccb555b321b65
阻塞,每得到一个新的连接,就创建两个线程。一个接收客户端发来的数据,一个给客户端发送数据
public class SocketServer2 public static void main(String[] args) throws IOException{ ServerSocket serverSocket = new ServerSocket(8088); while(true){ final Socket socket = serverSocket.accept(); new Thread(new Runnable() { @Override public void ru...
0
51e9421e1df7e6d621c98753f540f72c
cb79ecc0b56303e7e4195e5662b05aba
给模板对象添加控制对象属性
@ControllerAdvice public class MyControllerAdvice @ModelAttribute public void addAttributes(Model model) { model.addAttribute("author", "zm Abel"); }
1
1b480058370129c9c991b0d9008b50af
48a6984dd37f61f2c35c0862d83221ae
Update Coupon Expiration This method check the coupon expiration and update the Active column ( boolean )
class CouponService public function updateCouponModel(array $params) : bool { if($this->coupon->status == 0){ $setter = $this->setter($params); if($setter){ return $this->coupon->saveCoupon(); } } return false; }
0
5a3407a537f44dfaab50f4fa57726305
6d6b524f4789c1b332769a124b9862ce
Patikrinama ar teisingai nurodytas naujos grupės vardas
{ bool NoProblems = true; var emptyTxtBoxes = GetTextBoxesByText_Ordered("") .Select(x => (x.Tag as Label).Text).ToArray(); if (emptyTxtBoxes.Length != 0) { NoProblems = false; var grammar = new Tuple<string, string>...
0
1627a25f8488d195c8acbab4dbed113b
9b4c944fe617a318401d844ce18ff5dd
Split command to list for pexpect.
def split_cmp_command(cmd, remove_quotes=True): if isinstance(cmd, str): spl = cmd.split() res = [] for s in spl: if len(res) == 0: res.append(s) elif res[-1].startswith('"') and not res[-1].endswith('"'): res[-1] += " " + s ...
1
82be326d298ef1e5b85feec94ccf2909
bdf2106f212950a978a39e0c2aa469b1
Does diffing work across a long text with many changes?
{ $result = array(); $jobs = array(array(0, strlen($from_text), 0, strlen($to_text))); while ($job = array_pop($jobs)) { list($from_segment_start, $from_segment_end, $to_segment_start, $to_segment_end) = $job; $from_segment_len = $from_segment_end - $from_segment_star...
1
809a7bc313cfba95494817cb89ce344b
9b119940a6ccc0bfed434ece00ce97d3
Method to get the understandable format for route taken so far
namespace TrainTicketSeller.Business public class Train public String OutputRoute() { String outputString = ""; if(ListOfLegs.Count > 0) { outputString = ListOfLegs[0].StartingCity + " - "; for(int i = 0; i < ListOfLegs.Count - 1; i ++) ...
1
39b0c2e1123769f82c70e777b03c1ae5
9c78993ea45c531ebc31b652a24bd8c8
得到线程的结果
class HiveThread(object): def get_result(self): if not self.finished: self.join() return self.result
1
a00be9b149dbbf8d7c4eaebb48af37dd
9576966778a8795defddf103f73057ba
reads the data of every individual Temperature Sensor and writes it into the dictionary of the dataexchange object
self.__temp = {} for slave in self.__slaves: path = "%s/%s/%s" % (self.w1dir, slave, self.slave_name) fp = open(path) result = fp.readlines() fp.close() temp = self.parseW1Slave(result) self.__temp[slave] = temp
1
0e52d9f512bf3e720fa1d9fe40e15b9e
9c3f98196f8210189f831789659395d7
Initializes the hbridges
self.hatchsolenoid1 = hs1 self.hatchsolenoid2 = hs2 self.armsolenoid1 = as1 self.armsolenoid2 = as2 self.hatchsolenoid1.set(False) self.hatchsolenoid2.set(True) self.armsolenoid1.set(False) self.armsolenoid2.set(True) self.hatchbutton = JoystickBut...
0
e4592b5bd77d7884324aaa1bb7f329a7
41fab27f4405a563d701c508b4e3ac76
Provide shop maintain page.
class TrackingController extends Controller public function shop() { return view('shop'); }
0
63057e6a740b09946dc9138bf60e9dc0
a79aefb1649180aeb1c57aac8c32e2a7
Removes the specified bucket from the list.
namespace Couchbase.Management public class ClusterManager : IClusterManager public async Task<IResult> RemoveBucketAsync(string name) { IResult result; try { using (var handler = new HttpClientHandler { Credentials = ne...
1
69d2a584bc6e7224ce229bb680f04827
16565be338e95004cf25f09f47174313
Load an Account ID for a certain user
{ $id = 0; global $conn; $stmt = $conn->prepare('SELECT id FROM account WHERE username = ? '); $stmt->bind_param('s', $username); $stmt->execute(); $stmt->store_result(); $stmt->bind_result($id); if($stmt->num_rows) $stmt->fetch(); $stmt->close(); return $id; }
1
e93910613c3cc05bce0ba66420919dad
820fd6486a126fdf1c2d692c49606506
Метод поиска людей по дате рождения.
[MapToApiVersion("1.0")] public async Task<IActionResult> SearchByDate(DateTimeOffset date) { var result = await this.get.First().Handler(new SerachModel { DOB = date }); return !result.Any() ? NotFound(Constant.NotFound) : (IActionResult)Ok(result); }
1
7996c69bb81161fb0deadbe1f31745f6
efb0437aa71094100512337e09a08faa
refreshes the state of the build panel after switching back to it
public void refreshState() throws DebugException;
1
7155effa30f786b872735407b0390248
b7e89745d6a522242e4593e618ca9eb6
Calculation of net total amount of profit/losses over the entire period
def calculate_net_amount(trans_list): p=0 for i in trans_list: a=[] a=i.split(":") if(a[0]=='D'): p=p+int(a[1]) else: p=p-int(a[1]) return p
1
69be64299853df595dd45d3db7e6c102
35739da44826286606976200fdfe31fd
Actualiza el comentario de una orden de compra
class Client extends \Jane\OpenApiRuntime\Client\Psr7HttplugClient public function patchCommentToOrder(int $orderId, int $commentId, \Starweb\Api\Generated\Model\OrderCommentModel $requestBody, string $fetch = self::FETCH_OBJECT) { return $this->executePsr7Endpoint(new \Starweb\Api\Generated\Endpoint\PatchC...
1
4ac78ad6b11505329fc8e3346f2a5de1
23ee651d3b8c1f852eef761fcbae49d9
查询用户搜索到科研成果的数量
Map<String, Object> paramMap = this.getRequestParam(request); if(paramMap.keySet().contains("results_search") && null != paramMap.get("results_search") && !"".equals((String)paramMap.get("results_search"))){ String newStr = URLDecoder.decode((String)paramMap.get("results_search"),"utf-8"); paramMap.put("resul...
1
6f54132c1099186c87116d42473cc96e
011fdb45ad253cd56f7bf5afbdc81f4d
Is a particular output-name recorded as enabled?
public abstract class DefaultBlockModel implements Serializable, BlockModel, XmlStorable, XmlSignable, XmlDataStoreSignatureListener public boolean isOutput(String portName){ return outputs.containsKey(portName); }
0
8d0cae352a5922e90f9f6df472f3c164
03fb4d4b5b3b931268f6f6101a32fbe6
현재 화면잠금 상태 불러오기( true: 잠김 / false: 풀림)
class Data(context: Context){ fun isLock():Boolean{ return data.getBoolean("Lock",false) }
1
b9c9597afba4c22937537911070d53ef
ba4205455bf56053b1f17c7d5bcf6bbc
Occurs when the actor data is newly existing; Usually when it first comes into range of the player.
EventActorNew::EventActorNew(sge::Actor *actor) : EventWithData<Actor *>(EVENT_ACTOR_NEW, actor) { }
1
30b81f1a22c9db3a4ea0d7fa02acf57f
03d5801cebd7a1c599b146ba481a2c45
对验证码进行url编码
StringBuffer sb = new StringBuffer("#code#="); sb.append(code); try { return URLEncoder.encode(sb.toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); throw new RuntimeException(e); } }
1
070c496779298c6ac90d820f6011ddd0
3f1522d1a1ef9b99e359e53b0f39fda5
Deletes a database instance
public static void LocalDbDeleteInstance(this ICakeContext context, string instanceName) { var settings = new LocalDbSettings() { Action = LocalDbAction.Delete, InstanceName = instanceName, }; ExecuteRunner(context, settings...
1
f3a0f60236714fe9e06a2fce80222383
50e2d0bd82e92fda36ce8006f75a7ec9
method for loading all auteurs. It is using the crud service to getting data from the web API
export class AuteurService getAuteurs(): Promise<Auteur[]> { return this.http .get(this.auteurs_api_url) .toPromise() .then(response => response.json() as Auteur[]) .catch(this.handleError); }
1
73c5bc7b0cff2862e6ebed5cac7e13c0
d012a2a0902df0d106127ddc89308208
them bai viet moi
class BaiVietController extends Controller public function create() { $chuyenmuc= ChuyenMuc::all(); $loaichuyenmuc =LoaiChuyenMuc::all(); return view('admin\baiviet\addbaiviet',['chuyenmuc'=>$chuyenmuc,'loaichuyenmuc'=>$loaichuyenmuc]); }
1
3b59977ca4d24d0779545f67d6281030
d45593f5a5fd59c437c7131076e3c621
パネルが動けるかを判定し、更新
public class MainPanelControll : MonoBehaviour void Update () { }
0
a741e3fcf8d330f66eacc4c5914354f7
963ca3c1b5f8e9fa6a00ab545ba62bc2
ADDITION MATRICIELLE
Matrice r = new Matrice(m.nbLgn, m.nbCol); if (this.nbLgn == m.nbLgn && this.nbCol == m.nbCol) { for (int i = 0; i < this.nbLgn; i++) { for (int j = 0; j < this.nbCol; j++) { r.mat[i][j] = this.mat[i][j] + m.mat[i][j]; } } } return r; }
1
4e312020ef9cbfd6371cec496e566d6b
273ea91c002372bea53c4510d10ed895
Parses date from line by splitting on space (' ') and taking the first element
date_line = date_line.strip() datestr = date_line.split(':')[-1].strip() date = datetime.datetime.strptime(datestr, "%d/%m/%Y") return date
0
356c299d8f7b588716f20eb03c1f9d73
f97ac363329e6c4c51bf8c1635ce7dbc
Return a hash of the versioned columns with their values before the last save.
class AuditBatch def old_attributes @old_attributes ||= begin query = @relation.select(:id, *@updates.keys).to_sql result = ActiveRecord::Base.connection.exec_query(query) result.to_hash end end
1
f9f6a170e7b91a9a94b842d87db66fcc
6898736abfa93171958e764d9b45e346
Select Sim Study Plan In Report.
namespace RevenuePlanner.Test.Controllers [TestClass] public class ReportControllerTest [TestMethod] public void GetTopConversionToPlanByCustomFilter_ByCampaignCustom() { Console.WriteLine("Retrieve data to render view by ParentLabel as Program Campaign Custom.\n"); HttpC...
0
3f4d89d7c354bbb9bbf9faecb0c1a4bf
d3babba302cc7ee717fff34e25b2fca6
Display the sanction creation view
$em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SquadFttBundle:Sanction')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Sanction entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->r...
0
5e096aca6069753500f68fe85871cd4a
fa0136ed5bc9a5a2413aa5660cdd9061
returns if the entity is fetched from database.
class DocumentRef<T extends Entity> implements IDocumentRef<T> public isFetched(): boolean { return this._cachedDocument !== null; }
1
8d3cd85dc5d5435a3bb60fb2232a08fc
c1473b8a05b98aef9357a1b92363d23b
Ein vom Namen des Workingsets abgeleitetes Unterverzeichnis erstellen.
def sub(name): dir_sub = Path(workspace['root']) / name if not dir_sub.is_dir(): dir_sub.mkdir(parents=True) log.debug("Subfolder: %s" % str(dir_sub)) workspace['sub'][name] = str(dir_sub)
1
0ed7ba86d0b7b8a10d23bc0a7c7aef56
ca32c291c32f905bab87db67f27ad483
Whether we expect an XML response from the server. <code>false</code> for text or other response
boolean isResponseXml() throws IOException;
1
84d5cf54bc2439a1122ffb2616212230
dcf0e025d22f876494129d5372bfbf96
判断是否已登录 如果登录了 自动跳转到后台首页面
class Login extends AdminController public function initialize() { parent::initialize(); $action = $this->request->action(); if (!empty(session('admin')) && !in_array($action, ['out'])) { $this->redirect(__url('/'.config('app.admin_alias_name').'/index')); } $this...
1
0532ce3187ee0cc39920059471fabea9
1877bd260432bc2646ba20bf7f35198b
Filter the arguments used in an HTTP request, to make sure our user token has not been overwritten by some other plugin.
class FluentFormAddOnUpdater function http_request_args($args, $url) { if (strpos($url, 'https://') !== false && strpos($url, 'edd_action=package_download')) { $args['sslverify'] = false; } return $args; }
0
22c30d3abed12cc08d7800934718f406
171c030cae4a90cc4ba0cfac7b03ffc7
en:Get Float type parameters, such as ExposureTime and Gain, for details please refer to MvCameraNode.xlsx file under SDK installation directory
for i=1, cameraParaSaveFileLimit do for k, v in pairs(cameraParameterList[i]) do if type(k) == "string" then local key = k..i if not CS.LPCFramework.LocalDataStorage.Instance:HasKey(key) then break; end local sav...
1