query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4947691db2f77e4c1bd21b152377a220 | 55cf6a1e33fd43f9396b2df843bfe803 | Subscribe to active player change. When it's AI's turn, play after
thinking for a bit. | class ComputerPlayer extends Player
simulate() {
this.receive('start', () => this.play());
this.receive('result', () => this.stop());
this.send('join');
} | 0 |
cd7e44e8d2f43a760d3fb576c404ad87 | 9269b6936f603deda8f0900f579fb700 | @brief Asserts whether or not a mailbox is valid. | {
int nodenum;
nodenum = (knode_get_num() == MASTER_NODENUM) ? SLAVE_NODENUM : MASTER_NODENUM;
test_assert(kmailbox_open(-1, 0) == -EINVAL);
test_assert(kmailbox_open(PROCESSOR_NOC_NODES_NUM, 0) == -EINVAL);
test_assert(kmailbox_open(nodenum, -1) == -EINVAL);
#if __NANVIX_IKC_USES_ONLY_MAILBOX
test_assert(kmailbo... | 1 |
27c38e5e79e6dec917f7e380dcc3538c | cda7e13469e214ffb72edc44744abdac | 获得Banner广告缓存 | {
$is = $this->redis->hExists($this->redis_advert,'banner');
if($is)
{
$banner_info = $this->redis->hGet($this->redis_advert,'banner');
$banner_info = unserialize($banner_info);
return $banner_info;
}
else
{
$conditions ... | 1 |
90dd478e470518a95abf5958219115e3 | 87e9c31005577e939165c7a170b4e21f | Elimina usuario dado su nombre de usuario y su password | def eliminarUsuario(userName):
try:
u = User.objects.get(username=userName)
u.delete()
return
except Exception:
return | 0 |
10ffb3da28c5993e05a99529274798c3 | bcf1ff197748519f811358b8ebfb8709 | Returns the hash value associated with a specific block index. | class BitcoinClient::Client
def getblockhash(index)
@api.request 'getblockhash', index
end | 1 |
85ab4628d67b819ebdc5fa22d13de057 | d03377a91070b9492f5f44f21c4233cf | fill deck with cards and shuffle | {
for (int i = 0; i < numberOfDecks_; i++)
{
for (int value = 1 ; value <= 13 ; value++)
{
for (int suitInt = Hearts; suitInt != Spades; suitInt++)
{
Suit suit = static_cast<Suit>(suitInt);
Card card = Card(suit, value);
car... | 1 |
beb073d9af6085c9012ce41dac98f89f | 61e30a9fd62cf265fb0585533758aae5 | Used by qsort to sort media references by name. | static int ref_sorter(char **a, char **b)
{
int ix;
REF_HASH_TAB *p1 = (REF_HASH_TAB *)(*a);
REF_HASH_TAB *p2 = (REF_HASH_TAB *)(*b);
ix = strcoll(p1->string,p2->string);
if(ix != 0)
return ix;
ix = p1->ph_table - p2->ph_table;
if(ix != 0)
return ix;
return(p1->ph_mnemonic - p2->ph_mnemonic);
} | 1 |
194a2c6fa022d1ab4a2c2a119117d7e4 | 897c58de4cb1d4ce43ab913720ad80a9 | Creates a new Hook's Model filling their properties with the JSON payload. | namespace Twilio.Rest.Video.V1
public class CompositionHookResource : Resource
public static CompositionHookResource FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<CompositionHookResource>(json);
}
catch (JsonException e)
... | 1 |
f8d46e122615b48f9bcf7f61df362d1f | 11385bd746bb9e305a57f2e557c8a931 | applique une matrice sur la cible de la lampe afin d'obtenir la position caméra
NB : cette méthode ne fait rien dans le cas d'une lampe omnidirectionnelle | void PointLight::apply_camera_transformation(const glm::mat4 &ivm) {
p = ivm * p;
} | 1 |
3ae0b490d68ff9d62a60e14a707de3f6 | 3a04a1c30c227b797800beeb56baf1f7 | Установка максимального количества бомб для установки на текущем размере поля | namespace itiblab1
public class PereborVariantov
public void SetMaxCount(int mx)
{
maxcnt = mx;
} | 1 |
b1c07f094031237f3e094b0e00045379 | 161d34ca24be73144772e42987d1d31b | Test for a Landsat 8 ORTHO (level 1) scene. | def test_l7():
_test_core_optical("LE07*") | 0 |
70e7bc3ab395b32b41d6f7e146e1abe1 | 6fb5c31ba22eae25c5d168959f7e22bf | 根据订单的id获取该订单的场馆名 | for (var i in responseData.data) {
if (id == responseData.data[i].id) {
return responseData.data[i].cname;
}
}
} | 1 |
6e8ed15a689d058ac26f0d49b9af30d8 | cf2c15bf1bfb39f6bcfcc2ddc856b30f | 根据学校机构代码查询出其下属的班级列表 | def get_class_by_collection(college_code=''):
uri = 'http://xgbfwq.gznu.edu.cn:8888/student/jsp/instructor/class_findClassTreeByLoginByXY.do?I_B_id={}'
if college_code:
url = uri.format(college_code)
else:
for i in college_collection.find({'type':'college_code'}):
college_code = ... | 1 |
3436a12e97a41fdc6296ad04077cd9e0 | 4999f64ef485913ab0fc331c2004ecf0 | 更新站内公告数据处理 | BigstarAnnouncementProduct announcement)
{
DynamicDataSourceHolder.setDataSourceType(gameServer);
if (announcement != null)
{
if (announcement.getDateExpire() != null)
{
long dateTime = announcement.getDateExpire().getTime();
in... | 1 |
fc7ab63c7d56f7ef1c84e39de30bf604 | 5eac2d10324a8da3d37bfd74c0623e1d | Checks, if another graph has the same attached data and contains
vertices and edges with the same attached data as this graph. | boolean isSameGraph(T root1, T root2); | 1 |
f387ed6168681f729aa0e4e69f325ec1 | 16c4e4823d9e537a52e155886aeb5700 | Function that returns map of the labyrinth | class Map:
def __init__(self):
self.list_objects = []
self.position = Position()
self.list_labyrinth = self.load_map()
self.list_labyrinth = [list(s) for s in self.list_labyrinth] | 0 |
20185c1e54f99560e85437efabdbd50b | 1ebbb48ccbac882ceedf937a1bf7187c | Visit a parse tree produced by PlSqlParser#overriding_subprogram_spec. | class tsqlListener(ParseTreeListener):
# Enter a parse tree produced by tsqlParser#tsql_file.
def exitOver_clause_expression(self, ctx:tsqlParser.Over_clause_expressionContext):
pass | 0 |
08e2814f68c7fe58d1c50d19489d6580 | 2edec93ad9237842eb95fec6fcddb080 | Check whether this node content is actually a part of source code or being included.<br/> | public boolean getIncluded(); | 1 |
831a336ce7e342079baac2e18fc2762c | 1a220af5486f7112a7242fb60d942a4a | Contains information pertaining to the entire TTree. | void Unpacker::AddTTreeUserInfo(TTree * tree)
{
TNamed * elapsedTime = new TNamed("Unpacking Time", Form("%.0f", fTimeElapsed));
TNamed * eventsUnpacked = new TNamed("Events Unpacked", Form("%llu", nevent));
TNamed * wordsRead = new TNamed("Words Read", Form("%llu", fReadWords));
TNam... | 1 |
873b57bae4fde0c1254f3c13cfc5c8b1 | 262391cf7f47fc4be1a140a3dc7b358d | Verifies account balance sync state management (that balances are fetched backwards). | class AccountBalanceReportStageTestCase(BaseTestCase):
def test_account_balance_initial_sync(self, get_mock):
with open('tests/resources/trial_balance_report.json') as report_contents:
get_mock.return_value = json.load(report_contents)
self.create_org(status=CONNECTED, changeset=0)
m... | 1 |
4e09ec2989a00fd3b313b8320da501ba | 0653a1384061424b0f21731194d7fb32 | 获取UNIX/LINUX 下正在运行的进程数量 | public class MonitorUtil
public static int systemProcess() {
Process process = null;
int progressNumber = 0;
try {
process = Runtime.getRuntime().exec("tasklist");
BufferedReader br = new BufferedReader(
new InputStreamReader(process.getInputStream(), ... | 0 |
bfdbde308c1e3b61174cca4b9c870f2a | 958844349ab13b677d1abc19602c7475 | Returns the meta object for the attribute '{@link dz.smartMilefe.milafete.milafeteDataModel.Document#getDocumentType <em>Document Type</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getDocumentType_Types(); | 0 |
7f09c2b7bb8a94272dda3d5defde35cc | 38c6249c9c08074e37b0850a47d87188 | Notifies this listener that the given part has been activated. | ISelection selection) {
if (sourcepart != AbstractOnSelectionView.this) {
updateOnSelection(sourcepart, selection);
}
} | 0 |
14eaf6b0dda9ad26000e1af43b212096 | d1c56c08f62d2102bc2855d2ac80065f | Creates a form to create a generarMulta entity. | {
$entityManager = $this->getDoctrine()->getManager();
$form = $this->createForm(new VotersType($entityManager), $entity, array(
'action' => $this->generateUrl('voters_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array(
'labe... | 0 |
73b39c7a33abb1e4a09e67b65d4e5f86 | e9b4a7ae9da0f74bbe20ac64196edb23 | Return the most recent move executed in this game. | public class JackBauer extends EventDispatcher implements IPlayer
@Override
public Move getMove()
{
return lastMove;
} | 1 |
52b0d677f3a17b32dbe369c3998df915 | d4c82edfa176e5216415a8d3beeecf93 | GET: Strojes/Create | {
ViewBag.ResponsibleAdultId = new SelectList(db.ResponsibleAdults, "Id", "Name");
ViewBag.StudentId = new SelectList(db.Students, "Id", "Name");
return View();
} | 1 |
920c8cfdf679835c8c792b2c10d5ca03 | e1adbfe10c8f8078f77923b0647074b4 | Runs the R scripts for Granger causality inference and measurement to
calculate Interplay. | def main(params):
mpi_vs_multiprocess_logging("process", params)
ifg_paths = []
for ifg_path in params[cf.INTERFEROGRAM_FILES]:
ifg_paths.append(ifg_path.sampled_path)
rows, cols = params["rows"], params["cols"]
return process_ifgs(ifg_paths, params, rows, cols) | 0 |
1d3fbda639ce6e7749878c46342b0523 | b97f8de07bd1e1cba997d1d32bd924c5 | Asserts that predefined message is printed to the standard output | final String[] words = expectedString.trim().split(" ");
assertNotNull(givenComposite);
assertEquals(givenComposite.count(), words.length);
givenComposite.print();
assertEquals(expectedString, new String(this.stdOutBuffer.toByteArray()).trim());
} | 1 |
ac0f602e0837349d28f7dfaeafd23785 | 096b3ede45388e11e72c7f1c6ad25ede | 礼品兑换成功页面 | $this->pagedata['title'] = '赠品';
$_params = $this->_request->get_params(true);
$win_id = $_params && isset($_params['win_id']) ? (int) $_params['win_id'] : null;
$win = $this->app->model('win')->dump(array(
'win_id' => $win_id,
'partin_id' => $this->partin['partin... | 1 |
be8c2d4063860e563a6ef3e0a6b8adc7 | b8b26aed9d45a885317067143f2d0b7c | 返回运行所耗时间,单位ms | public abstract class HowTime
public long getHowTime(){
long start = System.currentTimeMillis();
code();
long end = System.currentTimeMillis();
long time=end-start;
return time;
} | 1 |
2ebd7892505840a29f79196efd2b1fc6 | 5f91e5e72bd0255b084be16abcdd1a3a | Terminates all producer stages, interrupts all threads, and waits for a graceful termination. | self.switch.end = True
for p in self.producers:
p.stop()
return True | 0 |
054d5ee7d2af9b9211b265c8c674d5ee | 886521235e95bc020abba1d408886cc9 | Puts the integer in an array and returns the array | class MTpython(MT19937):
def int_to_array(self,k):
if k==0:
return [0]
k_byte = int.to_bytes(k,(k.bit_length()+7)//8,'little')
k_arr = [k_byte[i:i+4] for i in range(0,len(k_byte),4)]
return [int.from_bytes(i,'little') for i in k_arr ] | 1 |
142bd62bcf637bfd724d7eacce67c4d3 | e38b89c0e0137b41adbf6a5b3a629f3a | Format the data for keystone session using application credential | d = {}
d['username'] = 'cshane200'
d['api_key'] = os.environ['OS_PASSWORD']
d['auth_url'] = 'https://keystone.ece.comcast.net:5000/v2.0'
d['project_id'] = 'Xfinity Home'
d['region_name'] = 'ndc_ch2_c'
return d | 1 |
486618ac21861d0dbbf07c31dff029ca | 6c833a23ebfaf173ab2f38288ee99829 | 函数:设置物理防御 | {
__ENTER_FUNCTION
INT iTmp = g_MonsterAttrExTbl.Get(m_pChar->GetDataID(), CATTR_LEVEL2_DEFENCE_WATER);
if( iTmp == -1 )
{
}
else
{
m_pChar->SetBaseDefenceWater( iTmp );
}
__LEAVE_FUNCTION
} | 0 |
65238e10fdbd4f3075783d00f099a838 | 3e615dc75ba2ef35cb4d269ec412a9f1 | 将rabbitmq push的消息体,根据不同头类型,解析成不同类型。
实际大部分是 将序列化的<字符串>转成obj | protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
if (in == null) {
return null;
}
if (in.readableBytes() <= HEADER_SIZE) {
return null;
}
in.markReaderIndex();
int dataLength = in.readInt();
if (in.reada... | 0 |
d146617958f5f0fd1af618b706c9a270 | f8a49511017e62c9fead7b41c2c040fb | Sets a new rateDistance
Information on the distance that a reserved vehicle may be driven as part of the standard rental charge. Such distance may be unlimited, or a quantity of miles or kilometers for a certain period of time. This may be repeated for situations such as an 8 day rental that has 500 miles per week and ... | {
if (!false) {
throw new \InvalidArgumentException(sprintf('The RentalRate property can only contain items of anyType, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->RentalRate[] = $item;
return $this;
} | 0 |
17c457985dae369e8a5282810fc8710f | 69adffef16db4d9f9522ca291284d59d | Inserts a student's fee payment. | $fName = InputSanitise::inputString($request->get('f_name'));
$mName = InputSanitise::inputString($request->get('m_name'));
$lName = InputSanitise::inputString($request->get('l_name'));
$userId = InputSanitise::inputString($request->get('user_id'));
$phone = InputSanitise::inputS... | 1 |
5a6960772b8a804cb4614e5ae3f376fb | 69a64b5b47cdeee786433d4b7bbb7769 | Set up the spectrum identification list. | public abstract class Identification extends ExperimentObject
public ArrayList<String> getSpectrumFiles() {
return new ArrayList<String>(spectrumIdentificationMap.keySet());
} | 0 |
328d0ebf4cf821da57eeabea80d05f7a | 8aeeb0105fd1f23dffed392ed875eadc | プレーヤーの出す手を文字列で返却するメソッド | System.out.println("出したい手を入力してください");
Scanner scan = new Scanner(System.in);
Judge judge = new Judge();
String playerhand = scan.next();
return playerhand;
} | 1 |
106be0e5e3333e235c75bac780c8974f | 6fe175668cbee53d988a0290cfb9b627 | This method sets this long click listener to the adapter | public class MessageAdapter extends RecyclerView.Adapter<MessageAdapter.MyViewHolder >
public void setOnItemLongClickListener(MyItemLongClickListener listener){
this.mLongClickListener = listener;
} | 1 |
9734e3257c9a106a9cc2f92ab322085d | e3ae42a8b7cfd3c866dc08fc75a8ce8f | 首页显示商品,每一类商品查询6件,根据最新上架排序 key的命名为catelogGoods1、catelogGoods2.... | @Service
public class ProductServiceImpl implements ProductService
@Override
public List<Goods> findGoodsByCategoryIdForIndex(Integer id) {
List<Goods> goodsByCategoryId = goodsMapper.findGoodsByCategoryId(id);
List<Category> subCategories = categoryMapper.findByParentId(id);
for (Category s... | 0 |
3c3e41cb1d14d973d2168bd387e4f846 | 8a777404381c37fbc6a4d930602375c1 | Mark all internally tracked domain events as committed. | void commitEventList(); | 1 |
22e096394584dee5c0cd936638481a61 | eb0afbc25837fae24c330d24a546431a | Evict any query result sets cached in the default query cache region. | {
$this->getQueryCache()->clear();
foreach ($this->queryCaches as $queryCache) {
$queryCache->clear();
}
} | 1 |
7d22d6cb0dcb35544e270eae87ac2942 | 0a5e96c1d17ba53fde99530e80487ecb | releases the HTTP parser | void parser_free(parser_t *self) {
parser_cleanup(self);
free(self);
} | 1 |
62945281ce44c6e443d3093a8cae12f4 | 240b602fd4265e25f90795744b0263ab | Updates an existing content type. | class ContentType(BaseEntity):
def update(self, update_children):
qry = ServiceOperationQuery(self, "Update", [update_children])
self.context.add_query(qry)
return self | 1 |
0117eb397b5e4d430640f04f825d4744 | 8f63dfac22505ef87fac14b4bf2a310e | 조합을 만들어 치킨 거리의 최솟값을 찾는 함수 | if (cnt == 0) {
int tmp = 0;
for (int i = 0; i < homes.size(); i++) {
tmp = tmp + calchi(visited, homes.get(i));
}
if (tmp < output) {
output = tmp;
}
return;
}
if (idx > visited.length-1) {
return;
}
visited[idx] = true;
comchicken(visited, cnt-1, idx+1);
visited[idx] = false... | 1 |
e4bc867e355a31beb6135d0ebae16cc0 | 10ab95af87d164e76b82ec8ca25fb80f | Se deja de admitir nuevos jugadores en la partida. | int n = 0;
this.aleatorio.setEnabled(false);
this.tableroDesactivado = true;
for (int f = 0; f < this.tablero.getFilas(); f++) {
for (int c = 0; c < this.tablero.getColumnas(); c++) {
this.tableroBotones[n].removeActionListener(this);
n++;
}
}
this.panelMensaje.onPartidaTerminada(null, this.co... | 0 |
287b0287d96aae27cbf98c4b636218e9 | 31b28021e7bed3b5e98cd4a9bd3bed89 | 根据维护品牌code获取id | @Service
@SuppressWarnings({ "unchecked", "rawtypes" })
public class NewERPCommonServiceImpl implements NewERPCommonService{
public String getBrandIdByBrandCode(String brandCode) {
Map<String,String> params = new HashMap<String,String>();
params.put("at_code", brandCode);
return newERPCommonMapper.getBrandI... | 1 |
c3536ef876ce56cb78c5d89a5e35daba | 09d5cea61616b356e99e195bb332efd3 | 绘制一个特征的百分比堆叠图 | count = df.groupby(column).count()\
.sort_values(by='group').to_dict()['index']
if not ax:
f, ax = plt.subplots(1, figsize=(12, 8))
ax.barh(y=range(len(count.keys())), width=list(count.values()),
height=1.0, align="edge")
return ax | 0 |
8aeba261356ac3de7dc21a06a49f9343 | fe96767789e60b4944c8601ae4533c81 | Sets the unmarshalling context | public class XMPPStreamContext
public void setUnmarshallingContext(UnmarshallingContext uctx) {
this.uctx = uctx;
} | 1 |
0a7a111843a1e4dc2728fccf79b6c3a4 | 4bb52efe75b75f6bdd9b44acc83580ae | 根据QueryRule查找记录
<pre></pre>
☆ZhouYanBin(2016年4月27日 下午5:03:55): <br> | @Service("umTAccountService")
public class UmTAccountServiceSpringImpl implements IUmTAccountService{
public List<UmTAccount> findByRule(QueryRule rule) {
return umTAccountDao.find(rule);
} | 1 |
6aa6654cd1d9cc7de5a05202ace8ce3f | 763cec8be40c80b37b24b1d8dcafdc12 | Run generate translation messages for country names.
This command load and parse translations csv data file. | class Csv implements FileLoaderInterface
public function load($locale, $filename)
{
$messages = [];
ErrorHandler::start();
$file = fopen($filename, 'rb');
$error = ErrorHandler::stop();
if (false === $file) {
return false;
}
while (($data = fgetcs... | 1 |
851856791c70d64503cdd4c11d624a38 | cf254a8c71d93fca03c123dab1b363f5 | 将日期里的/ 替换成- | dateSwitchCommon(date) {
const str = date.replace((/-|\./g), "/");
return str;
} | 0 |
4a74642db2bb39ce6854667f36802e15 | d7b5c3554d9a649842770baf9149b724 | When calling this function, the second keycard's selection buttons will appear in the inventory menu | {
if (grenadeCarrying == true)
{
selectionButtons[4].SetActive(true);
selectionButtons[5].SetActive(true);
}
} | 0 |
49321f38532f4fe7f5cbfd38aa1603f9 | d8926b054a8e5dd1d61715deb1ad7b29 | 根据ID取供应商的标识键值 | {
String sqlText = "SELECT Material_ID FROM Supplier_Performance WHERE ID = '"+ID+"'";
DataTable rst = DBHelper.ExecuteQueryDT(sqlText);
return (rst.Rows[0][0].ToString());
} | 1 |
8ec8cfcded76d4021a725c5c356885e7 | 6dfee308002b014a39d2309716cec06a | 显示库存. | class StockController extends Controller
public function show(Product $product, Stock $stock)
{
return view('admin.stocks.show', compact('product', 'stock'));
} | 1 |
bcf5ac65b3303ab86e1a80c7cd2e29f2 | eef2eab9a76a1cea49341eca3b484caf | Set default positions on all earth enemy. | class Environment:
def init_positions(self, RedArmy, GreenArmy):
self.RedArmyBodies = []
self.GreenArmyBodies = []
for index, unit in enumerate(RedArmy.Units):
RedArmy.Units[index].set_position(x=numpy.random.uniform(self.minX, self.redDeployLimit),
... | 1 |
b3146673c4c516411fac51deacffc0da | 037be190c28cb6b19a17e5bb5d64d865 | Get the indentation information of each tag | class ToDoneToHtmlCommand(sublime_plugin.TextCommand):
def parse_indents(self, lines):
indent_levels = [0]
for line in lines:
spaces = len(line) - len(line.lstrip())
if spaces not in indent_levels:
indent_levels.append(spaces)
level = 0
for spaces ... | 1 |
46996aabfad0f517d708477fa8b1987a | 656d77c173407c9afbd8cee6aa9bfa3e | Returns formated html of peek | $inputs = $this->inputs;
$html = '<div class="posted-field">';
$html .= '<div class="field-label"><strong>'.$this->Get_Label().'</strong></div>';
$html .= '<p class="field-contents">'.$this->Get_Contents().'</p>';
foreach ($this->inputs as $k => $_input) {
if ($this->... | 1 |
e0b0998acd3055677e7417920919ec39 | 0c5f4167d2946ee0aa721b922572b952 | Opens the viewer. | {
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = "c:\\";
if (openFileDialog.ShowDialog() == true)
{
CurrentFilePath = openFileDialog.FileName;
openFileBtn.IsEnabled = false;
}
... | 1 |
deb51ddeb44f2e32828ed57216494a1d | 09a789aa240739200d113e660b42b587 | 判断两个线段是否相交(解参数方程法) | {
if (MIN(Apt1.x, Apt2.x) > MAX(Bpt1.x, Bpt2.x))
return false;
if (MIN(Apt1.y, Apt2.y) > MAX(Bpt1.y, Bpt2.y))
return false;
if (MIN(Bpt1.x, Bpt2.x) > MAX(Apt1.x, Apt2.x))
return false;
if (MIN(Bpt1.y, Bpt2.y) > MAX(Apt1.y, Apt2.y))
return false;
double xa = (Apt1 - Bpt1).cross(Bpt2 - Bpt1)*(Apt2 - Bpt1).cr... | 1 |
f540466cb1a76635be787bff1e3538c4 | ba73b461257e072e3c8b9a996ff8074b | USUARIO LOGADO retorna o valor total do carrinho | {
$carrinhos = Carrinho::where([
'user_id' => Auth::id()
])->get();
return view('carrinho', compact('carrinhos'));
} | 0 |
342c3a99543f221f069eed2aa5c042e7 | 57f58872292a88d54a6172bb33784429 | Query the Belongs to many relation. | abstract class Model extends IlluminateModel
public function belongsToMany($related, $table = null, $foreignPivotKey = null, $ownerPivotKey = null, $foreignKey = null, $ownerKey = null, $relation = null)
{
$type = $table;
$key = $foreignKey;
$relation = $ownerKey;
if (is_null($relati... | 1 |
2f588ce6c9521d9d9d79876931e01148 | 455b816ea239d6b6bdd5c7b2f65d33af | Check if custom app settings should be displayed. | return (
(not external and bool(load_settings().get("show_internal", True))) or
(external and bool(load_settings().get("show_external", True)))
) and bool(load_settings().get("quick_panel_commands", True)) | 1 |
a65c55fbaec2e9464a0d9173a983cc36 | b48225ffd73df2f9f5d04e47e3eaf5f0 | Deincrements Orientation Value, if the value decreases to -1 it loops aorund | if(degrees >= 0){
degrees --;
}else{
degrees = 180;
twistAmount *= -1;
}
twist(geo);
renderer.render(scene, camera);
} | 0 |
68768f421941d64512f8dc3ff7de0c8b | 6bc6d60c18d06c65135d836d077ee276 | Diz se uma string representa um CPF valido ou não.
A entrada pode ser uma string só com números ou algo no formato
`XXX.XXX.XXX-XX`. Esse algorítmo é um pouco diferente do que está no site
da receita federal, mas dá os mesmos resultados. O código foi tirado daqui:
https://pt.wikipedia.org/wiki/Cadastro_de_Pessoas_Físic... | public class Util
public static boolean isCPF(String xCPF) {
try {
int d1, d4, xx, nCount, resto, digito1, digito2;
String Check;
String Separadores = "/-.";
d1 = 0;
d4 = 0;
xx = 1;
for(nCount = 0; nCount < xCPF.length() - 2; nC... | 1 |
2cec573af20a29c5d066c7bca8e4de43 | 51c1e51962003758f8dc67d2e244c865 | 将基础分类保存到数据库 | public class DataUtil
public void saveClassifyLocal(List<ClassifyEntity> list) {
SQLiteDatabase db = mHelper.getReadableDatabase();
db.execSQL("delete from Classify where _id > 0");
for (int i = 0; i < list.size(); i++) {
ClassifyEntity model = list.get(i);
db.execSQL("i... | 1 |
ca2ece526077be16c004336e7e78c7e6 | 7602c21a1ad6820c2350fa4d9d15dee2 | Gluster FS로 이미지를 업로드하는 메서드 | class Storage_Mgfs extends Storage
public function put(Storage_Entry $entry, $option = NULL)
{
Log::debug($entry, __METHOD__ . ' start put');
if (!$entry->isImage()) {
Log::notice( $entry, 'is not a image');
return FALSE;
}
$meta = $this->retrieveMeta($entry, $option);
$id = $meta['id'];
unset($meta[... | 0 |
c49cd739139ac862987f78e1584f9b6e | d249e46424bfcf430aed0f1e60becea3 | Set Access all Orgs.
Access all Organizations (no org access control) of the client | Collection<Org> allOrganizations = organizationsStorage.getOrganizations();
return allOrganizations.stream()
.map(org -> new OrgPermission(org, true, true))
.collect(toList());
} | 1 |
4c72e3ae3d97c5f123bdc68f3d170188 | 0e0d5444e148ba139fa2e3f7b0fdb48a | 开始编辑频道 | $params = [
'id' => $id,
'template' => '',
'template_name' => '',
'author' => '',
'remark' => '',
'op_user' => '',
'status' => 0,
];
$res = Channel::api()->edit($params);
$res ? $this->_end(!ApiModel::isSucc($res), $res['message']) : $this->_end(1, '通信失败');
} | 1 |
e209370bbc4717e7448770d9c139e65c | b70beb708e66799b198ef55e6f2786b8 | This adds all total landed values together | int loyertotal = 0;
for(int i = 0; i < terrain.length; i++) {
for(int j = 0; j < terrain.length; j++) {
if (terrain[i][j] != null) {
loyertotal += terrain[i][j].getLoyer();
}
}
} return loyertotal;
} | 0 |
b08d70dc94655601acbe34e39c303f7c | 1578f5f9f6b3f2b072eba3dcc2cad948 | 点击邮件按钮 | class Mail(WebUI):
# 写邮件元素属性 /html/body/div[1]/nav/div[1]/ul/li[2]/span[2]
def clickWriteMail(self):
return self.findElement(*self.writeMail_loc).click() | 1 |
655b3d19f0184c569f12cc352bff907e | 9f0c82482af05b9d918e52029f095a15 | select from the available servers | RealServer *C2S::chooseServer()
{
if (curServer)
curServer = curServer->next;
if (!curServer)
curServer = serverList;
return curServer;
} | 1 |
ce1a9ca0c2910fb823723250c5969459 | 59cd1572d592e1ab13a4ada361792a40 | 邀请充值扣量记录 | class FinanceController extends Controller
public function actionRechargeRecord($id)
{
$model = User::findOne($id)->toArray();
return $this->render('rechargeRecord', $model);
} | 0 |
b80d94a1bfdc9ae470796ff0c9ec491c | 75be523f91064f6fa92077617dc6f4fa | Sets the TreeNode select state to the new value.
specifies the TreeNode which select state will be set
specifies the new select state | var node = this.treeHash[nodeId + ""];
if (node) {
if (node.selected != valueForce) {
switch (valueForce) {
case false:
case true:
node.selected = valueForce;
... | 1 |
2f9d4a4d8bd2e9680ffa6248828daadd | cdb7000b6fbb181f7274064649a129f7 | 获取ItemView的key文本 | public class BookingFragment extends AbsFragment<FragmentBookingBinding> private void pay(final GetComboBoxBean getComboBoxBean)
@Override
public CharSequence getLabelText(TextView label, int position, GetComboBoxBean.ResultBean data) {
return data.getKey_value();
} | 1 |
2f9e1ad93d5a50dce4f34f06538d6ac3 | b9704e9e1aa674aa14318d6e6a911879 | Sets the health status for given service. | namespace Amazon.AutoScaling
public class AmazonAutoScalingClient : AmazonWebServiceClient, AmazonAutoScaling
public SetInstanceHealthResponse SetInstanceHealth(SetInstanceHealthRequest setInstanceHealthRequest)
{
IAsyncResult asyncResult = invokeSetInstanceHealth(setInstanceHealthRequest, null,... | 1 |
e393c57c02a5511f6054cc771f7b4491 | ad9f6a6de89f2ee315a24130dd2c7851 | Create Child Command Console | class TestConsole extends Command
public function __construct() {
parent::__construct();
} | 1 |
e67d015184e89fb7c263108fd29e5889 | 5bec9abeb88df80398f804ce7684cc29 | Grab tags (classifiers) from bylines. | match = content.match(/^[tT]ags: (.*)$/o)
if match
@tags = match[1].split.collect! {|tag| tag.downcase }
content.gsub! /^[tT]ags: .*$/, ''
else
@tags = []
end
return content
end | 1 |
1ea22938344ca3446ac147937f0b16e5 | f88af87916eefe981cc5fc7d60fddfcf | to validate Change Of Ownership Form data on submit | function validateForm(){
var CoCurrentAddress1 = document.forms["myForm"]["CoCurrentAddress1"].value;
if(!CoCurrentAddress1){
document.getElementById('input_2021').innerHTML="<span style='color:red'>*This field is Required.</span>";
document.getElementById('geocomplete').focus();
return fal... | 1 |
1417b3067cc4d825e93aec80533fe777 | 0bf3b0272993ba3a4ee669a96680c7cd | Get the URL to retrieve CSV data from for a given date. The web form we
access generates the CSV file when we POST our query and generates a web
page with a link to the CSV file to be downloaded. This function submits
the query and retrieves the URL of the CSV file from the resulting web
page. | def fetch_url(date, country=None):
DATA_URL = ("https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/"
"csse_covid_19_daily_reports/{}.csv".format(date.date().strftime("%m-%d-%Y")))
if country == "US":
DATA_URL = ("https://raw.githubusercontent.com/CSSEGISa... | 0 |
8638a3c934df646ee25e67ded41c2711 | 60065ce01c1aff18d45dab4c8383b22d | Gets a singleton instance of the <see cref="SettingsViewModel"/> class. | namespace SanzaiGuokr.ViewModel
public class ViewModelLocator
public static void CreateApplicationSettings()
{
if (_as == null)
{
_as = new ApplicationSettingsViewModel();
}
} | 0 |
cd540dc8e118d93e81863b6aecb7d304 | eb02eafa3ed02f41b8ad8088cfef441a | Compara 2 objetos CronogramaTarefa | return task1.id === task2.id
&& task1.name === task2.name
&& task1.status === task2.status
&& task1.startTime?.getTime() === task2.startTime?.getTime()
&& task1.finishTime?.getTime() === task2.finishTime?.getTime();
} | 1 |
af86b157b464c94543c42d9dcc8131f4 | 83d1c54f4512434b44e06a7c2d36209a | Checks for enemies for the current room | public class Room : MonoBehaviour
private IEnumerator FindEnemies()
{
yield return new WaitForSeconds(0.005f);
enemies = GameObject.FindGameObjectsWithTag("Enemy");
} | 1 |
decb5d02ef886d2a383c1cdf519507f1 | 896044c291100aba56820d448578c6e0 | Recebe um Note e atualiza essa entrada no banco de dados | @Dao
interface WordDao
@Update
suspend fun updateNote(note : Note) | 1 |
f892ce6228c7cec314ad11f689522682 | 3517006ddcfb7e235c2137d004652845 | Converts Julian Date to modified Julian Date. | double GregorianCalendarDateToModifiedJulianDate(DateTime time)
{
return GregorianCalendarDateToJulianDate(time) - 2400000.5;
} | 0 |
e81fbfa15157cc2acd83fbf5f10c131b | 48e0d018e37235d87302bb6fa16fe14f | View specific field in the .plist file. | static int view_index(lua_State *L) {
if (strcmp(lua_tostring(L, 2), "buffer") == 0)
lua_pushdoc(L, SS(lua_toview(L, 1), SCI_GETDOCPOINTER, 0, 0));
else if (strcmp(lua_tostring(L, 2), "size") == 0) {
lua_pushnil(L);
Pane *p;
#if GTK
if (GTK_IS_PANED(p = gtk_widget_get_parent(lua_toview(L, 1))))
... | 0 |
8980a53b8d7de91d5cb99deeae3bd701 | 576615fa7dc4828b1abf8095d6418764 | Route for assigning an animal to an event | class UsersController
def tinder
UserEvent.create( user_id: current_user.id, event_id: params["event_id"].to_i, shown_user_id: params["user_id"].to_i, liked: "#{params["selection"]}")
redirect_to "/"
end | 0 |
cf4fce74826196eb2a2cd9a9d3409e42 | 9ccfd350dd6e798790a6d146e4195469 | выбирает профили (в сокращенном виде) друзей и их статусы | browser.get("https://vk.com/friends?id=" + str(id) + "§ion=all")
ScrollAllPage()
bsObj = BeautifulSoup(browser.page_source, "lxml")
nameList = bsObj.findAll("div", {"class": "friends_field friends_field_title"})
idList = bsObj.findAll("div", {"id": re.compile("friends_user_row[0-9]*")})
fio ... | 0 |
510c6fb239d07f0b9052dba261da1951 | fa5e0fae42fb2b018b1473a22587446a | Comprueba si alguna de las recomendaciones ha sido usada | for (int recommendedId : recommendedItems) {
for (int relevantId : relevantItems) {
if (recommendedId == relevantId) {
return true;
}
}
}
return false;
} | 1 |
758be39558420f66cab0547c683959e6 | ecd21921e52ec62c9a57c319187fb801 | Post_Type constructor. | class Post_Type_Ensenanzas
private function __construct() {
add_action( 'after_setup_theme', array( $this, 'create_type_tax_and_meta' ) );
self::$page_name = self::$type_name;
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
add_filter( 'template_include', array( $this, 'template_chooser' ), 10, ... | 1 |
de22bc6b8b80d491d2fb702dac8debe0 | d3462dab5c2de9be1e28b819b48d8c54 | Create 3x3 rotation matrix (default around z axis) | def Rot_z3(theta):
R = Matrix([ [ cos(theta) , -sin(theta) , 0],
[ sin(theta) , cos(theta) , 0],
[ 0 , 0 , 1]])
return R | 1 |
bf3ee6fd43d8fd549c482ad9e1bb4737 | 44879ce3f890dc4e64b3a0325b6aa21e | 获取下一个未被访问的顶点
注意此顶点一定要是距出发顶点距离最小的 | if($v<0 && $v>=$this->vexNum){
return -2;
}else{
for($k=0;$k<$this->vexNum;$k++){
if($this->arcs[$v][$k]!=0ik && $this->arcs[$v][$k]<2147483647){
return $k;
}
}
return -1;
}
} | 0 |
a568977ec086a41b3f50b715e0fd5658 | da7f95075088ec7ed6a74de8515497a2 | Displays data relavant to the provided pricingstructure. | public function premiumStructure(); | 0 |
f545c43b83196d8b3460752ff28a166b | 38bbe0c0f4fbd2da62d865279a198410 | 为了模拟大数据量的处理延迟,这里调用Sleep方法将时间延迟三秒 | func sleep() {
fmt.Println("begin to sleep 3 second")
time.Sleep(3 * time.Second)
fmt.Println("finished sleep 3 second")
} | 1 |
4e5c1deed868a70f92b70762a1085677 | e487335cdff48538c1f524b18523426b | 验证bookinLogin.tpl 的登录表单 | function checkBooking(){
var $trs = $("#table_login_input").children().children();
for (var i=0; i<$trs.length; i++){
if ($($trs[i]).css("display") == "none") continue;
var $in = $($trs[i]).find("input[type='text']");
if ($in.length >= 1) {
if ($.trim($($in[0]).val()) == "") {
alert ("请填写“" + $($trs[... | 1 |
3e8c80d8dd89e593398026701dc2ddd8 | f39505d62f28a960de1b321999e22a6b | as soon as we consider this media active, we want to listen to player events. We unregister during LeaveMedia | {
try
{
BackgroundMediaPlayer.Current.CurrentStateChanged -= this.mediaPlayer_CurrentStateChanged;
BackgroundMediaPlayer.MessageReceivedFromBackground -= backgroundMediaPlayer_MessageReceivedFromBackground;
}
catch (Exception ex)
... | 1 |
cea16ecb04e392413deaed4d83055248 | d62d417e1608771ee20ada03ab43f387 | Remove the task force marker. | public class TaskForceView
public void selectTaskForceMarker() {
taskForceMap.selectTaskForceMarker(name.getValue());
} | 0 |
f3982bba321c04e729e90d9962c03a85 | 9fe4645bcc4d7c3cf9133f9151f0ede7 | Count the number of environment attributes in XACML request
Modifies the value pointed to by @a count to contain the number of
environment attribute in @a request. Values from 0 to the value returned
in @a count can be passed to xacml_request_get_environment_attribute() to
iterate through the set of environment attribu... | size_t i;
UNUSED(srv);
UNUSED(con);
for (i = 0; i < sess->request_headers->used; i++) {
data_string *ds;
size_t j;
ds = (data_string *)sess->request_headers->data[i];
buffer_reset(p->tmp_buf);
if (0 != strcasecmp(ds->key->ptr, "CONTENT-TYPE")) {
buffer_copy_string_len(p->tmp_buf, CONST_STR_LEN("HTTP_")... | 0 |
45cca45096ab5f59d34989a0f079e329 | 8ea8656917dd20a06f4e9c1711b9a899 | Return true if this contact can have avatar requested | bool IsContactMraProto(MCONTACT hContact)
{
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
CMStringW szBuff;
if (DB_GetStringW(hContact, lpszProto, "AvatarLastCheckTime", szBuff))
if (DB_GetStringW(hContact, lpszProto, "AvatarLastModifiedTime", szBuff))
return true;
}
return false;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.