query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
202904a58a2e437e9e76e6f53069669c | e6a779d5558445b6bc814daf56e3d760 | Modifies an array of int32 numbers by applying offsets that are within a minimum percent and maximum percent of the original number. | {
long[] offsetNums = new long[numsToModify.Length];
double[] origNums = new double[numsToModify.Length];
for (int i = 0; i < numsToModify.Length; i++)
{
origNums[i] = (double)numsToModify[i];
}
double[] res = OffsetInteger(... | 1 |
f2bb38bf9525dbdf62b7de1343e3e492 | 2c910f4718ffad89386869544109da54 | Show a list of all empresaconfigs.
GET empresaconfigs | class empresaController extends Controller
public function index()
{
} | 0 |
6ddb0d1e256cb41b4748d70c4d1b3fb0 | 19a2ae4191294a6ad52abcbc7ce3745b | Test if raw data with tags can be stored | class CacheManagerTest extends TestCase
public function testRawDataCanBeStoredInCacheWithoutTags()
{
$cache = new CacheManager;
$template = array("test1" => "Test1", "test2" => "Test2", "test3" => "Test3");
$key = __METHOD__ . "TestKey";
$cache->rawData($template, $key);
$storedTemplate = $cache->getRawData(... | 0 |
8533f4fbd9c4487f72331ac1f17f4fea | c8800b4f8dafe9082683f14e14c86c6b | Basic method to send byte arrays.
In this method, the length of the byte array will be sent before the contents. In order to maintain the
consistency, the receiver must use the recv_data method in corresponding placesto avoid | data = json.dumps(payload_as_dict)
data = data.encode()
length = len(data)
declaring_dict = {"timestamp" : time.strftime('%Y/%m/%d %H:%M:%S'), "sender" : "server", "response" : "recv_size", "content" : length}
declaring_dict = json.dumps(declaring_dict)
declaring_dict = d... | 1 |
7a7d488c71925959be5de4ccceac86f4 | ae6bf0f79bcf0a7f467c277bbf7dadc1 | Checks if the mana pool has more than or has the specified number of mana | function IsOwnersManaEnough() end | 0 |
69b8b27b8cfa84546bde43d16a7c36e7 | cbc371cc5bfe294fd378f66692a784a8 | Update the protected files. | namespace Aurea.CRM.Core.Platform
void UpgradeFileProtectionForResources(); | 1 |
ebb0af52d708c83056de00d72d08d7a5 | a11cb65b3d2712875a6432c337980569 | Dump object to json to be logged. | json_file = constants.LOGGING_DIR / f'{int(time.time()*1000)}.json'
with open(json_file, 'w') as f:
json.dump(data, f) | 1 |
ddcf587f8e37c2f8c934526d7590543a | 208a5eba3eb23797fca4573d8ff33e3d | Creating buttons for pagination NEXT and PREVIOUS | const totalPages = Math.ceil(totalResults / resultsPerPage);
const createButton = (page, type) => `
<button class="${elementStrings.pageBtn} results__btn--${type}" data-goto=${type === 'prev'? page - 1: page + 1}>
<span>Page ${type === 'prev'? page - 1: page + 1}</span>
<svg class="search__i... | 1 |
7d4343ceb689a4bf4e6d797e85444b4a | aa5ae1a3f714c106a96746d2b6f3d581 | Tarkistaa oliko ensimmäisenä klikatussa ruudussa miina. Jos oli, jakaa miinat
uudelleen kunnes ruudussa ei ole miinaa. | public class Pelilauta
public void arvoMiinat() {
int pommitJaljella = this.miinojenLkm;
while (pommitJaljella > 0) {
int rX = random.nextInt(kentanKoko);
int rY = random.nextInt(kentanKoko);
if (this.ruudut[rX][rY].getMiina() == false) {
this.ruudut[r... | 0 |
c8ad82e64044ed77a43bfd3715443ea3 | 70b3bc1ba58f44ea8f156354a2835211 | C# 문자열 다루기 | a := "Hello\nWorld"
b := `Hello\nWorld`
fmt.Println(a)
fmt.Println(b)
c := "죽는 날까지 하늘을 우러러\n한 점 부끄럼 없기를 \n잎새에 이는 바람에도\n나는 괴로워했다.\n"
d :=
`죽는 날까지 하늘을 우러러
한 점 부끄럼 없기를
잎새에 이는 바람에도
나는 괴로워했다.`
fmt.Println(c)
fmt.Println()
fmt.Println()
fmt.Println(d)
} | 0 |
4446b9b28d231ab6fae5a521af2496b1 | 7b8043f2aa6a4200de3a5563f4b426dd | Checks if a set is visible | for (var elem of subset) {
if (!set.has(elem)) {
return false;
}
}
return true;
} | 0 |
3ff69800ed28ac487611f026af2570a6 | 5a4a985a448ad87b51f2f801d2d0f083 | CSVファイルから1行取得する | public class CSVReader : MonoBehaviour
public string GetCsvCell(int lineNum, int columnNum)
{
return csvDatas[lineNum][columnNum];
} | 0 |
3d387700148ea92f6695a98cf34f5a48 | eeef7ccb516358113fec86ab726d90db | Метод проверяет наличие в рабочей книге зарегистрированного фонта с указанными характеристиками и если он отсутствует то регистрирует его. | namespace Kesco.App.Web.Docs.Directions
public class ValidationMessages
public static int CheckExistsDirection(EntityPage page, TextWriter w, Direction dir)
{
if (dir.SotrudnikField.ValueString.Length == 0 || dir.Finished)
{
w.Write("");
return -1;
... | 0 |
30671c63499d338cc457798a1a177d39 | 13983088591e3f551c9237b6cbab4822 | Add and remove checkbox for task | function Listen_checkbox_complete() {
$checkbox_complete.on("click", function() {
var $this = $(this);
var index = $this.parent().parent().data("index");
var item = get(index);
if (item.complete) {
update_task(index, {complete: false});
} else {
... | 0 |
3f378b32031d88be164415e9d42c8be9 | 2ce6b7b513c1812c7a1a88ab27291323 | 获取测试服务器的信息 | public JsonResult GetServerTest(string key)
{
TokenHelper.ResponseTokenInfo _response = new TokenHelper.ResponseTokenInfo();
_response.StatusCode = (int)TokenHelper.StatusCodeEnum.Success;
_response.Info = TokenHelper.StatusCodeEnum.Success.GetEnumText();
... | 1 |
d5b163a6fd7a6ecbfd3cd01d0627352f | 6b19de22aa20c639017da36ccac53038 | Test the VectorData output with data from the wrong hemisphere | def test_surface_wrong_kind_of_input():
ship_data = load_sample_bathymetry()
data = ship_data.bathymetry.to_xarray()
assert data_kind(data) == "grid"
with pytest.raises(GMTInvalidInput):
surface(data=data, spacing="5m", region="245/255/20/30") | 0 |
605943acb60bcd7a9edf94e6a485243a | cdc9d21cd81ce6aa7f07ecb2227a55a5 | fonction qui permet de recupèrer la nom de la formation grace à son id | $this->loadModel('Departement');
$res = $this->Departement->findFirst(array ('conditions' => array('id' => $id)));
return $res->name;
} | 0 |
01f0a3b0f09b9320304f6f3924cc35f3 | 50e17989d9d759511430b0a7f59eac6d | On disable, we unregister to the OnObjectSpawned event | function BadPet:OnDisable()
self:UnregisterEvent("PLAYER_ENTERING_WORLD");
self:Refresh();
end | 0 |
813545394c8d2e11c7b1862b57692d13 | 082840efb5ab7894f3fd937125fb7fbf | 产品开发完成并测试通过后,通过发布产品将产品设置为发布状态 | public class ProductAction extends ActionSupport{
public void productRelease() throws IOException{
System.out.println(JSONObject.fromObject(product));
System.out.println(JSONObject.fromObject(user));
JSONObject resultJson = new JSONObject();
try {
Product resultProduct = FactoryUtil.getProductService().produ... | 0 |
7c7524f56db936260a8a7da8bec876a7 | 724237f16d1f982cf9ac20c5c0a1bc9b | query power board for battery bus voltage and notify seawolf if voltage is low | void CheckLowPowerCondition(void)
{
AdcInit(ADC_CLOCK_SYSTEM);
AdcSampleWait();
if (!USB_BUS_SENSE && adcResult.batt > 10 && adcResult.batt < BATT_CHARGE_MIN_SAFE)
{
int i = 0;
while (!USB_BUS_SENSE)
{
if (i++ % 5 == 0) { LED_SET(LED_RED); DelayMs(1); }
SystemPwrSave(WAKE_ON_USB| WAKE_ON_BUTTON| WAKE_... | 0 |
a1ebbd42ab6d9ffd1d7eeccf96b83602 | 676c9897d0854ee0b64c3f96df3c6ee1 | Writes Variable State to the Registry | def vjog_device_write(dev_file, v):
global ns, sharedRegs, changeRegs
s = dev_file.split('/')
dev_file_tag = s[len(s) - 1]
st_reg = "dev_%s" % dev_file_tag
sharedRegs[st_reg] = v
changeRegs.append((st_reg, v)) | 1 |
30a886aae1ff6a652c3af0c691eac1ac | 1cf1cf7a589289ac2aec50cbfe1fa447 | GET: Regimes | class RegimeController extends Controller
public function index()
{
$regimes = Regime::orderBy('id', 'DESC')
->get();
return view('regimes.index', compact('regimes'));
} | 1 |
8dba5c39e13247dee7f30d175e324f06 | c211fd4c3d6788d17ed4a3c88b976ad3 | 对K个链表排序 | Map<Integer, BufferedReader> fileKToReader = new HashMap<>();
FileWriter fileWriter = null;
fileWriter = new FileWriter(resultPath, false);
PriorityQueue<SortNode> queue = new PriorityQueue<SortNode>(11,
new Comparator<SortNode>() {
public int compare(... | 1 |
ecd360890854302fb04db7af38e897f3 | 9158f67bc48321d839eba2345175ed92 | 解析购物车数据 | public class JsonParser
public static List<CartItemListPojo> CartItemListParser(JSONArray jsonArray) throws JSONException {
List<CartItemListPojo> list = new ArrayList<>();
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jo = jsonArray.getJSONObject(i);
CartItemListPojo... | 1 |
ce44971b8b1403543c4e00677b2960e2 | f8ebd77c66b7add65bb0544d5286635c | Sunny day scenario that creates IResources with relative resource name
and ensures the correct contents can be read from them. | [Fact]
public void STRWithResourcesNamespaceCS()
{
Utilities.STRNamespaceTestHelper("CSharp", "MyResourcesNamespace", null, _output);
} | 0 |
958ac3e2390d4823f87cdc95bd90a8f1 | 74fe213d9f3578955ffd23932aed31f2 | Print the AArch64 exceptions status. | uint64_t nzcv_flags;
asm volatile ("mrs %0, NZCV" : "=r" (nzcv_flags));
uart_puts("processor_print: NZCV: ");
uart_hex_uint64(nzcv_flags);
uart_puts("\n");
} | 0 |
04cef5b15eced272f4f5b5cf349ac449 | 83786ef96ee76b93fc29b8c02c1cf1c1 | locally apply add, modify or delete operations +++ | class Undo extends MultipleUndoAppModel
function apply($changes) {
foreach ($changes as $table) {
$model = ClassRegistry::init($table['model']);
if ($table['action'] == 0) {
$model->delete($table['id']);
} else {
$model->create();
... | 1 |
8e4d311989929945a344df3d1ac3e0b6 | c08cc30338287345e2f5d368602eb378 | ### remove extension | function RemoveExtension($f) {
$path_parts = pathinfo($f);
if(!isset($path_parts['filename'])){
$path_parts['filename'] = substr($path_parts['basename'], 0,strpos($path_parts['basename'],'.'));
}
return $path_parts['filename'];
} | 1 |
966e71b9540d9156f0871b6421455546 | b4ebde26a292545b9cab662d1c0a2558 | Gets the VASP Code from the VAAN (first 4 bytes) | namespace PlcSMICECallAGV
public class CommunicationSiemensPlc
private string[] GetCode(short[] content)
{
StringBuilder sb1 = new StringBuilder();
sb1.Append(Chr(BitConverter.GetBytes(content[6])[1]));
sb1.Append(Chr(BitConverter.GetBytes(content[6])[0]));
sb... | 0 |
a16dc4e592ef165aa78f34c32ecdc50a | aa0000cb527c1b4c8bf01b309794f6dc | This method exists to convert a face to a list of correctly (counter-clockwise) ordered
vertex indices. | namespace Vim.G3d
public static class GeometryAttributesExtensions
public static IArray<int> FaceIndicesToCornerIndices(this IGeometryAttributes g, IArray<int> faceIndices)
=> (faceIndices.Count * g.NumCornersPerFace)
.Select(i => g.FaceToCorner(faceIndices[i / g.NumCornersPerFace]) + i ... | 1 |
34ca2659d24cd4d1e4c867f92154bf12 | 83634f7acc25538b2cedbc51ebb0b08e | Prev candle hot getter (last closed candle) | class Candle(object):
def c(self):
return self._c | 0 |
41c4cac36b821c2d1b5f15943d314efa | 85e5784686041b9b3ca51543c3277d99 | 判断抓球是否在必掉的id数组中 | {
boolean out = false;
if(id == 2795 || id == 2796 || id == 2797 || id == 2798 || id == 2799 || id == 2800 || id == 2801 || id == 2802
|| id == 2803 || id == 2804 || id == 2805 || id == 2806)
{
out = true;
}
return out;
} | 1 |
b3055fa5018240ee6e7fe3d7e91230cb | aed2b73c5853bfbd07442fa77131b507 | Creates a form to edit a Capstone entity. | {
$sid = $builder->getData()->getId();
$builder
->add('password', TextType::class, [
'label' => 'field.password'
])
->add('number', TextType::class, [
'label' => 'field.number',
]);
if ($options['include_name']) ... | 1 |
dbb201ddc3756c205a4500aefe5bc640 | 1686591355dc3ee73c61d156412e265f | Détermine s'il s'agit de l'environnement de RECETTE | public class FwkUtils
public static boolean isRecette() {
return getEnvironment().isRecette();
} | 1 |
13fded60d930553c3d8128020d54a57f | 0c59f7297ccfc80058b705f958b5461a | 根据合同id 查找订单id | @Service("hetongService")
public class HtServiceImpl implements HtService
@Override
public List<Fahuo> getFaHuoByContractId(int id) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("htid", id);
String hql = "from Fahuo where hetongCode=:htid";
List<Fahuo> fahuoList = fahuoDao.find(hql,... | 0 |
7c148b71232d30ea4dbb69f0dff0c13c | 014d75fcc2ee80f6240b235a7a828026 | Initializes Timer to 0 | void Clock_Init(){
time_seconds = 0;
time_minutes = 0;
time_hours = 0;
Timer0A_Init(&increment_time, CYCLES_PER_SECOND);
} | 1 |
5ee063abaf11b70029668da10e56554f | 9d6369e1ee22442f50a38dbd189e2f12 | 根据编号获取文件夹路径 | @Service
public class FormService
public List<Map<String, Object>> getDiaPathByID(String Id) {
return formFolderDao.getDiaPathByID(Id);
} | 1 |
70cad1d3325de4ab29d2f952704e570f | a06c1ae8ba1c3ac6860a4d87f632961b | Method: getBounds()
* Returns a <code>GRectangle</code> that specifies the bounding box for the string.
*
* @usage GRectangle bounds = glabel.getBounds();
* @return The bounding box for this object | double reservedHeight) {
double labelWidth = 0.0;
if (label!=null) {
Rectangle2D labelBounds = labelFont.getStringBounds(label, g2.getFontRenderContext());
labelWidth = this.labelInsets.left+labelInsets.right;
if (this.verticalLabel) {
labelWidth = labelWidth + labelBo... | 0 |
45887a5364376a2b4267c4b5a50ed6d7 | ed1a3ca3ff2048c10e168c17f8c98927 | Display a status list of ALL services | class HealthCLI:
def services_status(self):
print(str(self._health_checker.get_magma_services_summary())) | 1 |
d0b805d13831f6b30bb0ef0e72c0267e | 6fc1d2e130f502d0446226358880a62d | Получить список входящих полей подписки, доступных для уведомления конкретного типа (Начало процедуры создания подписки) | namespace ICSSoft.STORMNET
IDictionary<Type, IEnumerable<string>> GetSubscribedProperties(); | 1 |
dd98b3a5da5cbcfc73f8bd6db13a9e97 | 2afc20abddf4924be5e4d890f2e28483 | Test the Asset Bank client. | user = self.client.post('/api/v1/rest-auth/registration/', {
'username': 'admin',
'password1': 'Administrador',
'password2': 'Administrador',
'email': 'admin@gmail.com',
'email2': 'admin@gmail.com',
'first_name': 'Nombre',
'last... | 0 |
db6740564a705c0bf7628b5ad029dbda | 49f2aea7b9153e6e95757e3e49f16796 | We can't simply store mediaInfoText in self.FormattedMediaInfo because the "Complete name" property gets modified.
(By removing the full path if needed.) | {
TiXmlElement* pParent = GetOtherElement();
if(pParent)
{
PutString(*pParent, "last-media-file", filename);
return true;
}
else
return false;
} | 0 |
5547bfa0a6d5feacfb256f1892261d8d | 2d8cdab8f2011785ebfa0025abf00e26 | equation 7, the distribution function for the isothermal sphere | def Fdist(x, dfT, dfE):
return gamma((v+w)/2.0)*(v/w)**(v/2.0)*x**((v-2.0)/2.0)/(gamma(v/2.0)*gamma(w/2.0)*(1+x*v/w)**((v+w)/2.0)) | 0 |
7c2d6188e70cd64b1b9684f0a4d6adcb | c16dd7df316a3796e1a1c82e2e2deee7 | 正規表現にマッチした部分文字列にクリックイベントを登録します | node.textContent = this.$vm[RegExp.$1.trim()];
const exp = RegExp.$1.trim();
this.update(node, this.$vm, exp, "text");
} | 0 |
0dfe4da9742c970d6462ab86f44768af | e7549625528148787ded308237dc251d | Mom - Momentum | def ang_mom(pos,vel,m):
mass=numpy.column_stack((m,m,m))
L=mass*numpy.cross(pos,vel)
return L | 0 |
9df4704e5d1edfaaeba3b47fac946d45 | e38e7f469f69ffe93788b52e0d33b29c | or by an IVI class driver. This function initializes the I/O
interface, optionally resets the device, optionally performs an
ID query, and sends a default setup to the instrument. | static long init_ai(int parm)
{
if(parm==0) {
devSupParms.name = "deve364xa";
devSupParms.gpibCmds = gpibCmds;
devSupParms.numparams = NUMPARAMS;
devSupParms.timeout = TIMEOUT;
devSupParms.timeWindow = TIMEWINDOW;
devSupParms.respond2Writes = -1;
}
return(0);
... | 0 |
3881a9b73c7b07d1411b01dfb33ba413 | 59a0f350980a0a08c2c001a0a1471ed4 | Enter a parse tree produced by {@link TSqlParser#create_or_alter_function}.
@param ctx the parse tree | public class TSqlParserBaseListener implements TSqlParserListener
@Override public void exitCreate_or_alter_trigger(TSqlParser.Create_or_alter_triggerContext ctx) { } | 0 |
5100c3c6d1bc2696a855e056957ba65e | 723e28080f7c3cffb8b1397a6bd48e09 | True if has "GivenName" element | get givenName() { return this._givenName; } | 0 |
836fff12005c28ea7f74f7274ac39fb2 | 645fd600b32d061b463d1e3ef6ab5386 | @brief アニメーションのベースサンプルを取得する | {
m_nCounter++;
if ( m_nCounter > m_list_animate_counter[ m_nIndex ] )
{
m_nCounter = 0;
m_nIndex++;
if ( m_nIndex >= m_list_animate_counter.Count ) m_nIndex = 0;
}
return m_list_graphic_handle[ m_nIndex ];
} | 1 |
0646acde46681a4385a8ca000afd1cf3 | aa47197d10b08d72022c44efd869f70c | 跳转到修改小程序售后订单管理 | @Controller
@RequestMapping("shopFront")
public class ShopFrontManagerController
@RequestMapping("goto/modifyshopFront")
public String goto_modifyshopFront(HttpServletRequest request,
HttpSession session, String id) {
try {
CgShopFront shopFront = (CgShopFront) baseService.findEntity(
CgShopFront.class,... | 0 |
24de509398c9f7845def064914e0cb52 | 9da9c5cc118d247c0ab5f860eb168192 | The method to call the solving methods.
Will continue iteration until no more changes can be made | public class Grid
public boolean solve() {
boolean changed = true;
while(changed) {
changed = false;
clear();
if(groupsHaveOne()) changed = true;
clear();
if(onlyOnePossible()) changed = true;
}
if(!errors()) {
return solved();
}
return false;
} | 1 |
23ac36d7c9b49a0e6d9bbe2ba0a8b7cc | 3e87907753482d8b48966c7db71bd894 | 実績の定義と解禁条件の設定を行います。 | def make_achievements():
add_achievement(
lambda user: True if G.USR[user].commandCount >= 1 else False,
"use_MLA")
add_achievement(
lambda user: True if G.USR[user].commandCount >= 50 else False,
"use_MLA2")
add_achievement(
lambda user: True if G.USR[user].commandCo... | 1 |
2c4141fb876036e4961ef05ad437cef9 | 73df6f0626ee62af6543f9d071b3ba60 | 펀딩별 투자자 리스트 불러오기 | ArrayList<HashMap<String, Object>> resultList = new ArrayList<HashMap<String,Object>>();
ArrayList<OrderFVo> orderList = this.fundingMapper.selectOrderList(memberVo.getM_no());
for(OrderFVo order: orderList) {
HashMap<String, Object> map = new HashMap<String, Object>();
ArrayList<ODetailVo> orderDetails= ... | 0 |
9e7fba6da23319fbc231870e2b4c03ea | ebab38348ad852efe18aec1257b3570c | By default foreign_key=off - cascading deletes will not work | class TableTestCase(BaseTestCase):
def test_ondelete_cascase(self):
assert 1 == 1 | 0 |
2303797564195570dd557d713738aabf | be748d33c5011a062160593e3d1c8485 | Listener de cambio de seleccion del combo de roles | {
if (dxListRoles.SelectedIndex != -1)
{
_OLAP.role = (mycOLAProle)dxListRoles.SelectedItem;
List<mycOLAPuser> lstUser = _OLAP.role.listUser;
lstUser.Sort();
ShowFilteredUsers(dxListUsers, lstUser);
}
} | 1 |
d06de7f085f583e9c7357ad1283898a7 | 40f15ef8cab7bfdcb51c2ab47792250c | Retrieves a single track from a list of results | class LastFM_Playlist
public function getTrack($index){
return $this->tracks[$index];
} | 1 |
05ee794b2d4af47b6da6ede4fd1a610e | a8294e3fe2dbdb2b764d5bbe74beb2c4 | GET: Toestel/Create | {
List<SelectListItem> roomSelect = new SelectList(_context.Room, "RoomID", "RoomName").ToList();
roomSelect.Insert(0, (new SelectListItem() { Text = "Select Room", Value = string.Empty }));
ViewData["RoomID"] = roomSelect;
List<SelectListItem> timeSelect = new Li... | 1 |
5601e2892a2aea8febeeb2da815c7fc5 | f4dd639b3a31a12bdc0b084434d03913 | Returns the player ship object. Currently does not support multiple player ships. | namespace ShipGame.Actor
GameObject GetPlayer(); | 1 |
2cbeb8afa85d409863063c9d6b742fb5 | a460b94d047ee0fe54f721dbbaf30ab4 | InsertRentableSpecialty writes a new RentableSpecialty record to the database | db := ConnectDb()
res := db.Create(row)
if res.Error != nil {
panic(res.Error)
}
} | 1 |
7031da8931592c4735a4ec27437d9eb6 | fca2b4b638c55244fe36e7cbe21b2f69 | Called when any building worth attacking takes actual damage | public class JCTRLGeneric
public void unitAttacked( JWarDynamicObject dyn )
{
} | 1 |
89e4ad58f6e3f2e6dace2d7fa17c0a8b | d8fca335455164b8f75d396fa4143b52 | Poll for completion status of a previous IO submission.
If there's no error, the descriptor will be freed. | impl IoUring
pub fn submit(&self) -> Result<usize> {
self.submit_and_wait(0)
} | 0 |
c43cdbe8d87dfc93259dbf544ffe106e | 30d31ab921d6859d261a8c38e4a9010d | Whether or not component is a valid text component | {
return this._componentType != null && this._componentType.Count > 0;
} | 0 |
6c875fc861dec522e38cd8d7e8c11a7e | 7570a04774ffdd698ad1fbe2b20d0eac | Shows loading layout if the list is empty | class TrendingFragment : Fragment(), SwipeRefreshLayout.OnRefreshListener
private fun displayLoadingView() {
if (listAdapter.itemCount == 0) {
showShimmer()
}
error_layout.visibility = View.GONE
} | 1 |
aa7140d879063a1608b85f2e1210d4d0 | e3624354ad53d5c0e89f32b0e616a8f6 | !
@brief States if the EEPROM is busy | int mbug_2165_get_busy( mbug_device dev )
{
return get_param( dev, PARAM_BUSY );
} | 1 |
3182d659d25b4ad21bf408f4cd2c6787 | c0d43b4c6a089cf7e3502dbceb0b694a | 添加状态信息,返回自动生成的状态ID | class RepairStateModel extends Model
public function addStatue($stateInfo){
if(empty($stateInfo) || !is_array($stateInfo)) E('参数错误');
$stateInfo['ctime'] = time();
return $this->add($stateInfo);
} | 1 |
cb584ac1a5cd3806de21826458d0889d | 55c7dff2454bd009b34340351482a934 | 通过课程ID获得所有教师对象 | @Service("teacherService")
public class TeacherServiceImpl implements TeacherService
public List<Teacher> getTeachersByCourse(List<Long> courseIds, Long teacherId){
return teacherDao.getTeachersByCourse(courseIds, teacherId);
} | 1 |
5a936c09a1b2ea63980d5e085d397c5a | caad88ecf09acea4cb788a54656cc4b6 | 保存导航分类类型 | if(empty($_POST['submit'])){
$this -> ACT_layer_msg("参数错误!", 8, $_SERVER['HTTP_REFERER']);
}
$_POST = $this -> post_trim($_POST);
$idStr = intval($_POST['id']);
$navData = array();
$navData['name'] = array('=', $_POST['name']);
$navData['nid'] = array('=', $_POST['nid']);
if(!... | 1 |
4351a587bb22d8bb28352b765837c5c9 | 3a07ecb195c684cb240236e635349de5 | Runs the game of life forever | class GameOfLife(object):
def run(self):
while not self.handle_events():
self.board.draw(
self.population,
)
if getattr(self, "started", None):
self.population.cycle_generation()
self.fps_clock.tick(15) | 1 |
19a4a9434a036e488a03af09e4b9576a | 4db60342e0a174da397ece91ab69e848 | Compare the maximum number of nodes available in a tree of its height to the actualy number of nodes | if (node == null) return true;
System.out.println("+++ findMaxHeight(node) - findMinHeight(node) : " + findMaxHeight(node) + " " + findMinHeight(node));
return ( (findMaxHeight(node) - findMinHeight(node)) <= 1 );
} | 0 |
d55307abc0155d5bd4c1d7adaaa0f790 | 092a67b5eb50f817000efb294b82312b | Luo satunnaisen listan kysymyksiä annettujen parametrien mukaan. | String lista = this.valitseLista();
String viesti = "Anna positiivinen kokonaisluku, joka ei ylitä listan pituutta!";
if (lista != null && harjoittelu.lueLista(lista)) {
String montako = this.lueKayttajalta("Sanapareja listalla: " + harjoittelu.getListanPituus() + "\nKyseltävien sana... | 0 |
c586589ea70ffa58cb69a31043568012 | 508cbd195a37e293dffb29b52e8d3132 | 设置某一天是否工作 | @RequestMapping("/indexSourceProvide")
@Controller
public class IndexSourceProvide
public int isWorkDay(String day) {
int isWork = 0;
Calendar c = Calendar.getInstance(java.util.Locale.CHINA);
String[] sp = day.split("-");
c.set(Calendar.YEAR, Integer.parseInt(sp[0]));
c.set(Calendar.MONTH, Integer.parseInt(s... | 1 |
f997dc46c1a6f6d2562c19088160fb11 | 198605a66010462b9b74a0868d8e34fd | SHORTの値を文字列に変換する | namespace System
public static class Convert
public static string ToString(short value)
{
return value.ToString();
} | 1 |
93db5d1bd38cf6a187700ee6b77ef68f | f089f88169b2cd957bcbc8b71212a8ba | Empty endpoint to verify a TOTP token | class CoreHOTPTests(unittest.TestCase):
def test_noop(self):
return | 0 |
15051176299dda38aacfd06aae0fccbb | 9fc9e5c83584d66853a7f2be97be7416 | 受注番号テキストボックス | namespace KATO.Form.D0310_UriageJissekiKakunin
public partial class D0310_UriageJissekiKakunin : BaseForm
private void txtJuchuNo_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
SendKeys.Send("{TAB}");
}
} | 1 |
75a0339aa2d3ad2bbb61ac3a018dc148 | 0d8f4cb6bca0c5f5bc55b7aca0ba0901 | Apk安装包保护弹窗 | new MaterialDialog.Builder(activity)
.title(String.format("是否升级到%s版本?", "appInfo.getAndroid_version()"))
.content("sb")
.positiveText("立即安装")
.negativeText("暂不升级")
.canceledOnTouchOutside(false)
.onAny(new MaterialDi... | 1 |
1c42a622310d5c3cbd8ac5bb8875223d | d9cafc7771af862268d60f7b3f2ab458 | Controls whether the current document is allowed to use
<code>Element.requestFullScreen()</code>. When this policy is enabled,
the returned <code>Promise</code> rejects with a <code>TypeError</code>. | class Fmp4 extends Html5
supportsFullScreen() {
return false;
} | 1 |
13300e7882b9e629d2a1963e906a32e6 | 68183cf49bffe921f5267280a84eac2a | Free the strings in our info structure. | void kill_t_info(void)
{
FREE(t_info);
FREE(t_name);
FREE(t_text);
} | 1 |
3427a58a8abacec11854e1e1822e47ed | d22abd723d53a70e15edb6c0bdb5e081 | Fetches a topic given a profile ID and a topic ID. | export class StudyDataService
getDiscussionTopicById(studyID: string, topicID: string) {
return this.afs
.collection('studies')
.doc(studyID)
.collection('topics')
.doc(topicID)
.valueChanges();
} | 0 |
dd8be5b0bdcf4999aafdd370292832db | 94e691f05b16d3b34747b36ba3458aa2 | Wrapper function of above, suitable for root finding.
Note that for root finding, the dimension of the output of our objective has to
be the same as the dimension of the unknown vector x. Therefore we only keep the first dim*K elements. | {
if (CheckModelFunctions() != SUCCESS)
return MODEL_NOT_PROPERLY_SET;
int error;
const double INFINITE_BOUND = -MINUS_INFINITY_LOCAL;
const double TOLERANCE = 0.0;
const string COLD_START = string("Cold Start");
const string NO_PRINT_OUT = string("Major print level = 0");
const string DERIVATIVE_LEVEL = ... | 0 |
22457b5d0d2ddef1df6df364b1f711f1 | d84676e913473eb1a44ed952846e1a6b | 通过商品名和商品页面展示数查询总页数 | int total_pages =0;
try{
sqlSession=MybatisService.getFactory().openSession();
if(product_name==null || product_name.equals("")){
product_name="%";
}
total_pages=sqlSession.selectOne("adminProduct.totalRecord", product_name);
}catch(Exception e){
e.printStackTrace();
}finally{
MybatisServi... | 0 |
59a2fa2b4821852cd5591995b41fda33 | 46d671e89aa6fd891fb2d144563fbfb4 | Cierra esta ventana y abre la ventana final | public class AlertaContraseñaIncorrectaController implements Initializable
@FXML
public void clicAceptar(){
Stage stage;
stage = (Stage) botonAceptar.getScene().getWindow();
stage.close();
} | 0 |
2915f0683cdc9764c81cc83fdb83a6a3 | d849178598aaca280a53966365b3795c | 获得主键列以外的所有列 | ret_lst = list()
for col_name in self.get_columns_list():
if (not self.is_pk(col_name)) and (not self.is_fk(col_name)):
ret_lst.append(col_name)
return ret_lst | 1 |
628d116682010c157a9a9b02f38583f4 | 7cfab7fe71cf88d2afb5973da22972d5 | Функция возращает полный путь от точки до корня | path = [y]
while y.parent:
y = y.parent
path.append(y)
path.reverse()
return path | 1 |
c167ece9407bc279695a6ab0526e0998 | 47d3d159af950c8480cecebfb0d9ee1f | 使用table.concat库函数,对数组内容使用" "拼接成字符串。 | local function func(...)
local temp = { ... }
local ans = table.concat(temp, " ")
print(ans)
end | 1 |
62fce8d0af671c54be8de8d4999680b4 | 09399d300ccf71e4188d1998ddac0d72 | ● 繪制隊伍角色 | class Window_Base
def draw_actor_icons(actor, x, y, width = 96)
last_font = contents.font.clone
contents.font.size = 19
contents.font.bold = true
contents.font.color = crisis_color
icons = (actor.state_icons + actor.buff_icons)[0, width / 24]
turns = (actor.state_turns + actor.buff_turns)[0, wid... | 1 |
bdfffea715a499ff361c4fa199c5c08f | f2ffebb978c3ab2247f5442ee680ca4e | 拉取仪器的id和name,用于下拉框的store | const vm = this;
$.ajax({
url: `${host}/mu/`,
type: 'GET',
dataType: 'json',
success: function (res) {
vm.gatewayID = res.data[0].id
muport = res.data[0].ports;... | 0 |
07162583bd335d906bf0e63a5c11a08f | 70a012137731b032e620184d8bc4c0cc | Пытается решить задачу коня | {
List<int> puzzle = new List<int>();
List<int> correct = new List<int>();
bool trigger = (size % 2 == 1) ? true : false;
for (int i = 0; i < size; i++) {
for (int j = 0; j < size; j++)
{
int index;
if (trigger)
... | 0 |
a11e8cb3db10f818cd5730c060a39f59 | c6ce22bf88f747ffdd121ce7e02aefb5 | 功能说明 : 判断字符串是否是指定范围长度的数字 | public class Regex
public static boolean isLengthRange(String Str) {
Pattern p = Pattern
.compile("^[0-9]|[a-zA-Z]{4,20}$");
Matcher m = p.matcher(Str);
return m.matches();
} | 0 |
2b83f8537b965be673995d589b3b8718 | 7de25c04a93c1fa9d3368e6869a39888 | prvTgfBrgVplsBasicTest_configRestore
restore configurations. | static GT_VOID prvTgfOamIPclConfigurationRestore
(
GT_VOID
)
{
GT_STATUS rc = GT_OK;
GT_U32 ruleIndex;
PRV_TGF_OAM_COMMON_CONFIG_STC oamConfig;
PRV_TGF_POLICER_BILLING_ENTRY_STC prvTgfBillingCntr;
rc = prvTgfVntCfmEtherTypeSet(TGF_ETHERTYPE_8100_VLAN_TAG_CNS);
... | 0 |
e6073242c2cd214c57a45baf7f4675c8 | d2d57aedd1abdd3aad686af0f63c43a0 | Get the path to the XSD file for the schema with target namespace equal to Namespace | namespace ExportTemplate.Export.Element
public class XmlValidator
public string SchemaTargetNamespace()
{
string targetNamespace = string.Empty;
if (!string.IsNullOrEmpty(_schemaUri))
{
XmlDocument schemaDoc = new XmlDocument();
schemaDoc.L... | 0 |
0b289a86e38515ab60d8626c9009bb1b | b5368af6bec733273bae84d45c8ac002 | get inbox message number specified user id | class UserMessageRepository extends EntityRepository
public function getUnreadNumber($userId)
{
$qb = $this->createQueryBuilder('um')
->select('count(um.id) as total')
->where('um.recipient = :userId')
->setParameter('userId', $userId)
->andWhere('um.read = 0'... | 1 |
70c2ccf278b0f338cd00038948e2c105 | 5488f7fc973701718bfd54a2f86e1a11 | Read notafter of a X.509 certificate. | def read_notafter(pem):
return ocrypto.load_certificate(ocrypto.FILETYPE_PEM, pem).get_notAfter() | 1 |
b661bc241129d9bc865963dc9ee36931 | 5a0c88c983eba3f6d5b76df60f421fc5 | Set the bit for this channel in the software uDMA request register. | int dma_set_tx_request(int chan)
{
unsigned int *cfg_reg = (unsigned int *)base_DMACFGL;
unsigned int tmp;
if (chan > 7)
return -1;
chan *= 4;
tmp = *cfg_reg;
tmp &= (~(0xF << chan));
*cfg_reg = tmp;
return 0;
} | 0 |
0ab2a9749c6877608440ab7e2d18a94b | 9d0eac081a222cc6e4c22071a50dfbb4 | get all postings matching a filter criteria | public class Utility
public static JSONArray getAllPostings(Activity activity) throws IOException, JSONException {
JSONArray json = (JSONArray)getRequest(activity, "http://laddr.xyz/api/posting");
return json;
} | 0 |
2e2aa3e77d7d0c917891ff8f6716aa41 | 1aaf51d6373870663f273be5319f43c4 | Turns a dictionary of query parameters into a query string | keys = list(query_dict.keys())
keys.sort()
query_str = '&'.join([f"{key}={query_dict[key]}" for key in query_dict.keys()])
return query_str | 1 |
0033207457fa54ef8fb1851a8dbdcc81 | 285f2d2b77e7b24cab3056955d98cfdf | Create paging information. | class LicInfos(object):
def paging_info(self):
return self._paging_info | 0 |
b66d5e64cceb4fe5deb20962a03605d2 | 4eab05770022ab2fad9b51da47abc543 | 显示物料下拉信息 | $.ajax({
type : "post",
url : baseUrl + "/material/getMaterialName.action",
async : true,
data : {
materialType : materialType,
orgId : orgIds
},
success : function(data) {
if (data.length > 0) {
var html = '';
$.each(data, function(i, b) {
html += "<option value='" + b.mateName + "'>... | 1 |
de4a21dce1bf724ab196cd3299b7a07e | 6ce54b7e11fd2729a5ac920b71457cc3 | Get element 7 of this Tuple. | namespace LangExt
public static class TupleModule
public static T7 _7<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10>> self) { return self.Item7 ; } | 1 |
711a5d3ebdbf7a48827df0419cc3ff6a | 24013d801c3d8d6b05ed230d6d9056d2 | Récupération du nombre de jours de la période de ré-engagement. | public class NegotiationActivity extends KraPersistableBusinessObjectBase
public String getNumberOfDays() {
return getNumberOfDays(getStartDate(), getEndDate());
} | 1 |
602b5752678ca698e5d4e1cc4a0e7cd9 | 42c5f9bdbfecab46ebf88bf3d19ad0a2 | Setup the behavior of a call to a method with <see cref="void"/> return type. | namespace Attest.Fake.Setup.Contracts
void Visit<T, TResult>(IMethodCallWithResultAsync<TService, IMethodCallbackWithResult<T, TResult>, TResult> methodCall); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.