query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
238284e729718e46a45c366bdede65b6 | d3a62ba1fb7d0998dacca362a36229aa | Simple number palindrome check | bool is_paldinrome_number(int input)
{
return (reverse_number(input) == input);
} | 1 |
36c6f98f6062079b749eb653bdc18578 | 000b5b1f1da000aafc565ff4984db698 | Masks all emitter systems | {
foreach (Material material in GetRenderer().materials)
{
material.DisableKeyword("_EMISSION");
}
} | 1 |
4bcbacb919da8bcbda56636aa43ea247 | bd51c45d8adfbb38a22901e77186fc1c | Poistaa valitun tapahtuman tietokannasta. | class Luokka
public function poistaKannasta($id) {
$sql = "DELETE FROM luokka WHERE id=?";
$kysely = getTietokantayhteys()->prepare($sql);
$kysely->execute(array($id));
} | 0 |
5171a81aa1714eac1deadf1bc69ae4b3 | 93fbcac25e6d39882d873f3badcf1543 | 搜索规则设置 | class SiteSetting extends Common
public function saveSearch()
{
$data = Request::post();
$res = Db::table("search")->where("id",1)->find();
if(!$res){
$data["create_time"] = time();
$res = Db::table("search")->insert($data);
}else{
$data["update_time"] = time();
$res = Db::table("search")->where("i... | 1 |
141ce41235f4786b7c4b2f9989d9387c | 22d21d4473cecece241fdaa475dd472c | going from login activity to main activity | public class CreatePassword extends AppCompatActivity
public void launchLoginActivity(){
Intent intent = new Intent(CreatePassword.this, MainActivity.class);
startActivity(intent);
CreatePassword.this.finish();
} | 0 |
91baebf3dec8b44329d86b771d0bec12 | 141d9b1e19c74f4fc05c47d4e08640e7 | 如果下标位于用户自定义的频率模式范围,则可以编辑 | class Adgroup extends MY_Controller
public function edit_freq()
{
$params = [];
param_request([
'freq_id' => 'STRING',
'ids' => 'STRING',
], '', $params,[
'freq_id'=>0,
'ids'=>''
]);
$where['id'] = ['in'=>'&/(' . $params['ids'] ... | 0 |
303d8542395a5056c9d34f746c9513e8 | 90e2e1e28c13654f4b2abb191f85596f | Check if at least one day of the week is selected. | namespace PX.Objects.FS
public class RouteMaint : PXGraph<RouteMaint, FSRoute>
public virtual bool isThereAnyActiveDay(FSRoute fsRouteRow)
{
return (bool)fsRouteRow.ActiveOnMonday || (bool)fsRouteRow.ActiveOnTuesday || (bool)fsRouteRow.ActiveOnWednesday
|| (bool)fsRouteRo... | 1 |
2d6d93517f11a4a5d1608069e83b4e6d | 24b70956481eebc0dfe49a23bc23c46b | 教学大纲页面 | @Controller
public class StaffJumpController
@RequestMapping("/staff/teachingSchedule")
public String teachingSchedule() {
return "staff/teaching_schedule";
} | 0 |
6d0afc358335200b163ecdf7387eb26d | c250d670a5da817af822fae3e31b0447 | Generate Relation. | {
if (relations == null)
{
throw new ArgumentNullException(nameof(relations));
}
var indent = this.Indent > 0 ? new string(' ', this.Indent) : string.Empty;
return string.Join(Environment.NewLine, relations.Select(relation => $"{indent}... | 1 |
0a3a17684b2a866c17b8b1c6f5e80013 | 90a835a4e2bab261cbc670f35edbaf6b | Calls the "get" method of a property.
This method don't throw an Exception if the Method isn't found. | try {
return getMethod.invoke(instance, getArgs);
} catch (final Throwable e) {
throw new MethodProperty.MethodException(e);
}
} | 0 |
4d2b2cdb8005a4d53100d8903ab2dbc4 | ce52039f07851b742d26198bc7c9f4fa | Current Energy Produced in Svalin | class WindPower(AnnualSavings):
def get_total_energy_produced (self):
return self.net_generation_wind | 0 |
2f83cefb968c3031e40cf44d875f3fad | 54657f06a8bbd81bc8d0f0fe1565cda6 | 设置自动推流状态 | {
$id = Yii::$app->request->get('id');
$publickey = Yii::$app->request->get('publickey');
$mdhash = Yii::$app->request->get('mdhash');
$status = Yii::$app->request->get('status');
$channel_name = $id;
$time = date('Y-m-d',time());
$platform = Platform::fin... | 1 |
d093e04fe95e1c5c61afe094cd26edde | 90de195b2a8d97a5e720ac252580cac1 | 将对话置为已读 | EMConversation conversation = EMClient.getInstance().chatManager().getConversation(username);
if (conversation == null)
return;
conversation.markMessageAsRead(messageId);
} | 1 |
1a045169360f334e5b1a98f59f2a4921 | 5927594a4f0ef8ae5d90f8c6ab51195a | Creates the increase button of the scrollbar. | public class CustomScrollUI extends BasicScrollBarUI
@Override
protected JButton createDecreaseButton(int orientation) {
JButton falseButton = new JButton();
falseButton.setPreferredSize(new Dimension(0,0));
return falseButton;
} | 0 |
0fda537fc480aeb0eff7406560df7ce2 | 46bfd497b35396b6b2d7883a5bc7aa65 | 更新店铺快捷方式表 | if(x_shortcut_menu_info!=null){
x_shortcut_menu_info.setUpdate_user(SessionUtil.getUser().getZid());
x_shortcut_menu_info.setUpdate_time(DateUtil.getDateTime());
DB.update("sql_x_shortcut_menu.x_shortcut_menu_update", x_shortcut_menu_info);
return true;
}else{
return false;
}
} | 1 |
8117d61f068e3faf007eb32d62191383 | 9343909bd60d844dc93b3b81c2774c2e | 获取与我相关的话题列表,包括赞 和评论 | public ResponseData getMyFocus(HttpServletRequest request) throws Exception {
Map map = getParams(request);
String userId = map.get("userId").toString();
if (StringUtils.isBlank(userId)) {
return new ResponseData(false, "缺少必要参数");
}
QueryFilter queryFilter = new Q... | 1 |
2c37ce008bb0447cb19bd4a4257076eb | b36113ce89a69a7bbd38e4f8b9b49682 | 遍历计算部件材料用量(涉及材料开数和部件总印张) | namespace ZXSystem.Function.ProductProcess
public partial class Form_Main_ProductProcess : Form
private void CalcMFDimension()
{
DataRow dr = gv_WorkOrderExt.GetDataRow(gv_WorkOrderExt.FocusedRowHandle);
string sFluteType = dr["sFluteType"].ToString();
string sCustID = d... | 0 |
e3c2e813cf0a231866edc266b15e6f19 | 0a022419d052009322d30df7b6d0fd63 | updates values from the gui | public class Simulator
private void giveNewValues() {
HashMap<String, Integer> map = simulatorView.getUpdateValues();
updateEnterSpeed(map.get("enterSpeed"));
updatePaymentSpeed(map.get("paymentSpeed"));
updateExitSpeed(map.get("exitSpeed"));
updateReserveSpeed(map.get("reserveSpeed"));
u... | 1 |
627b4af3790fd9ef5ce16f47f03ea7c0 | f21310b6c6eb3b87d4b80ae5107999f7 | Get all unpaid invoices. | class PaymentRepository extends EntityRepository
public function findUnpaid()
{
return $this->findBy(array('is_paid' => false));
} | 1 |
496c1befc63414ab473d5207fdcb106d | c068f631c9b347c8ba3b8378db3cad3e | Strat aléatoire: On commence avec 1 grille alea et chaque tour on joue un coup random | cases = 0
x, y = Game.PlayerX, Game.PlayerY
while (True):
Game.Grille[x, y] = 2
mvt = ListMoves(Game)
nbMvt = len(mvt)
if nbMvt == 0:
return cases
else:
pos = random.randrange(nbMvt)
x += mvt[pos][0]
y += mvt[pos][1]... | 1 |
19894b52bf79661839a433e9fb1d40f1 | 7413303b353cc9aedc682993a3870d7e | Runs all stress tests. | parser = ArgumentParser(description=main.__doc__, epilog=EPILOG, formatter_class=RawDescriptionHelpFormatter)
parser.add_argument('url')
parser.add_argument('guest')
parser.add_argument('--limit-rate', dest='rate')
parser.add_argument('--post-size', default='100M')
parser.add_argument('--proc-co... | 1 |
4e871acb888335415460db09549bff34 | 0c1db8f3a55a8d4148dd920a3a19592d | estimate normals using SVD around local neighbourhood of point | A = []
area_list = []
area = 0.0
count=0
nan_vertices = []
for x in range(len(rr)):
A.append([])
solid_angle = 0
for row in tris:
v1=rr[row[1],:]-rr[row[0],:]
v2=rr[row[2],:]-rr[row[0],:]
nml = np.cross(v1,v2)
area = area + np.linalg.norm(nml)/2.0
... | 0 |
1dfdb89e4324597bd34e0e8af11529e6 | e1c15fad50c44a2ebe790bcfa080ea5c | \brief 设定视频亮度(0~100) | {
if (!pVPA)
return FALSE;
long flags;
long currentValue;
HRESULT hr = pVPA->Get(VideoProcAmp_Brightness, ¤tValue, &flags);
if (SUCCEEDED(hr))
{
hr = pVPA->Set(VideoProcAmp_Brightness, brightness, flags);
return TRUE;
}
return FALSE;
} | 1 |
178d0b198836b628266308aa4e59d310 | ee62bf0ad49b15643f978bf1c1e282dc | MySQL: | function mysql_admin_db_query($c, $query)
{
$db_answer = mysqli_query($c, $query);
if($db_answer === TRUE)
{
return 'Query successfully executed. ' . mysqli_affected_rows($c)
. ' affected rows.';
}
if($db_answer === FALSE)
{
return mysqli_error($c);
}
$i = 0;
while( $row[$i] = m... | 1 |
05735b8eca308c6f86c36d2b59b90ba6 | c773bb72a6a09f3be15aa991f3475cc1 | metoda resetujaca symulacje | public class MainFrame extends javax.swing.JFrame implements ActionListener
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.gridPanel1.resetSimulator();
} | 1 |
6ece066bb7acc9b8124346fc83da5900 | 70c26409ec0cc15605078cbdda073bff | Returns an array of permissions that are not yet in the
database | static $perms = null;
if( $perms === null ) {
$sql = "SELECT * FROM relpermissions WHERE suppress = 0 ORDER BY name";
$rset = PSU::db('portal')->Execute( $sql );
foreach( $rset as $row ) {
$perm = self::load( $row['id'], $row );
$perms[$perm->code] =& $perm;
unset( $perm );
}
}
return $p... | 0 |
0c5aa2eb5ac1b7dc698936615058cd64 | 799ce6a4ed67b36e43211197442f5684 | 翻訳結果の英文をクリップボードにコピーする関数 | namespace CARB2
public partial class Form3 : Form
private void Button2_Click(object sender, EventArgs e)
{
Clipboard.SetText(resultTxtBox.Text);
} | 1 |
52e2338ee4abe7c141d4485256545b7c | 116ef52aa6b7b28938dca7a626468a2c | convert dec to bin with leading zeros | def dec2bin(dec, bits=MASK_BITS):
s = bin(int(dec)).replace("0b", "")
return pad(s, bits=bits) | 1 |
35f5142af4e8972b8d59592208111a40 | 24fc6a26f8cf958657c6b551c1677395 | 创建产品列表的按钮 | public partial class ProductionBasicInfo_PBIProductBaiscInfoMgt : Page
protected void Button_Add_Click(object sender, EventArgs e)
{
Panel_AddPS.Visible = true;
UpdatePanel_AddPS.Update();
} | 0 |
cfec2627e6c4bff4508d056f24722330 | b390f7e64a1a55b9cbbe08aa9d62267c | Exit action for state 'None'. | class FindPart(EventState):
def on_exit(self, userdata):
pass | 0 |
005d1e535834b7e3e627c1d3e5532777 | 6a499c29eba4a0da6940fa06b049fa48 | Pre load / Initialize prior to primary activity load.
Speeds up map loading significantly. | namespace TerrorTown [ClassLibrary(Name = "TerrorTownGamemode")]
class Gamemode : BaseGamemode
public override void LoadMap(string name) {
DefaultPostProcess.MotionBlurAmount = 0;
base.LoadMap(name);
} | 0 |
0ddf098f8bd81e337fadfe0f73711430 | 7522545578088bb0f2e9f75c75f5b3b5 | HunterLAB -> RGB. | l: Float,
a: Float,
b: Float,
tristimulus: FloatArray
): IntArray {
val xyz = LABtoXYZ(l, a, b, tristimulus)
return XYZtoRGB(xyz[0], xyz[1], xyz[2])
} | 1 |
70f00532f891c868e3a9fe99050dd5a2 | f001da3370f31ba1bc72b12158e0bfb2 | 设置回测初始资金信息 | class BacktestingEngine(object):
def setInitialPos(self, initialPos):
self.strategy.pos = initialPos
trade = VtTradeData()
trade.vtSymbol = self.contractName
if initialPos > 0:
trade.direction = DIRECTION_LONG
elif initialPos < 0:
trade.direction = DIRECTI... | 0 |
4c5260d2a4c3eafb14de56c249d8cfda | c8f352b8ce8aa7c3205f8caea2c7b09a | post方式 获取郑煤机图表初始化缓存数据 | @RequestMapping(value = "/getShearerPosCacheData",method = RequestMethod.POST,consumes = "application/json")
SysResult getShearerPosCacheData(HttpServletRequest request, HttpServletResponse response); | 1 |
4bcd22a6a671f67170613fbed5c663bb | fef2622f6ada069c760abe6b94ecfd6c | apaga um jogo na tabela | {
SQLiteDatabase db = this.getWritableDatabase();
db.delete(Game.TABLE_NAME,
Game.COLUMN_ID + " = ?",
new String[] {String.valueOf(Game.get_id())});
} | 1 |
747643d4cddaa23b0d14173b4190e12f | e977718a6388e4893e79e8f1fce7e7c0 | получение изображения информера для предварительного просмотра | Image Image_in
, int PreviewSize_in
, int PreviewDepth_in
, Color PreviewBackcolor_in )
{
PixelFormat formatPreview = Imaging.ImageDepth2PixelFormat( PreviewDepth_in );
Rectangle rect_image = new Rectangle( 0, 0, Image_in.Width, Image_in.Height );
Rectangle rect_preview = new ... | 1 |
511dc0c5497ad5ba5f99ab51483ea6c8 | 463112633ffcd863f59dc636d8c3c807 | 获取玩家已经完成的任务列表 iid列表 | int db_get_done_task_list(player_t* p)
{
return send_request_to_db(p, p->id, p->role_tm, dbproto_get_done_task_list, 0, 0);
} | 1 |
41e2aa8d2cb28fa57a5925095ab5c6d8 | 9a5d297aa5cb8d38054b2d4878ae347d | Returns every second element (=proportion) in a given list starting by 2 | halvesies = []
for i in range(len(some_list)):
halvesies.append((some_list[i]/2))
return halvesies | 0 |
4cc015decc4954d1a131f2af95f85a47 | a0eb49e95f834c17d883648526720b3e | Tar inn to noder og skriver det til filen edge.txt på rett format
Setter at dette er en directed kant | FileWriter fileWriter = new FileWriter(fileName);
PrintWriter printWriter = new PrintWriter(fileWriter);
graph.getEdges().forEach(edgeNum -> {
Pair edge = graph.getEndpoints(edgeNum);
printWriter.println(edge.getFirst() + "," + edge.getSecond());
});
print... | 0 |
e8499cc6e06a0c7c21088280d4e7e79a | 79b118683b78f3e1fa791c86453e0c91 | Generate a ASCII table | int from = 'A';
int to = 'Z';
int offset = 'a' - 'A';
printf("Code: Char Code: Char\n");
for (int i = from; i < to; i++) {
printf("%4d: %c %6d: %c\n", i, i, i + offset, i + offset);
}
printf("\n");
} | 1 |
81d8894993297f9226b7c655d1310f84 | 2712e571c07bb280bf60d207d64c8a4d | Set model's table suffix | public function setSuffix($suffix = null)
{
if ($this->isSplitTable) {
$this->suffix = $suffix ?: Carbon::now()->format('Ym');
}
if ($this->suffix !== null) {
$this->table = $this->endTable.'_'.$this->suffix;
}
$this->createTable();
} | 1 |
80a3cf6a3d661b2d54ea503efef14e50 | 86ba18008b8bc2a06cbc075f2da87280 | Return a copy of the array with the element added, without duplications. | public class Test
public static int[] getUniqueArray(int[] arr) {
int[] ret = new int[arr.length];
boolean found = false;
int finalLen = 0;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < finalLen+1; j++) {
if (ret[j] == arr[i]) {
... | 1 |
e413a523e7155f6d78fce9b81f574b36 | 25b39ceb9aa8f76b488df6bcf0b71dc3 | Update the total bytes copied. | public class Progress
public long getCopiedTotalBytes() {
return copiedTotalBytes;
} | 0 |
ad08de3fac1f1486430938e48361f1a8 | c49b8890654ae02856f83bbbb7c58136 | Włącza powtarzanie aktualnej piosenki. | setRepeat() {
return this.#kodi.send("Player.SetRepeat", {
playerid: 1,
repeat: "cycle",
});
} | 1 |
7af6899c92e5de9cdb82931d9a251b71 | 51636c744836550d290936adcb0c5c49 | 资源文件加载完毕后执行回调callback | export default class Global{
static onResourcesLoaded(data){
console.log(data);
if(data){
Global.LOAD_RESOURCES.map(r=>{
let d = Laya.loader.getRes(r.url)
resourceMap[r.url] = d;
})
}
} | 0 |
f250ea045b50db40675aea2e825fa406 | 3eda95f74de14dc608e3adb833fac66b | Wrapper method for selenium_utils.get_attr_details() | class Driver:
def get_element_attributes(self, element):
return self.get_element_functional(element, "attributes") | 0 |
588d558147c13be4bb49cca0779d10e0 | b64b61efc24c26017d91b944e3f50463 | Получение заголовков всех доступных полей (атрибутов) отдельной записи лога | public final class DBaseFileAttributePool
@SuppressWarnings("resource")
@Pure
public Collection<String> getAllAttributeNames(int recordNumber) {
try {
final DBaseFileReader dbReader = getReader();
synchronized (dbReader) {
final List<DBaseFileField> fields = dbReader.getDBFFields();
if (fields == null... | 1 |
8ccc7e79c600f089b13ede6de10931f0 | b459063eb3d7b623c09c5c881bb956bc | 获取moment的点赞人 | function getLikes() {
mui.ajax('http://121.42.29.124/workoa/index.php?s=/Api/Moment/all_lauds', {
data: {
momentid: id,
page: "1",
num: "3",
datetime: ""
},
dataType: 'json',
type: 'get',
timeout: 10000,
headers: {
'content-Type': 'application/json'
},
success... | 1 |
5e3b0fdb7182a15c0bb010e46772d5a8 | 01a373913da51bed09a5375be5ebfa9b | 验证图片数量是否已经达到最小 | function limitNum(num){
if(!num){
return true;
}else if(imgFile.length>num){
return false;
}else{
return true;
}
} | 0 |
e78315171b96717b8e1169dd998477f7 | 99c3f28b94d4385547a1c339ce8c0d8d | Tests that two identical CastingSets evaluate as equal | for c1,c2 in [(("Standard 4 Pipe","Standard 2 Spring"), ("Standard 6 Pipe", "Standard 6 Spring")),
(("Standard 4 Pipe", "Standard 2 Spring"), ("Standard 2 Spring", "Standard 4 Pipe")),
(("Standard 4 Pipe", "Standard 2 Spring", "Standard 4 Spring"), ("Standard 4 Pipe... | 0 |
69a4f2907d9446645cbcc00004bbd731 | 7692303faa62d64f9ffed2ef6fc4f686 | GET: /Legislacion/Create | {
ViewData["IdEstadoFk"] = new SelectList(_context.Estados, "IdEstado", "DescripcionEstado");
ViewData["IdInstitucionFk"] = new SelectList(_context.Instituciones, "IdInstitucion", "DescripcionInstitucion");
ViewData["IdTipoTelefonoFk"] = new SelectList(_context.Tipotelefonos,... | 1 |
a4fc8260ec09df8968f473f744070ee9 | bc3b55385eb7902d1bff930f1f7859a9 | 获取对象clazz的静态属性property的值 | Field field = ownerClass.getField(fieldName);
Object property = field.get(ownerClass);
return property;
} | 0 |
7896f2fb07356407c6eafc557af626fb | 5898fc46641b4d0ed23b76bc433ab5b6 | The constructor for this class. Takes in the instance data to be parsed into models | class Info extends Model
public function __construct($data = null) {
parent::__construct ( $data );
parent::setupModel ( __CLASS__ );
} | 1 |
6f85bd0c2769ba098a160eee7f545631 | 37c81ec24d1578551e64ed02cdcb5627 | Decrement number of microsteps taken per movement by 1 | void motorPowerOff() {
MoveMotors(1, ++step, 0);
} | 0 |
7141516278981920d930e5bc894f6bd7 | ef258c718c644435ba2da6f3e76c946e | Prüft ob MinimumW_NBR oder W_POS Prüfung aktiv ist | {
if (textBoxRegulacja9.Text != string.Empty)
{
return checkedListBoxAktywa9.CheckedItems.Count > 0;
}
return true;
} | 0 |
cb155c37a01e1538cb5639e443a3ed99 | 655ef67ac224be84ed733053feb2370b | 首页跳转登录页面 | @Controller
public class CommonController extends BaseController
@RequestMapping("go")
public String go(){
return "login";
} | 1 |
78b77fec157c2fec67773076ece338b1 | fb9ea6fd5434a18b27af5c006e0f5a67 | Removes all specified Json Paths from the provided JToken | self.maxDiff = None
msg = {
'TestA': { 'ValueA1': 'A1', 'ValueA2': 'A2' },
'TestB': { 'ValueB1': 'B1', 'ValueB2': 'B2' },
'TestC': { 'ValueC1': 'C1', 'ValueC2': ['C2', 'C3'] },
'TestD': [{ 'ValueD1': ['Da11','Da12'], 'ValueD2': 'Da22' }, { 'ValueD1': ['Db1... | 1 |
bfff4c513a5adcdcbace7bc8a41c1811 | 1f5911061732380ce664fe16cb845435 | 定时器的设置及信号的绑定 | struct itimerval value;
value.it_value.tv_sec = 0;
value.it_value.tv_usec = 1000;
value.it_interval.tv_sec = 0;
value.it_interval.tv_usec = 10000;
if(setitimer(ITIMER_REAL, &value, NULL) < 0){
perror("setitimer");
}
signal(SIGALRM, do_timer);
} | 1 |
99f8e437b37e9c8789f0fbf8758d4490 | 44d1c4031b4b6f4fa94f719114f610e5 | 13.35 0x3C CellVoltage4()
This read-word function returns the Cell 4 voltage.
Protocol - Word
Unit - mV | int data = 0;
data = readReg16(LC709203F_ADDRESS, LC709203F_REG_CELL_VOLT);
return data;
} | 1 |
bccdc552876e92bf4b6b9f39aebdb28f | bcdacb579ec9cdce736ef99186321f55 | Update Gift Card Account states by cron | $this->clear_payment ();
$this->clear_shipping ();
if (! $this->gift_cards_enabled)
return;
if ($gc_code) {
if (! isset ( $this->_cart_contents ['gc_list'] [$gc_code] )) {
$gift_card = $this->CI->Gift_card_model->get_gift_card ( $gc_code );
if ($gift_card) {
if ($this->CI->Gift_card_model->is... | 0 |
d563e0c13ac01600cd0e72638c8b90fa | b9a09d54434333d6e1e9d85f7b39ed19 | ----------------------------------------------
FUNCTION: UpdateCharacterUI
DATE: February 7th, 2019
REVISIONS:
DESIGNER: Keishi Asai
PROGRAMMER: Keishi Asai
INTERFACE: public void UpdateCharacterUI(Status status)
NOTES: Update the hpBar based on the given health value
---------------------------------------... | {
GUI.Label(
new Rect(x, y, this.nameRect.width, this.nameRect.height),
status.characterName,
this.nameLabelStyle);
var life_value = (float)status.HP / status.MaxHP;
if (this.backLifeBarTexture != null)
{
y += this.nameRect.height;
... | 1 |
58788a394b478bf3f30aa0f7b0249d06 | b1b1a2f3c0f6c105ac0c8110bbecd8cb | Returns all the defined custom build rules for the distribution build steps to replace. | class CustomBuild(build):
def count_rules():
return len(CustomBuild._rules) | 0 |
b4ce1bea5d796b0d1eb4e2d2314dac84 | cdf82b990baae0f34f340814c6cb2c16 | 处理指定文件夹,智能生成 README | print(' -> create readme docs...')
if not os.path.exists(os.path.join(initializer.context, 'README.rst')):
with open(os.path.join(initializer.context, 'README.rst'), 'w', encoding="utf-8") as rst:
rst.write(initializer.name)
if not os.path.exists(os.path.join(initiali... | 1 |
ca08bec1a1d41d0c237b444dc4fd1965 | 3b21b6eb85bf1a35fd0c0f1a458187bf | 获取UTF-8编码的属性值 | {
try {
return new String(p.getProperty(key).getBytes("ISO8859-1"), "UTF-8");
} catch (UnsupportedEncodingException e) {
return "";
}
} | 1 |
e17125ccc70014035c01888be810f25b | bcbf7f0ef90faf1e1dcac4b3b699802c | 완료한 프로젝트 리스트 가져오기 | namespace Peacock.InWork2.BLL
WSOutputDTO<PDTO[]> GetDoneProject(WSInputDTO<GHValue> dtoInput); | 1 |
6a047c4078fbd64f8062e92614b2158f | 466e60fc4d7bb18670b950f14cb81fb1 | Test send requests as student | self.client.force_login(self.staff_user)
mock_mailgun_client.send_individual_email.return_value = Mock(
spec=Response,
status_code=status.HTTP_200_OK,
json=mocked_json()
)
url = reverse(self.url_name, kwargs={'student_id': self.recipient_user.profile.s... | 0 |
e2756441830443f4a9ec8afac0d86ced | 51cdc51212201184097adc5fbbb3d7e9 | 이미지 모델을 제거하는 메소드입니다. | class Image(models.Model):
def delete_image(self):
self.delete() | 1 |
0b33a9e4c68db49f649d403854260d3f | 506cdf033e621fd072140257d81bbc2b | https://stackoverflow.com/a/43130355 | def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]:
for first in iterator:
rest_of_chunk = itertools.islice(iterator, 0, n - 1)
yield itertools.chain([first], rest_of_chunk) | 1 |
83165fb3cdd2a7e4ce0495f6e8a00dff | c2f1b80f7250a6471fa0def291adba11 | 插入空行,序号从1开始,在第i行插入 | private void _insert_line(object pl)
{
string *text=({ });
mapping me=pl->query_temp("me");
me["is_Command_Mode"] = me["is_NewFile"] = 0;
me["is_Modify"] = 1;
if (me["iS_Row"]+me["iRow"]-3 >= 0)
text = me["sText"][0..me["iS_Row"]+me["iRow"]-3];
... | 0 |
74bf9fb534ecf5d474a3d5c01e98bbc7 | 6f70ca55519f4c0da9a101b1c6151e36 | Validate that the attribute on the given model has a non-nil value assigned | class CaseReminderHandler(Document):
def check_state(self):
def check_attr(name, obj=self):
if getattr(obj, name) in [None, ""]:
raise IllegalModelStateException("%s is required" % name) | 1 |
6f454d06605ce3ea7e681c2bcdcacad2 | 892c9b9bc8cab370c52ffed7f4dde955 | メール送信画面 | class MessageController extends AppController
public function send($id = null) {
$this->layout = "main";
$this->set("title_for_layout","メッセージ作成 - 派遣管理システム");
$this->set('active1', '');
$this->set('active2', 'active');
$this->set('active3', '');
$this->set('active4', '');
... | 1 |
7ead71280c2e6a0852b8be082bfc64ab | 0d5ce9e50f8dc0e42f53ef4a2f015587 | Translate and event to raw data. | class Translator:
def event_to_raw_data(self, event):
raise NotImplementedError() | 1 |
5f2be644a89fe03d59ac228beed8398a | dd1ce42020c9ae638b3987522d476bbc | Using the adc peripheral library, configure ADC1 as follows:
12-bit
sample off of AN0
Use dedicated ADC RC oscillator
Automatically start new conversion after previous
Use Avdd and Avss as reference levels | {
CLK_PeripheralClockConfig(CLK_Peripheral_ADC1, ENABLE);
ADC_DeInit(ADC1);
ADC_Cmd(ADC1, ENABLE);
ADC_Init(ADC1, ADC_ConversionMode_Single,ADC_Resolution_12Bit, ADC_Prescaler_1);
ADC_SamplingTimeConfig(ADC1, ADC_Group_FastChannels, ADC_SamplingTime_9Cycles);
ADC_ChannelCmd(ADC1, ADC_Channel_24, ENABLE);
... | 0 |
24e8c42bdc7c9b9052e0c0bac336faf7 | d781d2aa00fdfe151413a99d66e2bc5a | 慣性 | public final class JavaClass extends AbstractJDependUnit
@Override
public float cohesion() {
if (this.cohesion == null) {
float intensity = 0;
for (JavaClassRelationItem relationItem : this.getCeItems()) {
if (this.component.containsClass(relationItem.getDepend())) {
intensity += relationItem.calRelat... | 0 |
87cfcc0c1e20523dd70a1ec66964b45d | 13913c2183981314e7d9606f0fc8090e | The given attribute is loaded and converted to an OGR geometry.
If force_points is True, the ogr.Geometry.Centroid method will be
applied to each geometry. Then each geometry will be represented by its
geometrical center.
If inplace is True, the original attribute will be overwritten, else
returned. | int VFKDataBlockSQLite::LoadGeometryPoint()
{
if (LoadGeometryFromDB())
return 0;
const bool bSkipInvalid =
EQUAL(m_pszName, "OB") || EQUAL(m_pszName, "OP") ||
EQUAL(m_pszName, "OBBP");
CPLString osSQL;
osSQL.Printf("SELECT SOURADNICE_Y,SOURADNICE_X,%s,rowid FROM %s",
... | 0 |
313d4742e219267dca157fc0e6652882 | dcaae458e36a0b42a5faf0a351090189 | Clears the weekly menu | cache.put(dayOfWeek, Optional.<GroceryListRecipe>empty());
try (SQLiteDatabase db = helper.getWritableDatabase()) {
String selection = RecipeEntry.COLUMN_NAME_DAY_OF_WEEK + " = ?";
String[] selectionArgs = {Integer.toString(dayOfWeek.ordinal())};
db.delete(RecipeEntry... | 1 |
5a7a427fca38a198404dd619d6f17f4b | b1c4028499daeaf272b35e5c559e95ed | マイページに遷移する際、BGMの変更処理を同時に行う(戻るボタンと一緒に登録する) | public class SoundManager : MonoBehaviour
private void OnActiveSceneChanged(Scene prevScene, Scene currentScene)
{
if (beforeScene == "Title" && (currentScene.name == "Menu" || currentScene.name == "SelectPlayerName"))
{
BGM_Title.Stop();
BGM_Menu.Play();
}
if... | 0 |
22c5bf2971e708cdecafc80e0cf0d4de | 802a619527ab17103ef8de38fd74b543 | Parse ast array expression containing plugins. | var types = astNodes.map(ast => astToType(ast) as ti.TypeArray);
return ti.composeFunctionChain(types);
} | 0 |
592321eb05cc9d527cfb036e014199cf | 80ac2ca91155c496302763a3168dcab5 | @brief LOG打印所有 PD固定输出电源数据对象 | {
struct ptp_det *det = (struct ptp_det *)m->private;
FUNC_ENTER(FUNC_LV_HELP);
seq_printf(m,
"PTP_LOG: PTPOD [%s] (%d) - (%d, %d, %d, %d, %d, %d, %d, %d) - (%d, %d, %d, %d, %d, %d, %d, %d)\n",
det->name, det->ops->get_temp(det),
PTP_PMIC_VAL_TO_VOLT(det->volt_tbl_pmic[0]),
PTP_PMIC_VAL_TO_VOLT... | 1 |
ae213ad5d2c61e32d556da2fd5281c10 | dd853e0c53438f5bf375da85897e5740 | 获得已创建的配置文件数量 | int result = 0;
for (Iterator it = Viewer.getViewerConfig().getTargetAppConfigFilesByMask().keySet().iterator(); it.hasNext();) {
String targetAppConfigFileMask = (String)it.next();
List targetAppConfigFiles = (List)Viewer.getViewerConfig().getTargetAppConfigFilesByMask().get(targetAppConfigFileMask)... | 1 |
e08a116e9ed933d337367fc32d2fc07e | 5e53f9a4158be156cf108bf5f527a9bb | Resets the ID input | if (this.configData.participantIdBase !== '') {
const element: HTMLElement = this.participantIdBase.nativeElement;
element.dispatchEvent(new Event('input'));
}
} | 0 |
fd55712ac3020919a2e762b40ef3a9e2 | 9acdf7578a9f63e0b7363a7a7d408a0a | Returns the primary key of this sku sales. | @AutoEscape
public String getSku(); | 0 |
6025b57f9dda22f9d9a6fdee5a53e872 | 1998db28d15dcb1a29ece677cfc48652 | start the message handling thread | class MsgHandler(QThread):
def run(self):
self._main_window = client_holder.get_instance('MainWindow')
self._sender.start()
self._receiver.start()
while True:
msg_dict = self._receiver.pop_msg_from_queue()
if msg_dict is not None:
self._handle_mess... | 1 |
a5aa2e635b37c3d6cdcd80301bc37348 | 8843427dee0dd0f57c29af087caefc9a | Расчет объема позиции фьючерсного контракта | namespace OsEngine.Entity
class MarketDepthSpreadAnaliser
private decimal GetPrice(List<MarketDepthLevel> marketDepthLevels, Position p)
{
decimal ost = p.OpenVolume;
decimal sum=0;
foreach(var el in marketDepthLevels)
{
decimal min = 0;
... | 0 |
de4398c55023599036715fb858ee500c | a2f2b73fb9237e434ab5f6e8fe16948e | 初始化数据库信息,需要传入数据库名称和版本号 | public class DataSource
public void initialize(Context context, String databaseName, int updateVersion){
DatabaseCreator databaseCreator = new DatabaseCreator(context, databaseName, updateVersion);
this.databaseName = databaseName;
this.currentVersion = updateVersion;
if(database == null || !database.isOpen()){... | 1 |
eca53c88757c82b60371a6dabf5e175c | f7e113312c521db20eaab81bc14af14c | 疑问句分析 | jieba.load_userdict(USER_DICT_FILE_PATH)
segment = jieba.lcut(question, cut_all=True)
while '' in segment:
segment.remove('')
print('[segment]', segment)
is_place, place = ask_place(segment)
if is_place:
return place
else:
i = 0
while i < len(segment):
... | 1 |
4575324eadfa99f777f01d93c613a002 | 6e1e4e3774fc1bebf7c67b691b21c3e5 | 產生指定的PointModel | public class PointManager : SingletonMonoBehaviour<PointManager>
public void CreatePoint()
{
int index = 0;
index = Random.RandomRange(0, popPos.Length);
Vector3 pos = popPos[index];
var obj = Instantiate(pointPrefab);
obj.transform.position = pos;
} | 0 |
4e3adce09bfd3379277367396eed4e71 | fade19ae67d7da0aa1e7ed1607d73520 | function to update the bullets shot out by the player and to
produce appropriate interactions with the current level | void Game :: advanceBullets()
{
for (int i = 0; i < bullets.size(); i++)
{
if (bullets[i].isAlive())
{
bullets[i].advance();
if (bullets[i].getCount() == 40)
{
bullets[i].kill();
}
}
}
} | 1 |
ef80e1af92d48ff42b73d2dbfbbbabaf | 983f2a886eb98ebe05a1e201edaecc50 | 获取弹出框文本信息函数 | namespace App.Controls
public partial class UI
public static string GetText(PopupBox tb)
{
return tb.Text;
} | 1 |
b1935825cc39336f9d435508f770be19 | 3f20de49f53bcef388c440d0efb25460 | Метод получения задач на текущий день | {
$sql_query = 'SELECT title AS name, DATE_FORMAT(deadline, "%d.%m.%Y") AS date FROM tasks WHERE status = 0 and deadline <= NOW() and deadline >= DATE_SUB(NOW(), INTERVAL 24 HOUR)';
$result = mysqli_query($connect, $sql_query);
if ($result) {
$result = mysqli_fetch_all($result, MYSQLI_ASSOC);
}... | 0 |
fa64dfae3f1d35c0239a07b0d67d378c | 350028599d4ec9fe6b971dd06e61e1f4 | update a WARC metadata record from a scrapy Item | r = item_et.find('record')
attrs = {}
for attr in r.find('attributes').findall('attr'):
name = attr.get('name')
if name in attrs:
attrs[name] += '\n' + attr.text
else:
attrs[name] = attr.text
id_ = r.find('recordId').text
o = {
'title': item_et... | 0 |
9430d14ef6c5012fd9b2a4da05823ea8 | e986ae98f046b51a537aa5652d621caa | 根据商店名称查询账单 | Store operator_find(String storename); | 0 |
454353151c5f0752a1b82a6a79986a39 | 58a5db144f4c77e57c8e739c0c69d6a9 | For now, it will always return true so it will always drop an item
But if we want chances, then we'd uncomment the stuff. | bool IResearchLink::canBeDropped() const {
return true;
} | 1 |
f49512977ab0c72a2195942615fd3a9b | 2274ca66edd1a61bd4ead77d3d092101 | 현재 원소 리스트에 있는 각 원소의 개수를 측정합니다. -> 마법의 위력 결정 | {
int burn = 0;
int poision = 0;
int buddle = 0;
for (int y = 0; y < yDim; y++)
{
for (int x = 0; x < xDim; x++)
{
if (pieces[x, y].state == State.burn)
{
burn++;
}
if ... | 1 |
2612cd189537612fbae9c3777b08c991 | 941ebe6adc7bfe7dd62f3d3a45a8744d | 查询邮件概况
针对某域名,统计一段时间内,发信总量和收信总量 | {
$db = self::__instance();
$sql = <<<sql
SELECT mail_to,count(*) num
FROM wangfq.etl_mailamavis
WHERE mail_time >= to_date('{$start_date}', 'yyyy-mm-dd')
AND mail_time < to_date('{$end_date}', 'yyyy-mm-dd')
AND lower(mail_to) LIKE '%@{$mail_to}'
group... | 0 |
da652a1db9162057f2e41c657b77901e | 0baca3c913395ed9485c32f3e30c8684 | Edit Testimonial (admin) | {
$request->validate([
'testimonial_id' => 'required',
'person_name' => 'required | max:100',
'designation' => 'required | string | max: 255',
'description' => 'required',
]);
$testimonial = Testimonial... | 1 |
264911fe509a30abd537c3b255a95ed9 | 93730e95656b317993456116417e635f | 检索公交站牌 | public class BusStationActivity extends Activity implements
OnMarkerClickListener, OnItemSelectedListener,
OnBusStationSearchListener, OnClickListener
@Override
public void onBusStationSearched(BusStationResult result, int rCode) {
dissmissProgressDialog();
if (rCode == AMapException.CODE_AMAP_SUCCESS) {
if... | 1 |
faf8d0295e07bf5f4d44858202e46996 | 7e1cd86c5eedabe72fd23ee8bfd01fac | Retourne l'ensemble des termes alternatifs de ce concept, quelque soit la langue. | public SCollection<String> getAlternative(); | 1 |
3980ead295bfe14b3076b4a14644d90c | 3b84064835aa8e7a1c271fbe831fad63 | Completes the accept process that was initiated with
<see cref="BeginAccept"/>. | namespace Gorba.Common.Medi.Core.Transport.Tcp
internal class TcpStreamServer : IStreamServer
public IStreamConnection EndAccept(IAsyncResult result)
{
var asyncResult = (SimpleAsyncResult<IStreamConnection>)result;
return asyncResult.Value;
} | 1 |
aea8916ca27e20f09930facc0f5e9484 | bdde16433c6672fcf6647c8712ae331d | Control para mostrar a las actividades en un select | class MvcController{
public function vistaPlanEntreSelectController(){
$respuesta = Datos::vistaPlanEntreModel("plan_entrenamiento");
$a="";
foreach($respuesta as $row => $item){
$id=$item["id_planEntrenamiento"];
$e=$item["codigo"];
echo'<option value='.$id.'>'.$e.'</option>';
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.