query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4e112df740c35513c9ac575d33a0ce5d | c8fa451a7f3ab0010d053c7a89d22c6f | 删除选中的 visitedView | DEL_VISITED_VIEW(state, view) {
for(let [i, v] of state.visitedViews.entries()) {
if(v.path === view.path) {
state.visitedViews.splice(i, 1);
break
}
}
} | 1 |
1c09cc82f5dc1d0751a091770aae0920 | 860022f6e1f28552bc90945a88ade31a | Saves the given aggregate | {
try {
$res = $this->createCommand()
->update("{{". $this->getTable() ."}}", $data, ['id' => $id])
->execute();
$this->createCommand("COMMIT")
->execute();
$this->createCommand("SET AUTOCOMMIT=1")
... | 1 |
fce37a2922d17f56046c83f189b8da03 | 0affc6b3c2c962f41129b63a74205c76 | Collect the non-segment properties from definitions. | this.defines = Object.assign(
{},
MeshPhongChunk.getDefines(),
SurfaceNormalChunk.getDefines(),
ExpansionChunk.getDefines(),
this.defines
);
} | 0 |
cf10c527be36d8d3fc357ad2f60d0097 | 1fe68c6a1fc4847ef279fdc3d4645282 | Changing size should change calories | public void ChangingSizeShouldInvokeINotifyPropertyChangedForCalories()
{
var beans = new BakedBeans();
Assert.PropertyChanged(beans, "Calories", () => { beans.Size = Size.Large; });
} | 1 |
6205ba9a6b9a1123ffbab1c15cd8d081 | 5a17f8477f371bdd36735440a93e02c1 | Returns the meta object for the attribute '{@link br.dslcross.crossplatform.crossPlatform.MethodCallCmd#getObj <em>Obj</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getCallAttributeObject_Obj(); | 1 |
6219deafc0df8b2ccb7b41167f76046f | 6272d29ce0802a841551c4889da74126 | 生成一个32位安全uuid,可以用于sessionId、作为密钥等场合。 | public class StringUtil
public static String uuid32() {
return uuid64().replace("-", "");
} | 1 |
ef16d591b1ed36c8f0c4efd38b8faff9 | 6d089092ea4e2e2df1aac1ebb6324c73 | 页面配送方式下拉绑定数据 | public partial class admin_Order_Travel_CreateNewOrder : ControlPage
public void DropBind() {
DataTable StartDt = _base.GetNextDataTable("ActiveCity");
foreach (DataRow dr in StartDt.Rows) {
Ord_StartCity.Items.Add(new ListItem(dr["BASE_Name"].ToString(), dr["BASE_Id"].ToString()));
... | 0 |
0610f13bcf42fd66f8d7e08383a7b525 | da1153df821b49c69c8d09850c00f558 | Gets 微信支付partnerid | class WxPayAppPay extends WxPayDataBase
public function SetPartnerId($value)
{
$this->values['partnerid'] = $value;
} | 0 |
3d60d7090f6ac15734f0beb4b5290b37 | 90ea45fe2fdd8a5d4584ce508361e993 | Sets the name of the property that will be fetched on each bean in the collection in
order to generate optgroups. A new optgroup will be created each time the value changes. | void setPropertyName(String propertyName); | 1 |
1f2fd9a92b960af78b9b85db748d2f46 | 0a201cb8004c50180e9545c2f82190a3 | 计算两点之间线段距离,计算结果以毫米为单位 | {
double lon1 = (Math.PI / 180) * start.longitude;
double lon2 = (Math.PI / 180) * end.longitude;
double lat1 = (Math.PI / 180) * start.dimensionality;
double lat2 = (Math.PI / 180) * end.dimensionality;
double R = 6378.137;
double d = Math.acos(Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) ... | 0 |
3f200eb79b4947cf892718abca4cabc2 | 18b07c17aa6294e354ce15dbf370ce5c | must match exactly one token: | rubix.stringVariables.zip(tokens)
.filter { it.second.isHoleTokenIn(this) }
.map { mustBeOnlyOneTerminal(it.first) }
.fold(T) { acc, it -> acc and it } | 1 |
3edd620a90c735a423679865990de0ad | 2b3ac770ab1d0615c02e6ef73d15d486 | wrapper method to:
- fetch page content, and
- get total covid cases. | class Data:
def get_total_cases(self):
data = self.data['Totals']
for content in data:
if content['name'] == 'Coronavirus Cases:':
return content['Values'] | 0 |
d645a4f4fe0a8036afcea581528e2e8d | dd64f692086613892d967fd542422ff0 | get the payment method from session | class View extends \Magento\Backend\Block\Template
public function getPaymentMethod()
{
return $this->_getOrder()->getPayment()->getMethod();
} | 0 |
453c2be2180613bb40803ba26b56f7a6 | 7c4adc6ec7f77d38884f1f562c7fc297 | Method to delete the player profile | class Profile(Screen):
def deleteProfile(self):
self.manager.current = "DeleteProfile" | 0 |
989251f11e89e62fddac25455d38780b | 0401cf52c5ac164758fa3a2d04f5f2b0 | Make an HTTP GET request to Abstract's Phone Number Validation and Verification API,
for retrieving all available details about requested phone number. | class ValidationService extends PaparaService
public function ValidateByPhoneNumber(ValidationByPhoneNumberOptions $options)
{
$result = $this->GetResult("/phoneNumber", $options);
return new PaparaResult($result);
} | 1 |
dc26ee9a1d691239321c48999d0e43ce | 4ae64ad9722b8313ef9a55fa79b691b6 | Calculate the sale price of the trip from its base cost and services | public class Appointment
public double calcPrice(List<Service> services) {
double totalPrice = 0;
for (Service service : services) {
totalPrice = totalPrice + service.getPrice();
}
return totalPrice;
} | 0 |
6990da128248a3c9038e96f44d3e92db | f224e6a929ed1ca03ef33f60f708ed18 | Will print the raw value | if let Some(ref raw) = raw {
write!(self, "{}", raw)?;
} else {
write!(self, "{}", value)?;
}
Ok(())
} | 1 |
2eea159fb3af195a08b7f3ed6074e6ed | 310473b90b6544f879c329b6b26cdde1 | Initializes the database with song data. | from goodsongs.models import seed_database
import click
@app.cli.command('seeddb')
@click.option('--songs')
def seed_database_command(**kwargs):
seed_database(**kwargs)
print('Database seeded.') | 1 |
d357a97a4a5de470847c3f9702346706 | 67c588ecbe5f1207555c41630689a643 | function description :this function is used to set SPI as a slave | {
memcpy(g_ucTxBuff,SLAVE_MSG,sizeof(SLAVE_MSG));
ucTxBuffNdx = 0;
ucRxBuffNdx = 0;
MAP_SPIReset(GSPI_BASE);
MAP_SPIConfigSetExpClk(GSPI_BASE,MAP_PRCMPeripheralClockGet(PRCM_GSPI),
SPI_IF_BIT_RATE,SPI_MODE_SLAVE,SPI_SUB_MODE_0,
(SPI_HW_CTRL_CS |
S... | 1 |
ad54fc600a910fb7da64f383a14f5a4c | a0dea72ec047fc0fcf07e891ecf1ddcc | Sets up the widgets default admin fields. | {
$fieldDefinitionForm->add(
'defaultWidth', IntegerType::class, array(
'required' => false,
'label' => 'ezyt.default_embed_width',
'translation_domain' => 'forms',
'property_path' => 'fieldSettings[defaultWidth]',
)
... | 1 |
b74b690f7926692dc615eb266ab67fab | cfa11905285d2ebc026139298c342b5c | Метод добавляет админа к диалогу, который открыт в админке. | async with state.proxy() as chat_link:
chat_link['description'] = message.text
reply = chat_link['url'] + '\n' + chat_link['description']
reply = (f'Пользователь @{message.from_user.username} '
'хочет добавить чат:\n' + reply)
admin_ids = db.admin_ids()
for admin_id in admin_ids... | 0 |
dedea42dc7a8d70d3f11f607ba8228f4 | 0ee353687d88ca5716a76f9c4e44a551 | Asynchronously delete an extended attribute from an object. | namespace WebDAVServer.FileSystemStorage.AspNet.ExtendedAttributes
public static class FileSystemInfoExtension
public static async Task DeleteExtendedAttributes(this FileSystemInfo info)
{
if (info == null) throw new ArgumentNullException(nameof(info));
await extendedAttribute.Delete... | 1 |
9c7d21689a01bbfa51b1386574dc230e | 98bc0859feb70702cdaaae183e24b477 | Removes joke from favorite jokes | class JokeItemController extends Controller
public function destroy($id)
{
} | 0 |
aadbdc77589c8f44cc9b1f3a0aa50635 | 5a95cd85a6b8e0d71b8f4c3feb8b1c30 | register the callbacks for OSC adresses | @oscReceiver.add_method('/test/finished', '') do |msg|
@testDone = 1
end
@oscReceiver.add_method('/test/result', nil) do |msg|
if(msg.args[0] == "PASS")
if msg.args.size == 2
puts " PASSED: #{msg.args[1]}"
elsif msg.args.size == 3
puts " PASSED: #{msg.args[1]} #{msg.args[... | 1 |
c9f4690205394d75cd8fed9f6bdc46f0 | 86a081410fb1cd0be98a9e5e4e378a67 | Se daña a si mismo | class jugador:
def Hit(self):
self.vida -= 1 | 1 |
f756668635024ae23c5f82b3bc3c61c8 | 0a0d03f143c91ae045f73de5ac3ae32a | GPU evaluations are availabe only for order 0, 1, and 2. Cubic will come later, but higher order will not be supported | if not core.is_compiled_with_cuda():
return
places = [core.CUDAPlace(0)]
for place in places:
for layout in ["NHWC", "NCHW"]:
self._compare(place, layout, False) | 0 |
fb8fc8f0a11cce4d2ca6dfdd5c974975 | efab6ead3354ee5f2e8aae833a5626e1 | Returns the matrix of the reviews represented by the words vector | class BaseSimilarityRecommender(BaseRecommender):
def W(self) -> Union[sps.csr_matrix, sps.csc_matrix, np.ndarray]:
if self.W_ is None:
raise RuntimeError("W fetched before fit.")
return self.W_ | 0 |
fa0a35ce3e48d3ca72084b3549269a43 | b19145324b3ab9636120bfbeb053e54d | 날짜문자열(format에 따른)에 날짜를 더한(혹은 뺀) 일자를 구함 | DateFormat dateFormat = new SimpleDateFormat(format);
String resultString = null;
Date resultDate = null;
Calendar cal = null;
try {
Date date = dateFormat.parse(targetDate);
cal = Calendar.getInstance();
cal.setTime(date);
cal.add(Calendar.DATE, afterDays);
resultString = dateFormat.fo... | 1 |
72bd8a3adb3fb2346305461942112f5c | 810926955f99e2adee774e4869d32ac6 | perform a 32 bit Fowler/Noll/Vo hash on a vetex point
Direct from reference code which has
Please do not copyright this code. This code is in the public domain. | static int _ihash(int *x, int i, int l, int k) {
unsigned int j = l * 100;
k = 32 - k;
while (l-- > 0) {
j ^= 3141592653U * (unsigned int) *x >> k;
j *= 97;
x += i;
}
return 3141592653U * j >> k;
} | 1 |
032559aea4f418df96ee344feb7bed48 | 3dddeff0a40db7d8e015b675a850b67a | 获取最新工具前6条 | {
var result= rep.GetFWTools();
var ret = JsonHelper.ToJson(result);
return Content(ret);
} | 0 |
cc5526f90d25679952fc08a05a5571ea | ff8095f30db4e0466e48a16c9c563805 | Filters input locales based on filter locales and condition. Each input locale's entry will be checked against
corresponding filter locale's entry:
Condition takes input's entry and filter's entry. | class Table
protected function fieldsCondition($fields)
{
$localizedColumns = array();
$notLocalizedColumns = array();
foreach ($fields as $field) {
if ($field->localized()) {
$localizedColumns[] = $field->id;
} else {
$notLocalizedColu... | 0 |
961d1f7f3b362a177fabc2e7a2c8877a | a07ce69e68c2b241658d2e1480feb972 | 计算栅格的范围 | max_pnt = Point(self.Mx, self.My, self.Mz)
max_cid = py_find_cell_id(max_pnt, self.cell_size)
min_pnt = Point(self.mx, self.my, self.mz)
min_cid = py_find_cell_id(min_pnt, self.cell_size)
self.ncx = numpy.int32(max_cid.x - min_cid.x + 1)
self.ncy = numpy.int32(max_cid.y -... | 1 |
5f4dc64eff8f6aea48e71f03e239e1af | b4c8fcd1b66fa901f74a38bf38a904b2 | Computes the rescaled range of the differences of the data in the window. | public class Scores{
public double standardizedAllResponsesRange(){
if(!this.dataPreprocessed)this.preprocessData();
if(!this.variancesCalculated)this.meansAndVariances();
return this.standardizedAllResponsesRange;
} | 0 |
4b144ea3d9fcef0f493afb189ada00e5 | 779bd37c349b2e599f4500cc74d19a27 | Kills another member. | class Moderation:
async def kick(self, ctx, member : discord.Member):
try:
await self.bot.kick(member)
await self.bot.edit_message(ctx.message, 'Kicked {} from the server.'.format(member))
except:
await self.bot.edit_message(ctx.message, 'You dont ... | 0 |
3bff6298444d6a7415ae67485dd3145b | 78ceeb2fffad1c82a050495680c9816d | 车队单车充电量(瓦/次)= 充电总量/充电订单总数 | public class MemberRechargeInfoDto implements Serializable{
public void setBusPower() {
if (this.billCount == null || this.power == null || this.billCount == 0) {
this.busPower = 0L;
} else {
this.busPower = this.power / this.billCount;
}
} | 1 |
927497ac2179fd372efa91123d85d7fb | f4de8f75081de518b990cea0038fd112 | 根据模型id、字段id获取用户自定的数据类型(用于模型复制) | String getModelItemByDataType(Integer modelId,String dataType); | 0 |
09c80e80e0c3a146fa86abe59066d12c | 5568696670128c404c6f49d6a4962866 | 设置鼠标点击回调函数 | def on_mouse_click(f):
window.on_mouse_clicked = f | 1 |
cfe1e4c6ffb78269556cccccf2cf2718 | e73ac5c66185e0ebe9641553e2b9aed6 | Function to add a feature that considers
the total age of applicants and their co-applicants
Returns | result = {
"auto": 3,
"disability": 3,
"home": 3,
"life": 3
}
try:
income, vehicle, house = data["income"], data["vehicle"], data["house"]
if income and vehicle and house is None:
remove_eligible(eligible, "disability")
remove_eligible(... | 0 |
a6223b3ab97b6572a1fe757c810f5673 | fe63c664ca5d47608951eab87e87eda4 | Total ELBO gradient wrt alphaBar: likelihood, KL and prior. | dim = len(alphas.size())-1
alpha_0 = alphas.sum(dim=dim)
beta_0 = betas.sum(dim=dim)
kl = alpha_0.lgamma() - alphas.lgamma().sum(dim=dim)\
- beta_0.lgamma() + betas.lgamma().sum(dim=dim) \
+ ((alphas - betas)*(alphas.digamma() \
- alpha_0.digamma().unsqueeze(dim))).sum(dim=dim)... | 0 |
b61a6229c3eac4b72c2442013b860d03 | 1dab93e1b4d7a86e58efc609a9d941dd | take DiGIR XML search request and translate
into a simple common 'intermediate' SQL form suitable for
translation to Texql. | final class Da_Wrapper
static function toTsQuery($term, $default_and = FALSE)
{
$term = preg_replace('/\\\/', '', $term);
$term = preg_replace("/[\(\)]/", '', $term);
$term = preg_replace('/:/', ' ', $term);
$searchstring = '';
$m = array();
if( preg_match_all('/([-!]?)(\S+)\s*/', $term, $m, PREG_SET_ORDER... | 0 |
83a70bd5ee9be4e622b83d43f100cff9 | 1a57b29bce28280449db53bdce418338 | Returns the registered fragment at the position | public class FolderSettingsDialogPagerAdapter extends FragmentPagerAdapter
public Fragment getRegisteredFragment(int position) {
return registeredFragments.get(position);
} | 1 |
4dc0fb6756d7a4ae05c0715986db7ebc | 2f0337d8a4730ebe5f4f7f83c2e7ae5a | Enable or Disable haptic feedback | namespace UnrealEngine
[ManageType("ManagePlayerController")]
public partial class ManagePlayerController : APlayerController
public override void SetDisableHaptics(bool bNewDisabled) { } | 1 |
193387d0113d086ee0cae7d72d6dc3e8 | 55d31d60eeb0f25778a9bc08e1986d08 | returns max dimensions | maxWidth = max(map(lambda s: s[0], sizes))
maxHeight= max(map(lambda s: s[1], sizes))
return (maxWidth, maxHeight) | 1 |
afc9b487211c2925206ee5651a720e33 | 5e9ff99167648b03a694697a7609a121 | Gets a light's current data from the bridge and updates the client's data about it. | namespace HueApp
internal sealed partial class MainPage : Page, INotifyPropertyChanged
private async void LightRefresh_Click(object sender, RoutedEventArgs e)
{
Lights = new ObservableCollection<Light>(await _bridge.GetLightsAsync());
} | 1 |
95bca92e0b57482a24ba4bef8c0a97c3 | d3ca413c1b2544b343250c66ca2094b1 | goToDest but returns when withing specified distance so momentum can be kept | double distanceToDestinationInCM = 0;
if (update) getPositionControl().updateAllCoordinates(false);
try {
double distanceToDestination = TrigonometricUtil.dist(getPositionControl().getFrontPoint(), destination);
distanceToDestinationInCM = distanceToDestination / (getPosi... | 0 |
891eb352d7522a6b2c10156b6f24c505 | c3370eafc5200f647289c2c34a9efda2 | List all the accounts following the user. | require (signedIn()) { "need to sign-in to get following users" }
return getFollowingsAsync(account!!.name)
} | 1 |
086dd55166a70c3e08c7678bb08e1af1 | 295ec4c2e957ebbee93f64d6d824108e | Enqueues a MODIS preparation task. | DataDate date, Runnable continuation) {
enqueue(new RunnableTaskQueueEntry(
Priority.Reprojection.ordinal(),
new PrepareModisTask(project, product, date),
continuation
));
} | 1 |
282461aa40b873ef4ec703181769ba16 | 3095b68c035e939696beffa07fb260de | 创建K个随机质心的集合(基本K-means的方法) | centers = []
dimensions = len(data_set[0])
min_max = defaultdict(int)
for point in data_set:
for i in xrange(dimensions):
val = point[i]
min_key = 'min_%d' % i
max_key = 'max_%d' % i
if min_key not in min_max or val < min_max[min_key]:
... | 1 |
737f19846ae685844cacac0e64324298 | a46f986db616ea4a0cf3f3fcb0af15b5 | Метод. Создает новый регион и открывает диалоговое окно для его редактирования | [Authorize]
public Region AddNewRegion([FromBody] Region oRegion)
{
if (ModelState.IsValid)
{
return _iRegionService.AddRegion(oRegion);
}
else
{
return null;
}
} | 0 |
554a8334c45ddcd2489826b49da62653 | cc133717b28bed82cb7de1a2404fceb5 | 不展示菜单 | function Game1ViewLayer:onShowTopMenu()
if self.m_nodeMenu:getPositionX() == 1110 then
return
end
local actMove = cc.MoveTo:create(0.5, cc.p(1110, 128))
local spawn = cc.Spawn:create(
cc.CallFunc:create( function()
local Button_Show = self._csbNode:getChildByName("Button_Show")
... | 0 |
9f873a785f296d75649de5e65b803037 | 251e93034e98a28bc47cc1b30f7cf621 | 获取所有采购规则信息 | {
string pid = ConfigurationManager.AppSettings["CoalAppDAL"];
SafeReader sr = await DataCommon.ExecuteSafeReaderAsync("[dbo].[MCARule_GetAll]", new SqlParameter[] { }, pid);
List<MCARuleDO> objs = new List<MCARuleDO>();
while(sr.Read()){
MCARuleDO... | 1 |
e36ad59a0a96842429cb31eea3ca760c | 4246f8e40bb9fdae36a3e2dac8360518 | Get number of actual attempts for the user | public function getAttempt(): int; | 1 |
dba012cbafc2e409d7e03c98854c4655 | ac3235c72838ddafe762fbc311c7bb42 | 审批众筹项目 | project = Project.query.get(project_id)
if project is None:
return render_template('admin/project_list.html', project=None)
project.is_approval = 1
project.public_status = 2
db.session.add(project)
db.session.commit()
return render_template('admin/project_list.html', project=project) | 1 |
dec1ae4309a234117ce8c07b9c55a9d1 | 1625758046e7a9aea16ea8665d43b5dd | decreases invincibility timer | public class Bar_fire_control : MonoBehaviour
public void invincible()
{
CancelInvoke("decreaseHealth");
} | 0 |
05cc3f2beb7bae0b94ffe2924d9e8a53 | 6c335cc42e97680d602ca834f2b96cda | Encode32 encodes uint32 slice to variable byte codes. | bbuf, err := EncodeBytes(objs...)
if err != nil {
panic(err)
}
return bbuf
} | 0 |
9a9457c4227e6837af793172d77a7cbf | c6cb197f9fa021fd55bc6c1321d0f84b | ● 判定文字是否继续显示 | return true if @cursor == STOP
now = Time.now
@last_update ||= now
now - @last_update > UPDATE_DELAY
end | 0 |
d62389bd8f9b511f03f0531c0c29915a | f85cc8ca8ed0f77309439acb5294259a | Init the Alexa moudle | PLUGIN_HANDLE plugin_init(ConfigCategory* config)
{
Alexa *alexa = new Alexa(config);
return (PLUGIN_HANDLE)alexa;
} | 1 |
a426eac09f30e8e65378cb01927d48cc | 29908bacc61ec1854e504f0181d19a4a | 每个任务组中的任务名称不能重复 | public class TaskQueryDO implements Serializable
private boolean isTaskName(String taskNameOrId) {
if (taskNameOrId.indexOf(',') != -1)
return false;
for (int i = 0; i < taskNameOrId.length(); i++)
if (taskNameOrId.charAt(i) < '0' || taskNameOrId.charAt(i) > '9')
... | 0 |
96296b3e38edc71c4b5bea89a02a0e9a | 7263bb3a49c85aa65d7ac1f2f56cd52a | 获取消息概况(最多5条) | {
try
{
var list = bLOG.Infoes.OrderByDescending(p => p.Count).Take(5).ToList();
return list;
}catch(Exception e)
{
Console.WriteLine(e.Message);
return null;
}
} | 1 |
aafaabe1095bf6ca9240bafad45d41e4 | 24d7103e7cf80dbf866f31d50e93c48a | Retorna as matrizes cinemáticas nodais calculadas na origem de cada elemento finito poligonal. | void calculateElementMatrices(std::string element_type,
libMesh::DenseMatrix<libMesh::Number> &Ke, libMesh::DenseMatrix<libMesh::Number> &Ce, libMesh::DenseMatrix<libMesh::Number>&Me,
libMesh::DenseMatrix<libMesh::Number> &Re,
con... | 0 |
d90ac979515cd33d45f19d74ea87a480 | ce7e0698597f54aa020e3a18791577f4 | 找两个有序数组的第K小的数字,这样找就可以保证时间复杂度变成O(lg(m+n))了 | if len(nums1)>len(nums2):
return self.findkth(nums2,nums1,k)
if len(nums1)==0:
return nums2[k-1]
if k==1:
return min(nums1[0],nums2[0])
i=min(k//2,len(nums1))
j=k-i
if nums1[i-1]<nums2[j-1]:
return self.findkth(nums1[i:],n... | 1 |
e1a05f23d24e0c78eff93b116a7971c0 | 9195034eb311a39255508e717d943ee2 | Indica si es solo movimiento de captura. | {
if (ev.PointerCount != 1)
return false;
return CaptureMovementCheck(ev);
} | 1 |
069a1ad2ef5fdac583d18de4b4e75822 | 7105c1cd22444ce8b928708501e482bd | Метод выдачи координат диагональных клеток. | public class Bishop extends Figure
public ArrayList<Cell> way(Cell sourse, Cell dest) {
ArrayList<Cell> cells = new ArrayList<>();
Cell newCell;
int i;
if (sourse.x < dest.x) {
if (sourse.y < dest.y) {
i = sourse.x + 1;
for (int j = sourse.y + ... | 1 |
4b222eecfa68ec4103c76aa943f4e4a4 | bf2fd32151d2fbc09e98e8312935ed8d | 配列のキーを再帰的にスネークケースに変更する | {
$newArray = [];
foreach ($array as $key => $value) {
$value = (is_array($value) || is_object($value)) ? $this->renameKeys((array) $value) : $value;
if (is_string($key) && str_contains($key, '_')) {
$newArray[$this->camelCase($key)] = $value;
} el... | 0 |
377a1211df67d6b2125964d6336fdcd3 | ade4c48d3af5a2f5133e61d9258d919d | écrire une ligne dans le fichier Save.txt | void Interface::screenshot(void)
{
ofstream myfile;
myfile.open("Save.txt",fstream::in | fstream::app);
myfile<< line<<endl;
} | 1 |
40c7e4f6fc5d06ab95567250e85486e0 | a0551b25408ddb479578cc5c3e6b6338 | Esta função gera todas as ilhas em ambiente gráfico a partir de uma lista com os centros das ilhas e de outra lista com os seus formatos geométricos | double altitude = sideLength*Math.sin(Math.PI/3);
for(int indexLevel = 0; indexLevel<numberOfLevels; indexLevel++){
for(int index = 0; index < figuresByLevel;index++){
if(indexLevel%2==0){
agh.newNode(index*sideLength,(int)(indexLevel*altitude));
}
else{
agh.newNode(sideLength/2+index*sideL... | 0 |
5a311702fc774dda75f4d14babc37d8e | 457e8e5c05b6f83d7554ec699dc28a7a | equality test between two digit lists. | for (int i = 0; i < 10; i++) {
if (a_digits[i] != b_digits[i]) return 0;
}
return 1;
} | 1 |
92946dc8dcf459b4dc9bc5cbfe404144 | 9b31e071044099a9a3276df9c13de149 | Sets the login error message | setLoginMessage(state: TraceLoginState, { payload }: AnyAction) {
state.loginMessage = payload;
return state;
} | 1 |
e2fe8e4fad5511cbef71cb986fa948bf | 55cea08c44afff66e0dcee651365eb36 | 把id为n的活动配置,设置当前的配置信息 | public class ActivityData:BaseData
public void reloadConfig()
{
config=ActivityConfig.get(id);
} | 1 |
af1d987f81bace38143fea52a6d2efe2 | 3d77ed1045b2b18b5d4ea67c76fd3284 | #fonction basique evaluant la moyenne empirique d'un echantillon gaussien | r.em <- function(N, xt, par.em){
par.em[1]*exp(xt/2)*rnorm(N)
} | 0 |
5621f09eab47f95415608b637054a601 | 019318c7b6db8ab0f9acd2f03b0cae92 | en base al index de combobox buscamos las unidades del material para ponerlas en el label | class Buy_order extends CI_Controller
public function filtraUnidad()
{
$idPro = $_POST['idPro'];
$idPrv = $_POST['idPrv'];
$this->load->model('Orden_compra');
$data = $this->Orden_compra->buscaUnidad($idPro, $idPrv);
$select_unidad = "<div><select id='unidad_producto' class='nminputselect'>";
$select_unida... | 1 |
1aa69e762fe46ced508e68726b87a059 | 1505e3861fc83a4070d422d00e0e7d1b | Deletes the given owner_obj from the database. | List<Payment> paymentList = this.getPaymentsOfOwner(owner);
Set<Object> objs = new HashSet<Object>();
for (Payment p : paymentList) {
objs.add(p);
}
return dao.deleteInTransaction(objs);
} | 0 |
1ba10d6a9ec1f19ec1f13358721cd2a6 | 8710a5965f4b69baafb5b713ec4decad | Set Alarm notification rule name, which can contain up to 60 characters | class TenantActivityLogAlertArgs:
def alert_rule_name(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "alert_rule_name") | 0 |
890281a1a118090fc751c95a1ee144e2 | de237fc729abdf7ed9e6c89f3412a2ba | Get all the product from the cart associated with the customer. | {
$list_shop_ids = Shop::getContextListShopID(false);
$sql = '
SELECT ma.`id_product`, p.`quantity` AS product_quantity, pl.`name`, ma.`id_product_attribute`
FROM `' . _DB_PREFIX_ . self::$definition['table'] . '` ma
JOIN `' . _DB_PREFIX_ . 'product` p ON (p.`id_product` = ma.`id_product`)
... | 1 |
745837c01272ae07fedcb08fad23544d | 93592dea10333fb7682f67023990dfa5 | 上传新的图片,然后删除旧的图片 | public class LoginPresenter extends BasePresenter<ILoadView>
public void updateImg(ArrayList<String> imgs) {
MultipartBody.Part[] parts = new MultipartBody.Part[imgs.size()];
for (int i = 0; i < imgs.size(); i++) {
File file = new File(imgs.get(i));
RequestBody body = RequestBody... | 0 |
8fe2390e724cc2df01a2fe028a2ebe77 | cd4cec2bbd6ff1c4bfdd74cb224a5cdf | Находит разделительные линии для буквенной строки | {
return Words.GroupBy(x => x.BoundingBox.Bottom)
.Select(x => new TextLine(x.OrderByReadingOrder(), wordSeparator))
.OrderByReadingOrder();
} | 0 |
2fb6bcad820113e63b1d2521f92798de | 5650848a7dc404badc5bfdf342368611 | User-defined pre-delete logic.
Implementers of this class should add a call to this method as the first
line of code in their implementation of $this->deleteAll() | abstract class User implements ActiveRecordInterface
public function postDelete(ConnectionInterface $con = null)
{
} | 0 |
8eeb4873619defe6dcea48eb2bfefc42 | 84ffeb5587168f14f1db1ecbe7aafc47 | Returns <see cref="Vector3" /> that has the same direction to this <see cref="Vector3" /> but is, at most, of given
length. | namespace eZstd.Geometry
public class XYZ
public XYZ SetLength(double newLength)
{
return this * (newLength / GetLength());
} | 1 |
3dea938f0958c3ea2cbddc358ab660da | 8ed0075031a3ab3ceb5f238afb8ffee4 | Returns whether the instruction at the given offset is popping exactly
the reference type of the specified class constant. | if ((self.itype == idaapi.ARM_push or self.itype == idaapi.ARM_pop)
and self.ops[0].type == ida_ua.o_idpspec1
):
return self.ops[0].specval
return False | 0 |
1c8ef1eefcb4624105192eda4698a9a0 | 5d1e146ff4cecf8d184d399e598202c1 | <para>Quickly flick on and off collider infront of player. Small range</para> | public class CheckForAttack : MonoBehaviour
public void ToggleCollider()
{
targetField.enabled = !targetField.enabled;
} | 1 |
a27f13d839c818ae223a1b20e6222a91 | 202950466d7c539026c7989890e618d7 | Ustawia minimum w zależności od wybranego typu danych. | {
switch (Counter.Type)
{
case CounterTypes.Amount:
LowerLimit = Calc.NaturalToValueAmount(value);
break;
case CounterTypes.Quantity:
LowerLimit = Calc.NaturalToValueQuantity(value);
break;
case CounterTypes.Integer:
case CounterTyp... | 1 |
ee0f63ddab8d41070b9f2fa9d86a5a8d | ebe85ed4063a8f4392e9a8d512d130c6 | 編集時に投票の入力値に1が入っているときに一番マークが選択マークになるようにする | public class VotePager extends BaseFragment implements ViewPager.OnPageChangeListener, CompoundButton.OnCheckedChangeListener
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (mCurrentVoteRadio.isChecked()) {
mViewPager.setCurrentItem(0);
mCur... | 0 |
60b0c84503c4dea1753f27268cba00d0 | 8ffb101f5b956199a046185e2a260870 | A generator function like range but act on months | def month_range(start, end):
m = int(start)
while True:
yield m
if m == end:
break
m += 1
if m > 12:
m = 1 | 1 |
1546ad95abf13db8cf509674426a48cb | 1b1aaa18afc2346ba3ed019fcfd1a1a5 | Tests that out-of-range field name SIDs fail consistently in both text and binary. | public function testUpdateBinaryDataAsFilenameFailure(); | 0 |
020e8a090c31f36ef8175f4b26af1a22 | 5816c62ef8b577ee9536a7b5c70ef3f6 | Creates a mapping from an external label to an object. | function buildLookupSemObject( arr ) {
var lookup = {};
for( var entry of arr ) {
lookup[ entry.getURI() ] = entry;
}
return lookup;
} | 0 |
3f91e3e0698c1b575f2852f2a86d62bd | 0154277b55c9fad6da21f2688de56249 | http://stackoverflow.com/a/40474415/1422096 | def zip(*iterables):
sentinel = object()
iterators = [iter(it) for it in iterables]
while iterators:
result = []
for it in iterators:
elem = next(it, sentinel)
if elem is sentinel:
return
result.append(elem)
yield tuple(result) | 1 |
63b89c6e6c8f65d1ca324fca1fe3a9c7 | e3bfd3e55fb1405fa309f66ebfd5c050 | Initialise a trivial smoother which doesn't do any actual
smoothing, and just returns the input x as the smoothed output | def persistence_model(x):
return x | 1 |
dfbf4f549f4afc8df2272ec5fde13dab | 44301e320fde40e03d08cf410ddea535 | Singulariza una palabra | if (palabraEnProcesamiento.at(tamanioPalabra) == 's'){
if ( terminaCon( 4, std::string("sses")))
tamanioPalabra -= 2;
else
if ( terminaCon( 3, std::string("ies")))
cambiarPor(1, std::string("i"));
else
if (palabraEnProcesamiento.at(tamanioPalabra-1) != 's')
tamanioPalabra--;
}
if ( terminaCon( 3, ... | 1 |
6785b70b69e9b99f1789deb8659b32f7 | 99687dcd2aee4787f54e47e4a309b839 | 接受准则 | if self.sensob.value < 15:
self.motor_recommendation = ('T', 1)
else:
self.motor_recommendation = ('F', 2)
self.set_match_degree() | 0 |
dfb454e04339f35c55647cd6b1626dca | 28268a580b4ed785ce3ec52552f5b3f7 | Merge Freesurfer brain segmentation with the lesion segmentation
performed by samseg in Freesurfer's space. | l2_file = glob.glob(os.path.join(dtifit_output_dir,"*L2*.nii.gz"))[0]
l3_file = glob.glob(os.path.join(dtifit_output_dir,"*L3*.nii.gz"))[0]
output_file = l2_file.replace("L2","RD")
fsl_rd = pe.Node(
fsl.MultiImageMaths(
in_file=l2_file,
op_string="-add %s -div 2",
... | 0 |
b1b5a2442baa157aa2092c7dfc667bfb | a6cd82e9da72208d0e6867f70e2cd0cd | Multiply by the Gamma_mu spin operator | void qcd_oneMinusGamma(qcd_complex_16 result[][3], qcd_complex_16 vec[][3], qcd_uint_2 mu)
{
qcd_uint_2 alpha,beta,c;
for(alpha=0; alpha<4; alpha++)
for(c=0; c<3; c++)
{
result[alpha][c]=(qcd_complex_16) {0,0};
for(beta=0; beta<4; beta++)
{
result[alpha][c] = qcd_CADD(result[alpha... | 0 |
e9723b5bd5cbd3b849c362c48846117c | 3209dfe9591719b648b063db94ded502 | 从用户中心入口(用户姓名)进入到用户管理界面 | class UserManagementPage(basepage.Page):
def into_user_management_page(self):
self.dr.click('xpath->html/body/div[10]/div[1]/a')
self.dr.click('xpath->//div[@id="navMenu"]/ul/li[7]/a/img')
self.dr.switch_to_frame('id->fNav')
self.dr.click('id->spage.data.tree39')
self.dr.switch_t... | 1 |
56a8e79b117ceb196c57bacb13af8062 | 0bc73dfbd787dbbdd2c1f1f407f0d681 | 设备类型String to Int | @Service
public class ConfigFileService
public Integer getDeviceTemplateDataIntTypeByStringType(String stringType){
List<DeviceTemplateDataType> typeList = getDeviceTemplateDataTypes();
for(DeviceTemplateDataType type : typeList){
if(type.getTypeString().equals(stringType)){
... | 1 |
5122603432b47277ddf2d6f8674c2043 | d68a3dcc9e74938598a0d8846dc691de | Set Require Symbols
"Specifies whether to require symbols for IAM user passwords." | try :
return self._requireuser
except Exception as e:
raise e | 0 |
59e695cdcc55abd0454cb18734931976 | 0945374d4d0867565c76f316ff23867a | description:
Sets the ipv6 address on the test AP
usage:
steps.radvd_enable(ipv6_ip="2001:1234:5678:9abc::1",
ssh_host="192.168.1.1",
ssh_user="root")()
tags:
ddwrt, config, ipv6 | self.ipv6_ip = ipv6_ip
self.ssh_host = ssh_host
self.ssh_user = ssh_user
self.step_data = None
base_step.__init__(self, **kwargs) | 1 |
1feee459f290727f0c74ad715fbe4ea5 | 90d361f1146fb857ce0c6ef944f472bc | 設定 registerModal 事件 | function regEvent() {
if (!isRegEvent) {
isRegEvent = true;
spanClose.onclick = function () {
divModal.style.display = "none";
};
divModal.onclick = function (e) {
if (e.target === this) {
divModal.style.display = "none";
}
};
btnConfirm.onclick ... | 1 |
ff7707548b3c00c64e1bd9d70d57cc97 | c83804581e5aa8f9b945fcabcb4d4440 | Verifica que existan las carpetas necesarias para la aplicacion. | def preparar_archivos():
if isfile(join("componentes", "cuenta.txt")):
return False
if not isdir(join("componentes", "copia_seguidores")):
os.makedirs(join("componentes", "copia_seguidores"))
if not isdir((join("componentes", "copia_seguidos"))):
os.makedirs(join("componentes", "copi... | 1 |
144d2ef49c92fb567cd7faf080a3f1cf | 3f6bdd5a840d20f957044462fcabba0e | Handle synchronization of inline relations | $schedule = $event->schedule;
$user = $schedule->user;
$users = $schedule->users;
foreach( $users as $u ) {
if( $u->id != $user->id ) {
$type = ScheduleType::where( 'user_id', $u->id)->where( 'class', 'relation' )
->whereNo... | 1 |
d7d548214179c95fc525de2c02b7ed6c | 4d841022a2aa3af443d6bc758113294b | Default no-op | class OpRing
def noop
end | 1 |
0208ac29bacb15dfa198a43fdef2bba5 | 5328ad012c9b10cc8a3454e5301b7059 | https://stackoverflow.com/a/6487534 | def chunks(iterable, n, fillvalue=None):
args = [iter(iterable)] * n
return itertools.zip_longest(*args, fillvalue=fillvalue) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.