query_id
string
corpus_id
string
query
string
code
string
label
int64
22e46f68fc78d3b6992b5c70af4a89bb
1cc64a60e6d5344f2d108baa5818ba5e
이미지가 수정될 때마다 stackUndo에 복제본 삽입.
namespace Paint.Utility public class BitmapLayer public void HoldCurrentImage() { ChangesHolder.Push(Bitmap.Clone()); }
1
e62c1e8eb67e6bfdf849eabb65f83a66
b6ab798a8aeeeb5841def30f9da8d304
\brief Transmit subtask handler for Sending LORAWAN Join Request Messages
{ if (loRaWANctx.TsEndOfTx) { usbLogLora("\r\nLoRaWAN: JOIN-ACCEPT RX1 (5 s).\r\n"); spiSX127xReset(); loRaBareCtx.frequencyMHz = 0.f; loRaBareCtx.spreadingFactor = 0; spiSX1272_TxRx_Preps(&loRaWANctx, DIO_TxRx_Mode_IQ_Balancing, NULL); loRaWANctx.Current_RXTX_Window = CurWin_RXTX1; ...
0
c809b829723a7e2aa489e808d14e1f9c
c013f25e4435e7f67deadc0f20cfab62
撤销解决方案
$solution = SolutionModel::with('lang')->find($solutionId); $solution->is_enable = 0; if(file_exists(base_path() . '/public/'.$solution->lang[0]->dm_file)){ @chmod(base_path() . '/public/'.$solution->lang[0]->dm_file, 0777); @unlink(base_path() . '/public/'.$solution->lan...
1
5583daff42c8f5c4191fb8e64cb63b8c
537d432cc5f704703b44edbb8067e926
AppConfig도 스프링 빈으로 등록된다.
@WebServlet("/*") public class ServerApp implements Servlet @Override public void init(ServletConfig config) throws ServletException { this.config = config; logger.info("Spring IoC 컨테이너 준비 ..."); iocContainer = new AnnotationConfigApplicationContext(AppConfig.class); printBeans(); logger.info("Re...
1
ecde7be8dc7101278429e0cc35b44bb9
56cddd2e391d75a3dc3a9e982d6ca3be
Determine whether dp_heads form a projective tree at each token.
length = probs.shape[0] probs = probs * (1 - np.eye(length)) heads = np.argmax(probs, axis=1) tokens = np.arange(1, length) roots = np.where(heads[tokens] == 0)[0] + 1 if len(roots) < 1: root_probs = probs[tokens, 0] head_probs = probs[tokens, heads[tokens]] new_root = to...
0
fd01c0cc60bf080038a2c32070eff1f2
2c0bb144498e4aded6d7de5c60048f83
Replaces "\r", "\n", or "\r\n" with a single space in one pass (and trims the end result)
class AppController(QtCore.QObject): def _cleanStr(self, s, repl): replaced = str(s).replace('\n', repl) filtered = [u for (u, _) in groupby(replaced.split())] return ' '.join(filtered)
0
e4f39cec575988a305c1321c8d1fc1e8
b9beaa6c65705b5208b1df6aea6d8261
Return a list of Analysis objects.
class AnalysisTracker: def get_all_analysis(self) -> List[Analysis]: return list(self._analysis_tracker.values())
1
53da78d9b9ce2ca50993b9373b2acc3d
2224565ef84fe2c1aa7c8d49f0403bbc
Show host sensor group attributes.
class GpodderSensor(Entity): def device_state_attributes(self): return self.attr
0
0224110f618cc393513cd85db3f6a0f4
ba27cd8cc547e8fa4f45d4934e625a65
Reveal card two.
{ isHoleRevealed = true; DisplayCards(); System.Windows.Application.Current.Dispatcher.Invoke(delegate { lblDealerValue.Content = HandValue(dealerFullHand).ToString(); }); }
0
f8e050222b9b260632935680c996cfd7
f424c8d9e2c37d3cdbf82411e3a512c5
深拷贝v2版本, 采用序列化方式优化
if (v2) { console.log(cloneDeep(v1), cloneDeep(v2)); } else { console.log(cloneDeep(v1)); } }
0
bbc4958f6765d7bce416c29c6868677e
37fc2b20830d4eb6cf620b15a03989b0
Create expense action
{ if (!Sentinel::hasAccess('expenses.create')) { Flash::warning("Permission Denied"); return redirect('/'); } $types = array(); foreach (ExpenseType::all() as $key) { $types[$key->id] = $key->name; } $custom_fields = CustomField::wh...
1
0d8a59f627d49ab2e84b844507c90706
f077ea9c6cc66b96afe645d8b69a50b0
Downloads the malwaredomains.com list of malicious domains.
def main(): results = [] domains = fetch_domains() insert_domains(extract_domains(domains))
0
6e2f1c7a3360913182f720ecc0253f57
4f1492054681e4555491d164c21b19f2
checks if two items have same parent
const level = this.getModelLevel(parent); return this.getPrimaryKey(parent, level) === this.getPrimaryKey(child, level); }
0
fa6383a2d454e3ccbe1e480112b1dfdd
b5e2c5e4b0c1420893769a80f950a835
Creates the builder that lets the user select a name.
{ $this->checkFormType($type, $data, $options); return parent::createNamedBuilder($name, $type, $data, $options); }
0
79a681e425fe58530ac61c0c3a0ef806
c0f4822ab46c29cd8a3a5c7eb5ff1172
This method returns the number of nodes in the list so far This method has a constant running time
class LinkedList<T> implements LinkedListADT<T> @Override public int size() { return numberOfNodes; }
1
ea88ca1eee71deafac29d6743b0d2424
ba16319844b1339c5a0db55e3facef37
对象属性根据键排序
function objKeySort(obj) { let newArray = Object.keys(obj).sort() let newObj = {} for (let i = 0; i < newArray.length; ++i) { newObj[newArray[i]] = obj[newArray[i]] } return newObj }
1
4f78775a777b57de5f463da533e02f92
32711015c7362f3c3442e6b4d3342805
treeView的结点单击事件处理函数: 在treeView中获取到目录的绝对路径 获取到所有的子元素,在treeView和listView中显示出来
{ DirectoryInfo dinfo = new DirectoryInfo(@str); savefullpath = str; if (dinfo.Exists) { setListview(); ListViewItem item0 = new ListViewItem("..", foldericoncount); item0.SubItems.Add(""); item0.Sub...
0
62ed7554fb7506db7f4575a31f07d38e
b89078ed756b55b495f38727f890767c
获取当前订单待处理的退货单数量(不包括,作废和已完成的退换货单)
@Controller @RequestMapping(value = "/reportitem") public class ReportItemController extends EcpBaseController @RequestMapping("/waitretordercount") @ResponseBody public Long getWaitReturnOrderCount(ReportItemVO reportItemVO) throws Exception { Long count = 0l; count = orderWorkPlatRSV.catchPlatBackGdsOrderCount(...
1
28fac6ae1f638d0dced17eeb2b8bd709
39783617ca00ecf727d6025024577d3c
回复绿色通道申请
namespace Frxs.Erp.WarehouseManagementSystem.WebUI.Controllers.Again [ValidateInput(false)] public class AgainController : BaseController [AuthorizeMenuFilter(520513)] public ActionResult AgainApply() { return View(); }
0
65a5f81b4a05d137e28f5aeb39393dbb
a325685eff53979e0b05d0864517e077
The simple Bresenham line algorithm using integer algebra. Assumes that the line is less than 45 degrees and the site positions are integers
def bresenham_line(x, y, x2, y2): steep = 0 coords = [] sx = 1 if (x2 - x) > 0 else -1 sy = 1 if (y2 - y) > 0 else -1 dx = abs(x2 - x) dy = abs(y2 - y) if dy > dx: steep = 1 x, y = y, x dx, dy = dy, dx sx, sy = sy, sx d = (2 * dy) - dx for i in range(0...
1
e8a901cb0dcc95cf8e29003ffe3f64b0
569b785d647a12b2612c57b66c541dda
Set the firmware version of the IKEA TRÅDFRI gateway
ensure_client && ensure_uri body = { op: 'replace', path: '/firmware', value: value } response = @client.rest_patch(@data['uri'], { 'body' => [body] }, @api_version) @client.response_handler(response) end
1
7be267c33ec3c963389ad957d66cbeb9
1c162c5f5efd92d726c00464e3481aa4
Returns the result of interpreting the object as an instance of '<em>Expr Length</em>'. <!-- begin-user-doc --> This implementation returns null; returning a non-null result will terminate the switch. <!-- end-user-doc -->
public class LosMelosSwitch<T> extends Switch<T> public T caseExprLength(ExprLength object) { return null; }
1
665c6892b0609c046b913fd1bca1227b
c5b2045dcdcdc30fee3d65f07bd0e682
Get 策略组名 注意:此字段可能返回 null,表示取不到有效值。 注意:此字段可能返回 null,表示取不到有效值。
public class InvokeRequest extends AbstractModel{ public String getGroupName() { return this.GroupName; }
1
59f613942b7b12e7010023d186739e9d
c546563f714e6bce7e7d73806d28f440
Get the name of a field of an object.
public String getName(Field field);
1
a279fdae27242dac43ebefee754d58b6
e973dfae2f5e23497bf07a1fcce31adf
Run phonon solver at BZ-grid points.
inputs = dict(self.ctx.inputs) options = inputs['options'] settings = inputs['settings'] parameters = inputs['parameters'] inputs['kpoints_mesh'] = self.ctx.kpoints_mesh inputs['parameters'] = ParameterData(dict=parameters) inputs['settings'] = ParameterData(dict=...
0
8c69c6d1d956d58b8dec75ba78fd1160
73fb1e8903192e963483a04fadf2c931
Return a list of names of all eggs in the crate that are needed based on the options set in the Galaxy config file.
eggs_dir = config.get('eggs_dir', 'eggs') if os.path.exists(eggs_dir): projects = os.listdir(eggs_dir) else: projects = [] try: projects += [x[0] for x in config.cp.items('settings')] except NoSectionError: pass return projects
1
5c8fb017eadc8fd734da8b336a863c57
50cd7debddbb48ecf78d81e1f6005750
Stores message to specified folder.
void Message::save(Folder &f){ folders_.insert(f); f.insert(this); }
1
1e67b9c1f35e28a63340b26f7653c64c
08590a58663ed932b1c4ebd1c1c0dfbf
Adds new child to the list of icon children.
iid = self.treeview.insert( parent, tk.END, text=name, tags=("fstag",), image=self.get_icon(path)) self.fsobjects[iid] = path return iid
1
598f9c8d6d85d96797fd120cde72fb26
cc319291e5b35c7217d88efd486019ea
Returns the meta object for the containment reference list '{@link de.darmstadt.tu.crossing.crySL.EnforceConsBlock#getReq <em>Req</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getRequiresConstituent_RequiresAnnotation();
0
1578c192b716175e829a3adb6cdc4285
59c9d2ece8c29ebce310dbf57d7946b9
Add plural suffix to a unit
{ $parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE); $lastWord = array_pop($parts); return implode('', $parts).self::plural($lastWord, $count); }
1
ce81f3ea85a7443e8e42226406351499
37ab1f0ca79b405c84ece3349cf9df1c
# Calculate the probability distribution that a clade's volatility falls within a series # of bins.
if(is.null(z)){ z <- list(rnorm(1),rnorm(1000))} p_lower <- mean(z[[2]]<=z[[1]]) p_upper <- mean(z[[2]]>=z[[1]]) return(c(pL=p_lower,pU=p_upper)) }
0
051b256e1a522c1ab72132b706c6add2
3ea654c7a9d597404297412d332025f5
Loads a cycle and adds it to the chart.
void MainWindow::createCycle(lst inputList) { MoebInv::figure originalFigure = this->f; ex cycle; nextSymbol = lblGen->genNextSymbol(this->nextSymbol, true); if (inputList.nops() == 0) { lst unpackedRelationList; try { for (auto item : relationList) { if (item...
1
eb171859da7042501bda032a95e0378c
eae1da6657fffd4130102857a45aefa5
notify all listeners about an input error
public class CtrIndustrialSectorPanel implements IControllable, IObserver public void addInvalidInput() { infoPanelController.getView().showInvalidInputError(); paramPanel.setErrorStatus(true); industry.notifyObservers(); eBenchmarkScaling.notifyObservers(); }
1
71d075ea3ec51f766d8f07a8bf29d05f
3305f5c6a9c16133471f2853ff2b30ec
Unpacks an IPv4 address.
def unpack_ipv4_addr(raw_value): return '.'.join(map(lambda x: str(ord(x)), raw_value))
1
c6e02419402702596b576b36a2d5d7ad
7e51ba4ac1296cdd3deb2bd2a84fc5c8
跳转三星应用商店
val uri = Uri.parse("http://www.samsungapps.com/appquery/appDetail.as?appId=$packageName") val intent = Intent(Intent.ACTION_VIEW, uri) intent.setPackage("com.sec.android.app.samsungapps") intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) return try { context.startActivi...
1
9e6330249a0079fd2ebb55c1f175e8ee
431e267bc3c2bfe31c8ed0506dcf74f0
Sets whether the service is managed.
final class CloneInfo extends ServiceInfo @Override public boolean isManaged(final boolean testOnly) { final Host dcHost = getBrowser().getDCHost(); if (Tools.versionBeforePacemaker(dcHost)) { return super.isManaged(testOnly); } else { final ServiceInfo cs = con...
0
1551e28585d0d69c5b8ad4d9dd74ba6d
c05d96e058050576817237c4faa844c3
球面坐标系转直角坐标系
namespace eight_homework1 public partial class Form1 : Form public void bl2xy(double b, double L,double L0, double X, out double x, out double y) { double B = b * Math.PI / 180.0 / 60.0 / 60.0; double t = Math.Tan(B); double n2 = e12 * Math.Cos(B) * Math.Cos(B); ...
0
7ea329c1bb5bbcfbbc522ef8467e9255
b62de5e983652b0b9c27ced240ccfc9a
An abstract method to be implemented by children of this class. It is called to fully parse the section of a bytestream a particular BaseRW class presides over.
class relocated_class: #aka section. Is an abstract base class def toBytes(self): raise NotImplementedError()
1
8e867116b3f1ae9f0fd1c8f77b78f63d
360426568cad443d00528b10b5ac4ddb
Get the optional scatter-gather data buffers.
public byte[][] getBuffers();
1
1a9d93f0fd07a9f8717a7c8b8e67a691
d156de2fc70098272d9463bee42beebf
Enable keepalive for *sock*. Will set socket options depending on the platform, as per return of :func:`keepalive_socket_options`. .. note:: Value for ``TCP_KEEPINTVL`` will be calculated through :func:`keepalive_intvl` based on *timeout*, *idle*, and *cnt*.
if hasattr(socket, 'SO_KEEPALIVE'): if opts.get('tcp_keepalive', False): sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) if hasattr(socket, 'SOL_TCP'): if hasattr(socket, 'TCP_KEEPIDLE'): tcp_keepalive_idle = opts.get('tcp_keepalive_idle...
1
17d57952cd753c467b532d022bc79858
bc3999bdbdd233058f7088ca8ccac82b
Method for printing expression in XML format
public abstract class Expression public abstract void print(TreeStream tree);
0
d88859af811fecb1d58f19f3c4928a92
2bcc9cfde5ef53bdc4bacceb9e4af62e
Risk Quotient for NON-LISTED MONOCOT seedlings exposed to Pesticide X in a DRY area
def dry_matter_production(W_p0, LAI0, leaf0, root0, stem0, fruit0, t, t_start, T_average, C_ppm, DIS_1, DIS_2, DIS_3, PAR, TEP, k_ext, WT_1, WT_2, WT_3, C_f, f): def diff(y, t): W_p = y[0] LAI = y[1] leaf = y[2] root = y[3] ...
0
8adea41e1131ee91a1023eb769dc9017
01a6ce459d1851c53025d1c912caf624
Adds a listing to the list of associated (matching) listings
class Matcher(object): def _add_match(self, item): self._match_list.append(item)
1
187b3d5dfcc6e5045f7c0e2c4c2204fd
c5350573864b74a958a665546fc492f3
Si la ruta no ha cambiado, evitamos recalcular y usamos el valor almacenado.
export class UpdatePOIorRoute extends BaseComponent shouldComponentUpdate(nextProps, nextState) { return this.state.map === nextState.map; }
1
3e8808033adc1f9e9b83e0c2ba863ea4
4be8596f6d6ff6069c0b5eb1c4472bed
Если дерево стало пустым, данный метод добавит одну ветку
{ var a = new NodeTree(x) { Degree = 0, Parent = null, Mark = false, }; if (this.Min == null) { this.Roots.Add(a); this.Min = a; } else ...
0
272a2bf34721ed3d615a66deea5343bf
d384f0b28c9a46bd79529862c079b545
Visit a parse tree produced by PLambdaParser#bindingList.
class LULU2Listener(ParseTreeListener): # Enter a parse tree produced by LULU2Parser#program. def exitList_(self, ctx:LULU2Parser.List_Context): pass
0
6c0135ee42b55f0c7dcb8075265b7a63
9daaec9f7e66c08e3bde90bf4fd4c09d
Sets the transparency (alpha) value for all web lines, default: 150, 255 = 100% opaque, 0 = 100% transparent
public class Draw public static final void setAlpha(int alpha) { Draw.alpha = alpha; }
1
fd98e59a7feb424a1c0f6cb09438cefd
6be097c74a8c7b39ccf25ab6f9ef9444
Unpacks a dataset from a dataloader object
d = {} d['l1Size'] = x[0] d['activation'] = x[1] d['batchSize'] = x[2] d['lr'] = x[3] d['std'] = x[4] d['dropout'] = x[5] d['optimizer'] = x[6] return d
0
c69494f427fc43e8cd1c31dc12359f0f
93acb11acdbef42058f7dac571eca310
test a did with multiple id segments.
dup_ids = ('882379.1.564582.7826.8.77.626.', '4.67200.60.28351.67009.683.7.4', '794.8678.94.3702.1785.63.6925.') for id in dup_ids: query = self.session.query(HL7_Msh).filter( HL7_Msh.message_control_id==id) self.assertEquals(...
1
c1bd62b8e26f1729f5ee463eca0da272
b4d23831fdc1e628eb55e27d40e22bbd
1. 请求数据并把数据反序列化为实体数组
@Controller public class UserController @ResponseBody @RequestMapping(value = "queryAll",method = RequestMethod.GET) public String queryAll() { User[] users=restTemplate.getForObject(url,User[].class); System.out.println(Arrays.toString(users)); return "success"; }
1
d6bac32e0216185f0fae0e8e943a1a1c
7e8c5ddf815dcfb431c481c7eb6c29d1
これらはどのクラスタに属するかを決める確率であるから和は1である。
std::vector<ClusterTypeRatioPair> NaiveBayesClassifier::GetClustersProability(const std::string& segmented_string) { std::vector<ClusterTypeRatioPair> vec_typeratio; ofstream ofslog("log.log", ios::app); ofslog<<segmented_string<<endl; vector<FeaturesRatio>::iterator iter_end = vec_ratio_.end(); for (std::vector<F...
0
0d1a87f09a5544989c7fcfae68e1b1c7
c13f78b991bee30c662734337b9c23b5
Some preprocesssing that will be common to all the text classification methods you will see.
def preproc(props, lem=True): props['Summary'] = props['Summary'].str.lower() props['Why'] = props['Why'].str.lower() props['How'] = props['How'].str.lower() props['text']=props['Summary']+props['Why']+props['How'] props = props[pd.notnull(props['text'])] return props
1
f41e48fdf1567dce0ef3a974a19c3726
4ec01bc084feddf98358238088d9a59a
Write the graph to a string. Depending of the output format, this string can be used by read() to rebuild the graph. @type fmt: string
class Graph(object): def writeGraph(self,fname,format): start = time.time() self.canvas.draw() if format.lower() == 'png': self.canvas.print_png(fname) elif format.lower() == 'svg': self.canvas.print_svg(fname)
0
856187ac7fafa4cf38d3723261098f19
064ee56167140d20be599f3aeff1de92
Returns a structure that represents the internal state of the publisher.
class PublisherBack(TopicBase): def asdict(self): d = super(PublisherBack, self).asdict() d['publishers'] = self.topic.impl.get_stats_info() return d
1
c9a38bf06d50118b2833be8bffec468c
8907202b9dc9b34c43dcef4b9ab49acf
Obtiene las asignaturas cuyo nombre contiene al parametro
{ TreeMap<String, Asignatura> retorno = new TreeMap<String, Asignatura>(); Iterator<Asignatura> asignaturas = this.getAsignaturasIterator(); while(asignaturas.hasNext()) { Asignatura otro = asignaturas.next(); if (otro.getNombre().contains(nombre)) ...
1
c1350de7c2d5082830c56aebadfe3d0d
878358c8469d90e88224189a3699817e
Provides tests with library and driver data.
test_dir = os.path.join(os.path.dirname(__file__), name) return driver.build_tests(test_dir, loader, host=data['host'], port=data['port'], prefix=data['prefix'], fixture_module=fixtures)
1
32da3a8c4611341846213a877cbce117
5893b7bdeeaba66fecd0ba666484f651
#Extracts the measurements on the standard deviation for each measurement
GetVar<-function(Toy1000){ Toy1000$VAR<-apply(Toy1000[,4:length(Toy1000)],1,sd) return(Toy1000) }
1
c465172558f185688c53d6def6c597f0
631a61ca5e2d1ce49771b2588a849d88
Display a header for a NED/MSG type
printhead(int mesg) { const char *fmtstr; char *msgline; fmtstr = value(ENAME_HEADER_FORMAT); if (fmtstr == NULL) fmtstr = DEFAULT_HEADER_FORMAT; msgline = smsgprintf(fmtstr, get_message(mesg)); if (screenwidth > 0) msgline[screenwidth] = '\0'; (void)printf("%s\n", msgline); sig_check(); }
1
8527eb959789ec163b30e9bccbbc714f
c063a7be67ab1f950fed3c539441aade
Returns the given string with all curly brace tags removed.
def remove_curly_brackets(s: TextSeries) -> TextSeries: return s.str.replace(r"\{[^{}]*\}", "")
1
7f0062fb49caf0da78a98afbb1a8f36a
c7db7e211f670fe50a2520e29042fd99
Generates a sequence of elements that are obtained by iterating through the values, while the current value is not <c>null</c>, starting from the specified value, advancing the iteration by invoking the specified function.
{ Contract.Requires(factory != null); return Iterate(factory, source, null, factory.CancellationToken, creationOptions, factory.GetTargetScheduler()); }
0
f6eb69feb6ada3c5dd6178ab97cc6fde
b9f62144581a1c06be41ea69cf3ecd03
Add custom CSS to every Control Panel page:
function custom_login() { echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo( 'template_directory' ) . '/css/admin.css" />'; }
1
1d3fd84a3590c833af08a7c83ce4569e
0ce410ca2677f08f9cf10de3601a5b00
A basic functional test for Array to JSON conversion
class JsonTest extends \PHPUnit_Framework_TestCase public function testArraySerialization() { $request = new JsonRequestWithArray(); $jsonWalker = new Json(); $serilizer = new Serializer(); $serilizer->setVisitor($jsonWalker); $serilizedData = $jsonWalker->visit($request, $se...
1
3f35df48b0412705afc531e5ad77bc83
12ce5b94842d946450b7a867f8711f15
Evaluate state of TX, RX FIFOs Compare this with RF24_QUEUE_* #define's from msprf24.h
{ *rx_fifo = uart->physical, RF; *tx_fifo = uart->physical, TF; }
0
fc5a744d73f4121122e1f3b30af3f8ea
856c062da19328bc1ed7799ce4a51014
Creates an export data which satisfies the configurations set by the user.
abstract class AbstractDataExporter extends System public abstract function createExportFile($objConfig);
1
c0e3b119b1c38262c1af45063b5f58b2
e21259886f20e7a1ca6d9fc739108814
表具修改
@Log(title = "设备台账", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody EquipmentDevise equipmentDevise) { return toAjax(equipmentDeviseService.updateEquipmentDevise(equipmentDevise)); }
1
7b232b8923da07a6f0539de101064bd5
db9237153819013d05f167ac92fe33f1
returns the result of 10^x
namespace CalcStackDoDies.OneArgument public class TeninxCalc : OneArgument.IOneArgumentsCalculator public double Calculate(double first) { return Math.Pow(10, first); }
1
e06dd2fa96e7d73e01e1997be1a90b0d
e0d064246cbc627f5dbddbdac191f5fa
统计商家 每小时 交易单数
class StorestaffAction extends BaseAction{ public function shop_count() { $this->check_shop(); $time = I('time', time()); $where = array('mer_id' => $this->store['mer_id'], 'store_id' => $this->store['store_id'], 'pay_time' => array('gt', $time)); $count = M('Shop_order')->where($where)->count(); $data_store...
0
6cb9e5cb353c149c6e6ae9ab5e34f49f
9586ffe108ea50ea2cb83fc607224807
Bubblesorts the Array
function SortingVisualizer(props) function bubbleSort() { const animationsArr = BubbleSort(array); updateAnimation(animationsArr); }
1
c14d4f5bcdf3915aa003d8b2c19a40cc
4bc2ea73ffa46f6f8f4d077f9249a6a8
@brief Sets map initial size to the loader
tileWidth = mapLoader.getTileWidth(); tileHeight = mapLoader.getTileHeight(); numTilesX = mapLoader.getNumTilesX(); numTilesY = mapLoader.getNumTilesY(); }
0
c9bdfbcb07ddc2ca223c8ca014cece5b
ca3d90b2d1919a9b5c60450179547077
Parse the message and returns a ISSDPMessage if the message is supported. If the message is not recognized a null value will be return. Some extra attributes could be received within the message. Even if there are not part of the SSDP specs, and they be parsed and kept into the property : Attributes.
public Object parse(String message);
1
d2d79a09eb537295f36eb586691aa848
7ef2cea77fdd2e2cdea12603bd5a52f1
Обработка события изменения сцены у слушателя
public class Fade : MonoBehaviour private void OnSceneChanged(UnityEngine.SceneManagement.Scene arg0, UnityEngine.SceneManagement.Scene arg1) { Canvas canvas = GetComponent<Canvas>(); canvas.worldCamera = Camera.main; }
1
cddc0a7c8bdb6e222b7dc07c14668bdc
8a1f26ccd86749fd86710148b4f45a87
明星信息保存
int insert(StarInfo starInfo);
1
37470b8b96f45f84b55b89d9bc5c2818
7a3db9296c9250f704e3c6c11713325a
@brief Set or clear a boot partition's read-only flag
{ uint16_t optionbyte; optionbyte = FLASH_ReadOptionByte(0x4803) >> 8; if ( (optionbyte & (1<<0) == 0) ^ (val==0) ) { FLASH_Unlock(FLASH_MEMTYPE_DATA); FLASH_ProgramOptionByte(0x4803, optionbyte^(1<<0)); FLASH_Lock(FLASH_MEMTYPE_DATA); } }
1
ebadd9aaf6b292267b3ab3578caa0b68
c6ea383361e472885139f1724ad79e8d
@brief Get the Accelerometer data of the MPU-6050
void GetData_MPU6050(int16 data_buf[]) { uint8 byte[14]; I2C_Start(); I2C_SendByte(0xd0); I2C_SendByte(0x3b); I2C_Start(); I2C_SendByte(0xd1); byte[0] =I2C_ReceiveByte_Ack(); byte[1] =I2C_ReceiveByte_Ack();data_buf[0]=byte[0]<<8|byte[1]; byte[2] =I2C_ReceiveByte_Ack(); byte[3] =I2C_ReceiveByte_Ack()...
1
436bb1bc28ce9f974eaf9df16698e734
fc541c07339abce23f9dccd6b0b5bd29
@brief Get value of the TM Egress Flow Control counter. (APPLICABLE RANGES: 0..191).
static CMD_STATUS wrCpssDxChTmGlueFlowControlEgressThresholdsSet ( IN GT_UINTPTR inArgs[CMD_MAX_ARGS], IN GT_UINTPTR inFields[CMD_MAX_FIELDS], IN GT_32 numFields, OUT GT_8 outArgs[CMD_MAX_BUFFER] ) { GT_STATUS result; GT_U8 devNum; GT_U32 tmPortInd; GT_U32 xOffThreshold; GT_U32 x...
0
c3b875c28f56dcbe64f90d5f78e070e6
96f4b780aa719cf660bf8d5600569ff9
Set animated property in XP and theoretical lines
class XPs_Plotter__OF: def set_animated(self,val): self.XP_Plotter.set_animated(val) self.lines_theory.set_animated(val)
1
0125b05956b67b8c627273a2934192ea
b3f5675ce12c23949cd2a691017c4ad5
将dp转换为pixels
int dp = (int) (pixel / scaleFloat); return dp; }
0
80885015cd12936ce19f5e0a55b04760
f896810bd81c4ef23822521f7192e0a1
对满足条件的字符串进行过滤
public abstract class Utils public static String stringFilter(String str, String filter) { String filterStr = null; Matcher m; try { Pattern p = Pattern.compile(filter); m = p.matcher(str); filterStr = m.replaceAll(""); } catch (PatternSyntaxException e) { } return filterStr; }
1
762138f29ef2d050b2bdcee64f7665d3
15adb092a441a40620fbf17c5ae3e50c
Returns the list of registered unit names as symbols.
namespace udm unsigned int UdmDfiConfig::getUnitNameList(std::vector<std::string> &unit_names) const { if (this->unitlist == NULL) return 0; return this->unitlist->getUnitNameList(unit_names); }
1
0c929868366d48880f90e335000b33ac
20769143fc4a43d33e12068b506d3784
จัดการผู้ใช้ระบบ
{ if (!$this->authModel->isLogged('admin')) { $this->authModel->accessDenied(); exit(); } if (($action == "0" || $action == "1") && ctype_digit($id)) { $result = $this->authModel->setActivation($id, $action); } $users = $this->authModel->g...
1
1002208f5d655afec00ea5686dbf3a00
ed957e25ab4ef11fb6cb449e08c0b4a4
Print a list of available SPARC CPU types.
{ int i, j; struct arm_cpu_type_def tdefs[] = ARM_CPU_TYPE_DEFS; i = 0; while (tdefs[i].name != NULL) { debug("%s", tdefs[i].name); for (j=13 - strlen(tdefs[i].name); j>0; j--) debug(" "); i++; if ((i % 5) == 0 || tdefs[i].name == NULL) debug("\n"); } }
0
6bb3238a5b568e2c9ae9419890c94412
118f38e39bcb549b384b4d55fa90472b
Test the grid info printer.
FILE* in_file; Grid* in_grid; if (argc != 2) { fprintf(stderr, "Usage: grid_info <in-file>\n"); return 1; } if (!(in_file = fopen(argv[1], "r"))) { fprintf(stderr, "Cannot open %s for reading\n", argv[1]); return 1; } in_grid = grid_read(in_file); fprintf(stdout, "ncols: %d\nnrows: %d\nn...
1
51d5d36f3f436c521d1f5f136f144783
0673b6bd6f26325e6d2beac3a2b9e017
@brief Set the Sustain level and Release rate
void YM2413::set_sl_rr(int slot,int v) { OPLLChannel *CH = &P_CH[slot/2]; OPLLSlot *SLOT = &CH->SLOT[slot&1]; SLOT->sl = sl_tab[ v>>4 ]; SLOT->rr = (v&0x0f)? 16 + ((v&0x0f)<<2) : 0; SLOT->eg_sh_rr = OPLLSlot::eg_rate_shift [SLOT->rr + SLOT->ksr ]; SLOT->eg_sel_rr = OPLLSlot::eg_rate_select[SLOT->rr + SLOT-...
1
2769872c12ad7980be99bb9b486c78f2
654b0e8f14fe598f8e7507e6c78b9038
Sends <tt>body</tt> to <tt>buddy</tt> as an instant message
namespace Core.Message MessageResult SendMessage(String body, String recipient);
1
d2dd5609bed7fc2f5a0639154d4f33ab
5f9ec392d324ab566bdcbe66f04e64e1
Determines if the x axis autoscale property is true.
public class DrawingPanel extends JPanel implements ActionListener, Renderable public boolean isAutoscaleXMax() { return autoscaleXMax; }
1
566b12e5a1de954652a8f50654b00ecb
31b87c8703c5ad4a61fe9634e5e22d5c
Sets the Vendor ID for the order.
public class TransportOrderValue extends TransportOrderSuperValue implements RateRequest public void setPreferredVendorId(Long vendorId) { preferredVendorId = vendorId; }
1
3d30b058b4ad8f387344d513aeaa89ae
5bc064e362da2e05dedbb1e752095911
Gets all the children parts of the specified type "T" into "partCollection" of this part.
namespace DocumentFormat.OpenXml.Packaging public abstract class OpenXmlPartContainer public void GetPartsOfType<T>(ICollection<T> partCollection) where T : OpenXmlPart { ThrowIfObjectDisposed(); if (partCollection == null) { throw new ArgumentNullExceptio...
1
edcb0ad07f82e2788626c92f6e98ccc7
b3ce7ee2691664dc70c0d78e8a9a0fec
Sanitize JSON from extra brackets caused by AppleScript
function fix_json(data) { return data.replace(/(\')/g, '"'); }
0
2e3be0a452cd8e416d0f3efd32fd0ccb
b7c8e34a3272b527d38fb6f92ed1f926
Split indices in train/test/val sets.
def get_indices_split(data): split = StratifiedShuffleSplit(n_splits=1, test_size=0.3, random_state=42) train_indices, val_indices = next(split.split(data, data['class'])) return train_indices, val_indices
0
8fb317457d148ab2ec99dee8e22b09f0
06f9b9bcd229f88532eeaba4de85f1c4
将记录按照文件夹目录排序
public class FolderDAOpe extends BaseDAOpe public void sortRecordByFolder(final ArrayList<Record> records, final OnFinishListener listener){ new AsyncTask<String, String, ArrayList<Folder>>() { @Override protected ArrayList<Folder> doInBackground(String... strings) { Arra...
1
418dc27b2d93e89e747b452830fd7011
945ddff14fb650e178f9ae4317711cbe
Computes an optimal affine transform for two points sets. This function assums that the translational component has been already removed, i.e. that both point sets have the same centriod.
assert len(A) == len(B) N = A.shape[0]; centroid_A = mean(A, axis=0) centroid_B = mean(B, axis=0) AA = A - tile(centroid_A, (N, 1)) BB = B - tile(centroid_B, (N, 1)) H = dot(transpose(AA), BB) U, S, Vt = linalg.svd(H) R = dot(Vt.T, U.T) if linalg.det(R) < 0: print "Reflec...
0
df242dd3c4eb7ebfcbd13d2b71302101
16056db329281d174c7b9251be9562e7
函数描述 : 根据用户账号删除标签
if(userId == null) { return 0; } return userLabelMapper.delByUserId(userId); }
1
d42868bd33bf66e89e55dfdcd14e0a7a
84c69c408a9e5a3f89543a5857258bba
Validate ASCII files using difflib.
class FileValidation def files_are_ascii? ascii_errors = check_if_files_ascii ascii_errors.each {|error| @errors << error } unless ascii_errors.empty? @errors.empty? end
0
ec3576801cad1d48c8b677a661b7312b
040ee71ccb18817a796cf259b870ce84
志愿者报名参与志愿者活动
namespace IntellVolunteer.Controllers [Route("VolunteerManageApi/[controller]/[action]")] [ApiController] public class VolunteerActivityController: ControllerBase [HttpPost] public ActionResult<VA_SignAddResModel> VA_SignAdd(VA_SignAddViewModel AddViewModel) { int Add_Count; ...
1
b79857eef38846bc5a6e3bf3d8eafb6a
d83d4e7acec7d6d3c3615d31c371757a
Returns a value to be used in setw to center outputs in a box
static inline int get_margin(int width, int full_w) { return ((full_w - width) / 2); }
1
81117e419317c3019a61ec131331fd1a
ff68e900ed18855872c653ff36e350fb
Create a simple header with version and host information
var template = '{"version":"<%= pkg.version %>","publicDate":"<%= pkg.publicDate %>"}'; return header(template, { pkg: {version:pkg.version,publicDate:strToday} }); }
0
073c8bb6e264b407bfffc7176570f005
c361c891b16f6d69062f925c136b84fb
NewKubeClient creates a new Kubernetes API client with a given configuration.
k := &kubelet{ client: httpClient, } return k, nil }
0
6fe935a391b30c3bcb341a74870d33b8
8e1f58146e260c0793dbf9a2cccb20c6
대여장부 검색부분 내용 초기화 함수
var dprtId = $.trim($("#dprtId").val()); $("#keyword_search").val(""); $("#divSearch").find("input").each(function() { $(this).attr("value", ""); }); $("#divSearch").find("select").each(function() { $(this).attr("value", ""); }); $("#divSearch").find("textarea").each(function(){ $(this).val(""); }); $("#...
1
c1111e5bff2578c1e67f690f57098ec5
ca9923dd5cf5e143285e14ea0bdc5ac9
跳转到选择兴趣界面
public class WuYeJiaoFeiActivity extends MySwipeBackActivity implements View.OnClickListener, SwipeRefreshLayout.OnRefreshListener{ private void initUI() @Override public void onClick(View v) { MyUntil.mStartActivity(WuYeJiaoFeiActivity.this,JiaoFeiLiShiActivity.class); ...
0
9531132111d28d493b233cd4b2a0eed2
2266e206f2ede75a7dcc6e02bb9c109e
Private slot to swap the byte order.
class ObjectWidget(QWidget): def flip(self): self._orientation = {'h': 'v', 'v': 'h'}[self._orientation] self.update() self.emit(SIGNAL("flipped()"))
0