query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5d23f5a9935ccc77e1597d0c1b2b3db1 | 6abcaee04f21d30e4feb6c5d1f0b38f1 | calculates the ig of given ngram according to ig formula. | def ic(pssm,norm=True):
bgFreq = [0.21, 0.29, 0.29, 0.21]
res=0
pwm=pssm.getMatrix()
for i in range(len(pwm)):
res+=2
for a in [0,1,2,3]:
if pwm[i][a]!=0:
if norm==True:
res+=pwm[i][a]*math.log(pwm[i][a]/bgFreq[a],2)
else:
... | 0 |
6dc5bc0cbbc2fd16f104b757c8b74e28 | 88a79b5fc200d86ef82ada5a1123ae67 | Spiced up brownian motion | RandomWalkBase.__init__(self, r, b, sigma, T, dt)
self.a = a
self.r = self.s0
self.b = self.mu | 0 |
0e16268e06d8fe4126e733d375749448 | db7df5a1df2a8ecdea7df1f88cad2ce6 | create a list of pattern grouping all the pattern by category and respecting their position | formatted_coverage_list = []
for coverage in new_coverage_list:
pattern, formatted_coverage = [], []
for element in coverage:
if element[0] == 'w':
pattern.append(element[1])
else:
formatted_coverage.append((... | 1 |
ff16990bc097aecdbff85afea726d6ce | e3ecc529ddc20395667050f65ff091c0 | Wait for dependent scripts to finish loading | self, timeout=DEFAULT_WEB_CONTENTS_TIMEOUT):
self.WaitForJavaScriptCondition(
'document.readyState == "interactive" || '
'document.readyState == "complete"', timeout=timeout) | 1 |
4d79cf677e6aa292514f91ff4454c0d6 | 16a68086b4b89e68af09a16f5afb5e3c | Returns the codepoint without doing checks, for internal VM use only. | namespace RazorPDF.Legacy.Text.Pdf
public abstract class BaseFont
public virtual int GetCidCode(int c)
{
return c;
} | 1 |
b037c6d286e9709d55a40ac64b9fd0ba | 95313d63b5df397c102f5efbf235754b | 摇杆控制行走 | {
horizontal = Input.GetAxisRaw("Horizontal");
vertical = Input.GetAxisRaw("Vertical");
movementVec.Set(horizontal*2, vertical*2, 0);
movementVec.Normalize();
physic.velocity = movementVec*5;
foots.transform.position = transform.position + footHeadPos;
} | 1 |
228e7588b23aacfec31bf59f25b9ee67 | 2c31ee30a63e36e46727fe2b16454f92 | check if link returns 200 OK | print('Running connection check on: ' + crawler.url + ' expecting 200 status code' )
try:
crawler.get_page_content(crawler.url)
assert True
except:
assert False | 1 |
f3a252282fa8e2222d070ac871b395fd | 7d58356aff3b5420d26430ebc8fa658c | constructor. params: position to spawn at, how long between particle spawns, how many particles to spawn | float power, angle;
this->numParticles = 40;
this->particles = new TParticle[numParticles];
for (int i = 0; i < numParticles; i++) {
particles[i].location = new Coordinates(this->location);
particles[i].timeLived = 0;
particles[i].active = true;
particles[i].sprite = IMAGE_SMOKE;
particles[i].phase = 0;
... | 0 |
d0c2c0c1f17035821f31a6e2bfea94e4 | 165399d002def943354dadde3f19ff84 | Affiche en tenant compte du ALPHA (transparence) dans la couleur.
(On utilise glBlendFunc et glEnable). | {
GLboolean bWasLightingOn = glIsEnabled(GL_LIGHTING);
glDisable(GL_LIGHTING);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBindTexture(GL_TEXTURE_2D, TextureID);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0,g_window->init.width... | 1 |
4525768724d2af61396c4f4c9927fa4a | 643aea4d00f6399dde54e84cc243e119 | Is called to perform 2nd phase of driver migration of a given share. | class PowerVMDriver(driver.ComputeDriver):
def pre_live_migration(self, context, instance, block_device_info,
network_info, disk_info, migrate_data=None):
pass | 0 |
1c9512cb85401f29312d9ddd9a2c1d1b | 883d71e316cb149ca688525177b1fe07 | https://atcoder.jp/contests/typical90/tasks/typical90_ap | fn main() {
input!{
n: usize,
k: usize
};
let mut ans = 0usize;
for i in 1..=n {
for j in 1..=k {
ans += 100*i + j
}
}
println!("{}", ans);
} | 1 |
24ae91bfbd358ea20cb64813b08f7938 | 445a1255406cfc3e813b732de88a3139 | Returns the jump count between the two ids | return {
x: getJump(from.x, toJump.x),
y: getJump(from.y, toJump.y)
};
} | 0 |
83a2e44bbd5b6d87d1dbbf19719d2059 | 806eb852b9b9ec5937a379a1acd50221 | Returns true if this tag does not requires a matching closing tag,
which is the case for certain elements such as br and img. | public class TagBuilder extends TagBuildableEntry<TagBuilder>
public boolean isClosable() {
return closable;
} | 1 |
d8e8b97bcd0728b84e5cce7b8f1f5256 | ad2cc341febf6f0b3b890874b05193c1 | setter for isHierarchical - sets True if this LAT is part of a specificity hierarchy. E.g. LAT generated by focus or evidence match is not, while LAT generated by WordNet or YAGO is. This allows e.g. WordNet specificity matcher to match between WordNet and non-hierarchical LATs, but not between WordNet and YAGO LATs ... | void setIsFederated(boolean t); | 0 |
365d0d38c0067c6445ccd62e662424e1 | 46f166acf2e14e6001ce4dd28c59bf1e | @brief Attribute Write Access
This function is called whenever the Application Framework needs to check
access permission for an attribute write. | {
attWriteReq_t *pReq = &(pMsg->msg.writeReq);
gattAttribute_t *pAttr;
uint16 service;
uint8 status = SUCCESS;
pAttr = GATT_FindHandle( pReq->handle, &service );
if ( pAttr != NULL )
{
if ( gattPermitAuthorWrite( pAttr->permissions ) )
{
pfnGATTAuthorizeAttrCB_t pfnCB = gattServApp_FindAuth... | 1 |
2e9e74d793a4e9cb070a7b1c2cd5890c | c9fdb2755ef62b845b7d1c6521b0136b | 获取该clientId的所有的订阅关系 | public Set<JSONObject> getSubscriptions(String channelID); | 0 |
fe2716aa11a16fc79391e08627a993aa | f3b9ebe0044e2662796cc48ee5ed83ef | развёртка главного окна | namespace Практика
public partial class Готовые_отчеты : MetroForm
private void xuiButton1_Click(object sender, EventArgs e)
{
this.Hide();
Main form2 = new Main();
form2.Show();
} | 1 |
744c20837a9f5ed78311cbbba77d3282 | e7f949cdf70ac6b667e46e90193792f9 | 设置唯一字段表达式 | {
foreach ($fields as $fieldName) {
$this->field($fieldName)->expression(true);
}
return $this;
} | 0 |
b2a0cbcaeb48a82b025f5a1ffa23fd8b | cabd474999a903722ff3349174806b1b | Get all printers count | namespace PublisherConsole.Services
int GetCount(); | 0 |
348fe08727539bc6eb40da29c8791646 | 679818369f7d30d8a89289a2ad85e027 | Calculate the distances of corrected dots (on the vertical lines)
to fitted straight lines.
Useful to check the straightness of the unwarped lines. | planes = np.stack(( data[combs[:,0]],
data[combs[:,1]],
data[combs[:,2]] ))
n = np.cross(planes[1,:,:] - planes[0,:,:], planes[2,:,:] - planes[0,:,:])
dots = np.einsum("ij,ij->i",n,planes[0,:,:]-points)
d = np.abs(dots/np.linalg.norm(n,axis=1))
return ... | 0 |
ed467aaa21815d1c19554454876d2299 | 30ef36f0511b5ce2e45c7426b381a6d8 | Traverses a binary tree Post-Order (LRN) and performs a callback <see cref="Action{T}"/> on each node. | {
var stack = new Stack<MyTree<T>>();
stack.Push(this);
while (stack.Count > 0)
{
var node = stack.Pop();
action(node);
if (node.Right != null)
{
stack.Push(node.Right);
}
if (node.Left != null)
{
stack.Push(node.Left);
}
}
} | 0 |
67facb02b72c19d8a9f85dbc27e2d4b2 | 385637ce36e4e1ce0328535370858dfb | Notification that the registration status has changed. | public class Faceless
extends JApplet
implements CallManager, ProtocolEventListener
public void registered(Friend f, boolean s) {
Log.warn("registered " + s);
if (s == true) {
_peer = f;
}
else if (_peer != null) {
_peer.stop();
_peer = null;
... | 1 |
b0d6ce495a0689518132003204aece2b | 2e46f77ab7ae81bf9c9954be3e98ef70 | Lists all Comentarios models. | class CommentController extends Controller
public function actionIndex()
{
$query = Comment::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'comment_id' => SORT_DESC,
]
... | 1 |
bc07bc827c39c6d18c23d2a3b3e83197 | 1bd4120fe8119f194c8c037df5d16e9f | 第1引数と第2引数を掛け算し答えを返す。 | def multiply(num_1, num_2)
ans = num_1 * num_2
return ans
end | 1 |
750da3ef3f812231833f0c98686dca45 | 9d195252ef35925b75ecbf8330ec461f | Reads GRASP output grid files from file object and fills a number of variables
and numpy arrays with the data | if ('datafile' in kwargs.keys()):
self.datafile=kwargs['datafile']
col1,col2,col3=np.loadtxt(self.datafile,unpack=True)
self.Number_gals=col1[0]
self.ngal=col2[0]
self.ngalerr=col3[0]
self.rp=col1[1:]
self.wp=col2[1:]
self.wperr=col3[1:]
ikeep=np.where(self.rp<=self.rpcut)
... | 1 |
2d87a1ae755e6941dff669ff027b1a54 | ee22d84a152aee12e543a8f39ded536f | 根据指定playlist_id获取该列表下的视频id | path = f'playlistItems?part={part}&playlistId={playlist_id}&maxResults={max_results}'
data = self.get_html_to_json(path)
if not data:
return []
video_ids = []
for data_item in data['items']:
video_ids.append(data_item['contentDetails']['videoId'])
... | 1 |
9bc7919ed4716a11e0e3780e046b9182 | c7e01f4c1f341fbe2c674371ae44d0e5 | This functions is responsible for returning the top documents in the
index. Top documents are the ones that contain terms which appear either
NOT too frequently or NOT too rarely. It returns a list of document
ids. | class Indexer():
def retrieve_documents(self, terms, num_docs=1000, measure_time=False):
print(f'Number of indexed terms: {len(list(self.inverted_index.keys()))}')
retval = []
if measure_time:
start = time.time()
for term in terms:
if term in self.inverted_index:
... | 0 |
f0c7e3edfd47a0a02c59031ee1efaf5e | bf8da77331e2859fb9c3b3895ae12c96 | Check to see if IsPartial property is set | class CoredumpInfo(NetAppObject):
def is_partial(self):
return self._is_partial | 1 |
36853c5cb07391153f0ca9146935ab22 | b4865a124fd1538169ac279ef9fc476b | 计算两个矩形的并集。结果将是一个包含其他两个的矩形。 | namespace MG.Framework.Numerics
public static Rectangle Union(Rectangle value1, Rectangle value2)
{
Rectangle result;
Union(ref value1, ref value2, out result);
return result;
} | 1 |
64178cd7da1c4d62149d5092186ace0b | 16f3241720591e6cd430ea0259431faf | 校验是否是Window系统 | boolean isWindowOS = false;
String osName = System.getProperty("os.name");
if (osName.toLowerCase().indexOf("windows") > -1) {
isWindowOS = true;
}
return isWindowOS;
} | 1 |
dde4dc017a02e00267013cc1791d3a02 | 191cae46e8a61f31ebdc9fb3e9db2005 | Filter to add extra fields before log the record.
@alternative: https://docs.python.org/2/library/logging.html#loggeradapter-objects | class JobLogger(logging.LoggerAdapter):
def process(self, msg, kwargs):
return '(%s) %s' % (self.extra['job_id'], msg), kwargs | 1 |
e93cde5ab775d60134b3888092bdef37 | 5f97901ebd792cf57a975277ce3fbc6b | GET: ModifyQuizzes | {
if (string.IsNullOrEmpty(Convert.ToString(Session["UserName"])))
{
return RedirectToAction("Login", "Home");
}
ViewBag.ExamID = new SelectList(db.ExamTables, "ExamID", "Title");
ViewBag.ClassSubjectID = new SelectList(db.ClassSubjectT... | 1 |
b17cba9e064d120e0e309d222d714106 | 7601d3328d230394acd55d2f8797bf76 | Return whether the distribution is a list of choices. | choices = self.get_choices()
if len(choices) < 2:
return False
if self.count and not [x for x in choices if x.count]:
return False
return True | 0 |
c90f150398a6b53b74d71413588e9bad | 174c2edf7e6a455ed84c497f4d4182dd | <p>
Deletes tags from the specified resource.
</p>
Documentation</a> | public TagResourceResult tagResource(TagResourceRequest request) {
request = beforeClientExecution(request);
return executeTagResource(request);
} | 0 |
e0bc9c2a2034f487c1ca9d2eb27e02f4 | 03de2d61b67c3b148cd6e5878095e135 | Body部のテキストがセットされているか確認し、セットされてない場合はBody部の文字列をセットします。 | public class DialogueWindowHandler : MonoBehaviour
public void SetBodyText(string NPCTextString)
{
BodyText = NPCTextString;
ready = false;
BodyIndex = 0;
} | 0 |
3285d1c2a18d7b943afb9ba76df4823a | ad6c7b11bf2caf4a4ddd3094e30889ad | Add routes to permission table | {
DB::table('permissions')->insert([
'name' => 'manage_user',
'display_name' => 'Edit user',
'description' => 'can edit user',
]);
DB::table('permissions')->insert([
'name' => 'manage_option',
'display_name' => 'Manage options',
... | 0 |
d11ba45b086ddd28103c6dae2317a550 | ddd767192904857f6843f83a99955260 | 创建具有SingleTask启动模式作用的Intent | fun Intent.newTask(): Intent = apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } | 0 |
0d49cba63ced6622f08ee07d919f3998 | 42a7f18b8793f4fa0bb0c1c42d5448cb | Assign product to store | data, _status_code, _headers = product_store_assign_with_http_info(product_id, store_id, opts)
return data
end | 1 |
bc55d04f185f82e9a7ca96f1f14caf69 | 1a8d8afda26008e1406680df381f90a2 | Avança para próxima linha de leitura. | {
lineNumber += advanceBy;
if (lineNumber < lines.Length)
nextLine = lines[lineNumber];
else
nextLine = "[end]";
} | 1 |
788240c6d26a960d8fbe2a96ac50d628 | 631dcce26f2f3193d732058497f1115c | Send a new transactional message through Mandrill. | {
$options['message'] = $message;
$options['template_name'] = $template;
$options['template_content'] = $blocks;
$parameters = $this->resolveOptions($options, $this->options);
return $this->mandrill->command('message.sendTemplate', $parameters);
} | 1 |
903bb95015385660069dce0858f4c2b5 | 019c230b0a978d5134a0d9d46a372613 | Returns the path without file name | class CFile
public function getPath()
{
return $this->filename;
} | 0 |
9a4520f26ce5fa51cc1ebe8428e0f190 | a212382a0facecd2fe035fc19c03b0d8 | create contact by assigning parameters into key/value pairs within an
object. | class Contact
def initialize(name, email)
@name = name
@email = email
end | 1 |
2c3cbae197bfe205ba99132dae9206ed | dfba03b338eaf9ff99cee265e237b363 | Spins up the motors to shoot | public abstract class MyOpMode extends LinearOpMode
public void initShooter()
{
firstCycleOfSpinner = true;
} | 0 |
0aeb846b77bce2d098cb1d873c3c2b25 | 89ffe482e54203b8450d093c4b015ca3 | Customized argument parsing for the BeatsDROP evaluation script | parser = argparse.ArgumentParser()
parser.add_argument('--model_path', type=str, default="/opt/ml/processing/model")
parser.add_argument('--test_csv', type=str, default="/opt/ml/processing/output/test")
parser.add_argument('--output_path', type=str, default="/opt/ml/processing/evaluation")
params, _... | 1 |
cc5d5bd1c4fd0aad64a014d08723c847 | 0b80c801325dda1e192c8acb780df021 | Toggle the active state of the row | export class DropdownMultiselectComponent implements ControlValueAccessor, OnInit
public toggleRow(item: IDropdownItem) {
item.selected = !item.selected;
this.onChange(this.cd.viewModel);
} | 1 |
d7923e2ed55bbd611e87704e63f7e08f | fabe38fbae8dec16650738a417f9a4a1 | 返回当前节点后代元素的数目 | TreeNode myParent = getParent();
if (myParent == null) {
return 1;
} else {
return myParent.getChildCount();
}
} | 0 |
9a02af7cfd245a238c6095ec206f2a3e | a80f19e05af3f1d71aaff5e43d33e8ce | 根据后缀得到最大上传大小 | String maxSize = null;
switch (processorType) {
case IMAGE:
maxSize = PropertiesUtils.getConfigProp().getProperty("image.maxSize");
break;
case VIDEO:
maxSize = PropertiesUtils.getConfigProp().getProperty("video.maxSize");
... | 0 |
9f11a8e7f1885ee0fc15839684978e62 | 7d06f823f0e25bb5d9b395c494bb5a10 | 通过字段名,获取这个字段对应值的数组 | $reuturnArr = array();
if(empty($filedName)||empty($param)){
return $reuturnArr;
}
foreach ($param as $value) {
array_push($reuturnArr, $value[$filedName]);
}
return $reuturnArr;
} | 1 |
04220443935281d3e9ea24ae29143337 | 344be365032252b5d5d90cac6dc3b369 | Turn ON all the LEDs | void LEDArray_ALLON(void)
{
LEDArray_OutHex(0xFFFF);
} | 1 |
41d557b4df27c4ad2a6b73339904f2fc | b7b604faa344d02fedb19594529cbc93 | QR - шаг со сдвигом Уилкинсона
Литература: Уоткинс, Основы матричных вычислений - '... находим собственное значение наиболее близкое к a_nn ... | {
double help1, help2;
double c = 0, s = 0;
for (int j = 0; j < A.N - 1; j++)
{
for (int i = j + 1; i < A.M; i++)
{
if (Math.Abs(A.Elem[i][j]) > CONST.EPS)
{
help1 = Ma... | 0 |
d11f0183c23283aa5699f662d6878636 | 04df92767edbdc85b0acaa1915a3bf06 | 浏览器准备完毕
该方法有终端调用,在触发NoticeAppReady方法后终端会进行初始化,初始化完毕后会调用该方法。
该方法首先会初始化页面的缩放比,将宽度控制在1920实际宽度中,与真实页面进行缩放,详见zoomPage方法。
然后初始化系统参数和工具组(主要是页面中的单选按钮初始化)、系统操作函数
然后关闭导星曲线图(开始的时候因为需要初始化曲线图的Canvas大小,所以曲线图是打开的,初始化完毕后关闭曲线图)
然后初始化系统,该步骤用于从服务器中获取全量配置信息,并调用各部分的内容初始化将内容Put进去,各部分的内容初始化方法将视情况是否启动各模块。
然后,有写东西没有翻开反法写,就写到了最后嘛,设置不允许打开右键菜单、显示... | class App extends React.Component
componentDidMount() {
var setPreviewSize = function(){
let wHeight = window.innerHeight;
let wWidth = window.innerWidth;
let ratio = wWidth < 800? wHeight/800 : (wHeight - 100)/800;
$('.m-preview').css('transform', `scale(${ratio}... | 0 |
7611f29a1bec46a97afd9c1a870e8236 | 17bc940ba3da08f03ac89039fcc7de4f | Creates the backup copy of the user account preferences data in the new backup table. | void deleteUserAccountPreferences(List userAccountPreferences) throws PDBPreferencesDAOException; | 0 |
87f737477e1d9c5a2981dcc336d55d80 | 427fae2023302aca48df30e78a08f7f7 | Returns a list of index pairs of reactions forming equilibria.
The pairs are sorted with respect to index (lowest first) | class ReactionSystem(object):
def identify_equilibria(self):
eq = []
for ri1, rxn1 in enumerate(self.rxns):
for ri2, rxn2 in enumerate(self.rxns[ri1 + 1 :], ri1 + 1):
all_eq = rxn1.all_reac_stoich(self.substances) == rxn2.all_prod_stoich(
self.substances
... | 1 |
a66594163094e6c20e2ca6f6a5686813 | 1744ce5623b2124850f13fedfb29879e | <p>
This method puts all the entries from the source into the symbol table.
</p> | for (Entry<String, V> entry : input.entrySet()) {
put(entry.getKey(), entry.getValue());
}
} | 1 |
27df0748a9350934e1f6a083f350721f | d4876c486f745d9f58b79c95c70becc0 | Retrieves the corresponding static preinitialized data field by looking at various attributes | {
switch ($name)
{
case 'input':
if (empty($this->static))
{
$this->static = $this->getStatic();
}
return $this->static;
break;
case 'repeatable':
if (empty($this->repeatable))
{
$this->repeatable = $this->getRepeatable();
}
return $this->static;
break;
de... | 1 |
df04c7ab82da19f41bb7b9213ab5536b | 32eca1337fb7e02175ab222c37864f5e | Handles the Click event of the picImage control. | {
Image tempImage;
List<Form_Viewer.modifiedImageInfo> modifiedImages;
if (File.Exists(_currentPhoto.path))
{
Form_Viewer picView = new Form_Viewer(_pictureList, Convert.ToInt32(_currentPhoto.id), _constantAppName);
picView.StartPo... | 0 |
a89078a094e29efbc6ff4636a0b36b6d | 8a5dd9926f91dc92b278871d370940dc | Logs a warning (yellow colored) to the console with default prefix (CraftEra Suite). | {
lock (sync)
{
ConsoleColor oldColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("<{0}>", DateTime.Now.ToString());
Console.WriteLine(pText);
Console.Foregroun... | 1 |
b8d9e73d52a868d8893edeaf6c9ec66b | 41734eb14b4012f59689dd09216e0848 | 下载计划指标模板 | return requestData(`${BASE_URL}/manage/plat/download/downloadTemplate`, {
method: 'post',
body: JSON.stringify(params),
responseType: 'blob',
isJson: true,
});
} | 1 |
7667256d6960d2c2489064553f091190 | 5168772539055f5dd9033e3e26fb387c | The function responsible to notify when the animation should stop. | {
double fStopForSeconds = 1/10.0f;
g_fStopAnimatingUntil = SMX::GetMonotonicTime() + fStopForSeconds;
} | 0 |
d6a8b14cbd4e1080e9241ac7d8d098b3 | 9da6526bf5fbb5145a8c82577ddce2c5 | Borrar la relacion Usuario Empresa por su identificador | namespace Layer.Business
public static class MovimientoShippingBusiness
public static void BorrarEuid(int id, out TransactionalInformation transaction)
{
transaction = new TransactionalInformation();
repositoryS = unitOfWork.Repository<MovimientoShipping>();
try
... | 0 |
e3e2957a7c7f00547889a59ade5980b6 | 040f06b89ce60784740ac338c4fa4539 | Test whether paper has DBLP authors. | class TestWebServer(unittest.TestCase):
def testSamples(self):
if getpass.getuser()!="wf":
return
html=self.getResponse("/sample/dblp/article/100")
self.assertTrue("<th> publtype </th>" in html)
pass | 0 |
f008854230491362560b1fbfb37807aa | c975652b123a13c41337e3efac7173b0 | ### x is expected to be a numeric vector
### function returns the mean, sd, min, and max of the vector x | ss<-function(x){
avg<-round(mean(x),digits=2)
std<-round(sd(x),digits = 2)
med<-median(x)
res<-list(mean=avg, sd=std, median=med)
} | 0 |
dc9d7f7c34eaf56167b4948620a921d3 | c073577d643fb942c4b019612e747ceb | Create the signature to send to Pagamastarde. | if not date:
date = datetime.date.today()
return '%s@%s:%s' % (signature, date, version) | 1 |
2ce48db3797895f11f7c1d1935795660 | e045e3ef44f3964d6c190e46fcaca162 | 蛇身的运动 | function snakeMove(){
for(var i=0;i<snakeL;i++ ){
bodyX[i] += (snakeX[i]*iSize);
bodyY[i] += (snakeY[i]*iSize);
}
for(var i=snakeL;i>0; i-- ){
snakeX[i] = snakeX[i-1];
snakeY[i] = snakeY[i-1];
}
eatRat();
} | 1 |
be8fb9a342c2ab94204b2ae5596d99ee | 36dd22388eb54b20712a6a45a3c8355f | Create fake data for tracks | var playlist = {
title: 'Japandroids @ Union Transfer',
songs: [{
album: 'Near To The Wild Heart Of Life',
artist: 'Japandroids',
id: '4aQSJS43Lwfc6egUwKbXhb',
image: 'https://i.scdn.co/image/7082... | 1 |
6a259b027953e742552f000eacb69ba3 | 4c077919d5574ea52d0c8a954cd2dfb3 | Удаляет все квадраты | {
square1.clean( );
square2.clean( );
square3.clean( );
square4.clean( );
square5.clean( );
square6.clean( );
square7.clean( );
square8.clean( );
square9.clean( );
} | 0 |
b7a9922b6b0840c021cb59d2e64260ac | 6f8c7366bf07ed70b59c705caf696c1a | Gets the average block write time | @Metrics(about="Metrics for WASB", context="azureFileSystem")
@InterfaceAudience.Public
@InterfaceStability.Evolving
public final class AzureFileSystemInstrumentation implements MetricsSource
public long getBlockDownloadLatency() {
return currentBlockDownloadLatency.getCurrentAverage();
} | 0 |
88b21518360c8a5ec9a1a0ffa3dded44 | 0a615b5ff041adca1e4a9c88450f4ad5 | Decode a text-encoded long integer. | long long
DkimConverter_longlong(const char *head, const char *tail, unsigned int digits, const char **nextp)
{
const char *p;
static const long long multmax = LLONG_MAX / 10LL;
long long v = 0LL, retv = -1LL;
for (p = head; p < tail && isdigit(*p) && p < (head + digits); ++p) {
if (v > multmax)... | 1 |
6230c1280aef8af585be7348cc1cdb08 | 22c62f437e50ff9b5a95c51764960433 | ReadTag returns the string version of the given tag sequence. | tagRawBytes := []byte(tagRaw)
if tagRawBytes[0] != 'v' {
return nil, fmt.Errorf("not a version tag (vX.Y.Z)")
}
tagRawBytes = tagRawBytes[1:]
tagParsed, err := semver.Parse(string(tagRawBytes))
if err != nil {
return nil, err
}
tag := ReleaseTag(tagParsed)
if err := tag.Validate(); err != nil {
return n... | 0 |
ac07c20aafc528705efba617805a6431 | e1043a28d5e8284d85587525b245a845 | Taken from MSDN: http://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx | {
StringBuilder b = new StringBuilder(512);
UInt32 numChars = (UInt32)b.Capacity;
while (numChars == b.Capacity)
{
b.Capacity *= 2;
numChars = GetModuleFileNameW(hModule, b, (UInt32)b.Capacity);
}
if (numChars == 0) return null;
b.Length = (int)numChars;
... | 1 |
b0069f0f8c7ed511c49ff5613573a907 | 7d1cdf604e27eb8f3afdd6954a54ce2f | 创建满二叉树函数 | Status createBinaryTree(TNode T){
scanf("%d",&T->data);
if (T->data == 0) {
return OK;
}
T->lchild = (TNode)malloc(sizeof(Node));
T->rchild = (TNode)malloc(sizeof(Node));
createBinaryTree(T->lchild);
createBinaryTree(T->rchild);
... | 0 |
cdb58702380920f2ea06288ab15b9e72 | cc877d9dc54ae9afdc753c8888194750 | Checks for active state of WooCommerce | class Pronamic_WP_Pay_Extensions_WPeCommerce_WPeCommerce
public static function is_active() {
return class_exists( 'WP_eCommerce' );
} | 0 |
a9e0d5f96ba24155c43d1af5e05543fa | ace550828268488d4322bad2478952f3 | 指定した2つの座標間の点を、距離を指定してList形式で取得します | {
List<PointD> calculatedPoints = new List<PointD>();
calculatedPoints.Add(startPoint);
calculatedPoints.Add(endPoint);
return calculatedPoints;
} | 0 |
e2b5382b9330eca9392937b3e854c4ba | 2f0d1274279c834f64d5faccd250fef2 | set pivot as the an element between the most smallest and most largest
to avoid the worst case. Somewhat random in nature. | class StringSorter
short getPivotIndex(std::vector<std::string> vectorToBeSorted)
{
short max = vectorToBeSorted.size();
std::vector<short> pivotCandidates;
for (short i = 0; i < pivotCandidateNum; ++i)
{
std::srand(std::time(nullptr));
short *pickRandom = ne... | 1 |
efc4c6c8aab656ddd82dfcd1496841ec | 8aec00f749f8a3849250bbe5ee5247d9 | Поиск персонажей для определённого мира. | let selectedCharacters = [];
characters.forEach((character) => {
if (character.homeworld == homeworld) {
selectedCharacters.push(character);
}
});
return selectedCharacters;
} | 1 |
dd9edfd8ddfbdf2a999c99508fe01b96 | 3c949454055ca77d909910b5917cd11c | Returns a dict of names of Megabus stops, keyed by ID.
These IDs are used to set the start and destination of a Megabus
search. | routes = {}
geodata = []
with open(STOP_DATA, 'rt', encoding="utf-8") as mobile_csv:
reader = csv.reader(mobile_csv, delimiter=',', quotechar='"')
next(reader, None)
sorted_rows = sorted(reader, key=lambda row: (
row[1], row[2], datetime.strptime('01/01/2020 ' + row[11]... | 0 |
e00cb12f7a578437be7d6c14768d37b4 | ae3945bf545d3edd9186d65a26a7355d | Returns the earnings on a big bet (11 - 17) dice sum | {
if (RandomlyChosen == playerBet) return betStake * 36;
else return 0;
} | 0 |
6834570901d896a6376e5713570707b8 | 4bd7d45aae25513ac1dfdfe4a0496ca4 | Returns an Array of Hashes listing the properties for every type of _Sobject_ in the database. Raises SalesForceError if an error occurs. | class AnalyticsIndexManager
def get_all_datasets(options = GetAllDatasetsOptions.new)
end | 0 |
97c5f3209d2f097e9c66897479936612 | 772c50264657487bf278699735b59825 | 根据套餐id删除套餐和检查组的中间表数据 | @Service(interfaceClass = SetmealService.class)
@Transactional
public class SetmealServiceImpl implements SetmealService
private void setSetmealAndCheckGroup(Integer setmeal_id, Integer[] checkgroupIds) {
if(checkgroupIds!=null && checkgroupIds.length>0){
for (Integer checkgroup_id : checkgroupIds) ... | 0 |
1580205dcbb2dfcffa4ccb2e95a0ac64 | 5ad4a7a8df081907e67a66fd81ebec98 | @brief Esta función configura la iluminación del escenario. Asi como la posición del foco. | if (angulof > 2*GL_PI || angulof < -2*GL_PI ) angulof = 0.01;
if (angulo > GL_PI - 0.01 ) angulo = GL_PI - 0.01;
if (angulo < 0.02) angulo = 0.01;
px0=radio*sin(angulo)*cos(angulof);
pz0=radio*sin(angulo)*sin(angulof);
py0=radio*cos(angulo);
printf("posicion del ojo x: %f y: %f z: %f \n angulo: %f an... | 0 |
3f99b82e17cf8e05b89fddc12de4afce | 3e22071fd0f60e9a33820ad89a009bff | 对资源进行分级,方法3
只要local的属性大于等于dc的属性1以上,使用local | if (!TextUtils.isEmpty(ves) && !TextUtils.isEmpty(loaclves)) {
String[] vsesplit = ves.split("\\.");
String[] loaclvsesplit = loaclves.split("\\.");
if (vsesplit.length == loaclvsesplit.length) {
for (int i = 0; i < vsesplit.length; i++) {
... | 0 |
f16b9e0237b2fa801a9dbe88bd7e9de1 | cf1f7f5f0f85c62d4f18b8c939e9ae4b | GUI プロダクト名の描画を行います | String name = Application.ProductName;
String ver = Application.ProductVersion.ToString();
this.Text = String.Format("{0} v{1}", name, ver);
} | 1 |
ce7d03c9c4afaed00c433f732c8686d3 | bdac1e34aafa32fad0c6a64c4c4106d5 | 多張QR生成 | {
$table_count = $_POST['tableCount'];
for ($i = 0; $i < $table_count; $i++) {
$iii = $i + 1;
$user_id = Auth::id();
$protocol_host_url = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'] ;
$url = $protocol_host_url."/order_pa... | 1 |
7ae4dd3e83abb4456d3789721e005437 | 684389f216af66c6bb7623bbf75465f4 | Delete everything before the specified string | bool begins = this->beginsWith(str);
if (begins) {
this->erase(0, strlen(str));
}
return begins;
} | 1 |
4558d8ee403948d2906746fd88e7cce0 | 5891819449f8ba677b53f342a431e66a | Retrieves the time limit that will be enforced for searches
performed using this client connection.
performed using this client connection. | public class Configuration implements Shareable
public long getSearchTimeout() {
return mySearchTimeout;
} | 1 |
ec24ef101a535ebc19ca766038200c52 | 2521c3c59cb68f8ab7fe4547d0e4423e | Creates an upgrader for GRS SQL Server databases. | {
var builder = new UpgradeEngineBuilder();
builder.Configure(c => c.ConnectionManager = connectionManager);
builder.Configure(c => c.ScriptExecutor = new PostgresqlScriptExecutor(() => c.ConnectionManager, () => c.Log, schema, () => c.VariablesEnabled, c.ScriptPreprocessors, () => c.Journal... | 0 |
bc7d93a95c15f86b9b2e85521a8fba53 | 9537ab2b3e02de1e9138304dd4359dbb | 通过工序id和状态id判断他是否有下一道工序 | $where[] = array('name' => 'ajra_s_id', 'oper' => '=', 'value' => $this->sid);
$where[] = array('name' => 'ajra_ajp_id', 'oper' => '=', 'value' => $pid);
$where[] = array('name' => 'ajra_m_id', 'oper' => '=', 'value' => $mid);
$where[] = array('name' => 'ajra_type', 'oper' => '=', 'value... | 0 |
e08ac12f0cff9fd27f3c3c9ebae538d3 | abd78b8c8118f930a16f73331f801728 | Convenience method for generating an EXTRACT minute expression.
<p>
{@code Object} -> {@code Expression} conversions handled by
{@link Converter#toColumnSqlObject(Object)}. | Preconditions.checkArgument(minute >= 0,
"minute must be greater than than or equal to 0.");
return minute * ONE_MINUTE;
} | 0 |
7fe622e985a1785133d1565256a15fd7 | 95b7497ec5b3c35f329408bb8761c018 | @brief Send the Mode Sense6 Command to the device | {
uint8_t index;
USBH_MSC_Status_TypeDef status = USBH_MSC_BUSY;
if(HCD_IsDeviceConnected(pudev))
{
switch(USBH_MSC_BOTXferParam.CmdStateMachine)
{
case CMD_SEND_STATE:
USBH_MSC_CBWData.field.CBWTransferLength = XFER_LEN_MODE_SENSE6;
USBH_MSC_C... | 1 |
84342dbb20ab23a55dd3bf746ace65d4 | b679c6d89a31a54543291ed6918b6a53 | Metodi ainoastaan hakee tiedon luokan private muuttujasta | public class Solmu implements Comparable<Solmu>{
public int getAvain() {
return this.avain;
} | 1 |
adbf632e9ca847f6bf386807cbdf51fd | edf4ad68cbb235ac7917f429bfa8e719 | 获得输入的数独 | for(int i = 1; i <= 9; i++)
{
for(int j = 1; j <= 9; j++)
{
scanf("%d", &digit[i][j]);
flag_a[i][digit[i][j]] = 1;
flag_b[j][digit[i][j]] = 1;
flag_c[2 + 3 * ((i - 1) / 3)][2 + 3 * ((j - 1) / 3)][digit[i][j]] = 1;
}
}
set(1);
fo... | 1 |
93c3b3c7ca153614ec6467d6a310a1a2 | f8874ca9e9dca174cfffde9d723a27dc | Notify callback function for `but_threshold_image'. | class Calibrator(object):
def _threshold(self, *arg, **kw):
org = self._original_image.copy()
thrs = cv2.getTrackbarPos('threshold', self._win_name)
blurred = self._median_blur(org)
ret, image = cv2.threshold(blurred,
thrs, 255, cv2.THRESH_BINARY)
... | 0 |
3f0e1d1e703a6a3a6b89ef6ebf17ae41 | 123b36d5c2e9b7abbbb98a8b1c5dc301 | log the distribution of a custom value (e.g. selected actions, earned rewards) | class Builder:
def distribution(self, key: str, data: str, **config) -> FieldInfo:
return self._add_field_spec(key, distribution(data, **config)) | 0 |
8667cda7e7114bdc66d954691ede28c4 | 67c67446d83856683b7d0e3fbce9fe4c | 最小出借金额 | $where = ['borrow_id'=>$user_id,'is_done'=>1,'status'=>4];
$count = model('order')->where($where)->count('id');
if($count>9) $count = 9;
$max_loan_money = sprintf('%.2f',$this->getmaxloan($count));
return $max_loan_money;
} | 0 |
13726c54f934d6f05c9b451589cc6909 | 764d335ac771623aa2a3c9260ca49102 | 下载班级内导入教师模板 | return ax.post('/action/mod-xiaojiao/weixin/teacher/downloadExcelTemp.do', params, config)
.then(res => res.data)
.catch(e => console.log(e));
} | 1 |
8d032b6eb6cbd98e1506e377924b435c | be005ba9fe0fb1db3932e173faca7f83 | draw and position all the aura frames | local function CreateAuraWidgetLayout(widget_frame)
local db = TidyPlatesThreat.db.profile.AuraWidget
local align_layout = GRID_LAYOUT[db.AlignmentH][db.AlignmentV]
local aura_frame_list = widget_frame.AuraFrames
local pos_x, pos_y
for index = 1, CONFIG_AuraLimit do
local frame = CreateAuraFrame(widget_fr... | 1 |
614af7f1e5f53367e0212df3dccdc9a3 | 6bee51e0a8a31ede920ee79196c41f3f | Exit a parse tree produced by Java9Parser#constructorDeclaration. | class JavaLangListener(ParseTreeListener):
# Enter a parse tree produced by JavaLangParser#compilationUnit.
def exitConstructorBody(self, ctx:JavaLangParser.ConstructorBodyContext):
pass | 0 |
2759f4f8e8b4749ddddc1b287178d687 | 1f011e1b94552a3a42e3bf4fd7835364 | return a dictionary of the count of letters (lowercased)
in the given string. | ALPHABET = "abcdefghijklmnopqrstuvwxyz"
letter_count = {}
for letter in ALPHABET:
letter_count[letter] = 0
for character in wordlist:
letter_count[character] += 1
return letter_count | 0 |
02957014af6dd6f75329e2c99d56036f | 6955ef27a0e2dca4d121e7d0e041725e | 技能面板按钮回调 | local skilldata = self.skilldata
local transform = self.transform
if nil == skilldata then return end
local info_panel = transform:FindChild("InfoPanel").gameObject
info_panel.transform:FindChild("Icon"):GetComponent(Image).sprite
= self.assetWrapper:GetSprite(AssetConfig.skillIc... | 0 |
2cdf649a3374ad0dc034a5ecd049cabc | f258e50fa5537c33b48c212f921b3dea | 初始化请求所有订单列表 | var that = this;
wx.showLoading({
title: "Loading...",
mask: true
});
app.getUserOpenId(function (err, openId) {
if (!err ) {
app.requestFn({
url: '/proapi/doAllOrder',
data: {
openId: openId
}
}, function (res) {
if(r... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.