query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
04021adc3dd53c673459c9b5f5e6cd6f | c325e6e66aa238ba582d12f46a62f66b | Returns the current string evaluator, if any | public class NewTemplatePage extends WizardPage
implements ModifyListener, SelectionListener, FocusListener
@Nullable
public StringEvaluator getEvaluator() {
return mEvaluator;
} | 1 |
ab04d5fdb98191a788354afb27a452a2 | accc51b61984ad4036230718d2562ad9 | Get log titles | {
return [
'id' => 'ID',
'user_id' => 'User ID',
'log_text' => 'Log Text',
'ip_address' => 'Ip Address',
'log_date' => 'Log Date',
];
} | 0 |
2acc52c01c5134bd20e8abafbe1956e5 | d95d3a221dd06e8df1ce69634ab754f0 | Функция загрузки выбранного изображения продукта в облачное хранилище firebase. | this.fireStorage.ref().child('Photos/' + imgName + '.jpeg').getDownloadURL().then(
(url) => {
this.af.database.list('/photos/' + imgName).$ref.ref.child('src').set(url)
console.log(JSON.stringify(url))
},
(error) => {
console.log(JSON.stringify(error))
})
} | 0 |
44522af31e52623aac773eb172a9c3a2 | 504ecc659a5b133991d47e990f1738ba | The servers to send all outgoing mail through | public class EmailTransport
extends BasicManager<GeminiApplication>
public EmailServerDescriptor[] getInboundServers()
{
return inboundServers;
} | 0 |
34403e4bf6f0c2d8a2a2847aea679e1b | 1516986deba747a0f8baa1d81c8f13ea | constructor that sets up a master slave arrangement on the 4051s | self.pin1 = dataTypePin
self.pin2 = pwmPin
self.pin3 = analogPin
self.RXpin4 = readTogglePin
self.TXpin5 = rangeDataPin
GPIO.setup(self.pin1, GPIO.OUT)
GPIO.output(self.pin1, GPIO.HIGH)
GPIO.setup(self.pin2, GPIO.IN)
GPIO.output(self.pin2, GPIO.LOW... | 0 |
0e2710fde5c3bf308e8d08a2c1657152 | 5b4ea8d29875edfb78b2073a95bde2fa | Copiar para área de transferência | Area_de_transferencia copiar_colar = new Area_de_transferencia();
String texto_atual = area_texto.getText();
texto_atual += copiar_colar.getInTransfer();
area_texto.setText(texto_atual);
} | 0 |
d95df421af8a06bad5943868bff99fa9 | 2d77c0dcb0dc5e2e0f9814c55d77e065 | GET: ShiftWorker | namespace Factory_Manager.Controllers
public class ShiftController : Controller
public ActionResult Index()
{
return View();
} | 0 |
ed9a44f704ec3892219850179507c3f6 | dbc996a703055f307e19487a6fb2d6c0 | Prueba que verifica que el validador de fechas funciona correctamente. | probarComponer(31, 10, 2016, 20161031);
probarComponer(1, 11, 2016, 20161101);
probarComponer(19, 9, 2016, 20160919);
probarComponer(1, 2, 2017, 20170201);
probarDescomponer(20161031, 31, 10, 2016);
probarDescomponer(20161101, 1, 11, 2016);
probarDescomponer(20160919, 19, 9, 2016);
proba... | 1 |
13f4567c244980fce875ba10bcf4e94e | f4cffeb8ea5c8f305a11c7fc4c1ab44e | Возвращает название и цену блюд. | return shops.stream()
.map(shop -> String.format("%s price is %.2f", shop.getShopName(), shop.getPrice(product)) )
.collect(Collectors.toList());
} | 1 |
4608ae1b8e512a1263c190618dbd2cf2 | 6696dfface0f500178fb80adbdfb93d0 | [io_endianness] | {
ASSERT(from == BIG_ENDIAN || from == LITTLE_ENDIAN);
ASSERT(to == BIG_ENDIAN || to == LITTLE_ENDIAN);
if (from != to) {
const I32u low = (I32u)data;
const I32u high = (I32u)(data >> 32);
return (((I64u)_DATA_Swap32(low)) << 32) | ((I64u)_DATA_Swap32(high));
} else {
re... | 1 |
1b7e66caa1e6009ddcf6cd468af5c435 | 93f635f6ed3e14ebf53d105b895ce4f1 | Checks if release timer has not expired | return self.start_date is not None and \
timezone.now() >= timezone.make_aware(
datetime.combine(self.start_date, self.release_time)) | 1 |
17f87247669b14ef3d083ea26a4f5409 | eca8afaf8db386b054e3619a1de8d7c1 | Fonction qui retourne les scores stockés en DB | func GetScores(w http.ResponseWriter, r *http.Request) {
scoreList, err := models.GetScores()
if err != nil {
libs.ResponseError(w, r, "Error on get scores: " + err.Error(), http.StatusInternalServerError)
}
libs.ResponseJSON(w, r, scoreList)
} | 1 |
4226a3a7befb96b7c3000cdbe66c94ef | ffb9ff293ec5511475361d58e247a5f5 | Calculates the level from the current xp
Returns 1-50 | var levels = [
[0, 20],
[20, 40],
[40, 60],
[60, 80],
[80, 100]
];
var min = 0;
var max = 100;
for (var i = 0; i < levels.length; i++) {
if (xp < levels[i][1]) {
min = levels[i][0];
max = levels[i][1];
break;
}
}
var range = max - min;
var percentage = ((xp... | 0 |
f81165d7c48e9e26e5b9e30ffd668422 | 2cd0a155237290d0a4d7ea182ed13148 | Resets the shader parameters. | namespace RetroBlitInternal
public sealed class RetroBlitRenderer
public void ShaderReset()
{
SetCurrentMaterial(mDrawMaterialRGB);
Flush(FlushReason.SHADER_RESET);
mCurrentShaderIndex = -1;
} | 1 |
a8e65c211781bdd9ab38abe44f4389e0 | bc7ca653eea87cfc2e99e0a254f31bff | 两组和之差 | public class _10个数分两组
public static void getMinusArray(int[] a, int[] b) {
int suma = getSum(a);
int sumb = getSum(b);
int startMinus = Math.abs(suma - sumb);
int minus = 0;
for (int i = 0; i < a.length; i++) {
for (int j = 0; j < a.length; j++) {
int ... | 1 |
33860fcc385ee12c3c73eb2396c727b2 | b70eb13cc028bb9ebaa64b0db717bc24 | as is | def urn_to_slicename (urn):
return urn | 1 |
356bccb5edc20a7a66ab54ecbef2e1b8 | a273c4dee978d57aae0af153092b5784 | Creates an entity from an AST node. | class AssignFactory(HasTraits):
def from_ast(self, namespace, node):
assign = Assign(
namespace = namespace,
lineno = node.lineno,
expr = node.expr
)
compiler.walk(node, AssignVisitor(assign))
return assign | 1 |
0196dab917de901f5efcfe0f93a0ee72 | 2ed84309001101fa4e08d11080c00c38 | 执行活动添加操作 | {
if ($request->isMethod("post")) {
$this->validate($request, [
"titlie" => "required|unique:actives",
"content" => "required|",
"start_time" => "required|",
"end_time" => "required|",
]);
$data = $request->p... | 1 |
1f3b4d0b5329660092b655388593de37 | c403bf6d239e0c510e22e2926ef3c15f | 根据时间获得当前的心情值 | var retVar = 99
val calendar = Calendar.getInstance(Locale.getDefault())
calendar.timeInMillis = givenTime
when {
isBefore(calendar) -> retVar = Constants.CURRENT_TIME_BEFORE
isAfter(calendar) -> retVar = Constants.CURRENT_TIME_AFTER
isEqual(calendar) ... | 0 |
cb24026a54ecfa8a4f7da5f9ea694330 | 6749b13b2a45a1d958f2a71d8e571c51 | Filter the query by a related Ptk object | abstract class BaseTugasTambahanQuery extends ModelCriteria
public function filterByPtkId($ptkId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($ptkId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $ptkId)) {
$... | 1 |
0725e00a0afa47b8f424de7e2c5b4ef6 | 4ae369c454850d5775c7b4bfabf95fe0 | Purpose - This method will remove the borrower | {
if (Borrower::where('id', $id)->delete()) {
return redirect()->back();
}else{
return redirect()->back();
}
} | 1 |
b94dc00f95482a7a4acf7f7ed30d9204 | d6ed7b98c0041a516f78b6b9b224f4b2 | gmtOffset returns the date's timezone offset to UTC as a string. | {
$hours = intval($offset / 3600);
$minutes = abs(intval($offset % 3600 / 60));
return 'GMT' . ($offset ? sprintf('%+03d:%02d', $hours, $minutes) : ' 00:00');
} | 1 |
cf39deabb17c120202671610aa4d897e | adc50c8b0a31339f82dab2cfe1446a44 | Получает предложения пользователя для валютной пары | namespace TrDeals.Data.Repositories.Interfaces
Task<List<Offer>> GetList(Guid userId, string currencyOneId, string currenctTwoId); | 1 |
ab189d2a29857e63e347ed374e6c46b0 | 62f2cb257a1ad2b3ab38ecf19ee4b774 | Configura a barra de ferramentas e ações de janela e teclado. | namespace prj_StringBuilder
class Program
private static void config_janela(string titulo)
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.BackgroundColor = ConsoleColor.White;
Console.Title = titulo;
Console.SetBufferSize(80, 25);
Console.S... | 0 |
bf102407effebd1373dcceb2cbc5bbb4 | 6ed85e76912eeb59e77c6d6562acecbb | 考试表分页查询 | function examPageList(data) {
return request({
url: '/course/exam/pageList',
method: 'POST',
data
})
} | 1 |
cc6c68184e98885f572e948fb194624d | 3c5ded8f768f2721c24e0619d905727e | Test updating coverage when empty. | def test_coverage_calculation_handles_empty_files_list():
result = calculate_coverage([])
assert result == 100.00 | 1 |
865a5e0b8cac5123353f5e88bab7bdd2 | 045028df46417da616d0ff97f36f1726 | Adding custom admin color scheme | class Yikes_Inc_Easy_Mailchimp_Forms_Admin
public function alter_yikes_easy_mc_color_scheme() {
$current_color_scheme = get_user_option( 'admin_color' );
switch ( $current_color_scheme ) {
default:
case 'fresh':
$main_color = '#00a0d2';
break;
case 'light':
$main_color = '#E5E5E5';
... | 1 |
3a5cae5d6d1b29dc73c8666ef8470841 | 0d1409b2b6a98215929901583f88e843 | 获取缓存项目。 如果它还没有在缓存中,则加载并缓存它 | namespace TinyFx.Extensions.StackExchangeRedis
public class RedisHashExpireClient<T> : RedisHashExpireBase<T>
public CacheValue<T> GetOrLoad(string field, CommandFlags flags = CommandFlags.None)
{
CacheValue<T> ret = null;
var redisValue = Database.HashGet(RedisKey, field, flags);
... | 1 |
a2e2e90cab12cd07262a4885986db537 | 6e16ac5bc916a8338fa0046193b0d4b4 | 获取附近维修点的,根据半径进行筛选 | fun getNearList(@Path(ParamsConstant.CityID) cityIDs: String,
@Query(ParamsConstant.Lat) lat: Double? = null,
@Query(ParamsConstant.Lng) lng: Double? = null,
@Query(ParamsConstant.Offset) offset: Int? = null,
@Query(ParamsConstant.Limit... | 0 |
ffa1e56a7c9034369322b7c6358835af | d9d10f554d6ce2858658f398b4e97fcc | Register vendor scripts. | class Assets
public function register_scripts() {
wp_register_script(
'revenue-generator-select2',
REVENUE_GENERATOR_BUILD_URL . 'vendor/select2/select2.min.js',
[ 'jquery' ],
$this->get_asset_version( 'vendor/select2/select2.min.js' ),
true
);
wp_register_style(
'revenue-generator-select2',
... | 1 |
f01c53b2835893440f78300c88acad72 | 531462fbe7fa304415e8ee742b6c6f4d | O usuário poderá ver todas as classes presentes até o momento, qualquer um pode realizar essa ação. | class UsuarioController extends Controller
public function lista() {
if (\Auth::user()->adm != 1)
return redirect('/classificacao');
$usu_pend = DB::select("Select * FROM users WHERE inscricao_liberada = 0 ORDER BY login");
$usu_total = DB::select("Select * FROM users WHERE inscricao_liberada = 1 ORD... | 0 |
9a154eff146dd6334e644286f399dcfc | 58ac6e9ad2329eae455da18227e6310d | 该方法用来发送需要执行的Memcached命令. | $.ajax({
url:memcached_url,
method:'POST',
data:memcached_data,
success:function (data){
if(!data.success){
$.messager.show({
title:'提示',
msg:data.message,
timeout:5000,
showType:'slide'
});
}
console.info(data);
},
error:function(data){
$.messager.show({
title:... | 1 |
33be9623ec03e613638da2b24f820f39 | 24c01ab8dc35808e0f0f6dcb39a3a74f | Очищает все файлы из дериктории рекурсивно со всеми поддиректориями. | class FileStorage extends AbstractCache
public function doClear()
{
$target = new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS);
$iterator = new \RecursiveIteratorIterator($target);
foreach ($iterator as $file) {
$this->doDelete($file->getFilename(... | 1 |
0fc1ed3d2c9f2acdfbd9ae4fd0eeb676 | d9085bee8c3c34d683d61a9a64d9203e | Number of float predictions per timestep. | class GluonTsDatasetConfig(DatasetConfig): # pylint: disable=abstract-method
def _prediction_length_multiplier(self) -> int:
return 0 | 0 |
e17398743d29ef1e16d7d9db2ede6c11 | 4f459054f5e32ac466761c7177173552 | compress the image bytes before storing it in the database | Bitmap bm = ((BitmapDrawable) imgPreview.getDrawable()).getBitmap();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, baos);
return baos.toByteArray();
} | 1 |
9141395cf52efca32dc1e84b95d1583f | d250d32ffebfb908425882ff247a3814 | Функция для получения сервисов в JSON формате | services = Service.query.all()
services_list = [s.to_dict() for s in services]
return jsonify({'success': True, 'services': services_list}) | 1 |
d056ad6e7a837f05264d42dc98d2b4b2 | 565ec579340d719c9da72a6173e089a8 | ページタイトルをボタン形式で表示 | function og_title() {
if(is_front_page()) {
$title = get_bloginfo('name');
}
else {
$title = get_the_title().'|サイト名';
}
return $title;
} | 0 |
973e3fe8d0ec0384c1a56b41032bfa83 | 4d6354a4c170e4b460d7aa7ca2ca14c3 | 初始化玩家的任务数值 | @Component
public class TaskManager{
public TaskInfo initTask(Player player){
TaskInfo taskInfo = new TaskInfo();
initBaseTask(player,taskInfo);
initTimeRefreshTask(taskInfo,1,getTaskNum(TaskConstant.DAILY_TASK_INIT_NUM,1,player.roleInfo().getVipInfo().getVipLevel()));
initTimeRefreshTask(taskInfo,2,getTaskNum(... | 1 |
8747112ff7f8ab4fccd8ed79abcd0469 | e168f444d8dfbf89da5be4fe51f6ba77 | send a message to the display to scroll forward through its history buffer | var proc *syscall.LazyProc
if lineCount > 0 {
proc = conctrl.NewProc("ScrollPannelForward")
} else {
proc = conctrl.NewProc("ScrollPannelBackward")
}
proc.Call(messagePannel, uintptr(math.Abs(float64(lineCount))))
} | 1 |
f21d8d44c15f1ffdd0f9c48da96a5043 | f83d10660d6285b967148eecc3ed59a3 | 메인 페이지 -> 내가 쓴 댓글 | class MypagesController
def showmyposts
end | 0 |
3f056da0e08e586194fdb178645aa23c | 0403ed51ce9f74da6ab71f22873ef53b | 求列表lst中元素的排列(默认是全排列),同时去重。
len可取值:'ALL' 或 正整数(小于等于列表lst的长度) | def rpermutations(lst):
if len(lst)==0:
return [[]]
perms = rpermutations(lst[:-1])
res = []
for perm in perms:
res += [perm[:i]+[lst[-1]]+perm[i:] for i in range(len(perm), -1, -1)]
return res | 0 |
2d733ddf29dd47586bac9d1e8bb0cb11 | 7409411698f9a28a72dd2e39c2158a06 | Get 背景水印宽度。默认宽度1920。 | @ScriptAssert(lang = "javascript", script = "_this.usernameMaxLength >= _this.usernameMinLength && _this.passwordMaxLength >= _this.passwordMinLength")
public class Setting implements Serializable
@NotNull
@Min(0)
@Max(100)
public Integer getWatermarkAlpha() {
return watermarkAlpha;
} | 0 |
c059b991049059a844a98d1e2a831544 | 9fbf9296aa0e65228c255c3f49ee9af9 | Results object with appropriate getters for the GetItem Choreo. | class CloudMine_ObjectStorage_ObjectGet_Execution extends Temboo_Choreography_Execution
protected function wrapResults($outputs)
{
return new CloudMine_ObjectStorage_ObjectGet_Results($outputs);
} | 1 |
b58eeb804079584874779639f0d5f945 | a1d2fd0e9752db41491b012152203096 | Returns the criteria for checking the last name. | {
if ($lastName !== null) {
return $qb
->andWhere('u.lastname LIKE :lastName')
->setParameter('lastName', '%' . $lastName . '%');
}
return $qb;
} | 1 |
1dcfe6cf4796fbbfc7f2d70442f42bd7 | ee4ad2815c0c81d66662f0ae5f34383f | 返回每一个页面的电影url列表 | user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36'
header = {'user-agent': user_agent}
response = requests.get(myurl, headers=header)
bs_info = bs(response.text, 'html.parser')
urls = []
for tags in bs_info.fin... | 1 |
aabf307dff1dcba496b8ca8f1205bbce | 7fcb1222bc47cd20c2dc544231921b31 | Don't include untranslated nodes in the resulting YAML file. | class NodeSourceXlsxSerializer extends AbstractXlsxSerializer
public function setOnlyTexts(bool $onlyTexts = true)
{
$this->onlyTexts = $onlyTexts;
} | 0 |
001808b5798936c5d6f22961fafafd47 | f98034a92d448731a0e7c72214026186 | Square root approximation with arbitrary precision. | fn sqrt(&self) -> Self {
let one: Self = One::one();
let two: Self = one.clone() + one.clone();
let mut min: Self = Zero::zero();
let mut max: Self = self.clone();
while min < max {
let mid = (min.clone() + max.clone() + one.clone()) / two.clone();
let mid... | 1 |
0104307d30079f3694f82ec4345c1a40 | 6819a008200f20f161911c8dd7683d7a | Test that it can automatically switch classes | $this->create_classes();
$class_array = $this->class_object->get_class_names();
$this->assertTrue( in_array( 'chupacabra', $class_array ) );
} | 0 |
29abb9c4fa2e067cdf23d58226cd454e | bc58b97df1a94f0b1f1beca114e55d1f | Add config for Panoptic-DeepLab. | self.arg_config_group.add_argument('--output_dir',
type=str,
default='pp_tinypose_output',
help="The directory to save output images.")
self.arg_config_group.add_argument('--v... | 0 |
52ce1ccbb885a2674542f048000b2e0a | 8611b0a12ef8dc3474c152cacc90427e | 15.FIJA LA CÁMARA PARA LA PELEA CONTRA EL BOSS | this.bulls = this.bulletsPre.getChildren();
this.ebulls = this.bulletsEnemy.getChildren();
if (!this.is_paused) {
if (mapas[selectedMap].nombre === 'con') {
this.TaxiDown.body.moves = true;
this.TaxiUp.body.moves = true;
}
this.... | 0 |
7d58e3edbc9752467e32d030e0b268c6 | c6bff712b658b65a68cafda920c4c202 | Sets neighborhood type for current simulation- taking into account cell shape and user input (torodial or finite) | string sim = askUser();
bool condition = true;
int generationCount = 1;
while(condition) {
for (int j = 0; j < width+2; ++j) {
cellArray[0][j] = '-';
cellArray[height+1][j] = '-';
}
for (int i = 1; i < height+1; ++i) {
cellArray[i][0] = '-';
cellArray[i][width+1] = '-';
}
for (int j = 1; j < w... | 0 |
3c8aa3feea2af48e3b222642d56ddefd | c8848183a4056331a0ec7d4558a52b57 | 移除小數點後的最後一個位數 | function trim_last0($floatnum){
$floatnum=sprintf("%.1f",substr(sprintf("%.2f", $floatnum), 0, -1));
$floatnum=strval($floatnum);
return floatval($floatnum);
return $floatnum;
} | 1 |
e684cdf2d59d3951b6e4b2b24998e8c4 | 42827b1d107537df8f6a0ab43c299cfd | Returns the number of bankses. | class PinBanks(object):
def __len__(self):
return len(self._banks) | 1 |
65b759ac08dd3dcb3dd064349b1fb6f7 | ff915d2a40ec54f8e3e989d923411a7a | 将新密码替换旧密码 | $userInfo = $this->getUserInfo((int) $uid, $password);
if (empty($userInfo)) {
$this->error = '旧密码不正确或者该用户不存在!';
return false;
}
$verify = genRandomString(6);
$status = $this->where(array('id' => $userInfo['id']))->save(array('password' => $this->hashPassw... | 1 |
e4339384089bb1be3acce7b50ea96c35 | 6507f443bb57482368474cd9b3993e37 | Return the version the properties on this object were last updated | class PropertyResponse implements \JsonSerializable
public function getUpdated()
{
return $this->updated;
} | 1 |
ff9cfc19a9422eafc7feb6b1dca8a626 | ffac679a08336ae90176a84438f93a4b | 根据文件名获取子路径 | public class UploadUtil
public static String subFileName(String fileName){
int index = fileName.lastIndexOf(File.separator);
if(index == -1){
return fileName;
}else {
return fileName.substring(index+1);
}
} | 0 |
598db27ffac1aa9b05b65f7fb13cb54a | 087cae803e1d79ebab55525be1ec93e4 | Gets the border insets. | public Insets getBorderInsets (); | 1 |
a7214717b8c6ef56a8d0beba4d2c06bd | be2af6b32549c7695b7eb386a43551e0 | load all Waypoints with full Details | function TP.LoadWaypoints()
local mapID = Player.localmapid
TP.MapID = mapID
gMapName = mapID
if (TP.AutoListMapId == 0 or TP.AutoListMapId ~= Player.localmapid) then
TP.AutoListMapId = Player.localmapid
TP.AutoList = persistence.load(TP.coordspath..TP.AutoListMapId.."_auto"..".lua")
if (TP.AutoList == nil) t... | 1 |
960e9aad8be7a4b29d349bb4ca68e2b3 | ddda391acbbcdc9d7c096a55ac1080c9 | Encode the supplied message into bytes using the supplied byte buffer. | class Encoder(abc.ABC):
def encode(self, data: MessageData) -> bytes:
raise NotImplementedError | 0 |
61d9d453f25c3e066b44185c2747cad5 | 33b8e02d450bd871950eb201e26c0a54 | Solves a system of linear equations for multiple right-hand sides, AX = B. | namespace Xamla.Graph.Modules.MathNet
public class MathNetWrapper
[StaticModule(ModuleType = "MathNet.Numerics.LinearAlgebra.Matrix.Solve")]
public static Matrix<double> Solve(
[InputPin(PropertyMode = PropertyMode.Allow)] Matrix<double> lhs,
[InputPin(PropertyMode = PropertyMode.All... | 1 |
58c1398d76a371d62405433b4f5e7aa3 | 0c520535e0d092c17767c4a860d0d33a | Create a message builder to send follow-up messages for this interaction.
You can send, edit and delete follow-up messages for up to 15 minutes after you received the interaction. | public suspend fun messageCommands(builder: suspend MessageCommandsBuilder.() -> Unit) {
builder(messageCommandsBuilder)
} | 0 |
0b5326b18e1e4eef58e65a9e7e4c5cbf | 7c3565c2af7cd6c186bd2d551498aec3 | Given a java type, determine the proper cast type name. | public String getCastType(Class javaType); | 1 |
4e63df57b3efbca8560d4b6f327f845d | 1aad3c7ab83facb9d649509fa5fa4ebd | ksz8851Init() initializes the ksz8851. | {
int err;
err = phy_write(phydev, MII_MARVELL_PHY_PAGE, 0x12);
if (err < 0)
goto out;
#if 0
err = phy_write(phydev, 20, 0x820);
#else
err = phy_read(phydev, 20);
if (err < 0)
goto out;
err = phy_write(phydev, 20, (err & 0x77) | 0x800);
#endif
if (err < 0)
goto ou... | 0 |
4e1c8457a76ed211acd34d45d82abf2d | 55f979d364633522606ebb683d1046bc | 检查集群是否有资源启动AppMaster | abstract class BaseService extends \ms\lib\BaseService{
protected function checkMaster(){
$master_name = $this->getMasterProcessName();
$last = exec("ps -ef | grep '{$master_name}'| grep -v index.php | grep -v grep | wc -l");
return $last > 0 ? true : false;
} | 1 |
0ebc5e185d765567c3f091c231c77351 | a467062e6821c4e9fe870c5ca20aad57 | Dump Lua bytecode of the supplied function | int strip) {
DumpState D;
D.L = L;
D.writer = w;
D.data = data;
D.strip = strip;
D.status = 0;
DumpHeader(&D);
DumpByte(f->sizeupvalues, &D);
DumpFunction(f, NULL, &D);
return D.status;
} | 1 |
063a8906338fa8587308d16f24e40958 | 625eaebd346b68db42db753cc7595d87 | Run the stored procedure to get state vectors of the planets | namespace DB
public class DbUtility
public string RunProcedureState(string storedProcName, IDbDataParameter[] parameters)
{
using (DbConnection connection = providerFactory.CreateConnection())
{
connection.ConnectionString = ConnectionString;
connectio... | 0 |
1f64b9ba99b9cd0c14284c1151d8e9f7 | 3c9e13d0fceb419671d882e5a39facfa | Cancels the local notification associated with the specified <paramref name="id"/> and <paramref name="tag"/>. | namespace VoxelBusters.NativePlugins
public partial class NotificationService : MonoBehaviour
public virtual void CancelLocalNotification (string _notificationID)
{} | 0 |
143090d45b7e8e9df0576e19f670212c | d7a8d7d598abc29970c2162ac6831fce | 显示数字 2 | static void LCD_2digit(uint8_t number)
{
LCD_data(number / 10 + '0');
LCD_data(number % 10 + '0');
} | 0 |
2b56844f39292cccb43e77e6fad45b45 | 3f9bf3e41deed4d7603092e220bd7d7d | GET api/Avisos | namespace AdminVivienda.Controllers.Administrador.Avisos
public class AvisosAdministradorController : Controller
public ActionResult Index()
{
return View();
} | 0 |
12f2223372f5229aa8d3e3ae4cfc7c70 | 33eba40f48c3b36c0811ed371feaa2e3 | Reverse routing. | class Router implements
MiddlewareInterface,
RouteCollector,
LoaderAwareInterface,
CacheAwareInterface,
InvokerAwareInterface,
ContainerAwareInterface
public function reverse(string $routeName, array $variables = []): string
{
return $this->getReverser()->reverse($routeName, $variabl... | 1 |
0d6b8babc3351f03e5523dfd7e2ea341 | c1439203c563e3b3c568b180f8905786 | Checks whether the Pixel from the Image sample is transparent or not | if img.mode == "P":
transparent = img.info.get("transparency", -1)
for _, index in img.getcolors():
if index == transparent:
return True
elif img.mode == "RGBA":
extrema = img.getextrema()
if extrema[3][0] < 255:
return True
return Fals... | 1 |
91750df021940face678719b3db5461e | 0ed4163be305fef93b7cb157639ec587 | 电池入库 | Class Battery extends MY_Controller{
public function addBattery(){
$this->checkAuth();
$action=$_SERVER['REQUEST_METHOD'];
if($action=='POST'){
$parames=$this->parames;
$this->form_validation->set_data($parames);
$this->form_validation->set_rules('batteryNum... | 1 |
b94ea9f6f1b9373d55cbddee48bc505d | 2a3fab690d55e149604374c0ee16fd08 | Make selection cursor follow the cursor. | let model = this._selectionModel;
if (!model || model.isEmpty || model.selectionMode !== 'cell') {
return;
}
let fill = this._style.cursorFillColor;
let stroke = this._style.cursorBorderColor;
if (!fill && !stroke) {
return;
}
let startRow = model.cursorRow;
let startColu... | 1 |
ec6099970516e0ec999921d3bec1c46b | 8d90821a04afdc90139803b4dd4d5b41 | Register the javascript block of Form.Onsubmit and Form.OnLoad
Put the content from hiddenfield to editonpro in Form.Onload
Put the contrent from editonpro to hiddenfield in Form.Onsubmit | function _onSubmitForm(){
if(htVar.bEditable === false){
_appendSelectedLabelIdsToForm();
}
return true;
} | 0 |
188157702e1e320ca22d7af95119e8d8 | 06ba6aeab5158a43394a30855caaaaf3 | Reenable channel catalog product (asynchronously)
By default a all your catalog products are exposed to the channel. You can reenable a product by using this operation. /!\\ In case of massive optimisation we recommand you to use the analytics api | namespace IO.Swagger.Api
public partial class V2UserChannelCatalogsApi : IV2UserChannelCatalogsApi
public async System.Threading.Tasks.Task EnableChannelCatalogAsync (string channelCatalogId)
{
await EnableChannelCatalogAsyncWithHttpInfo(channelCatalogId);
} | 1 |
6715f9c17c7232f3e7257cafe1231c60 | 3824f6e5f52325d29234453860f5c45c | 渲染-编辑个人简介区域 | class ResumeController extends Controller
public function actionDescriptself()
{
$session = \Yii::$app->session;
$user_id = $session['user_id'];
if (empty($user_id)) {
$arr['msg'] = "保存失败!";
} else {
$data = Yii::$app->request->post();
$descriptsel... | 0 |
872a964c0dbbfc1581373e0d56cc69f2 | 17a6e4897a4aa5883a75f186a46bad1d | 设置关于Em的全局监听 | this.doc.em.addListener(EventName.DOCUMENT_CHANGE_SIZE, this.setEditorHeight)
this.doc.em.addListener(EventName.DOCUMENT_CHANGE_CONTENT, this.onDocumentContentChange)
this.doc.em.addListener(EventName.DOCUMENT_CHANGE_FORMAT, this.onDocumentFormatChange)
this.doc.em.addListener(EventName.DOCUMENT_NEED_DR... | 1 |
3f3b0b2a8bb56c8661b1063b8e7a8abd | 208cdb678db650ea5553ee21795f1a01 | Calculate the standard deviation of values of all elements in each dimension of a given Matrix. | namespace StarMathLib
public static partial class StarMath
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float standardDeviation(this float[,] a)
{
return standardDeviation(JoinMatrixColumnsIntoVector(a));
} | 0 |
55fde65286ee18a936509dd6468a3bd7 | 021256b075f3e0439377b3567908aeff | [Tin.Nguyen] - Lấy danh sách dữ liệu bảng Tỉnh/Thành Phố (Cat_Province) | namespace iGNProject.Controllers
public class ProvincesController : ApiController
public IHttpActionResult GettblProvince()
{
return Json(db.tblProvince.ToList().Select(p=> new {p.ProvinceID,p.ProvinceName }));
} | 1 |
79285c327505d6ca09ec05acf08f217d | 28f7741bce929acc736ae9e550e1974d | Returns the largest integer less than or equal to the specified double-precision floating-point number. | namespace System.Prelude
public static class Prelude
public static int Ceiling<A>(this double x)
{
return (int)System.Math.Ceiling(x);
} | 0 |
6bedeefcea64a5fe3d1f22d4e1dd1af4 | 0c23e2161022ab252abb6df3eb93b1ec | Gets the script material question list. | class SurveyQuestionGUI
protected function getMaterialOutput()
{
if (count($this->object->getMaterial()))
{
$template = new ilTemplate("tpl.il_svy_qpl_material.html", TRUE, TRUE, "Modules/SurveyQuestionPool");
foreach ($this->object->getMaterial() as $material)
{
$template->setCurrentBlock('material')... | 1 |
1625f7968be066b78190c31c6962d5bd | b5809ab38253e645b478950f844ebac6 | 时分秒加1 | def timesecadd1():
timesec = int(showtimesec.value)
if timesec > -1 and timesec < 59:
timesec = int(showtimesec.value) + 1
showtimesec.value = str(timesec) | 0 |
5487f72e98b89b701a3809600a6e57c3 | dd222bb776c951615d233f3e195aa06e | Returns a click test runner (for shiv-info). | class TestCLI:
def info_runner(self):
return lambda args: CliRunner().invoke(info_main, args) | 1 |
65af327266d92ecdad56b79045b18547 | 8279226e6ce74f565cb2b7b81ce95d51 | localizedcontroltype for ServerLoginControl | switch loginttype {
case glogin:
return "guser"
case flogin:
return "fuser"
case llogin:
return "luser"
default:
return ""
}
} | 0 |
80bab944cf0bcae1bc256d7de6959a17 | 287e6583608e74029daa2ea7311c3a79 | Create an instance of {@link PositionTypeRHSRQ } | @XmlRegistry
public class ObjectFactory
public Right createRight() {
return new Right();
} | 0 |
86e99f3c56b85b4c3be7239da640938e | f6d69d5457694a7262d082157e105fc1 | Check if an addon is part of the community repo. | class PackageInfo
isForAddon() {
return isAddon(this.pkg.keywords);
} | 0 |
8f3e4b4fc4e826272884fcb7e8474ab4 | 33cccaca8dccc57177bfb0514e6524f0 | Calculate the e-structure representation of the parse tree node | name = node.__class__.__name__
if isinstance(node, e_nodes.BXmlTypeNode):
value = None
elif isinstance(node, e_nodes.VariantTypeNode):
value = node.string()
elif isinstance(node, e_nodes.OpenStartElementNode):
value = node.tag_name()
elif isinstance(node, e_nodes.AttributeNod... | 1 |
1334e2a76dbc157c54e01c8f45f3d2d5 | a31dcae86d5c483b006b52637e3a930a | This method updates the IP address of a user | class Login_model extends MY_Model
public function update_last_ip($user_id)
{
$this->db->update($this->table_name, array('last_ip' => $this->input->ip_address()), array('id' => $user_id));
return $user_id;
} | 1 |
c01bead638a1077fcfc081eb898ae8b1 | 1c12431a67ff88869f6fb62ba2bcdd92 | @brief Find the next empty space in the list from the start | {
int size;
if(fatType == 16)
size = FATSz * bpb.bpb_bytesPerSec / sizeof(uint16_t);
else
size = FATSz * bpb.bpb_bytesPerSec / sizeof(uint32_t);
int i;
for(i = 0; i < size; i++)
{
if(tableValue(i) == 0x0)
{
return i;
}
}
return -1;
} | 1 |
7fa3a8f0322f4824352461f2100ccfc6 | 52331d5275940bc51a37e668b87d5f99 | Returns statement for frequently used DB statements | sqlStatements["newMovie"] = "INSERT INTO movies(path, name) VALUES (?, ?)"
sqlStatements["deleteMovie"] = "DELETE FROM movies where path=? and name=?"
sqlStatements["addDownload"] = "UPDATE movies SET downloads=downloads+1 WHERE path=? AND name=?"
sqlStatements["getMovies"] = "SELECT name, downloads FROM movies WHE... | 1 |
2668aaa54944612e5513c7bd463289ef | ddfe74cd26354545924b13d536e03ba5 | 获取所有安装的语言输入法 | namespace Aura8RT.Language
public class LanguageHelper
public static IReadOnlyList<string> GetAppAvailableLanguage()
{
return ApplicationLanguages.ManifestLanguages;
} | 0 |
764ce8b5164ef4f349190c359d5e98e4 | 1ce215c55f5c9bb39a9e95a8ce8a50af | Get the exposure cohort incidence rates. This function is not using a
proper incidence rate so this should be viewed as informational only
and not as a report | ageAtHCV = self.data['age at hcv']
duration = self.data['duration']
etoh = self.data['etoh proportion']
exponent = (-1.6038 + 0.0172 * ageAtHCV - 0.05939 * duration +
0.4539 * etoh)
return self.__exp(exponent) | 1 |
79ec1f4361d259240baf555bc84de8cb | 0d7ef9129b1ad1ce697b83c246cbcbb6 | This function runs the support vector machines (SVM) algorithm using
the cross-validation technique. | params = {'C': [1, 50, 100], 'kernel': ['poly', 'rbf']}
model_SVR = SVR()
grids = GridSearchCV(model_SVR, params, cv=cv, verbose=1, n_jobs=-1)
grids.fit(train, train_target)
print(f'Best estimator: {grids.best_estimator_}')
model_SVR = grids.best_estimator_
model_SVR.fit(train, train_target)... | 1 |
70c2927ba2484577d58d0456c740e68f | bb5c501149659eb7e72f05c869d9cc77 | Gibt zurück, wie der Klassifikator ein gegebenes Sample klassifizieren würde | class Classifier(object):
def evaluate(self, samples):
pass | 0 |
3a820fc8346d5fe0917d1e419b1b4fa4 | 2fb4782f33bb576b94d8d0cacb79e12a | Callback for Icon Button
This callback is activated when an icon button is clicked
NOTICE : it is used into mathml palette and SVG palette (the buttons displayed) | public class LibsConfiguration
void onIconClicked(View v); | 1 |
361ce26755c9bec3369797f6c7b7dc05 | a898e4795aa1851f77eb35fc34214a78 | Returns the next nonce parameter | class SBV2xAdvancedParams:
def nonce(self) -> bytes:
return self._nonce | 0 |
c417d8776cb208244fc8fec5c4dd84db | 8b218b93eb9885f0a1fe19fc8c96fd90 | 将指定的路线隐藏 | export class BreadcrumbService
hideRouteRegex(routeRegex: string): void {
if (!(this.hideRoutesRegex.indexOf(routeRegex) >= 0)) {
this.hideRoutesRegex.push(routeRegex);
}
} | 1 |
48f1402df791d4f50c3ad1b72d8a3938 | 0034b5527e86bb790a66916ae0463f80 | all the customers have been served | def serve(customers):
serving = customers.pop()
print("Now serving: " + serving)
print("Remaining customers:")
for customer in customers:
print(customer)
print("") | 0 |
bad0b02379d314992c5afd6116a401be | f958d9ac251cd2159dd92bece2d8b95a | Generating the home score in the match. | {
return local_score + " - " + away_score;
} | 0 |
f0c001f0590255e3d8dab63316bb47bf | 71ac3b0974bb30007ddc6e1f14d7accf | Возвращает средний индекс загруженности по всем шагам | class Workshop extends \yii\db\ActiveRecord
public function getLoading()
{
$n = 0;
$sum = 0;
foreach($this->facilities as $f)
{
$sum += $f->loading;
$n += 1;
}
if($n === 0)
{
return 0;
}
else
{
return $... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.