query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2d305b0e7ce2273b22bce39148f9e67a | 27b2e19a2af9de5f69b02b97f9760634 | 在欢迎界面停留1500毫秒 也就是1.5秒 | imageViewWelcome = (ImageView) findViewById(R.id.imageView_welcome);
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();... | 0 |
708a546dc1043c70d08ffa1c1f8f12e3 | 7933c2c6e919322382c95e8064ea6bbc | An abstraction for reading and parsing Apache log files. | class Parser(ABC):
def __init__(self, logs: list) -> None:
self._logs = logs
self.metric = Metric() | 0 |
b9f7e590053eb8180e99d3539e9c983d | 8d585f5cf659ceaf2d93a732d3c3a56d | <para>Activates all <seealso cref="JobDefinition"/>s of the provided process definition key.</para>
<para>Note: for more complex activate commands use <seealso cref="updateJobDefinitionSuspensionState()"/>.</para> | namespace ESS.FW.Bpm.Engine.Management
IUpdateJobSuspensionStateBuilder ByProcessDefinitionId(string processDefinitionId); | 0 |
f27a8b27257be03ca2eaf083c64b6d56 | 8d7cfc156f14ec6da8f8f2cce2fdd353 | Добавляет перевод аннонса | public function addAnnotationText(AnnotationText $annotationText): Phrase
{
return $this->addPhrase($annotationText, self::annotationText());
} | 0 |
b89248029bcaa08b12723847b3a71b62 | c7c6ff722f661c32bc8bf4922c11d824 | Returns the map for a given source for the extended model. | namespace Tuohy.Epi.Docs.Interfaces
TTarget Map(TSource source); | 1 |
c37fdfbda444209657028c73d6bcd146 | 1ef009789dfbd7523534783aba0f8cf9 | 同じ名詞の連続 | def get_NO_connected_np(parsed_sentences):
connected_np = set()
for sentence in parsed_sentences:
for no_idx in range(1, len(sentence) - 1):
if (sentence[no_idx - 1]["pos"] == "名詞" and \
sentence[no_idx]["base"] == "の" and \
sentence[no_idx + 1]["pos"] == "名詞"):
connected_np.add(sentence[no_idx - 1]... | 0 |
7b087379748c978af364b84d795393f8 | 01968a91742f68f4e47b0c354f3de342 | 保存温度基础数据 | public class Preferences
public static void updateTemperatureCommonData(Context context,
String data, String version) {
try {
if (!TextUtils.isEmpty(data)) {
setString(context, FILE_PREFERENCE_COMMON_SETTING,
PREFERENCE_TEMPERATURE_COMMON_DATA, data);
if (!TextUtils.isEmpty(version)) {
storeD... | 1 |
1382eae291d46bcd0da298b67e9ac294 | a243fce00d28b9a742e7f93f68be2025 | Get initial y position for selection range | if (selection.isReversed) {
return selection.active;
}
return endPosition(selection, document);
} | 0 |
e98fc799249eacc6d7799568f9359238 | 8fba92b8b1471259a0dea1026a267663 | If the current user is the guild owner, then it can manage itself. | class botMaintenance(commands.Cog, command_attrs=dict(hidden=True)):
async def cog_check(self, ctx):
return self.bot.owner_id == ctx.author.id | 0 |
fe6a738b88eed471fac515ac2fc0ce03 | d22f20ce611e063e68c51edf36633636 | Utility of a path from src xy to trg xy | double utilityPointToPoint(int src_x, int src_y, int trg_x, int trg_y)
{
double util = 0.0;
int iter = a_Star(src_x, src_y, trg_x, trg_y);
if(iter != 99)
{
for(int i = 0; i < iter; i++)
{
if(PacMap[aPathX[i]][aPathY[i]] == 4)
util += 0.8;
if(PacMap[aPathX[i]][aPathY[i]] == 5)
util += 5;
int g =... | 1 |
6539ae3da053ff28b3211c3231cb9529 | c0c42a98e7147ea135e3f983202063f6 | 支取通知存款费用试算-----回调 | function callback(res, opt) {
Alert(LU_MSG('cancelFeeSuccess'));
App.main.infoPanel.setReload(true);
App.main.infoPanel.getPayfeePanel().refresh();
App.main.infoPanel.getAcctPanel().refresh();
App.main.infoPanel.getDocPanel().setReload(true);
App.main.infoPanel.getDoneCodePanel().setReload(true);
} | 1 |
2c334b77fd8a0daa50ba9aee8f516516 | 4ba8ea67807e71f156f94982c2376b01 | If we have a connection string, construct our context with it,
if not, use the new constructor | DbSelect::DbSelect(const std::string& crit) : m_context(0), m_criteria(crit) {
m_context = new DbSelectContext();
} | 0 |
1fe2622dfa1bc1fb897328df64bf252c | fb1b4948e26c3ac7563d12b7f3979145 | 작업중인 행동 규칙 화면을 갱신합니다. (블록 코딩 부분) | class Controller_Tasktracker_Common extends Controller_Tasktracker_Base
public function action_routine_setting(){
$this->view->set_filename('tasktracker/common/routine_setting');
$this->response($this->view);
} | 0 |
0cc87bfd5b278eeeaa59625641a2e4c9 | 662c7e6a79ceb2002d262893a5d17f71 | 把所有的金额 除以100 | {
try
{
return Convert.ToDecimal(amount) / 100;
}catch{
return 0;
}
} | 1 |
4cafb9d805860473d8a6e725d240ca9b | 94ed7ce27e1afe89dfd4b24aca909ccb | @brief 线程变量初始化函数 | void thread_init(int *info) {
int i = 0;
pthread_t stid;
static int init = 0;
*info = FT_OK;
if (init) {
*info = FT_EINIT;
return;
}
threads = NULL;
array_init(&threads,INIT_SIZE);
thread_attrs = NULL;
array_init(&thread_attrs,INIT_SIZE);
thread_keys = NULL;
array_init(&thread_keys,INIT_... | 1 |
b3d9bd8326f693c0e839f688260c06e8 | 6c4497121045719ac66a632bc62d05e8 | 给员工添加表彰信息 | {
$model = new self;
$model->employee_id = $employee_id;
$model->type = $type;
$model->credit = $credit;
$model->note = $note;
return $model->save();
} | 1 |
0cb6de5c04f71957c6cca4e4b1fcbd3a | 6419099c4b8cb81468b3bf7bff368521 | ParseString text/template for a string. Fails on error. | if html := template.HTMLEscapeString(text); html != text {
return ierr.BadRequest("text contains html")
}
if js := template.JSEscapeString(text); js != text {
return ierr.BadRequest("text contains js")
}
return nil
} | 0 |
191512a863eef871d88fd531aa6e9800 | 0ff7cc827802c65ed93d094084fdaa33 | Добавление инструмента | self.p_2_info('%s has been connected successfully.' %self.Ins_type)
MainWindow.INSTRS.append(instr)
MainWindow.NAME.append(self.Ins_name)
self.row_len = self.ui.table_instrList.rowCount() -1
self.ui.table_instrList.insertRow(self.row_len +1)
Ins_property = [self.Ins_name,... | 1 |
fbbc87f26134478cca86a005c539d2c5 | a6af7da17db0d2b27a2dfb4e6693c448 | real numbers are either in the true or false range
according to the semantics of mathbuild. This method
returns true if this number represents true, and false
if this number represents false. | public class BinaryMulExprPro extends BinaryMulExpr
implements ExprPro
public boolean isNumber()
{
return true;
} | 0 |
c27ace427d723cf1cdc4cd1cd0740826 | 9d5bdc808bc551e04ea2746de9c52adc | Set a new subscription status for this member, must be either subscribed, unsubscribed or cleaned | class Client:
def set_subscription(self, subscription):
self.subscription = subscription
self.subscription.append("type")
self.state = Client.CS_SUBSCRIBED | 0 |
c3e10db11a8a88bd214e6ecb373fbe15 | 31baa8093ac9fdb8e7616217d97d43ce | Setter for <code>TEXTSITES.NAME</code>. | public class SelectTranscriptSchoolTag extends TagSupport
public void setName( String name) {
if ( name == null) {
name = "";
}
this.name = name;
} | 0 |
3ff2c1b5ea1cfcdf32d3be6b6c713bd0 | ba45c499306a9be9d4930dcdb7c7408d | Map sequence references to equivalent bismark indexes | class TranscriptDBWriter(object):
def _index_with_tabix(self):
pysam.tabix_compress(self._fn + '_tmp', self._fn + '.gz', force=True)
pysam.tabix_index(self._fn + '.gz', seq_col=4, start_col=6, end_col=7, meta_char='#', force=True) | 0 |
a0728b0c4c7fc76a6b64fae846536ba6 | 77f5915d6e6256ef66b877499cdc1e48 | This method does the basic motion laid out in the project instructions. For each frame,
boundary checks are conducted, and the velocity is changed as needed. | public class BasicMotion
public void basicMotion() {
PVector v = behavior.behavior(obj.getMotion());
obj.getMotion().setVelocity(v);
obj.getMotion().kinematicUpdate();
float x = obj.getMotion().getPosition().x;
float y = obj.getMotion().getPosition().y;
if(y <= turnCornerMin ) {
behavior.setDest(turnCorn... | 1 |
5bfa9402d87385a833a80b836196cbae | 6bb552e59ee1fdd0ba6d3102c9f2f984 | Haetaan sudokusta koko rivi listana, rivi-indeksin mukaan | function solver(tablevalues)
function findValuesFromVerticalLine(i) {
var list = [];
for (var j = 0; j < 9; j++) {
if (A[j][i] != 0) {
list.push(A[j][i]);
}
}
return list;
} | 0 |
bf076c607bfd3bf12fc6537a67d79408 | 7a66b2cbce676fecfe3453a5b03755bf | 取消下载按钮点击事件 | {
if (btnBegin.InvokeRequired)
{
delVoidFunction d = new delVoidFunction(EnableBeginButton);
this.Invoke(d, null);
}
else
{
btnBegin.Enabled = true;
btnCancelDownload.Visible = false;
... | 0 |
1b0dafbcea1ad476727941bac4904beb | be2ae0f509f2e4a880de121e68c1e331 | Returns a value indicating if the date/time value is valid for SQL Server. | {
if (dbType == null)
return false;
else if (dbType is DbType)
return ((DbType)dbType) == System.Data.DbType.Time;
else if (dbType is OracleDbType)
return ((OracleDbType)dbType) == OracleDbType.IntervalDS;
else
... | 0 |
4aa65aaca60eec1811258c2be4777de6 | f4e468f9d26fbad9a34b0ca99c018cb0 | We don't need to create directories in zip archives | class ZipPath(PathBase):
def is_real_dir(self):
return False | 1 |
a06bbf9002194c09e4c35a712309ab4e | b669f33be49b0fe7e1662b0fc4c4cbe7 | https://github.com/KieranWynn/pyquaternion/blob/master/pyquaternion/quaternion.py#L965
Get the 3x3 rotation matrix equivalent of the quaternion rotation.
Returns:
A 3x3 orthogonal rotation matrix as a 3x3 Numpy array
Note:
This feature only makes sense when referring to a unit quaternion. Calling this method will impli... | w, x, y, z = q
Nq = w*w + x*x + y*y + z*z
if Nq < FLOAT_EPS:
return np.eye(3)
s = 2.0/Nq
X = x*s
Y = y*s
Z = z*s
wX = w*X; wY = w*Y; wZ = w*Z
xX = x*X; xY = x*Y; xZ = x*Z
yY = y*Y; yZ = y*Z; zZ = z*Z
return np.array(
[[ 1.0-(yY+zZ), xY-wZ, xZ+wY, 0.0 ],
... | 1 |
efb1eec7d60499cb5249df603cf1186b | d90d49ce44cc35b43f45331b63d9ac37 | Exibe tela para realizar transferencia entre contas | class HomeController extends Controller
public function showTransfer()
{
return view('transfer');
} | 1 |
36448d9050aa183fee538cbfeb55f2e8 | dd48961d3b1a250b92e0dd624384ca51 | Unsets the "Cause" attribute | namespace Bandwidth.Standard.Voice.Models
public class CallState
public void UnsetDisconnectCause()
{
this.shouldSerialize["disconnectCause"] = false;
} | 1 |
1d00ea103ef496273b4740e2c982f4b2 | 8180e3d08243b9f8e801f778f900eaf9 | Returns the Amazon resource name (ARN) of the bucket to which data is exported. | class BucketArgs:
def arn(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "arn") | 1 |
b666551b65c2f5a9efb63f2348c1d7ec | f1ebb9ba9cd5373ca2f637471d9f8afd | after login redirect to profile | class Login extends Component
componentWillMount() {
if (this.Auth.loggedIn()) this.props.history.replace("/Profile");
} | 1 |
d64597d0509be9d1db83f26f534dba3d | 81b56174aec639e2d7d5118274e04c06 | Plays mouse enter sound. | public class MenuButton : MonoBehaviour
public void PlayMouseOverSound()
{
audioSource.Stop();
AudioManager.Play(AudioClipName.BUTTON_ENTER, audioSource);
} | 1 |
47e21b677cb38d2ea73186c2247955ae | 9d33ceeac8170385992b35614bf2b138 | 测试读取单行效率 | {
Stopwatch stop = new Stopwatch();
string connString = "Server=.;Database=Inte_CRM;uid=sa;pwd=123456";
var context = new DataContext(new ICS.XFramework.Data.SqlClient.DbQueryProvider(connString));
stop = new Stopwatch();
stop.Start();
for ... | 0 |
5e4396e6630b56e491b95ff95a166d6f | 476ac9665a58ef0784121d8d69f24343 | Метод отвечает за физическое сохранение файла на сервере. | public class FileManager
public static long writeFile(TransferFileMessage inMessage, String pathToFile) throws IOException {
long fileSize = 0;
Path fileOnServer = Paths.get(pathToFile);
byte[] data = inMessage.getData();
if (inMessage.getCurrent() == 1) {
if (Files.exists(fi... | 1 |
1b5786c530ddbd98785e701d440920a1 | 5073e6188321515f8e6bf87bc28e7b21 | 返回该条维基的评分的小数位 | class Extractor:
def get_score(self):
score = self.soup.find('strong', {'property': 'v:average'}).get_text()
if score:
return score
... | 1 |
81b232c19338586cdf969e32061a2367 | a49741c276972ab5192e326d0ba22212 | Adds PopupMenuListener to combo box to listen to the events fired by the
combo box's popup menu containing its list of items | class MainFrame extends JFrame{
public void addPopUpMenuItemsListeners(ActionListener cutListener, ActionListener copyListener, ActionListener pasteListener){
cutItem.addActionListener(cutListener);
copyItem.addActionListener(copyListener);
pasteItem.addActionListener(pasteListener);
but... | 0 |
4e698c8eb561633eb3a0c9c62a1cc219 | e767af05c3f48132be2b4d8364aa2741 | Set Sales Rep. | class Outboundorders
public function setSalesrepresentative($salesrepresentative = null)
{
$this->salesrepresentative = $salesrepresentative;
return $this;
} | 1 |
72dac3336d58e82c1a168aa223bb81d5 | 145f147284715cb9c62ab521e830ecd5 | 根据历史统计信息记录从一个 zone 到另一个 zone 的概率
从一个 zone 出发的所有概率只和 <= 1 (没有 normalize 到 1) | public class ExchangedParameter implements Cloneable, Serializable
public static List<Double> normalZCondProbs(List<ExchangedParameter> parameterList, double[] xVector, double[] zVector) {
return normalZCondProbs(parameterList, Arrays.asList(xVector), Arrays.asList(zVector));
} | 0 |
0d2da5fdd261ea7351b89be5500b45cb | 77c0dbfef3228643ea098bf6f46e936b | From: https://pandas.pydata.org/pandas-docs/stable/user_guide/cookbook.html | def assert_frame_equal(df1, df2, **kwds):
from pandas.util.testing import assert_frame_equal
return assert_frame_equal(df1.sort_index(axis=1), df2.sort_index(axis=1), check_names=True, check_dtype=True, **kwds) | 1 |
7255432d1d882320113e79b10fb8f27c | db4e9447785f160acea89c24d429cfb7 | The average training loss per sample for the last minibatch trained | float NeuralNetwork<DTYPE>::GetLoss() {
float avg_loss = 0.f;
int batchsize = m_aLossFunction->GetResult()->GetBatchSize();
int timesize = m_aLossFunction->GetResult()->GetTimeSize();
for (int ba = 0; ba < batchsize; ba++) {
for (int ti = 0; ti < timesize; ti++) {
avg_loss += (*m_aL... | 1 |
7d15e451a5b7ef12ec8fe4c6e6e4efa7 | adb0b199dffdcf17194b97c26417e0d3 | Finds out what row the coordinates are in with a reversed perspective | public class MazeView extends View
private int inverseCoordinates(int y){
return (19 - y);
} | 1 |
cb5fcbf89210b234769c56c934ad8bc0 | bf377a2054d4de9b1f8c1b499021a2ea | réinitialiser les éléments des frais forfaitisés | namespace Gsb_Frais
public partial class Accueil : Form
private void bt_Effacer_ElementsForfaitises_Click(object sender, EventArgs e)
{
txt_InsertEtape.Text = "0";
txt_InsertKm.Text = "0";
txt_InsertNuit.Text = "0";
txt_InsertRepas.Text = "0";
} | 1 |
203a7c8e7ce0cb6d962ab93cf9066091 | 3defd6e377c0dfdbc4d359a0eb15d07a | If it's not a local var or a function parameter, then it's probably
referencing something outside the function scope. | const blockVar = this.getScope().findBlockScoped(varName);
if (blockVar) {
return;
}
const funcVar = this.getScope().findFunctionScoped(varName);
if (funcVar) {
funcVar.markHoisted();
}
} | 1 |
5dd6ee0beaa2645ff29a4e453ba8a7a3 | b7fead9c716f3ad3ce0d4c0321e2ea2c | Sets the value of the fkVocAttivitaVigilanza property.
allowed object is
{@link DSchedaVigilanza.DAttivitaVigilanzaTrasferimentoProprieta.FkVocAttivitaVigilanza } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"codiProvenienza",
"fkVocTipoStrric",
"textTitoloStrumento",
"fkFonte",
"textEstrCronoTestuali",
"dateEstremoRemoto",
"textSecoloRm",
"fkVocValiditaDtrm",
"fkVocSpecificaSerm",
"dateEstremoRecente",
"text... | 0 |
47aa672c62f3828c0baa33f866ea15ae | cd84dff1a5c1b0ea347f96638c1ea584 | Write key pem (necesary to connect with IoT Core) in NVS (ioled_data partition) | {
nvs_handle handle;
esp_err_t err;
if (!app_nvs_validate_wifi_creds(creds))
{
return ESP_ERR_INVALID_ARG;
}
err = nvs_open(APP_NVS_STORAGE_NAMESPACE, NVS_READWRITE, &handle);
if (err != ESP_OK)
return err;
err = nvs_set_blob(handle, APP_NVS_CREDS_KEY, creds,
... | 0 |
b8527691c21103b52d56ea90abbad2c4 | 838c7341c4bde16a8c14daea12441905 | Marca la casilla y retorna el nuevo tablero | if (estaMarcada) throw new RuntimeException("La casella esta marcada");
else if (estaDescoberta) throw new RuntimeException("La casella esta descoberta");
else estaDescoberta = true;
return teMina;
} | 0 |
8ca2ebed00a9121808e943c12f663c3b | 0035c0ab4a776781ffc16cae6645bc23 | Pretty print serialized job. | atts = self._attributes.copy()
job_str = self.job_name_comment.format(atts['insert_job']) + '\n\n'
job_str += 'insert_job: {} job_type: {}\n'.format(atts['insert_job'], atts['job_type'])
del atts['insert_job']
del atts['job_type']
for attribute, value in sorted(atts.ite... | 1 |
ceed2754325c66e724ebf058119bf8b2 | 9d13276ef50528a79f6936c9733a15db | 餐馆列表 | class WyFoodsService extends BaseService
public function search(){
$responseJson = new ResponseJson();
$r = new R();
$name = $r->name;
$page = (int)$r->page;
$pageSize = (int)$r->pageSize;
$name = str_replace('"','',$name);
$page = $page > 1 ? $page : 1;
$pageSize = $pageSize > 1 ? $pageSize : Constant:... | 0 |
458784d0b5793fb78cd4d269400b940e | 51b538a4a5dabc64b739f23ad6dcc58d | Test gesd on real data with standard. | self.assertEqual(self.gss.run([12.3, 12.2, 12.19999, 3, 2.9999, 3.0,
3.1, 3.2, 3.3, 3.4, 5, 66, 777, 888]),
2.9999)
self.assertEqual(self.gss.run([12.3, 12.2, 12.19999, 3, 2.9999, -3.0,
-2.99999, 0, 2.2,... | 0 |
be590472ad864899b25fc9501f664bff | c9e7b04a90a80b4088aa4a2eef3b9680 | Changes filter so that GetFirst() and GetNext() will return saved games | {
if (_store == null)
return;
StoredGames.Clear();
foreach (String name in await _store.GetFiles())
{
if (name == "SuspendedGame")
continue;
StoredGames.Add(new StoredGameModel
{
... | 0 |
a1ea8ba537d21b9efdb5f332e40fd2d7 | 294e58b915d66349085a7bce992a68c1 | 设置SmartSelect选择条目 | class Libs_Global_Page
public function setSmartShow($smartShow) {
$this->SmartShow = is_array($smartShow) ? array_merge($this->SmartShow, $smartShow) : $smartShow;
return $this;
} | 0 |
0e72458a17b323f51d32e132cc67e6be | a837ba6ab27fea6bc155ab8b76f906d2 | notify the renderer that we want to change the encoder's state | int VideoGen::onEncodeDeviceChange(){
#ifdef ENABLE_GEN_LOG
infoRecorder->logTrace("[VideoGen]: on encoder device change.\n");
#endif
ENCODER_TYPE oldType = useEncoderType;
if(isChangedDevice){
isChangedDevice = false;
if(useEncoderType == changeToEncoder){
return 0;
}
if(encoderType == ADAPTIVE_C... | 0 |
76a90a153ba56360c2d09d04cc112325 | d08d8f06ab616574dea5aa3121409a5c | 页面中平滑滚动 | window.onscroll=function () {
var btn = document.getElementById(buttonId);
var sto = document.body.scrollTop||document.documentElement.scrollTop;
var timer = null,step = 0;
btn.onclick = function () {
var start = sto,end = sto;
sstep = 0;
timer = s... | 1 |
694af85d1b14cc1f454079b9dd46c4a1 | bb5d7068b22b7e1371845e5561792ed8 | u'''获取表格中的所有行对象 | class GridTable(object):
def get_all_rows(self):
for row in self._rows:
yield row | 1 |
acf12b0648112129b006cf9a2ff2108a | 734b452603efa22ceac0e268637ab758 | 显示游戏通关界面 | function LoginScene:showEnterGamePanel()
self:showLabTips(tostring("showEnterGamePanel").."_")
self:closeAllPanel()
if self.enterGamePanel == nil then
self.enterGamePanel = require("app.login.LoginEnterGame").new()
self.mainLay:addChild(self.enterGamePanel)
end
self.enterGamePanel:op... | 0 |
ae51772af4aab53ef0ad77e8193b1cad | 1cf824f3de739c0f412e9d23a6335c9f | Donne la position du boss | Hero trouveHeros(PositionE pos); | 0 |
a5960a3b5459003b0e905d5755c6c7e4 | 324f502c0d055038577a363f305f3a27 | 推出一副52张的新牌 | print('\n 新牌')
marks = ('♠', '♥', '♦', '♣')
nums = ('A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K')
for cn in nums:
for cm in marks:
card = cm + cn
new_deck.append(card)
return | 1 |
48ccfb953f9f5db6599ba9b86327d1e9 | a9f865bb4a9bb030b8aeee98f4b4f111 | レベル1ヘッダ、レベル2ヘッダ、レベル3ヘッダの ヘッダデータからCRC16値を読み込む。 | public class LhaHeader implements Cloneable
private static boolean verifyHeaderCRC16(final byte[] headerData) {
switch (headerData[HEADER_LEVEL_INDEX] & 0xFF) {
case 1:
case 2:
case 3:
return readHeaderCRC16(headerData) == calcHeaderCRC16(headerData);
default:
return false;
}
} | 1 |
3b9ebed940c891feda5e2462f4772f45 | cfd87856c46bcbb5ed025931b19fb26e | Valida que haya periodos para mostrar en pantalla | class Metricas extends CI_Model{
public function get_period_data($id)
{
log_message('debug', 'get_period_data');
$this->db->select('period_shown');
$this->db->from('config');
$this->db->where('user_id',$id);
$result = $this->db->get();
log_message('debug', 'Last Qu... | 0 |
61dbd96d6bac2df602e082be2c693696 | 9bd00ac1ae4716ea1615ad3859634c8c | function gets the subcategories of the current $category_id and puts them in the category_count_array and iterates for each
returns the count total for itself and its subcategories (and an array of the contributors to the count) | static $tmp;
if($indent==0)
$tmp = FALSE;
foreach($catIDs as $catID) {
$pair[0] = str_repeat(" ", $indent*3) . $catNames[$catID];
$pair[1] = $catID;
$tmp[] = $pair;
if(array_key_exists($catID, $subcats)){
build_category_array($subcats[$catID], $subcats, $catNames, $indent+1);
}
}... | 0 |
d2ba6fed6aaf96196167aab3f5ac79ed | 23a24336676b651b57fb3c7722d79575 | GET: Engine/Create | public async Task<ActionResult> Create()
{
var lstLocation = (from pm in db.Papermills
group pm by new { pm.location } into grp
select grp.FirstOrDefault()).ToList();
var lstPapermills = db.Papermills.ToList();
... | 1 |
6937b46212d9deace03b2db85d349b0d | 74b3dc804aaf388eb05b0333e8865a55 | Transforms the input argument channels to a list of integers. | class Transformation(Comparable):
def get_input_channels(self, output_channels: Set[ChannelID]) -> Set[ChannelID]: | 0 |
cf27dd7979fe2c28adf5bc21d2795774 | 718ec3399bbdc2fd412c70c8da891b80 | 生成json格式参数
<p/>
将 id,1,limit,9类似的字符串转换成json字符串 | JSONArray jsonArray = new JSONArray();
if(listDto != null && listDto.size() > 0){
for(ParamDto dto : listDto){
JSONObject temp = new JSONObject();
temp.put("sourceEntityId", dto.getSourceEntityId());
temp.put("planTrainId", dto.getPlanTrainId());
temp.put... | 0 |
02e64567547a28f7c70808d222ba2619 | 232cae9ea5f7d354d596b4257cfece7b | Collision resolution between a dynamic and static object | {
if (pObject1->isSolid() == false || pObject2->isSolid() == false)
return;
std::shared_ptr<MoveableObject> pMovingObject1, pMovingObject2;
if (pObject1->isStatic() && pObject2->isStatic())
return;
pMovingObject1 = (pObject1->isStatic() || pObject2->isStatic()) ? std::static_pointer_cast<MoveableObject>(pObject... | 1 |
3763fedca66a449c81e4d4d3cb5e9ef6 | 32cf3ba0acf3154c90e8299393b7da5c | Funcion para encontrar el area de una esfera | def calcularareaEsf(radioa):
valorArea = 4*pi*(radioa**2)
return valorArea | 1 |
f5056d418fa62ac9231617633eeb46fd | bb1a7fc420f747e4a114d45a017fc9c6 | Set Database type of the source instance. Valid values for database migration: `mysql`, `redis`, `percona`, `mongodb`, `postgresql`, `sqlserver`, `mariadb` | public class SwitchDrToMasterRequest extends AbstractModel{
public void setDatabaseType(String DatabaseType) {
this.DatabaseType = DatabaseType;
} | 1 |
cf961fdbcffd80df359b241d8bba8634 | a99fd8de717a831d16f5782145b62512 | The column index of the nth cell. | function ix(j,k,nCols) {
return j * nCols + k
} | 0 |
817d2cc5fdf7bc79d724bdb0dc7a41b5 | 8378036287d0eaf899d9cb0430d37aee | Returns dictionary with mapping: vertexIndex -> clusterIndex | class IVertex(Interface):
def toMap(): | 0 |
c342d0586956de8f3ee70cc1c961d532 | 350eb947f0fb588e8d45e38771beab92 | 利用坏字符,计算下一个需要移动的距离 | public class BmMatch
private static void shift(String target, String badChar, String goodTail, int badIndex, Shift shift) {
int badShift = getBadCharShift(badChar, target, badIndex);
int goodShift = getGoodTailShift(target, goodTail, badIndex);
if(badShift > goodShift) {
shift.setValue(badShift);
}
else {
... | 1 |
154a156644469d92d7ff15ce587db11e | 6f02852c45a1b9c6e2ae3c71573940a2 | Sends event to DB to retrieve terms | let conn = pool.get().expect("couldn't get db connection from pool");
let terms = web::block(move || actions::get_terms(&conn))
.await
.map_err(|e| {
eprintln!("{}", e);
HttpResponse::InternalServerError().finish()
})?;
if let Some(terms) = terms {
Ok(... | 0 |
5e023b6bece8f18ccb156bf58edfb2a4 | a949be4b8019a89c8a0c19b3383aa434 | Delete the Vertex Buffers for the Grid and Axises | if (vertexarray != 0) {
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, 0, 0, GL_STATIC_DRAW);
glDeleteBuffers(1, &VBO);
glDeleteVertexArrays(1, &vertexarray);
}
} | 1 |
20284f675aab51d10cef7b9f4bba65e9 | ecff99bc8968cef67d6a1485668472b6 | Gets the checkout page | [Route("Shop/Checkout/{id?}")]
public IActionResult Checkout()
{
int accountId = int.Parse(HttpContext.User.FindFirst(x => x.Type == "Id").Value);
ViewBag.Cart = bookDB.GetCart(accountId);
List<Address> addresses = addressDB.GetAddresses(accountId);
... | 1 |
b9785c5697ce5c2a65db7766de6ab22c | 991b3e375f5760e98f2c48b2fbf81ede | возвращает количество документов выбранного типа | namespace AccountingSoftware
public abstract class DocumentSelect
public int Count()
{
return BaseSelectList.Count;
} | 1 |
d5a334c097bcb62bae64fbd7d12714e2 | 849d17f9ab32bdb5b71918c633e84089 | Test GraphQlParser.parse() on valid documents. | content, status_code = graphql_server()
GraphqlServerTest.mocked_graph_sync.assert_called_once_with(
schema,
GraphqlServerTest.json,
context_value=GraphqlServerTest.mocked_request,
debug=False
)
self.assertEqual(status_code, 200)
se... | 0 |
7fe55559ff49b98f90b912890eb51dc4 | 95049b64bafb0bda103f5e2d449e6c7b | If set to true the user can delete events from the view by clicking the "destroy" button. Deleting is enabled by default. | class GridMessagesCommands extends \Kendo\SerializableObject
public function destroy($value) {
return $this->setProperty('destroy', $value);
} | 1 |
0c5d5f8651e0cb017df2a9ebeefd5ac0 | 611af0b7ef41372a9f985d564c994623 | ステージ詳細ID、章IDに紐づく敵を生成する。
指定した区間の敵データを生成する | {
if(enemyPrefabs.Count <= 0)
{
UnityEngine.Debug.LogError("enemyPrefabsが正しく設定されていません。");
return;
}
if(!createArea)
{
UnityEngine.Debug.LogError("createAreaが正しく設定されていません。");
return;
}
else if(!createArea.isTrigger)
{
UnityEngine.Debug.LogWarning("createAreaのisTriggerがfalseに... | 0 |
8cff22121775ed2986d3611d30d530ee | ddca59d509dd092c2c5d79baf3c0e411 | Helper function that reduces a list of TransactionOutputs to a object of assetSymbol: amount.
This is useful during the calculations as we just need to know much of an asset we need. | class Transaction:
def create_transaction_output(
self,
amount: int,
script_pubkey: Script
) -> dict:
return {
'amount': amount,
'script_pubkey': script_pubkey
} | 0 |
48362143708bc855ba94e65d3e90c27b | 9a088b03db950f9b4b55140ae075ef70 | Returns whether or not the current device configuration is showing multiple panels. | class UxManager extends LuigiClientBase
isSplitView() {
return lifecycleManager.currentContext?.internal?.splitView;
} | 1 |
9257471787fe7c20f9021c91177e0287 | 1ae61e95a2454cce5b33244f5aedc662 | registra los centros de costos de la unidad para el costeo | var id = $('#e_idCentro').val();
var codigo = $('#e_codigo').val();
var descripcion = $('#e_descripcion').val();
var empleados = $('#e_empleadosCentro').val();
var porEmpleado;
var asistenciaPuerta;
var modoTareo;
if ($('#switchPorEmpleado').is(":checked")) {
porEmpleado = 1;
... | 1 |
43431cfa8392a226d4250d8fe5a3a691 | 67dd4e47e58250d8b006bfdbbeba259f | Check for Transaction Error | {
$msg = "";
if ($this->TxnType != "Purchase") {
if ($this->TxnType != "Auth") {
if ($this->TxnType != "GetCurrRate") {
if ($this->TxnType != "Refund") {
if ($this->TxnType != "Complete") {
if ($this-... | 1 |
278d7436a835b941cbc27ac85bcbd9bb | ba9d63669856c1f3d67dd29362c16c04 | Shuffles ArrayList of Card objects | public class Blackjack
public static void ShuffleCards(String[] intArray)
{
List<String> intList = Arrays.asList(intArray);
Collections.shuffle(intList);
intList.toArray(intArray);
} | 0 |
ed0acee3c20e397b88308873b3d6dd66 | fb74ec4b657d5e217a1af21f261b5298 | Rounds a <see cref="decimal"/> value to the specified number of places. | namespace JCE.Utils.Extensions
public static class DecimalExtensions
public static decimal RoundDecimalPoints(this decimal value, int decimalPoints)
{
return Math.Round(value, decimalPoints);
} | 1 |
a3e722a73d341b507d66fa2905915db6 | fecaf6c840b033ab86e6db68a6a6e460 | 根据id批量删除IP段 | return request({
url: global_.BASE_URL + '/api/eip/si/delete/ids',
method: 'post',
data
})
} | 1 |
ecc99b851eb18da85b981e4f44cce6cc | 5a0ee0c6fb2983b26410344e47f45889 | Trim all whitespaces. | namespace AP.MobileToolkit.Fonts.StyleSheets
internal static partial class StringExtensions
public static string TrimWhiteSpace(this string str)
{
if (str == null)
{
return null;
}
char[] whiteSpace = { '\r', '\n', '\f', '\t', '\v' };
... | 1 |
b0a973d9f580ebaaa6764f69b86c126d | b9e41c94f31f78616cb82eaa766bc673 | !
Counts the number of factors a number has. | {
int count = 0;
while ((n % 2 == 0) && (count < MAXFACTORS)) {
factors[count++] = 2;
n /= 2;
}
for (uint64_t i = 3; (i <= sqrt(n)) && (count < MAXFACTORS); i += 2) {
while (n % i == 0) {
factors[count++] = i;
n /= i;
}
}
if (n > 2) {
factors[count++] = ... | 0 |
9c4e50c20095aef4711a1d88331160c1 | 7500e77907e97a99302ec242f98fef14 | 私有, 单例模型,禁止克隆 | class Abs_Model_Db_Thesaurus
private function __clone ( )
{
} | 1 |
1ba31596daa70826f4cd0d3f921b17ac | 0f01128b66672965725f746d152900ec | appends a single character at the end | char* appendChar(char* array, char a) {
size_t len = strlen(array);
char* ret = new char[len + 2];
strcpy(ret, array);
ret[len] = a;
ret[len+1] = '\0';
return ret;
} | 1 |
ff4e526a655c210be288bb416afb4eb1 | c2a0e1f43cb6343ef1b4d9892ea28e47 | Returns the number of characters in a given file | {
FILE *fd;
fd = fdup(file, "r");
char lineBuffer[1024];
int counter = 0;
while(true)
{
if(fgets(lineBuffer, sizeof(lineBuffer), fd) <= (char*) 0)
break;
counter++;
}
rewind(fd);
return counter;
} | 0 |
742ebed76e3b3d9fd29278eac7c7607b | ec41d8c4e31cff3d39cad8215ca07a75 | Verifica se a lista de vértices possui algum vértice que ainda não foi visitado | bool Graph::isConexSolution( ){
bool ingraph[numVertices];
for(int i(0) ; i<numVertices ; i++ ){
ingraph[i] = false;
}
ingraph[0] = true;
risConexSolution(0, ingraph);
for(int i(0) ; i<numVertices ; i++ ){
if( !ingraph[i] ){
std::cout << i << "-esimo vertice nao foi m... | 1 |
1d26db044d9d72642fa35e2c67641316 | beffd593417aa03fa415267ce2686d6d | 高德逆地理位置编码 | HttpServletResponse response) throws Exception {
JSONObject jsonObject = new JSONObject();
DynaBean dynaBean = (DynaBean) form;
String locations = (String) dynaBean.get("locations");
String ret = "0";
String msg = "";
if (StringUtils.isBlank(locations)) {
msg = "参数有误!";
jsonObject.put("ret", ret);
... | 0 |
6469fa1d8b316573997ba976fee511d0 | ff24ddbf629cca06bee61f618fc2c4dd | Shorthand assignment for adding number | namespace Atkin_MoreinPrimeTest
public Monom AddNumber(BigInteger number)
{
Coefficient += number;
return this;
} | 1 |
c0b62a7feb337adfc560b52e058dad56 | 7af5dcd7ebc0759190c00cb68d49168d | Returns statistics describing the search. | public class SearchLogDo
public int getSearchStats()
{
return searchStats;
} | 1 |
e671e3e3ee7325b551378896f94648b8 | 8ee69394c659441371b53ea3e3e2e2f3 | Test that debugserver doesn't disturb the suspend count of a thread
that has been suspended from within a program, when navigating breakpoints
on other threads, or calling functions both on the suspended thread and
on other threads. | self.build()
exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
line = line_number(
"main.cpp",
"// Set break point at this line and setu... | 0 |
38e58d081143be18a6caa8277d483e31 | 3bbc8e6c61b1d99038206e8defcef7fa | Returns a new instance of the providers CommandBuilder class. | namespace RefinId
public class TableCommandBuilder
public DbCommandBuilder GetDbCommandBuilder()
{
DbCommandBuilder dbCommandBuilder = _factory.CreateCommandBuilder();
if (dbCommandBuilder == null)
throw new InvalidOperationException("dbProviderName");
return dbCommandBuilder;
} | 1 |
5085044abf571b4c6c8914c22ba111e2 | a45d7b9ec5750f061ff48fcf0056f6c8 | 检查任务表是否存在,不存在就创建相应的表 | class Common extends Model
public static function checkDatabaseByTableName($table_name){
$tableResult = DB::select("select table_name from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA = 'images_classifier' and TABLE_NAME = '$table_name'");
if(count($tableResult)==0){
DB::select('create table... | 1 |
85fd5e972785a825a4899b3650f6bc8c | 5f2834676c4da02938e389fc5ce5a17c | Returns the list of configuration names that are currently
selected | configs = [(name, config.get_value())
for name, config in _get_all_leaves(_CONF_TREE)
if config.is_configured() and not config.is_used()]
return sorted(configs, key=lambda x: x[0]) | 0 |
48d44e5e8fe53a6e12ea80c51820785a | 43fab1717f42e1e1d437e216da4283ad | Returns a list containing the blocked result files. | class EnviCodeCoverageFilter
public function getBlackList()
{
return array_keys($this->black_list_files);
} | 1 |
6e80d9b31798373c8cb58ad717540521 | 3615fa790cdb992744dee48751d821eb | belirtilen şehire plaka sırasına uygun olacak şekilde komşuluk ekler | public class World
private void initUphill(){
if(!(aco.getUphillAtive())){
return;
}
Random r = new Random();
while(numberOfUphill > 0){
int index = r.nextInt(cities.size());
City temp = cities.get(index);
index = r.nextInt(cities.size());
if(!(temp.getUphilRoutes().contains(index)) && (index != ... | 0 |
14afbb3224e41f0fa15480687556c8b8 | 1348e13b47d4a7fadbedc09418ca8ac4 | Agent leaves no bequests. | def no_bequests(model):
return model.assets[model.T+1] == 0.0 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.