query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
371fc8e1c1102e9fa051fc72e8a6fd4e | 559cc5e2451ee1564a967764e7e9fd9a | Gets the "WarehouseReceptionMinDate" element | {
Integer ii = (Integer)get_Value(COLUMNNAME_M_Warehouse_ID);
if (ii == null) return 0;
return ii.intValue();
} | 0 |
ee5ac3f9678f16741a1560bbc26697e0 | d12919525f2de7d61ef0d36cb789462d | To introduce an arithmetic restriction in the query with {@literal !=} | final class QueryBuilder implements JsonBodyBuilder
public function neq(string $column, $value = null, $and = true)
{
return $and ? $this->where($column, '<>', $value) : $this->or($column, '<>', $value);
} | 1 |
55993ef48c0abe070a21826893352c72 | 1310e498b70b056608b7eeeb8e3f084f | Function that gets content of dynamic assets files and puts that in static ones | global $wp_filesystem;
WP_Filesystem();
if ( moments_qodef_is_css_folder_writable() ) {
$css_dir = QODE_ASSETS_ROOT_DIR . '/css/';
ob_start();
include_once $css_dir . 'style_dynamic.php';
$css = ob_get_clean();
$wp_filesystem->put_contents( $css_dir . 'style_dynamic.css', $css );
ob_start();
... | 1 |
0889d81771eace7356edc6797db6063a | 9ad1f14fc9f7d6cb74e863d5bdc973e1 | permette di impostare a mano tutti i parametri per l'invio della mail | class Mail{
public function setParams($params = array()){
if(isset($params['message'])){
$this->setMessage($params['message']);
}
if(isset($params['subject'])){
$this->setSubject($params['subject']);
}
if(isset($params['to'])){
$this->setTo($pa... | 1 |
44a9ae5a6963cef2f3deb3a8aaf54829 | f5abe6d2b3e061e47ab6dff16083b8da | Handles the user setting changes and licenses when using the large revision upload applet | {
if (DesignMode)
return;
License.LicenseName = Constants.LicenseName;
License.LicenseUser = Constants.LicenseUser;
License.LicenseKey = Constants.LicenseKey;
Text = "Related IDs";
SetUpForm();
} | 0 |
adf1c0c2b4f77157ee39c9ee447cfb28 | c1ec3bf7abedfe865db63c159e1fa025 | 指定したプレイヤーがリーダーのメンバーを集めてテーブルを作成 | {
teamData.LeaderObject = Generate((Camp)teamData.Camp, CharacterType.NormalCharacter);
teamData.Leader_BasicStatusData = leader_BasicStatusData;
teamData.TeamObject.GetComponent<TeamMemberManager>().LeaderInitialSetting();
return teamData.TeamObject;
} | 0 |
140fd18eed0d58b7f0b97a75f34fbec5 | c3d74b78f553a6ce89519242cabb42b0 | routage vers le composant d'édition | export class DashboardComponent implements OnInit
onSelectEditBtn(itemId) {
this.router.navigate(['.', itemId], {relativeTo: this.route});
} | 1 |
90963c336b4a25ec1fbf188371d8c55f | 702e74d04875d779b89f40097b170c28 | Show the user a dialog to set up game information | public class GameScreen extends AppCompatActivity implements View.OnClickListener, AdapterView.OnItemSelectedListener
public void popUpInfo(){
Log.d("On Click", "Opening Dialog");
GameHelp dialog = new GameHelp();
Bundle strs = new Bundle();
strs.putString("gameName", GameName);
... | 1 |
d5d8c6b5dfae4cfa8d32fb196b1d26e1 | 3b37361fe5951044401afb132b7e8509 | add to main, disable sorting | void modView::init()
{
setSortingEnabled(false);
setEditTriggers(0);
setSelectionMode(QAbstractItemView::SingleSelection);
model=NULL;
QStringList listh;
listh << "name" <<"type" << "specification" << "document";
setHeader(listh);
selectionModel = new QItemSelectionModel(model);
... | 1 |
99967755ebf8ac9dbba811688a2be981 | 3e5137a627d2cac1c5982b5b6aff1331 | for defining composite keys | namespace d8EnrollmentDemo.Data
public class EnrollmentDbContext : DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Enrollments>().HasKey(enrollment =>
new { enrollment.StudentID, enrollment.CourseID });
} | 1 |
d83aeb22643156f61287bb3a86c8a11b | a5f53d708433dc8c674261bc32f12916 | Priority of Thread mode with no active exceptions | {
if (IsIrqMode() || IsIrqMasked()) {
return osPriorityError;
}
ThreadDispatcher::Mutex mutex;
osRtxThread_t *thread = reinterpret_cast<osRtxThread_t *>(thread_id);
if ((thread == NULL) || (thread->id != osRtxIdThread)){
return osPriorityError;
}
if (thread->state == osRtxThreadTerminated) {
return osPrior... | 1 |
fd2618cf6f70e656598206648287a88a | 6474d78a12b4f19f9ba92979f00d89a8 | Undoes RLE for the given block. | var rleSize = GetInt();
_zars.Add(new Zar(new List<int>(), Width, Height, _subType, _defaultPaletteIndex, 0, 0, null));
for (var j = 0; j < rleSize; j ++)
_zars[_zars.Count - 1].RleBlocks.Add(GetByte());
} | 0 |
e29269c71c704d4ccfce8eef497096f2 | b62d0457555f08e86dd839555e5fb36f | Set the value of [missiondate] column. | abstract class dbs_templates_mission_mission extends super
public function set_period($value)
{
$this->setdata ( self::DBKey_period, intval($value) );
return $this;
} | 0 |
969d46073be5250fae81bfd9f6446e05 | 165f5de05bfe92ba02546b1f302fffdf | Write CCDData object to FITS file. | class tileCCD():
def writeFITSfile(self, data=None, unsigned16bit=True):
if os.path.isfile(self.inputs['output']):
self.log.info('Deleted existing file %s to generate a new output' % self.inputs['output'])
os.remove(self.inputs['output'])
else:
self.log.info('Writing ... | 1 |
6a050e4fa0e80e8b228116516c7b2c51 | 4f3961644a5bb60a89b66ecf39a14b7c | Visit the ios help page | class AppDownloadPage(BasePage):
def visit_ios_help_page(self):
self.click(self.link_app_ios_help) | 1 |
86649d4f4d366655d9b8be78acd660e8 | a6648903581eb3730da690b59898153e | Overload to handle multiple models for GenerateResource, randomly selects between the given models | {
string randItemTypeString = "RandItemType"+_index;
if (!CheckAttribute(_location, randItemTypeString)) {
trace("ItemLogic -> randItem draw: missing attribute " + randItemTypeString + " in location " + _location.id);
return;
}
int n = sti(_location.(randItemTypeString));
if (n < 0) return;
if (Items[n].mode... | 0 |
749cecb9a396384c15b9eef08bfc0778 | 3b2371c416f2285c13cfbbac2b03ec70 | @brief 查询会员的小号列表 | class appsina_m extends CI_Model
function query_member_infos()
{
$post['identity_id'] = "20009";
$post['identity_type'] = "UID";
$post['member_type'] = 2;
$post['service'] = "query_member_infos";
return $this->_interface_submit($post);
} | 0 |
f1d7c4753fe5e529431b31e1854acc2d | e12306c2ba5d903f7457a40322fff243 | 获取无卡支付该商户该用户名下已激活的银行卡 | public ResultBO<?> getBankName(String token, String cardCode) {
UserInfoBO userInfoBO = userUtil.getUserByToken(token);
if (userInfoBO == null) {
return ResultBO.err(MessageCodeConstants.TOKEN_LOSE_SERVICE);
}
List<?> list = bankcardMapper.selectByUserIdAndCardCodeIsExist(userInfoBO.getId().toString()... | 0 |
f5469185f902746dad5b9f109509bf4b | 4b628f395759bc2ef7225d9e5e7fcfe3 | 三角形の重心を求める | class Polygon
Point gravity()
{
Point ans;
ans.x = ans.y = 0.0;
double area = 0.0;
for(int i = 0; i < n; i ++)
{
int nt = (i + 1) % n;
double tp = pt[i].x * pt[nt].y - pt[nt].x * pt[i].y;
area += tp;
ans.x += tp * (pt[i].x + pt[... | 1 |
e31b3239fbebc71a8d0a4f864284c2e6 | 79588fd38520ec9574ffd3984a3df0d3 | 得到手机上所有已安装应用的包名 | String result = "";
List<PackageInfo> packages = context.getPackageManager().getInstalledPackages(0);
for (PackageInfo i : packages) {
if ((i.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
result += i.applicationInfo.loadLabel(context.getPackageManager()... | 0 |
2c8faca92b5e723281f19e1c46b3e2e9 | 06b145b4920accf97914948976cdde63 | ham nay dung de kiem tra so vai tro cua tai khoan | $query_student = "SELECT student_id FROM student WHERE password = SHA1('{$pass}')";
$query_teacher = "SELECT teacher_id FROM teacher WHERE password = SHA1('{$pass}')";
$query_admin = "SELECT admin_id FROM admin WHERE password = SHA1('{$pass}')";
$res = $this->getResult($query_student);
... | 1 |
f8138a402f065ac717f56752a9d30e77 | 9f824fafba8e06e940268d2cb6896f2c | wireshark uses 32-bit AUTODIN crc and does a bitwise
not on the result | {
static const uint32_t POLY = 0xedb88320;
uint32_t crc = 0;
crc = ~crc;
while (len--)
{
crc ^= *buf++;
for (int k = 0; k < 8; k++)
{
crc = crc & 1 ? (crc >> 1) ^ POLY : crc >> 1;
}
}
return ~crc;
} | 1 |
52c951d8f4bb9255f49013f25c1519e1 | ae82c5d027423d2538c85a432c217c09 | For any given TileTemplateRead, we want to make sure that there is only a single TilePhasingValue | [CreateAssetMenu(fileName = "RandomTileAsset", menuName = "Terrain/Tiles/RandomTileAsset")]
public class RandomTileAsset : BaseTileAsset
public override void OnPlaced (int x, int y, TerrainLayers layer, MobileDataChunk mdc = null) {
if(!IsPresenceValid(x, y, layer, mdc)) {
TerrainManager.inst.SetGlo... | 0 |
e8f33ab3b54614fac34a3fc20a6c8a4a | fe82be770739aabde8cd821d312d8339 | 更新切换大小屏按钮的信息 | {
selectingPanel.UpdateCloseBtn(touchPos);
bonusPanel.UpdateCloseBtn(touchPos);
installationFinishBtn.Update(touchPos);
shootBtn.Update(touchPos);
flagBtn.Update(touchPos);
glareBtn.Update(touchPos);
pvoBtn.Update(touchPos);
reloadBtn.Update(touchPos);... | 0 |
0ee533305ed7e5f538e8cccf549695d5 | e26d77c0bdf53af85d8267cd4f10b066 | Выводит компонент рейтинга пользователей | class Complain(QMainWindow):
def reputation(self):
self.list_reputation.clear()
self.list_allComplaintsForUser.clear()
con = sqlite3.connect("users_db.sqlite")
cur = con.cursor()
reputation = []
logins = cur.execute("""SELECT login from users""").fetchall()
for i... | 1 |
07e99c8b855dd3ff331e093d73f5a242 | 34b01d1d8bff39eeedb373db4df5b5c8 | 代码生成执行-单表 | var modules = stringutil.split(context.get("dbmodule") ,",");
for(var i in modules){
var tables = project.getTableBasicDataByModule(modules[i]);
for(x in tables){
var info = tables[x];
var tablename = info.getMasterTableName();
if(context.get("genmode") == "install"){
put(tablename,genSingleT... | 1 |
bc7ba729beae0e6cc3e098dbdf6bd5b1 | 431c558ffb2720aff7417db9bb5c6d26 | #(Admin) Montant totale des bon de renouvellement des serveur | {
$creditImmobilierTotal =
$this->clients->getPatrimoines()->getProprioCredit()
+ $this->getInvestissements("creditImmobilierInvest", "getInvestMontant", "creditImmobilierInvestValue") / 12;
return $creditImmobilierTotal;
} | 0 |
00f916ce6bb26d6e18d733a01605cbfe | 2a33b6e23525b069cadea0c02cdac0ed | Get Data for Slider template, based on
https://github.com/KnpLabs/KnpPaginatorBundle/blob/master/src/Pagination/SlidingPagination.php | \UmiCms\Classes\Components\UmiSliders\iSlider $slider, iUmiConstantMap $slideConstants
) {
return [
$slideConstants->get('SLIDER_ID_FIELD_NAME') => $slider->getId(),
$slideConstants->get('IS_ACTIVE_FIELD_NAME') => true,
$slideConstants->get('LIMIT_KEY') => $slider->getSlidesCount(),
$slideConstants->ge... | 0 |
c12727a4881f4ce0826fad588bb516d5 | 4e3a23badcebfb14e087f86c270d34da | Set the state attribute to the next enum state, by enum values order. | void set_next_state(int state) {
next_state = state;
} | 0 |
e391b7b2b6b5016dc24e1b449936ef10 | 7a58dc1f41725dc67ef8dc6cdf3eb306 | 给$id内容投票 | {
$data = file_get_contents("php://input") ? json_decode(file_get_contents("php://input"), true) : [];
$id = isset($data['id']) && $data['id'] !== '' ? intval($data['id']) : null;
$chooseNum = isset($data['chooseNum']) && $data['chooseNum'] !== '' ? $data['chooseNum'] : null;
$mark... | 1 |
5ac07e9b33c58483abcc5bcb9c953eb3 | 6585f4c5e187052fe27dad806ddd084c | Check whether a series of image files has the exact same dimensions. | print "Checking images", ifile_image1, "and", ifile_image2
image1 = readmetaimage(ifile_image1)
image2 = readmetaimage(ifile_image2)
extent1 = image1.GetExtent()
extent2 = image2.GetExtent()
if (extent1[0] == extent2[0] and
extent1[1] == extent2[1] and
extent1[2] == extent2[2] an... | 1 |
d3f6633713e6d1e68b0825c7fdafacf6 | 176d4f398a11747222f0ef794e61ebca | @brief Remove all detectors | void ObjManager::deleteAll()
{
vector<Connector*>::iterator itConnectors = _connectors.begin();
while (itConnectors != _connectors.end())
{
delete (*itConnectors);
itConnectors++;
}
_connectors.clear();
vector<DetectorUnit*>::iterator itDetectorUnits = _detectorUnits.begin();
... | 1 |
9c927a172d12e0a7bcbe6b75e6a7c5a9 | c1792226f9931b925b1671f7276e2bd3 | decodes a double array, encoded as String of the form value0 value1 ..... value-n,
where the values are separated by characters specified by means of the delimiter String.
The doubles array should be sufficiently large so that all tokens can be allocated,
or else it should be null. In the latter case, a new double arra... | public final class StringUtil
public static Double[] toDouble(String[] strings) {
return toDouble(strings, null);
} | 0 |
d5e2f6c39d84cb7daf0532ed18c66bee | f61d135e8da2b225ee12d55a5e81f7ab | Handles the RowValidating event of the domainGroup_DataGridView control. | {
if (!this.springGridView.Enabled)
{
return;
}
if (m_ModelDataManager == null)
{
return;
}
CellValueValidating(this.springGridView, e);
} | 0 |
ea09fe6fec2f3a33da0418cdb5ca29ec | 3410d9ba49d0cefcd060ece6cb08df45 | CanExecute handler for the MdiCommands.MaximizeWindow command. | namespace VIBlend.WinForms.Controls
public class OfficeRibbonForm : Form, IScrollableControlBase
private void maximizeButton_Click(object sender, EventArgs e)
{
this.HandleMaximize();
} | 0 |
eab3beb737545c70c356239b1c608a82 | 6277685bf0d2f35a7f275d9025ebd68f | 返回全部图的DFS森林的高级函数 | DFN[tidx] = Low[tidx] = ++timepoint;
tarstack.push(tidx);
visited[tidx] = 1;
if(!successor[tidx])
parturient(tidx);
int i=0;
for(i;i<ptnet->transitioncount;++i)
{
if(TGraph[tidx][i])
{
if(!DFN[i])
{
Tarjan(i);
... | 0 |
ed59585ebdcc2ba9ff446b8be2221c48 | a5817d9b0742e70927ff9a34b911e315 | Create a new serializer using the factory. | class EntityFactoryService
public function __construct()
{
$this->serializer = new Serializer(array(new ObjectNormalizer()), array(new JsonEncoder()));
} | 1 |
3bf3ad7b74f5e010161f7b27bb58bcf3 | 88c1429e12cb258491f59fe9340a604a | Returns single row of matrix at index i | class TrafficMatrixSequence(object):
def get(self, i):
return self.matrix[i] | 1 |
b8a38026b20d435738e60e858fc4ac57 | 9dc0b149a8db77929e38941e2d100cfb | Sets the next_attempt of this OrderAutoOrder.
The next time that the auto order will be attempted for processing # noqa: E501 | if parameters is not None:
self.set_parameters(parameters)
return self.order + 1 | 0 |
d00fa3d59c0fdea4c3b26c87c26e55cf | 40dbac80eae26559fe42add42431e1bc | Remove the specified Fundraising from storage.
DELETE /fundraisings/{id} | class CharityController extends Controller
public function destroy(Charity $charity)
{
} | 0 |
bcdc6262808ce942c8ca88c75a0d56ad | dd8a3c125ec41dcc022956069b7e9d1e | when the list is scrolling, the soft-keyboard will hide automatically. | if (view == getListView()) {
hideSoftKeyboard();
}
return false;
} | 1 |
7f577c8d164ff8d8f63bf0ed96776813 | f73a3197a2e187c59ffa02ea30a72c9c | Ensure that we can authenticate with success if the public username is
not found in the LTI request | data = self._setup_lti()
payload = {
'enabled': True,
'provider_type': 'legacy',
'plugin_configuration': {
'allow_anonymous': False,
},
}
response = self._post(payload)
data = response.json()
assert data['ena... | 0 |
3f8a58ae7b0fef1bde5302af55fd9b45 | af39e73f25e7a9e7125556ef6af4b14a | Gets the achievements and displays them through google's default widget. | public void showAchievements() {
if (isSignedIn()) {
activity.startActivityForResult(Games.Achievements.getAchievementsIntent(
gameHelper.getApiClient()), UNUSED_REQUEST_CODE);
}
} | 1 |
b658b0ddcc38786a3b0abf58aea22a7d | f2032bb3760691790918fe8670c1ca19 | ICMP数据包分析函数 | void Answear_ICMP(void)
{
unsigned long a;
static uint16_t buffer[288];
uint16_t tmp;
tmp=Frame.Counter-34-4;
if((tmp&0x01)==1)
{
tmp=(tmp+1)>>1;
Frame.Data[tmp+16]=Frame.Data[tmp+16]&0x00FF;
}
else tmp=tmp>>1;
buffer[0]=Frame.Data[3];
buffer[1]=Frame.Data[4];
buffer[2]=Frame.Data... | 1 |
aacfe8895accab6dfc7d99529c51c286 | 0bc8adf1e9281725d086f2e7a719eb3d | Remove trailing slash from address | class slashIndependentPatternRouting extends sfPatternRouting
public function parse($url)
{
$url = rtrim($url, '/');
return parent::parse($url);
} | 1 |
3f98e418cf6b058c357b3928c7e3fc03 | bcd660bf21121731a463729fcbab7759 | * Any change made within the Language and Region settings panel will trigger this callback, even changes which are not reflected in the locale information provided by [hs.host.locale.localeInformation](#localeInformation). | namespace IMESample
class IMESample : NUIApplication
private static void InputMethodEditor_DisplayLanguageChanged(object sender, DisplayLanguageChangedEventArgs e)
{
Log.Info("IMESample", "InputMethodEditor_DisplayLanguageChanged callback");
} | 1 |
3a789857d40a0906e3bc7091732790f0 | 5bd05e7a96eb01351814ae6b51741149 | Şehir güncelleme fonksiyonu. Aranan şehir adına göre ekleme veya silme işlemleri yapılarak dosyaya yazılıyor. | {
try
{
foreach (Country SearchResult in SearchResults)
{
var country = DataBase.Countries.Where(x => x.CountryName == SearchResult.CountryName)
.FirstOrDefault();
... | 0 |
1d2bb0bed42039bac29dc774375f62ce | caa2e204e72f76e4db864b0eb2ca11ac | 所有玩家是否进入就位 | function GameEnter() {
GameEnter.userPosition.length = GameConfig.game_cfg.nPlayerNum;
this.resetUserCoordinate();
} | 0 |
ded7db8f29ae757b6e61ad2996ceae80 | ed177ba83892572b1cf523bbbb36c449 | Set All Loan Proposal Defaults | this.parentForm.controls['rehabBudget'].setValue("0");
this.parentForm.controls['maintenanceRate'].setValue("1");
this.parentForm.controls['inflation'].setValue("3");
this.parentForm.controls['appreciation'].setValue("3");
this.parentForm.controls['sellingFees'].setValue("6");
this.parentForm.co... | 1 |
0fdf4c3a09b521972b8992b1e528925c | a2e4ef3db6036813045ed6ddb007b0ae | Проверка актуальности токена
Если проверка успешна - продлевается жизнь токена, иначе токен удаляется | {
if (null === $token) {
$this->throwUnauthorizedException();
}
if (time() < $token->getClaim('exp')) {
return;
}
$this->throwUnauthorizedException();
} | 0 |
e67a9b3d8552e0f48111be91bdeeb85d | 3c3059b83c33393094e06da4cb39b9fd | 根据id查询导游信息 | @Service("guidePageService")
public class GuidePageServiceImpl implements IGuidePageService
public GuidePage selectByPrimaryKey(Integer id){
return guidePageDao.selectByPrimaryKey(id);
} | 1 |
d64ca87abbb0810b55094ab79e8186ff | 82e5ae17f9a2cf33ec6f3e8bc359357b | Returns the light-DOM <code><style></code> child this element wraps. Upon first call any style modules
referenced via the <code>include</code> attribute will be concatenated to this element's
<code><style></code>. | CSSStyleDeclaration getStyle(); | 0 |
6d478278313b389cb8fb8f0238a1d531 | 22d73d6024fddec8573f0a50e57a4aca | Function gets URL of otodom serp and returns number
of pages with advertisement listing | k = 0
while k<100:
html = get_html(url)
if html:
soup = BeautifulSoup(html, 'html.parser')
number_of_pages = int(soup.find('ul', class_='pagination').find_all('li', class_='page')[-1].get_text())
print("-----------", number_of_pages)
return number_... | 1 |
bab84c4404343ffe27b695b30d7abd08 | 52fb33f8c097e35c83232c587df29f64 | Saves names and gendes in CSV | def write_to_csv(names, filename):
filename = str(filename)
with open(str(filename) + ".csv", 'w') as result_file:
wr = csv.writer(result_file, delimiter = ",")
wr.writerows(names) | 0 |
80b2e93e16ddc6e8b68b0d0fd5b990ff | 4c312f2d98c7fe295df9a1079806e88a | 获取参与砍价的用户列表 | async getHelpBargainUserList(ctx, next) {
let {
index,
size,
activityUserId
} = ctx.request.body;
let result = await bargainProductService.getHelpBargainUserList(activityUserId, index, size);
if (result.data.Success && result.data.Data) {
l... | 1 |
cd53b2d57d5aa4801e78bb01abb5606c | 1fc7768f0cd309bba0d9ae6380ced100 | 1.se la settimana non contiene la commessa passata, viene creata la lista associata.
2.aggiungo la commessa nella lista associata | public class GestoreMagazzini extends GestoreLogin implements Gestore<PuntoPrelievo>
private void addMagazzinoToList(PuntoPrelievo magazzino) {
if (!magazzini.contains(magazzino)) {
magazzini.add(magazzino);
Collections.sort(magazzini);
}
} | 0 |
a05f171efb2d97be12197f25ff9624a0 | 9dc4d7475b597c033c4a3874ca12333e | 获得公立学校信息 | def getSchool():
try:
schools = json.load(open('school.json', 'r'))
return schools
except FileNotFoundError as e:
pass
urlschool = 'http://yz.chsi.com.cn/zsml/queryAction.do'
schools = []
params = {}
try:
schools = getData(urlschool, params, handleSchool)
... | 0 |
179facc2c2304cfa75867a9c521834cc | c439f2f226af2b2bf068aeae0d359f0a | Returns the directives associated to this Listen object. | List<ListItem> getListeners(); | 0 |
8dcbb8578e113d1182ec4838e3840c1c | 0d8ff6d4a401da969caa119778fe0565 | Method to print all the moves stored by this Piece. | void Piece::print_moves() const
{
for (int i = 0; i < moves_.size(); ++i)
{
cout << i << ": ";
if (moves_[i].first == -1)
cout << "O-O ";
else if (moves_[i].first == -2)
cout << "O-O-O ";
else if (moves_[i].first == -3)
cout << "jump ";
else if (moves_[i].first == -4)
cout << "en passant " <... | 1 |
a2f1d57d449f647330b3dacbc354940c | f70c31508dc9db951868750cc8cf8419 | 記事タップ時に呼ばれる | public void onClick(View v) {
long newTimeStamp = System.currentTimeMillis();
if (newTimeStamp - timeStamp <= TAP_THRESHOLD && articles.size() != 0) {
mStaggeredGridLayoutManager.scrollToPositionWithOffset(0, 0);
}
timeStamp = newTimeStamp;
} | 1 |
4ffa425e8ce28f5741772fd92adcb3ec | 80c675ae5676a6e997f75757c546b825 | Get the unique ID of the TWCManager. | public class DwpTableHandler extends Observable implements IDwpTableHandler
public String getID()
{
if (m_uid == null)
UID.generateUID();
return m_uid;
} | 0 |
38c404ca7fdf74683dead2e3736ead5b | d620095b943b5571b22b01471127fbe9 | A re-usable algorithm/processor for adding examples to things in various ways | def main():
t1_add_retr_object_plain()
t2_add_retr_object_with_attr()
t3_add_retr_object_hierarchy()
t4_retr_obj_error() | 0 |
5133ba43fc632737ddac55c2cb9b1815 | bd410f70f01d311fc8971cdc8c494412 | Take the guild and then the emoji value and will return the emoji to put in a message | public class GuildEmoji implements IGuildEmoji
@Override
public String toString() {
return String.format("<:%s:%s>", this.name, this.id);
} | 1 |
68568f2ba885107c85b0097fb6c55d56 | 63f744cf6bc42363e23d014a3f73f033 | Initialize Type's, delegates and nested classes entry points from
dynamic libs (so, dll), where entry points mangled name contain C++ scope
(namespaces, classes and others) like
nestedClassType::nestedClassType2::entry_function_name. | IMetaModelCommon *pCommon,
mdTypeDef td,
CQuickArray<mdTypeDef> &cqaTdNesters,
CQuickArray<LPCUTF8> &cqaNamespaces,
CQuickArray<LPCUTF8> &cqaNames)
{
LPCUTF8 szName, szNamespace;
DWORD dwFlags;
mdTypeDef tdNester;
ULONG ulNe... | 0 |
8077998f4dbc4b47f33689a6153cb99a | 72fdcb96e1780db93f314ce22f50001f | Returns a one-channel bitmap which is a copy of the specified channel | namespace FreeImageAPI
[Serializable, Guid("64a4c935-b757-499c-ab8c-6110316a9e51")]
public class FreeImageBitmap : MarshalByRefObject, ICloneable, IDisposable, IEnumerable, ISerializable
public FreeImageBitmap GetComplexChannel(FREE_IMAGE_COLOR_CHANNEL channel)
{
EnsureNotDisposed();
FreeImageBitmap result = ... | 1 |
eff83474dc932d8cbdc7c3dd170517a0 | 7f0a7e002351c45c5ec4be4ae63a1724 | \brief Returns whether a value is a userdata of type circle movement. | unsigned index = static_cast<unsigned>(kind) - static_cast<unsigned>(UserDataMapping::GlobalTable);
return specialUserData.size() > index && !specialUserData[index].users.empty();
} | 0 |
7fa5ee3800f7c70666df5b21d5378df1 | 49d3c6e4e2e4dd25d22d6cb3d3971f53 | Create a file with the given template file and add it to the parent node. | public function addParent( $parentTemplate ); | 0 |
dec6013a2d69778854d9ac5dbbf1dd18 | 3411af5b94076bc116bc833cf23a984d | If the relationship was migrated from the legacy post relationships, we need to
provide backward compatibility for it. | class Toolset_Postmeta_Access_M2m
public function update_post_meta( $meta_id, $object_id, $meta_key, $_meta_value ) {
$parent_type = $this->get_parent_type_from_meta_key( $meta_key );
if ( ! $parent_type ) {
return;
}
if ( ! Toolset_Utils::is_nonnegative_numeric( $_meta_value ) ) {
return;
}
$child_po... | 1 |
7b93ebd6eb4396213203eacbe794f9a2 | a1b1c621072ea30e039688c6eada3052 | Get file name for RepairPatch | public class Properties
public String getPatchName() {
return patchName;
} | 0 |
5557645c108c24b9df6f9b1853c3c9e2 | 4cd885322da641a8f42d4652441ef34e | Inserts the data at the end of the DLL | newNode = _DoublyLinkedNode(data)
if self._size == 0:
self.insertAtStart(data)
else:
tempNode = self._tail
self._tail = newNode
self._tail.previousNode = tempNode
tempNode.nextNode = self._tail
self._size += 1
re... | 1 |
73b8556929b0fdd00ef237a098d36314 | 46cf67163966e51a6f7c611742283d7d | Convertion des images RGB en images en noir et blanc | {
int h, w;
unsigned char* image2 = new unsigned char[width*height];
for (h = 0; h < (int) height; h++)
{
for (w = 0; w < (int) width; w++)
{
int ind_rouge = (int)(image[0][h*width + w]/8);
int ind_vert = (int)(image[1][h*width + w]/8);
int ind_bleu = ... | 0 |
84ddbdd34ea9062032014605762685f3 | a81207f5134d49269342a2188c68ed73 | 初始化微信API_URL前缀 | {
self::$API_URL = $apiurl ? $apiurl : 'https://api.weixin.qq.com/';
self::$APP_ID = $appid;
self::$APP_SECRET = $appsecret;
self::$ORIGINAL_ID = $originalid;
self::$TOKEN = $token;
self::$ENCODING_AES_KEY = $encoding_aes_key;
... | 1 |
982c995ad2c150ebdcd0eb92c80a15f4 | 158790d39eaae49f953f686578ff6a29 | convert a date string to a sortable integer YYYYMMDD | def _date_to_int(d):
return int(d.strftime("%Y%m%d")) | 1 |
884ce36318647c8f05ef8bb7dc8aef37 | 41348e41c777e04a1757978287d825bf | Palauttaa merkkijonon annetulle solmulle. | public class Puu
public Solmu annaJuuri(){
return this.juuri;
} | 0 |
d0519d46b8409420f2fceb46067c4451 | 3edfe029a1b8f592d5e562fd3f09d741 | ## NOTE: Despite what this says above, this does not actually call
## `docker_client` because that's quite slow. Instead we call
## http_client, which is way faster and does not require internet
## access to get the spec. | options.merge!('container' => self.id[0..7])
hash = Docker::Util.parse_json(connection.post('/commit', options))
Docker::Image.send(:new, :id => hash['Id'], :connection => self.connection)
end | 0 |
1bb6f65206290f9f68726a34c2c43891 | 3fc7ba6b08d70cefe1176512442d66af | find coordinates where 2 paths (as a series of connected straight lines)
collide with each other, excluding the point of origin (0,0)
and collisions with themselves. | combs = itertools.combinations(lines, 2)
_ret = [comb for comb in combs if comb[0].intersection_on_segment(comb[1])]
return _ret | 0 |
3fa226ed1a33803e3b054e6e7529c64b | 320d34cedf871b938982d293c2d7da26 | Before delegating, log all exceptions to the console. | async function logExceptionsToConsole(what: () => Promise<any>,
showStack: boolean): Promise<void> {
try {
await what();
} catch (err) {
const msg = (showStack ? err.stack : `Error: ${err.message}`) + "\n";
errorMessage(msg);
logger.er... | 1 |
6c40861e2b9313260e251a8ad2e9c441 | 30b6dfa670b70345da04d8da4468a85b | 購入結果をチェック. | @selected_drink = drink_select(drink)
if @selected_drink[:count] == 0
"在庫切れ"
elsif @selected_drink[:value] > @slot_money
"金額不足"
else
"購入可能"
end
end | 1 |
6a8ae31ed2871d8b9c30c7931bd712fb | 0bf4cd160bf5305407fa30a71ce1415b | Return ASCII map where each element represents row in map. | string str_map = "";
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
str_map += map[y][x] == 0 ? " " : "*";
}
str_map += "\n";
}
return str_map;
} | 1 |
f42be4af0f324b9bd0ae0ad111fc4758 | c652948bdde7f6a5a6dabbd9ac604ecc | Make the CAN inactive (Clear the Enable bit). | void
CANDisable(uint32_t ui32Base)
{
ASSERT(_CANBaseValid(ui32Base));
HWREG(ui32Base + CAN_O_CTL) |= CAN_CTL_INIT;
} | 0 |
7bcecb95037a022a483a8eea3a54d4a1 | 22e6f1d2f7d45c2541f129ff1e002ea3 | Initializes an auto-dereference pool and sets it
as the current pool for the current thread. You
must call PhDeleteAutoPool() before storage for
the auto-dereference pool is freed.
\remarks Always store auto-dereference pools in local
variables, and do not share the pool with any other
functions. | NTSTATUS PhInitializeRef(
VOID
)
{
NTSTATUS status = STATUS_SUCCESS;
PH_OBJECT_TYPE dummyObjectType;
#ifdef DEBUG
InitializeListHead(&PhDbgObjectListHead);
#endif
PhInitializeFreeList(
&PhObjectSmallFreeList,
PhpAddObjectHeaderSize(PHOBJ_SMALL_OBJECT_SIZE),
PHOBJ_SMALL_OB... | 0 |
f98861b94cb9ba66dd5b82f515fdb706 | aef872c204cdbf6c0dcbc8cca1a9f030 | 记录已处理事件,用于消费事件的时候过滤重复事件 | public Object invoke(MethodInvocation invocation) throws Throwable {
final EventMO event = (EventMO) invocation.getArguments()[0];
if (!lock.tryLock()) {
log.info("the record is being processed, eventId = {}", event.getEventId());
return null;
}
try {
... | 1 |
1b44eaec82330b6e723d1e92417074c3 | 39617afd2f4f5fbf14edaf0cf99ef75e | 随机抽样,输入一个数组和抽样比例,则返回两个抽样后的结果 | def random_sample(index_list, scale):
positive_index_list = []
negative_index_list = []
lenth = len(index_list)
if index_list is not None and lenth > 0:
positive_index_list = random.sample(index_list, int(lenth*scale))
negative_index_list = list(set(index_list) - set(positive_index_list)... | 1 |
184e506d579a06d0c60e4bea2ba67918 | 7af75510b59e6efaf1b80e5fb0ebb51a | Called when the timer goes off. Now there should be enough service
components, but we check anyway. | static void service_timeout_cb(uev_t *w, void *arg, int events)
{
svc_t *svc = arg;
if (svc->timer_cb)
svc->timer_cb(svc);
} | 1 |
9a19ba31df2a47662caf51e861a83ab5 | 144c7a30e66c416c08f469396526a58f | 获取类的方法注解信息 | public class JoinPointHelper
public static Annotation[] getMethodAnnotations(ProceedingJoinPoint joinpoint){
Method method = getMethod(joinpoint);
return method.getAnnotations();
} | 1 |
09676ba7be4309971fef95d6406e6112 | 43cff8521f5d6efa9f3e3b0b740fafc9 | Legger sammen to tall | def adder(tall1, tall2):
return tall1 + tall2 | 1 |
32e3a78490b4d15ec25566f12011be96 | 0f10fb11345bb69bcfbbacb7afe1196d | All actions with the given name | public class Module
public List<Action> getActions(String name) {
return actions.getOrDefault(normalizeName(name), new ArrayList<>());
} | 1 |
936293dff130af526a78efad7b28e819 | 2c6918a4a3908085e810e68b044df083 | 已知一个未排序数组,求这个数组最长上升子序列的长度。 | def LSI(nums):
dp = [1] * len(nums)
for i in range(1, len(nums)):
for j in range(i):
if nums[j] < nums[i]:
dp[i] = max(dp[i], dp[j] + 1)
return max(dp) | 0 |
5898fd5355d9f169cf98634d97a6399a | 26de90a4a2882c4e6ee2c61831a206b8 | ``code <newcode>`` Set the card code to <newcode>. | if self._code_name not in kwds:
kwds[self._code_name] = None
original_set_attributes(setattr_self, kwds) | 0 |
328d41ec10942eb6ac793bee04f1783c | f11306338c1d0ad9ee20d6d584395319 | returns the index of the median of 3 values | public class Arrays
private static int med3(char x[], int a, int b, int c) {
return (x[a] < x[b] ?
(x[b] < x[c] ? b : x[a] < x[c] ? c : a) :
(x[b] > x[c] ? b : x[a] > x[c] ? c : a));
} | 1 |
915bd73122aa29db7647e1d74ce65233 | 74a07a0fdb84c4b324e201121fba4b83 | Updates an existing Orders model.
If update is successful, the browser will be redirected to the 'index' page. | {
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
ItemOrder::deleteAll(['product_order_id'=>$model->id]);
foreach($_POST['product'] as $key=>$list)
{
$product=Product::find()->where(['id'=>$list])->... | 0 |
967870ddbe8a13e0f81350eb656b223a | e799c4d874adbf0bc2473c4d17aeb9ce | Track dust grain until it collides with the surface. | class dust_grain():
def impacting_phase(self):
r = self.grav.y[0:3]
v = self.grav.y[3:6]
magnetic_field = fun.B_field(r)
a = (self.Prams['charge']/self.Prams['mass']) * np.cross(v, magnetic_field)[2]
a = a - var.g
dr = self.Prams['length']-r[2]
if dr < 0:
... | 1 |
9e7fdc2914518441a124761fdd4d5229 | 8b750eee687d0cc7b028405e1274777c | Method to go back to the final screen. | Intent intent = new Intent(this, random_final_activity.class);
intent.putExtra(EXTRA_MESSAGE, this.message);
startActivity(intent);
} | 0 |
e44b8c39c078fbd3e1909847660fad69 | 0521d682273fdf6109177347dc06837e | Returns the <see cref="IChessFigure"/> king for color <paramref name="color"/>. | public class ChessPieces{
public King getKing(ChessPiece.Color color){
return new King(this.getPieceAt(this.getIndexOfKing(color)));
} | 1 |
0d6756e1bb62bad4e97f9be24ec8f246 | d6bdd54091527e1419d30c95b9563ba7 | Helper function to get the current, confirmed, available balance of the given currency
for this account.
May block.
We need to have a reference to a {@link CurrencyFactory} because we might
need to find out runtime properties of a currency in order to correctly
distinguish hash rates, currency codes etc. | public function fetchConfirmedBalance($currency, $account, CurrencyFactory $factory, Logger $logger); | 1 |
9acc3968af7156e214bc288311b5ee25 | 7ed23ce9be57ff241b566484070ef8c8 | Ищет максимум модуля функции на отрезке с заданными границами | extreme = - b / (2 * a)
f = lambda t: a * t * t + b * t + c
if extreme > lower_bound(x) and extreme < upper_bound(x):
return interval(min(f(extreme), f(lower_bound(x)), f(upper_bound(x))), \
max(f(extreme), f(lower_bound(x)), f(upper_bound(x))))
else:
return interval(min(f(lower_... | 0 |
4cfb29d151df6588bbeab130fc9d3841 | de1df4395273caf92855ee1a35fbe717 | Test edge case where empty string is passed. | class CipherTestCase(unittest.TestCase):
def test_when_empty_string_passed(self):
self.assertEqual('', cipher('')) | 1 |
0fc0280a32e137ec475f3a0f3d092420 | 9d7ed4968da27e66015ce24d1e45302e | gets the current object of current scope if available, otherwise returns None. | {
var scope = ParentOrSelf<TObject>();
var value = scope != null ? scope.CurrentObject as TObject : null;
return value;
} | 1 |
51fa512a4c9dda13bacb0b1c0bee5d5f | fc0596a6525a8ee3fc2f7dd8d339855c | Advect the location of marker points using the interpolated velocity field. | int advected_index_x=(int)(advected_x);
int advected_index_y=(int)(advected_y);
if(advected_index_x<1){
advected_index_x=1;
advected_x=(double)advected_index_x;
}
if(advected_index_x>=smoke_simulation::physical_const::kGrid_num_x){
advected_index_x=smoke_simulation::physical_... | 1 |
aab9c70fdb5e3171bdd07d5edd17a56a | 7ea97cc25d22ef51acd4a25635fc705c | Redirige a la página principal del módulo Vendedores. | ListarVendedor lis = new ListarVendedor();
fecha();
try {
lis.start(new Stage());
} catch (IOException ex) {
Logger.getLogger(PrincipalController.class.getName()).log(Level.SEVERE, null, ex);
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.