query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6ebf0d1d4191734d576ed71d6d916107 | 78aff25b9b6f44353ad13e693805d6bd | This view is for the individual category pages and their respective listings | class CategoryView(View):
# For a given category (settings, cuisines, price ranges, or dinelists), shows all its subcategories in a vertical-scrollable format
# whithin each subcategory, shows all its restaurants as small cards in a horizontal-scrollable format
def get(self, request, category_name):
re... | 1 |
a22bfaf67ef40cb9373a650f5e4bc0b1 | 9f4c8d87e04e70049ed1b52d5990ac18 | Enable NAND Card Host Controller operation and driving clock. | {
u32 ctr;
u32 tmp;
ctr = readl(FIO_CTR_REG);
if (ctr & FIO_CTR_RR) {
ctr &= ~FIO_CTR_RR;
ctr |= FIO_CTR_XD;
writel(FIO_CTR_REG, ctr);
}
writel(FIO_DMASTA_REG, 0x0);
writel(FIO_DMACTR_REG, FIO_DMACTR_FL | FIO_DMACTR_TS4B);
if (flnand.banks == 1) {
flnand.control = flnand.control & (~0xc);
tmp = readl(... | 1 |
f3e79d7744a6e21da95276c48f8f53fd | 40154cbe91c09e8b1f4c96c218dfb07b | Issue the appropriate DROP DATABASE statement. | int is_drop_database(Node *node)
{
return (IsA(node, DropdbStmt)) ? 1 : 0;
} | 0 |
b92f84ba3ea2b680a242dbbacf324971 | ac3f121941401df27546c8f34f02a79a | Function to sum up the flux between a given wavelength range.
Info. about the spectral line center, the width of the region of interest around
the center,and the 'start' and 'end' pixel indices should be contained in the
'line_info' dictionary. | def srwl_und_max_flux_spec(_e_beam, _mesh, _per, _len, _bx_vs_par, _by_vs_par, [_par1_start, _par1_step], [_par1_start, _par1_step], _par1_to_use, _par2_step_to_use, _min_pol_rate): | 0 |
f5ab11789398db6136bfb2d1db1e2e80 | 7f91646183fd6059f13a2770fd323a23 | List all properties for which this entity has values set. This
does not include unset properties. | public ListProperty<T> listProperty(); | 0 |
b61ff7a026af39a0e6cef976c8d0dbd5 | 038f305de6b3c73a14fe2608c1024c80 | Check The Number Of Slides | $uid = ($this->user_id) ? $this->user_id : $_SESSION['user_ID'];
$q = sprintf('SELECT COUNT(*) from s_slide WHERE creatorID = "%s"',
$uid);
return DBMain::$db->query($q)->fetchColumn();
} | 1 |
a591eea469329b6f1e16685f38c4b558 | 0803401ef458184d05384ddfe7e35509 | Computes all n^2 pairs of distances after projection
for each sentence in a batch.
Note that due to padding, some distances will be non-zero for pads.
Computes (B(h_i-h_j))^T(B(h_i-h_j)) for all i,j | x_norms = tf.reduce_sum(x**2, axis=2)[:, :, None]
x_norms = x_norms + tf.transpose(x_norms, [0, 2, 1])
batch_size, max_len, d = x.get_shape()
scalar_products = tf.einsum('bid,bjd->bij', x, x)
dists = x_norms - 2 * scalar_products
return dists | 1 |
6ac6a8f6612cd3e65ac144dd81e5685d | 8e22009adaf2cf95bf5021808cd9b9c0 | Parse out the interesting bits of one line.
Returns (ip, names) tuple, where names is a list of aliases,
else (None, None). | m = re.search(r'^\s*(.*?)\s*\((.*)\)$', full_name)
if m:
return m.groups()
else:
return (full_name,) | 0 |
7c12b3ee3786979f605d754a46c7a7ad | b5aba3e75b453bf7745861408d5d5713 | Replace supported tags. | class Translate extends Command
private function replaceInTags() {
$saved = [];
if ($this->originalString === strip_tags($this->originalString))
return $saved;
foreach ($this->supportedTags as $tag_key => $tag) {
if (!str_contains($this->originalString, $tag))
continue;
$unique_key = 'Tag'. ucfirst($... | 1 |
c325a45aea73f40564f95a73253f2aa9 | f7226cec1726fe076f79ed0acc15b277 | 查询出库单数量 | @Service
@Transactional
/**
* 采购审核实现类
*/
public class CgshServiceImpl implements CgshService
public Integer queryCgshXxNum(Map map) {
return cgshMapper.queryCgshXxNum(map);
} | 0 |
803d71a8372f6c3df08d152f9e66c5ec | 087661bef4deedc8d4a10767e512ba93 | 判断是否需要自动升级,如果已经手工下载覆盖代码,则不需要 | public class UpDataManager
private boolean isUpData() {
if (!"".equals(mVersion_code) && null != mVersion_code) {
int serviceVersionCode = Integer.valueOf(mVersion_code);
int localVersionCode = 1000;
try {
localVersionCode = mContext.getPackageManager()
... | 1 |
3eb6f27f9cb5ac8ca74508184a23e2fe | 02cb5d3a0f776005744caebdd5a02690 | Sets a Layer at the given index. | {
if (!Contains(layer) && (index >= 0) && (index <= layers.Count))
{
if (index < layers.Count)
{
layers.Insert(index, layer);
}
else
{
layers.Add(layer);
... | 0 |
d23a349b2548887e2e0406b56baa2737 | d29a20431ab6304059b8b56a4f31e8d7 | Fixed number of iterations or operations. Does not depend on input size | public class FMMMLayout
public int fixedIterations()
{
return m_fixedIterations;
} | 1 |
5d05df64f1ba07b446354c5231c3b938 | 7bd36738ffeadc514ba36050eadd0486 | Sort the array in place, using the provided comparison callback. | class Container
public void SortItems(CompareItemsCallback compare)
{
int x = 0;
int y = 1;
object item1 = arr[x];
object item2 = arr[y];
int order = compare(item1, item2);
} | 0 |
e4c4d69666f0f3a7b73089139b80b519 | 52724a8c6f21280c436ec569a7b6ee4b | 开始倒计时功能(倒计为time长的时间,时间间隔为每秒) | public class TimerUtils
public void startTimer(TextView tvTimer,int totalTime){
this.tvTimer=tvTimer;
tvTimer.setClickable(false);
tvTimer.setTextColor(Color.parseColor("#999999"));
this.mTotalTime=totalTime;
isCanClick=false;
mTimer = new Timer();
mTimer.schedule... | 1 |
f713f95b490d5003ab886f0c9392ef9f | a37a87f02d2d503e5fca060716b7de4b | Writes a register to the specified by the base and limited by the bit mask
This function holds a spin lock to ensure secure access register writes goes
through. If the secure access unlock register is armed, any old register
write can unarm the secure access unlock, causing the next write to fail. | {
* (volatile unsigned int *)(pBase + reg_offset) = value;
} | 0 |
6ac97d0d3361e11727a08e7628bb5fd9 | 2bed49b23430409a5987aba2c1fc1871 | Returns details for a single load serving entity | class LoadController extends Controller
public function show($id)
{
$load = Load::find($id);
return view('loads.show', compact('load'));
} | 1 |
2e1ed662c2a8b79b26d64e4f096185c6 | d709f98474e6ec77ad2590b5c04d08ff | The dimensions are the 'radii' of the box, meaning 1/2 extents in x dimension,
1/2 extents in y dimension, 1/2 extents in z dimension. All three must be positive. | ( const std::string& Name ,
const double xHalf ,
const double yHalf ,
const double zHalf )
: SolidBase ( Name )
, m_box_xHalfLength( xHalf )
, m_box_yHalfLength( yHalf )
, m_box_zHalfLength( zHalf )
{
if( 0 >= xHalfLength() )
{ throw SolidException("SolidBox(): XHalfLen... | 1 |
008c29fa883d88477f442c7d3d2ff955 | f59879f00fc7370e0e3b77df0fa16f64 | Вопросы из города постранично. | class City extends Model implements StatusDefine
public function questions()
{
return $this->hasMany(Question::class);
} | 0 |
dbdad4c0c9259c79e0abb75935fde6be | 7700cda7f2b88ddfbccdafc93a7902d2 | attempt to detect the packer in use | {
s8 magic[4];
if (pkg->pio->open(pkg, IO_READONLY))
return -CUI_EOPEN;
if (pkg->pio->read(pkg, magic, sizeof(magic))) {
pkg->pio->close(pkg);
return -CUI_EREAD;
}
if (!strncmp(magic, "pac2", 4))
is_encrypt = 1;
else if (!strncmp(magic, "pack", 4) || !strncmp(magic, "PACK", 4))
is_encrypt = 0;
else {
... | 1 |
bc162fe210b4c7719add06e8d24aa980 | ce3c96f25b8dd6df7943212483f694f7 | Gets an existing account from OpenNebula. | {
var x = Search(id);
if (!x.IsSuccessful) {
return x;
}
Account account = (Account)x.Data;
return new Response(true, x.Description, account.GetBuffer());
} | 1 |
dd6fdb3db134fac3e0a2d381ba1c1d22 | fbad884e06a323f53979f400e9903df7 | 把footerView和currentPage设置为初始状态。 | public class PagingListView extends ListView implements AbsListView.OnScrollListener
private void initPagingListView() {
super.setOnScrollListener(this);
footerView = PagingFooterView_.build(getContext());
} | 0 |
a9fd0665807f0e932e528f1aa84f9f93 | f1948c8e8d36b4fc6d7f410adf3b9b2a | gets hidden pk name from configs. | def get_pkey(login, plugin_name):
lang = 'p'
if plugin_name.startswith(f'{lang}_'):
return (login, plugin_name)
return (login, f'{lang}_{plugin_name}') | 0 |
c81b02a55d3cb73a03d6e6e19363d805 | a2f7d93a8f49ff47a7c662d236b7b034 | <p>Return the operation definition with the given identifier that is contained in this dictionary.</p>
definition contained in this dictionary. | if (operationsDefinitionID == null) {
operationsDefinitionID = new ArrayList<IdentifierType>();
}
return this.operationsDefinitionID;
} | 0 |
c0c4e1d06474306fbb2ef2f8bade90b7 | ed51241e747b44284e83507446f03ba1 | Retrives All usuario (profesor) instances ordered by Full Name | queryset = Funcionario.objects.all().order_by('usuario__persona__primer_apellido',
'usuario__persona__segundo_apellido',
'usuario__persona__primer_nombre',
'usuario__... | 1 |
45e9236914f93a2d258350e584805057 | 0aacfdd364f77e94f7b0405533449d72 | Invoked when an item on the recentConversationsListView is clicked. | open class ConversationsActivity(val archived: Boolean = false) :
AppCompatActivity(),
ActionMode.Callback, View.OnClickListener,
View.OnLongClickListener,
ActivityCompat.OnRequestPermissionsResultCallback
override fun onLongClick(view: View): Boolean {
toggleItem(view)
return true
} | 0 |
26ae138f99abc552d3434ad0da0aecec | d3aedccd433be67b19edc77cca23626a | The `charitable_login_form_args` filter allows you to set
the arguments that are passed to wp_login_form().
In this example, we change the URL that people are redirected
to after logging in through the form generated by [charitable_login].
You can include any other parameters that are used by
wp_login_form(). | class AIOWPSecurity_Process_Renamed_Login_Page
function register_link($registration_url)
{
return $this->aiowps_filter_wp_login_file($registration_url);
} | 0 |
6f5bc385d57a2fdd6b7fc2570398c89e | df490cef42abf1a2192c6c9f66afe980 | Gathers an exercise result from the database. | def get_result_from_database():
job_id = request.args["job_id"]
try:
result = (
app.db.query(models.Result).filter(models.Result.job_id == job_id).first()
)
return result.to_dict()
except Exception as exception:
abort(404, description=exception) | 1 |
bf91b1165f69f496a17c257155ac6844 | 83d54ed126cd68124c361bedf4ee2395 | Operation: Update Сustom Field
HTTP Method: PUT
Endpoint: /restapi/v1.0/account/{accountId}/custom-fields/{fieldId}
Rate Limit Group: Light
App Permission: EditAccounts
User Permission: Users | class ProjectsApi
def update_custom_field(id, api_custom_field, opts = {})
data, status_code, headers = update_custom_field_with_http_info(id, api_custom_field, opts)
return data
end | 1 |
3cb5a227e0c46d37071255883c434adf | fd1161ca424b51c9b598f1f4417b9e77 | 设置默认的错误提示信息 | class Base extends Controller
protected function setError($error)
{
empty($this->error) && $this->error = $error;
} | 0 |
dc3a658e8dfa9202ba087e26bea91cba | 63d209138c1a2dddd83934a4ffab0a06 | Функция для представления массива в виде древовидной таблицы | {
?>
<style>
table {
border-collapse: collapse;
}
td {
border: 2px solid black;
padding: 5px;
}
</style>
<table>
<tbody>
<?php foreach ($matrix as $array): ?>
<tr>
<?php foreach ($array as $va... | 0 |
14dbc0f877a2e1b1515cc28fccea6c6d | 69bc972924a105d6c92ebaa19c5af5c9 | 私有方法,用户回复位置信息 | class WeChatController extends Wechat
protected function onLocation() {
$tousername = $this->getRevTo();
$fromusername = $this->getRevFrom() ;
$location = $this->getRevGeo();
$keyword = 'x@' . $location[x] . '@' . $location[y];
$reply = '' ;
$tpl01 = '收到' ;
$tpl02 = '发来的位置消息:' ;
$keyword = "图片... | 1 |
2501767654d0de7942720526a61e88ed | 8410deb1aa7da3546449fddadc9f9d4f | 求一个数组中,出现次数最多的k个数,利用桶排序的思想,注意这里的桶排序空间
复杂度为O(n),桶的下标表示出现的次数,桶的元素是一个List,表示所有出现了
这些次数的元素,厉害 | int divisor = (int) Math.pow(10, len);
ArrayList<ArrayList<Integer>> bucket = new ArrayList<>(10);
for (int i = 0; i < 10; i++) {
bucket.add(new ArrayList<>());
}
for (int i = 0; i < arr.length; i++) {
int c = (arr[i] / divisor) % 10;
bucket.get(c).add(arr[i]);
}
for (Array... | 0 |
b40d7e5a463bb86a00c39618cabdad9c | aaddba6c91db7b4f24d71a2dede5bdae | убираем из адреса возможные пробелы (которых может быть больше одного) и переход строки | public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener
public String deleteSpace(String IP) {
while (IP.startsWith(" ")) {
IP = IP.substring(1, IP.length()).trim();
}
while (IP.endsWith(" ")) {
IP = IP.substring(0, I... | 1 |
a004ce8bc8c6ba469c5fe6b5209d85dc | 34d2671cc76c7a8d9a29d56d2ba0954e | Merge the reference that was recently fetched. This will merge
the branch on the fetched remote that corresponded to the
current local branch when we did the fetch. This is the
second step in performing a pull operation (after having
performed said fetch). | self.fetch_unshallow()
self.git(['fetch', 'origin', pr_ref], check_result=True)
self.git(['checkout', '-f', 'FETCH_HEAD'], check_result=True)
self.git(['submodule', 'update', '-f', '--init', '--recursive'],
check_result=True) | 0 |
78034f129f71e6de993a3ad3094d7895 | 885a1598c5310e3dab0a564045914d5d | Tests for the Acconeer parser | inputs = []
inputs.append('3 E right')
inputs.append('10 A wrong')
inputs.append('30 C wrong')
inputs.append('50 B wrong')
inputs.append('100 A wrong')
inputs.append('200 A right')
inputs.append('250 C wrong')
inputs.append('300 D right')
i... | 1 |
951500239350bf79aa1a24fe8bef3ed6 | 962fe0fd187644c7e7708055e0767a0f | 把root directory读入内存,并把在内存的引导扇区放入Root_Directory数组 | void open_root_dir(struct partition *part)
{
root_dir.inode = inode_open(part, part->sbk->root_inode_id);
root_dir.dir_pos = 0;
} | 0 |
283c1ba5d827f1be11b162b73ce5680b | 62d9633ab52f0fbccee3df4aa94526a0 | Updates the state of each virtual output pin to match
that of the real pins | VOID
)
{
DeviceStreamState oldState;
for ( DWORD dwIndex = 0, dwSize = (DWORD)m_OutPins.size(); dwIndex < dwSize; dwIndex++ )
{
COutPin *poPin = (COutPin *)m_OutPins[dwIndex];
oldState = poPin->SetState(DeviceStreamState_Disabled);
poPin->FlushQueues();
poPin->SetStat... | 0 |
13a9cbfca926960f6ab53009bbc0b124 | b47cb1866d037f5b045340fdaf7e7666 | Looks up a configuration name to find available D-Bus paths to
configuration objects with the given name. | const proxyObject = await this.bus.getProxyObject(this.dbusConfig.baseName, this.dbusConfig.path)
const managerInterface = proxyObject.getInterface(this.dbusConfig.name)
const connectionPaths = await managerInterface.ListConnections()
const connections = []
for (const connectionP... | 1 |
9d911422f92a78b782ba09b18e270052 | 137a9173d3d483b5eb716c5898bbeb2f | Deletes entity_tag items for provided params. | {
if (!$request->isXmlHttpRequest()) {
$this->forward404();
}
$tag_ids = $request->getParameter("ids", array());
foreach ($tag_ids as $tag_id) {
$tag = TagPeer::retrieveByPk($tag_id);
$this->forward404Unless($tag);
Assert::ok($tag->getCustomerId() == $this->getUser()->getCustomerId());
$tag->del... | 1 |
2dcae4525bc13718dfb2ead7146bc577 | 8db6512de4bea0e64276350bad3c55f2 | Returns a rgb tuple given a scalar | def int_color(x):
return (255*(1-x),255*x,0) | 1 |
46d8880d6164131c89f3059ee0601c8a | f3c35f1f4125e75f28ae6f8d508a97da | Получает все соединения из реакции.
Например, результатом для системы, указанной в kotlin doc'е текущего класса
будет список: [<br/> { Br<SUB>2</SUB>, Br, H<SUB>2</SUB>, HBr, H }.] | namespace Org.OpenScience.CDK.Tools.Manipulator
public class ReactionManipulator
public static IAtomContainer[] getAllAtomContainers(IReaction reaction)
{
return SetOfMoleculesManipulator.getAllAtomContainers(getAllMolecules(reaction));
} | 1 |
ba8a2c8599f07e5e8f162eae99b29f2b | 1c24c664367a003305362392b634661d | Gets the integer value query terms. | public int getIntVal() {
return _intVal;
} | 1 |
496d21105d738d9860aeb58d90e6695c | 514f9f4ce134b32d14cbb1a770455ae0 | 로그인된 회원의 중고or 옥션 구매 리스트를 조회 -페이지 | @Controller
@RequestMapping("/member")
public class MemberController extends BaseController
@PostMapping("/selectAuctionMyPage")
public ModelAndView selectAuctionMyPage(ModelAndView modelAndView, HttpServletRequest request, Pagination pagination) {
HttpSession session = request.getSession();
Member member = (Membe... | 1 |
b471380759abe0005f748b897b3d5d94 | a9681a4e887abefec2db3ae6485abc9b | Функция сохранения услуги БЕЗ кассы. | class sbr_emp extends sbr
public function reserve($reserved_id)
{
if (!$this->_openXact(true)) {
return false;
}
$tax_emp = 0;
$pskb = new pskb($this);
$lc = $pskb->getLC();
$dvals = array('P' => pskb::$exrates_map[$lc['ps_emp']]);
foreach ($this->... | 0 |
2c41b14b7571bd196b9bd24e0e9c6488 | 139808af466f5a184fef3b5dc6db940a | Number of Guild objects in the cache.
Count will be inaccurate if the GUILDS intent is disabled. | class DiscordBotsOrgAPI:
def guild_count(self):
try:
return len(self.bot.guilds)
except AttributeError:
return len(self.bot.servers) | 1 |
e0c2db6236202e77162a2b537c766dc5 | 64e6d11eed1e2b211cca1363b07b4503 | run.
Start the Action Service. | class SMWinservice(win32serviceutil.ServiceFramework):
def SvcDoRun(self):
self.start()
servicemanager.LogMsg(
servicemanager.EVENTLOG_INFORMATION_TYPE,
servicemanager.PYS_SERVICE_STARTED,
(self._svc_name_, ""),
)
self.main() | 1 |
13fa564b18e17c087ce4fb387027b76a | 756df88dc835cef9619d9742ba65cacb | Connect to the instrument using GPIB connector | class Driver():
def __init__(self, gpib_address):
rm = pyvisa.ResourceManager()
self.instrument = rm.open_resource(gpib_address) | 1 |
c8ef2e440acb06f9e354a917e05306fb | 50ccc0885c2a30bf2e6cccd436cdada4 | ensure that some action is performed even if everything doesnt go well | def try_finally1():
try:
print('in try:')
print('do some stuff')
float('abc')
except ValueError:
print('an error occurred')
else:
print('no error occurred')
finally:
print('always execute finally') | 1 |
4e09b24a88f7e5676d356fb436410106 | bbb4759687743dbc139b6dd050c6f84a | set learning rate and iteration numbers to get a better result. | class LogisticRegression(object): #implements an instance of logistic regression
def __init__(self,learning_rate=0.1,iterations=7000):
self.learning_rate = learning_rate
self.iterations = iterations | 1 |
b01736b25058b9c6c9963adaf3f26123 | 2c9b69778e94643a680aef97e1f32e4b | 判断每个字符是否都是0-9的数字字符 | for(item in s){
if(item=='0'|| item=='1'|| item=='2'|| item=='3'|| item=='4'||
item=='5'|| item=='6'|| item=='7'|| item=='8'|| item=='9'){
return true
}
}
return false
} | 0 |
8526e3d09bf1e95a768c1bd59914005f | b1b608d412dbf982a8f58c84d1b80a93 | 获得一篇帖子详细信息 | func getPost(id int64) (postInfo common.PostInfo, error error){
var (
post models.Post
meta models.Meta
tags []*models.Meta
)
o := orm.NewOrm()
fmt.Println("the query post id is ", id)
err := o.QueryTable("post").Filter("id", id).Filter("status", 0).One(&post)
if err == orm.ErrMultiRows {
fmt.Printf("Retu... | 1 |
21f3df277dee384e9b52c30286d45878 | ae78bfbea4d7efcca0e90229c7877504 | 获得数据修改后的数据,并ajax传给后台 | class Wanhuu_administeation extends CI_Controller
public function edit_ajax()
{
$admin['admin_id'] = $this->input->post('id');
$where['admin'] = $this->input->post('name');
$where['password'] = $this->input->post('pass');
$row = $this->db->update('admin', $where, $admin);
i... | 0 |
9ef7d33bbf4ba86262e2f06879d0d23c | 8267d57f32eff8441ad994b9c0248046 | Save account history in db | SharedPreferences sharedPreferences = PetalApplication.getContext()
.getSharedPreferences(SP_HISTORY_ACCOUNTS_FILE_NAME, SP_READ_WRITE_MODE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putStringSet(PREF_HISTORY_ACCOUNTS, accouts);
editor.apply();
... | 0 |
90c36a2441405e4d57754571d9842980 | 4fd3be943fe7b2110e5e0e7e1f72b3c1 | Tests for whether a specific user should have the right to delete a instance within a repository. | namespace ISISNotesBackend.Core.Repositories
bool CanUserDeleteNote(Guid userId, Guid noteId); | 1 |
491688136f5a7d0a03c7afe84b3f9272 | 9634b9744b32f5ec76a8e01e338b945f | Plot the signal-to-noise-ratio-spectrum that has been calculated for
this data. | fig, ax = plt.subplots()
wave, snr = self.result['1d']['sn']
ax.plot(wave,snr)
ax.set_xlabel('Wavelength ($\mu$m)')
ax.set_ylabel('SNR')
fig.show() | 1 |
0ef45c5c2f42c0ea06954870c1142f3d | 2d73bd4b11a8bdce5247662a36c58375 | get all CustomEvents using Reflection | {
foreach (var eventInfo in type.GetEvents())
yield return eventInfo;
foreach (var subInterface in type.GetInterfaces())
foreach (var eventInfo in this.RecursiveGetEvents(subInterface))
yield return eventInfo;
} | 1 |
2409bb193c22a02bfe61a0d6ee91b1a7 | b7f263ad945c87082ff60b082e77a72b | returns a pointer to the file name | const char **get_fname(void)
{
return _prsfs_filename;
} | 1 |
3578435cd97a086faffeec68aeaa02b4 | 8172cdb775c1f811425aef945fad85d4 | Ventas por ano especifico_internet | print (SEPARADOR)
print("Consulta de ventas")
print (SEPARADOR)
cuenta = ("select count(clave) from venta")
c.execute(cuenta)
rtotales = c.fetchone()
if rtotales:
fecha_consultar = input("Dime una fecha (aaa-mm-dd): ")
... | 0 |
574a77c427804988359943199c22d961 | 39aa9b7bf64eb46af16f01f2da0b4d75 | This function creates a giant SQL OR statement that restricts
the files you can select from to files owned by any of your friends.
It assumes you are joined to the Users table. | username = session['username']
cursor = conn.cursor()
query = 'SELECT DISTINCT group_name, username_creator FROM Member WHERE username_creator = %s'
cursor.execute(query, (username))
fgownerdata = cursor.fetchall()
cursor.close()
return render_template('addToFriendGroup.html', fgownerdata=fgownerdata, fullname =... | 0 |
05961762c2f8310ae1dce50cc50caf71 | f98173e2db28675626bc2a847b6913ac | 如果使用可变列表做默认参数,那么没有指定乘客的实例会共享同一个乘客列表 | class PassengerRepository(object):
def get_passengers(self):
return self.__passengers | 0 |
665903db5c3f173a4f77db4ce422ef8a | 47bcf429e1bc94bbe7e69db1b0d27f4d | 新增折扣时间段 | function doAdd() {
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
if (startTime > endTime){
layer.alert("开始时间不能大于截止时间!");
}else {
var addJson = {};
addJson.discountType = $("#discountType").val();
addJson.mainStadiumId = $("#mainStadium_id").val... | 1 |
22e8c2a65cd393dd7e677f49edf91175 | 429024f0cbe33487f3b3a293fca3fbfd | takes in a 3d point and projects it into 2d | void convert_point_3d_to_2d(Point3d inputPoint, Point2d outputPoint){
} | 1 |
8859a6d41ead5f20f6e28217e73fb105 | c0dc0a0c71c814cce47730d0071cf354 | Compute and return the empirical cost of a parameter configuration on the subset of provided instances we have runs for. | class MonteCarloIndex:
def costMoment(self, costEstimatorValueArguments):
return self.costEstimator.value(*costEstimatorValueArguments) | 0 |
f84d74ad1b53992b5b7d724840f9c8f4 | 7f61448ad6da3ef0f9cb03f40c5be655 | ******* DEFAULT CONSTRUCTOR ***************************** | cases like (1) | 0 |
8469b39adfcdd6cb8a08d58774dbfd25 | 263663a8500523ab459741164b983671 | Called when the import process has completed and we have a prefab ready to go | {
if (Application.isPlaying && isPlayed)
{
nextPrefab.SetActive(true);
director.transform.parent.gameObject.SetActive(false);
}
} | 0 |
6656e6202b98e1af8a32c5f357847c67 | 7439b9295c81c18a3666a4c34b7e5c69 | Count ticket comments | $sql = 'SELECT COUNT(*) FROM comments '
. 'WHERE id_ticket = ?';
$request = $this->executeRequest($sql, array($id_ticket));
return $request;
} | 1 |
9becff064441e0d519fce0142c49e6f9 | eb9ebe350a92a6d3c10c474b0a8b0135 | Returns the accumulated Hi byte of the checksum | def HI(x): return _eval(x) >> 8 | 1 |
0ffd3811fd65d9745b9301e27c4e446e | 18ab1d612c4a63a3ecb835b34d131934 | Metoda vrací cestu k upgrade adresáři | class Install_Core
public function getUpgradeDir()
{
return $this->getInstallDir() . self::CORE_UPGRADE_DIR . DIRECTORY_SEPARATOR;
} | 1 |
cfe830962f16793464f7953e6c954754 | add0e40b83aaf03fc1d996266e375428 | {@code GET /player-money-transactions} : get all the playerMoneyTransactions. | @Singleton
public class TransactionController extends Controller
public Result list(Long userId) {
return wrapExceptions(() -> {
userExistenceValidator.validate(userId);
return ok(toJson(transactionRepository.findAll(userId)));
});
} | 1 |
121a4f5babf519f524d8034c71270239 | 829f760e361814943890f837eb6ea785 | Gets the region for the locale. | class Bal_Locale
public function getRegion(){
return $this->Zend_Locale->getRegion();
} | 1 |
ba039f9ed4e3a16c22678e94e3daf728 | a20e905c1e06f1739e72de8550db7a67 | updates routing table | for (int i = 0; i < N_IFACE_ON_BOARD; i++) {
if (!update) {
make_response(i, RIP_MULTI_ADDR, entries);
} else {
std::vector<RoutingTableEntry> cur;
for (auto &entry: entries) {
cur.push_back(entry);
if (i == entry.if_index) cur.back... | 1 |
c331fd2488523b63244b4aa613433fc3 | 645adbf3ec31da39488330435d94b57b | Cancel the manager override operation. | void QBtCanOverwrite::cancel()
{
done( CANCEL_FILE );
} | 1 |
07ada3972695f50cd4887424e74328ef | f41e09f661ab54f4b6418952894aa480 | Seed database with all recipe data from list of urls. | seeds = []
repoMetaData = json.load(open("../bucket2.json", "r"))
try:
os.mkdir("repoData")
except OSError:
pass
for repo in repoMetaData:
name = repo["full_name"].replace("/", "-")
try:
os.mkdir("repoData/" + name)
... | 0 |
8f2b1636ac421d31d6b2e9c9512fce69 | 756465bc4d7850e1137691d94d706d17 | Set sourceInvAccount | class AllowTrustOperation private constructor(
/** The account of the recipient of the trustline. */
val trustor: KeyPair,
/** The asset of the trustline the source account is authorizing. For example,
* if a gateway wants to allow another account to hold its USD credit, the type is USD. */
val ass... | 0 |
933e0fc060d2f09e1583f7f8e2823a43 | bab14ddc8ba566a149d7fc5bb9f2d6d8 | Performs Tukey's Honestly Significant Difference (HSD) Test. | def pairwise_tukeyhsd(endog, groups, alpha=0.05):
return MultiComparison(endog, groups).tukeyhsd(alpha=alpha) | 1 |
f1cff00edcb07a8498874b673d948570 | 93df0c63d11340d33c8e7868baa07554 | The second derivative of the phi function | def Dyy(phi,dxy):
calc = (phi[2:,:] + phi[:-2,:] - (2 * phi[1:-1,:])) / (dxy**2)
return(calc[:,1:-1]) | 1 |
ee58b5843d8d39e13ee009523f04611e | 4d38179d8f54c6786df2de6cdfacbab0 | Creates a socket connecting to the given ip adress, performing a DTLS handshake | receiver_addr = socket.getaddrinfo(ip, port)[0][-1]
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.settimeout(socket_timeout)
t1 = time.ticks_ms()
try:
sock.connect(receiver_addr)
return sock, None
except OSError as e:
print("Socket failed to connect to", r... | 0 |
6cb30beef2003cb400a7610b6a3ed745 | 62b0087583a9d12e87f86063f6e4bec8 | Deletes all items that have been consumed by the player | self.potions = []
self.scrolls = []
for item in self.consumables:
if item.type == 'potion':
self.potions.append(item)
if item.type == 'scroll':
self.scrolls.append(item) | 0 |
c416815a928540f3343dffb274075c31 | 3ea1de868bcc2d456d61c74131ab0b47 | This function simply introduces the labels, it will see how many objects the operator
wants to track, the operator will also get to specify the names of the objects
Returns | class MockLocateObjectOperator(Op):
def setup_streams(input_streams, image_stream_name, depth_stream_name,
trigger_stream_name):
input_streams.filter_name(image_stream_name)\
.add_callback(MockLocateObjectOperator.store_color_image)
input_streams.filter_name(depth_strea... | 0 |
9d299c75a874392ec756a819d876138d | e13fbce721c8d950febaea32e68078df | ボーナスを付与したら、上限数に超えるか | namespace Cubra
public class DailyBonus : MonoBehaviour
private void CheckQuantityBonus()
{
if (PlayerPrefs.GetInt("bonus") > 0)
{
_bonusButton.gameObject.SetActive(true);
_effect.gameObject.SetActive(true);
_effect.Play("ShiningRepeate... | 0 |
abdb58a0b1138ce56e9b92e2b7c32ae0 | 803fdb0b6c126701240fed42351d1766 | Inicializa las acciones de los botones flotantes | this.fabJuegos = (FloatingActionButton) getView().findViewById(R.id.fabJuegos);
this.fabJuegos.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
DetalleJuego detalle = new DetalleJuego();
FragmentTransaction tr... | 1 |
14e6fb9ef04d62f9e8e2729468c7be27 | a3a2074137f5e7a58687d370eb99cacb | Returns whether nested transactions will be created if
<code>run()</code> is called when a transaction is already active for
the current thread.
By default this property is false.
<p>Note that this method always returns false in the JE product, since
nested transactions are not supported by JE.</p> | namespace biz.ritter.javapi.sql
bool supportsDataManipulationTransactionsOnly()
; | 0 |
f5d0ef95f18f57ad73d8f4faae70a97f | 0c52936aa6695bd5aa934d7477d41ab5 | 设置顶部面板 | function setMainPanel(divId,cmp){
gridHeight = screen_height ;
var mainPanelCmpItem = [] ;
if(Boolean(tipCmp)){
gridHeight = gridHeight - 30;
mainPanelCmpItem.push(tipCmp);
}
if(Boolean(queryFormCmp)){
gridHeight = (gridHeight - 100) ;
mainPanelCmpItem.push(queryFormCmp);
}
if(Boolean(cmp)){
if(cmp ins... | 0 |
5ea274fbc4daa7d2f8fc27bd23c54a0e | 172d3ad5b86a130ab94fcac522db370c | first determine if we should update an existing story
or add a brand-new story by checking the story identifier | class StoryActivityStreamsSerializer(serializers.BaseSerializer):
def create(self, validated_data):
try:
story = Story.objects.get(json=validated_data)
return story
except Story.DoesNotExist:
pass
story = Story.create_from_activity_stream(validated_data)
... | 1 |
6fbd4310eb26921f0bcb33af1287b24b | f345839f41fb2032e236b9fc619833e5 | Check if Whatsapp Joined Analytic has been saved at DB | return new Promise((resolve, reject) => {
documentModel.findOne({joinURL}, (err, data) => {
if (err) {
reject('serverError');
}
data ? resolve(true) : resolve(false);
});
});
} | 1 |
3f78893ff1c37467848451788a4e203a | 2c619e8d99a9d130ed1c4cb2de536bf9 | block ui before ajax calls | function break_fun() {
$.unblockUI();
} | 0 |
fe103d7de662ea39a0ca73d91fb0f867 | 311dc678d90e5e6788dff391c1af0c0e | Comprueba si la colección contiene al menos un elemento del tipo
especificado. | public static partial class EnumerableExtensions
public static bool IsAnyOf(this IEnumerable collection, Type type)
{
foreach (object? j in collection)
{
if (type.IsInstanceOfType(j)) return true;
}
return false;
} | 1 |
53ad64377ad400b79ce7717c0180076d | 6062adae2ce497de8364889fc2a29fa5 | Every simulation cycle generate a probability to create a transaction | double randomValue = random.nextDouble();
if (randomValue < clientsProbabiblity_Q) {
createClient();
}
if (randomValue < maintenanceCrewProbability) {
createMaintenanceCrew();
}
} | 0 |
5977406d7c3f8f33407ab57ab01c7513 | f57b2f72881d732cb28edab5dbba08ae | 强制Seek到播放开始状态,以便重新开始播放 | public class RecorderBroadcastVideoActivity extends BaseActivity implements SeekBar.OnSeekBarChangeListener,
MediaPlayer.OnErrorListener, MediaPlayer.OnCompletionListener, MediaPlayer.OnPreparedListener
@Override
public void onCompletion(MediaPlayer mp) {
mVideoView.seekTo(0);
videoSeekBar.s... | 1 |
d70a37a7592c5d5028255b4dbc15173d | a14d0521259beb706cdf7ba73b346f79 | Vraca zahtev za trazenje psa. | @Service
public class RequestService
public void sendOwnerReq(User user) {
Request req = new Request();
req.setDescription(GET_OWNER);
req.setUser(user);
requestRepo.save(req);
} | 0 |
a94adebfd1d457c129b70ee66b71d7d1 | 7f5aea98a7e528c43ff9dd2171367e9a | Should return list of directories in current folder. | f = []
for (dirpath, dirnames, filenames) in walk(os.getcwd()):
f.append(dirpath)
return f | 0 |
041ea28dcfeec4a2656bc86c642aaad9 | 010da2a84cc9dd6f4c083ab91a97c860 | Pulls out the comand line, process name, and process path out of a string, if possible | data.strip!
space = data.index(" ")
if space
cmd = data[0, space]
param = data[space+1, data.length - space]
param = nil if param.strip.size == 0
else
cmd = data
param = nil
end
return cmd.downcase, param
end | 0 |
84c268c2a1c367e93547b5b88280bed1 | c3c4d152f2ae5cb52afb28ae78a06c56 | The prepartitioning representation of a Number Partition Problem solution is
simply a sequence P of values ranging from 0 to (n - 1) where n is the size
of list of numbers ot partition. A random solution can be obtained by generating a
random sequence of n such values. | max_n_bit_number = 2**bitlength-1
self.S = sorted( [ randint(0, max_n_bit_number) for i in range(n) ] , reverse=True)
self.t = randint(0,n*max_n_bit_number)
self.n = len( self.S ) | 0 |
a2f9bd3a821204a3d515d672dd83e074 | 2a9ef8979b87c32f6071d4043f93d95c | Изменяет mood у нот с start до end | class MyFirstProgram(QWidget):
def cut(self, song):
try:
if self.sender().text() == 'Играть':
self.start = int(self.m_input.text()) * 1000
self.end = int(self.mus_input.text()) * 1000
if self.start > self.end or self.end > len(song):
... | 0 |
c20fab357c49f1ed7f826dc5a3dbc893 | 7c10545b37dfe533916bcf0101c10113 | Returns the id of the parent page of a page | $pages = FLPageManager::instance()->listAll();
$parent_handle = self::_createAncestorFilename($page_id, $pages);
return (string) self::$page_prefix.trim($parent_handle, '_');
} | 0 |
e5a00b6edf4318c16838d522d7e05efe | 3179ac94fca6312ba47acc8e294d2434 | Función para el despliegue del cuerpo de la encuesta. | $html .= "<div id=\"p$iPun\" class=\"collapse\" role=\"tabpanel\" aria-labelledby=\"c$iPun\" data-parent=\"#accordion\"><div class=\"card-body\">";
$iNue = 0;
foreach ($aAps as $iApa => $aApa) {
$sApa = $aApa[0];
$sSub = $aApa[1];
$sTxt = $aApa[2];
$html .= f_getActaCuerpo($i... | 1 |
e24b03657fde4bf5dce33f1a651c76f1 | 0f14fe591f11bf2970072a694c638166 | 管理员正常下架广告 | public void shelfAds(Integer id) {
Nlcads nlcads = nlcadsMapper.selectByPrimaryKey(id);
Byte status = nlcads.getStatus();
if(status == 1) {
nlcads.setStatus((byte)0);
}else {
nlcads.setStatus((byte)1);
}
nlcads.setTime(new Date());
nlcadsMapper.updateByPrimaryKey(nlcads);
} | 1 |
0339775de356738b0160ab0b65d14fe7 | 26f521e6a5bd783c1c9838f9733699c6 | 如果为新角色解锁,发送系统消息 | {
Role::Ptr role = RoleManager::me().getById(roleId);
if(role == nullptr)
return;
auto rev = reinterpret_cast<const PublicRaw::RequestZhuansheng*>(msgData);
if(!rev)
return;
if(rev->sceneItem == SceneItemType::role)
{
role->m_zhuansheng.requestZhuansheng();
}
else if(rev->sceneItem == SceneItemType::hero)... | 0 |
94cd51fa586f88bdfec5899803aac827 | 06541bfd8013563a20ab75373ed6790f | Unterbindet das Klonen des Objekts (Singleton) | class Singleton
final private function __clone()
{
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.