query_id
string
corpus_id
string
query
string
code
string
label
int64
5aa178e0eec1e3764d8b82be5997da91
e5b42ab74df0b8310b5094ff8f5b748c
从标注预料中抽取实体 IOB -> entities
entityDic = {} last_label = '0' _word = '' start_index = 0 end_index = 0 for i in range(len(tag_seq)): _tag = tag_seq[i] _char = char_seq[i] if _tag == '0' or _tag == 0 or _tag == 'O': if _word != '': ...
1
2be7dc7fc5505ecca0ec6b5e0d8c90cd
dab44fea9d5b1b000d424c6a97b306f2
显示盟友会员的数量
function battle_layer:show_td_mons_count( ) self.ui_layer:show_td_mons_count( ) end
0
7e7e6ba7e5b1ff3a174f11ea2f7c727b
893777fec4e0cde058cc2b6d8a2d7c84
Create a subsampled mask of feature sequences.
assert in_size % seq_len == 0 and out_size % seq_len == 0 item_size = in_size / seq_len new_item_size = int(item_size * (float(out_size)/in_size)) mask_lengths = range(out_size, 0, -new_item_size) mask_lengths = [item_size*[l] for l in mask_lengths] mask_lengths = [item for sublist in mask_leng...
1
8cf71d0992e255cc07767b56e1af10da
37b82e201952e48e9d04f779ffcd594a
UInt16Comparator compares the value of type uint16.
static inline void compare16(uint16_t val1, uint16_t val2) { if(val1 != val2) { error++; } }
1
26994794c6285283ac1063c121dd211c
0b4a532fc3313e19968a88c4d02985b7
Generated from: uk.ac.stand.cs.insense.compiler.unixCCgen.TypeMarshaller::printInitializeSerializerFunctions
out << ".bytecode 49.0\n"; if(debug >= 1) out << ".source " << sourcename << "\n"; out << ".class public " << classname << "\n" ".super java/lang/Object\n\n" << "\n" ".implements lljvm/runtime/Module" << "\n"; out << "; ;;START LINKER DECLARATIONS;; ;\n"; printDeclareLi...
0
79fcfb3466c85edc0a602221d1d54624
a812e142de90e46bd2be36fcc096be59
Add new banner group
class Enterprise_Banner_Adminhtml_BannerController extends Mage_Adminhtml_Controller_Action public function newAction() { $this->_forward('edit'); }
0
9b15b52a9d37d1e5032a12e8d63f6f6e
6173ff802878c2eeb6fec0fb45bbc4af
Dodawanie dwoch list. Nowa lista zawiera najpierw elementy listy po lewej, a nastepnie elementy listy po prawej.
public class ArraysAndLists public ArrayList<Integer> append(ArrayList<Integer> listOne, ArrayList<Integer> listTwo) { ArrayList<Integer> result = (ArrayList<Integer>)listOne.clone(); result.addAll(listTwo); return result; }
1
b1f559a03b23cbdba4f8bad7b9aa51eb
f515fb54efdada570392473484173f3f
translate wheel velocity to the motor speed command roboteq takes speed commands as a percentage of the maximum speed So, 500 would be 50% maximum speed
micros = 0 if(self.servo_reversed): micros = interp(fSpeed * self.scale_factor, [-1, 1], [self.servo_max, self.servo_min]) else: micros = interp(fSpeed * self.scale_factor, [-1, 1], ...
0
d10185bd76e9fffbfeaff40bc9a22bc5
83daf22fc24b53f1d8782d95b595d3d4
Проверка доступности страницы редактирования поста разным пользователям
self.group = Group.objects.create(title="test", slug="some_slug") self.post = Post.objects.create( text="simple text", author=self.user, group=self.group, ) self.client_auth.post(reverse('post_edit', args=(self.use...
0
ca8ca1b303d6da0878c207538ac9abc5
d6eddfaa968b71295dc1096667edaa80
设置制冷机开启或者关闭
namespace astro namespace camera namespace simulator void SimCooler::setOn(bool onoff) { std::unique_lock<std::recursive_mutex> lock(_mutex); if (onoff == on) { return; } on = onoff; _cond.notify_all(); }
1
4e909aabd44140744da6c1b5ce420e1a
3322ece35e67095763749babfd73e53a
Provide unsigned 24-bit integers
def Int32ul(): return FormatField("<", "L")
0
052d3854a3e489517a7500475013b73c
267a4df406283e7daf8ca829f0e498f1
构建基于占位符的query string
class QueryStringBuilder public static function build(array $queries = []) { if (count($queries) < 1) { return ''; } $queries = http_build_query($queries, '', '&', PHP_QUERY_RFC3986); return $queries; }
0
89818b4e5e3f3a3e341b770e9b25f184
2dca725cdcacc24f4294c9c48ee45c04
获取终结符或非终结符在数组中的下标
int isInT(char ch) { for (int i = 0; i < grammar.T.size(); i++) { if (grammar.T[i] == ch) { return i + 1; } } return 0; }
1
f880c33b3920e6a33c62f2243bc5244d
a4f55119df43604605729bfc2d91d1cd
スレッドの削除用パスワードを設定します。 <p> スレッドのパスワードが設定されていない場合、スレッドの削除を行うことができません。<br> なお、このパスワードは平文で保存されます。 </p>
void setAdminPassword( String adminPassword );
0
fbb425ea55e4b1a30bc9f92ab94fb0f5
564a060e9b49a63dff0d340f7f62c347
adds a value to a BST and returns a pointer to the modified BST
if(cur_root == NULL) { return make_tree(val); } else if(val > cur_root->val) { cur_root->right = insert(val, cur_root->right); return cur_root; } else if(val <= cur_root->val) { cur_root->left = insert(val, cur_root->left); return cur_root; } }
1
d71a1c86f8a0f096c14b46ac9fc18626
7034efb97ed64cd550e045edfc328fd6
Get the value of URI of the application
class AppTemplate public function getURI() { return $this->app->path->url($this->resource); }
1
b402903ac2b39bc486926bc092d7cb47
88fa5433d252e2d66c4865b60ea48165
Launches ConnectionSettings window
PaloBrowser browser = getPaloBrowser(); ConnectionDialog conDlg = new ConnectionDialog(browser); Rectangle r = browser.getBounds(); int w = 400; int h = 250; conDlg.setBounds(r.x + (r.width - w) / 2, r.y + (r.height - h) / 2, w, h); conDlg.setVisible(true); }
1
37808dc60f9788024be27789882fbd48
bb6ecb5d2610601fb0d027118f78ae6e
Clear the row at the given row index so that all blocks are empty
class Sudoku: def clear_row(self, row): self.__board[row] = ["0"] * 9
1
5063c41ce9cfed417a607b3564775e5d
a12bd5bb128ba4fc7061c98810b10aac
Inject properties and call methods on Objects already instantiated.
public static void injectMembers(Object instance) { INSTANCE.injector.injectMembers(instance); }
1
f351b33b3bae80afd97202f122c791e2
bc1e9142b8e75e38fefa876ffa0c69a4
Returns a value from a dictionary x if present. Otherwise returns an empty string
def safekey(d, key): if key in d: return d[key] else: return ''
1
a2e63881bcd1a91f2c28903478f04340
d38a9a533ed66667619ef90250791faa
Get path converted to UTF8
class File extends \SplFileInfo public function getRealPath($asUtf8Str = false) { return $asUtf8Str ? $this->path_str : (parent::getRealPath()); }
1
a2616f1cbf7ddd76c45958dc1ce2dc74
c8db618061f48e48a8a7f1002f226953
This returns a description of this test (suitable for putting at the top of an error message), with " " at the start and \n at the end.
public class HttpTest extends NetCheckTest public String getDescription() { return " URL: " + url + "\n"; }
1
f2f0eb59067e833f2b47dac4e6964741
20fcc8f1478e29c71bbb6f7b0a18ecba
[[...],
function common:split(str, delim, maxNb) if string.find(str, delim) == nil then return { str } end if maxNb == nil or maxNb < 1 then maxNb = 0 end local result = {} local pat = "(.-)" .. delim .. "()" local nb = 0 local lastPos for part, pos in string.gfind(str, pat) do nb = nb + 1 result[nb] = par...
0
6b9ed8d55d43ba27510651e18ce718e2
f37291dd06eac9e3c03660675808e60d
按照培训开始时间查询培训计划(搜索框搜索)
{ UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"]; model.CompanyCD = userInfo.CompanyCD; return TrainingDBHelper.SearchTrainingInfo(model); }
0
c749e682950e0dea86d794926e6a1d79
5bb8449796bfa94cd03b7bfeb6f3298e
Gets the name of this FieldDefinition. # noqa: E501
class Dex(KaitaiStruct): class FieldIdItem(KaitaiStruct): def field_name(self): if hasattr(self, '_m_field_name'): return self._m_field_name self._m_field_name = self._root.string_ids[self.name_idx].value.data return getattr(self, '_m_field_name', None)
1
63517d635731bdd0091e8e720da86b62
e6ede99eb38c48dc6a24eb746a20f9bd
Tests valid shipping methods.
class PbInstantInstallment extends AbstractMethod public function _validateShipping($quote) { if($quote) { $address = $quote->getShippingAddress(); if($address) { $method = $address->getShippingMethod(); $availableMethods = $this->configHelper->getActi...
1
e99f58c2577e07d3264a7e0f7a737cee
b795e487df8fdfc40821b8f3048c286a
Eq. (6.2) Design Ratio
gM = self.gl.l * self.gl.M() old_mu = self.gl.set_mu(1.0) gA2 = self.gl.L() self.gl.set_mu(old_mu) Lg = self.rr.L() return (-gM * gA2 + np.sqrt((gM * gA2) ** 2 + gM * Lg * gA2 * eps)) \ / (gM * Lg)
1
c727b028531554d1c9b3145524890396
e202f827e653b5347f5e1d30ff63c530
This function reports an expected string value.
void GetStringTest() { DoGetTest(EStringVal, ETrue); }
0
7547d8ec0fe8004badc295e21f09f7dc
770e5df63f3bf5d3ab364f5af7156560
Raw number of data points accounted for in the sufficient statistics.
public class StandardDeviation extends AbstractStorelessUnivariateStatistic @Override public long getN() { return variance.getN(); }
1
6c02fc2d3028c7622a0cc62f6e36859f
572952b2a5d7b83db0ce32ff0df06a65
增加军团贡献值
if (change < 0) { return; } KGameMessage msg = KGame.newLogicMessage(SM_GANG_SYN_CONTRIBUTION_CHANGE_COUNT); msg.writeShort(change); KSupportFactory.getRoleModuleSupport().sendMsg(roleId, msg); }
1
3072f5bf08bc73a6b5b95b8f7a8bc4d1
dc943433a748a5b4744a60066d7d2dd2
ignoreRead is true the cell will not be stored to the current Line object.
public abstract class SchemaCell implements Cloneable @SuppressWarnings("unchecked") public static abstract class Builder<T, C extends SchemaCell, B extends Builder<T, C, B>> public B withIgnoreRead(boolean ignoreRead) { this.ignoreRead = ignoreRead; return (B) this; }
1
06fbe6bbf41ab883172d535a7c86a837
049daa7291c0dc0c65b821067b22e849
Forcefully abort a transaction which is open on a topic partition. This will send a `WriteTxnMarkers` request to the partition leader in order to abort the transaction. This requires administrative privileges.
class Stomp public function abort(string $transaction_id, array $headers = NULL): bool {}
1
8883e9035494c2f258c23cea9e49e441
c266421d27945ef8af9faf3bc9bc8460
Use the same method as DisGroCalX() to calculate displacement on the ground on Z
r1 = -1.9835e4 k1 = -1.215 alpha1 = np.zeros((8, 1)) alpha1[2] = 1.38e-24 r3 = -8344.5 k3 = 0.155 alpha3 = np.zeros((8, 1)) alpha3[2] = -4.5e-22 alpha3[3] = -8.15e-30 nr = xInMm.shape mr = yInMm.shape if (nr != mr): ...
1
3b5925aeb407c3d12f4d29514ec34ab8
91ae34aa9fb99f436b02d309c336ac5c
Generates the end of central directory record. Purely a subroutine of finalize().
{ uint8_t *p = (uint8_t *)buffer; p[0] = 0x50; p[1] = 0x4b; p[2] = 0x05; p[3] = 0x06; p[4] = 0x00; p[5] = 0x00; p[6] = 0x00; p[7] = 0x00; p[8] = context->numFiles; p[9] = 0; p[10] = context->numFiles; p[11] = 0; p[12] = (uint8_t)(context->centralDirectorySize); p[13] = (uint8_t)(context->centralD...
1
77db7e4f4326ee08b4555d57ab0ac216
1abfe957670672a5393965071139ec1d
Binds the fragment shader data location.
{ const GLuint ONLY_COLOR_OUTPUT = 0; glBindFragDataLocation( Id, ONLY_COLOR_OUTPUT, FragmentShader.OutputColorVariableName.c_str()); }
1
5322102f7148a07c63a278c4c55ed898
4864d4d2db682db8e81ddfab929c9a94
Convert the lisptree to Python object.
self.res = '' self._serialize(root) if self.res != '': self.res = self.res[:-1] return self.res
0
79831e6e96ecadaf5bd013a55c2f88de
f99e1758470fd19e797d8ee19d261d8b
@brief Shows the current setting of NVGRO packet age threshold.
void ngate_filter_show(void * self) { Ngate_filter_data * private = (Ngate_filter_data *)(((Filter *)self)->privateData); tty_printf("(Noise gate filter @ 0x%x, threshold %d, reduction %f)\r\n", self, private->threshold, private->reduction); }
0
c74486b52299ee9694fe5b7c728263c9
f55eabaea8c2b7f9f91fddc1a9911260
社員名(漢字)を取得します。
public class EmployeeSearchResultBo public String getYakushokuNm() { return yakushokuNm; }
0
229f695af1059ec6ea2dc5b681a0c877
d5915a5ef5ad91a653192f67632cf874
Resize right side bar for better documentation preview
var height = $(window).height() - ($('.navbar').innerHeight() + $('.right-sidebar .nav-tabs').outerHeight()); var $el = $('.right-sidebar .demo-settings'); if (!isFirstTime) { $el.slimScroll({ destroy: true }).height('auto'); $el.parent().find('.slimScrollBar, .slimScrollRail').remove(); ...
1
0c20893b82cd5284fd9735d16a5edb62
d35e2195374aa90a8482d294ade099bd
# Construct Python path and pass it to reticulate
if (notebook == TRUE) { filelist <- list.files("../python/") for (f in filelist) { source_python(paste0("../python/", f)) } } else if (notebook == FALSE) { filelist <- list.files("python/") for (f in filelist) { source_python(paste0("python/", f)) } } }
0
44c46a5d313ff8bd22c8ca9b3122e547
e4ff89d6a0da3b91c8eb49f998bca154
end current general path and draw it
export default class Graphics extends Container finishPoly() { if (this.currentPath) { if (this.currentPath.points.length > 2) { this.drawShape(this.currentPath); this.currentPath = null; } else { ...
1
4836ed6214b65ddaac09b9057837d0b9
d506f6c8b9a1ff65a9329c9278bcd667
obtiene todas las actividades de un curso
class ActividadController extends Controller public function index1() { return Actividad::with([ 'leccion', ])->get(); }
0
5663072b81b8b421c9118ca4cbc2572e
f87471b9feaeda218a99a3dbd933a97b
Iterator over all entries in the dictionary, sorted lexicographically.
class sorteddict(dict): def iterkeys(self): return iter(self.__keys)
0
429dd13256499f86328d2a6db21b49ed
8ff3c915eff63beaa36e2fd7248ee7c9
Creates an object and sets initial values to derived/base class members
BaseObject::BaseObject(char type, int speedRating, int sizeRating){ setType(type); setSpeed(speedRating); setRadius(sizeRating); resetFlags(); }
1
92d866623ca2c939adedec252e6da02a
c931b9b4a9160e1f63c7d7c2cf27f076
从剪切板粘贴, 格式化, 然后复制到剪切板
window.clipboardData.setData("Text", $('#div_' + tbid).html().replace( $('#foot_' + tbid).html(), "")); try { var ExApp = new ActiveXObject("Excel.Application"); var ExWBk = ExApp.workbooks.add(); var ExWSh = ExWBk.worksheets(1); ExApp.DisplayAlerts = false; ExApp...
0
10e62a5930fd7691c3c5a99f8d433d80
4ceb394b15ba73edd934ae03582fbd44
Broadcasts" the video feed of the puck (i.e, displays it on the screen)
class Broadcaster(object): def broadcastVideoOfPuck(self,i_frame): pass
1
efa828359b5e84df9647463c1ff9426e
ebf1176b4985a1c94feda8bd5d974d04
Handels the SelectedIndexChanged event of the CB_Dest.
{ if (DestinationInstance.SelectedIndex > -1) { int DestModID = Int32.Parse(DestinationInstance.SelectedItem.Value); int ModuleTypeID = Int32.Parse(ModuleTypes.SelectedItem.Value); ContentManagerDB contentDB = new ContentManagerDB(); ...
1
85139f5803fb8b1a25618092149651a3
e2467da70e9b7d0427de40a2a454e113
@brief 传感器查找配置值
int image_sensor_scan(image_sensor_device_t *dev) { uint32_t i,j; uint32_t sensor_match_flag = 0, ret = -1; image_sensor_command_t read_id = {0, 0}; for(i=0;i<sizeof(sensor_list)/sizeof(sensor_list[0]);i++){ for(j=0;j<sensor_list[i]->id_size;j++){ read_id.address = sensor_list[i]->id...
1
06da6c52735ac3615df65091b2a058d1
04897435094b1a8552bb571bb9435516
这个方法在blot初始化时调用,可以用来准备bolt用到的资源,比如数据库连接 本例子和SentenceSpout类一样,SplitSentenceBolt类不需要太多额外的初始化
public class MetricMain public static class MetricSpout extends BaseRichSpout public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; }
0
4e692ba15d036c07e52bde321dfc4d0b
7b0882e3bb9c7c2a63620c4cc39aa1d6
skip next instruction if Vx == kk
class Chip8: def _instruction_3(self, arg): (arg_x, arg_kk) = nnn_format_to_xkk(arg) if self.reg_v[arg_x] == arg_kk: self._move_to_next_instruction()
1
ba38490f40ae04cc7d38c21e35bf380c
5d9c83cbacd0389fb182a5137fae61eb
DocumentPrePersistListener constructor.
class EntityListener public function __construct(DocumentManager $documentManager) { $this->documentManager = $documentManager; }
0
c84434bfbf9d1f822573c00a0c87f88c
700c67686535cf1add557e71570e0dfa
查询讨论病例资源列表
@Controller @RequestMapping(value="/teachweb") public class TeachWebController{ @ResponseBody @RequestMapping(value="/discussinfomation1") public Object discussinfomation1(HttpServletRequest req) { return medicalCaseDiscussService.discussinfomation1(req); }
1
c8c6a712e7c0de8d89297fd9f0ad273f
09ee997a681aa6df4e4df79955d7fc69
Фильтрация по диапазону цен
public final class Filter public static Filter ofRangeBound(int lowerBoundPrice, int upperBoundPrice) { Filter filter = new Filter(); filter.lowerBoundPrice = lowerBoundPrice; filter.upperBoundPrice = upperBoundPrice; return filter; }
1
c80d187409fa8aa25e080fa587901175
39ad7f2bf4abc0a22d1d4afef6db0055
获取指定素材类型的总数
$type = $_GET['type'] ? trim($_GET['type']) : ''; if ($type){ $this->showAjaxReturn(array('count'=>material_get_count(array('uid'=>$this->uid,'type'=>$type)))); }else { $count = array( 'total_count'=>material_get_count(array('uid'=>$this->uid)), 'image_count'=>material_get_count(array('uid'=>$this...
1
7bf025f53ed1e188887248e76e5882a4
bdbaa97aa32da88e8b1c84f16186d263
事前に取得した情報に従い拠り所となる他のCoreノードに接続
if (others == null){ others = new ArrayList<Connector>(); } others.add(other); if ( this.direction == ConnectorDirection.PULLING){ this.parent.getImpl().setPrevious(other.getParent().getImpl()); other.getParent().getImpl().addNext(this.parent.getImpl()); } else { this.parent.getImpl().addNext(o...
1
af94994fb7ed6f1db87224b0a07ef668
fb061e6a2b060706b74f4f4498383c0f
Generate a Pyomo ConcreteModel.
def read_pyomo_model(filename, **kwargs): _, ext = os.path.splitext(filename) if ext not in READER_BY_EXT: raise InvalidFileExtensionError('invalid extension') reader = READER_BY_EXT[ext] return reader(filename, **kwargs)
0
512fb44c1e13ff71813b6abd64b7a4d1
e5c09e357550bd6dee5f70311a23b1eb
Given a text, this function returns the same text without accents and rare characters,
def lower_and_no_accent(text): chars = { '’': '\'', 'ù': 'u', 'û': 'u', 'ü': 'u', 'Ù': 'u', 'Û': 'u', 'Ü': 'u', 'ÿ': 'y', 'Ÿ': 'y', 'à': 'a', 'â': 'a', 'À': 'a', 'Â': 'a', 'ç': 'c', 'Ç': 'c', 'é': 'e', 'è': 'e', 'ê': 'e', 'ë': 'e', 'É': 'e', 'È': 'e', 'Ê': 'e', 'Ë': '...
1
66b56098bbacc089f0b3d5c39bc2e963
b4884d18e242483b4d8c2699f959c499
クリアタイムを登録する
class Worldboss extends ZC_Controller{ public function clear() { $this->worldboss_model->set_time(); }
1
89280c7dd43da127de62b0e6b07c35c9
94b2ae520c09df1aa44431d614764a33
Смена текста на Русский язык.
void CommPay::on_enUS_triggered() { if(qtLanguageTranslator.load("languages/CommPay_en_US.qm")) qApp->installTranslator(&qtLanguageTranslator); ui->retranslateUi(this); ui->statusbar->showMessage("Установлен язык: Английский (США)"); }
0
a610af8106c4001a8d3bccf20936fcc1
19d61beb9ed4fc85bfbc1e65a69cb046
Restart a node that had previously joined the cluster successfully.
public PollerFlux<PollResult<Void>, Void> beginRestartAsync(String resourceGroupName, String cloudServiceName) { final RoleInstances parameters = null; Mono<Response<Flux<ByteBuffer>>> mono = restartWithResponseAsync(resourceGroupName, cloudServiceName, parameters); return this ...
0
f1571f247099c8ffc50734a178fde10e
28ed0de815ffa78b5695713c761e6253
Clear local alerts when route is changed
export class ProcessPage implements OnInit, OnDestroy clearAlertsForCurrentStep(): void { this.selectedBatch.process.alerts = this.selectedBatch.process.alerts .filter(alert => { return alert.title !== this.selectedBatch .process .schedule[this.selectedBatch.process.currentStep] ...
0
2e9fa7da24513bd043575de3a0e2f0e3
954055c7d881365b765803c752334450
Сохранение файла, при сворачивании/закрытии приложения Если файлов не осталось и был удален последний, без сохранения
class Window(QMainWindow): def save_and_close(self): if self.widget.appointments_list or self.widget.tasks_list: self.save_file() self.close()
1
cbce6d6d3c6c9a8300af445e200d9f9f
28c66640a8b8faff4f96e0dcf2b9fdb9
Create an instance of {@link ValuationType.EnrollmentAssessment.PrimaryEnrollment }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "elAssessmentType", namespace = "http://www.sifassociation.org/datamodel/na/3.2", propOrder = { "design", "administration", "result" }) public class ElAssessmentType @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { ...
0
5639d92a2ca40323a3fb50eead9de8c9
2bbdaed07694e7b1d3d371dc89f42a94
Get Promotion Apply Qty by court
public int countMatchByCourtId(Integer courtId) throws Exception;
1
d00f9ca2f120d393e5ecc82aae1d698d
cd97d1420cd6bb6313158e8549f7317e
获取当天当次购买云海御剑活动点次数所需元宝
export class ActivityDataMgrBase public getDayLimitHaveBuyCount(giftId: number, id: number) { let dayLimitBuyData = this.getDayLimitBuyData(id); for (let i = 0; i < dayLimitBuyData.indexdata.length; i++) { if (giftId == dayLimitBuyData.indexdata[i].index) { return dayLimitBuyData.indexdata[i].data.fi...
0
05fa8283135b3c578fdbefd481d46f06
fb1790926b18e5e680937c9b4dfaa970
Solve for the root of the fit function (i.e. :math:`f(x_r) = 0`). This method used `scipy.optimize.fsolve` to find the function roots.
def _find_params(params_start, *sample_moments_rho): try: out = tuple(scipy.optimize.fsolve(_equations, x0=params_start, args=sample_moments_rho)) except RuntimeWarning: out = (-1000., -1000., -1000.) return out
1
d67124b889c2df19371daeb62c024182
5ed39a18f0cad5fb6cbeea4a59334113
Returns the subtype portion of the media range.
class MediaRangeTest(TestCase): def test_any_subtype(self): media_range = MediaRange("image/*") self.assertEqual(media_range.content_type, "image/*") self.assertFalse(media_range.any_media) self.assertTrue(media_range.any_subtype)
0
9d992c840db7ffae1839516edcd31b01
8824aa8ab8ffe52089e4c6e79bc48980
Set the minimum amount the joint must move before a joint motion event is reported. Also see enableJointEventCallback() @type angle: floating point number
class CDoubleAxisHingeJoint(CX3DRigidJointNode): def setMaxAngle1 (self, angle): pass
0
19c2f7aebe8ce2760d3e35efbcfeea81
5cb16a9c4f75f3f1eeac150f12fb6ae9
Xác thực quyền truy cập với new
class Employee extends CI_Controller public function __construct(){ parent::__construct(); if (!$this->session->userdata("CheckLogin") || $this->session->userdata('ChucVu') != 'Quản trị'){ redirect(base_url() . "index.php/login/view"); } }
1
12ca1bc01637ebc21b37c7884cca9c59
7f61448ad6da3ef0f9cb03f40c5be655
Ex. 4:
cases like (1)
0
6047d7fafa6bfcce1fcc6d2f84243114
207a5930d6555aaab337d35bfe87dba8
**** SILHOUTTE WIDTH Calculation****
function SievedBlockFunction(a,b){ switch(b){ case 1: return 0.75/(a+1);break; case 2: return 1.25/(a+1);break; case 3: return 2.25/(a+1);break; case 4: return 3.75/(a+1);break; case 5: return 5.25/(a+1);break; case 6: return 7.75/(a+1);break; case 7: return 20.0/(a+1);break; default: break; } }
0
385954c3ecf3ab9d33fd752103fa28c8
7435bcdc321fd8cb67fc2ece5054b490
метод формирования второго меню
public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_second_menu, menu); return true; }
1
358acc678fcf1578713b7e04b5b30b24
f5d20fb6cd8603cf4ca6cfdad7ad3025
given array of 4D points making a polygon, function projects points and draws
function drawQuad( ctx, viewProj, viewProjViewport, p1, p2, p3, p4, color, ndx ) { var b1 = vectorMultiplyProjective( viewProj, p1 ); var b2 = vectorMultiplyProjective( viewProj, p2 ); var b3 = vectorMultiplyProjective( viewProj, p3 ); var e1 = vectorSubtract( b2, b1 ); var e2 = vectorS...
1
27833be8109a426eb6d5dd7ac2c9593c
c3a80529443fc961812dbd569329e39c
Zjištění indexu z ID předmětu
for ($i=0; $i<sizeof($this->list); $i++) { if ($this->list[$i]->getId() == $id) { return $i; } } return -1; }
1
e987219bfee60d018b040e1e7364387e
a130bb95a1aff98665683d63e6683c67
Finds the maze exit
class TestCharacter(CharacterEntity): def find_exit(self, wrld): for i in range(wrld.width()): for j in range(wrld.height()): if wrld.exit_at(i,j): return (i,j)
1
398b65d3581f2d070ae7a7baba995475
24f53c0a5bf70b13acd5e10246b3c6c6
加载外部的web页
public class UnitFragment extends Fragment{ private void loadweb() { webView.loadUrl(String.valueOf(checkURl())); webView.requestFocusFromTouch(); WebSettings setting = webView.getSettings(); setting.setJavaScriptEnabled(true); webView.setWebViewClient(new WebViewClient() { ...
1
222656f8d82578f90ad1235e4b333b4c
d2fb126b0bd8aea14245001632279b6c
更新总时间和显示的歌名
if (OperateMusic.getMusicName(PlayListCache.getCacheMusic(PlayListCache.getPosition())) != null){ mSong.setText(OperateMusic.getMusicName(PlayListCache.getCacheMusic(PlayListCache.getPosition()))); mArtist.setText(OperateMusic.getArtistName(PlayListCache.getCacheMusic(PlayListCache.getPo...
1
59fdccec4839311a2aaeaac54930549c
036a2f7c336f85aec1abd856c522c1e2
将要删除的vid加到待删除数据库中
stmtIns, err := dbConn.Prepare("insert into video_del_rec (video_id) values(?)") if err != nil { return err } if _, err = stmtIns.Exec(vid); err != nil { logger.Info("add video deletion record error:\t", err) return err } defer stmtIns.Close() return nil }
1
bf502497d3991158504eeb2deefc033b
09004adb3f91c740595602ae2f33a6b6
Helper calculates the destination position needed to center a sprite in the middle of the screen.
{ int iWidth, iHeight; lpSprite->GetMaxSize (&iWidth, &iHeight); ptNew->x = ptCenter->x - (iWidth/2); ptNew->y = ptCenter->y - (iHeight/2); }
1
53ee0d9ad3b677bfad8e926d845caf08
0119e5a33d9959c0bca14c18760e6cff
Regression test of issue #11: the expression below segfaulted
class CrashingInferiorStepTestCase(TestBase): def test_inferior_crashing_expr_step_and_expr(self): self.build() self.inferior_crashing_expr_step_expr()
1
fc5fb5bb3597127673aedc46b68f230a
a062b6d4beb1f6a6fa182749af2fb05b
Check if order is all free shipping
namespace AspDotNetStorefrontCore public partial class ShoppingCart public bool IsAllFreeShippingComponents() { return CartItems.IsAllFreeShippingComponents; }
1
1b7884237fd1f3ea2232030993295ccd
84f2f4426cfae4b4925bac5b318cf4e7
Get the UrlMapper instance
class GetUrl extends AbstractBaseHelper public function getUrlHelper() { return $this->urlHelper; }
0
45c363e7a1ce213a23884324afb57331
879dfc704be62a2a5e00b60cc9d79b1e
Displays how long you worked
{ int minutesWorkedSchool; int minutesWorkedHouse; if (*code == 'D' || *code == 'd') { minutesWorkedSchool = addMinutesInFile(1); minutesWorkedHouse = addMinutesInFile(2); printf("You've worked %d hour(s) and %d minute(s) on school and %d hour(s) and %d minute(s) on house work today", minutesWorkedSchool / 60,...
1
e4efb651be5d53987d139387664f1e7a
75431e3e1c9dad92e2752e0b79c15900
Selects Hierarchy level from filter.
public class HierarchicalFilterSetting extends AbstractFilterSettings public final IntegerParameter getEndLevel() { return endLevel; }
1
e3c12f661c78ada889a0940cbf21661c
5807625e66a7ed1072a65fa1e71736e5
查看担保人附件
@Service @Transactional(readOnly = true, rollbackFor = Exception.class) public class FlowBankAccountService extends FlowServiceBase public void setGuaranteeLetterFile(FlowBankAccount o){ if(o.getGuaranteeLetterFile() != null && StringUtils.isNotBlank(o.getGuaranteeLetterFile())) { Attachment atta = ...
0
22b94980d2f7fd94812a6125eac86926
ff59f53aa143fc40f7de59bd6ad3fee9
Query to determine gamedays in current season where no data for team_opponent_dashboard table Returns: query string
def upcoming_matches(): return ""
0
90c5122ef3e3b9567d02dd6402b34eb1
c523a39165f698fdc3d785a682737aa6
开启脉冲计数
void openTime() { TIM_Cmd(TIM3,0); msHcCount = 0; TIM_Cmd(TIM3, ENABLE); }
1
4f3c0b735cfb249fc69ccd722eeb4ba1
f0edd71110606e17031872c1043932d4
Calculate the maximum distance between all pairs of coordinates --> (km, mi)
class TweetsRepository implements ServiceRepositoryInterface protected function calculateMaxDistance() { $this->numLocations = count($this->coords); for ($i = 0; $i < $this->numLocations - 1; $i++) { $coordA = Geotools::coordinate($this->coords[$i]); for ($j = $i + 1; $j < $this->numLocations; $j++) { ...
1
df676d1f3854735d1fc848959e4f9119
74a06700276537648f038a405e79e023
商品検索キー設定
namespace KyoeiSystem.Application.Windows.Views public partial class ZIK05010 : WindowReportBase private Dictionary<string, string> setSearchParams() { Dictionary<string, string> dicCond = new Dictionary<string, string>(); dicCond.Add("倉庫コード", Warehouse.Text1); dicCond.Ad...
1
022762092c42c7dc1e6863744c36c5cc
0f095c80390e48e1af45e70c8ea3e5b4
获取物流公司code列表
$where = [ 'status'=>1, 'is_delete'=>0 ]; $res=LogisticsCompany::where($where)->field('id,name')->order('sort ASC')->select(); return $this->buildSuccess($res); }
0
9c4f5ae71ec2dd6fbe7477bc6fcb8cfc
9d202bd1c80e5815050d95fefb5417a7
Get the whole traceback stack with locals at each frame and expand the local with additional info that may be useful.
p('START Extended Traceback', '!!!') tb = sys.exc_info()[2] while 1: if not tb.tb_next: break tb = tb.tb_next stack = [] f = tb.tb_frame while f: stack.append(f) f = f.f_back stack.reverse() traceback.print_exc() print 'Locals by frame, inn...
1
f9ec46cdaa79c7df45e0016a6d7c91e5
781d9607a3360430353c13037c515f04
Send the rootSpans to zipkin service
if self.do_pop_attrs: pop_zipkin_attrs() if not (self.is_sampled and self.logging_initialized): return end_timestamp = time.time() self.handler.parent_span_id = self.old_parent_span_id self.annotations.update({ 'cs': self.start_timestamp, ...
0
3561813328e93a00140f163d243d331a
4816cd5ad8266fd3e68fc3cac0d0bf87
utility structure that simplifies creating and manipulating DOM nodes
function Element(name, attrs, parent) { return { elem: function (name, attrs) { var e = Element(name, attrs, this); this.children.push(e); return e; }, children: [], name: name, _attrs: attrs || {}, _parent: parent, parent: function () { retu...
1
89878749cb0b0c7d63ab6521821a0246
45abfb55f9d8db40a0ef1a81071e419d
학생들한테 명령문을 전송함
namespace Assets.NetService public class NetSDKManager public static void SendToStudentCall (string command, JSONObject msg, string stuKey, Action<Message> incallback) { SessionManager.SendToStudentCall (command, msg, stuKey, incallback); }
1
f92042b5810507b779763fa946443684
29ddc9668ed1c582066b2de2994a948b
All certificates prepared for by a course.
class CertificateBuilderService public function getCertificates() { return $this->_certificates; }
0
847f04d013d6b10a9ab859e682f7178a
37ef69486c8e040c12e62ce339deae78
机器人发送当前点位过来时的事件处理程序
{ mchip.open[pkt->rx_node] = true; point* pt_ptr = (point*) pkt->data; mchip.neix[pkt->rx_node] = pt_ptr->x; mchip.neiy[pkt->rx_node] = pt_ptr->y; program_num = pt_ptr->pnum; if(program_num >= 50){ program_num -= 50; reset_myself(program_num); } LED_PORT.OUTTGL = LED_USR_2_PIN_bm; }
1
43b9640ed6bb735a198b9d85fa299589
c12ca32bad8812aaff57e4aee49ebed2
大屏父窗口
wx.Frame.__init__(self, None, -1, title=title, size=(920,700)) self.SetIcon(wx.Icon('icons/logo.ico', wx.BITMAP_TYPE_ICO)) self.sp = wx.SplitterWindow(self) self.p1 = ProvPanel(self.sp, -1, style=wx.BORDER_SUNKEN|wx.TRANSPARENT_WINDOW) self.p2 = wx.Panel(self.sp, -1, style=wx.BOR...
1
a5d667f99516ac3ff0c37ed670617d38
8132d7d995de815afc9d870293187c9c
Update logged-in user's rating of given movie
def update_rating(movie_id): email = session['email'] user = db.session.query(User).filter(User.email == email).first() ratings_list = user.ratings movie_id_list = [r.movie_id for r in ratings_list] if movie_id in movie_id_list: old_rating = db.session.query(Ratings).filter((Ratings.movie_id...
1
97eff01397e7a5213605fd1d1ba1ebe2
135914e5bcd97e3818b36757d877d45f
Validazione dati registrazione studente
class RegisterUser extends User public function verify(){ $stato = true; if(empty($this->username)){ $this->errors[] = "Username not valid"; $stato = false; } if(filter_var($this->email,FILTER_VALIDATE_EMAIL) == false){ $this->errors[] = "Email not val...
1
a0ad77d1eea2e8c228582f206cb72435
5837349aad6d01ada3e393ecd531c832
Xử lý sự kiện khi người dùng chọn thay đổi chủ đề của bản đồ
const data = e.target.options && e.target.options.extData if (this.graphicSelect) { this.map.setView(L.latLng(data.latitude, data.longitude), 12) this.graphicSelect(data) } }
0