query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f27a95a8e7cd3f04302c12ac8c629a14 | 80b7854d91a9e58da20e547fdbc383f8 | Exit a parse tree produced by {@link ASParser#primaryNoNewArray_lf_primary}. | void exitPrimaryNoNewArray_lf_primary_lf_arrayAccess_lf_primary(ASParser.PrimaryNoNewArray_lf_primary_lf_arrayAccess_lf_primaryContext ctx); | 1 |
936fdc94ab02d978a75fddc9027125d9 | 3d91096b1733098685ff3ea03b47d964 | diac and variation selectors | public class SelectorUtils
@SuppressWarnings("ConstantConditions")
public static String escapeSelector(String unescapedSelector) {
String escapedSelector = unescapedSelector;
if (Character.isDigit(unescapedSelector.charAt(0))) {
escapedSelector = "\\\\3"+unescapedSelector.charAt(0)+" "+escapedSelector.substr... | 0 |
c0c26911a44174fe232acdf9b7b2bcd3 | 1447b8aa61bbd22d6c22b6ef71820c09 | loads a book of the given name into the given array. | void loadBook(string dictArray[ARRAYSIZE], string bookName) {
ifstream inStream;
inStream.open( bookName);
if( !inStream.is_open()) {cout << "Could not find file. Exiting..." << endl; exit( -1);}
int i = 0;
string line;
while(getline(inStream, line)) {
if (!line.empty()) {
... | 1 |
6adb18785b64449238559a090f520908 | ba78c2623c495c829ad5fdfd016e40fa | ----------------------------------------------------------------------------
%%Function: DoColumnReorder
%%Qualified: AzLog.AzLogWindow.DoColumnReorder
%%Contact: rlittle
Handle a drag of the column header (reordering the columns)
---------------------------------------------------------------------------- | {
mIsDirty = true;
try
{
if (mColumnNamesInOrder != null)
mColumnNamesInOrder.Clear();
else
mColumnNamesInOrder = new Dictionary<int, string>();
for (int i = 1; i < mainGrid.Cols.Count; i++)
{
mColumnNamesInOrder.Add(i, mainGrid.Cols[i].Name);
}
}
catch (Exception ex)... | 1 |
4fd310caa0adfb39d35d432d932d71c7 | fa2042908bb7cc7a88e7dac7f8d793e7 | 从SharedPreferences获取图片 | public class MainActivity extends Activity
private void getBitmapFromSharedPreferences(){
SharedPreferences sharedPreferences=getSharedPreferences("testSP", Context.MODE_PRIVATE);
String imageString=sharedPreferences.getString("image", "");
byte[] byteArray=Base64.decode(imageString, Base64.DEFA... | 1 |
a1838c3d95c5d9429e07fef4cc8a55e5 | 65338f683410ec37f233426686991c76 | remove the optimal node from solution | def remove_route(sol, r):
data = u.pop(sol.r, r)
cust = map(itemgetter(0), data[R_EDG])[1:]
u.ada(sol, 'k', -1)
u.ada(sol, 'dist', -data[R_DIS])
return cust | 0 |
8c243b9437ae38e290b218a0b8cef504 | 0690a0da571a2f39815e596ae9411c56 | verify that the event falls into the relevant date parameters | class Scheduler(object):
def _in_time_range(self, event):
start_dt = datetime.combine(event.start_dt.date(), self.start_time)
if self.end_time > self.start_time:
end_date = event.start_dt.date()
else:
end_date = event.start_dt.date() + timedelta(days=1)
end_dt = d... | 1 |
ac6b1c667148c4a115d9760ab7f8cb69 | 680294bb09bd07aad30e72e22fdc7199 | 获取相似橱窗 | class ShowWindowDetailPresenter(view: ShowWindowDetailContract.View) : ShowWindowDetailContract.Presenter
fun getRelateShowWindow(rid: String) {
dataSource.getRelateShowWindow(rid, object : IDataSource.HttpRequestCallBack {
override fun onSuccess(json: String) {
val discoverLifeBean ... | 1 |
24ab6a752927e1066cdb77ba904edac8 | 191f04a347a0ebda04629b559fa37382 | Called when the content share has started.
This callback will be on the main thread. | public class FacebookShareActivity extends AppCompatActivity public void initFacebook()
@Override
public void onSuccess(Sharer.Result result) {
} | 0 |
c622171aa368b6534dbbbe6a7bfe9bf3 | ac14d02fe990f91259c0990368241515 | Draw a solid sphere and return the corresponding object
Keyword arguments:
name -- The name for the new sphere object
r -- The radius
segments -- The number of vertical segments (like beach-ball panels)
rings -- The number of rings (horizontal slices)
location -- The location of the center of the sph... | def create_sphere(coordinates, radius=5, mask=None):
from nltools.data import Brain_Data
if mask is not None:
if not isinstance(mask, nib.Nifti1Image):
if isinstance(mask, str):
if os.path.isfile(mask):
mask = nib.load(mask)
else:
... | 0 |
6eb99e09d5b9e8e20a89d15d9f3864a8 | 5c8296d34f865ced14038596c3361f38 | Fakultät rekursiv | if n > 1:
return n * fakultet(n - 1)
else:
return n | 1 |
adb55fce94450fcf34a01612d3c0c556 | e278be1e63877ef64cf5a1d4a984a9f6 | Read an 64-bit value from the specified address.
Corresponds to viPeek64 function of the VISA library. | __attribute__((unused))
static uint64_t
kernel_ioread64(uint64_t kvaddr) {
return kernel_read64(kvaddr);
} | 1 |
23a3bd53af02fb052ffbaccac364f468 | 7f2fc8bba82b162b21115450ed953c08 | Returns the succeeding version where the corresponding search string matches. | if (isSearching() && mMatchCount > 0) {
return mPreviousMatches.size() + 1;
} else {
return NO_MATCH;
}
} | 0 |
902a9a4e3450a8159944f43d4cbedeb8 | 8d8c67cbd6db42668d5a2ec22d16df3c | Computation of the signal power in dB
Notebook: C1/C1S3_Dynamics.ipynb | def compute_power_db(x, sr, win_len_sec=0.1, power_ref=10**(-12)):
win_len = round(win_len_sec * sr)
win = np.ones(win_len) / win_len
power_db = 10 * np.log10(np.convolve(x**2, win, mode='same') / power_ref)
return power_db | 1 |
1d7dab7dc37a615a872ee3b7e10d7a2a | 0a2e5bfcefbab3646a98c6df2a4dacaf | This method is invoked whenever something is happening in notepad++
use eg. as
if (notification.Header.Code == (uint)NppMsg.NPPN_xxx)
{ ... }
or
if (notification.Header.Code == (uint)SciMsg.SCNxxx)
{ ... } | namespace Kbg.NppPluginNET
class Main
public static void OnNotification(ScNotification notification)
{
} | 1 |
7d2e89997ebbd3d26bbe43ee55df102d | 944dbce7c3320a60afa694d2dfa9cc8f | konvertiert Wiki-Formatierung ('''...''', ''...'', <u>...</u>, <i>...</i>, <b>...</b>) nach LaTeX | label = ''
text = ''
to_be_print = []
in_tex = False
for char in html:
if char == '<':
label = '<'
to_be_print.append(text)
text = ''
elif char == '>':
to_be_print.append(label + '>')
label = ''
elif char == '$' and ... | 0 |
d3ce1cf9116432764fa83a2a841bed32 | 8f7c0768edec91b15fa40eea7dfadbba | decode 4 '6-bit' characters into 3 8-bit binary bytes | assert(0x0800<=u<=0xffff)
a = u%64+0x80
u = u>>6
b = u%64+0x80
u = u>>6
c = u%64+0xe0
return c,b,a | 1 |
94b9b320a71fc22647c6ededbc33de05 | e8f4ba11bb9cdaefc6f64d17415c44d7 | Pass an i2c device, and this fxn will purge all of its queued work. Presumably, this is
because it is being detached from the bux, but it may also be because one of it's operations
went bad. | template <class T> class BusAdapter : public BusOpCallback
int8_t I2CAdapter::advance_work_queue() {
int8_t return_value = 0;
bool recycle = busOnline();
while (recycle) {
recycle = false;
if (current_job) {
switch (current_job->get_state()) {
case XferState::IDLE:
case XferSta... | 0 |
d61043c48f2b00433d6ad57f3341453f | 1644bc33b44a792dfa985a178202001f | 添加实体对象集合(自定义sql语句) | namespace BLL
public class BaseBll<T> : IBaseBll<T> where T : class, new()
public virtual IEnumerable<T> AddEntities(IList<T> list)
{
IEnumerable<T> entities = BaseDal.AddEntities(list);
SaveChanges();
return entities;
} | 0 |
907d51dfeee78accda6cb04693a1109a | 61a9b166d380fca0b250f5722530c58d | Merges the second object parameter into the first object, in-place. | for (var key in obj2) {
obj1[key] = obj2[key];
}
} | 1 |
9893973f8dde764e8d791d58fca6d8a9 | 2615f6c978841921b40771f6dd6418b3 | Convert input image to JPG, JPEG format Converts the input image into JPEG/JPG format. Customize encoding parameters. Supported input file formats include AAI, ART, ARW, AVS, BPG, BMP, BMP2, BMP3, BRF, CALS, CGM, CIN, CMYK, CMYKA, CR2, CRW, CUR, CUT, DCM, DCR, DCX, DDS, DIB, DJVU, DNG, DOT, DPX, EMF, EPDF, EPI, EPS, ... | namespace Aspose.Imaging.Cloud.Sdk.Api
public class ImagingApi
public System.IO.Stream ModifyJpeg(ModifyJpegRequest request)
{
if (request.name == null)
{
throw new ApiException(400, "Missing required parameter 'name' when calling ModifyJpeg");
}
... | 1 |
df42b523a04f7c635b8e5fdd9aedbccd | 7e1636e31296ab1c26cec064df7cc90a | 查询用户所属职位ID集合 | public List<Integer> listUserRoleIds(int userid); | 1 |
57cc36952d85c222251f24ac5b9538df | 49797aca9973a952bdce3f7276c78e66 | Stops the constant spawning of ghosts. | {
m_bAboutToNotBeAbleToKillGhosts = true;
float fStartTime = Time.unscaledTime;
const float c_fTimeToWait = 0.25f;
while (Time.unscaledTime - fStartTime < c_fTimeToWait)
yield return false;
m_bCanKillGhosts = false;
m_bAboutToNotBeAbleToKillGhosts = false;
} | 0 |
6ed191c6c16ff9d4a64e17d9647b0c56 | 67ce03578b87d8fe3471fec99f29fc38 | Dispatches the PDF generation in the concrete PDF generator. | class JasperGenerator(object):
def generate(self, data=None):
return self.generate_pdf(data) | 1 |
878a28f93c47c8f980a887ab17fafe58 | f607988e4f9326f87b21796b68ffba0e | OK, working | console.log('==========*************==========')
console.log('-- OBSELETE WAY OF DOING THIS. --')
console.log('-- PLEASE USE .queryRaw NOW --')
console.log('-- QUERY USING SQL STATEMENT --')
console.log('==========*************==========')
let cursor = `UPDATE ${tabl... | 0 |
18c20eb4d6967a93817c3a3c3a4140e9 | 212cbd96b3b6888f939bbd54f33ebc60 | Getter method for the chrome driver path field. | public class SeleniumOptions extends VersionedAbstractParam
public String getFirefoxDriverPath() {
return firefoxDriverPath;
} | 0 |
6815e948cbc35673bafa4a6c8a857e96 | 9bb691afbc2a09beb07f944fff5d8ca6 | 通过委托获取临时访问密钥
该接口可以用于通过委托来获取临时访问密钥(临时AK/SK)和securitytoken。 临时AK/SK和securitytoken是系统颁发给IAM用户的临时访问令牌,有效期为15分钟至24小时,过期后需要重新获取。临时AK/SK和securitytoken遵循权限最小化原则。鉴权时,临时AK/SK和securitytoken必须同时使用,请求头中需要添加“x-security-token”字段,使用方法详情请参考:[API签名参考](https://support.huaweicloud.com/devg-apisign/api-sign-provide.html) 。 该接口可以使用全局区域的En... | public class IamAsyncClient
public CompletableFuture<CreateTemporaryAccessKeyByTokenResponse> createTemporaryAccessKeyByTokenAsync(CreateTemporaryAccessKeyByTokenRequest request) {
return hcClient.asyncInvokeHttp(request, IamMeta.createTemporaryAccessKeyByToken);
} | 1 |
ae6cb94bc63ee4752f41e182934f5ce5 | b0abca8f76b49f544bdd20085cad4a01 | доступ к пропертям NetObj по имени через поля класса ( AgentNetObj.angle=0 равноценно AgentNetObj["angle"] = 0 ) | class IFNetworkClass():
########DEFINE A DEFAULT CONSTRUCTOR#########
def __getitem__(self, key): return self.__dict__[key]; | 1 |
7c3fe697b36a3e42a65239b50a6460e1 | ea19ec86569fd9aa58ec27b4e61d6527 | Palauttaa aina luvun, joka osoittaa, kuinka monta km henkilö on juossut
kuluvan vuoden aikana. Ei omista näytetään vain julkiset. | public int annaKierroksienMaara(); | 0 |
011a09ba990f6f51032e834f85b0e613 | 95073251b594df82e603c4254cbf0af5 | builds the Open Weather Maps url based on the lattitude and longitude given | const api_key = "c80fa9cb65a6496da87b7ddf658498d3";
const baseUrl = "https://api.weatherbit.io/v2.0/current";
return `${baseUrl}?lat=${lat}&lon=${lon}&key=${api_key}`;
} | 0 |
6789dd8faf45c277cc348b19d0a9ce4d | 83202c070e7757fad1a7e057f2681748 | Move delivered file from the DTS spool to the final raw data area.
This function will ensure that the destination directory exists. | {
Octstr *os, *hash, *dir, *filename;
os = octstr_duplicate(smsc);
octstr_append(os, ts);
hash = our_hash_func(os);
octstr_destroy(os);
dir = octstr_format("%S/%ld", spool_dir, octstr_hash_key(hash) % MAX_DIRS);
filename = get_msg_filename(dir, hash, dst);
octstr_destroy(dir);
octstr_destroy(has... | 0 |
5d652b3017633269975d7a700071e4e5 | 06671aec6dbdb8baecc04ce1234e9623 | Using Fisher-Yates shuffle // | function knuthShuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const random = Math.floor(Math.random() * (i + 1));
[array[i], array[random]] = [array[random], array[i]];
}
} | 1 |
52532957dafdd0b87e8d52f890ba2369 | 0487a60497683548340fec58433d9c2f | Get the generator weights.
Returns:
(list of tf.Variable):
List of weights. | class Policy(BaseModel):
def get_params(self, inputs):
variable_features = self.root_gcn(inputs)
dot_weights = self.weight_generator(variable_features)
return dot_weights.view(-1, self.n_input_feats) | 0 |
dd5a4f8fbff13e67cfc29aa90b8d1764 | 341d31b47bba426d83d01da15bab593b | Number of SSL handshakes on TLSv1 on the NetScaler appliance. | try :
return self._ssltlsv12handshakesrate
except Exception as e:
raise e | 0 |
2c957da912aa64dd5e75b3c0da54eed1 | ef305892e13649f277e36f3c77144492 | Changes the status of Light component attached to Player. Called when the light button is pressed. | public class MiniLight : MonoBehaviour, IPointerDownHandler
void Update()
{
if (player != CurrentPlayer.currentPlayer)
{
player = CurrentPlayer.currentPlayer;
light = player.transform.GetChild(7).GetComponent<Light>().gameObject;
}
} | 0 |
f31f297b78c302eb70de3a2da400bdc1 | 3d2d2c55a2fa6d529c168e6287f24fa9 | Gets the last picture from the DB | namespace ClawLibrary.Services.ApiServices
Task<Media> GetPicture(); | 0 |
a945ebd2183c8e1dd1615f79c035ae70 | 37b66ab8804a9f23282ee7da61ec7e63 | Annotate dates in a clinical note
Return the date annotations found in a clinical note # noqa: E501 | print("Bulid dates")
dates = {date: do_date(date) for date in s.unique()}
print("Replace dates")
return s.map(dates) | 0 |
dece6e81da924e02206ba9ed6494b9bf | fe958c5c808903e7e7a7abc57e87d8ca | Gets send transactions timer. | public abstract class Transaction
extends MessageChannel
public int getRetransmitTimer() {
return SIPTransactionStack.BASE_TIMER_INTERVAL;
} | 1 |
b863846e13b8111d9aebc1ead0d7f04f | 37b00e10c725250aaa8b55dcfa4e2518 | Retrieves statistics on search service. Information is provided on documents, partition indexes, mutations,
compactions, queries, and more. | options: GetServiceStatisticsOptions = {}
): Promise<ServiceStatistics> {
const { span, updatedOptions } = createSpan(
"SearchServiceClient-getServiceStatistics",
options
);
try {
const result = await this.client.getServiceStatistics(
operationOptionsToRequestOptionsBase(upda... | 1 |
65862ac10eec5ff03242745f83267958 | da8d3236ce8e819ecb5341c25397e197 | Whether responses has the specified line | {
foreach (LineData ld in lines)
{
if (ld.lineNumber == line) return true;
}
return false;
} | 1 |
cb65329c44cd0d3119e385e54d8bb200 | 87987b86ee8d2fa1b2051859e565617b | Returns the transaction inputs in this pool. | export class TransactionClient implements ITransactionClient
public async getInputs(seed: Hash, startIndex: number, endIndex: number, security: AddressSecurity, totalRequired: number): Promise<{ inputs: Input[]; totalBalance: number }> {
this._logger.info("===> TransactionClient::getInputs", seed, startIndex, e... | 1 |
9ab1ec072737a3d4dd6ef0529225cb9e | 1438a238141609bf0c061fbcbbb89cce | 预处理UIPrefab,实际打包资源是使用图集资源的UIPrefab | {
#if Use_AB
string abfullname = ResourceHelper.getResFullName(EABType.E_AB_NONUIPREFAB, nonuiprefabname);
AssetBundle nonuiprefabab = null;
GameObject nonuigo;
if (mNonUIPrefabAssetMap.ContainsKey(abfullname))
{
nonuigo = GameObject.Instantiate(mNonUIPrefabAssetM... | 0 |
3a564851b938abead1ee42a71e8a1ae9 | 2b6e4ff48a8ed2c2792c08b53fce3f51 | Advance the position of the cursor by one and return the Feature object at that position. | namespace gView.Framework.Data
Task<IFeature> NextFeature(); | 1 |
5bd9be6a2b4104f960184aab9a62a1f2 | 094dcce903cc749380a07b746a82b87e | Liefert den Index der aktuellen Ecke zurück. | public class Simulator
public int getCurrentIndex() {
return currentIndex;
} | 1 |
db1d97e93f8b4d2d931086c111ef19c4 | 54a6f5253d5e33bd567078d9cb958499 | 查询部门完成情况 | void department(Map<String, Object> map); | 0 |
5c5e4200cdb565c0b77856216607c9b2 | bb305f33f63ed94841e2fb9cd97c0a09 | Gets the value of the fundingType property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ESB_FSSC_FSSC_ImportReceiptInfoSrvInputItem", propOrder = {
"prikey",
"operatetype",
"receiptid",
"crmpartyidfrom",
"crmpartynamefrom",
"sapsalesorgcode",
"sapsalesofficecode",
"crmpartyidto",
"crmpartynameto",
"sapcustomerid... | 0 |
981c470a73a38c05bb95da38d649fd8e | 3eb89721bb174837879ffa9ad8ea13e6 | Get the number of pairs which match the condition that the sum of integers in pair is zero.
Time complexity: NlogN | {
int pairs = 0;
int i = 1;
while (i < 20)
{
if (array[i-1]%3 ==0 || array[i] % 3 == 0)
{
pairs++;
}
i++;
}
return pairs;
} | 0 |
cca79a58e3b5001e7f3b81d5303446c2 | d5a8efd59a5347a842eb67f3b87e6b34 | peek() returns the top item in the stack | {
if(stk == NULL)
return 0;
if(cur == NULL)
return 0;
if(stk->size == 0)
return 0;
*cur = ( stk->data[stk->size-1] );
return 1;
} | 1 |
def9e98b60e3bfc493bcd7693e702096 | 817337688f9f94cdbcb430e64b37ca31 | 收起 | dom.next().slideToggle();
dom.parent().siblings().find('.right').attr("class", "iconfont icon-iconfonti right");
dom.parent().siblings().find(drop).slideUp();
var iconChevron = dom.find('.fa-caret-right');
var iconChevrons = dom.find(".right");
if (iconChevrons.attr("clas... | 1 |
a7ac469008367b9878c7b7ad7139bacb | c7ea8bf4500a6cab17079ce22ec52d6a | Checks the availability of ImageMagick on the system. | class Magick{
public static function info(){
exec ('magick --version', $output_info, $return_val);
if($return_val != 0){
throw new \Exception('ImageMagick未找到,请到https://www.imagemagick.org下载安装。');
}
} | 1 |
96bdf502b31db17c17a0313500fcef3a | 4c0568deaf0d6f93f4a1279d93feba9b | Relative uncertainty on the total weight.
We assume the different contributions to be uncorrelated and sum the relative uncertainties in quadrature. | if 'trcWtW_WW' not in self._cache:
self._trcWtW_WW = self.diagWtW_WW.sum()
self._cache['trcWtW_WW'] = self._trcWtW_WW
return self._trcWtW_WW | 0 |
9f57c4550dc0a48e1e05eb13b565a30f | 9190c3e9412d23e516faae99745cfc80 | Nos permitirá enviar email para validación de usuario. | try:
send_mail(
config.get_option('VALIDATED_MAIL_SUBJECT'),
generate_validation_mail_message(v, operador),
config.get_option('RETURN_EMAIL'),
[v.email]
)
except:
return None
return v | 1 |
557a6e0ad3b71c5140bab8ad66d33ea1 | a027819c3f6f9b949c475dbc9b3277cd | 设置字段utime 项目更新时间 | @Table(name = "p_charge")
public class Charge
public void setUtime(Date utime) {
this.utime = utime;
} | 1 |
67ca6d5d1e6c03480e3ed8b88d379914 | 21185face32607da5e12c910f7387d06 | hides or shows due dates | {
global $nameTools;
if ((is_allowed_to_edit() OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous())) and $_GET['isStudentView']<>"false")
{
if (isset($_GET['id'])&&$_GET['id']&&isset($_GET['action'])&&$_GET['action']=="showhide")
{
$id=(int)addslashes($_GET['id']);
change_visibility... | 1 |
722198322a7d0758239c819cb97b0e03 | eaaa5c8ae2286273bbecfef6f5323c69 | Set the captcha generator | class HTML_QuickForm2_Element_Captcha_TextCAPTCHA
extends HTML_QuickForm2_Element_Captcha
public function setAdapter(Text_CAPTCHA $adapter)
{
$this->adapter = $adapter;
} | 1 |
6a24dc94cc6872199c2af5d201332a70 | d68125611baaa00469eb5939339f3a84 | Гроза | global Zoloto, CON, CONm
Story[31] = story() + CONm
print('-Испытание стойкости:')
if Story[31] <= 4:
print('Вы чуть было не умерли. Вы теперь хромаете, вас терзает жуткий кашель, \n'
' у вас искривлённые руки, подслеповатый глаз или другое ярко выраженное недомогание.')
elif 5... | 0 |
d00a28e66d615b3f647a83d2b039e3bd | 1d0c5989eb2651f69692de2fbb30b793 | 選択中のテナントにおけるレジストリ情報を取得する | namespace Nssol.Platypus.DataAccess.Repositories
public class RegistryRepository : RepositoryBase<Registry>, IRegistryRepository
public IEnumerable<Registry> GetRegistryAll(long tenantId)
{
return GetModelAll<TenantRegistryMap>().Include(map => map.Registry).Where(map => map.TenantId == tenantId... | 1 |
f2536df3e70689b9cb0ef5685c2ba14c | a9081113ae5cd5be75836b5f871ee6e6 | 将http开头的url改成https开头的url | .replace("href=\"/i/", "href=\"https://i.v2ex.co/")
.replace("href=\"/t/", "href=\"https://www.v2ex.com/t/")
.replace("href=\"/go/", "href=\"https://www.v2ex.com/go/")
.replace("<img src=\"//", "<img src=\"http://") | 0 |
7207c7584470dd4ee367f281cc234dd0 | 94a837bbb879f8cb588296b3f79acad5 | Function to compute value of npr | class Main
static
int nCr(int n, int r, int p)
{
if (r==0)
return 1;
int fac[]=new int[n+1];
fac[0] = 1;
for (int i=1 ; i<=n; i++)
fac[i] = fac[i-1]*i%p;
return (fac[n]* modInverse(fac[r], p) % p *
modInverse(fac[n-r], p) % p) % p;
} | 0 |
1898449e74140a389aecda1d6818236b | 35c7539d5f87d32ce4b7bfb1d709adf9 | Associate a Person object to this object
through the moviesPersons cross reference table. | {
if (this.get_movie_director() != null)
this.entity_movie_fq_name = build_fq_name(this.get_movie_name(), this.get_movie_director().get_person_name());
else
this.entity_movie_fq_name = build_fq_name(this.get_movie_name(), null);
for (String label : this.entity_movie_labels)
{
if (this.get_movie_direc... | 0 |
d434b33cb52ae6d732813116acf4acbd | 37e8b25644a68d5c5d63845c048aaee3 | On récupère la meilleure valeur possible du pivot | int lig, col, val_ret, lig_max = -1, col_max = -1;
int val_max = -99999;
int mat2[N][N];
int tab[54];
for(lig=0;lig<N;lig++){
for(col=0;col<N;col++){
if(coup_possible(mat,couleur,lig,col) != 0){
copie(mat, mat2);
ecrire_mat(mat2,couleur,lig,col);
val_ret = retourner(mat2, couleur,... | 1 |
ab9e9c4f22b328ad34e02784e01d8949 | 48eb7d2bebd91b0943310b3da80ad17a | Create a property for the table or view flag. | public static BooleanExpression flagProperty(String flagName)
{
return flagProperties.computeIfAbsent(flagName, f -> new SimpleBooleanProperty(getFlag(f)));
} | 1 |
5842c6fc5f0f53a14910c1b177115f88 | 6fae4acf0700b7c3b0bdf78e834a4ce5 | Fetch mails, parse, update store, and send back the event | {
if (!$force && !$this->getConfig()->isRefreshMetadataAllowed()) {
return $this;
}
if (!$force && !$storageEmail->isEventOutdated()) {
return $this;
}
$events = $this->getEventsFromApi($storageEmail->getMessageId(), $storageEmail->getEmail());
... | 1 |
3f84a131701a2465aa1c4e8c25ca85b6 | 0b4fefcb0813540ab6b38ca7d8fa8fe1 | whether they are both nan or both non-nan | def na_cmp():
return lambda x, y: bool(np.isnan(x.magnitude)) & bool(np.isnan(y.magnitude)) | 0 |
554aa2e244346e6a8e8d0eb44a3be3f1 | 11204be9e2af0635ac34607703522995 | allow statements like const A_B = "test" | export class Assembler
public parseConstant(text, labels, subst, logger) {
var match = text.match(/^\s*([A-Za-z_.][A-Za-z0-9_.]*)\s*=\s*(\S+)/);
if (!match) return false;
var name = match[1].toLowerCase();
if (
this.REGISTERS[name] !== undefined ||
this.SPECIALS[name] !== undefined
) {
... | 1 |
f17995bff83bfda72426f83ca5040cf7 | 5f1af4bf7bd14188afb21b807b9a0c83 | Returns whether or not the UI should show the pet select screen. | if (!this.GuildPets) {
return true;
}
return this.GuildPets.length >= Data.getModule("models.pets").getNumber("slots");
} | 1 |
049ddee94154016d502e348099ab4f65 | c9a709f9fce70ff370dc6a5a44b400da | 分页查询报价商品列表(询价商品ID) | namespace OA.BLL
public class AskPriceBLL
public DataSet GetPageList(string apCode, string clientName, string state, int pageSize, int startRowIndex)
{
return iAskPriceDAL.GetPageList(apCode, clientName, state, pageSize, startRowIndex);
} | 1 |
20111a67437ce91496793ecae5301a07 | dbc3b522a6bd23274b34acf7f474b521 | Maps messages to services. | public class EligibilitySummaryServiceClient extends GenericServiceClient
private void mapServiceTypes(WSIFService service) throws WSIFException,
ClassNotFoundException {
service.mapType(new QName("http://request.detail.elig.prv.uhg.com",
"Request"), Class
.forName("com.uhg.prv.elig.detail.request.Request"... | 1 |
7ca9fb0fe124956a2294b38e29e223bd | 28d234094389777614e0d29a2b7f38a8 | 指派客户到某一销售人员下 | function assignSales() {
var salesmanId = $("#model-salesmanList").val();
$.ajax({
type: "POST",
url: "assignSalesman",
async: false,
dataType: "json",
data: JSON.stringify({
'salesman': {
... | 1 |
d82b94865b1a4089eb4f363454a5f646 | eab37a08aacc7a38ea4d436ef52c735f | Return a copy of +hash+ with all of its keys normalized by #normalize_key. | class Hash
def transform_keys
result = {}
each_key do |key|
result[yield(key)] = self[key]
end
result
end | 1 |
a52e8d9ec68fbd56c111dc436a605363 | ff437e1cbe523e81781736b486332170 | Check if the max length check is set or not | public function hasLength(); | 0 |
adfa7445ba80a4a2bf45ae625fe33592 | 0d27f19ff4e8150fe46a76f9326edd4d | Calls one of the simulators. | {
if (Configuration.scheduleType == ScheduleType.FCFS)
simulateFCFS();
else if (Configuration.scheduleType == ScheduleType.SJF ||
Configuration.scheduleType == ScheduleType.PS)
simulatePriority();
} | 1 |
2d53a72e77ba48728e03cc8e00ee342a | 205dfb56470eae990939ed0f508a9d06 | @brief IRQ Handler
This function handles DMA1 stream0 global interrupt. | void DMA1_Stream0_IRQHandler(void)
{
ENTER_ISR();
if ((*irqHandler[DMA1_Stream0_IRQn])(irqHandlerArg[DMA1_Stream0_IRQn]))
taskYIELD();
EXIT_ISR();
} | 1 |
f9784920e7e3ec0c15c347f7965a0d05 | c7734b17c208aa5c24d060ba130df157 | Convierte los datos del RTC a un string con formato DD/MM/YYYY hh:mm:ss | void formatInfoRTC ( rtc_t *rtc, uint8_t *infoToSave ) {
infoToSave[0] = ( (*rtc).mday / 10 ) + '0';
infoToSave[1] = ( rtc->mday % 10 ) + '0';
infoToSave[2] = '/';
infoToSave[3] = ( rtc->month / 10 ) + '0';
infoToSave[4] = ( rtc->month % 10 ) + '0';
infoToSave[5] = '/';
infoToSav... | 1 |
f628e2a111a7746c53ee8b3090c85c17 | 7facb7bac6bf7049b5d9111e19fd51e9 | Retrieve allowed origins from the application settings. | {
if (null == allowedOrigin)
{
return allowedOrigin = new ArrayList<String>();
}
return allowedOrigin;
} | 0 |
c0a9ce12ef459163ddbf86294322c219 | f93ab599c601ffa8710dafdb3bc3c96a | construct file of edges from the input expression file. | lib_node* lib_vec[]) {
int exp_haz_nodes = 0;
char temp[7];
char expr[MAXEXPRLEN];
while (net_node->succ != NULL)
net_node = net_node->succ;
do {
net_node = net_node->pred;
fill_null(expr, MAXEXPRLEN);
if (net_node->head->ahazard || net_node->head->mhazard)
exp_haz_nodes++;
strcat... | 0 |
188b9633026941c6d2cf7340870b4359 | 521b98aedcb98044062d30ab433769a6 | METODO PARA MOSTRAR EL PROMEDIO DE TODOS LOS MESES INGRESADOS. | {
$total = 0;
for ($i=0; $i<=count($this->arr)-1; $i++) {
$total += $this->arr[$i];
}
$promedio = $total / count($this->arr);
return $promedio;
} | 1 |
b6d2b5aa4470817901950cfc61b036b6 | 56d389d756bb183ba0de2a06215454df | UVマップを爆弾に変更 | for (int i = 0; i < *BombCnt; ++i) {
Maze[BombArr[i].y][BombArr[i].x] = '1';
if (BombArr[i].y + 1 < 20) {
if (Maze[BombArr[i].y + 1][BombArr[i].x] == '0') {
Maze[BombArr[i].y + 1][BombArr[i].x] = '1';
}
if (Player->x == BombArr[i].x && Player->y ==... | 0 |
a02a5578cc8f15d3f21275cb96688f82 | 2eecc301663688f58fc6076fa58a6963 | Estimates the pose and intrinsics of a new view. | self.frame_height, self.frame_width, _ = np.shape(rgb_cams[0])
self.max_depth = np.max(depth_cams)
triangles = self.triangulation(pts, new_pts)
ref_triangles = self.get_reference_triangles(pts, new_pts)
projected_pixels = self.find_pixel_correspondences(triangles, ref_triangles, ... | 0 |
dfd1abed025d53aee075dc4feb4bbc84 | d616fc111dd36a7fc50fdf86ee9c8179 | Download official Malaria dataset to data_path | def download_qm9_data(data_dir):
data_dir = os.path.join(data_dir, 'qm9')
if os.path.exists(data_dir):
print('Found QM9 dataset - SKIP!')
return
prepare_data_dir(data_dir)
def download_figshare(file_name, file_ext, dir_path='./data/',
change_name=None):
... | 0 |
6f60a0a1373734b6200a52ad6d93bbc5 | b6e8b10b013e25b4ecd730aeb2833cfd | evaluate cross entropy on the whole dataset | def cee(y, t):
if y.ndim == 1:
t = t.reshape(1, t.size)
y = y.reshape(1, y.size)
batch_size = y.shape[0]
return -np.sum(t * np.log(y + 1e-7)) / batch_size | 1 |
9461e5dae973e51c00a8efda7148b3e8 | 1f6345bc03ca515ebdf20044db5e951b | Function to determine if two hosts are equivalent by resolving their absolute addresses | in1 = instance_name1.copy()
in2 = instance_name2.copy()
in1.host = None
in2.host = None
return in1 == in2 | 0 |
11707bd8756bf939c5ddf7974d2a7808 | 307a9c935103ce58f7f522366d1445eb | uses #2 constructor to build structure and initialized all pixels to a given color | ImageDataStructure::ImageDataStructure(int H, int W, unsigned char pixle) {
m_arr = new(std::nothrow) Pixel * [H];
for (int row = 0; row < H; row++) {
m_arr[row] = new(std::nothrow) Pixel[W];
for (int col = 0; col < W; col++) {
m_arr[row][col] = pixle;
}
}
} | 1 |
d888eac8b447e351c29bf62364f99e06 | 196d620d7abefe3e469eaa69edb90fbd | Création du menu déroulant des catégories | function SelectCategories() {
$count = GetConnection()->exec('SET NAMES utf8');
$count = GetConnection()->prepare("SELECT * FROM categories ");
$count->execute();
while ($row = $count->fetch(PDO::FETCH_ASSOC)) {
echo '<option value="' . $row['idCategorie'] . '">' . $row['nomCategorie'] . '</opti... | 1 |
66008732baf09717b34b9b1ebf896c2a | 55ca207b7740016b0ebda91f7cdce631 | Returns entire Flower array | class Flowers implements \Bloomon\interfaces\Flowers
public function getFlowers()
{
return $this->flowers;
} | 1 |
7fdf4cb2cef246d09db094117219afd0 | 8e1a58ab6ebff98e7a8237fa476e03ab | Test that the data route will return data with sample log file | self.user_login()
test_data = Data.objects.all().first()
url = "/data/retrieve/" + str(test_data.id)
res = self.client.get(url)
self.assertEqual(res.status_code, 200)
self.assertIn(b'application/json', res.serialize_headers()) | 0 |
55f444f287da860d4be05d9c04baf57e | 660ce5f7db942539557aa80154d4f240 | Expand this bounding box with another point. | namespace swftypes
void rect::expand_to_point(float x, float y)
{
m_x_min = Min(m_x_min, x);
m_y_min = Min(m_y_min, y);
m_x_max = Max(m_x_max, x);
m_y_max = Max(m_y_max, y);
} | 1 |
f2c4e3212a73114f329e5945c9037dc5 | 26bbfc9e0051c800eaac1431e14df545 | This method returns the value of the database column TB_FS_CONFIG_CHANGE.OBJ_ID
column comments null | @javax.annotation.Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.5.1"
},
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class MediaWasteRecord extends org.jooq.impl.UpdatableRecordImpl<jooq.generated.vcc.vcc_service.tables.record... | 0 |
d2e9b29a087688918d654100d84560ef | df513d87d83928406888956d1064f48f | This moves the piston to the opposite of its current state | public void initialize() {
if (intakePivot.getPosition() == Position.IN) {
intakePivot.flipOut();
intakePivot.setPosition(Position.OUT);
} else {
intakePivot.flipIn();
intakePivot.setPosition(Position.IN);
}
} | 1 |
3d951d5f5a421a393ebeb18078b41a2c | f66d401cf1ef0f23fd045f0b69f07173 | 添加自定义的标签 | class LabelController extends BaseController
public function SetLabel()
{
$name = Request::only(['name'])['name'];
$data = [
"tag"=>[
"name"=>$name
]
];
$data = json_encode($data,JSON_UNESCAPED_UNICODE);
$url = "https://api.weixin.qq.co... | 1 |
18d93d7586c3d82c5455a840d0f591b7 | e04e7e878e6a02cdd9e0268c3d704a47 | **********************ACQUIRE AC POWER DATA PHASE************************* | {
WORD wData;
InPort( &wData );
return( wData & ACPOWER );
} | 1 |
bb94a5f1df85e0a35d79f8bc1ed310f9 | 1545742243695c123a31ffabd8009df0 | generates frenet path parameters including the cost | double car_x, double car_y, double car_yaw, double car_s, int prev_size,
const vector<double> &previous_path_x, const vector<double> &previous_path_y,
const vector<double> &map_waypoints_x, const vector<double> &map_waypoints_y,
const vector<double> &map_waypoints_s, vector<double> &cost... | 1 |
a15327d67fc4e2b10b90c8ef8448df2c | 467f88999cf4ca2bf578783833f4909d | Lists all groups (DEBUG ONLY) | class tentakelShell(cmd.Cmd):
def do_listgroups(self, rest):
print "\n".join(self.conf.getGroups()) | 1 |
908524d87d29ce6afcdea102adbfbf6c | 7ea5027759870a56680b75280cd79750 | 导入专业数据 | class UserOption(UserInfoURLManager):
def import_user_info(self, session, username):
response = session.post(self.query_student_info, data={'xh': username})
result = json.loads(response.text)
code = result['rows']['ssxy']
majorcode = result['rows']['sszy']
dormitory = result['row... | 1 |
9e0a3b1b91798890e8c0a567b370820a | 00626fe4ccc4f2ce7b3f3043bf564f7b | 分页查询全部弹幕 | public class BroadcastChatDao
public LinkedList<BroadcastChat> queryBroadcastChatPage(int pageindex,
int count) {
LinkedList<BroadcastChat> list = new LinkedList<BroadcastChat>();
StringBuilder sql = new StringBuilder(
"select * from BroadcastChat Order By id desc ");
sql.append(" limit " + pageindex * cou... | 1 |
888e3b19741f0e1594890cc84b2a6746 | b440030760f23a5ea470880f328b0955 | 慢速上传文件的操作 | trash = 3
while trash != 0:
try:
result = self.client.upload_by_filename(filepath)
if result['Status'] == 'Upload successed.':
return self.check_exception(result)
else:
raise ConnectionError
e... | 1 |
9d89d9692a0687dfe2134cf70bec1a84 | 1d0767a99ba95a23be28f041999e9774 | Compute scene marginals over training data | if not self._post_eval:
samples = self._samples
if nbins is None:
nbins = 2 * int(np.cbrt(len(samples)))
nd = samples.shape[1]
self._posteriors = dict()
for ii in range(nd):
marginal, edge = np.histogram(samples[:,ii], d... | 1 |
e5307fe8c1c0cec75b340a2d2d65ef00 | c00c1b2074d3c4642cf5bec53429e7ab | 获取手机的IMEI值 International Mobile Equipment Identity国际移动电话设备识别码 | public class TieBaUtils
public static String getIMEI(Context context) {
String imei = "456156451534587";
try {
TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
imei = telephonyManager.getDeviceId();
} catch (Excep... | 1 |
0d51cc2b251abe400bd05def32af1a38 | 3ebb55ed3ee0a65f588fd1a16a3dba53 | Remove all blocks from page | function resetBlocks ( options ) {
if ( options.blocks ) {
Object.keys( options.blocks ).forEach( blk => {
options.blocks[blk].replace( '' )
} );
}
} | 0 |
1387b79f6e657dde63e524d006274c16 | 23f377099126892e0298bc8060b42827 | Get the number of data points in this segment. | public class HL7SegmentGroup implements Iterable<HL7Segment>
public int getCount() {
return segments.size();
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.