query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8fe13675b78fc7623230e4df18508bf5 | 7c5151cdec7eadec7df3034855032fe9 | Retrieves all active Product Instances from all stores | List<ProductDto> getAllActiveProducts(); | 1 |
c614f0e4cda44cb63a687fc05da8f3e6 | 039b2c1a056670e57fb597b161e44452 | TC - NULL parameter test for openSession (output as NULL) | TEST_F(FwdLockTest, ConverterWhiteBoxNullCheck02) {
int sessionId;
EXPECT_EQ(FwdLockConv_Status_InvalidArgument, FwdLockConv_OpenSession(&sessionId, NULL));
} | 1 |
6d6523e1e783b0b7af0100ca6cfaac0d | 3a73336123e3d071aa628757163a093a | Display Subcetegory When Change Category. | var cat_index = $("select#category option:selected").text();
var newOptions;
if (cat_index === "Textbook"){
$("div#sub-category-div").slideDown(500);
$("#sub-category option").remove();
newOptions = {
'':'',
'math' : 'Mathematics',
'engg' : 'Engin... | 1 |
9ca88fe0b2ab45eec69fbc47a169918c | dfad8366c07936ba6edb6e0c72622a5f | 获取Team的敏感信息,例如JoinCode | func cmdTeamSensi(rd *bufio.Reader, hdr MsgHdr, s SessionInfo)(string, error){
jsonline,err := rd.ReadString('\n')
if err != nil{
m.Print(err)
return CmdNetFault, ErrFatalErr
}
var t TeamIdenti
dec := json.NewDecoder(strings.NewReader(jsonline))
err = dec.Decode(&t)
if err != nil {
m.Print(err)
retur... | 1 |
f45d8ee8cb872f8e285f55e5f2374d13 | 193c7799a5974fe044d7a7b9ddeaa45c | Método que, dado el identificador de una película, devuelve la lista de etiquetas
de la perícula | namespace Es.Udc.DotNet.PracticaMaD.Model.EventoService
Collection<Etiqueta> EtiquetasDeComentario(long idComentario); | 0 |
165e809b96e1c0a65533a16f97254619 | faca86ac9e6cd6cd32429eb0bd9e8880 | 为edittext添加文本事件,价格不能以0开头 | class NumMoneyView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : AppCompatTextView(context, attrs, defStyleAttr)
override fun onTextChanged(s: CharSequence, start: Int, lengthBefore: Int, lengthAfter: Int) {
var money = s.toString()
if (money.startsWit... | 1 |
a9d4067c1f7607064e5d05325c45df98 | 5dfffd9121c5064c70a8f490d81ce95f | right upper arm | function drawRarm() {
ctx.beginPath();
ctx.moveTo(185, 120);
ctx.lineTo(225, 110);
ctx.stroke();
} | 1 |
6f67a8f02f6c05a90d029eb217db1a83 | b4a8986db5d824a43e075e468284de4b | Finalizes the application and exits to the host OS. | namespace LaunchPadNet
internal class MyApplication : IDisposable
public void Exit()
{
try
{
CmDataCapture.Capture( CmDataCapture.MaskError, "MyApplication::Exit() calling Abort()" );
Abort();
}
catch( DllNotFoundException e )
{
CmDataCapture.Capture( CmDataCapture.MaskError, "MyApplicati... | 1 |
862920bb8981b821fe76fac6df1279da | aa87af7728a78963326f2bed2bb49a03 | Get the chance of upward particle movement. | public class EnemyStateMachine : BaseCharStateMachine
public bool TryGetUp()
{
Debug.Log(StartWP + ", " + Turns_Down);
int MaxRNG = 100;
int GUpChance = Mathf.RoundToInt(((StartWP / Stats.WP.Base) + (Turns_Down * 0.1f)) * 100);
if (GUpChance > MaxRNG) GUpChance = MaxRNG;
int ... | 1 |
d49026154378e5927ba78f3499316193 | ca305da4ca66d5c6c4de2d2e1fda30f8 | 题意:给你一些数字,让你重新排列,使得相邻的数字不相同,任意排列都行。
解法:贪心地先输出出现次数多的数字。
例子:
111122233
121213132
【相似题目】
621. Task Scheduler,358. Rearrange String(LOCKED),767. Reorganize String
跟上面的做法略有不同,不用间隔一位插入数字了,但是要每次poll完之后更新pq,跟621做法一样。
时间O(n log n)
对于[1,1,1,2,2,2]comparator一定要有a.getKey() - b.getKey()是否相等的判断,
否则会出现1,2,2..这样的情况。如果严格按照顺序去offer和poll... | int main() {
int d, n;
scanf("%d %d", &d, &n);
vector<int> s;
s.push_back(d);
int k = 1;
while (k < n) {
vector<int> sTmp;
vector<int> sTmpN;
sTmp.push_back(s[0]);
sTmpN.push_back(0);
for (int i = 0; i < s.size(); ++i) {
if (sTmp[sTmp.size() - ... | 0 |
89b0c8b28b2f78a1ef9e3987ee36d984 | e4ee24ba41651ee083e1c9cddd4db67a | Averages paper features to authors. | def PTAAverage(g, coeff, autcoeff):
npubs = {aut : 0 for aut in autcoeff}
for n in g.graph.getNodes():
laut = g.graph["authors"][n]
for aut in laut:
autcoeff[root.id2aut[aut]] += coeff[n]
npubs[root.id2aut[aut]] +=1
for aut in autcoeff:
autcoeff[aut] = autcoe... | 1 |
e473d5e66a270c8670ae158af1da15fb | b529300b0ee3ac34dec271056bac8a93 | Обновляем количество товара в корзине | class GoodsForm extends Model
public function re_count($id, $color, $size, $qty)
{
for($i=0; $i<count($_SESSION['basket'] ); $i++)
{
if($_SESSION['basket'][$i]['id']==$id&&$_SESSION['basket'][$i]['color']==$color&&$_SESSION['basket'][$i]['size']==$size)
{
... | 1 |
845c81b2f65d3633438ee2d5daa2e7a8 | 022b1d09e8834e6eab9ef23260c600f1 | Loads elements from a given data input, storing them in a given big array. | size_t load_array(FILE *input, float *outarray, size_t nelem) {
size_t count;
for(count = 0; count < nelem; count++) {
int result = fscanf(input, "%f ", &outarray[count]);
if(result < 1) break;
}
return count;
} | 1 |
c60f437fbea00d69e69466b873206920 | 5035b618f3a13bba62be09512d5bd0df | 计算不同还款方式的每月利息收益 或总收益 | class InterestFormula
private function __04()
{
$i = 0b0001;
$Lx = bcmul($this->return['amounts'], $this->return['m_rate'],2);
$Se = bcmul($Lx,$this->return['s_rate'],2);
$this->return['i_total'] = self::__Fn($this->return['amounts'] * $this->return['y_rate'] / 12 * $this->return['period']);
$this->return['... | 1 |
17e3b1dcd70a94d6c5815f74ce293f10 | 69fdc3a9f35c4b2490b00aa186d4f7be | Status queries go to the primary shard. | const std::string& dbname,
const BSONObj& cmdObj) const {
return Status::OK();
} | 0 |
af3863b40604803e8a3060830fd5b025 | 15f07e105551c2d764fad47fe3ea9e63 | 将元素转为XPath格式 | {
string strXPath = "";
try
{
while (htmlEle != null)
{
int ind = GetXpathIndex(htmlEle);
if (ind > 1)
strXPath = "/" + htmlEle.TagName.ToLower() + "[" + ind + "]" + strXPath;
... | 1 |
3fa961d445cf6f7d8855bc471295d6f6 | 9e982420cc541588c671ba964e8101f2 | 读取dat文件中的数据,转换成浮点矩阵
Input parameter:
filename为文件路径 | def reader(filename):
data = []
f = open(filename,'r')
for line in f.readlines():
row = line.strip('\n').split('\t')
data.append([float(i) for i in row])
data = np.array(data)
f.close()
return data | 1 |
211fb4ccd60235bd758e217d4c7ed4fa | 4fe362b43dbe2526dcb3512c36ad85b9 | チュートリアルをするかどうかのボイスを流す | namespace Waifuloater.Displair
public partial class Showcase : Form
private void Play_Ha_Gu_Ut( )
{
VoiceEngine.Play( "TestVoices" );
} | 0 |
d57b2c47ff7a5ced3cf6b1a5d5634a2b | 6554b0c3060c81b4944265ec476b0926 | create callback to parent activity | public class TweetDetailsActivity extends AppCompatActivity implements View.OnClickListener{
@Override
public Intent getSupportParentActivityIntent() {
finish();
return null;
} | 0 |
d5760f6de280a80e95f4033601a6edb9 | 4f8171e1886fca85cc07b9960b232986 | determines whether it is a read, write, or read and write event | {
return ($a_event == "updateStatus" ? "lp_event" : ( $a_event == "addParticipant" ? "member_event" : "unknown"));
} | 0 |
a32b61f0c55fb6a38c3dbdde7da0901d | ce792341296b6173feb261cdf6cfad23 | Actualizar grupo de torneo | class TorneioSaoPaulo extends Model
public function save()
{
$matches = $this->getmatchresults();
$sql = new Sql();
for ( $i = 0; $i < count( $matches ); $i++ ) {
$sql->query( "UPDATE tb_groupmatches SET goals1 = :GOALS1, goals2 = :GOALS2, isfinished = 1 WHER... | 1 |
f0ac240b71a90168e7304e1325618611 | 5d5737ea9ce3c880beaa3054cf606a2a | Simulates a possibly non-integer time delay and added noise. | const baseDelay = minutes * 60 * 1000;
const delayMS = delaySeconds * 1000;
const minimumDelay = delayMS / 2;
const randomDelay = Math.random() * minimumDelay;
const totalDelay = Math.round(minimumDelay + randomDelay);
if (Math.random() > 0.5) {
return baseDelay + totalDelay;
}
return baseDelay - to... | 1 |
df6566a607bd898c60f7d815a305f192 | ff982c42227b4941fbb253912ec7406e | Obtém o nome da area (se existir) concatenado com o nome da controller do ControllerContext informado. | namespace MSFramework.AspNetCore.Extensions
public static class ActionDescriptorExtensions
public static string GetControllerName(this ActionDescriptor actionDescriptor)
{
actionDescriptor.RouteValues.TryGetValue("controller", out var area);
return area;
} | 0 |
01c7491700d17e098efd39fb2e6884ed | 0832b29dc45ecdc41e135f692229f554 | Function used to calculate the isolation mass. | mn = get_mn_mass(g, g_sub)
mw = get_mw_mass(g, g_sub)
if mn > 0.0:
return mw/mn
return 0.0 | 0 |
5ae94b8bdffc50fe2c24def0462463cf | 7b242e2eaf29d7a44c4e8df85d9540d6 | 过滤文件 | public class MyFileFilter implements Runnable
private void fileFilter() {
MyFile myFile = null;
try {
myFile = fileReaderQueue.take();
} catch (InterruptedException e) {
e.printStackTrace();
}
if (myFile != null) {
String name = myFile.getFile(... | 1 |
96f4ddde348680cb9cbfb3d9f5447720 | 5fcae52610d4e295b3897c85da089a00 | logprobability function used for mcmc fitting with two line components. Loglikelihood is just classic
sum of residuals^2/error^2 | def log_like(theta, data, sigma, x):
m, c = theta
md = straight_line(x, m, c)
return -0.5 * np.sum(((md - data)/sigma)**2) | 1 |
f02ece87730a005496ca09f8e14ae22a | fff4bb36b5fce356347c9efcc2f0b8ef | 通过map查询单个展会信息 | @Service
public class WhgDigitalExhibitionService extends BaseService
public WhgDigitalExhibition srchOne(String id) {
return whgDigitalExhibitionMapper.selectByPrimaryKey(id);
} | 0 |
3efe21f003564401d649622e63c3cda4 | f674e483ea85e20f58dfe2033fd036f6 | 判断是否在appStore的审核期 | class pay
public function check_appstore_orders($orders)
{
set_time_limit(30 * count($orders));
foreach ($orders as $k => $v) {
if ($v) {
$myorder = $this->_orders_list->get_one("`orderid`='" . $k . "'");
if (isset($myorder['channel']) && $myorder['channel... | 0 |
718d3a0f87ba8b32dbc96a98d5a8282c | e40a0b66a813a9678ff89d39cde6712b | Scroll to where the caret is. | rawpos = 0
for i in range(self.__cursor_pos):
rawpos += self.GetTextExtent(self.get_text(i, i + 1))[0]
xsize = self.Size[0] - self.padding * 2
pos = self.xoffset + rawpos
slop = pos - xsize
if slop > 0:
slop += self.GetTextExtent("M")[0]
... | 1 |
1605267f92084c50af4ee439e78af14f | e97a53ce01a8c10ff383309e404342ff | <p>
Lists all of the AWS DMS attributes for a customer account. The
attributes include AWS DMS quotas for the account, such as the number of
replication instances allowed. The description for a quota includes the
quota name, current usage toward that quota, and the quota's maximum
value.
</p>
<p>
This command does not ... | namespace Amazon.DatabaseMigrationService
public partial class AmazonDatabaseMigrationServiceClient : AmazonServiceClient, IAmazonDatabaseMigrationService
public virtual Task<DescribeAccountAttributesResponse> DescribeAccountAttributesAsync(DescribeAccountAttributesRequest request, System.Threading.CancellationToke... | 1 |
e5397737529811f3b8b65e758d42680c | 47d6dd7f43b585838b7c98a84397013a | Triggers prior to getting the groups assigned to a specified user. | void doPreGetUser(String uniqueUserId) throws IdentityStoreException, UserNotFoundException; | 1 |
5572ea9a23bc86888828726b2adab3a3 | 93f76feab2457462138e92c310f66947 | 加速计校准 | void gyro_cal(SI_F_XYZ *gyro_in)
{
if(cal_gyro.flag==1)
{
if(cal_gyro.i < gyro_cal_sum_value)
{
cal_gyro.offset.x += gyro_in->x;
cal_gyro.offset.y += gyro_in->y;
cal_gyro.offset.z... | 0 |
4084055cef7f15b53cfdf6ddd20bd24b | 43caf675f8ee299e2c98f67988fe1692 | Allocate space for pointers. | Addresser::Addresser()
{
pMemoryDebug = (char **)malloc(N_SLAVES * sizeof(char *));
pMem_classDebug = (Mem_class **)malloc(N_SLAVES * sizeof(Mem_class));
} | 1 |
066f2cd1780e4b4211b36e31a9fc8e92 | 04f3ae0485a086cdd8f911577e25d4b7 | 读取接收方邮箱列表 | public class TransUtils
public static String GetMailRecivers(){
Properties prop = new Properties();
InputStream in = Object.class.getResourceAsStream("/fileConfig.properties");
String mailreciver = "";
int port = 0;
try {
prop.load(in);
mailreciver = prop.... | 1 |
4e3539326a07d581c3db1e5f11ccc5ca | 234551887e5710cfeb0a220c9d65b2e6 | Get child OUs of the given organization | namespace Listen360API
IOrganization[] GetChildren(); | 1 |
86154bff241e40d2b78882e406adfad0 | 60cf3f2c14d27eb29b1acf54512fde94 | Ativa/desativa o desenho das bordas de cada região | void Layer::forOutline(bool b) {
ForOutline = b;
return;
} | 1 |
f4af8b7903915343c4c425de89e12625 | 7db8af04d3e617d8b484051fca07dfb6 | @brief 计时结束,隐藏通知 | {
if (m_countTime >= m_displayTime)
{
m_displayState = DisplayStatus.disappear;
m_countTime = 0;
}
} | 1 |
af02e0c5fab91098f7a1efae0497475b | d2b4284d246222d8daa3369ef2e37f9c | Open a bCap socket. | if (m_bOpened)
return true;
if (m_hSocket == INVALID_SOCKET) {
m_hSocket = socket(PF_INET, nProtocolType, 0);
if (m_hSocket == INVALID_SOCKET)
return false;
}
m_bOpened = true;
return m_bOpened;
} | 1 |
25fd4c647feaf3f4afd54d4c46b3fc45 | 2a95f9c17cf9a35a0645c28582c1583c | Convert transition probability to per action matrix of size NxN
This method just transposes the matrix so that you can iterate through
actions. | self.transition_matrix = np.zeros((len(self.states), len(self.states)))
for t in self.transitions:
self.transition_matrix[t.s1.id][t.s2.id] = t.p
return self.transition_matrix | 0 |
844db3d167146a6c768ab5d29048d830 | ed1ef9363fc6b953a6434ee491cb6f14 | Test 0x7XNN: Add NN to VX. | impl<'a> Cpu<'a>
fn op_7xxx(&mut self) {
self.v[self.op_x()] += self.op_0nn();
self.pc += 2;
} | 1 |
822e596b6aa1b0b65153263f53c2b8c1 | e96965fff670c784684df4e3284a3f52 | 月の末日を取得する | namespace Mizuochi.Commons.Codes.ClassExtensions
public static class DateTimeExtension
public static DateTime GetLastDayOfMonth(this DateTime date)
{
return new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month));
} | 1 |
a5a422da5b4974ba43c27ebbeaa5d4fd | 3f8597b69adc325249a5d3b0586b0781 | 当有属性变动时才保存。 | namespace LcmsNet.Properties
internal sealed partial class Settings
void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
Save();
} | 1 |
49f4dac723f39f3e0912ca2e10983523 | 48d82bc7a9f77e5c43aba40096551c0c | Path for checkbox "Save account for later use" (or other thing to click on) | public class StatusBarFooterHandle extends NodeHandle<Node>
public String getSaveLocation() {
return saveCandidateBookLocationNode.getText();
} | 0 |
cecc06e1eba1b10c5e54eef790983f45 | b5b9d14f23a2c25cb8cddd1f643aba92 | 写链错误率对好写链比例的影响. | MESSAGE_POOL_SIZE = 100
NODES = 30
ROUND = 50
P_N = 0.1
STRATEGY = 1
W = 5
P_WRITE_WRONG = np.arange(0.1, 0.5001, 0.05)
P_VOTE_WRONG = [0.2, 0.3, 0.4, 0.5]
res = {rate: dict() for rate in P_VOTE_WRONG}
for pvw in P_VOTE_WRONG:
print(f'P_VOTE_WRONG rate {pvw}')
for... | 1 |
b737d01a11c838f5fc76e99165d421d3 | 0a53d86f053c96caa9295d072491430e | Tests for AssessmentOfferedForm | ora_section = (
'<li class="nav-item">'
'<button type="button" class="btn-link open_response_assessment" data-section="open_response_assessment">'
'Open Responses'
'</button>'
'</li>'
)
response = self.client.get(self.url)
self.... | 0 |
8369be36416eca6e23aeabd82d884bfa | 525131a63230d2e0bf8752ed32fbccca | 取得rpc回调函数,并从rpc回调池中移除 | for i, v in ipairs(self.rpcList) do
MSys.regRpcClassFunc(self, v, self[v])
end
end | 0 |
0400bf913327b224a2a15449329c7b1d | 9cdcd47e30ef2b74d412aac831b623b9 | The ARN of this Repository.
:attribute: true | class _RevisionState:
def arn(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "arn") | 1 |
473c8d93f1b06954ae32b2e7027e9981 | 84c81e59bb4233bf8cd80de9727c7714 | Creates an order in MundiPagg One. | Object postBody = body;
if (clientId == null) {
VolleyError error = new VolleyError("Missing the required parameter 'clientId' when calling orderCreate",
new ApiException(400, "Missing the required parameter 'clientId' when calling orderCreate"));
}
if (accessToken == null) {
VolleyE... | 1 |
a7a97983f82622f681cb1c910ef15c97 | e0bdaf3b1e5dad43dc6a090ecb5830d9 | dp转像素. | public class TDevice
public static int pixelTodp(Context context, float pxValue) {
final float scale = getDisplayMetrics(context).density;
return (int) (pxValue / scale + 0.5f);
} | 0 |
4800dd97d63b54fe0a5121b0a42dc665 | d7ae8118ffb94fdb91d4623a2f5ab428 | Pobieramy ustawienia i wyswietlamy login FB, jesli jest ustawiony | {
$fb_data =$this->lib_login->js_fb();
if( isset ($fb_data['me'])){
echo '<pre>' . print_r( $fb_data, 1 ) . '</pre>';
echo $fb_data['me']->getProperty('name');
} else {
echo "no me";
}
$fb_data = $this->lib_login->facebook();
if (isset($fb_data['me'])) {
var_dump($fb_data);
... | 1 |
d25f6d4013335fbf8302e4fdd6327a23 | 6c47de2a9ca53b2beb8b327ae2312a55 | Ensure we are on the main thread when running the callback, since the app developer
will most likely need to update UI. | public class LauncherModel extends BroadcastReceiver
public static void runOnWorkerThread(Runnable r) {
if (sWorkerThread.getThreadId() == Process.myTid()) {
r.run();
} else {
sWorker.post(r);
}
} | 0 |
ea00a9e129b79c8e1432b284ceb9aad5 | 13c18a21931c50d04cdc99780cd1499c | funcion para cambiar de pantalla | class Profile extends Component
changePage(pagina){
if(pagina !== this.state.pagina){
this.setState({
pagina: pagina
})
}
} | 1 |
9ef8210fc9d9ce46d9359092ca5a37b4 | 9aa450399836f59b72da4cdfe454b0b1 | cette methode est un equivalent de "isSatisfiedBy", verifiant si la regle instanciée est valide ou non. | public class Nombre extends Expression
public void verifier() {
} | 0 |
ce6aa77ffe9f024164d555382b04577c | 3232aad5feb0e8316312a381e0b5abd8 | 本月投放所获积分的排名 | class Cron extends Controller
public function dealRank(){
$cid = 2;
$map['cid'] = $cid;
$map1['id'] = ['neq', 1];
$map1['is_show'] = ['eq', 0];
$map1['status'] = 1;
$fields = "`Score`.id,`Score`.subject_id,`Score`.user,sum(`Score`.ml_add_score) as ml_add_sum,sum(`Score`.m... | 1 |
246992971e67bbe2775ab21a4df72ab4 | b0f16550b858b90c694f13eec5cc85fe | Retourne tout les états selon l'ordre préférentiel. | @RestController
@RequestMapping("etat")
@CrossOrigin("http://localhost:4200")
public class EtatController
@GetMapping
public List<EtatTache> afficherEtats() {
return etatService.afficherTousEtats();
} | 0 |
24404166f999feccb59496caec51d27c | 4a25724a1e9c30454d6aeb0081821474 | Gets the IsSelected property. This dependency property
indicates whether the first ListBoxItem found in ancestors is selected. | namespace Win8XamlControlPack.Primitives
public abstract class Selector : ItemsControl
public static bool GetIsSelected(DependencyObject element)
{
if (element == null)
{
throw new ArgumentNullException("element");
}
return (bool)element.GetValue(Selector.IsSelectedProperty);
} | 1 |
8073a43a4fdcee6ea7ffbac813bdd1ba | f8991e8c180cc144b172fa37dc7f92ca | função para criar parágrafo com JS | function main ()
function criaParagrafo(className) {
const p = document.createElement('p');
return p;
} | 1 |
60a1dc0fb0748335e36e86e2c8f92806 | 586db0320dea402a19e47bd41b1db412 | 修改GoodsAttrValue数据(根据参数做选择) | {
$primary = array(
'goods' => 'goods_id',
'goods_attribute' => 'attr_id',
'ad' => 'ad_id',
);
$id = I('id/d', 0);
$field = I('field');
$value = I('value');
Db::name($_POST['table'])->where($primary[$_POST['table']], $id)->where('st... | 1 |
c256ad12a102672c7aa291fbc20aa801 | 68e0ccefaa73ac18aa2b8b3598eadb36 | Returns TRUE if the parameter is an countable entity
array or an instance of Countable class | class Assert
public static function countable($value): bool
{
return is_array($value) || $value instanceof Countable;
} | 1 |
5840363f3f014aab662802a494572509 | a7ac9aea78e72607227d57ddfd4da857 | Get the number of times the container is read. | public int getReadCount(); | 1 |
6536ffbfee8ba4589b95b51925eef2c2 | a590d298fc03715ca5321cef4d1386f4 | 指定された放送局の番組一覧を返す | url = 'https://mediaarts-db.bunka.go.jp/mg/api/v1/results_magazines?id=' + \
key + '&page='
magazines = []
for i in range(1, n_pages):
response = urllib.request.urlopen(url + str(i))
content = json.loads(response.read().decode('utf8'))
magazines.extend(content['results'])
... | 0 |
39c7d950cbd2d1dd09df2a479ea9c1df | 248ca3f07f7646fe321b4494130415c1 | key를 주면 value를 알려주는 함수 | def checkKey(dict, key):
if key in dict:
return(dict[key])
else:
return '' | 1 |
7ed9d71bf61f0bd9459508f4a4bf80e7 | 17d519eeb78ca626edcc8f6f838c4b1b | Metodo que cambia signo del valor representado en el jTextPane. | value = text.get()
value = eval(value)
value = '-1*' + str(value)
text.delete(0, tk.END)
text.insert(0, eval(value)) | 1 |
5403da1f5ba94c24eef9c674bdff5d36 | 123d015eb3db181eb97596c17e1cafb7 | 判断是否是安全保密员 | public class DataPermissionUtil
public static boolean isManagerSecretary() {
String roleName = sysParameterServiceClient
.getSysParameterValue(SysParamEnum.SYS_PARAM_MANAGER_SECRETARY_ROLE_NAME.code());
return hasRole(roleName);
} | 0 |
834615db9675afaf492abbf2f68912f2 | 41255fc99f3de8e7805ad7489a6fd476 | 중고차량 소유자 목록을 조회한다. | @Controller
public class MaintenanceController
@ResponseBody
@RequestMapping("/maintenance/ownerList")
public List<Owner> getOwnerList(Model model) throws JsonProcessingException {
List<Owner> ownerList = maintenanceService.getOwnerList();
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclus... | 1 |
b47828329169bdaee5ad5d6111ff1728 | d5da0dfb8e87242b138fd0aace684e4a | Gets the product family attribute associations. | namespace UL.Aria.Service.Provider
IEnumerable<ProductFamilyAttributeAssociation> GetProductFamilyAttributeAssociations(Guid productFamilyId); | 1 |
a72d12cee8fab8041ce4681426217397 | c9e53422f351d9e163b41b0e6a858f60 | starts the game when the spacebar is tapped | function startButton:tap( event )
self:removeSelf();
title.isVisible = false;
Runtime:addEventListener("enterFrame", checkBounds)
Runtime:addEventListener("touch", handleTouch)
createBlocks();
local offsetNum = 8;
local offsetNumY = 5
scoreText = display.newText( "0", 320-offsetNum, 390... | 0 |
c541c9ccbbaae85fe31e5a1813ec7968 | 3692f283abb708298b19dcddbcbd22f7 | Blueprint | {
$this
->setDescription('Creates a blueprint')
->setHelp($this->getHelp());
$this
->addArgument('table_name', InputArgument::REQUIRED, 'The name of the blueprint, has to be the same as the table\'s')
->addArgument('number_of_columns', InputArgument::R... | 1 |
7bd3b8739564bce92bb6c8dfab991d9b | ec444d8570db5c8fb017ea6e2a4b11a4 | Create an instance of {@link StatusType } | @XmlRegistry
public class ObjectFactory
public StatusRole createStatusRole() {
return new StatusRole();
} | 0 |
ef13a20d5378ed8e424941e20b348c74 | 61555990d243fc00cd360f50a9190dc2 | a database worker responding to commands | def _database_manager(database_path, database_command_queue):
with sqlite3.connect(database_path) as connection:
while True:
try:
payload = database_command_queue.get()
if payload == 'STOP':
break
sqlite_command, argument_list, ... | 1 |
6746cecba12799f76fd8617aeaf6a7f0 | d00db14d691bb7974403c6690a9ac869 | RasterBounds datasets offer a limited sort of reproject on the fly.
This tries to update the bounds by reprojecting the top left and bottom
left and top right coordinates and updating the "affine" transform.
This should not be used if CanReproject is false.
Greater accuracy can be accomplished using the Projective tran... | namespace SharpMap.Layers
public class GdalGridRasterLayer : Layer, ICanQueryLayer, IDisposable
public void ReprojectToMap(Map map)
{
GetTransform(map.Projection);
ApplyTransformToEnvelope();
} | 1 |
a442d1cd17afced91171e41040b0df9f | c4441ca78667dae538b74ce7e4993a02 | Test case for get_users
Get existing users list # noqa: E501 | def test_post_request_for_users_api(): | 0 |
d4608e9c1849f24d220ec68283fcba84 | cd2e80709807cf09b36d4af931923d6f | 全文表示の停止ボタンを制御する関数 | function cntStop()
{
document.timer.elements[2].disabled=false;
clearInterval(timer1);
} | 1 |
51a4367d56401c6a2b653e4813b52e22 | 03be05f342a7de3635234d35fbb265e7 | This means that the entry can be read directly without a zip decompressor for fast access. | public abstract class ArchiveOutputStream extends OutputStream
public boolean canWriteEntryData(final ArchiveEntry archiveEntry) {
return true;
} | 0 |
900b5c8dbd705eb19070d77082b63ce2 | 74730b43292bb8450bd8fc0ad9737709 | \brief Solicita un dato al usuario, valida que contenga solo letras y lo almacena | {
char aux[256];
getString(mensaje,aux);
if(esSoloLetras(aux))
{
strcpy(input,aux);
return 1;
}
return 0;
} | 1 |
2113031259beac55f8aa2ba7c91edf8f | 074138ea9019f374813d43d5ce25c0ec | Updates the defensive rankings list as the season progresses | {
GameData.Defense1Point = Constants.Defense1PointDefault;
GameData.Defense2Point = Constants.Defense2PointDefault;
if (!GameData.InFielderDrawIn)
{
GameData.Defense3Point = Constants.Defense3PointDefault;
GameData.Defense4Point = Constants.Defense4PointDefault;
GameData.Defense5Point = Consta... | 0 |
547744836032d0ee1bd95fc2b32f3813 | cad14602e1cb3420717c75be35fb1919 | Set the path of the cmake *config* file. | class Tester
public static function setCMakePath($path)
{
Tester::$path_to_CMake = $path;
} | 0 |
f0ece5777a2b31de96a8c6b7f15ce541 | 17005b0ece1050a6c4947b706a462360 | Set pointer to reload Game variable in game Controller | void User::setPointerReloadGame(bool *re_game)
{
_reload_game = re_game;
} | 1 |
0dd155887daea18655f3faebad3bd397 | 2710e80cd923bcfd5fc2773908aca3f6 | # Perform non-metric multidimensional scaling | {
nobj = nrow(x)
nvar = ncol(x)
ncomp = min(ncomp, nobj - 1, nvar)
scores = matrix(0, nrow = nobj, ncol = ncomp)
loadings = matrix(0, nrow = nvar, ncol = ncomp)
eigenvals = rep(0, ncomp);
E = x
for (i in 1:ncomp)
{
ind = which.max(apply(E, 2, sd))
t = E[, ind, drop = F]
... | 0 |
fe65db3965d072521b88348c4fd16545 | 5f41c0e13c32f14d0da71a22cf5924b2 | 获取集团型空间的部门列表(根据所属它下面的空间所创建的部门的名称) | @Controller
public class WorkspaceNameController
@RequestMapping("/workspaceController/getDepartWorkspace")
@ResponseBody
public MjWorkSpaceUnitInfoPage getDepartWorkspace(WorkSpaceDepartmentQueryList queryList) {
MjWorkSpaceUnitInfoPage result=mjWorkDepartService.getWorkspaceDepartment(queryList);
return result... | 1 |
3b98fc567a2b0d8d57955ae8c5e97a29 | f9528ebdbc2d2a2e27364b1000c98072 | Extracts the table for LASLP and verifies printout in the meantime. | public class LASLPcommand extends CPcommand
private void getLaslpTable() throws PrintoutException {
String laslpTableHeaders[][] = {
{ "BLOCK,BN,BS,TYPEEXT,TYPE,PSA,PCV", "CV,PSV,NSIN,NSOUT,NB,BSA,NDF",
"DFTSA,ACM,SCM,FSI,ALTBATSA,ALTDFTSA" }, { "BAN,DFN,VCAT,NRR,MPAW,LEN,NINDX,ROFF,FSID" },
{ "DFN,NRR,... | 1 |
67e52c5568999a843e55c769f6bdbfea | 2f1b93cf5e23ef08068bb351f70ea1ee | 获取数组容量,要减1,有一个空间会被浪费 | func TestArray_GetCapacity(t *testing.T) {
array := array.NewArray()
array.AddLast("我是张高元")
array.PrintIn()
t.Logf("array cap:%d \n",array.GetCapacity())
} | 0 |
88e4ebb338c9ffea5e09cc11f738b79e | 10b56ea3104320dbee898f7f648e5a0c | Get all accelerators from resources | export class ShortcutCustomizationAppElement extends
ShortcutCustomizationAppElementBase
private fetchAccelerators_() {
this.shortcutProvider_.getAllAcceleratorConfig().then(
(result: AcceleratorConfig) =>
this.onAcceleratorConfigFetched_(result));
} | 1 |
345c67d616a72c906dc93cea9a7fd7e4 | 3f81a5b448d50e2d5410ee078aff1af7 | Initiates the asynchronous execution of the UpdateMemberSession operation. | namespace Amazon.CleanRooms
IAsyncResult BeginGetMembership(GetMembershipRequest request, AsyncCallback callback, object state); | 0 |
da4664cd5a240ac6fbc2da7a083d8863 | c3b97b786b2174deb589e9095f6225ac | Returns a Read-Only copy of the current Library | public class TLModel implements Validatable
public List<AbstractLibrary> getAllLibraries() {
return Collections.unmodifiableList( libraryList );
} | 1 |
b2b39e4f2620b59280422d87f6c6418d | bc63f24bdabd97679941a686a734415c | Set coordinate system for velocity increment vector, for Local Orbital Frames. | public abstract class PortedBetterCharacterControl extends AbstractPhysicsControl implements
PhysicsTickListener
protected void updateLocalCoordinateSystem() {
calculateNewForward(localForwardRotation, localForward, localUp);
localLeft.set(localUp).crossLocal(localForward);
rigidBody.setPhysicsR... | 0 |
21657897d81b75da1d186509837a95a9 | bd4e76766e8b409007d3a94437a53286 | 数组转树 非递归求解
利用数组和对象相互引用 时间复杂度O(n) | function tool() function array()
function toTree(data, childrenFn = () => {}) {
let result = [];
if (!Array.isArray(data)) {
return result;
}
data.forEach((item) => {
delete item.children;
});
let map = {};
data.forEach((item) => {
map[item.id] = item;... | 1 |
a5d0bc7552eea63d3fa8849e4393df42 | a351ed0c412da58ffaa27eb19f1d9040 | 匹配字符串是否是时间格式 "20xx-xx-xx" | public class DateUtils
public static boolean isDateTime(String str) {
String regex = "^[0-9]{4}\\-[0-9]{1,2}\\-[0-9]{1,2} [0-9]{4}\\-[0-9]{1,2}\\-[0-9]{1,2}$";
return str.matches(regex);
} | 0 |
ec537ff2852d0884048bb30002fbb4e4 | 9e55d4ed413e2a84b04d44b3c6744b58 | Exit a parse tree produced by VerexParser#module_instantiation. | class SQLiteListener(ParseTreeListener):
# Enter a parse tree produced by SQLiteParser#parse.
def exitModule_name(self, ctx):
pass | 0 |
a50a2b1293628a4a2779f9ca41196e4f | 1895ab6478301f9102cab5f472894ad0 | Получить список всех получателей. | class Recipient extends BaseEntity
public function getAll(): array
{
$response = $this->client->makeRequest('GET', 'recipients');
return $response->body;
} | 1 |
3736654aaba5d6b8e3a608695cc51ea9 | d30e395271d3fed175818f5c0245f2cc | Place the thread waking up on the dispatcher queue. | namespace Windows.UI.Core
public sealed partial class CoreDispatcher
internal void WakeUp()
{
CheckThreadAccess();
if (IncrementGlobalCount() == 1)
{
EnqueueNative();
}
DecrementGlobalCount();
} | 1 |
8d1803840a43f491078bbd08f877a94d | f6a8b8daf1cff26dd27b308ebbe95143 | Push a word (16 bit) on the stack | namespace NesEmu.Core
public partial class CPU
public void Push16(ushort value)
{
byte low = (byte)(value & 0b1111_1111);
byte high = (byte)((value & 0b1111_1111_0000_0000) >> 8);
PushByte(high);
PushByte(low);
} | 1 |
34e2c4910f77ec10823d6609b7120d53 | 129eded75549a5c2dcdec0e8e11b55cd | Send command to arm the drone (asynchronous).
Note that arming a drone normally means that the motors will spin at idle. Therefore, before arming take all safety precautions and stand clear of the drone. | self._CheckState([actuator_types.kActuatorStateInit])
self._CheckServosSelected()
set_state_msg = pack_avionics_messages.ServoSetStateMessage()
(set_state_msg
.state_command) = actuator_types.kActuatorStateCommandArm
(set_state_msg
.servo_arming_signal) = safety_codes.SERVO_ARMING_SIGNAL
... | 1 |
3d93507f9ff7d907d6adf82a527248bf | 21749dde7628cba0a9abb3af4c1b351d | Mixin to add automatic styling to a Skatejs component | const thisComponent: ComponentConfig = components[component]
if (thisComponent && thisComponent.style) {
return thisComponent.style
}
return ''
} | 0 |
ba8745f2d8da1da76f79ca071d51fe2a | cd9960ebdbf432ab64e04ab54daa21ed | Record when the user takes no action on the stash entry | void SkeepFrame() {
static vector<double> noAction(42, 0);
game->makeAction(noAction);
} | 0 |
ee4cb2cf0a85cf5d3cf9882af87e393a | d14431986b6ef651d82d97a7216576c4 | Take a report and format a few fields into a brief string | class MissionStatusReporter():
def get_overview_string(self, mission):
s = self.get_pool_overview_string(mission) + "\n\n"
s += self.get_job_overview_string(mission) + "\n\n"
s += self.get_storage_container_overview_string(mission)
return s | 1 |
d31fc638a51be00f2ddc70ed1f44da07 | c774e8a3fd67665941ddc103ed5368da | https://leetcode.com/problems/ones-and-zeroes/ | {
std::vector<std::vector<int> > dp(m + 1, std::vector<int>(n + 1, 0));
for (auto str: strs) {
int zeros = 0, ones = 0;
for (auto c : str) {
c == '0' ? ++zeros : ++ones;
}
for (int i = m; i >= zeros; --i) {
for (int j = n; j >= ones; --j) {
... | 1 |
8c28c246b64c3a4995cb8e1fdbff856e | 323cd0b5fbccfc29969e786978855106 | 서버 연결 종료 시 게임종료 | public class ConnectServer : MonoBehaviour
void OnDestroy()
{
if (SocketTCP != null && SocketTCP.Connected)
{
WriteLine("DISCONNECT");
Thread.Sleep(500);
SocketTCP.Close();
}
StopCoroutine(PacketProc());
} | 0 |
f93bac130df51f6c8db8efce880eacde | dde7aa489d26936c9dfb7a1ad05ee386 | 根据 ID 查询电梯井信息 | @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Integer id)
{
return AjaxResult.success(wsElevatorMinitorDeviceService.selectWsElevatorMinitorDeviceById(id));
} | 1 |
2722ef6cc80f41291e567c6574d96ca6 | d4a761eab0c984cf762e91169d6ecd05 | small delay to ensure tkinter has handled the keypress | def wait_run():
sleep(0.1) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.