query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9a92806e81d446c75766fe4eea4c98d4 | afa108475850ac118518c94f0283ce64 | обновить значение всех анимируемых параметров | [RequireComponent(typeof(Rigidbody2D))]
[RequireComponent(typeof(Collider2D))]
public class Entity : MonoBehaviour
protected virtual void setAnimationParameters()
{
anim.SetFloat("speed", Mathf.Abs(rbd.velocity.x));
anim.SetFloat("verticalspeed", rbd.velocity.y);
anim.SetBool("grounded", isG... | 1 |
7c86560cb6a3ea7372e0dc7ddfd06c27 | 45656db96fa4d366c037e41445ac1d8a | Initializes the UI callback behaviour for this session. Called from
{@link #createUI()}. | public class SiteDescriptionActivity extends ListActivity
public void setUI() { ... } | 0 |
a1b5c5599b6666ce9d04ed26803530c6 | 8ac94da1bea165c4e264629753786fc6 | Sets the title of the edit article form to the given value. | public class PartController implements Initializable
public void setFormTitleLabel(String formTitleLabel) {
this.FormTitleLabel.setText(formTitleLabel);
} | 1 |
ed0a097012ceaee7da15ef83b8dcf9d6 | 47f2054b476b8d68340e6a06be51ce26 | 结题报告列表. | Object myReportList(int userId, int tagId, int subject,String cv,int terminal) throws BizException; | 1 |
1d3e41db78ce653c7e69f54329cd3b87 | a1e8b970501c9195f3b7c7af6c0f3166 | gets this wolf's angry state | public abstract class Character
public abstract boolean getWereWolf(); | 0 |
53b2f34ebec3a9b4248ddca346e7927e | 15edfbf606901bf553b3a9d154aa5675 | Gets a value indicating whether the specified parameter has a default value. | {
var literal = expression as Literal;
if (literal != null)
{
return Equals(literal.Value, GetDefaultValue(type));
}
var unary = expression as UnaryExpression;
if (unary != null)
{
var operand = u... | 1 |
c9a3212d2e5eef3e70015ddb5c8a4a1a | 1548a17414dcf57a9877a7a1fa378a3e | Gets the status key. | class Submission extends DataObject
function getStatusKey() {
$statusMap =& $this->getStatusMap();
return $statusMap[$this->getStatus()];
} | 1 |
679f4087f70a0ab51e61c536f9a1f982 | 8c8474d8dec2e84a0845d81516ac0ef5 | Seeds the pagelets. | class SmartController extends FirstController
protected function outputPagelets($context)
{
$pagelets = array();
foreach ($this->pagelets as $pagelet) {
$id = $pagelet->getParam("id");
if( in_array($id, $this->ids) ){
$config = $this->outputPagelet($pagelet... | 0 |
15ff1558ec3e56085af36aa5afbc3c3e | 685e78d3f60cfc92acefc1690e01bb5c | Serializa y guarda un objeto Universidad en un archivo xml | {
IArchivo<Universidad> archivosXml = new Xml<Universidad>();
string rutaArchivoXml = AppDomain.CurrentDomain.BaseDirectory + "xmlfile.xml";
if (archivosXml.Guardar(rutaArchivoXml, uni))
return true;
else
return false;
} | 1 |
72a4076736d935b1cdb16b3cfadaeb2a | 95d6a0e9d65dfa34cbc9f98e63877638 | Funktion, die Rotationswinkel liefert | float ring::getRotation() {
return _rotation;
} | 1 |
1b9f86fc23a6608917e5117378491c86 | 30cef6b4dcf518491b25e6bce47e0d41 | Set if the Salesforce application is on a
sandbox or a production organization. | final class RegisterCreateAccountRequest extends AbstractNotAuthorizedRequest
public function setSandbox($sandbox) {
$this->sandbox = (bool) $sandbox;
} | 1 |
b296121661a1ec0c3fae133df1a3ec22 | 3be98a203a38de974a8dc1a0b841cb43 | Get upload cutoff period. | class upload extends rapid
public function getLimit()
{
return self::$limits;
} | 0 |
8a1d03e858f7a0f72c8368414646ab37 | 459b89fccf2bd1de6b15588832536ee9 | Records the current time as the time at which route selection was completed. | try:
user = getattr(current_user, 'name', None)
if user is None:
user = getattr(current_user, 'username', 'unknown')
OX_PROF_BP.record_req(user, request.endpoint, g.ox_prof_ts,
datetime.datetime.utcnow())
except Exception as problem:
lo... | 0 |
f35540d77f05d1546c2543c58346055d | fdcc080ca29963953cfc785550642010 | Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
filters are used in many different applications CITE: EM11 .
param src Input 8-bit 3-channel image.
param dst Output 8-bit 3-channel image. | namespace OpenCVForUnity.XimgprocModule
public class FastBilateralSolverFilter : Algorithm
public void filter(Mat src, Mat confidence, Mat dst)
{
ThrowIfDisposed();
if (src != null) src.ThrowIfDisposed();
if (confidence != null) confidence.ThrowIfDisposed();
i... | 1 |
295f5c4ad4abcc5cf7f282df95650637 | 6c5309f08835dfb6c530cdc1c70da104 | Get the width of the container as a count of the lowest level containers | const nodes = [].slice.call(container.childNodes);
if (nodes.length < 1) return 0;
return nodes[0].offsetWidth;
} | 0 |
1e66980ca714ec2113955dfb9283dafd | 9e8664953e739c49ab303821098d66de | 指定の地点における曲線の半径を設定する(カントは前の構文の設定値が引き継がれる 構文間の数値は補完される) | namespace TR.BVEMapMaker
public class Map
public class Track
public class Cant
public void SetGauge(string TN, double Gauge) => SetGauge(0, TN, Gauge); | 0 |
5703b2ebef37b3012425b63bf1c3da9e | 2cb921af0ad710d27c65cdbcd966c314 | This calculation accounts for areas that exactly line up with the tiles
and those that end somewhere in the middle, snapping down and right. | public class PlaceUtils{
public static NormalizeResult normalizeArea(int tilex, int tiley, int endx, int endy, int rotation, boolean snap, int maxLength){
if(snap){
if(Math.abs(tilex - endx) > Math.abs(tiley - endy)){
endy = tiley;
}else{
endx = tilex;
... | 1 |
cebbbf6882c704d9716cd04f0d7fa416 | e6636531a45ebc3b41168c3e75668216 | Test case for data_context_oam_context_meguuid_meplocal_id_odu_connection_end_point_spec_odu_ctp_get | class TestTapiOduController(BaseTestCase):
def test_data_context_oam_context_meguuid_miplocal_id_odu_mip_spec_odu_tcm_get(self):
response = self.client.open(
'/data/context/oam-context/meg={uuid}/mip={local-id}/odu-mip-spec/odu-tcm/'.format(uuid='uuid_example', local_id='local_id_example'),
... | 0 |
6986e7f70bd494fceedead2b980677d5 | 39678a20d2fee05c6d3318b5b522e579 | 验证状态码是否是失败状态码 | func isFailure(statusCode int) bool {
return statusCode < http.StatusOK ||
statusCode >= http.StatusMultipleChoices
} | 1 |
03ffc84fd0fdb229d0a130e722c8033c | fe7f2dd1ba09139aed61e3a6fae6e881 | 将用户的地理信息保存到cookie | class SelectedAddress
protected function saveAddressInCookie(): void
{
$address = $this->getAddress();
$data = [
'country_id' => $address->getCountry()['id'],
'region_id' => $address->getRegion()['id'],
'city_id' => $address->getCity()['id'],
];
se... | 1 |
5cdc02a3933c621a1d9096d1c744fc9a | 0a19cb315b26ca863573a89d199486b8 | Returns the last generated token. Does not generate a new one. | public abstract class AbstractPdfContentAnalyzer
public PdfToken getLastToken() {
return lastToken;
} | 1 |
cb9144160fe35e1d44eb0a9895d8994d | c0063e8be275c9edab69853c94b6c7b2 | Unmounts all children of HTMLElement | if (children.length) {
children.map(child => toNativeEl(child)).forEach(nativeChild => this.el.removeChild(nativeChild))
} else {
while(this.el.firstChild){
this.el.removeChild(this.el.firstChild);
}
}
return this
} | 1 |
47d97a268eb246848d41d112e2e49451 | 1acf52bc2dfa91a88ed2cc2571955278 | first fill in missing entries in both indicator matrix & trader pnls | def add_missing_indicator(df, var):
df[var + '_NA'] = np.where(df[var].isnull(),1,0)
return df | 0 |
a8c444cbe08e877db507237345a2b595 | 9a5d4971c37793e10b782ea6db6709e9 | <include file='IVMRWindowlessControl.xml' path='doc/member[@name="IVMRWindowlessControl.GetColorKey"]/*' /> | [MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(325)]
public HRESULT get_stopColor(VARIANT* p)
{
return ((delegate* unmanaged<IHTMLCSSStyleDeclaration*, VARIANT*, int>)(lpVtbl[325]))((IHTMLCSSStyleDeclaration*)Unsafe.AsPointer(ref this), p);
} | 0 |
b293148d024c790ac54ca8be8a74639b | 028e4d2d1dc8b3b544bebeff1c38a396 | Speichert die bearbeiteten Daten des ausgwählten Fahrers. | export class OwnerInfoComponent implements OnInit
saveData(): void {
console.log('this.carForm.value ', this.carForm.value)
const newCar = {
...this.carForm.value,
id: this.owner.id,
}
console.log('newCar ', newCar)
if (this.editMode) {
this.carOwnersService.editOwner(newCar).subsc... | 1 |
bdb9328e4c9bd813a111e4493c196fb5 | 2db1e5670dd153f776f9b6badb66ddb8 | 按第index列对文件内容进行排序 | double[][] d = m.transpose().toDoubleArray2D();
for (int i = 0; i < d.length; i++) {
d[i] = sortArray(d[i], index);
}
m.setArray(d);
return m.transpose();
} | 0 |
4f72c30aef188d377350cead92f6bef3 | 4a23ba92455f4d4a571abb21c2bda38b | Return Angle Between Agent and Target,if target is null, return infinity | {
int targetAnt;
if (speed > 0)
{
targetAnt = id + 1;
}
else if (speed == 0)
{
return double.MaxValue;
}
else
{
targetAnt = id - 1;
}
... | 0 |
c886862761f595227a43f44aab40395e | 802a6361d5548f10f69e81d604949556 | Returns the classpath containing all plugin libraries. | {
if (getExtraClasspath() == null)
{
this.extraClasspath = new Path(getProject());
}
return this.extraClasspath.createPath();
} | 0 |
0977afa0a47ab98a77cc626b3ed8eda1 | b53438c339d3cd8ec8cf0fc2e0630365 | returns whether the main variable was changed | def checkVar(s):
global var
for v in vars:
if v in input:
var = v
return True
return False | 1 |
9693c3ba9b6e37a95423b9e2d2601afe | a84484058690d507cccf93518e9f1942 | Display completed tasks assiged to logged in user | {
$assign_tasks = DB::table('assign_tasks')
->join('admin_tasks','assign_tasks.task_id', '=', 'admin_tasks.id')
->select('assign_tasks.*','admin_tasks.worktitle','admin_tasks.workdescription','admin_tasks.whatinitforme','admin_tasks.usercredits','admi... | 0 |
2fc82e25ee0618f99dced94c0cf0ea40 | 745dcbc721892fc5d5e08a9464530161 | adds an item and sorts the list | class ItemList:
def add_item(self, new_item_criteria):
self.items.append(Item(*new_item_criteria))
self.sort() | 1 |
369115f648f9181c28aa7c0cd72644bb | 3cef98adacec7ab99fc5d80afdfe6481 | Finds the Mailing model based on its primary key value.
If the model is not found, a 404 HTTP exception will be thrown. | class MzeeController extends Controller
protected function findModel($id)
{
if (($model = Mzee::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | 1 |
d951cfbfbf43b4b88740f7415802dbea | 7a86a80690dda92695c72f274c9db9c1 | Task 1: Write a function called int_return that takes an integer as input and returns the same integer. | func func1(a int) int {
return a
} | 1 |
307d398df7afa59b1f8d44d09c732903 | 9d24daad73ff7623850cf84a9b2d5b0b | Is credit points amount valid? | {
amount = 0;
if (str.Length <= 4 && int.TryParse(str, out amount) == true)
{
return amount > 0;
}
else
{
return false;
}
} | 1 |
35d26bf73287a6615160888567c900d0 | 6d34c8b6dcb1933e6489b57b6230e389 | floyd算法遍历出所有点之间的最短路径和记录路径 | class Floyd(object):
def floyd_search(self):
for mid in self.graph.vertex_set:
for start in self.graph.vertex_set:
for end in self.graph.vertex_set:
if self.dist[start][mid] < self.INF and self.dist[mid][end] < self.INF:
if self.dist[start]... | 1 |
03c1c12f74acedaaa931fcff9442061f | 53992eb1a9d9c81dd3e78de22801a20c | RECLAIM DELETED INODES
The following thread scans the file system once looking for deleted files | {
ext2_filsys fs = ctx->fs;
ext2_ino_t ino, next_ino;
struct ext2_inode inode;
struct problem_context pctx;
char *block_buf;
if ((ino = fs->super->s_last_orphan) == 0)
return 0;
fs->super->s_last_orphan = 0;
ext2fs_mark_super_dirty(fs);
if (fs->super->s_state & EXT2_ERROR_FS)
return 0;
if ((ino < EXT2_FIR... | 1 |
429f6d66d28bff05704622ac39c0c894 | ed3114a43ec471f476a9032577262777 | Test the ToListOf converter. | namespace Util.Tests.Maps public class MapTest
[Fact]
public void TestMapToList() {
List<Sample> sampleList = new List<Sample> { new Sample { StringValue = "a" }, new Sample { StringValue = "b" } };
List<Sample2> sample2List = sampleList.MapToList<Sample2>();
Assert.Equal... | 1 |
27a17dd4ce978684a7b17a59e0d61880 | 4392b6fecf19474a20d190f2c4bf23b2 | Cerrar todas las tabs excepto la de uso actual | class TabWidget(QTabWidget):
def close_others(self):
current_widget = self.currentWidget()
self._try_close_dirty_tabs(exept=current_widget)
i = 0
while self.count() > 1:
widget = self.widget(i)
if widget != current_widget:
self.removeTab(i)
... | 1 |
734cb05efc81b0297be399e0159e1907 | 8e8ebef1226c519e1415830a38f0eb7d | Returns the comma-separated list of argument values. | class Field:
def value(self) -> str:
return " ".join(self.data["args"][1:]) | 0 |
fbd308e1e21ed608aeadd421c79ea2ad | bc9ba087563c6789139d3e394aa2083b | Get the ids of the related model to filter by. | abstract class BaseController extends \Illuminate\Routing\Controller
public function filterableBy(): array
{
return [];
} | 0 |
6748b7c66278119976ffff25b5ead060 | 95db5fb82cd51f95c8ecbdcfcd2ea8e1 | convert form info to Info type | impl Info
pub fn from_raw(raw: quirc_data) -> Self {
Info(raw)
} | 0 |
e603f692e7d4dfb3c5fe9c8b3e1fd38e | 1542e76fc9ca91aaeda2e184055ed934 | Load entries for converting to compressed codes. | namespace bytepress.Engine
public class Presser
private void LoadCompressors()
{
_compressors.Add(new GZIP());
_compressors.Add(new QuickLZ());
_compressors.Add(new LZMAez());
} | 1 |
7a9b674fd50389523c59934efbb760ae | 4d13c6bfbed216ad00585e756070702d | 创建数据并且返回编号 | class BaseModel extends Model
public function addData($data) {
$id = $this->add($data);
return $id;
} | 1 |
cba48654c52ed07f6b939befdede9f05 | 8b827e825e8a614d5f45f9d3c74528b3 | Integration testing for basic_operations.py | def test_basic():
pass | 0 |
420f7d0e0037c13cd97fae556651ae6b | ff86944b28b99c8a8708755cf28fcf7e | Normalizes choices into values for Solr query. Transforms predefined
ranges and validates choices. The result is always an array with two
values (start and end). | {
$choice = $this->type->normalizeChoice($this, $choice);
if ($choice instanceof \Closure) {
$choice = call_user_func_array($choice, array($query));
}
return $choice;
} | 0 |
927c0acf114902baba4ca6394a76024b | 8b30379e5efe46a0542b3d81e895f09f | Listener welcher darauf reagiert wenn das Fenster geschlossen wird | public class SpielGUI extends JFrame implements WindowListener, KeyListener
public void windowClosed(WindowEvent e) {
} | 1 |
4cf12d6407d95f40205943b33baafbc0 | 4bbb5a9a02660fa87402866b6ee22f32 | Add filter by orderId and verify that only the details of the orderId which was passed on filter is displayed in History book | namespace Online_SHopping_Cart.Controllers
[HttpPost]
public ActionResult OrderDetails(int OrderId, int UserId)
{
List<OrderHistory_ViewModel> ohvmlist = new List<OrderHistory_ViewModel>();
string userName = db.User_Table.Where(x => x.UserId == UserId).Select(x => x.UserName).Fir... | 1 |
3d63a71160a2e9c8410ed2ada4fb225d | 8902403a5c86a2bfcc5695f8b2ea2247 | 从所有数据源得到属性,这里是多个ZooKeeper | List<String> children = zkClient.getChildren("/", true);
for (String child : children) {
System.out.println(child);
}
Thread.sleep(Long.MAX_VALUE);
} | 0 |
b4bed5eea4f1616d91a263f8e46bb00b | eb4c070eca1bb33ae049228a5485a8af | 将dataFrame格式数据导入数据库表tb,默认数据库链接。 | class DataOperator(object):
def insert_from_df(self, df: DataFrame, table_name: str):
if not self.db_engine:
self.create_db_engine()
try:
df.to_sql(table_name, self.db_engine, index=False, if_exists='append')
except Exception as err:
err.args += ("error in dat... | 1 |
a38d8846a78ae38e104410edeb132f67 | 309fae431bfac34b8ddab6ef8addd62a | Test that the correct names of active customers is returned | customer_ids = [123, 12345, 1234567]
customers_list = search_customers(customer_ids)
self.assertEqual(customers_list[0]['name'],
'Elon')
self.assertEqual(customers_list[1]['name'],
'Jeff')
self.assertEqual(customers_list[2]['name'... | 1 |
5a485145ba3691015764fffda4c1aa0d | b03ef4f785ffbe11123919a875cd41c9 | Returns original size | match self.orig.size_hint() {
sz @ (0, Some(0)) => sz,
(0, _) => (0, None),
_ => (usize::MAX, None),
}
} | 0 |
44cdb787c796ca998f0cc8a3274cd052 | ee8c6b85309b6eec758d6edc0c36f952 | 界面控件_取得播放前等待 | function GetSelWndIsPlay() {
var v = preview.GetSelWndIsPlay();
alert(v);
} | 0 |
b1c09f48a7fa3ab26c7b051a141d58ca | 2e0961ae03c450da0a78bbd0ada01367 | Return the partition of the nodes at the given level
A dendrogram is a tree and each level is a partition of the graph nodes.
Level 0 is the first partition, which contains the smallest communities,
and the best is len(dendrogram) - 1.
The higher the level is, the bigger are the communities | check, queue, levels = [False]*len(G), [start], [0]*len(G)
while queue:
x = queue.pop()
if check[x] == False:
check[x] = True
for y in G[x]:
if check[y] == False:
levels[y] = levels[x] + 1
queue.append(y)
return ... | 1 |
71274bb1847b25600280a8114343a69d | 293393552507a0c804fd83b7eb1b38f1 | add an additional objective function | void OptimizationDialog::addFunction()
{
int idx = mpFunctionsComboBox->currentIndex();
addObjectiveFunction(idx, 1.0, 1.0, 2.0, mSelectedVariables, QStringList());
} | 1 |
07bae7f553a501dc1b9f29e60fa56b20 | 2dfb0d26d2ddcae459f628a5fbef7966 | Default execution for API methods. | class BaseClient:
def exec_api(self, path, **kwargs) -> NoReturn:
raise NotImplementedError | 0 |
855eaba66e2eb302b01d73de2167ab39 | 82cba8ae975193c5621b720ac3feb803 | Get the currently configured cache implementation for template calls. | class Configuration
public function getMetadataCacheImpl()
{
return $this->attributes['metadataCacheImpl'];
} | 1 |
d9cc58f25d09f4f6aae64b19da471794 | 2d1e38f771b76fc8f0082b1c2f8f9827 | Action을 Dispatcher에서 동기식으로 실행한다. | namespace System.Windows.Threading
public static class DispatcherExtension
public static void InvokeAction(this Dispatcher dispatcher, Action action, DispatcherPriority priority)
{
if (dispatcher == null) throw new ArgumentNullException("dispatcher");
if (action == null) throw new A... | 0 |
e2fce09f7db9949ca48d68fa6eac119b | 08d375a0f4a038a398a4642c7b09594a | A multivariate power series is a unit if and only if its constant
coefficient is a unit. | if allow_negative_monic:
return all(abs(coef) == 1 for coef in expr.as_coefficients_dict().itervalues())
else:
return all(coef == 1 for coef in expr.as_coefficients_dict().itervalues()) | 0 |
41817cd035b0edd664fa08775d6df6a1 | 600d525e51a828a88e69f0b6833abb4b | Funzione utilizzata per pagare quanto dovuto dopo un'asta. Attualmente impiegata solo dalla
versione delle simulazioni non bufferate. | public class Junior extends Dipendenti
public void calcolaPaga(){
} | 0 |
17c393bbc62581c2fae8e81c09bfb81b | 798fad95395c87169a4c30f1f0f8bc05 | 是否为服务器插件 | function isServerFile(file) {
if (file.ATTACH_ID) {
return true;
}
return false;
} | 0 |
2fd48d1109cfcee4007e3812b5bfd77a | 05c1514cf03c0737abfe8603185ef8c9 | Changes batchsize depending on the performance of the reward | class Agent():
def learn (self):
if self.memory.mem_cntr < self.memory.batch_size:
return
self.q_eval.optimizer.zero_grad()
states, actions, rewards, states_ ,terminals, batch_index= self.memory.sample_buffer(self.memory.batch_size)
states = T.tensor(states, dtype= T.float).t... | 0 |
6fcf5ac500733e7ca1ca66d7e4ce97e8 | 272d6760372d6a306939332c7cdeba88 | @summary: 根据亲和组名称获取其id | for i in range(0, len(group_name)):
if an_id[2] in group_member[i]:
return group_name[i]
return '其他' | 0 |
636ddf87d138852416a92fe542801123 | 0c33533d8370416ca3eaf649ecc9fb3a | Randomly samples sequences and outputs to files. | if args.m == 'random':
get_rand_seq(extract_seq(), extract_otu())
elif args.m == 'consensus':
get_cons_seq(extract_seq(), extract_otu()) | 1 |
16ca5d1f57de3e0513d7eaf9b180bbb7 | 693be0be9275370b4891fb6de31b1aff | Gets "system" information.
Calls snd_seq_system_info() and puts the relevant values into
the passed array. | VarBind *
stsSystem_get(OID *incoming, ObjectInfo *object, int searchType,
ContextInfo *contextInfo, int serialNum)
{
return (v_get(incoming, object, searchType, contextInfo, serialNum,
(SrGetInfoEntry *) &stsSystemGetInfo));
} | 0 |
e91efa58ab483eba0815c51a609a0223 | f4a3c4455d6907193ff9c3c9c425ad09 | Test for PhilippinesZoneI | public void IsValid_DZ_All()
{
var country = Country.DZ;
IsValid("01234", country);
IsValid("12345", country);
IsValid("11111", country);
} | 0 |
4fb0474addd36b727b36d975b0f79780 | 8dd7b8114ed5c90960bc34f48499f86b | 加入到"我的商品"清單 (代表已按下新增按鈕) | function addProductCollect(){
location.href="addProductCollect";
} | 1 |
9b34f0001cb078d198306fdcdc0c7504 | 50277f3fd3ccf84cb20a30f268640875 | Not required for this operation. | public final class NullCompoundOperation<T extends Enum<T>> implements CompoundOperation<T>
@Override
public void setHistory(int samples, long time, TimeUnit unit) {
} | 1 |
7b49363225ef26d3d9c68128fccda8bf | 4938214756d120ab5b1a93e170ff06e2 | Keep track of indices of splits of file reader chunks (chunks of data). | self._chunk_size = chunk_size
self._num_chunks = (self._file_size - self._discard_size) // self._chunk_size
if (self._file_size - self._discard_size) % self._chunk_size:
self._num_chunks += 1 | 0 |
8fbbf68f4401851a5952cac085ab3c69 | 34b2231d601c65f6f0e5c9a6187965cb | 创建证书自动续签任务 | {
$issuerChain = [];
$issuerChain[] = $response->getCertificate()->getPEM();
$issuerCertificate = $response->getCertificate()->getIssuerCertificate();
while (null !== $issuerCertificate) {
$issuerChain[] = $issuerCertificate->getPEM();
$issuerCertificate = $is... | 0 |
9aaa7e00a14f80628ab26b241195368b | 51db9468ffd7d432ebb8ee823a1a9b05 | services api does not allow org admins to update their own orgs | url = reverse('user-detail', kwargs={'pk': self.user_1.username}) + 'update_organization_levels/'
data = {
'organization': self.org_1.id,
'organization_levels': {'admin': True, 'regular': False, 'private': False}
}
self.client.force_authenticate(self.superuser)
... | 0 |
81a91e73e5a9617ed870c71a65ab7934 | 4e947266641cd1a35b46b3b00a4d5efb | Show info about an earthquake. | def earthquake_detail(nat_id):
earthquake = Earthquake.query.get(nat_id)
return render_template('earthquake.html', earthquake=earthquake) | 1 |
b02f396e5cfc82cab1189ed986b3c075 | afadc53190d10f17bd41baeb907f086e | @brief 入力から当該層の出力を算出 | std::vector<double> MultiLayerPerceptron::out(std::vector<double> input, bool showResult) {
std::vector<std::thread> threads(num_thread);
int charge = 1;
threads.clear();
if (sda_neurons[0].size() <= num_thread) charge = 1;
else charge = sda_neurons[0].size() / num_thread;
for (int i = 0; i < sda_neurons[0]... | 1 |
8618d0996accddc65db3a2d0032aced8 | 0302647d632c768339fde75c20440c61 | Prevents starting a background thread under any circumstances. | from System.Threading import Thread
import _thread as thread
global done
done = None
def f():
global done
done = Thread.CurrentThread.IsBackground
thread.start_new_thread(f, ())
while done == None:
Thread.Sleep(100)
self... | 0 |
8b3f37aed9f109a006dbc401456b60cb | fceffa2591a60abd50e9f37e8ca50647 | 判断字符串是否半角字符 | namespace step10
static class MyDetection
public static Boolean IsHalfWidth(string strValue)
{
Encoding sjisEncoding = Encoding.GetEncoding("Shift_JIS");
if (sjisEncoding.GetByteCount(strValue) == strValue.Length)
{
return true;
}
r... | 1 |
e1f9d4000ce0a5aea9a9ed65a4d0b3d5 | b24afb73703b66b8fba3bf1d7345e92e | gets the full yelp details to flesh out the record from just its phone number | class YelpAPI:
def business_details(self, business_id):
url = BUSINESS_DETAILS_URL.replace("{id}", business_id)
response = self.request(url=url)
return response | 0 |
1d7b9797b96475f1394b5f327a282c36 | 2de78f052d46c19a78b76cdd451367a8 | Añade un listener de eventos al comando para una propiedad | namespace TappauMVVM.Commands
public class Command : CommandBase
public Command ObservesProperty<T>(Expression<Func<T>> propertyExpression)
{
ObservesPropertyInternal(propertyExpression);
return this;
} | 1 |
16287435ac24d994b02d5407eeb914a1 | 0e3358929604a6bc7d9dc5152f1320d4 | Override a mouse click on the titlebar to allow a move. | class Titlebar(Widget):
def eventMousePress(self, event):
if event.button == GLUT_LEFT_BUTTON and event.state == GLUT_DOWN:
self.parent.startMove()
elif event.button == GLUT_LEFT_BUTTON and event.state == GLUT_UP:
self.parent.endMove()
return True | 1 |
8081aae12baa1b319ad8ea95ef1d6e59 | f906ff385d7fc7618dee39e4abce8602 | Exit a parse tree produced by VisualBasic6Parser#moduleBlock. | class VerexListener(ParseTreeListener):
# Enter a parse tree produced by VerexParser#vfile.
def exitModule_instantiation(self, ctx:VerexParser.Module_instantiationContext):
pass | 0 |
f74547851722a9e6179673407c37e5cd | 4dac8a1a1a13853e15ee41a747681ca7 | Remove unused (but auto-added) tags. | class Settings(EventDispatcher):
def __update_new_tags(self):
for tag in self.tags:
if tag not in self.__new_tags:
continue
self.__new_tags.remove(tag)
self.__update_new_tags_file() | 1 |
267249e344b7cd940766d1c2557819ca | cd6df8e60e5fd1df56a48fba47314828 | Sets the selected layout and closes the dialog. | public class ExtendedAttributeDialog extends javax.swing.JDialog
private void doClose(int retStatus) {
returnStatus = retStatus;
setVisible(false);
dispose();
} | 0 |
b3fcdc5b760533996401368b5621419f | be0db5e71b36589e24a7c613ed32a48f | Permet l'affichage d'un écran noir, servant à cacher le menu précédant pour en afficher un nouveau
en évitant toute superposition | public class Graphics
public void pause() {
GL11.glColor4f(0f, 0f, 0f, 0.5f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(0,0);
GL11.glVertex2f(0,resolutionY);
GL11.glVertex2f(resolutionX, resolutionY);
GL11.glVertex2f(resolutionX, 0);
GL11.glEnd();
} | 1 |
33fa2caf42480d49f5523fc6ada7ecf9 | fb248fd288a1a2f472598d5b2d2bc44c | Lap의 랭크 업데이트 | public class TimeCount : MonoBehaviour
public void LapCount(int playerID)
{
Debug.Log("ラップタイム" + _timeCount);
timeRanking.SetLapTime(_timeCount, playerID);
if(_isTimeAttack)
{
InstantiateLapTimeText();
}
_lapTimeCount = 0.0f;
} | 1 |
5ea7dc1d7d4af5db2700128ab42152f1 | eaa077d555af308231890758436a98ba | test 2: encrypt/decrypt a big file | func TestFiles(t *testing.T) {
t.Parallel()
tt := []string{
"rand500MB",
"rand100MB",
}
key := randKey()
for _, pName := range tt {
pPath := "testdata" + string(os.PathSeparator) + pName
eName := pName + ".enc"
ePath := "testdata" + string(os.PathSeparator) + pName
dName := pName + ".dec"
dPath := "t... | 1 |
671974432447b78bc50a881cdf1b72b5 | fb16509b6606a2d74483ea5365d5aad4 | Obtain DBMS specific SQL code portion needed to declare a timestamp
field to be used in statements like CREATE TABLE.
of the field being declared as array indexes. Currently, the types
of supported field properties are as follows:
default
Timestamp value to be used as default for this field.
notnull
Boolean flag that i... | abstract class AbstractPlatform
abstract public function getDateTimeTypeDeclarationSQL(array $column): string; | 1 |
5fe0b98a4aa5876663cc48e8db1c6a20 | befd22a2a55b2f13600359a3a315122f | check if string ends with needle | function endsWith(haystack, needle) {
return haystack.slice(-needle.length) === needle;
} | 1 |
34ea3a4c36f1060cbcea76a2e7c1ae99 | 50456d6a5d5a72a845ae5ab1459059d2 | handler for the mouse click in the generation state | public class GuiModelSelection extends GuiScreen
protected void mouseClicked(int x, int y, int button)
{
super.mouseClicked(x, y, button);
if(y > guiTop + 17 && y < guiTop + 88)
{
if(x > guiLeft + 8 && x < guiLeft + 150 && getFirstModelId() + (y-guiTop - 17)/18 < models.length)
... | 1 |
17536c99f1f97e4fc9d154d6ab3ab437 | 8dcc40c99cbc1068b5ba3787e4db87a5 | 403 errors won't happen in client only apps,
so we can stub this method. | namespace Scorpio.Authorization
public class AuthorizationService_Test : IntegratedTest<AuthorizationTestModule>
[AllowAnonymous]
private void FakeMethod()
{
} | 1 |
ad61ec68591dce5e380241fdaa9e1913 | 9126ad7c275a83e092bdba0c5ded9da7 | Teste de pesquisa de cliente | public void testSearchCustomerByCpf() {
Customer customerAuxOne = null;
Customer customer1 = new Customer("Diego", "07278910112", "3422-1010",
"diego.sousa@dce.ufpb.br", "S3cr3t", 18, 11, 1988);
threadControl.prepare(getAddCustomerFinishedState(1));
facade.addCustomer(customer1);
threadControl.waitUntilS... | 1 |
b5ea87bb5a2e309939cadcce77248f5f | 35016ec68ba01fc03367c9c6bcfba01e | 参数转为JSONArray | JSONArray array = null;
if (list.isEmpty()) {
return array;
}
array = new JSONArray();
for (Object o : list) {
array.put(toJSONObject(o));
}
return array;
} | 1 |
584fc5fad8915eee61667db1249a73d0 | 616a20219ad2606b40f1433767592e26 | 创建春节猪头底板 | function createBp() {
for (var i = 0; i < 60; i++) {
var widths = 2;
var heights = 8;
if (i % 5 == 0) {
widths = 4;
heights = 16;
}
var num = i * 6;
$("<div></div>").css({
width: widths,
height: heights,
back... | 0 |
ef04576a178ed1241d669b4d46d2dbda | ad94e76eb9b8c51a7b05e84fd694fc73 | # Black-Scholes IV apporoximation formula by Hagan(2002) | blackSholesPut<-function(S0,k,sigma,r,t){
d1<-(log(S0/k)+(r+sigma^2/2)*t)/(sigma*sqrt(t))
d2<-d1-sigma*sqrt(t)
p0<--S0*pnorm(-d1)+k*exp(-r*t)*pnorm(-d2)
} | 0 |
9d4b344b34ccbc40ed1276fb1336ccac | 74c2119b6593deb0f572a581f34588dc | # 改行を取り除く | clean_text <- function(col){
return(gsub("[\r\n;]+"," ",col))
} | 1 |
447db3ab8e99feaa50c6bea8017ab516 | 4ffc988e5216b88d2c9898eec40b20fe | 查找所有可用端口 Find all available ports | {
IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties();
IPEndPoint[] ipsTCP = ipGlobalProperties.GetActiveTcpListeners();
IPEndPoint[] ipsUDP = ipGlobalProperties.GetActiveUdpListeners();
TcpConnectionInformation[] tcpConnInfoArray = ipGlobalProperties.G... | 1 |
18fda1b123b7ce69c12d7927f1f6e3a5 | 273355cacf71ff07e30c839560623a7c | NewModbusTCP creates an instanc eof the ModbusTCP protocol class | static int libmodbus_new_tcp_pi(lua_State *L)
{
const char *host = luaL_checkstring(L, 1);
const char *service = luaL_checkstring(L, 2);
ctx_t *ctx = (ctx_t *) lua_newuserdata(L, sizeof(ctx_t));
ctx->modbus = modbus_new_tcp_pi(host, service);
ctx->max_len = MODBUS_TCP_MAX_ADU_LENGTH;
if (ctx->modbus == NULL) {
... | 1 |
a85902df94c50900ea271e7ecd9c6702 | 586a97c6febbb03621995bafac219370 | computation average magnetization over all spin states of current model configuration | class Ising:
def average_magnetization(self) -> float:
return self.magnetization / self.spins_board.size | 1 |
f4c03947fe8f561383d990c457c0db66 | 527dcf4863f9756362e90a5a42f827d4 | 这是获取技能影响范围的函数
用以UI显示,提示怪物的技能影响范围 | function FightBaseSkillClass:GetTriggerRange()
return self.m_triggerRange;
end | 1 |
85fb76d6e25f7c867147d3636809ecf4 | 4d68e31d90d052801c43ea4dc4014912 | throws an exception to prevent saving an empty last name | namespace PayrollCh03WindowsForms
public partial class FormPayrollChapter07 : Form
private void validateLastName()
{
if (textBoxLastName.Text.Trim() == "")
{
textBoxLastName.Focus();
throw new ArgumentException(
string.Format("No Va... | 1 |
b8b52f317613d00d3c9ef9ddd9332dd0 | 2e8289294b88941fcfc1bda502547ecb | 短文本相似度接口
短文本相似度接口用来判断两个文本的相似度得分。 | class TextComparison
function getSimilar($str1, $str2)
{
$len1 = strlen($str1);
$len2 = strlen($str2);
$len = strlen($this->getLCS($str1, $str2, $len1, $len2));
$this->similar = $len * 2 / ($len1 + $len2);
$data['similar'] = $len * 2 / ($len1 + $len2);
if ($this->scor... | 1 |
037ae6b46d3f75a4052f90eb17e48fac | 21fd6fee45fcc744369617a0babedad7 | Get html code for the order line error info message image | if($error===true){
include_once(dirname(__FILE__) . "/class/common.php");
$config = CommonOrderConfirmCheckCommon::getConfig();
$html = (isset($config["error"]) && strlen($config["error"])) ? $config["error"] : "";
}else{
$html = "";
}
return $html;
} | 0 |
4fc39cb6510d8e44eeff1678d067cbcb | 632c9cedcc7aed978d382573beb46af7 | We should be able to add sparse arrays properly. | sa = SparseArray(LIST1)
sa.append(LIST2)
list3 = LIST1 + LIST2
assert sa[0:4] == list3[0:4]
assert sa[5:10] == list3[5:10]
assert sa[10:21] == list3[10:21]
assert sa[-1::2] == list3[-1::2] | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.