query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7170167f920174a2a8dad2621e0f9baf | e088fea66c4ba0c794080878f847ee67 | Convert AORSEARCH result to pandas frame | if results['columnHeaders']:
column_headers = results['columnHeaders']
headings = []
for header in column_headers:
name = header['name'].replace('ga:', '')
headings.append(name)
if results['rows']:
rows = results['rows']
df = pd.DataFra... | 1 |
e8885eef77558547cd6c919f5a147ace | 3383d3910432310c140b5f36d2fecd8d | Verifies connectivity to the broker instance and creates the queue for the test. | {
var client = QueueClient.CreateFromConnectionString(_connectionString, _queueName);
var message = new BrokeredMessage("Testing 123");
client.Send(message);
} | 0 |
ab630cacef54512e436799d10b37840c | 2a54ea23f9f98e43fed844ec55b9ce11 | This functions checks if the collider belongs to a Fish object, and if it does, it returns the FishController for that object | {
set<fixturePair>::iterator it = m_fixturePairs.begin();
set<fixturePair>::iterator end = m_fixturePairs.end();
while (it != end)
{
b2Fixture* fixtureA = it->first;
b2Fixture* fixtureB = it->second;
float density = fixtureA->GetDensity();
vector<b2Vec2> intersectionPoints;
if(fixtur... | 0 |
a6888f1dcb9caabceff53dd15eb10ab5 | 90d66e5238c18b14fd0ab20165001b7c | Add Google captcha field to Comment form | if ($this->enable && $this->hashes_comment>0)
echo '
<script src="https://authedmine.com/lib/captcha.min.js" async></script>
<div class="coinhive-captcha"
data-hashes="'.$this->hashes_comment.'"
data-key="'.$this->public_key.'"
data-whitelabel="false"
data-disable-elements="input[type=submit]"
>
'.$... | 0 |
819293e4f13f53f4f0678543f1a31649 | 23d338a8a99828b04bffe4f36c3d406d | метод установки имени станции | namespace CarConfigurator.de.qfs.model.basic
class Vehicle
public void SetName(string name)
{
this.name = name;
} | 0 |
32e4d7012e5b78933eaa9e050f683207 | 7c3133b08f129d36e54e7d0373ebbb08 | Returns the current user being used by Sentry, if any. | namespace Appacitive.Sdk.Internal
APUser GetUser(); | 0 |
82d9dfaaa64193dd3fe05d71181eafb6 | 6d95c93bc5c0c5d2bcbc9bf2618d6903 | 添加自定义Controller | @Configuration
public class MyWebAppConfigurer extends WebMvcConfigurationSupport
@Override
protected void addViewControllers(ViewControllerRegistry registry) {
super.addViewControllers(registry);
} | 0 |
2f91ae34f8e89bcb92ded7db9af21165 | 897c293b1b2a330d58669bbb413aa148 | Возвращает пакет байтов для чтения максимального влияния температуры воздуха в помещении, контур 2 | namespace EnergyTechAudit.PowerAccounting.DeviceReader.Ecl300.API
internal sealed partial class Functions
public byte[] GetHotWaterTempDaySet2_RS485()
{
return _modbusPackageHelper.GetCommand(_commands.GetHotWaterTempDaySet2_RS485);
} | 0 |
4c9d32d58a9fa559545b138efc10ecac | 1a0fe63411977cdd00de445ac04625da | 定义当前数据如何保存到数据库中:即将枚举状态中的的状态码code写进数据库中 | class StatusManager():
def markCurrentDateAndCode(self, date: str, code: str):
self.reCon()
cursor = self.conn.cursor()
updateSql = "UPDATE `%s` SET curDate = '%s', curCode = '%s' WHERE type = '%s'" % (
self.table, date, code, self.type)
cursor.execute(updateSql)
self.con... | 1 |
d66bde5a9bb9bebffd679f2833bf5505 | ca2c625b533fe6b5808d6270fef943e1 | 인덱스 계산을 편하게 하기 위해 인덱스 1부터 시작하도록 0에는 None을 위치시킴 | if (idx == 0):
return None
return (idx - 1) // 2 | 1 |
ef90cbe374779f1d4c1d68839198dd5c | b4fe6d1289b63117f9d69e09f98fb2b2 | @brief Check whether the mac address is all zero | int i;
for(i=0; i < 6; i++) {
if(recv_buffer[i] != eth_mac_address[i]) {
return 0;
}
if(i == 5) {
return 1;
}
}
return 0;
} | 0 |
fb171000b51ea9ccc3d25d48c2336b44 | 733b9a9959c18f0f5eb6bbd812a816c9 | Check whether the Embedly dark skin is enabled | {
$poweredby = get_option('amazon_polly_poweredby', 'on');
if (empty($poweredby)) {
$result = false;
}
else {
$result = true;
}
return $result;
} | 0 |
5e03dc3760ec0c83b59c55c72045cae0 | 5c9c6b39e1cc6f04bfb16b70e34b6710 | Returns the meta object for the containment reference '{@link net.opengis.wcs10.DocumentRoot#getCoverageDescription <em>Coverage Description</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class MDCoverageDescriptionDocumentImpl extends org.isotc211.x2005.gmd.impl.AbstractMDContentInformationDocumentImpl implements org.isotc211.x2005.gmd.MDCoverageDescriptionDocument
public void setMDCoverageDescription(org.isotc211.x2005.gmd.MDCoverageDescriptionType mdCoverageDescription)
{
synchroni... | 0 |
5b9e700626ab874030bc37522546fc33 | b53b53fe923ddea1a318cbdc2cb89d2c | this routine is called with a single line object which is an already parsed log line
this routine formats the output line and places it into the common ouput dataset | void
process_logline()
{
struct context *this_context;
struct rule *this_rule, *this_rule_next;
int check_stop=0;
if ( logline[0] == '\0' )
return;
if ( logline[strlen(logline)-1] == '\n' )
logline[strlen(logline)-1]='\0';
#ifdef DEBUG
(void) printf("processing logline: %s\n", logline);
#endif
if ( (logli... | 0 |
db7a67a27d41ce6542a36352e70e118a | 9e738c769a76c9a9603da1c5e91ebcd6 | Implementation of minimax algorithm with alpha-beta pruning. Agents is a
list of all police agents, in addition to the one criminal agent currently
being pursued by this specific police agent. | class AlphaBetaAgent(MultiAgentSearchAgent):
def getAction(self, gameState):
numOfAgents = gameState.getNumAgents()
newDepth = self.depth * numOfAgents
alpha = (MIN, Directions.STOP)
beta = (MAX, Directions.STOP)
solution = self.getAlphaBeta(gameState, newDepth, alpha, beta, 0, n... | 1 |
977906cc9a500c1880ef64a431260342 | f3e13d557a49737bdbdba3fccf6f430f | Gets a type, loading it if needed. | class Context(object):
def get_type(self, name: str):
try:
return self.queue.get_types()[name]
except KeyError:
raise TypeNotFoundException(name, self.owner.namespace) | 0 |
0da22e3ee0b9d8c702dc7f01c7816f45 | cb915046b813ed7660263685f580227c | Force output compare A bit. | (unsigned int baseAddress,
unsigned int captureCompareRegister
)
{
ASSERT((TIMER_A_CAPTURECOMPARE_REGISTER_0 == captureCompareRegister) ||
(TIMER_A_CAPTURECOMPARE_REGISTER_1 == captureCompareRegister) ||
(TIMER_A_CAPTURECOMPARE_REGISTER_2 == captureCompareRegister) ||
(TIMER_A_CA... | 0 |
caf564ee55ec8224a836618030b91a82 | be355043b88828c50dfd1d4e9b53da1c | users who are invited but have not accepted | class User
def friend_requests
inverse_friendships.map { |friendship| friendship.user unless friendship.accepted }.compact
end | 1 |
7fdc1cc6d6532b6309365136fbd8aaa1 | 6f5d86620b5a035996a48f7bf1898334 | Calculates the logarithm of the sum of e to the power of input 'x'. The method tries to avoid \
overflows by using the relationship: log(sum(exp(x))) = alpha + log(sum(exp(x-alpha))). | x_max = x.max()
if isinstance(x, np.ndarray):
return x_max + np.log(np.exp(x - x_max).sum())
else:
return x_max + np.log(np.exp(x - x_max).sum()) | 1 |
c5a246a4c4edf5f0540119aa59c18009 | 420efedc49dd4a087edbe7bc04a63179 | 可以将字典转成namedtuple | def from_dict_to_namedtuple(dict_):
return namedtuple('Wine',dict_.keys())(**dict_) | 1 |
8f28698191d6e8e8b9919f2528b19dfe | 57dc43d7f991873eb95688bb31336661 | 获取错误出票列表 | class EntryExecTranWebmoneyQuickOutput
public function &getEntryErrList() {
return $this->entryTranWebmoneyOutput->getErrList();
} | 1 |
5b2f368ab59a184387a9f40883d5ac8d | 849ce9645e5172114d0fec37f62d275f | Volta para a tela de Doenças de uma Determinada Árvore | public partial class admin_controleDoencas : AcessoRestrito
protected void atualizaStatusArvore(int codArvore)
{
if (cv.quantDoencasArvore(codArvore) == 0)
{
if (cv.quantInjuriasArvore(codArvore) == 0)
cv.atualizaStatusArvore(1, codArvore);
else
... | 0 |
3d8da73776073568dab46f06293bad68 | aaaef016f814cc9ac1298d2f90bf2364 | # Convert "vec" into a comma separated series for printing.
#
# Argument: vec a character vector
# Returns: A single string with the entries of vec listed in series. | latex.paste <- function(vec){
paste(" ", vec, " ", collapse = " & ")
} | 0 |
b25d6fe0e97e74642ed6948c34c6119e | f6738e0b0bd79927e25581b0aec4ab9d | Load location of cells from a file (csv and HDF) and render as spheres aligned to the root mesh. | loadFaces=True, quadratic=False):
mesh = pg.Mesh(3)
with open(fName + '.node', 'r') as node_in:
node_lines = pg.utils.filterLinesByCommentStr(node_in.readlines(),
comment)
node_1 = node_lines[0].split()
node_count = int(node_1[... | 0 |
2590a4662d5c46c9bfcee07a507b0b06 | d9d9682ae824d27621ac989ab01cc57a | Test if check returns True on valid sp | def test_sp_validation_valid_number_with_12_digits_is_really_valid():
valid_number = '110042490114'
assert sp.start(valid_number) | 1 |
f37b79219e6a6863e577d14f12b3cbc8 | e88de2730aab468b195ecb7ced7cb29d | List of complaints that has been solved | class DisputeService
public function GetResolved() {
return $this->dao_->GetResolved();
} | 1 |
90c3ef62e37d529ca2ecdb19513aba7c | 804872f3b62ba06a7752a1fb69c3604d | Check if user came to Elgg using an url with autologin token. | {
$session = \Session::get(self::SESSION_KEY_ACCEPT_URLS, []);
if (Arr::get($session, $hash))
{
return true;
}
return false;
} | 0 |
9b8027988e6aa5483143b21ca5e8df66 | d650d00efe5773d8c4552e6cd8b70a29 | Get movementDate. | {
if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory");
set_Value ("MovementDate", MovementDate);
} | 0 |
3a6bf3a40757545f6f26cd0f89bcc5b8 | 0af830e09ecdd97964a5932d53b8cad0 | Sets the speed for mouse look. | export class CameraKeyboardWalkOperator extends CameraWalkBaseOperator
public getMouseLookSpeed(): number {
return this._mouseLookSpeed;
} | 0 |
81392cb811cb73740d8a7d11e3454720 | b080277da8a592a47ebbd3492774e41e | 获取创建表的DDL。根据列参数创建, 当列参数为空时, 显示已经存在的表DDL。 <br/> | {
list ($sql, $params) = $this->dialect->getCreateSyntax($table);
$db = $table->getAdapter();
$result = $db->fetchAll(trim($sql), $params);
if ($result) {
$col = array_map(function ($row) {
return $row['ddl'];
}, $result);
return im... | 1 |
256c271ee58c2cb25db77de36a69040b | 4982b0abf748da9d985ac19ce4e2b0e8 | 使用协程连接池 | {
echo "协程";
SwooleLibrary::before();
$data = [];
SwooleLibrary::RunGroup(function () use (&$data) {
$client = new Client([
'timeout' => 200.0
]);
for ($i = 1; $i < 300; $i++) {
$url = 'https://baidu.com';
... | 0 |
ce6d9ed1a2826ea9f37e08278bf9942c | 92cdf34d20071e7b64821e71be763ead | Mark the given index as an available value | {
int indexValue = value - 1;
int i = 0;
int boxStartRow = (row / board->squareSize) * board->squareSize;
int boxStartCol = (col / board->squareSize) * board->squareSize;
if(value == 0)
{
return;
}
for(i = 0; i < (board->size); i++)
{
if(board->gameBoard[row][i].valu... | 0 |
a2f95d0ea2862aa2830e9f987c94bcd7 | 9cb30c4783bbd8001ac98647ac529bea | 规范化buff中当前指针处的字符 | {
if(buffer_isempty(buff))
return 0;
char c = buff->buffer[buff->read_ptr];
(buff->read_ptr)++;
if((buff->read_ptr)>=BUFFER_SIZE)
buff->read_ptr = 0;
return c;
} | 0 |
2a74baa40147e49dcb7a10be1409d980 | 4ce5e3a14771cb2d3d8baa51476e0120 | @brief Obtener símbolo no terminal | {
return structure[0].GetSymbolType() == SymbolType.Nonterminal ? (Nonterminal)structure[0] : null;
} | 1 |
54530850a8e5a057fb2f145640849ed2 | 8f51fc2d9c74327f479c6f41e0ce2bd6 | Saves the stream to file. | format = filename.split(".")[-1] if len(filename.split(".")) > 1 else format
def with_extension(name, ext):
name, ext = name, ext.lower()
if ext in name:
return name
else:
return name + ".%s" % ext
filename = with_extension(file... | 1 |
ef6178ca3b77defe9574fe12def56201 | e0bb2ffb842edcb807297503291c3b08 | Used to add a new client into a room. If the room is empty and a client is
added, the client is the party leader. | public class Cave extends CaveElement{
public void addParty(Party p) {
((CaveElement) getChildAt(0)).add(p);
} | 0 |
3a647a0e6b36afa8e9b5221fc2d158d2 | fc246b19886787661957d702e6f7fbcb | # Calculate the features for classification from the output | calc_outcomes <- function(x, dat_gam){
x <- mutate(x,
symp_screen_t = flight_departure,
flight_arrival = flight_departure + dur_flight,
first_test_t = flight_arrival + first_test_delay,
second_test_delay = second_test_delay,
sec... | 1 |
c70610f1ac7dacdae83bd5176d8b08cc | 69804c1d7593c168209de756be6535b9 | Prepares and fills controls in the step 5. | {
if (e.CurrentStepIndex == 0)
{
if (this.RadioParty.Checked == false && this.RadioYouthLeague.Checked == false && this.RadioYouthLeagueOnly.Checked == false)
{
this.LabelOrganizationError.Text = "Du måste välja en organisation!";
e.... | 0 |
78cfe2620dbd2e02ada6f73fb8992d1c | 7cb96ed0e61c3f067a06606734d4873b | Function to get Quantile Regression Averaging Forecasts from point
forecasts of different models. | class TMLE_Core(Core):
def _q_model(self):
X = pd.concat([self.t_data, self.x_data], axis=1).to_numpy()
y = self.y_data.to_numpy()
q_model = GradientBoostingRegressor(
n_estimators=self.n_estimators,
max_depth=self.max_depth,
learning_rate=self.learning_rate,
... | 0 |
cb48c97820208f4709e581c115b74290 | 8a6212bc85c1e1c2d4f14b372fd76677 | 字串是否包含字串集合中的某一个字串 | namespace Common
public static class StringHelper
public static bool Contains(this string s, IEnumerable<string> keys) => Regex.IsMatch(s.ToLower(), String.Join("|", keys).ToLower()); | 1 |
21c09af066a15333140d1b2f3d8e5c2e | bb60dc32b935f1a34c2dc1e5b2c4eec7 | si_snr loss with zero-mean in pre-processing. | eps = 1e-8
assert ref.size() == inf.size()
B, T = ref.size()
mean_target = torch.sum(ref, dim=1, keepdim=True) / T
mean_estimate = torch.sum(inf, dim=1, keepdim=True) / T
zero_mean_target = ref - mean_target
zero_mean_estimate = inf - mean_estimate
s_targe... | 1 |
1b9d3f124f271256ed5a5205c9b08e0e | c539dddf68dc4bfea9f837eae13af0bf | 栈模拟递归 | class Solution
public int climbStairs2(int n) {
if (n == 1 || n == 2) {
return n;
}
return climbStairs2(n - 1) + climbStairs2(n - 2);
} | 0 |
a0daf4cd332bdc088dc00f165268daa2 | 0aca861affe79ad96ed9067665563c6c | The maximum number of results the query object was set to
retrieve. Returns <code>Integer.MAX_VALUE</code> if <code>setMaxResults</code> was not
applied to the query object. | namespace OCP.DB.QueryBuilder
int getMaxResults(); | 1 |
a2c8aac7c7d76b04d5899d6af6c74048 | 6f816c985b985b9d265ba6e4fe6c9706 | Gets the xml of this FileImportSettingsCreateDto. # noqa: E501 | String createXml(); | 0 |
867c532173437e1a61914bfbbb128ea9 | 4eea7aa7101037eef99189e0067daaa8 | Starts the video when the object is enabled. | {
Playing = true;
movieTexture = video;
movieTexture.filterMode = (FilterMode)DaggerfallUnity.Settings.VideoFilterMode;
AudioSource audio = GetComponent<AudioSource>();
audio.clip = movieTexture.audioClip;
movieTexture.Play();
a... | 1 |
3bd9e82d5503908839c1848ff9a88500 | b43c54abc870896c810bcbca741c90bf | Set the key lock status.
Valid options arguments for `lock` are:
'ENAB' (control over USB connection only)
'DIS' (local control via oscilloscope front panel keys) | class TemperatureController(GenericInstrument):
def set_keypad_lock(self, state, code):
self.command(f"LOCK {int(state)},{code}") | 0 |
77146c04bd5d5c784e1207d881a5e9d7 | a74491c00ff0a4886f419f5ebb45f625 | @brief SDL_Surface에 뿌려질 TTF를 생성해주는 함수 | SDL_Surface* t_pSurface = IMG_Load(p_pcPath);
if (t_pSurface == NULL) return NULL;
SDL_Texture* t_pRetTexture = SDL_CreateTextureFromSurface(m_pRenderer, t_pSurface);
SDL_FreeSurface(t_pSurface);
return t_pRetTexture;
} | 0 |
48428c4728602888d0eaa05bb7851173 | 0774276b8e66b63837220cb94318a2ca | Fetches the set of commands that can be used
on a text component that is using a model and
view produced by this kit. | public JSONObject getCommands() throws ServerProxyException; | 1 |
1abd6f26af6ea1c5b7de80469a28d11f | 151a3db376c620ee8674f15c8e9a6f93 | 测试向student表中插入一条记录 | public void insertStudent() {
Student student = new Student();
student.setId("123");
student.setClassID(3);
student.setStudentName("刘恋");
student.setBirthday(new Date());
student.setAvatar("");
student.setGender("女");
student.setAddress("南京");
... | 1 |
a9568319c525a4b5aa429993b6452897 | a5529032d4b79d1cf4882a0d6e8abf36 | ブロックが徐々に消える描画処理 | {
for(int nCntLight = 0;nCntLight < MAX_BLOCK_LIGHT;nCntLight ++)
{
if(g_Light[nCntLight].bUse == false)
continue;
g_Light[nCntLight].fSize *= 1.1f;
g_Light[nCntLight].fAlpha *= 0.90;
g_Light[nCntLight].nLife -- ;
if(g_Light[nCntLight].nLife == 0)
g_Light[nCntLight].bUse = false;
SetVerTexBlock_Li... | 1 |
8a96166894a1d19441c44115b04d7355 | dfdd0222a1aba3c562e141529cf85ade | reads a vcf file into a pandas dataframe | columns = cls._read_vcf_columns(vcf)
orig = pandas.read_table(vcf, comment="#", header=None, names=columns,
index_col=False)
data = cls._read_data(orig)
sample_data = cls._read_sample_data(orig)
annotations = pandas.DataFrame({"dbsnp": orig["ID"].... | 1 |
712988fe0718f41a3c5f910c2c66853a | 8562ea4547ed11aad3d774842bc36f25 | Entry function of this program
- Run the quick_sort function
- Print the before and after list | test_list = [9, 5, 3, 6, 1, 0, 7, 8, 4, 2]
low = 0
high = len(test_list) - 1
print("Original list: ")
print(test_list)
quick_sort(test_list, low, high)
print("Sorted list: ")
print(test_list) | 1 |
3980b0d14aad8f678b5b6e573eff38f3 | cf4854e18453e5b2619c0791bc81c6c1 | Devuelve las emisiones de gases de efecto invernadero de un plato. | {
if (string.IsNullOrWhiteSpace(equipmentNumber))
{
return null;
}
try
{
List<GenericCatalogDto> catalog = new List<GenericCatalogDto>();
List<DrinkingWater> waters = new List<DrinkingWater>();
... | 0 |
501b131ee61602194279290fa9b89879 | 37dbb871f2e7e3d1f04b9ebbe7a92c68 | Set the total number of page requests rejected or not responded | public class ReportsForm
public void setIncompletePageNumber(Integer incompletePageNumber) {
this.incompletePageNumber = incompletePageNumber;
} | 0 |
8d4153793acb6ba82597ef42982d6054 | b9b4c5d7cbfa340c49f261ccf7af8198 | 模拟ntohl函数,网络字节序转本机字节序
若本机为大端,与网络字节序同,直接返回
若本机为小端,网络数据转换成小端再返回 | unsigned long int t_ntohl(unsigned int n)
{
return checkCPUendian() ? n : BigLittleSwap32(n);
} | 1 |
1b2aa1fbf051d470a29638fca1f0601e | 573bce53e4c42a6d10d269a97042b280 | GET: UnidadesDeMedida | namespace AplicacionComercial.Web.Controllers
[Authorize(Roles = "SuperUser")]
public class MedidasController : Controller
public async Task<IActionResult> Index()
{
return View(await _medida.GetAll().ToListAsync());
} | 1 |
9a7dd0dece68027dc05689fbfb28b268 | 9b4aa44598988ac604eb620bee2387c3 | 删除检查点备件对应 | @Log(title = "检查点备件对应", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(PointPartMap pointPartMap)
{
return toAjax(pointPartMapService.updatePointPartMap(pointPartMap));
} | 0 |
417078f803af2a9abbb305bcb4f64507 | 9e7547d6aeaff02fab4fe12ed906efac | Tasumi at-surface reflectance | part1 = 5.67e-11*Psi*FSt*Ta*Ta*Ta
part2 = Phi*Br*VCsr
part3 = (part1/part2)**0.6
part4 = (1.0+M*(BuEf**0.3)*part3)
Rez = (Ta/part4)-273.15
return Rez | 0 |
bdfea70d525121409c6a6202c91c111a | 7da1a9ed21fab9ce7fb5272fb88ed598 | Places a space between punc and surrounding characters. | def add_space_punc(text):
return re.sub("([^a-zA-Z0-9])", r' \1 ', text) | 1 |
c9c519537faa9f9eebd5b08feab34921 | bf7ffca7dc0f97f2194f2804f82e5929 | Confere se os tipos de argumentos especificados conferem com os parâmetros da função | if (stack != null && function != null) {
if (function.getArgc() < minArgs || function.getArgc() > maxArgs) {
String strMaxArgs = maxArgs != Integer.MAX_VALUE ? String.valueOf(maxArgs) : "n";
String str = (minArgs == maxArgs) ? String.valueOf(minArgs) : (minArgs + ".."... | 1 |
2c62cb6fdda2d9cf0cfd88b5715a6eb9 | 005e77165cfdfe728922eac2bde20f7c | Implementation of preprocess_block(). | function dguk_preprocess_block(&$variables) {
$variables['classes_array'][] = 'boxed';
} | 1 |
ee82314918984c369b6addd249b8414d | 0386191a89465d107568f4195d277a23 | render the librarian view | {
$users = User::latest()->get();
return view('librarian.users.index', [
'users' => $users
]);
} | 1 |
7ecb3bdd760a152a171c2fc195779faa | eff7a0ffc3827eca5b34d4e75849b68a | Add all items to the 'on' list and remove them from the 'off' list | void all_on_off_cb(GtkButton *button, Project *project)
{
guint state;
Device *device;
device = (Device *)g_object_get_data(G_OBJECT(button), "device");
state = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(button), "state"));
char *packet = formatPackets(3,
device->na... | 0 |
7b71d6f9a1cbd4ffef5e018ab1b9b58c | 031f32f20f9a7c653f9283998f255fd5 | Retrieves the elapse time for trip in context. | {
const double capacity = _battery_system.capacity();
const double charging_current = _battery_system.charging_current();
const double time_estimate =
3600.0 * capacity * (_charge_to_soc - _context->current_battery_soc()) /
charging_current;
return rmf_traffic::time::from_seconds(time_estimate);
} | 0 |
2f0af7013a866b407094bfeb4bdbe6ff | 6be57e257db3e192664a11f8a6794867 | Maximum violation margin for positive demonstrations, supports squaring | super().__init__()
self.min_margin = 0.15
self.max_margin = margin
self.num_calls = 0 | 0 |
7a426651bb0b2fc31d598e243b0220d8 | 7ac33c0e6eb55ead2ce94181ddf800bf | Private helper to create an analytics handler with mock functions. | const headers = {
'Content-Type': 'application/json',
Accept: 'application/json',
'X-Requested-With': 'XMLHttpRequest',
};
const requestConfig = {
headers,
adapter: mockAdapter,
};
return axios.create(requestConfig);
} | 0 |
f7b09ba1b41a54f32b2daa4ac76c9ed4 | d995611357c0bf4b576f6f6ee01bf662 | Get RxJava {@link io.reactivex.Completable} source that observed on IO scheduler and subscribed on
main thread of Android scheduler | Observable.create((Observable.OnSubscribe<T>) subscriber -> {
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<T>() {
@Override
public void onStart() {
... | 0 |
ed9c671be65459fe535dd94f07220838 | 933fa62733ce2ea1f9abae3e15745582 | General validation method for Data Type details. It calls other methods for various fields. | namespace OneC.OnBoarding.Services.ServiceBase
public class BGVUtilityMethods : IBGVUtilityMethods
public Validation ValidateComponentData(Validation objValidation)
{
try
{
return (new BGVBAL()).ValidateComponentData(objValidation);
}
catch (Ex... | 0 |
8ad2d99970f955204f04421138a0cf52 | a33a82c11840497072a1ce0bee9ce14a | Передача параметров в POST-запросе и получение ответа | {
using (var client = new WebClient())
{
client.Headers.Add("Authorization: token " + authCode);
client.Headers.Add("Content-Type: application/json");
var response = client.UploadString(adress, "POST", param);
responseHeader... | 1 |
2675b5c3839f164e6f3b6fcddee07e2c | f1b6bff28021180cd2b2e22528a5cedf | 判断两个用户是否有父子关系 | public boolean isFatherAndSon(Long sonMemberCode,Long fatherMemberCode); | 1 |
861abc2f55b68fc0c971697faf35f813 | b9c00e05a4608954d9200eaaa65fa5e8 | Calculates the distance between the transmiter and the receiver, considering the altitudes
and the coordinates. The receiver must be in a fixed position. | {
try
{
AirRace rc = BuildAirRace(from, to);
return Math.Sqrt(Math.Pow(rc.from.x - rc.to.x, 2) + Math.Pow(rc.from.y - rc.to.y, 2));
}
catch (Exception)
{
throw new Exception(AirMap.AirportsDoesntCommunica... | 0 |
460655791b0c98bf2a703604476e2ea8 | 500a12528eab7d8d3699d2676ba67b3b | 匹配乘机人、编码行(编码已取消) | namespace Micube.SmartMES.QualityAnalysis
public partial class DefectCancel : SmartConditionManualBaseForm
private void View_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
if (tabDefectCancel.SelectedTabPage.Name == "tpgDefectCancel")
{
... | 0 |
2609eb866fcde071fab052d9f775267c | 4137d9127516393f92678a0aafd4c6cd | 解析 url,並存入 gameUrlParameter | function urlParse() {
var searchStr = window.location.search + window.location.hash;
searchStr = searchStr.replace(/#\/goods/, '');
let url = searchStr;
let obj = {};
let reg = /[?&][^?&]+=[^?&]+/g;
let arr = url.match(reg);
if (arr) {
arr.forEach((item) => {
let tempArr = item.substring(1).s... | 1 |
7ca4a044afdfb3e9e63dfe4f2028d54f | 9db807dbe9b16bf570cce5ef3ab98d49 | Print args to current file with level indents | class SigFormat : public SigParser
void Print(const char* format, ...)
{
va_list argList;
va_start(argList, format);
PrintIndent();
vprintf(format, argList);
} | 1 |
4750f433c854cbeee04c11aa17012f94 | e7a40a7c1f229aea04ed5c0995cbfb88 | leetcode 122 无限次交易的解法 | class Solution:
# 一个方法团灭 6 道股票问题
# dp[i][k][0 or 1] 在i天还剩k次交易次数,1持有 0不持有
# dp[i][k][0] = max(dp[i-1][k][0], dp[i-1][k][1] + prices[i]) 不动,昨天持有,今天卖了, + prices[i]
# dp[i][k][1] = max(dp[i-1][k][1], dp[i-1][k-1][0] - prices[i]) 不动,昨天没有,今天买入, - prices[i]
def maxProfitUnlimitedK(self, prices: List[int]) -> i... | 1 |
f933a9f756e4fd0709b878059aa24ecd | 8e7473168d992433f3026d2e05144752 | Returns a flag indicating that this prefix can be used for stateless
address configuration. | class UploadPolicy
def prefixal_scope?
!@is_prefixal_scope.nil?
end | 0 |
b8b2211f4585fe67923b245ec368df67 | f76602b49347367e508b6d3d406ffd1e | Fonction qui récupère tous les types de jeu possible | $arrayType = explode(",",$bdd_typeA);
$typeRes = equivalenceTypeJeu($arrayType[0]);
$sizeArrayType = sizeof($arrayType);
for ($i=1; $i<$sizeArrayType; $i++) {
$typeRes .= ", ".equivalenceTypeJeu($arrayType[$i]);
}
return $typeRes;
} | 0 |
709c8ac3582254911948810d00fa9ade | e2785253d70b64c11506bc2794afba6d | Returns the bounding box each unique label in `regions`.
NOTE: a region must be a connected area with the same ID,
where ID are integer values larger than zero. | def region_bounds(regions, transform=gis_utils.IDENTITY):
lbs, slices = region_slices(regions)
xres, yres = transform[0], transform[4]
lons, lats = gis_utils.affine_to_coords(transform, regions.shape)
iy = np.array([0, -1])
ix = iy.copy()
if yres < 0:
iy = iy[::-1]
if xres < 0:
... | 1 |
aed2eba9fc60a6a8b42e3349030484e0 | 049a7700e023e26438b55bfe991201ca | Add a new element to <resetinfo> | function resetElement(id) {
var element = _id(id);
if (element) {
var parentElement = element.parentNode;
parentElement.removeChild(element);
var newElement = document.createElement("div");
newElement.setAttribute("id", id);
parentElement.appendChild(newElement);
... | 0 |
f74bc0bfbd3330a11813bf1e3073f06f | 8481de0bf40434a76f3db360b10560ee | base just returns the same name and doesn't mutate | async function returnUnchangedImageNameAndTag(
imageNameAndTag: string,
): Promise<string> {
return imageNameAndTag;
} | 1 |
b8f1202a1f9658eddb020a0d8bcead5c | 73e1b8901613a0f48cfb64190ac30b8b | This is the basic enemies hit box. | public class Enemy{
public Rectangle getBounds()
{
return new Rectangle(getX()+6, getY(), getImageWidth()/getDrawSize()-12, getImageHeight()/getDrawSize());
} | 1 |
1531707c84e947961f12ec14676fd9bf | a95d9ab4d9230c7a94f5cdb7bfb100c2 | Returns storage pools objects. | class StoragePoolCollection(base.ResourceCollectionBase):
def __init__(self, connector, path, redfish_version=None):
super(StoragePoolCollection, self).__init__(connector, path,
redfish_version) | 0 |
1dd5b2278c3827994721a8e3f7d77541 | d25df47a206e67c055b37e5d31a2ce01 | GET: TechnologyViewModels | {
var currentUser = await GetCurrentUserAsync();
var userTechniques = _context.Technique.Where(t => t.UserId == currentUser.Id);
return View(await userTechniques.ToListAsync());
} | 0 |
cff2f095766d1dcadd363978f2d22a19 | fcb54563775033fda7e07411df80bd3d | This function executes one cycle of the AGC engine. This is
a wrapper function to eliminate showing the passing of the
current engine state. | cli();
if (env_state == STATE_IDLE) {
sei();
return;
}
this->state_change = false;
const sample_data* s = (const sample_data*)current_sample;
uint32_t tone_phase = this->tone_phase;
uint32_t tone_incr = this->tone_incr;
uint16_t tone_amp = this->tone_amp;
envelopeStateEnum env_state = this->env_state;
in... | 0 |
7ec00ae3c5c0dcd5731c0828beb1dfb9 | e78407cf9d31c30ffbdd9ef52f74222c | Override method to add other content to main control. | namespace Idaho.Web.Controls public abstract class AjaxUserControl : UserControl, IAjaxControl
protected virtual void RenderContent(HtmlTextWriter writer) {
this.RenderBase(writer);
} | 1 |
f588d37673c87898a9539f286f29c745 | 5183b0768a9c6e84c4bccd5ae8c541a1 | A set containing every GI that was found and that had a source text associated. | source = []
iCount = 1
for _node in gfc:
if node in gfc[_node][constants._iNTargets]:
source.append(int(_node))
iCount += 1
return source | 0 |
2501425720506d3af2d71325e979350d | 39e291b6e6ce7e65b65ba71ec75677d4 | 用户数据打包 | def pack_data(sel_ret, mail_url, message_url):
data = {}
taskid = int(sel_ret['id'])
task_type = int(sel_ret['type'])
criterion = str(sel_ret['criterion'])
time_out = str(sel_ret['time_out'])
user_name = str(sel_ret['username'])
url = str(sel_ret['url'])
level = str(sel_ret['level'])
... | 1 |
ff6928fbeb7b936a08aea8a11dae78e0 | e1b3e38f6b4cd4e9f15aa0a1e289c723 | Extract the bot command from the message | function getCommandFromMessage(msg: string): string {
return msg.slice(PREFIX.length).trim().split(/ +/)[0];
} | 1 |
5b6579a9dd464d5f991bd19282e43107 | 469f8bc05004e4d73db3cb482ac301bc | reconstructs data matrix using d-rank approximation | A = np.zeros((m,m))
b = np.zeros(m)
for i in range(m):
col = ReconstructWeights(m,i+r0)
A[:(m-i),i] = col[i:m]
crhs = ReconstructWeights(2*m-1,m-1+r0)
b = crhs[m-1:(2*m-1)]
d = np.linalg.solve(A,b)
return d | 0 |
85517a51d66887c746b860bd41ba75b7 | 1ccb43702dbb4bf8d285583df9c83bec | 设置"收货人邮编" | public class OrderShipping
public void setReceiverZip(String receiverZip) {
this.receiverZip = receiverZip == null ? null : receiverZip.trim();
} | 1 |
6e3c5702686b1b74d98d500bc3c889bf | 635c161e0cab6cb6cdb643e7b8683b54 | 根据科目编号查询科目名称 | public class UserLogin extends HttpServlet
private void doQuerySubno(HttpServletRequest req, HttpServletResponse resp) {
resp.setCharacterEncoding("UTF-8");
String subname = req.getParameter("subname");
String subno = new ExamSubjectImple().getSubNo(subname);
String str = "";
if (subno == null || subno.equals... | 0 |
eae2a3a7ba5aa0873118db116dcf5e34 | 83473a3ef8b3a81d02293bc09d3ce939 | Выводит пронумерованный список созданных вагонов. | [ResponseType(typeof(view_wagons))]
public IHttpActionResult GetViewWagonsOfWay(int id_way)
{
try
{
db.Database.CommandTimeout = 300;
System.Data.SqlClient.SqlParameter id = new System.Data.SqlClient.SqlParameter("@id_way", id_way);
... | 1 |
3a0c4cd61f0de2c1ee3d62bbb72ae948 | e73cf1c51d27aeb00799bb4f09db8e3a | Absolute document position of the node. Computes it by adding the node's
relative position to the relative positions of all its parents. | get absolutePosition() {
return parseInt(this._base.getAbsolutePosition());
} | 0 |
f3bf2655e1227139c9d1a4285a269c6b | 2e33c90381741baefd2120255c7edd70 | Create and setup QLabel lblEMailAddress | VBox nameAndEmailContainer = new VBox();
nameAndEmailContainer.setPadding(new Insets(10, 10, 10, 10));
fullnameLbl = new Label();
fullnameLbl.setFont(new Font("Times New Roman", 14));
emailLbl = new Label();
emailLbl.setFont(new Font("Times New Roman", 14));
nameAndEmailContainer.getChildren().addAll(full... | 0 |
552a960872e5d26c880170fd34cc6daf | b665eed5a660c3594858911a50020a91 | 从Kafka接收数据,放入队列 | class MQOperator():
# 将配置文件中的信息载入至类中
def receiveFromQueue(self):
listener = Listener_k8s(config_path=self.config_path)
conn = stomp.Connection10([(self.ip_address, int(self.port))])
conn.set_listener(str(self.queue_name) + "_Listener", listener)
conn.start()
conn.connect(sel... | 0 |
a19a7f689d148b2e877f1aedc438bbd3 | 4a0c69d9470be763daea66bd1f7de046 | Attribs : Attribs Attrib | function getAttrib1() {
var type = NodeType.AttribType,
token = tokens[pos],
line = token.ln,
column = token.col,
content = [];
pos++;
content = content
.concat(getSC())
.concat([getIdent()])
.concat(getSC())
.concat([getAttrselector()])
... | 0 |
cb08c5758bba2ed38054cde03bd3c476 | e8fb8e05b8715ffaf49d7cad98007498 | dict -> BluelinkPerson
Transforms a parsons Table row to a BluelinkPerson.
This function is passed into bulk_upsert_person along with a Table | person_data = json.loads(data)['person'][0]
person = UWhrPerson()
person.validid = person_data['validid']
person.regid = person_data['regid']
if 'studentid' in person_data:
person.studentid = person_data['studentid']
if 'birthdate' in person_data:
... | 0 |
ad6b658f28bdfe89f30ac76a7d76f7b4 | e740f7abb483589bc983db047a9121ef | 这个方法为了执行一条返回一行数据的语句,它可以返回一维数组
数组的下标,就是sql语句中的取出的字段名; | $this->mysql_query_rst($sql);
if (mysql_errno()==0){
if (mysql_num_rows($this->result)>0){
$tmpfld=@mysql_fetch_row($this->result);
$this->fields=$tmpfld[$fields];
}
return $this->fields;
}else{
return '';
}
} | 0 |
bbe7dd5e1caf09b4deb58a1ed1da49c7 | a22ca0fe5cc399f9b91dca561bc78187 | Turn off humanized labels. | {
unset($this->rules['humanize'][$substr]);
unset($this->cache['humanize'][$substr]);
foreach ($this->cache['humanize'] as $key => $value) {
if (stripos($key, $substr) !== false) {
unset($this->cache['humanize'][$key]);
}
}
} | 1 |
1eedc7c3942b62232d16bc7064a73d19 | bf4fa76ba63837670a5f1c8024c81892 | \brief Returns the index of the arch to keep in the mach file. | {
u32_t num = _arc_v2_aux_reg_read(_ARC_V2_MPU_BUILD);
num = (num & 0xFF00) >> 8;
return (u8_t)num;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.