query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
29d52f9899dcb6317945806253e5b379 | 772913d1202a521e7e04094cb5003c11 | We want the file with the more recent last write time to come first | public class LastModificationSort implements Comparator<File>, Serializable
@Override
public int compare(File o1, File o2) {
return Long.compare(o1.lastModified(), o2.lastModified());
} | 1 |
f660d84c893972c6a8ee83085b7e41b7 | f011c4e130f79c108f06986b801b8978 | add one to account for the bias term | class LinearReg():
def add_bias(self, X):
return np.c_[np.ones(X.shape[0]), X] | 1 |
25f18e06b24b51e5fe38a4a0e648675d | 0f49dc54249482da45e066aad0902d6e | function to get account name based on the typed value in account field | public class LoginActivity extends Activity implements View.OnClickListener
public String getAccount() {
return et_name.getText().toString().trim();
} | 1 |
3b45807406c565717226798667a2e083 | 569385c937ec8a76fc4be3dc6d8e6233 | 批量更新sku | public void updateSkuCountBatchByIds(List<SkuDTO> skuList) throws Exception, BusinessException {
this.updateBatchById(DozerUtil.mapList(skuList, SkuEntity.class));
} | 1 |
2825c7e919d3f527e55829d9a3caf021 | e91570ae095fd2a42ec8d6972c1f1424 | Returns the given list with all duplicates removed. | newList = []
for entry in list:
if entry not in newList:
newList.append(entry)
return newList | 1 |
e3bff0a4f5dd9fe4aab17e5bae1457a1 | af3b864153d407ae1123501fcd43912b | return all of the children of this accessible element. | public Enumeration<Node> children(); | 1 |
25451447e7a137e141e884c6a8dde0ad | afa7ac00462ed54cd6204ef7a7e2287a | 通过request包装学生实体类 | @Service
public class StudentService
public Student convertEnity(StudentDTO dto)
{
Student student = new Student();
student.setStudentId(dto.getStudentId());
student.setFirstName(dto.getFirstName());
student.setLastName(dto.getLastName());
return student;
} | 0 |
af41f2bce48d78e392a4ec8a264cf788 | 2f37e0ef37a5aa0d1c668bc6e7b755f2 | пропускает элементы в последовательности, пока они удовлетворяют заданному условию,
и затем возвращает оставшиеся элементы | public static class ListExtensions
[Pure]
public static IEnumerable<TSource> SkipWhile<TSource>(this Lst<TSource> source, Func<TSource, bool> predicate) =>
Enumerable.SkipWhile(source.Value, predicate); | 1 |
09c0451f12211d990ad810a1151c9f90 | f44af583690a4f7ddb2b3630480aef70 | Можно ли пользователю проверять жалобы | if ($this->_allow === null) {
$uid = get_uid(false);
if ($uid && !is_emp()) {
$reqv = sbr_meta::getUserReqvs($uid);
if ($reqv['is_activate_mob'] != 't') {
$this->_allow = true;
return $this->_allow;
}
}
$this->_allow = false;
}
return $this->_allow;
} | 0 |
5c723857cefb544a9ebfac216243cce3 | fb1e37ea0105734d16bcb3a34c3eceb4 | 从磁盘加载CSV数据 | {
XDebug.Log("LoadCsvData : path = " + path);
if (string.IsNullOrEmpty(path))
return;
if (csvData == null)
csvData = new List<string[]>();
else
csvData.Clear();
csvData = LoadSimpleCsv(path);
if (csvData != null)
{
... | 1 |
65b7b8a5659a5ad04509d7ec040a1f12 | 247db5d5744365b1aaacdeae2bada03b | No longer being held | public class CirculatingBook extends LibraryBook implements Comparable<LibraryBook>{
public void returned() {
currentHolder = null;
dueDate = null;
} | 1 |
5dccf1ee8852a4712c6f66289d5646f5 | 0bf350a7f6ae7ea26fc22916a31693e0 | This sample shows how to use a functional-type semantic script as an input expression for EE.
Some preprocessing will be needed to make the script look like C# | {
var input = CepStream<StockQuote>.Create("input");
var ericUSDGroupCepStream = from e in input
group e by e.FieldID into eGroup
from w in eGroup.HoppingWindow(TimeSpan.FromDays(7), TimeSpan.FromDays(1), Hop... | 0 |
d91d9c6367477ae7c17d3afaf9f433f3 | 58d3df5e477c07ee72736728a16047cd | The distance to the far clipping plane. | float CCamera::GetFarClipDistance() const {
return m_fClipFar;
} | 1 |
57d977212b14845a0164f25a1a48fd68 | 2402968fbc05700bcf6cb532d0246f8c | @brief This API returns the base address of the input memory node | static
SSA_STATUS
GetBaseAddress (
EFI_PEI_SERVICES **PeiServices,
SSA_BIOS_SERVICES_PPI *This,
UINT8 Socket,
UINT8 Controller,
UINT8 Index,
BASE_ADDR_TYPE BaseAddressType,
EFI_PHYSICAL_ADDRESS *BaseAddress
)
{
MrcParameters *MrcData;
MrcD... | 1 |
bf45974955d0bc9a110d3e15a007ac3e | 12cf9c2932d9a00a309999a13e6c19b2 | Determines if the specified <c>type</c> is a <see cref="Task"/>. | {
var isTask = false;
if (activityInstance.ActivityType == (short)ActivityTypeEnum.TaskNode)
{
isTask = true;
}
return isTask;
} | 1 |
509f6c2874368f1f9215278fa043d40b | aa2dce27f325d427e419988b2942ecad | opens a frame to change the open project properties | class AppView
openProject() {
this.appController.readWriteController.openProject();
} | 0 |
8db0112b71777010c2e3e8cb11872689 | 3795e85285874a19b040b91fb918c453 | Print message-box with optional title. | def msgbox(text, width=0):
menu(0, 0, text, [], width) | 0 |
531fdf275dde0aba9da30ffca72029c4 | 59e0a3d9f21293f4e5120a707a204748 | Returns length of vector. | class Vec2d:
def __len__(self):
return int(math.sqrt(self.x * self.x + self.y * self.y)) | 0 |
073bc222b89081eed2c3f4a1ae7a9270 | 2ad14898f18c66d47f4c9db5ec2a124e | 生成时间序列的GUID | {
long i = 1;
string str;
foreach (byte b in Guid.NewGuid().ToByteArray())
{
i *= ((int)b + 1);
}
str = string.Format("{0:x}", i - DateTime.Now.Ticks);
return str;
} | 0 |
043b9bec5fac1fb856fbde559395abfe | 674091d751ae0629d10c5a7f9515ac06 | sensor locations values into a bitmask. | class IASZone(BinarySensor):
def parse(value: bool | int) -> bool:
return BinarySensor.parse(value & 3) | 0 |
08c6463cb37ab545e78e147783a17cde | deda766c05da7c3927405c8165143252 | ラベルを全部削除する関数 | {
try
{
for (UInt16 cnt = 0; cnt < m_LabelList.Length; cnt++)
{
m_LabelList[cnt].TextAlign = ContentAlignment.MiddleLeft;
m_LabelList[cnt].Text = String.Empty;
}
}
catch (Excep... | 0 |
0c619d960c4e7f889e1e7e1101a44444 | d4d65aaccc77fb4cd80f2c32bccbe952 | Reads pairs file, creates node to neighbor mapping, and converts
the mapping into the adjacency list. | graph = dict()
max_node_id = 0
for line in open(fpath, 'r'):
nodes = [int(n) for n in line.split()]
parent = nodes[0]
neighbors = nodes[1:]
graph[parent] = neighbors
max_node_id = max(nodes)
assert max_node_id == len(graph)
return graph | 1 |
8f8346b5cdf3fbe73fa4c31477d8b205 | 09254f523ef63e1c2f7354b7a29cf799 | 保存课程类型信息 | @Service("com.tranzvision.gd.TZPxTeacherBundel.service.impl.PxCourseTypeMgServiceImpl")
public class PxCourseTypeMgServiceImpl extends FrameworkImpl
@Override
public String tzAdd(String[] actData, String[] errMsg) {
String strRet = "{}";
if (actData == null || actData.length == 0) {
return strRet;
}
try {
... | 1 |
282ec14f905fab4ac4f66367e69dc355 | fde80ba565e45bde4bd10ae948b02d3a | 打印点击的点的坐标 | x = e.screenX;
y = e.screenY;
d.text("X:"+ x + ",Y:" + y);
} | 1 |
0dd2bc9d15bb51e490e3f9dffc635873 | b0e9fda3ab2814340d212e8d71e7b71c | 获得响应返回的数据分块列表。 | public class RealtimeDataBlock
public List<InstructResult> getReplies() {
return replies;
} | 1 |
3825670153045be34f2314dbbb40cebc | 639dbd382470dc26f2ff3d732ca47684 | 将一个字串中含有半角的数字字符、字母、空格或'%+-()'字符转换为相应全角字符 | namespace OneOne.Utility4Core.Helper
public sealed class ConvertHelper
public static string ConvertToHalfStr(string str)
{
int index;
string retStr = str;
string fullStr = "1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
string halfStr = "1234... | 0 |
f00d6c5ef9fdcab80c9e58317c69180d | 1028b80d2bdf36cffd1cb7dd634b566f | defines which Items of the MenuBar are currently visible | namespace PanoSim.UI.Window
public partial class MainWindow : RibbonForm
private void visibilityBBI(bool visible)
{
this.bbiBackward.Visibility = visible ? BarItemVisibility.Always : BarItemVisibility.Never;
this.bbiStart.Visibility = visible ? BarItemVisibility.Always : BarItemVisib... | 1 |
78c6ba2217550a65670745305e48cc18 | 5a0af710d870feab8cc5c60a8b9368d4 | Bitwise and returns an AndObj BooleanOperation object | class mctobject(cotobject, numobject):
def __iand__(self, other):
self.code(lambda x: x&other)
return self | 0 |
77d4db63f9f178602dec5e041a76a561 | e5d9cda3634f33525bf34eaccaaa88bb | @brief Calculates the CAN FD RAM buffer address. | CANProtocol_RxBufferTypedef **rxBuffer) {
switch ((uint32_t) CANx) {
case (uint32_t) CAN1:
*rxBuffer = &CANProtocol_rxBuffer[0];
break;
#if 1 < CAN_NUM
case (uint32_t) CAN2:
*rxBuffer = &CANProtocol_rxBuffer[1];
break;
#endif
default:
return ERROR;
}
return SUCCESS;
} | 0 |
8d5777ff31c5fd2d8d7617602b954660 | c96fcb1a811329b749ee96c3833b16b8 | function to set the fill color to white | {
colour1.red= 0xFF;
colour1.green = 0xFF;
colour1.blue = 0xFF;
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
SDL_Rect newRect = {TOOLBAR_LEFT_WIDTH, TOOLBAR_TOP_HEIGHT, DRAWING_SPACE_WIDTH, DRAWING_SPACE_HEIGHT};
SDL_RenderFillRect(renderer, &newRect);
colour.red= 0x00;
colour.green = 0x00;
co... | 1 |
a6ec0f6f42b10994263a08a23e9cc257 | e49833b9f808a510c849457e65458b0a | Validate a Gregorian date | {
if ((year < MIN_YEAR) || (year > MAX_YEAR))
{
return false;
}
if ((month < 1) || (month > 12))
{
return false;
}
if ((day < 1) || (day > 31))
{
return false;
... | 1 |
69c5cec8febf1f99945b6ff40585d357 | e3fe08cbd4a5c4b5d5b01aba8fbf7012 | 展示所有的相册图片 | class ImageAlbumController extends Controller
public function index()
{
$images = $this->imageAlbumServiceInterFace->getAllOfUserLogin();
return view('admin.images.list', compact('images'));
} | 1 |
ea4a012a9fff4dca2400560d7aa8845f | 66abb2d80dfc3b2a797c9872b70e037f | 2.操作 修改表portal_user_account,将字段money_amount的值与续费金额累加在一起; | class VipUpgrade extends Command
public function editUserMoney($aUserGift){
$aSql = 'UPDATE `users` SET ';
$str1 = '`money` = `money` + CASE `id` ';
foreach ($aUserGift as $key => $value){
$str1 .= 'WHEN \'' . $key . '\' THEN \'' . $value . '\' ';
}
$str1 .= 'END , ';... | 0 |
63f48b7ef332a8338387ab95c82459a2 | 98837186f9c2e07b2a1ac01c7eb9e70a | 编辑视频信息功能 包括价格 | @Controller
public class ArtistInputController
@RequestMapping({ "/editVedio" })
public void editVedio(HttpServletRequest req, HttpServletResponse resp) throws Exception{
String videoimglist=req.getParameter("videoimglist");
JSONArray videoimgArray = JSONArray.parseArray(videoimglist);
List<StarVedio... | 0 |
05a5942c460b6e5e61a44bf055ec4773 | 4542693101d71f8777fcda95a24bdce0 | Modification des valeurs des paramètres matériaux.
Entrée : | class tx_vdexcavationexchange_validator extends tslib_pibase
function f_categoryMaterial($fieldsValue, $field, $v){
if($fieldsValue['catmatterrial'] == 1 ){
if($field == 'designiationsimplemeubleha' && $v == 0) {
$msg = $this->fieldsConf[$this->table][$field]['msg'];
}
}elseif($fieldsValue['... | 0 |
2bb32bd3efc9da9931552d96d4e2cc55 | 8b29400033e5583b094bafbfe2ceddb6 | Gets absolute time reference point for relative timestamping.
If is zero, then relative timestamping is disabled. | Long getReferenceTime(); | 1 |
8ebc027f92c44995814aadc29d84752e | 46b81271dd17b966684dcb795f85f1d8 | Getter for <code>NBC_FLUP_PET.COMMENTARY</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.8.0"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class NbcProcRecord extends UpdatableRecordImpl<NbcProcRecord> implements Record15<Long, Long, Long, Long, Timestam... | 0 |
6253b2ad538b74c9149b7c490b660076 | deb5b259feeb4cc1537dd5aeadb68b40 | function to count number of set bits | int Solution::numSetBits(unsigned int A) {
int count = 0;
for(int i = 0; i <= 31; i++)
{
if(A & (1 << i))
{
count++;
}
}
return count;
} | 1 |
470f03d2a949a7edfb4b361abbbb9bad | 8ad7a912963765cde69e414f7c502724 | Create operator form of dg/dx for distributed responses | BC = self.set_cell_gradient_BC(self._cell_gradient_BC_list)
if self.dim == 1:
G = _ddxCellGrad(self.shape_cells[0], BC[0])
elif self.dim == 2:
G1 = sp.kron(
speye(self.shape_cells[1]), _ddxCellGrad(self.shape_cells[0], BC[0])
)
G2 =... | 1 |
1ab3b259422c911489fa031571eb9279 | ff0ef330522c005e2db060976138c2f3 | Get indicationColor. | public class NotificationFactory
@ColorInt
public int getColor() {
return accentColor;
} | 0 |
9258c59853cb6cd50db5bcfce464700b | a1d2bb42876bfec54145112fd700c164 | Создание Заказчика | class OrderController extends BaseController
public function postNewPerson(Requests\PersonCreate $request)
{
$person = Person::create($request->all());
if ($person) {
return redirect()->to('/new-order/'.$person->id);
} else {
$this->SetErrorNotifyM... | 1 |
ff1b83922a2cd7c6cd9c443ada2359c6 | 73e36b36e5a84f32bc0c817c34d0ee4e | 让大于今天的日子不可选 | namespace Final_Plaetzler
public partial class index : System.Web.UI.Page
protected void cal_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date < DateTime.Today)
{
e.Day.IsSelectable = false;
}
} | 0 |
5766bc3e98477d0d721956240d0568fe | fc6b738245d53196f85f76d5773f99b8 | get all available currency pairs from binance | def get_binance_currencies() -> List[str]:
return [
"AUD",
"BIDR",
"BKRW",
"BNB",
"BRL",
"BTC",
"BUSD",
"BVND",
"DAI",
"DOGE",
"DOT",
"ETH",
"EUR",
"GBP",
"IDRT",
"NGN",
"PAX",
... | 0 |
f89f62061a4487b681985e25555a2dbd | 5553bae989348a536e9cd5a1b1f17367 | Process bulk action for profiles | @RequestMapping(path = "/bulk/action", method = RequestMethod.POST)
@PreAuthorize("hasAuthority('" + CoreGroupPermission.PROFILE_READ + "')")
@ApiOperation(
value = "Process bulk action for profile",
nickname = "bulkAction",
response = IdmBulkActionDto.class,
tags = { IdmProfileController.TAG },
a... | 1 |
439675ea89f81cd567d226cd5f94861b | 7ebd29ab1b970dc1310546b4d2e01b6e | Renvoie l'indice de la valeur minimale dans un tableau d'entiers
En cas d'occurrences multiples des valeurs minimales, l'indice correspondant a la premiere occurrence est renvoyee. | public class ToolBox
public static int iMin(double[] table) {
double min = table[0];
int imin = 0;
for (int i = 0; i < table.length; i++) {
if (table[i] < min) {
min = table[i];
imin =... | 0 |
fda726a4051bc5fcdda54718a1ef6f4f | cc965d668a17ba7686bdc2760ee49fe4 | Metodo che restituisce il codice fiscale dell'utente che ha effettuato la prenotazione. | @Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "ABBONATI")
public class Abbonato
public void setCodiceFiscale(String codiceFiscale) {
this.codiceFiscale = codiceFiscale;
} | 0 |
8c9bea201ccbaf7911fdaf42831a6d6c | 0b594c1a4ac579402d376243d451063f | Updates the information and state of a MiniController. | RobotPanelController.updateRobotPosition(alpha, yaw, gamma, pitch, extend);
RobotPanelController.updateRobotClaws(attachedClaws);
RobotPanelController.updateBranchDistances(topClearance, botClearance);
BatteryPanelController.updateBattery(battery);
} | 0 |
7e0964d4a2dd8a1bebed85b6b1499d27 | e13ab07d53b6f7d22927f2a1227720b1 | Вывод суммы депозитов пользователя по ID | namespace Penates.Interfaces.Services
DepositViewModel getDepositSummery(long depositID); | 1 |
e4e942b612cbe6e8f22ff7f8be71425c | 82f6bf9c2873675401a5d304b6659726 | 种子兑换果实 | if (this.currentState == "havetree") {
let params = {
treeUserId: Datamanager.getNowtreedata().id
};
MyRequest._post("game/harvestFruit", params, this, this.Req_harvestFruit.bind(this), () => {
this.pick_hand.once(egret.TouchEvent.TOUCH_TAP, this.PickFruit, this);
})
}
else if (this.currentSta... | 0 |
4fcca78db8621066135ed93c4fd0b0f4 | cf904d3941b642c48cc9b48389e84f65 | Retourne l'id de la dernière insertion par auto-incrément dans la base de données | class TiSQL{
public function lastId(){
return $this->connexion->lastInsertId();
} | 1 |
1409bc6bd761a97368283d2d54dcd4c2 | d1ac45e187d386988f532c15c2036d63 | Creates unordered dicts and compares for equality. | class TestIteratorCreation(unittest.TestCase):
def _unordered_list_compare(self, expected: list, actual: list) -> bool:
matched = []
for ele in actual:
self.assertIn(ele, expected, 'ele not expected')
self.assertNotIn(ele, matched, 'ele not unique')
matched.append(ele... | 0 |
a3ddd662a7306321d1976b90bb49ead8 | c46b93102554b2acad453ae16f3a0d1f | REINFORCE with baseline agent | def train_baseline(returns, states, w, alpha_w):
steps = np.size(returns)
for i in range(steps):
v_cap, phi = baseline(states[i], w)
w += alpha_w*(returns[i] - v_cap)*phi
return w | 1 |
90f284e32eddfa2a7f5ee66e8b71ffa8 | 64b7d611cb2df1ee526770905ca0a38b | ===============================================================
Constructor
================================================================ | class Display_Core
function __construct()
{
$this->container_blocks = array();
$this->col_data = array(
'leftcolumn' => '',
'rightcolumn' => '',
'header' => '',
'footer' => '',
'history' => array(),
'show' => array(),
'extraHeadContent' => '',
'page_... | 1 |
9147975da22a1b37ce8c05a823f39d83 | 9bb3d886dd5b75fb8fa740c800c18472 | 设置使用Opus编解码器。 | public class MainActivity extends AppCompatActivity
public void OnOpusCodecSettingClick( View clButton )
{
setContentView( m_pclLayoutActivitySpeexCodecView );
m_pclLayoutActivityCurrentView = m_pclLayoutActivitySpeexCodecView;
} | 0 |
aa3b95a0fa2225f02932836ce5ed4ba9 | c38590cce41d25796e91cc569718b322 | draws the porthole window | class Rocket:
def draw_porthole(self):
self.turtle.penup()
self.turtle.setposition(self.CIRCLE_CORDS)
self.turtle.pendown()
self.turtle.fillcolor(53, 74, 95)
self.turtle.begin_fill()
self.turtle.circle(self.RADIUS)
self.turtle.end_fill() | 1 |
040efacf8b4850ea64a36c57d38eefc0 | 6ce623cdcfb079664be6a3df942641ed | Get programAcceptanceAt | class PersonalityInsightsModel extends ServiceModel
public function getAccept() {
return $this->_accept;
} | 0 |
81aa1cf91e954ff137ad1ee71771aa83 | 89e972beb89ac8efe01b43193a2e052a | Called after Dtella has finished syncing. | class GithubEntity(object):
def after_sync(self):
pass | 1 |
ca0c08bf12a942db51f13a000079e95b | 1c0a16ab6c94ec1cbf2189cb24ef6380 | Load the root directory block from disk. | class OleFileIO:
def loaddirectory(self, sect):
log.debug('Loading the Directory:')
self.directory_fp = self._open(sect, force_FAT=True)
max_entries = self.directory_fp.size // 128
log.debug('loaddirectory: size=%d, max_entries=%d' %
(self.directory_fp.size, max_entries))
... | 1 |
80b3494ef12e32a152704b52b6516c9e | b052e93d8f794cdece23e3b2ecae92cd | Renders the form field content for the media library element. | $field = FormField::create( $args );
return $field->render( FormBuilder::get_value( $args['name'], $formdata ) );
} | 0 |
b9ec8cb7a87d289f1fd8749cee48a8ce | 40e80de58d80437e8693b197bff0253d | Grant role to selected principals | function assignAccessesToRole(orgId, roleName, accessNames, primary)
function doAssign() {
var deferred = q.defer();
var query = "select access_id from roles_accesses where role_id = {1} and access_id in ('{2}') and delete_date is null";
query = u.formatString(query, role... | 0 |
b6d8e8f68a4b2e56108d2467961c72aa | 8795702a566fd4851ca2fa81caed54e5 | continue recording from paused recorder | public class Recorder: MonoBehaviour{
public void StopRecording()
{
replayState = replay_manager.ReplayState.Paused;
} | 0 |
0b70f5a3c51b5e5ad073bffd857f9e1a | 115d5e679eebb5498cffeafc5664e7c9 | Connects to the rover at the specified IP on port 19232.
Assumes that the rover is currently running and listening with a socket on port 19232. | namespace NeuronDataReaderWraper
public class NeuronDataReader
[DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
public static extern IntPtr BRConnectTo(string serverIP, int nPort); | 1 |
671dab5de82c4e8e3abc590b0cd406f5 | f2373cf7a7224851897bf091ed6788a9 | Enable all scene switch buttons | {
foreach (Transform button in gameObject.GetComponentInChildren<Transform>())
{
button.GetComponent<Button>().enabled = true;
}
} | 1 |
d01e418afd07dec9c3778ac05a52937f | 65467b017b1ffcba333ded5b68292d29 | Receives an Ethernet frame on a DPAA1 network interface | {
uint8_t instance = netif->num;
enet_buffer_t bd;
LWIP_ASSERT("g_netif[instance] != NULL", g_netif[instance] != NULL);
if (STATUS_SUCCESS == ENET_DRV_ReadFrame(instance, ENET_QUEUE, &bd, NULL))
{
(void)enetif_input((struct netif *)g_netif[instance], (uint8_t*)bd.data, (uint16_t)bd.length);
... | 1 |
f0ca82a40384878b3fdaf70b9f4e9300 | a71c4ce1ebc7a7c2b10333f1911e0860 | Should be overridden by subclasses to return a list of base (i.e. always required,
don't need to be specified) gem dependencies. Should return an array of hashes
of the form {:name => 'rails-rubygem', :requirements => ['>= 1.2.5-1']} | def dependencies
end | 0 |
cbee8585bd168cf01b695f3ff396e513 | 92028e5b456c6a71afde615af361dc3b | Get the cell NorthEast of this (L{Geohash}). | class Geohash(Str):
def neighbors(self):
return Neighbors8Dict(N=self.N, NE=self.NE, E=self.E, SE=self.SE,
S=self.S, SW=self.SW, W=self.W, NW=self.NW,
name=self.name) | 1 |
43ada2e805b7f093bfea49cc1b36c3fd | 8c617cff6b0496ebf008b1ea61a1eb42 | 约瑟夫问题,将出圈的人的序号依次存放在数组中 | public class Main
static void josephus(){
CircleLinkedList list = new CircleLinkedList();
for (int i = 1; i <= 8; i++) {
list.add(i);
}
list.reset();
while(!list.isEmpty()){
list.next();
list.next();
System.out.println(list.remove()... | 0 |
8119ff7173eeafd23266b75baac96dc6 | 37dfb25db6d2a0f47c347de58382400e | Get the maximum connection layer supported by this libtgvoip version.
Pass this as <code>max_layer</code> in the phone.phoneConnection TL object when requesting and accepting calls. | public class FloodedRoomPopulator extends DMMazeRoomBlockPopulator
@Override
public int getMaximumLayer() {
return MAX_LAYER;
} | 0 |
45e20ed42c6eff8fefb5b79a075977ca | 9555ec2744d142e6fe4ca6741cf366be | Gets filtered data from ultrasonic sensor | public class USLocalizer
private float getFilteredData() {
int filter=0;
float distance = uspoll.getDistance();
while (filter<5 && distance==255){
filter++;
distance=uspoll.getDistance();
}
filter=0;
if (distance>THRESHOLD){
return 255;
}
return distance;
} | 1 |
c962ec830f395ddfda7a0c91d05f9e37 | 1a8af1bc80b21887dc158baee15267a8 | Obtain a lower dimension mask for an sparse weight matrix. | coords = _get_coords(n_voxel, ndim=ndim)
sq_radius = np.sum(coords**2, -1)
if radial_cutoff is not None:
in_range = sq_radius < (radial_cutoff * n_voxel/2.)**2
else:
in_range = np.ones(sq_radius.shape).astype(np.bool)
n_active_pixel = np.sum(in_range)
splil = sp.lil_matrix((n_vox... | 1 |
a906134a3cef10b7a866bd6504b9cc67 | c1af654d8eefc091728b7c4813eff6d1 | Метод запуска потока для очищения директории | {
var directory = new DirectoryInfo(path);
_waitStart.Set();
long temp = 0;
fillDirectory(directory, ref temp);
_waitStart.Reset();
_isProcessing = false;
_xmlWaitHamdler.Set();
_treeWaitHamdler.Set();
... | 0 |
319e96f7a3cad28685186db5803b3996 | 19475ce969f48c46481ba8a79b0520f5 | Returns a result structure for the optimization state. | class OptimizerResult(object):
def __init__(self, objective_func, opt_x, opt_f=None, opt_jtj=None,
opt_unpenalized_f=None, chi2_k_distributed_qty=None,
optimizer_specific_qtys=None):
self.objective_func = objective_func
self.x = opt_x
self.f = opt_f
self... | 1 |
9f61c5be67856060e3631fced3ba7f1b | 325b8664fd074e2cd4874451e249c660 | aliyun postObject 方式上传单个文件 | public class SettingFragment extends BaseFragment implements OnClickListener
private void uploadFile() {
String endpoint = "http://oss-cn-hangzhou.aliyuncs.com";
OSSCredentialProvider credentialProvider = new OSSPlainTextAKSKCredentialProvider("<accessKeyId>", "<accessKeySecret>");
ClientConfiguration conf = new ... | 1 |
badf55992a1a7f6323b296d8d002a626 | 63be20b10e884724d8e6d7df7386aae8 | Finds out whether two standings entries objects have the same properties. | namespace VolleyManagement.UnitTests.WebApi.ViewModels
[ExcludeFromCodeCoverage]
internal class StandingsEntryViewModelComparer : IComparer<StandingsEntryViewModel>, IComparer
public int Compare(object x, object y)
{
var firstEntry = x as StandingsEntryViewModel;
var secondEntry... | 0 |
df4604b9abf9c3051a2c841b492ccd0e | b286fc0eceae6713847f943b8f3d20ea | @brief Clears the selected data port bits.
This parameter can be any combination of PORT_Pin_x where x can be (0..31). | void Gpio_ClearPortJ(
uint8_t pinMask)
{
PJOUT &= ~(pinMask);
} | 1 |
098a336b818b09e9b364fb8c4a1008f6 | 3d9cb8d642c4328433e64bacb14f56d3 | sort measurement list received from database based on timestamp with ascending order | Comparator<MarketDataEntity> c = new Comparator<MarketDataEntity>(){
public int compare(MarketDataEntity o1, MarketDataEntity o2) {
return - o1.getTimeStamp().compareTo(o2.getTimeStamp());
}
};
Collections.sort(timeSeries, c);
} | 0 |
0fd24e44fd5e9d702a3aa6354c97bce5 | e637f6a5ef35960e44655808bff1a456 | Function for calculating inclination from coordinates | def incl(inputs):
lgror,lgroa,lgt0,lgper,lgb=inputs[:,-5:].T
return np.rad2deg(np.arccos(np.exp(lgb)/np.exp(lgroa))) | 1 |
583763b6484e0884bf08e9f9f6420a98 | bfc87f71677234853820b4bc409c57f8 | Move the cursor to the start of the line, extending the selection if in extend mode. | namespace Microsoft.VisualStudio.Text.Editor
public abstract class Caret : DisplayTextPoint
public abstract void MoveToBeginningOfPreviousLine(bool extendSelection); | 0 |
fef46adf72d430c5147e9dce50792723 | d291adcbf038a2fdb6ecc02590d5eab1 | POST /keys | class KeysApi
def apps_app_id_keys_post_with_http_info(app_id, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: KeysApi.apps_app_id_keys_post ...'
end
if @api_client.config.client_side_validation && app_id.nil?
fail ArgumentError, "Missing the re... | 0 |
c1d51c65afa3dda764abf2855a5acc92 | 97e50b940dcf36121b48ad2e1594a9b6 | 此时组件已经挂载,我们可以进行dom操作,对我们的状态进行更新操作了 | class HelloWorld extends PureComponent
componentDidMount() {
console.log('渲染ok')
} | 1 |
949aa389f0a8fd5521d3ced09d78dc0b | 3b3fbff61c3cc0f5ba0e4618ccc85cd2 | Returns the previous point in the track | if (trackStructure.containsKey(detectorId)) {
return trackStructure.get(detectorId).getPreviousSection();
} else {
throw new TrainLocationException("Unknown detector " + detectorId);
}
} | 1 |
ba00fca157751f0f9a521807ea494f42 | d217c0633866a5990a9d46120d4f2e58 | fungsi untuk menghitung total alumni sesuai dengan cabangnya | function totalUserByDirID($dir, $gender)
{
if($dir!=0)
$wsql = " login.login_status = '1' AND dir.dir_id = '" . htmlspecialchars($dir, ENT_QUOTES) . "'";
else
$wsql = " login.login_status = '1'";
if($gender != '0')
$wsql .= "AND user.user_gender = '" . htmlspecialchars($gender, ENT_QUOTES) . "'";
$query_use... | 1 |
f03ded8a78c4ecd9fdf4392524521e16 | e66e1ee410f598b0f1678c3513dc4e35 | Transforme un vecteur du plan par le système de coordonnées puis calcule ses coordonnées à l'écran | void ss_orbit_clipSpaceToScreenSpace( vecteur3d_t *pt, vecteur3d_t *result ) {
float i,j;
i = pt->x*ECRAN2D_WIDTH/2 + ECRAN2D_WIDTH/2;
j = -pt->y*ECRAN2D_HEIGHT/2 + ECRAN2D_HEIGHT/2;
vecteur3d_init(result, (int)i,(int)j, 0);
} | 1 |
42e12e1a78939af6ec3507f3066cc4b7 | de1bd78274e5d3e6b20a7c77a372f95f | Retorna array com todos os filtros combinados com a seleção da URI | foreach($filterarray as $itemfilter) {
foreach ($itemfilter as $key =>$value) {
if(is_array($value)) {
foreach($value as $j => $content) {
$urlfilter .= "&itemFilter($i).$key($j)=$content";
}
}
else {
if($value != "") {
$urlfilter ... | 0 |
e696f147c83ce46aeff5a73953570987 | fb6deeb9013c69e5e4e0fe6f09ceb612 | Gets the names of all the joints and actuators in the collection. | names.clear();
names.reserve(jnt_names_.size());
for (const auto& name : jnt_names_) {
names.push_back(name);
}
} | 0 |
bfbec50a29d5280cfc7ede6c81ba6e8e | fe4696450a5c1c793964bf0895b3bf01 | 创建工单的controller | class WorkorderController extends CommonController
public function create(){
$this->need_param = array('openid','title','content','type','type2','mobile','smstime');
if($_POST['accessory']){
$this->need_param[] = 'accessory';
}
$this->_need_param();
$this->_check_sign();
$data['uid'] = $thi... | 1 |
1b7d48baa1892c90406e60ba5f1529da | e7e12f420a4cfa30cc16bbdc49c2a75e | Určí cílový bod při zadání výchozího bodu, úhlu a vzdálenosti | namespace Geography
public Coordinates LoxodromicDestination(Angle bearing, Distance distance)
{
return GeodesyCalculator.LoxodromicDestination(this, bearing, distance);
} | 1 |
d61e1a47c3c3f38327f43aa189dadce2 | cbea931069bbcc3bccffbd21b764541f | Gets the LIKE, LOVE, HAHA and WOW reaction counts from an object | {
using (HttpClient httpClient = new HttpClient())
{
var response = await httpClient.GetAsync(LikeEndpointsUrlsFactory.CreateGETLikeUrl(mediaId, this.accessToken));
string responseContent = await response.Content.ReadAsStringAsync();
if (re... | 0 |
95f18bc0e62a7c51b18744a3f86ad29a | c00bab5d9154e98b8dd271d1348f0623 | 添加一组用户到指定机构 | class InitialData(object):
def add_users_to_orgnization(self):
orgnization_arr = self.get_orgnizationid()
users_arr = self.create_users()
m = 0
for n in range(self.first_agent_num,self.last_agent_num):
session = requests.Session()
agent = UsersForTest(n,session)
... | 1 |
242004a6f1222f8f0a53401a55596e7c | 244d0c0da25aced8a7feddb378dc4661 | 根据条件设置数组的某一项 | function array_value_set($key, $array){
if(hook_check(__FUNCTION__)) return hook();
if(isset($array[$key])) return $array[$key]; else return $key;
} | 0 |
7d98261e333ebcbac6131609c93d987f | 00db7f8e418e9fef00366d14be2108d0 | Constructs action object setting start node, end node and cost. | class aStartNode:
def __init__(self, state, parent, pathcost):
self.state = state
self.parent = parent
self.pathcost = pathcost | 0 |
22ced5bdc488fc5e15372880e4a9d5d5 | c26aee5f25e88db12863d7ca66172f3d | <p>diskSizeLimit を取得します。 | public class PhoneModel
public Integer getDisk() {
return disk;
} | 0 |
e2ee0a2f18219fc91581374a2c0cf13e | 1944a0e7ed656eca950af2c29ef598d8 | Get total custom fields | request.get(`${hostname}/customfields`, {
auth: {
bearer: token,
},
}, (error, response, body) => {
if (error) {
res.sendStatus(500);
}
callback(body);
});
} | 0 |
0f48f6fed8c82bd4aa1d0b467e339b41 | 7392a40531905a8824f177eed99db302 | Takes a file_name returns 0 if it's a regular file. 1 if not. | unsigned char file_detect(char *file_name) {
if((access(file_name,F_OK)) == -1) {
return 0;
}else {
return 1;
}
return 0;
} | 0 |
6505ab8dadff4eb300105f19fe9e522d | 9e2278fa3563f44ab92c170c50a7c1a6 | Type of this database provider (such as jdbc:mysql, mongoDB etc.). | Type getDBType(); | 1 |
4cd4d35f92ef04eb7911489ddd440902 | cbc3ddf2c160ad7e7d61a569592d8bfc | Gets the value of the hosts property.
A comma-separated list of values allowed in the Host request header to select current virtual server. Each
Virtual Server that is configured to the same Connection Group must have a unique hosts value for that group. | public function getHosts(); | 1 |
c247d371d3df893966b965dc101e349a | f7789f1c06d28c6bed7acb7cd2535044 | Voltar o estado da tarefa para não concluída (pendente) | {
TodoList values = await _context.TodoLists.FirstOrDefaultAsync(x => x.Id == taskId);
values.IsCompleted = false;
values.CompletedOn = null;
await _context.SaveChangesAsync();
return values;
} | 1 |
e1ede87f8eadbce5936b4f2940249414 | 0cf3104034b07a9c9478820267f7a528 | 当为KN币的时候,价格定死 | if (typeKd != 1) {
return false
}
if (resouce == "KD" && typeKd == 1) {
return true
}
return false
} | 0 |
09198b0999256dd095d6483ee30bee5a | 1fb5165f7b41237e63bf5ce4141027a3 | __len__() returns the number of vertices in the graph | class Graph:
def __len__(self):
return len(self.nodes) | 1 |
1a0c6c8bffc764e9eb163fb54f3045f0 | cad125d2fa1bceaa1b107086983051e6 | Get a list of the SavingsYears for the scenario | public class RetirementViewModel
public ReadOnlyListProperty<SavingsYear> getSavingsYearsList() {
return this.savingsYearsList.getReadOnlyProperty();
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.