query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
807ec95f0f86b3a2b74d9a7958fdd44f | 06163c0353e38640c8afd906482a07b5 | カード情報をCSV出力用のリストへ変換する | def import_to_card_view(pass_obj, sh):
with open(pass_obj, 'r', encoding=mmtUtil.get_encoding(pass_obj)) as f:
reader = csv.reader(f)
for i in range(7):
next(f)
csv_data = [row for row in reader]
max_row = sh.max_row
for row_no, row in enumerate(csv_data, max_ro... | 0 |
4e933cc6fe8327d608664b80597df110 | 93a5da88505ac82e5ea36d3d3103db66 | function to calculate total linguistic complexity (total observed/ total possible) | num_tokens = count_tokens(text);
num_tokens_wop = count_tokens_wop(text);
return (float(num_tokens - num_tokens_wop))/(float(num_tokens)); | 1 |
77bb2a3313e61f1c4e7d4313f4728041 | de0b4462dcb9049a9d415f2becb29409 | Close all of the browser windows except the original one. | {
var windowsids = ObjectRepository.Driver.WindowHandles;
for(int i=windowsids.Count-1; i>0; i--)
{
ObjectRepository.Driver.SwitchTo().Window(windowsids[i]);
ObjectRepository.Driver.Close();
}
ObjectRepository.Driver.Swi... | 1 |
b359c0073c65a2052c960987fe53b208 | d52dcf60021913faa5fbd79c73c7806e | 上传视频结束 | public class UserDao extends Dao
public static void uploadSuccess(int avId) {
String sql = "UPDATE video SET success = 'y' WHERE av_id = ?";
jdbcTemplate.update(sql, avId);
} | 1 |
22446f10a03797446b7334388979e098 | 4a50565fa956e2e4849abc9ef3e90bc1 | 获取载客热点数据 | hotelsList() {
var data = {
url: config.hotelsList,
params: {
startTime: this.data.startTime + ' ' + '00' + ':' + '00' + ':' + '00',
endTime: this.data.endTime + ' ' + '00' + ':' + '00' + ':' + '00'
}
}
app.nGet(data).then(data => {
if (data.data) {
this.setDa... | 0 |
e075f793a3303f71acb591d8588b1081 | e19dbd2e1808a9d4383c9926273f9812 | Make a copy of the corrupted visibilities and add noise. | colList = ['VIS2DATA', 'VIS2ERR', 'FLAG']
for ext in self.get_extensions():
hdu_data = self.hdul['OI_VIS2', ext].data
flag = hdu_data['FLAG']
vis2data = np.ma.array(hdu_data['VIS2DATA'], mask=flag)
vis2err = np.ma.array(hdu_data['VIS2ERR'], mask=flag)
... | 0 |
5135b28ef8a3f43b622f2e40f1b5e99a | e8d80723b06a82c19c05bcd6cdfccec5 | Returns all the members of the set value stored at key.
This has the same effect as running SINTER with one argument key. | public Set<?> smembers(String key); | 1 |
eeff9f9fd2a2be2d7eab2b4d51c8d8d1 | c27947e14c8d95a8f815bf0c5e5260ae | Returns true if entered interests are valid, else false. | {
if (string.IsNullOrEmpty(interestRate))
{
validationMessage = Resources.InterestRateEmpty;
return false;
}
double rate;
if (!double.TryParse(interestRate, out rate))
{
validationMessage = Re... | 1 |
6e83b39fc85e6f4d21060a772a230251 | df11a4da81b7cd41e7eaf6473a89e30d | Find first Fibonacci term to contain `digits` number of digits. | stub = Stub()
stub.start()
counter = 0
for num in gen_fibonacci():
if count_digits(num) >= num_digits:
return counter
if counter % 1000 == 0:
stub.msg(count_digits(num), counter)
counter += 1 | 1 |
1ca94ddd3edcf9b4b4cd3fad4356c23b | 12c4440b4e45bd69051ca73841c5a39f | Retrieve from centralized setting storage when running in the cloud.
Retrieve from App.config / Web.config when running on-premises. | [SharePointPermission(SecurityAction.LinkDemand, ObjectModel = true)]
protected string GetSetting(string key)
{
return this.GetSettingFrom(key, ConfigLevel.CurrentSPWeb);
} | 0 |
015449198d4293dcd441b1db62f560bb | 99a0c2306667843d316c61933c878a3b | works similar to the main loop in write_frame but only draws 4 boxes | def drawRects():
rectW = 50
rectH = 100
rX = 150
rY = 0
box1 = pygame.draw.rect(screen, (255,106,106),(rX,rY,rectW,rectH))
rectH += randint (0,40)
box2 = pygame.draw.rect(screen, (255,48,48),(rX+50,rY,rectW,rectH))
rectH += randint (5,40)
box3 = pygame.draw.rect(screen, (238,44,44),(... | 0 |
24366d11d8d0474aa5cacccdd5917a70 | 099f6e3d212a8239e9f9d77a55c77b5e | Use dictionary as a simple lookup for matching control types with configuration functions | namespace Redwood.Framework.Runtime
public class DefaultControlResolver : IControlResolver
private Dictionary<string, RedwoodProperty> GetControlProperties(Type controlType)
{
return RedwoodProperty.ResolveProperties(controlType).ToDictionary(p => p.Name, p => p);
} | 1 |
afd431309e13a32964b876e4ec305546 | bb6e53208e46def48149b975f221628d | Get the vertex index of one of the vertices making up the corners of the specified face | int getVertexIndex(int ix, int iy, int iz) {
assertion(ix>=0,__LINE__);
assertion(ix<numberOfCellsPerAxisX+1,__LINE__);
assertion(iy>=0,__LINE__);
assertion(iy<numberOfCellsPerAxisY+1,__LINE__);
assertion(iz>=0,__LINE__);
assertion(iz<numberOfCellsPerAxisZ+1,__LINE__);
return ix+iy*(numberOfCellsPerAxisX+... | 0 |
b3ea4e46b01432e3a91613b027cbea75 | 64f96af8d83d9bd7a0625db697b3638a | Project to subset of rows | def ProjectData(X,U,k):
U_redu=U[:,:k]
z=np.dot(X,U_redu)
return z | 0 |
47f901624dd7d795591959ed7a0e822f | 5344b74dd1ee3d18dbc45eca6337a08a | Displays Yellow Card for Team A. | public class MainActivity extends AppCompatActivity
public void displayRedCardForTeamA(int score) {
TextView scoreView = (TextView) findViewById(R.id.team_a_red_card);
scoreView.setText(String.valueOf(score));
} | 0 |
66d89d95a354bf8dd18510784de7e40e | 50308f935ca6d514ee0d1e5ad9cc9853 | 编辑用药信息 | class Warns extends Apibase
public function edit_pill_warns(){
$param = input("param.");
$warns_id = intval($param['warns_id']);
if(empty($warns_id)){
$this->ajax_return('10300','invalid warns_id');
}
$pill_name = strip_tags($param['pill_name']);
if(empty($pill_name)){
$this->ajax_return('10301','inva... | 1 |
1c3d78b056d3b9565270de0910d5456c | 652850635f3106e02d0fb6d89b5956ee | Remove the specified resource from storage.!! | class RequestController extends Controller
public function destroy($id)
{
return 'amamr sonar bangla';
} | 0 |
aa56383e718f97c17125154e9246c650 | 86543ad0eea18d6bed3f7f116e9cdd19 | Is passed a hash containing (at least) a name and a parent number.
Adds the new element the list of the parent element's children.
Returns the newly-created-element number. | class Int32
def add_elem(elem)
end | 0 |
bbe2e1e1c93e40a1ecaebdbc20ca6606 | fac2eebadd49c6a3a078e12d3a8662ec | 在指定的书签位置插入图片
书签名 | public class MyDocument extends AdvancedRTFDocument{
@Override
public void insertPicture(ImageIcon icon, int pos) {
MutableAttributeSet attr = new SimpleAttributeSet();
StyleConstants.setIcon(attr, icon);
try {
insertPictureString(pos, attr);
} catch (BadLocationException... | 0 |
8271edcd2785d7af55f0f8ff6f8c0fbb | df06e84ae902edfb0e75a8058f76cd2e | Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. | {
uart.set( "\r\n\nHwUSBdevice," __DATE__ "," __TIME__ "\r\n\n" );
cMyInterf interface(usb, 0 );
usb.start();
while( 1 )
{
if( interface.isNew.getEvent() )
{
uart.set( interface.writeBuffer.toString() );
uart.set( "\r\n");
}
}
} | 0 |
d171a04fc9079df73ac244ce64e58c76 | 26dd80d240b957e3e3c85779c4ebcc1f | 是否为镇级部门 | class User(AbstractUser):
def is_town_department(self):
if self.department_id and self.department_id.type == '1':
return True
return False | 1 |
86cc59e83b8eca6025f23edcb64d2e57 | 341617a0e280ecbb3dd9f9a9627f809f | 填充下拉框:票券类型 | function initCombobox(){
$('#ticketTypeId').combobox({
url : $ctx + '/orgMng/ticketTypeList.do?flag=a',
method : 'get',
valueField : 'ticketTypeId',
textField : 'ticketTypeName',
multiple : false,
editable : false,
onLoadSuccess : function(e) {
},
onLoadError : function(e) {
getAjaxError(e);
},
... | 1 |
ff02607a597b2b4f54651269bc9539a1 | 4ef27b0e50ed4bf53eba640726d44072 | show elements to add work hours.
(name, firstname, arriving time, meal time, departure time, city, button to add and to close). | let workField = document.getElementById("addNewRow");
workField.firstElementChild.setAttribute("style", "display:none");
let form = newHtmlElementCreator(workField, "form");
let mainDiv = newHtmlElementCreator(form, "div", { "class": "form-row text-center" });
let nextDiv = newHtmlElementCreator(mai... | 0 |
284e1d4b80eaae077b6cac4e56829b53 | fcee56641681c95dd38614293c3e663a | Print out the given block using the following seperator for decoration | def printBlock(message):
print ""
print divLine
print "- " + message
print divLine | 1 |
964b9923f418f1d045461880d90478fe | 4b48e0307cbcdc38713d3733da3a5235 | Returns the frame rectangle used by a window with a given content rectangle and window style. | namespace Quilt.Mac.AppKit [Class]
public abstract class NSWindow : NSResponder<NSWindow, NSWindow.MetaClass>
[Import(Name = "contentRectForFrameRect:")]
public abstract NSRect ContentRectForFrameRect(NSRect frameRect); | 0 |
f99089c77be6b14b140d718e7b14e521 | b3545db5219cff5b10d93a3a63b00ab3 | From http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing | function xhr(url, successFunc, failFunc, obj, postData){
var parts=resolveUrl(url).split(/\/+/g);
if(parts[0]!==location.protocol||parts[1]!==location.host){
throw new Error("cross-domain requests not allowed");
}
var http_request = false;
if (window.XMLHttpRequest) {
http_request = new XMLHttpRequest();
}els... | 0 |
357ba5ddb7c176778fdbd6a691e59374 | 6c04c6b6b76880f68e5f8f55ea95fef4 | Stops all applications. | namespace AutoClicker
public partial class MainWindow : MetroWindow
private void StopAll(object sender, RoutedEventArgs e) => viewModel.StopAll(); | 0 |
bafdbaaf98df0d51223c0a056bd27bc6 | 6d3f015ca656f60a5c5798edbc876bd6 | 생산이력관리 상세 화면을 구성한다. | {
if (e.ColumnHeader) return;
_isModify = true;
_arrProcList.Clear();
_deleteRowList.Clear();
btnCmd02.Enabled = true;
btnCmd11.Enabled = false;
btnCmd12.Enabled = false;
btnCmd13.Enabled = false;
string ... | 1 |
14eb3d235d3f97223031f9bced69b245 | 5444c4be32b08fc63405eb5d77151095 | 自动生成协议module的ts文件中的function内容 | let code='//TODO 待完成的方法\n//'+item.description+'\n//'+item.tag+'\n';
let addArr=item.address.split('/');
let itemName= changeName(addArr.filter(i=>i).toString().replace(/,/g,'_').replace('{','').replace('}',''))
code+=item.method+itemName+'(){\n'
code+='\t return util.putData(url.'+apiEnName+'.'+addA... | 1 |
fd49cedea4fa17d632ea294b6a15d1c0 | 3b8584dc7a97b7f7606b384a8246fcd1 | 查询所有有效行业 | @RequestMapping(value = "/api-ecm/industry/getIndustries",method = RequestMethod.GET)
String getValidList(); | 1 |
d2daf6fa5dd439ed4412a52e430a330c | c66847070114eb44c47fbd93a5775cae | Metoda pozwala na zmianę karty. | namespace SchoolTT_02
public partial class Card : UserControl
public void Edit()
{
var editCardWindow = new EditCardWindow(this, ClassList);
editCardWindow.ShowDialog();
} | 1 |
db0f3839b1c561d0feeaafa78d59c214 | 91459530eb25b8198ce41f2aedf2fefa | 获取帖子(A)中用户(B)的所有购买记录. | $post_id = (int) $post_id;
$user_id = (int) $user_id;
if ($post_id <= 0 || $user_id <= 0)
return false;
$query = sprintf(
'select %s from %s where user_id = %d and id = %d', join(', ', $this->getSelectFields()), $this->_table, $user_id, $post_id
);
... | 0 |
98e22ac79090f6b8c5a3f36097829f3f | de6078f87f7b68427eaa68865de0cb11 | Creates Alert object containing text. Object disappears after a while or when clicked. | class Alert extends BaseComponent
public function __construct($type, $dismiss = true)
{
$this->type = $type;
$this->dismiss = $dismiss;
} | 0 |
13d23374602520c736533138e8cbeade | 23c41bfb11768de6302602e95c5a0cc2 | Playerのこライダーに侵入いした時に攻撃アニメーション | public class TriggerRecon : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision)
{
if(collision.tag == "Player")
{
isIn = true;
animator.SetBool("idle", false);
animator.SetBool("attack", true);
}
} | 1 |
28c30dfd61de6f9e94bd60f8a80c9b31 | 3167dd41fa94e5406aa7b90d067e55fb | Returns the ambiguous entities mapped to their possible candidates
from which humans need to manually choose the correct candidate. | export class SzEntityDetailComponent
public get possibleMatches(): SzRelatedEntity[] {
return this.entity && this.entity.relatedEntities.filter ? this.entity.relatedEntities.filter( (sr) => {
return sr.relationType == SzRelationshipType.POSSIBLEMATCH;
}) : undefined;
} | 1 |
ad0def9eb6465ba9d5389411bcc99479 | 90b3508d4a81d06953beacb94f0faef9 | Заполнение полей объекта Новость. | class WsPosts extends Beans
public function setThis($object) {
$this->setPost_name((isset($object->post_name) ? $object->post_name : null));
$this->setPost_url(isset($object->post_url) ? $object->post_url : null);
$this->setPost_title((isset($object->post_title) ? $object->post_title : null));
... | 1 |
d96c374950279c51e46dc79a54564193 | 2c0dd05da263ddb4d1bec0ba5b88d46a | 获取格式化游玩时长 | public class TimeManager : RankingBase
public string GetPlayTime()
{
return GetTimerString(playTime);
} | 1 |
be3115e3bbcea4731faa105c299a4543 | 46186c1b0f834128346b2936b6dc326b | 增加友情链接分类 | class TonghuagushiModuleSite extends WeModuleSite
public function doWebAddtukufenlei()
{
global $_W, $_GPC;
$table = "story_tukufenlei";
if (!$_W['ispost']) {
include $this->template("addtukufenlei");
} else {
$arr = array();
if (empty($_GPC['typen... | 1 |
d231e1243930ec4b113e3cc75c610e73 | 309cd952a13b4736307609c6a13229c0 | Hides the menu view controller. | {
var toReturn = base.CreateNavigationController(viewController);
toReturn.NavigationBarHidden = true;
return toReturn;
} | 0 |
40577da7d70eecfb63d70fdb45644290 | 0c9290b20ecaf18fdc0131e882c78438 | 根据输入主帐号姓名查询主帐号是否在可以设置副手机号的登录名白名单中 | {
String callinno = getRequest().getParameter("callinno");
List<ConBwList> list= conBwListService.getAll();
StringBuffer buff = new StringBuffer();
boolean isTrue;
buff.append("{success:true,msg:");
for (int i=0; i<list.size(); i++){
String no = list.get(i).getMainContactNum();
if (no.equals(callinno... | 0 |
582d93bc06af5368204112fdbf49f962 | 36472c00a99ac33d20ec975ca83a54f6 | 날짜유효성검사 | {
var aryDate = changeDate( sDate );
var dtDate = new Date(aryDate[iDateYear], aryDate[iDateMonth]-1, aryDate[iDateDay]);
var dtToday = new Date();
if (((dtDate - dtToday)/(1000*60*60*24)) >= 0)
return true;
else
return false;
} | 0 |
678ca75290cad0881d3d6df1b6c40029 | a134216363346c529313f68a7b921e61 | create
Creates a new upload with the provided properties.
<table summary="Response Details" border="1">
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
<tr><td> 201 </td><td> Upload created successfully </td><td> - </td></tr>
<tr><td> 0 </td><td> Lob uses RESTful HTTP response codes t... | class UploadsApi
def create_upload(upload_writable, opts = {})
data, _status_code, _headers = upload_create_with_http_info(upload_writable, opts)
data
end | 1 |
8af19e96b1f580bfb4e482270c2d4849 | 7362315a9acbe785f60e22ee81c9cedc | 设置为单例作用域 | function SingletonSet(member) {
this.member = member;
} | 0 |
d3297075636f9ee8632aed726635e99f | 9782881dccb9d8ed9032728153fb92f6 | Floods all touched squares with the specified override. | {
this.coords.ForEach(
pos =>
{
if (this.worldGrid.GetTileMap()[pos] == null)
{
return;
}
Vector3 objPos = this.worldGrid.GetTileMap()[pos].transform.position;
... | 0 |
fd004d31115c3b69e9029b509734f911 | f87e0dc1073e6aa512d9483818c4e617 | 设置从上往下单列布局 | var layout = GridLayoutManager(mContext, 1)
layout.orientation = GridLayoutManager.HORIZONTAL
rlv.layoutManager = layout
} | 0 |
2ae9107ebd1473157b2d95624cd581af | 6638b5d0fb8d021f2fd6b9afefc82b70 | 获取购物车中所有非购物车状态下的商品 | uncheckedList(state, getters) {
return getters.cartList.filter(item => !item.checked);
} | 0 |
86a260ee946126d5f148ad92348b2c06 | 58f74f510e9dde9eb1abbf6d8fe28bcd | Returns array with the first and last values swapped | def exchange_first_last(seq):
return seq[-1 : ] + seq[1 : -1] + seq[ : 1] | 1 |
c545ede143f1e1b8a0fd504ed18ff3dd | 50d150ebfd09cc198f251aeaa3ca536f | deuxieme version de la fonction qui calcule la qualité d'un individu à partir de sa valeur,
obtenue par la fonction "decodage" | double fitness2(Individuo &i)
{
double x = decode(i.cromosoma, 6, false);
return -func2(x);
} | 1 |
8541e5565819cea796a628589117f789 | 415af91320e4c192d04aa212fa6dc4a1 | 计算每个batch中分类前n准确的个数 | def compute_acc(labels, x_labels, nb_batch):
N = int(nb_batch * 10)
pre_labels = np.zeros(N)
real_labels = np.zeros(N)
c = 0
for i in range(nb_batch):
for j in range(x_labels.shape[1]):
pre_labels[c] = np.argmax(x_labels[i, j, :])
real_labels[c] = np.argmax(labels[i... | 0 |
6d5c189367cc89e166294498579fb832 | be36d4f60c8cd152fe850f66c8a0486b | 将SQL拼接到 context | void appendFrom(DbSqlContext ctx, SqlJoinType joinType, String manyWhere); | 1 |
690a6254bdb3cb9d4ca6225134b14cd3 | 199a68dc1c2f0b62812262477e922510 | In bioinformatics, the template modeling score or TM-score is a measure of similarity
between two protein structures with different tertiary structures.
The TM-score indicates the difference between two structures by a score between (0,1],
where 1 indicates a perfect match between two structures.
< Zhang Y and Skolnick... | def TM_score(peeled_pdb_path, ref_pdb_path, peel_longer):
if peel_longer:
cmdLine_TM = ("bin/TMscore64 " + peeled_pdb_path + " " + ref_pdb_path)
else:
cmdLine_TM = ("bin/TMscore64 " + ref_pdb_path + " " + peeled_pdb_path)
out_TM = sub.Popen(cmdLine_TM.split(), stdout=sub.PIPE).communicate()[... | 1 |
4c2dc07e725267494356163289fe542f | ab7d44e65593c8bbdc7ddc7516943fdf | 结束DB事务(根据$result结果 commit或rollback) | abstract class BaseModel extends LActiveRecord
public function doTrans($result, $msg = '')
{
if ($result === false) {
if (G::msg() !== null) {
$msg = G::msg();
}
throw new Exception($msg);
}
} | 0 |
46ae92fc024abb92325c0f915a534713 | 3e5d4ec9e3d76cdaac82c52491c36b6f | 设置视频背景图片 | public class MyVideoPlayer extends StandardGSYVideoPlayer
public void setBackGroundToPlayer(String url) {
Glide.with(mContext).load(url).asBitmap().dontAnimate().into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideA... | 1 |
ff94d25a3fb59a5c70da18ca23bda52e | 725ce1516f91871bbbec580c4e3b384d | Find a shared library by name in a list of directories. | def find_vendored_lib(libname,lib_path='lib'):
libname = split_path(libname)[1]
for lib in listdir(lib_path):
if lib == libname:
return lib
return None | 0 |
9face6af42ca0049cb638323a39c49a7 | 63fdb5276a3c3cd6254892343a40f5a3 | 根据服务商id号审核服务商 | if(row['status'] == 0 ){
this.msg.warning( this.i18n.fanyi('CenterManger.tips.examine',row['name']) );
return false;
}
this.helper.navigate('/admin/center/serviceAccount', this.i18n.fanyi('CenterManger.setAccount.serveTitle'), {orgId:row['orgId'],techAccount:row['techAcco... | 0 |
b674d3228062e6ae73938b8fb67a0996 | bfb897d4a9c9f49a1d808145da628fb4 | Transforms .html file content into an array of
desired values and yields it (generator) | encoding = options.get('encoding', 'utf-8')
current_node_type = None
properties_to_translate = {}
for keyword in keywords:
if '/' in keyword:
properties_to_translate[tuple(keyword.split('/', 1))] = keyword
else:
properties_to_translate[(None, keyword)] = keyword
... | 0 |
9b43273414d06b5a826a401626f16a38 | 230fa38a7f9f97dd50302cee2bbf100b | 更新组信息前,判断成员数是超额 | $members = $this->queryDetail($tid);
if($members['code'] == 200){
$update['member_num'] = count($members['result']);
$array = [];
foreach ($members['result'] as $key => $value) {
$array[$key] = $value['accid'];
}
$update['members'] = json_encode($array);
$res = $this->mysql->update('wc_group'... | 0 |
1ba5133f57fea9376052e8d7dc14f214 | 4f8e4fb07eba2ebced780219c4ddb173 | Assert get_location_list when there are no locations returns empty
list. | def test_find_locations(self):
pass | 0 |
e39a7e707473954e89aa7e4e6cf050b2 | 5daadd7fb7af8b3a863991b0e034df2e | save holder in the storage layer | @Service
public class EtlDataLoadDAOService
@Transactional
public HoldingsEntity savedHoldingsEntity(HoldingsEntity holdingsEntity){
HoldingsEntity savedHoldingsEntity = holdingsDetailsRepository.save(holdingsEntity);
flushAndClearSession();
return savedHoldingsEntity;
} | 1 |
dbfc4eddc0528636c039cbd2df2378e0 | e8e5f35e51e3c6b32ed617527f600bf9 | 预加载Mabinogi的资源文件夹 | RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR, this.onResourceLoadError, this);
RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
RES.... | 1 |
db102a668066deb4b412b310dbb94608 | 5f84353a0d5342f8ad2c443b54985b7c | Reorder the row positions | class Section_Model extends CI_Model
public function reorder($sections){
$x = 0;
foreach($sections as $key=>$val){
$sectionId = $key;
$position = $val;
$data = array(
'position' => $position
);
$this->db->where("id", $sectionId)... | 1 |
254ce6619c7034b7574529d831b6213b | 8b746f679f5b3e9bb1ef03b832740de2 | Compute the growth rate. | namespace Gem namespace Geneva
std::size_t G_OptimizationAlgorithm_ParChild::getGrowthRate() const {
return m_growth_rate;
} | 0 |
dd4cf6e19d0717a10b4f753baad577b8 | 7492ce108a18386bd3cec905cded4fdc | 修复bssid | class Metasploit3
def reg_binary_to_mac(mac_v)
bssid = mac_v.data.to_s.unpack("H*")[0]
bssid.insert(2,":")
bssid.insert(5,":")
bssid.insert(8,":")
bssid.insert(11,":")
bssid.insert(14,":")
return bssid
end | 1 |
8aa441dc2ed6216ff68d24c97ac3966a | 31fbdb18c47f0ed97627b0643f4b9515 | 获取代理服务地址:简单的轮询 | class Scheduler():
def get_proxies(self, cycle=GETTER_CYCLE):
getter = Getter()
while True:
print('开始抓取代理')
getter.run()
time.sleep(cycle) | 1 |
0f98a1015a35d25e4ee8f4eacac6dada | d46c5ca73492ea36a14d059d26a9a91e | Finds and displays a basicSetting entity. | {
$deleteForm = $this->createDeleteForm($basicSetting);
return $this->render('basicsetting/show.html.twig', array(
'basicSetting' => $basicSetting,
'delete_form' => $deleteForm->createView(),
));
} | 1 |
b65be01bd5b8dbdee917f05a07685744 | acb9c8a1581dee64adea466cd99162d9 | Finds the last race entry and the results. | public function findLastRaceWithResults(); | 1 |
dd091ac9aa36b20dca0ac96ceb682064 | 97cd5e15118918f611c0a78fc5d99404 | 在bitmap中画矩形 | public class MtcnnUtil
public static void drawRect(Bitmap bitmap, Rect rect, int thick) {
try {
Canvas canvas = new Canvas(bitmap);
Paint paint = new Paint();
int r = 255;
int g = 0;
int b = 0;
paint.setColor(Color.rgb(r, g, b));
... | 1 |
7806b029b68c3f1c120245991196e406 | 9431a2fff39f1d497b95fae93312311e | Return list of `kw` ranges defined in `tchain`. | if self.subframes:
first_frame = self
for subframe in self.subframes.values():
for subchain in subframe.unwrap():
yield [first_frame] + subchain
else:
yield [Frame(self.fun)] | 0 |
e59bac45f13194d884ae0a77a6b04fe3 | 3553d53434bd97966a73cffc8e279636 | 获取阅卷状态 | String getExamineStatus(String openId); | 1 |
f73619205768bbb26caa1b0b6f9b0afc | f84aab1169d1a0a272f915bb25bb031f | Translated from https://stackoverflow.com/a/14646734/8239386 | {
const double circle_radius = circleRadius;
const double start_x = start.x;
const double start_y = start.y;
const double end_x = end.x;
const double end_y = end.y;
const double center_x = circlePosition.x;
const double center_y = circlePosition.y;
const double dx = end_x - start_x;
const double dy = end_y - s... | 1 |
8b7393df33f82c3b45beb68fe1eae086 | 61129ced3d6d1f6c172e831f024d5b56 | Checks whether the current BoundingBox intersects a Ray.
The Ray to check for intersection with.
Distance at which the ray intersects the BoundingBox, or null if there is no intersection. | namespace VRage.Utils
public static partial class MyUtils
public static float? GetLineBoundingBoxIntersection(ref Line line, ref BoundingBox boundingBox)
{
VRageMath.Ray ray = new VRageMath.Ray(line.From, line.Direction);
float? intersectionDistance = boundingBox.Intersects(ray);
... | 1 |
27df0dc8be0d336b664af7b7d2bf1aea | d17a394609a4bac249359a2fa341093d | This prints the state of the network (the results of test cases, and weights). | func DebugNetwork(network Network, epoch int, outputs ...[]float64) {
fmt.Printf("Epoch = %d\n", epoch)
for lk, l := range network.layers {
for nk, n := range l.neurons {
fmt.Printf("N[%d,%d]\tI=%f\tW=%f\tBW=%f\tE=%f\n", lk, nk, n.Input, n.Weight, n.BiasWeight, n.Error)
}
}
for ok, o := range outputs {
fmt... | 1 |
969fa19bd9860c8d0b0e560a003217d7 | 06790e5ee98abd57e082ebe0609002b5 | Compares the usernames of the given users and returns the longer of the two | def old_cmp(u1,u2):
return len(u1.name) - len(u2.name) | 0 |
ef029dae3576165922f3acfeb82449fa | 6446c6351ecd06b4bc3b477151701880 | Move the camera on the z-axis by a given number of steps in either direction. | const tmp = [0, -1, 0];
vec3.scale(tmp, tmp, delta);
this.moveCam(tmp);
} | 0 |
020d2a5fbbaf4a61231512083f30d046 | d3e8da48d4dfd194d818fb84564a506f | Only replaces first instance in case of repetition | namespace Bulk_Email_Sender
static class MyUtilities
internal static void ReplaceFirstOccurrence(ref StringBuilder Source, string Find, string Replace)
{
try
{
int Place = Source.ToString().IndexOf(Find);
if (Place == -1)
return;
... | 1 |
b7d4fe8080dd753e01b420750b5f5335 | 6eaf39390cf17dcdb71a54c819626c5c | Gets the index in the emoji array of the currently focused cell. | export default class Messages extends React.Component
getHoverIndex() {
return this.hoverIndex;
} | 0 |
a31b0372b7e280cd993c6b4ff4d9cf5e | 55432300f068f8618e4fcea02b7092d2 | reset calculated labels and entry boxes | def reset():
lbl_kpd_file.place_forget()
btn_kpd_file.place_forget()
lbl_delta_cal.place_forget()
btn_load['state'] = tk.NORMAL
upd_txt['state'] = tk.NORMAL
kpd_txt['state'] = tk.NORMAL
btn_dlt['state'] = tk.DISABLED
btn_cal['state'] = tk.DISABLED
btn_kpd_file['state'] = tk.DISABL... | 1 |
97605e69da8573725a373b6dcbc55344 | c326bcd5fa6c71a794dd12a148e98e21 | BigToHash converts a big int to Hash. | buf := hash.Bytes()
blen := len(buf)
for i := 0; i < blen/2; i++ {
buf[i], buf[blen-1-i] = buf[blen-1-i], buf[i]
}
return new(big.Int).SetBytes(buf)
} | 0 |
10895c9910383ce9cdfeb5c1c3033031 | f63a53f427e55ba9642e38ae2b2440a5 | Display the list of the overtime requests by the connected employee | class purpleBugTKController extends Controller
public function OBRequestList()
{
$id = Auth::user()->id;
$OBattendance = new Attendance;
$this->data['OBattendance'] = $OBattendance->getOBAttendance($id);
$this->data['Image'] ... | 1 |
3604245a87ad16824a0db9f2f2def298 | b83b439aed9ec4582cf7193bf1ef9bf3 | Get flag "validate while setting"
If unset the values will not be validated while setting them | public function setRequiresValidation(array $requiresValidation)
{
$this->requiresValidation = $requiresValidation;
return $this;
} | 0 |
36be27d447a2928b1f466dd5a45837ba | 173839160af0c44c633ff7653359d3d8 | 初始化下拉组件(支持模糊大小写字符查询过滤,前提是需要对sql的查询条件做小写转换匹配)
_url : 数据请求地址
_extraParams : 请求参数 如:{"findPath":"2", "serviceId":"100157"}
inputId : 输入框ID
hideId : 隐藏框ID
_minChars : 最小输入字符0,就是全查询
isCase :true 全部转换成小写字母传值给后台 | function initAutoComplete(element,data){
$('#' + element).autocomplete(data,{
width: 180,
minChars: 0,
matchContains: true,
scroll: true,
scrollHeight: 180
});
} | 0 |
0d3b90ff08362fb9b7eb1bdd5ec3d3d9 | 3c10255e9173142552a53dd21378bacc | 展示商品类别及其下面的商品列表 | class ListView(View):
def get(self, request, type_id, page):
try:
type = Category.objects.get(id=type_id)
except Category.DoesNotExist:
return redirect(reverse('goods:index'))
types = Category.objects.all()
sort = request.GET.get('sort')
if sort == 'price'... | 1 |
0cc4e3bc1e76970ac36fa8bdc41690be | 8ed7b932bae0c426439fc8a663fcd2ca | Ask PBX Agent information | {
printf("\nPB Info received from QMI PBM\n");
printf("\n-----------------------------\n");
if (pbm_info_resp.resp.result != QMI_RESULT_SUCCESS_V01)
{
printf("Response from QMI PBM returned error %d\n", pbm_info_resp.resp.error);
return;
}
if (pbm_info_resp.capability_basic_info_... | 0 |
cbc8d7bda8b0ed052bbb34ee5ba62967 | 086a58a61aa30115bc1fe0b211e53229 | Starts the game, or returns false.
GUARANTEE: Returns true only once, even if called from multiple threads.
WARNING: It is not guaranteed to mutate internal state atomically; you still need a lock. | class Client(threading.Thread):
def start_game(self):
return | 0 |
77493f5afb87f9e3a8f3679b6d4ae8f7 | ba103987988e6dea8280a5e10e6c8fc4 | Método para devolver a estilização da tag <tr> | const tr = $("<tr></tr>");
if (val) {
tr.addClass(val);
}
return tr;
} | 1 |
ecbd61495e93eab4369355afa0d1efb4 | 2be24521e60e3f3782104c343c249de3 | 获取酒龄(小时) | @Table(name = "biz_ykjl")
public class BizOilCard implements Serializable
public BigDecimal getYkYe() {
return ykYe;
} | 0 |
ada182fe4a4f1f7b6a4b687c850b85e9 | bff65d59e38e34077df4b2680e9458cd | Runs test for create from key throws exception with white space configuration key. | @ActiveProfiles("test")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
class ServiceIntegrationTest
@Test
fun createWithEmptyKeyServiceConfigTest() {
val serviceConfig = ServiceConfig("service_integration_test", "")
val result = WebTestClient
.bindToServe... | 0 |
77e75e30cb0fb0df96c1b69065bd7624 | 9fcb81b011b0ac082402ed5eafe3189b | Tests exception with empty path. | class FolderTest extends FilesystemTestCase
public function testPathException(): void
{
$this->expectException(InvalidArgumentException::class);
$filesystem = $this->getFilesystem();
$filesystem->folder('');
} | 1 |
9c1043f2b78b95fd5a4f9228f2d88bf4 | e7efccde68e6e007029ef43651e98c2e | 去常见问题页面 | class CommonProblemAction(CommonProblemPage): # 常见问题页操作
def click_common_problem_back(self):
self.common_problem_back().click()
from page.test_help_center_page import HelpCenterAction
return HelpCenterAction(self._driver) | 0 |
b01c9d689214c5baff534d090772cc2f | 424f4c0e592ea5be5f86b807084657b1 | Seeks to a specified percentage into the song | void PlayerWidget::seekToTimePercentage(const double perc){
if (!_bmng->getFrameByTimePercentage(_actualFrame, perc)) {
QMessageBox::critical(NULL, "Error", "seekToFrame failed");
return;
}
displayFrame();
return;
} | 1 |
58110ea4816b056df45ca7a6c9662f3e | 1423ebd9dec560dd31d7a8c4bdf1b58d | convert to string and html-escape given value (of any type) | if (is_float($object)) {
return strval($object);
} else if (is_bool($object)) {
return $object ? 'true': 'false';
} else {
return strval(htmlspecialchars($object));
}
} | 1 |
6eee76293994b833fae2950306e45823 | 59ecea777256c0c17b7c2ec825c3c48d | Register automatic form submission when field is changed. | function registerFormEvent() {
var triggers = ScriptApp.getProjectTriggers().filter(function(trigger) {
return (
trigger.getEventType() == ScriptApp.EventType.ON_FORM_SUBMIT &&
trigger.getHandlerFunction() === 'updateAll'
);
});
if (triggers.length > 0) {
return;
}
var spreadSheet = Sp... | 0 |
793012d7f053c94bbc93565a92a6c2ce | 706c4423fac46befada8b0503ebef148 | Return the value of the last data.
Throw Exception if the queue is empty. | {
if (_isEmpty)
throw new InvalidOperationException("Deque is empty");
return _tail.Data;
} | 1 |
dd7c60e8ce5271ceea915b0b96a4b58a | cc8335f389a01b166add8558190c0161 | gckOS_GetPageSize
Get the system's page size.
gckOS Os
Pointer to an gckOS object.
gctSIZE_T * PageSize
Pointer to a variable that will receive the system's page size. | gceSTATUS
gckOS_GetBaseAddress(
IN gckOS Os,
OUT gctUINT32_PTR BaseAddress
)
{
gcmkHEADER_ARG("Os=0x%X", Os);
gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
gcmkVERIFY_ARGUMENT(BaseAddress != gcvNULL);
*BaseAddress = Os->baseAddress;
gcmkFOOTER_ARG("*BaseAddress=0x%08x", *BaseAddress);
return gcv... | 0 |
9e9ea7a64e0c9308f26106466646624b | 143f2d30b5ab7845c3c29af706d6c00d | draw marks, inputs: center at x coordinate, y coordinate, and radius of a circle | def ring(x_coord, y_coord, color):
pencolor(color)
width(10)
penup()
goto(x_coord, y_coord)
goto(60 + x_coord, y_coord)
setheading(90)
pendown()
circle(60)
penup() | 0 |
0421e7900d146f013788ef7d42002a0a | b9ce2e7261a4fcd61ab3386216700bf3 | 判断对象是否有某个原型属性 | function hasPrototypeProperty(object, name){
return !object.hasOwnProperty(name) && (name in object);
} | 1 |
8904c0b17d88740373d03708d5f1d44e | f012c706b52b56930b49f675c3c44fbc | Возвращает HTML код с продуктами данного каталога | $connection = new ConnectionBuilder($this->catalog_type);
$raw_data = $connection->getAllData();
if (!isset($raw_data)) return $connection->error;
$data = $this->dataTypePrepare($raw_data);
if (!$data) {
return 'Каталог пустой';
}
$table = '<table>';
$table_head = '<tr>';
if (i... | 1 |
e48bbc93d31556bf7c74c31571ba4004 | e8ccfa8248afc130e3231cbd6ca3f5d8 | 查询咨询分类列表GET | class Consulttype extends BaseModel
public function getConsulttypeList($condition, $field = '*', $order = 'consulttype_sort asc,consulttype_id desc')
{
return Db::name('consulttype')->where($condition)->field($field)->order($order)->select()->toArray();
} | 1 |
614b90eb90ea6f89b82dbb92914bc1d4 | f7863ffc3bd045f4d181845fe5a1b39b | 查询 CC 攻击日志 | namespace JDCloudSDK.Ipanti.Client
public class IpantiClient : JdcloudClient
public async Task<DownloadCCAttackLogDetailsResponse> DownloadCCAttackLogDetails(DownloadCCAttackLogDetailsRequest request) {
return await new DownloadCCAttackLogDetailsExecutor().Client(this).Execute<DownloadCCAttackLogDetails... | 1 |
75a1756729f650831b67bda31b763e04 | 15e9673cb931026ecdfcd6b0fe5bb448 | Paint a round background for all selected cells. | {
Rectangle rect = valueRect;
rect.Inflate(-1, -1);
rect.Offset(-1, -1);
g.DrawRectangle(m_selectedCellPen, rect);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.