query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
dc8267ba247991e5cbb9b9c8066716e5 | fd9be5c2bf2ba7d277f7a92321922423 | 设置左侧 Hint 字体颜色 | public class BannerView extends RelativeLayout
public void setHintColor(@ColorInt int c){
this.color = c;
mHintView.setBackgroundColor(c);
} | 0 |
9989e1e235f03487775d899d212670e7 | 42695cd914162f7e2564f79a07800746 | 提取每条评论的词,去除停用词 | class cleanMeasuredValue():
def stop_pooling_gene(self, list_):
save_word_path = r'save_word.txt'
save_word = {x.replace('\n', '') for x in open(save_word_path, 'r', encoding='utf8').readlines()}
p = re.compile(r'[a-zA-Z0-9]*')
gen_jiebawords = [p.sub('', x) for x in list_ if x not in sa... | 1 |
08e8cead3f9b3cf9068c5ce55d6cb8ae | 27b941e7f827668f43bb78446791f65f | Prints an odometer reading to standard out | class Car(object):
def read_odometer(self):
print 'This car has ' + str(self.odometer) + ' miles on it.' | 1 |
d389d291f9e77c23e4547054f183d1dc | 802160e19230f15733c26de309ac42fd | Apply acquisition function to pred list. | class EI(BaseAcquisition):
def _compute_acq(self, x):
m, s = self.model.predict(x)
fmin = self.model.get_fmin()
phi, Phi, u = get_quantiles(self.jitter, fmin, m, s)
f_acqu = s * (u * Phi + phi)
return f_acqu | 0 |
7c34fe2733c9b3bc5c55642682c900ac | 8eea392e2cfb905a62dc2002c3594296 | Returns the name of the HTTP method with which this request was made, for
example, GET, POST, or PUT. | public class HttpInputStream
extends InputStream
public String getMethodName() {
return m_method.getRequestLine().getMethod();
} | 1 |
e2016ea6321c45f00cbffc7de1494f67 | 317b2e1cec29c235acbb0107c4ae7b56 | The spatial distribution will model a point at the origin by default | Terrain::Terrain()
{
position = Vec3(0, 0, 0);
} | 1 |
0e1be581ad3452db5adf46ac9f605bef | 50bb6d15c8413a3e004983b0fa801fc1 | Converts VariableSecificationMessage (Scalar) to Python value. | if not self.pb_class:
return serialized_value
elif self.pb_class == int:
return int(serialized_value)
else:
return protobuf.decode_message(self.pb_class, serialized_value) | 1 |
7b7254743a256a9d3d1efd57440f41d6 | 54493ce8a36af87249ab2a8d2c4bd944 | Apply the stored movement again. | class UndoableMoveCommand(QUndoCommand):
def redo(self):
self.object.moveBy(self.dx, self.dy) | 1 |
00a4a985370e1a100267380c4cf3c8aa | e6e9371d627f6ca5cac187c76fd55b6d | アプリケーションユーザペイメント取得
アプリケーションユーザペイメントを取得します。
引数のモデルに、条件となる値をセットしてください。 | class Logic_Payment_PaymentDelete extends Logic_Payment_Abstract
private function _readApplicationUserPayment(Application_Model_ApplicationUserPayment $m)
{
$where = $this->_generateWhere($m);
$mapper = $this->getApplicationUserPaymentMapper($this->getDbSectionNameMain());
$r = $mapper... | 1 |
42beb197d9bba4279847a9833bc52e97 | 7d4656f51aedaeb3d3215162062ff32c | 查询健身房分页列表 | Page<School> page(Page<School> schoolPage); | 0 |
26dcdb48d9fa3f63eb8c66e4cbe9a596 | ba45af9997614c3d6df6b55e6111388a | 주소명으로 위치 찾기 메서드 | var addr: List<Address>? = null
var loc: LatLng? = null
try {
addr = tourMap_coder.getFromLocationName(spot, 5)
} catch (e: IOException) {
e.printStackTrace()
}
if (addr != null) {
for (i in addr.indices) {
val lating =... | 1 |
bd1da889ba140b6f3d147bf366675310 | 2eee16a6e2672d5d136381ef69cb2799 | Adds type parameters to list box | function populateParameters()
{
var option ='';
for(var i = 0; i < ITEM_TYPES.length; i++)
{
console.log(ITEM_TYPES[i] + " : " + FIELDS_TO_SHOW[ITEM_TYPES[i]]);
option += '<option value="'+ ITEM_TYPES[i] + '">' + FIELDS_TO_SHOW[ITEM_TYPES[i]] + '</option>';
}
$('#param'+paramNum).append(option);
paramNum++;
... | 1 |
8cb44147c321836d9c0bf8c3f9fc95ef | 80cd2da0bc724650947a46867081a639 | gọi các store SELECT, không có tham số input | @Service
public class StoreServiceImp
public Page<Store> selectStores(Pageable pageable) {
return storeInterface.findAll(get(), pageable);
} | 1 |
ef8abaac262ad6cd2b4810f13536d830 | 625d42c64737a684be7a37607235590f | Tests appending a jump instruction to a jump list | class TestContract(unittest.TestCase):
def test_single_jumpdest(self):
c = Contract('5b')
c.parse() | 0 |
55ae4864705e1191ed6c08a099584b52 | 4079de252b4f03c5df7a3b6d8e140e9e | used for reading the bytes from a file channel into a set of buffers | {
try
{
using (FileStream SourceStream = File.Open(SourceFile, FileMode.Open, FileAccess.Read))
{
BufferPart part;
int reportCounter = 0;
while (true)
{
... | 1 |
ac028400e1f6057603ea7a43be321498 | 3dbda205ed33f8542e44a71480a722af | 导入订单到财务表 | importParams.forEach((item)=>{
item.ord_no = order.ord_no;
item.id = uuid.v1();
});
OrderProduct.destroy({where: {
ord_no: order.ord_no
}}).then(function(){
OrderProduct.bulkCreate(importParams).then(function(){
callback(ord... | 0 |
f8c87a07bd5bee9f8b68f1d0779a9a6f | 64add0fdf20f1d507a76e5c8432f57d1 | <br/><li>说明:自定义单字段查询
<br/><li><font color=red>注*:字段名和字段值均自由定义, 但只支持精确匹配, 不提供Like方式的模糊匹配, 支持的数据类型有NUMBER,VARCHAR2,CHAR,INTEGER</font>
<br/><li>创建人:谭诚
<br/><li>创建日期:2013-8-21
<br/><li>修改人:
<br/><li>修改日期:
<br/><li>修改内容: | public List<T> queryByOneField(String fieldName, Object fieldValue) ; | 1 |
e13301b00f627de63901dd204fea2774 | 5b2f491cfbb55f01a6e0f81d22105f0d | Get list with IDs of apps that the customer also bought. | ids = [int(i) for i in request.GET.getlist('ids')]
ids = set(request.amo_user.purchase_ids()).intersection(ids)
return list(Webapp.objects.filter(id__in=ids)
.values('id', 'manifest_url')) | 1 |
21d8146d14f75599655336d0a947c2e6 | 3bc7dfa6f0943e5e77ff81fcd000789f | maps method of payments to their total cost | $sumPayment = 0;
foreach ($this->payment as $payment) {
$sumPayment += $payment->amount_to_pay;
}
return $sumPayment;
} | 1 |
6f2e52c2642488c6dbc787b4c59ca87c | e767132be5ec4bfc373d2d88a5ddf573 | 判断驱动对象存在时再执行退出操作 | boolean drive2Exit() throws Exception ; | 0 |
3172f1fe76e7d7308fc83c17cffb6102 | 942b54a78d15479ddbb3ee1d801054d4 | Get the address of a particular sector. | {
uint8_t i;
return pf_lseek(((unsigned long) sectNum) << 9);
} | 1 |
afb1210de5b11714cada137626583ac0 | f95b812d2270ae0bab00f5bba78eaf23 | Defines which lines are wanted/unwanted when writing previous run information during integrating | raw_output = []
network = False
multipath = False
socket = False
reg_kernel_control = False
active_kernel_event = False
active_kernel_control = False
routing_table = False
interface_table = False
for line in cleandata:
if line.startswith('Active Internet'):
ne... | 1 |
36974236862223c179bb9c2fe4060b4f | fa99544fd79571eebf4f150458aae49f | 求每日已实现波动率 | expected_profit = []
daily_change = self.returns.pct_change()
vol = self.asset_volatility(daily_change)
for i in range(len(self.returns) - 1):
s1 = self.returns[i + 1]
s0 = self.returns[i]
k = s0 - vol * s0
p = self.black_formula(s0, k,... | 0 |
882fafd1135eb106d48e410ad89e44e2 | 66dab969dd85d30ef53a20d14ebb9cf3 | Returns the value of the '<em><b>Labor Duration</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Labor Duration</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | public class TaskFlowDefinition
public ImmutableSet<LaborMode> getLaborMode() {
return laborMode;
} | 0 |
5c74a84cc7cf99bdfe5a9de69d8d7a4e | 3c4e8f90c86feba6402ba4f3a0e64151 | 关中断,返回关中断前的状态 | {
SpiCePort&=~(1<<SpiCePin);
_delay_us(2);
SpiSend(0x05);
unsigned char StatTemp=SpiSend(0);
SpiCePort|=(1<<SpiCePin);
_delay_us(2);
return StatTemp;
} | 0 |
888c8a2e82e8b4785c121b7693d41dd3 | 5582fbf90d0eaaf55519cda4b70651d1 | !
Finds number of favorite stations | public class DatabaseHandler extends SQLiteOpenHelper
public int getFavoritesCount() {
String selectQuery = "SELECT * FROM " + TABLE_FAVORITES;
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
cursor.close();
return cursor.getCount()... | 1 |
5be75ef52cabbfd06661ac676c3dfd2f | a364fdd4e85fb63a13259138e5101a51 | Setter for <code>WETRN.DLTD_OFFR_SLS_CLS_SKU.CREAT_TS</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.7.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class OffrSlsClsSkuRecord extends UpdatableRecordImpl<OffrSlsClsSkuRecord> implements Record20<BigDecimal, String, Integer, BigDecimal, ... | 1 |
c7dd6c82e06a586b7baa3d3d070e6ea1 | 9cad6a75d07ce212c8b11dc0ce24f267 | Returns the currently selected columns from a query | public int[] getSelectedColumns(); | 1 |
e92626dd3dd4adbfd0b367825736e5ee | cd5850c878a3f179e19076b1e1ec078c | When an enemy exits the range of the towers, remove it from the list | public class Enemy : MonoBehaviour
private void OnTriggerExit2D(Collider2D collision)
{
attackList.Remove(collision.transform);
} | 1 |
8d1dfa8530f367443df43359408e7a4c | 7f1b6e0c74602433340cd07ff4fbd4c6 | ~~~~~~~~~ 批量删除友情链接 ~~~~~~~ | class AdvertController extends CommonController
function DelAllFlink(){
$this->check_logined();
$newstype=M('adverts');
$aa=$_POST['arr'];
$InformationID=explode(",",$aa);
foreach($InformationID as $val) {
$condition['ads_id']=$val;
$list=$newstype->where($condition)->find();
$result = $newstype->... | 1 |
d065e955e8b14f588f6612d5b1026c7a | d92e310c25551920979ff8a4c6f649cc | sort the recurring candle by descending & get the most recurring candle | $candles = array_count_values($ar);
krsort($candles);
$candlesBlowsValue = array_values($candles);
return $candlesBlowsValue[0];
} | 1 |
5dded7b999cd43d07dc122a403e9bac8 | c6efd2b002c41419c8961d2870024115 | 重启android设备 | fun restartDevice(){
Runtime.getRuntime().exec("su")
Runtime.getRuntime().exec("reboot")
} | 1 |
597395d28a77181cafe6e72f0339ce62 | da6dd06b60971327fc31bd3ae74a43a7 | Kollar om man är på samma position som en nyckel. | public class QLearner
private boolean isSameBoard(IBoard board, Entry<Pair<IBoard, Move>, Double> entry) {
try {
return entry.getKey().f.getCurrentUnicorn().pos.equals(board.getCurrentUnicorn().pos);
} catch (ArithmeticException e) {
return false;
}
} | 1 |
219b9984b919829568b8d306a94d689e | 17b00cf460b15cfbdb16bf8bf7b52b42 | 角度 --> 弧度 | function EllipseType:radianToAngle(radian)
return radian * 180 / M_PI;
end | 0 |
65054ad8c715b2f2acf8e68c0f36e67e | 37fb4438768de846295dc97ba5dadedd | Load a page of data into the Data buffer for reading data | static uint32_t MDR_EEPROM_ReadBuff_Page(uint32_t address, uint32_t count, uint32_t * data, MDR_EEPROM_MEM memBank)
{
uint32_t tmpCMD;
uint32_t bankMask = VAL2FLD(memBank, MDR_EEPROM_CMD_IFREN);
uint32_t readCount = 0;
tmpCMD = MDR_EEPROM->CMD;
MDR_EEPROM->CMD = bankMask | MDR_EEPROM_CMD_BIT_CON;
MDR_EEPR... | 1 |
64dce3071e128c2f260a468726bba33f | 347351b34a4f3d656f5411e8b530a43d | Updates the I_xx value when it changes | {
xValue.text = ((int)(25 * xSlider.value - 25)).ToString();
MyPrefs.XSensitivity = xSlider.value;
} | 0 |
068f826f01ff6f0462651c69001b668e | 976a89f9309a28c60bcf48c1247b32f7 | Declines a job offer. | public final class JobRoutersImpl
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Object> declineJobActionAsync(
String workerId, String offerId, DeclineJobOfferRequest declineJobOfferRequest) {
return declineJobActionWithResponseAsync(workerId, offerId, declineJobOfferRequest)
... | 1 |
46dff0f2a6397696425848b7515c2497 | dfea37df403525a44b68f4f99183b04f | Pre-Process the data prior a delete operation. | public function DELETEquery_preProcessAction(&$table, &$where, \TYPO3\CMS\Core\Database\DatabaseConnection $parentObject); | 1 |
258fac4d9d8b68fe411621729a6f1066 | 20c35fc47fd30dc854c8278d4f7a832a | 计算掉落池掉出来的物品列表 | {
if (fallID <= 0) return;
List<FallGoodsItem> gallGoodsItemList = GameManager.GoodsPackMgr.GetFallGoodsItemList(fallID);
if (null == gallGoodsItemList)
return;
List<FallGoodsItem> tempItemList2 = GameManager.GoodsPackMgr.GetFallGoodsItemByPercent... | 1 |
a8994ee4bc4326bb21d8b8c6fa841f76 | 74b3f2abe6ae0c8232f43eda2dac52c6 | The ID of the selection bet on. | public class ParametersBean
public String getBetTypeId() {
return betTypeId;
} | 1 |
4b4508bfb6969cd58d4cdd55bc522475 | 162532e5aa1e929e45e0d72e5a36dd3a | Creates a list of tags matching the passed filter. | if (tags == null) {
throw new ArgumentNullException(nameof(tags));
}
IEnumerable<TagDefinition> result = FilterType == TagDefinitionFilterJoinType.And
? tags
: new TagDefinition[0];
foreach (var clause in FilterClauses ?? ... | 1 |
490d135bd4af991ae7532a9e69928e9a | 34c5c3a21028f3f372eae4051568e336 | 通过address查找FolderManifest | namespace PowerUI{ public static class Bundles{
public static AssetBundle Get(string address){
AssetBundle result;
Lookup.TryGetValue(address,out result);
return result;
} | 0 |
ed6bb9a21c328df3d327a5016ac5759d | 76ecd727091c7a1af332a19890c5efe7 | 获取用户密码时解码 | class Users extends CActiveRecord
public static function decodePwd($password)
{
return base64_decode(trim(base64_decode($password), self::$salt));
} | 1 |
6f22ef76b30b9c9575e98242d4d7488c | 59a195d84072e3d8800a560bab97e108 | コンボボックスにEnterが入力されたら、確定させる | namespace KyoeiSystem.Application.Windows.Views
public partial class MST04021 : WindowMasterMainteBase
private void UcLabelTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Update();
}
} | 0 |
bf9812126911bdfa297535dca215f157 | bd68ab2b5b2695642a393e6c6ba23399 | 根据vipNo删除购物车所有数据 | int deleteAllCart(String tid); | 0 |
516b95105bbd4818013fdb94a1ecf74e | 0e7801db77a6ce21833de0159b054a46 | 无线频段测试:5G | class TestAPDhcpServer(unittest.TestCase):
def test_034_wifi_5g_dhcp_server(self):
log.debug("034")
tmp1 = APSBusiness(self.driver)
tmp1.change_AP_Freq("5GHz")
tmp1.connect_DHCP_WPA_AP(data_ng["NG2_ssid"]+"-2",
data_wireless["short_wpa"],data_basic['wlan_pc'])
result ... | 1 |
ce0a9762aab35a9b1d47c967f4653a57 | be5292937f4525a34dd1d0019dafbb55 | Wrapper for wp_dropdown_categories to easily add new dropdowns. | global $typenow;
if ( 'post' !== $typenow ) {
return;
}
$taxonomy = get_taxonomy( WSU_Magazine_Issue()->taxonomy_slug );
wp_dropdown_categories( array(
'show_option_all' => 'All issues',
'taxonomy' => $taxonomy->name,
'name' => $taxonomy->name,
'orderby' => 'name',
... | 1 |
e4345bdceffaa3bb69ea687eecef2dc3 | 05524d2ec1bbdb88a20059938708e66e | Fetch file segment asynchronously. | {
return GetStreamAsync (index, section, offset, count, true, cancellationToken, progress);
} | 1 |
a1f19a2213c7487b837a799d371989bd | 519d32b70d328ac85ab8909266571334 | # Nitrogen Flux from Microbial SOM to Passive SOM | internal_fluxes[["N_srfmic->N_slo"]] = function(
C_am
,N_am
,C_as
,N_as
,C_bm
,N_bm
,C_bs
,N_bs
,C_fw
,N_fw
,C_acw
,N_acw
,C_bcw
,N_bcw
,C_srfmic
,N_srfmic
,C_mic
,N_mic
,C_slo
,N_slo
,C_pas
,N_pas
,N_ino
,t
) {
c_cont = C_srfmic
n_cont = N_srfmic
radds1 = rad1p1 + ... | 1 |
5dd493e5c7328da1fd8658684a434c40 | dd34ffc1fce0c2e5f83fc268b0772366 | Meldet, ob es sich bei einer Tabelle um eine <i>PREMIERE Content
Information Table</i> handelt. | if (this.getContentSource() != null && this.getContentSource().equalsIgnoreCase("pq") &&
(this.getPmid() == null || this.getPmid().length() == 0)) {
return false;
}
return true;
} | 0 |
d23916cb6f744bf199146f80f2caf0e9 | 20a63d32a0f5004a4807eaefc4099bd2 | 从链表中删除并返回头结点的游标 | ListNode *List_shift(List *list){
ListNode *node = list->first;
return node != NULL ? List_remove(list, node) : NULL;
} | 1 |
ef73874f8884f730d27d0040f5e9fc5b | 51c9f85ea7c9963a466fb406956ef0cd | Sets the error information object for the current logical thread of execution. | ErrorInfo setErrorInfo(String message); | 1 |
5d11bf2a54aef896809cad94d73c3225 | 046952b50fe7c59789e2f3f38142b8ac | Check that we throw an appropriate error when passed an out-of-bounds index.
(write, negative) | namespace spvtools namespace opt namespace
TEST_F(LocalAccessChainConvertTest, OutOfBoundsAccessAtBoundary) {
const std::string assembly =
R"(OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %2 "main" %3
OpExecutionMode %2 OriginUpperLeft
%void = OpType... | 0 |
f6f893d3114abb305d3c55085ffee9e2 | 3e3f821b3f1cdd0474a5cdb85d3397f1 | Teste default, onde o número de elementos deve ser o mesmo que o número
de componentes | {
component1.reset(new ComponentTest);
controllerComponent1.reset(new ControllerComponentTest);
component2.reset(new ComponentTest);
controllerComponent2.reset(new ControllerComponentTest);
object.addComponent(component1);
object.addComponent(controllerComponent1);
object.addComponent(component2);
object.addCom... | 1 |
9d48fb37863f2badcb313cf054f7bb66 | 2582f09d2dab2d71917b0b8b76a69a4c | GET_MAIL_NO_PROCESS | {
$criteria = New CDbCriteria;
$criteria->addCondition("process=0");
$criteria->limit= 20;
return Mailqueque::model()->findAll($criteria);
} | 1 |
7d62a9e71c2255cbb27937ecab5f11ad | e574409448a0b62f48f512842ce6be8b | Adds a new bone in the hierarchy of the given control rig asset | {
var bone = new WowBone() { Id = uint.MaxValue, Index = (byte)Bones.Length, ParentBone = parent, LocalPosition = localPosition };
bone.SetName(boneName);
Bones = Bones.Append(bone).ToArray();
if (parent != null)
parent.ChildBones.Add(bone);
... | 1 |
82ea33201a1aa631a2d88d4d306aa627 | e0194fc862968b7791bdb8ef4f0779a3 | This function creates the ground truth for one image
It also caches the ground truth for the image using its index
Input:
bboxes: (n_boxes,4)
index: scalar (the index of the image in the total dataset used for caching)
grid_size: tuple:len(2)
anchors: (grid_size[0],grid_size[1],4)
Output:
ground_clas: ... | cache_file = os.path.join(self.cache_path, self.name + '_gt_roidb.pkl')
if os.path.exists(cache_file):
with open(cache_file, 'rb') as fid:
roidb = pickle.load(fid)
print('{} gt roidb loaded from {}'.format(self.name, cache_file))
return roidb
g... | 0 |
076f77b605ec930a6d65b7f57760a0a9 | e4210aca4456ea3cd08fbf2ccfae5292 | Returns a new object of class '<em>Project Repository</em>'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class RepomodelPackage extends EPackageImpl
public EReference getRRepository_RProjects() {
return (EReference)rRepositoryEClass.getEStructuralFeatures().get(1);
} | 0 |
9302bf713a153d470286ed3846f2fcb6 | 1309a8460deb8f4d3fd54a597701f4c9 | 该函数求解距离,函数体内自带角度获取,需要传入Imagprogress函数处理过的data | def calDistanceAndAngle(cxnum, rynum, colsum, rowsum, Head_angle, cameraID):
distx = colsum / 2 - cxnum
disty = rynum - rowsum / 2
logging.info("distx: %f" % (distx) + "______________disty: %f" % (disty))
Picture_angle = disty * 47.64 / 240
logging.info("Picture_angle: %f" % Picture_angle)
... | 1 |
953bcca7448e7d79510637810c696765 | f513cd15f1e57481fc34f825eb899671 | Method handeling the press event on a keypad button | namespace BB_8
public partial class Call_ControlPhone : Window
public void PressKeyPad(int item)
{
Execute("<CiscoIPPhoneExecute><ExecuteItem URL = 'Key:KeyPad" + item + "'/></CiscoIPPhoneExecute>");
} | 1 |
290e10199e15bae12cec88d4c3af1fed | 8dc1c5f6236ab0c2d06cd5fc67816364 | Extract youtube url from item of search result | url_pattern = re.search(
r"http[s]?:\/\/www\.youtube\.com\/watch\?v=\S{11}", url)
if url_pattern is not None:
return url_pattern.group()
url_pattern = re.search(
r"http[s]?:\/\/youtu\.be\/\S{11}", url)
if url_pattern is not None:
return... | 1 |
0c7a9bf2330c7fbc9b45d44173a98a9b | 474323f75c3341d9269f221437b731dd | 如果Bean实现了BeanNameAware接口的话,Spring将Bean的Id传递给setBeanName()方法 | public void setBeanName(String beanName); | 1 |
eb98b165bc89ec1916844114c3020131 | 97b6bca5fabae9e00fd2c8b2086fb912 | Gets the "feet" element | int English_Length::getfeet() const
{
return feet_;
} | 1 |
f46d983e82f5809f58ddb15feff8132a | 6d5a042437d8653bd85c87b77e87dab4 | Creates grid and sets all pieces in their homes | public class BoardManager : MonoBehaviour
public void SetupGame () {
SetBoard ();
SetBoardPieces ();
} | 1 |
2b82040227950670cd202fd97ed41429 | 701417b5ad611d513ff14c4a1d7fb66a | Check if a stair exists between the two cells | if not all(value in self.vertices for value in [x, y]):
return False
idx_x = self.vertices.index(x)
idx_y = self.vertices.index(y)
return self.matrix[idx_x][idx_y] >= 1 | 1 |
d8d63c4d27437959f92585766014527e | 35657dac957dd624b97306a0d5844447 | Copy metadata (=DICOM Tags) from one image to another | oldElement: ImageElement,
newElement: ImageElement
) {
newElement.stars = oldElement.stars;
newElement.tags = oldElement.tags;
newElement.timesPlayed = oldElement.timesPlayed;
newElement.year = oldElement.year;
} | 0 |
1afcac65e8d48d1960f6265e18d15e98 | 816145090bc937de22bb22c14eba723e | First method that deals with handling requests, this one is for
dealing with multiple clients trying to make requests at the same time. | void * dispatch(void *arg) {
int fd;
request_t request;
char filename[BUFF_SIZE];
while (1) {
fd = accept_connection();
if (fd >= 0) {
pthread_mutex_lock(&lock);
if ((get_request(fd, filename)) != 0) {
printf("Failed to get request from the client\n");
pthread_mutex_unloc... | 1 |
e5d996fae947dd535ac84d69c9d5872c | 32f325f0b4653c12c7ced31ae5914709 | Check if value is nil (null or undefined). | isNull (val) {
return val === null
} | 0 |
4aded85a4e08eab1a35b3326b95768c1 | 895b93da7fe7a413a0c3dab0959ea720 | 爬取一天数据实现(子类必需实现的方法) | class Spider(object):
def crawl(self, *args):
fmt = "%s must implememt crawl()"
raise NotImplementedError(fmt % self) | 1 |
f89c7bb69b2553a14a65584b1c2b64d3 | 729ebecd3b0e2541d2599368f3934579 | Github 监控任务 | executeTaskList([
hexoGenerate,
pushBaiduSitemap,
hexoDeploy,
remotePull,
restartNginx,
gitCommit,
gitPush
])
} | 0 |
2d8c0eed7c102657e9293ddddda16468 | b1ce8ef8149b58ddc8b1deda9dae4959 | 获取搜图模式状态 | public class GameController : Singleton<GameController>
public bool IsScanMode()
{
return m_isScanMode;
} | 1 |
c75af6b164334dbd9203412fc3ea0c9b | a1b3993a799130ae411e87932e3fe01c | Hauptnavigation innerhalb des Programms (rückwärts) | global $usertoken,$lastdate;
echo _button('SSI Ranking','','ssi_points.php').'<br/>';
echo _button('Erfasste Spiele','','ssi_points.php?func=listgames').'<br/>';
echo _button('Meine Chancen','','ssi_points.php?func=personal').'<br/>';
echo 'System SSI Date: '.retaustriandate($lastdate);
} | 0 |
597f24e1de297a2dfaf82a78324a6b79 | 2f7644716b3f01fdda819a20bec030f0 | Get the 'Offer_Id' element value. | public class OfferList
public static class OfferInfo
public String getOfferId() {
return offerId;
} | 1 |
d3c26915a61d7822a3f01b4d6c9e1fe5 | 552c9d7e3108f39da0eafa473d32f329 | Toggles subscription to fanclub news | class User
def update_subscription(community)
community_user = self.community_users.where(community_id: community.id).first_or_create
community_user.subscriber = !community_user.subscriber
community_user.save!
end | 1 |
00ceb00014521fbed133ee86e7bc5a25 | b5561e0a27e9244f2e40c5fe38ebbdeb | Функция отправки email-сообщения: Обратный звонок | class Vlans extends Controller
private function callMe() {
if ($this->isAjax()) {
if (isset($_POST) && !empty($_POST)) {
if (empty($_POST['name']) OR empty($_POST['phone'])) {
giveJSON(array('status' => 'fields_empty'));
} else {
$toMail = (!empty($GLOBALS['config']['sit... | 1 |
d9167b7f54fe47b56aa6adcdd074d38f | 9433277e064990f15c6340f6517f512a | Creates a list of Shape objects from the selection. | class Qt4_GraphicsManager(HardwareObject):
def get_selected_shapes(self):
selected_shapes = []
for item in self.graphics_view.graphics_scene.items():
if (type(item) in [GraphicsItemPoint, GraphicsItemGrid, GraphicsItemLine] and
item.isSelected()):
selected_sha... | 1 |
96d71e3a9f61b2b7e8d23def5a6a5450 | 878ea7f799b063df8ecaaffafb30afd1 | The YARN endpoint address used by this endpoint. | public java.lang.String getEndpointAddressUri(); | 1 |
55f5c1a1cb271180743d1869c0040eb0 | 2739198c774ed16cf3b26bc4cc078f3b | returns nil or error, or array with strings of all element names | def element_definitions_by_name(names)
return [] if names.blank?
if names.to_s == "all"
Element.definitions
else
Element.definitions.select { |e| names.include? e['name'] }
end
end | 0 |
77af01b2420b00afd5675f4b17526e10 | 171dd5ab4a39811ca5e101dc81f1b2cf | Implements in-place TOS = TOS1 / TOS. | void static INLINE command_DDIV(registers* pointers)
{
if ((pointers->sp - 1) < pointers->bottom) interpret_crash(stck_empt, pointers);
pointers->sp--;
(pointers->sp)->dnumber = (pointers->sp + 1)->dnumber / (pointers->sp)->dnumber;
} | 1 |
4492f18b5d1f12e9521f9c6bcc9bf39b | e53f32343cdc24bc4ae019ab7a69f7ef | 是否 fitsSystemWindows, 即在顶部加入一个padding,默认不加入
0 --> 不加, 1 --> 加上 | abstract class BaseActivity : AppCompatActivity()
open fun isSetPaddingTop(): Boolean = false | 0 |
b1165b64a5160ba25bf574c473f06637 | 0326b874acbdf0e6565ab10aa1ca61b5 | GET: api/Candidate | namespace WebAppTest20170719.Controllers
public class CandidatesController : ApiController
public IEnumerable<Models.Candidate> GetAllCandidates()
{
return Candidates;
} | 1 |
aaa97e0047510e3db22cb28442c4093f | 885c8a7e7d82660fd3150ad134e6843f | Test that setting an attribute that doesn't exists fails. | abstract class AbstractEntityTest extends AbstractTest
public function testSettingAttributeThatDoesntExistsFails(): void
{
$this->expectException(\InvalidArgumentException::class);
$this->abstractEntity->setAttributes(['dummyAttribute' => 0]);
} | 1 |
f600720f58f23a599c39db7800eee187 | 2c2882945d6de186a2279c5542669d92 | 创建一个任务,它在指定的 <see cref="T:System.IAsyncResult" /> 完成时执行一个结束方法函数。 | namespace Nito.AsyncEx
public static partial class AsyncFactory<TResult>
public static Task<TResult> FromApm<TArg0, TArg1, TArg2>(Func<TArg0, TArg1, TArg2, AsyncCallback, object, IAsyncResult> beginMethod, Func<IAsyncResult, TResult> endMethod, TArg0 arg0, TArg1 arg1, TArg2 arg2)
{
var tcs = new... | 1 |
ecab305088581d382ca7b90100432673 | 0d226aedea53cf3d1948f8fc0dc03e42 | 获取当前Activity屏幕方向,true竖屏,false横屏 | Configuration mConfiguration = this.getResources().getConfiguration();
int ori = mConfiguration.orientation;
if (ori == mConfiguration.ORIENTATION_LANDSCAPE) {
return true;
} else if (ori == mConfiguration.ORIENTATION_PORTRAIT) {
return false;
}
re... | 0 |
c927fbee7ecc19c6a5b1aec52e14e9cf | e8f0793fa6dddf98ab14b0db61f9f628 | 更新电梯的经纬度 | public ServerResponse updateLatitude(String hSid, String hJingdu, String hWeidu) {
int a = hoursMapper.updateLatitude(hSid, hJingdu, hWeidu);
if (a == 0) {
ServerResponse.createByErrorMessage("修改失败!");
}
return ServerResponse.createBySuccessMessage("修改成功!");
} | 1 |
ba5c07bc10d86062546498aaa220473f | a2f29834499b1ced5bcd65cc4406366e | clears the values that the user has entered in the posting comment section | {
var nodeToDelete = document.getElementsByName("postcomment");
var nodeLength = nodeToDelete.length;
for(var i=0; i<nodeLength; i++)
{
nodeToDelete[0].parentNode.removeChild(nodeToDelete[0]);
}
} | 0 |
c3b8d69f97a829f84091ae9745e23b8a | 1d695858c1700ebed5432149bd0f33bd | Finds novel transcripts, builds their attributes | def addTranscript(attributes):
attributes = attributes.split(';')
return retrieveIdTrFronAttributes(attributes) | 0 |
37a6df5f9f2794d903f0fe9d2ce8a7c2 | 326b1ac8de9c5b577f4c0a5895d4f654 | @brief Deletes the address associated with your current Tox ID. | def delete_address(addressid: str = None):
return get_anonymous('deleteAddress', addressid=addressid) | 1 |
6fb4bfdfaacf113d09ed792abd2ee859 | a6aa04dc88f2541ee5ad07a83f024d3d | Test ping between 2 PODs | topo = MNTopo()
net = Mininet(topo=topo, host=CPULimitedHost, link=TCLink)
net.start()
sender = net.get('sender')
receiver = net.get('receiver')
result = sender.cmd('ping -c 5 ', receiver.IP())
print result
net.stop() | 1 |
6f8a448f98fb72253c604f56dbd8a4c3 | 9dfcf4816b8c3681077b712d72721530 | Uploads the package from the temporary directory to a repository. | {
$extra = $this->getComposer()->getPackage()->getExtra();
if(!isset($extra['azure-publish-registry']) || !is_array($extra['azure-publish-registry']))
{
return;
}
$this->copyPackage();
$this->cleanIgnoredFiles();
$this->sendPackage();
$this... | 1 |
4b027d6836f38ce0b455a88a9491962f | 91dfefef94a8641afe830c32025eec98 | 返回链表中某个键的索引,类似于index()方法 | class ChainTable(object):
# 初始化链表
def getIndex(self, data):
pointer = self.head
index = 0
while pointer.data != data:
pointer = pointer._next
index += 1
return index | 1 |
103b944e8ea7dd2a84afc3bc07ebd76a | 6dff6ea63b10ed5e02340eac18ede87b | Текущее состояние клеточного автомата. | public class CellContext
public CellState getState() {
return this.cellState;
} | 1 |
c5c52920c416fcb6b987541e841ced49 | 9e44069792b903d38c2ee0829c6433c1 | This method generates the call of a method
Example : $this->methodName($args) | {
if ($methodScheme->argumentsPhpCode !== '')
{
$this->result .= "({$methodScheme->argumentsPhpCode})";
return;
}
elseif (count($methodScheme->arguments) === 0)
{
$this->result .= '()';
return;
}
$tmpArguments = ... | 1 |
f1c9c282c7383c4c37ff49bc21ac2d7e | d75784967bbfc4df5c02bd4d9592904e | Creates a new Grade model.
If creation is successful, the browser will be redirected to the 'view' page. | class GradeStudentController extends Controller
public function create()
{
} | 0 |
4b576b92644d72c215b29d6c58f464a3 | 2544efbdfe893f58ca6c14a34c66f4f3 | Provides the standard 0-input Object interface to the dF MATLAB function. | namespace Capacity
public class Class1 : IDisposable
public MWArray[] F(int numArgsOut)
{
return mcr.EvaluateFunction(numArgsOut, "F", new MWArray[]{});
} | 1 |
e805036b9a92f0143383c14d407a6ea4 | 7fc5fd6ab1330675182c8c0fc992ae41 | Valida el campo IdCuentaObservacionSubTipo. | if (this.getSelected() != null && observacionTrabajadorIdTipoObservacionController.getSelected() == null) {
observacionTrabajadorIdTipoObservacionController.setSelected(this.getSelected().getObservacionTrabajadorIdTipoObservacion());
}
} | 0 |
7df541b003a4e799c8aea8f7ff37fb7d | 9e533b9c81c214906f9ca4f9f02dc91b | reads numbers from the text file called input_filename and
inserts first quarter of elements into one queue and the rest into
another queue using NEW INSERT. Then merges the two queues using
EFFICIENT MERGE and calcualtes the time to perform all
these operation and finally performs DeleteMin10. | bool run_sim(string input_file, string output_file) {
ifstream ifs("InputFiles/"+input_file);
if (!ifs.is_open()) {
cout << "Error opening: " << input_file << endl;
return false;
}
ofstream ofs("OutputFiles/"+output_file);
if (!ofs.is_open()) {
cout << "Error opening: " << ou... | 0 |
2bda1587c6661af2e915c352b4e97459 | 03962f2d01a734b53b45a942bdad0dcf | 获取钱包账户(不存在则创建) | @Service
@Slf4j
public class UserWalletServiceImpl implements UserWalletService
public UserWallet createWalletAccount(Long userId) throws Exception {
UserWallet wallet = this.findUserWalletByUserId(userId);
if (wallet != null) return wallet;
String password = RandomStringUtils.randomAlphabetic(3... | 1 |
9cfce7d943a931840ee02da502b10af9 | aa24f3a0dc5b6b5acaea1eefaa9cc27b | Evalua el potencial de Lennard-Jones de forma analitica. | def lennard_jones_potential(rij2):
sig_by_r6 = np.power(1 / rij2, 3)
sig_by_r12 = np.power(sig_by_r6, 2)
energy = 4.0 * (sig_by_r12 - sig_by_r6)
return energy | 1 |
4857ccf33d9f15bd77b72cbc8b214626 | 2deb0e29e7749e525343d60addebbf98 | Test adding multiple stereotype attributes | class StereotypeAttributesTestCase(unittest.TestCase):
def test_n_st_attributes(self):
f = """
class c1 "A"
: <<tt>> :
: x = 1
: y = 2
"""
n = parse(f)
stattrs = n[0].data['stattrs']
self.assertEquals(1, len(stattrs))
self.assertEquals('tt', stattrs[0][0])
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.