query_id
string
corpus_id
string
query
string
code
string
label
int64
102b2db003bf7ad2d9758b5e0e763245
294cd83c89a3a11a301754bc1423af8f
Run the minimum area enclosing triangle program
def main(): triangle2()
0
9526b03894edb85189eaed7eff1c3202
9d3ed80a3617bc6e1dbea583f868c9fe
Saves user's cart price to Local storage
let cartCost = localStorage.getItem('totalCost'); if(cartCost != null){ cartCost = parseInt(cartCost); localStorage.setItem("totalCost", cartCost + product.price); }else{ localStorage.setItem("totalCost", product.price) } }
1
6760c2ad781011f34c5bd3ec2fa62c41
3170f0c6bd6d95ac85dd26b42dda18f7
Get the DynectSession creation out of the way so that tests can ignore it
class WDIOTerraService beforeSession() { global.Terra = {}; global.Terra.serviceOptions = this.serviceOptions; global.Terra.describeTests = describeTests; global.Terra.describeViewports = describeViewports; global.Terra.viewports = getViewports; }
0
8a4c08784b3834783e24cba66d042f74
43cb4e994bd147cd411dd5b46d76ce9c
Fetch a file from provided url and generate a checksum.
local_filename = os.path.join(gettempdir(), filename) if not os.path.exists(local_filename): local_filename, _ = urllib.request.urlretrieve(url + filename, local_filename) statinfo = os.stat(local_filename) if statinfo.st_size == expected_bytes: print('Found and verified', filename) ...
0
51b418af2c531c84877efa01c2e750fe
ddde801eb932f88e1a5bc34e46e5c59c
Rapid move to point
{ var rapid = Mach3GcodeCommands.RapidPositioning(); var across = Mach3GcodeCommands.MoveXY(x, y); return rapid+across +Environment.NewLine; }
1
b0d90e74cacb043a96b0d5513b835d66
0d8391dcb03596aa69065118e5f141fa
Bloqueia a alteração do formulario
namespace TCC_PA public partial class Pergunta2 : Form private void button15_Click(object sender, EventArgs e) { button15.Enabled = false; }
0
2c48840412a69273b91afb02e3e61a71
cd6a05deb0ba3e2004676dcaed5e1264
Retourne des informations sur le visiteur actuel (informations tirees de la table fsb2_users)
{ $req = " SELECT nom, prenom FROM visiteur WHERE id= '$idVisiteur' "; $rs = parent::$monPdo->query($req); $liste = $rs->fetch(); return $liste; }
0
9898dbce1f0a2af449943ea81e69eab2
48fe4bf55230f6487a72897287f528ea
Go to the next page in a document
function handleGoNextDoc() { goNextPrevDoc(+1); }
1
eb78fcd56e817dac90c015b42fed3439
38c6a0dd39a34453af1075bae4fd53da
Get Target Extension name without dot
namespace iHoaDon.Util public static class PathUtil public static string GetExtensionWithoutDot(string name) { if (String.IsNullOrEmpty(name)) { throw new ArgumentNullException("name"); } if (name.IndexOf('.') > 0) { ...
1
4a7dec3f8471a426c03b7427b1a5cac9
a658051b6cf135e7827015fae64386f2
returns the inverse of self, a Hash with swapped key/value pairs. For repeated values an array with all its keys are given.
class TransmutableHash def invert! @inverted = !@inverted self.class[replace(invert)] end
0
0c36b3eceea8766346ba39d83611d006
216f1bc298980f2425984031735c1dbb
Enable browse node functionality
class BrowseF(tk.Frame): def enable(self): self._lbl_user_instruction.config(state='normal') self._lbl_status.config(state='normal') self._btn_browse.config(state='normal')
1
4c268bb50aed12fa76620d40525f6394
8fec6ffe424729ae4dab512db0300956
使用多线程进程并发测试
namespace WP.Share.Data.Id.Center.Tests [TestClass()] public class IdTests : IdTestBase [TestMethod] public void MultiThread() { List<Thread> threads = new List<Thread>(); for (int i = 0; i < THREAD_COUNT; i++) { var thread = new Thread(IdMetho...
1
23c9e8dbe43f23191380a20a4c0c7f3b
6c4309be03f672b8541d83653a561ee1
@brief Reads the plus-infinity constant from the manager.
namespace PAT.Common.Classes.CUDDLib public partial class CUDD public static CUDDNode MinusInfinity() { return new CUDDNode(PlatformInvoke.DD_MinusInfinity(manager)); }
0
2f21fc66ab451b9262dece3f5047e410
102777ba5c2376702ad20fade6dca1b9
サーバからの応答待ちでタイムアウトした場合にログを出力するかどうかを設定する。<p> デフォルトでは、false。<br>
public class ServerSocketThread extends Thread public void setTerminateOnTimeout(boolean timeoutQuit) { this.terminateOnTimeout = timeoutQuit; }
0
30bc0cc6c2f1d84d9d8b456b0b8a9ed2
07fb9a18e689824d0856a0b9f4f03872
Called once a step by runtimeScene to update forces magnitudes and remove null ones.
abstract public class KinematicRealBands extends KinematicIntegerBands public void force_compute(KinematicBandsCore core) { reset(); update(core); }
0
b57b56fe57d6225dfc8185da281b962d
9217b868de4efe905cbc88562464a758
复位错误
class SlideDevice public function zeroErrNum() { if ($this->errNum != 0) { $this->errNum = 0; } return $this; }
1
4535e2ed00cac9c75846decb398f1160
70dc2b190f55f02aed8ee1f868335b97
Determines whether the XElement has the specified <c>LocalName</c>.
{ if (!IsValidName(name)) { throw new Exception("Name is invalid."); } if (children == null) { return false; } foreach (TreeNode child in children) { if (child.Name == ...
0
0d27a767d3c0d876714d2bb7bf722f69
07a9abb3129b17f9e50b38b1cf93828c
平均、もとい重心の初期値を決定。値域に収まったx,yの値をクラスタ数分生成
class KmeansClustering: def _initCluster(self): p = len(self.points) / self.k for i in xrange(self.k): cluster = {} rand = random.randint(i*p, (i+1)*p) mean = copy.deepcopy(self.points[rand]) cluster['mean'] = mean cluster['cluster'] = set() ...
1
f95fbce2f6eda3fa0f554119366b0b86
a9ad597d3e7d82dab1a87ac2e93c6285
This method releases the active toolchain back to the core. Overwrite this method if you want to delay the release of the toolchain.
{ for (int i = 0 ; i < acs.length ; i++) { this.releaseCore(acs[i]) ; } }
1
4450f4a8e4dd7f7b0e9bf5bfa4e3a949
6d3c8a083d2510b577be1147ae25fc6d
Retreive client state from database
class SqliteStorage(object): def get_client_state(self): q = '''SELECT threat_type,platform_type,threat_entry_type,client_state FROM threat_list''' output = {} with self.get_cursor() as dbc: dbc.execute(q) for h in dbc.fetchall(): threat_type, platform_typ...
1
661da3b93ce935375ad434ec43cc7676
a34b8986715c8ef8d36799409756b941
This generator yields datapoints as a dictionary with keys being CSV column names and data being values.
def _gen_data(line, id_col, ignorecols, onlycols): for i, elem in enumerate(line): if i != id_col and \ (not ignorecols or not i in ignorecols) and \ (not onlycols or i in onlycols) and \ i != len(line) - 1 and \ i != len(line) - 2: yield elem
0
ff8d89e606187eb479dc84c55c6faa30
fe012f3903042032505b3b408a1a47e1
u""" The ``reset`` method resets the data of the writer. This can be used to reset the content of a shared (through cloning) builder, where the output stream is divided into parts, such as the export of PHP files.
CsvWriter.reset(self) self.source_layout = None self.__position_values = [] self.__md_pool_values = [] self.__iso_concentration_values = [] self.__iso_volume_values = []
1
130137c6a5b46b65cdc7a1c1feeb943f
6e3d702a345695355c5e4f940f2ecaef
Taylor Series Iterative
int i = 1, nextTerm = 1; float sine = x, prev_sine = 0.0; float diff = x; while(true) { i += 2; prev_sine = sine; if((nextTerm % 2) == 0) { sine = sine - nthTerm(x, i); } else { sine = sine + nthTerm(x, i); } diff = sine - prev_sine; if(diff < 0) diff = -diff; if(diff < ep) break; next...
1
d9e0bcf1a8e8a50e0b5dd140ba57ad0b
bd34fe82cb746bd032cc91808f4183bf
retorna el radio de la circunferencia inscrita
function acirculo(r){ return ((Math.PI*r*r*100)/100); }
0
63ed6e8fab1f58679ac8dc1439b12a15
bc614248d6c446bbfbd08df9a08e054f
指定需要由cxfServlet映射的路径(同理/app/*)
public class WebApplicationInitializerImpl2 extends AbstractAnnotationConfigDispatcherServletInitializer @Override protected String[] getServletMappings() { return new String[] {"/app7/*"}; }
0
5edc2150bee30aacefd0ea2a7741ad75
7d6c39873fb0e9334443debf62b1687d
Gets the subseries to edit.
if(subModelOrderId != null) { var newSeries = new Array(); var count = 0; subModelOrderId = new Array(); subModelOrderName = new Array(); $("#sortSubModel .order li").each(function() { var obj = $(this); if(obj.attr("on") == "true") { subModelOrderName.push(obj.find("span").html()); subModelOrd...
1
fe71fc49258950ba391306ec423958d1
67c724b83fd34a8e91200120ddc83212
Load the most recent save.
export class SaveData static load() { this.io( false); }
0
23448ec122e1206e05ef01f10ad2b28a
9b5444a3661a4de5d2b4e4e99dc704f1
This method creates a AlertDialog that is used to determine what kind of notification the user wants to receive
public class Link extends Activity private AlertDialog.Builder createDialog(String title, String message, int imageResource) { return new AlertDialog.Builder(this).setTitle(title) .setMessage(message).setIcon(imageResource); }
0
a75aabb2c228c4d136836d5e8e457d62
0c6553e54b9be6398488845bf65c5368
Get robots.txt custom instruction default value
class SeoAdmin implements Injectors\iLinksCollection, Injectors\iLinksSourcesCollection private function getCustomRobotsTxt(int $domainId) : ?string { $fileRobotsTxt = $this->getCustomRobotsTxtFile($domainId); if ($fileRobotsTxt->isExists()) { return $fileRobotsTxt->getContent(); } return null; }
0
8dc6eadb46023d775c1f25724586f007
eff7ca08528197d2f4e910bdb9fff09f
Возвращает список идентификаторов дочерних типов данных, по отношению к заданному типу. Поиск осуществляется на всех уровнях иерархии, для заданного домена или для всех
{ $result = []; if ($baseType instanceof ISchemaElement) { $this->derivedFrom($baseType, new SplObjectStorage(), $result); } return $result; }
1
159dced3e7d14fd49f07b7cb53d74c2f
f505a5768f7e4295f7167addd07ee54f
Returns true if both indexes are in the same 3 x 3 block of a 9 x 9 sudoku puzzle.
ASSERT_RANGE(row1, 0, 8); ASSERT_RANGE(row2, 0, 8); ASSERT_RANGE(value, 1, 9); for (int col = 0; col < 9; col++) { if (sudo->sudoData[row1][col][value] != sudo->sudoData[row2][col][value]) { return false; } } return true; }
0
4d5db422733843332fd49098c5e6e2b9
23c6f10ee87dcb0739dc6a91f428afc4
remove cat from front, which creates new array and leaves original alone
function destructivelyRemoveElementFromBeginningOfArray(array){ array.shift(); return array; }
0
6726f66eae3cf4354cb7f0e85162274e
65afe15ee0b4adae6533548051091604
更新客户合同关系数据
void updateContract(ContractEntity params);
1
dea9274b2444a157fbac8ad570926a68
8c1224550ff47393042850187cb9c8a3
打开或者关闭任务器
Cron4jPlugin cp = (Cron4jPlugin) TaskConstant.getTaskMap().get(taskId); if(status == TaskConstant.TASK_STATU1) { cp.start(); }else if(status == TaskConstant.TASK_STATU2) { cp.stop(); } TaskBase.me.findById(taskId).setStatus(status).update(); }
1
8b3b3558b23affede46450f2af9ef558
4838402fe6588eb9e5f080138cfbe16a
计算当前位置与周边目标之间的直线距离,并按照距离升序返回
function GetLinearMostTargetsPosition(search_position, search_radius, team_number, start_width, end_width, team_filter, type_filter, flag_filter, order) local targets = FindUnitsInRadius(team_number, search_position, nil, search_radius+end_width, team_filter, type_filter, flag_filter, order or FIND_ANY_ORDER, false) ...
0
4ffa4a33f7b1dcfbdf0e3a65bbf8f3a2
7e4e15a13cd89304caa1682a2b5e4b44
日本語曜日の取得
class Time def wday_ja to_date.wday_ja end
1
25fd1a508f0a25126a60631905f9ae68
40488f9779f8aa3b9314894c11975ed2
функция инициализации элемента.
{ cout << "Элемент " << this << " создан" << endl; }
0
f27f9df30a5c80ff168207e5f7214228
d5fba1054c36793020668ec5130e0e56
获得最近一次复权的日期 比如省广股份 变动日期 为 2014-05-16 则5.15的KLineUnit为cur,5.16的为last
class DrEngine(object): def get_last_datetime(self,renko_name): qryData = self.mainEngine.dbQueryBySort(dbName=RENKO_DB_NAME, collectionName=renko_name, d={}, sortName=...
0
852279d77080730c35ab83c333b37232
2516e92ddc0b7664d35af8905d839659
[START dialogflow_list_contexts]
namespace Google.Cloud.Dialogflow.V2 public abstract partial class ContextsClient public virtual gax::PagedEnumerable<ListContextsResponse, Context> ListContexts( SessionName parent, string pageToken = null, int? pageSize = null, gaxgrpc::CallSettings callSettings = n...
1
b7614a08707f55f3e43529cf37b58144
03dcf2eed5cd790f73520643c1a6d9eb
Muestra una simulación del diagrama de Gantt.
{ if (mode == 0) { List<Process> groupprocess; List<Process> scheduledprocesses = new List<Process>(); List<Process> orderedprocesses = Clone(processes); int accumlatedtime = 0; Process currentprocess; ...
1
b9a889420aed3798b76d5b5cf84676f5
73302c24c528aabe73fd0677557a34da
LCD uitzetten.
{ lock (LCDLock) { _backlightval = DefineConstants.LCD_NOBACKLIGHT; expanderWrite(0); } }
1
9eac1fcf0c9d50520fd747f9846a9e99
a01b4f7dee865fcad486bb623e17d676
Method of associating specific operator with exact department
public void SetDepartmentOnAssignedEmployee() { Employee emp = CreateObject<Employee>(); Department depOriginal = CreateObject<Department>(); Department depNew = CreateObject<Department>(); emp.Department = depOriginal; emp.Department = depNew;...
1
05b9795d75b141bd36251290e34715d4
3767bfdc724fd5a1512c85575fc291a3
Sets size of button.
class GButton(GCompound): # Constants def setSize(self, width, height): self.frame.setSize(width, height) self._recenter()
1
df0b1cf0b208a4ac1c927ed83af5084d
cb9c20e7bcd026d871e7efd0476af7d3
Called when the user specifies an
void fn_prompt (inode_state& state, const wordvec& words){ DEBUGF ('c', state); DEBUGF ('c', words); string input; for(auto i = begin(words) + 1; i != end(words) ; ++i){ input.append(*i); input.append(" "); } state.change_prompt(input); }
0
a8be20ef7802ca78628dd0cdd1f6ac25
a6a547d3ccceee1e8442636233348769
Determines whether the application is being approached with a vesselVisit id thus setting the context in which the application acts
var isNavigating = applicationSettingsModule.getBoolean("isNavigating"); if (!applicationSettingsModule.getBoolean("isNavigating")) { applicationSettingsModule.setBoolean("isNavigating", true); console.log("navigating",applicationSettingsModule.getBoolean("isNavigating")); return false; ...
0
4d758411613118a00a4c557bd1d23fed
072e323b46b8cca9cc5fce5a7b3dfb31
Método asincrono para enviar telemetria de coração simulada
function timeout() { setTimeout(function () { let batimentos = Math.floor(Math.random() * (maxBpm - minBpm + 1)) + minBpm; if (batimentos < 60 || batimentos > 90) { publicarMensagem(batimentos); } timeout(); }, 2000); }
1
e13a5d0e8cd15e70a9ca16cc2a6a7852
8c1ca34bbdd06d3aba08afe7b24520aa
Reads the next key-value pair form the given file contents. Keys and values are delimited by colons. Values may extend to the next line if the next line begins with two or more white-space characters, but contains at least one non-whitespace character. This automatically skips over comments, blank lines, etc, till the ...
for line in fh: key, found, value = line.partition(sep) if found and sep not in value: yield key, value.rstrip()
0
5ef6513cce0444e854134f38d7c2cfb5
d58845a98fdbd8d46e6810677a1d57ce
订单发送到 蜂鸟 的 配送渠道
{ if (app::get('logisticsmanager')->is_installed()) { $channel_type = $this->__dlyObj->getChannelType($this->__currDlyInfo['logi_id']); if ($channel_type && (in_array($channel_type,array('360buy','taobao','ems'))) && class_exists('logisticsmanager_service_' . $channel_type)) { ...
0
8b163f85add860f5db576fff845e01e1
e76678e33246045f515db84e533a4461
pulls probability of precipitation from a weather description
if row_precipitation == '': precipitation = 999 else: precipitation = row_precipitation return precipitation
0
0f63537b6d5885af3a660d47b1939c0f
908579dfd6b64faeeb355d1d14e8bfeb
solve the problem with A* algorithm
class A_Star_Solver: def solve(self, terrain: Terrain) -> list: open_list = [] closed_list = [] start_pos = terrain.start start_block = Block(start_pos, start_pos) start_node = Node(start_block, move=None, parent=None, f=0, g=0, h=0) goal_pos = terrain.goal g...
1
d3c36f48e4f214320b727f6f7bcd3258
66c358e6328b778ec9735005bbbdbe71
Computes the hyperbolic sine of `self`.
getcontext().prec += 2 re2 = 2 * self._real im2 = 2 * self._imag den = cos(re2) + cosh(im2) ans = self.__class__(sin(re2) / den, sinh(im2) / den) getcontext().prec -= 2 return +ans
0
708b294b68ae6c39afe308b3d9ca33e0
e4e2df3a440f1285b667e2bf08c5caeb
让坦克回到上一次移动点位置
public class TankEnemy : MonoBehaviour void MoveAgain() { Speed = previous_Speed; EnemyTarget = null; target = null; transform.LookAt(waypoints[curWaypointIndex].position); }
0
166021508f5fb45f4af491dff26d3195
acf56d4b729f9d48580ad378c945de00
Metodo para validar la existencia de una unidad de medida Si no existe lo crea, si ya existe retorna los IDs correspondiente al producto (product_uom_id)
@Transactional(rollbackFor = Throwable.class) @Service("uomService") public class UOMServiceImpl implements UOMService @Override public Boolean isUOMExistsArabic(final UOMDTO uomDTO) { if (uomDTO.getId() != null) { return uomRepository.findByMeasurementArabicIgnoreCaseAndVendorIdAndIdNot(uomDTO.getMeasurementArab...
0
d8d51b4fead04cd4b6e72abf97ac59a7
c0d8f598ad0ff0bc0cd003b71a3142e1
All encompassing method that allows dealer to handle betting and clean up to perform one round of Texas Hold 'em
class Table(object): def nextRound(self): self.cleanSeats() self.getBets() self.deal() self.playerActions() self.dealerAction() self.settleUp()
1
7f8317bc6264ac79cf669c8f3b14b800
27e60673bbf7272395d551af41c60db1
更新职位浏览次数
class Job{ public function upadteJobView($id,$lastview){ global $_W; if(empty($id)) return; $newviews=$lastview+1; return pdo_update("labour_job",array('views'=>$newviews),array('uniacid'=>$_W['uniacid'],'id'=>$id)); }
1
9946665076b70c4cfb69acf46ea92345
1e9716eb1870950eb8d69612dd00a2e0
初始化一颗空二叉树
TreeList initTree(TreeList root) { root->leftSon = NULL; root->rightSon = NULL; return root; }
1
6c4e871a67aad46d4f9730dc7209a555
9976da6c9455bbd0ec4a3d9b92ea3566
@brief Enable or Disable Lower/Upper threshold warning of the analog watchdog on single/all channels. This parameter can be any combination of the following values.
{ if(ENABLE == newvalue){ ADC_WD1SR(adc_periph) |= (uint32_t)adc_channel; }else{ ADC_WD1SR(adc_periph) &= ~((uint32_t)adc_channel); } }
1
57ff526622daf338de7dc79381592448
21690666093e3ecc2ac73f181068db13
清空积分
{ ScoreDAO sdao = new ScoreDAO(); JiGouDAO jgdao = new JiGouDAO(); KpxmDAO kdao = new KpxmDAO(); List<JiGou> listjg = jgdao.findAllPinfenJigou(); List<Kpxm> listk = kdao.findAllOrder(); for(int i=0;i<listjg.size();i++) { JiGou jg = listjg.get(i); for(int j=0;j<listk.size();j++) { Kpxm k = li...
0
6ebc95a404f78c28b49a11f90744cc82
75bc661b7702c27dd8bedbfb17f479f9
Draw an outline around all matching elements.
{ g.SmoothingMode = SmoothingMode.None; g.FillRectangle((e == selection_) ? Brushes.Yellow : Brushes.Orange, e.marker_); g.DrawString(e.Name, Font, Brushes.Black, e.marker_.Left + 2, e.marker_.Top + 1); if (null == e.children_) return; foreach (LayoutElement child in e.children_) { g.Smoothi...
0
d715c0857e844003e16d7201676d7945
bc631db92ed7f89d4a94c0e0bab2000e
Defines a 3-dimensional volume which pieces can be but in. Is a rectangular box of any size.
class Obstacle3D: def __init__(self, boundsx, boundsy, boundsz, penalty=100): self.boundsx = boundsx self.boundsy = boundsy self.boundsz = boundsz self.penalty = 1
1
8ab531475bef8895ba212bc58ef0f26d
51125634d8138133510f65a509fb8081
attempt login with incorrect email credentials
class LoginTest extends DuskTestCase public function testLoginWrongEmail() { $this->browse(function ($browser) { $browser->visit('/login') ->type('email', 'notAnemail@mail.com') ->type('password', 'secret') ->press('Login') ...
1
6333fa5fc3cae1b27408d07a9e9c3f5d
f594a5458f4438011cb8853e2fff26d7
Plucks column elements from buffer and lays them down in continous space
void extract_column_buffer_table(long col, long cols, long rows, char **thebuffer, double *x) { char *temp; char *buffer; char *savebuffer; long z = 0; long r = 0; buffer = (char *) mycalloc(strlen(*thebuffer)+1,sizeof(char)); savebuffer= buffer; strcpy(buffer,*thebuffer); while((te...
1
981b72d6f435ca2792659fdf90078935
b88ed16aea0639badf46be473c5c07e4
获取json类型数据(普通对象类型),并刷新过期时间
public class ERequest<T> public void doJSONGet(String url, JSONObject jsonObject, boolean cache) { EJSONObjectRequest sr = new EJSONObjectRequest(Method.GET, url,jsonObject, (Listener<JSONObject>) mListener) { }; sr.setForceUpdate(!cache); sr.start(); }
1
8458dfb68ad9659e62c9c302254a504f
e8a0ca418b3009bed557adb91fdd9724
Returns the assurance level
@Entity @Table(name="PROJECT_COST") public class ProjectCost implements Serializable @Column(name="AUDIT_LEVEL") public String getAuditLevel() { return this.auditLevel; }
0
60ce99b0388b89f67ceb852c9df607d0
9699943cdf362536a6f5cc00c329d3c4
Gets a message from the rx queue.
if self._closed: raise ChatError("Port is closed.") if self._thread.is_closed(): if self._rx_q.empty(): self.close() raise ChatError('Thread closed unexpectedly.') self._raise_thread_errors() if not block and self._rx_q.empty():...
1
bb285108470a26748366be3d47c03064
e94ab6df278e4f79af1ab4cd9e5d6d7f
平台驱动的探测函数, 同时带过来平台设备的结构体pDevice
static int s5pv210_led_probe(struct platform_device *dev) { int ret = -1; struct s5pv210_led_platdata *pdata = dev->dev.platform_data; struct s5pv210_gpio_led *led; printk(KERN_INFO "----s5pv210_led_probe---\n"); led = kzalloc(sizeof(struct s5pv210_gpio_led), GFP_KERNEL); if (led == NULL) { dev_err(&dev->dev, "...
1
864ef9c4ed77867e74a669d16b95423c
a948b3b128d6e8283b605b3a31ed3b69
将一张图片设给ImageView并且加入到LruCache中
public class ImageLoader public void loadImage(final String path, final ImageView imageView){ imageView.setTag(path); if(mUIHandler == null){ mUIHandler = new Handler(){ @Override public void handleMessage(Message msg) { ImageBeanHolder ho...
1
b1fd902b9e2ad0bb6beebcb4348988a1
e610adfd4e150399efb25a7c40b7c77e
環境が負荷テスト環境か否か
{ global $context; if (! isset($context['X-Jumei-Loadbench']) || empty($context['X-Jumei-Loadbench']) || strcasecmp($context['X-Jumei-Loadbench'], static::PROD_ENV) === 0) { return true; } return false; }
1
cb6e61a9060041376dff692f113026ed
5b8aff73dfa6082acc719f472e51ba87
格式化long型时间,默认格式yyyy-MM-dd HH:mm:ss
public class TimeUtils public static String longToString(long longtime,String format){ Date date = new Date(longtime); SimpleDateFormat formatter = new SimpleDateFormat(TextUtils.isEmpty(format)?"yyyy-MM-dd HH:mm:ss":format); String dateString = formatter.format(date); return dateString;...
1
fe397ec5e873025d2f44e332c7c2f1f3
a35aed975d6a27c67d6646414bb0f8e9
################################################################################################ # calculate the raw p-values using the observed test statistics # and their null distribution. ################################################################################################
delta_obs <- t1 * sqrt(2 / design$n_1) n_recalc <- design$n_1 * ((qnorm(0.2) - qnorm(1 - design$alpha_1) * sqrt(sqrt(design$n_1)^2 + sqrt(design$n_1)^2) / sqrt(design$n_2)) / t1 + sqrt(design$n_1) / sqrt(design$n_2))^...
0
7ec56b4eb067b6349dab6c97f556b882
6e03b56e238a973a9cf96b6ebed9773b
健康教育记录AggDO数据更新
{ List<object> param = new List<object>(); param.Add(aggdos); si.url = url; AdhgeneralnursingAggDO[] rtn = si.invokeList<AdhgeneralnursingAggDO>("update", param.ToArray()); #region "数据缓存逻辑新增" handleRtn(rtn); #endregion ...
1
9efd0d23a90dbd7063ecf8838a48b0b7
1407ba7c1f578719c497bb73c0a664ed
是否存在二分搜索树中
namespace CSharpAlgorithm public static class SearchExtention public static bool BiSortTreeSearch(BiTree<int> bTree, int key) { Node<int> p; if (bTree.IsEmpty()) { return false; } p = bTree.Root; while (p != null) ...
1
4129baedd62a3efaccc144b8a2f92545
4ceebb162c07c7013ecf297f6caf7728
Convert bits per second to kilobytes per second
{ double res = ToMebibitsPerSecond(val) / 8.0; return res; }
0
94ef9ad82a594dfef7a9ec9047216b64
ec40c6204aa04dea91893d545c3255cc
Modify an AWS EC2 NetworkInterface attribute.
export class ModifyInstanceAttributeCommand extends $Command< ModifyInstanceAttributeCommandInput, ModifyInstanceAttributeCommandOutput, EC2ClientResolvedConfig > constructor(readonly input: ModifyInstanceAttributeCommandInput) { super(); }
0
e0122e1aa9b9111cdc008bd47afe1d68
03f4cdda996c449f5fd9702cdbb9d467
Enable state saving. Stores state information such as pagination position, display length, filtering and sorting.
private createSettings() : Report_SaveState { return { pageSize: this.getPageSize() }; }
0
6060725e9808ecf509559da3114f7132
065012bcd5d69efa89bf90dbc6e4b428
Retourne l'arrondi a l'entier le plus proche d'un nombre
class Constante static Floor(value){ return Math.floor((value + 0.01) * 10) / 10; }
0
55aad5187b5dac9bfa0d5a39c9d7905d
f1a90cc3290470ffa7ea984234a803d7
If the input array is 2D return it, if it is 1D, append a dimension, making it a column vector.
if np_arr is None: return try: np_arr.shape[1] except IndexError as e: return np.reshape(np_arr, (-1, 1)) return np_arr
1
ec46d12f2a4ff4ff7fccf4b2383f4aa4
f889acbc90d631ab38768b66c5cfb1d8
accepts an array of logical characters and sets the word to the value of chars
{ if (newChar != nullptr) { word = new char[strlen(newChar) + 1]; strcpy_s(word, strlen(newChar) + 1, newChar); } else { word = nullptr; } }
0
23a0252f7da4656198eaa6a2eeca288a
1cc0bedba2e97ffd59266a4518c93128
查看队伍类型列表
namespace BLL public partial class Bll_TQB_CHARACTER public DataSet GetList_TYPE_ID(string C_TYPE_ID) { return dal.GetList_TYPE_ID(C_TYPE_ID); }
1
91d6cd57a3363fc69f6daca5f1c9f29b
c9f3717d6016a8bbd0c8b2f7c3a8b44a
Invalidates the thumbs.
try: os.unlink(self.thumbpath()) except (IOError, OSError): pass try: os.unlink(self.thumb2path()) except (IOError, OSError): pass try: os.unlink(self.disppath()) except (IOError, OSError): pass
1
c8846217d3b450d6bcb8532bfa6249b1
4dd3b85cfef72e80b604a2e5db56eb61
Appends the contents of the given language dictionary, overwriting any keys already present with the new values
export class Messages public static add(newMessages: IMessagesDictionary) { this.content = merge(this.content, newMessages); }
1
19ae2ebd6e87882bcfead343b8581431
0cdefdd5007bc2ad16afb7d4c6ed61ad
========================================================== <T>追加一个页面复选框对象,放在父容器里面,并返回这个对象。</T> ==========================================================
check = check == undefined ? false : check; var array = addInputLabel( "radio" , target , value ); var jqueryInput = array.input.attr( "name" , name ); if( check ){ jqueryInput.attr( "checked" , "checked" ); } return { input : jqueryInput, label :...
0
8f6bc3576d02e6f5e98346cc2ba4e624
7a64f56ac003e552c04196f77aa8c1af
Redis模板,存储关键字是字符串,值是Jdk序列化
public RedisTemplate<String, String> redisTemplate(LettuceConnectionFactory lettuceConnectionFactory) { RedisTemplate<String, String> redisTemplate = new RedisTemplate<>(); redisTemplate.setConnectionFactory(lettuceConnectionFactory); RedisSerializer stringSerializer = new StringRedisSeriali...
0
4905eb184d1065e9b8b8cdd4c8e804a0
a7585ea26579ef0fe240701c94f445a4
Delete Character(s)
{ for(DWORD i=0; i<=strlen(Input); i++) { if(Input[i] == Character) { for(DWORD n=i; n<=strlen(Input); n++) { Input[n] = Input[n+1]; } } } return Input; }
0
2e6934f29ac6b8e2ed532089eca9206c
27bce282e1de1b4390cde40105d67747
开真空,并且检测到真空已经达标,则返回true
{ bSend[0]=0xaa;bSend[1]=0x00;bSend[2]=0x21;bSend[3]=0x00;bSend[25]=0xcb; for (int i = 4; i < 25; i++) {bSend[i]=0x00;} System.Threading.Thread.Sleep(1000); sP.Write(bSend,0,26); System.Threading.Thread.Sleep(1000); if (bReceive[3]==128) { return true; } else { return false; } ...
1
7507c88cb69bdd4beef27891622ff82d
39ae2690698692cd3fa9531f43eace35
Form a complex number from real/imaginary parts
complexType::complexType(double real, double imaginary){ realPart = real; imaginaryPart = imaginary; }
1
996c4321bb84a5287d6e07017eb345e1
b0ba66993c9f16183816652ea50362f6
下滑监听,手指从下往上滑
float endY = event.getY(); float distanceY = startY - endY; float date1 = distanceY/audioTouchRang; float volume = distanceY/audioTouchRang*maxVolume; float volemeS = Math.min(Math.max(volume+mVol, 0), maxVolume); if(date1!=0){ updataVolume((int)volemeS); } }
1
282d4fcefada7adef2552becc72909f4
591cbf789b469c5e035e08e85a4ddb96
设置增益的偏移DB
{ HI_U16 data16; HI_U16 lut_val; if((p_gains->again_db + p_gains->dgain_db)< 0x8C) { SENSOR_I2C_WRITE(PGC_ADDR, (p_gains->again_db + p_gains->dgain_db)); } else { SENSOR_I2C_WRITE(PGC_ADDR, 0x8C); } }
1
ff2293f594e732285edd68b3d1efb244
83ea6c27c888cc16d249dd10b53969a8
提交随机练习答案
class ExerciseController extends Api public function exercise_rands(){ $this->checkToken(); $em = new ExerciseModel(); $userId = $this->param('user_id'); $exerciseId = $this->param('exercise_id'); $tQuestion = $em->getRandomExercise($exerciseId,$userId); $this->Api(array(1,$tQuestion)); ...
0
96cdd9a25d1d0dda3e13afc1ddd6c858
257c2dd827bc6dceb180473af0aa343f
Returns a if x is less than a and b if x is greater than b, else returns x.
function iff(t, a, b) if t then return a else return b end end
0
4b4c35be5b969cc04d005aefe0569048
862228bcc87e369c7f64ab94d81b5f59
Counts the depth of read bases meeting a minimum quality
void read_count (std::vector<clade_t>& cladeinfo, const std::vector<u64ipair_t>& record, const bvec_t& is_record_m, const strvec_t& ipfqs, const strvec_t& isfqs, int k, int batch, bool silent) { int num_record = record.size(); for (int fidx = 1; fidx < ipfqs.size(); fidx += 2) { if (!silent) std::cout << "\tp...
0
65aa89e606eb9651a9a4f34bf3ed7470
cabadea6aeb25b21feeee759882a57ef
根据JDBCTemplate查询结果整合返回所需格式的数据
public class MessageHelper public static ResultMessage formatToResultMsg(List<?> list,long total){ ResultMessage resultMsg=new ResultMessage(); resultMsg.setSuccess("success"); resultMsg.setMsg("查询成功"); resultMsg.setRows(list); resultMsg.setTotal(total); return resultMsg; }
1
de0ac86473daf329def431220a5eb8a8
cb716e7a05d3d2c13ed357842cfeb2fb
Taking the coords we gained and getting the forecast from it, We then set up the Weather list to easily pull this information later
class Farm: def pull_forecast(self): self.future_forecast = weather.get_forecast(self.coords[0], self.coords[1])
1
a6db173c02367a9ea2c8bce123683a17
4a5b8198c06aa897c0b8f55e47de6703
Create training set using the true function. Noise is added to the true function value.
void TrueUnknownFunction(unsigned int num_training_points, unsigned int num_dimensions, double noise_variance, double** X_train, double* y) { unsigned int i, j; for (i = 0; i < num_training_points; i++) { y[i] = noise_variance * RNorm(0.0, 1.0); for (j = 0; j < num_dimensions; j++) { y[i] += sin(0.9 * X_tra...
1
854d746578719ddcb2251885bb979d59
21f957b85519c744c57939cf95fb6fd7
指定したウィンドウにメッセージを送る。 メッセージ送信後のタイムアウト時間を設定できます。デフォルトは100msです。
namespace WindowX internal class WindowXProc [DllImport("user32.dll", SetLastError = true)] internal static extern bool PostMessage(IntPtr hwnd, uint msg, IntPtr wParam, IntPtr lParam);
0
f721e595eaa816082d060624d5552b91
c1926b6c268a90c1795921a29635ab4d
Sends the event match start.
class MatchDataProvider extends AbstractDataProvider public function onStartMatchStart($params) { $this->dispatch('onStartMatchStart', [$params['count'], $params['time']]); }
1
8281bb6f0cbf31e480587e5b12fb219f
dd2bd7de51319e2fc59d112ad08d78f5
Esta funci�n configura el JTable "tblDat".
boolean blnRes = true; try { vecDat = new Vector(); vecCab = new Vector(3); vecCab.clear(); vecCab.add(INT_TBL_DAT_LIN, ""); vecCab.add(INT_TBL_DAT_COD_PRV, "Cód.Prv."); vecCab.add(INT_TBL_DAT_NOM_PRV, "Proveedor"); ...
1
40d0c81f45ef6072d5d8d9194ac54406
585581109b5cb57a965501e1e07be20f
根据设置邮件的接受语言,获取用户名.
class EmailService extends BaseService private function getFromUserName($data) { $fromId = Arr::get($data, 'from_id', ''); return $fromId === "systemAdmin" ? trans("email.system_message") : Arr::get($data, 'user_name', ''); }
0
13c9776ac3828ddb553723031c0d656e
d549dd415a9a80cadcbc9f21921f05c4
原路退款成功短信通知
{ $touser =$openid; $templateId=Config::get('sure'); $url =$this->hostUrl."/index/order/index/param/all"; $first = "亲,物流显示您的订单已签收,请确认!"; $remark= "如果您已收到货,请点此消息确认收货"; $status ="已签收"; $template = file_get_contents(__DIR__."/refund.json"); $param = sprin...
0
fc4864ac1a0c30f697acd8b70b777c5d
f3710bb926d87c76e716830ee523ea81
Stores the next line for the next user interface response.
public class CLI public String readUserInput() { addLineBeforeNextMessage = false; return sc.nextLine(); }
0