query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
39a93fbf543ba0c64fa8ae565edb1a28 | 7365caee118f81eb08ec2e2851e03d28 | 通过car数组清理地图图层 | if(overMapLayer){
if(overMapLayer.gird){
overMapLayer.gird.clearGrid();
overMapLayer.gird.destroy();
overMapLayer.gird="";
}
if(overMapLayer.contour){
overMapLayer.contour .destroy();
overMapLayer... | 0 |
45458e1845d2eb4518b3064f5c30c300 | d7cb9600d5760ee89002dc5e25fd39ff | 演示通过completionService实现forking模式,冗余某个服务的多方调用,只要有一个正常返回,则返回 | public void testForkingPattern() throws InterruptedException {
ExecutorService pool = Executors.newFixedThreadPool(3);
ExecutorCompletionService<String> completionService = new ExecutorCompletionService<>(pool);
ArrayList<Future> futureList = new ArrayList<>();
Future<String> future0... | 1 |
2bb9225942155b1f86508b736f85833c | 2f985e2fce234042e98ad0f0ad111a54 | Scales the vector by a factor. | {
result = new OldVector2(value.X * scale, value.Y * scale);
} | 1 |
83cc821082017635476dd8f188ec7bb6 | 0b4652406d8d923f50cb2c328b753f12 | Função responsável por agrupar as alocações dos colaboradores: | positions = pd.DataFrame()
for cnpj,name in data.itertuples(index=False):
query = f"select c.name as company, m.name as employee, p.name as position\
from {schema}.positions p, {schema}.employees m, {schema}.companies c \
where m.name = '{name}' and m.company_cnpj= {cnpj} and c.cn... | 1 |
0e86d9ad219dbae1c358d675362ac02d | 923db4af5994118cd70c653f424cb97e | r"""Rate (/s) counter for camicrosoftsmoothstreamingvidcachebytes. | try :
return self._camicrosoftsmoothstreamingvidcachebytes
except Exception as e:
raise e | 0 |
6f82f69a527b2197bc786107876504c9 | 73e6ebb12e7aa771700e5bafb844a944 | Returns a tuple of predicted labels and confidence levels for those predictions | lower = self.clfl.predict(x )
upper = self.clfu.predict(x )
ret_val = np.zeros((len(lower),2))
ret_val[:,0] = lower
ret_val[:,1] = upper
return ret_val | 0 |
5a9f09a1ce4a59b5d1bd14290ddb2fbb | b7e75d3c3406d69a7fdd2158d8edf543 | 优先展示异常真实原因 | return function (val, m, record, rowIndex, colIndex, store, view) {
if (FastExt.Power.config) {
return val;
}
try {
if (Ext.isEmpty(val)) {
return FastExt.Renders.toEmptyTip();
... | 0 |
d6500a7ea4f1f6830d72d4bcdfa68e3a | f50ee877d6296d76481f6216bd187561 | 日期所在月的天数
如:“2011-02-02”所在2月份的天数为28天 | public class DateTimeUtil extends DateUtils
public static Integer getDaysOfMonth(String monthStr) {
String year = monthStr.split("-")[0],
month = monthStr.split("-")[1];
if ("02".equals(month)) {
Integer yearValue = Integer.parseInt(year);
if (isLeapYear(yearValue... | 1 |
b9165721a859c96ad6854dbb0a09dbe3 | 7be340eefcf2b933b4f75ea33bf8f500 | Create db command by configured command name. | namespace Eqi.Core.DataAccess
IDataCommand CreateDBCommand(string commandName); | 1 |
57558468addf1a49d283c6c47deb9bd7 | 7f61448ad6da3ef0f9cb03f40c5be655 | Copy from predict_1.py | cases like (1) | 0 |
f15057c2e882ffd9f4ad1778b4c8e75c | 9b685960e890fccd924798db599280f0 | Matches SMTP recipient of the incoming message against the regular expression pattern. | {
$event = $incomingMessage->getEvent();
if (!$event instanceof TextEvent) {
return true;
}
$pattern = '/^' . preg_replace(static::PATTERN, '(?<$1>.*)', $incomingMessage->getPattern()) . ' ?$/miu';
return (bool) preg_match($pattern, $event->base()->getText(), $thi... | 0 |
e52cd16d32dc7aa3995699bba9e58a05 | ed39f4924f20923eae77d08a3e0ffed5 | deallocate all the memory used for records | {
int i;
if (part_start!= NULL) delete[] part_start;
if (part_end != NULL) delete[] part_end;
if (xpt != NULL) delete[] xpt;
if (ypt != NULL) delete[] ypt;
if (iframe_pt != NULL) delete[] iframe_pt;
if (time_pt != NULL) delete[] time_pt;
if (flag_pt != NULL) delete[] flag_pt;
... | 1 |
5af40bfd44890442c93f6570671eb306 | c5b27e6e6b68a80f44f221634f987c60 | Get membership information for all group members | $ret = array();
$member = new Knowledgeroot_Db_GroupMember();
$select = $member->select();
$select->where('group_id = '.$this->id);
$rows = $member->fetchAll($select);
foreach($rows as $value) {
if($value->member_type == 'user')
$ret[] = new Knowledgeroot_User($value->id);
else
$ret[] = new Knowledg... | 1 |
9d01afab60456b67e9a095736620411a | 453c34a65e468812c7cc49f51550de79 | Load contents of a binary file to specific memory region on the target | export class DzrpRemote extends RemoteBase
protected async loadObj(filePath: string, startAddress: number): Promise<void> {
const objBuffer = fs.readFileSync(filePath);
await this.sendDzrpCmdWriteMem(startAddress, objBuffer);
} | 1 |
eb3b120a96924dd8f9b649ab804255b0 | d83399979ad5de5af3fa37192de6b81e | Publishes a message to the event aggregator telling all subscribers to save the solution. | namespace SkyrimCompileHelper.ViewModels
[ImplementPropertyChanged]
public class ConfigurationViewModel
public void SaveSolution()
{
this.eventAggregator.Publish(new SaveSolutionEvenHandle(), action => { Task.Factory.StartNew(action); });
} | 1 |
341608ebba6ebb98b4154e516fe5cb63 | d8a1ee550cbe823ce3ede075b5f4d7fd | split the sentences into words | def sentence_splitter(par):
sents = SentenceSplitter.split(par)
return list(sents) | 0 |
97ecd90d65988015fbf4aa279879d25c | 9ff93808044107f8c5da25ae772abc86 | Returns True if augmentation is currently enabled, see setter | class AmpScaler:
def is_enable(self):
return self._enable | 1 |
2d0237eb84c473b358d88c15350c603c | 1d48b5fd9722a83edfd7ae95eb8aed16 | Requests in-app purchases details for currently owned items bought within your app. Only
non-consumed one-time purchases are returned.
callback with the list of purchases and the success flag. | namespace Google.Apis.AndroidPublisher.v1_1
public class InapppurchasesResource
public virtual GetRequest Get(string packageName, string productId, string token)
{
return new GetRequest(service, packageName, productId, token);
} | 0 |
9c607c0bcf56dff29579092ab3bf580d | 1b9d2ccc72098602b28f67dfee23e559 | 获得闪避率 | public class ObjLife : MonoBehaviour
public int GetDodge()
{
return objLifeData.GetDodge();
} | 1 |
2a2756f3385b39c6929973d1cb08d972 | e0f11d81441632412955233bdb49f878 | Constructor for UNet class. | class Unet():
def __init__(self, rowImg, colImg, nChannels):
self.rowImg = rowImg
self.colImg = colImg
self.nChannels = nChannels | 1 |
75915695e6deb016f8a3230c7d4cc431 | 8928b1f64675593dca7033fe4bbe0605 | 敵の名前で検索 | public class CharacterManager : MonoBehaviour
public string GetNameByNameE(string cNameE)
{
return apCharacter.cps.GetRowsByNameAndValue("cNameE", cNameE)[0][1];
} | 1 |
830be2fcf1c1730dfcc11f3beb64626b | ec290e3b89777bae2aeff45550e00806 | like Json.NET | {
const string pattern2 = ",\"[^\"]+\":null";
entity = Regex.Replace(entity, pattern2, string.Empty, RegexOptions.IgnoreCase);
return (T) JsonConvert.DeserializeObject(entity, typeof (T));
} | 1 |
053b340165c211f55d70295641f8aaec | 75a3d0a510e06b7633d6c8069d70b039 | Get First Object, Null if not found | class FormElements extends FormElement implements Iterator
public function getFirst($returnNullObject = false) {
if (!$this->elements) return ($returnNullObject) ? new NULLobject() : null;
$this->rewind();
return $this->current();
} | 1 |
c95b26a1f7ed5bb72d0fea410929b79c | 12db6aba136a3e06ada2f2ef5d4f871d | Private slot to handle a change of the state of the authentication
group. | class NetworkSettings(QtGui.QDialog):
def on_auth_released(self):
disable = not self.auth.isChecked()
self.username.setDisabled(disable)
self.password.setDisabled(disable) | 1 |
29f581d1805a888abaf57710d8fb41aa | 83cccf6633bf4e862f9f216b1a7a4967 | Create spinner with list of students. | Thread t = new Thread() {
public void run() {
if (stdList != null) {
Group g = (Group) grpList.getSelectedValue();
int y = ((SpinnerNumberModel) spYear.getModel())
.getNumber().intValue();
try {
... | 0 |
1a5afbf3791ae75fc330449688f06bdf | b753dc14c852ef7de91575f699f0a8dc | Delete files marked for deletion from a target directory using a JSON file generated by the find duplicates command
The de-duplication JSON can be auto-deleted post de-duplication with the flag 'args.del_json | duplicatesDirectoryPath = directoryPath + "/Duplicates"
total_nb = len(os.listdir(duplicatesDirectoryPath))
pdfsWhichNeedAction = FindDuplicatesToDelete(duplicatesDirectoryPath, pdfTypes)
pdfsToDelete = pdfsWhichNeedAction[0]
uniquePdfs = pdfsWhichNeedAction[1]
for pdf in uniquePdfs:
os.... | 0 |
928b82e2814744bd9bedbb1264775b78 | d4c6cd5e3d953e45e390f213c6afffe4 | 카테고리 셀렉트박스 초기화 | $.ajax({
url : SERVER_URL,
type : "GET",
data : {method : "get.category.list"},
dataType : "json",
timeout : 10000,
success : function(json) {
for (var i = 0; i < json.length; ++i) {
$("#Select_Category").append("<option value = " + json[i... | 0 |
31fa1b2a826304dcc7f07bbac97f24a0 | 3cc21397118bc041d7a619b5911b4997 | 设置 每手止盈金额(原币种) | public class ImFeeFymx extends PageQuery
public void setZkbl(BigDecimal value) {
this.zkbl = value;
} | 0 |
4b23e8f2d405c4999d7ce754594bfd99 | b5fec6b9bea3b8d0d3564c1c000207f0 | Function to load images from a directory of files | def loadImgs(adir):
fnames = utils.getFileNames(adir)
imgs = []
for fname in fnames:
img = tr.loadImage(fname)
imgs.append(img)
log.debug("%d imgs." % (len(imgs)))
return imgs | 1 |
d8e8548e9ee8562165c11b9033ae88ae | 104b4faa2069852b5c4d2111b2a6544f | 由编辑区的输入获得DomainObject | {
String xml = DSLUtil.parseVariableDomain(element);
if(xml == null || xml.isEmpty()) return null;
try {
Object obj = ModelDataXmlTool.xml2Model(xml);
VariableDomain domain = (VariableDomain) obj;
return domain;
} catch (ObjectNotFoundException e) {
e.printStackTrace();
}
return null;
} | 1 |
4b05c83eb1fc43a398f3ce77c13bb064 | f1899dc6fd34678f02070b9d3cdc2ac9 | Leaves a status range started by a call to <see cref="EnterStatusRange"/>. | namespace AmbientServices
internal class StatusNotificationWriter
public void LeaveStatusRange()
{
if (_tabLevel != 2) throw new InvalidOperationException("There is no status range to leave!");
LeaveTabLevel();
_details.Append("</div>");
} | 1 |
dbef81d18191cd8f9223bec1eeeee827 | 9ee2e1d07ff1d437cb7acac3ff19853d | Set the handler that should be assigned to the {@link SwingTask}
in order to handle potential uncaught exceptions that happen
during the execution | public function setExceptionHandler(MvcHandlerExceptionInterface $handler): MvcMappingHandlerInterface; | 0 |
43b16000301175648fc1bf2d29c554d1 | 1a0f0609222a8f15b702b23c634daedd | 增加探险时长(探险类型[1-4], 元宝或礼券) | void Player::AddTeamDungeonBuyTimes(int32 val)
{
CnAssert(val > 0);
if(val > 0)
{
m_base_info.team_dungeon_buytimes += val;
}
} | 0 |
83bfbaa434bbe82e72cd65223e06705c | dd26d735c3fad00fbb98895c28156da7 | Found at https://stackoverflow.com/a/32882220 | function shuffle(iterable) {
const array = [...iterable]
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1))
;[array[i], array[j]] = [array[j], array[i]]
}
return array
} | 1 |
9b117b3baf7a1a019006560d841abd22 | ecf6a891a1b1663d615fadf40b7d5376 | fonction qui renvoie les feuilles de l'arbre | class ArbreBinaire :
def feuilles_negatives(self) :
feuille_neg = []
if self.aFG() :
if self.fg.estFeuille() :
if self.fg.valeur() < 0 :
feuille_neg.append(self.fg)
else :
self.fg.feuilles_negatives()
if self.aFD():
... | 0 |
3efb3fd4cb943fb64930dc191c4ece0a | 2f712da26f4cf083cd7ed6369e8845ae | 清空编辑区按钮点击事件 | group_edeit_clear.setVisibility(View.VISIBLE);
group_edeit_clear.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ClearEdit();
}
});
} | 1 |
eb8c710c2f86c4764414a4e786eddab1 | 2efec198f337aa2b093c079dd1a49881 | ファイルからJavascriptオブジェクトを読み込む. | inter = make_bond("javascript")
if file:
with open(file) as f:
content = f.read()
inter.eval_block(content)
return inter | 1 |
7167b8df186ff8ca31f6bfac430368a8 | fb287f78bce80808dfaca364d94db1ac | Goes to Configuration screen. | class MainViewModel(host: Host, val mBinding: ActivityMainBinding) : BaseViewModel(host)
fun configurationSetting(view: View) {
mContext.startActivity<ConfigActivity>()
} | 1 |
7ec65d5376504de71d239f37c7211a9e | ba36feee2ef8b1d62d4c97fcfa0fec2a | 添加菜品标签 | class Petaticle extends BaseAdminController
function addLabel(){
$this->assign(config('config.view_replace_str'));
return $this->fetch();
} | 0 |
dd1647e16aab636aa6202eb64019c313 | d4981cb28be0434b75c86ed7fa16f322 | Tests wille can not view protected | announcement = AnnouncementFactory(pub_state='protected')
self.assertTrue(self.client.login(username=self.wille, password='password'))
r = self.client.get(announcement.get_absolute_url())
self.assertRedirects(r, '{0}?next={1}'.format(settings.LOGIN_URL, announcement.get_absolute_url())) | 1 |
b2de48d8401f76699e9175aaf5b9f78d | d1c832b9699380aead55863933febcf0 | Initialize ServerWorker. | {
$this->server->onWorkerStart = $this->initApplication();
$this->server->onMessage = [$this, 'onRequest'];
$this->server->onWorkerReload = $this->reloadApp();
} | 1 |
0b993e3a4c620cf916c3c635c52d5bcb | eeac6c84dcf35db443b4864e2c975378 | Recursively finds the very most top level parent of a Page | class ormPages
private static function getParent($page_id){
if (isset(self::$pages_rel[$page_id]))
return self::$pages_rel[$page_id];
else
return 0;
} | 0 |
2c4e700efb0b318c6bcd09c75a94fafc | a24d1d5e322c8474e012ad38e1e12ebe | 设置透明状态栏,并且布局向上提,需要android版本再5.0之后 | public class MainActivity extends BaseActivity
implements RongIM.UserInfoProvider, LoadIMUserInfo.OnUserInfoListener
private void setTransparentBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
... | 1 |
143bddfb99b2a99a3ddb7b0e18f5bbfd | dc26821a9ef6579c109027583f270a51 | 获取某个节点的所有子孙节点 | export class TreeTable<T extends IKey> extends Table<T>
getAllChildren(node) {
if (!node)
return [];
let result = [];
this.addAllChildren(result, node);
remove(result, item => item === node);
return result;
} | 1 |
f7971a3445a0c152151b3981d847070e | 90dddf86d63a3121a58fa5b130b79a59 | Photo is smaller than both maximum dimensions, take it as-is | if(!$this->enlargeSmaller) {
if((!$max_width && !$max_height) ||
( $this->width <= $max_width && $this->height <= $max_height))
{
if (!copy($this->filePath, $target_file_path)) {
throw new Exception("Could not save thumbnail to [$target_file_path]");
}... | 1 |
58f4776654a7bc02897597015770431b | 24123bc6d1e0f96110ca03d4f6c06472 | 搜索租借的商品 | if(!empty($_REQUEST['status']) && $_REQUEST['status']>-1){
$map['s.status'] = intval($_REQUEST['status']);
$search['status'] = $map['s.status'];
}
$renumber = C('RENUMBER_BORROW.new_grade');
if (!empty($_REQUEST['protype'])) {
if($_REQUEST['protype']==1){
$check['b.product_type... | 1 |
10faa483adb25b7f168c523e43e63574 | ad7ec31de1490f72ce45c8db1744642c | 根据货币的id获取货币的name | public class OrderRegisterAction extends AbstractAction
public void getCurrencyNameById() {
SysCCurrencyFacadeRemote currencyRemote = (SysCCurrencyFacadeRemote) factory
.getFacadeRemote("SysCCurrencyFacade");
String strCurrencyId = request.getParameter("currencyId");
SysCCurrency currency = currencyRemote.fin... | 1 |
6176830b521541e04b4d34d737ffbcb5 | d475b9c9bf469ff29601b3b714973b5c | pointer to the requested observation, or NULL if the
observation index is out of bounds. | type_t ord_array_lookup(uint32_t i, ord_array_t *ord_array) {
if (i >= ord_array->size)
return NULL;
return ord_array->entries[i];
} | 1 |
8c6726f688f008601a5d762337d551a3 | 63b1e7253743655901deed3e76d558fb | GET /response-choices/:id : get the "id" responseChoice. | @choice = Choice.new(choice_params)
@count = params[:count].to_i + 1
respond_to do |format|
if @choice.save
if @count <= 10
format.html { redirect_to '/choices/new/' + @choice.question_id.to_s + '/' + @count.to_s }
else
format.html { redirect_to '/users' }
e... | 0 |
8d7929c726fa8edd84dda7ada26e6b12 | c0d89f24ad50031edfa147d8f39ba6f8 | returns the ambient temperature sensor value in Kelvin
With enclosure on, the U6 is typically 3°C higher than ambient. The calibration
constant have taken this into account and have therefore an offset of -3°C, so
the returned calibration readings are nominally the same as ambient with the
enclosure installed
for refer... | assert 0 <= input <= 4
self._control(0x66, 0x66, 0x04)
self._trigger(input)
rreg = [self.TEMP, self.V1_T1, self.V3_T2, self.V5_T3, self.V7_T4][input]
hi, lo = self.i2c.io(rreg, 2)[0]
v = ((hi << 8) + lo) & 0x1fff
kelvin = v // ... | 1 |
f36de17fd859a5fac9a26ad8e9043749 | 72303b01190782b344a855ad6574d29b | Function prints the edit distance between two words. | {
int rows = len1 + 1;
int columns = len2 + 1;
int** matrix = (int**)malloc(rows * sizeof(int*));
for (int i = 0; i < rows; i++)
matrix[i] = (int*)malloc(columns * sizeof(int*));
int i;
for (i = 0; i <= len1; i++)
matrix[i][0] = i;
for (i = 0; i <= len2; i++)
matrix[0][i] = i;
for (i = 1; i <= len1; i++)... | 0 |
de2518eff761b9f04ae112e48db65d39 | 08b93fe6ca2f82d8a038726519ae0886 | Returns the matrix $\mathbf{V}$ of the decomposition.
<p>
$\mathbf{V}$ is an orthogonal matrix, i.e. its transpose is also its inverse. | public class SvdD
public MatrixD getU() {
return U;
} | 0 |
a99c6e8452af73dfec2eb400cd11beb0 | 193318d7f1dd4523f284ff8af9f054ae | Adds bat event listener and removes bowl event listeners, along with some additional necessary stuff | class WheelSelector extends React.Component{
componentDidMount(){
document.getElementById("wheel").addEventListener("mousemove", this.mouseToSpinWheel)
document.getElementById("wheel").addEventListener("mousedown", this.setDownTrue)
document.getElementById("wheel").addEventListener("mouseup", th... | 0 |
7da2ffa9c25bde89baed72c8d1db835e | 934229f0333ebbef455613897b9dfaf8 | Définit ou retourne le nom du participant | class Competition
public function setNom($nom = null)
{
$this->nom = $nom;
return $this;
} | 0 |
dbcee0b55ab46de7933af756196135d9 | e6fb4ed669898ae98bbc010e83f07c1e | gets the number of figures under pre-spcified conditions (fig type) | class SAPserver(server):
def discriminating_figfams(self,data):
self.function('discriminating_figfams')
return self.retrieve(data) | 0 |
da5f785d0f36e3d7ed0f459908ea98a5 | 22d1176543366848888b79ad2113f115 | 注意这里没有参数 | func Test1() {
fmt.Println("无参测试")
} | 1 |
0be16de3e52e7612e580d3999004de36 | 951899152c9e50685c15b64e1c9fb752 | This is called when quiz is finished. | public class LoadScript : MonoBehaviour
void DoneWithQuestions()
{
questionText.text = "That's it!. How well did you do?";
correctNumberText.text = "Correct: " + totalRight;
totalAnswersText.text = "Question " + (questionNum - 1) + " of " + totalQuestions;
} | 1 |
22e9b4c528238514442e312098080e36 | 00e695c3d8aa29ce9ab734023bd7072c | This is called when a mail merge encounters a MERGEFIELD in the document with an "Image:" tag in its name. | namespace UtilityLayer.Common
public class HandleMergeField : IFieldMergingCallback
void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs e)
{
if (e.FieldValue != null)
{
byte[] buffer = (byte[])e.FieldValue;
if (buffer != null)
... | 1 |
e8da06dd66305e54a5d101e90b9ad044 | 4908b0c820775038a62c2064723c0b8b | 鼠标停留在某个元素上 | try:
ac = ActionChains(self.driver)
ac.move_to_element(self.driver.find_element_by_xpath(xpath)).perform()
except Exception as e:
print(traceback.format_exc(e))
return False
return True | 1 |
d881216c2d9b7a7a8db1ba074e3376fb | eba1ec7fef6276d786763ec1165dad1a | Ends the asynchronous print. | stop() {
return __Printer__.stop();
} | 1 |
3b1773f0cb189e1d911840d86e0358fb | ad09533a4606cc9a6af48cace5c73e78 | Rewards the user for installing the app. | this.promptEvent.prompt();
this.promptEvent.userChoice.then((choiceResult: { outcome: string; }) => {
this.snackBar.open('PWA install ' + choiceResult.outcome, 'Ok', { duration: 3000 });
});
} | 0 |
81a00690e06f8b45aa5ddb4e50fa217f | e006b2f8d8d0d06fd0b56d0630fa707c | 从数据库中获取所有边 | class Game_System{
all_edges(){
return map_info.edges;
} | 0 |
a7ec5af7ead84a262e617f5f7b138c64 | 697912a9bba4306998b15de609f6ad01 | to show necessary conntrols on the click of logout button and hide irrelevant ones | public class FXMLController implements Initializable
@Override
public void initialize(URL url, ResourceBundle rb) {
logoutBtn.setVisible(false);
logged.setVisible(false);
} | 0 |
66a4e7435aa1e29d02209cc600085204 | 5fbab1809eca6a49833ceee60ccb956a | changing icon when hovered | class DBHelper
static handleHover(iconVersion, hoverVersion) {
const icon = document.getElementById(`${iconVersion}-icon`);
const hover = (hoverVersion) ? 'icon-hover' : 'icon';
icon.className.baseVal = hover;
} | 1 |
fac789be31ed0ddcf5ab1f488f77ac6d | 2d309cbaef969d2bb756374fca010c1f | Visualizes the average latency per timestep over all clients of the simulation | fig, ax = plt.subplots(figsize=(6*0.7, 3.5*0.7))
np.random.seed(1)
npts = 200
maxt = 10
x = np.linspace(0, maxt, npts)
y = 0.5*np.random.random(npts) + 0.75
ax.plot(x, y, lw=1, color='black', label=r'$u_i(\vec{x}, t)$')
ax.axhline(np.mean(y), linestyle='--', color='black',
... | 0 |
957c289fb8f50d0d741d7de6eaac2889 | ad881e76ff25465ae96c297c74909ec7 | On affiche le bouton pour générer en pdf, le nom du film, son résumé et son texte | {
var html = "<h4 class='line'><span class='badge'>3</span></h4><button onclick=\"javascript:xml2RTF('report-pdf')\">RTF</button>";
$("#report-pdf").html(html);
} | 0 |
7ec1aad2371070571caa29cd3ac77ad2 | 008dcd4af6a2fcd7b99baa0a47d03bc4 | Try to get the sup/inf of two functions by looking at the piecewise components. | public DataFrameItf loc(String labelInf, String labelSup); | 0 |
2e295661c96164d5144463235a59379c | 927ff61a835ba69c31a000471a163416 | Callback to the activity when a trip is clicked with the clicked trip | Log.i(TAG, "You have arrived!");
stopForeground(true);
stopSelf();
Intent activity_intent = new Intent(this, TripSummaryActivity.class);
activity_intent.putExtra(TripSummaryActivity.EXTRA_TRIP_ID, trip_id);
startActivity(activity_intent);
} | 0 |
029c3b76814768540725d5941de7476f | 5ebe904987aba63d588421ffbc06da2d | 通过jsoup方式爬取用户信息 | public class LibraryCrawler
public static List<String> getUserLibInfo(String url) {
List<String> userInfoList = new ArrayList<>();
String result = getter(url, "");
Document document = Jsoup.parse(result);
Element div = document.getElementById("mylib_info");
Elements trs = div.sel... | 1 |
6f6d04f40c9af46a62bcbef5abae8775 | f57b0ac38e73d7eadc1ad324323994a5 | Sets the flag that indicates wether to show item detail or a list of
items. | public class LoadFieldSetStatus
public void setDetailOpen(boolean detailOpen)
{
this.detailOpen = detailOpen;
} | 1 |
10401a686f8323008965770ea737ab96 | 4a59855a3c5b9eac2c821ec12e225f9a | 国际化浏览器头信息本地语言解析 | function langInitByBrowser() {
var local = GetCookie("language");
if (local == null) {
if (navigator.userAgent.indexOf('MSIE') >= 0){
local = navigator.browserLanguage;
}else if(navigator.userAgent.indexOf('Firefox') >= 0 || navigator.userAgent.indexOf('Chrome') >= 0
|| navigator.userAgent.indexOf('Opera'... | 1 |
eeacd3ac54487dcd55241f1ce25835ab | 71e66924adbd0c23830ff2e2cc4ecb02 | Dadas 3 coordenadas actualizamos la cámara para que se posicione en
estas coordenadas. Una vez actualizada, volvemos a dibujar. | void CCamera::PositionCamera(float positionX, float positionY, float positionZ,
float viewX, float viewY, float viewZ,
float upVectorX, float upVectorY, float upVectorZ)
{
CVector3 vNewPosition = CVector3(positionX, positionY, positionZ);
CVector3 vNewView = CVector3(viewX, viewY, viewZ)... | 1 |
41159dfaf044b79de378ba96a8c60f8e | ce41764b7e4c4ea4b421d5aa767d7ca8 | Required for singleton | class SeleniumDriver(object):
def __new__(cls):
if not hasattr(cls, 'instance'):
cls.instance = super().__new__(cls)
return cls.instance | 1 |
181445c02d5885bbcce343d8a3da8a94 | 45ffd2592709bd439ae78b9cfc660b5f | Called when user's guess is repeated | if(colorGuessed === false) {
gamesPlayed += 1;
avgGuessDisplay.textContent = Math.round(guessCount / gamesPlayed * 100)/100;
colorGuessed = true;
};
} | 0 |
41ae74ef43eac1ac63056ebd08f395a5 | 025dd99be3e6afbbcf31bc316e18d33b | Sets the name of a mesh to use as a hat for all karts. | void KartPropertiesManager::setHatMeshName(const std::string &hat_name)
{
for (unsigned int i=0; i<m_karts_properties.size(); i++)
{
m_karts_properties[i].setHatMeshName(hat_name);
}
} | 1 |
33284abff8f0bae0fbb7fcc437cbc7b3 | 535a194b0f40be793c30f159b6ae92ca | 传入数据源配置信息,根据password字段进行解密。格式修改成dict 一层关系 | class Base():
def decryp_dict(self, username, vault_password, data, vault_list, isverify=True):
encryp_api = Using_AES256(vault_password, vault_header)
if isverify :
vault_result = self.verify_vaultpassword(username, vault_password)
if not vault_result[0] :
self.l... | 1 |
5ec575195f545322077a58ee9d2fa07a | 25dc2ddf0d51759c429ebfca24109678 | Returns if initial focus is enabled/disabled for the editor. | public abstract class ChromiumSettings
public abstract void setNeedInitialFocus(boolean flag); | 0 |
2c65ff47600386b384cbf9841117232b | d944916525d3440ed5ee3a75cd33cb85 | Load the Scene the User has selected | public class LevelSelectionMenu : MonoBehaviour
public void LoadSelectedLevel(string levelName)
{
SceneManager.LoadScene(levelName);
} | 1 |
9d8a2ba45d1daf3cf97e3a26c76e8152 | aa70e180c011fb6b3e4c8654e9ad9d90 | Creates an instance of IconRoundHeadsetMicElement. | class IconOutlineGavelElement extends AoflElement
constructor() {
super();
} | 0 |
fb311ea46621f5f95f776c67624f675f | d28ae8858bebd13f21f69b6dec4442f1 | Tests a notification can be set as notified | async def test_notifications(bridge: Bridge):
notified = False
def callback():
nonlocal notified
notified = True
bridge.target.add_subscriber("2", callback)
bridge.leap.send_unsolicited(
Response(
CommuniqueType="ReadResponse",
Header=ResponseHeader(
... | 1 |
2d42287926d90c52cc8a74c1c88de05d | 3fc5d2fdd9eb641a0b98156a37446248 | Ajout d'un element en queue de la liste d'arc | void nouvelArc(GRAPHE g, int s, float val ,int dest)
{
g->t[s]->successeurs= ajoutEnTete(g->t[s]->successeurs,val,dest);
} | 0 |
faac0a9900da187657f9f2cd1b769adf | 6135da631ab81570fe9d2bc2d41ae761 | 通知前台更新页面 | {
if(!UserHelper.isLogin() || notice == null) return;
Intent intent = new Intent("net.oschina.app.action.APPWIDGET_UPDATE");
intent.putExtra("atmeCount", notice.getAtmeCount());
intent.putExtra("msgCount", notice.getMsgCount());
intent.putExtra("reviewCount", notice.getReviewCount());
intent.putExtra("new... | 1 |
960802c2c7a2a1973b02b94d3f2554f8 | f6edc703cd32e5807e2ccc46bf2de952 | ExtendedConfigurationGet get the extended configuration accessible to authenticated users. | [Get("/")]
Task<ExternalConfiguration> GetConfigurationAsync(); | 0 |
845122784da99daca68f991858288cbf | 3b34aa2e5697a52bf5fe1ef187ce75bd | Removes Nickels from the Pocket | public class Pocket2
public double getNumberNickels()
{
return numNickel;
} | 0 |
6ab42423984e3927339036cc467bf757 | 24d1f304c434fe49fe38b96431dbea88 | Get the focused target. | namespace Sce.Atf.Applications.NetworkTargetServices
Target GetSelectedTarget(); | 1 |
f1f74469f2c6d73431bf6763f4b563c7 | faeddaf182b308e34bdb786036dbdd6b | Agrega una ventana a la aplicación. | public void registerWindow(Window window); | 1 |
1d86abfb328a006c2341836a9d4502ea | 198538001caab9c1a12d8b91a54407d9 | 重建所有資料 | void rebuildAll(); | 1 |
010b3f2a6cadeeccc1d291ee014d370b | c2f88e3c4675df3df89cb8ee524832aa | Sets the v12_0
When TRUE, only Version 12.0 or later is supported. Default value is FALSE. Exactly one of the minimum operating system boolean values will be TRUE. | class IosMinimumOperatingSystem extends Entity
public function setV12_0($val)
{
$this->_propDict["v120"] = $val;
return $this;
} | 1 |
8e8e85cc1fe237fec228bb2cc9f8cd91 | 95b03cff3b283ca4120e1a86bd9929c9 | 移除属性时的监听方法 | @WebListener("listener.ObjectAttributeListener")
public class ObjectAttributeListener implements ServletRequestAttributeListener, HttpSessionAttributeListener
public void attributeRemoved(HttpSessionBindingEvent se) {
System.out.println("将名为" +se.getName() + "的属性从session对象中删除了");
} | 1 |
5313defb9b0af1b1186e5d41d70f8463 | 4daed2bb18c93f4035848f57955b78e1 | Get data from MPU6050 for KK2.1 | {
#ifdef _ENABLE_MPU6050
int get_data;
short aacx, aacy, aacz;
short gyrox, gyroy, gyroz;
#ifdef _PRINT
printf("_MPU6050: %d\r\n", _MPU6050);
printf("_MPU6050_DMP: %d\r\n", _MPU6050_DMP);
#endif
if(_MPU6050 == 0 && _MPU6050_DMP == 0)
{
get_data = mpu_dmp_get_data(&pitch, &roll, &yaw);
#ifdef _PRINT
pr... | 1 |
cc29a28ebaf54cde5ff86722aae82f72 | 4730f53ae0aa4e23144edaf8f6bf3edf | Compress list of bytes array to a bytes array | {
byte[] ret = new byte[size];
int index=0;
foreach (byte[] ba in bytes)
{
ba.CopyTo(ret, index+ba.Length);
}
return ret;
} | 0 |
85bda7b659ffca76c073f6de6e845bed | ead277a446b3372565279eee32b05565 | removes custom tables from DB. only for dev. this will be removed and only happen on plugin removal | class Shopware_Plugins_Frontend_NostoTagging_Bootstrap extends Shopware_Components_Plugin_Bootstrap
protected function dropMyTables()
{
$this->registerCustomModels();
$modelManager = Shopware()->Models();
$schematicTool = new Doctrine\ORM\Tools\SchemaTool($modelManager);
$schematicTo... | 1 |
1bace06d2c4ebd10b0bbd0014ee157f4 | 134471da1f5fc8bf3a3910875fc90fd7 | все данные поставщик -> товар | class Products extends \yii\db\ActiveRecord
public function getSuppliers() {
$products = self::find()->all();
$suppliers = [];
foreach($products as $product) {
$suppliers[$product->supplier] = $product->supplier;
}
return $suppliers;
} | 0 |
2a9ad4d696c1555b29c1722d21bc21ca | 5c298d01efcf47a9a9ba29b49a5726a4 | Compare versions.
(4.0.0 > 4.0.0-alpha1, 4.0.0 < 4.0.1) | $x = BoostVersion::from($x);
$beta = ($this->beta === false) ? 9999 : $this->beta;
$x_beta = ($x->beta === false) ? 9999 : $x->beta;
return $this->version < $x->version ? -1 :
($this->version > $x->version ? 1 : 0) ?:
($beta < $x_beta ? -1 : ($beta > $x_beta ? 1 :... | 1 |
b2273c2be2c7b5619979abb8d1023656 | eee1320a101693cda40ac36912b325f2 | 将文本分句 | class SentenceSegmentation(object):
# 初始化函数,获取用于分句的分隔符集合
def segment(self, text):
res = [textrank_core.as_text(text)]
for sep in self.delimiters:
text, res = res, []
for seq in text:
res += seq.split(sep)
res = [s.strip() for s in res if len(s.strip()... | 1 |
037900cdaf41299c02d9e80f1e77f919 | a4e7b81c520e35cfa551d0d45bdb1388 | t, tuple or list
Each element of t is either an int, a tuple, or a list
No tuple or list is empty
Returns the maximum int in t or (recursively) in an element of t | def max_element(*args):
if not isinstance(args[0], (int,float,list,set)):
return
foundMax = False
for arg in args:
if isinstance(arg, (int,float)):
highest = arg
else:
highest = max(arg)
if foundMax == False:
maximum = highest
f... | 1 |
4c2f297250f752b782b9b1ab109d346a | 4234e2c4c314b5f3c9a21ae141e4587a | 管理员查看教师信息 | class Admin extends Controller
public function teacher()
{
$this->isLogin();
return $this->fetch();
} | 0 |
ef7f3266b5547870d5028dcc983415ec | 5fcbe32416d31cabd246e2692cb8d33a | This function tests all arguments in a list of 2tuples to see if unit letters are SIBU
2tuple presumed to have structure: symbol, degree | def chemistry(element, symbol):
element = element.lower()
symbol = symbol.lower()
if len(symbol) != 2:
return False
if symbol[0] not in element or symbol[1] not in element:
return False
index = element.index(symbol[0])
if element[index+1:].find(symbol[1]) == -1:
return False
return True | 0 |
8520715535cf5867f312ce0fdad0509b | 5413ac076ccee9c20d4afe51df551e37 | 根据categoryId查询newsItem | @RestController
@RequestMapping("/category")
public class CategoryController
@GetMapping("/find/categoryNewsItem/{type}")
public ResponseEntity<List<CategoryNewsItemVo>> findCategoryNewsItemsListByType(@PathVariable("type") Integer type) {
return ResponseEntity.ok(categoryService.findCategoryNewsItemsListBy... | 0 |
34577809ab8f5ed208c2a9a16f7ecee1 | f31a7bc0401f6c6620652a70afbe3846 | 通过检验模版名称获取检验模版数据 | namespace Sys.Safety.Services
public partial class AnalysisTemplateService : IAnalysisTemplateService
public BasicResponse<List<JC_AnalysisTemplateInfo>> GetJC_AnalysistemplateListByName(AnalysisTemplateGetListByNameRequest jC_Analysistemplaterequest)
{
var jC_Analysistemplateresponse = new Basi... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.