query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2265826b9cc3a3e771cc066f6e43d3fc | faf48a3f1b31d875b342cc65914303d1 | Example output: Sunday | dt = date(year, month, day)
weekdays = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
return weekdays[dt.weekday()] | 1 |
33a940aae4e2fe4bf83435b1db19a069 | 9c98cc0c15732dc5ac841fdf805f3256 | Los campos obtenidos en formato SHP deberían ser los esperados y
deberían corresponder a los campos obtenidos en otros formatos. | createQueryTable()
params = importer.getGeometryInfo(queryTableName, geometryField)
self.assertEquals(params['type'], geoparams['type'])
self.assertEquals(params['ndims'], geoparams['ndims'])
self.assertEquals(params['srid'], geoparams['srid'])
importer.commitChanges() | 1 |
686fafdea18b37b0602e5ed2a358d405 | 808b76b31d46ab77a637fd0ba86922ef | 获取开奖是否是豹子,顺子,对子 | void jiexi(int *B, int *type, int *cardm, int* q, int *p)
{
int allnum(0);
int initmax1(0);
int initmax2 = findmax(B, &initmax1);
if (initmax1 == 1)
{
if (B[16] == 1 && B[17] == 1)
{
*type = 41;
return;
}
int singlenum(0);
for (int i(3); i < max; i++)
{
if (B[i] == 1)
{
singlenum++;
... | 1 |
a6e05209b168d11d6187d920ee557a99 | 7d4c2ec0538a706fc4f309859f2f1d8e | Test the Set and Get tax percentage functions | public void testGetTotalTax() throws Exception {
double totalTax = 1005.0;
assertEquals(receipt.getTotalTax(),totalTax,totalTax);
} | 0 |
5b0adb1549b7063448ff25fda08348bd | c41f101fa7bbcb55f8826d67b481edb4 | 是否输入完成 | public class ExecutionStatusManager
public synchronized boolean isInputFinished() {
return _inputFinished;
} | 1 |
81217a6b96f6311d1e66cd296473af69 | d345da73e97b934e3da3084f4225c888 | 두 점의 유클리디안 거리 계산 | long long dist(Point a, Point b) {
return (((long long)b.x - a.x) * ((long long)b.x - a.x)) + (((long long)b.y - a.y) * ((long long)b.y - a.y));
} | 0 |
34b6a646b6332adddef32cbfc72e966a | dfda6a1f6daedc4cb6d82d0c085833d5 | 合併wf派車單 | seglist.sort("INDEX_IN_BRANCH", true);
DataObjectList mergeSegList = new DataObjectList();
Map<String, GenericDO> deletePointMap = new HashMap<String, GenericDO>();
for (Object o : pointList) {
if (!(o instanceof GenericDO)) continue;
GenericDO point = (GenericDO)o;
... | 0 |
7f4bc488523b41f710c91e618a57ceaf | e3b30fc49996175c0b95ab3990910a47 | 获取确诊人数前十的省份 | {
string strSql = string.Format(" select top 10 a.p_province,sum(a.p_count) as p_count from jmp_province a left join " + JMP.DbName.PubDbName.dbbase + ".dbo.jmp_app b on b.a_id=a.p_appid left join " + JMP.DbName.PubDbName.dbbase + ".dbo.jmp_user c on c.u_id=b.a_user_id where 1=1 ");
... | 1 |
fb8420711408a53c360bda13f9cd71d0 | ba0049b7fc3b84f1412f0012431a45df | 礼包名称排重 | public class DetailsAction extends BaseAction
private String chkFormName(String formName, Long notID) throws Exception {
Details tmp = detailsService.findDetailsByFormName(parent.getParent()
.getGameKind().getId(), formName, notID);
if (tmp != null) {
String str = System.currentTimeMillis() + "";
formName... | 1 |
0e52392251ad36247f474f6ce79a922c | d9a51f1840d3af5a3a14341988a3b83b | 参加学术团及任职情况取数 | Transaction tx = null;
boolean isDivided = false;
if (this.isDivided != null && this.isDivided.trim().equals("true")) {
isDivided = true;
}
String pageSize_s = null;
if (session.get("pageSize_GTJAM") != null) {
pageSize_s = (String) (session.get("pageSize_GTJAM") + "");
if (pageSize_s != null && pa... | 1 |
68dbcde4a719277922598ceb5d389e7d | 615bf674587cc6de0ca5932f72c34d78 | this is called to start a new table heading that spans more than 1 column | public void beginsTableBody(); | 0 |
4d4023c76a7c1c02d8ac76467dbe3df5 | 8acdff066ab49a82997fb64b52e75ed6 | acts correctly for undirected graphs, returns false otherwise. | public class Q1Main
public static boolean is_undirected(Graph g){
for(int i=0; i<g.getNumV(); ++i){
for(int j=0; j<g.getNumV(); ++j) {
if (g.isEdge(i, j)) {
if(!g.isEdge(j, i) || ( g.getEdge(i, j).getWeight() != g.getEdge(j, i).getWeight() ) )
... | 1 |
71d466be000e46bcb3ede4f040ea93d9 | ca53fa330e33f955d1cb8638d1892eca | 取消添加歌手操作 | const { history } = this.props;
history.replace(`/manage`, {to: "singers"});
} | 0 |
28dfead8113953fb240aef99acc083da | 880c856ec23e03c0faea8c0391acc551 | Attach a file to a businessTransaction | namespace Acumatica.DefaultEndpoint.Api
public partial class BillApi : IBillApi
public ApiResponse<Object> BillPutFileWithHttpInfo (List<string> ids, string filename)
{
if (ids == null)
throw new ApiException(400, "Missing required parameter 'ids' when calling BillApi->BillPutFil... | 1 |
f1d30602a14ce6e12c39682eb8201d11 | 3655302a6316dc28029ac9dad63e65ea | @brief identifier에 의해 아이템 객체를 생성한다. | namespace MiGame.CoreClass
public static class ItemFactory
public static ItemBaseClass CreateItem(int _item_id)
{
return (ItemBaseClass)Activator.CreateInstance(ItemDictionary[_item_id]);
} | 1 |
3af8a1990f94e2bd14455a712e45ec24 | f553e1aa6d7f55ed2601de5f8f468b1e | Constructs a representation of table data returned from a stored procedure as a List of
objects that represent the individual rows of the table. | namespace JocysCom.ClassLibrary.Data
public partial class SqlHelper
public static List<T> ConvertToList<T>(DataTable table)
{
if (table is null) return null;
var list = new List<T>();
var props = GetProperties(typeof(T));
var columns = table.Columns.Cast<DataColumn>().ToArray();
foreach (DataRow row i... | 1 |
88872b900ead100b3783cc30d7b3dc89 | 381dbfc1e8e3922bd6419baf5e9a304c | Run Tests for pio_spmd.c functions. | MPI_Comm test_comm, int rearranger, int num_types, int *pio_type)
{
int ioid, ioid3;
char filename[NC_MAX_NAME + 1];
int dim_len_3d[NDIM3] = {Z_DIM_LEN, X_DIM_LEN, Y_DIM_LEN};
long long delta;
int ret;
for (int t = 0; t < 1; t++)
{
float time;
sprintf(filen... | 1 |
f608854b5ce60c4138d99f5d5e4691f8 | 1b3b3dce8e9a4f55a7b1d4187bca1b8b | 在列表中寻找帧ID及其某个属性,并以字典形式返回 | obj_dict = {}
i = 0
for line in obj:
if line[0]=="F":
i = str(i)
if len(i) != 4:
i = "0"*(4-len(i))+i
obj_dict["Frame {i}".format(i=i)] = line[13:].split()
i = int(i)+1
return obj_dict | 1 |
ac0a34956528be75adfa4bd5e1673903 | 5feeef4c3fe108b93ddb85abc8fa3e12 | หากออกจากเพจนี้ก็ให้ลบ key ด้วย | {
if (!Auth::user()->isAdmin() && !Auth::user()->isTech() && !Auth::user()->isPlanneur() && !Auth::user()->isFM() && !Auth::user()->isManager()) {
return redirect()->back();
}
$key = Key::find($id);
$key->deleted_at = Carbon::now();
$key->save();
if ($requ... | 0 |
d918ec37d42b1a8fabfbf138bbeb5256 | 0fbb1d53cdbf6b58b63225a36a424800 | Blocks the current thread until the current eventWaitHandle receives a signal. | {
if (waitHandle == null)
throw new ArgumentNullException(nameof(waitHandle));
var tcs = new TaskCompletionSource<bool>();
var rwh = ThreadPool.RegisterWaitForSingleObject(waitHandle,
delegate { tcs.TrySetResult(true); }, null, -1, true);
... | 0 |
b5f46bb814a1d1bf51a19e48b25d7d52 | 90eba90ba101fd6b677a0b7dca36143f | Calls the contract method without broadcasting a transaction. | contractName: string,
methodName: string,
methodArgs: Array<any>,
gasLimit: number=100000,
enablePayGasInXAS: boolean=true
): Promise<object> {
let trx: Transaction =TransactionBuilder.callContract(
contractName,
methodName,
methodArgs,
gasLimit,
enablePayGasInXAS... | 0 |
70b1c24b3bc50a80df6a48e1fcd98d1a | d9441f3fcb4ca4ecb1f3b7e1303318e7 | Sets selector values to the values used in the previous page visit. | const urlParams = new URLSearchParams(window.location.search);
const initialVariantId = Number(urlParams.get('variant'));
if (initialVariantId) {
const initialVariant = this.variants.find(variant => {
return variant.id === initialVariantId;
});
initialVariant.options.... | 1 |
0d1ca811b583a106949054c4cd0de1d8 | 1d2e822ea532394ac3cb6d19a38599c9 | 按ISBN精确查找 | Isbn queryByIsbn(String isbn); | 1 |
c41c66f4acb061bc8a746974b816abd9 | ead5ad63de1d543a00b96349614b2128 | 이베스트 api 에 로그인하는 메서드 | res=ApiLogin(self.protocol,self.domain,self.port).login_post(self.accountEmail,self.password,self.base_url)
result_json = res.json()
token_ = result_json["result"]["token"]
token = "Bearer " + token_
return token | 1 |
78f063c63d68cb48a5d100c3028f279d | 49afeebcaf8d0630a8b9ece1673cef03 | Sums the two numbers given in an array and all integers in between
Handles negative, positive, or mixed sign spreads | function sumDigits(num) {
var sum = 0;
var str = num.toString();
var i = 0;
while(i < str.length){
if(str[i] != '-'){
sum+=parseInt(str.charAt(i));
i++;
}
else {
sum+=parseInt(str.charAt(i+1)) * -1;
i+=2;
}
}
return sum;
} | 0 |
31d2399475781112eecfd39ae702174a | 51959e8a55728644dcf40f318e50b4d8 | equivalent to [a-zA-Z_0-9]: | class Lexer
isIdentifier(a: string | number): boolean {
return a >= 'a' && a <= 'z' || a >= 'A' && a <= 'Z' || a === '_'
} | 0 |
9b103f79c5fb05f0cab247dba2974d70 | 97ed03f19cea50e8eab76af279a6acc3 | 根据留言ID删除留言 | int deleteById(Integer messageId); | 1 |
be05cfd3ccdcb5f9e6f62c6bc0d21e1f | 878fe9996d494775df687c301f8d381c | allocates memory and copies the contents of the given memory element into the new memory element | {
int *target;
target = malloc(sizeof *target);
assert(target != NULL);
*target = *source;
return (target);
} | 1 |
d0934db159255906d85a1269b9c5d987 | f661ca125c6681458777cbe298aff793 | Initialise the IR brightness config entity. | config_entry = MockConfigEntry(
domain=DOMAIN,
title=DEFAULT_ENTRY_TITLE,
data={CONF_HOST: IP_ADDRESS},
unique_id=SERIAL,
)
config_entry.add_to_hass(hass)
bulb = _mocked_infrared_bulb()
with _patch_discovery(device=bulb), _patch_config_flow_try_connect(
device... | 1 |
09c0e8f5002e595d0fc05719d280e6d3 | a16510b18e769da9046093d6f18b8b47 | 指定时间是否是一天结束时间(严格模式,校验毫秒) | {
int disDay = (int) ((getNextDailyTime(endTime,zoneOff) - getNextDailyTime(startTime,zoneOff)) / dayTime);
return disDay==0;
} | 0 |
e4119437491b6df9f15e89cd6550a7bd | 703fb8fd67d2e018a0696236b8612636 | 给定URL,分析出其中的作者,文章标题等信息 | content = reconnecting_urlopen(url).decode("gbk", "ignore")
soup = BeautifulSoup(content)
tags = ["百度贴吧",]
try:
username = BAIDU_AUTHOR_RE.search(content).group(1)
_title = soup.find("title").renderContents()
title = _title.rsplit("_", 2)[0]
tag = _title.rsplit("_", 2)[1]... | 1 |
5b68371c5cce76cf970d94243f257d34 | cfc9a3dde3dd963e8210e1311e47f572 | 将func_waitpid方法注册给SIGCHLD信号,使子进程在退出时加载函数做收尾工作 | {
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler = catch_SIGCHLD;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_NOCLDSTOP | SA_RESTART;
sigaction(SIGCHLD, &act, NULL);
return;
} | 1 |
4c027c8c0e6164256e88e4509da1ebdb | f91b3b99f7385d72f5f65643c261bd93 | |---------------------------------------------
| Get random order code
|--------------------------------------------- | $s = [
[1, 2, 3, 5, 6, 7, 8, 9, 0],
[1, 2, 3, 5, 6, 7, 8, 9, 0],
[1, 2, 3, 5, 6, 7, 8, 9, 0],
[1, 2, 3, 5, 6, 7, 8, 9, 0],
[1, 2, 3, 5, 6, 7, 8, 9, 0],
[1, 2, 3, 5, 6, 7, 8, 9, 0],
];
$code_number = '';
for ($i=0; $i<count($s); $i++){
$code_num... | 1 |
1dbc7f2963601a3a9a47776599ae4c95 | 6d664fe88e9406ad4a502dbc76531271 | Сохранить запись о присвоении должности | class DutyRepository extends BaseRepository
public function saveDuty($input)
{
return $this->save($this->duty, $input);
} | 1 |
e79eaf6018fc0e99d45452bed1e9d68c | 4e5461137efeddc4231a0970a44de73b | clear all 'in-playlist' marks. | struct papers *self;
long rock;
{
struct paperPositions *node;
StartWaitCursor();
for (node = self->Positions; node != NULL;node = node->next)
if (node->flags & eos_PaperMarked) ToggleMark(self, node);
StopWaitCursor();
} | 0 |
2068c8f04b8b7b06cfff0135b5010d2b | 05566076f70d8fe3d905d91c20052328 | <p>通过中转线路虚拟编码查出该线路途径的外场列表</p> | public class CommonQueryVirtualSalesDeptService implements
ICommonQueryVirtualSalesDeptService
@Override
public List<String> queryExpressBigReginIncludeVirtualDeptCodeByExpressBigCode(
List<String> expressBigRegionCodes) {
if(null == expressBigRegionCodes){
return null;
}
return commonQueryVirtualSalesDe... | 0 |
b6fe9da53b0562a967cb60dd4182a991 | d47d78b51bc912b117f2144d7e90ef20 | Get the HTTP `Version` of this `Response`. | public class Response
public int getHttpVersion() {
return httpVersion;
} | 1 |
4b4de9c13aa8e5c10a2ddb7014b55b57 | c4a1f2b1a0a150c0365a2efe2fc99cf6 | Load dữ liệu sách lên datagridview | namespace LapTrinhCSharp.Forms
public partial class FormTimKiemSV : Form
private void LoadGrid()
{
gridView.DataSource = SinhVien.All();
} | 0 |
121adeba66122f200c26434105bac091 | 5198fce81682932a4b70e0e887860d5f | 设置 实名认证标识,记录该客户是否已经实名认证通过。实名认证的规则由应用实现。LOVB=PUB-C-0006。 | public class CheckinCustomer extends BaseDomain
public void setIssuingAuthority(String issuingAuthority) {
this.issuingAuthority = issuingAuthority;
} | 0 |
c401fa17cc8c7a1d7b6fc381e06c2957 | 42cd0d44a68f5787d8aa799899cca20e | Returns the select mutiple attribute | class ProductSelectAttribute extends ProductsModel
public function getMultiAttIds($productId) {
return $this->getDbConnection()->createCommand()
->select('attribute_id')
->from(self::tableName())
->where(" product_id = '{$productId}'")
... | 1 |
5ec69386055be903d9312868a4a3a02d | 6ea6fd1706c991c41ce9d3fc1e19fdbf | ---------------------------------------------------------------------------------------------------------------------------------
Funcion que havilita la seccion de busqueda por sucursal y deshabilita el resto
--------------------------------------------------------------------------------------------------------------... | {
try
{
List<SelectListItem> liLista;
liLista = _context.Sucursal.Where(p => p.Habilitado == true).Select(x =>
new SelectListItem()
{
Text... | 0 |
053d5b16c26997ae0fcb61d80ccad0e5 | eb5cfb6c6b6f1b135873b8d9620503f7 | Finds all [Customer]s with the given lastname. | public List<Customer> findByLastName(String lastName); | 1 |
41d6aa6561ae98a67a5747cae6f857c7 | 0d36c937a37e558e632e4c2b764afee6 | Check wether the configured delivery method is valid. | {
return ($this->type == 'elasticemail-api' || $this->type == 'elasticemail-smtp');
} | 1 |
092b620c900c486e8dd52db591fb91dd | a3851a08e5c068ea1cac23fddfa98d88 | Returns a serializable dictionary that represents this SOAP Vector. | class ResultStore(object):
def SOAP(self):
return tuple([self.soapargs[a] for a in self.soapstr]) | 0 |
41d657f8aa866b374aff463ae4711c09 | 47a1b92abed666a5289ce4fc4070ca37 | 计算point到直线线的距离(直线由start和end决定) | export class Direction8
calcPoint(startPos: Point, endPos: Point): number {
return this.calcXY(startPos.x, startPos.y, endPos.x, endPos.y);
} | 0 |
470f50a15370d845dca735937a38adbc | 288680a76c03fbe73d7da6ec3b8a4745 | Returns texture coordinates for a given character | GlyphVector glyphVector = font.createGlyphVector(g2d.getFontRenderContext(), String.valueOf(chr));
Rectangle visualBounds = glyphVector.getVisualBounds().getBounds();
FontMetrics fontMetrics = g2d.getFontMetrics();
int widthChar = fontMetrics.charWidth(chr) - visualBounds.x;
if (... | 1 |
085954692584d4b57b0436deee7d9ad3 | 0deab835dd24617a15df4c8e744bc145 | Returns a YAML representation of this operation. | class CalendarOperationsCalendarOperation(object):
def __repr__(self):
return self.to_str() | 0 |
9910a2b13b8a95ac31f7e17544de2466 | 73b3fdb3c224bd2602abdcc73aa0782f | 获取页面Post上来的参数Object值 | namespace MyWebApi
class ApiBase
protected virtual dynamic ParaGET()
{
dynamic obj = new System.Dynamic.ExpandoObject();
foreach (string key in this.Request.QueryString.Keys)
{
((IDictionary<string, object>)obj).Add(key, this.Request.Form.Get(key));
... | 0 |
96fb9e6d3b724b49c1f5c71fa46ec527 | 4cb96eb5a4d13a4625de356794668054 | Returns the version of Solid Edge that was used to create the referenced document. | public final class AssembliesGetAssemblyDefinitionResponsePartStudioFeatures extends AbstractResponseObject implements ResponseWithDocument
public final String getDocumentVersion() {
return this.documentVersion;
} | 0 |
0fa8bb53b02dc83f15c3eda60f493619 | 97c79cae26a1a44a367fcc8dd8d3f34d | 根据corpus构建二层字典,用于n_gram计算概率 | class Ngram:
def _buildModel(self):
self.tset = list(set(self.tokenlist))
self.tdict = dict([(x,self.tset.index(x)) for x in self.tset])
self.grams.append({})
self.rgrams.append({})
self.vocabcount = [0]*(self.degree+1)
self.totalcount = [0]+[len(self.tokenlist)-x for
... | 1 |
189b6a0ae2a329b5e91f82b895a6f401 | 35abbc10c719fdf6f4c572cffdab95c1 | This should be overridden in derivative classes. | class Allocation:
def free(self):
assert False, "Deriving class must implement" | 1 |
3a6b80abf55256280f76e0e4c6327d96 | f448f9308970ea46d165de80da0c4713 | Evento que se ejecuta al cambiar la fecha de la póliza | const data = this.filterFormGroup.value;
if ((data.p_cod_asegu || data.p_poliza || data.p_estado === 'VIG' || data.p_patente) && (!data.p_fec_emi.desde && !data.p_fec_emi.hasta)) {
let cFecEmi = this.filterFormGroup.get('p_fec_emi');
cFecEmi.get('desde').clearValidators();
cFecEmi.get('desde')... | 0 |
5388b7bbcf608af948b8bc84175e869b | 85a3860258d09a14262cf56aa71c5aa9 | 爬虫任务编辑 | if task_id:
task = get_object_or_404(Task, pk=task_id)
else:
task = Task()
if request.method == 'POST':
form = TaskForm(request.POST, instance=task)
if form.is_valid():
task = form.save(commit=False)
task.save()
return redirect('cms:task_li... | 1 |
4dc1bd349343ccf1bda1155f04edd643 | 397043d5cd4f88bd1b1bb14a7b6f0458 | 保存无效原因 | $("#disabledForm").validate({
rules : {
reason : {
required : true
}
},
messages : {
reason : {
required : "填写禁用原因"
}
}
})
} | 0 |
c161d0c1fbb2bd6659a4b3c61b975719 | e9f0006d1ff93d4d2299b01b8ae311f2 | 定时清除过期的鱼 | class AutofillFishGroup(object):
def clearShoalTimer(self):
for _timer in self._checkShoalTimerList:
if _timer:
_timer.cancel()
_timer = None
self._checkShoalTimerList = [] | 0 |
c632eebee95d8d8ec84046d02456a2c6 | bae34b7f196f7346ba8564f1d2380b1c | 显示岗位福利、岗位要求、岗位职责的封装函数 | class PositionHandler(BaseHandler):
def _make_jd_detail(self, position_info, pos_item, position_id):
position_temp = ObjectDict()
module_job_description = self.__make_json_job_description(position_info)
module_job_need = self.__make_json_job_need(position_info)
position_feature = yield s... | 1 |
ea1069cd157d8bd65d32dca822552a4c | 4d9738f8b8683e9e8604e4911722975d | ID ile Ürün bilgilerini çekme fonksiyonu | class main{
public function getItem($id){
$sql = "SELECT name, price, stock from tbl_items WHERE id = ?";
try {
$result = $this->_db->prepare($sql);
$result->execute(array($id));
$fetchData = $result->fetchAll();
return $fetchData;
}
catch(PDOException $e){
echo $e->getMess... | 1 |
f7776d627ea2c63338a623dd93c8f6fb | c6b0ec31a2ad700a9ae829b79da68be5 | Get a set of line segments that outline the given transect | {
GeometryCollection gc = new GeometryCollection();
gc.Add(contour);
return GetLines(gc);
} | 1 |
b7a4d96d0242a15bbfe2d8dde1963742 | 701c26b629511a78daec7a3bfdace1cb | !
@brief Client function to invoke associators call of the provider | {
(void) self;
(void) service;
(void) param;
return HALCS_CLIENT_ERR_INV_FUNCTION;
} | 0 |
b20cc494b3932198e614a79c1b51a3de | 08b46f898d911381259de1d79984a3c1 | We don't do any error processing | TInt CAlwaysOnlineEmailPluginTimer::RunError( TInt )
{
AOLOG_IN( "CAlwaysOnlineEmailPluginTimer::RunError" );
return KErrNone;
} | 1 |
5c925ade120a88e4d4b25734f724e41b | ad3de44b99730dcff163761bcf3c1f13 | Add tags [‘tag2’, ‘tag3’, ‘super’] to other articles except articles from type a | function drupal2wp_include_tags($wp_query) {
global $wp_query;
if ($wp_query->get('tag')) $wp_query->set('post_type', 'any');
} | 0 |
f6f53d14ca9f3b931873a559bfecbf02 | 7f449bf72d79c7a026217e095bcea52f | Returns whether the value of the '{@link org.oasisopen.names.tc.opendocument.xmlns.form.RadioType#getCurrentSelected <em>Current Selected</em>}' attribute is set.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class Version extends OFDElement
public boolean getCurrent() {
String value = this.attributeValue("Current");
return Boolean.parseBoolean(value);
} | 0 |
bbb9f7d84fcb306a57add86df002b659 | f9311e30088f3613667cefce5d487bd5 | запись в БД информации об attachments type => photo | $query_img = sprintf("INSERT INTO `accomodation_type_images` SET `image`='%s',
`accomodation_type_id`='%s'",
mysql_real_escape_string($file['name']),
mysql_real_escape_string($id)
);
return parent::insert($query_img);
} | 1 |
36e4e840cc2673b4be62252cd1787b55 | cac094397aab1381c89c9672367b475f | The home page for bjj logs. | def index():
global loginfo
return render_template('index.html', loginfo = loginfo) | 1 |
62f63743a4ee6a90ebaa790aede0499d | 05912bdeb8bf78bd018f25fda48a5134 | Выгрузка результатов kmeans | def KMeans(filename, clusters, iter):
data = np.load(filename)
data.resize(100000,27)
print "Loaded data"
t0 = time.time()
estimator = cluster.KMeans(n_clusters=clusters, n_init = 5, max_iter=iter, verbose=1, n_jobs=5)
estimator.fit(data)
print('%.2fs %i'
% ((time.time() - t0), ... | 1 |
c0b5616f74cf62910d0aa21a85a60af7 | c4c98a3edf28edcd43e214436aba47a4 | @brief 发送MQTT Ping报文 | namespace Netduino_MQTT_Client_Library
public static class NetduinoMQTT
public static int PingMQTT(Socket mySocket)
{
int index = 0;
int returnCode = 0;
byte[] buffer = null;
buffer = new byte[2];
buffer[index++] = Constants.MQTT_PING_REQ_TYPE;
... | 1 |
f6a69ecffe88473bbace8b6d468218d9 | 424e77f21b51b293ab24ed1fa6a693c3 | Test the run history gives the correct run. | workflow = self.workflow_populator.load_workflow( name="test_for_pja_run", add_pja=True )
workflow_request, history_id = self._setup_workflow_run( workflow )
run_workflow_response = self._post( "workflows", data=workflow_request )
self._assert_status_code_is( run_workflow_response, 200 )... | 1 |
e4131cf2f9f3eb0a6d82761d13168b30 | a42948ab407bc41447621289c9794e2f | Test that, for different event and target ID registration, the
trigger calls only the required listeners the exact number of
required times. | hooks.reset()
test_multiple.counter = 0
def mkinc():
def inc():
test_multiple.counter += 1;
return 42
return inc
hooks.add_callback('alien_invasion', mkinc())
hooks.add_callback('alien_invasion', mkinc())
hooks.add_callback('alien_invasion', mkinc())
... | 1 |
10474fae8a1321bb2b93176dab1ab939 | e1959eac9f99c9a706425cb6436b1a18 | Deserialise Timeline Event array from API response | class Twitter extends BaseApi
public function denormalize(array $data)
{
$objects = array();
foreach($data as $tweet)
{
$event = $this->denormalizeObject($tweet);
if ($event && ($event instanceof \CleverAge\Bundle\LifestreamBundle\Entity\LifestreamEvent))
... | 1 |
3e4d90d203447df34a82a72c880df73c | a98bf9f7fca79b959b360822c18248ba | 获取续约量 | {
$start_time_condition = $this->start_time_condition($date_time);
$end_time_condition = $this->end_time_condition($date_time);
$sql = "SELECT COUNT(lg.deal_id) renew_success_totals,lg.admin_id
FROM _tablePrefix_deal_op_log lg INNER JOIN _tablePrefix_loan_base d ON lg.deal_id=d.id INNER ... | 1 |
deb0bf6daeb6b4ebb282d8fa09aa9688 | 36deb5ffa48392a437012b96b89ee700 | builds a dummy JSON stream | {
cJSON *root,*fmt,*img,*thm,*fld;char *out;int i;
const char *strings[7]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};
int numbers[3][3]={{0,-1,0},{1,0,0},{0,0,1}};
int ids[4]={116,943,234,38793};
struct record fields[2]={
{"zip",37.7668,-1.223959e+2,"","SAN FRANCISCO","CA","94107",... | 1 |
c7ee7600f3aab9d7802601847da5608d | 69e06ee995e2cf26ee844bdf03c5b772 | Test #1: Test that products are returned correctly when they are present (unicode strings). | class WebsiteViewTests(TestCase):
##################
### INDEX ####
##################
def test_index_with_products(self):
create_product(user=create_user())
response = self.client.get(reverse('website:index'))
self.assertQuerysetEqual(
response.context['product_dict... | 1 |
7f4f95538708e8c40077ce2331a7dffe | 54a2cc34a28b6b1457ca4a20d293c18c | Returns the client's current latency (RTT), more accurate than GetAvgLatency but jittering.
@param client Player's index.
@param flow Traffic flowing direction.
@return Latency, or -1 if network info is not available.
@error Invalid client index, client not connected, or fake ... | public class NgGrpcExecInfo implements GrpcExecInfo
public double getCompressionRealTimeOnClient(int argID) {
return getCompressionRealTime(clientSessionInfo, argID);
} | 0 |
fbed8d2691724cf0d1943703e75ef163 | 31eb7f5e597dc3f02f0f0f5323f4122b | Writes the provided stream to the specified folder using the provided filename. | WriteStreamToFileRequest writeStreamToFileRequest,
CancellationToken cancellationToken
)
{
CreateParentDirectoryForPathIfNotExists(writeStreamToFileRequest.FilePath);
if (writeStreamToFileRequest.Stream.CanSeek)
{
writeStreamToFileRequest.Stream.Seek(0, SeekOr... | 1 |
dc8a35fb0dccc738aef6a3b2974a6aef | 9b179ee22b25b756941aad19e04b3ccc | Creating a VectorElementLayer(called markerLayer) to add all markers to it and adding it to map's layers | var vectorSource = new ol.source.Vector({})
var iconFeature = new ol.Feature({
geometry: new ol.geom.Point([lng, lat], "XY"),
name: "my Icon",
});
vectorSource.addFeature(iconFeature);
var iconStyle = new ol.style.Style({
image: new ol.style.Icon({
opacity: 0.75,
... | 1 |
554f54fa55533a296bbc1f08312caeba | 2b6083274d4830f2233114459fda6c2f | <summary>
Converts an integer to a fixed-point value.
</summary> | public class FP
public static int floatToFix(float aFloat)
{
return (int)(65536.0f*aFloat);
} | 0 |
73ee9f6759fec4d2090128ad77f6e544 | 61d0e26ef389965ed42ad07dec3de094 | 05 a - Notifica che il colpo sparato all'avversario è andato a vuoto | public class Aggressive implements IStrategy
private void goToNoMoreAttack() {
playerModel.noMoreAttack();
} | 0 |
04f9f9cda2b184bb47907062c44b8b40 | c5a931d11553ba0a769c7374c21a1bf2 | 获取url?号后面的参数 | $result = [];
$mr = preg_match_all('/([?&#])(.+?)=([^?&#]*)/i', $url, $match);
if ($mr !== false) {
for ($i = 0; $i < $mr; $i++) {
$result[$match[2][$i]] = $match[3][$i];
}
}
if ($key){
try{
$value = $result[$key];
}catch (Exception $error){
... | 1 |
cacff3a2b9f399725d0772f22c73c22f | 34537f9939df49c08c44371a0ed5bb1d | TestGetLast tests GET-last request | req, err := http.NewRequest("GET", "http://example.com/foo", nil)
if err != nil {
log.Fatal(err)
}
w := httptest.NewRecorder()
Handler(w, req)
if w.Code != 200 {
t.Fatal("Status code is not 200")
}
if w.Body.String() == "" {
t.Fatal("Body should not be empty")
}
} | 0 |
53c293efbcb58f9901dab8474966db67 | 9cfc2572484987c19a93067c01b80956 | Return the best estimate for what case a string is using. | fun String.getCase(): StringCase {
return when {
this matches StringCase.CamelCase.regex -> StringCase.CamelCase
this matches StringCase.PascalCase.regex -> StringCase.PascalCase
this matches StringCase.SnakeCase.regex -> StringCase.SnakeCase
this matches StringCase.ScreamingSnakeCase.regex -> StringCase.Screa... | 1 |
ce06abf7170bb67a315934b4d0bf0b1c | f37eb458258caef961321a565e493a13 | Método para que el usuario compre un jugador para el DTTeam registrado para un torneo en particular. | public class DT extends User
public void buy(PhysicalTournament t, PhysicalPlayer p) throws InsufficientFundsException, CompleteTeamException, ExistentNameException{
expenses.buy(t, p);
DTTeamsManager.addPlayer(t, p);
} | 1 |
bb96bdacbabed95392ac35240dc8c0e0 | 4dc31aeda3cffac29c82312ca54fbecc | Gets the value of the fromCity property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"address",
"zipCode",
"city",
"region",
"country"
})
public class PostalAddress
public String getCity() {
return city;
} | 0 |
014f908bade9cd5f69f89247d57fba94 | b6c84f11dd53fd812dd1e687e2205090 | Adds a facility resolver to the builder. | {
if (builder == null)
{
throw new ArgumentNullException(nameof(builder));
}
var resolver = new PlaceholderResolverSource(builder.Sources, loggerFactory);
builder.Sources.Clear();
builder.Add(resolver);
return bu... | 1 |
ec55cccb6aad0658c16c6b33e180ea9c | 4a7cf9fe0544a21ed7101793b51850bc | ***********************************************************信用卡账单管理************************************************************//
信用卡账单列表 | class MemberController extends PcBaseController
public function creditBillList(Request $request)
{
$data = [
'pageNo' => $request->input('page', 1),
'pageSize' => 10,
];
$Member = new Member();
$res = $Member->listCreditBill($data);
if ($res['result'] ... | 1 |
4be3eb650179786039fffeea19e20dbb | 73e34f3259e642e46a06a45dd8af91d4 | Sets the state as initial state of the state machine. If there are multiple states marked as initial, last one wins. | namespace XamarinCore.StateMachine.Interfaces
void Initialize(); | 0 |
23237e5f586821ac97428ee557c552e1 | 13923e44d0eaa977c7ec03a31693e3ae | Set the new milliseconds remaining on the clock. | public final class ManualClock implements Clock
public synchronized void setTimeMs(long timeMs) {
mTimeMs = timeMs;
} | 1 |
3113466e7aac7d1f22e60fdfbc1b04cc | b4d65c722e0e492980fdbf4b481d7663 | Меняет комплектацию местами с основной | public class RoomCraftingDisplayer : MonoBehaviour, IRoomDisplayer
public void SwapBetweenSlot()
{
string tempIndex = RoomItemSlotScript.buttonDownSlot.itemIndex;
RoomItemSlotScript.buttonDownSlot.SubtractCount(1);
RoomItemSlotScript.buttonUpSlot.SetSlot(tempIndex, 1);
} | 1 |
d123f3e2e8ada0c259e88f8caaf295f7 | a79cb35ec689723166cb71b57c68fb62 | 사이트 로고 이미지를 가져온다.
사이트 로고는 사이트템플릿의 package.json 에 의해 정해진 종류별로 가져올 수 있다.
해당 종류의 사이트로고 파일이 없을 경우 기본 로고 이미지를 반환한다. | if (obj.strTeamLogo) {
return obj.strTeamLogo
}
var sport = obj.strSport;
switch (sport) {
case 'Baseball':
return `./assets/images/icons/baseball-solid.svg`;
case 'Soccer':
return `./assets/images/icons/futbol-solid.svg`;
case 'American Football':
return `./assets/images/icons... | 1 |
ecc0646a7b555675d4ce0930feb7232e | 4e6782666226e0593db8b9af98e44acd | 全角数字 | if uchar >= u'\u0030' and uchar<=u'\u0039':
return True
else:
return False | 0 |
1a351a20e4389f44fbf715eff86f3c4a | e2cb3c61277ce67d490828fcce2e67d3 | Restore canvas defaults | function resetCanvas() {
fillMode = true;
strokeMode = true;
context.fillStyle = "black";
context.strokeStyle = "black";
context.lineWidth = 1;
context.clearRect(0, 0, canvasW, canvasH);
} | 1 |
5c497d49d7318f856b5e84817f1ec2b1 | aa436c3c38bc1bdad0be10796af555af | ================================================================================
Return the complementary error function with fractional error everywhere less
than 1.2 x 10^{-7}
================================================================================ | def erfcc(x):
z = abs(x)
t = 1. / (1. + 0.5*z)
r = t * numpy.exp(-z*z-1.26551223+t*(1.00002368+t*(.37409196+
t*(.09678418+t*(-.18628806+t*(.27886807+
t*(-1.13520398+t*(1.48851587+t*(-.82215223+
t*.17087277)))))))))
if (x >= 0.):
return r
else:
return 2. - r | 1 |
947cd28e866f59a7b519ca95883ad6e5 | fb2ac993b93c3839cd0f3ee11b45804a | sets the building graphic, based on the upgrade level | if (myBuildings.ordinal() < myUpgradeCost.length) {
return myUpgradeCost[myBuildings.ordinal()];
}
return NOT_UPGRADABLE;
} | 0 |
9dcdb01647a81dba12e098dec9178d0f | 0add1bcc900a5b26a84c69f46a058678 | GET: AdminIndex | public ActionResult AdminIndex()
{
if ((string)Session["user"] != null)
{
return View();
}
return RedirectToAction("Login", "User");
} | 1 |
20b7dda4a7bad8c74e2043650312e5f2 | 87013b29ce181b1f066f986a838d21b8 | Returns canvas that is a fragment of the source canvas | {
Image originalImg = Image.FromFile(pPath);
Bitmap partImg = new Bitmap(pPartWidth, pPartHeight);
Graphics graphics = Graphics.FromImage(partImg);
Rectangle destRect = new Rectangle(new Point(pPartStartPointX, pPartStartPointY), new Size(pPartWidth, pPartHeight))... | 1 |
a866e8436ff846c900be691003ac0a78 | 4c7e1a6021303f9c39efae0207c059ef | Função que incializa um novo estado. | if( aa_esta_nh(aa, nh) == TRUE) return ERROR;
aa->estados[aa->num_estados] = nh;
aa->num_estados++;
return OK;
} | 0 |
1863ec3a3c09f2b6bedcc884b147e6d9 | d5e7c4d6b951bd9f5c4d30a79a7cff45 | devuelve el camino más corto | list<int>::iterator it1=result.begin(), it2=result.end(), pos=it1;
it2--;
int dist = distancia(*it1, ciudad, matriz) + distancia(*it2, ciudad, matriz);
dist -= distancia(*it1, *it2, matriz);
it2=it1;
it1++;
while(it1 != result.end()){
int a=*it1;
int b=*it2;
int dist2 = distancia(a, ciudad, matriz) + dist... | 0 |
3bdf5da60b5a5115fd341306e0c4881f | 0a2903a0a5f7091c6834eb6d90424342 | Run the AI that is used to solve the keys in a file. | if not(os.path.exists(keyWordList)):
print('The file %s is missing!' % keyWordList)
return False
bestKeys = {}
startTime = time.time()
bestKeys = attempt_keys(myMessage, bestKeys, keyWordList)
print('the best keys are...\n')
for key in bestKeys:
print('Key: %s' % key)
... | 1 |
bf000e3593fc0a268348907a8baa97b4 | 885f0060ba0d8c9c108d8aaa4a1bcf51 | 递归调用子节点的业务方法 | public abstract class BaseFlowNodeHandler
public abstract void doBusiness(DelegateExecution delegateExecution, String nodeJsonParam); | 0 |
7942b5c703a42f7b6cc1f33632ee11d0 | 71eaee0cc954143c4f7a8bd14dfa032a | 退回一个问题 | namespace NOTKNOW.Controllers
public class AdminController : Controller
public ActionResult rejectQuestion(int id)
{
Question q = db.Questions.Find(id);
q.QState = "reject";
db.Questions.Remove(q);
db.Users.Find(q.QUserID).UQuestionNum--;
db.Topics... | 1 |
3b6975cba29868b4ca200e171479fa80 | 0404f1cfb539d5bdab255591cbe05488 | determines equality by reference.
if object is supplied compare options, if function, compare match callback | class Diff
constructor(options) {
this.equalFunc = options.equalFunc ? options.equalFunc : defaultEqualityFunction;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.