query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
dc53f693f81b496adc6bd4ce1ab5aada | 59fdb2e2f7938bec7dbe8e756d617f46 | Loads the progress. | this.progress = this.add.graphics()
this.load.on('progress', (value) => {
this.progress.clear()
this.progress.fillStyle(0xffffff, 1)
this.progress.fillRect(0, this.sys.game.config.width / 2, this.sys.game.config.width * value, 60)
})
this.load.on('complete', () => {
this.progress... | 1 |
a2d383cdf418eaee23819608f7b52eea | fc51078eb5be16ed90eae82bc5c83ef1 | This function returns a file object. It reads the file from a configuration file.
If the file is not configured or does not exist a message is logged into a log file,
and None is returned. | def read_config(self, config_filename): | 0 |
15c430cee44a923917a736307e96ba9c | db33aa751e05079a91238c27d2335714 | prints the filenames of each node in the SLL | void slist::printMe()const{
node*temp=head;
printAux(temp);
} | 0 |
8fbb23a53a2cc22479787bb9974c5cad | e1275eb84790fd1241f71cdda8934e36 | Called after <see cref="Preprocess" />. | void onAfterPreProcess(); | 1 |
a578a82b617813a4f3171d72a45a1787 | de418e34c3b049731405173221a0fe5f | Behaves like \ref syntax_do "do", but evaluates the entire body atomically,
i.e. without switching to another process, as long as you don't use the
pausing functions \ref fn_receive "receive" and \ref fn_run "run". | int err;
char* cmd;
char buf[256];
char* pbuf;
Object* ob = 0;
HocStr* hs=0;
cmd = gargstr(1);
pbuf = buf;
if (strlen(cmd) > 256 - 10) {
hs = hocstr_create(strlen(cmd) + 10);
pbuf = hs->buf;
}
if (cmd[0] == '~') {
sprintf(pbuf, "%s\n", cmd+1);
}else{
sprintf(pbuf, "{%s}\n", cmd);
}
if (ifarg(2)) {... | 1 |
b37819d95b8460d21278566172aa00d0 | 805fdb1c5be5dd1fe2024520fee04677 | Transform context file name. | context = context_model.context()
if context is None:
return "new context*"
title = os.path.basename(context.load_path) if context.load_path \
else "new context"
if context_model.is_modified():
title += '*'
retur... | 1 |
d563c633a4ef34e3b43d70aea440f441 | 15fe9cb430306d65aa3d37c96cb53a89 | Returns the value of the '<em><b>Brick Width</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Brick Width</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | public class Spielfeld
public int getBrickHeight() {
return brickHeight;
} | 0 |
8b449cc5cdd5d1e5cc10676e29e3dd01 | bf69cd332c783adf2c6778f743977ecf | Returns the percentage of ones in the binary dataset. | if (getHistogram().isEmpty()) {
return 0d;
}
int[] classes = getHistogram().getHistogram();
return 1d / (double) classes[0];
} | 0 |
efeb82d2b5fe09c9c762925cbe19b9c8 | 24b3e891b8649de464f2d8340d124606 | ボーンのローカル拡大率を設定する | export default class Node extends Component{
setLocalScaleXYZ(x, y, z){
this._m_LocalScale.setToInXYZ(x, y, z);
this._updateLocalMatrix();
} | 1 |
aafc2c59a6723bee79da39be10b328e9 | 517ef0b9122a1313af18b197bec0e165 | Sets the flatness.
Flatness: sets the maximum permitted distance in device pixels between the
mathematically correct path and an approximation constructed from straight line segments. | namespace Dt.Pdf.Object
public class PdfGraphics
public void SetFlatness(float value)
{
if ((value >= 0f) && (value <= 100f))
{
this.WS(value).W('i').WE();
}
} | 1 |
75cca164a62f3c6794aafb18083be6ba | bf85ce641e52b93bbf1fc65d3c0aebfc | Function: load_game
This function opens up a dialog box with a list of games in the shelf file 'boggleshelf.db'
If a selection in the list is clicked, load the game with load_from_save | def loadRequest():
root = tk.Tk()
root.attributes("-topmost", True)
path = filedialog.askopenfilename(
initialdir=vars.savedir,
title="Select Story File",
filetypes = [("Json", "*.json")]
)
root.destroy()
if(path != None and path != ''):
exitModes()
fi... | 0 |
9e9d0f1f958682f82737058a88f015ee | 4de601903c30a0a23ec53db84a03d4b2 | Ændrer bools i array, afhængig af checkbokse | public class MainActivity extends AppCompatActivity implements TextWatcher
public void checkCheckbox() {
whippedCreamChecked = whippedCreamCheckbox.isChecked();
chocolateChecked = chocolateCheckbox.isChecked();
iceCreamChecked = iceCreamCheckbox.isChecked();
mintFlavourChecked = mintFlav... | 1 |
3d62048534a69af1423cd311d5ede296 | 11e485af2d55b19afc656e97739e4738 | Devuelve el nombre del elemento principal XML. | public class XMLfab
public String getName(){
return last.getNodeName();
} | 1 |
03406de74161ef07d81fcb2069c24b0f | 52cb5ca2ff4d08edc22aa0025e693c69 | function to perform the readout operation at the end of the gntk calculations
according to du et al. (2019) to get a final theta value | import PN_p_t as pt
pt.f_p_t(m1,m2, chi1U,chi2U, r)
dHcirc_dr = (+sp.diff(Htot_xyplane_binary.subs(Pr,sp.sympify(0)),r)
+sp.diff(Htot_xyplane_binary.subs(Pr,sp.sympify(0)),Pt)*sp.diff(pt.p_t,r))
import PN_MOmega as MOm
MOm.f_MOmega(m1,m2, chi1U,chi2U, r)
import PN_dE_GW_dt_and_d... | 0 |
e26e3575a250d38566d079c8856e0216 | e468a9a48d345a8bfaee86e46628b899 | 如果下一个token是t,那么跳过并返回真 | nonlocal lookahead, current
if lookahead and lookahead.type in toktypes:
current, lookahead = lookahead, next(toks, None)
return True | 1 |
2f004edcddb4dfbf141df1c2b55b2585 | e1e7a724b6a97e75b76e861b8eba73a0 | number identifying the collection holding the item (e.g. the series number for a book) | public class BibliographicRelationshipTag extends VariableField implements PersistentObjectWithView
@Override
public int getItemNumber() {
return sourceRelationship.getItemNumber();
} | 0 |
68ee9d7348779917ee5f017f3ddf1040 | 6df94c70735b25bd0b97cd0031e2d962 | Gets maximal seg id in a chunk based on the atomic counter
This is an approximation. It is not guaranteed that all ids smaller or
equal to this id exists. However, it is guaranteed that no larger id
exist at the time this function is executed. | public class SegmentsStats implements Writeable, ToXContentFragment
public long getMaxUnsafeAutoIdTimestamp() {
return maxUnsafeAutoIdTimestamp;
} | 0 |
561148e634198b7f54d40b5cdb5f2d2e | 81e82928779c055efe36f4c427f52c4d | 查询订单类型为银行卡支付的类型的订单 | OrderTypeItem orderTypeItem = new OrderTypeItem();
orderTypeItem.orderType = 0;
orderTypeItem.orderTypeTitle = "@string/order_paied";
orderTypeItem.orderSubType = 2;
ARouter.getInstance().build(RouterUrl.ROUTER_URL_ORDER_LIST).withSerializable("orderTypeItem",orderTypeItem).navig... | 0 |
bc140c2985f19f00e97c75b552ceb926 | 096b6d4f01dd9f02ab6d756f1bfc0e7e | Set the values of the corners to random values | void room::create(int hinf, int hsup, int vinf, int vsup)
{
srand(time(NULL));
cord_[0].x_ = rand()%(hsup-hinf-MINSIZE)+hinf;
cord_[0].y_ = rand()%(vsup-vinf-MINSIZE)+vinf;
cord_[1].x_ = rand()%(hsup-(cord_[0].x_+MINSIZE))+cord_[0].x_+MINSIZE;
cord_[1].y_ = rand()%(vsup-(cord_[0].y_+MINSIZE))+cord_[0].y_+MINS... | 1 |
43ce66c00f7dfba0d5c9a97b5c29e186 | eec0a0af03240032f28e1ddac5ec5ab6 | ref: https://blog.csdn.net/fuxuemingzhu/article/details/81017965 | s = strings.TrimLeft(s, " ")
s = strings.TrimRight(s, " ")
ans := make([]string, 0)
tmp := make([]byte, 0)
for i := len(s) - 1; i >= 0; i-- {
if s[i] == ' ' {
if len(tmp) > 0 {
ans = append(ans, string(tmp))
tmp = tmp[0:0]
}
continue
}
tmp = append([]byte{s[i]}, tmp...)
}
ans = append(ans,... | 1 |
c304cecc8f5aea84e05f33dd4244eb3c | 02c1b43422850bafc40eeb7085f3b878 | Retrieves process definitions filtered by process id or name | const opts = appId ? {
latest: true,
appDefinitionId: appId
} : {
latest: true
};
return from(
this.processDefinitionsApi.getProcessDefinitions(opts)
)
.pipe(
map(this.extractData),
map((p... | 0 |
195f9649d72f4f9b6b6729db4c8b1c09 | 1c1ac277455cdea185ea3ed36bd2357b | Adds a new line to the map with a user-defined color. | export default class Animation
addNewLineToRender(startPos, endPos, color) {
Storage.render.addLine(startPos, endPos, color,
true, 5.0);
} | 1 |
bf502a6b3f4190d888fcb707921d0a53 | 0fd2e979432c68ced6580c000100c96d | editor의 포커스를 제거한다. | final Control currentEditor = editor.getEditor();
if (currentEditor != null) {
currentEditor.dispose();
editor.setEditor(null);
}
} | 0 |
f933ac44cf640ac4722f16a963517c04 | b333884030c7d9dec83e102c4edcac18 | Function to modify the homepage | function printHomePage() {
var x = homePageJson;
for (i = 0; i < x.length; i++) {
var imgHomePage = '<img src=" ' + x[i].img + ' "/>';
var pHomePage = '<p> ' + x[i].p + '</p>';
var h2HomePage = '<h2>' + x[i].h2 + '</h2>';
var linksHomePage = '<p class="linkHomePageLeft linkText">... | 1 |
5abb8d13084fee37cade9673b8c8387a | 45c34d310a78ace001b9b7e153f93801 | Creates a new access token that duplicates an existing token. This
function can create either a primary token or an impersonation
token. | {
if (!Imports.OpenThreadToken(ThreadMethods.Imports.GetCurrentThread(), desiredAccess, openAsSelf, out var threadToken))
{
WindowsError error = Errors.GetLastError();
if (error != WindowsError.ERROR_NO_TOKEN)
throw Errors.GetIoExceptio... | 1 |
416a5e05a44b49c75d9e63efaec75ca7 | d2d23fdb7b287d1f83df2ea82d789405 | Stop all timers attached to this object. We can get away with this because
all object pointers are unique. | {
for(timerMap_t::iterator it = m_timerArray.begin();
it != m_timerArray.end();
++it ) {
if(it->second) {
if( it->second->IsActive() ) {
it->second->Cancel();
}
addForDeletion(it->second);
}
}
m_timerArray.clear();
cleanupOldTimers();
dele... | 1 |
57dba8075541cacdecfc03d1c6c44a05 | 4c38f491fd430f184ce8920eec599efa | Initialize the python list. Non-public data. | class NewList(DQ):
# """
# A Python list with some extras!
# """
def __init__(self, initial_state):
self.data = initial_state
self.calc_length() | 1 |
9b87971ca0bd7249da3cebc024075c73 | 110a1df888afdb78ceccb3daba3ca18c | Set whether the dispatch target is specified as a full path or a logical name (e.g. ActionForward).
Whether the dispatch target is specified as a full path or a logical name. | public class RequestAttributesInterceptor implements HandlerInterceptor
public void setAlwaysUseFullPath(final boolean alwaysUseFullPath) {
this.urlPathHelper.setAlwaysUseFullPath(alwaysUseFullPath);
} | 1 |
a3072ffcd6036d63a78e04fac395de4e | 84c1f23822ec0737805d2eb0fb320aa0 | 初始化Iconify | if (ICONS.size() > 0 ){
final Iconify.IconifyInitializer initializer = Iconify.with(ICONS.get(0));
for (int i = 1; i < ICONS.size(); i++) {
initializer.with(ICONS.get(i));
}
}
} | 1 |
0251164bfba7b492265e704e720d7b2a | ac41717e13cb1fd0f76d359caabddc99 | Are coordinates geographical (LONG/LAT)? | class Coords(object):
def is_regular(self):
return hasattr(self, 'regular_coords') | 0 |
9b1dc78a3421fec526c31a2103211b52 | 8f51127ccd82788b6b7ba0755085837e | Recibe la id de una categoria y devulve el numero de productos que tiene | $db = Db::getConnection();
$result = $db->query("SELECT count(id) AS count FROM product WHERE status='1' AND category_id= ".$id);
$result->setFetchMode(PDO::FETCH_ASSOC);
$row = $result->fetch();
return $row['count'];
} | 1 |
477153f00723ae5ab28cdad1c1144cda | 8d4bdf5a048cf590048cda6c66870e0b | Метод выполняющий запросы по API в CRM | abstract class Api
protected function _build($link, Array $data = null, $type = null) {
curl_setopt ( $this->_curl ,CURLOPT_RETURNTRANSFER, true );
curl_setopt ( $this->_curl ,CURLOPT_USERAGENT, 'amoCRM-API-client/1.0' );
curl_setopt ( $this->_curl ,CURLOPT_URL, $link );
if ($data != null) {
... | 1 |
d494b2c5b83b94a5a3ea4fdf0e9efb8f | 046515f8ccea5b7647b00b675adbde10 | draw a star based on a single point | void draw_pt(struct point *pt, float alpha) {
float rad = 0.0055f;
float x = pt->x;
float y = pt->y;
glBegin(GL_TRIANGLES);
glColor4f(1.0f, 0.5f, 0.5f, alpha);
glVertex3f(x, y-rad, 1);
glVertex3f(x + rad/1.5, y, 1);
glVertex3f(x-rad/1.5, y + rad, 1);
glEnd();
} | 0 |
c75be1faf780877757247e6151740300 | 9d03593eac7c1ff9ccf7cf39850b10b2 | Uses sine & cosine to represent position. Adds the position to the given matrix
Default behavior is batch_first | assert inputs.ndim == 3, ('Number of dimensions should be 3,'
' but it is: %d' % inputs.ndim)
pos_emb_shape = (1, inputs.shape[1], inputs.shape[2])
pe = self.param('pos_embedding', pos_emb_shape, posemb_init)
if inputs_positions is None:
return inputs + pe
else:
... | 0 |
10fc71669773fba63051023c3751a079 | 73a37295fdca1acb7c35ac006d4b36d7 | Transforms a <see cref="InvocationExpression"/> of type <see cref="ExpressionType.Invoke"/> into an object of type <see cref="T"/>. | bool TryApplyTo(IInvocation invocation); | 0 |
1e6fd18949449edec18fa9a6b83e1d50 | 656ed7982b8358b6bb7d92dc8444092c | 发出事件的应用名称,一般为{@code spring.application.name}。 | public class InvocationInfo<PARAM, RESULT> extends BaseEntity
public String getAppName() {
return appName;
} | 1 |
f1781493b6e54658cb7ea10ca745e6f7 | b56497b5afa6686c1e134650139b388e | 获取该对象的Json字符串。 如果obj有嵌套的对象,将通过递归调用该方法继续获取Json字符串,知道基本数据类型位置。 | {
if (obj is string)
{
return obj.ToString();
}
var js = new DataContractJsonSerializer(obj.GetType());
var msObj = new MemoryStream();
js.WriteObject(msObj, obj);
msObj.Position = 0;
var sr = new Str... | 0 |
5aac9c87f1bb66365b505328a062ebdd | f0edfeaea932f8794c8496806cc7d8ae | Обновить описание достижения | id: number,
params: FormData | object,
): APIResponse<{ achievement: AchievementData }> {
return this.client.patch(`${this.#urlPrefix}/${id}`, params);
} | 1 |
26ca64e88d1a17f5459db555924db7f3 | e42fc36a1f32b724adc92e7325fb90e2 | Devuelve la vida del puente | int Duck::getLife(){
return _life;
} | 0 |
47306aeea25e1e2349acc85fd0773318 | cf6c56c570ab5e28c53755623047e35d | statDate格式 20160131 | public class DateUtils
public static Integer getYearMonthDay(Date statsDay) {
return Integer.valueOf(new DateTime(statsDay).toString(YYYYMMDD));
} | 1 |
1ac635ac8d437788f6307780f6f07cb8 | 9d79f3791ccd3320027d41e50fcca2fe | Test case for com_day_cq_mailer_impl_email_cq_email_template_factory | class ConfigmgrApiTest extends \PHPUnit_Framework_TestCase
public function testComDayCqWcmNotificationEmailImplEmailChannel()
{
} | 0 |
04e57dda20e7db2c535f7725c0122340 | e8c9462db9f9b7531d8e2914dd1d5446 | 设置字段ModuleName的值,该字段的<br>
字段名称 :模块名称<br>
数据类型 :varchar(255)<br>
是否主键 :false<br>
是否必填 :false<br> | @SuppressWarnings("restriction")
public class CVSCheckoutOperation
public void setModuleName(String moduleName) {
this.moduleName = moduleName;
} | 1 |
f7728af51c01707671fa1c27024bba74 | b906da83531b80a7cb66664218af691b | 找到id为cate_box的元素,设置其显示 | function showCate(category) {
category.querySelector("#cate_box").style.display="block";
} | 1 |
ad8c65c209faa46ae37e838184246f7d | 52688a139c766c46ecb9f48e515806f3 | Sets the RoomSharing pool id. | class ilRoomSharingDatabaseRoom
public function getPoolId() {
return (int)$this->pool_id;
} | 0 |
c4afe0835ea31aa9d06e52e66dfced84 | 4be3f4d2cc0bc482392cba9dc20d2035 | マウス ドラッグ時。 | public class mouseAction : MonoBehaviour
void OnMouseDrag(){
print ("drag");
} | 1 |
b69e247f05313c84c98aad1a96ec7cea | 18f4f9d2d58f80975e103e04da2921c8 | Public getter for paypal express picture | {
$localUrl = $this->getHelperConfig()->getConfigGeneral($quote->getStoreId())->getPaymentPaydirektExpressCheckout()->getPaydirektExpressCheckoutImage();
if ($localUrl) {
return Mage::getBaseUrl('media') . 'payone' . DS . $localUrl;
}
return self::DEFAULT_LINK_IMAGE;
... | 0 |
4a6dbc58427d902c384c3016262f15f7 | 7ac7c45f28c1e6fa0c4b5884ec67a4a8 | Automatically discover Markdown files and add them. | global _MD_FILES
for root, dirs, files in os.walk(folder):
for f in files:
if os.path.splitext(f)[1].lower() == ".md":
_MD_FILES.append(os.path.join(root, f)) | 1 |
f2f1f5a6e94d1b2f636ceda5025645b3 | 0d0e1d42a967b6ff612ed6eeb61aee48 | POST: api/Areas | namespace simeAlcatraz.Controllers
public class areasController : ApiController
public void Post(area ar)
{
if (ModelState.IsValid)
{
myEntity.areas.Add(ar);
myEntity.SaveChanges();
}
} | 1 |
fde88cf839f95ee2aecb45262285c8cb | 50bf49ac9f35337f27fe4355d7145a01 | 获取图片请求结束处理函数 | if (status == 200) {
var data = JSON.parse(t.responseText);
uploadImageId = uploadImageId + "," + data.url;
setPhoto(data.data.src);
toast(3, "关闭lodding")
} else {
console.log("上传失败:" + JSON.stringify(t));
mui.toast("图片上传失败");
toast(3, "关闭lodding")
}
} | 1 |
24ccc723430e8181ae4570a691577ecc | 6ffc69d54f98420cea9ffd161c3cc802 | Adds the distributed cache service for repository caching. | this IServiceCollection services)
{
services.AddDistributedMemoryCache();
services.AddSingleton<IMsalTokenCacheProvider, MsalDistributedTokenCacheAdapter>();
return services;
} | 1 |
09d396009d95c6018c7025809ab8600c | 1db33e5465a1c0e00e4aa7acf0e8b1ed | Get the robots found on the current network. | def find_robots( filename):
robots = set()
with gzip.open(filename) as f:
for line in io.TextIOWrapper( f, encoding = 'ascii'):
fields = line.split()
if fields[6] == '/robots.txt':
robots.add(fields[0])
return robots | 0 |
2550ab86743061cc8b0095b9e61ae4ef | 5d53497750dbbec53809f1a22fb8a698 | Set the absolute world velocity of an actor's root component | void RavEngine::RigidBodyDynamicComponent::SetLinearVelocity(const vector3& newvel, bool autowake)
{
Write([&]{
static_cast<PxRigidBody*>(rigidActor)->setLinearVelocity(PxVec3(newvel.x, newvel.y, newvel.z),autowake);
});
} | 1 |
ed004342a807bc3b678d02bd75b98536 | 00436b84a454ff2a2fd0116e72fc13d2 | stops playing the laser shot sound | public class Hub : BaseTile
public void ResetLasers()
{
laserSound.Stop();
chargeParticle.Stop();
foreach (ParticleSystem laser in laserParticles)
laser.Stop();
} | 1 |
7ecb5796e11979c272486338137bed3f | 4e923746183d3e91d452601b2ae0c3c1 | 计算k玩家是否取得胜利,未取得胜利则返回0,取得胜利则返回评估值 | class Gomoku(object):
def evaluation(self,is_ai):
total_score = 0
if is_ai:
my_list = list1
enemy_list = list2
else:
my_list = list2
enemy_list = list1
score_all_arr = []
global my_score
my_score=0
for pt in my_lis... | 0 |
1670224e08c8738ff64a8a06307f4776 | e2ca77ff5ce9741cf00a504063d40b0e | #---------9.sort by two columns - release_date (earliest) and Imdb rating(highest to lowest) | downloaded_data = download_data_about_movies(movies)
downloaded_data_df = pd.DataFrame(downloaded_data).copy()
downloaded_data_df["imdbRating"] = downloaded_data_df["imdbRating"].astype("float")
result = downloaded_data_df[downloaded_data_df["imdbRating"] == downloaded_data_df["imdbRating"].max()]
p... | 0 |
9c1eb8b6bf42a1dda09f1c8a07e7fb90 | f0465ac3cccf5e65345423cf945e945e | <p>Description:保存医生患者关联关系<p> | void saveRelation(Map<String, Object> map); | 1 |
4558269edf9714c02ba9f3ab9f52a83d | 5ae1060431782e6363524be3eebe67de | Trả về chu vi của đường tròn | class Circle{
public function perimeter($r){
return 2 * PI * $r;
} | 1 |
eb360b7ab727b3348496ce1d6cfe7443 | 46bf5be17ede838e890e9d9c1d144dcb | 当前用户已关注用户贴子的查询 | var userFeeds;
$.ajax({
url:rootPath+"/sinaWeibo/attentionInfo_read",
async:false,
dataType:'json',
success:function(result2_list){
userFeeds=result2_list;
},
error:function(){
userFeeds="error";
} ... | 1 |
d5c29f6f9d32921a0b1a96fa395c2c36 | 4f57a93b0e73d38c87f03beebb72ba03 | Clear half transfer interrupt (htif) for the DMA stream. | {
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAT);
CLEAR_BIT(husart->Instance->CR3, USART_CR3_DMAR);
if (husart->hdmatx != NULL)
{
if (HAL_DMA_Abort(husart->hdmatx) != HAL_OK)
{
if (HAL_DMA_GetError(husart->hdmatx) == HAL_DMA_ERROR_TIMEOUT)
{
husart->ErrorCode = HAL_USART_ERROR_DMA;... | 0 |
acd95fd34511b9b61ad50b5a7fc8ba52 | 5871505368b099d90f89b407e0256c16 | 如果gif存在是打开的,则关闭 | return close if close_judge?
update_content
return close unless @image_config
if @sprite
if Graphics.frame_count % @image_config[:SPEED] == 0
last_index = @anime_index
@anime_index = (@anime_index + 1) % @image_config[:IMAGE].length
update_image if last_index != @anime_inde... | 0 |
50366204e7b9cd17ac59af12c22fd41c | 255ab058a9f53321518221cc161b954c | This is a function to create an anonymous message. | class CoolQ
public function sendAnonymous($ignore=false) {
$a = "[CQ:anonymous";
$a .= $ignore?',ignore=true]':']';
return $a;
} | 1 |
97d0e7d981be165f238d3976a24f7594 | c275449248f5e9f16704347ad906919f | Run the test cases and print the results. | if (casenum < -1) {
if (!run_full_test()) {
cerr << "Illegal inputs in full test cases!" << endl;
}
return;
}
if (casenum > -1) {
if (run_test_case(casenum) == -1 && !quiet) {
cerr << "Illegal input! Test case " << c... | 1 |
d205e11d44e8a35001875aa8c17e3a1c | 31a4fc13ccdac1922a9bf55f5423cdc1 | Returns all versions which are available in the migration folder | abstract class DoctrineConfiguration extends Configuration
public function getAvailableVersions(): array
{
$availableVersions = [];
foreach ($this->migrationVersions as $migration) {
$availableVersions[] = $migration->getVersion();
}
return $availableVersions;
} | 1 |
1a1deda4294bb18706e6b6dfcf599022 | 3038cdf4747cef54ba8f6bdb481bf0b1 | Check if domain is active | {
$DO_Domain = new \DO_Domain();
$DO_Domain_auth = new \DO_Domain_auth();
$DO_Domain->domain = $domain;
$DO_Domain_auth->is_active = 1;
$DO_Domain->joinAdd($DO_Domain_auth);
return (bool)$DO_Domain->find(1);
} | 1 |
adf91d236d5cde1e818a219f4e26685a | 81c63b6424ffc623718c3c77aa9e359a | Recupera una lista de entidades dado un rango. | List getEntidades(Map params); | 0 |
9c13b69737a6574515b6d4fbed149222 | 79a3e925091457adebe55e823eb05cd5 | 担当者の従業員番号を表す文字列をこのクラスのリストに変換して返す. | public class OutputAttributeHelper
public static String getEmployeeBalanceListString(String outputAttribXML) throws Exception {
Document doc = XMLHelper.createDocument(outputAttribXML);
NodeList nodeList = doc.getElementsByTagName(ELEMENT_EMPLOYEE_BALANCE_LIST);
if (nodeList == null || nodeList.getLength() == 0) ... | 0 |
ef1e843a33873f3a61e1f8ffc06104d0 | 3d104a176ca57c73ff3496f84c92226a | Save surface to an obj (wawefront) file | def save_obj(meshpath, vertices, facet):
with open(meshpath, 'w') as f:
for k in range(len(vertices)):
towrite = 'v' + ' ' + str(vertices[k][0]) + ' ' + str(vertices[k][1]) +' ' + str(vertices[k][2]) + '\n'
f.write(towrite)
for k in range(len(facet)):
towrite = 'f' + ' ' + str(facet[k][0] + 1) + ' ' + str... | 1 |
f345e9c81c1c8225d1b42fb56c4f447a | d51540ea020da5664b653409ccfff815 | Delete objects matching a condition against linked objects | static void
deleteObjectsInList(ObjectAddresses *targetObjects, Relation *depRel,
int flags)
{
int i;
if (trackDroppedObjectsNeeded() && !(flags & PERFORM_DELETION_INTERNAL))
{
for (i = 0; i < targetObjects->numrefs; i++)
{
const ObjectAddress *thisobj = &targetObjects->refs[i];
const ObjectAddressE... | 1 |
311a7c37ef0cc05d136067333dea803e | 2c8f05e5bd3ac87ef6e7a5d69ec09421 | Resume conversation. | resume(context : IConnectionContext, state : any) : void {
this.socket = state.socket;
this._context = state.context;
this.queue = state.queue;
this.connectionEstablished = state.connectionEstablished;
} | 1 |
46c97318b8b53c206d493d3079434a68 | 7e1c8ec71e933302755dd9e4a1a063e4 | Image display for Question,Solution,Comments | class Question extends MY_Controller{
public function display_question_image($question_id){
$image = $this->challenge_question_model->get_question_image($question_id);
$this->output->set_header('Content-type: image/png');
$this->output->set_output(base64_decode($image['image']));
} | 1 |
2db2050eacab05e5eab77b8b4178fb96 | 903e491a6e4b82223b6ba27e019117bc | Plate validator. | {
return [
[['plate_no', 'comment', 'created_at',], 'required'],
[['created_at'], 'safe'],
[['plate_no', 'upload', 'comment', 'created_by'], 'string', 'max' => 200],
];
} | 1 |
0db84c5930286cfa831e00af576ec31b | e6b085dc1c3bb0e828b933b71ed2d730 | Add values to the end of an array. Returns a flattened copy. | class Arrays
public static function push ($array, ...$values) {
array_push($array, ...$values);
return $array;
} | 0 |
a981bf667611e0b4851dd613ddb46f20 | c19d8b47c01fc81b016c82a8a83db95c | pbimg"鼠标松开"事件处理方法 | void CustomGraphicsView::mouseReleaseEvent(QMouseEvent *event)
{
if(m_bIsPreview)
{
BlackPixmapItem *selectedItem = (BlackPixmapItem*)itemAt(itemPos);
if(selectedItem)
{
if(selectedItem == (BlackPixmapItem*)itemAt(event->pos()))
{
s... | 1 |
5f3f8787aafc9307072a9cd52d45d003 | cc189d9883bc3d6238f8864b0b154617 | Call this and save the result at the start of every system call we
want to buffer. The result is a pointer into the record space. You
can add to this pointer to allocate space in the trace record.
However, do not read or write through this pointer until
start_commit_syscall() has been called. And you *must* call
start... | {
__frame->__status |= REG__STATUS_SYSC_ENTRY;
if (tracehook_report_syscall_entry(__frame)) {
return ULONG_MAX;
}
return __frame->syscallno;
} | 0 |
2c943ac059ad344bd4983a259ce0132f | 5f5dbccf77c51b026b3ea145adc02f4a | 创建一条pong的数据协议 | func createPong() *UwsgiPacketHeader {
return &UwsgiPacketHeader{100, 0, 1}
} | 1 |
311649cedfc982999fca648f9aba3d04 | d3e377627ea8cf11c41d040de4dd60ca | 添加词典的初始数据,主要有词典来源数据,单词词性数据 | {
SPSamplesDal _SPSamplesDal = new SPSamplesDal();
StreamReader sr = new StreamReader("D:/data/最终例句汉语.txt", Encoding.UTF8);
string line;
while ((line = sr.ReadLine()) != null)
{
string[] infos = line.Split('\t');
if (inf... | 0 |
d7f63e31eaf4403ebfe704f343b64fba | bb0aaf70f67d6ef84a4b8bee1fae5fe4 | Handle the resizing of the window with a shop display. | function shopResize() {
window.onresize = function() {
if (window.innerWidth >= 992) {
document.querySelector('.filter-container').style.left = 0;
} else {
document.querySelector('.filter-container').style.left = '-100%';
}
}
} | 1 |
dc78e45d572255ac04fe7dfcdf2fc8b9 | 33a4ff9219066b94c96de436113576ea | 2引数関数をカリー化します。 | ReverseCurry<T1, T2, T3, T4>(this Func<T1, T2, T3, T4> func)
{
return a3 => a2 => a1 => func(a1, a2, a3);
} | 0 |
3e234b710287888ed4ce6eae0224b7ef | 467f6b81fda29947dd6fb7601b6ffea3 | Registers a command into the [Bukkit command map][CommandMap]. | public abstract class BetterPlugin extends JavaPlugin
protected void registerCommand(String name, BetterCommandExecutor executor) {
getCommand(name).setExecutor(executor);
} | 1 |
3bc7f71f1ad007fa2aa50ee19398cd35 | 895f46d7b99840b502ef8f63cb1880e6 | Get the RMS amplitude of this DRW process.
Returns:
The RMS amplitude of this DRW process. | class ManualWarp1D(_ManualWarp1DAbsolute):
def amp_r(self):
return self._get_relative_amp() | 0 |
917772639d5f2ff2b3251c00ab40546e | 84aa5fc5c3fd94a4fe9bfab538fc33a6 | generates and returns a random unsigned int | public class RandomIntegers
private int getNextUint()
{
int re = 0;
int leftPart, rightPart;
leftPart = random.nextInt();
rightPart = random.nextInt();
re = leftPart;
re <<= 16;
rightPart &= 0xffff;
re += rightPart;
return re;
} | 1 |
e500aa59fc410f7ae5458486936a6206 | 5a18a1ac8615d3efdfb53937e1f5546c | Changes how much the object's speed is reduced at each step | void DefenceTower::SetReduceSpeed(int rspeed)
{
_reducespeed=rspeed;
} | 1 |
e8e30b52850daf0f991b72b2d1340f1e | 498f4b37124583d6c111c537e3a17ece | Function used to select product and quantity wanted | void purchaseprod(){
int quant,i;
char id[10];
int z=false;
count=readFile();
printf("Sell an Item ");
printf("\nProduct ID: ");
fflush(stdin);
gets(id);
for (i=0; i<count; i++){
if (strcmp(id,prod[i].id)==0)
{
z=true;
printf("\nItem found! Containing: \n")... | 1 |
e6504a1ecacd9c8f0e37788f24c4ee76 | 934229f0333ebbef455613897b9dfaf8 | Set the name of the league | class Competition
public function setNom($nom = null)
{
$this->nom = $nom;
return $this;
} | 1 |
3b07d02f28fc0fb42a2a6feeb4f32502 | 2588c79ac0ea72f88d7a94952ba95a25 | function for picking up the business name from the ad page | let random_business = Math.floor(Math.random() * businesses.length);
document.getElementById("business").innerHTML = businesses[random_business].type;
getRandomImages(4, random_business);
} | 0 |
a7b5a42ea5e4e2970cdcdbbdba788370 | 9172807c90200fbb79ca82665845b7c3 | Sets the value of [date_created] column to a normalized version of the date/time value specified.
Empty strings are treated as NULL. | class Email extends \Library\Model\Mail\Email implements \Doctrine\ORM\Proxy\Proxy
public function setDateCreated($date_created = NULL)
{
$this->__initializer__ && $this->__initializer__->__invoke($this, 'setDateCreated', array($date_created));
return parent::setDateCreated($date_created);
} | 0 |
5e8e27574546e66df6324a961b32c645 | d30b4ff88d59f350000c573f6d2bf05f | Returns the index of <paramref name="item"/> using Binary Search | namespace Sekhmet.Collections public partial class List<T> : ReadOnlyBase, gen.IList<T>, gen.ICollection<T>, coll.IList, coll.ICollection, coll.IEnumerable
public int BinarySearch( T item, gen.IComparer<T> comparer ) {
return BinarySearch( 0, this.Count, item, comparer );
} | 1 |
aa4ef7df763dcc2af7124f29948b80c9 | 38f86ce5c29e0fb7406d106945df796e | 获取end_str之前num天的日期,end_str是字符串类型 | try:
year = int(end_str.split("-")[0])
month = int(end_str.split("-")[1])
day = int(end_str.split("-")[2])
except:
print "prepare_data.py - get_date2() : error input param end_str : " + end_str
exit()
end_date = datetime.date(year, month, day)
return (end_date - d... | 1 |
6f28e5a39701f01cbd00d04dfc30405b | f30cfb3b5f90868ce3b31657bc369bb3 | 设置扑克牌显示隐藏状态 | namespace DRB.DouDiZhu
public class UISceneDouDZView : UISceneGameViewBase
public void SetShowPokerImage(bool isActive)
{
m_imgShowPoker.SafeSetActive(isActive);
} | 1 |
00fa1097c3708cce4ad2c7d48bdc6a11 | f7fe5c1bfe8db8582eb51b25ba1e73d1 | Computes boolean spatial overlap of templates. | template2id = np.zeros((max(unique_templates)+1), dtype=int)
for count_template, uqt in enumerate(unique_templates):
template2id[uqt] = count_template
scores = np.zeros((len(p1),))
total_pairs = np.array(range(len(p1)))
batchsize = 100000
sublists = [total_pairs[i:i + batchsize]
... | 0 |
fde4b5ea07c74bcde704c83346e39d6c | 7b4511ec963aa44c790b999dc1f41ab8 | Checks the satisfiability of Z3 constraints. | public class CSPAnalyzer
public static boolean isSatisfiable(IFile file) {
boolean isSatisfiable = false;
FeatureModelAnalyzer analyzer = getAnalyzer(file);
if (analyzer != null) {
isSatisfiable = analyzer.isSatisfiable();
}
return isSatisfiable;
} | 0 |
36b3435f66ebac4adad25c3c78b76047 | d13f98317de965fec5269860e141979b | Метод определяет с какой стороны находится данный узел | public abstract class Unit
public int getSide() {
return side;
} | 1 |
66dd3b38a4f588be3f6a2215fd4ab189 | f7d65009f53d6d962871c42f9cb21b63 | Function to collect important property data from zillow xml into a hash | class ZillowDemographics extends ZillowData
protected function parseXmlCensusMetric($type, $element)
{
$this->census_data[$type][(string) $element->name] = $this->getMetricValues($element);
} | 1 |
e6cf8692725807628860c136ae8fefc1 | d374794de45fc3962aa2fe9d5fb310be | Decode characters not decoded by html_entity_decode() | function htmlchars_decode($s)
{
return html_entity_decode($s, ENT_QUOTES, 'UTF-8');
} | 0 |
7c11a444171519053e9231015415cb62 | 9a61fa73cf77d4e7ae06e017638e6d36 | Поиск ближайшей точки. | class KdTree():
def search(self, x):
self.nearest_point = None
self.nearest_value = float('inf')
self._travel(self.root)
return self.nearest_point | 1 |
87c7680c4359047506104206c5222691 | be42342b1e04c0efa70e925936949cf1 | 重複しないタグのデータを取得する。
結果は、付与された日時の新しい順で返される | class Store(object):
def get_tag(self, tag):
for item in self._data:
if item[0] == tag:
yield item[1:] | 0 |
173683a66f6a67b24162f08eb4dbf770 | 6da68516c8c9d9e8894c4f0e06cf9b16 | 增加班级
不允许重名 | $setarr['crid'] = $param['crid'];
$setarr['classname'] = trim($param['classname'],' ');
$setarr['classname'] = str_replace(' ','',$setarr['classname']);
if(isset($param['grade']))
$setarr['grade'] = $param['grade'];
$setarr['dateline'] = SYSTIME;
$this->ebhdb->insert('ebh_classes',$setarr);
} | 0 |
a926b0d2d092ca733c3b8be708f18806 | 181a647f3f5a311adacb4e4197cd49be | adjustable sepia filter | @SuppressWarnings("UnusedParameters")
public class ResultActivity extends AppCompatActivity implements AppCompatSeekBar.OnSeekBarChangeListener, View.OnLongClickListener
public void onSepiaFilterRequested(View view) {
editBitmap = ImageUtils.sepiaBitmap(editBitmap);
imageView.setImageBitmap(editBitmap);... | 0 |
ddd2a9b24ac6f98541bb6367ca8abe4a | 62f55d2a758681b557ac157dc27eda69 | 动态画向上竖线 | clear(ctx);
startY++;
if(startY >height){
startY = 0
}
drawLine(ctx,0,startY,width,height-startY,'#000');
} | 0 |
70864ff6e5319b01f69fd4884cd7073b | b950f9a210480c9491bc1686364545f3 | Map the Left-value. | abstract class Maybe implements
TypeInterface
, CollectionInterface
, UnaryApplicativeInterface
, FilterableInterface
, ReducibleInterface
, \Countable
public function toLeft(callable $right) {
return $this->isEmpty() ? Right(call_user_func($right)) : Left($this->get());
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.