query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4669975c230b2d0bdf0b3e4eb9b01c1c | 4c4b167e95253d40fa46d20231abf273 | Get song name from song object | public class Song
public String getName(){
return(this.name);
} | 1 |
135aee716a609aad54bd2309f0eb8d2c | 064b55b5db70c01b6739e67c7247304a | Extract the submitted values from the form. Throws exception when validation fails. | this FormBuilder builder, IDictionary<string, string> submitValues) {
if (builder.Attribute.EnableCsrfToken) {
var exceptedToken = HttpContextUtils.GetCookie(FormBuilder.CsrfTokenKey);
var actualToken = submitValues.GetOrDefault(FormBuilder.CsrfTokenFieldName);
if (string.IsNullOrEmpty(exceptedToken) ... | 1 |
b8f66f297cd51bacb4a051244188e31a | 9d1a245b5a04c069d48ec6ec1b2b8414 | Поиск дубликатов в каталоге | {
List<List<FileScanInfo>> ex = new List<List<FileScanInfo>>();
List<FileScanInfo> files = new List<FileScanInfo>();
List<string> filePaths = new List<string>();
try
{
scanDirectory(new DirectoryInfo(path), filePaths);
f... | 1 |
e92233dbebb7c0071571a1a741c1746f | d6d67401fe6bc609c4487b68396c3e2a | # Logistic regression constructor that can use different row_pair_functions. | theta = theta, theta0 = theta0, L = L, W = W,
REML=T, penalize=F,
PenF = c("SCAD", "LASSO", "aLASSO","MCP")) {
arg.call <- match.call()
PenF <- match.arg(PenF)
m <- length(X)
p <- ncol(X[[1]])
q <- ncol(Z[[1]])
ni <- sum(mapply(length,... | 0 |
79a530dbeda4019ae5d692117e7af4e4 | 2c73e8ddfc4188ee9561a99f5e5a9a46 | Getter for current morale | public class ObjLife : MonoBehaviour
public int GetMorale()
{
return objLifeData.GetMorale();
} | 1 |
9914eced8a45c093a0ac2c99173fb4bd | be657248024b1b834ec90a5d8794999d | 根据attr_value_id查询出attr_value | @Service
public class MangaeServiceImpl implements ManageService
@Override
public List<BaseAttrValue> getAttrValue(String attrInfoId) {
BaseAttrValue baseAttrValue = new BaseAttrValue();
baseAttrValue.setAttrId(attrInfoId);
return baseAttrValueMapper.select(baseAttrValue);
} | 0 |
6d6b8f873f6e0cf137c455ae48e0da09 | 232c039a060e20104f741a138d88930e | 得到花盆数据 | @Service
@Transactional //配置此方法加入事务管理
public class FlowerService{
public List<Flower> getFlowers() {
return flowerDao.getFlowers();
} | 0 |
a2bc2ec0b426f242b5d0efb3f092972f | 390f15590eee6bab9762760af8c5d9c4 | Put the given string at the beginning of the buffer. | int buf_puts(struct buf *buf, const char *s) {
return buf_put(buf, (char *)s, strlen(s));
} | 0 |
dbca877d1fac238fc4ea288768a45a5f | 93b6f88c84348a76b70f6b720bd65526 | 获取执行中的列表数据 | public class DataUtil
public LinkedList<TaskBean> getDoingTask() {
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
LinkedList<TaskBean> tList = null;
try {
conn = ConnectionManager.getConnection();
String sql = "select * from task_manager where runflag=?" ;
ps = conn.prepare... | 1 |
a6731c0f45788287eb75b591d4a25ee7 | edb56962c954e365dfc05c18977a727f | Převede logické (herní) souřadnice na pixely.
Vrací dvojici (x, y), souřadnice středu daného políčka. | float maxSize;
if (this.getWidth()<this.getHeight()){
maxSize = this.getWidth();
} else maxSize = this.getHeight();
float stepSize = maxSize / (float) fieldSize;
int []out = new int[2];
out[0] = (int)(x/stepSize)>=fieldSize ? fieldSize-1 : (int)(x/stepSize);
... | 0 |
8150dc334ad697455c26f2fe43c8154c | 8623c111e9eddeb8a6ec978ddf327a16 | Task to output data to UART0. | void
UARTIntHandler0(void)
{
ulStatus0 = ROM_UARTIntStatus(UART0_BASE, true);
ROM_UARTIntClear(UART0_BASE, ulStatus0);
while(ROM_UARTCharsAvail(UART0_BASE))
{
var = (unsigned char)ROM_UARTCharGetNonBlocking(UART0_BASE);
ptr[i] = var;
ROM_UARTCharPutNonBlocking(UART1_BASE, ptr[i]);
i++;
}
} | 0 |
b7fd899edc7ede189a939226014bef31 | 530899fa060098be63caa82795bda115 | Start Spawning Enemys and powerups | public class SpawnEnymeController : MonoBehaviour
void Start () {
} | 0 |
5a5c010a6f42a003f2d56e8689529e62 | 48642e4a60e85c619c2e8c4712dd8624 | https://atcoder.jp/contests/abc164/tasks/abc164_d | let out = std::io::stdout();
let mut out = BufWriter::new(out.lock());
macro_rules! puts {
($($format:tt)*) => (let _ = write!(out,$($format)*););
}
#[allow(unused)]
macro_rules! putvec {
($v:expr) => {
for i in 0..$v.len() {
puts!("{}{}", $v[i], if i ... | 1 |
855948d79e55924f89d113f52508da94 | 85726cf890b97f114d4779971acbce57 | Метод по генерации случайной фамилии | public class Snames
public String randomSurname() throws DatabaseException
{
try {
Gson gson = new Gson();
Reader reader = new FileReader("json\\snames.json");
Snames SNAMES = gson.fromJson(reader, Snames.class);
data = SNAMES.getSurnames();
}
... | 1 |
eabe9b22b838f7bae996201e19e454b3 | 3c4aba9488d6f12cb54a3f1d67b10451 | Disposes of the passed {@code LLVMOrcSymbolStringPoolEntryRef*}.
<p>Does not release the symbols themselves.</p> | {
yojimbo.assert(m_allocator != null);
m_entries = null;
m_entry_sequence = null;
m_allocator = null;
} | 0 |
af6ea6589b447ff117c1f10ccce13ea4 | d986456a79f74951ad0963eae5d408ca | # Crossover : randomly select a point and swap the tails | popsize <- length(population)/2
N <- length(population[[1]])
newpop <- list()
for(i in 1:popsize){
j <- popsize + i
parent1 <- population[[i]]
parent2 <- population[[j]]
idx <- sample(N,N/2,replace=FALSE)
parent1[-idx] <- setdiff(parent2,parent1[idx])
newpop <- c(newpop, list(parent1))
}
newpop
... | 0 |
d50d4e525e7297afdcbbfc8062d43eb7 | a5aa3792e7838fba1d8f989d0f6a8a54 | Returns -H_U^{-1} @ x | res = self.U * x
if ndim(res) != ndim(self.U) + ndim(x) - 4:
raise ValueError('Can not contract U=%s and x=%s properly!' % (
self.V.__repr__(), x.__repr__()))
if self.S is not None:
res = res * self.S
return res * self.V | 0 |
3a39b198f14f097b545add5c9dc629ec | d3fdfc757b3daa40da84565c9db1f7e2 | References the assemblies the are already loaded into the current <c>AppDomain</c>.
<para>This method is an equivalent of <see cref="CSScriptLibrary.IEvaluator.ReferenceDomainAssemblies"/>
with the hard codded <c>DomainAssemblies.AllStaticNonGAC</c> input parameter.
</para> | namespace System
public sealed class AppDomain : MarshalByRefObject
[MethodImpl(MethodImplOptions.InternalCall)]
public extern Assembly[] GetAssemblies(); | 1 |
b6692ac30d3eb56caa3476698504e78e | 9335b512794984f137f867b5dd490ecc | Resets the retry count to zero. | public class PublishProcessorState private static class PublishThrottle
public void resetRetryCount() {
mRetryCount = 0;
calcLatestPublishAllowedTime();
} | 1 |
8d360717bd06d55b721570874659a073 | c0f8bd0820f46e1caefc2f5b47cb2109 | > Anti Gapcloser | {
LPOBJ lpObj = &gObj[aIndex];
if (lpObj->Connected != OBJECT_LOGGED && lpObj->Connected != OBJECT_ONLINE)
{
return;
}
if (gServerInfo.m_CheckLatencyHack != 0 && abs((int)((GetTickCount() - lpObj->ServerTickCount) - (lpMsg->TickCount - lpObj->ClientTickCount))) > gServerInfo.m_CheckLatencyHackTolerance)
{
gLo... | 0 |
0cd77ebce12d2736578175b0c2386e29 | a4903f2f3bf70956ddc006584f8061a5 | Fetches the entire accessibility tree | fun AccessibilityNodeInfo.all(includeTree: Boolean = true): ArrayList<AccessibilityNodeInfo> {
val accessibilityNodeInfoList: ArrayList<AccessibilityNodeInfo> = arrayListOf()
this.all(includeTree = includeTree, accessibilityNodeInfo = this, arrayList = accessibilityNodeInfoList)
return accessibilityNodeInfo... | 1 |
74e3ff6150830770fe412b752d460935 | 684f876ee99c425aca63d41d6956c765 | Given a list of elements it creates doubly linked list | export default class DoublyLinkedList<T>
constructor (...nodes: Node<T>[]) {
if (nodes.length) {
this.setHead(nodes[0])
for (let i = 1; i < nodes.length && this.head; i++) {
this.insertAfter(nodes[i - 1], nodes[i])
}
}
} | 1 |
27573fb68d47aca47726d99e19bf6485 | 670ec3e1e6958bdeaedd00644ddfe15d | 将滚动条滚动到指定的view底部 | public class UIHelper
public static <T> void scrollToBottom(final T view) {
if (null != view) {
if (view instanceof ScrollView) {
final ScrollView scrollView = (ScrollView) view;
scrollView.postDelayed(new Runnable() {
@Override
... | 1 |
8c0724a98fce5cf23ec243e88a41b434 | 850cc3e9d982b0a3990296eb2a23efa3 | 根据评估分配专家成员情况,在Session中暂存一个反分配的Expert Id | @Controller
@RequestMapping("/inspectionArrangement")
public class InspectionArrangementController extends WebBaseController
@RequestMapping("/deleteExpert")
public JacksonCountReturn deleteExpert(String id) {
return this.inspectionArrangementService.deleteExpert(id);
} | 0 |
23820ec384031711e670026a090f724e | 85b6dd663867bef173f1d45807316a03 | Compares two {@code Money} objects for less than. | public class Money implements Serializable, Comparable<Object>
public Money subtract(Money other) {
assertSameCurrencyAs(other);
return newMoneyWithSameCurrency(amount.subtract(other.amount));
} | 0 |
ab770e4e5cfe3542debf5d8cdf85f8de | 6b75e619ee5024f36a17d4740b1647c8 | Menu to select other, more specialized GUIs | class MaestroUi(Ui_MainWindow):
def otherGuiSetup(self):
self.fileSchedule.triggered.connect(self.getSchedFileNames)
self.exportAction.triggered.connect(self.exportDirectConnections)
self.exportFullConnectionAction.triggered.connect(self.exportFullConnections)
self.actionSetDotLoc.tri... | 0 |
4f74f96f8cf38b53c9d4e5838d4843f2 | 446ca70053a6812f72125a5b6e090a8a | Process a received vCard data. Saves vCard photo as user's avatar
if possible. | VCard vCard = new VCard();
vCard.load(getConnection());
byte[] bytes = getFileBytes(f);
String encodeImage = StringUtils.encodeBase64(bytes);
vCard.setAvatar(bytes, encodeImage);
vCard.setEncodedImage(encodeImage);
vCard.setField("PHOTO", "<TYPE>image/jpg</TYPE><BINVAL>" + encodeImage + "</BINVAL>", true)... | 1 |
6d425b2557069c694c203d899da3bfde | eb97c328c5880a25a536ade401525ca9 | @brief Clear the error code of a manager. | {
AFX_MANAGE_STATE(AfxGetStaticModuleState())
*pVal = _lastErrorCode;
_lastErrorCode = tkNO_ERROR;
return S_OK;
} | 1 |
724e036c97b7ec02e6ef9a268b080684 | 930a61477f6f66acc2966ddacb109e14 | given a pixel, groups the neighbouring pixels together. returns group X,Y values. | {
Queue<Coords> _check = new Queue<Coords>();
List<Coords> list = new List<Coords>();
_check.Enqueue( new Coords(_x,_y) );
m_Tile.SetPixel(_x, _y, 0);
while (_check.Count != 0)
{
Coords point = _check.Dequeue();
... | 1 |
63fa2d2c95776b00be1be588214670f3 | 097007d895417ba0f7c97fa7a8e16fda | Calculates the price earnings ratio of a known stock identified by it's stock symbol. | public abstract double calculatePeRatio(Stock stock, int tickerPrice); | 1 |
7820b22387d1abcc2a40129c94c09812 | 239e702be3274a3d56cf89cb6e5210a6 | Abstraction of the kanji chip, which contains position
coordinate corresponding to upper left corner, the kanji,
and the status (0=uncompleted,unclicked, 1=clicked, 2=completed) | global screen
board_area = pos + (CHIP_SIZE, CHIP_SIZE)
screen.blit(BG_IMG, pos, board_area)
screen.blit(chip, pos)
screen.blit(BOARD_IMG, pos, board_area) | 0 |
da98dad8fb43dc410a2e5649cf11db8f | d55dff78f9af9edffa5ce79459e1aa89 | Detach tensor (collections) from current graph recursively. | def detach_and_clone_dict_recursive(dictionary):
if not isinstance(dictionary, dict):
error("detach_and_clone_dict_recursive acting on neither a Tensor nor a dict.")
new_dictionary = dict([
[
key,
value.detach().clone() if isinstance(value, torch.Tensor)
else ... | 1 |
19160ee79fa7471403991bbc28e0fdc3 | d12f329161ef75c53f85fd2efc1e6c73 | 测试SimpleDistributedLockImpl实现分布式锁
<p>
试着去获取锁(会发现:不论给其他时间多长时间,它们都不能获取到锁),只有等到获
取到锁的zookeeper客户端释放锁之后,其他zookeeper客户端才能获取到锁 | while(true) {
try {
client.create()
.creatingParentsIfNeeded()
.withMode(CreateMode.EPHEMERAL)
.withACL(Ids.OPEN_ACL_UNSAFE)
.forPath("/"+ZK_LOCK_PROJECT+"/"+DISTRIBUTED_LOCK);
log.info("获取分布式锁成功");
return ;
} catch (Exception e) {
log.info("获取分布式锁失败");
try {
if ... | 1 |
026e96e7e78cda6b2bae89560a7c6c38 | aa54724c104f826d3f25c69411ac07da | Tests the iteration logic of a doubly linked list. | dll = DoublyLinkedList()
dll.add_node(0)
old_tail = dll.tail
dll.append(5)
assert old_tail.next_node is dll.tail | 0 |
20f1ef56fc8ebe51060c6d7df2ae8a10 | 895331130ef4335413d60ed48b6ab074 | Checks if current token is a word | namespace Texxtoor.BaseLibrary.Core.HtmlAgility.ToXml.Parse
internal class TokenQueue
public bool MatchesWord()
{
return !IsEmpty && char.IsLetterOrDigit(_queue[_pos]);
} | 1 |
ab670e876d4ea3a30499bf5146041848 | cbb8159ce3913ceaf484cf0cc0957959 | Tests convertion of flat map to a prefix map. | public class ExecutionTests extends AbstractExecutionTest<Script>
@Test
public void testMap1() throws IOException {
assertEqual("mapTest1");
} | 0 |
3d2ccf390c11611ad8aa8430d1c46513 | f892ecbb536f12acc0c65298c342aee5 | Sets the count of a specific character | public void setCharacter(int pos); | 0 |
e0f021a1dce54c46367d57b233b8b6fd | 0b37065721673466de7c0631b0ccb36c | Print all supported languages. | translate_client = translate.Client()
results = translate_client.get_languages(target_language=target)
for language in results:
print(u'{name} ({language})'.format(**language)) | 1 |
e7b092b885fd49dbb592cdd5c735778c | 0d4d12a1f6357eab2b74d78c61bac620 | Reset the number of jumps. | public class CharacterBehavior : MonoBehaviour,ICanTakeDamage
void LateUpdate()
{
if (_controller.State.JustGotGrounded)
{
BehaviorState.NumberOfJumpsLeft=BehaviorParameters.NumberOfJumps;
}
} | 1 |
83242fb8a419a0c6e010034bc781ac59 | ba55a11a4fd7345c52cea0989d76a422 | True if no changes are pending. | def no_changes_pending?
%x(git status --porcelain).split("\n").length == 0
end | 1 |
2276386df59f32af8369dd7a2f33a049 | 4ecf1acd7b10a0ff0bf8aa273751871b | Get a random file path in the system temp path | namespace FileManager
string GetTemporaryFilePath(); | 1 |
b9c2889a2aa6ae75a586a44a6c52ce24 | 333ab5042d89856dd78ce640dd0381f0 | transform polar coordinates to cartesian systems
https://stackoverflow.com/questions/20924085/python-conversion-between-coordinates | def pol2cart(theta, rho):
return rho * np.cos(theta), rho * np.sin(theta) | 1 |
6764b0c1cf15c830b0fd37aeec57cd31 | e5748fedb0cdfb9e9a59c5180a138687 | 实现发布感谢信功能接口 | @Repository("expressThanksDao")
public class ExpressThanksDaoImpl extends BaseDao implements IExpressThanksDao
@Override
public boolean save(ExpressThanks expressThanks) {
Session session = super.getSession();
try {
session.save(expressThanks);
return true;
} catch (Exception e) {
e.printStackTrace();
... | 1 |
536b875c53ad273698443ac5acaddb8e | e740e193f6847b90d8cf77f801601064 | Returns a serial number (default to device serial number). | class GetSerialNumberCommand(ItemInfoCommandBase):
def __init__(self, device_type: str) -> None:
super(GetSerialNumberCommand, self).__init__(device_type, "SERIAL_NUMBER") | 0 |
c0c75984a47ea72483598d0b0d2c2247 | 04aadcd8c84319145469d36131676a09 | ---------------------------------------------------------------------------------------------------------------------------------------
Map network drive
--------------------------------------------------------------------------------------------------------------------------------------- | namespace MapDrives
public class NetworkDriveHelper
public void MapDrive()
{
mapDrive(null, null);
} | 1 |
7089c87a181d83583ac62a260dcaa347 | 0b6c7015805dd1663fd421bdea01d5db | Retorna el tamanio en bytes de los archivos asociados a una captura.
Se invoca para actualizacion de la progressbar y el label con los bytes enviados/totales. | class Database_model extends MY_Model
function Calc_Files_Bytes_Period($jobname, $dataMenor, $dataMaior) {
if ( $dataMenor != "0" || $dataMaior != "0" )
{
$this->db->where('endtime <= ' , $dataMaior );
$this->db->where('endtime > ', $dataMenor);
}
$this->db-... | 1 |
12fde537a97bca49f2852e32d5446c59 | c359a00bae23aee74bc834956108a6f8 | Factory method for making a TextChapter and its children from a .json. | with open(json_file, "r", encoding='utf-8') as reader:
text = reader.read()
return cls.from_dict(json.loads(text)) | 1 |
65c6acd9155fff037714bf1931c8c633 | d16533f1c8968ba74166dec6158b01d8 | Loads the control's saved metrics. | class TestBench(SemanticVersionerMixin):
def load_metrics(cls, path: str) -> dict:
savedir = pathlib.Path(path)
return dill.load(open(str(savedir / "metrics.dill"), "rb")) | 1 |
6b85bf3a795fbb61b788d35b4e80272c | ea3b821d4b1400157b50d31e3a4d555c | Creates an instance of Database. | function Database(app) {
this.app = app;
this.opts = { useMongoClient: true };
mongoose.Promise = Promise;
} | 1 |
d5ade500775b41142ec10c3e3b79bda0 | 0e7510d7d2883b4d023d0a6892f92276 | Регистриррует нового пользователя на основе данных заказа
При успехе возвращает нового пользователя, иначе добавляет в заказ ошибки | Boolean isValid = checkPersonIsValid(person);
if (isValid) {
_orderMask.createOrder(person);
}
} | 0 |
50b710e0545f13221314fc9222b8fd92 | 1c3ed3c842ecc39a745878ec6af064d8 | Gets as feedbackID
The unique identifier of a Feedback record. This field is used if the user wants to retrieve a specific Feedback record. If <b>FeedbackID</b> is specified in the call request, all other input fields are ignored. | public class CampaignFeedbackResponse
public Integer getFeedbackId() {
return feedbackId;
} | 1 |
b9ba33d342ec22c5830ca4b6140f9258 | 2ed1835b977574c95e8454391ed9e391 | Gets the histogram values of a specified band. | GdiConstant.GDIPlusDll,
SetLastError = true, ExactSpelling = true,
CharSet = CharSet.Unicode)]
public static extern int GdipBitmapGetHistogramSize(
GpHistogramFormat format, out uint numberOfEntries); | 0 |
3c8d61c599a8d71cbd4bd9124e2a9726 | 3ecab575040adb73a5c21f7f28393332 | в организации должен остаться хотя бы один админ | {
if (count($organizations) > 1) {
return true;
}
return
count($organizations) === 1
&& $organizations[0]->getId() !== $this->tokenAccessor->getOrganizationId();
} | 0 |
bb6e10b362197868fce41133337df469 | 658f900da3218f86b52f0db640f983df | Test that IOB tags are correctly converted to BILUO tags. | new_tags = []
for i, tag in enumerate(tags):
if tag == 'O':
new_tags.append(tag)
elif tag.split('-')[0] == 'B':
if i + 1 != len(tags) and \
tags[i + 1].split('-')[0] == 'I':
new_tags.append(tag)
else:
... | 1 |
b3a8e9a8c5d3e1c59c6a1c68f6834711 | e8fb4ea2924a5db8268951d744c062bb | If the gold has fallen far enough this method is called and the falling gold then is removed
and a broken gold bag is created in its place | {
if (npcManager.SpawnGroceries)
{
int i = 0;
foreach(Groceries grocery in groceries)
{
grocery.GetComponent<RectTransform>().anchoredPosition3D = grocery.StartPosition;
}
while (i < 4)
{
int rand... | 0 |
04915f48381970d19ff07e54dc369daa | 68af2ee3821eed5f3c4aad4ee6196591 | ## Substract two numbers | numberSubtract(num1, num2) {
return (numeral(num1).subtract(num2)).format('0.00')
} | 1 |
335fd3554094d513002d731611d775fc | db71c2966b6413adff4775ad6368a80b | computes the correlation matrix from the covariance matrix | p = np.shape(rhos)[0] + 1
cormatrix = np.ones([p,p])
for i in range(p-1):
for j in range(i+1,p):
for k in range(i,j):
cormatrix[i,j] = cormatrix[i,j]*rhos[k]
cormatrix[j,i] = cormatrix[i,j]
return cormatrix | 0 |
ef71d31cf8bbd2904f36b99f0804025f | 1f3243f80d0f87bf4d798db14fe7996f | 批量启动实时迁移、同步、灾备任务。
Please refer to HUAWEI cloud API Explorer for details. | public class IoTDAClient
public SyncInvoker<CreateBatchTaskRequest, CreateBatchTaskResponse> createBatchTaskInvoker(
CreateBatchTaskRequest request) {
return new SyncInvoker<CreateBatchTaskRequest, CreateBatchTaskResponse>(request, IoTDAMeta.createBatchTask,
hcClient);
} | 1 |
8f248379908e219aae69de78975e11de | 5037d84d30cd8927627ab0a76664eb25 | Dispatches for each element in a collection. Set up with <see cref="Add{TSpecific}"/> first. | IListHelper.ForEachThree(tuple.collection1, tuple.collection2, tuple.collection3, (ref T1 i1, ref T2 i2, ref T3 i3, ref int index) => {
doWork(ref i1, ref i2, ref i3, ref index);
});
} | 0 |
261158b8f46c796005bf37022cad1ff7 | e23a69c1e31fc56a1ebf8a03a02cb92a | 计算顶部菜单的透明度,实现渐变效果 | int topMargin = viewGroupLayoutParams.topMargin;
int alphaHeight = headerHeight;
if (topMargin > alphaHeight) {
mAlpha = alphaMax;
arrowBgDrawable.setAlpha(alphaMax);
description.setTextColor(Color.argb(alphaMax, 63, 57, 51));
} else {
mAlp... | 1 |
c4f0a7b3a9f1382fca65e2f85e64f61f | ab40b3bcff87ebfc51e6d7737ba00cd4 | Getter for a project by index | for(int i = 0; i < projects.length; i++)
if(projects[i].getName().equals(projectName))
return projects[i];
return null;
} | 0 |
6a52039aeb0e5549d6d21ea0c821d471 | 7d41ceea7672a2f0f1b915fc1b18561b | MACD筛选全部股票 | g.filter_paused = True
g.filter_delisted = True
g.only_st = False
g.filter_st = True
g.security_universe_index = ["000300.XSHG"]
g.security_universe_user_securities = []
g.industry_list = ["801010","801020","801030","801040","801050","801080","801110","801120","801130","801140","801150","801... | 0 |
993e79e09329a6fc986941803a6d7c84 | f640e3cc47707d87527c5914915a5fcf | Defines what to do when the venue visit query form is submitted | form = VenueForm()
err = False
try:
venue = Venue(
name=form.name.data,
city=form.city.data,
state=form.state.data,
phone=form.phone.data,
address=form.address.data,
genres=form.genres.data,
image_link=form.image_lin... | 1 |
9d339f00d8c62fceea9ede4cf68884dc | 642b3463e90d7d72de939710f1a1e8fd | Creates a new adapter for an object of class '{@link de.uni_stuttgart.iste.cowolf.model.component_diagram.Sensor <em>Sensor</em>}'.
<!-- begin-user-doc -->
This default implementation returns null so that we can easily ignore cases;
it's useful to ignore a case when inheritance will catch all the cases anyway.
<!-- end... | public class GuigenAdapterFactory extends AdapterFactoryImpl
public Adapter createActorAdapter() {
return null;
} | 0 |
f57f80fe180ff4fd9557c3cf1579153c | 3f30d036c8a8e16f4c48d0a916eb736d | Hides the chat pane | {
var dispatcher = Application.Current.Dispatcher;
dispatcher.Invoke(() => ChatPanel.Visibility = Visibility.Collapsed);
dispatcher.Invoke(() => ButtonSend.IsEnabled = false);
} | 1 |
29a622f696c58478f6b9f576510bf56a | 545e4a608ab51e8f858fe92b964e006e | 点击批量下载存档报告按钮 | function btn_Archive_OnClick() {
try {
archiveTask();
} catch (e) {
}
} | 0 |
03f7c849883e7824472be571e60b59c2 | 3e8915f3040fa6454c92cd5c5111f50d | 将字节变量的每一位转换成bool数据存入一个bool型数组MBitVaue中 | extern void bytetobit(bool *DatOut,char *DatIn,int Num)
{
int i=0;
for(i=0;i<Num;i++)
{
DatOut[i]=((*DatIn)>>(3-i%Num))&0x01;
}
} | 1 |
2b444bfd9f7b40d3f1ab2ac9ffc67ef9 | 547ea523acbc991794c044348d32015f | Updates the data point when the independent value is changed. | namespace System.Windows.Controls.DataVisualization.Charting
public abstract partial class DataPointSeries : Series
private void OnDataPointDependentValueChanged(object sender, RoutedPropertyChangedEventArgs<IComparable> args)
{
OnDataPointDependentValueChanged(sender as DataPoint, args.OldValue... | 0 |
34136576a1416ececd4c1d5a69e46c07 | d664f602efa9e2fb1a1c79cbb5b34f7b | output sac struct array into a list of files | {
std::ofstream writer(fileName);
if (!writer.is_open())
return false;
for(int outputIndex = 0; outputIndex < (int)outputs.size(); outputIndex++)
{
writer << Stringf("%s\n", outputs[outputIndex].c_str());
}
writer.close();
return true;
} | 0 |
679e9ee0cf33075af23a15a9a293d92b | fe7029e016ae3392f937a10825608ba7 | 将16进制字符转2进制串 | let tempStr = '';
for(let i = 0,len = str.length;i<len;i = i + 2){
let num = parseInt(str.slice(i,i+2),16).toString(2).toString();
if(num.length < 8){
for(let j = 0,len2 = 8-num.length; j < len2; j++){
num = "0" + num;
}
}
tempStr += num;
}
return tempS... | 1 |
f0cee7d9164a29971af497a9d020c875 | c98f5c10295069a5bb6dfe100fccf921 | 将空接口转换为整数 | func ToInt(param interface{}) int {
switch ret := param.(type) {
case int:
return ret
case int64:
return int(ret)
case float64:
return int(ret)
case []byte:
r, _ := strconv.Atoi(string(ret))
return r
case string:
r, _ := strconv.Atoi(ret)
return r
case bool:
if ret {
return 1
} else {
ret... | 1 |
39781a07e653b440e14768a7c8928a3f | 26be1e1758fb659480524fe1d55e6220 | Stub out mirror manager for testing purpose. | public class MirrorManager : MonoBehaviour
void Start()
{
} | 1 |
73f4bd90778db10e968a78f9575efcb5 | 390228492f934cfbe1e88a7a73ae5477 | First ensure that there is a valid CAS login. Then, present the user with a page allowing him/her to select
filler or joiner status. | def welcome():
login = session.get(app.config['CAS_USERNAME_SESSION_KEY'], None)
if login is None:
return redirect("/login")
user = Profile.query.filter_by(net_id=login).first()
if user is not None:
return redirect("/my_profile")
(name, year, college) = get_user_details(login)
da... | 1 |
413dc6256a03be4654a05361ee0f7afb | d4689beedcc3ab0d154198fd5786c273 | Производит замену всех вставок (Insertions). | void insertions_to_repeats(
std::vector<std::unique_ptr<Differential_Instruction>>& baseInstructions) {
Threader threader;
std::mutex instructionMutex;
std::vector<std::unique_ptr<Differential_Instruction>> newInstructions;
for (const auto& inst : get_large_insertions(baseInstructions)) {
th... | 1 |
7e872d6b6ff2cf0f5ea25642c4d7c86c | 1d566f3db82e4b8370abef086c1abd99 | カテゴリに一致するキャッシュヘッダリストを取得する | $get = func_get_args();
if (empty($get)) {
return NULL;
}
$i = 0;
$param = array();
foreach ($get as $t) {
if ($i == 0) {
$param[] = 'module-'.SITE_ID.'-share';
$param[] = 'category';
}
$param[] = $t;
$i = 1;
}
$ci = &get_in... | 1 |
40649cfea50872f9572e8f67ec946343 | b0ba7e03025d8670a04c748c810cfa34 | get the selected library from the comboBox | String ret = "";
ret = value_combo.getSelectedItem().toString();
return ret;
} | 1 |
9653f1cb7a7cd23e585196c86d8c6526 | 44793a9e15b6da96fe50ac898322b031 | [local] Updates local dev environment | local("hg push ssh://liket@liketools.valt.me/http --new-branch")
with cd("~/http/"):
run("hg up")
run(".env/bin/python manage.py syncdb")
run(".env/bin/python manage.py migrate")
run(".env/bin/python manage.py collectstatic")
run("killall python") | 1 |
08d4cbda9e96075f200fc02a4c3ec709 | 284c75a0ea7a36dd750b473e214dfc97 | 按条件和排序查询第一个TempExamDeviceClass对象 | namespace Tellyes.BLL
public class TempExamDeviceClass
public List<Model.TempExamDeviceClass> SearchTempExamDeviceClassByCondition()
{
return new DAL.TempExamDeviceClass().SelectModelObjectByCondition();
} | 0 |
91eb00a581cdd081b651c29f14c2b03b | 7a7f327bc042d06e381a8f041105bfe4 | Call another CLI class, by name. | class test_apex_cli extends test
private function send_cli(string $action, $vars = array())
{
if (!$app = app::get_instance()) {
$app = new app('test');
}
$response = $app->call([apex_cli::class, $action], ['vars' => $vars]);
return $response;
} | 1 |
b204885cd9921b1d780161599905304a | d42ee71a1125db80506d8826e556817d | 在任务执行完毕之后,会进入一定时间的有效期。在过期时间之前的有效期内,任务不会再次执行。
默认为第二天0点。重写这个方法修改过期时间。 | if(!$this->taskTime){
return config::SET('task', time());
}elseif($this->taskTime+2592000<time()) {
config::SET('task', time());
import('@.Yuol.clean');
return clean::CLEAN();
};
} | 0 |
ac915a6ab4ce2e32fa8235cef912b54e | 94fd0a53f98689a545ab761e7dd64081 | Set the get request to only return count of the keys.
@param countOnly flag to only return count of the keys
@return builder | public function getOnlyCount(): ResponseInterface; | 0 |
526fba35ddd5cdf2413e66f7b68a9234 | 6b4af7d0b19bb7174a923799a54556c2 | 註冊,成功回傳_id,失敗回傳False | def register(accountid1, password1, name1, information1, count1):
v1 = models.Account.objects.filter(accountid=accountid1)
if len(v1):
return "fail"
else:
models.Account.objects.create(accountid=accountid1, password=password1, name=name1, information=information1, count=count1)
retur... | 0 |
b75c102e232f770895230b6fb43ddc78 | 2197046e8578f07408e4807c37ea6bd4 | 为每个持仓股票分配资金 | update_columns = ['股票余额', '可用余额', '市值', '买入成本', '参考盈亏']
for c in update_columns:
if c not in stock_df.columns:
stock_df[c] = None
postion = xbx_get_position(ths)
time.sleep(0.5)
if postion.empty is False:
postion.set_index(keys='证券代码', inplace=True)
for i in lis... | 1 |
fc745b52d1329824bd14411cf31d826a | 8ad0d3ed351b8469437ae8109a49e0a5 | Clones an entity and copies all properties except those in the ignored list | public class EntityBeanUtil
public static Object cloneBean(Object object, String... ignoreProperties) {
Object cloneObject = null;
if (object != null) {
try {
cloneObject = object.getClass().newInstance();
BeanUtils.copyProperties(object, cloneObject, ignorePr... | 1 |
1a063dd1066fbbcd10d487bed28ecf9f | 072c39b6ac93f6dcdc240e5ee9bb4268 | Returns the specified range of elements in the sorted set stored at key. By default
the elements are considered to be ordered from the lowest to the highest score.
Lexicographical order is used for elements with equal score. Both start and stop
are zero-based indexes, where 0 is the first element, 1 is the next element... | Set<Object> zrange(final String key, final double start, final double stop); | 0 |
0f9e651e74339c055304270879733d39 | 3af26e0dc1a29428797b96f21bc19e8c | Initializes communication with the magnetometer and sets sensor parameters | void initMagnetometer(I2C_HandleTypeDef* i2c){
hi2c =i2c;
count =0;
lastDegree =0;
softResetMagnetometer();
} | 1 |
2433e6ac4770bd74f1a90c6014be7ee2 | 67163ed3d9b16cdf6406fd5462530d24 | Apply the output stream directory. | parser = method_parser(self.outputdir, summary = 'config outputdir <path>')
parser.add_argument('path', action = 'store')
if not args or 'help' in args:
parser.print_help()
return
subargs = parser.parse_args(args)
if subargs.path:
if not exists... | 1 |
41e9149aa788a4fecaf3ca815c80636b | 6ebe2f521b8f73d69f0dccc497e0940a | 得到方法名 | public class MyFTPClientGetTest
private String getMethodName() {
return Thread.currentThread().getStackTrace()[2].getMethodName();
} | 1 |
3b7360a817ec68111487d02c01c61b5f | 9e27527036bb4eede944653310889c14 | whether the character has the Item with the given ItemId | namespace RPG.InventorySystem
[CreateAssetMenu(fileName = "New PlayerInventoryObject", menuName = "Inventory System/Inventory/PlayerInventory")]
public class PlayerInventoryObject : BaseInventoryObject
public bool HasItem(int itemID)
{
return inventorySlots.Any(slot => slot.slotData.itemData... | 1 |
f174e979c36a6695dfbc7286c8228e5a | 841e6e3d1d0203b872509a94daff36c9 | Retrieve the frequency domain noise patterns for a noise pattern indicated by index, for both regular and flipped. This
method deals with five cases: | LD, ND = self.data_path[index]
LD_path = self.LDCT_root + '\\' + LD
ND_path = self.NDCT_root + '\\' + ND
preprocessed = self.get_preprocess(LD_path, ND_path)
if self.train:
return preprocessed[0], preprocessed[1]
else:
return preprocessed[0], prepr... | 0 |
3c5be42e693d380082d1ebba633d04b1 | 6fc2ee42ea532e1bd672103f30178f37 | Méthode permettant de supprimer tout les observeurs | void Observable::removeAllObservers()
{
_observers.clear();
} | 1 |
0509fd8e4123e1a64fbd9f58baa2ac6e | cf6f6f010e5bfad3d742dc2f1013e266 | 提交添加监管中心信息,返回监管中心列表页面 | public String toCreateInfoCenter(HttpServletRequest request, HttpServletResponse response,
Model model) {
return path + "createInfoCenter.vm";
} | 0 |
1c7731040338595ad84424cdb1c92aaa | fe52c8be55005af993ab2006836e1d4f | computes x_(k+1) = x_k + B*u_k + noise | [A, F] = assemble(u_k)
du = np.insert(solve(A, F), [0,N-1], 0)
return du | 0 |
b82b0f526a08dc6c642349f8d9e08bd2 | 2b6a5748e1e72fe917947433726a6d29 | Senam typů změn (přidáno, změněno, oprava) | class KamiCorpus(object):
def modifications(self):
return nodes_of_type(
self.action_graph, self.get_action_graph_typing(), "mod") | 0 |
3c4cb3a23db069fb74a8f6c4561ef269 | f9280926bbbe08af4739b908cb2fc4ec | DynamoDBのテーブルに値を入れて取り出すテスト | public class EnhancedHandleList
public static void putRecord(DynamoDbEnhancedClient enhancedClient) {
try {
DynamoDbTable<Contact> contactTable = (DynamoDbTable<Contact>) enhancedClient.table("Contact", TableSchema.fromBean(Contact.class));
List<String> names = new ArrayList<>();
... | 1 |
2f65364fcf5a88b4ee914240fc31a8c8 | da229b7d7cae6f6d36b8d0976ccf4c37 | retrieve all data collection ids for a session (visit) | sessiondata = apDatabase.getSessionDataFromSessionName(sessionname)
selectq = appiondata.ApSelectionRunData()
selectq['session'] = sessiondata
selectdatas = selectq.query(results=1)
if not selectdatas:
return None
return selectdatas[0].dbid | 0 |
a3d7de9cd002f3e9beab7aa474f1dc04 | 4a065eda953d1ce7b19c0f76502cd11b | Retourne le parking parent de cette vue | public class VehicleRepresentation
public ParkingLot getParkingLot() {
return parkingLot;
} | 1 |
eab4302252a9567bef5f76cf74b944d4 | 3812af6d9cce4af98cf62491d9dfb962 | Returns a patched proof rule where the reasoner version has been
changed to prevent its reuse. | struct proof_sequent __attribute__((unused)) * sequent,
int __attribute__((unused)) which) {
return (struct prover_rule_result){NULL, NULL};
} | 0 |
1708a73b6f3aa00f60fb0540fbb6878f | d3fad364de439ed3ad4820835b1df1e0 | Get the current item of the media player that is played pause or stopped | IMediaPlayer getCurrentPlayer(); | 0 |
37f9c3aa01fc8689d80f81fa1990af0b | c6a1dcadbb822340a749941732d5d071 | Keep checking the guiQueue *forever*, executing the commands
which are passed to it. Queue.get() blocks until the queue is non-empty. | class GUI(tk.Tk):
def __init__(self, client_queue_cmd, client_queue_log, client_queue_telem, beam_gap_queue, destroyEvent, server_ip, **kwargs):
tk.Tk.__init__(self, **kwargs)
self.client_queue_cmd = client_queue_cmd
self.client_queue_log = client_queue_log
self.client_queue_telem = clie... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.