query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c16ace0c4337d82e32bb6b2a3163b2c3 | fd66b03bc8ed7b3ce7e2a1159b3957d8 | 从localstorage拿到待支付金额 | let request = null
if (getters.hadLogin) {
request = dispatch('getOnlineWishAmount')
} else {
request = dispatch('getLocalWishAmount')
}
request
.then(data => {
commit('setWishAmount', data)
return Promise.resolv... | 0 |
486ae83d72cc5118652c3d6b86010c31 | d0bcb98b6cf50ec69f3dc73335746e79 | Parse a PageItem and all requests to follow
@url http://www.scrapinghub.com/ | class PlayStoreSpider(scrapy.Spider):
def parse(self, response):
if self.is_max_item_reached():
log.msg("**** Max Item reached", level=log.DEBUG)
return
log.msg("**** Scraping: " + response.url, level=log.INFO)
app_urls = Selector(xpath=self.APP_URLS).get_value_list(respo... | 0 |
77f3abf46ce09cf0f797287a9dfa719c | 576af524e1b4d7b46fc6c7a9c82f0a3d | 参与小组讨论 | function addTeamDiscuss() {
var teamId = $("#teamId").val();
var title = $("#title").val();
if (title == null || title == "") {
showAlert("讨论题目不可以为空!");
return false;
}
if (title.length > 100) {
showAlert("讨论题目不可以超过100字符!");
return false;
}
if (discussUE.hasContents() && discussUE.getContentTxt().length ... | 0 |
f638537832b1799e0491983c6a593fe3 | 25485c3ec39a7e3af1643a5847df8304 | 获取当天的开始时间, 如:2014-02-24 00:00:00 | public class DateUtils
public static String getTodayStart() {
long zero = getTodayStartMills();
return format.format(zero);
} | 1 |
5ed8d8b6862d97bddd3287aeeffc9076 | beee895a258e3302c74b8ed06bcc6ab7 | 支持资源池的节点类型 | let name = node.name;
let pool: NodePool = undefined;
if(this.poolList_.hasOwnProperty(name)) {
pool = this.poolList_[name];
}else {
pool = new NodePool();
}
pool.put(node);
} | 1 |
d5dfd6a73d0f0cf1a7b140ce71ffe6a2 | c45729d693748b567e6bc7034edbced3 | [db] ユーザーIDをDBから取得する | public class UserDAO
public User getUser(String userId) throws IllegalArgumentException {
SQLiteDatabase db = helper.getReadableDatabase();
String where = USER.USER_ID + " = ?";
Cursor cursor =
db.query(TABLE.USER.name(), USER.columns(), where, new String[]{userId}, null, null, "... | 1 |
3696eb7fe6a282e9b79e669ec15624b9 | 1f335aa1364e8cca3d3b099ed2f85433 | tf-idf 策略加权的词袋模型 | text_docs = []
for doc in docs:
text_docs.append(" ".join(doc))
tfidf = TfidfVectorizer()
tfidf.fit(text_docs)
max_idf = max(tfidf.idf_)
self.word_idf_weight = defaultdict(lambda: max_idf,
[(word, tfidf.idf_[i]) f... | 1 |
6d438365b4f89d1e2a024ea822069865 | e43a7bc1da11da30f8d9bc1fabb8106f | https://www.linkedin.com/company/it-advanced-consulting/ -> it-advanced-consulting | def url_to_company_name(text):
url_end = text.rfind('/', 0, text.rfind('/')) + 1
text = text[url_end:]
if re.search('(-color-palette/)$', text):
text = re.sub('(-color-palette/)', '', text)
text = re.sub('/', '', text)
return text | 1 |
7aa4c9563e2797c72dcc1265123f0150 | 476b5ba573b64e0218ed941e80258219 | Gets employee's time off calculated table | {
$validator = Validator::make($request->all(), [
'search_data' => 'min:0|max:191|nullable',
'status' => 'integer|min:1|max:6|nullable',
'approved' => 'integer|min:0|max:2|nullable',
'month' => 'integer|min:1|max:12|nullable',
'year' => 'integer|nu... | 1 |
c79291b72549d44234e95dc9d4f43999 | 2c60a08d29c86dd86a576253cbb79289 | Get the value of id_produto | class Produto
public function getId() {
return $this->id;
} | 1 |
8a477c4492e337db3d80ea9a2ff410a0 | 839b91b6af8aed894fbad80a1036f7df | 是否全部都是福星 | public class PaiXinHelper
public static boolean isWanTiaoTong(List<Integer> cards) {
for(int card : cards) {
if(card == ALMIGHTY_CARD_NUM) continue;
CardType cardType = Mahjong.getCardType(card);
if(!Mahjong.isWanTiaoTong(cardType)) return false;
}
return true;
} | 0 |
5287082601c3b14535b94fbcce3acae9 | 39a6e71fb55e5146d87ffacced745d02 | 获取F_Id字段为keyValue值的数据并返回JSon类型 | if(_id == undefined || _id == null || _id == "") {
return undefined;
}
var data = $("#"+_id).find('.dataObj').attr('key');
return JSON.parse(data);
} | 0 |
6cc0b849cfaa04457f1249f4c10b0af1 | fe4324cae9dfd06296b7c959390d69fc | Returns the kernels that will be used to compute the discrete derivatives. | def sobel_kernels(n_dims):
in_dir = tf.convert_to_tensor([1, 0, -1], dtype='float32')
orthogonal_dir = tf.convert_to_tensor([1, 2, 1], dtype='float32')
comb = np.array(list(combinations(list(range(n_dims)), n_dims - 1))[::-1])
list_kernels = list()
for dim in range(n_dims):
sublist_kernels =... | 1 |
2d249b582cdfadf6c7002b7d06c250e9 | 880203e3bee432eb6291ab3b7d5599e7 | 添加英雄节点,此时不考虑添加顺序,直接在尾节点添加
1.遍历节点至最后一个节点
2.将最后一个节点next指向新节点
3.将新节点的pre设置为当前最后一个节点 | temp := head
for {
if temp.next == nil {
break
}
temp = temp.next
}
temp.next = newHeroNode
newHeroNode.pre = temp
} | 1 |
6174f8e7fa98000580a4f93b16f5f1e5 | 6192bf25a0f0682439edc302bd4c7e25 | Load in the osberved data as well as the randomly shuffled data | stest_x = np.load(config.PREDATA_DIC + '/wtest_x.npy')
stest_y = np.load(config.PREDATA_DIC + '/wtest_y.npy')
stest_x, stest_y = __shuffle_both(stest_x, stest_y)
return stest_x, stest_y | 1 |
fda1a9edcff8c026b048e7305356f475 | 6c2100379ceab878e550f81c8cc3693a | 修改所选店铺库存的吊牌价和售价 | $stocks = input('stock', []);
$sku_ids = input('sku_id', []);
$goods_ids = input('goods_id', []);
$store_goods_sku_array = [];
foreach ($stocks as $key => $stock) {
$store_goods_sku_array[] = [
'store_stock' => $stock,
'store_id' => $th... | 0 |
95bad04e6bbf4ee2636ff59297b1cc81 | 78f1726cff759395a2f1958d282d2036 | If a sympy 'Expr' is of the form:
expr = expr_0 + expr_1*a_1 + ... + expr_n*a_n
where all the a_j are noncommuting symbols in basis then
f(expr) = expr_0 + expr_1*f(a_1) + ... + expr_n*f(a_n)
is returned | def antisymmetrize(f):
import inspect
import itertools
import math
nargs = len(inspect.getargspec(f).args)
def new_func(*args):
val = 0
coeff = math.factorial(nargs)
p_args = itertools.permutations(args, nargs)
for i, e in enumerate(p_args):
val += (-1) **... | 0 |
174cadeea8c1258901d826f2bf822515 | 5c78bf1c68de90957463af785ace4b86 | Construct a dictionary that groups profiles by time | result = dict()
currUser = None
currYear = None
currMont = None
count = 0
for item in dataset:
time = item[-1].strip().split('-')
if currUser != item[0]:
if currUser != None:
result[currUser][currYear+currMont] =... | 1 |
122af69ccec19ec8492705cac47e1fae | 5cd9408fb161d7d4769a0cab83255a15 | Обмен столбцов местами | namespace Console_CalcMat
class CalcMat
public void SwapColumns(int Col1, int Col2)
{
for (int i = 0; i < this.RowLength(); i++)
{
col1[i] = this.mtrx[i, Col1];
}
for (int i = 0; i < this.RowLength(); i++)
{
col2[i] ... | 1 |
d50e5d564617682491683b00ea9ae1e1 | 20afaa4059951b149be9dfaac33e3488 | Specify path to external recognizer | if dirpath is None:
self.dirpath = os.getcwd()
else:
self.dirpath = os.path.abspath(dirpath)
self.debug = False
self.last_trained_file = None
self.last_recognized_file = None
self.speaker_name = None
self.filepath = None
self.scores... | 0 |
005af53f82c9aa48101fde87d93552e2 | b407bcc57669043a23a12e7425f8468d | クライアントIDに紐付いている全てのスコープを返す | {
$query = "SELECT sb_oauth_scope.scope
FROM sb_oauth_client_scope, sb_oauth_scope, oauth_clients
WHERE oauth_clients.client_id = :client_id
AND sb_oauth_client_scope.oauth_client_id = oauth_clients.id
AND sb_oauth_client_scope.oauth_scope_id... | 1 |
3d34ae257630797ae088757c3228b534 | 9ff7ffea202e214c6787fbd227c57d39 | Copy a DNS name | {
char *domain_name_pointer = NULL;
char *domain_name = NULL;
char *tmp_ptr = NULL;
int dns_header_len = DNS_HS;
int name_part_len = 0;
int dn_len = 0;
if(packet_size > dns_header_len){
domain_name_pointer = (dns_packet + dns_header_len);
do {
name_part_len = (int) domain_name_pointer[0];
if((name_part... | 1 |
1ee651cf2db81c412990355f1656c536 | f2156b3c7462296b4151708e053aa9ec | Paginación de suministros requeridos para realizar una nueva orden de giro | class ControladorAlmacen{
static public function ctrMostrarPedidosSuministrados($item, $valor){
$tabla = "atencionaclientes";
$respuesta = ModeloAlmacen::mdlMostrarPedidosSuministrados($tabla, $item, $valor);
return $respuesta;
} | 0 |
c0c5f8d9c493bfd1afe946aff28984d3 | 712c9b80c6a3775487f7dad29d27b00a | 根据下载状态设置样式 | switch (type) {
case 0:
viewHolder.setBackgroundRes(R.id.iv_status_icon, R.mipmap.course_catalog_download);
viewHolder.setText(R.id.tv_status, "下载");
break;
case 1:
viewHolder.setBackgroundRes(R.id.iv_status_icon, R.mipmap.c... | 1 |
edee9678992004e9f8a06bcbceb746e7 | 35dec677a0c0a12de6aac9f4b2723b81 | Realiza la consulta de la personalidades Juridicas para el modelo que se despliega en la pagina. | List<Persona> lstPersonas;
em = getEntityManager();
String queryString = "SELECT per FROM Persona per "
+ "WHERE per.tipo = :tipo "
+ "ORDER BY per.razonSocial";
Query q = em.createQuery(queryString)
.setParameter("tipo", TipoPersona.JURIDI... | 1 |
c0403c845b36738ff5cd8a4f84ca232f | aec8ff8cbc9d655873b12064f7908a14 | Returns next byte (unsigned) or `-1` if no more bytes available | where
Self: Sized,
T: Copy,
{
let end: u32 = saturating_usize_as_u32(buf.len());
buf[usize::try_from(self.next_bounded(end)).unwrap()]
} | 0 |
3cdcbcdadcd4a3018c941809dde8b651 | 002f2c06087cb1cdbe28ad61e0ff7cb7 | 실버 IV > 카드 2 | def solution(n, lost, reserve):
std = [1 for i in range(n)]
for i in reserve: std[i - 1] = 2
for i in lost: std[i - 1] = std[i - 1] - 1
for i in range(n):
if not std[i]:
if i > 0 and std[i - 1] == 2: std[i] = std[i - 1] = 1
elif i < n - 1 and std[i + 1] == 2: std[i] = std... | 1 |
0ebf010f593658e842287e057fec0ebc | ce22b0420fe0703e80a4ff5d485e19a6 | 选择立方体取消 | local s_unit = self.arr_units[_uuid]
if s_unit then
if s_unit:CancelSelect(_player, _pos) then
Broadcast('ElementCancelEvent', self, _player.UserId, _uuid, _pos)
self.ins_ani:Play(_player.UserId, Const.GameAniEnum.Cancel)
end
end
CheckInHand(self, _uuid)
end | 1 |
06d7330fb260e41a2e8dfad2ce1819b3 | 3a48a04defbf596d87a363e654871af8 | view to find the matches played per year | def years():
return render_template("years.html") | 0 |
1a6bc4982237165e00ea1a611c231c5c | 30882312b9fd50715e497cf69f848778 | 割合を指定して1行のなかにプロパティを表示 | {
return string.Format("{0} {1}{2}\r\n", caption.PadRight(linewidth, '.'), value.ToString().PadRight(15, ' '), pct == -1 ? string.Empty : string.Format("{0:F}", pct.ToString("#0.##%")));
} | 1 |
22519aa98b8ea8b3e5afc98a3adcfea3 | 84c86141b58afb02bfbf15c051c284ca | List of pom.xml files that, directly or not, are children of the root artifact
set in the artifacts tree
set in the artifacts tree | Set<DependencyArtifact> getArtifacts(); | 0 |
7fb85b363bd11dd5bc091afd282f7007 | fbec82cb87261cb66d287882de17e01f | 更新机器组信息,如果机器组已应用配置,则新加入、减少机器会自动增加、移除配置。 | namespace Aliyun.Api.LogService
Task<IResponse> ApplyConfigToMachineGroupAsync(ApplyConfigToMachineGroupRequest request); | 1 |
3222fbd21b466787b2dcc49ed36b7ad8 | 0a7808c261a5d5797c46939fcce0c7d6 | This implements the `svn_ra_neon__startelm_cb_t' prototype. | static SAX_RETURN sax_startelement(void *ctx, SablotHandle processor,
const char *name,
const char **attr)
{
zval *argv[3];
zval *retval;
php_xslt *handle = (php_xslt *) ctx;
char ... | 0 |
a7abf346cd4d9a6cc934253908e8d878 | 9bec7285532fceb638b84d64c7ed33e2 | This function releases the NB P-state force for CZ | VOID
MemNSwitchMemPstateCZ (
IN OUT MEM_NB_BLOCK *NBPtr,
IN UINT8 MemPstate
)
{
ASSERT (MemPstate < 2);
IDS_HDT_CONSOLE (MEM_FLOW, "MemPsSel = %d\n", MemPstate);
NBPtr->MemPstate = MemPstate;
} | 0 |
7d136793f2800350bfe2a6ccc76bf175 | a8e23f351f35670a49f19ae47b8c30d9 | Test method for {@link com.example.crystalgame.library.events.StateChangeEvent#getPrevious()}. | {
$this->assertEquals(1, count($arguments), '引数は 1 つ必要');
$this->assertEquals($arguments[0], $world[self::CONTEXT]->getPreviousState(), '前回の状態が引数と等しい');
} | 1 |
9b91a9cbf91764aaaf73dee2b8c022d1 | 2517aa5c09b1d83ae1bd2b4a6b92321d | Autoconfiguration cfprint routine when attaching
to the "iopxs" device. | int comedi_pcmcia_auto_config(struct pcmcia_device *link,
struct comedi_driver *driver)
{
return comedi_auto_config(&link->dev, driver, 0);
} | 0 |
78647dc5eec68191ead55429168f29b6 | 82a653add8bc398f2a3bb6be38dac0d7 | Returns True if two torch Tensors are equal within a tolerance.
Mimics np.allclose | def dense_equal(mat1:torch.Tensor, mat2:torch.Tensor, err=1e-5):
if len(mat1.shape) != 2 or len(mat2.shape) != 2:
return False
if mat1.shape != mat2.shape:
return False
return (torch.abs(mat1 - mat2) < err).all().item() | 1 |
aa4eae8f48b46aa5cc37edee50436c3c | 5b6a977654112e96bacbcba62e316c0f | Taking the finite difference derivative of Lm to be sure that autograd does its work properly. | if k is None or lmb is None:
k = self.k
lmb = self.lmb
eps = 1e-5
delk = (self.loglik(t, x, k + eps, lmb) -
self.loglik(t, x, k - eps, lmb)) / 2 / eps
dellmb = (self.loglik(t, x, k, lmb + eps) -
self.loglik(t, x, k, lmb - eps)) / ... | 1 |
db6ce486017d3b1de8d072522cbb12bc | b9dad0755dcd0954e1a880c37eca1926 | \brief Block until an input module has a connection.
\todo Currently there is no priority override setting on input modules, so in thoery if a job in the hot
folder might not get a chance to run if there are many pending socket connections available. | {
struct input_modules *pMods;
int bWaitingForJob = 1;
int nResult;
if(!l_ptModules) {
return FALSE;
}
while(bWaitingForJob) {
if(g_tJob.eTestPage)
return TRUE;
#ifdef PMS_OIL_MERGE_DISABLE_JS
bWaitingForJob = 0;
for(pMods = l_ptModules; pMods; pMods = pMods->pNext) {
if(pMods->tInput.pfnOpenDataSt... | 1 |
fb1d332afd361767cd22f17e90f79779 | f3bc3cdbd7b4eb6d6b9b1efa4b68085c | IsPrivateKeyPEM verify if a given byte array is a valid PEM-encoded private key | function isValidPrivateKey(privateKeyStr)
{
if(privateKeyStr === undefined || privateKeyStr === null){
return false;
}
try {
if (privateKeyStr.length === 52) {
Crypto.PrivateKey.deserializeWIF(privateKeyStr);
} else {
return false;
}
return true;
} catch (error) {
return fals... | 0 |
5ee04961a173c0fa75bb1f5f69f3adc8 | 92c016e92bf433dc185d8bb3f457e01a | CV: test final risk calculation w/ missing data.
Test missing data at feature propogates to empty field in output. | from natcap.invest import carbon
args = {
'workspace_dir': self.workspace_dir,
'do_valuation': True,
'price_per_metric_ton_of_c': 43.0,
'rate_change': 2.8,
'lulc_cur_year': 2016,
'lulc_fut_year': 2030,
'discount_rate': -... | 0 |
62d22fdd6beb3b088c7d528f35f70f2d | 9bcb38576820be8524c7c625a52b090b | Recurses validation to children in branch.
Note this occurs regardless if this node is disabled (or if there
are warnings), to enable downstream handling. | class AbstractConstraint
def recurse_valid?(spec=nil)
spec ||= self.spec
case spec
when Array
spec.any?{ |sub_spec| recurse_valid?(sub_spec) }
else
validate(spec)
end
end | 1 |
3882eb312b136731b6ec084cbe4a1e48 | fb3f06d6734eecad0cec03e4f83da042 | Add a Launch Listener to receive launch events | class BaseEvent(BaseHandler):
def register(self):
self.session.event_hub.subscribe(
'topic=ftrack.update',
self._launch,
priority=self.priority
) | 1 |
a00e483ab7610c14c501f14f2a664c65 | 7f89eb623847986d6ac9e5cb374fdc82 | Publishes the action in the queue. If the user is not specified the action is public.
Otherwise it is directed to the specified user. | namespace io.fusionauth public class FusionAuthClient
public Task<ClientResponse<ActionResponse>> ActionUserAsync(Guid? actioneeUserId, ActionRequest request) {
return buildClient()
.withUri("/api/user/action")
.withUriSegment(actioneeUserId)
.withJSONBody(request)
.withM... | 1 |
d543b5bf6ea0a0829642595d47a83930 | fa71668fe0fa62296d2ef21a489451d5 | id指定でユーザを検索 | @RequiredArgsConstructor(onConstructor = @__(@Inject))
public class DynamoUserRepository implements UserRepository
@Override
public Optional<User> find(@NonNull String id) {
DynamoDB ddb = new DynamoDB(client);
Table table = getTable(ddb);
Item item = table.getItem(ID_ATTR_NAME, id);
... | 1 |
076d458756ab3c6933e46e7e1138dbc0 | 857efa55d7248ae7ddee1d5641727302 | Metoda koja na zadanu lokaciju upisuje predanu vrijednost. | String put(final Location location, final String string); | 1 |
efb6a7ff37a2a8b9c8b6ca3eb51194f6 | 57ea71973b916ce7eab3d771b17d612d | Gets the current gap pct. | @JsonPOJOBuilder
public class RefundablePremium
public Double getCurrent_gap_pct() {
return current_gap_pct;
} | 1 |
0f75f588509f87931b79c11726b8a5f8 | 70f3b1d29ef3b5203dbf265f3f4a3b9e | Generate a static plot of the motion of both bodies. | class MomentumBasedCentroidPlannerWithPredefinedZ(centroid_planner_base.CentroidPlannerBase):
def plotMomentum(self, with_pause=True):
tm_traj = self.mpc_xy.dt * np.arange(len(self.ref_cog_traj))
if self.figs.get("momentum") is not None:
plt.close(self.figs.get("momentum"))
fig = sel... | 0 |
71a8fd846b9b07dfc212e045c72eb2c1 | da8c3347e2f49b26ad9bfddeb823a8ed | findByQuestionAndAnswer | public class AnswerDAOImpl extends GenericDAOImpl<Answer, Long> implements
AnswerDAO
@Override
public List<Answer> findByQuestion(Question question) {
return super.findByCriteria(Restrictions.eq("question", question));
} | 0 |
1a40fd135a40bbd1365848632de82072 | 9ac7cca6713861bfd90194c40c15704a | задача таймера - периодически запускать "шаг" транспорта, выводить текущую дистанцию и время, проверять конец круга и заносить
в списки победителей | void Step()
{
static int i=0,k=0;
#if USART1_DEBUG
int j;
#endif
if(motor1.isResetPoint && motor2.isResetPoint)
{
TIM_Cmd(TIM1,DISABLE);
motor1.totalTime = 0;
motor2.totalTime = 0;
if(!rec_buffer.issbufNull)
{
if((rec_buffer.isNeedChange[k]==1) || (rec_buffer.isNeedChange[k]==11))
{
Annex_Sea... | 0 |
dc3dc615c4de09a9148974147cce2d38 | e1d27bdc4fb3d577759a7ad4c2cb6d2b | Creates thread pool work item. | {
Debug.Assert(workItem == null);
workItem = threadPool.QueueWorkItem(perform);
if (threadPool.InUseThreads == threadPool.MaxThreads)
logger.Add(@"WARNING: ThreadPool is saturated!", LogLevel.Error);
} | 1 |
3cd1d66f49545930c7b8e5aaeb193774 | 060d151c54148331a34c1fbd6d5040d2 | Remove relative article link for provision | class Contacts_DetailView_Model extends Accounts_DetailView_Model
public function getDetailViewRelatedLinks() {
$relatedLinks = parent::getDetailViewRelatedLinks();
foreach ($relatedLinks as $key => $relatedLink) {
if (isset($relatedLink['relatedModuleName']) && $relatedLink['relatedModuleNa... | 1 |
7e4c0c7cceb90414c4ac03807536a546 | 16929df96a3f0182a3f0cd8dad5f32ed | Henter og opdaterer kontoen. | {
if (string.IsNullOrEmpty(kontonummer))
{
throw new ArgumentNullException("kontonummer");
}
Func<IKontoModel> func = () => KontoGet(regnskabsnummer, kontonummer, statusDato);
return Task.Run(func);
} | 0 |
90ddede7746c667fc8bdb66feee3d8f4 | 419780dfef6e9da5e1c3e40bd543b94f | MySQL格式日期字符串"yyyy-MM-dd"转换为Date对象
日期字符串 | Date date = null;
try {
date = new SimpleDateFormat("yyyy-MM-dd").parse(dateString);
} catch (Exception e) {
}
return date;
} | 1 |
cfabc5c9d0b940cc5f150f7f55130483 | 669db7d6be22562699b1fd6b1d475880 | 下料单号变化时触发的事件 | {
string billNum = e.Values["bill_num"].ToString();
using (var daHead = new t_delivery_bill_head_sampleTableAdapter())
using (var daContent = new t_delivery_bill_content_sampleTableAdapter())
using (var conn = daHead.Connection)
{
conn.... | 1 |
deb4b6004cdbd2e2334894242f072e74 | 7e0e6356b0df676ac921fd25374a28dc | Transforma string em número.
Caso não consiga transformar, retorna zero. | {
bool verifica = true;
int num = -1;
int i = 0;
while (i < str.length() && verifica)
{
if (!(str[i] >= '0' && str[i] <= '9'))
{
verifica = false;
}
i++;
}
if (verifica)
{
num = std::stoi(str);
}
return(num);
} | 0 |
93b3ed81d0a56fc4b479c26b14676c1d | 9608c32c24107a75585a14d3d45cc7ec | Gets a list of writeable member names. | Set<String> results = new HashSet<String>();
for (Map.Entry<String, PropertyDescriptor> each : getPropertyDescriptors().entrySet()) {
if (each.getValue().getWriteMethod() == null) {
continue;
}
results.add(each.getKey());
}
return resul... | 1 |
7a52c029f91c1eeefa71edbf54ff8773 | 2b6ce9809e7b97362ee0216e833251e5 | Método que envía una transacción ya firmada sin listener. | public class TransactionsHelper
public void sendSignedTransaction(@NonNull String signedMessage){
new Thread(new Runnable() {
@Override
public void run() {
try {
web3j.ethSendRawTransaction(signedMessage).send();
} catch (IOException e) {
e.printStackTrace();
... | 1 |
147a26d054891ab273f55db37deece32 | db8c894eb148a7a7f9d0ad2ca8028b05 | Inserts a new tweet and returns its ID | t = datetime.datetime.now()
if self.store.create_tweet(content, handle, t):
return self._format_tweet((content, handle, t))
else:
return None | 0 |
682b3483f1e9af51561ffbfdf2a25dd4 | c1142cc75780514a78913793d94c4295 | テーマを選ぶ | RadioGroup rg = findViewByIds(holder.view_themes, R.id.themes_rg);
rb_gold = findViewByIds(holder.view_themes, R.id.themes_rb_gold);
rb_night = findViewByIds(holder.view_themes, R.id.themes_rb_night);
rb_ocean = findViewByIds(holder.view_themes, R.id.themes_rb_ocean);
rb_green = ... | 1 |
ff94b6d9996178d542ca8545ccba966d | f79b513b779c53cfe0a90f68da2f3a9a | Returns the Frame at the specified time, interpolating the data between existing frames, if necessary. | namespace NSynth
Frame GetFrame(long index); | 0 |
19790867455d92c437eedb1554c6c204 | 0a10b042f55f2adcb820e63d5f3f6910 | THIS FUNCTION OPENS A NEW WINDOW WITH A FIND FUNCTIONALITY # | def openWindow() :
startProg()
global window
window = Toplevel(windowMenu)
window.title("Detecteur de langue")
window.geometry("2000x400")
lF = LabelFrame(window, text="Choisissez un fichier texte", padx=20, pady=20)
exitBtn = Button(window, text="Quitter", command=window.quit)
findFile ... | 1 |
a85dfd2d82b9f561d81644ed6bb04cbc | 9c7c2837c0a7db11338ce20971719b6d | Displays tasks before given date | function displayDueTasks(date) {
let taskCounter = 0;
let a = new Date();
let today = returnDate(a, 'today');
let tomorrow = returnDate(a, 'tomorrow');
displayDueHeaders(today, tomorrow, date);
for (let i = 0; i < tasks.length; i++) {
const element = tasks[i];
if (element.dueDate... | 0 |
c2b3da891c7e104159b13dd93b08f46f | 97c0738b97acb88a108d05b2f7b7600a | the tree must remain valid (keep its invariants).
returns the number of rebalancing operations, or 0 if no rebalancing operations were necessary.
returns -1 if an item with key k already exists in the tree.
change the min max count accordingly | if key not in self.bykey:
return -1
item = self.bykey[key]
freq = item.parent
next_freq = freq.next
if next_freq == self.freq_tail or \
next_freq.value != freq.value + 1:
next_freq = self.create_new_freq_node(freq.value+1, freq, next_freq)
... | 0 |
9528034c2367136927d0928d6fa4f8f9 | 1dfa96f9c80d715b950d409d73a772b8 | @brief Software reset all SPI registers to default value. | if (pSPI == SPI1) SPI1_REG_RESET();
else if (pSPI == SPI2) SPI2_REG_RESET();
else if (pSPI == SPI3) SPI3_REG_RESET();
else if (pSPI == SPI4) SPI4_REG_RESET();
} | 1 |
b05545833ce3ad439523b92aef95e7c9 | 6101657f15e91c2a0ae04a7d1edacf59 | 毫秒数转为分秒 | @SuppressLint("SimpleDateFormat")
public class TimeUtils
public static String toMS(long timeMillis) {
timeMillis = timeMillis / 1000;
int m = (int)(timeMillis / 60);
int s = (int)(timeMillis % 60);
String mm = m < 10 ? "0"+m : ""+m;
String ss = s < 10 ? "0"+s : ""+s;
return mm + ":" + ss;
} | 1 |
c218ccd1fe1bc7698910422c84607f11 | 64dddbf25ec5910b49fec4f9efae855a | Consulta de la tabla CatGenerales. Definición de todos los catalogos de la aplicación | {
ENTResponse oENTResponse = new ENTResponse();
DataSet ds = new DataSet();
try
{
ds = dbs.ExecuteDataSet("catEstatusSel");
oENTResponse.dsResponse = ds;
}
catch (SqlException sqlEx)
{
... | 0 |
ae828a6ed321f9b75df6518aee7b44a6 | 8454a235451ceac45aaff23679e86bb3 | Just create and dispatch the inherited replication operation. | namespace Store
void ReplicatedStore::TransactionBase::ReplicateAsyncOperation<TDerivedTransaction>::OnReplication(
AsyncOperationSPtr const &)
{
} | 0 |
00d35c6867ebd3361ba824833e040919 | 22511880deef666c9ff5e6f5ea0db8b0 | 根据医院名称查询医院 | List<OrgHospitalInfoApprovalEntity> selectByHospitalName(@Param("hospitalName") String hospitalName); | 1 |
0d5e366ff73c719c88aa18e7b39e34cd | e81e1d63d63b19fd6d1980bef03ce54b | BPSP_Courses()
Constructor. Loads the hooks and actions. | $plugin_functions = BbclmsFunctions ::instance();
$plugin_db = new BbclmsDB();
$plugin_ajax = new BbclmsAjax( $plugin_db );
$actions_to_add = [
'widgets_init' => [ [ $plugin_functions, 'bbclms_register_widgets' ] ],
'wp_enqueue_scripts' => [ [ $plugin_functions, 'bbclms_enqueue_styles' ], [ $plugin_... | 1 |
4fbe898f52de04c70970d2fa96a0c399 | d5f03f685dbfc64958d601165486c42f | Calculates the has that signs the requests for service.thrivethemes.com | class SdfApi_Request
public static function calcSignature( SdfApi_RequestInfo $Request, $SecretKey )
{
$stringToSign = $Request->Method . "\n" .
$Request->ContentMD5 . "\n" .
$Request->ContentType . "\n" .
$Request->Date . "\n" .
$Request->Host . $Request->Uri;
$signature = base64_encode( self::hashHma... | 1 |
39ef4e5ca4cf1eaabcd7772b8d130045 | ce631715483bb2809747ecc929f9fce9 | A hepler method for Bipartite.
Generate an int array with values from 0 to V-1 uniform distributed. | Random rand = new Random();
Random neg = new Random();
Integer [] arr = new Integer [count];
for (Integer i = 0; i < count; i++) {
int r = rand.nextInt(count+1);
if (neg.nextInt(2) == 1) {
r = -1 * r;
}
arr[i] = r;
}
return arr;
} | 0 |
bde8bc84be3d7b553257ffc6ef6bfa45 | d8e8ed78da19ee8ce1e3b57e4283c012 | Gets the old program trap area and memory and
passes the exception number and the old program
trap area to pass up or die. There, pass up or
die will determine if an exception state vector has been
set up for that process | void
trapexcept(struct trapframe *tf, int *sp) {
struct proc *p = curproc;
volatile auto int eip, eflags;
int i;
eip = tf->tf_eip;
eflags = tf->tf_eflags;
tf->tf_eip = *sp++;
tf->tf_cs = *sp++;
if (eip == (int)&iret)
tf->tf_eflags = *sp++;
tf->tf_esp = *sp++;
tf->tf_ss = *sp;
p->p_md.md_flags |= MDP_SIGPRO... | 0 |
227aa3a2756f52a9ff6a9ca110d63554 | daab47d6b6e71295441c97262f7ae563 | 画横坐标线 | class LineChart @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr: Int = 0
) : View(context, attrs, defStyleAttr)
private fun drawCoordinate(canvas: Canvas) {
canvas.drawLine(
mXPoint - axisWidth / 2f,
mYPoint,
mXPoint + mXLen... | 1 |
ef959a8b7e9456ff93a9475eda42848a | 15ed1f8cd6ab2a4e63b7fb9fbdef333c | 推送给品牌 | @ResponseBody
public Map<String, Object> pushBrand(@RequestBody List<Map<String, Object>> paraList) {
List<BrandDataOut> proPushList = new ArrayList<BrandDataOut>();
List<BrandDataOut> efPushList = new ArrayList<BrandDataOut>();
List<Map<String, Object>> ePushList = new ArrayList<Map<Str... | 1 |
9999d8f0ae851df7690d3663c52462c4 | 964d39819b88285632fb1e9310e50190 | Чтение списка пакетов, записанных клиентом sdd в формате json,
и конвертирование в более удобный формат | func ConvertPackEntries(packFile string) ([]snd.Entry, error) {
packBytes, err := ioutil.ReadFile(packFile)
if err != nil {
return nil, err
}
packLines := strings.Split(string(packBytes), "\n")
var entries []snd.Entry
for i := range packLines {
if len(packLines[i]) <= 2 {
continue
}
pack := PackEntry{}... | 1 |
89c7e4d075ae48ef3e92692ce29760a2 | 2393fdbb693d92e6b2c50db0fc534911 | Use this hook for providing custom return type logic. If this plugin does not know what a function should
return but another plugin may be able to determine the type, return null. Otherwise return a mixed union type
if something should be returned, but can't be more specific. | abstract class SelfHandlingObjectAction extends ObjectAction
abstract protected function returnType(); | 1 |
2af69898a15a033bb937e760400e37f4 | 5d1e8e03fcc0595dfb0e30269352af97 | verificamos si el usuario registrado con google ya existe en la bd caso contrario lo crea | class Usuarios extends CI_Controller
public function ingresar(){
if($this->ion_auth->logged_in()){
header('Location: '.base_url(), true, 302);
exit;
}
$code = $this->input->get('code');
if(isset($code)){
$this->google->getAuthenticate($code);
... | 1 |
811aa392ccb36fcd46e05f6aa78100a8 | bb79aae618b70a80d7653ba2e8b7ec59 | Time independent part of Hamiltonian | def H_independent():
res = jnp.zeros((2**N, 2**N))
for i in range(N):
for j in range(N):
if j <= i:
continue
params = 1/np.abs(i-j)**6
res += params*(jnp.dot(n0[i], n0[j]))
return res | 1 |
59486a14d44278830fa5c4afd5a9281f | 224c9999f71a98eabc1898afa8be66c8 | ## corresponding Weibull density | lambda.now <- exp(sum(beta.now*x))
if(outcome==0)
ans <- pweibull(y, kappa.now, 1/lambda.now, lower.tail=FALSE, log.p=TRUE)
else
ans <- dweibull(y, kappa.now, 1/lambda.now, log=TRUE)
return(ans)
} | 1 |
6763fcf819829e236a789fba3442088f | 84595f74b6cd567ac67cd77143c38cd3 | 添加部门失败测试用例 | def test_add_department():
data = {
"name": "广州研发中心",
"name_en": "RDGZ",
"parentid": 2,
"order": 1,
}
res = requests.post(f"https://qyapi.weixin.qq.com/cgi-bin/department/create?access_token={token()}", json=data)
print(res.text) | 0 |
d5c45068a27492c4bdb844ae090e0093 | 654a6f3a4664343771efcf640360db33 | 初始化背景根据图片虚化效果 | public class SplashActivity extends BaseActivity
private void initPic() {
Animation animation = AnimationUtils.loadAnimation(this, R.anim.background_larger);
splashBackGround.startAnimation(animation);
} | 0 |
bb28aa79f6ad34a7a25780a533b45536 | c88abe0c856ff39431598f26bdd429e6 | Simple truncated exponential eigenvalue model from notes
This actually generates the covariance matrix.
Default parameters attempt to loosely match eigenvalues of SLR. | import numpy as np
n_max = 22
fx_vec = np.array ( [ \
0.8689780717709105E+00, \
0.2776712616989048E+00, \
0.05147914933043151E+00, \
0.006743927971987495E+00, \
0.0006838294584220406E+00, \
0.00005658597917091951E+00, \
3.955923765931341E-06, \
2.394450910776484E-07, \
... | 0 |
482e1d2c689d31e45dc168e2970e229c | b62fb58792b26de63211c8c936261236 | Returns a collection of the sibling elements before this node, in document order. | namespace Ivony.Html
public static class NavigateExtensions
public static IEnumerable<IHtmlNode> SiblingNodesBeforeSelf( this IHtmlNode node )
{
return node.SiblingNodes().TakeWhile( n => !n.Equals( node ) );
} | 1 |
0410d2d1172ee05a0bba8906e097fb71 | 9345b1918a8f1fc8e31d758f0a0beba8 | Test register_view posted with empty form. | data = dict(fname="kerubo", lname="12345")
response = self.app.post('/register', data=data, follow_redirects=True)
self.assertEqual(response.status_code, 200) | 0 |
1d4d6214cc1637b467fb7c3b9a9488c3 | e8a8e883f56007133bab451bfd5fd2fd | 获取群组内已安装的所有应用列表 | $callback = empty($_REQUEST[self::_AJAX_PARAM_BK]) ? '' : $_REQUEST[self::_AJAX_PARAM_BK];
if(empty($_REQUEST['gids'])) {$this->out($this->gen_resulet(true, '' , array()),$callback); exit();}
$gids = $_REQUEST['gids'] ;
$apps = array();
foreach ($gids as $gid) {
$appsOfOneGroup = get_group_app($this... | 1 |
73ff09d8a0cad8c1b4fa63a8ff5e3824 | 64233af048b8b4138866ca512d79f6e7 | Gets AssemblyDefiniton containing the specified type. | namespace ICIDECode.NRefactory.TypeSystem
ITypeDefinition GetTypeDefinition(TopLevelTypeName topLevelTypeName); | 0 |
d0d700c7d94624eee6446c19b88b73ca | 3303df78bb8c50e9802a0b4f8abc3b74 | 设置iframe的内页路径 | function changeIframePath(checkde_index) {
var iframePath = "";
switch (checkde_index) {
case "0-1":
break;
case "0-2":
break;
case "1-1":
break;
case "1-2":
break;
case "2-1":
iframePath = "../helmetPosition/helmetPostion.html";
break;
case "2-2":
iframePath = "../foundation/foundati... | 1 |
54ac9e2de8b148bc0c4d4d02544441ab | 86bfeebac37d66b9bd733b85229aaffd | Called when the val epoch ends. | class LogRunMetrics(Callback):
# callback at the end of every epoch
def on_epoch_end(self, epoch, log):
run.log('val_loss', log['val_loss']) | 1 |
c4d0ee71e8c23c0f9b140a1d88a9abdc | afa329d1d800688222e0c8137a9a246e | Find an already existing playlist using it's ID | namespace BrightcoveMapiWrapper.Api
public partial class BrightcoveApi
public BrightcovePlaylist FindPlaylistById(long playlistId)
{
return FindPlaylistById(playlistId, null);
} | 1 |
4fffbcde02ba2426bec53b35f6d12df2 | 7e031fbf7454fcfe9fd2f45dadc70bc1 | Generates random amount followers following a exponential distribution. | int n = 0;
double p = Math.exp(-lambda * time);
double s = p;
double u = rng.nextDouble();
while (u > s) {
n = n + 1;
p = p * lambda / n;
s = s + p;
}
return n;
} | 0 |
4f359385f09b227cb9659c7e132ecb17 | fbe727c4547651711b7161c819220d9a | 根据条件获取monitor列表,无分页 | Map<String,String> map = new HashMap<String, String>(4);
map.put("pid",pid);
map.put("dateType",dateType);
map.put("dataType",dataType);
map.put("searchTime",getSearchTime(dateType,searchTime));
List<Map<String,String>> list = monitorDataDao.getList(map);
if(CollectionUtils.isEmpty(list)){
return null;... | 1 |
a4d47da8e1c7cec461c55ae4a05d714e | 8d9cf05c3d81425b5b7a6ccc14ec8db2 | 二进制查询控制 | class ResourceQuery:
def supports_bin_query(self):
return | 1 |
fa0c1b75e03b38080b1fccebce4234be | e40f75e5f55b28683d909c076988c092 | リールは全て止まっているか | {
var flg = mOmatsuri.IsReelStopped(0) &&
mOmatsuri.IsReelStopped(1) &&
mOmatsuri.IsReelStopped(2);
return flg;
} | 1 |
1a11c21220910c49f586f6eb7bd63640 | 077084c2229f29e21dd53dc52b47f1f6 | upon mouse hover over the "New Game" button | public class MainWindow extends JFrame
private void newGameButtonMousePressed(java.awt.event.MouseEvent evt) {
newGame.setIcon(new ImageIcon(getClass().getResource("/blackjack_iteration2_images/NEWGAMEbuttonCLICKED.png")));
} | 0 |
d05e07533194f4b68f56488dcea9b5c1 | 8bb4013eecd77b15c057f57ff17a23bc | Fonction vérifiant que les deux utilisateurs reçus sont présents dans le graph.
l'erreur rencontrée. | class MESGraph(nx.DiGraph):
def checkTypeThreeError(self, som1, som2, reaction):
if self.has_edge(som1, som2):
self.addTypeThreeError(som1, som2, reaction)
return True
elif self.has_edge(som2, som1):
self.addTypeThreeError(som2, som1, reaction)
return True
else:
return False | 0 |
8b1d5a83c961bf76cb8271793dabdd79 | 403b8deb4a8867dde166e246fc975b6e | 创建渲染器(并设置抗锯齿属性) | class App
static createRenderer(canvas) {
let renderer = new THREE.WebGLRenderer({
canvas
});
renderer.setPixelRation(Window.devicePixelRatio);
renderer.toneMapping = THREE.ReinhardToneMapping;
renderer.toneMappingExposure = 2.0;
return renderer;
} | 0 |
c24db1f1e60befb973a9b9500dcbf43c | a956ec1c649d8022f2fda9348cd7e75f | 设置下一动画阶段的开始点,结束点,以及开始的时间 | {
this._start = start;
this._end = end;
this._times = times;
this._endAt = endAt;
if ( this._end == -1 || this._end > this.frameCount - 1 )
this._end = this.frameCount - 1;
if ( this._endAt == -1 || this._endAt > this.frameCount - 1 )
this._endAt = this._end;
this.currentFrame = start;
... | 1 |
add1df3b61611f1b313e541aa32e6bc8 | 87c1d95bd40d99b3918e8a4ff7d998a9 | [RO] Verifica paginile obligatorii (https://github.com/celdotro/marketplace/wiki/Verifica-pagini-obligatorii)
[EN] Checks the mandatory pages (https://github.com/celdotro/marketplace/wiki/Check-mandatory-pages) | class cdc_googletagmanager extends Module
protected function isOrderValidationPage() {
$ordervalidationpage = false;
$controller = Tools::getValue("controller");
$module = Tools::getValue('module');
if($this->debug_enabled) {
$this->addDebug("[isOrderValidationPage] controlle... | 0 |
46ffed76ca777d121eede579c5f68dae | 9ac32dab65fc574ec1fd5d9578e6368c | Returns the scenes last update time | time_t RPG_volume_status_last_updated(){
return( Last_vs_update_time );
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.