query_id
string
corpus_id
string
query
string
code
string
label
int64
8039c6ba58408d4edcfeacc1405c862a
cda9a508ac06438754d94f8033f5612c
Copy the workfile of the given release to the releasefile location This is inteded to be used in a action unit.
upload(filename, remote_filename) run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}" end
0
a42b16272b004b1ff5cde1090a1d406f
626cf251bd000475b0994d18d795a1aa
Saves the theme in a XML file
class Mage_XmlConnect_Adminhtml_MobileController extends Mage_Adminhtml_Controller_Action public function saveThemeAction() { $data = $this->getRequest()->getPost(); $this->_saveThemeAction($data); }
0
b5b4a0ac4cd49b72df0ed8f975160390
542683e9555f4b0046b1c64007a6a9c8
Returns the H matrix for the Hamming(7,4) code, which is multiplied by the encoded word to check for errors
class GloHammingDecoder: def __init__(self, input_bits): self.data_bits = input_bits self.checksums = [[None] * 7, [None]]
0
2c68de3bef398d84170412db6a5f689c
f4a48837620b57327405a8ca714498a1
Sets the pass steps.
{ int _PassCount = Cell.Passes.PassCount; FirstCellPassIndex = 0; LastCellPassIndex = _PassCount - 1; PassIndexDirectionIncrement = 1; FinishCellPassIndex = _PassCount; }
1
9dc6a4dc4bd9f28d00a0051ebacf3533
f9499f5791bc7930e6d101cb36a2b583
构造支付请求 UI 接口,如自动提交的表单或支付二维码
public class PayController extends BaseController @Before(POST.class) @NotBlank({ "orderNo", "payMode" }) public void index(String orderNo, int payMode) { renderJson(paySrv.requestPayment(orderNo, payMode, getUserId(), getIp())); }
0
569db3c19dcf4e848f0c8e55f618d058
da1590a6c144b42c9425ea6f94149823
转换Collection所有元素(通过toString())为String, 每个元素的前面加入prefix,后面加入postfix,如<div>mymessage</div>。
List<String> result = new ArrayList<>(); for (Object obj : collection) { if (obj != null) { result.add(prefix + obj.toString() + suffix); } } return result; }
1
c945ee1e79211e66e753d2c7d8490141
7016e1460db312e1b9b190705b139707
删除最后一次出现的指定元素,如果删除成功返回true,不存在该元素删除失败返回false
namespace CatLib.API.Stl bool Remove(TElement element);
0
ff22bf1af89eefa5c93f5dadb1c89c34
da23c0617f308701cd7aa74ccbe2684f
目录拖放
const { file, action } = params const { filePath } = file const { dragFromAction, dragList } = state const inDragStatus = dragFromAction === action && dragList.has(filePath) if (inDragStatus || getters.cantDragOver(file)) return commit(...
1
84f035f9604b5ddc29ff8f261c7c8c79
f8bd601f6cb16f541f2cbcf8a40e7593
receive message from client and broadcast them to other clients until client disconnects
while True: incoming_buffer = so.recv(1024) if not incoming_buffer: break self.last_received_message = incoming_buffer.decode('utf-8') self.broadcast_to_all_clients(so) so.close()
1
d3e39530536a9f0c137c73fa8a1c3d90
cfadc141ed329b42a7b18297327b5026
Determine if another NamedPropertyMessage is equivalent to this one, ignoring ID's. NamedPropertyMessage are equivalent, <code>false</code> otherwise.
{ return other != null && Name == other.Name && Properties.ContentsEqual(other.Properties); }
1
d4b639b99dc623852949eb4dc55b8390
96d945496f5445f57304bb7424384334
通知server 玩家有金币改动
{ #if(GAMESERVER_UPDATE>=603) PMSG_HELPER_START_SEND pMsg; pMsg.header.set(0xBF,0x51,sizeof(pMsg)); pMsg.time = time; pMsg.money = money; pMsg.result = result; DataSend(aIndex,(BYTE*)&pMsg,pMsg.header.size); #endif }
1
a3a79edc309f40ac6272192c5fd571d7
55759b0cc49f92a10857bb210aa5f513
Retrieves the number of children in the Func list.
static int FuncLen( lam ) register struct EvalNode *lam; { register int n; n = 2 + GETINT(&lam->left); lam = NEXTREL( &INDIRECT(&lam->right)->right ); while( lam != NULL ) { ++n; lam = NEXTREL(&lam->right); }; return( n ); }
1
c78adf69f32f57e2345119ec257e0be5
dd2f84ecaa0f5de7ad5c9afb0aafecc5
通过Id查询案件注销申请表
class IpService public function getCancleApplyById($id) { $query = $this->database->select('bip_apply_cancle','t'); $query->fields('t') ->condition('id', $id); return $query->execute()->fetchObject(); }
1
635b71c2b065028ce9be029b23c62ec6
9d0fb59a98d41c14535af94db5e7abaf
fonction simulant la commande svn cat
int Cmd_cat(int argc, char *argv[]) { FRESULT fresult; unsigned int usBytesRead; if(strlen(g_cCwdBuf) + strlen(argv[1]) + 1 + 1 > sizeof(g_cTmpBuf)) { UARTprintf("Resulting path name is too long\n"); return(0); } strcpy(g_cTmpBuf, g_cCwdBuf); if(strcmp("/", g_cCwdBuf)) { ...
0
12a582253248009bab37fc36504de60c
0a064e41af4d0be5bb85a34dcd6fb329
Creates a runtime converter which is null safe.
{ Contract.Requires(component != null); Contract.Ensures(Contract.Result<TypeConverter>() != null); return default(TypeConverter); }
0
8fc879960d606d8659e493a66ff80419
dc6cd2bd3586e63316f7bf91d23ca3fa
this method will be automatically called by the constructor and should contain the initialization of the UI especially of the saveButton and revertButton
public abstract class MoodEditorActivity extends AppCompatActivity implements MoodEditor.MoodEditorInterface protected abstract void setupSaveButton();
0
7284b2cc54e2d0077c64bf53f4e1fca5
ae08a89f2fcdf8905a8f732a004b715e
获取已访问链接
public class LinkQueue public static Queue getUnVisitedUrl() { return unVisitedUrl; }
0
2c75d9efd95e451deae7166f13cecd0f
a057ea35d7af68c95f532abc6cfb6306
Called whenever the currently selected building is changed to update the panel display.
{ UpgradePanel.SetActive(true); if (building == null) { BuildingNameLabel.text = "none"; UpgradeNumberText.text = ""; BuildingIncomeLabel.text = "none"; UpgradeCostLabel.text = ""; SellCostLabel.text = ""; SetSellButtonAvailable(false); SetUpgradeButtonAvaila...
1
d0ad9d3f5c428ba13a2089e81df71c6f
61faa90f735eee8526fbc8b4290339f5
Update user's activity when user add any application.
public final class Server implements ConnectionAgent public static void updateUserActivity(Connection connect){ if (connect.getUser() != null) { logger.debug("SERVER: Update user's activity: " + connect.getUser().getLogin()); connect.getUser().setLastActivity(System.currentTimeMillis());...
0
5d459733d66928e3f291bb77dfe2e6eb
38b583da575001afcd91f268dfe6331e
Returns the element for which this is a certificate.
namespace org.bouncycastle.cert.dane public class DANEEntry public virtual X509CertificateHolder getCertificate() { return certHolder; }
1
173ea7188c8714a837bf5444c11a64cb
6201153121b424d17652afebb6c63275
get the system statistics for the specified process. ( cpu time, page faults etc. Look at the description of HostRUsageSType for a detailed explanation ). the members of the struct may be zero on platforms that do not provide information about specific fields .
let flavor = T::flavor() as i32; let mut pidrusage = T::default(); let buffer_ptr = &mut pidrusage as *mut _ as *mut c_void; let ret: i32; unsafe { ret = proc_pid_rusage(pid, flavor, buffer_ptr); }; if ret < 0 { Err(get_errno_with_message(ret)) } else { Ok(pidrusa...
1
74b8ac34db25b8c182c004a076367b35
4fadb51cc8b206fadb8d962764cfc7f0
Draws a rectangle with a boarder around it
void drawRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t color) { drawHorizontalLine(x, y, w, color); drawHorizontalLine(x, y+h-1, w, color); drawVerticalLine(x, y, h, color); drawVerticalLine(x+w-1, y, h, color); }
1
5c2f1ac2177da20fa0334d5669ac19c9
071656d2ed06f7fa9bdf62bc522ee76d
将long型时间戳转化为日期(年月日时分秒)
var longtimeint = parseInt(longtime); var time = new Date(longtimeint); var y = time.getFullYear(); var m = time.getMonth() + 1; var d = time.getDate(); var h = time.getHours(); var mm = time.getMinutes(); var s = time.getSeconds(); return y + '-' + add0(m) + '-' + add0(d) + ' ' + ad...
1
2665ac6cdf67983867defffb8847be76
5378bdc956bc8b19e7ab3450593f4a48
Connect to a signal of the transaction's DBus interface
class DBusInterface(ABC): async def connect(self, bus: MessageBus) -> None: await self.initialize(await DBus.connect(bus, self.bus_name, self.object_path))
0
0f2c9bd494de718699a9130801c1decc
1b3d5589b9c2f736b5483fe42d354667
A list of all currently existing things in ./archive/
class Archive_int(object): def namelist(self): return []
0
8e2caa393f63313f81175b3f9433bd17
92092530c094fe0cc8a94f1129b9b189
Order prefectures along intuitive axis, for label encoding to work well.
class VectorBundleChart(BundleChart): def order (self) -> int: return 1
0
54548737190199175bf4e1d83f2f1e54
5b04d69c0ffffb63d483b78be2943fa1
ApiService constructor.
class FilterApiService public function __construct(FilterService $filterService, FeedService $feedService) { $this->feedService = $feedService; $this->filterService = $filterService; }
1
f5402d7db70d04966fd31de17a44ad48
00398212d9a166305de22cf2cbb0b4aa
The 3x3 matrix specifying the orientation of the crystal with respect to the diffractometer axes.
class XtalOrientation: def cartesian2hkl_mat(self): from .xtalori import xtalori2mat return xtalori2mat( self.ra, self.rb, self.rc, self.u, self.v, self.psi, )
1
2498510364d5e3f6014ead78addd467f
9a44e00b8b14b4a8cb2cb19a3b2dedbc
Calculates the maximum weight the monster can carry
int getMaxPossibleWeight();
1
ae09f202fd41b588be8474ab67aa8bcd
20be26aa34f59fa0a27d47d58a9a2b3e
Pretty print and writes JSON output to file name provided.
class JsonOutput(DataSink): def __init__(self, filename): self.out = open(filename, 'wb')
0
1fcee86dea1c02516738ebc21e1a7342
55d9c8dc4760adedff7b8bb9811b6c04
Calculate values for display on the ScaleBar below the map
sb_width = 50 x1 = self.canvas.size[0] - 55 y1 = 10 scale_value = sb_width * self.meters_per_px if scale_value > 1000: scale_text = u"%.1f km" % (scale_value / 1000.0) else: scale_text = u"%d m" % (scale_value) if self.meters_per...
1
70c312be8157854a006a4d4bb22d1472
a8ac9c39c8e8fc05c62dce53d662e4ec
计算垂直的空白尺寸
class LBannerLayoutManager : RecyclerView.LayoutManager(), RecyclerView.SmoothScroller.ScrollVectorProvider private fun getVerticalSpace(): Int { return height - paddingBottom - paddingTop }
1
f58e3ecb45e7510c18693c024d798a9e
7fcdeeea0c4ea22918794737838d6948
Sets the number of components in the finite mixture
class MultiViewMixtureModelMixin(MixtureModelMixin): def n_components(self): return np.product(self.n_view_components)
0
7106879bc8736669b847bd03e71b7f9c
c894d127318aac110054c5f83f13a3c9
Show Zip checkbox callback
{ return $this->getTextFilter()->appendFilter(new Zend_Filter_Callback(array( 'callback' => array($this, 'filterZip'), ))); }
0
2ec4c63cc84b2a47803c3d209b5d8f88
0d0dc9cde497e0ad3ef6ac8869a32337
Get the download updater class started
public function setUpdaterClass($updaterClass);
0
c4e0b24dab9616705906c7008de83bf8
91a6fe645fbbd49841c901d302114711
根据部门名称和所属校区类型获取部门
JSONObject json = new JSONObject(); json.put("deptType", deptType); json.put("deptName", deptName); List<YZDept> list = (List<YZDept>) dao.findForList(TableNameUtil.SYS_DEPT + ".getDeptByTypeAndName", json); if (list == null || list.size() == 0) { return new YZDept(); } return list.get(0); }
1
6faa875595f13a366d12f23b99791803
7e07227a1fc2d3c8a8f67666c31d689f
从解析树生成Markdown文本行
_.forEach(node.children, function(cnode, num){ var nodeTitle = trimReturn(cnode.getTitle()); var nodeLink = cnode.getHyperlink() ? mdSyntax.link(cnode.getHyperlink(), 'anchor') : ''; var nodeImg = getNodeImg(cnode); if(!(nodeTitle + nodeLink)){ nodeTitle = nodeImg; ...
1
0cae2380ae06c7eb22f4737b9ee7587a
9614bf23e624452223d636633a9f6d89
将Z方向毫米数转换成绘图容器PictureBox中像素数
namespace INV.Elearning.ImportPowerPoint.Helper public partial class HelperClass public double EmuToPixels(long emu) { if (emu != 0) { return (double)Math.Round((decimal)emu / 9525, 5); } else { return 0.0; ...
0
6bc47000b4853a6122e24c25f4422565
5cb43e262142665a31a3f54ae580c927
更新开机画面
{ char bmp_buf[160*480*3]; int lcd_buf[160*480]; open_bmp("./ui/refresh.bmp",bmp_buf,160,480); extend(lcd_buf,bmp_buf,160,480); lcd_p = lcd_p + 640; lcd_p = lcd_p + 0; normal_appear(lcd_buf,160,480); lcd_p = lcd_p_flag; }
1
0572d5e6566b9c4db8bc0cc0a19b27c9
5237ffc112b8841c8b9ee8ceae4342be
Handles the cases where something is dropped on the Canvas
{ ReinstatementObject(); Rectangle rectangle = sender as Rectangle; if (check.IsDropper(currentMouse)) { CurrentColor.Fill = rectangle.Fill; TestLine.Stroke = rectangle.Fill; } else if (check.IsDelete(current...
1
df113ae6cccb499b70d425abf3f264eb
4d3a4b26c47baeec793cf6aa7b23aa8a
Damereau-Levenshtein distance
x_1 = x[1:] y_1 = y[1:] return ( len(x) if not y else len(y) if not x else damerau_levenshtein_distance_naive(x_1, y_1) if x[0] == y[0] else 1 + min( [ damerau_levenshtein_distance_naive(x_1, y), damerau_levenshtein_distance_naive(x...
1
f7eca89c9b3beb35019ee53569fe5bef
1438622bfb5bb22ab0fb4adf568dbbc3
Sets the projection property to be ignored during instance transformation operations.
class NullProjection(WrfProj): def __init__(self): pass
0
1a1bae6859cd61d582659901ba9766ca
f5094a77f2817b2119d2dd8af8ff7274
获得系统当前日期的上一个月,并以YYYY-MM格式返回
Calendar c = Calendar.getInstance(); c.setTime(new Date()); c.add(Calendar.MONTH, -1); Date m = c.getTime(); String str = smf.format(m); System.out.println(str); return str; }
1
b4be915b645b11e797bb807ee5b87cc0
7dd310d76aa54fa67b805c5e30857066
Получаем данные с Google Table
async function fetching () { const response = await fetch('https://spreadsheets.google.com/feeds/list/1vnKwmmsSAnZKvp_B1aGO3OcEXAQ1NMiuLv3yn-m9qPg/od6/public/values?alt=json'); var dataSheet = await response.json(); return dataSheet; }
1
ed24f6e3109b2a818989e75e636c029c
7ad74e19a04af836e1bc984a9b9564a5
Indicates if the given URL uses FILE protocol
path = fspath(path) parts = urlsplit(path) return parts.scheme == '' or parts.scheme == 'file'
1
5b88bcb812d90551c8099099f4ffde07
71f4528c5498864b021ad9e026df425b
Offers the permission holder a permission which they can hold <p>This has no effect if the holder already has the given permission</p>
public function addPerm(String $name);
1
57cf76d7aa291002e1365c3b22e1e20c
8b0ef6ec514198c258e96a2a9aafe8ec
Die Runde als Server beenden. Der Server kann sich selbst am Buchstabenbeutel bedienen.
public class Client{ public void sendeRunde() { try { this.writer.writeObject(this.runde); this.writer.flush(); } catch (IOException e) { e.printStackTrace(); } }
0
f157a12fa303697a1676dd16dca68b8f
7699d84210bff9e318db53b9df4e8f8a
一键求救
function onekeybite() { $.ajax({ url : '/CMT/public/api/onekeyBite',  beforeSend : function() { setDiagnoseButtonEnable(false); updateDiagnoseStatus(1, Trans.t("检测中......")); updateTroubleMessage(new Array()); }, dataType : "json", success : function(data) { console.log(data); setDiagnoseButto...
1
9adbf1bc8161b44b916503c884c038d6
115919a136aed243df1067ca8f7c0e30
Sanity check the last decoded position is a possible value. not a possible value produced via the respective encoding
if prev_bits is None: status = True else: known_bits_count = len(self._known) * 8 required_bits_count = (self._index + 1) * 45 missing_chars = math.ceil((required_bits_count - known_bits_count) / 8) sample = known + self._fixed_first_char + (b'...
1
f14d5bf8cdb8f8e36fab11abc4e5da86
bde1e2f0a71b43fa2407616d5961e2d6
bind the nav dropdown menu listener
this.nav.events.on(`change`, this.displayPage.bind(this)); this.nav.events.on(`toggle`, ({ expanded }) => { this.settings.navOpen = expanded; }); }
1
1e08b4d3332f271a4a8d2edc74a9c2aa
52687b2ef5b32b759afeab8992b83492
Perform something similar to `str.strip` but apply it on the top and bottom of Str2D as well as left and right. It will readjust to respect alignment and fill preferences.
static PyObject* n_set_null_bitmask( PyObject* self, PyObject* args ) static PyObject* n_pad( PyObject* self, PyObject* args ) { PyObject* vo = 0; unsigned int width = 0; const char* side = 0; const char* fillchar = 0; if( !parse_args("pad",args,"OIzz",&vo,&width,&side,&fillchar) ) Py_RETURN...
0
ef34b4f3caeb986beef6fe1ba5738472
d7630a2f4db95912be9e8ce8d156b53c
Set if flow graph should allow modification of code from within the graph view
void allowInputModification(boolean allow);
1
89e80d65b61d849d94c9aef29797db22
7229d38dff8e5340f075e5c1c7051ef9
params : number of threads a process is creating. returns : none. Initialize barrier with total number of threads.
if (pthread_barrier_init(pthread_barrier, NULL, nthreads)){ fprintf(stderr, "Error trying to initialize a barrier\n"); exit(-1); } }
1
7a16d4fb483fc538b5273ce7f8ce1115
7c4470af5637927249a0dd8d8987f034
获取订单金额信息,并将用户所有可用余额用于扣减金额。
public @ResponseBody HttpResponse<OrderResidualAmountResult> getResidualAmount(@RequestParam("order_id") String orderId) { try { return new HttpResponse(orderService.orderResidualAmount(orderId)); } catch (AryaServiceException e) { log.error(e.getMessage(), e); ...
0
e82eac1a604addcec25388c3fe401900
1d490f5b7d51f5fcd7c0b3de8a20a0e4
Substituição Geracional com Elitismo
dictPopFit = {} dictPop = {} popAtual = [] for i in range(len(fitness)): dictPop[i]=fitness[i] for item in sorted(dictPop, key=dictPop.get): dictPopFit[item]=dictPop[item] for chaves in dictPopFit: popAtual.append(populacaoAtual[chaves]) popElite=[] for i in r...
1
6a3af2fe9a44604b1ee504a9ed74254c
4ed72f4e17bbc12b5f0870bc9e391f80
Blocks specific user agent
String useragent2 = m_useragent.toLowerCase(); if( useragent2.contains("googlebot") ){ m_useragentLabel = m_useragentLabel + "_googlebot"; } if( useragent2.contains("bingbot") ){ m_useragentLabel = m_useragentLabel + "_bingbot"; } if( useragent2.contains("yahoo") ){ m_useragentLabel = m_useragentLabel + "_yah...
0
55ee52de66551ae78778247961612ecb
1e2fe96b3db5613f9c0c17c23c70c668
Gets the size, in bytes, of an ACE.
public class SECURITY_ATTRIBUTES extends Struct<SECURITY_ATTRIBUTES> implements NativeResource @NativeType("DWORD") public int nLength() { return nnLength(address()); }
0
bef00395dc79ebb7b8d67e4330bbffa3
cd9f0ddd329a6ed0afefbe76628d3c99
Return the set of counter keys shared by first and second.
static void mergeHelperFirst(void *arg, const int key, const int count) { twoCtrs_t *two = arg; counters_set(two->result, key, counters_get(two->another, key) + count); }
0
8bcd3c27ecd033e64cf7ee1b8ad71105
291ac6b10ce47f1a88049876fd8cf6a4
Lấy giá trị hoành độ tâm của hình vuông
public class Circle extends Shape public double getHoanhdoTam() { return hoanhdoTam; }
0
85bb72f566b9ee35a5e782afae86ff57
c946c54f9c71c389bb1e13ee1407f10c
Convert iTunes path to Galaxy filesystem location. Technically this could fail if you had some weird artist/album/song names, but if it did it would at least fail consistently.
class EchonestWrapper def fix_filepath(filepath) song_path = URI.unescape(filepath) fix_filepath(song_path) if song_path['%'] song_path.gsub('file://localhost', '') end
0
fdd56f698720287fa63847bf3f788fd3
17e3cb102567706df7b8b37feaeaed38
Compte le nombre de commentaire en attente
$exist=false; $result = DB::query('SHOW TABLES'); while($row = DB::fetchArray($result)){ if( PREFIX."comments"==$row[0]){ $exist=true; }; } if ($exist){ $sql = " SELECT `id` FROM `".PREFIX."comments` WHERE `approved`=0"; $res = DB::qu...
1
a7017b4723437a38a0c6e32ae6147b77
740a6c1a516149dc63e0a29a440d9bb9
test if commands can be changed for certain poses
pub = rospy.Publisher('cmd_pose_stamped', PoseStamped, queue_size=1) while pub.get_num_connections() == 0: time.sleep(0.1) ps = PoseStamped() ps.header.frame_id = 'ignored_value' ps.header.stamp = rospy.Time.now() ps.pose.position.x = -42.0 ps.pose.pos...
1
303cdd801d7636ab789cf47ad2754f66
076e612253ff6913302ff4cbb60cafa4
Shim for mysql's `createConnection` function since mysql handles everything from a connection instance this is where the shimming needs to happen
function getConnection() { return Promise.try(function() { return Promise.promisifyAll(mysql.createConnection(config)) }).disposer(function(connection, promise) { connection.end(); console.log("CONNECTION ENDS"); });; }
1
970f1610b5f1bb908cd760f349f9f829
c4ccf81b2c3ea18704ced7e3186ad871
prints characters "slowly" to appear human-like
def slowText(text,amtime): for char in text: time.sleep(amtime) sys.stdout.write(char) sys.stdout.flush() time.sleep(0.5) print()
1
6fcf1dc585d3ca882e916d8a0ba900f5
2c96775ca930fad2b3266188c804bc19
使用同步屏障模拟并发访问
public class Atomic_ private static void atomicAccumulator(int acc) throws Exception{ CountDownLatch cd1 = new CountDownLatch(2); Thread t1 = new Thread(new Runnable() { @Override public void run() { for (int i = 0; i < acc; i++) { atomicCount....
1
ae3ca9dc70ecc346620a34a480b8017a
a154daafd51071b6891eef18ab0a9236
count the number of entries per project
PreparedStatement ps; try { ps = newConnection.prepareStatement( "SELECT projectcount FROM dbcount WHERE userID = ?"); ps.setInt(1,userID); ps.getResultSet(); ResultSet rs = ps.executeQuery(); if(rs.next()) return rs.getInt("projectcount"); } catch (SQLException e) { return 0; } retur...
0
36e83df4ecb001866f8ea455c972c8ee
3c45e828a614b5223123dadbf213c4fd
"good",
def good_bye2(name): return 'gb' + name
0
766cf7937bcba887b760dc95ec348dd4
a5ec69f10f637e063bc5075dd7f87b80
订单取消退款 积分处理
{ $r_rid = $request->input('rms_rid'); $r_uid = $request->input('rms_uid'); $r_token = $request->input('_token'); $r_order_no = $request->input('order_no'); $r_enforce = $request->input('enforce', false); if (!$r_token || !Func::rmsSessionToken($r_uid, $r_token)) { ...
1
2da90d949ff0e62332036b1c5f802cea
7bc5d41611d2c1f2626100e92aa12666
place rooms until coverage is achieved
public class BoardManager : MonoBehaviour void ConnectAllDoorsToCenter() { List<Pair> reachableRoomsFromCenter = GetAllReachableRoomCoords(centerRoomCoords); List<Pair> frontierRooms = new List<Pair>(); List<Pair> outskirtRooms = new List<Pair>(); int numRooms = gameSize * gameSize; ...
1
53eecfc50a5a1a665b3df08af0d8035f
d9015ce29cf1b6721106cfbdd7fcf821
function to store the dataset 1 into a SQL table using dataframes
engine = create_engine('sqlite:///' + database_filename) df2.to_sql('Disastor_Recovery', engine, index=False, if_exists = 'replace') pass
1
895dce524f30c471b1b7f3b1c2283c29
0350ae5d2f411c6d1cadfa900db611b8
Fetch and return the json text from services.json.
{ String line; StringBuilder sb = new StringBuilder(); try { StreamReader sr = new StreamReader(JSON_LOCATION); line = ""; while ((line = sr.ReadLine()) != null) { sb.Append(line);...
1
5c168c966b556e35cf94aa0c839bc95b
dc89e4d7aafd74d33a0b1963eafad8cd
Evaluate and possibly store classifier and data
class WindowFinder(object): def __get_classifier_and_scaler(self): if self.load_saved: print('Loading saved classifier and scaler...') svm_clf = pickle.load( open( "./cache/" + self.svm_clf_name, "rb")) if self.svm_enable else None rf_clf = pickle.load( open( "./cache/" + sel...
1
c706cd4c9c8d77dc0023b92424f198db
fcc8e56913a27311dc0c04dcb85899f3
Initializes a Robot in the specified wall. The robot initially is at coordinates (x=0, y=0) in the specified wall. The robot "nails" the stud it is on. wall: a Wall object.
{ int min_idx, joint_idx; double position; std::vector<double> pos_error, rot_error; pos_error.resize(this->wall_anchor_.size()); rot_error.resize(this->wall_anchor_.size()); joint_idx = 2; if (!this->joints_[joint_idx]) { min_idx = this->ClosestAnchor(joint_idx, pos_error, rot_error, this->wall_anc...
0
20ed63a2042eae7f5964599bfdb8febe
e3e3fc1e7c81481a0cc169ad43e83107
Add brackets to task type and status icon
var color = taskStatusColor[value].color; var text = taskStatusColor[value].text; var result = '<i class="fa fa-circle fa-2x" style="color: ' + color + '"></i>' + text; result = "<div style='white-space:nowrap;'>" + result + "</div?"; return result; }
0
63f01ded6d376b839140f1bf0264ad51
243098a936a71054a8343f811446ee13
item이 선택되어 있으면 해제하고, 그렇지 않은 경우 선택한다.
public class MenuMyDataActivity extends BaseActivity private void itemChoice(int id) { for (StaticCarData carTypeData : staticCarDataArrayList) { if (id == carTypeData.getId() - 1) { if (carTypeData.isChoice()) { carTypeData.setChoice(false); ...
1
587ae1e72279e70482fb6793865fd55a
57c49fcb242ed8382549a76f46408a3f
Remove the entire allocated diagram
void GVDLau::RemoveDiagram() { if (nullptr != data) { for (unsigned int i = 0; i < height; ++i) { delete [] data[i]; } delete [] data; } if (nullptr != next_data) { for (unsigned int i = 0; i < height; ++i) { delete [] next_data[i]; } d...
1
fe5db453796723b74877133c719e8d71
dc5e34ae934e048574cf186161fd477c
Устанавливает демонстрационные данные для модулей
class Install extends AbstractInstall function insertDemoData($params = []) { $imports = []; if (\RS\Module\Manager::staticModuleExists('banners') && \RS\Module\Manager::staticModuleEnabled('banners')){ $imports[] = ['\Banners\Model\CsvSchema\Zone', 'banners-zone']; $imports[...
1
2ed1d47642cbee12abd7167f8f8a1ab0
eb021d6878ce3dc1ff52405a520f4995
r""" Compute average KL divergence loss over the whole training set.
def kld_loss(mean, variance, collection): divergence_loss = KLD_REGULARIZATION * tf.contrib.distributions.kl_divergence( tf.distributions.Normal( tf.squeeze(mean), tf.squeeze(variance)), tf.distributions.Normal( tf.constant([0.0 for _ in range(BATCH_SIZE)], tf.fl...
0
3e6f5e3b1304ec523433126d00cba3f4
f7084c2e0805dff043da46db0ee55c56
Calculate multiscale refined dispersion entropy of signal x
def dS(x, N, K): nxkx = make_nxkx(x,K) mp.dps = DPS mp.pretty = True f = lambda w: _dSi(w, nxkx, N, K) g = lambda w: _measure(w, nxkx, N, K) return ( np.log2(np.exp(1))*quadgl(f, [0, 1])/quadgl(g, [0, 1]) - S(x,N,K)**2/np.log2(np.exp(1)))
1
5f73dc61857270877450f8d9fe28e87d
3d80a48ef2fe2ee21a24cbd7cec64d25
Delete all movie trailers from the local data source.
{ final SQLiteDatabase db = this.getReadableDatabase(); Movie[] currentMovies = getMovies(null, null); for (int i=0; i < currentMovies.length; i++) { Utility.deleteFileInternalStorage(currentMovies[i].getPosterFileName(), mContext); } Integer filesRemoved ...
0
ca43a91c807fa2542a3751a797f11dc7
e3a45f405ab4e61fdcc9a9b43f8cfc6f
Count the distance between train Image and Test Image
double distance = Math.sqrt( Math.pow((test.lang - train.lang), 2) + Math.pow((test.hours - train.hours), 2) + Math.pow((test.games - train.games), 2) ); return distance; }
0
620ac6aea790244bd3f0661cfaf4bde0
757507088d020f99c269d516b5eb12b8
Calculates Severity Returns: float: Severity
if self.b_data[8][1] >= 1.25: return 1.0 elif 1.20 <= self.b_data[8][1] < 1.25: return 0.95 elif 1.18 <= self.b_data[8][1] < 1.20: return 0.90 elif 1.16 <= self.b_data[8][1] < 1.18: return 0.85 elif 1.14 <= self.b_data[8][1] < 1.16:...
1
c8da0ae30d86f327360875cb997d1135
6b23e08a311d81b7baffc946787602d3
Check input and set values to public fields. Returns 0 in case some input was wrong.
fscanf(&ifst, "%d%d", a, b); if (a <= 0) { printf("%s", "Incorrect input values.\nRadial distance must be positive"); exit(0); } if (b >= 360 || b < 0) { printf("%s", "Incorrect input values.\nAzimuth must be between 0 and 360 degrees"); exit(0); } }
0
7997b21676e3f1ec58d9bcbe9eaffa4f
42736bb43504b04029187c0e8c602d53
Method to draw all of the missiles
{ while(lst) { graphics->fillCircle(lst->p.x, lst->p.y, 1, missileColour); lst = lst->next; } }
1
be33191a3e9a2dddf52860c38408a12f
6618258c5be6dc465fcc8b645da82770
根据配货类型获取配货单位列表
namespace Hyt.BLL.Distribution public class DsDealerBo : BOBase<DsDealerBo> public IList<CBDsDealer> GetDaiLiShangList(string Type, int TypeSysNo) { return IDsDealerDao.Instance.GetDaiLiShangList(Type, TypeSysNo); }
1
43dd1a373e2de8d17ec3e3740e3f58bf
100fd0bb43c10da96e3e2f2826d3983c
Загрузка папки на фтп сервер
try: with open(source_path, 'rb') as source_file: conn.storbinary('STOR ' + ftp_path, source_file) except FileNotFoundError: print('Файл не найден ', source_path) except IsADirectoryError: print('Это не файл, а папка ', source_path) exc...
0
d15a537ad0502a3d3e18e5ef48a86744
bfa33b8fc8935061313535ee4d9cc52c
获取所有论文的ID和发表年份信息
$sql_paperIDget='select paperid from PAPER;'; $sql_result=$this->query($sql_paperIDget); $allPaperID=array(); while($eachResult=mysqli_fetch_array($sql_result)){ array_push($allPaperID,$eachResult['paperid']); } return $allPaperID; }
0
b5fadde9e810e7beac97c2c44e0260e1
4779dfe6a0c8b60a3ee2dac8f5705e03
测试实体转换成JSON
entityRuntimeCtx := &runtimectx.RuntimeContext{ ID: "id", RuntimeID: "runtime_id", Key: "key", Value: "value", } conv := runtimectx.NewConverter() modelRuntimeCtx := conv.FromEntity(entityRuntimeCtx) assert.Equal(t, entityRuntimeCtx.ID, modelRuntimeCtx.ID) assert.Equal(t, entityRuntimeCtx...
0
1547f0cb4bceb0cf6702e2be1f1ede7c
63dcdf91b48a5613f264ec81c0160b7e
Converts timestamp in millseconds to HH:MM:SS,mmm string form
String hhmmss = String.format("%02d:%02d", TimeUnit.MILLISECONDS.toHours(millis), TimeUnit.MILLISECONDS.toMinutes(millis) - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS.toHours(millis))); return hhmmss; }
0
19010a762bb1add45d5e54d44e3dc2ea
1c960533c194d1be1ad07dd6b5d00f43
获取反射类文件名
public class ReflectiveClass public String getClassName() { return className; }
0
79ec7e6838723f2f2cc1497862bb40ef
517d5ea6de89a07c13c1d8791ec7936e
查询已发布的商品
public class ProductDaoImpl extends HibernateDaoSupport implements ProductDao{ public List<Product> findall(){ String hql = "from Product p where p.status=1"; List<Product> list = (List<Product>) this.getHibernateTemplate().find(hql); return list; }
1
3486c9cd4eb16936da847017f5d54bbd
f5797ef711b097eb792e3156017e905e
指定时间段内的新增话题
List<Topic> selectTopicByDate(Date topicStart, Date topicEnd);
1
41f65d6d48053dd90102e35867d7a6ef
e3058e3ab21159c16e85a33f5aa22ed9
在类中添加实例的信息
class MyClass(): def add (self): num = raw_input('num:') name = raw_input('name:') sex = raw_input('sex:') age = input('age:') degree = input('degree:') self.classinfo.append((num,name,sex,age,degree))
1
0c28f074a52320646e69a7f80ebfcd7e
3ebcf78e28f2994e3e32bc3b13f98a7c
指定服务器批量获取缓存
{ MemcachedClient client = GetClient(server); for (int i = 0; i < keys.Length; i++) { client.Set(keys[i], values[i], expirys[i], hashCodes[i]); } }
0
da8e016e717d3514519c3e9fae5db664
6713a879b6e0811eed7623fd5b4e4731
Register the decorated function to run when one or more files have changed.
def _register(action): handler = Handler.get(action) handler.add_predicate(partial(any_file_changed, filenames, **kwargs)) return action return _register
1
c3891732e64f2da8cf76b8c0f3fbbb33
3560f0083dd738470aae9c9705ca63b7
Mark resources as fully loaded after initialization completes.
let duringLoad = this.lookUp(this.initializers.loading, this.currentPage); let afterLoad = this.lookUp(this.initializers.afterLoad, this.currentPage); if (afterLoad) afterLoad(_.noop); }
0
e52f285b9ef3b4438668ae819d178cc9
5e575b0d6b8b4263da42e9635cc0c75d
Returns the IPv4 dotted-quad notation.
class DNSParser: def read_address(self): return '.'.join(tuple(str(self.read_int(1)) for _ in range(4)))
1
7f3b98296c7ff2c230d2c21698ad2637
5c74f209aa247dd774a22ddff3c1a1be
Functia care modifica cnp-ul unui client
namespace TryFasterClient class DBConAct public static void Client_Update(Int32 Id_Client, string SC, string NC, string MNC, string EC, int AU) { spConfiguration("Client_Update"); try { cmd.Parameters.Clear(); cmd.Parameters.AddWithValue("@...
0
34778376341162d986fe588136ddb208
96d3490035b8b76813f32895710544b5
Retrieve the gameday urls.
class GameSlate(object): def game_url(self, href, year, month, day): return urljoin( urljoin(Constants.BASE_URL, self.date_path(year, month, day)), href)
1
95cb22cc542882a80b14d26d292ef349
1899a11ea72bc813b61443cf9ec9097c
Get the color space dictionary.
String getColorSpace();
0