query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
57e07278a9990a094b18675d803266a8 | 2f578a5c57f9ed91b12b64d40dbcd9fb | Method to get a hashed user agent string that does not include browser version.
Used when frequent version changes cause problems. | product = "ec2-halo-delta"
version = cls.get_product_version()
ua_string = product + "/" + version
return ua_string | 0 |
f85b20e12d5059adf72beab29d3046c0 | 436964c787dd51aa49f208f60581159b | 1. Phase im Verwebungsprozess:
Verwebt eine Aspektclasse auf dem kompletten Typen
Hier wird noch kein Code erzeugt | {
if (isCreated) return;
isCreated = true;
gameEClass = createEClass(GAME);
createEReference(gameEClass, GAME__PHASES);
phaseEClass = createEClass(PHASE);
createEAttribute(phaseEClass, PHASE__PHASE_NUMBER);
createEReference(phaseEClass, PHASE__PHASE_TYPE);
createEAttribute(phaseEClass,... | 0 |
df27587adb76c964a997cb4c564823a1 | ee17a1efd06c76180a985b693dc06db6 | Extracts the relevant bits and sets them in the Single Data Trans struct | {
assert(buffer);
getTime1(buffer, d);
getTime2(buffer+21, d);
d->status.low_alarm=ds1921temp_convert_out(buffer[11]);
d->status.high_alarm=ds1921temp_convert_out(buffer[12]);
d->status.sample_rate=buffer[13];
d->status.control=buffer[14];
d->status.mission_delay=(buffer[19]<<8)|(buffer[... | 1 |
7eaf15fe2e28c3300f31d7bd1f26f825 | 4236c46484ec6b74da84ef926c251e87 | # 啃咬 | if (plunderimg == "none") {
plunderimg = ICON_NOPLUNDEREQUIP;
plundername = TxtNoJunk[lang];
}
var size = big?"":"16";
ShowImg('PBBACK', '/stock/plunder/', plunderimg, plundername, size, size, (oldVersion?7:2), (oldVersion?23:16), 10, 'actplunder');
} | 0 |
a469251a45b5ebb74167ae81a71168c4 | 5a7d319882e754bd4482065bbe77b507 | @brief Register callbacks with the pm framework. | int *num_callbacks,
powermgmt_callback *c) {
#ifdef DEBUG
char buf[64];
snprintf(buf, 64, "[DBG] Registering power callback with address %p\r\n", c);
uart_sendmsg(DBG_UART, buf, 64);
#endif
if (*num_callbacks == POWER_MAX_CALLBACKS) {
#ifdef DEBUG
... | 1 |
3fbf48761b8f34f1aa7929103bf0351e | 29644d6b900e73f00510a3f3a9d50a96 | Sets the value of the '{@link com.bos.utp.dataset.privilege.OmPartyrole#getPartytype <em>Partytype</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "STREventDocumentMap", propOrder = {
"addressee",
"partyRole",
"attachment",
"orchestrationStep",
"produceOnRelease",
"produceOnInput",
"archiveInstant",
"isAPIDocument",
"useEventTransferMethod",
"sendByGatewayOnRelease",
... | 0 |
3adb679d2ba370ced0aead40b0f7aa5f | a10174862a8a794c8cf8617fa1ba9be9 | Returns the boundary operator matrix for the simplicial complex scg
in dimension dim | class DiffOperators(object):
def project_edge_to_boundary_edge(self):
if self.dim == 1:
return None
is_b = np.r_[
make_boundary_bool(self.shape_edges_x, dir="yz"),
make_boundary_bool(self.shape_edges_y, dir="xz"),
]
if self.dim == 3:
is_b... | 1 |
12a7941b22cdb0868f533dd81fe3431c | f83cae759d1b42ec8a6db9133c53b9ac | Algorithm for finding an optimal policy by using Monte Carlo
control method | values = []
for i in range(25):
values.append(0)
delta = 10
actions = [0, 1, 2, 3]
while(delta > theta):
delta = 0
for s in range(25):
v = values[s]
temp = 0
if s != 24:
for a in actions:
temp += policy[s... | 0 |
0863bef2c73ff9e9330c27aac8d59808 | d7d862e0de7a4c5ec5c5e29693c67328 | Asigna el mal rollo al jugador, dándole valor a su atributo
pendingBadConsequence. | class Monster(DoorCard):
def bad_stuff(self, player):
pass | 0 |
d81672b02bb7ea710e3fd8019d87c378 | 0eceebf75716c865363d9fac4a6cca1e | Initializes an add-on from Heroku data. | dynos = dynos(heroku_application[:id])
heroku_application[:autoscaled] = false
heroku_application[:state] = application_state(heroku_application, dynos)
heroku_application[:instances] = application_instances(heroku_application[:id])
heroku_application[:active_... | 0 |
2b6bfbf1c2513b17f8e46697a4fd3a99 | 3d4511cd9924079227d6cc08ea4cb00b | requests posts from the server | console.log(reddit)
return dispatch => {
dispatch(requestPosts(reddit))
return fetch(`https://www.reddit.com/r/${reddit}.json`)
.then(response => response.json())
.then(json => dispatch(receivePosts(reddit, json)))
}
} | 1 |
31a6790aa688eaee39511913e324a0e9 | 82d803e7fe23aed3f8fa71d5408f0d5a | Cancels any existing yield check before beginning a new one. | {
if (YieldTcs.Complete())
{
ContinuationTcs = new Tcs();
return true;
}
return false;
} | 0 |
e5ff05215a29952f4a69033306278ca9 | c1fa2e1e340cef7dbf830c42acd176bd | Using the shapefile to link every tile with their neighbor tiles
Creates a dictionary that has index of tiles as keys and list of
indexes as values
Takes a long time to run, so output is written to memory for further use | for index, adjacents in enumerate(isadjacent(number), start = 1):
if start_tile not in check_list:
check_list.append(start_tile)
if adjacents in check_list:
continue
else:
check_list.append(adjacents)
current_string = [mapping[ii] for ii in check_list]
current_string = "".join(current_string... | 0 |
68f6a12d5ee3f028f841832538cfe173 | 70b7db159f0ee85d9c3897fa1890e9ae | 采用数组(邻接矩阵)表示法,构造无向图G | { int i,j;
G.vexnum=v;
G.arcnum=a;
for(i=0;i<G.vexnum;++i) G.vex[i].number=i;
G.vex[0].city="乌鲁木齐";
G.vex[1].city="西宁";
G.vex[2].city="兰州";
G.vex[3].city="呼和浩特";
G.vex[4].city="北京";
G.vex[5].city="天津";
G.vex[6].city="沈阳";
G.vex[7].city="长春";
G.vex[8].city="哈尔滨";
G.vex[9].city="大连";
G.vex[10].city="西安";
... | 1 |
640a553691f6ec0544987e77374c0916 | 3c52769c613d7a8c1a87fe05cc5fb1b9 | Add our custom success/error messaging query args to the removable list. | class MLAMediaModalExample
public static function mla_media_modal_query_custom_items( $wp_query_object, $request ) {
return $wp_query_object;
} | 0 |
38243ef03762a3fc5cb7b050c9fc9acb | 448d73648a3f1c1924d082989f62ff1d | Método para conectar con bbdd y ejecutar una query que muestre las asignaturas del profesor | List<AsignaturaProfesorDTO> lstResultado = new ArrayList<>();
Query nquery = em.createNamedQuery("AsignaturaByProfesor");
nquery.setParameter("idProfesor", idProfesor);
List<Asignatura> resultado = nquery.getResultList();
for(Asignatura ires : resultado) {
lstResultado.add(new AsignaturaProfesorDTO(
... | 1 |
9f2dc39b19067575990d7afbfa95dbd5 | a67c03d0304ff5a97d05fa42694ef439 | This method returns all questions based on the activity Type, Name and Behaviour mode. | @Service
public class QuestionService
public ArrayList<Question> getQuestion(int type)
{
return questionRepository.findAllByType(type);
} | 0 |
e69f8bd8465fe19ad6233ef3205b3832 | 4dbd282c14167f9c3b36c892a4113468 | Retrieve inventory utilizing OpenStackSDK. | self.manila_sentry = self.d.sentry['manila'][0]
self.manila_generic_sentry = self.d.sentry['manila-generic'][0]
self.percona_cluster_sentry = self.d.sentry['percona-cluster'][0]
self.keystone_sentry = self.d.sentry['keystone'][0]
self.rabbitmq_sentry = self.d.sentry['rabbitmq-ser... | 0 |
20b7d212c518cd4d88f85511dce0c0d9 | 0ffa8f986035b4da5c369681f2260f14 | Retrieve all trucks. | namespace Truck.Core.Interfaces
Task<IEnumerable<Entities.Truck>> GetAllTrucksAsync(); | 1 |
e193ce1b0902613a24db4ec5b8e12c64 | fde92bced1afc01b1b241a54c2f79ad5 | フェードアウト中か返す | TRI_CORE_NS_BEGIN
///
/// フェードレイヤー
class FadeLayer
: public LayerBase
bool Director::isFadeInEnd() {
return fade_layer_->isFadeInEnd();
} | 0 |
b4c7cc703b3ff7ed579c49a949f1fabb | 0384d9ae684377d42fb959cbce29d57c | 根据索引值下载书;
如果索引值超出bookArr的个数时结束; | index--;
if (index < 0) { index = 4; }
curImgSrc = "images/" + aryBookSrc[index];
curBook = aryBookName[index];
$("#bookpic").attr("src", curImgSrc);
$("#bookname").text(curBook);
} | 0 |
0faae164d03236d663b70dd4a2b1e35c | c862dd44c658bcaebcc63e36df16577d | Pull a message from the queue if it matches the message text given(dequeues message pulled) | {
if (await theQueue.ExistsAsync())
{
CloudQueueMessage retrievedMessage = await theQueue.GetMessageAsync();
if (retrievedMessage != null)
{
string theMessage = retrievedMessage.AsString;
await theQue... | 0 |
f5dae4c321d67d7a9b442ca1879773c8 | 6fbf41e4591b04b12c272ea88332a685 | Makes possible to use objects as dictionary key | class Person:
def __hash__(self):
return hash(self.name) | 1 |
8c2f238cc39dd0e40d75e0e9f3424d39 | 540e6d78360fda626a77422375a9889a | Returns the FQN of the Java enum constant. | public String getReferenceName() {
return enumConstant.getReferenceName();
} | 0 |
340728ca654400daace64f272612c45e | 3e000ddc9445f7f372f7586d3579b37f | Turn off aerator. | class MiotClimate(ToggleableMiotDevice, ClimateEntity):
async def async_turn_aux_heat_off(self):
self._aux = False
self.async_write_ha_state() | 0 |
54605d9ff1fdcf80fb7c74121408b2e4 | 10f88bba4ff31edb993be0e65cd8de89 | Fires the blur after clicking enter on the keyboard | export class JbhTypeaheadComponent implements OnInit, ControlValueAccessor
public blurInputElement() {
if (this.inputElement && this.inputElement.nativeElement) {
this.inputElement.nativeElement.blur();
}
} | 0 |
e641e4755dc41d6cef5a83a6c3d89830 | 00a256ab945b5e1fabfbe4ccd64ab446 | Cycle color backwards | def rainbowCycle():
j=0
while True:
j=(j+1)
for i in range(tails.numPixels()):
tails.setPixelColor(i, wheel((int(i * 256 / tails.numPixels()) + j) & 255))
tails.show()
if r.proc["cycle_tails"].die: return
time.sleep(4*(1/conf.speed)) | 0 |
d9937cf3722f2428f6fa6efaa4d1a6a0 | 847555f5ad748f209e736e1635552f9f | NewUint8Setting creates a Uint8Setting with the given default value. | gen := &Uint8{
numbers: make([]uint8, common.PageSizeInBytes),
}
gen.Reinitialize()
return gen
} | 0 |
bbd207244cbb413b145a8268dca66233 | 045757c56d6b8f9030dae16c2edf2715 | Removes all expressions from the collection. | public function clear()
{
$this->_expressions = [];
return $this;
} | 1 |
c82dc1e5f2b466e937f5b380857d8c8f | 74c20f422d5a189985ca829db1cb29f8 | 删除目录(支持删除多级目录) | String dirNames = dirName;
if (!dirNames.endsWith(File.separator)) {
dirNames = dirNames + File.separator;
}
File dirFile = new File(dirNames);
if (!dirFile.exists() || !dirFile.isDirectory()) {
log.debug(dirNames + " 目录不存在!");
return true;
}
boolean flag = true;
File[] files = dirFile.listFile... | 1 |
e8d1e945b2701bcc8e436d8d07336157 | a2fba5e7d1642764d7b0c9bc37d9388b | Indicates if the value is valid HTTP header value. | class UHeader
static function isValidValue($value)
{
$value = (string) $value;
if (preg_match("#(?:(?:(?<!\r)\n)|(?:\r(?!\n))|(?:\r\n(?![ \t])))#", $value))
VOID;
$length = strlen($value);
for ($i = 0; $i < $length; $i += 1) {
$ascii = ord($value[$i]);
... | 1 |
3e443052bded22f9e71239eebe949002 | 0fcb2b231174c4d0e50a70cc8be6aa5e | Generate hash (used as container ID) | class MY_Session extends CI_Session
private function generateHash() {
return sha1(uniqid(microtime() . $this->CI->input->ip_address(), true));
} | 1 |
b5067df472f66124cba8c5c9c132b4e4 | ea31317ec857775274690485e562e892 | Generic download function, given a job id and the file to be downloaded. | def download_job_files(id, filename=None):
try:
job = Job.get_by_id(id)
except NotAuthorizedError:
return Response(status=401)
path = job.path
path, job_directory = os.path.split(path)
if filename is None:
tmpdir = tempfile.mkdtemp()
tmpzip = os.path.join(tmpdir, job_... | 1 |
2cd4ec6e22cd9766187440e12ee10545 | eea5588e9a571d570db4b3751f2d1791 | Main loop of the SAL application. | SDL_Event event;
bool quit = 0;
struct timeval time;
gettimeofday(&time, NULL);
long usec = time.tv_usec;
while ( quit == 0 ) {
while ( SDL_PollEvent( &event ) ) {
switch (event.type) {
case SDL_QUIT:
quit = 1;
break;
case SDL_VIDEORESIZE:
event_resize... | 1 |
7a1b80589fed30aebeaed39fd6c97ecb | 0eff0409c25ba1a25b3abd56cdb8a0a6 | Attempt to read metadata to determine whether instance config exists | if (not os.path.isfile(self.metapath)):
print('no file found')
self.valid=False
self.create_metadata()
else:
f = open(self.metapath,'r')
obj = json.loads(f.read())
assert self.name == obj["filename"]
self.times = obj["ti... | 1 |
e363968ed0578bef97cdaaf672567b90 | f2670d6ae522a3c98043c71829168f31 | Remove all of the indicated <see cref="T:Quartz.ITrigger"/>s from the scheduler. | namespace BlackCat.Win32.TaskScheduler
public class TriggerList : IList, IDisposable
public void Clear()
{
for (int i = Count - 1; i >= 0; i--)
{
RemoveAt(i);
}
} | 0 |
a48e8905c2093c37e433bb1220d8ffb3 | 167db6f2ce9ea74df1e3e7cbeca89d7c | check that all input tensors match in size | mask_keys = list(self.mask_dict.keys())
for name in mask_keys:
mask_size = self.mask_dict[name].size(name)
try:
data_size = self.tensor.size(name)
assert mask_size == data_size
except RuntimeError:
del self.mask_dict[nam... | 1 |
368b8f5acebb1bec0a6d310448db90eb | bd9f21c69c676b8e62f25b4e12e3ea0e | Normalize ranked values, bounded [0, 1] | v = torch.abs(module.ranking)
v = v / torch.sqrt(torch.sum(v * v))
module.ranking = v | 0 |
c4bf398224265f4b4e85a4e53d2edb8e | 2a92850f1e093064abece2e384e01a0e | 顯示msg select dialog | public class Dialog
public static android.app.Dialog showSelectDialog(Context context, String title, String toast, final DialogClickListener dialogClickListener) {
return ShowDialog(context, title, toast, dialogClickListener, SELECT_DIALOG);
} | 1 |
ab9bad81a6edfd57dd8d2940802db913 | 974544b60a401d35f247ce9b84c3bd01 | Updates a resource to the database. | class ResourceController extends Controller implements ResourceControllerContract
public function update(UpdateRequestContract $request, UpdateResponseContract $response): UpdateResponseContract
{
return $response;
} | 0 |
1736cc655a051bd63a3c07e355786156 | 594b78be5f77262ee78a8149e83bf469 | Multiline Table | global $NDK,$func;
$out = "";
$numcol = count($table['title']);
$rowfield = array();
$rowalign = array();
$rowextra = array();
$out .= $NDK->skin->Table_Top($table['name'],$numcol);
$out .= "<tr>";
while( list($k, $v) = each($table['title']) ){
$rowfield[]=$k;
$tittle_arr = explode("|",$v);
$title ... | 0 |
60ed0c7cfb7994087b1e55d5aeb5f6dd | 05911f4aa9943cfb2a438d25654bb042 | @brief finds what color the diffuse and ambient component should be at a point. | {
float alpha2_sum = 0.0f;
float beta2_sum = 0.0f;
float alphabeta_sum = 0.0f;
Vector3 alphax_sum(0.0f);
Vector3 betax_sum(0.0f);
for (int i = 0; i < count; i++)
{
const uint bits = indices >> (2 * i);
float beta = float(bits & 1);
if (bits & 2) beta = (1 + beta) / 3.... | 1 |
22f79cfc67fd6039297d6c295d06cd2f | c1cc52c223b0023a16407fa00d2ebd17 | 先删除字典项 | if (!this.currentNodeEvent) {
this.message.warning('请先选择一个节点');
return;
}
const dictItem: DictItem = new DictItem();
console.log('等级', this.currentNodeEvent.node.level);
dictItem.parentKey = this.currentNodeEvent.node.key;
dictItem.id = '1';
dictItem.itemKey = '';
dictItem.it... | 0 |
e973a873719916c054930da669b5cf76 | 8c61a5221964f8cb14044c40342153fd | calculate polygon outline of MODIS land tile in sinusoidal coordinates | def createFootprint(pathname):
with rasterio.open(pathname) as r:
T0 = r.transform
p1 = Proj(r.crs)
A = r.read(1)
cols, rows = np.meshgrid(np.arange(A.shape[1]), np.arange(A.shape[0]))
T1 = T0 * Affine.translation(0.5, 0.5)
rc2en = lambda r, c: (c, r) * T1
eastings, north... | 0 |
1f68570b3ba1e151c85d386ada03dd90 | 68997f598251b92a1a2a5e2477d2141e | hien thi giao dien chinh sua thong tin cua 1 khach san | @Controller
@RequestMapping("/admin")
public class AdminController
@GetMapping("chinhsuanhahangchuquan/{idkhachhang}")
public ModelAndView ChinhSuaQuyenNhaHangChuQuan(@PathVariable int idkhachhang){
NhaHangChuQuanModel nhahang= nhcqr.findById(idkhachhang).get();
ModelAndView mv = new ModelAndView("/admin/ChinhSuaN... | 1 |
152111b6a6a5c03bcf20718a58205f87 | 2ca2edd7824ddf9195f7951177e7f3f6 | Format bools for metadata output | def format_bool(bool):
if bool:
return 'true'
else:
return 'false' | 1 |
e16c98f1f6ac213042f2d8d0c79cbf0e | 26d25effe93c1b5d2f64e9b6c5d8a11b | Удаляет из отряда юниты, чей показатель здоровья равен нулю. | public class Turret : MonoBehaviour
void updateEnemys()
{
List<int> emptyIndex = new List<int>();
for (int i = 0; i < enemys.Count; ++i)
{
if (enemys[i] == null)
{
emptyIndex.Add(i);
}
}
for (int i = 0; i < emptyIndex.Count;... | 0 |
1d456830da033fde0677227959619801 | 726edd18e26e5eef042ddb343bed02dc | 重新认证以后的回调方法 | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (ssoHandler!=null){
ssoHandler.authorizeCallBack(requestCode,resultCode,data);
}
} | 1 |
1f44c136080bb18d82f1f993ac7749fb | c9f32f01a77f79e8d069501eaa53ceb1 | 只取 https 的 ip | func filterHttp(url []string) []string {
supplierChannel := make(chan string)
filterChannel := make(chan string)
go func() {
for _, v := range url {
supplierChannel <- v
}
close(supplierChannel)
}()
go func() {
for url := range supplierChannel {
if isHttp(url) {
filterChannel <- url
}
}
cl... | 0 |
dcef17f67d3c27720208a0b3c8dec05b | 18a6a1c8a8389cf3ca2d9efbbf1225ba | 维护监控项:删除tcpinfo时触发此函数 | monitoritems = MonitorItem.objects.filter(var_name__iexact=var_name, app_id=tcpinfo.app.id)
if monitoritems:
monitoritems.delete()
else:
return
sync_monitor_point(tcpinfo.app)
sync_app_mitem(tcpinfo.app) | 1 |
9ab071249f8968ad09bf8bc155824e38 | e37cf7356f0463d4baa79b3e7fe33263 | Return div_class attribute if it is set | if ( ! empty( $this->classes ) ) {
$string = 'class="' . esc_attr( implode( ' ', $this->classes ) ) . '"';
return $string;
}
} | 1 |
35a98bd7ef8219cbd06af9c32a0507e5 | 9d964f9e9499d7c1443b5d10a23a61dd | Gradient for BatchMatrixInverse. | a = op.inputs[0]
c = op.outputs[0]
a_adj_inv = linalg_ops.matrix_inverse(a, adjoint=True)
return grad * c * a_adj_inv | 1 |
d7d36757dd398c66d72f1dce640f7357 | ff287a8a9cb69525c547500a75be4c25 | Set default project for current user | public class GlobalSettingsManager
public String getDefaultProject() {
return userManager.getDefaultProject();
} | 0 |
730a4bc08f48bc4034e0055e76a86f94 | 4869d2a5193ed85b021eb9c9ec5a69db | This method is called when the statistic button of all categories was clicked | statisticIndex = (statisticIndex-1+statistics.size())%(statistics.size());
while (statisticsPanel.statisticUsed(this, statisticIndex)) {
statisticIndex = (statisticIndex-1+statistics.size())%(statistics.size());
}
setStatistic();
} | 0 |
6022b533ba9ded469a3607acbccb10b0 | 0f1800a57bd70744d069708c501a8b30 | создание кнопок со зданиями конкретной улицы | for(var i=0;i<data_routes.length;i++)
{
var ix=i+1;
$('#buttoms').append($('<button onclick=\"Click('+i+')\">Маршрут '+ix+'</button><br>'));
}
} | 0 |
f42d6f0c83f0432b5eea840d544ea31f | b8550f22cbb280ac0d96d8571facdf95 | Generate groups ``user`` is member of, according to ``config`` | {
$groups = $this->generateGroups($entitiesConfig);
$normalizedGroups = $this->normalizeGroups(array_values($groups));
$this->writer
->setFilename(sprintf(
'%s%s%s',
$globalConfig['output_dir'],
DIRECTORY_SEPARATOR,
... | 1 |
cc1e865ec8ee2ed4b660812725d9b565 | 42ed7711408dd8ba7727fabf7b352e22 | -- BUILDER | class Director
public function builder(BuilderInterface $builder)
{
$builder->createVehicle();
$builder->addDoors();
$builder->addEngine();
$builder->addWheel();
return $builder->getVehicle();
} | 1 |
cbaf29abe553bbc712733b0119b4f727 | 7b00317bf93216986ca8af8fbb65f536 | get the stepper position for the backward/rear end stop | int DBW_Ctrl::get_steer_encoder_pos(void)
{
return cSSI.mu_motrona_enc_pos_read();
} | 0 |
f2abec953970e6090a8fa7970597f984 | ea84cdd73f09a6db80d8545734083864 | Sets the base ACL provider. | public void setAclDAO(AccessControlListDAO aclDAO); | 1 |
3638f37a17adc05c29d583eb577711ba | 90fe719aebc8dff55ceadcb229332af7 | save products associated with this manufacturer | {
$condition = $this->_getWriteAdapter()->quoteInto('manufacturer_id = ?', $object->getId());
$this->_getWriteAdapter()->delete($this->getTable('mybrand/manufacturer_product'), $condition);
foreach((array)$object->getData('product') as $productArray) {
$productArray['manufacturer... | 1 |
8d759f29148f6868561e376658bbec25 | 9a63c77fe0ddb898b84aab975b79fa54 | Handler for context menu's Add Image menu item clicked event | {
Debug.Assert(this.SelectedEntry != null, "There must be a selectd entry when modifying photo.");
if (this.SelectedEntry.PhotoPath != null)
{
this.contextMenuStripPhotoWithPhoto.Show(
this.buttonPhoto, new Point(), ToolStripDropDownDirecti... | 0 |
9b03dc3beabdf38e6e21ea291b6f8e04 | fef68da3a3ea0077fee67684b7ad5764 | #' @return file names with new extensions | file_extension <- function(file_type){
data.table::fcase(file_type %in% c("rmdformats", "prettydoc", "bookdown",
"ioslides", "tufte_html", "xaringan", "rolldown", "flexdashboard",
"slidy_presentation", "html_document", "html_notebook", "pagedow... | 1 |
cccb21893674d53d7b578eb39fa7a7ea | 1b9624f106b25dcf0b10b1089f7719d3 | Get a valid image URL to use from BackOffice. | class BackendPhotogalleryModel
public static function getURLForImage($URL, $language, $id = null)
{
$URL = SpoonFilter::urlise((string) $URL);
$db = BackendModel::getContainer()->get('database');
if($id === null)
{
$number = (int) $db->getVar('SELECT COUNT(i.id)
FROM photogallery_sets_images_cont... | 1 |
845d9e84919aa62208595d8394e2a1f9 | 53b819522193804b67961769429a633e | 绑定任务到等待可读事件的socket队列上 | class EventLoop:
def _register_socket_to_read(self, sock, callback):
future = CustomFuture()
try:
self.selector.get_key(sock)
except KeyError:
sock.setblocking(False)
self.selector.register(sock, selectors.EVENT_READ, functools.partial(callback, future))
... | 1 |
ad6a2b736821fb6186a3233496e45170 | 8baf50b027d48e76bbb9dfb9fe9dbb26 | 포인트를 통한 레벨 가져오기 | class points_levelLogic{
public static function getPointsLevel($points) {
return self::$model->getPointsLevel($points);
} | 1 |
3dbbef90c7677fbfdd4ce3a8d52d051d | cc276bba702a550e24b64ce6f9848bbb | For a value of parameter lambda, compute the first derivative wrt lambda | def param_correction(lam):
dalpha = 5*lam
d2alpha = 0
return -d2alpha * dalpha**(-2) | 0 |
911cb18e47fadddb4de19d206b94e5f0 | 3952666ea47de8f1e7c1ceda45a2d818 | 学生个人中心通知公告列表 | [Authorize]
public Resp<PageList<StudentNoticeModel>> getStudentNoticeList(StudentNoticeSearch searchInfo)
{
try
{
if (CurrentUserContext.User == null)
{
return Resp<PageList<StudentNoticeModel>>.NoPermissions();
... | 1 |
204c20fd985401d46828d47dfa0d239d | 327968a5f76354b68664745c4fd4333c | Purge burn_in and correlated samples | class mcmc_logistic_reg:
def trim(self, burn_in):
start = 1 + round(burn_in * self.raw_beta_distr.shape[1] - 1)
self.beta_distr = self.raw_beta_distr[:, start:-1] | 1 |
dad9960b9fc6049d828302a096d4e5ee | 83ab8336088e904d6f73e93477557acc | version for just the knees | class dino():
def fkine(self, pos="Full"):
th = np.array([0., 0., self.th_fem[0], self.th_kne[0], self.th_ank[0], self.th_toe[0], 0.], dtype = float)
for i in range(0,th.size):
th[i] = th[i] *np.pi/180
c2 = np.cos(th[2])
s2 = np.sin(th[2])
c4 = np.cos(th[4])
... | 0 |
d3ef014c2730798829203482cf2b7577 | ad9a74d977aa1a9ac8e3f2a3b10ec1d7 | Returns queryset responsive to N terms provided as OR search | terms = SearchTerm.objects.filter(pk__in=[1, 2, 3])
accounts = Account.objects.filter(pk__in=[1, 2])
locations = Location.objects.filter(pk__in=[2, 3, 4, 5])
return ReservoirQuery(
searchterms=list(terms),
accounts=list(accounts),
locations=list(locati... | 0 |
c836eac7faf3e304ef1370090af69852 | 245784fba908b06f489518a363913767 | Checks if this range contains the given other range. | @Embeddable
@XmlRootElement
public class Range implements Comparable<Range>
public boolean overlapsWith(Range other) {
return getStart().compareTo(other.getEnd()) <= 0 && getEnd().compareTo(other.getStart()) >= 0;
} | 0 |
156765073eb279a76ff541b37bf6b9b2 | dc9682aff406946499397916f8b51f5e | Turn all or specified climate devices away mode on. | class Warmup(ClimateDevice):
def turn_away_mode_on(self):
self._away = True
self._device.set_location_to_frost() | 1 |
d10374d84a0986f460deb8674196073e | f8772ae264cf108a62c5758f7d785898 | 今年节假日旅游收入 | class IndexController extends Controller
public function eachyue()
{
$year = date('Y', time());
for ($i = 1; $i < 13; $i++) {
if ($i < 10) {
$map['ti_addtime'] = array("like", "%$year-0$i%");
} else {
$map['ti_addtime'] = array("like", "%$year-... | 0 |
5eeae718b022d76079880a7376f81c60 | 3101876c1c5caab226244a4e6b04e083 | Elimina todas los Instructor_Promocions | abstract class PromocionQuery extends ModelCriteria
public function doDeleteAll(ConnectionInterface $con = null)
{
if (null === $con) {
$con = Propel::getServiceContainer()->getWriteConnection(PromocionTableMap::DATABASE_NAME);
}
$affectedRows = 0;
try {
$con... | 0 |
96b88057372dacb7f95338f40e296393 | 3083b459d7b14ec3589ae94d2256b01a | 输入注册qq号(选填) | {
checkTel();
var qq = trim(jQuery('input[name=qq]').val());
if (qq == '') {
showMsg('qq', 'empty');
} else {
if (qq.length >= 2 && qq.length <= 13) {
showMsg('qq', 'right');
} else {
showMsg('qq', 'error');
}
}
} | 1 |
8c4ae2afb953e689b484d22af80e154f | aa8c5f27ec23d84e11c0aa227b1c895f | compute number of tokens with incorrect labels across all labelings | double mistakes = 0;
NOrderModel model = (NOrderModel) lattice.model;
int [] labels = model.getTruth(lattice.seq);
for (int pos = 0; pos < lattice.length(); pos++) {
int start = lattice.getEdgeOffset(pos);
int end = lattice.getEdgeOffset(pos+1);
double threshold = thresholds.length > 1 ? thresholds[pos... | 1 |
9cdf572a2ea95ce68fc04fcd976681d5 | 8bd5757540bab0e7040e733da4f89ec0 | Añadir centro de costos | {
using (RELOJBIOEntities wdb = new RELOJBIOEntities())
{
var ListCCosto = wdb.CostCenter.ToList();
return View(ListCCosto);
}
} | 0 |
c642064ea3b75092fc87e8d1651a017e | 885cb12d63f2dc9fe097fe8e7b8f7bec | Adds support for WordPress' "custom-header" feature. | add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 440, 138, true );
add_image_size( 'header-post-thumbnail', 1600, 9999 );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'bbpress' );
register_nav_menus( array( 'header-menu' => 'Header Menu' ) );
} | 0 |
0a76c644d9889908103108fd4842e82e | ce6ecd3602b5b4d093415c66534c334a | Функция, определяющая кол-во занятых мест в хранилище | namespace OOP6
public partial class Form1 : Form
class Storage
public int occupied(int size)
{
int count_occupied = 0;
for (int i = 0; i < size; ++i)
if (!check_empty(i))
++count_occupied;
return count_o... | 1 |
d3ff58218e8d442a2e345ca98ef7f831 | fece5e484ff401e65eed798c49d7e06c | 得到倒数第K个节点(新浪笔试题)
思路:先得到链表的长度,链表长度减K就是节点的位置。 | if(k < 0) {
return null;
}
ListNode fast = this.head;
ListNode slow = this.head;
while(k-1 > 0) {
if(fast.next != null) {
fast = fast.next;
k--;
}else{
System.out.println("该节点不存在!");
... | 0 |
787d580f6576fecef0488a15f179f5bb | 35657e9fa3ac3e2ebe2618ee1bf13f08 | RTS - return from subroutine | void chip8_subroutine_return(chip8_t* chip, opcode_params_t* params){
chip->pc = chip->stack[chip->sp];
--(chip->sp);
} | 1 |
1a9b0c50d0ddfd7fad51797f1916db7c | 14ca706384eb30763a5d94ade51c423d | Scales the size down by one step | public class MapEditor
public void decreaseGridScale() {
gridScaleIndex = Math.max(gridScaleIndex - 1, 0);
gridScale = GRID_SCALE_DATA[gridScaleIndex];
} | 1 |
5b9a095df252ffe842a023835b30523c | b5b55876ab998f05c00b9d870d5a94d8 | Creates a core network Connect attachment from a specified core network attachment.
<para>
A core network Connect attachment is a GRE-based tunnel attachment that you can use
to establish a connection between a core network and an appliance. A core network
Connect attachment uses an existing VPC attachment as the un... | namespace Amazon.NetworkManager
GetCoreNetworkResponse GetCoreNetwork(GetCoreNetworkRequest request); | 0 |
0774d49ddbcd99088788c274f3e7c2ba | eaecf0c2dc847c7bba945d5bcc1926f9 | <pre>
查询库区列表(用于新建及更新清仓任务界面)
1、新建任务时,获取本部门所有库区的情况
2、编辑和确认任务时,通过清仓任务ID获取库区信息
</pre> | List queryAreaList(); | 1 |
30e649f6430b5573ff9a29f69b3e771f | 16ff991317cee1b86509afce60b6cb15 | 180°以下の角が小さい方の角度を取得 | float tmpAngle = mAngle < 90 ? mAngle + 360 : mAngle;
float angleDiff = Math.abs(tmpAngle - 270);
return angleDiff;
} | 0 |
e1caf449eb334c1f42349cabf0136645 | 88c3db4f8957783d3baca0ddc748d565 | Flipped Horizontally | class ImageEditor:
#initialises the class, sets the width and shape
def flip_image_hor(self):
flip_hr = iaa.Fliplr(p=1.0)
flip_hr_image = flip_hr.augment_image(self.image_edit)
return flip_hr_image | 1 |
92565380c494e63c48fc0c507d1c9a0c | 8242ce439b3e83a61659f08a01280978 | User clicked on the button to view the attendance percentage data. | void navigateToAttendance(); | 1 |
35224c427444b3f93f276da7bc9e7eb0 | 8a377d3fc167364065f8ad8969576ae9 | The time the run was scheduled. | final class Cron extends Model
public function getScheduledAt(): string
{
return $this->scheduledAt;
} | 1 |
b5aafc90bb899f1d3be7a8a5ceca2c19 | 288dbe952548ae724c855a0ba04b7306 | Steigert die Kühlung | public class LogicManager : MonoBehaviour
public void AddCooling()
{
if (coolingAmount < coolingMaximum-5)
{
coolingAmount += addCoolingAmount;
}
else
{
coolingAmount = coolingMaximum;
}
} | 1 |
6f3e7c908dd3a2d34113b060a3dbd253 | 5658fb5723bc8715d1df8792a919e11e | When a user connects, adds that user to the USERS-map | public class WsPool
public static void addUser(String userName, WebSocket conn) {
wsUserMap.put(conn, userName);
} | 1 |
2cd3eaef7309445b9e702d47588ee470 | c165d8d38fd3a6a827f6ebd708e1a5dd | 插入多行,并复制指定行的内容 | namespace XYQ.Common.Office.Excel
public class ExcelOperate
public void InsertRow(int currRowIndex, int rowCount, bool isCopyRow)
{
Range currow = (Range)_sheet.Rows[currRowIndex, Missing.Value];
for (int i = 0; i < rowCount; i++)
{
if (isCopyRow)
... | 1 |
043e62619a1964a2a0849906974137c1 | b79960082527b1e5516cd36f58eda98a | calculates l_pq distance of the parameter matrix of a layer from the random initialization,
with an extra factor that depends on the number of hidden units. | n_clients, n_dims = pm.shape[0], pm.shape[1]
dm = np.zeros(shape=(n_clients, n_clients))
row_pm_matrix = np.repeat(pm[:,np.newaxis,:], n_clients, axis=1)
col_pm_matrix = np.tile(pm, (n_clients, 1, 1))
absdiff_pm_matrix = np.abs(col_pm_matrix - row_pm_matrix)
if correctio... | 0 |
ead991be6c346f2135cb50c9b6bf21a1 | cb5f757a649d9d6c62db17063d73e390 | 取消作业
该API用于取消已经提交的作业,若作业已经执行结束或失败则无法取消。
Please refer to HUAWEI cloud API Explorer for details. | class Client extends abstract_client_1.AbstractClient
async DeleteTask(req, cb) {
return this.request("DeleteTask", req, cb);
} | 1 |
703ffed96886f976e9a5b8a6e0a717e8 | 6a776168df79cd88223c582fa422b235 | @brief Removes a position from a cstring | {
size_t len = strlen(*str);
if (pos <= len)
{
for (int i = pos - 1; i < len; i++)
(*str)[i] = (*str)[i + 1];
(*str)[len] = '\0';
*str = realloc(*str, len);
}
} | 1 |
f9c7848bed7f77e3cbe3d99308e565bc | 6f21ea507113ff2147b3b2e716a444c1 | 提现查询 | {
$map = array();
$name = trim(input('get.name'));
if ($name) {
$res = $this->User->where('phone', 'like', "%$name%")->find();
if (!empty($res)) {
$map['uid'] = $res['id'];
} else {
$map = $this->query_time($map, input('get.... | 1 |
bc6545f6e1d0d7af8daf0624cd48b9f4 | ab69ab2348bbb12d6d5b6e7c773a6e8c | Set cursor streaming mode. | public class SignalDiagramModel
public void setCursorMode( final boolean aCursorMode )
{
if ( aCursorMode )
{
this.mode |= CURSORS_VISIBLE;
}
else
{
this.mode &= ~CURSORS_VISIBLE;
}
ICursorChangeListener[] listeners = this.eventListeners.getListeners( ICursorChangeListener.clas... | 0 |
ede68cf6df78d7c0be9a542dd86b1ee2 | 2bc1c687b634da4df1023162bf780c7a | !\brief Test of the HermitianMatrix assignment operators.
\exception std::runtime_error Error detected.
This function performs a test of all assignment operators of the HermitianMatrix specialization.
In case an error is detected, a \a std::runtime_error exception is thrown. | namespace blazetest namespace mathtest namespace uniformtensor
void ClassTest::testAssignment()
{
{
test_ = "Row-major UniformTensor homogeneous assignment";
blaze::UniformTensor<int> mat( 2UL, 3UL, 4UL );
mat = 2;
checkRows ( mat, 3UL );
checkColumns ( mat, 4UL );
checkPages... | 0 |
59e493f9d45fb484c574c4879b42df6c | fa14357436c88094afa20905e513fb27 | Tests whether frames are being placed into redis. | for request in context.requests:
battle_id = request['battleId']
raw_battle = redis.instance.get(battle_id)
battle = pickle.loads(raw_battle)
board = battle['board']['state']
entities = battle['entities']
robots_created = Counter(k['battleId'] for k in context.request... | 0 |
be3120968d169559ad8ad1ad4c687228 | 356d8415c030ed56e1fce50342c637af | 获取全部的小说章节名和地址列表 | headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8'
}
r = requests.get('https://bo... | 1 |
eb09ec7dda92cd9fe4410083463795b8 | 66d77fdf3ab9c8fba32c38bdcaaf0201 | Get data which had get outgoing result but not yet notify to supplier | public class SensorXMPPClient extends SensorClient
public List<String> getPendingData(String nodeID) {
if(this.rawPendingData.get(nodeID) == null)
return new ArrayList<String>(0);
List<String> newList = new ArrayList<String>(this.rawPendingData.get(nodeID).size());
newList.addAll(this.rawPendingData.get(nodeID... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.