query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
228509879beebcd98b476014ec9f050e | 97b3f1ad1c03a2868243ac90d962608b | 根据用户id获取点赞博客 | public List getByUserId(Map map) {
List<com.gaoyuan.model.Blog> list = BlogDao.getBlog(map);
int resultNumber = list.size();
list.toArray();
System.out.println(list.get(1)+"==============");
for (int i=0;i<resultNumber;i++){
HashMap map1 = new ... | 0 |
fa869f526384db0bcf85177e1a2e1d16 | ce119c713e08a2f115e70eb05cfb0a24 | 判断某一只股票是否低估 | maxupordown = w.wss(stock_code, "maxupordown", "tradeDate=" + date).Data[0][0]
open_price = w.wsd(stock_code, 'open', date, date, "Fill=Previous").Data[0][0]
close_price = w.wsd(stock_code, 'close', date, date, "Fill=Previous").Data[0][0]
low_price = w.wsd(stock_code, 'low', date, date, "Fill=Previous")... | 0 |
e1e304a581d76431cacc396aa600d8b2 | 55ac0a51fcfce4fbaa120654085e0d5a | Link encryption status. | {
if (result == ble::link_encryption_t::ENCRYPTED) {
printf("Link ENCRYPTED\r\n");
} else if (result == ble::link_encryption_t::ENCRYPTED_WITH_MITM) {
printf("Link ENCRYPTED_WITH_MITM\r\n");
} else if (result == ble::link_encryption_t::NOT_ENCRYPTED) {
pri... | 1 |
2ee4b78a329348b9b265e53226b975da | 7f61448ad6da3ef0f9cb03f40c5be655 | https://gist.github.com/mattheyan/46a230da86a0894a5ff654b9139ec5f2 | cases like (1) | 0 |
5fcbf54f69d1f2d7854abe9b3d4af977 | fbdb5c97846ec6967eda7ee379ae75a1 | Sert à créer une date de création automatiquement avant la mise en BDD | class Article
public function __construct(){
if( $this->getDateAjout() == "" )
$this->dateAjout = new \DateTime();
$this->dateEdit = new \DateTime();
} | 1 |
0cdc14ecd8f11a63607e17c804a27556 | 10febfc87630bc12e2e789b7769fd531 | 新增&编辑组织&微信关系 | @RequestMapping("saveOrUpdate")
public Map<String, Object> saveOrUpdate (Organization org){
Map<String, Object> map = new HashMap<>();
if(org == null){
map.put("status", false);
return map;
}
if(org.getId() == null){
org.setIsHide((byte) 1);
User u = CommonUtils.getSessionUser();
... | 0 |
7cc81897a6819675ec79ad3b43f3bf0f | 82db523dcb8e311aa1558d1416273f7c | # Create chunks; randomly sort master IDs into n(chunks) distinct groups | m<-floor(n/K)
r<-n-m*K
I<-sample(n,n)
Ind<-list()
length(Ind)<-K
for (k in 1:K) {
if (k <= r) kpart <- ((m+1)*(k-1)+1):((m+1)*k)
else kpart<-((m+1)*r+m*(k-r-1)+1):((m+1)*r+m*(k-r))
Ind[[k]] <- I[kpart]
}
Ind
} | 1 |
9460f938cce3aa7d48849c3e16ea578e | ea4c57a7a80e664d1d6c602ffac9957a | 根据父id添加菜单 | @Controller
public class MenuHandler
@ResponseBody
@RequestMapping("/menu/add/child")
public ResultEntity<?> addChild(Menu menu) {
menuService.addChild(menu);
return ResultEntity.successWithoutData();
} | 1 |
98579d3a456cca835e01d546b523a6c5 | 927783a3b64f52e9f546d29e711bbcae | All named parameters will create properties on this object. | class ParameterSet:
def __init__(self, **kwds):
self.__dict__.update(kwds) | 1 |
eea0932743644ddb4f317d39ca8f1deb | 266357a8d75d461058e64187a546cc29 | Tests the data in the table with the data set. | {
$expectedTable = $this->getDataSet()->getTable('product');
$actualTable = $this->getConnection()->createQueryTable('product', 'select * from product');
static::assertTablesEqual($expectedTable, $actualTable);
} | 1 |
6911d08eb90745beb02e3a4cd62d313d | e19d32a40f22f25f51261c8c6c5d9ccd | test that one can write a point | class PointTests(APITestCase):
def test_create_point(self):
url = reverse('point-list')
data = {
"data": {
"type": "Point",
"coordinates": [50, 0]
}
}
response = self.client.post(url, data, format='json')
self.assertEqual(re... | 1 |
e3af8d5604aacc563352dee231741da1 | 9b3d503beb4a5842ae4848da415b8190 | 请求前验证 | requestBefore(options){
options.header = {
token: 'token'
}
return options
} | 0 |
e3658f2c37ad7c7572623047faf2f339 | f47ca9e69904cd14a558495a1c76eb4c | 功能说明:
将串口初始化并以非阻塞形式打开 | {
serial_fd = open ( __file, O_RDWR | O_NOCTTY | O_NDELAY );
if ( serial_fd < 0 )
{
printf ("open Com: %s fail !\n",__file);
return -1;
}
struct termios options;
tcgetattr ( serial_fd, &options );
options.c_cflag |= ( CLOCAL | CREAD );
options.c_cflag &= ~CSIZE;
opti... | 1 |
88b1a16c0ad151d1447f8189d954dacd | 39f3ca15ab12e32b68765b0ad7299376 | |cvtStringToIcon|. It converts data in XPM format into an XPM image and
prints error messages in case of failure. | void setup_icon()
{
int n;
Arg args[2];
icon_pixmap = XCreateBitmapFromData(display,DefaultRootWindow(display),
icon_data,64,64);
n = 0;
XtSetArg(args[n], XtNiconPixmap, icon_pixmap); n++;
XtSetValues(toplevel, args, n);
} | 0 |
31ed41eea82f63d62cc463880b799481 | b5b29a60d12680fb6ec8d9814ef0b602 | 是否是"三同花顺" | bool MethordHuClass::Check3S3TS_HU(std::vector<CMjCardPile> &p_hand, std::list<CMjCardPile >& p_desk)
{
vector<char> v_card_shun;
for (std::list<CMjCardPile >::iterator it = p_desk.begin(); it != p_desk.end(); it++){
if (it->GetPileType() == SPECIAL_TYPE_SHUN){
v_card_shun.push_back(it->GetPileFirstCard());
}
... | 0 |
b6421abf25551d049564ecb7ebe536c2 | 348a0f7d11eb1f5f3d9a158f9b2abe6c | Handles the Click event of the AddColumn control. | int retValue = base.Add (column);
columnList.Add(column.ColumnID, column);
ContextMenu.MenuItems.Add(column.ColumnMenuItem);
column.VisibleChanged += new EventHandler(ColumnVisibleChanged);
return retValue;
} | 0 |
686c4128cd7836598f8f6ec40620d90f | 6f8fb496feb8460a3622d13c2d6f6fce | provoque la génération des factures pour les containers embarqués à partir des informations de mouvements
paramètres : identifiant bateau ou train + liste des identifiants des containers effectivement embarqués | public java.util.Collection createOrderWithContainers( net.metaship.intermodal.transport.ejb.OrderValue orderValue,net.metaship.intermodal.transport.ContainerInfo[] containerInfos ) throws net.metaship.generic.LocalException; | 0 |
ad674848c10e69bc2a04232bb01b3912 | 0adece72851b6f8c648ee9e1bae487a7 | 获取班内所有学生以及学生的成绩 | public List<Student> getClassScore(String className); | 1 |
d4cc286721c9bb9644623724024bafce | 1ac2aef721e595c03b5cb19ce656a24e | method to fetch and display professional members ID in order to know it | try {
stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("Select userID FROM NUTZER ORDER BY userID;");
String information = "";
while(rs.next()){
information += "#"+rs.getString("userID");
}
return information;
}catch (SQLException e) {
e.printStackTrace();
System.err.println(... | 1 |
06fefbffc7e4aa5063c0fdbfa62f5e09 | 965e68a82de215304fc5ed195299fbb1 | Set the active ViewpointData | namespace Howell5198
tFault SetViewPoint(Howell5198Session session, SetViewPointRequest setViewPointRequest); | 1 |
b05ff02132810d32f4c08201f0741e84 | 8195d4604411a8a1aaacabef88cd7193 | 更新课程及讲师信息 | @Service("teacherService")
@Transactional
public class TeacherServiceImpl implements TeacherService
@Override
public void updateTeacherInfo(TeacherVO teacherVO) {
teacherDao.updateTeacherInfo(teacherVO);
teacherDao.updateTeacherCourseInfo(teacherVO);
} | 1 |
2228cc16871ad69cbea1a2be6fbea104 | 52fa93de6afb3ce0c020f6cde3cc289b | Diese Methode gibt den Artikel oder die Startseite aus. | class WebsiteArticleController extends AbstractController
public function indexAction(
Request $request,
ArticleInterface $object,
string $view,
int $pageNumber = 1,
bool $preview = false,
bool $partial = false
): Response {
return $this->renderArticle($reques... | 1 |
b5e2bfc1ac99cb3444d6be1a8c871d30 | 50df7316a3fa255a5cf4b670b8b6d13b | GET: Curtidos | {
var dobradores = db.Dobradores.Include(a => a.Equipe).ToList();
return View(dobradores);
} | 0 |
55242ce925d730b06c53052415adcc67 | 17bebfa184c1b60c0da5ecbe09c3589e | # Substring tail starting from length - n characters | substr_r <- function(x, n){
substr(x, 1, nchar(x)-n)
} | 0 |
28babb12d9763ed686e6d569daa68169 | d6f8e6bddbcccc5b197b3ad95bd709c7 | Обновление кэша расписания для выбранной группы | namespace bsuir_chat_bot
public class BsuirProvider : VkBotProvider
private static string GetSchedule(string groupId)
{
using (var webClient = new WebClient())
{
webClient.QueryString.Add("studentGroup", groupId);
return webClient.DownloadString(Bsu... | 0 |
786b674f3c55663d4f378c6b954d8d68 | 75d42ebb92f4645da8b3345ca9ffef42 | Get the asset replacement of asset. | class JSimpleRule extends JModel
function getAsset()
{
return $this->_asset_id;
} | 0 |
2f582edb60f60c43aa4884422911eee7 | 6640b1efc2d93e8c6ba189f63e37e771 | Visit a bound IsNan predicate. | isNullPredicate.expression().accept(this);
_queryString.append(QueryConstants.SPACE);
_queryString.append(QueryConstants.IS);
if (!isNullPredicate.evaluateTo()) {
_queryString.append(QueryConstants.SPACE);
_queryString.append(QueryConstants.NOT);
}
... | 0 |
016df44f086885f2de751688a4d5058d | 9663cb51875fa2f55056124aa79dfd82 | 保存开发商信息 | class Develop extends MC_Controller
public function save_estate(){
$message='';
$this->load->model('stuffdevelopModel');
$rows=$this->stuffdevelopModel->update_develop_kfestate($this->input->post());
$status=$rows>0?1:0;
$data['jsondata']=array('status'=>$status,'message'=>$message,'rows'=>ar... | 0 |
6e1f131062ac5df3b12bc2c7fcc67cc2 | 0fa9abb5395bbafd882c7e98006f2a76 | Tests relatifs au TAD Couleur | class CouleurCarte(Enum):
def __eq__(self, other):
return self.value == other.value | 1 |
a79197492edcc7ae1672047d342e9285 | 74ca8bd76f340598bf82257083707a15 | Поиск активных платежных систем, с учетом сортировки
возвращает ассоциативный массив (тип плаежной системы является ключем) | $db = nc_Core::get_object()->db;
$catalogue = (int)$catalogue;
$query = "SELECT b.*
FROM `" . NC_PAYMENT_SYSTEM_CATALOGUE_TABLE . "` AS a
LEFT JOIN `" . NC_PAYMENT_SYSTEM_CLASSIFIER_TABLE . "` AS b
ON (a.`PaymentSystem_ID` = b.`Pay... | 0 |
2b5ca00c530105c69946db692d5157e0 | b7efa2c1f258feaa90a32e16843060cd | Verifies that a port is optional when constructing a URL. | def test_url_is_required():
client = Client(url=None) | 0 |
1c4d1d7174e23ff7c97f48f22856a4aa | c44d52a6c936f01f22db82a963b82779 | determines how many times the word shows up in the tweets | if ' ' in word:
raise ValueError('word cannot contain spaces')
lowercase_tokens = [token.lower() for token in nltk.word_tokenize(message.text)]
return lowercase_tokens.count(word.lower()) | 1 |
4bd91330e85bd6e976154b0f8807ec1f | 04f56d7de6ff6cb67f66aa2b56d10807 | Test automatic generation of UFO helas calls in Fortran | fortran_model = helas_call_writers.FortranUFOHelasCallWriter(\
self.mybasemodel)
result = fortran_model.get_matrix_element_calls(self.mymatrixelement)
solution = """CALL VXXXXX(P(0,1),ZERO,NHEL(1),-1*IC(1),W(1,1))
CALL VXXXXX(P(0,2),mdl_MW,NHEL(2),-1*IC(2),W(1,2))
CALL VXXXXX(P(0,3),... | 1 |
4f1852acf46429e224338eed327344f2 | dbccc542ee446859cfb8abb047b149b1 | Decides where to go after the splash activity | public class OnBoardingActivity extends AppIntro
@Override
public void onDonePressed(Fragment currentFragment) {
super.onDonePressed(currentFragment);
Intent intent = new Intent(OnBoardingActivity.this, SplashActivity.class);
startActivity(intent);
finish();
} | 0 |
eb9810eaff0cc9235986d81688175343 | 885b446b2c72fe1d04000d42fef79c56 | Lorsqu'un objet va être drag and drop,
on en crée un autre qui va prendre sa place
et celui qui est drag va devenir un objet temporaire. | function CreateDragContainer() {
var cDrag = DragDrops.length;
DragDrops[cDrag] = [];
for (var i = 0; i < arguments.length; i++) {
var cObj = arguments[i];
DragDrops[cDrag].push(cObj);
cObj.setAttribute('DropObj', cDrag);
for (var j = 0; j < cObj.childNodes.length; j++) {
if (cObj.childNodes[j].nodeName =... | 0 |
a54fa0b153b278e237e83586a4cd9e6d | 8217bf4e4edabd75169071b96a452bb5 | Convenience function to render an array of numbers as a JavaScript (JSON notation) array
(used for initialises jQuery UI array control properties).
Naturally for a numeric list the resulting array does _not_ have quotes. | namespace Fluqi.Extension public static partial class Misc_Extensions
public static string JsArray(this List<string> values, bool doubleQuotes) {
return values.ToArray().JsArray(doubleQuotes);
} | 0 |
cbcc94c35e57667c73812bd3ed0e4579 | c46165d0080697637c186f3b16abf57e | 募集 ID・情報を公開する相手を承認 | {
$this->error_trace(__FUNCTION__, 'start');
$mode = sec\Mode::RSA();
$data = $this->getDecryptedParam($data, $mode );
$con = $this->get('doctrine')->getConnection();
$acc = $this->loginCheck($con, $data);
if($acc == NULL) {
$this->error_trace(__FUNCTION__... | 0 |
87bbfcd92712426112bd379021f03233 | cd1e0d7109537350ced507260316e62b | Get all waypoints under specific distance behind a waypoint.
"Behind" means in the direction closer to the car. | public class Waypoint : MonoBehaviour
public List<Waypoint> GetDistanceNeighbours(List<Waypoint> allWaypoints)
{
var list = from waypoint
in allWaypoints
where GetSqrDistanceTo(this, waypoint) <= NEIGHBOURING_DIST_SQUARED
select waypoint;
if (... | 0 |
8bb3ae9fbdb5529c8be0607cbec8ca11 | b7da5bac58643d3b524fc7e8a9541007 | получить вывод схем и их последних продуктов, которые нужно показать в сайдбаре | {
if(Request::header('Accept')=="qr")
{
$table_id=Request::header('tableId');
$table=Table::find($table_id);
$menus=$table->area->restorer->menus;
}
else
{
$user = JWTAuth::login(Request::header('Accept'));
if($user->restorer)
{
$menus=$user->restorer->menus;
}
else
{
$menu... | 0 |
832ce8dbbc6a03280b3ae6ba34bf75da | 8a1a1078e5d7d4e67db08959e9ab31f0 | 更新正在使用的设备 | public void updateRecord(Device device) {
CheckRecord cRecord=device.getRocordResult();
cRecord.setUseNumber(cRecord.getUseNumber());
device.setRocordResult(cRecord);
IASDeviceDAO deviceDao = (IASDeviceDAO) new BaseDAOImpl();
deviceDao.updateObj(device);
} | 1 |
b5945a9cf6e0173230fd1cbf5417f9b9 | 940bcba3d68ddb9994cbd35ce164bb02 | Adds an event listener for the specified event type to this event dispatcher.
Calling this multiple times with the same arguments will only result in one listener being added. | if (!this.listenersMap.has(eventType)) {
this.listenersMap.set(eventType, new Set());
}
const listenerSet = this.listenersMap.get(eventType);
listenerSet.add(listener);
} | 1 |
8f1c61572c6844a715e78c2eef771918 | 9dd0a9b812421b797b05d933c056f7d5 | Sets the key which represents the flow execution ticket parameter. | public class AsrsOutParameter
extends OutParameter
public void setTicketNo(String ticketNo)
{
_ticketNo = ticketNo;
} | 1 |
dc0aa4e454e9a26aa674e350c643a7be | 629ab87fa5c6e4da9fed423e3fd40b5f | 将数据是 (am,pm)格式的hour,修改成 24小时的 | if st1[1:2]==':':
st1='0'+st1
if st1[-2:] == "am" and st1[:2] == "12":
return "00" + st1[2:-2]
elif st1[-2:] == "am":
return st1[:-2]
elif st1[-2:] == "pm" and st1[:2] == "12":
return st1[:-2]
else:
return str(... | 1 |
32acdd5aa41fa57186c71cebf7991943 | 2c9ac7eaa390ef581c488b10b4226178 | Convenience function to create a projector from a volume and projection
header files. | stir_domain = stir_domain_from_file(volume_file)
proj_data_info = _proj_data_info_from_file(projection_file)
comp = Compression.from_stir_proj_data_info(proj_data_info)
proj = comp.get_projector(stir_domain=stir_domain,
stir_proj_data_info=proj_data_info)
return proj | 1 |
89a32dd4cf9c62f88aa20b787420cc76 | 200d208f3d85a66418f39986f266ec8a | Tests the get applicant information by identifier. | {
using (SqlConnection _sqlConnection = new SqlConnection())
{
_sqlConnection.ConnectionString = GetConnectionString();
SqlParameter[] sqlParameterCollection = new SqlParameter[]
{
new SqlParameter("@Maste... | 1 |
05df5d6f476655ffa823ca0aaf4fbf56 | b8141c4dabd217c276f469258932e07f | (the IAP_PROGRAMM_END payload was sent
over the CAN) this method is called to
update the program pointer to the new
program location and finalizes the
programming. | vprg_comms_program_reset(void)
{
vprg_send_program_reset();
return Vprg_comms_state_complete;
} | 0 |
bff502fdee40de0dd2fff4f3347cae40 | 983a0f34bada60fd72bf7c8ae7a21fc8 | Применяет сортировку по характеристике к списку торговых предложений | export class OffersContainer extends Component
handleOffersSort(selectedSortValue) {
this.props.offersActions.loadSortedOffers(selectedSortValue);
} | 1 |
ae38a779e60d19e1f37e795c57f9c151 | b217ad0135737d4aff4481913786fd63 | 生产系统工单审核人员树数据 | @Controller
@RequestMapping("/")
public class RepController extends BaseController
@RequestMapping(value = "repTree", method = RequestMethod.POST ,params = "action=data")
@ResponseBody
public Object repTree(HttpServletRequest request) {
UsrProvider.setUsr(SessionUtils.getLogedUser(request.getSession()))... | 1 |
babc3e841f2ae2f303f3434695c72529 | fb8f4290f6e2d3216756c2ba10851636 | Returns delta value set.
A set of previous and current changed values. | class DeltaList(object):
def changed(self): | 0 |
f2db9b2ba7c44ae6f201d413b869f6d0 | 8806dcc344ad8b5edcee9e2f25790ae0 | @brief add portfolio to Bib in Alma | class DataBase
public function addPortfolio($userId, $title, $context, $thumbnail_path, $web_thumbnail_path, $image_path, $category) {
mysqli_autocommit($this->conn, FALSE);
$query = "INSERT INTO `depol_portfolio` VALUES (NULL , '{$userId}', '{$title}', '{$context}', NOW(), '{$thumbnail_path}', '{$web_thumbnail_pat... | 0 |
0189c096372311152551ea1548c800b5 | 47d2451863c0eb933705ee008624dbd3 | Increase health of the ship | {
if (health != 10)
{
health += 1;
}
} | 1 |
96632b612737af46beefa1b9ed70dc61 | 1aeaf1e209b1d619688d0c4a681a0f00 | Removes all the alarma_ buscadors from the database. | public abstract class GameEngine extends Activity implements SensorEventListener
public void deleteAllAlarms() {
gameAlarms.removeAllElements();
} | 0 |
8005941f4c5418d6c46487d332671e00 | 724d444f7c62cfa38be57836997eed14 | Utter Hack to reload local modules (modules with relative filenames and
paths in home directory). | import sys
import os
path, filename = os.path.split(fullpath)
filename, _ = os.path.splitext(filename)
sys.path.insert(0, path)
module = __import__(filename)
reload(module)
del sys.path[0]
return module | 1 |
37f33f057b5227b2455261eac778ecae | ccbcb561c052dfa9ac7177f5b394c6da | add new staff details | class Admin extends Db{
public function create($fields){
$columnvalue= implode(', ', array_keys($fields));
$placeholdervalue = implode(", :", array_keys($fields));
$sql="INSERT INTO admin($columnvalue)VALUES(:".$placeholdervalue.")";
$stmt = $this->connection()->prepare($... | 1 |
cc3154072157327d84037524f17f495f | a44a18347cb97764bbda2ea36c7317a3 | Computes the derivative of the polynomial with respect to r | def deriv(p):
return poly([n*c for (n, c) in enumerate(p.coefs) if n > 0]) | 1 |
94d96f9bebc4c1736015a1283615f8ca | 2e44b4a00139be51a93cbcfd7687c4cb | esta funcion ayuda a registrar un vehiculo nuevo al cliente seleccionado | Owner _own = (Owner) loggedInUser;
boolean isSuccess = _own.addVehicle(mVehicle.getMatricula());
if(isSuccess) {
allVehicles.put(mVehicle.getMatricula(),mVehicle);
if(log != null)
log.addToLogVehicle(mVehicle);
}
return isSuccess;
} | 1 |
898f3255d2b1268aac4da6e193b00c62 | af678d97b1e61766472734ef2f9132b3 | 駒箱に入っている残りの駒。残りを全て持ち駒にする際などに使用する。 | namespace Ragnarok.Shogi
[DataContract()]
public partial class Board
private int GetGyokuCount(BWType bwType)
{
var list =
from sq in Board.AllSquares()
let piece = this[sq]
where piece != null
where piece.PieceType == PieceTyp... | 0 |
9e503791f32cdc818c63a26ecafe8d55 | d224a7bf1e03e4081ff480c37a5d0fd7 | Retrieves a list of StepExecution from database by JobExecution id. This method does not check the cache, so it
should only be called after the cache has been searched without a match. | namespace Summer.Batch.Core.Repository.Dao
IList<JobExecution> FindJobExecutions(JobInstance jobInstance); | 0 |
b6ac7f04309d6edbceea196f9498aa5b | 1beaa46d8d5cfbf62e1ead95630db0a9 | 根据供应商编码删除文件 | public void deleteSupplierAttachmentMs(Map<String, Object> map) throws Exception; | 1 |
2982afbd23f3d74dd2182a612d8bc3bc | 6dbfbbd8e031b1d6b639765eb259d280 | Wait for any children and remove from queues and update metrics. | _LOGGER.debug('watcher begin: %s', path)
if path in self.process_complete:
self.process_complete[path].clear()
self.queue.append((path, children))
if path in self.process_complete:
_LOGGER.debug('watcher waiting for completion: %s', path)
... | 0 |
020a48798d8902e3a0739e2aa5dde04d | 3959dc7195dbf5b643a67c4f3d27d34b | 全角数字を半角文字に変換 | def full_to_half(str)
str.tr('0-9a-zA-Z', '0-9a-zA-Z')
end | 1 |
3be5dad56ab6ab8089906e7990c7f13a | a2d2ddaadbdcbb080c3bf4b2bda3f6db | Масштабирование изображения с помощью колёсика мыши | namespace Sample
public partial class MainForm : Form
private void picImage_MouseMove(object sender, MouseEventArgs e)
{
if ((Control.MouseButtons & MouseButtons.Left) == MouseButtons.Left)
{
_matAffine.Translate(e.X - _oldPoint.X, e.Y - _oldPoint.Y,
... | 0 |
3b20206bf88837f1c7eef70b22ae9948 | 6e36481076d74a97a647b74f516385cd | Returns whether or not any emails sent to this email address come back as bounced (undeliverable).
<p>
<p>
Default is <tt>false</tt> for convenience's sake - if a bounced message is ever received for this address, this value should be set to <tt>true</tt> until verification can made. | class Gems_Project_ProjectSettings extends \ArrayObject
public function getStaffBounce()
{
if ($this->offsetExists('email') && isset($this->email['staffBounce'])) {
return (boolean) $this->email['staffBounce'];
}
return $this->getEmailBounce();
} | 1 |
4b95365de5f5bb5d3db5af384c0a288c | f800c80a9d342be7afaa0d302e0405e0 | conn.connection_needs_password() -> Boolean
Returns +true+ if the authentication method required a
password, but none was available. +false+ otherwise. | class RarFile(object):
def needs_password(self):
return self._needs_password | 0 |
39de714b97f47df3bdd6832ccbd9fe7e | d19d9b55f9e6c109c9b24bd44be82297 | Gets the requested pygame.sprite.Group. | for key in self.sprite_order:
if key not in self.sprite_groups:
continue
for s in self.sprite_groups[key]:
yield s | 0 |
8ea5d05ec8f70fed02cacd854b498378 | a7f50732cd4ae2e3815cfe4d2d5ba0ca | 隐藏用户动画 | public class GiraffePlayer{
public void setHideAnimation(ArrayList<View> views, int duration) {
for (int i = 0; i < views.size(); i++){
if (null == views.get(i) || duration < 0) {
return;
}
}
if (null != mHideAnimationFull) {
mHideAnimationFull... | 1 |
330d4a99df4cd8f37d588bdd29abd50c | a312d4607dd381e2c05a9e0e7894fd56 | Hide keyboard always on pause | class MainApp(App):
def on_pause(self):
return True | 0 |
14e78e7b9d7fe500565f657c6c6d6716 | 6e041e08bcbcddb5f37a169a99ad5d60 | Retorna true se o operador desejar inserir os parametros manualmente, false caso queira ler
o arquivo de configuração "parametros.dat". | bool PARAMETROS_CAMERA::read (const char * arquivo) {
FILE * arq=fopen(arquivo, "r");
if (arq==NULL) {
return true;
}
unsigned bri, exp, hue, sat, gam, shu, gai;
if(fscanf(arq,"Brightness: %u\n",&bri) != 1) return true;
if(fscanf(arq,"Auto exposure: %u\n",&exp) != 1) return true;
if(fscanf(arq,"Hue: %... | 0 |
c2e4d1892a6e14a1bb1d75342076d728 | 8e588a0fd81e49a1348b3a599ffd5ceb | 描述:获取当前用户看课的最后时间 | public Date getLastTimeByUid(int uid); | 1 |
6b31c937b9cd442b994e1fb6d9d2af9e | 892646104fed3e44ed8dbdecc2c55f43 | \
Routine Description:
This function is called to find the file name given a file
handle.
\ | BOOL GetFileNameFromHandle(HANDLE hFile, string* w)
{
BOOL bSuccess = FALSE;
TCHAR pszFilename[MAX_PATH + 1];
HANDLE hFileMap;
DWORD dwFileSizeHi = 0;
DWORD dwFileSizeLo = GetFileSize(hFile, &dwFileSizeHi);
if (dwFileSizeLo == 0 && dwFileSizeHi == 0)
{
_tprintf(TEXT("Cannot map a file with a length of zero.\n"... | 1 |
c1fcd85baa19ab144ba5c35a2ac463b5 | 96f0a5493e64f49bbe332b545eb34cb0 | Декартово произведение | class tools_math{
public static function descartes() {
$t = func_get_args();
if(func_num_args() == 1) {
if(count($t[0]) == 1)
{
$data = array();
foreach($t[0] as $val)
{
foreach($val as $i)
{
$data[] = array(... | 1 |
b7fbe1758e7001c2f0a8fc0a30b3bd2f | c9926b0c4d0bdd855d1e73367eb1a9d6 | Get the dielectric permittivity at given position. | double RealDielectricWignerPoisson(double w, void * kpar_v)
{
double Iax(double, void *par );
struct combine_pars *kpar = (struct combine_pars *) kpar_v;
double k = (kpar->x);
struct phys_par *par = (kpar->par);
double A,b,c;
double complex re_eps;
A =pow(k/ par->kf,-3.0)/( PI * par->kfa0 * par->efbeta) ;
b =... | 1 |
9796bc1b7154bc587e28d4afb8754427 | 41d61385d644ca6485797677e934c54f | * Write a program that enters from the console a positive integer
n and prints all the numbers from 1 to n not divisible
by 3 and 7, on a single line, separated by a space. | class NumbersNotDivisibleBy3and7
static void Main()
{
Console.Write("n = ");
int n = int.Parse(Console.ReadLine());
for (int i = 1; i <= n; i++)
{
if (i % 3 == 0 || i % 7 == 0)
{
continue;
}
Console.Write(i + " ");
... | 1 |
55b8374757412433426e37df22bc851e | e446656878485a07861b143a06a16120 | Умножение квадратных матриц размера 2 x 2 | void СlassicMultiply(int A[][N], int B[][N], int C[][N]) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
C[i][j] = 0;
for (int t = 0; t < 2; t++) {
C[i][j] = C[i][j] + A[i][t] * B[t][j];
}
}
}
} | 1 |
a5206866ce3f65f83e9ea2b4397e4c8d | 61cbe612f486e3aad00a6ef4d31a0f06 | Принимает номер года, выводит номер года в столетии. | if (typeof(year) === 'number' && Number.isInteger(year) && Math.floor(year) === year) {
if (year <= 0) {
throw new RangeError('год – отрицательное значение');
}
return Math.ceil(year / 100);
}
throw new TypeError('в качестве года передано не число');
} | 1 |
23430176b5eba27b66f7f8f4b903ae6e | 448037a27c6dfb8bcdfaa3f95bd15e06 | Gets the import log. | dateFrom?: null | string;
dateTo?: null | string;
}): Observable<StrictHttpResponse<Array<LogImportDto>>> {
const rb = new RequestBuilder(this.rootUrl, ImportsService.ApiImportsGetlogimportsGetPath, 'get');
if (params) {
rb.query('dateFrom', params.dateFrom, {});
rb.query('dateTo', params.... | 1 |
85cced407d49773b4223c6467eedf237 | ec298dc30d3e1d2ced2913700c1df369 | Creates a <see cref="InspectTemplateName"/> with the pattern
<c>organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}</c>. | namespace Google.Cloud.Dlp.V2
public abstract partial class DlpServiceClient
public virtual stt::Task<InspectTemplate> GetInspectTemplateAsync(InspectTemplateName name, gaxgrpc::CallSettings callSettings = null) =>
GetInspectTemplateAsync(new GetInspectTemplateRequest
{
Inspe... | 0 |
92c83bc25be7b4666ea9438eadb85732 | 8ee49a4048449c42444e553e3ec32a5e | 获取闸机版本列表 | function listVersion(query) {
return request({
url: '/bajiaostar/version/list',
method: 'get',
params: query
})
} | 1 |
7f414775db4c6f3de465b65df4ef0d35 | 69b5580a0c9462cb9ad40fd79b23b18f | Removes the Order resource. | class OrderController extends Controller
public function destroy(Order $order)
{
$order->delete();
return response(null, HttpResponseStatus::NO_CONTENT);
} | 1 |
431d80b5a1f3eca86692903ed39a8754 | f3ee7d9ff9a5ecf3caf7f76be90ef3e2 | Gestion des relâchements de touche | switch(touche) {
case GLUT_KEY_UP:
if (menu == -1) {
if (mode_affichage == MODE_2D_1 || mode_affichage == MODE_2D_2) {
mouvement_haut();
}
}
break;
case GLUT_KEY_DOWN:
if (menu == -1) {
if (mode_affichage == MODE_2D_1 || mode_affichage == MODE_2D_2) {
... | 0 |
685e6635c96321367825b8a61abff933 | 123d38f88db4485f388ad89ee756d804 | 设置聊天对象缓存 | class UserCache
public cacheFromMessage(msg: IUMessage) {
if (!msg.sender || !msg.sender.id || !msg.sender.name) return
if (this.caches[msg.sender.id]) return
this.caches[msg.sender.id] = { name: msg.sender.name, loading: false }
} | 1 |
fb2cd6b88d8ff33f1609a755546139f4 | dda00e70149e1ad342fcd528a09d47d5 | GET: KasaIslem | {
var ktpgecmis = db.TBLHAREKET.Where(x => x.UYE == id).ToList();
var uyekit = db.TBLUYELER.Where(y => y.ID == id).Select(z => z.AD + " " + z.SOYAD).FirstOrDefault();
ViewBag.u1 = uyekit;
return View(ktpgecmis);
} | 0 |
66de22822010d1745e3d67f6441a2bd2 | efbc9872370d81f4e5a5c869b6dbc35b | Create an empty union find data structure with N isolated sets. | class UnionFind(object):
def __init__(self, n):
self.uf = []
for i in range(n):
self.uf.append(i)
self.sets_count = n | 1 |
2f5ae3e55c456be2aac0aea9318be9c2 | 6cec5d8ea4c441ccabef52da2becea51 | 从文件中获取域名 | class DomainUp:
def GetdomainList(self):
with open(self.subdomainTXT) as file:
for subdomain in file.readlines():
if subdomain: self.subdomainKb.append(subdomain.strip('\n'))
else: file.close() | 1 |
03a6d123aacee84a34c0a8e1457add99 | 6ee6f6e6c804487d0429a3a8da6f889c | 共分散行列 | class PCA():
def cov(self):
x_T = np.transpose(self.x)
x_cov = np.cov(x_T)
return x_cov | 1 |
eb6ac632ec7652bba21881352e29b651 | 3d8d9eacbbc9c3749b23764fc02e034e | gets a reply for when the bot receives an insult | replies = ["Sorry, not sure what you meant there. I can help you find the place that brings out the best version of yourself "
"Try something like 'Tell me the best place where i can learn to overcome my fears'"]
responder.reply(replies) | 0 |
87361434484cf1a459524864d588c0ef | cb8e059e0c40131336222a9f141de94f | Abstract method that returns a single sample | public abstract class DatasetProcessor
public abstract SamplePoints takeSample() throws MLDataProcessingException; | 1 |
e1248081f5c0101a3403108868cca1ae | 4edc5090cc01b50e8c83bb84a1afa802 | 1. Check render random group page | var indexPage =getGroupIndex();
switch (indexPage) {
case GROUP_1:
resetPage(INDEX_2);
break;
case GROUP_2:
resetPage(INDEX_3);
break;
case GROUP_3:
goBigMap();
break;
}
timePlay();
} | 0 |
b7938f9d7ab00eda77ae91b613010dd8 | 3677cb8a3add708f255cd23211398e54 | Loads KITTI dataset from local folders | self.data = pykitti.odometry(base_path, sequence)
self.calib = self.data.calib.T_cam0_velo
self.seq_length = int(seq_length)
assert self.seq_length > 0
self.seq_step = int(seq_step)
assert self.seq_step > 0
self.shuffle = shuffle
self.keys = range(len(self... | 1 |
30ea6ff957c13c6b60197b06c44b33cb | 50ef38060e4ddd8af7b10c21fc1be1a0 | Retrieve the bar end type. | @Entity
@Table(name = "report_delivery_defs")
@GenericGenerator(name = "id-generator", strategy = "native", parameters = { @Parameter(name = "sequence", value = "seq_report_delivery_defs_id") })
public class ReportDeliveryDefinition extends AbstractMutableDomainObject
public String getEndPointType() {
return... | 0 |
9ad7ddd026c0cec10b1ef14430fcf610 | d9a9eacb22e2f5a46201c09e347360fe | Returns the difference between y2 and y1 | class HaversineDistance:
def get_change_in_y_coord(self):
return self._y_coord_2 - self._y_coord_1 | 1 |
7bd8bd04b65914f75b6cf227ced97a10 | 889f3b36f041d03d234bc1ba7c1f13ab | write the frequency output to a file | def write_freq_to_file(freq_dist, file):
with open(file, 'a') as output:
for word in freq_dist.keys():
key_value = '"{}" {}'.format(word, freq_dist.get(word))
print(key_value, file=output) | 1 |
07cf57618bd8f684f462602c1dda8a8b | 328ebc97f92094213357aafef7f7d74f | Function to perform PCA on per-item topic scores and plot the result. | path_log = os.path.join(result_directory, "log_final_reduced")
df_log = pd.read_csv(path_log, header=0, encoding="utf-8", sep=";",
index_col=False)
path_tfidf = os.path.join(result_directory, "tfidf.npz")
tfidf = load_sparse_csr(path_tfidf)
print("df_log shape :", df_log.sha... | 0 |
9204508e5a0f19de80eb3ab59df98d90 | aafe85e9f1ccf311b12af1181b97a743 | Cast spirits. | {
try
{
if (CastWitchDoctorSpell("Big Bad Voodoo", D3Control.Player.Location))
{
D3Control.Player.Wait(skillInterval);
}
if (CastWitchDoctorSpell("Fetish Army", D3Control.Player.Location))
... | 1 |
74cd8fc6e00d7da3057da1832bb083bf | 8703ddb6c12ea75d488627976b05b50e | function to do some basic boosts on a TLorentzVectors using the number of the corresponding frame and the top/antitop 4-vectors | met1 = copy.deepcopy(metvec); met2 = copy.deepcopy(metvec)
pTv = metvec.Pt()
phivec = [cos(metvec.Phi()),sin(metvec.Phi())]
Elep = lep_vec.E()
plep = lep_vec.Vect().Mag()
pZlep = lep_vec.Pz()
pPhi = lep_vec.Px()*phivec[0]+lep_vec.Py()*phivec[1]
arg0 = MW*MW+plep*plep-Elep*Elep+2.*pTv*pPhi
arg = ... | 0 |
b2c07becaea7a466dd8d9b09c7c6509b | f03a36b00b8f84181f4f945abbd4dca1 | Get hours learnt per week for a subject | {
include 'config.php';
$get_hours = mysqli_fetch_assoc($connect->query("SELECT*FROM subjects WHERE id=$subject"));
return $get_hours['hours'];
} | 1 |
24e54765c6638f0d9f823a2badb79490 | edbbbb2a59d7b0b1f2f2a36ff87c584f | Test the method to get the paths with best cost by the Roy-Marshall algorithm. | def test2():
wins = {'filter_bw': 1400, 'tint': 1.0, 'number_spectra': 2, 'deltafreq': 0, 'if3': 750, 'res': 5.7, 'vel_freq': 1400.0, 'beam': '1', 'bandwidth': 23.44, 'vpol': 'self', 'mode': 20, 'restfreq': 1400, 'subband': 8, 'nchan': 4096}
beam = wins['beam']
rx = "Rcvr1_2"
g = getGraph(rx)
paths ... | 0 |
95ea7842ed0af220acdca51a0cfbc9df | ec21449928a1a5cb3b7ec2d29d12abd6 | Splits the edges of the input graph in sets of train and test and returns the results. Split is performed using edge
timestamps (see Notes). The resulting train edge set has the following properties: spans a graph (digraph) with
a single connected (weakly connected) component. | u, v = g.edges()
eids = np.arange(g.number_of_edges())
eids = np.random.permutation(eids)
test_size = int(len(eids) * 0.1)
train_size = g.number_of_edges() - test_size
test_pos_u, test_pos_v = u[eids[:test_size]], v[eids[:test_size]]
train_pos_u, train_pos_v = u[eids[test_size:]], v[eids[tes... | 0 |
93dd7dbdd4eb7eb36dabe8715aa7debb | ce53a7ec0a48ca468e04db6a31440ef3 | Set the rulestring and init the model | class RuleItem(object):
def __init__(self, rule_str):
self._rule_str = rule_str | 1 |
a668a8ae0e98f37d1e4af64b1141415b | c5229852abeaa9dbca131d7379d2b300 | is Four Function Calculator enabled? | return (
'yes' === $this->enabled
&&
in_array( get_woocommerce_currency(), array( 'HUF', 'TWD', 'JPY' ) )
&&
0 !== absint( get_option( 'woocommerce_price_num_decimals', 2 ) )
);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.