query_id
string
corpus_id
string
query
string
code
string
label
int64
6d45628fecbe49d65978ba163c532114
bbfcecb828d90950e5672266814069c0
生成一个逻辑异常类
public class ResponseBean implements Serializable public static ResponseBean createException(String message){ ResponseBean responseBean = new ResponseBean(); responseBean.type = ResponseBeanType.EXCEPTION ; responseBean.code = ResponseBeanCode.EXCEPTION ; responseBean.message = message ;...
0
9e7c68b0fdbe46ecd76279080e900bd7
489a7a9c7144adc9ea0626a85c8ca548
Calculates the average depth from a point cloud buffer.
computeCloudResolution (const pcl::PointCloud<pcl::PointXYZ>::ConstPtr &cloud) { double res = 0.0; int n_points = 0; int nres; std::vector<int> indices (2); std::vector<float> sqr_distances (2); pcl::search::KdTree<PointType> tree; tree.setInputCloud (cloud); for (size_t i = 0; i < cloud...
0
f7459e81d37a273d72c72d4b857dc4ad
e59dc280a3bca307eb45fd27bdad1370
获取当前登录用户的所有留言
public class AnonAction extends ActionSupport public void showMessages() { User user = (User) ServletActionContext.getRequest().getSession().getAttribute("loginUser"); List<AnonComments> userMessages = null; try { userMessages = anonService.showMessages(user.getUid()); } cat...
1
69ea76b6e09fb8c27163a00938c8b874
a27933090b660fd212f955aeed7cce54
Gets the value of the shippingAddress property. possible object is {@link ShippingAddressType }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Line", namespace = "http://xmlns.oracle.com/apps/scm/doo/decomposition/orderDetailServices/orderInformationService/", propOrder = { "sourceTransactionLineIdentifier", "sourceTransactionScheduleIdentifier", "sourceTransactionLineNumber", "sourceTrans...
0
d994dc68fae4b936345986237f168b14
d5fe1757d297406c0e61f7a68f93bec9
Moves turn signal back and stops sound
{ turnTimer = false; timeText.text = " "; if (currentGameState == GameState.PlayState) { currentTurn.StopSelectedEarly(); } CameraManager.cameraManager.MoveCamera(CameraManager.cameraManager.overviewCameraPosition); NextTeamTurn(); }
0
5f76687b9b74b392242edd7afbcbebdc
44a07c41cd78ec658216bddcefafe371
将文档保存为字符串
{ MemoryStream mStream = new MemoryStream(); this.m_cXmlDoc.Save(mStream); String str = Encoding.Default.GetString(mStream.GetBuffer()); return str; }
1
bc7fc6fb1d1c4380ff1b6582e4b9446b
b367b07b953c8198bfbcc4060b120ac3
Test case for getDvrRESTConverterStore Retrieves the information about a store/converter associated with the application instance.
namespace Pulumi.GoogleNative.Healthcare.V1Beta1 public static class GetDicomStore public static Task<GetDicomStoreResult> InvokeAsync(GetDicomStoreArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync<GetDicomStoreResult>("google-native:healthcare/v1beta1:getDicomS...
0
01df35db03b362fea1796e04cec9a54d
a2070b6e13422ea3b99f819951e445f8
产生巡检任务(和以前的IInspectPlanMgr中的generateInspectPlanRes一样)
* saveInspectionPlan({ payload }, { call, put }) { const rsp = yield call(patrolPlan.saveInspectionPlan, payload); yield put({ type: 'initState', payload: rsp }); }
0
69793dfebbafe4363cea1a9185b33b7c
050ab12883fb593ba7b6f5adc9dc756b
===================================================== updatecond
class condition public static function update($templet,$name=NULL){ $cond=$templet; foreach ($templet as $key=>$value){ if(false!==getPara($key)){ $cond[$key]=getPara($key); } elseif(NULL!=$name && isset($_SESSION[self::OUCOND][$name][$key]) ){ $cond[$key]=$_SESSION[self::OUCOND][$name][$key]; ...
1
7d2f571983a896196c0225357ccb7bd5
5771abad4f017af12aca6b1c77862912
小组模糊查询
class SearchController extends Controller public function group() { $keyword = request('keyword'); $page = request('page'); $data = \Group::m()->getAll([ 'where' => [ 'status' => 0, "concat(name,info) LIKE '%" . $keyword . "%'", ], ...
1
3cf2582c07be9e39d6e8dd36d37e8e0d
82f91247917c0d7eb40dee3a9b3198fd
Проверка эквивалентиности среза и разворота списка
copied_lst1 = lst.copy() copied_lst2 = lst.copy() for i in range(len(lst)//2): copied_lst2[i], copied_lst2[len(lst) - i - 1] = copied_lst2[len(lst) - i - 1], copied_lst2[i] if copied_lst1 == copied_lst2: return 1 else: return 0
1
9823f061a6c60e1da596731f82665ea6
0b4fa64587e1667013761a47619adf6f
3、为每家店添加销售量客流量相关的均值,执行顺序在对时间进行拆分后
def count_consumer_flow(data_info,data_pay): dates = dateRange('2015-07-01','2016-10-31') consumer_flow = pd.DataFrame(index=dates) for shop in data_info.itertuples(index=False): shop_pay = data_pay[data_pay['shop_id']==shop[0]] consumer_flow[shop[0]] = shop_pay.groupby('time_stamp').coun...
0
c2f0baffc89a210b6fe5deacd4c4b44b
85887732c1040e8b1451ebabc8004347
This tests if the function that reads in a ranking matrix file works as expected.
class Testing(unittest.TestCase): def test_read_nbest(self): with open(self.nbest_file) as f: nbests = list(read_nbest_file(f)) self.assertTrue(len(nbests) == 15)
1
b78c39a3769ef3dbd1a4a49006e5d0c6
df7630a2104064f4e0368b3557bd3561
Metodo che genera l'intestazione del file PDF.
class PDF extends FPDF{ function Header(){ $fecha=date("d-m-Y"); $this->SetFont('Arial','B',18); $this->Cell(100,10,'Estancia Los Potros',0,0,'C',0); $this->SetFont('Arial','B',14); $this->Cell(100,10,'',0,0,'C',0); $this->Cell(80,10,'Cierre...
1
5b120ffa18a0e68c1cc704aa16e763a1
83cca8211eadb98f27d73300d1d5b8d3
计算优惠金额,预存款*优惠比率
double res = 0; if("2".equals(actm.getJmrdo())) { double rate = Double.parseDouble(WeChatUtil.dividedNum(actm.getNderatenum(), 100, 2)); res = billMoney * (1 - rate); } else { res = actm.getNderatenum(); } return res; }
0
e9b6d2f1b6038c216f7262d22719d8ba
5499d9eb79e6113fe328bed0b7b5652c
Sets the value of a property if it is empty.
namespace MoEmbed.Models public static class ResponseWriterExtension public static void WritePropertyIfNeeded(this IResponseWriter writer, string name, int? value) { if (value != null) { writer.WriteProperty(name, value.Value); } }
0
5cd53a7336d76926c8b5bbfcea9f2515
acee804d3c38401191179551e0260018
放電モードかどうか取得
{ float charge = 0; foreach (IMyBatteryBlock batt in compulsators) { charge += batt.CurrentStoredPower; } return charge > 1210f; }
0
18adb3e3564000d5ef007e48c6783f2c
fb85e3d650ce0224512c5053322e195b
Setter method for project file data byte array representation.
@Entity @Table(name = "FloorPlans") public class FloorPlan implements OpenCampusEntity public void setFpBytes(byte[] fpBytes) { this.fpBytes = fpBytes; }
1
9756a70f6cdc5f1f0e25fb391110213c
82a128c071281965a56217e19a45f3eb
Returns an array of the currently selected elements. To be called within or after open().
public class SelectDoublePanel extends JPanel public Enumeration getSelectedElements() { return selectedModel.elements(); }
0
9ad0bf9c03e595902572fe8912ad62f5
921a715057b02a7b3db16c01132c0bc1
获得xml文件中所有的节点的name属性的集合并且存储在arrname
String name = ""; for(int i=1;i<elementString.length();i++){ char c = elementString.charAt(i); if(StringUtil.BLANKS.indexOf(c+"")==-1&&c!='/'&&c!='>'){ name+=c; }else{ break; } } return name; }
0
d1d2945f8a2bf220efc5ffde52cc67f4
a668c8ce30020465ca42475fcb4acedb
PreOrder traversal method for filling a provided list with node data.
def pre_order(root, nodes): nodes.append(root.data) if root and root.left: pre_order(root.left, nodes) if root and root.right: pre_order(root.right, nodes) return nodes
1
c7874f2205c196501b9dfb26cbe2bf57
855fb97098d12b1806a856a5881ab733
Decrements the count of the latch, releasing all waiting threads if the count reaches zero. If the current count is greater than zero then it is decremented. If the new count is zero then all waiting threads are re-enabled for thread scheduling purposes. If the current count equals zero then nothing happens.
interface CountDownLatchConduit suspend fun countDown()
1
88e8f464af6282eec08bafda9d0ddf15
50eceb87b3cfe534d608d8a974bc21d8
通过id和标记词种类查找
String sql = "select * from word where wordclassid="+wordclassid; Result rs = Database.executeQuery(sql); GlobalValue.myLog.info( sql ); return rs; }
0
5d20847762d3553de1a28538843506f5
5e6e5068dd4cde896580471b017aee34
GET api/ageGroups
namespace Paho.Controllers [Authorize(Roles = "Admin")] public class CatAgeGroupController : ControllerBase public ActionResult Create() { return View(); }
0
2e86ea6a199f84118d2f7dd96c1eafa7
8f4676650c5c7d2a68a9208a07bff885
Save the message so that it can be checked during the tests.
public class AutoSteppingEnabledMessageTest @Before public void initialize() { representation = OutgoingMessageType.AUTOSTEPPINGENABLED.toString(); }
0
ac564a76d5ff065ffa0cfed8c931f4b5
6c72c91992fe303b4af5d876dc1f4ac0
Update UI details when remote peer left the room
class VideoCallFragment : Fragment() private fun initializeAgoraVariables() override fun onUserOffline(uid: Int, reason: Int) { activity?.runOnUiThread { onRemoteUserLeft() } }
1
1bce9cfe51d92648fc5ac0470d36079a
3c65c1684e21c0410708fb1b12469eba
根据Fid查询农夫信息表
public FamerGoods queryFamerGoodsByFgId(Long fgId);
0
dc09227c95e8e163d7a1e2e39e28ab2f
8f3c4d503e543780c7b08d4c9b633352
gör om den krypterade till "läsningsbar"
if (Config.getENCRYPTION()) { toBeDecrypted = new Gson().fromJson(toBeDecrypted, String.class); char[] key = {'Y', 'O', 'L', 'O'}; StringBuilder beingDecrypted = new StringBuilder(); for (int i = 0; i < toBeDecrypted.length(); i++) { beingDecrypted...
1
4b2d11330aa4ab59a32ed5fcda66ff89
caa679173ba68faf62c33a426c8d29a5
test floats for approximate equality
static void float_test_success(void **state) { assert_float_equal(0.5f, 1.f / 2.f, 0.000001f); assert_float_not_equal(0.5, 0.499f, 0.000001f); }
1
faab49e8c0ca112dd1396e8564c336fa
5ffd22f79811fe3e48125c4759685a50
Asigna un alto al icono
public class Casillero extends JPanel public ImageIcon createScaledIcon(ImageIcon Imagen, int height) { return new ImageIcon(Imagen.getImage().getScaledInstance(height - 2, height - 2, Image.SCALE_SMOOTH)); }
1
8e13e7af41f3c7aed800c42610d43c8c
1dfbb6ef206df32f0397b28e797214de
取较短的全球唯一码
{ double detLat = latMax - latMin; double detLon = lonMax - lonMin; if (detLat < 0 || detLon < 0) throw new ArgumentException("参数错误"); bool flag = false; if (detLat * 2 > detLon) flag = true; double lat = (latMax + latMin) / 2; ...
1
ebc59a72947562bd4ece7dcd633bf5d5
04c61e1b40fa3a3d4d079dd124648107
mp_salesman_cust을 삭제한다.
class module_upd{ public function fPrimeCustDelete($conn,$strTaishoBumon){ try{ $sql = "DELETE "; $sql = $sql." FROM T_MS_PRIME_CUST "; $sql = $sql." WHERE C_TAISHO_SECTION = '".$strTaishoBumon."'"; $stmt = oci_parse($conn, $sql); $r = oci_execute($stmt,OCI_DEFAULT); if (!$r) { $e = oci_error($s...
0
d39520f548ff4aba2f3141ebf17ebc7c
df1e4d78e701d55395655ee3d747652e
renvoie les parcours d'un enseignant donné liés à un exercice
class ParcoursRepository extends EntityRepository public function findAllForMap($source) { $str = "SELECT p, pmv FROM DevBieresNantesParcoursBundle:Parcours p INNER JOIN p.pmv pmv WHERE p.source = :source order by pmv.id"; $q = $this...
0
0a5fe05db22658d9e8ce4e83f1e1dd94
70c31ffb29ddb4f532ca91fdfad69775
Right Hand Side of the 1st order forced 2D ode
def RHS_upwind_1(): d0_r = (1-theta)*D*dt/dx**2 + v*dt/dx d1_r = 1 - 2*(1-theta)*D*dt/dx**2 - v*dt/dx d2_r = (1-theta)*D*dt/dx**2 return sp.diags([d0_r, d1_r, d2_r], [-1, 0, 1], (nx,nx), 'csc')
0
86b7986640d4bfc9d930595f14e1c20d
978f95b6571cde58a43898ccbcfcc82f
判断点到直线距离.
double dispointtoline(point p) { return fabs((p-a).cross((b-a)))/length(); }
1
7b9cb27daffca7f2a25fd9d0589cff5c
47f4d2d9f66c5d34afb4c338a98002da
Returns the row in which vertex {@code i} is found.
INDArray getRow(long i);
0
e7959d52f8f6d955a3ad858ad334cdd1
b991dd44640c30bae27e9479155077fd
преобразовать целое в строку с запятыми
class Humanize public function intcomma($int) { return number_format($int, 0, null, ','); }
1
b758be591456efda9d44b9cb60f3fa18
ffc1fcbd96634301a718ba67171291d3
Deletes a value from an INI config file.
public class AutoItClient extends SystemObjectImpl implements AutoItConstants public boolean iniDelete(String filename, String section) throws Exception { return iniDelete(filename, section, null); }
0
62db7479e776a56de33de58adcd6cc53
9ba468ada69bc9aa0af1ddfedb0a6066
Create a 64 bit hash value of a data set
namespace ProbabilisticDataStructures public class HyperLogLog private uint CalculateHash(byte[] data) { var sum = Hash.ComputeHash(data); return Utils.HashBytesToUInt32(sum); }
0
c013494604a51a575a0c33d0833d8104
319dfbe6e41eb532705cdb0f60094201
@brief 静音复音快捷键修改
void Dialog::on_EnabelKeySoundSetting_stateChanged(int arg1) { if(arg1 == 2) { ui->KeySoundPreSetting->show(); ui->SoundLibraryButton->setEnabled(true); ui->PlaySoundButton->setEnabled(true); } else if(arg1 == 0) { ui->KeySoundPreSetting->hide(); ui...
0
4af5b2d2921c26bd833b2a4ed64066bf
f719f44f3f481ea08cd2bdf66dceea48
Recupera as pessoas físicas cadastradas no AGHU (código e nome).
export class CoreesamynService extends BaseService getPersonaJuridicaList() { return this.getAllPaginated(null, 'personaJuridica.crud.findall'); }
0
3a0e6240ae55137be9bb2da7f66bda48
b751e77f7b8177b72d66ebda199ad48e
获取满足条件的バックアップ先対象グループ明細数量
namespace IDAL int GetManualBackupServerCount(IEnumerable<SearchCondition> conditon, OdbcConnection conn);
1
1fb50970f886b4fcdfcf1020dff23397
3552079469c0f3d594fb333ec5a012af
món ăn
{ return "Một loại Cá đem nướng lên cực kỳ thơm ngon,\n sử dụng sẽ nhận được kinh nghiệm và ngân lượng." ; }
1
fa5bf9d59c5379aecabc3505c237647b
315758e7d206847ab6d0694c5b143f54
将内存bitmap中第bit_idx位所在的512字节同步到硬盘o
struct Bitmap * const p_bitmap, unsigned short const bit_idx) { int ret = 0; unsigned short long_idx = 0; unsigned short bit_offset = 0; unsigned long mask = 0; if (NULL == p_bitmap) { ret = -1; fprintf(stderr, "%s: p_bitmap is nullptr\n", __func__); goto final...
0
d28fffce137f2c1c3d9b6e181eb3e74a
f8639658c849af2fb136d3420de17a9a
Skip Enemy AI if in town
BWTA::BaseLocation* targetEnemyBaseLocation = enemyMainBaseLocation; BWAPI::Position targetPosition = BWAPI::Positions::None; if (targetEnemyBaseLocation != nullptr) { if (myRace == BWAPI::Races::Terran) { for (auto & bunker : myDefenseBuildingType1List) { if (bunker->getLoadedUnits().size() > 0) { bo...
0
a65bb4fa2457f9f4e5a20593d382a864
88ebf7453fc53c7f9ae08a9631f173bb
Loads the specified block from disk and serves it as a json dictionary.
if not path or not path.strip(): raise ValueError("path argument cannot empty") if index < 0: raise ValueError("index argument cannot be negative") data = self.dispatcher.get_block(path, index, ...
0
67970156bba67e72dd3419c0ada48eba
d377f82c1de66d1416b7a3a8de66286a
Test the view presented when some of the DOIs provided can't be validated
query_string = [ ("force", False), ("db_name", self.temp_db), ("identifier", "urn:nasa:pds:insight_cameras::1.1"), ] error_response = self.client.open( "/PDS_APIs/pds_doi_api/0.2/dois/release", method="POST", query_string=qu...
1
9831ca991a92d9c57d641ef461071dc8
18f72fd2d72788906fbf3089924fb2b9
метод получения списка договоров у которых три дня до окончания срока обслуживания
namespace ERP.Wholesale.Domain.Repositories IEnumerable<Deal> GetListByActiveContract(DateTime startDate, DateTime endDate, ISubCriteria<Deal> deals);
0
27886c97f685c0063f6be580b6e045aa
e6109930a5603aaa39ec222669f68855
Test conversion to chroot: inside, workspace, nested chroot.
pairs = [("OSFamily", "linux"), ("ISA", "x86-64")] exec_instance = ExecutionInstance( MockScheduler(), MockStorage(pairs), ["ChrootDigest"]) assert exec_instance.execute("fake", False) == "queued"
0
87a85f99e2237428abe451a1dfc95745
33b24a77110c0b17b018f2dc9d670c6d
Get accessControlSystemId
public class AuditFieldsChangeFilterTO implements Serializable public Integer getSystemId() { return systemId; }
0
559b80302af2a133c1f3641a4d609e8d
bb92caa1a65d4fb8068725ff37cbf2c2
指定された角度のハイパーボリック アークタンジェントを返します。
if (angle <= -1.0f) { return (float)(System.Math.PI); } if (angle >= 1.0f) { return 0.0f; } return (float)System.Math.Acos(angle); }
0
5e7ddfcac0d1383fa6e5f26428715542
27f60dae257628d66bf796c961111b49
check registration app
if (checkPlayServices()) { Intent intent = new Intent(this, RegistrationIntentService.class); startService(intent); } }
0
9a38056e3b18cf07746e42aa671acc1f
7049178cc6bf6ee9a2665ba134af6fc3
获取新增UDF的请求参数
function getAddForm(){ var name = $("#name").val(); var analyseGroupID = $("#analyseGroupID").val(); var isAlert = $("#isAlert").val(); var isWarn = $("#isWarn").val(); var checkTimeTypeId = $("#checkTimeTypeId").val(); var checkTimeValue = $("#checkTimeValue").val(); var checkTimeBegin = $("#checkTimeBegin").v...
1
eee3979eae9c423156777d277ae4bd2e
77d6600f908f21c632579f8c6162b419
Custom method to get the metadata of the ghaemiyeh epub file.
if not os.path.isfile(metadata_file): return [], [], None, {}, {} metadata_dict = load_json_or_empty(metadata_file, {}) if 'version' in metadata_dict: return self.__get_metadata_info_v2(metadata_dict) else: return self.__get_metadata_info_v1(metadata_d...
1
c0d02c607b6e38b7a70cb8f327279074
19f4e68c9a758edeefc6093af866c81d
POST: /SensorGroup/Create
public ActionResult Create() { ViewBag.ApplicationGroupId = new SelectList(db.ApplicationGroups, "Id", "Name"); return View(); }
0
a8952978350712cbf06e384038f2414c
8c19c1095d9bdd93c4042273633e6210
Initializes ADMM algorithm
mat_theta, mat_s, mat_z, alpha = current_vars tmp = self.admm_param * self.sigma0 - self.admm_param * mat_z - mat_s eig, mat_u = scipy.linalg.eigh(tmp) eig_theta = (-eig + np.sqrt(np.square(eig) + 4 * self.admm_param)) / 2 eig_theta[eig_theta == 0] = 1e-16 mat_theta = n...
0
b2ac3c4cf629a6b63cd8441025c4d9e6
cd66991edfd0de2d017a8ebc536f1242
Which ever Promise fulfills first is the result passed to our handler
class Promise then(onResolved, onRejected) function handler(callback) { try { const result = callback(self.data); if (result instanceof Promise) { result.then( (value) => { resolve(value); }, (reason) => { ...
0
321c30cf662f42b43e992c82073bda13
91e5c80fac1b2496c64ed72c81e384d7
进入证据链申请支付页面
public ModelAndView facePay(HttpServletRequest request, HttpServletResponse response) throws Exception { ModelAndView mav = new ModelAndView(); mav.addObject("userId",request.getParameter("userId")); mav.addObject("userName",request.getParameter("userName")); mav.addObject("subject",...
1
dbd5cf774bc18df22fb7f7a04729f32a
bde71194dafa70db6bb44d2ce857f05d
功能: 获取设置的CDP个数 参数: 无 返回: 设置的CDP个数
int CDCollection::Count() const { return numcds; }
1
eacf6fc5ff5367b5d28f4395d3b9cca7
1893560eb5bdc7101ce90d3fa2a236c9
渲染查看按钮或者印章
function renderCzBtn(data, type, full) { var btn = '<button type="button" class="btn btn-xs ue-btn viewBtn"><span class="fa fa-file-text-o"></span>查看</button>'; btn += '<button type="button" class="btn btn-xs ue-btn updateBtn"><span class="fa fa-pencil"></span>修改</button>'; btn += '<button type="button" class="btn b...
0
113ca4b6e703e6ccad590479f5359111
2f1aefdff0daed7fec88f5c56a4a5b61
每次选择剩余队列中最小的元素放到对应位置i上去
while i<=n//2-1: if nums[i*2+1]<nums[i]: t=i*2+1 else: t=i if i*2+2<n: if nums[2*i+2]<nums[t]: t=i*2+2 if t==i: break else: nums[t],nums[i]=nums[i],nums[t] i=t return
0
1cc2f151a7ffa4725e93dc321c858dd4
566ffb42ed6f419718be7a89a4fc418a
USD to JPY
def usd_to_jpy(usd): return usd / 8 * 1000
1
6a2d1fa49805afa05a894ac6b3542da9
50746c61ebdb4f01ed2d9ab899e6c0b4
返回当前程序安装时间(毫秒)。<br/> <strong><i>如果没有</i></strong>标记程序安装时间,则标记当前时间作为程序安装时间。<br/>
File saveFile = getSaveFile(context); if (saveFile.exists()) { try { JSONObject root = new JSONObject(StringUtil.from(saveFile)); return root.getLong(KEY_INSTALL_TIME); } catch (JSONException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return System.curr...
1
17645fefd3a8f4141813412de7f2cb95
e4670de4fbc479347c11d8e4aa425dca
----------------------------------------------------------------------------- Used to align the weapon model with the camera in first person when aiming down sight (position). -----------------------------------------------------------------------------
{ Vector3 weaponForward = (lookPosition - m_CurrentWeapon.weaponRoot.transform.position).normalized; m_CurrentWeapon.transform.forward = weaponForward; }
1
7b2e6661dc5457969bb963ab55a1ea3d
35576da26210ae459661e354c48b91a8
Get first mile tracking object.
public final class Trail public Station station1() { return station1; }
0
3703d84708449155f0e6f6227b154285
e3f111c325fbe20d3c75f6517cf2d146
Returns the list of unique words in the file.
def get_word_list(file_name): f = open(file_name, 'r') lines = f.readlines() curr_line = 0 while lines[curr_line].find('Actus primus') == -1: curr_line += 1 lines = lines[curr_line+1:] words = [] for line in lines: line = line.translate(line.maketrans('', '', string.punctuati...
0
69b1a75d9a03d77aa12f030011b24864
cf2d7017cd9918f5a6b0d1f36ad89b0f
admin special privileges page
def special_user_config(request): if request.method == 'GET': if request.user.is_superuser: special_config = SpecialUserParamConfig.objects.all() return render(request, 'special_user_config.html', {'special_config': special_config}) else: return render(request, '4...
1
1b7dcc1f1e3733d405af91cc4df5e130
0d876c2bf65cb62aa2f862968bdeeaf2
Inserts a column before the given column.
namespace FXC.Modules.Planshet.Behaviors public static class ColumnBuilder public static Column InsertNewColumnBefore(PlanshetDocument planshet, Column column) { Contract.Requires(planshet != null); Contract.Requires(column != null); Contract.Ensures(Contract.Result<Colum...
1
ca4bd1d2b6a1ebd7447f5f8046317bb8
3a71927865f6a10d39d244792e477c13
获得配送规则列表
class GoodsController extends ApiController public function actionRules() { $form = new PostageRulesListForm(); $form->attributes = \Yii::$app->request->get(); return $this->asJson($form->allList()); }
1
e8eddd101852d7a5f20a6a7adde4015b
6eed2ac3fccb1249764771b767edf0bf
广度优先遍历/搜索
void breadthFS(Graph* graph) { front = 0, rear = 0; int visit_list[MAX_VERTEX]; int i = 0; Vertex* Search_Vertex = NULL; for (i = 0; i < delete_count + vertex_count; i++) { if ((graph->vlist + i)->head != NULL) { ...
1
364fef9f539ce32a6c6c974e2918a81f
9d2f332df4b8afe6fd1f97869e1e7d38
\brief Retrieves the property which caused the notifier to be called
namespace wgt namespace Variant undoPropertyGetter( const RPURU::ReflectedPropertyUndoRedoHelper& helper ) { return helper.preValue_; }
0
ece91b40e0d57e01f43cda6a15764a9b
f836a8498572f839e6f7d56813672ffb
Set the location text substitution dictionary.
class flickr_trainer(): def set_dict_loc(self, loc): self.dict_loc = loc
1
4de0d88cccd9a8898c3b1404d8fdf38d
f43fdf5a8ed782d4291a41e7e0e08e82
Cleanup the dialog so other instances can use it..
public class InteractiveSelectiveUndoDialog extends TitleAreaDialog implements RectSelectionListener private void cleanup() { TimelineViewPart.getInstance().removeRectSelectionListener(this); instance = null; }
1
54cbe313305713c537d72869f8de0d74
fea706491eaf3bb36de63d0a3fe5d6aa
Меняет цвет заданного узла на противоположный
if (node == null) {return null;} node.color = color; return node; }
0
98cd8370068a8d0a8d3bb8f35952fba5
c19ec89cac079ec18a6e526b162be8be
비동기적으로 메시지 창을 띄우고 선택된 버튼의 인덱스 값을 반환함.
$game_temp.message_text=str.clone b=true $game_temp.message_proc=Proc.new{b=false} c=nil if(choices.size>0) $game_temp.choice_max=choices.size $game_temp.choice_cancel_type=choices.size $game_temp.choice_proc=Proc.new{|i|c=i} $game_temp.choice_start=start $game_temp.cho...
1
78a7b02107b8ba6c9c0be6de1320e604
2b3c3ea4569c081fc53f743f2bd54471
Excludes records from a scope.
public function scopeExcept($query, $value) { $defaultColumns = ['id', 'created_at', 'updated_at']; if (in_array_('deleted_at', $this->dates)) { $defaultColumns[] = 'deleted_at'; } if (is_string($value)) { $value = [$value]; } return $query->se...
0
b9f42595379ceffffd4adbf47d2864eb
4a1c965cb27244ba046c431de1586d4d
查询同一个手机号是否注册了公司或者个人账户并且未注销
produces = {"application/json;charset=UTF-8"}) public ResultEntity isRegister(@PathVariable("phoneNum") String phoneNum) throws Exception { return new ResultEntity(0,"手机号",phoneNum,0); }
0
8845ff1f52e4f002751d6dcf0d0ac7ff
140d4edcaf0647bcfd32ed6b2bbc682e
キャプチャイメージを削除する
function hideImageCaptureView(){ if(captureInnerHtml == ""){ removeImageCaptureListeners(); ImageCaptureControl.removeCameraView(function(result){ console.log("removeCameraView success"); },function(error){ alert("removeCameraView error !"+error); }); fromC...
0
019c67d94d3969bfcaaef16449d67daa
0a9e623e04adb6aa6a84f6fa619ee043
ignore already cancelled bookings
event = baker.make_recipe( 'booking.future_PC', allow_booking_cancellation=False ) paid_booking = baker.make_recipe('booking.booking', event=event, user=self.user, paid=True) url = reverse('booking:delete_booking', args=[paid_booking.id]) ...
0
2d0bb61b91f70980ac5205715b8bccac
b025f8efeb7e287371257451793c3297
Tests basic usage of ScopedOptionalGlobalMutexLock (Disabled).
{ $expired = Helper::secondsToMilliseconds(5); $operationName = 'phpunit.20200424'; $ids = [71, 72]; $obj = new BusinessMutex($this->getLockRepository(), $expired, $operationName, ...$ids); $obj->lock(); sleep(6); $obj->unlock(); }
0
0891097344670b03caebb120e7df0910
72b3ec94e8c71286de3194aef5bf5730
Comparação angular para pré-processamento dos pontos
private void SortAngular() { Point avgPoint = AveragePointInside(); Comparison<Point> mycomp = (a, b) => { double a1 = Math.Atan2(a.Y - avgPoint.Y, a.X - avgPoint.X); double a2 = Math.Atan2(b.Y - avgPoint.Y, b.X - avgPoint.X); double angle1 = (a1* (180/Math.PI) + ...
1
3b942fb916788fce0656b85b53cbfa8e
3a65d177283834b227b259efb8ebd3a9
更新楼盘信息记录
{ try { using (var db = new kyj_NewHouseDBEntities()) { var sqlparmsList = new List<object>(); var sql = new StringBuilder(); sql.AppendFormat(@" BEGIN TRY BEGIN TRAN DECLARE @buildingid I...
1
5ce83c1622f2a8a5278f016f24a31fbf
a4d81eb3c9548a19690566ab85cd8bed
add a new column to table "users" called username and of type "string"
class AddUsernameToUsers def change add_column :users, :username, :string add_index :users, :username, unique: true end
1
45f32e96765c1bfed45e49282e111e65
037612ec08cda2b67e1060b96e6f24a9
This script will perform a unit test on your function, and provide useful output.
def unitTest(): pass
0
a0c979f139ba21b9ce930263863a39e9
dfae2828db2674a39d2f9b42d07018fd
Instancie l'objet utilisateur.
class ControlerConnexion extends Controleur public function __construct() { $this->utilisateur = new \BlogEcrivain\Model\Utilisateur(); }
1
2332fe7d8f5fe33b1aa4903d1dd6d04b
999333e98fe64647fbe7eb7bb7c3f78b
Redos one Action and changes the edit menu items
public class ActionPerformer public void actionRedo() { try { tpEditor.getUndoManager().redo(); } catch (CannotRedoException ex) { System.err.println(ex); } tpEditor.updateControls(); }
1
4f215f9cd6ebf20f1d9a90278916f5d2
9ade81c78a0b18c778494e03f6335ed8
配列をCSV形式でデスクトップに保存 デバック用
{ if (string.IsNullOrWhiteSpace(DestFilePath)) return; string csv = string.Join(",", strList); var desctopPath = System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); if (!DestFilePath.EndsWith(".csv")) { DestFi...
1
c3ff9470bfc47b4bbf70ebd34803155b
3444f5964a2818ba649d06c616463a0d
Tile sprites buffer size adjustement
private uint clist_tile_cache_size(const gx_device *target, uint data_size) { uint bits_size = (data_size / 5) & -align_cached_bits_mod; if ( (gx_device_has_color(target) ? target->color_info.max_color : target->color_info.max_gray) >= 31 ) { bits_size -= bits_size >> 2; } #define min_bits_...
1
2a4ae3ac46a6ac0890f953989bc7465a
088a9eeb4e439926d37b653f17b7c104
获取博客访问次数 区别于getMemberBlogStat函数的是, 该函数使用缓存数据,原因是点击量蛋疼的设计,会先写入缓存, 缓存定时写入数据库,所以前端读取博客统计的时候,不能每次都从数据库读,不然数据不同步
{ global $config, $memcache; $data = array(); $keyStr = str_replace('memberid', $memberid, $config['keys']['blogclick']); $data = $memcache->get($keyStr); if(empty($data) || $_debug) { $data = getBlogStat($memberid); $flag = $memcache->set($keyStr, $data, $config['cache']['expire']); } return $data;...
1
72d2ab106e70c2e55cd0ef4df09fa2ef
81b84a9acb1a51dfeb97b700ff7c36c4
返回某一天所有人的订餐
function calculate($date){ $db = makeDB(); $order_list = $db->get_results('SELECT * from `order` where status != 2 and created_at between \''.$date.'\' and \''.$date.' 23:59:59\' order by user_id,id;'); $data = []; foreach (valueToArray($order_list) as $key => $order) { $data[] = [ 'username' => $order->...
1
d7e2e3397d086356b6b5106a775a9165
d1ba2deb10d0541875699b33511eabcc
Método conveniente para adicionar locação
{ $locacao = $this->locacao->find($id); if($locacao === null) { return ['code' => '400']; } return $locacao; }
0
36e834cfd97ee11db6ca36567cb9251c
153f57b4ebdf610f3fb0fe3df93039b7
处理查询终端参数应答消息
byte[] msgBodyBytes = packageData.getMsgBodyBytes(); if (null == msgBodyBytes || msgBodyBytes.length == 0){ mUtils.queryTerminalParamsResp(packageData.getMsgHeader().getFlowId()); } PackageData.MsgHeader msgHeader = packageData.getMsgHeader(); mUtils.terminalCommonRes...
1
ec260d4e0ec575b861f15a307e5883ae
490ea8c5c95f56b98666517d32e4d77b
Adds a class translation mapping to the receiver whereby instances of of a given class are encoded with a given class name instead of their real class names.
public final class Variants public static void mapClass(String type, @NonNull Class<?> clazz) { requireNotEmpty(type, "type name cannot be null or empty"); typeMappings.put(type, clazz); classMappings.put(clazz, type); }
1
20bc134e0ac66313c55c799a04ae9ac7
2b5d992849281043085ec57f93afb8b4
Returns just the file extension.
interface IFileName: Comparable<IFileName> fun getExtension(): String
1
3d9f29ac61eb46bed470f974c93cbe8a
52468c1f8c38372ad45c091822646f31
获取入库单的船名
{ $sql = "SELECT group_concat(DISTINCT shipname Separator' ') as shipname from hengyang_doc_stock_in si left join hengyang_doc_stock_in_detail sid on si.sysno = sid.stockin_sysno where si.isdel = 0 and si.sysno = " . intval($id); return $this->dbh->select_one($sql); }
1
f440afe0f4d97f987af271c3b2eb0bca
4ba9bd542963b36b8c72a55173101b05
If you wanna prevent horizontal scroll, set this true.
class DineStore @action disabledAutoScroll() { this.autoScroll = false; }
0
a58dfb55dae83a729f6c4794aa65e6b3
0e8f3d7969163c9352155ad4c3bc73d9
remove all non Latin characters
function clean( $str ) { return preg_replace( '/[^(\x20-\x7F)]*/','', $str ); }
1
77c28379b763db49fb35c1ff88076709
81d5eeb609d462d2949ffe2d6de49f9e
Check to see if LayerDigest property is set
namespace Amazon.ECRPublic.Model public partial class CompleteLayerUploadRequest : AmazonECRPublicRequest internal bool IsSetLayerDigests() { return this._layerDigests != null && this._layerDigests.Count > 0; }
1
dd5d2db8e7bfa959e36ee737fd0a344c
f4fd58dcbddc352f9f84a2629f75062c
Notification that a thread in the target VM is about to wait on a monitor object.
cbMonitorWait(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread, jobject object, jlong timeout) { EventInfo info; jvmtiError error; jmethodID method; jlocation location; LOG_CB(("cbMonitorWait: thread=%p", thread)); BEGIN_CALLBACK() { (voi...
1
1b7f77bae07433e60eada8ae00e6380f
a7dcf26701c79b622822197f7d1636fa
头文件处理函数,
string includeFilePath; if (line.find("<") != string::npos) { newCode.append(line).push_back('\n'); return; } unsigned long mFirstPosition = line.find_first_of('"'); unsigned long mSecondPosition = line.find_first_of('"', mFirstPosition + 1); includeFilePath = line.substr(mFirstP...
1