query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
2052a3346d263d0ed36aac3151bc7e0b | 20dffe629e322d867f27e5c2b9e1ff67 | Создает пакет однотипных запросов в виде массива. | namespace VTDev.Libraries.CEXEngine.Crypto.Cipher.Asymmetric.KEX.DTM
public sealed class DtmKex : IDisposable
private MemoryStream CreateRequest(DtmPacketFlags Message, short State, int Sequence = 0)
{
return new DtmPacketStruct(Message, 0, 0, State).ToStream();
} | 0 |
a6597099984d34395b75678bfdd81cd9 | 65a66ee153b23fe26d013bccd0fa18bb | Returns a callable for the hessian of the polynomial approximation of a function (or model data).
Returns | f: Callable[[np.ndarray], np.ndarray], h: float = 1e-4
) -> Callable[[np.ndarray], np.ndarray]:
def df(x: np.ndarray):
assert x.ndim == 1
n = x.shape[0]
g = np.zeros_like(x)
for i in range(n):
h_i = np.zeros_like(x)
h_i[i] = h
g[i] = (f(x + h_i... | 0 |
bc3a14d999e49edeace8bcf5e9e59ad6 | a33cfb7c625f1312cf36958ee82e9e01 | Returns if the current file path is valid. | {
bool checker = false;
if ((FilePath[0].Equals(DOT) && FilePath[1].Equals(SLASH)) ||
(FilePath[0].Equals(DOT) && FilePath[1].Equals(DOT) && FilePath[2].Equals(SLASH) || (FilePath[0].Equals(SLASH))))
{
checker = true;
}
else
{
if ((FilePath.Length == 2) &&... | 1 |
513bb436c30a87cc18154a48a34014fa | 1c45431287d591a30d3e6af7e62e1983 | 容積および重量上限の取得 | DataInfo Capacity = new DataInfo();
Capacity.flag = "pressure";
Capacity.baxMin = iPressWarnLow[iPressUnit];
Capacity.baxMax = iWarnBarPressMax[iPressUnit];
Capacity.baxMove = iWarnBarPressMove[iPressUnit];
Capacity.unitName = sPressUnitSting[iPressUnit];
iPressWarnHigh[iPressUnit] = (iPressWarnHig... | 0 |
ca69d4d8aba75259ca48bcabae095b69 | 455817c9e24944aeb5e7ec10c4ada683 | 刷新代理并返回新的代理 | class DiyRetryMiddleware(RetryMiddleware):
def delete_proxy(self, proxy):
try:
r.delete(proxy)
except BaseException as e:
print('当前代理不存在')
new_proxy = r.randomkey()
return 'https://{}'.format(new_proxy) | 1 |
093b42a1005767b91cbcf46f16d8eb47 | e041512f228e4b0d16774e3db93d4885 | 设置车票查询提示文字 | if self._Text_hint ~= nil then
local str = string.format("温馨提示:本场每押一注将消耗您 %d 游戏币",chipRate)
self._Text_hint:setString(str)
end
end | 0 |
5cad05922f380eb55d13d59bf7f6a6ee | 937b8e8decafdc38166b71a29088b3b7 | 在当前参数的基础上再添加几个键值对请求参数 | class RequestBuilder(
// 请求方法构建器
private val methodBuilder: MethodBuilder,
// 请求行构建器
private val urlBuilder: UrlBuilder,
// 请求头构建器
private val headerBuilder: HeaderBuilder,
// 请求体构建器
private val requestBodyBuilder: RequestBodyBuilder,
// 网络请求器
... | 1 |
db54a0abbbc62e0eae44cb65bce16a92 | d6467173f64a42cbce87e1e843b2b27f | iterate over all columns and get their longest values | namespace SqlEditor.ScriptResults
public static class FormattingHelpers
private static Dictionary<string, int> GetMaxDataLengths(DataTable table, IEnumerable<string> columns, IList<DataRow> dataRows)
{
var dataLengths = table.Columns.Cast<DataColumn>()
.ToDicti... | 1 |
228c31f04c4094cdcf44c3951c26045e | 7b406a8564ecad97c55c9f64377d939e | Вывод сообщения в центре окна консоли | x = win.getmaxyx()[1]
str_x = 1
if align == 'center':
str_x = (x/2)-(len(msg)/2)
elif align == 'right':
str_x = x - len(msg) - 1
str_x = str_x + x_base
win.addstr(y, str_x, msg, attr) | 1 |
b661095f3b4187a8e19574cc3d768e1b | 0b7da035d2f8c6ec1078083d59661170 | Gets the container managed fields. | namespace UL.Aria.Service.Domain.Entity
public class AssetFieldMetadata : IAssetFieldMetadata
public IEnumerable<KeyValuePair<string, AssetField>> GetContainerAssetFieldsForContainer(
AssetTypeEnumDto assetType)
{
return _containerAssetFields[assetType].Where(a => a.Value.IncludeInCo... | 1 |
09c128e086895d7059d224bee7e879df | 5375fa2f392a4fb7e06994eb51005849 | 重新加载hosts文件 | {
$pattern = '/'.preg_quote($this->blockStart, '/').'.*?'.preg_quote($this->blockEnd, '/').'/s';
$domains = $this->getDomains();
$data = trim($domains)."\n".$data;
$data = $this->buildBlock($data);
$newContents = preg_replace($pattern, trim($data), $contents);
$this->... | 1 |
2100b05a85e2816ac97c73af3336a3de | 041a9d11869b20e8773af9841ee5e553 | 设置表单分类 | $cond = array(
'id=' => $id,
'com_id=' => $com_id,
);
$data = array(
'classify_name' => $classify_name,
'dominated' => $dominated,
);
$ret = g('pkg_db') -> update(self::$Table, $cond, $data);
if (!$ret) {
throw new \Exception('更新表单分类失败');
throw $e;
}
return $ret;
} | 1 |
a43ae45316dd2bcdac6fb2918a3397ba | cdb1441ca6d916ca28b4905e7570242c | Tries to get hold of the workspace that holds the monitor data inside the
input workspace.
pointer. | try:
ws_index = mon_ws.getIndexFromSpectrumNumber(spectraID)
return mon_ws
except:
ws_index = data_ws.getIndexFromSpectrumNumber(spectraID)
x_param = mon_ws.readX(0)
bins = [x_param[0],x_param[1] - x_param[0],x_param[-1]]
ExtractSingleSpectrum(InputWor... | 1 |
b72fb9bb53b7753ffeed934ed8363e79 | f4d8c030d7a32adbf03939a55fb84fee | 每天统计每个来源发送的短信成功量、失败量、总量和消费总额 | public List<SendResultVo> selectCampaignSMSDailyStat(Map<String, Object> map) {
return selectList("SmsRptSendResult.selectCampaignSMSDailyStat", map);
} | 1 |
1b3053eee7d5362b369438f5b9cac215 | 88b6dbaf45acedabfa4fcb676c4eac1c | Inserts a revenge killer data into table revengedata. | int insertSuccessKill(SuccessKill successKill); | 0 |
572bbeeb89e7d01e3d1b74253d015b3d | a59375ea978a49be2656799d72e74b0c | Filter which plans are shown to a user on the registration form. | {
var now = DateTime.Now;
return source.Where(j => j.Plan.WhenPublished.HasValue && j.Plan.EnrollExpirationDate > now);
} | 1 |
7f7b9e834463fb12a25fdbb555bcdea7 | 05e1a8b7a4c722078019d467f65952c3 | !
\brief Иницилизирует ядро генератора случайных чисел данными из эфира | void curand_init()
{
CURAND_CALL(curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT));
CURAND_CALL(curandSetPseudoRandomGeneratorSeed(gen,1234ULL));
} | 0 |
d8869384df4c7858c38e39d0e4cc9921 | 17af0dccb2d006eb24db41e55cb29f8b | Replace the placeholders created by wsh_extract_exclusions() with the original content. | o_str = re.sub(r"(?<=boundary=)[0-9a-fA-F]+", "[BOUNDARY]", o_str)
o_str = re.sub(r"--[0-9a-f]{32}", "[BOUNDARY]", o_str)
o_str = re.sub(r"(?<=<entryId>)\d+", "[ENTRY-ID]", o_str)
o_str = re.sub(r"(?<=Content-Type:).*", "[CONTENT-TYPE]", o_str)
o_str = re.sub(r"(?<=test_fragment_volatile_)[0-9a-fA-F... | 0 |
1af6e51ea7f0de49416db124643f50a6 | 17c9e993ce92b918d83953ba657ed9a5 | Iterates over all tags present at a given address. | class address(object):
def iterate(cls, end):
return cls.iterate(ui.current.address(), end) | 0 |
9bd073b870dd31714c317bfb3df1825d | ca238a3147fb48b2774be39690d2f9eb | Make folder for normalized files | try:
os.mkdir(self.folder)
logger.info("Created folder: ", self.folder)
except FileExistsError:
logger.info("Already exists: ", self.folder) | 1 |
c3f083e20b7c7dce3ee235d4a89db060 | 81b3d866b5abbc1e6f3b6946e3af0977 | Funcion para dar formato a la fecha antes de guardarlo en la base de datos | function insercion_fecha($fecha){
$datos = array();
$datos = explode("/",$fecha);
return $datos[2].'-'.$datos[1].'-'.$datos[0];
} | 1 |
18598e6e1560b5f70e35d12016ac26be | cfcc275ea6be7aa2d4ae7e7920cd187a | 根据用户名来获取总订单数 | @RequestMapping(value = "getTotalorder", method = RequestMethod.GET)
public JSONObject getTotalorder(String name){
return orderService.getTotalorder(name);
} | 1 |
93732804928a0513e442efb14f893abd | cca1bb9dd9cd980529866a22c185615b | Returns true if the last rolled skillcheck
for the given skill passed. | int skill_check(struct char_data *ch, int skill, int dc) {
int result = skill_roll(ch, skill);
if (result == dc)
return 1;
else if (result < dc)
return 0;
else
return (result - dc);
} | 1 |
7b0468dd476c25d217cda41525d87a06 | 1b0f4a30a4aab680928f65d2b6bf5583 | 得到服务员ID. | public class RefundResultPO implements java.io.Serializable
public Integer getStaffId() {
return this.staffId;
} | 1 |
e743c9068dbc8f56d5d8a8e71e292b52 | f5e6cee93c3c536759cbde07c40d5bef | 将用户学校的id存入数据库 | class ActivityAction extends CommonAction{
public function school(){
$User=D("User");
$result=$User->getByUserid(Session::get('userid'));
$data=array('schoolid'=>$result['schoolid']);
$this->putBelow($data);
} | 0 |
7a6b29f39670432ea1bb3fd80fe71852 | d3a290519b1d607b79877546bbea8e50 | Throws an <see cref="ArgumentNullException"/> if the given object is null. | namespace Mjcheetham
public static class ArgumentAssert
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void NotNull<T>(T obj, string name) where T : class
{
if (obj == null)
{
throw new ArgumentNullException(name);
}
} | 1 |
c853339af9eb15d38ac5a9bafd6bc813 | 0b8f93787bcdf60de3629a173d67077f | Gets the PuzzleElement associated with this view | public class MainActivity extends AbstractMainActivity implements Puzzle.OnPuzzleListener
@Override
protected View getGameView()
{
return findViewById(R.id.gameview);
} | 0 |
585518497bdc94a86a6190365fa0f070 | 00bb80c7507b636278c77caf883f022e | 添加尺寸单位 | function addSizeGroup(e,d){
var opt = {
cgi : config.cgi.addsgroup,
data : d
}
var success = function(data){
if(data.err==0){
var list = Cache.get('sizegroup');
var obj = convertSizeOne(data.result.data);
list[obj.id] = obj;
handerObj.triggerHandler('cache:set',{key: 'sizegroup' ,data: li... | 1 |
271911812a8bb5f02564422c3bf77ea9 | 4c960a1c3ef96494f3aa94e68209b675 | Remove currently displayed graph if necessary, and display given graph in main panel. | public class RunnerGUI extends javax.swing.JFrame
public void updateServiceGraphGUI(GraphGUI gg) {
JScrollPane scrollPane = servicePanels.get(gg.serviceName);
scrollPane.setViewportView(gg.currentGrappaPanel);
scrollPane.updateUI();
} | 0 |
b1398ceadd155383a17ee294d47f2767 | d71843d348707b9e3567559ac4a88275 | 根据temp文件获取list数据,同时把日期时间格式合并 | public class ReadLocalFile
private void parseTemp(String temp){
try {
JSONObject jsonObject=new JSONObject(temp);
JSONArray array=jsonObject.getJSONArray("data");
for(int i=0;i<array.length();i++){
JSONObject item=array.getJSONObject(i);
TemperatureEntity entity=new TemperatureEntity();
entity.se... | 0 |
8a4fb258b3dd60e5025209915a526a34 | 93bce163a6f451cae4bdf77bc4e87627 | Push item to last index in list. If you many arguments, last arguments will be the last item. | class Lists extends Redis implements \Iterator
public function setEnd(string ...$value)
{
return $this->_redis->rpush($this->_key, $value);
} | 1 |
c0445f81931fd883821ae662b7c2a6c7 | 32d22955c4f8bb0897fd6ce8dd4af5cd | 读者个人资料 | class UserAction extends AdminBaseAction
public function personal () {
$StaffBase = D('StaffBase');
$personage_detail = $StaffBase->seek_personage_info($this->oUser->base_id);
$html['personage'] = $personage_detail;
$html['personage']['account'] = $this->oUser->account;
$this->assign('html',$html);
$th... | 1 |
6203ca781526b0ef4a4a524b45db8bbc | 4d2f786805b5b04c882dd1cf6458b5dd | Write one variable from the variable map | {
BOOL ok = ( fputs( s, fvarout ) != EOF );
if ( !ok ) {
message( FATAL_WRITE_VAR, inpf );
errstr( "Error writing var" );
}
return ( ok );
} | 1 |
3ddbfa229bb20eb2e4511666ad241696 | cdef56fea50142ac924a005efb660be3 | 获得SD卡容量总大小 | if (null != SDCardPath() && SDCardPath().equals("")) {
StatFs statfs = new StatFs(SDCardPath());
long totalBlocks = statfs.getBlockCount();
long blockSize = statfs.getBlockSize();
long SDtotalSize = totalBlocks * blockSize / 1024 / 1024;
return SDtotalSize;
} else {
return 0;
}
} | 1 |
9495e81550a10c719f78d9ccff5ae045 | f07f993850dec15807ddd275b97891e1 | <#if lang="ja">
BoundWordSetを作成する
</#if> | class TranslationTemplateClientTest extends PHPUnit_Framework_TestCase
public function testAddBoundWordSet1() {
$result = $this->createBoundWordSet();
$this->assertEquals($result['status'], 'OK');
} | 1 |
47d6e371da2ccaf28cd5eb3777b576d0 | 94352427bb22b6c485cb674b8032a433 | API v1 method for returning the 3-char currency codes associated with a given 2 char territory code. | @Injectable()
class PackagesControllerService extends BaseService
getCurrencyCodesUsingGET(): Observable<CurrenciesResponse> {
return this.getCurrencyCodesUsingGETResponse().pipe(
map(_r => _r.body)
);
} | 0 |
ea2bc55b1dda99fb16bb9ac188a1899f | 205c651bd40d627910fde8a886f2f0e5 | Returns score for Full House score | public class ScoreCard extends Player{
public void setFullHouseScore() {
this.fullHouseScore = 25;
this.setScore(fullHouseScore);
this.fullHouseUsed = true;
} | 0 |
972d38270ae9b28761c6e6c4efec9f91 | e37252df7314df310625decdd096681f | Funktion 14 - Visa Företagsförsäkring och dess Försäkringstagare | {
using (var db = new DataModelContainer())
{
List<sökförsäkringföretag> res = (from x in db.FörsäkringFöretagSet
where (x.Företagsansökan.FörsäkringstagareFöretag.orgNr == orgNr) || (x.Företagsansökan.FörsäkringstagareFör... | 1 |
d36f25ab6b4c0b10228222d83e42eafa | e4e4699facf9705b1f25acc7e388e70a | Runs all three menu functions to display the menu based on each desired condition | {
if (optionsMenu.activeSelf == true)
{
TurnOnMenu(menuButtons);
TurnOffUIElements(optionsMenu, menuObject);
}
if (playerSelection.activeSelf == true && trackSelection.activeSelf == false)
{
TurnOnMenu(menuButtons);
TurnOffUIEle... | 1 |
7da432246e38d3a83bdd83a23b450730 | 14b365ad0eb838214936b69736220cd5 | soultion ========================================================== | def longest_common_prefix2(strs):
if not strs or not strs[0]:
return ''
def lcp(l):
for i in range(l):
for s in strs[1:]:
if len(s) < i + 1 or s[i] != strs[0][i]:
return False
return True
min_l = min([len(s) for s in strs])
l, r = 0... | 1 |
8deab44b590d16e1b48e3eb08753cdc4 | a5a18224c3c3d93979a7e5fb93bd4d35 | 递归解n阶行列式函数, 行列式用一维数组存放 | double calcDet(double a[][N], int n)
{
double ans = 0;
double temp[N][N]={{0.0}};
double t;
int i,j,k;
if (n == 1) {
return a[0][0];
}
for (i = 0; i < n; i++) {
for(j = 0; j < n-1; j++) {
for(k = 0; k < n-1; k++) {
temp[j][k] = a[j+1][(k>=i)?k+1:k];
}
}
t = calc... | 0 |
ddadfc86b3fec0e172c37cc0991027b9 | d70d484489d53b0745ba11ffc693f761 | Generates indices which will be used to distrbute chunks of data across
multiprocessing pool.
Returns chunked indices. | def _get_indices_from_lengths(lengths: Tensor, num_items: int) -> Tensor:
length_list = lengths.detach().cpu().numpy().tolist()
chunks = [(i * num_items, i * num_items + length) for i, length in enumerate(length_list)]
indices = torch.cat([torch.arange(x, y) for x, y in chunks], dim=0).cuda()
return ind... | 1 |
8eb695b3c8e697088424567a36e286bc | a06b0d337394299dcdca2c6b0249bc15 | метод в котором работает поток сохраняющий тики | public void run() {
preDate = new Date();
while (true) {
if (!run) {
try {
sleep(500);
} catch (InterruptedException ex) {
Logger.getLogger(TimeThread.class.getName()).log(Level.SEVERE, null, ex);
}
... | 1 |
29c63fd08175cb48364fcbae007ac808 | 002c0010ea24c22bb52d96864cfdf30e | 零壹财经 标的数据推送 | $result=array();
foreach($coin as $k=>$val){
if($mark=="zb"){
if($val=="bch_usdt"){
$val="bcc_usdt";
}
if($val=="bch_btc"){
$val="bcc_btc";
}
$zb=new \Home\Controller\ZbController();
$result[]=$zb->hangqing($val);
}
... | 0 |
24343744b1e6eb094cc049a4c60fc866 | 8f1a2cda903f29c5f5ad242658ad5bb7 | Query para obtener la descripción de las tablas del esquema. | {
return sprintf(
'DESCRIBE TABLE %s',
($database ? $this->quoteSingleIdentifier($database) . '.' : '') . $this->quoteSingleIdentifier($table)
);
} | 1 |
858ab7e23b209f72f9ceeb9a97f7f4a6 | ba6dce314d4b365da6ae53c6ff98b01a | 設定螢幕不隨手機旋轉 | {
Screen.autorotateToPortrait = true;
Screen.autorotateToPortraitUpsideDown = true;
Screen.autorotateToLandscapeLeft = false;
Screen.autorotateToLandscapeRight = false;
} | 1 |
0a6a2ada0d713daa786dae7360a5b253 | 76634770320372ab3120202031339567 | Returns the full name of the .NET Framework root registry key | class WinRegistryFile(object):
def GetRootKey(self): | 0 |
5ddfd8345482b5fd18a3b0cf332a5554 | 58d30bbe09f6e3d140047382f9f31087 | Send "quit" and return the response. | class Secret_Server extends Security
public function SS_Quit() {
return trim( $this->__sendServerSocket( "quit\n" ) );
} | 1 |
7456603bd2a9ae6a2570a76c8a6f867e | fb99ca1ac1a4f91c3bb58434b3d0f739 | Tests non-exceptional conditions for the two argument constructor. | public void testConstructor() {
new Container<Object>();
new Container<Object>(new Object());
new Container<Object>((Object) null);
new Container<Object>(new Object[] { null, null });
new Container<Object>(new Object[] { null, new Object() });
new Container<Object>(new Object[] { new Object(), null });
n... | 1 |
0a473fa238af19f610eaaf5ea2440134 | 13feb4b164e505a3bf3d4cb1bffdc16d | Save a ReadMe if changes are detected. | func saveReadme(project *model.CGProject, opt SaveOptions) {
if project.WithReadme && len(project.ReadmeChildPaths) > 0 {
infoLogger.Println("Saving Readme ...")
content := ""
for _, path := range project.ReadmeChildPaths {
if util.FileExists(path) {
childContent, err := ioutil.ReadFile(path)
if err !... | 0 |
3c0ca48ab731eb1803edb5de91938ee3 | cfb756fd6ac76caef08509ef34064e15 | Get elapsed time after session started and before session closed, in ms.
elapsed time | class CATSSession
public function getExecutionTime()
{
$this->_endTime = microtime();
if (!isset($this->_startTime) || empty($this->_startTime))
{
$this->_startTime = $this->_endTime;
}
list($a_dec, $a_sec) = explode(' ', $this->_startTime);
list($b_dec, $... | 0 |
d029d3a16f53df9b2c39d95de51cd5d3 | 589ff0b02855876ee56ed9bfada9a49d | Goes the the previous song in the current playlist. | server = ctx.message.server
if self.is_playing(server):
curr_url = self._get_queue_nowplaying(server).webpage_url
last_url = None
if self._is_queue_playlist(server):
try:
last_url = self.queue[server.id]["QUEUE"].pop()
... | 1 |
63dae79172b02b82803558fa7fb08035 | 9372a4fe383360bb0d83346bbbc160b1 | Updates the form using the query. No attempt is made to rearrange the
query to fit into the form. We consider the form to consist of ANDed
fields. Even if the query is something like "NOT(A OR B)" (equivalent to
(NOT A AND NOT B), which would be possible to map into the fiels), this
is not done.
<p>
This is because we ... | try {
this.submitForm ( form, null );
} catch ( XPathExpressionException e ) {
} catch ( AmbiguityException e ) {
}
return this;
} | 0 |
3ef087911cc51fd70e7516577660bb52 | 29e34c71256a2979ccf5884384819238 | Parse the IKEv2 header and payload list | hdr = { 'nlri_list': [],
'withdrawn_list': []}
(withdrawn_len,) = unpack('>H', fd.read(2))
withdrawn_data = fd.read(withdrawn_len)
(attr_len,) = unpack('>H', fd.read(2))
attr_data = fd.read(attr_len)
hdr['nlri_len'] = (len - 4) - (withdrawn_len + attr_len)
if (hdr['nlri_len'] > 0... | 0 |
8bdcf198c56df704cb72042a681eafc9 | 0432d8e868567eec75b060dd59f49e26 | Error Case which raises exception due to negative bet entry | public class BettingActivityTests
@Test (expected = MinimumBalanceException.class)
public void lostBetWithZeroBalanceThrowsException ()
{
int amount = 10;
int bet = 25;
int actualNum = 30;
better.betOnANumber(amount, actualNum, 35, bet);
} | 0 |
c57cd3ad3bf1ec2ea5af562bf69fb203 | 5854efeaf099d953d9aa6ae062b5ef4d | 制作フローデータの追加 | append_hais = [self.remove(hai) for hai in hais]
append_hais.insert(int((direct - 1) * 1.5), target)
self.furos.append(Furo(append_hais, FuroKind.MINKAN, direct)) | 1 |
049359a73af451df01852705de484ced | 8883af366823e8fc6b2917b3f4d44fd4 | 下载一个大文件 -- 分段下载文件 | defer wg.Done()
defer file.Close()
packageSize := contentLength / threads
var count int64
for i := 0; i < int(threads); i++ {
var start int64
var end int64
start = int64(int64(i) * packageSize)
end = start + packageSize
if i+1 == int(threads) {
end = contentLength
}
if req, err := http.NewRequest(... | 1 |
c269e901ead255ba61d57f6469ddbefb | bf82582c2bcfc14e40229840ffe23848 | 24小时同步 | class MyRunnable implements Runnable {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Override
public void run() {
while (true) {
try {
String time = df.format(new Date());
List<Label> list = Label.dao
.find("select * from label where TIMESTAMPDIFF(hour,last... | 0 |
55ef32365778f79ad363d083c1b56b77 | 9782a811d2da42f6b930aaed20d2dfd3 | @brief
Timer IRQ handler. Add the corresponding callback and argument in the queue
so that it can be safely processed. | bool callBackTask(void)
{
uint32_t oldFlags = LEON_CPUDisableIRQ();
if (callbackList.active.front != NULL_INDEX)
{
CallbackIndexT index = callbackList.active.front;
CallbackNodeT node = callbackArray[index];
CALLBACK_RemoveCallbackFromQueue(CLT_ACTIVE, index);
if (callbackArr... | 0 |
231a309ce91c010b955772941d805401 | 98d3e04c3fbfa0b929c6f2386a3d93c8 | 직무콤보 | class mainView(QWidget):
def job_choice(self):
self.gameWindow.setAlignment(Qt.AlignCenter)
self.gameWindow.setText("직업을 선택하십시오")
self.button_text("전사","법사","궁수") | 0 |
a5d595f4322f6b917e3013415d48f99a | daeffd8098b54de9e042551cc9e2ab86 | 查询财务应收款记录列表 | @Slf4j
public class CrmReceivablesService
public List<Record> queryList(CrmReceivables receivables) {
String sq = "select * from 72crm_crm_receivables where 1 = 1 ";
StringBuilder sql = new StringBuilder(sq);
if (receivables.getCustomerId() != null) {
sql.append(" and customer_id = "... | 1 |
e2b07f4e1afdb1ec2dc284d8f819236a | 7dc87d97cea49f3b302438c7d044e4e6 | 提取度量的CRD文件的生成 | def dump2crd(file_in,file_out):
f=open(file_in,'r')
while f.readline().count('TIMESTEP')==0:
pass
ln=[i.strip() for i in f.readlines()]
l=[i.split() for i in ln]
f.close()
ntypes=max(int(i[1]) for i in l[8:])
dat = 'LAMMPS Description. time=0 \n \n'
dat += '%11s atoms \n' %ln[2... | 1 |
1920b5a686a36d50b6376c774be3eb75 | 99a45a36b64dc7d7f7c31ca1671eeb9e | Load a journal file from disk, or create a new blank journal if none exists | try:
with open(self.__file, 'rt') as file:
file = csv.reader(file)
for journal in file:
self.__journals.append(journal[0])
except FileNotFoundError:
raise | 0 |
d37458140ef107060c42fd93abf1c18c | cf4e6a089f9f7b8d7ccf5f91e49e4fbf | used for updating the camera after all player movement has finished | public class CameraController : MonoBehaviour
void LateUpdate()
{
cameraRoot.transform.position = playerReference.transform.position;
} | 1 |
55706cf3cb65bcb7571a3ea76e993b47 | b4b4ccfb18e0c83cc15d6c386a91c2fd | Reverses a string in place. | char popped;
char *_input = input;
char *end_of_input = _input + strlen(input) - 1;
while (end_of_input > _input) {
popped = *end_of_input;
*end_of_input-- = *_input;
*_input++ = popped;
}
return 0;
} | 1 |
dc1f948fffa1f534c7c28093e46e65c8 | 551883f1c59bfed42790c9f90ba5bb33 | SEGGER_RTT_GetBytesInBuffer()
Function description
Returns the number of bytes currently used in the up buffer.
Parameters
BufferIndex Index of the up buffer.
Return value
Number of bytes that are used in the buffer. | BYTE USBCDC_bytesInUSBBuffer (BYTE intfNum)
{
BYTE bTmp1 = 0;
WORD state;
BYTE edbIndex;
edbIndex = stUsbHandle[intfNum].edb_Index;
state = usbDisableOutEndpointInterrupt(edbIndex);
if ((bFunctionSuspended) ||
(bEnumerationStatus != ENUMERATION_COMPLETE)){
usbRestoreOutEndpointInter... | 0 |
8161b81a69eb214e6b013e65e107c369 | 74a30e4f0ce4eaf29f7a305aa7c89464 | Returns the value of the '<em><b>Integrity</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Integrity</em>' attribute isn't clear, there really should be more of a description here...
</p>
<!-- end-user-doc --> | public class StaticMessageChannelSecurity extends AbstractMessageChannelSecurity
public boolean isIntegrityActive() {
return integrityActive;
} | 1 |
c262e7677be9e6bff19544fe18ac809e | 99a0974251cb728a5e7b7ddb90c290a7 | Checks if this type information represents a Tuple type. Tuple types are subclasses of the
Java API tuples. | {
var type = value?.GetUnboxedType();
return type != null && IsTupleType(type, ofOptions, isOptions);
} | 1 |
223561a0baafa2219a3f8d6a29bc2b6f | 74a00caca877435ae0ce2e3d95bb7ee7 | Convert coorditates from physical screen resolution to virtual resolution | namespace Sgry.Azuki
void VirtualToScreen( ref Point pt ); | 0 |
6ddb53f3f739f93c324c519318809d7a | 6e8db3c44427744d4a9550b15b53b571 | переключение активных блоов в меню | for(let elem of this.blocks) {
let block = document.querySelector(`.type__navigation-menu${elem.name}`);
elem.isActive ? block.classList.add('type__navigation-menu_active') : undefined;
}
} | 1 |
53971be305c018240d94399e19fbd838 | 28c4379eb7886e34779dbeed1d797d72 | Updates the contents of the context combo box, as well as its selection. | public class DeviceSearchResultPage extends AbstractTextSearchViewPage
implements ISearchResultPage
protected void fillContextMenu(IMenuManager mgr) {
super.fillContextMenu(mgr);
actionGroup.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
actionGroup.fillC... | 0 |
9535e5415b345059fdc0ed3216172af5 | a9b61439f290e954545ebe660df3aae3 | Adds or updates an inline policy document that is embedded in the specified IAM user.
An IAM user can also have a managed policy attached to it. To attach a managed policy to a user, use AttachUserPolicy . To create a new managed policy, use CreatePolicy . For information about policies, see Managed Policies and Inli... | class DlcClient(AbstractClient):
def AttachUserPolicy(self, request):
try:
params = request._serialize()
body = self.call("AttachUserPolicy", params)
response = json.loads(body)
if "Error" not in response["Response"]:
model = models.AttachUserPolic... | 1 |
3e4a788ac6ac8e0e514f65312ec3bb74 | 314f608d5e5b431aa8768d9be0da5316 | Collects handlers from subclasses. | class Topology(issue.ReporterMixin):
def _init_handlers(module_):
handlers = {}
for attribute_name in dir(module_):
if attribute_name.startswith('_'):
continue
attribute = getattr(module_, attribute_name)
if isinstance(attribute, type) and issubclass(a... | 1 |
aee6ee0ac3799fbbc33dec785e70ee41 | 6ab99100a3a43b24c8ffc81874fa0268 | recursive solution that takes an nth term and returns its fibonacci value | if n == 0:
return 0
if n == 1:
return 1
else:
return nth_fibonacci(n-2) + nth_fibonacci(n-1) | 1 |
34037ec14a490e15cf6a96eeea0fd98e | 9ba527523a7581ff759f0b6f54d75e7b | sap xep ds theo chieu tang dan cua ten | def sapXep(a):
for i in range(0,len(a) - 1):
min = i
for j in range(i,len(a)):
if (a[j][1] < a[min][1]):
min = j
temp = a[min][1]
temp_name = a[min][0]
a[min][1] = a[i][1]
a[min][0] = a[i][0]
a[i][1] = temp
a[i][0] = temp_na... | 0 |
1e919239bfb388270e2e84fd4db22779 | e52ff82f687555ad22207e1f884b76f4 | Dessin des vies du pacman | void systeme_vie(){
champi = SDL_LoadBMP("././img/champi.bmp");
if(champi == NULL){printf("not found\n");}
SDL_SetColorKey(champi, SDL_SRCCOLORKEY, SDL_MapRGB(champi->format, 255, 255, 255));
pos_champi.y= 0;
for (int i = 0; i <= vie-1; i++){
pos_champi.x = i*55;
SDL_BlitSurface (ch... | 1 |
f5ea9f12b5f124e6dcfe33c2ed644cce | ecb56699fe1b12e5e63bff0f3e7b01ed | cambia aleatoriamente el mercado de la ermpresa | function marcoAleatorio($fila){
if ($fila > 3){
$sw = 0;
} else {
$sw = mt_rand(0,1);
}
return $sw;
} | 0 |
ebdbf65c56bb126ca341f7d6cf8e2d2b | ebb713d08af12c62259bd761002c0beb | 重置 订单编号
设置为 "" | public class OrderStatePresenter
public void resetOrder(final String uid, final String oId) {
iOrderStateFramentModel.resetOrder(uid, oId, new StringCallback() {
@Override
public void onError(Call call, Exception e, int id) {
LLog.eNetError(TAG, e.toString());
... | 0 |
55c67b0a93036e7947091b0c82f8d5d8 | 4d1af07f366c3d3ac0b9e29d5691ef52 | Calculates probability of AND nodes. | double FaultTree::RePbSCalculation(int node_i){
if(tree_nodes[node_i]->node_type != 0) return 0;
double Pbs = PbSCalculation(node_i);
return Pbs * tree_nodes[node_i]->GetPossibility() / GetTopProb();
} | 0 |
8f37deda1dbe42104564f82880f3c099 | d20133bdf0b0319fda757575e71c9ae9 | This function can be used to send XDomain control channel messages to
the other domain. The function waits until the response is received
or when timeout triggers. Whichever comes first. | dp_ctrl_send_msg(struct dp_loop *dp_loop, size_t conn_id, of_xid_t xid, struct ofl_msg_header *msg) {
ctrl_send_msg(dp_loop->ctrl, conn_id, xid, msg);
} | 0 |
df85771275fff8a32011b128aac3aedf | f186eece9cadcd2698a043277f3fad9b | 大小格式化输出 | public class P1002a
static void printF(){
int n = 123;
double d = -1234.6749;
String s = "test line";
System.out.println("123456789012345678901234567890");
System.out.printf("%5d %10.2f %10s", n, d, s);
System.out.println();
System.out.printf("%5d %10.2f %10s", -12, 10.5, "Java: ");
Sy... | 1 |
a9a30a52ae9dcabb1879bfda59131235 | ec713a27b7d05b21b1f499b15d75d0ac | 更新本地公司列表 | class GetAllCompanyCron extends CronBase
public function updateCompanyData() {
$localCount = StockCompanyModel::getCompanyCount();
$companyCount = $this->_getRemoteCompanyCount();
if ($companyCount <= 0 || $companyCount <= $localCount[0]['total']) {
if (rand(0, 4) < 4) {
... | 1 |
b9b09e88667481ecbc8fc961190e766b | 2796ec15170d21978be6dee96784a0ab | @brief GLB power off wifi audio cpu PLL | {
GLB_PLL_REF_CLK_Type refClk;
if (xtalType == GLB_XTAL_RC32M) {
refClk = GLB_PLL_REFCLK_RC32M;
} else {
refClk = GLB_PLL_REFCLK_XTAL;
}
GLB_Power_Off_WAC_PLL(GLB_WAC_PLL_WIFIPLL);
GLB_WAC_PLL_Ref_Clk_Sel(GLB_WAC_PLL_WIFIPLL, refClk);
GLB_Power_On_WAC_PLL(GLB_WAC_PLL_WIFIPLL,... | 1 |
5145189f920a214d0636f2c2c25b866b | 602b13eef4ab726c4621080e8df9334a | Constructs list of pixel indices spanned by nucleus. | self, size: Iterable[int], overlap: Iterable[int] = (0, 0)
) -> Tuple[slice, slice]:
n = np.round(self.size / size).astype(int)
with np.errstate(divide="ignore"):
xi = np.floor(np.arange(self.size[0]) / np.ceil(self.size[0] / n[0]))
yi = np.floor(np.arange(self.size[1... | 0 |
3bd2aa75021e34f5f507274b27f80c00 | d64d0b41e1312a120cc65b204c37c8f7 | Запрос получения списка комментариев конкретной картинки | {
List<string> requestUrlParameters = new List<string>();
if (requestParameters.ObjectId != null) requestUrlParameters.Add("object_id=" + requestParameters.ObjectId);
if (requestParameters.ObjectType != CommentObjectType.Empty) requestUrlParameters.Add("order=" + RequestValue... | 1 |
99a9ad3c36c3cd8309d4e9882102e7ce | c2262f068fb5709f00850526e791bf12 | Metodo que sirve para buscar cursos optimos por su titulo o por filtracion de coste, tiempo o reputacion | namespace Control
public class ControlCursosCurricular
public List<Object> FiltrarDescripcionModalidad(string descripcion, string modalidad)
{
List<ActividadCurricular> CursosCurriculares = datosCurso.BuscarDescripcionModalidadEstudio(descripcion,modalidad);
if (CursosCurriculares ==... | 0 |
300d191aaebfdbd96f974471ea25870d | 816c8d7f41db10f1be586cefd04c3e59 | 分页查询未激活卡列表 | {
try
{
return iDCardService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
... | 1 |
7630508ec1876eea5054d99003f0ea41 | 640064eb5b0d9fc70e89f31cca06cdee | 해시 테이블에서 이벤트 처리기를 삭제한다. | @Repository
public class EvtRepository extends AbstractRepository
public int deleteEvt(Evt evt) {
return getSession1().delete("com.plgrim.ncp.base.deleteEvt", evt);
} | 0 |
1f6a0d48041d85869539ad8157bee0b5 | e18fe59312147b95156d5d185ab8f4e1 | Function to restart the level when the player touches a trap. | class Trap(pygame.sprite.Sprite):
def catch(self):
self.caught = fps // 10
self.image = traps[1] | 0 |
54bacde27bee55921b067fb1e7c57fea | 3bc262e44a076bfb184582cc8a8739a3 | 用户的主题 | function xintheme_level() {
$user_id=get_post(get_the_ID())->post_author;
if(user_can($user_id,'install_plugins')){echo'<span>站长</span>';}
elseif(user_can($user_id,'edit_others_posts')){echo'<span>编辑</span>';}elseif(user_can($user_id,'publish_posts')){echo'<span>作者</span>';}elseif(user_can($user_id,'delete_posts... | 0 |
e6b4ed264096290b7997117517b3970c | 05598487d3dbc820b0bdaaf1d30883c1 | 得到目前登录教师已经发布时间的实验 | $sql = "SELECT DISTINCT paper_id,name,startTime,endTime,category_id
FROM examination e,class_student c ,examination_class ec,examed
WHERE (UNIX_TIMESTAMP(e.endTime) < UNIX_TIMESTAMP(NOW()) OR (examed.examination_id=e.id
AND examed.student_id='".$student_id."'))
AND e.id=ec.examination_id
AND ec.c... | 0 |
a877a6c58ee27c8d5e8ac564eb04c736 | fdf9bcd69da178aa6cdeb83530a0c9a5 | Call when user click to rate application
in google play. | public class AboutActivity extends Activity
public void rate(View view) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(MARKET_LISTING));
startActivity(intent);
} | 1 |
71d243c5875a536602bf902646547863 | ca1e9559acf57b9ab0b5ba068de1fd14 | 获取方法的字节码 | namespace Platform.Reflection
public static class MethodInfoExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static byte[] GetILBytes(this MethodInfo methodInfo) => methodInfo.GetMethodBody().GetILAsByteArray(); | 1 |
2bc49850915fb35a93b0ea28e2b3fe1d | daf97ed56077a8a00939b66867d1a1ce | Saves the dashboard indicator data custom. | {
global $current_user;
$dashletDefs = $current_user->getPreference('dashlets', 'Home');
$dashletDefs[$this->id]['options'] = $optionsArray;
$current_user->setPreference('dashlets', $dashletDefs, 0, 'Home');
} | 1 |
fa99b9ad8e0e095d75259e56cd6f75b1 | d5813ca43689aa194ec2b995cdc16b1f | 按key大小排序的迭代函数 | function bcAM_pairsByKeys(t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0
local iter = function ()
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end | 1 |
73d812fdf125d5541cdd77d6e2937d89 | aec1961adb216daf6aeb282179e11489 | Translate java format to moment.js format | const result = [];
for (const key in json) {
let value = json[key];
if (this.isDate(value)) {
value = moment(value).format("YYYY-MM-DD HH:mm:ss");
}
result.push(value);
}
return result;
} | 0 |
cefc0e9b8d40ec742c23a4402fdc9e3d | 7558adb806135ef9dc8014e0792a9a6f | Set a string for the broker initialization in command line argument format. | void setFromStrings(@NotNull String[] args); | 1 |
ad0108f4a5c593e3e50497666dc58bac | e3cc8c544f577971338ab7ff1c9da995 | Get the type of agent from the agent string | def agent_for_worker(worker_name):
if worker_name.startswith("C_"):
index = worker_name.index("_", 3)
return worker_name[0:index]
else:
index = worker_name.index("_")
return worker_name[0:index] | 1 |
28b650e821bef17adcd585fb4155e906 | 188b26287654ad95045c37a459de5328 | Create a new Query with standard JDBC properties.
<p>
ResultSetType and ResultSetConcureny are JDBC standard parameters like
ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.TYPE_FORWARD_ONLY,
ResultSet.CONCUR_READ_ONLY, ResultSet.CONCUR_UPDATABLE, ...
</p> | boolean nullable) throws SQLException {
return new JdbcResultSet(true, null,
conn.createStatement0(),
Collections.<String>emptyList(),
Collections.<String>emptyList(),
Collections.<String>emptyList(),
Collections.<List<?>>emptyList(),
... | 0 |
95d174dbfa9365b22c248c3c5868b547 | 516bd9851e80fe66d0fa982c9e022616 | 获取未分配给指定角色的功能权限 | namespace BL
public class RoleManager: BaseManager
public List<Permission> GetUnassignedPermission(Role role)
{
RolePermissionMapper rolePermissionMapper = new RolePermissionMapper();
return rolePermissionMapper.GetUnassignedPermission(role);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.