query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
56fd5dff9bb4e520de1aa3445581e003 | 38c8814db70b5bd48e9d5a4a28f64642 | runs <command> as though it were python code | class _Command():
def c__pyexec__(_arg, _splitarg, _commasplit):
try:
_ = eval(_arg.strip())
if _ is not None:
DataGlobal['ret'] = _
except Exception as e:
exception(e) | 1 |
f041813dd576b9399876d85be808171f | edda7c9dd92ff698774ef182d5f91730 | Recupère l'identifiant unique de la règle du jeu | class Rules
public function getId($rule)
{
$tmp = array_search($rule, $this->rules, true);
if ( !empty($tmp) )
return $tmp;
else
{
RuleError::notExists($rule);
return -1;
}
} | 1 |
b03e679e044a933343a32c9fdb7d5051 | 1cc412d38bdc5beda9bce182c9835d27 | Procède au rendu de transformation et le renvoi dans un dictionnaire
avec les stats de parsing | class FormulaOneDNFParser(HTMLParser):
def get_dnf_stats_json(self):
return {
'ret': self.get_ret(),
'nc': self.get_nc(),
'dnq': self.get_dnq(),
'dnpq': self.get_dnpq(),
'dsq': self.get_dsq(),
'dns': self.get_dns(),
'dnp': self.... | 1 |
d4d8081a888a8d2fe32b1aeb4958d260 | 45fe59c4bbd906dfe75104a3dc5d9bac | when followed, will open that file in TextMate for editing. | class SuperNano:
def open_file_dir(self):
filename = self.file_menu.get()
if filename.startswith('<DIR>'):
self.current_dir_box.set_text(os.path.join(self.dir, filename[6:]))
self.open_new_directory()
else:
try:
self.edit_text_block.text_color_... | 0 |
5592ce0ad84ebe12aabfa11deca06d38 | 4599a88bdeed8a44af344cdabfe666a7 | Add an existing node to the directory (No FS calls) | if (fname == NULL) FATAL(ENULLPTR);
if (strlen(fname) > FNAMESIZE - 1) FATAL(EBIGFNAME);
i8 buf[BYTESPERBLOCK] = {0};
bioRead(DBNDIR, buf);
Dir* dir = (Dir*)buf;
for (int inum = 0; inum < NUMINODES; ++inum) {
if (strlen(dir->fname[inum]) == 0) {
strcpy(dir->fname[inum], f... | 1 |
8945718a0aae0277776cb9efcddf2ea4 | a439cf8c8d9ff471d271fc292894509c | Get the status of DHCPv6 option status from Web UI. | $rspString = parseResponse(getResponse("network radvd", "show-status", "", 1));
echo $rspString['rows']['status'];
} | 0 |
e975045ec637998e3c237abe3042047d | 68fe57368dd5f8195b093f6617598b93 | unselect study type questions | var ele = document.getElementsByName("popeyescore");
for(var i=0; i<ele.length; i++)
ele[i].checked = false;
var ele2 = document.getElementsByName("likertScore");
for(var i=0; i<ele2.length; i++)
ele2[i].checked = false;
} | 1 |
d96407d45ca7c94d4faca1bc25ae1f5e | c42f6bc24e7c96ba4e205e55bc56c583 | KeywordRequriments checks if phrases are longer than 2 characters. | function shouldSearch(query){
return query && query.length > 2;
} | 1 |
0afcd539dec51b8abb2c69e10064c6ec | f4c41b62186384a258492f01bb5956fc | Funçao da Query2.2 Estatística - Faturação total por mês para cada filial e o valor total global; | Double getTotalFaturacaoMesFilial(int mes, int filial); | 1 |
0d0db3ef8a7d05b4d9b1c75d86187121 | 5036481790e9fee211bfacc5d3d010f3 | Get the key of the position where the internal pointer is located. | class Node implements \ArrayAccess, \Iterator
public function key()
{
return $this->iteratorPosition;
} | 1 |
46c66a4d84a1f23fa5af9e0aaf385bfc | 795c251508304cffb01d52a2215a6da0 | Initialize a known-valid sudoku board deterministically | var _isvalid = false;
while(!_isvalid){
var initarr = shuffle([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]);
initarr = initarr.slice(0, 15);
if(scramble(initarr))
_isvalid = true;
}
console.log(_blankX, _blankY);
return initarr;
} | 0 |
31cbdabf1246eb53b37ea48b11646145 | 89bb342f446315deff23e3ce81d35475 | Write a program to print largest number from array | public class AdvancedArray1Max
public static void main(String[] args) {
int arr_size = 0;
int max=0;
int maxindex=0;
Scanner in = new Scanner(System.in);
arr_size=in.nextInt();
int arr[] = new int[arr_size];
for (int i=0;i<arr_size;i++)
{
arr[i]=in.nextInt();
}
max=arr[0];
... | 1 |
d331bf6770bef0737bc01581db53595f | 7a44c472084f5902cd8759362a540d6a | Gets the files for the homework assignment | ArrayList<File> assignments = new ArrayList<>();
Pattern pattern = Pattern.compile("Assignment(\\d)*.csv");
Matcher matcher;
File[] files = new File(".").listFiles();
for(File file: files) {
if(file.isFile()) {
matcher = pattern.matcher(file.getName());
if(matcher.find()) {
... | 1 |
4237498c6bbe95969c75a682329043c0 | 7c237e28d2041c0e70ebbec8a2b203f5 | Function to get the depth of a chromosome | public class DLLFunctions : MonoBehaviour
[DllImport("CheckersDLL")]
public static extern int GetDepth(); | 0 |
6b75795558928371e4d3770a7c5733fd | 0fd262bb0a975ed65e924477dab8351e | list转换为str, 分隔符为', | public class GlobalFunc
public static String listToStr(List<String> list) {
StringBuffer buf = new StringBuffer();
for (String str : list) {
buf.append(str + ",");
}
String str = buf.toString();
str = str.substring(0, str.length() - 1);
return str;
} | 1 |
6357939ab64521f87539f778fad10aaf | 5e67f33f7d156f309c0bd4548f778341 | Defines a many-to-many relationship. | const { Category } = models;
this.belongsToMany(Category, {
through: "ProjectsCategories",
foreignKey: "projectId",
otherKey: "categoryId",
});
} | 1 |
eeb10e58d3d9bdd0dbf190846d3d10cd | 87209e97e47899a524ae640ddb09e9ef | Gets the login from a "push" json string | public class Family
public static boolean loginUser(String json) {
mUser = new Person();
try {
JSONObject root = new JSONObject(json);
String authToken = root.getString("Authorization");
String userName = root.getString("userName");
String personID = root.... | 1 |
ebc2914cb5f50e7886e056ebf61215de | f00a1814999900347950448381099bb0 | Bytter til neste gamemode | gameMode++;
if(gameMode > Arena.DEATHMATCH){ gameMode = Arena.DEATHMATCH; }
UpdateGameMode();
maps = MapsByMode(gameMode);
mapIndex = 0;
} | 1 |
5c159f37075453d85ea3d880c8855ef3 | 7c4b3663be03472d30803d25abb0ff5a | If {@code true} blocks when the Disruptor's ring buffer is full. | default StubComponentBuilder defaultBlockWhenFull(
boolean defaultBlockWhenFull) {
doSetProperty("defaultBlockWhenFull", defaultBlockWhenFull);
return this;
} | 1 |
43a1f3a0042808ebc85006b7fceb5023 | 3464018b6398cb111990d865451c1f69 | 判断是否是简体中文,原因:
nexus 6p 简体中文(香港)和繁体中文(香港) http://www.jianshu.com/p/a6d090234d25 | def is_chs(val):
if val:
flag = False
if is_jps(val):
return False
for c in val.decode('utf-8'):
if ord(c) >= 0x4e00 and ord(c) < 0x9fa5:
flag = True
break
if flag:
try:
val.decode('utf-8').encode('gb... | 1 |
3be76282b23fa093662deb262a1e8dc8 | c04253f7e404479cbec2439db54eaca1 | Analog to Enumerable.Select(). | namespace Kottans.LINQ
public static class ExtSelect
public static IEnumerable<TR> Select<T, TR>(this IEnumerable<T> source, Func<T, TR> selector)
{
if (source == null || selector == null)
{
throw new ArgumentNullException();
}
return SelectIte... | 1 |
534e7adcc15f3b2bcb562c2cb975f212 | df75ba520ae0fd2d8eff07a5897a48dd | 查询闸机状态 | @ResponseBody
public String getBarrierStatus(){
String barrierStatus = restTemplate.postForObject(urlRest, null, String.class);
return barrierStatus;
} | 1 |
2b9d513cd1e12d3ad592d870530af11f | 93e1fc826e4017fc618e9dab28f9338e | FUNCION PARA CARGAR LOS TIPOS DE AMBIENTE | $html = "
<option value=''>
-- Tipo --
</option>";
$select = $this->select(array("id","type"))
->where("activated = '1'")
->order("type");
$resourse = $this->fetchAll($select);
foreach ($resourse as $... | 1 |
c9351861f11c75a2b98b145d1741c455 | 87b6023f347b393771b3c918eac8459f | 读取本地文件返回字节数组 | byte[] buffer = null;
try {
FileInputStream fis = new FileInputStream(file);
buffer = new byte[fis.available()];
long length = fis.read(buffer);
fis.close();
logger.debug("length:" + length);
} catch (FileNotFoundException e) {
logger.error("FileNotFoundException异常", e);
} catch (IOException e... | 1 |
f73e6834ff1ddffd939503056eb9282b | d938c934a0de53f7e373dea082724417 | We allocated the list of active connections and ccp_datapath struct,
so we are responsible for freeing them | _dispatch_close_list(struct dispatcher *d)
{
while (d->connections_closing) {
struct my_connection *c;
c = d->connections_closing;
d->connections_closing = c->_next;
c->_next = 0;
dispatcher_remove_at(d, c->pollfd_index);
}
} | 0 |
f887491b847e0be0d8b92074aa09b228 | 76e52da574d5a33c3f61ff9832d8a8c0 | 数据验证
对订单与商品必填的数据进行校验,若有缺失则返回相对应的错误信息 | {
$p = [
[
'checked_type' => 'length',
'key_name' => 'title',
'checked_data' => '2,60',
'error_msg' => '标题名称格式 2~60 个字符',
],
[
'checked_type' => 'length',
'key_name' ... | 1 |
9213d980e4c223274949f803d3c0baa8 | cdb0a74def162b20ca7976bc4ee6ed75 | Multiplies a color by a scalar. Does not ensure the correctness of the
obtained color as it allows to exit the normal ranges. | impl ColorOp
pub fn with_mul(self, mul: Color) -> Self {
Self { mul, add: self.add }
} | 0 |
67c1c8c5150947062fb0476113ca3028 | a48afced3c3d2b32e974cab86f71c30b | \brief Application entry point for ssc_dam_audio example. | {
uint8_t c ;
int16_t freq, amp ;
WDT_Disable( WDT ) ;
printf( "-- DAC12 Sinewave Example %s --\n\r", SOFTPACK_VERSION ) ;
printf( "-- %s\n\r", BOARD_NAME ) ;
printf( "-- Compiled: %s %s --\n\r", __DATE__, __TIME__ ) ;
amplitude = MAX_DIGITAL / 2;
frequency = 1000;
SysTick_Config( BO... | 0 |
75474bf5037f64f177429dbed6599e3b | 288c6398c8a1fc3be47ee4dfa5050658 | Cloud server의 파일, 디렉토리 삭제 | class YunApi(object):
def delete(self, yun_path):
params = {'method': 'delete', 'path': yun_path}
return self.request('POST', '/file', params=params) | 1 |
efd901674e14cdf7643078681729db3b | 36eb3636e5a412bf4ba5fe22fc6aca59 | Сохраняет имя класса | class Database
public function setClassName($className) {
$this->className = $className;
} | 1 |
e9932228449bdc45a1818b24213fad68 | b99453a93123605ac7dc71809d190e28 | Retrieve total time for a user during a given period. | @SecuredRest({Role.ADMIN, Role.USER})
@Path("/users")
public class UserService
@GET
@Path("/hours/{startTime}/{endTime}/{userId}")
@Produces(MediaType.APPLICATION_JSON)
public long getHoursForPeriod(@PathParam("startTime") long startTime, @PathParam("endTime") long endTime,@PathParam("userId") int userId){
... | 1 |
e56cabe3f18733e99fa64a051351940d | b1b812c49c80fb8580c703e4cb64b4a8 | A helper function to construct a Function object from source.
Helpful if you need to create a test function with syntax
that's not supported by some of the Py versions
that are used to run tests or build docs,
or if you need a function with custom __future__ imports. | if six.PY2 and '.print(' in src:
src = 'from __future__ import print_function\n' + src
parsed_module = gast.parse(src)
parsed_module.body = parsed_module.body[1:]
else:
parsed_module = gast.parse(src)
return parsed_module | 1 |
4790391ea9921aa5b0ba681b4a1f31e0 | 080df850e49211310a16a9c49b521a1b | 通过显示(\|/-\)符号表示库正在运行, | def print_status():
loading_symbols = [" --", " \\", " |", " /", " --"]
t = threading.currentThread()
while getattr(t, "do_run", True):
for i in range(0, 5):
cls()
print("\n " + message + loading_symbols[i])
time.sleep(0.1)
cls() | 1 |
4efa23d8d56d663e512495d73fd37204 | 00782e0dd3d98f3ed6b74f1017235526 | リストノードをキューの先頭に追加する | {
if (_listFirst != null)
{
coroutine._listNext = _listFirst;
_listFirst._listPrev = coroutine;
}
_listFirst = coroutine;
} | 1 |
241b5283fa5f36a04683e7773c823a4a | fc9415eca07ac3ef30d9aef92ca4a911 | Recompute the RMS sum periodically to prevent accumulation of rounding errors
during long waveforms | {
double sum = 0.0;
uint32 count = 0;
for (size_t startSample = m_overlappingSamples; startSample < m_samples.size(); )
{
size_t samplesThisPeriod = std::min(m_samples.size() - startSample, m_samplesPerRMSPeriod);
double db = CalculateVolumeFromRMSPower(&m_samples[startSample], samplesTh... | 0 |
f8851d4b954959e8032b6194aaafb7d1 | b570245133a717dc9df6acf4a5f96913 | Import participant list. | abstract class ParticipantListImporter
public function import(string $filePath, Course $course) {
$parsedParticipants = $this->parser->parse($filePath);
return $parsedParticipants->map(function ($parsedParticipant) use($course) {
$parsedParticipant['scout_name'] = mb_substr($parsedParticipan... | 1 |
ab4fc969376e805c9e9353dc7d8f12ec | 3c94f3a325455432e5d3e0abde95cdc4 | Given a scalar function at vertices, compute its gradient in each face.
The gradients are defined in a tangent-coordinate system in each face as
specified by edge_in_face_basis(). | v = np.zeros((xyz.shape[0], 3))
if self.gradient_function is None:
v[:, :] = np.nan
else:
v[:, :] = self.gradient_function(xyz)
return v | 0 |
3b4a903f7ec1e4192907dc89bdf55523 | 41487a11903c7150868dcd2f2dc83381 | Message box NO button click event handler | private void noButton_Click(object sender, RoutedEventArgs e)
{
OnNoClick();
} | 1 |
a046669499ead09f5f72727e6f5d27e1 | 80a8184e8c2b6a5a04aa939c7b3b4f33 | ### gentle adaboost | DR_boosting = function(X, z, y, seed = 1, ntrees = 100, ...){
set.seed(seed)
dat = data.frame(X,z,y)
X1 = dat %>% filter(z==1) %>% dplyr::select(-z, -y)
X0 = dat %>% filter(z==0) %>% dplyr::select(-z, -y)
ps_boost = gbm(Z~., distribution = "bernoulli",
data=data.frame(X,Z=z), n.trees = ntree... | 0 |
4cf5ee5e8f37e4e5f7f7417965759fa9 | b7406b8a4bc3626e6cce06b8882bf595 | Convert BR tags to nl | class ViewModel
public static function br2nl($string)
{
return preg_replace('/<br[[:space:]]*\/?[[:space:]]*>/i', "\n", $string);
} | 1 |
4fc06d410f9c932ac5a33cd2b5e94401 | 58c32354a729f7f8d8941787f8f41b27 | Factory to return a MySQL.Connections.Connection. | class IZodbFactory(Interface):
def getConnection(**kwargs): | 0 |
93c9fc8ddbc123fef18d3647b1b3bb0d | 1ea51618a5292366f1668d37414015fb | Returns a list of Mime type groups ordered by requester preference. | class ExoIconMimeManager
public function getMimeGroups() {
return [
'default' => [
'label' => t('Default'),
'icon' => 'regular-file',
],
'image' => [
'label' => t('Image'),
'icon' => 'regular-file-image',
],
'audio' => [
'label' => t('Audio'),
... | 0 |
5756d9dde8374c8d6b532553dd878318 | 4f7108202f171013398d69e768d855a8 | called on a regular interval to regenerate force power. | public class EnemyStatsContainer : MonoBehaviour
public void Regen()
{
Toolbox.GetInstance.GetStats().PowerUp(eStats);
} | 1 |
6676b9c42a75dca3c75e1cd331e0338d | 4b7d31da8c4d0ab8990328a1d5361871 | Returns an overview of your organization's history based on the specified time range.
The overview includes the total reactive and proactive insights. | namespace Genesys.Internal.Workspace.Api
public partial class ReportingApi : IReportingApi
public InlineResponse2002 Peek (string subscriptionId)
{
ApiResponse<InlineResponse2002> localVarResponse = PeekWithHttpInfo(subscriptionId);
return localVarResponse.Data;
} | 0 |
b6357eca3cf82818232db8c14a1655f3 | 7a7fab6e6699614881ce8f2fa8e4065a | Change the upper limit of the zone that triggers the high alarm. | bool GestionMPR121::setUpperSiteLimit(uint8_t value) {
return write8(REG_AUTO_CONFIG_USL, value);
} | 1 |
1119e309504c9167096fe1c7e0eb8022 | dc4c649349a76b8daaef967a58e7ef76 | ! \brief Enable the pio proximity sensor | bool SF_APDS9960_disableProximitySensor()
{
if( !SF_APDS9960_setProximityIntEnable(0) ) {
return false;
}
if( !SF_APDS9960_setMode(SF_APDS9960_PROXIMITY, 0) ) {
return false;
}
return true;
} | 0 |
ff622dbf11cdc7e0ca8c7618e03218de | e25b3154ae912fcdd70d215f0f7b5e03 | Разбивает строчку полученною от пользователя на елементи по разделителю + и
возвращает список елементов. | class subjectsParser(QtGui.QWidget):
def parseBox(self, tb):
tb.blockSignals(True)
s = str(tb.toPlainText())
tb.blockSignals(False)
return s.split() | 0 |
b3ea2ca0911593570d48fed28ff3097a | 35c4134bd0c26c5e980b63490c914ec5 | GET /dutyitems
GET /dutyitems.json | class ServiceDutiesController
def show
end | 0 |
591bc06762f70c1cccbbad35cef0f91f | 8052cbc26cce2970b4dfe688fe57529e | make a clean restart of the entire game, to start the player at level 1 | public class GameControl : MonoBehaviour
public void ResetGame(int startAtThisLvl = 0) {
string lvl = ("Level " + currentLevelNum);
DestroyGameObj(lvl + "(Clone)");
for (int i=0; i<currentLevelNum; i++) {
Transform floorParent = GameObject.Find("Environment/Floor " + i).transform;
GameObject newFloor = (Gam... | 1 |
5f3033cc101c5200f4c3874ca1b1bbd4 | adb0be0d2d140dc02b59522c5322d7c2 | 提交用户签名表单 | export default class PersonalInfo extends Component
inputSignResult(sign) {
this.state.itemInfo[3].rValue = sign;
let formData = new FormData();
let param=md5.hex_md5(global.commons.baseurl+'action/ac_user/saveUserinfo');
let params=md5.hex_md5(param);
formData.append('app_key',p... | 1 |
95242310d6174b0896867b0663100d32 | dc6cea41d0f1862c9b5c207ba77fb988 | 男女配列作成 | fun homeSexToys(): MutableList<SexToyEntity.SexToys> {
var sexToys = ArrayList<SexToyEntity.SexToys>()
for (i in 0 until 5) {
sexToys.add(SexToyEntity().SexToys())
}
return sexToys
} | 0 |
67d4de1d084d48dda00514df3b999b78 | 9d235c25be308186a909b4b9bfa8519c | toggle between black/white background | if (bg === 'night' && chalkboard.classList.contains("chalkboard")) {
chalkboard.classList.toggle("chalkboard");
chalkboard.classList.toggle("whiteboard");
mainColor.style.backgroundColor = "#000000";
toggleStrokeColors('black');
strokeColor = 'black';
document.getElem... | 1 |
948842303a396c4d79a7f12e21b7ac55 | 9a7e360cb562d48ba8ed29bc1521e519 | Displays the current entered Duty Cycle to the LCD | void displayInfo(int height, int degrees, int main, int tail)
{
char string[40];
sprintf(string, "main cycle: %2d%% ", main);
RIT128x96x4StringDraw(string, 5, 34, 15);
sprintf(string, "tail cycle: %2d%% ", tail);
RIT128x96x4StringDraw(string, 5, 44, 15);
sprintf(string, "Hgt. (%%) = %d%% ", height);
RIT128x... | 1 |
9b83d308e26526ff9525f540d67873f0 | cc17d376f20ebb206252aeec2de359e4 | Getter for <code>ehr.contribution_history.time_committed</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.7.3"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class ContributionHistoryRecord extends TableRecordImpl<ContributionHistoryRecord> implements Record13<UUID, UUID, ContributionDataType,... | 0 |
53cc94eafad1d3211ad9a62a1d7f8a06 | cb453ee7c5759e7d3b9259ff5c8af21d | 新建线程,在线程中进行备份操作 | class BACKUP():
#定义全局变量
def MultiBack(self):
dblist=self.getdb()
for db in dblist:
p = threading.Thread(target=self.Backup,args=(db,dblist,))
p.start() | 1 |
29df126ddded562e0bf084dfe2e8cdb6 | d83b8a165426955562a585eafb882c7a | return 0 if no gene pred or positive number to bump the score to favor parents with CDS annotation | CMappedFeat CGtfRecord::x_CdsFeatureToGeneParent(
const CMappedFeat& mapped_feat )
{
return feature::GetBestGeneForCds( mapped_feat, &FeatTree() );
} | 0 |
cf26899ba1b1096b1d737c734f483cf3 | 824d10f3a585418ecdd9306fcbf39f7d | フルーツリストを表示する | @Controller
@RequestMapping("/sample5")
public class Sample57Controller
@GetMapping("step7")
public String sample57(ModelMap model) {
final ArrayList<Fruit> fruits7 = shop57.syncShowFruitsList();
model.addAttribute("fruits7", fruits7);
return "sample57.html";
} | 1 |
d020028b82fba5c1f28ad164360ef964 | caedfa3994c34ef07cf7fec896827bc0 | Generate a 4x4 homogeneous transformation matrix from a 3D point and unit quaternion.
Input:
l -- tuple consisting of (stamp,tx,ty,tz,qx,qy,qz,qw) where
(tx,ty,tz) is the 3D position and (qx,qy,qz,qw) is the unit quaternion.
Output:
matrix -- 4x4 homogeneous transformation matrix | d = 7+9
q1 = self.q[d+0]; q2 = self.q[d+1]; q3 = self.q[d+2]
T01 = np.dot(Ttransl([-self.ltx, self.lty, -self.ltz]),
Trotx(q1))
T12 = Troty(q2)
T23 = np.dot(Ttransl([0., 0., -self.l1]),
Troty(q3))
T34 = Ttransl([0., 0., -self.l2])... | 0 |
b719a85d6df0537f9d5289842a222051 | 5468b111bd0bea7b04b9696d74ba2773 | 获取日期 yyyy-MM-dd HH:mm:ss | function getDatetime() {
return datetime(new Date(), 'yyyy-MM-dd HH:mm:ss')
} | 1 |
1b5a6d76534104127f6db9d8bae88f86 | a8071b1e35b5bf8947b5ea9e44ede6ac | Procesa de manera recursiva la estructura del árbol para preparar la estructura requerida por el visor XBRL | namespace AbaxXBRLCore.Viewer.Application.Service.Impl
public class XbrlViewerService : IXbrlViewerService
private void ProcesarNodoArbol(NodoLinkbase nodo, ArcoReferencia arco, IDictionary<string, ConceptoDto> conceptosPorId)
{
string idConcepto = nodo.Elemento.Id;
ConceptoDto conce... | 1 |
df3b92e1ba9ecb052e1c5f795e219ec7 | 15de9595c9b0ff4b20731546495e8589 | setRelay(state) | if status:
debug_print('Setting relay: ON ')
coopLightRelay.on()
else:
debug_print('Setting relay: OFF ')
coopLightRelay.off() | 1 |
ceb868d20b45fa2112b58e90de2bec87 | 9b21b886bbf79cbd5d44565a6e2f6681 | GET /:teacherID - Return a given teacher | {
$teacher = Teacher::find($id);
if ($teacher != null) {
return response(['data' => new TeacherResource($teacher), 'message' => 'Retrieved successfully'], 200);
} else {
return response([
'message' => 'No data found!',
], 403);
}
... | 1 |
17470ac1582fde0841d1dc6ebc6990fd | 0dea24ab692d2f698a0a898394152c27 | 向指定的handler发送延迟消息,传入what,arg1,arg2,obj | public class Handler
public final boolean sendEmptyMessage(int what)
{
return sendEmptyMessageDelayed(what, 0);
} | 0 |
d6d4bb69e65fbe1c2533e7249dfa3f42 | 1b3720fa3ccf58b34621b1b0b22075b6 | get scholarshiptype by ID
Get a scholarshiptype entity by ID | global $DB_DB;
$request = $DB_DB->prepare("SELECT * FROM SkillType WHERE idSkillType = :idSkillType");
try {
$request->execute(array(
'idSkillType' => $idSkillType
));
}
catch(Exception $e) {
if($DEBUG_MODE)
echo $e;
return -2;
}
return $request->fetchAll()[0];
} | 0 |
6e8586356cb25d6efd56035a8c997097 | e47c93f0505c00cdb2d93fe90655d221 | Starts the lathe spinning.
PARAMETERS
INPUT : none
OUTPUT : none.
SIDE EFFECTS: none | class Lauda(StandardDevice, IScannable):
def run(self):
self.lauda.put('WSTART', 1) | 1 |
60d48b74f922ee2f6f040417a7f53529 | 100dce9ed18c58dac5358fbaa04be045 | 如果程序运行在Linux OS上,则请优先考虑使用Epoll模型,其性能要高于JDK的NIO实现(摘自《Netty In Action》4.3.2) | @Slf4j
@Singleton
public class NettyServer implements TransportServer
private EventLoopGroup newEventLoopGroup() {
return Epoll.isAvailable() ? new EpollEventLoopGroup() : new NioEventLoopGroup();
} | 1 |
80272138171636cf86c7a09ebf73da60 | 3d4f09f84b331d32c3e9ff384f5b13e2 | Oculta la vista vista del login y muestra la vista del registro | onRegister(){
this.loginModel = false;
this.registerModel = true;
} | 1 |
d90bc635103ecf8fb9804866971324b6 | 46623191af2aef7d36131f6b23c56fc2 | A default converter method that tries to deserialize objects. | result = null;
var i = 0;
while (i < Converters.Count) {
if (Converters[i].TrySerialize(e, out result)) {
return true;
}
i++;
}
return false;
} | 0 |
c232dc3d725e0d8520a00ae30d17232b | b7ab193056afc594cd1aa943eec4115f | 逻辑与门电路 | s1 = NAND(x1,x2)
s2 = OR(x1,x2)
y = AND(s1,s2)
return y | 0 |
79e9b788de9a58f248213797b7803fc2 | 012b43c5388a9549cbf3ce2d23100c25 | 兑换鱼商店气泡动画 | void MixPowderScene::eggsAnimation(MySprite* _eggBowl ,MySprite* egg) {
egg->setCanDrag(true);
egg->addRange(bowlRect);
egg->setOnClick([=]{
handNotice->setPosition(mainBowl->getPositionX(), handNotice->getPositionY());
});
auto oldPosition = Vec2(egg->getPositionX(), egg->getPositionY()+150... | 0 |
e2230e610f6f6d48ee7aec870b03bcaa | 915188572e12e13baec076a55d5ed965 | Tests for nil "partNumber" element | namespace Microsoft.Research.Wwt.Excel.Common.Tests
[TestClass()]
public class WorkbookExtensionsTest
[TestMethod()]
public void GetCustomXmlPartTestNoParts()
{
InteropExcel.Application excelApp = new InteropExcel.Application();
try
{
Intero... | 0 |
902a9e63ccde78945579952a231d9fc4 | ec61f5eaa4615a2e42e5e4616c5d8661 | Set the total defence of the character | {
defTotal_ -= amount;
if (defTotal_ < 0) defTotal_ = 0;
} | 0 |
24f37ea02cf433f662bb103ed65036a5 | fbc7ed4c53ee81a935d0a6f141e0aed2 | Recupera o Id da rede/canal responsável pela série | public class SeriarAnuncioController
public int getIdSeriacao(int idAnuncio)throws SQLException{
return repositorioSeriacao.getProcessoSeriacaoByAnuncio(idAnuncio).getIdSeriacao();
} | 0 |
8313a97b32311f8b0a4c1a6bb6a57978 | d2e43d6bbf95115a7075d0c86481aedc | 在分布式环境中派生子任务 | @Slf4j
public abstract class AbsDistributeLockLua
public abstract void taskService() throws RTException; | 0 |
3fc58392942a854fa9e987c170b0e77f | ce43e64869ce8fad6040465c4b40fa1e | 查询分时交易额 | namespace LooWooTech.AssetsTrade.TradeApi
internal static class TdxTradeApi
[DllImport("TdxTrade.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void QueryHistoryMoney(string start, string end, StringBuilder Result, StringBuilder ErrInfo); | 0 |
723a529b0b09a7ee7ad77c27cf45d1f2 | 64498308801844d4520bac4991e082e3 | 根据keeperId获取Keeper | MemberApplyDto getShopKeeperApplyByMemberId(String memberId); | 0 |
1597e91d5b53c69bee19e81951251f02 | 8ae26e0b39b0571423351e3d7e1616cc | Compares two records in serialized form. | if (Utils.isAvro14()) {
Assert.assertEquals(serialize(record1, COMPLICATE_SCHEMA), serialize(record2, COMPLICATE_SCHEMA));
} else {
Assert.assertEquals(record1, record2);
}
} | 1 |
0f28e32f2e6ab4a1529e00d4daebd5db | 5fe8b673dd84acf99979f0f419565399 | Formats print statements to update on same print line. | public abstract class Ui
String printFormatter(String printString) {
String output = addIndent() + addLine() + "\n";
String[] linesToPrint = printString.split("\n", 0);
for (int i = 0; i < linesToPrint.length; i++) {
output += (addIndent() + linesToPrint[i]) + "\n";
}
... | 0 |
b6623b638941ef3b3ed2973335b2299e | 1d27abe0860f2274733a1e28f2d50d97 | Return the number of unique elements. | namespace Org.Apache.Hadoop.Hdfs.Util
public class ReferenceCountMap<E>
where E : ReferenceCountMap.ReferenceCounter
public virtual int GetUniqueElementsSize()
{
return referenceMap.Count;
} | 1 |
65bf7f5a392786fe33db05f8aa650146 | ccd875e5b80c2d0a61f6d9618d5023aa | return whether all states are at least at the given one | {
return atLeastOne($haystack, static function (StateId $maybe) use ($needle) {
return $needle->equals($maybe);
});
} | 0 |
a9b76cf5ab9552e00ad090cbb54ab093 | 7d95a7fa4ad4801469ac27dbf1eee79b | Provides access to the Node Created event | class EwsNotificationType extends AbstractStructBase
public function getCreatedEvent(): ?\StructType\EwsBaseObjectChangedEventType
{
return isset($this->CreatedEvent) ? $this->CreatedEvent : null;
} | 1 |
ed3cdf7aa2ee0fe612af390ad469eb6e | ba9dd16a6d9e9cea92bc6a70dc267acf | 他の三角形と共有点を持つか。 | bool CMeshData::m_ChkTrianglesShareEdge (int* triIndex1, int* triIndex2, sx::vec<int,2>& edgeV)
{
bool ret = false;
for (int i = 0; i < 3; ++i) {
int v0 = triIndex1[i];
int v1 = triIndex1[(i + 1) % 3];
if (v0 > v1) std::swap(v0, v1);
for (int j = 0; j < 3; ++j) {
int v0_2 = triIndex2[j];
int v1_2 = triI... | 0 |
1549079aeaf587b9122f09277a0c23d2 | 68cd3278e85036937fafedb3cb4f4016 | Create a DATCOM file using current rocket's specifications | class GaussCom():
def write_com(self,directory='./'):
with open(directory + self.filename + '.com', 'w') as f:
if self.chk:
f.write('%chk={}\n'.format(self.chk))
f.write('%mem={}GB\n'.format(self.memory))
f.write('%nprocshared={}\n'.format(self.procs))
... | 0 |
d5d7920f7a2c383bbee20692e640a77d | 78ef8413ebef1769cc0a4aed7d47da2b | Converts a http response to a JSON object | public class TestUtils
public static JSONObject getJSONObject(HttpResponse httpResponse) throws Exception {
String entity = EntityUtils.toString(httpResponse.getEntity());
JSONObject jsonObject = new JSONObject(entity);
return jsonObject;
} | 1 |
625613acad586e027ace791d4ac18707 | 7152d564616495690ad2fa2d5e8e8768 | Calculates the mask required by `combineKernValue()` from coverage `flags`. | flags: List[str] = []
if self.rd.release_mode:
flags += "release"
if self.rd.coverage:
flags += "coverage"
flags.sort()
return ",".join(flags) | 0 |
3b4ad99c52f968ee92338c0353955676 | de81a70b582b43733eacf3d4f9209e33 | 异步根据角色名字判断上下文是否存在。 | {
try
{
return await this.container.Context.Characters
.AnyAsync(c => !c.HasRemoved && (c.Name == name || c.AliasId == aliasId));
}
catch (Exception ex)
{
this.container.Error(ex);
return default;
}
} | 1 |
9944b114ecbf4654c56ecc9e21c1d9ac | 41909953e8641e9119a0e29320123ae8 | Operations to restore objects in the dependency graph. | namespace com.mxgraph
void Restore(); | 1 |
ac1c032edf5eef559ee6deca68b0b0be | 7fb8e4ab40b2567f265ab45312e8f7bf | Get the full os-specific path to the spacemesh top-level data directory | {
return parent::exec('SELECT' . U32 . '@@datadir' . U32 . 'AS' . U32 . 'DATA_PATH', true)[0]['DATA_PATH'];
} | 1 |
5a1ef2cb3da4115a1ed273901cf5cc2c | 3b0622589f7ef899a4505d1e9b791949 | RESIZE IMAGE TO FIT TO SCREEN | primaryW=int(img.shape[1])
primaryH=int(img.shape[0])
coefW=0.6/(primaryW/WIDTH_SCREEN)
coefH=0.6/(primaryH/HEIGHT_SCREEN)
coef=max(coefH,coefW)
scale_percent = int(coef*100)
width = int(img.shape[1] * scale_percent / 100)
height = int(img.shape[0] * scale_percent / 100)
dim = (widt... | 1 |
5994fad93b77914ed682d6d9de5b4524 | 53f559176d82f677aa52f62f5379d0ec | Create the bottom side vertices | {
buffer.positions.push( x, this.maxCeilingHeight, y );
buffer.normals.push(0, 0, -1);
buffer.texcoords.push(0.75, 0);
buffer.positions.push( x, ceilingHeight, y );
buffer.normals.push(0, 0, -1);
buffer.texcoords.push(0.75, this.texcoordOne * (this.maxCeilingHeight - ceilingHeigh... | 0 |
c4b83ed0da2bcb09795e82845103165c | c64c9f74b351897da552796dfd726c37 | Finds tasks changes for task with specified id | {
$task = json_decode($request->task);
$result = Task::where([Task::ATTR_ID => $task->id]);
if (null === $result) {
return new Response('Task not found', 404);
}
return $result;
} | 0 |
7ba1e95c0c95981c77a4537bb2edb360 | 2c50251de70bcb1e825cf131a514830f | Maullar es algo de gatos, este comando envía una imagen aleatoria de un gato. | class api:
async def dog(self):
dog_api = "https://dog.ceo/api/breeds/image/random"
json_data = requests.get(dog_api).json()
dogimage = json_data['message']
await self.bot.say(dogimage) | 0 |
c5a5d0c77fe9cbb09af0d8bf0329ef98 | 7cda9104593992984e41c75f6643b979 | Show the popup to register a new wallet | def register_wallet():
parser = reqparse.RequestParser()
parser.add_argument('pub_key', type=str, required=True)
request_params = parser.parse_args()
result = get_or_create_wallet(request_params['pub_key'])
return jsonify(result) | 0 |
41f49863868154f0df92de3b0f1b835b | e7dc42322a743ff57260294e610df92c | Opens the log file in append mode | file, err := os.OpenFile("app.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Fatal(err)
return
}
defer file.Close()
log.SetOutput(file)
} | 1 |
c525afed60d13f0442f829a2c5e2c0e6 | 6bbd0a01ea46f029b1ade0af818fef3c | Check the parameters of a write instruction | {
if ((strcmp("ADD", $instruction[0]) == 0) || (strcmp("SUB", $instruction[0]) == 0) || (strcmp("MUL", $instruction[0]) == 0) || (strcmp("IDIV", $instruction[0]) == 0) )
{
if (($first_arg != "var") || ($sec_arg == "type") || ($sec_arg == "label") || ($th_arg == "type") || ($th_arg == "label"))
{
Err()... | 0 |
c1beb8b9e9036163628455eb32ba5a0f | 55997a2d92a1659f2169e0f5b8ebc4f3 | 提交窗体 | namespace HAMS.Student.StudentView
public partial class StuSubmitHomework : Window
private void homeworkManagement_Click(object sender, RoutedEventArgs e)
{
if (true)
{
StudentMainForm smf = new StudentMainForm(account,name,pngfile);
smf.pngfile = this... | 0 |
585c4595ea792fb3ed9ae8c58af0fdd7 | b8ec3e50d7be7342106deeb9d3794b4a | 过滤特殊标签, 转换为全角 | class AboutModel extends Model{
protected function tag($value) {
return htmlspecialchars_decode($value);
} | 0 |
5bcb017d8167abcc974f34dfa9721b35 | 5e5b30080821a523fb68a112e22d4f1f | 如果不显示ppt 不触发此功能 | if (tag === 2 && isFirstClick_no1ppt === 0) {
getNo1PPT();
isFirstClick_no1ppt++;
} else if (tag === 3 && isFirstClick_poippt === 0) {
isFirstClick_poippt++;
}
} | 0 |
edc5a859614f2b7577e0f351ebb44ff4 | 264ba99a2e08a4fc65639685beaad36e | Populate the data grid with information sorted by engines' power in descending order | function setEngineStatusData(engineStatusData) {
var tableId = config.engineStatus.tableId;
var headers = config.engineStatus.headers.map(function(a) {
return a.id;
});
for(var esd in engineStatusData) {
var id = tableId + "_" + engineStatusData[esd].id;
var existingTable = undefined;
for(var est in this.en... | 0 |
1b8bc3945e3f30caffdac799fd34c713 | 5d95f65160fdbeb09623c1785db071b2 | 获取产品已预订的总数 | $sql = "SELECT COUNT(*) AS p_number FROM EZ_PRODUCT WHERE enterprise_id =? AND status = ?";
return $this->get_db()->fetchOne($sql,array($id, Model_Product::STATUS_ENABLE));
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.