query_id
string
corpus_id
string
query
string
code
string
label
int64
b15cf48d1e8f68cc442a8a91f520e774
fafbeab486556f8d570997413b5d7d33
带Cache的图片显示策略
@SuppressWarnings("deprecation") DisplayImageOptions options = new DisplayImageOptions.Builder() .showStubImage(R.drawable.icon_stub) .showImageForEmptyUri(R.drawable.icon_empty) .showImageOnFail(R.drawable.icon_error) .cacheInMemory(tru...
1
83e0e54eb8d8c0aeb21733b710fe9f99
0997f732bfa5bbd05bd5820253c0d0be
查询所有的家庭成员信息
public HashMap<String, Object> selectAllFamilycontact() { HashMap<String, Object> result = new HashMap<String, Object>(); List<Familycontact> familycontactList = familycontactService.selectAllFamilycontact(); result.put("familycontactList",familycontactList); return result; }
1
e7fa33045c90c52a67794b32459e68c3
1ba75b784e3601b6991332f8bb06674f
Extract from the docstring the keys and description, return it as a dict
def _parse_method_dict(m_doc): methods = {} for k,v in m_doc.items(): methods[k] = v['__input'].keys() return methods
0
41b7fbdb247c360edf8f4c77c51f2c24
1abfe11f1f0a8a00120f4eeae547367d
根据schoolid去得到相应的记录以json形式返回来创建一棵新的树 author: Ricker
class FrontController public function schoolJson(){ $this->schoolinfo = new SchoolModel( ); $this->schoolinfo->infoSet(); $this->schoolfilemanipluate->createFile(); $this->schoolfilemanipluate->writerFile($this->schoolinfo->getSchoolJson()); }
0
88dbcfe3f71199ee6dfca57c7413f64c
ddceb50b4c07018980d6d06670d5011a
Returns true if the specified date is in the past, otherwise false.
namespace Akkadian public partial class Time public static Tbool IsBefore(Tdate dt) { if (!dt.FirstValue.IsKnown) { return new Tbool(dt.FirstValue); } Tbool result = new Tbool(); if (dt == DawnOf) { resul...
0
a582bc7a78555500f17c08a948085402
97656c23c0c44c9671e6ff9ecad2bc7e
GET the Title of the Anime given the ID.
namespace MovieResources.Helpers public class MovieManager public static string GetTitle(string id) { using (MR_DataClassesDataContext _db = new MR_DataClassesDataContext()) { tbl_Movie movie = _db.tbl_Movie.SingleOrDefault(s => s.movie_Id == id); if (...
1
52ef0cd126de2d0d72bd37fe1fd0137f
dec748c6e1d4fb489b51ae08e3299804
6자리 인증번호 생성 메서드
class SignActivity : AppCompatActivity(), View.OnClickListener fun makeVerifyNumber() { val random = Random() val verifyNumberBuilder = StringBuilder() for(i in 0 until 4) verifyNumberBuilder.append(random.nextInt(10)) verifyNumber = verifyNumberBuilder.toString() }
0
82834c1b3db1f5e57d5c97416fbacee9
dec2ffd20e44ae7b21ad2d57e91926c9
Getter for <code>kjruyigou.shop_manager.agent</code>.
@Component public class OfflineProcurementSchedulerTask public IAgentService getAgentService() { return agentService; }
0
428299f2eb36d0099c496482575924aa
bdededc62614cd9de500d0e18e3b2f18
方差最小的投资组合优化
shares_list = csv_to_list(path) shares_list = shares_list[1:] share_list = [] for action in shares_list: share_list.append(ShareOpt(action[0], action[1], action[2])) share_list.sort(key=lambda x: x.benefit, reverse=True) share_portfolio = SharesPortfolioOpt(portfolio=[]) for index in...
0
dd4cab12c8bf9de64bb74ff574ac02d6
442da0af13b0add1b9d37ea0ea5f1b4f
when this event is triggered, the layout of header/background is not updated immediately. we use a one-shot timer to delay a synchronization among scroll viewers
if (getHeight() != heightBackup) { heightBackup = getHeight(); scrollSelectionIntoView(); } else { super.setScrollPositionsAfterLayout(scrollLeft0, scrollTop0); } }
0
22ddd459bd30db9963005f9cf464023b
d0e5c702fba15e06bdfc9f24c46a9938
获取支付预订单信息
namespace CHIS.Controllers.Charge [Authorize] public partial class ChargeController : BaseController [AllowAnonymous] [HttpGet] public JsonResult GetPayOrderPreInfo(string payOrderId) { try { if (payOrderId.IsEmpty()) throw new Exception("没有传入订单号")...
1
ff8429706ce1aeb3837acbf026cb3e57
68843979a8055ca4828317edf8bfeeb3
Determines whether the product has been initialized based on the status.
get initialized() { return _initialized; }
1
9ad45425c26fbd034b4d790e2d8bf290
495441dd064101d495bf820ac3d730e0
Redirect the user after determining they are locked out.
class AuthController extends Controller protected function sendLockedAccountResponse(Request $request) { return redirect()->back() ->withInput($request->only($this->loginUsername(), 'remember')) ->withErrors([ $this->loginUsername() => $this->getLockedAccountMessage()...
1
08220e88585745d39df8d2ef8b438756
c94ab967572376332b32bb04c9929d66
Specyficzna metoda dla klasy, Zwraca nazwę i Id produktu instancji obiektu
public class Main public abstract class Product public abstract String getName();
0
9e55420cc1f57928fcb029068840c67e
619eb5771e548b0ecae7c908c7517999
Fully Automatic (Fires bullets so long as the button is held)
cooldownTimer -= Time.deltaTime; if (Input.GetButton("Fire1") && cooldownTimer <= 0 && isFullAuto && Time.timeScale != 0) { GameObject bullet = (GameObject)Instantiate(bulletPrefab, transform.position, Quaternion.LookRotation(transform.forward)); bullet.GetComponent<Rigid...
1
de794d9330bc9750dbf7189c401c0b46
d0f1429911fdf2a3b1e1d708f2a6aef6
Creates the square bit matrix.
func makeSquareMatrix(length int) [][]bool { var squareMatrix = make([][]bool, length) for i := 0; i < length; i++ { for j := 0; j < length; j++ { squareMatrix[i] = make([]bool, length) } } return squareMatrix }
1
a08b616b289f38d7d652294f06038f11
a32191c410badbb6707620c8a52d0c9b
Callback to cancel the recording and re-enable the UIs
ivNext.visibility = View.VISIBLE playerEffects?.stop() playerBackground?.stop() recorder?.apply { stop() release() } recorder = null }
1
c1a538d16445185a4b967d3136e5c267
945824008570b200c9387173ee3ee3cb
Writes a null-terminated string to the virtual monitor.
void MonoOut(IMG_CHAR * pszString,IMG_BOOL bNewLine) { #if defined (_WIN64) PVR_UNREFERENCED_PARAMETER(pszString); PVR_UNREFERENCED_PARAMETER(bNewLine); #else IMG_UINT32 i; IMG_CHAR * pScreen; pScreen = (IMG_CHAR *) DBGDRIV_MONOBASE; pScreen += g_ui32Line * 160; i=0; do { pScreen[g_ui32LOff + (i*2)] = pszSt...
1
a86de819ad57ed6caf8dd452147cb98e
05d91ab50d6710c7ba789587dba2eb6a
Genera números de referencia para los productos
class Contenido{ function crear_codigo($cat,$sub){ $cat=$this->get_categoria($cat); $sub=$this->get_subcategoria($sub); $codigo=$cat[0]; $codigo.=$cat[1]; $codigo.="-"; $codigo.=$sub[0]; $codigo.=$sub[1]; $codigo=strtoupper($codigo); $codigo.="."; $sql="SELECT MAX(id_pro) AS tota...
1
ece2298186fd42dcaa372f993c8abeda
b1844a54634a90c89451a0d1a3856fc1
获取妖域幻界副本进入条件
local process = s_getTaskValue(uid,30043,TaskValue_Process) if process ~= TaskProcess_None then return VALUE_FAIL end local process = s_getTaskValue(uid,30260,TaskValue_Process) if process ~= TaskProcess_None then return VALUE_FAIL end local level = s_getValue(SCENE_ENTRY_PLAYER,uid,VALUE_TYPE_LEVEL) local ...
1
16751a2c955c731607bcef32a7a1e6f8
06e75aff7f8a8265e609cc60d5d77609
# check whether or not two items are linked
{ $where = array( 'fromid=' => $item1->id, 'fromtype=' => get_class($item1), 'toid=' => $item2->id, 'totype=' => get_class($item2), ); $results = $this->dbService->getObjects('ItemLink', $where); return count($results) ? current($result...
1
6a1e28616039d35dd836e50540e394a1
dfc1f9a5d9a421252ef3ff6ea40a1478
Throw if argument is NotImplemented, else return argument.
try: nv = fn(val) except (ValueError, TypeError): nv = val return nv
0
5939a8ef0a9aa01c69ddc9e37ca02ca1
da2a07ef3e58317f3bcbb2b691445e52
Test that `work_id` counter wraps around
class ExampleTest(tester.TempestaTest): def test_double_wrk(self): nginx: nginx_server.Nginx = self.get_server("nginx") nginx.start() self.start_tempesta() self.assertTrue(nginx.wait_for_connections(timeout=1)) wrk1: wrk_client.Wrk = self.get_client("wrk_1") wrk2: wrk_cli...
0
1ce1999c42a5d9932ded5b9969e4c37c
c37ccf002ccfabc8d24afacb8d5dd8bd
通过项点名称获取项点view列表
@SuppressWarnings("unchecked") public class KpointImpl extends BaseService implements IKpoint{ public List<Kpoint> getKpointListByPid(QueryKpointCondition queryKpointCondition) { List result = simpleDao.getForList("Kpoint_NS.getKpointListByPid",queryKpointCondition); Collections.sort(result); return result; }
0
4e45546b7a95e70c5c75b337594aeee2
813e8d57c6d9fb9bfe12ff77ae2417bd
Function that shows what points are selected by a particular slice operation
markers_in_slice = [] for m in self.markers: pixel_pos = np.array(m.pixel_position) if round(pixel_pos[self.orientation]) == self.current_slice: markers_in_slice.append(pixel_pos[np.arange(3) != self.orientation]) if len(markers_in_slice) != 0: ...
1
05d0071e08fc4000d71e6565ceeacf37
c2e4469fc2f65c05aba5404599612659
Экспорт из активного редактора
namespace Gaia public class GaiaManagerEditor : EditorWindow, IPWEditor void ShowExtensionExporterEditor() { var export = EditorWindow.GetWindow<GaiaExtensionExporterEditor>(false, m_editorUtils.GetTextValue("Export GX")); export.Show(); }
1
940ef7144abc5a3aa0ad8ea0d25a047e
604af05b1fb19ded7ba9453a77867c7d
将一个对象插入XmlDB
throws IOException { Folder db_folder = createDBFolder(star); PrimitiveManager manager = file_system.getPrimitiveManager(db_folder, new XmlMagRecordHolder(), new XmlMagRecord()); manager.addElement(record); }
1
88ecc2bc00d6cb5617a1af7ad6ba67d1
c8510da763db68f20fc7a96336acacf3
Tests the dealer feed elements against a set of "master" values.
class ChromeRiverAPI(): def ValidStatementFeedFile(self, element_friendly_name, object_type, object_set_value, expected_value, data_dictionary): data_dictionary['bank'] = "USBANK-Statement" data_dictionary['process_feed'] = True return data_dictionary
0
74be7d22ab30e1be31b86b48dbea4452
26f05e5bcad3ba3e343e79e3885484bc
保存文档标签
class Article extends ActiveRecord implements SafeDataInterface public function saveTags($tags = []) { $tags = is_array($tags) ? $tags : [$tags]; $tags = array_filter($tags); $saveTagsTransaction = Article::getDb()->beginTransaction(); try { $this->unlinkAllTags(); ...
1
4768d7d4c7cb8eaa3799591d8e97bb07
2b4af1350a2a5e587180662e4eeed159
Returns true if at least one flag or positional argument is defined for this tool.
return ( args.text is not None and args.key is not None and args.dest_lang is not None )
0
494a55ff250d98a18950b1b8de283750
c770ed5e5b098435045dc9bae407a6d7
右侧商品排序栏
var init = []; $.each(arr,function(i,ele){ init.push(ele); }) var a; $("#sortNew a").each(function(j,ele){ $(ele).click(function(){ $("#sortNew a").removeClass(); $(this).addClass("checked"); if(this.innerText=="人气"){ $(".sortPage>p a span").removeClass(...
1
b639bb3fbfc12e2c56251bc251c977bb
95cb5eb93e804f3efb71f1f80cc14d40
The Generatevpnclientpackage operation generates Vpn client package for P2S client of the virtual network gateway in the specified resource group through Network resource provider.
public SyncPoller<PollResult<String>, String> beginGenerateVpnProfile( String resourceGroupName, String virtualNetworkGatewayName, VpnClientParameters parameters) { return this .beginGenerateVpnProfileAsync(resourceGroupName, virtualNetworkGatewayName, parameters) .getSyncPol...
1
050dd294db502f620275e342b0d21012
2be87899bfc8d5bc6cab5112570b360b
修改密码ajax
class Personalcenter extends Base{ public function login_pwd_ajax(){ $param = input(); $uid = session('id'); $getPwd = Db::name('users')->where('id',$uid)->field('password')->find(); if($getPwd['password']==md5($param['old_pwd'])){ $data['password'] = md5($param['new_pwd']...
1
5bf55ce2164dd8dac147a682fc6f531d
568ee81a18f326a54616254d11428087
Reset/regenerate asset cache.
class SimpleMapprTestBootstrap private function flushCaches() { \SimpleMappr\Assets::flushCache(false); $this->clearTmpFiles(); }
1
5cab7ce960bca92eecd56f844659c4da
2aa67c5c6aa2fa0a574d84225096d4d0
Moves to the attribute with the specified Name.
{ ArgumentOutOfRangeException.ThrowIfNegative(i); ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(i, AttributeCount); MoveToElement(); MoveToFirstAttribute(); int j = 0; while (j < i) { MoveToNextAttribute(...
0
7bc493e6c038b98fb83203655c321043
60408a9937f009388ad0b53a3f1b9b06
Gets the username of this AccessConfig.
String getUsername();
1
b97d44a3dd9d11935d9c9c79ac66a1f2
8a64d15c59ad133280bae25848be5dca
有可能从游戏态、角色选择态过来的,先关闭网络
tcb_gamemode_onlinebattle_t::STATERETURN tcb_gamemode_onlinebattle_t::state_net_exit() { tk::net::apl::CINetMatching* pINetMatching = tcb_mainroot_t::get_instance()->get_network_manager()->get_inet_matching_task(); if (pINetMatching) { #if 0 TNSessionManager* pSession = TNSessionManager::GetInstance(); if (pSessi...
1
f34b2fc9f4a00758560be0c1ea4d3b56
6a006a3958e472dfa97fc6966ebbf5f5
Returns: Most likely word
words = list(self._probs.keys()) probs = list(self._probs.values()) sample_distribution = numpy.random.multinomial(1, probs) indices = numpy.flatnonzero(sample_distribution) assert len(indices) == 1 return words[indices[0]]
0
a00581e5cae6f57c3d5696313b8826f4
16bfbc220e7718d552fd144098a5426c
Ellison and Glaeser (1997) :cite:`ellison_1997` index of concentration. Implemented to be computed with data about people (segregation/diversity) rather than as industry concentration, following Mare et al (2012) :cite:`care_2012`.
result = {} memberships = H.nodes.memberships() members = H.edges.members() for n in H.nodes: ev = list(memberships[n]) dv = len(ev) if dv <= 1: result[n] = 0 else: total_eo = 0 for e1 in range(dv): edge1 = members[e1] ...
1
e7d95a8f809357023bf3977d47e49384
3dfb43936a79a8b2af0ae16018b11f33
This method is used for the insert/Update trading transaction letter details.
namespace InsiderTrading.SL public class TradingTransactionSL_OS : IDisposable public bool InsertTransactionFormDetails(string i_sConnectionString, TransactionLetterDTO_OS i_objTransactionLetterDTO_OS) { bool IsSave = false; try { using (TradingTransaction...
1
9b6ef07b09e2ae4e9eddbb6981e5a227
8de1a7993eebccdf84b696dd391561d5
Extract the titles of the actions from the JSON action menu response
local_filepath = download_from_url(STRING_PROTEIN_ACTIONS_URL, target_path) with gzip.open(local_filepath) as fp: fp.readline() return { line.strip().decode().split('\t')[2] for line in fp }
0
87f5653b7367afca6cbae31c528e2149
5e0446fd9e918f130e81d1783adcd084
Infers the probable decimal separator given a grouping separator. <p> To use when you've guess a probable grouping separator but no clue about a decimal separator (like in a integer for example). <p> Its based on the hypothesis that if we have standard EU grouping separator, it returns standard EU decimal separator, st...
namespace NeuroLoopGainLibrary.Text public static class TextUtils public static char DetectDecimalSeparator(string s, bool returnBestGuess) { return DetectDecimalSeparator(s, returnBestGuess, char.MinValue); }
1
f1452fd2d2d6159729bfd6f0f0eac7ff
2001af2d4af42debe52d6abc37f6a39c
<p> Holds the current size of the repository in MB. </p>
public class SshRepository extends BlobStoreRepository @Override protected ByteSizeValue chunkSize() { return chunkSize; }
0
101b10d6d5bf46dddf3afc102ec45790
86fafdfc980f52e774e4a678afb13596
根据userid获取单个listTaskRecord对象
public Map<String,Object> queryTaskByUserId(Map<String,Object> parameter);
0
f13e6ac7a4b0cb439e30c8d3cfe6b2f8
3995cd4d2cca5169947254a3b25bde9f
Logs pre worker event.
{ $this->log("{$worker_id} on start..."); $this->log("Swoole version is [" . SWOOLE_VERSION . "]"); }
1
a360f3476244ff284ec189f7a00f050c
bff0510f9af86852b181112bde3e5e4a
Scales 2D vector with scalar
public class IntVector2 public IntVector2 scl(Vector2 vec2) { return scl(vec2.x, vec2.y); }
0
79db1e9f24e085143b1af21155c1816c
2ac1932977162a42a327a52b9576657e
异步方式获取全部商品,并保存到List<>泛型集合
namespace DotNetScaffolder.Domain.ApplicationService public partial class ProductApplicationService : IProductApplicationService public Task<IList<IProduct>> ProductLoadAllAsync(bool cache, params Expression<Func<IProduct, object>>[] includes) { return this.ProductRepository.LoadAllAsync(cache, in...
1
6d2fce5d44f8017be7bf14368b54ba1b
4f13cea4fb5a9a9ca300ceee27c51154
マウスホイールイベントの転送
namespace static void winproc_mousewheel(WPARAM wParam, LPARAM lParam) { std::Position buttonPos = { 0 }; buttonPos.x = std::int32_t(LOWORD(lParam)); buttonPos.y = std::int32_t(HIWORD(lParam)); std::int32_t zdelta = std::int32_t(GET_WHEEL_DELTA_WPARAM(wParam)); if (zdelta >= 0) { gUiMain->procButtonEvent(...
1
ca0af5f7c51d546c3db314dcd0f727b6
fd317da9284d4176df460fd967c6716b
function returning the multiplication factor for calculating the y-coordinates
def mult(y): if y == 2020: return 50 elif y >= 2015: return 40 elif y >= 2010: return 10 elif y >= 2000: return 3 else: return 1
1
2c709d12bbaa6deb4c98704e24d59286
f347cbb63cb04512985f57002e05cf08
Returns a Matrix that will scale in the X and Y
namespace Ibasa.Numerics public static Matrix2x2d Scaling(double x, double y) { return new Matrix2x2d( x, 0, 0, y ); }
1
16468960e07b2de081793410714589e5
8da11fba581c9a14c3510b3f768b35cb
Construct the lowerer base class and initialize its members.
XfLowerImpl::~XfLowerImpl() { delete mSlo; }
0
5955907cf647357cb5298d2e2ac3096f
7478402850c8c63dda4da82a1a5fe154
Set the case insensitive for field: ChgWho (CMF_REWARD_BALANCE_DETAIL.chg_who)
@XmlRootElement(namespace ="http://bp.comverse.com/data") @XmlAccessorType (XmlAccessType.PROPERTY) public class AdjustmentObjectData extends BaseObjectData implements Serializable public void setChgWhoFromFormattedString(String _value, Locale _locale) throws ServiceException { if (Logger.TRACE) Logger.traceEntry(...
0
b8c24ac40109d9969bac8c3b41ebc731
567e34d26353c0876b8e3ff9545f27c6
ACFAccordionToTabs constructor.
$element['#attached'] = [ 'library' => [ 'cohesion/cohesion-accordion-element', ], ]; return $element; }
0
8c1a2f44181c86b519724ef4cb1ef81d
b07ffcd9182835eb8c66748fb19f521a
Creates or returns a preexisting {@link MethodInfoBuilder} for a method of the smart contract interface.
public Method createMethod();
0
6755510dae5764f520441c7aa2e39be2
379320c3ada2931ddfb75513785899aa
Obtains daily prices of assets from yahoo finance form startDate to endDate. Log returns are calculated and stored to dReturns(DataFrame).
df = pd.io.data.get_data_yahoo(symbol, start, end) df.columns.values[-1] = 'AdjClose' df.columns = df.columns + '_' + symbol df['Return_%s' % symbol] = df['AdjClose_%s' % symbol].pct_change() return df
1
7994548097a9167f5b2b97473e86bc20
b01cb4b96c8a55498f7d4b507e04e257
rmi服务可用性检测
public class RmiClient public static void main(String[] args) { ServerTimeService serverTimeService = RmiFactory.getInstance().getRmiService(ServerTimeService.class, "127.0.0.1", "9100", "serverTimeService"); Date date = serverTimeService.getServerTime(); log.info(date.toString()); }
0
5a3db7576519f130fedaf9642ecefa1a
19381032b3090c0eb0df4bc12b6135b8
(Optional) Number of rows marked updated on import.
class TableImportStatusRequestSuccess public function getRowsUpdated(): ?int { return $this->rowsUpdated; }
1
81ad70d9e0a03eb5bd83c5aa843cbbd0
d5fd9284460c200077d008fb2fcee7f4
获取本周热门抢购(有缓存)
class Iradio extends CI_Controller public function hotweek() { $DB=$this->rdb; $week = date("W",strtotime(TODAY)); $sql = "select sum(a.nums) as counts,b.id,b.dj_name,b.prog_name,b.pict,b.dj_online from dj_log_week as a inner join dj_program as b on a.pid=b.id inner join dj_channel as c on b.dj_name=c....
0
122a86d80b878f9bf3064a5d2d4bd40f
c95f421954e9fe429dcf062dc3db1fe2
说明: 开启防火墙
def StartFirewall(): if not FirewallStatus(): subprocess.run(["insmod", "/home/cshf/code/firewall-master/firewall.ko"]) SaveConfig(config["filter_mode"])
1
817a74440eeb8fc2b3dffc1b1f105f81
ff945d03ba1fd9f02bdc2dbee9933e73
Shows a progress dialog with an indeterminate spinner in it.
namespace Cashier.App.Views class ViewFactory : Cashier.Domain.Storage.DisposableObject public async void OpenProgressAsync(Window w, string title, string content, Action action) { var mySettings = new MetroDialogSettings() { AnimateShow = false, Anima...
1
0e2ee69679e3fed5376650509c1c095a
79e15533dcaefe420f9c0f27453d4fc9
This function returns the difference in number between our pieces and the enemies
double mobility_difference(board * brd) { move * m = malloc(sizeof(move)); init_move(&m); generate_all_moves(1, brd, &m); int a = count_moves(&m); free_moves(&m); m=malloc(sizeof(move)); init_move(&m); generate_all_moves(-1, brd, &m); int b = count_moves(&m); free_moves(&m); return (double)(a-b); ...
0
57f5d0f7ef7f925322776bbe5f077739
469ffab9796181bbae57e7026fcea854
初始化飞行图标
let seconds = 30 * (positions.length-2); timeSettings(seconds); let property = new Cesium.SampledPositionProperty(); for (let index = 0; index < positions.length; index++) { let time = Cesium.JulianDate.addSeconds(startDate, index*30, new Cesium.JulianDate()); let position = positio...
1
feef3107dde2af61aa0109b4a909370e
54380d33a3d2342580c150e8cf280af0
Calculate total cost of received packages.
class QuoteDeviceGroupModel extends My_Model_Abstract public function calculateTotalCost () { $totalCost = 0; foreach ($this->getQuoteDeviceGroupDevices() as $quoteDevice) { if ($quoteDevice->calculateTotalQuantity() > 0) { $totalCost += $quoteDevice->...
1
5c1e78306297eabcbfc5e2d8220fcc4a
d1723be0e0f7c977add30a52414ca34a
Metodo utilizzato per la restituzione del voto assegnato dall'utente
public function getIsVotedAttribute(){ return $this->isVote(); }
0
8514db2a0560a45b39e2df3e5acd3c91
2b7de7da53c151631135e591db9b4c3b
自定义显示位置地Toast
LayoutInflater inflater = LayoutInflater.from(context); View CustomView = inflater.inflate(R.layout.toast_customtoast, null); TextView ToastText = (TextView) CustomView.findViewById(R.id.toast_id); ToastText.setText(StrUtils.NullToStr(text)); if (CustomToast == null) { ...
1
7a3f3c69d2c9967b55b2b70fc7a05b29
7ee1d623381c98e97d7c559f461fb06e
# 去词函数
word<-str_remove_all(dat,"[:space:]+") dat<-dat[!(word %in% 0:150)] word<-str_remove_all(dat,"[:space:]") word<-str_remove_all(word,"[:punct:]") x<-c("本页内容结束") dat<-dat[! (word %in% x) ] return(dat) }
1
fa8683c566cafd48da1b4a1cc7a8eac1
99fa98ad19d2bcad28f038661abd4015
registering a BroadcastReceiver to listen to incoming messages
public void onStart() { super.onStart(); LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(getActivity()); IntentFilter filter = new IntentFilter(); filter.addAction(Constants.ACTION.BROADCAST_MESSAGE); broadcastManager.registerReceiver(receiver, filt...
1
1a5c47b9c8d7d85fdf3447fd333abf4c
5984b864121b6d3d3106e72ba6beca04
Traitement pour supprimer une pizza de la ListBox
namespace pizzeria public partial class PasserCommande : Form private void cboxTypeMenu_SelectedValueChanged(object sender, EventArgs e) { lboxPizzaMenu.Items.Clear(); lboxBoissonMenu.Items.Clear(); }
0
0b7fa2eaf8c3ee1c2bc209c2d1f20bcb
716a11d92fe57d59d3b43821c14832e9
显示层对象被销毁事件.
public class UILogicBase:SEventRegister protected virtual void removeShow() { if(_modelObject!=null) { _modelObject.SetActive(false); } }
0
4e0f7a4d85d9fdd81fd4faf808bf1989
02240bdcff101b54d7d861cd97177d84
判断用户是否收藏该路线
class CollectionModel extends Model{ public function is_collection($user_id,$route_id){ $res = Db::table('collection')->where('user_id',$user_id)->where('route_id',$route_id)->find(); return $res; }
1
db6dad8a49f3d5fe2a0cf44109ef421d
a930c6a9133408ea75335242d0ae0ad1
Reset the connected AVR Chip (matrix driver)
class data_acq_thread (threading.Thread): def reset_avr (self): self.serial_lock.acquire () self.serial_port.write ("R") self.serial_lock.release ()
1
8d02f826d77f18801ff1239d7eeaf289
058798e01d96d0bf54aa5e6b30287760
方法名以set开头,并且方法名的第四个字母为大写</li> <li>方法的参数个数只有一个</li> 待校验的方法对象 false 不是setter方法
@NoArgsConstructor(access = AccessLevel.PRIVATE) public class ReflexUtils public static boolean isSetter(String methodName) { if (!methodName.startsWith(SETTER_PREFIX) || methodName.length() <= SETTER_PREFIX.length()) return false; char fieldFirstChar = methodName.charAt(SETTER_PREFIX.length...
0
ad08f5114c0fe0dba02ea42c39bc8b9e
04fdea65718e2368874d5ecacc135619
Saves the data of a list of TVShow objects to a file for every saved show, it saves the name, and next season's number and the release date/release period in separate lines. If the next season hasn't been specified, it saves only the name and the word undefined at the next line
public void write(Series series, IFilter<Episode> episodeFilter) throws IOException { try { writeSeriesHeader(series.url, series.title); boolean episodesWritten = false; for (List<Episode> season : series.episodes) { for (Episode episode : season) { if (episodeFilter.allow(epis...
0
37b7bef3b0d61406db1c91099cbc2329
e9d9b02f1a5dcca5e528790f9a975b67
===================================== 管理者向け自動返信メールの終了用HTMLの取得 =====================================
{ $adminBody = "「" . $subject . "」からメールが届きました\n\n"; $adminBody .= "===========================\n\n"; $adminBody .= postToMail($arr); $adminBody .= "\n===========================\n"; $adminBody .= "送信された日時:" . date("Y/m/d (D) H:i:s", time()) . "\n"; $adminBody .= "送信者のIPアドレス:" . @$_SERVER["RE...
0
8947d0b060b31f21589438f13fba2038
3d67eb275f15f4f0a7c7f432d2275a23
マウスボタンを押下しながらの移動を処理する。
public class FollowMouse : MonoBehaviour IEnumerator MoveHandle() { while (true) { transform.position = MouseXY(); yield return null; } }
0
c65b313b3f603e4ada0a17e0c2963b4e
83a8b832cccb00633492f16723eea2a4
Генерация строки для записи в excel
namespace BitrixCSV public class FileRow public override string ToString() { string res = XmlId.ToString() + Delimiter + Name.Trim() + Delimiter + PreviewText.Trim() + Delimiter + DetailText.Trim() + Delimiter + ArtNumber.Trim().ToL...
1
cb80268f2221aa4dfedde038eb62037c
a8248fe7208b66a27c8e439036e92f90
有备选地址时,跳转到地址列表页;没有时,跳转到地址新增页。
public String toEditAddress(HttpSession session,Model model) { User user = (User)session.getAttribute("user"); if(user==null){ return "redirect:/login_register"; } model.addAttribute("main",addressService.getDefault(user.getId())); model.addAttribute("other",a...
0
1886317833d7c5c12dd0977ae62f8089
92ded47fc4a2e8e324cc310465901ec8
遍历excel文件目录,导出lua配置表
protocol_file = CodeTemplate.java_template.get("protocol_file") if os.path.isfile(protocol_file): excel_data = xlrd.open_workbook(protocol_file) sheets = excel_data.sheets() sheet_names = excel_data.sheet_names() sheet_num = len(sheets) if 0 >=...
0
ce70fba42ec33208b6ed50b0f48d2275
f995d8fd5b41bc0d8fab9dcffd7426b2
Valide un option entre 1 et 2 puis retourne l'option saisi et valide.
user_options() user_choice = None while user_choice == None: try: user_choice = int(input("Choisissez une option: ")) if len(options) < user_choice or user_choice < 1: user_choice = None print("Option invalide !") except: pr...
1
c39241d5f097c0a39d81ffb6d1833de1
5d629c31d086fc550dd20600fc36f9a4
Add the Album to the shopping list
@cart = current_cart album = Album.find(params[:album_id]) @line_item = @cart.add_album(album.id) respond_with(@line_item) do |format| if @line_item.save format.html { redirect_to(store_url) } format.js { @current_item = @line_item } else format.html { render :action ...
1
b7da96eab454629fee4bd5a411a151f7
bd5c345d3a83721c7ba50e7b94000953
Prints each object in the sequence on its own line.
void Sequence::dump() const { for (Node* t = head->m_next; t != head; t = t->m_next) std::cerr << t->m_data << std::endl; }
1
305a208642d21406c6e9a7ca47190621
085d8f1e1f0b3a20cdaa6b8f6c2166d2
FUNCIÓN PARA QUE AL OPRIMIR EL BOTÓN "ATRÁS" EN EL HEADER DEL MENÚ "CLINICA FORENSE", REGRESE AL MENÚ PRINCIPAL
function backTo(){ window.location.href='menu.html'; }
1
a42ac0bf914e3a9a27b774229fe98f1e
e24efaf31a5dc417bd31e10d1aeb64ca
Write CSV header for landmarks file.
class Surface(object): def _get_csv_header(self): return "coord x, coord y, coord z, scalar\n"
1
00e6187d988ac0c615ada6e638ee8c89
b40ff0f803d95e152ed522302511e395
Returns init object provided with constructor.
InitParams getInitParams();
0
fa777f4a38358b848609993a9c870c9f
06ca5b2558364f776e246e8684a58496
设置工具栏自适应
{ MaximizeBox = false; MinimizeBox = false; FormBorderStyle = FormBorderStyle.FixedSingle; PnlWListTN.Width = PageAbout.Width - 100; ViewMethod.Colwidth2(LvCmd); ViewMethod.Colwidth2(LvConsole); ViewMethod.Colwidth2(LvCtrlPnl); ...
0
b9aded63ef24f98a75ee74973453fcda
f1af7154e78be3d7a40aad9f2cc09288
Получает объект файлового блока по элементу родительского поля
class GlobalNav extends Component blockGetParent(blockId) { return this.props.blockGetParents(blockId)[0]; }
0
c66babad6d290cb475aff9c90b7fa61b
31c2506d721c67726a1013ed763ab949
@brief 像素点排序(按高度切片排序)
namespace scan_line_run bool point_cmp(VPoint a, VPoint b){ return a.z < b.z; }
1
f17928b4c3f01e39803bf87e083061c5
59321e80577b988f7abb55ff74d8170d
sort the project by last edited time
return project.getsourcetree(prj, function(a,b) local istop = (a.parent.parent == nil) local aSortName = a.name local bSortName = b.name if a.relpath then if not b.relpath then return not istop end aSortName = a.relpath:gsub("%.%.%/", "") end if b.relpath then if not a.relpath t...
0
d33c6ffe66e4c3b094426e67aa69ab15
9c997faf9d14e4d8601db696e293fd7f
Returns the number of responses received during the crawl, whose HTTP status code indicated success (2xx). success (2xx)
long totalSuccess();
1
6830f757af9ae874bfb60aaf3d2575e4
ff57f254a40317ec5196d5d6133ec303
Hides the product specification div
if(spec_show == 0) { $('#spec_tools').fadeOut(700, function(){ $('#footer').css({ 'padding' : '25px 0 25px 0' }); $('.content, .sidebar').removeClass('sc-dop'); special_refrash(); }); $('#spec_show').removeClass('active'); } else { $('#spec_tools').fadeIn(700, function(){ $('#footer').css({ 'paddi...
1
af1f3a860ad7b52c76e536e34a984a71
d7f175464d00b650f11075b0901d07fd
根据类别随机选取n条推荐话题
func GetRangeIsRecommendTopicFromDB(num int, topicIds []int64) []*share_message.Topic { col, closeFun := easygo.MongoMgr.GetC(MONGODB_NINGMENG, TABLE_TOPIC) defer closeFun() list := make([]*share_message.Topic, 0) queryBson := bson.M{} queryBson = bson.M{"IsRecommend": true, "Status": TOPIC_STATUS_OPEN} if len(to...
1
95965a31c52428286ab8a9f6263f0d64
4feca932130b008a8182a5119f30ab25
Function to close the special store
function Close9527Store() GameObjectSetActive(OfficialInterface.Object,false) end
1
3c8b4a42a35f98316980b03123fca390
7605d0c734df2e27fd2101fefb8bdab5
use a simple weight system to find the function with the lowest error
int minpos=-1; double minerr = DBL_MAX; for(int i=0; i < NofClassifier; i++){ double currentclassifiererr = 0; #pragma omp parallel for reduction(+:currentclassifiererr) for(int j=0; j < NofData; j++){ if(datavec[j][i] != targetvec[j]){ currentclassifiererr += weight[j]; } } if(minerr...
1
9a3092b000a3a76ef56162a5f4902691
d0d3888abb33ee041f7adcfb6ff1f216
replace newlines to spaces
class Scraper(object): def remove_newline(self,text): text = text.replace('\n', ' ') text = text.replace('\xa0', ' ') return text
1
7178e578539531a90de7f8ed3a7ef2ae
dbcd6c9ae7c6ecacc5853a127f85f8c8
查询网站类规则的 CC 防护默认配置
namespace JDCloudSDK.Ipanti.Client public class IpantiClient : JdcloudClient public async Task<DescribeCCProtectionDefaultConfigOfWebRuleResponse> DescribeCCProtectionDefaultConfigOfWebRule(DescribeCCProtectionDefaultConfigOfWebRuleRequest request) { return await new DescribeCCProtectionDefaultConfigOfW...
1
d94fbb73400da14f21be01a66333336e
4bc359651c39e41c4ba7cf56c81ff24b
绝对值的平均值
public class CalResult public float getAvgAbs() { return Calculate.getAve(FFTAbs); }
1
017d0cfae9b13bc272676cfb2df826bd
506cdf033e621fd072140257d81bbc2b
https://stackoverflow.com/a/23088000/1870799
def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]: for first in iterator: rest_of_chunk = itertools.islice(iterator, 0, n - 1) yield itertools.chain([first], rest_of_chunk)
1
054e298a7276ed3ff478c2ebfc3f8808
5d1d604bb1ce5b91c81e63c93b7ad506
初始化XML元素与函数成员指针的QMap,建立XML元素名与成员函数指针的映射
class FunctionFactory(): def InitHint(self, xmlpath, Parent): listhint = ReadXMlData(xmlpath, Parent) for list1 in listhint: self.FunctionMap[list1.get_function_name()] = MakeFunction(self.driver).make_function_hint(list1.get_element_location())
1
092d16ef5d0fa5be321acf666c3e2720
8f84745bf304564cb92f80c80a40a450
Output the message after a portfolio has been created.
Portfolio p = ContextHolder.getPortfolioManager().get(portfolioID); message = ""; if (p != null && p.getEndDate() != null) { PermissionChecker pc = new PortfolioPermissionChecker(p, ServletActionContext.getRequest()); DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); message = df.format(pc.getLastLegal...
0
537aedf5b76dcbc42c3c7d1475d03de5
6a0b528f2968d95e8b00fc0c933657c0
Gets the list of role colours from a list of roles.
async def get_role_color (role): role_color = role.colour return role_color
0