query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5e8607c5bb76a9bb444101aa452932f1 | 064c103212ada674cba59ddfc52a5d93 | 设置右起倒数第二图片控件是否显示选中效果 | RightSecondImgSettings secondImgSetting=dataItemBean.getRightSecondImgSettings();
if (StringUtils.isNotEmpty(secondImgSetting.getRightSecondImgURL())||StringUtils.isNotEmpty(secondImgSetting.getRightSecondImgStorePath()) ||secondImgSetting.getRightSecondImgResId() != 0) {
LinearLayout.Layout... | 0 |
a91ab48dd2b071be93905cef8bb300af | 4f74158d6dc2fed064eff1ad5577b160 | sorting the applicants by score using LINQ | namespace Login.Controllers
public class ProfileController : Controller
[Route("Score/Users")]
public IActionResult Scores()
{
var userModel = _service.GetAll().Select(user => new ProfileModel
{
ProfileImageUrl = user.ProfileImageUrl,
Username ... | 1 |
1f53b30bb391db9a5a3368666be65902 | 3dc309e91c3542a2950a4a8737d1d9a6 | Walk the file tree rooted at `path`. Works like os.walk but returned root value is relative path. | path = path.rstrip(os.path.sep)
assert depth > 0
assert os.path.isdir(path)
pathdepth = path.count(os.path.sep)
for root, dirs, files in os.walk(path):
yield root, dirs, files
subpathdepth = root.count(os.path.sep)
if pathdepth + depth - 1 <= subpathdepth:
del dir... | 0 |
f0cf1272d0b628e4a6cb015b1a4298bf | 32ae18831ddcfc9e12caa581ab71993e | Updates the animation
Returns:
Surface: Returns the image to blit. | class Animation:
def get_surface(self) -> pygame.Surface:
return self.surface | 0 |
f6c6859b6b0385d895683c16d983e270 | 827b63004799b4fb277614303ce39c25 | 获取商品轮播图,pdd.PddGoods.detail.get | return request({
url: '/v3/goods',
method: 'post',
params: {
method: 'get.goods.spec.image'
},
data: {
goods_id
}
})
} | 0 |
5d24c8c9667658e96d6162e8d2057495 | 3b4adc6c3c4b4975e8260c7f209d15e5 | Clears the div out entirely. | function tgClearDiv(divId) {
try {
if (divExists(divId)) {
tgRemoveChildren(divId);
tgSetInnerHtml(divId, "");
}
} catch (ex) {
alert("tgClearDiv Exception: '" + divId + "': " + ex);
}
} | 1 |
dfad1a68abff3616fbbab1d4394e2e4f | d2c302b5969ecdce592b441cd3b458c5 | ● DungeonRect を作成して追加 | DungeonScene *dung = static_cast<DungeonScene *>(getParent()->getParent());
Chara *chara = Chara::create();
dung->cardLayer->addChild(chara);
chara->setPosition(this->getPosition());
chara->setCharaId(this->getCharaId());
chara->setPlaceCost(this->place_cost);
chara->setBaseValue(this->getBa... | 0 |
ba5a3ace6e46799ba3a7a0d6979e99fb | dd9157214cc40e414f693e916c619d58 | Check if Program/Erase completed. | flash_err_t R_DF_Erase_Check (void)
{
if (1 != FLASH.FSTATR1.BIT.FRDY)
{
g_current_parameters.wait_cnt--;
if (g_current_parameters.wait_cnt <= 0)
{
return FLASH_ERR_TIMEOUT;
}
return FLASH_ERR_BUSY;
}
FLASH.FCR.BYTE = FCR_CLEAR;
while (0 != FLASH.FS... | 1 |
7271b8e081011a0bb2aa22f46b85d7c6 | d6033aa9e3ceb2510095b8ff9e4788e1 | 读取文件中数据内容(查看好友专用) | public class MainActivity extends Activity
private String readFiles() {
String content = null;
try {
FileInputStream fis = openFileInput(FILENAME);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len = 0;
while ((len = fis.read(buffer)) != -1) {
baos.... | 1 |
10aea9399539e96dad212b3522b4caf7 | 7db5293ccddfc7deeeea344f44b9f1fd | Undo/Redo an include | def include_changes(distro, path):
call('include', distro, path) | 0 |
35d8f7a86a0fe50590d5d94138c7becc | 2839e40aa2b721422135d1362b5d9205 | 清空Quadlist | void quad_clear (qtree_t *Q)
{
register struct obj_node *p, *pn;
register struct ref_node *r, *rn;
if (!Q) return;
for (rn = Q -> reference; (r = rn);) {
rn = r -> next;
FREE (r);
}
for (pn = Q -> object; (p = pn);) {
pn = p -> next;
FREE (p);
}
if (Q -> Uleft) quad_clear (Q -> Ulef... | 1 |
85d3195a7de2ecbcdf49a6f830f63c37 | 6ce72cd9758479bb1a1bd951243c407f | Delete OrdersDetails by IdOrder and IdProduct | class DeiController extends Controller
public function actionDeleteorderbyid() {
try {
$product = Productorder::delete_order_by_id($_POST);
return json_encode($product);
} catch (ErrorException $ex) {
Yii::warning($ex->getMessage());
}
} | 0 |
b356fc4895062488f6c461f4983973f4 | 4e03416f8cb52885b9ab874e21e916ca | Implements QAbstractNativeEventFilter interface for processing WM_DEVICECHANGE messages (Windows) | {
XWindowAttributes attributes;
previousRootWindowEventMask = 0;
if (X11Wrapper::XGetWindowAttributes(QX11Info::display(), QX11Info::appRootWindow(), &attributes) == Success) {
previousRootWindowEventMask = attributes.your_event_mask;
}
X11Wrapper::XSelectInput(QX11Info::display(), QX11Info:... | 0 |
819c4d881e35339428c6638488a37d8d | f9eb3becdd3e5d9e372050aead30b04b | Dual quaternion multiplication with self-assignment: dq1 *= dq2
See __mul__ | class Quaternion(object):
def __mul__(self, B):
qM = (self._left_multiply_matrix()*Matrix(B.q)).transpose()
qM.simplify()
q = np.array(qM.tolist())[0,:]
return self.__class__(q) | 0 |
48125ab3476214251c8668759da2758f | 3963372aceb0567982039c3370c5efce | # larval mortality | mszmn=function(x,species,timeint)
{
inc=!is.na(x)
x=x[inc]
species=species[inc]
timeint=timeint[inc]
tab=table(species)
nclass=length(tab)
ninit=tapply(x,species,length)
ndead=tapply(x,species,sum)
mntime=tapply(timeint,species,mean,na.rm=T)
mortrate=100*(1-((ninit-ndead)/ni... | 1 |
24e78ad46b19e4ac8af9e2839a79762c | c9b5a7726a98d07f5f650c2f144a68f2 | This method is called when {@link PlaybackGlueHost} is started. Subclass may override. | default void onStart() {
} | 1 |
c9cc2d9b7cea55fe9bf114d4f5aa7c62 | db97bc1bdce31b91bfbdf127f9791f6e | Return the number of black nodes between this node and the root (inclusive). | unsigned blackToRoot(BinaryTree::Node_t * node) {
unsigned count = 0;
while (node != NULL) {
if (node->color == BinaryTree::Color_t::BLACK) {
count++;
}
node = node->pParent;
}
return count;
} | 1 |
b5aa387afafe19519bdea2bddfb42ca3 | 9c8672c44ae30e19bcd02eef0ede53d6 | Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result | subtract(V3) {
return new Vector3(this.x - V3.x, this.y - V3.y, this.z - V3.z);
} | 0 |
6656e00314844f78082332e74cd0d733 | 9a17c04462196f49d989ac7100565e2b | Hides gift card textbox on checkmark | namespace PartyBooking
public partial class frmBooking : Form
private void chkCake_CheckedChanged(object sender, EventArgs e)
{
if (chkCake.Checked == false)
{
txtLettering.Enabled = false;
lblLettering.Enabled = false;
}
else
... | 0 |
fb9293878feb706a7a5b16bcf41182a6 | 1b699f73a3bcf18cd5b66f1443f3d88e | Function that opens a snack bar with a notification to the user | fun View.snackBar(message: String) {
Snackbar.make(this, message, Snackbar.LENGTH_SHORT).show()
} | 1 |
7a1dd0fd2d554b46a07bf0ce3ac0e5c3 | 290f0e71b49d7d078751af58d3c0705d | loop through each item in the checkboxlist, updating in database as necessary | {
CheckBox cbx = (CheckBox)sender;
GridView gv = new GridView();
gv = gvResult;
foreach (GridViewRow gvr in gv.Rows)
{
if (!gvr.Cells[1].Enabled) continue;
CheckBox ch = (CheckBox)gvr.FindControl("ItemCheckBox");
ch.Checked = cbx.Checke... | 0 |
970bf51df6b43ef2a3952fe08c21ada3 | 6240ccd77c4797a25cd5e5c9d74fe5c8 | 通过SysBasicCampus的id删除SysBasicCampus | int deleteBasicSysAreaById(Long id); | 0 |
ff6e5b138464880f10efd123ac27b14d | f0fa1556d9539d510fb42184e4fc15c9 | Callback to handle the selection of the Design Doc reference mode.
Sets the value of the corresponding item attribute. | String index = getRequestParameterMap().get(ROWID);
Integer record = Integer.valueOf(index).intValue();
List<UITestSupplierHardware> hwReference = new ArrayList<UITestSupplierHardware>(wsrdModelLists.getHwRefType());
if(wsrdUtilController.validateEditableRef(hwReference,"wsrdAdmin:adminHwRef"))... | 1 |
d0443eab8c8d87d3dc69fdc1f482ee34 | c20ba3cba16ed84a1e3e724067fb5c52 | 解析单个小说 | var body = new Node(content);
var title = body.text(".warp-main .title-warper .title");
var cover = body.attr(".warp-main .comic-cover img", "data-src");
var update = body.text("#randomColor c1");
var intro = body.text("#layerOpenCon");
var author = "未知";
var status = false;
var comic = ... | 0 |
3be273c5f93435c5effb50f79ba38e18 | 015054041c766082dba1323fe032d9ce | 尝试将对象转换为Decimal类型数据。转换失败是返回0 | {
const decimal defaultValue = 0;
if (obj == null || obj.ToString().Length == 0)
return defaultValue;
return GetDecimal(obj, defaultValue);
} | 1 |
cc0721aee79cf1070f65bc706d9862f3 | c6250db03f2edd8ddfcb1ffc8ffd372c | 将经纬度坐标转换为数组。 | {
return array(
'latitude' => (float) $latitude,
'longitude' => (float) $longitude,
);
} | 1 |
1fbc0713bcc85ecaeea93c215da30414 | 43b2b41fe36c63ee0e7e49959c915725 | Plot a dynamic number of images from a xarray dataset that
includes Date and Index in the title. Optional ability to
also include the sensor in the title if a 'sensor' attribute
is added to the dataset using dataset.assign_attrs | if not isinstance(img_collection, xr.Dataset):
raise TypeError("img_collection must be a xarray dataset.")
plot_count = img_collection.dims["time"]
if plot_count == 0:
if hasattr(img_collection, "sensor"):
raise ValueError("The {} dataset has no images to display for the "
... | 1 |
8e87ec714291b4968c632251cd3a103d | 3ccef793a3b75a67d3abc555a6be91d1 | Randomly sample an architecture from the search spaces.
Returns:
Sampled architecture. | class FixedArchitecture(Mutator):
def sample_final(self):
return self._fixed_arc | 0 |
f1ba7df261c87d97be6b9b37b7608b8d | e1a4a522d8e6341a7eb4e72f71a6a0a8 | формат строки параметров: КОД=ЗНАЧЕНИЕ | namespace Nostrum.XDynamicModule
public class ParameterStringStorageHelper
public static IEnumerable<KeyValuePair<String, String>> EnumSettingsParameters(String settings)
{
Regex template = new Regex(@"(?<name>(\w+|\s+)+)\s*=\s*(?<value>[^;]+?)\s*(;|$)");
foreach (Match item in templ... | 1 |
bebd2f2f45aa03fa44ea705934bd5c85 | 09a9b47bbf34b6bb7a7a3726f793255b | 更新发起工作民主评议表所有信息 | public IActionResult Update([FromBody]DutyCheckAppraise model)
{
try
{
if (model == null)
{
return BadRequest();
}
using (var db = new AllInOneContext.AllInOneContext())
{
... | 1 |
f4c05e7fc8927f936783047c5453afda | ec931ca91ecf84b3063b47fab7e7911c | Réduit l'opacité des langues qui ne sont pas sélectionné. Seul la Langue en cours d'utilisation est mis en avant. | {
#if WINDOWS_PHONE
isSelected = false;
#endif
float fadeSpeed = (float)gameTime.ElapsedGameTime.TotalSeconds * 4;
_selectionFade = isSelected
? Math.Min(_selectionFade + fadeSpeed, 1)
: Math.Max(_selectionFade - fadeSpeed, 0);
... | 1 |
d0c22c3f98cdcc0bbef2c0977f93cc35 | 7c288f6f5e3e14d94134f8363db0c0f9 | When overridden in a derived class, computes the hash value of a specified portion of a byte array by using a specified hashing algorithm. | public abstract class H32x86Test
protected abstract long getHash( byte[] data, int offset, int length, int seed ); | 1 |
32217f36eaa5461adc6db04b597cae9a | 2de6045c2d22bf3f891a280f89cac22d | Set the value of Unique ID of the ssh key | public function setUniqueId(string $uniqueId): self; | 1 |
83daca5a5689eb60d43323008c4f39e4 | 9b9b9cc106dd5bf3447b0980570e2086 | This method returns the const parameter value. | public class FieldInfo extends InfoObject implements Comparable<FieldInfo>
public Object getConstFinalValue() {
return constValue;
} | 1 |
21aa9c1fca0675212f8028f39a450c98 | 4d007f22413f3cd0c3b7055a6ed709e9 | Based on Gael Varoquaux's implementation:
https://gist.github.com/GaelVaroquaux/ead9898bd3c973c40429. | const remainder = key.length & 3;
const bytes = key.length - remainder;
const c1 = 0xcc9e2d51;
const c2 = 0x1b873593;
let h1;
let h1b;
let k1;
let i;
h1 = seed;
i = 0;
while (i < bytes) {
k1 =
((key.charCodeAt(i) & 0xff)) |
((key.charCodeAt(i += 1) &... | 1 |
40745ac796cfeed042fb5066763e182f | a6f29b4c1590dc5b05a9966d9198a734 | after starting everything up, give the mods additional environment variables | class LanguagePack::JSSPECCY2
def setup_language_pack_environment
default_config_vars.each do |key, value|
ENV[key] ||= value
end
ENV["GEM_HOME"] = slug_vendor_base
ENV["PATH"] = ruby_version ? "#{build_ruby_path}/bin:" : ""
ENV["PATH"] += "#{default_config_vars["PATH"]}"
end | 1 |
437d800f940504515bc88549c78938c5 | 32861ef759ba3011df8523439af8911c | Returns RGBA color | RGB getColor (); | 0 |
7219c57165dca390f06d473d1660fdde | 63c9ab36bc2c9cf1990c7e87ea248e53 | Get the information if voters are allowed to receive curation rewards. | class KarmaSubject
get canUpvote () {
return this.db.get('canUpvote').value()
} | 0 |
fe33f69578ecb629e86a9438d5c8e040 | df75fd43fe066ed2656229c8a84e2b75 | 默认团长 | setTuanzhang(e){
var that = this
var tz_id = e.currentTarget.dataset.id
request.postUrl("member_index.set_default_tuanzhang", {
tz_id:tz_id
}, function (res) {
if(res.data.code == '200'){
that.setData({
if_show:false
})
wx.setStorageSync("tuanzhang... | 1 |
5c3a520fec6e43cffc7c1525e1706e6d | 394a65022d83e5e2f66bd3963d5440a0 | Go through all values in the adjacency matrix
and change them to 0. | void graph_makeGraph(void) {
for (int i = 0; i < GRAPH_SIZE; i++) {
for (int j = 0; j < GRAPH_SIZE; j++) {
adj[i][j] = 0;
}
}
} | 1 |
ccdbce3a0c0796e8fcdd29a856ce05c6 | e49d5a6c9773b6028d4917ba729fec6d | A method to disable the surrender button | public class BoardFrame extends JFrame
public void disableRefute() {
refuteDisabled = true;
} | 0 |
a5de80da07d43c671cb058f96d71acb2 | 958cfffb39ad5b79bcb7be66b77bb55b | Returns the sequencing center used for this experiment | public class GetSequencingRequestsTask
private List<String> getSequencingFoldersOfRequest(DataRecordManager drm, DataRecord request, User user) {
List<DataRecord> seqExperiments = getDescendantsOfType(request, IlluminaSeqProtocolModel.DATA_TYPE_NAME, user);
List<String> experimentIds = seqExperiments.st... | 0 |
57a79cd95f7759403601439ec1b7bb8e | 7c8499ac7839997929abab89b8b9e6bc | 解析留言板标签 | namespace Foosun.Publish
public class ChannelLabel : Label
protected void ParseLabelConetent(int ChID)
{
string pattern = @"\[FS:unLoop,[^\]]+\][\s\S]*?\[/FS:unLoop\]|\[FS:Loop,[^\]]+\][\s\S]*?\[/FS:Loop\]";
Regex reg = new Regex(pattern, RegexOptions.Compiled);
string co... | 1 |
6bea8e6fde2d8b4fc02da407ebc66a13 | ed5b7de3ded54145b2e096d34b706b69 | Converts a mercado libre site to a two letter country code value; | namespace MercadoLibre.SDK.Meta
public static class MeliSiteExtensions
public static string ToCountryCode(this MeliSite @enum)
{
return GetValue<MeliCountryCodeAttribute>(@enum);
} | 1 |
4acc4d98e2931d2b1c021ac940742f3c | 18701c274da1608400fa9d56f1e42cb5 | metodo encargado de buscar en la lista de paquetes a descartar, si el paramtro de entrada existe en la lista o no | foreach(Package p in Packages)
if(p.Name == package)
return true;
return false;
} | 1 |
c70393a84fb1b60867d572dc531b391e | 4ab1134aef708fffc241901299ddf0c7 | hàm đếm số lượng số nguyên tố | {
int dem=0;
for(int i=0;i<n;i++)
{
if(a[i]%2==0)
{
dem++;
}
}
return dem;
} | 0 |
45820d2a7bf4f345d39c1edc1d8a6cbb | 735c5bba39fe809c7287aba1e71eae85 | valid day range (1-30 for Apr, June, Sept, Nov)(1-28 for Feb - except during leap year 1-29)(1-31 for all other months) | if(year >= 0 && (month >= 1 && month <= 12)){
switch(month){
case 4:
case 6:
case 9:
case 11:
if(day <= 30 && day >= 1){
return true;
}else{
return false;
}
case 2:
if(isLeapYear... | 1 |
cedaf08f0ebb32a82b2816bad2ae56b8 | eeeb4a6c6df652b13ac50e9e3dc8caff | Completion on an empty name reference in inner class. | this.workingCopy = newExternalWorkingCopy("X.java", "public class X {\n" + "}");
this.workingCopy.getBuffer().setContents("public class X {\n" + " int field;\n" + "}");
CompilationUnit ast = this.workingCopy.reconcile(JLS3_INTERNAL,
true, null, null);
TypeDeclaration type = (Ty... | 0 |
9c25c2ff76d492ccdc6671536c080662 | 5ab43f6e49c8ea7061cb102821b99884 | Fonction destructeur de UAudioRecorder | if (recObjectItf_ != NULL) {
(*recObjectItf_)->Destroy(recObjectItf_);
}
if(buffers) {
for (int i = 0; i < NUM_RECORDING_BUFS; ++i) {
if (buffers[i]) {
delete[] buffers[i];
}
}
delete[] buffers;
}
delete sdft;
#ifdef ENABLE_LOG... | 1 |
cae0bbf3d7efa5145114fa86b4395855 | b83d284b8904a597c65911aa8f525e25 | Customer's details with a graph (Chart).
Here we're getting the data of a particular customer and manipulate the Excel file and pass
the income and the expenses to the front end | String strcustomerId = request.getParameter("creditCustomer");
Long customerId = Long.parseLong(strcustomerId);
System.out.println("in controller customerId : " + customerId);
CustomerDetailsHelper helper = new CustomerDetailsHelper();
Map map = helper.getCreditCustomerDetailsForEdit(customerId);
Map<String... | 0 |
ae2516b27548a9c166c1ec5b4baa288d | c3c3fe262cc1078a35cb80cf117b3a9f | Send 1 bit of data to teh 1-Wire bus | unsigned char i;
unsigned char x;
for (i=0;i<8;i++) {
x = data>>i;
x &= 0x01;
ds18b20_send(x);
}
delay_us(100);
} | 0 |
838d9119363f1cb7ba8afb3d275c00e2 | 287a34dce68fca641e373b0ac162cf78 | Funcion que devuelve el timestamp a convertir en formato YYYYMMDDHHmmSS | {
string result = "";
char *timestamp = (char *)malloc(sizeof(char) * 16);
time_t ltime;
ltime=time(NULL);
struct tm *tm;
tm=localtime(<ime);
sprintf(timestamp,"%04d%02d%02d%02d%02d%02d", tm->tm_year+1900, tm->tm_mon,
tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec );
result = timestamp;
return result;
} | 1 |
4fbf4bd851ce1473a97abb970b7c49b5 | 03ee87da723527fc2688e34a49c8c7c1 | Função que gera o nome de um registrador | {
string tem;
if (reg.compare("$t0") == 0)
{
tem = "01000";
}
else if (reg.compare("$t1") == 0)
{
tem = "01001";
}
else if (reg.compare("$t2") == 0)
{
tem = "01010";
}
else if (reg.compare("$t3") == 0)
{
tem = "01011";
}
else if (reg.compare("$t4") == 0)
{
tem = "01100";
}
else if (reg.compa... | 0 |
384846d02dc2ffcfb18cecd4f8caaa09 | e3ef2e656bada16b93cc52e120581345 | Method that returns the listener to communicate result in
an asynchronous way. | public abstract class ImageOfAbsoluteConicEstimator
public ImageOfAbsoluteConicEstimatorListener getListener() {
return mListener;
} | 1 |
c9eee8f082f3737c5f108bc471203202 | cacf51c270731968ae06bf2f196cbade | Figures out correct axis accounting for current rotation
Starts a coroutine that spins the cube 90 degrees around that axis using lerp
r is 0 for left, 1 for up, 2 for right, 3 for down | for i in range(10):
time.sleep(0.05)
self.corners[self.pos["1"]].compound.rotate(
angle=(math.pi/20), axis=v.vector(0, 0, 1), origin=v.vector(0, 0, 0))
self.corners[self.pos["2"]].compound.rotate(
angle=(math.pi/20), axis=v.vector(0, 0, 1), ori... | 0 |
cdbb651fff2d2caf56f34e563fd01029 | 7155469cd5b5e33a697f12ebd97b940a | 获取pType背包解锁的格子数量 | public class KnapsackManager : BaseModuleData, IManager, IGlobalEvent
public int GetInitGridByPackageType(GameCmd.PACKAGETYPE pType)
{
table.UnlockStoreDataBase firstData = GetUnlockStoreDataBase((uint)pType, 0);
return (int)((null != firstData) ? firstData.initNum : 0);
} | 1 |
ee0fbc047160c3e5c52c4b2b8948d118 | c412fa2ed81e1d1fd161a7161bb38ca6 | This method creates sample virtual dataset with URISpace literal value | mock_isfile.return_value = True
testfile = 'file://localhost/vagrant/shared/test_data/meris_l1/MER_FRS_1PNPDK20120303_093810_000000333112_00180_52349_3561.N1'
ds = Dataset.objects.get_or_create(testfile)[0]
new_uris = ['file://fake/path/file1.ext', 'file://fake/path/file2.ext']
a... | 0 |
5ac23bc8dd3071eb13f827b847a8d039 | a1e8ae22262642e76d945bd7bb56b65c | Takes a key and message and sends it to direct message exchange. | async function sendDirectMessage(
memberID: string,
content: string | MessageContent,
) {
let dmChannel = await cacheHandlers.get("channels", memberID);
if (!dmChannel) {
const dmChannelData = await RequestManager.post(
endpoints.USER_DM,
{ recipient_id: memberID },
) as DMChannelCreatePaylo... | 1 |
cfa846ddfa4a7fe3d5371f99e3d02731 | c074f3afbaffd4867d97d30ee6983162 | returns the value in the map if it exists, otherise 'elze' value is returned | if (map.containsKey(key)) {
return map.get(key);
} else {
return otherwise;
}
} | 1 |
991cda093a311ddf70b37544a1424294 | b80363324d1d3d607cbb202773ae392b | проверка появления гласной | namespace Diplom
public partial class SearchVerse : Form
public void Verify(string newAccent, string oldWord)
{
int NumberSlogAccent = AccentInSlogs(SlogSpliter(WordAccentDictionary[newAccent]));
if (NumberSlogAccent <= SlogSpliter(oldWord).Length)
{
stri... | 0 |
873853f00452ad9f4a6d09bd3721246b | 7bf4f20949b75ba9245967005c740d65 | example 3 - ITERATIVE | struct Node* iterativeSearch(struct Node *p, int key)
{
while (p!=NULL) {
if(key==p->data)
return(p);
p=p->next;
}
return NULL;
} | 1 |
8044f8709d4e7bbb7a4b5bf061312396 | 5208dad95a910c81cffb15dd18f9681b | Test case for comDayCqWcmContentsyncImplRewriterPathRewriterTransformerFactor
. | class ConfigmgrApiTest extends \PHPUnit_Framework_TestCase
public function testComDayCqWcmContentsyncImplRewriterPathRewriterTransformerFactor() {
} | 1 |
d7b023d078dca3dd45205e43da0aca1e | b96ec7ef1bfc7a1abaed68572f86bd07 | Modification d'un niveau | {
$response = $_POST;
$levelObjs = json_decode($response["objs"], true);
$preLoadlevels = check_load_XML("xml/levels.xml");
$sendData = $response["name"];
for($i =0; $i <$preLoadlevels -> level->count(); $i++)
{
$levelAttr = $preLoadlevels -> level[$i]->attributes();
if($levelAttr["name"] == $sendDa... | 1 |
c74951d64a6aba6765438799a1b139ee | 6e4e8537c47f42788d51350cadb3f238 | 에러정보 파일 출력 함수 | void printErr(){
printf("입력이 올바르지 않습니다.\n");
} | 0 |
26651c07c40fd97d2fa0d888a7eb51ea | 57377a9aed09823023ea84c2031b9913 | trouve le processus et la fonction d'un GO term | process_t *get_process(int pid) {
job_t *job = job_head;
while (job != NULL) {
process_t *process = job -> first_process;
while (process != NULL){
if (process -> pid == pid)
return process;
process = process ->next;
}
job = job -> next;
... | 0 |
0c68c907aa46b978a53ca6589b14cc69 | d16640e43b2701e9ac3d0015d5d7e3b8 | Método que consulta todos los pagos hechos por una compañia | {
try
{
if (compAddr == null) throw new Exception("Company is null");
List<Payment> lstPayment = factory.GetPayment(compAddr);
if (lstPayment == null) throw new Exception("DAL.SalesOrder.MastDataFactory.GetPayment()==null");
... | 1 |
12a24d89b4504ed10033de39e0dcf38a | 9319813525418f54eee1f49fe36214cd | Create zone in PowerDNS server | params = {'name' : name }
result = ctx.obj['nc'].post("domains/%s/zones" %domain_id, params)[0]
print_object( result, only=ctx.obj['show_only'] ) | 1 |
956b5b8ffa5bac142b4a8f92b71a6cef | ef64ddce5c864031cbbd92ffff9da457 | Draws the grenade particles based upon the current nade type | {
if (nType == WEAPON_GUITAR)
{
for (int i = 0; i < MAX_BULLETS; i++)
{
if (!pBullets[i])continue;
if (!pBullets[i]->IsInUse())continue;
pBullets[i]->Draw();
}
for (int i = 0; i < MAX_CATCHBULLETS; i++)
{
if (!pCatchBullets[i]) continue;
if (!pCatchBullets[i]->IsInUse())continue;
pCatchBul... | 0 |
42096f6cb2e62f2e06226f16dac91b54 | ffd2f41c2778f8089daa9171fad64620 | Returns a FieldSet with which to create the CMS editing form. | class GuideSection extends DataObject
public function getCMSFields() {
$title = TextField::create('Title', 'Title');
$title->Required();
$title->setCustomValidationMessage('A title is required.');
$content = HtmlEditorField::create('Content', 'Content');
$content->Required();
$content->setCustomValidationMe... | 1 |
fd9014156fcff05c5fd8f10452ae1359 | 4cd1980ed955cf97264ec788617967d3 | 设置IMCFLogger 日志头前缀 | func init() {
log.SetPrefix("TRACE: ")
log.SetFlags(log.Ldate | log.Lmicroseconds | log.Llongfile)
} | 0 |
b50c29255fa5419ee7f3300efaa51525 | 89abbdbec0e6615b03a8a3449b089463 | False Positives | function utils.false_positive(predCube, targetCube)
return torch.sum(predCube:maskedSelect(targetCube:eq(0)):eq(1))
end | 1 |
08b57c6356cc43d9469b8c1da7a8d075 | 32ac732e910a591bee4a3b189f0c6ed0 | Sets a hidden variable. | {
X.AddScript("App." + sHiddenName + ".setValue('" + sHiddenValue + "');");
} | 1 |
109eea096ac69242bbaf05204d327e53 | 6e512179fe5765e8e9798fab7759a53f | Returns a timestep which is in the future and is closest and 'none' if
none available | {
for (int i = 0; i < size(); i++)
{
if (get(i).getTime() > getTime()) return get(i);
}
return null;
} | 0 |
648bde0595686ce884755f831593ab69 | 4984df69434ee7637362293c339e536a | Returns ``True`` if the two epressions are equal. | class Expr:
def __eq__(self, other):
return (other is self) or (isinstance(other, Expr)
and self.op == other.op and self.args == other.args) | 1 |
a31f29c24bf7c4c44607dac36552bc84 | 7cc2adf1db04cef8839df0f0fa272ec3 | 表示该字段不会映射到数据库中去 | namespace Schubert.Framework.Data.Conventions
public class PropertyConvention
public void Ignore()
{
this.ColumnRule = DbColumnRule.Ignore;
} | 1 |
8ad04136b0b76bc94d99036f1e0490a0 | dc20f4d2be790c8510eacecd4d296349 | 异步订单操作 | class CallPayController extends BaseController
public function callAliAsync()
{
$validator = Validator::make($this->req->all(), [
'out_trade_no' => 'required',
]);
if ($validator->fails()) {
return 'fail';
}
Log::info( 'callAliAsync: ' . http_build_que... | 1 |
611e7eaa4c2e4585f9fe6684f96955f4 | d56502d8318b2355aee34656c79fa9d0 | Ttakes a list of datetime strings and converts it into a list of strings with only the date. | def DateTime(date_list):
date_data = []
for data in date_list:
col_data = data['location_time']
date_data.append(col_data)
return date_data | 0 |
95ebcd8efe7f91485e7f643da244912c | 80c64d607604f567b06e9a04eabad7e2 | Method called during construction to define telemetry packets. | def build_kit_to_enable_telemetry():
pkt = CCSDSPacket(apid=0x80, cmd_func_code=7) / b'127.0.0.1\x00\x00\x00\x00\x00\x00\x00'
payload = bytes(pkt)
assert payload.hex() == '1880c0000011079a3132372e302e302e3100000000000000', "Sanity check failed"
return payload | 1 |
aeca77bcb8b91bb42283dafcb5c72781 | 9296790cd0e0ca8c6454f79db758d620 | 根据协议编号,取所有贷款台账信息 | List<CcsLoan> loanlist = new ArrayList<CcsLoan>();
try{
QCcsLoan qCcsLoan = QCcsLoan.ccsLoan;
Iterable<CcsLoan> loans = rCcsLoan.findAll(qCcsLoan.acctNbr.eq(acctNbr)
.and( qCcsLoan.acctType.eq(acctType)));
if(loans!=null){
for(CcsLoan ccsLoan: loans){
loanlist.add(ccsLoan);
}
}
}
... | 0 |
8537b00f3c341ac9263fccf5c738a73b | 595502b432d406a8aa082d52f17be9e0 | two finger pinch detection
source: https://docs.unity3d.com/Manual/PlatformDependentCompilation.html | {
if (Input.touchCount == 2)
{
_touch0 = Input.GetTouch(0);
_touch1 = Input.GetTouch(1);
_touchVector = _touch0.deltaPosition + _touch1.deltaPosition;
if (_touch0.phase == TouchPhase.Moved && _touch1.phase == TouchPhase.Moved)
{
_angle = _rotationSpeed * _touchVector.x * Time.deltaTime;... | 0 |
8c838c27fee654db01c4fbe96c704bb1 | 5111b93f0b2d9fbd0c410bdf403aaa45 | exits the program whatever its state is | class jobParser(cmd.Cmd):
def do_exit(self,arg):
exit() | 1 |
2991ab84beb7b3eff6c439e16caab10a | 594f47f483233243c5384b721b2eb7bf | Test if scheduler time interval is returned. | def test_first_schedule(timetable: Timetable, restriction: TimeRestriction):
next_info = timetable.next_dagrun_info(last_automated_data_interval=None, restriction=restriction)
assert next_info == DagRunInfo.interval(WEEK_1_WEEKDAYS[1], WEEK_1_WEEKDAYS[2]) | 1 |
a41399cde65c8709041e3fabd103c6a2 | c1d875c3eeaa06a743ec18e4ed8127ad | Finds common characters in two texts | lines_a = set(a.split('\n'))
lines_b = set(b.split('\n'))
matches = [line for line in lines_a if line in lines_b]
return matches | 0 |
8d6473591689e4d9d7b483f842a928ff | 2bd7b59c069d14139d4553ff72a78367 | Get invoice meter details | {
$response = [];
$servicesData = null;
if (count($this->InvoiceServices)) {
$response['orderId'] = (string)$this->InvoiceServices[0]->getOrdersService()->getOrderModel()->getOrderId();
$response['orderIdUTK'] = (string)$this->InvoiceServices[0]->getOrdersService()->g... | 0 |
a8e9a42d28c39d5a466e13a807e77f93 | 58684af1eb2c5c7343791e27e6888099 | Initialize the VerticaConnector instance. | self.init_config(app)
self.metadata_queue_name = \
app.config['ASCLEPIAS_HARVESTER_METADATA_QUEUE']
self.mq_exchange = app.config['ASCLEPIAS_HARVESTER_MQ_EXCHANGE']
if app.config['ASCLEPIAS_HARVESTER_HARVEST_AFTER_EVENT_PROCESS']:
event_processed.connect(
... | 0 |
43556a94a4652b6409d03887e82a79bb | 5ad2cc23eb394617a121165620dad09e | Expand input files to have full paths | def expandInput(inputLocations, result):
for location in inputLocations:
if os.path.isdir(location):
onlyfiles = [
os.path.join(location, f)
for f in os.listdir(location)
if os.path.isfile(os.path.join(location, f))]
result += onlyfiles... | 1 |
973eb4d3c7b5a951026cfc4c2b90a27d | 8a242783a3f917d1179c0850cf5bbe0b | Change the margin type for a symbol
https://binance-docs.github.io/apidocs/futures/en/#change-margin-type-trade | public String cOrderChangeMargin(String pair, Double margin) throws IOException, NoSuchAlgorithmException, InvalidKeyException {
return mCTradeProxy.orderChangeMargin(pair, margin);
} | 1 |
68478609e3b9d9ee682413c7bc56c69a | 141f4cee5923a27257352d88f16617ce | 验证请求是否来原与内部系统 | class IsAdminUser(OriginIsAdminUser):
def validate_sign(self, request):
key = settings.BUSINESS_KEY
secret = settings.BUSINESS_SECRET
timestamp = request.META.get('HTTP_X_API_TIMESTAMP')
noncestr = request.META.get('HTTP_X_API_NONCESTR')
sign = request.META.get('HTTP_X_API_SIGNAT... | 1 |
4e1b27f42fdad7403504f59229b06766 | 887877c5faf0b19f418f90dee71d1c60 | x.__str__() <==> str(x)
Return a string representation of this SessionOptions. Call of
'str(options)' is equivalent to 'options.toString()' called with
default parameters. | class Options(object):
def __repr__(self):
return self.to_str() | 0 |
cdc64b1d2627cbc654a68a76e9981451 | 61cda7afcc0b1e386025b06351e00971 | Builds the clusters suffix trees. | class LogCluster(object):
def build_prefix_tree(self):
pass | 0 |
8594ba21b73a982135f2806185c8aa27 | 78d018c3377b18aa3089f9ae67f66f53 | 5.删除数组中的重复元素 | var ra = new Array(), re = new Array()
for (var i = 0, len = arr.length; i < len; i++) {
ra.indexOf(arr[i]) === -1
? ra.push(arr[i])
: re.indexOf(arr[i]) === -1 && re.push(arr[i])
}
return re
} | 0 |
cd751c6ba71e6aa78010c24689beae9b | d089b5d4015e3dbc9e229f95233c0d16 | Gets the obligation processing service. | public class WalletCreditBulkUploadEventListener extends AbstractSiteEventListener<WalletCreditsBulkUploadEvent>
public BusinessProcessService getBusinessProcessService() {
return businessProcessService;
} | 0 |
1b4a5a5d557921b2283ead82e3f47122 | b2e23e9448d73776956dcaaf7fb37954 | Sends the reply message. | namespace Microsoft.MixedReality.Toolkit.Extensions.Sharing.Communication
void SendReply(ISharingServiceMessage original, ISharingServiceMessage reply); | 1 |
54770e111df31b021a866d1b9b17096b | 512bb7f7097d0f11d419f8b73ac54521 | 测试请求登录接口union_id为空 | class TestLogin(unittest.TestCase):
def test_login_false(self):
r = requests.get(self.url, data=self.data)
self.result = r.json()
self.assertEqual(self.result["errcode"], 100003)
self.assertEqual(self.result["errmsg"], "Request method error") | 0 |
b834694e290a4891dd387ef5efaa9635 | 580ba4ad7586db6ad0c7bb1f7b19c848 | Change the message of the day message. | class server_commandscript : public CommandScript
static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args)
{
sWorld->SetMotd(args);
handler->PSendSysMessage(LANG_MOTD_NEW, args);
return true;
} | 1 |
9260be94ac316574706163296161eda8 | af37b5bb8cce7351cbf0812114ae23f0 | update here | def update():
bird.y = bird.y + 3 | 1 |
4fe38a1b7ddecb37c5a820e6c5008da1 | 070bcbc2958683245410a0cc958d8fe5 | This method is used to verify that the user is log in before accessing a controller and redirects to the login page | class HomeController extends UIDashboardController
public function loginRequired()
{
Yii::app()->user->setFlash('error',Yii::t('app','Please login to access the requested page.'));
$this->redirect(Yii::APP_MANAGER_URL.'login');
} | 1 |
71ac031694cb654d7521b46f6ac1eef1 | 68bc64ec0fd807b8c22912936abc9385 | Iterates over the string values of the enum,
ignores entries without a string value by default | where
Self: Sized,
{
Enumerate { it: self, n: 0 }
} | 0 |
de474248c91c4544d70ff612d220cfb2 | 1d27bff33ee7ee5750efe3bea1304c76 | transfer all chinese symbols to english symbols | def cht_to_chs(line):
line = conv.Converter('zh-hans').convert(line)
line.encode('utf-8')
return line | 0 |
c25f196ff7bcf1e910e7e17ba9fbbc7d | 81fde2f4759060a281cbc0c2f446353a | Adds a Money value of the same currency to this value. | {
CurrencyException cException;
if (mcCurrency != rcMoney.mcCurrency)
{
throw cException;
}
mAmount = mAmount + rcMoney.mAmount;
return *this;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.