query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ea8e22bbb0dad1895ee43a6fb169722e | 33a2b3fd18183332f7bc81dcf4ac9a98 | 拖动改变左右列宽度 | function dragChange(dragObj,ganttObj,barObj) {
var priWidth = ganttObj.style.width;
var barWidth = barObj.style.width;
var x = 0;
var changeWidth = 0;
dragObj.onmousedown = function (event) {
x = event.clientX;
document.onmousemove = function (ev) {
changeWidth = (ev.clie... | 1 |
2154b6e812ac9f5a9a1bb52f3ccefc48 | 452c9afecd532e75792e0e55e8880153 | Método auxilar para tratar fechamento de escopos. Quando um END reduz o contador
de escopos abertos e chega a zero (nenhum escopo aberto), esta função é chamada.
Ela retira da pilha todas variáveis existentes do escopo atual, só parando ao chegar
no caractere separador de escopos, depois também o remove. | static void endScope() {
current->scopeDepth--;
while (current->localCount > 0 && current->locals[current->localCount - 1].depth > current->scopeDepth) {
if (current->locals[current->localCount - 1].isCaptured) {
emitByte(OP_CLOSE_UPVALUE);
} else {
emitByte(OP_POP);
... | 1 |
fc252896197d0480eb1f58b13572b72d | 5d08a1b8718f0f0a9211c221bd703017 | 指定したカテゴリ属性番号に合致するカテゴリ属性を削除します。
<p>
<dl>
<ol>
<li>トランザクションを開始します。</li>
<li>カテゴリ属性テーブルから、引数で受け取ったカテゴリコードとカテゴリ属性番号を持つデータをすべて削除します。</li>
<li>指定したカテゴリ属性番号に合致するカテゴリ属性値を削除します。</li>
<li>カテゴリ属性値テーブルから、引数で受け取ったカテゴリコードとカテゴリ属性番号を持つデータをすべて削除します。</li>
<li>トランザクションを終了します。</li> </dd>
</dl>
</p>
<p>
<dl>
<dd>categoryCodeがnullでないこと。</dd... | @Repository
public class ItemPropertyRepository extends BaseRepository<ItemProperty>
public void deleteWithCategoryProperty(String categoryPropertyId) {
delete(new Query(new Criteria("categoryPropertyId").is(categoryPropertyId)));
} | 1 |
2ea2be32d6ec64c3d42bca21fa25e7d1 | e1fde3593288ba92c9da5c7d8ebe50f9 | Verify passwords cannot be changed when new password matches old password | payload = {
'old_password': 'testpass',
'new_password': 'newpass',
'confirm_password': 'wrong'
}
res = self.client.patch(CHANGE_PASSWORD_URL, payload)
self.user.refresh_from_db()
self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST)
... | 0 |
863c0c9cba6d862438f23e2c676de748 | 6313c0618ae32444f7453688f8b240b5 | Rekurzív segéd metódus az odds tömb kiszámításához a GetOdds() függvényen belül. | class AgentLevelOdds
public function getCurrentAgentOdds($platformOdds,$aArrayOdds,$originalOdds,$length,$k,$i = 1){
$odds = (string)$this->interceptingDecimals((1 - ($platformOdds - $aArrayOdds[$i])/$platformOdds)*$originalOdds,$length);
$i++;
if($i <= $k)
$odds = $this->getCurrentA... | 1 |
58e3ecc7fdf248b3201ce8f4522b6a42 | f090d81ffd3868b0d04246c679bd0d29 | 清空图片文件夹 | if not os.path.exists("images"):
return
for filename in os.listdir('images'):
shutil.rmtree('images/' + filename) | 1 |
201b4114b3a5f9fbd51a0bcdfe0ff6e3 | de0ec4c2e3bcdac5850ac617fc9bd6a6 | Intercept the server request and check for URL prefix. | public class DispatcherServlet extends HttpServlet{
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
String actualURL = request.getRequestURI().substring(request.getContextPath().length());
System.out.println(actualURL);
if(actualURL.... | 1 |
9bcd2f83f8b0c5ea7fc409a5c4082c03 | 9484f745edb526cb6dfff00d2928e48e | Saves the commands history to use it in the future sessions | {
FILE* file;
if(history_cmds.start < 0)
return ;
if((file = fopen("history.dat","w")) == NULL)
{
printf("write history commands error\n");
exit(0);
}
while(history_cmds.start != history_cmds.end)
{
fprintf(file,"%s\n",history_cmds.cmds[history_cmds.start]);
history_cmds.start = (history_cmds.start + ... | 1 |
40eb73f6f72f75c89175cb361e76d90f | a95d95cafee49e4c1cecb7755290fef0 | 指定の親の配下にある全てのアイテムを取得する(主にホーム用)
アイテムのposでソート済みのリストを返す | public class InGameItemPositionManager
public List<MapItems> GetItemListByPos(Vector3 pos){
int row = GetPosRow(pos);
int col = GetPosCol(pos);
if(!itemsPositionMap.ContainsKey(row)){
return null;
}
if(!itemsPositionMap[row].ContainsKey(col)){
return null;
}
return itemsPositionMap[row][col];
} | 0 |
183a99487e3e4004ea9a5ce2b0e4fa2b | 6b4fb5c8fd525ee52f6e590ddfad8191 | Builds credential object necessary to access s3 service. | def build_credentials(service_account_file):
return service_account.Credentials.from_service_account_file(
service_account_file, scopes=("https://www.googleapis.com/auth/devstorage.full_control",)
) | 0 |
fdc0d6f5ab0a70bf7a43a314baafb1f6 | 6c7c724ca6937a465fe422eb3df10077 | Converts `self` to its inner value as `W`, truncating on too large or
small of a value.
# Examples
This has the same exact behavior as an
[`as` cast](https://doc.rust-lang.org/stable/reference/expressions/operator-expr.html#type-cast-expressions)
between integer primitives in Rust:
```
# rosy::vm::init().unwrap();
#... | quote! {
pub fn into_inner(self) -> #ident {
Self::from_usize(self.0.into_inner())
}
}
} | 0 |
220b597bd9d2ed3b1e836969f3a6ff7e | 8d24b357c3fbfd91da0c0e8defd012d6 | Getter method for vendor_ref, mapped from YANG variable /ped_catalog/peds/targets/vendor_ref (string)
YANG Description: Vendor part of the reference | class yc_vnf_ref_ietf_ped_catalog__ped_catalog_peds_experiments_parameters_vnf_ref(PybindBase):
def _get_vendor_ref(self):
return self._yc_vnf_ref_ietf_ped_catalog__ped_catalog_peds_experiments_parameters_vnf_ref__vendor_ref | 1 |
2b2cb12685852e5ffeceeac6adb65854 | 7ce67288837bb1a19c123c1435b85313 | Funci�n para crear las opciones adicionales a la tabla en la seccion footer | class Employee extends CActiveRecord
public static function createOption( $id)
{
$opciones="<tr><th>Colaborador</th><th>Cargo</th><th colspan='2'>Status</th></tr>";
return $opciones;
} | 0 |
6664ce425445f2740a577a0b725ad329 | 6ab7eadf9bd79c7361a70ab4bbf37de6 | 初始化全部病人信息,从数据库中读取相关信息 | {
List<Patient> patients = MedicineLogic.QueryAllPatients();
foreach (var patient in patients)
{
int index = this.dgvPatient.Rows.Add();
this.dgvPatient.Rows[index].Cells[0].Value = patient.Id;
this.dgvPatient.Rows[index].Cells[... | 1 |
4c147c5889dcceaeb59488879fac1082 | 5aaae67c3d20adf72733774d5992f300 | Metodo que se encarga de liquidar en el sistema de Geminus , los dias
compensados calculados previamente | final Boolean archivoCarnetCondisColSusEliminado, final Boolean archivoInformacionSumariaColSusEliminado,
final GestionarEmpleadoDTO gestionarEmpleadoDTO, final String codRefEmp,
final String codRefZona, final String accion, final String usuario,final ... | 0 |
b7c6b221ec10a89080572e55e01206cf | 83527cada0ff15cf01fe71faeb21ad81 | Calculate the Perkins Skill Score (PSS). | double n, double alpha) {
double ps, m, se, tmpe, tmpps, tmpw;
m = 1.0 - 1.0 / n;
tmpw = w;
if (tmpw >= wsat) {
ps = 0.0;
} else {
if (tmpw < wrsd + 0.001) {
tmpw = wrsd + 0.001;
}
se = (tmpw - wrsd) / (w... | 0 |
7d69693dc7fc53f9fa861253eba4a118 | e76a29fb9d222c70b54ac690a569c2d0 | function for adding up distances of points between two grids | x, y = cuda.grid(2)
dx, dy = cuda.gridsize(2)
if x >= X.shape[0] and y >= X.shape[1]:
return
for i in range(x, n , dx):
for k in range(y, i, dy):
ix = k*n - k*(k +1)/2 + (i - 1 - k)
p = X[int(i), int(k)]
dist_out[int(ix)] = p | 0 |
43b1710ae5f715a21abaadc1ed504ccb | fbac4ef61d84650db3b4494341f555f8 | Check if <income> has a value | class OLPBlackbox_Enterprise_Agean_Rule_WinnerVerifiedStatus extends OLPBlackbox_Enterprise_Generic_Rule_WinnerVerifiedStatus
protected function canRunIncomeTypeCheck($data, $state_data)
{
return !empty($data->income_type);
} | 1 |
d12896530bcc83e39b759dfdb412d6ce | 1ded7c633941d2ca81141dffb8373636 | Checa si el pt del Lambda b esta en el rango requerido, sí = 1, no = 0. | namespace ImageAnalysis
public class Stat_analysis
public static Validity VerifyCriterionK(float Lambda, float al)
{
float Rlimit = 1;
if (al == 0.05F) Rlimit = 1.84F;
else if (al == 0.01F) Rlimit = 2.65F;
else return Validity.excluded;
return La... | 1 |
d09542d6a507ac5912e16f4f0d787122 | ab89ab8c367995aefcf85a05cbda3e09 | Look for a specific record in the DNS records of a specific domain. | namespace DigitalOcean.API.Clients
Task<DomainRecord> Get(string domainName, long recordId); | 1 |
feca15f603e2033726d9623f5e3d0016 | a92ac8adf9260060a3137cb616485be1 | Test case for array_activity_log | class NodesApiTest extends \PHPUnit_Framework_TestCase
public function testGetRoomActivitiesLog()
{
} | 0 |
51cffe1804351e3e2e4dae2d27250964 | 65a7572a6ea8584148b4104ea95194bc | !
Przekazuje informacje do pamięci współdzielonej | SIMPLE_TRACK_INFO * p_src)
{
int i;
*p_dest = *p_src;
if (p_src->p_pos) {
p_dest->p_pos =
(BOD *) kopiruj_pole(p_src->p_pos,
sizeof(p_src->p_pos[0]) * p_src->keynum);
}
if (p_src->p_at) {
p_dest->p_at =
(QUAT *) kopiruj_pole(p_src->p_at,
sizeof(p_src->p_at[0]) * p_src->keynum... | 0 |
186c653b30c02af6b0d1f31321fc122a | 0503eb7da81efea5863cf5644cb91b70 | Test method for
{@link edu.depaul.se.account.IAccountManager#getAllAccounts()}. | public void test_getAllUser(){
List<UserAccount> accounts = userService.getAllUser();
for(UserAccount account : accounts){
System.out.println(account);
}
assertThat(accounts.size(), not(0));
} | 0 |
7a221893fdfd8d0168d1e6976f7c1c0e | 92fd1b8a1a0e57a8fff27088627cff62 | Adds a new method to the class, with the given name and method signature. | function runkit_method_add($classname, $methodname, $closure, $flag = RUNKIT_ACC_PUBLIC, $doc_comment = null){} | 1 |
1eaab76b0add9a87fb6becf12585f6b0 | ca730edfcda2b849d9d13e54e6c957ba | Clear all the labels on the QRZ display panel. | ui_xSetLabel(z10s2,"");
ui_xSetLabel(z13s2,"");
ui_xSetLabel(z14s2,"");
ui_xSetLabel(z15s2,"");
ui_xSetLabel(z16s2,"");
ui_xSetLabel(z19s2,"");
ui_xSetLabel(z20s2,"");
ui_xSetLabel(z22s2,"");
ui_xSetLabel(z23s2,"");
ui_xSetLabel(z10s3,"");
ui_xSetLabel(z13s3,"");
ui_xSetL... | 1 |
c86cf3f63b1534d92d0ebfc6009b0fd6 | 8b814ce335f5fccab7d7d7edee085f5a | 带多个返回值存储过程调用 | class UserBase
static async callStoreProcedure(StoreProcedure){
return await new Promise((resolve,reject)=>{
conn.query('CALL '+StoreProcedure,function (err,rows) {
if(err) reject(err);
resolve(rows[0]);
log.info(`user表的存储过程:${rows}`);
});
... | 0 |
606216b69f179133495c8aafb4082366 | 4d4d30f1df977e3ce46502fb3f564d42 | TestGetUsersJSON verifies that /api/users returns proper JSON output | return func(c *gin.Context) {
type ReqData struct {
Id int `json:"id"`
Offset int `json:"offset"`
}
type User struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
}
type RespData struct {
Success bool `json:"success"`
Message string `json:"message"`
Use... | 1 |
6a8275e9ab81167644b4457b5ba30da1 | 981697ad5dda6c22d585d350496a88e3 | 将两个tcp数据串起来,两个tcpstream数据之间相互转发数据 | func RelayData(s *network.Server, orig, relay *network.Conn) {
defer relay.Close()
go io.Copy(orig.GetRawConn(), relay.GetReader())
io.Copy(relay.GetRawConn(), orig.GetReader())
} | 1 |
c77de6b78d30a21539bfde1a78f6cd2e | 0776de87886a7a1faab085426ab74c58 | Returns the training algorithm that is used by fann_train_on_data and associated functions | class GaussianNaiveBayes(Model):
def get_algorithm(self):
return self.algorithm | 0 |
84946f8c11ca22e0b61a9c9f61218a85 | bb6e3fa7694df330393befbe4146e57e | 根据服务器ID获取站点列表 | class ShortConnectController extends BaseController
public function getServerList($uid, $data)
{
try {
return $this->view->success([]);
} catch (\Exception $e) {
$this->setErrorLog($e->getMessage());
return $this->view->response($e->getCode());
}
} | 0 |
2ecb6bded2d4875e0c33ae6efb9f165a | 03944fa4930c9e7ce6a49781eff9ec1f | Aktualizuje dane pizzy o podanym id | "UPDATE breakfasts " +
"SET " +
"breakfast_id = #{id}, " +
"name = #{name}, " +
"tag = #{tag}, " +
"price = #{price}, " +
"restaurant_id = #{restaurantId}, " +
"img = #... | 0 |
e2cca3129239f6402ff7bf3346795f2c | 20b7de3cc66c73cc07966c9d5768620b | 根据商品uuid和购货方uuid获取购货方采购商品的会员价 | {
$goodsMemberPrices = $this->field('member_level_id,price')->where(array("goods_id" => $goods_id))->select();
$member_level_ids=array_column($goodsMemberPrices,'member_level_id');
$price=array_column($goodsMemberPrices,'price');
return array_combine($member_level_ids,$price);
} | 0 |
c053ac56bac0c02020d44b81682122ad | a35bfcc0bb2dc8494c7b02022aa9d27c | ## sim_logprob_locus 19/5/11
## Returns the log-probabilities of animals genuinely simulated from the
## posterior distribution of allele frequencies specified in nutab.
## Operates in log_10 if logten=T, otherwise in log_e.
## nutab is a table of nu-vectors which are the posterior parameters for
## the different popul... | {
slopes <- ab[[ifelse(link == "cloglog", 1, 2)]]$slope[2:4]
intercepts <- ab[[ifelse(link == "cloglog", 1, 2)]]$intercept[2:4]
ppm <- c(0, seq(500, 4500, 500))
trans <- get(ppaste(link, ".bt"))
sim.dead <- NULL
reps <- rep(1:12, length(ppm))
for(i in 1:3){
slope.i <- slopes[i]
intercept.i <- inte... | 0 |
0659c8bd41b2b6a9a56165da3d08cd42 | e55f540ea6ea4c6be8aa50774b4f2c88 | 受け取った手札がフラッシュであるかどうかを判定する関数 | fn is_flush(hand:[(i32,char);5]) -> bool{
let same_suit:bool = is_same_suit(hand) ;
let flag1: bool = !(is_straight_flush(hand)) ;
let flag2: bool = !(is_royal_flush(hand)) ;
same_suit && flag1 && flag2
} | 1 |
ebbe6fdbfce556f8a685fd17b2f94035 | 37247b7c382a7dc421f4ed2e0ad34ac0 | 从路由文件所在目录中查找路由类 | public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (annotations.isEmpty()) return false;
Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(ARouter.class);
for (Element element : elements) {
String packageName = element... | 0 |
7ec064918444d01b3df17327fb2da213 | c927322468507f7a79156d5ce89609d1 | 空列表也是False | class TestType(unittest.TestCase):
def test_logic(self):
self.assertFalse(None)
self.assertFalse(False)
self.assertFalse(0)
self.assertFalse(0.0)
self.assertFalse(0j)
self.assertFalse([])
self.assertFalse({}) | 1 |
014f859ea7bd01d1ed83a78bcf473d51 | c0f1e5e5feb75e0955a0122db63ccf5d | Overload << operator to perform logging. | os << *se.elem << '.' << se.rep;
if (se.started)
os << " (STARTED)";
if (se.recurse)
os << " (RECURSE)";
return os;
} | 1 |
531c7b2fd68fdf4f080dd58ff9f969d3 | c295ff7afb09daec27112546ea0b307c | 读取点动减速度 | {
int i = 1;
dVelocity1 = 5;
dAccel1 = 2;
dDecel1 = 2;
dVelocity2 = 5;
dAccel2 = 2;
dDecel2 = 2;
dVelocity3 = 0.1;
dAccel3 = 0.5;
dDecel3 = 0.5;
dVelocity4 = 0.1;
dAccel4 = 0.5;
dDecel4 = 0.5;
p_MotorManager->SetMotorMove(MOTOR_3_INDEX, Distance3(12) * MOTO_... | 0 |
2b40aac5ebb5a394cc8ff164ee2a7275 | a217c6882c516870195ac3c6f29c7c50 | 根据临时订单到数据库取实际订单,并合并两对象 | public class OrderAction
public CsUnitOrder merge(CsUnitOrder csUnitOrder) {
if(csUnitOrder.getCsuoId()==null)return csUnitOrder;
CsUnitOrder dbOrder = csUnitOrderService.getCsUnitOrderById(csUnitOrder.getCsuoId());
if(dbOrder!=null){
Field[] fields = CsUnitOrder.class.getDeclaredFields();
for(Field field:f... | 1 |
f592a18b8c5c38020a8bbf66db71c952 | 6ac2af5ce8bc85f3c59cc4dde33ac822 | Inserting packages data into packages table | class CreatePackagesTable extends Migration
public function up()
{
Schema::create('packages', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name')->index();
$table->string('slug')->unique()->index();
$table->float('sale_price', 14,... | 0 |
081e5aac0b4e81caabb7b1b41748a190 | 76805effba613edea92b45d62971b670 | Surrounds current meadow with Obstacles. | self.obstacles = [
Obstacle(0, -self.size, self.width, self.size),
Obstacle(self.width, 0, self.size, self.height),
Obstacle(0, self.height, self.width, self.size),
Obstacle(-self.size, 0, self.size, self.height),
] | 1 |
9b19171ce23685a38029bcc82f261e7c | 0ec03b54e82217ad98df83d285ee3928 | Return 1 if 'a' == 0 and 0 otherwise. | static int is_zero(BigNum a)
{
int i;
for (i = 0; i < MAX_DIGIT; i++) {
if (a[i]) {
return 0;
}
}
return 1;
} | 1 |
f810c5f40376cf4c23d3a9243bfe9a1c | 399072e0e888ed536b8d87b9346dd0ce | A method used to capture CoauthStatus related requirements when getting coauthoring status. | String contentType, String itemType, String data, String action,
String fileName, String linkRef, String embededLinkRef, long size,
int hoursOfWork, String userId) throws Exception; | 0 |
0a561f284952d2751be390b1a0a7d44b | 11e08c52c6b97113b6f602e41461c7f1 | Show bids that were placed by the visitor
REQUEST params: | class BidController extends \BaseController
public function index()
{
} | 0 |
6d99e9532caf71ad801867dd5bd58687 | cfca9166cdeff3d014e1a1651537f806 | Calculates the age in day. | namespace BusinessLayer
class DOB
private int getAgeInDays()
{
if (dtDob.Year == dtNow.Year)
{
intAgeDays = dtNow.DayOfYear - dtDob.DayOfYear;
}
else
{
if (DateTime.IsLeapYear(dtDob.Year))
intAgeD... | 1 |
a1a44c890c1ec92de65f4d0c0d839392 | 48f0fcfb3d6fa2422f2e006ac4b3a743 | Поиск всех контактов в группе. | const membersIds = await this.getGroupMembersId(groupId);
const actions = membersIds.map(memberId => {
return this.getContact(memberId._serialized);
});
return await Promise.all(actions);
} | 1 |
a0f51e02747aec31dfb6d7c19ad7b9df | 33a97a60045fe1f3c18e0154265780eb | 查询城市的所有的数据 | public List<String> queryCityData(); | 1 |
2da4622b37d3a9b831f4bcb3a4fca244 | 61d1bf6d67db429c0acebfebdc034b78 | returns true if player swipes | class SwipeDetector : OnTouchListener
fun swipeDetected(): Boolean {
return action != Action.None
} | 1 |
56dba888992ede5b3fd0e5157eff95e5 | 175f95bbf57199aab579291b8752db24 | ... does nothing... | function doNothing()
end | 1 |
2935f7c08699604de9b024449a0bbf80 | 901952bbadb09b316334e0b89a757225 | Constructs this Matrix from 3 euler angles, in degrees. | namespace EarthView
namespace World
namespace Spatial
namespace Math
public class Matrix3 : EarthView.World.Core.BaseObject
public void FromEulerAnglesZYX(EarthView.World.Spatial.Math.Radian fYAngle, EarthView.World.Spatial.Math.Radian fPAngle, EarthView.World.Spatial.Math.Radian fRAngle)
{
EarthVi... | 0 |
ec8f5eb5c53cfc5e1dbe6432f25ede9c | a5725ffdb706310cb2bc07be56b04fc8 | # 判断海塞矩阵是否正定、负定还是不定,以确定极小/大值 | n = int(__A.shape[0]);
row_dom = col_dom = 1;
for i in range(n):
sum_row = sum_col = 0;
for j in range(n):
if(i != j):
sum_row += abs(__A[i, j]);
sum_col += abs(__A[j, i]);
if(sum_row >= abs(__A[i, i])):... | 0 |
3e9796dfa149d4a0f2b2daed35ca387c | 16e583217f43a5111fde0af7cd53a071 | 根据书号更改库存 | {
$book_name =\Request::input('book_name');
$book_stock =\Request::input('book_stock');
$res = DB::table('books_info')->where(['book_name'=>$book_name])->update(['book_stock'=>$book_stock]);
if($res)
{
return redirect('AdminIndex/skushow');
}
} | 0 |
d41d7c842dbbdebff3f7e0f408e66236 | c5a4db9e2a36fcf759147ec572fb1bbf | Converts the contributor list to an array. | class ext_update
private function createContributorString($contributors) {
$out = '';
$counter = 1;
foreach ($contributors as $c) {
$out .= 'Contributor '.$counter.': [';
$out .= 'surname: '.$c['surname'];
$out .= '; given_name: '.$c['given_name'];
$out .= '; role: '.$c['role'];
if (strlen($c['affi... | 0 |
dbf0a0ce697f123ff1f94e61676f8da2 | bb809c77fc6e9a3a2f84b689eae0fab6 | Set map canvas extent to selected administration extent | if (typeof(PMap.extentSelectedFeatures)!='undefined') {
if (PMap.extentSelectedFeatures) {
showloading();
var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&mode=map&zoom_type=zoomextent&extent='+PMap.extentSelectedFeatures;
updateMap(mapurl);
}
}
} | 1 |
911752a1c22fead72467339bcb624a81 | a4c8d8a74b8039c0fc4e3da0a9d1d79a | Return array listing all enabled providers as well as a flag if you are connected. | class UsersSocial extends Component
public function getProvidersEnabled()
{
$aResult = array();
$aConfig = config::file('social');
if (!empty($aConfig['providers']) && is_array($aConfig['providers'])) {
foreach ($aConfig['providers'] as $k => $v) {
if (!empty($v['... | 0 |
0d7ba728d13ffee37e713b8215b024d2 | b6d454ea61837b0c89d242bcdc235924 | Retorna els alumnes actuals d'una classe i activa el primer alumne de la llista | public abstract class DBCurso
public static List loadAlumnos(DBManager db, Curso curso) throws Exception {
return loadAlumnos(db, curso, 0, 0);
} | 0 |
8cc228f71919757b77a51b2611aa3126 | 301ad7075f22f267adb24381e9b31b06 | horizontal field of view | public class KilroyCamera
public double getHorizFieldOfView ()
{
return this.horizFieldOfView;
} | 1 |
ba83b0b5f7d6a7e9fda4fd16a7ad2cc3 | ef1ddf91b4411231b907c7ee2751e65f | Tests the NumberTickets with max int value saves. | public void TestUrgencyLevelWithLongValueSaves()
{
#region Arrange
var ticket = GetValid(9);
ticket.UrgencyLevel = "x".RepeatTimes(999);
#endregion Arrange
#region Act
TicketRepository.DbContext.BeginTransaction();
Ticke... | 0 |
1aa493febf6269f5da2afe564d9d3a2c | e6450cf4808c3f659ed604b7605b0342 | Create a new scene creator instance. | class ScenesController extends ApiController
public function __construct(SceneTransformer $sceneTransformer)
{
$this->sceneTransformer = $sceneTransformer;
} | 0 |
f823b77818e80f25c05225f41708806b | b0725e5a670a25504b4297d7c2aaf247 | 지정 위치부터 임의 개수의 문자를 삭제 | T_pSTR Utl_StrDel(T_pSTR strDest, T_S16 offset, T_U16 count)
{
T_U16 lenDest;
T_U16 i;
AK_ASSERT_PTR(strDest, "Utl_StrDel()", AK_NULL);
#if MAX_STRING_LEN < 0xFFFF
AK_ASSERT_VAL(offset < MAX_STRING_LEN, "Utl_StrDel()", AK_NULL);
AK_ASSERT_VAL(count < MAX_STRING_LEN, "Utl_StrDel()", AK_NU... | 1 |
c3c147423d4dfd8a794581fd9385c993 | 1cb48ff74710a0475c20b22e1c36599d | Prints the exam schedules of the input courses. | {
for(HashMap.Entry<String, ArrayList<Course>> entry : courses.entrySet()){
ArrayList<Course> sections = entry.getValue();
for(Course section : sections){
if(section.isSeminar()) System.out.println(section);
}
}
} | 0 |
c8ab9970b9cc566b97cbc11eceaf9618 | 803dbf0793b3d20d2bbca022db12d504 | 通过url获取视频的某一帧
Android 原生给我们提供了一个MediaMetadataRetriever类,提供了获取url视频某一帧的方法,返回Bitmap
需要 android.permission.INTERNET、android.permission.WRITE_EXTERNAL_STORAGE 权限 | Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
retriever.setDataSource(url, new HashMap());
bitmap = retriever.getFrameAtTime();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} finally... | 1 |
80a636434f6e1241278cdd79565efe31 | ec4ef5e62e411fbd87f573e267ede51a | Pokes the Client with a certain message | export class TeamSpeakClient extends Abstract
poke(msg: string) {
return super.getParent().clientPoke(this.clid, msg)
} | 1 |
133ac837451ea6d0dff961bf9d2bd6cf | ff3290d7d7660ba9a82465c00b3b4521 | Returns an ordered range of all the vcms article types.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both ... | public java.util.List<VcmsArticleStatus> findAll(int start, int end,
com.liferay.portal.kernel.util.OrderByComparator<VcmsArticleStatus> orderByComparator); | 1 |
f75e3e7f61b2086bcf0bf8273d64bd5d | 75c98cf0563b858fda6006c3717a23e3 | 完成一个Work order后批量更新wo operation的实际完成时间 | {
string sql = "UPDATE WORK_ORDER SET actualTime = @FinishTime, workTime = @WorkTime, maintainStaff = @Staff, " +
"workOrderState = @State WHERE workOrderID = @Id";
int result = db.Execute(sql, new
{
FinishTime = finishTime,
... | 0 |
d7f0a41a792aeb0105701e61adac884d | f418a1f0ae360de2ba38cf50dcd4a96e | Setter method to set Part Flag. | public class CPOCFFComDailyEntity extends TntCfcDay
public void setPartsId(Integer partsId) {
this.partsId = partsId;
} | 0 |
6f128b7c900f2932be82f6b350fbdc9e | 3b1fe3898da8aa94b3af5e7b894b4535 | Validates that all items originate from the
specified store and are to be transferred to
the specified store. | @Component
public class BranchSpec extends BaseSpec
public void canMerge(final Branch from, final Branch to) {
boolean isValid = true;
if (!isValid(from, Read.class))
isValid = false;
try {
ValidationUtils.mustNotEmpty("toBranch", to.getId());
} catch (SpecMgrException e) {
addError(Br... | 0 |
0d700d02e7106f8852e8e87871b355c1 | cdec7f9d10aeb97f5a3ff6c03f93bae6 | Ensures a string is a legal Python name. | if not NAME_PATTERN.match(s):
raise RuntimeError('invalid xml name: %s' % (s))
return s | 0 |
96b57b6c66afa899da1b1236ad982d21 | c1de9010ac1898ed61e1976d85973cab | Retorna a ObservableList das Entradas. | public Object getEntrada(); | 0 |
2f48f5ac9e0f31c61f0328824d3ae7ef | 14b42a2b3fd71de210a761cc5a5cfbb4 | Scan job directories for job classes | public class StarterVerticle extends AbstractVerticle
private Completable scanClasses() {
return vertx.rxExecuteBlocking(future -> {
ClassUtils.getScan();
future.complete();
}).toCompletable();
} | 0 |
c4837bc0b99b9182424a6b7c7d0f6ec3 | 032ab485cdcfedda1bc32f8eeb6d534f | Copy one file with the appropriate number of retries if it fails. | {
$tmp_local_filename = tempnam(sys_get_temp_dir(), 'safe_put');
$local_crc = crc32(file_get_contents($local_filename));
$success = false;
$this->_safe_retry_count = 0;
while (!$success) {
self::log_msg("retry count: " . $this->_safe_retry_count);
if (... | 1 |
fccfed78b1d9f544d1624133854db61a | 0de69b5f35bf43e4510f5e69cbe2b809 | 提交发布版本表单 | function submit(data) {
var modal = $("#versionModal");
var version_id = $("input[name='version_id']").val();
var version = modal.find("#version").val().trim();
var os = modal.find("#os").val().trim();
var detail = modal.find("#detail").val().trim();
var limit_version = m... | 1 |
e57cf507ff2686036a86f62e3187f53c | 1408bc57283f2c634608811023ff80eb | Converts class name to a file path with .class file extension. | String strClassFullName = c.getName();
StringTokenizer st = new StringTokenizer(strClassFullName, ".");
StringBuffer sb = new StringBuffer();
sb.append(st.nextToken());
while (st.hasMoreTokens()) {
sb.append("/");
sb.append(st.nextToken());
}
sb.append(".class");
return sb.toString();
} | 1 |
02ae843887d5f0e85dd288b10eceaa15 | c1939785a7342f2c53c0a33b727c7387 | close the 'Etext' window. | ex_tabclose(exarg_T *eap)
{
tabpage_T *tp;
int tab_number;
if (cmdwin_type != 0)
{
cmdwin_result = K_IGNORE;
return;
}
if (first_tabpage->tp_next == NULL)
{
emsg(_(e_cannot_close_last_tab_page));
return;
}
if (window_layout_locked(CMD_tabclose))
return;
tab_number = get_tab... | 0 |
b6024dff50578fea2426ba6b1e3b90a4 | 873cf411d9f8eae5eea18eebe037215f | ● 地形效果判定 | class Game_CharacterBase
def terrain_tag
$game_map.terrain_tag(@rgss_x, @rgss_y)
end | 1 |
1ce0cddb67e00dcc64976291edae30b0 | 6ca2884160af0b9460dcfad921bfa710 | copy all rows from a List of serialized data objects to a List of SOAP Contracts
links:
docLink: http://sql2x.org/documentationLink/7467f97d-14e5-4ccf-9282-ef8df4f63088 | if (soapModels == null) {
return null;
}
List<LivMerc> models = new ArrayList<LivMerc>(soapModels.length);
for (LivMercSoap soapModel : soapModels) {
models.add(toModel(soapModel));
}
return models;
} | 0 |
05fcd242d6560ead31a06617f40db1bb | e8063820c9cc0b933b818325c5efd8f5 | 判断指定fd是否具有指定的标志 | {
if (isset($this->flagsMap[$fd]) || isset($this->fdsMap[$flag]))
{
return false;
}
$this->bind($flag, $fd);
return true;
} | 0 |
9af951da89a9d4e4f4321e78ae2544bc | d62085432756e4931a3e7a783bafbabb | 等待多个任务完成,并设置最大等待时间,可以通过CountDownLatch完成: | @Slf4j
public class CountDownLatchTest
public static void main(String[] args) {
int count = 10;
CountDownLatch countDownLatch = new CountDownLatch(count);
for (int i = 0; i < count; i++) {
Thread thread = new CountDownLatchThread(countDownLatch, i);
thread.start();
... | 0 |
44c2f3a2e1d649361f62989ad70ccab2 | b134a2b989bd3950c3797d3416bb6f74 | Get the old releases. | class ReleaseManager(ProjectBaseMixin):
def get_releases(self):
return split_by_line(
self._runner.run("ls -1r '{0}'".format(self._releases))) | 0 |
a2a131eea72a83cf8ae9dae817dd4424 | 248f56108a7f1315ddcdac2fa7d87ee3 | ROS node to plan a path for the Pathfinder Boat | rospy.init_node('local_planner')
rospy.Subscriber('path', Path, self.path_callback)
rospy.Subscriber('odom', Odometry, self.odom_callback)
rospy.Subscriber('scan', LaserScan, self.scan_callback)
self.vel_pub = rospy.Publisher('/cmd_vel_mux/input/navi', Twist,
... | 1 |
7ad55cd686c3ccda47501484d197c53f | ee94ead752988df4db97df58f50b07cc | Sets client_contact_email | class JournalModel extends ValidationClass
public function setBusinessPartnerContactEmail($businessPartnerContactEmail) {
$this->businessPartnerContactEmail = $businessPartnerContactEmail;
return $this;
} | 0 |
93ebd7d60167c291fa394c216e61f8e6 | b448d897ea4fd6657dcb926ffdde382d | A bit larger net with no FC layers (global pooling instead). | class RegAllocRNDEncodingNetwork(RegAllocEncodingNetwork):
def __init__(self, **kwargs):
pooling_layer = tf.keras.layers.GlobalMaxPool1D(data_format='channels_last')
super().__init__(**kwargs)
self._postprocessing_layers.append(pooling_layer) | 1 |
0ac14b9e4b88ab5eead70963c8b3d88d | fb48e23bc508055d6c232b3671125484 | Get the padding-left css property. | String getPaddingLeft(); | 1 |
8e6e42d84d9383bbc0c57ab7c4414db5 | 49002abc9e2a3d3c3c568ba705cee685 | Called when the game is saved, commits inventory values into save game. | String inventoryFilename = _backpackType.getInventoryFilename();
NBTTagCompound tagCompound = new NBTTagCompound();
NBTTagList tagList = new NBTTagList();
_backpackInventory.save(tagList);
tagCompound.setTag("inventory", tagList);
HubbySavePersistentDataHelper.getInstance... | 1 |
13aac48a52b51d643ba6fc9e3aecb47a | 2f470f15f33714e1df19f30a467fb562 | After 2 seconds have passed, emit buffered values as an array | export function docRegionMulticastSequence(console: Console, runSequence: boolean) function multicastSequenceSubscriber()
function doSequence(sequenceObserver: Observer<number>, arr: number[], idx: number) {
const timeout = setTimeout(() => {
console.log('Emitting ' + arr[idx]);
sequenceOb... | 0 |
3c9765368920b22960b1cbe537362195 | 2a43f35346df1e0741abee1d72e10726 | 初始化大乱斗 | Laya.MouseManager.enabled = true;
this.selfWeapons = [];
this.otherWeapons = [];
this.robotRole = JSON.parse(JSON.stringify(this.params.monsterList[this.killNum].robotRole));
this.robotWeaponList = JSON.parse(JSON.stringify(this.params.monsterList[this.killNum].robotWeaponList));
this.resetPlay... | 1 |
cfbe578d12604ab967efae8f77a0867f | 54f3c440d6ac50b657e115e0f432cfe9 | Get portal username | class DeutschePost_OneClickForApp_Model_Config
public function getUsername()
{
return Mage::getStoreConfig(self::CONFIG_XML_PATH_PORTOKASSE_USERNAME);
} | 1 |
4d05352d39b90b871384aef9c1a7df84 | 5c9aeecc5a6e5010746b06db2cadf334 | Tests that passing an empty list to the constructor doesn't throw an
exception. | public class DefaultTaxListTest
@Test
public void testConstructed() {
TaxList list = new DefaultTaxList();
assertTrue(list.isEmpty());
} | 0 |
0bbb720f0c6861c519bab59f177b06bf | a5166db80c8a2362b633d558d6e39b2a | Display the time in military format | var str = ''
time = time.split(':')
if (time[1].includes('pm') && time[0] !== '12') {
str += `${timeToMilitary[time[0]]}:${time[1].slice(0, 2)}`
return str
} else if (time[1].includes('am') && time[0] === '12') {
str += `${timeToMilitary[time[0]]}:${time[1].slice(0, 2)}`
return str
}
return ... | 1 |
45b8e364ffa115088c5e3097daa2e5f9 | 753003eaa9649de9bacc422082d478d3 | Offset in percent of a video, used to specify the end of the video to be kept after trimming or
when an overlay ends displaying.
Normally used together with the start_offset and duration parameters. | namespace Kendo.Mvc.UI.Fluent
public class DiagramShapeFillGradientSettingsStopBuilder<TShapeModel,TConnectionModel>: IHideObjectMembers where TShapeModel : class where TConnectionModel : class
public DiagramShapeFillGradientSettingsStopBuilder<TShapeModel,TConnectionModel> Offset(double value)
{
... | 0 |
99a9030eabaa811a71f6801876e47ab2 | 314be451f7f20061428a9a0d80946a19 | 对渲染器的属性测试 | testAttr(renderer) {
console.log(`渲染器背景色:${renderer.backgroundColor}`);
console.log(`渲染器宽度:${renderer.view.width}`);
renderer.autoResize = true;
renderer.resize(512, 512);
console.log(`渲染器宽度:${renderer.view.width}`);
} | 1 |
ebd16a5d1b6631f452626a3295d9abad | 67752c6f2d0d95853a9e8586e612f2e6 | helper method to check whether height is missing | class CTCI4_1
public static int checkHeight(BTNode root) {
if (root == null) {
return 0;
}
int leftHeight = checkHeight(root.left);
if (leftHeight == -1) {
return -1;
}
int rightHeight = checkHeight(root.right);
if (rightHeight == -1) {
return -1;
}
int heightDiff = leftHeight - rightHeight;
... | 1 |
7ed8c58498caa9d24b71c4b26d07ae13 | 8302d0f5855ec72bad7abdeb4b6abd37 | 让第number个LED灯点亮; | void turn_on_led(int number) {
GPIOC->ODR &= ~0x3ff;
GPIOC->ODR |= 1 << number;
} | 1 |
2ded6ea33e7c068fc7be241f3a966b53 | 3a6815529dbde0ad4d394d2621b417da | Sort a sequence of text strings in a reasonable order.
From:
http://lists.canonical.org/pipermail/kragen-hacks/2005-October/000419.html | static void
sortlist(NClist* l)
{
size_t i, switched;
if(nclistlength(l) <= 1) return;
do {
switched = 0;
for(i=0;i<nclistlength(l)-1;i++) {
char* ith = nclistget(l,i);
char* ith1 = nclistget(l,i+1);
if(strcmp(ith,ith1) > 0) {
nclistset(l,i,ith1);
nclistset(l,i+... | 1 |
4f7efdd681ddbe73b0966d71121dd19e | 5990d79c8703ec5288d94cf91bc70ec0 | Sets the value of the scale property.
allowed object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "Extrusion")
public class Extrusion
extends X3DGeometryNode
public void setScale(String value) {
this.scale = value;
} | 1 |
452ebf25b6f3e9aa3972411581252b0f | 9d0986be5e63e61ef52ede47570cb174 | Helper function to remove celery files if project does not make use of celery. | if "develop" not in sys.argv:
try:
shutil.rmtree('abiflows.egg-info')
except Exception:
try:
os.unlink('abiflows.egg-info')
except Exception:
pass | 0 |
5fb7d1370eb7e9c825403c5216ed6c0a | 7002863edaad57475e120b1049598dda | возвращает максимальный номер символа в строке | public class CharacterSet
public int getMax() {
return max;
} | 0 |
74012053d1c219240969e98a36bf0c87 | a4b60f0a7429bc892ac92ba0e5ad1462 | Test that card still has same amount of points after being attached to a customer | public void placeBet_WithValidBet_CardCreditShouldBeUpdatedThroughCashier() {
Machine machine = new Machine();
Cashier cashier = mock(Cashier.class);
machine.setCashier(cashier);
Card card = mock(Card.class);
when(cashier.getCardCredit(card)).thenReturn(10.0);
machine... | 0 |
69378d47bc3e661bb892ff2ffed610f5 | c7a1fb1afa3e1a1287119f25fc609830 | Encodes steps vehicles spent idled into a vector representation. | def print_solution_steps(solution):
steps = []
for i in range(len(solution) - 1):
r1, r2 = solution[i], solution[i+1]
v1 = list(r1.vehicles - r2.vehicles)[0]
v2 = list(r2.vehicles - r1.vehicles)[0]
if v1.x < v2.x:
steps.append('{0}R'.format(v1.id))
elif v1.x >... | 0 |
7393593e5d931566e6e5ca59f4a6c5ee | f84ab8f3de93eafbaa54b7039485fb9f | function:轮廓提取按钮槽函数 | {
minArea = ui->Slider_MinArea->value();
int min_value = ui->Slider_MinArea->value();
QString s_value = QString::number(min_value, 10);
QString str = "最小轮廓面积: ";
ui->lineEdit_TipShow->setText(str.append(s_value));
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.