query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
19771d447e9905ac80d586a9d52c8630 | ef6a00b39479ca61ca9c1b2b51d82474 | 分数相减 | if (a==null||a.equals("")){
a="0";
}else {
a = a.replaceAll(",", "");
}
if (b==null||b.equals("")){
b="0";
}else {
b = b.replaceAll(",", "");
}
bigDecial_01=new BigDecimal(a);
bigDecial_02=new BigDecimal(b);
... | 0 |
8ab53e5f68cae0de8d9683449ba12e6d | 3af5c5154586a8c72e110436ce83e70a | Use the order ready date/time to determine when actual hand-off will happen. | class Totsy_Sales_Helper_Order
public function calculateEstimatedShipDate($order)
{
if($order instanceof Mage_Sales_Model_Quote) {
$shipDate = time();
} else {
$shipDate = strtotime($order->getCreatedAt());
}
if($order->getRelationParentId()) {
$pa... | 1 |
e492d582aaa1d8c699162ac7899c355b | f0d0f6a5644c35424c6d286fc659c64b | 维特比后向算法标注 | wrdlist = line.split(' ')
x = np.ones((len(tags),len(wrdlist)))*-1*np.inf
b = np.zeros((len(tags),len(wrdlist)))
for i,aword in enumerate(wrdlist):
if i==0:
for tagid,atag in enumerate(tags):
x[tagid,i] = E.get((atag,aword.lower()),-1*np.inf)
b[tagid,i... | 1 |
b14a950ee9c06f287fef54474d7c06b7 | 9d381efb51ff68a37151c51968f435ad | name should be a descriptive symbol. it is used to find copy, images and
links for the promo card | public class PromotionPo
public String getShortname() {
return shortname;
} | 0 |
33f625a913e28d109b21b4411c38324c | e2fcbf9cb04bec0205160a10513e5323 | Command group to inspect or modify the contents of basis sets. | def cmd_structure(): | 0 |
e53a9c961e8e0a0716f39751b5086cd7 | b64fc21c1ba2fc6f0b35e8a3dadb13af | 根据用户id删除评论记录 | @Service
@Transactional
public class CommentServiceImpl implements CommentService
@Override
public void deleteByUserId(long userId) {
QueryWrapper<Comment> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(Comment::getUserId, userId);
commentMapper.delete(wrapper);
} | 1 |
69ae870cb1fbf2c452a5950557179bb6 | 3dd3eeb858ff6549b6cd81a405bb843c | Return a generator to iterate through the elements. | class Document(MasterElement):
def __iter__(self, nocache=False):
pos = self.payloadOffset
while True:
self.stream.seek(pos)
try:
el, pos = self.parseElement(self.stream, nocache=nocache)
yield el
except TypeError as err:
... | 1 |
86009ad48c033dd892f262ff50ffa86d | d57492058c933e059ca7bc258effd629 | 默认设置为属性名 | public class CgJButton extends PvCgControlBase
protected String getDefaultPropertyName()
{
return "Value";
} | 1 |
a7af369ee4647da2c2585fb16475330d | 362ff3973b1801a09e7f836265873370 | the input or the dropdown has focus | export class TagInputComponent<T = any> implements AfterContentInit, OnChanges, ControlValueAccessor, Validator, OnDestroy
hasFocus(): boolean {
return this.isValidSelectIndex(this.selectedIndex);
} | 0 |
28bcc8ef96b50168d33079e0abb653e8 | 0387c3e06bca9b740ca9bbe56d0d4fa4 | Add a value for a placeholder | class Parser
public function addValueToPlaceholder(string $placeholderKey, $placeholderValue): void
{
$this->placeholderData[strtolower(trim($placeholderKey))] = $placeholderValue;
} | 1 |
e548276ca27c9bafa28a05359f42af83 | c69809d81708aab474c0b90941fea74c | # check if two segments interserct | impl Segment
fn intersect(&self, other: &Self) -> bool {
(self.start.ccw(&self.end, &other.start) as i32) * (self.start.ccw(&self.end, &other.end) as i32) <= 0 &&
(other.start.ccw(&other.end, &self.start) as i32) * (other.start.ccw(&other.end, &self.end) as i32) <= 0
} | 1 |
9ad6935e70019fe71e6d2d3e5f4a0769 | bdac56f3fe8b768f463cfd8d3a5f2aca | Makes sure that squash_mask() works as usual. Specifically, checks
if the sparsifier hook is attached correctly.
This is achieved by only looking at the identity layers and making sure that
the output == layer(input * mask). | num_steps = 1
num_elems = 100
d0 = np.asarray([1.0] * num_elems * num_steps).astype(np.float32)
def model_fn(builder):
main_in0 = builder.addInputTensor(popart.TensorInfo("FLOAT", [num_elems]))
sg0_builder = builder.createSubgraphBuilder()
sg0_in0 = sg0_builder.addUntypedInputTen... | 0 |
e32aa87e922d7e351f03a8caa3ee1637 | c26a5587e06658f995f964ba64f19a10 | 获得是否有玩家有效操作过 | {
object o = Bt.Blackboard.getData("PlayerOperateType");
PlayerOperateType player_operate_type = (PlayerOperateType)o;
return player_operate_type;
} | 0 |
b79db3468e5258bb1bf844dbafc82081 | a85f0abd7321b9a474c288a4354cb94a | Standard response when command specified on command
line is not recognized. | class CommandHandler(webapp2.RequestHandler):
def _Error(self, request):
return {'success': False, 'error': 'No command was specified.'} | 1 |
4c94d4fd481e7260679054e67e511032 | ea39df89bda9ad54f23ce1a2eddb9435 | 关闭指纹传感器 | export class FingerService
stop(): Promise<any> {
return this.doCommond('Finger', 'Stop');
} | 1 |
401d9eccfa682e3f6fd11324b67fcc72 | 80bf348805f735d2a7130209ca6a0ca0 | returns the average of all numbers in the array | public class Lab1
private static double getAvg(int[] data) {
return (double) getTotal(data) / data.length;
} | 1 |
338cbb96f7ebc2ba69ead57772c1eb05 | 5efb5d3aea42db7e2171074928940824 | Pop off 2 items from buy stack: stock name, and $ amount | class FarthVM(object):
def i_2drop(self):
try:
self.stack.pop()
self.stack.pop()
except IndexError:
raise StackUnderflow(self.farth) | 1 |
c8b566c40d918f89bbaa989b13c8d5b0 | 1f324367b28f8d45a91b3f083e4746c2 | Get the name from a short name | class ModelBaseKlass
shortNameFor(longName) {
const oThis = this;
return oThis.longToShortNamesMap[longName];
} | 0 |
7c47676bf8ff9ede098937aa68f63fbe | b9700f8502d4312202e8ebb993b5ab09 | retourne -1 si a est vide ou si e n'est pas dans a | int recherche2(liste* l, int e) {
if (!l)
return (0);
else if ((l)->dat == e)
return (1);
else
recherche2((l)->svt, e);
} | 0 |
22ded1aec72e8c3a1d1245799efe498d | 7dcf1f3fa9caa5101b4db833e83de53d | Get the Plugin ID of the plugin using the launcher. | public function getPluginId(); | 1 |
80134e0215ffaf5eba7d95ac5afc06a5 | 8a9678fbc20e21dbe77809df1169936d | レーダーチャートのメンバー回答集計を出す | class WEI_2300 extends Base
public function getLeaderTarget()
{
set_time_limit(30);
$date = $this->jlamp_comm->xssInput('date', 'post');
$dateItem = $this->jlamp_comm->xssInput('dateItem', 'post');
$leaderId = $this->jlamp_comm->xssInput('leaderId', 'post');
$leaderNm = $this... | 0 |
2801c08cacbf1cdb37b2d0a1ce51fe64 | 0d8070016cbfa101e4f080f00ed91fa9 | Méthode isValidConfig, qui vérifie si l'instruction est correctement écrite | if (instructions.size() == 5) {
if (instructions[0] != "L" && instructions[0] != "U" && instructions[0] != "R")
return false;
if (!isNumber(instructions[2]) || !isNumber(instructions[3]) || !isNumber(instructions[4])) {
return false;
}
} else if (instructions.si... | 1 |
4ee6e246cc6d5c6c43bee81ab043d226 | 22eab981e6ce91842c4af7b1380e7eba | calculate offsets assuming that the cameras are looking at some distant object | public class CameraManager : MonoBehaviour
void Start()
{
offset = transform.position - objectToFollow.transform.position;
} | 0 |
a6c52929e7c365a0dbeb79f55eb15a4b | dc2b58ac90c34293e4fd8b3fa821e584 | Used to update the points of interest selections for the user as the "Process Step" selection changes | class NameForm extends React.Component
handleChange(event) {
if (event.target.getAttribute('data-section') === 'rating') {
if (event.target.value === 'Energy') {
this.setState({building: [
'Office',
'Hotel',
'Shopping centre',
'Data centre',
]});
}... | 0 |
caf08f9380d57f9cbfed6290bb5887a2 | c5a96b4255983db5950ae1c16f967003 | Occurs when the value of the <see cref="Height"/> dependency property changes. | namespace Polaris.Windows.Controls
public class AnimatedExpander : ContentControl
private static void OnCollapsedHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((AnimatedExpander)d).OnCollapsedHeightChanged(e);
} | 0 |
23dfe8aa56313e2c15f30c803a05c0b9 | 428a2edbcd76c18f94b405f281d0ba3c | Appends a character to the end of the current secure string. | namespace OwinFramework.Pages.Core.Interfaces.Collections
IStringBuilder Append(char text); | 0 |
a476cb399f9893c4ce6a890b1a9f7b3d | f52b17814b815bc5b202de120c6edbc7 | Update the joystick enabled variable, checking whether the status is being changed | class Guitar:
# self.controller = xinput.XInputJoystick(0)
# self.curState = self.controller.get_state()
# self.prevState = self.curState
# self.whammyDown = self.GetWhammy() > WHAMMY_EDGE
# self.prevWhammyDown = self.whammyDown
# self.thrown = self.GetOrientation() > THROW_EDGE
# self.prevThrown = self.thrown
... | 0 |
6991243eefb059d524ef1747178e3382 | feba23678194aec052df25f2e4fb1c94 | 채널별 VOC 추이 | {
int start=0,end=0;
while( VolArr[start+2] - VolArr[start] > 0 && start < 51 )
start++;
while( VolArr[start+2] - VolArr[start] < Threshold && start < 51 )
start++;
end=start+10;
while( VolArr[end+2] - VolArr[end] > 0 && end < 62 )
end++;
while( VolArr[end+2] - VolArr[end... | 0 |
4985368d73845e9f53e0c17fcfe63b7c | 5c813b547ef35e51089f03d46f8ee00e | View for RolePermissions | {
$rolepermissions = DB::table('permission_role')
->join('permissions', 'permissions.id', '=', 'permission_role.permission_id')
->join('roles', 'roles.id', '=', 'permission_role.role_id')
->select('permission_role.*', 'permissions.name', 'roles.rolename')
... | 1 |
fb029ea4a888d2f7ab7faa09654ad886 | acc311dc159bd30df1a7d6c8cf628bdc | Asserts that valid data passes successfully. | def test_valid_dict() -> None:
_dict(schema=schema, data=data, case_func=is_camel_case) | 1 |
29f608636d63d536bcc404c9a73ebff8 | 8dc69968ef1dc32e97193d89a1adb996 | Clean distance input | def clean_dist(A):
B = {}
for (x, y) in A.items():
if y>2**(-300):
B[x] = y
return B | 1 |
2f0333bb5eb39e1c434ac0813cdfc6a6 | 724ed622257feb7bafb7852f19f8b743 | 获取路径地址的最后一位 | public class ReadExcel_Bcard
public static String getPostfix(String path) {
if (path == null || "".equals(path.trim())) {
return ReadExcel_Bcard.EMPTY;
}
if (path.contains(ReadExcel_Bcard.POINT)) {
return path.substring(path.lastIndexOf(ReadExcel_Bcard.POINT) + 1, path.length());
}
return ReadExcel_Bcar... | 0 |
62105160b1b57c1f69265a608b61c554 | d1408ab1b5c4cb4456c7991971800ca4 | This is used to switch from the main screen to the help screen with animation. | public class PauseMenu : MonoBehaviour
public void SwitchMenu_MainHelp()
{
StartCoroutine(SetTimeScale(1, 0));
if (mainMenuCanvas.GetComponent<GraphicRaycaster>().enabled)
fader.CrossFadeObjects(mainMenuCanvas, helpMenuCanvas);
else if (helpMenuCanvas.GetComponent<GraphicRaycaste... | 1 |
95d095d04a18640fa8ebf954c755d4d4 | d3edd4a8c0503281808682afec162dbd | Return the array of parameters for dislike.
If there is no parameter required this should return empty array. | class CommentDueDateChange extends Base
public function getActionRequiredParameters()
{
return array(
'subject' => t('Email subject'),
);
} | 0 |
eb6aea2c36bdcc0fb574e2e4143eed7e | 7721ce11c3058d8705ddddb2e92b034a | 得到完整的报表设计文件的名字,包括路径和文件名 | reportFileName=self.getFileReport() + '/' + ExcelConfig.REPORTPATHFILE
reportFileName = reportFileName.replace('\\','/')
return reportFileName | 1 |
912eb015b84e1e5dfc3e1e05234723df | c37145d89ffa60543063430d2990e4f8 | Creates a call to a generate method | {
$call = $this->compositeCallFactory->__invoke();
$call->setBefores($this->befores[$action]);
$call->setAfters($this->afters[$action]);
$this->generatedComposites[$action] = $call;
return $call;
} | 0 |
452de04952ff220aeee91b156a237c07 | c79374e058c41f4e2c23afb79a089725 | Set the case insensitive for field: CustomerDocumentUrl | @XmlRootElement(namespace ="http://bp.comverse.com/data")
@XmlAccessorType (XmlAccessType.PROPERTY)
public class CustomerDtUrlObjectData extends BaseObjectData implements Serializable
public void unsetCustomerDocumentUrl ()
{
this._CustomerDocumentUrlSet = false;
} | 0 |
7a79d99fb816435c3741df90e0e9c865 | 06785b1b84e26f9a14a117e087fcaa55 | 跳转到添加库存盘点页面 | goToAdd(){
let that = this;
let { operate, selectStorehouse } = that.data;
wx.navigateTo({
url: `/packageWarehouse/pages/addCheck/addCheck?operate=${operate}&id=${selectStorehouse.id}`
});
} | 1 |
e4bf41bbdfc16883b5aa0384904e2059 | fd5ad66e9860d2716322f3b1e1b270ec | return all primes less than N by Sieve of Eratosthenes algorithm | {
int [] sieve = new int [N + 1];
for (int i = 2; i <= Math.sqrt(N); i++)
{
if (sieve[i] == 0)
{
for (int j = i * i; j <= N; j += i)
if (sieve[j] == 0) sieve[j] = i;
}
}
return sieve;
} | 0 |
9c40fb654239ef1f928c79f5a8b41153 | 72b21b10a891e200d31c4fa7d2415fcf | Sets the file used for user modifications pre-loading. | public class DeNovoSequencingHandler
public static String getUserModificationFile() {
return USER_MODIFICATIONS_FILE;
} | 0 |
22daa15ec4fe085f6933b3bac7eb1913 | 19e20d81a6171d9ea3947eb8d0a617f8 | Shared SQLite database backend node history implementation | class FakeDatabaseHandler(DatabaseHandler):
def __init__(self):
self.hist = [] | 0 |
e0bf3336cc488caab2d87f317e40ee7b | f5e81659008665bcbf899f5a6c1cd120 | True iff this plugin will allow adding a certain user to a certain group. | abstract class FilterPluginBase extends HandlerBase implements CacheableDependencyInterface
public function canGroup() {
return TRUE;
} | 0 |
706b77ac8a42cd45390ec202c08cbfee | a73311032ced92661845b61ba80bc760 | The maximum difference between one entry and the following one in timestamp_field. | if (!is_array($value) || count($value) != 2) {
throw new MigrateException('Source value must be an array of two values');
}
foreach ($value as &$item) {
if (!is_numeric($item)) {
$item = strtotime($item);
}
}
asort($value);
return (end($value) - reset($value)) / 60;
} | 0 |
9fee9f782f775adb63aec27023b6d24b | 48f6d0064d332da6812301770984b369 | Define the event handler to handle the AJAX GET request | protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(request, response);
} catch (ClassNotFoundException ex) {
Logger.getLogger(AjaxServlet.class.getName()).log(Level.SEVERE, nul... | 1 |
784308619e92210350a27ac7d53ff7a0 | 04e6b9f573111b940d91566d266a748b | Test insertion of a disc in a full column is rejected. | class AddPieceTest(unittest.TestCase):
def test_full_column(self):
self.assertEqual((None, None), self.model.add_piece(4)) | 1 |
6b34f8add331c628d98b636b903d82b4 | 87bff4c65811eba39020d1063cb6f1c3 | Возвращает модель юридического адреса компании | class Company extends \AppBundle\Entity\Company implements \Doctrine\ORM\Proxy\Proxy
public function getAddress()
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'getAddress', []);
return parent::getAddress();
} | 1 |
9561ca3eb51986923a2131a9f2c58e83 | be06ad0222cb1a601987399a7365b555 | 根据机构id查询问卷 | PageData pd = this.getPageData();
pd.put("org_lev", "3");
return (List<PageData>) dao.findForList("QuestionInfoMapper.getOrgListByOrgLev", pd);
} | 0 |
532d335322e727de0a59ef29e2548653 | 257832bafb2f09a9d5c78197c1bad1b9 | 앨범 좋아요 생성/취소 | {
if (album.value == null)
{
onFinish.invoke(null)
} else
{
super.addOrRemoveAlbumFavorites(album.value!!, onFinish)
}
} | 1 |
59ee4c5120405e5441d04f4e82db8074 | c17690d8f5f36140ca7d27400ed26952 | LD HL,d16 | namespace LeBoyLib
public partial class GBZ80
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void LD_DE_d16()
{
E = Memory[PC];
D = Memory[PC + 1];
PC += 2;
m = 3; t = 12;
} | 0 |
e643b571f709dee2cd6dc9c29e033431 | 4e174b1b3fc9a5b7d00b48a23e82e28a | Invokes the platform functionality to update the media playback speed. | @OptIn(ExperimentalTime::class)
@ExperimentalAudiobook
interface MediaNavigator : Navigator
fun setPlaybackRate(rate: Double) | 1 |
6a6c5722b135f4981a23cb0e66739503 | 2eec0a4acdee166fba875be58da4df4f | 获取视频弹幕列表 | interface IVideoMollBiz
fun getVideoList(@NotNull subscriber: NetSubscriber<MutableList<VideoMol>>): Disposable | 0 |
ac4fef6b8465dfb937f60a54c396d1dd | b7219c1b8f4f0ea4a61eb509ead3ae69 | Returns protocol version used by this connection or {@code null} if unknown. | String getProtocolVersion(); | 1 |
52c15ec2f9e10426e0a2250abec17a1d | f5bdd8ccdd991140114cb8c10fca9042 | 帳票再出力ボタン押下処理 | {
if (DGVRequestSelect.RowCount < 1)
{
MessageBox.Show("納品書出力対象データが表示されていません。", "エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
else
{
if (DGVRequestSelect["req_no", 0].Value.ToString() == "... | 1 |
fd5a27847cd0aec86511e80e68aa1e9b | bf6c35c610f9689fea8388c9c5973b7f | 获得支撑三角形的中心 | namespace AuxStructureLib
public class Triangle
public void CalCenter(Triangle triangle, out double x, out double y)
{
double x1 = triangle.point1.X;
double y1 = triangle.point1.Y;
double x2 = triangle.point2.X;
double y2 = triangle.point2.Y;
doubl... | 1 |
323483facd004ee2517a4414a8a62fee | fb61e496900e6fa09affdee14603e6cc | POST /insurers : Create a new insurer. | [ActionName("Edit")]
public async Task<IHttpActionResult> Edit([FromBody] InsurerModel model)
{
if (model.LogoId == null)
{
ModelState.AddModelError("logoId", "Logo is required");
}
if (!ModelState.IsValid)
{
... | 0 |
e93a6bc16bf5f8c7c214ed11f699d6ca | c087ca579b136a81966d13ba9e561c7d | dequeue packets from crypto-queues and finalize processing. | static __oryx_always_inline__
void ncapd_process_packets (uint32_t port,
struct rte_mbuf *pkts[], uint16_t nr_pkts)
{
uint16_t i;
vlib_main_t *vm = vlib_main;
uint8_t c = port % vm->nr_ports;
for (i = 0; i < nr_pkts; i++) {
ncapd_enqueue_rx_packet (c, pkts[i]);
vm->rx[port].rxb += rte_pktmbuf_data_len(pkts[i]... | 0 |
871de549735a88834fa5a532fdec1286 | f2d39f1ad992a755bc8085bb14fe21a6 | from https://github.com/Lasagne/Lasagne/issues/468 | layer = copy.deepcopy(layer)
try:
layer.weight = torch.nn.Parameter(g(layer.weight))
except AttributeError:
pass
try:
layer.bias = torch.nn.Parameter(g(layer.bias))
except AttributeError:
pass
return layer | 1 |
dc6032204afc9745d24c8661e81fe321 | a9ed70baae01b80d8da705b2b247364b | This function generates a png file from a given dot. A dot can be generated wit *toDot functions | void Pda::createDot() {
std::ofstream file ("PDA.dot");
std::string start = this->getStart()->getName();
std::string s = "digraph {\nrankdir=LR \n";
std::string e = "invis -> "+ start + " \n";
s+= "invis [style=invisible] \n";
std::vector<Tjen::Node*> ends = this->getEndNodes();
for (Tjen::N... | 1 |
bcc70dca0482a39352c62d7fec0dec1b | e20649cf78062892ecd504df866f3899 | Reset image to the image originally uploaded to the image control | namespace MettleSystems.dashCommerce.Web.admin.controls.product public partial class images : AdminControl
private void Reset() {
txtImageFile.Text = string.Empty;
txtImageCaption.Text = string.Empty;
} | 0 |
5d9606294865b17be436444e52550f05 | 07689755660885a58cef05108cd415cb | 特約店コードを設定する。
特約店コード | public class JuchuJuchuAddOnlyDtRecord extends KitRecord
public void setShohinCd(String shohinCd) {
put("SHOHIN_CD", shohinCd);
} | 0 |
1476064da2614c5cc7fc3dc59e6cb4df | 56275fba661572955b0f0ef81440825d | 删除学生
批量删除时不同的学生通过 "-" 连接 | @ResponseBody
public Msg deletePerson(@PathVariable("ids")String ids){
if(ids.contains("-")) {
String[] str_ids = ids.split("-");
for(String str_id : str_ids) {
Integer id = Integer.parseInt(str_id);
personService.deleteUser(id);
}
}else {
Integer... | 1 |
e40719b8e1c6ffddde7dfa1eed46d227 | 977a0738e3f1ca30e4eace2f50407151 | return software name in the correct case | class SoftwareClassification:
def get_software_name_correct_case(self, software_name):
if software_name.lower() in self.software_name_lower_dict:
return self.software_name_lower_dict[software_name.lower()]
return software_name | 1 |
6853a7c49a6cb4e5698d3202c9a9282d | c61f657e3a868d9c5ac2bd5ca1f4211c | 判断输入信息是否正确
1.是否全部有输入
2.店铺电话格式是否正确
3.类目是否有选择 | hideRefError();
if (!isRightCity()) {
return false;
}
if (!isRightRealName()) {
return false;
}
if (!isRightLoanMoney()) {
return false;
}
if (!isRightProvice()) {
... | 0 |
8e81aecd59d7f5002b851831acd19eda | 8623b81db4413f06625f4590f5ef54ad | Inserts a new reservation into the database
Contains the user's site choice, a name for the reservation, arrival date, and departure date | {
using (IDbConnection conn = new SQLiteConnection(LoadConnectionString()))
{
conn.Execute("INSERT INTO Reservations (FirstName, LastName, StartDate, EndDate, TableId) VALUES(@FirstName, @LastName, @StartDate, @EndDate, @TableId)", reservation);
};
} | 1 |
def24f24c20c834fd1a4b515992a3477 | 33c2b9f8f2683c110fc5eb038ce6efa9 | 選択肢5の投票数を取得 | int select点字により投票者数(TohyojokyoMapperParameter 点字により投票者検索条件); | 0 |
2c507a276202ba68a43672c2cc886691 | 24a09c07113eda92d33eeb6f6396dce2 | If image is GIF or PNG keep transparent colors | {
$size = $image->getSize();
$alwaysAlpha = true;
$alwaysOneColor = true;
$colorValue = null;
for ($x = 1; $x < $size->getWidth(); $x++) {
for ($y = 1; $y < $size->getHeight(); $y++) {
$color = $image->getColorAt(new Point($x, $y));
... | 0 |
2b236859228c2848efc4e3681e07ee48 | f0ea1c1f0e61da04971a76f5943c3319 | getLanguage : receives lang code from front and returns associated language keys and text | $lang = self::ValidateLanguage($lang);
if ($lang == 'ar') {
require __DIR__ .'/ar.php';
}
elseif ($lang == 'cs') {
require __DIR__ .'/cs.php';
}
elseif ($lang == 'da') {
require __DIR__ .'/da.php';
}
elseif ($lang == 'de') {
require __DIR__ .'/de.php';
}
e... | 1 |
a0ce201ad07af1cff88c2fd831fccc1a | 7cf087be12236cd0700678bf3a83bb52 | 使用cmd打开文件和文件夹 | {
Process p = new Process();
#if UNITY_EDITOR_WIN
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c start " + path.ToString();
#elif UNITY_EDITOR_OSX
var str = path.ToString();
int lastIndex = str.LastIndexOf("/");
var shellPath = str.Substring(0, lastIndex) + "/Shell/";
p.StartInfo.FileN... | 1 |
cc6fe3fbd70ac6d9ec699018274b1988 | cbdaba50ffab00be6ba534b2c6144ee2 | 随机森林可视化及特征重要性 | def train_random_forest_regression(train_sample, train_label, test_sample, test_label):
trees = 10
n_features = train_sample.shape[1]
max_depth = 20
random_forest = RandomForestRegressor(n_estimators=1500, verbose=2, random_state=42, n_jobs=6)
random_forest.fit(train_sample, train_label)
... | 1 |
19f7da6d32054c5fbae5fa5e3e056a00 | 87f89bdd2057431c40ec3e23b7bca967 | 获取用户月订单额 | namespace MLMGC.IDAL.Enterprise.Plan
DataTable UserMonth(E_UserPlan data); | 1 |
6e949df66a0281b767e831eca4084972 | 31a93e794bf738311b90ac6ce5888485 | Прием файла. | {
$files = $this->_request->getFiles()->getAsArray();
if (!isset($files['file']) || !isset($files['file'][0])) {
$this->_setError(PLUPLOAD_INPUT_ERR);
return false;
}
$file = $files['file'][0];
if ($file->tmpName && is_uploaded_file($file->tmpName)) {
... | 1 |
7805a3187fedf0938f55e6a9aaf0b73d | 459507c897754b76b93ba6f3b021f366 | Execute 'set_index' operation on DataFrame. | data: tsdb.ColumnMap) -> None:
if not isinstance(index, int):
raise TypeError(type(index).__name__)
values = list(self[index])
for key, value in data.items():
field_index = self._field_index[key]
values[field_index] = value
self[index] =... | 0 |
2c6dadfae0b5b8d2932b0146e0872ab8 | 67008c9168a37a80aa8775621e7d300f | 获取堆栈中需首个需要显示遮罩 | {
curNeedMaskUI = null;
for (int i = m_list.Count - 1; i >= 0; i--)
{
var ui = m_list[i];
if (ui.maskType != UIMaskType.None)
{
curNeedMaskUI = ui;
break;
}
}
... | 1 |
921874c6ae950a952486c669dc3398a8 | 2613a8ee99c4d7fd3a64448dfe06ccd0 | NULL检查机制
Kotlin的空安全设计对于声明可为空的参数,在使用时要进行空判断处理,有两种处理方式,
字段后加!!像Java一样抛出空异常,
另一种字段后加?可不做处理返回值为 null或配合?:做空判断处理 | fun foo(s: String?) {
val t: String = s ?: ""
} | 1 |
eae7a24acdb0d59cb975cf70fea2a37a | a2253a90df5faf856b28a9ba92d723ae | Measures distance between 2 columns: Euclidean distance | class HashedWordMatrix:
def dist_cols_euclidean(self, col0, col1):
collector = 0
for key in self.get_tokens():
collector += (self.get(col0, col0, key) - self.get(col1, col1, key)) ** 2
collector += (self.get(col0, key, col0) - self.get(col1, key, col1)) ** 2
return collec... | 1 |
1eaf0917fa201d157df4ab0f962053fa | 956de3112163f0d3cfb9103bf4e0c5fb | Elimina saltos de linea en las hileras de prueba | class Examplify
private function _cleanup()
{
while (strpos($this->text, "\n\n\n") !== false)
{
$this->text = str_replace("\n\n\n", "\n\n", $this->text);
}
} | 0 |
1789a117926554bea8175e3d86aa2fb4 | a2092aa0712b981f338e4d060100cd82 | Returns a list of the IDs of all conversation recipients. | recipients = set([])
for r in recipient_id:
recipients.add(r)
for r in recipients:
yield contributor_name, r | 0 |
6f17d92c9b7c1d91b170bd0ca1662d55 | 11e2f2ccab52eee602a4a56fa87ace61 | Translate a position in another <see cref="ITextImageVersion"/> to this <see cref="ITextImageVersion"/>. | void CPVRImage::copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect)
{
} | 0 |
885beee4384cebf65272fd751d15d01e | daac632aba393c6de7e31849b7acafa1 | Called by a state/node that would like to know what the most recent
stop the user inquired about was. | class ThreadedLookup implements IFlowchange
@Override
public String getLastJump() {
return lastJump;
} | 1 |
b428f0876dc18d4997de76f31dfe46e8 | 35628646273de8b511220b47a78d7b28 | Muestra el formulario para actualizar información de un Pais | class PaisController extends Controller
public function show($id)
{
return view('pais_show');
} | 0 |
c207cf0b9f8799ab887c450e2864a014 | 711b23b6b91abd5e6dafd1dc3a6bd09a | Outputs a closing html </fieldset> tag | class FORM_RENDERER extends CONTROLS_RENDERER
public function finish ()
{
echo "</div>\n";
} | 0 |
0d15071d3d38dae729c8db971f129633 | 664853583face5560df2d76fdd26342e | Handler for the "Undo All Zoom/Pan" context menu item. Restores the scale ranges to the values
before all zoom and pan operations | {
UpdateZoomMenu();
_currentUndoHandler = null;
CheckAnimationEditTrack.Checked = false;
CheckAnimationEditTrack.Checked = false;
ItemZoomToWindow.Checked = true;
} | 0 |
106e4a9717fb6a3010ecdd0a7bed1406 | 26e5b17c9abd3eae94a7fffd312dbaa8 | Initializes internal state of \Base\CatentclsQuery object. | class MySQLQuery extends Root
public function __construct()
{
parent::__construct();
$this->action = false;
$this->table = false;
$this->columns = false;
$this->where = false;
} | 0 |
efcb3b14ae5019fcb9341d6cc4453a16 | 330f7cb911e8f1abfcf4d204e7bed37c | TripleDESで暗号化されたファイルを読み込んで、復号化してから返す | fun tripleDesDecrypt(data: String, key: String): String {
return String(tripleDesDecrypt(Base64.decode(data, Base64.DEFAULT), key.toByteArray()))
} | 1 |
5d1a9fb7ba7894a16173d4e431dc6d9b | fdeb255979ec90e8dd703a4d090804f1 | Create a new verification broker instance. | {
$this->middleware(['web', 'auth']);
$throttle = config('mobile_verifier.throttle', 10);
$this->middleware("throttle:$throttle,1")->only('verify', 'resend');
$this->tokenBroker = $tokenBroker;
} | 0 |
df3f7bdd1b848450af7a526660fbb81e | 8f454c85b86d27150fe48a12e175d3ff | ElementCode に展開できるものなら展開する | function decodeCodeFragment(
node: schema.CodeFragment
): schema.CodeFragment | schema.CodeExpression {
const { isExecutable, programmingLanguage, meta } = checkIfExecutable(node)
return isExecutable
? schema.codeExpression({ ...node, programmingLanguage, meta })
: node
} | 0 |
02ac5eaebb0037e78d90938026d6abeb | a368d8e8cabd076e836c1790191c4ba7 | 尝试从棋子集合中根据指定的棋盘位置获取棋子 | AChessBoardPiece* AChessBoardBuilder::GetChessBoardPieceAtCoords(FIntPoint SearchPoint)
{
AChessBoardPiece** SearchedChessBoardPiece = ChessBoardDict.Find(SearchPoint);
if (SearchedChessBoardPiece)
{
return *SearchedChessBoardPiece;
}
return nullptr;
} | 1 |
56115807a3f41880d4f722c39b6a278c | 6c60b3c28ba1e4084675a196378cfb4a | 测试自定义Realm,验证时使用md5加密 | public void testSaltMatcher() {
DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager();
CustomRealmCh08 customRealmCh08 = new CustomRealmCh08();
HashedCredentialsMatcher matcher = new HashedCredentialsMatcher();
matcher.setHashAlgorithmName("md5");
matche... | 1 |
7f6fd3741109d21bb17699886c27880a | 4bc0420894674c59acb6dacf9ab5ff18 | ******************* Gaussian curvature function *************** | def Gaussian_curvature():
return sym.simplify(Riemann_tensor_down(0, 1, 1, 0)/detg) | 1 |
95f483b6fe85c65a0e0060a73c311381 | 1aa6c1335293eef871e26884cb600a91 | returns the reaction id of a model reaction object (i.e. rxn34565_c0) | res = StoichiometricModel.print_reaction(self, r_id, reaction_names, metabolite_names)
lb, ub = self.bounds[r_id]
rev = self.reactions[r_id].reversible
if lb != None and (rev or lb != 0.0) or ub != None:
res += ' [{}, {}]'.format(lb if lb != None else '',
... | 0 |
fe1614d248d0ba90404c45f71bd7f5a5 | 08addf8cef13d4cd2cdca6307d495a4f | function that initializes an array to a sequence of random doubles. | {
int i;
float d;
for(i = 0; i < n; i++) {
d = (float) rand() / ((float) RAND_MAX + 1);
random[i] = d;
}
} | 1 |
27d55a39f57b64729e9fa6a21909968f | d0ed072c0ea73ee9b565802e84aff3b3 | This method is used to trigger continuous touch events on the client. | while self.socket is not None:
yield from self.send("2::")
yield from self.send(
'5::%s:{"name":"touch","args":["page"]}' % self.group_space)
yield from asyncio.sleep(5) | 1 |
f87e4a826e0294789393deb62318b9d6 | 03923c7d5643f063dd61b492265d137a | 获取根据指定“拍品状态”在给定时间范围内的拍品。 | public List<Buy> getAllByBuystate(String buystate); | 0 |
76aadb017e051bd4503d15696b5e9f2e | 562e3d99d1e0d727562d1b45790bd258 | Returns timezone information to the invoker as JSON. | class Event
def local_timezone_json
local_timezone_attributes.to_json
end | 1 |
a55bd695f27dce67d19a50b85520a2a0 | 335e39f51dfd9923b25ebc00de1fca72 | filters link list to original file only | async function removeFileLink(files) {
if (!Array.isArray(files)) {
files = [files]
}
for (let fileId of files) {
const file = await File.findById(fileId)
file.link = {}
file.markModified('link')
await file.save()
}
} | 0 |
00273fe54f300a04c34d78d053f9ade8 | fe0f41f08989029adcde5c22fa3204c7 | Before closing this SCO, save the last page's notes. | class ModuleBook(RAMSTKBook): # pylint: disable=R0904
def _on_close(self):
_n_pages = self.notebook.get_n_pages()
for _page in xrange(_n_pages - 1):
self.notebook.remove_page(-1)
_model = self._dic_module_views['revision'].treeview.get_model()
_model.clear()
return N... | 0 |
276c78d2bf3c330f23ea16b2f156a5f9 | 18de78ea8949a1ce391ba88d3cf39bf5 | u"""
Mark the quiz as scored. | class QuizProgress(TimeStampedModel):
def mark_as_reviewed(self):
if not self.is_reviewed:
self.is_reviewed = True
self.save()
return self | 0 |
097309b6fbdd1d7f8c578faa7a4fdf6b | 93d020bca8b63e21c40e5586f1f5c9a1 | 电话咨询提交订单 | class Logic extends Controller
public function submitOrder($phone,$nickName,$shopID,$orderType)
{
$orderPrice = Session::get('orderPrice');
if(Session::has("productStr"))
{
$user = User::get(["phone"=>$phone]);
if(count($user) != 0)
{
$user->save(
['nickName'=>$nickName],
['phone'=>$phone]... | 1 |
39442d1f0b37510ed34fe57c5fcf91de | c60fcdca747a28b005afd1ac49f66a89 | Update a row in PARAMETER table | param = value = None
if self.tblParamsPD.item(row, 0):
param = self.tblParamsPD.item(row, 0).data(0)
if self.tblParamsPD.item(row, 1):
value = self.tblParamsPD.item(row, 1).data(0)
self.pd_parameter_dict[row] = (param, value)
self.model['pd_parameters'] = ... | 0 |
fe24236e956c3cf6dae4bd0a8c0a5245 | f67d621adad73562afd14563ea05cd1a | Restore the previously active Event handlers. | class DeltaEvent(DeltaObject):
def reset(self):
self._handlers = [] | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.