query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
84946f8c11ca22e0b61a9c9f61218a85 | ec6012ca82ce8475c55cbb40ab9e7d85 | 根据服务器ID获取站点列表 | int32_t CDao_Config_Center::_GetSvrListBySetId(const int32_t& nSetId,DaoSvrList& oDaoSvrList)
{
int32_t iRetCode = 0;
MD_COMM_LOG_DEBUG("Enter SetId:%d",nSetId);
if (nSetId < CC_TEMP_MIN_FOR_ID)
{
iRetCode = CC_TEMP_SETID_INVALID;
MD_COMM_LOG_ERR(iRetCode,"Input is invalid.SetId:%d",nSetId);
ret... | 0 |
2ecb6bded2d4875e0c33ae6efb9f165a | ea89ce4ddd73016a9832cda5c3b2fa41 | Aktualizuje dane pizzy o podanym id | namespace Bocatasion.API.Controllers
[ApiController]
[Route("[controller]")]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
[ProducesResponseType(StatusCodes.Status404NotFoun... | 0 |
e2cca3129239f6402ff7bf3346795f2c | 1b942b1aea56f8181245f3d5ad10a69d | 根据商品uuid和购货方uuid获取购货方采购商品的会员价 | class Goods extends Base
public function ajaxGetMemberPrice($goods_id){
$price = model('Goods')->getMemberPrice($goods_id);
return json($price);
} | 0 |
c053ac56bac0c02020d44b81682122ad | 47203cd3cae667778b08f57860f46d6d | ## sim_logprob_locus 19/5/11
## Returns the log-probabilities of animals genuinely simulated from the
## posterior distribution of allele frequencies specified in nutab.
## Operates in log_10 if logten=T, otherwise in log_e.
## nutab is a table of nu-vectors which are the posterior parameters for
## the different popul... | logbayes.b=function(data,condi.parms,pb,snp.parms,snpfunction)
{ log.condi.y=sum(log.condi(data,condi.parms,pb,formu.value,condi.den.type.value))
logdenyb=log.condi.y+snpfunction(pb,snp.parms)
if(!is.finite(logdenyb))
logdenyb=-1e+20
return(-logdenyb)
} | 0 |
0659c8bd41b2b6a9a56165da3d08cd42 | 21d5d081009cd069849c024e882f942e | 受け取った手札がフラッシュであるかどうかを判定する関数 | class PokerService extends \Model{
private static function isFlash($cardList) {
$flush = true;
$base = substr($cardList[0], 0, 1);
for ($i=0; $i < count($cardList); $i++) {
if ($base != substr($cardList[$i], 0, 1)) {
$flush = false;
break;
}
}
return $fl... | 1 |
42c833a94dc05cfd411f318ddf18181b | 599fc0855487f06d3f0c3f4e088915f1 | Prepare entry context and human readable for devices search command | {
List<String[]> records = new ArrayList<String[]>();
records.add(getKeyValue(SearchTypeEnum.ACTION_NAME.toString(),
getText("commons.pages.actionName", servletRequest.getLocale())));
records.add(getKeyValue(SearchTypeEnum.ID.toString(),
getText("commons.pages.id", servletRequest.getLocale())));
record... | 1 |
7ec064918444d01b3df17327fb2da213 | dfb481c7df9885d3985bc548cac77dc2 | 空列表也是False | def myall(iterable):
for item in iterable:
if not item:
return False
return True | 1 |
014f859ea7bd01d1ed83a78bcf473d51 | 61266c881473f0bf60f4ff78e173699d | Overload << operator to perform logging. | namespace log
Logging::Logging(const char* file_name, int line, int level)
: impl_(file_name, line, level) {
impl_.stream_ << impl_.time_str_ << " "
<< impl_.file_name_ << ':'
<< impl_.line_ << impl_.level_str_;
} | 0 |
dde0e2d4bf0b27e8f3fd6334b37e0a71 | 7ca372a7069f2d64653f04187b192113 | 新增loginlog时确保accountId是唯一的 | @Service
public class AccountServiceImpl implements AccountService
@Override
@Transactional(rollbackFor = { AccountServiceException.class }, readOnly = false, propagation = Propagation.REQUIRED)
public void insertLoginLogTransactive(LoginLog loginLog)
throws AccountServiceException {
if (loginLog.getAccount() ==... | 1 |
2b40aac5ebb5a394cc8ff164ee2a7275 | 1ad108d699da759b3318eb96599b7f33 | 根据临时订单到数据库取实际订单,并合并两对象 | public class SpecialServiceImpl extends RemoteServiceServlet implements ISpecialService{
public boolean mergeOrder(String fromId, String toId) {
try {
OrderManager orderManager = SpringUtil.getOrderManager();
Order fromOrder = orderManager.getOrder(fromId);
Order toOrder = orderManager.getOrder(toId);
... | 1 |
f592a18b8c5c38020a8bbf66db71c952 | e236d180b085aa6984ae363447b34885 | Inserting packages data into packages table | class Package
public static function addPackageObjects($p_objects)
{
$flag = 1;
$values = "";
$i = 0;
if(count($p_objects) > 1)
{
foreach($p_objects as $p_object)
{
$i++;
$values .= "(NULL, '". $p_object . "', '" . $fla... | 0 |
081e5aac0b4e81caabb7b1b41748a190 | 99cab63bc876eb4635fcd004b6087cc5 | Surrounds current meadow with Obstacles. | public class MyWorld extends World
public void obstacles()
{
for(int i = 0; i < 600; i++)
{
for(int x = 0; x < 600; x++)
{
if(worldObj[i][x] != null)
{
addObject(worldObj[i][x],x,i);
}
}
}... | 0 |
9b19171ce23685a38029bcc82f261e7c | 02898102fdb11c64e0e51e9ac2bf9d00 | Return 1 if 'a' == 0 and 0 otherwise. | def test_a4():
assert 0 | 0 |
f810c5f40376cf4c23d3a9243bfe9a1c | 31bc7fecbe623da967beac4c28da19f5 | A method used to capture CoauthStatus related requirements when getting coauthoring status. | class CoauthorsController
def coauthor_params
params.require(:coauthor).permit(:user_id, :book_id)
end | 0 |
0a561f284952d2751be390b1a0a7d44b | 195578da13070bc07fe5d0036d7624be | Show bids that were placed by the visitor
REQUEST params: | vm.bidRequests = data.results
vm.paginationHooks = { next: data.next, previous: data.previous, count: data.count }
} | 0 |
6d99e9532caf71ad801867dd5bd58687 | 890249bf17a35185147ec5a97b6d9191 | Calculates the age in day. | if(birthday == null || calcDate == null)
return 0;
if(birthday.compareTo(calcDate) >= 0)
return 0;
return (int) ((calcDate.getTime() - birthday.getTime())/(1000*60*60*24));
} | 1 |
a1a44c890c1ec92de65f4d0c0d839392 | 6416ae8a3b90c2f396faf49f3433fdf6 | Поиск всех контактов в группе. | dbcon: DBConnection, monitor_id: int) -> Set[object_models.Contact]:
q = """select contacts.id, contacts.name, contacts.email, contacts.phone, contacts.active
from monitor_group_active_monitors
left join monitor_groups on monitor_group_active_monitors.monitor_group_id=monitor_groups.id
... | 1 |
a0f51e02747aec31dfb6d7c19ad7b9df | cc40e1389b626784ce39a26abbdb008a | 查询城市的所有的数据 | List<City> selectAllCity(); | 1 |
2da4622b37d3a9b831f4bcb3a4fca244 | 6bcbd1221dd108b1c387c3b09eece168 | returns true if player swipes | public class PromptAndResponseModel extends POSBaseBeanModel
public boolean isSwiped()
{
return swiped;
} | 1 |
56dba888992ede5b3fd0e5157eff95e5 | da64745b6f89d9ddb270713686b89257 | ... does nothing... | local function nothing()
end | 1 |
9e11a9c9bcad3c07ae735e6dc59e511c | 978633b1cc83064ecb622b41988502a1 | Called when there is a network or configuration error which cause sending keepalive
packet to fail | internal interface TransportSendAck
fun onError() | 1 |
21a85cb36fbeb624d36124318800d2d0 | 16538339884aa92a7ee715ebda6d5ddf | Write all milestones to DB in a single batch. | public boolean saveMilestoneReports(MilestoneReport[] milestoneReports); | 1 |
3e9796dfa149d4a0f2b2daed35ca387c | 958d3184b0a665a31bd0b57e22abfb97 | 根据书号更改库存 | void updateBookInv(@Param("bookNum") int booknum, @Param("bookName") String bookName); | 0 |
b1bcd572eb292c2a23aa9dd764f8e16c | 05c6bba9f41a7cb8dcaf74a1d84f3ac5 | Returns the hash code for the specified object (consistent with
{@link #areEqual}). Two objects considered {@link #areEqual equal} have
the same hash code. The hash code of <code>null</code> is always
<code>0</code>. | public final class Comparator<T extends Comparable<T>> extends AbstractBinaryComparator<T>
@Override
public int getHashCode(T obj) {
if (obj == null) {
return 0;
}
return obj.hashCode();
} | 1 |
dbf0a0ce697f123ff1f94e61676f8da2 | 17cb818606eedfb1958c75666ccb2cb6 | Set map canvas extent to selected administration extent | def set_geo_extent(bounding_box):
rect = QgsRectangle(*bounding_box)
CANVAS.setExtent(rect) | 1 |
911752a1c22fead72467339bcb624a81 | 9a19b3760a55ca3aec6ccdd396398e2a | Return array listing all enabled providers as well as a flag if you are connected. | abstract class Provider
public abstract function isConnected(); | 0 |
0d7ba728d13ffee37e713b8215b024d2 | 25b2706a378118b664323e164152c2fc | Retorna els alumnes actuals d'una classe i activa el primer alumne de la llista | export class DashboardService
getClassStudents(classId: number, pageId: number): Observable<Result> {
return this.http.get<Result>(`/class/students/${classId}/${pageId}`);
} | 0 |
8cc228f71919757b77a51b2611aa3126 | 51203ca1cbb71b0a990615d481563b87 | horizontal field of view | namespace LayerSceneGraph
Vector3 LPCamera::getHorizontalDirection() {
return Vector3(viewMatrix[0], viewMatrix[4], viewMatrix[8]);
} | 0 |
ba83b0b5f7d6a7e9fda4fd16a7ad2cc3 | fff5b5415fe74c56ce5757107702d8b3 | Tests the NumberTickets with max int value saves. | $TicketBin = new TicketBin();
$id = wp_insert_post(array('post_type'=>'raffle', 'post_title'=>'test title'));
$TicketBin->getBinFromDB($id);
$ticket = new Ticket;
$ticket->owner = 666;
$ticket->ticketNumber = 666;
$TicketBin->addTicket($ticket);
$numOfTickets= count($TicketBin->b... | 0 |
1187a5cffd12569993f21d3dbf6a60c0 | b65f0f17b9ef4e74d52f40e81b09b97e | Used to unify integration node address display on test step action tab and test case run report. | if (this.parentTest)
var parentName = this.parentTest.fullName();
if (parentName)
return parentName + '.' + this.name;
return this.name;
} | 1 |
f823b77818e80f25c05225f41708806b | 7be19bd14227d0ccb61a681c3fcae355 | 지정 위치부터 임의 개수의 문자를 삭제 | int del_sub_str(char *srcStr, int pos, int count)
{
int src_str_len = strlen(srcStr);
if(count < 0)
return 0;
if( pos<0 || pos>= src_str_len)
return -EINVAL;
char *src_str_tmp = (char*)malloc( src_str_len*sizeof(char) );
if(get_sub_str(srcStr, src_str_tmp, pos+count, src_str_len-pos-count) < 0)
{
free(src_s... | 1 |
c3c147423d4dfd8a794581fd9385c993 | 143227e1422c46c85c5dab06a1453410 | Prints the exam schedules of the input courses. | public class Timetable implements Serializable, Cloneable
public void printSchedule() {
for (Integer k : timeSlotInformation.keySet()) {
printSchedule(k);
}
} | 0 |
c8ab9970b9cc566b97cbc11eceaf9618 | 1faad6a670c2806238ce42e3602ce665 | 通过url获取视频的某一帧
Android 原生给我们提供了一个MediaMetadataRetriever类,提供了获取url视频某一帧的方法,返回Bitmap
需要 android.permission.INTERNET、android.permission.WRITE_EXTERNAL_STORAGE 权限 | MediaMetadataRetriever retr = new MediaMetadataRetriever();
retr.setDataSource(uri, new HashMap<String, String>());
Bitmap bitmap = retr.getFrameAtTime();
return bitmap;
} | 1 |
80a636434f6e1241278cdd79565efe31 | 0745a75647e9d74961ad5af054e27e62 | Pokes the Client with a certain message | public class ClientManager : MonoBehaviour
public void SendMessage(String msg)
{
client.Send (msg,true);
} | 1 |
133ac837451ea6d0dff961bf9d2bd6cf | f4df41a4670d53c4d74c035d1728bf25 | Returns an ordered range of all the vcms article types.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both ... | int start, int end)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().findAll(start, end);
} | 1 |
f75e3e7f61b2086bcf0bf8273d64bd5d | 45a2a24ecee302b60c201b2a173445ec | 完成一个Work order后批量更新wo operation的实际完成时间 | @Service
public class ErpWorkService extends AbstractErpService
@Transactional
public void updateWorkFlowReports(int workFlowCompleteState) {
List<OrderItemWorkState> orderItemWorkStates = orderItemWorkStateRepository.findByWorkFlowStateEquals(workFlowCompleteState);
for (OrderItemWorkState orderIte... | 0 |
d7f0a41a792aeb0105701e61adac884d | 93041b79b73ec631d4f9a17637db0ca8 | Setter method to set Part Flag. | public class PartFile
public void setPartFileDescriptor(String partFileDescriptor) {
this.partFileDescriptor = partFileDescriptor;
} | 0 |
6f128b7c900f2932be82f6b350fbdc9e | c3449dcd19c32a0e6b9aff0b4bcaf56e | Validates that all items originate from the
specified store and are to be transferred to
the specified store. | namespace TitaniumAS.Opc.Client.Da
OpcDaItemResult[] ValidateItems(IList<OpcDaItemDefinition> itemDefinitions, bool blobUpdate = false); | 0 |
0d700d02e7106f8852e8e87871b355c1 | ea3b606df18706f94aa00f4165c5acc0 | Ensures a string is a legal Python name. | if not CATEGORY.match(name):
raise NameError("Id '%s' is not allowed for category" % name)
return name | 0 |
96b57b6c66afa899da1b1236ad982d21 | a62c20e8cfdcfeb9146a5c288a95e1e4 | Retorna a ObservableList das Entradas. | public UnorderedLinkedList<IDivisao> getListaEntradasSaidas(); | 0 |
2f48f5ac9e0f31c61f0328824d3ae7ef | cc650523a11592ad61be44e860ae1bc5 | Scan job directories for job classes | {
FILE *fpList;
char *filename;
char classlist[256];
char buf[MAX_STRING_LENGTH];
sprintf( classlist, "%s%s", CLASS_DIR, CLASS_LIST );
if ( ( fpList = fopen( classlist, "r" ) ) == NULL )
{
perror( classlist );
exit( 1 );
}
for ( ; ; )
{
filename = feof( fpList ) ? "$" : fread_... | 0 |
c4837bc0b99b9182424a6b7c7d0f6ec3 | 72a950dfe240988404a11e208dd3ca0f | Copy one file with the appropriate number of retries if it fails. | namespace Jig.IO
public class FilePlus
public void RetryCopy(string sourceFileName, string destFileName)
{
FileRetry(() => File.Copy(sourceFileName, destFileName));
} | 1 |
fccfed78b1d9f544d1624133854db61a | 4afae58460df1ee8c512372939bbb9d3 | 提交发布版本表单 | login_verpush_sys(url,username,pwd)
sleep(2)
path_ver_push_href=driver.find_element_by_link_text(u'版本发布')
path_ver_push_href.click()
path_ver_push_button=driver.find_element_by_xpath("//button[@class='btn btn-primary btn-w']")
path_ver_push_button.click()
sleep(2)
path_choose_client_path... | 1 |
e57cf507ff2686036a86f62e3187f53c | ae94f0f1b679b4c8bd40a743cb83c550 | Converts class name to a file path with .class file extension. | {
int idx = className.lastIndexOf('.') + 1;
idx = className.indexOf('$', idx);
if (idx != -1) className = className.substring(0, idx);
}
return className.replace('.', '/') + ".java";
} | 0 |
02ae843887d5f0e85dd288b10eceaa15 | 768828d0db6c81026915f4b4f2dfae39 | close the 'Etext' window. | end_echowindow(void)
{
in_echowindow = FALSE;
if ((State & MODE_HITRETURN) == 0)
redraw_cmd(FALSE);
ew_msg_didout = TRUE;
ew_msg_col = msg_col == 0 ? 1 : msg_col;
msg_didout = save_msg_didout;
msg_col = save_msg_col;
} | 0 |
b6024dff50578fea2426ba6b1e3b90a4 | f4f57cad1e76523e89d9850cb6a5466c | ● 地形效果判定 | class Game_Character
def terrain_tag
return $game_map.terrain_tag(@x, @y)
end | 1 |
1ce0cddb67e00dcc64976291edae30b0 | e231af02c5bf08f8ad2c378cbe5e5785 | copy all rows from a List of serialized data objects to a List of SOAP Contracts
links:
docLink: http://sql2x.org/documentationLink/7467f97d-14e5-4ccf-9282-ef8df4f63088 | namespace SolutionNorSolutionPim.BusinessLogicLayer public partial class CrudeProductInfoRefService : ICrudeProductInfoRefService
public static void ContractListToDataList(List<CrudeProductInfoRefContract> contractList, List<CrudeProductInfoRefData> dataList) {
foreach (CrudeProductInfoRefContract contr... | 0 |
05fcd242d6560ead31a06617f40db1bb | 889b3e75269da33ee384cb76b48c19b4 | 判断指定fd是否具有指定的标志 | bool set_fd(int fd, int flags)
{
int old_flags = 0;
old_flags = fcntl(fd, F_GETFD, 0);
if (0 > old_flags)
{
return false;
}
old_flags |= flags;
old_flags = fcntl(fd, F_SETFD, old_flags);
if (0 > old_flags)
{
return false;
}
return true;
} | 0 |
2beb391be93ede58da48bd4b8b2bcad9 | d874bce5c6369680ef2447bc529e100e | 만약 길 찾기 플래너의 Path가 비어있으면, Idle 상태로 전환한다. | {
if(Targets != null && Targets.Count>0)
{
m_CharacterAI.ChangeAIState( new IdleAIState() );
return ;
}
if( m_Position == Vector3.zero)
GetMovePosition();
if( m_bOnMove)
{
float dist = Vector3.Distance( m_Position, m_CharacterAI.GetPosition());
if( dist > 0.5f )
return ;
GetMovePo... | 1 |
44c2f3a2e1d649361f62989ad70ccab2 | e30ea823a02edf24507ade1364ab8bf8 | Get the old releases. | assert isinstance(since, int)
cursor = self.get_cursor()
safe_execute(cursor, '''
select j.name,j.version,j.submitted_date,r.summary
from journals j, releases r
where j.version is not NULL
and j.action = 'new release'
and j.... | 0 |
a2a131eea72a83cf8ae9dae817dd4424 | f386a32203d5d38c3acedf0bc4f45a41 | ROS node to plan a path for the Pathfinder Boat | void Planner::plan() {
int width = Input::getInstance()->grid_width;
int height =Input::getInstance()->grid_height;
int depth = Constants::headings;
Node3D* nodes3D = new Node3D[width * height * depth]();
Node2D* nodes2D = new Node2D[width * height]();
float x = Input::getInstance()->goal_x / Co... | 1 |
eda07b8462497ed65b6d13828e6c668f | 5042b26693b1494e9d38fe08a3f2b02a | Applies a bitwise 'and' to the colors of the image using the specified mask. | class Bitmap
def and!(color)
AND.call(__id__, color)
end | 1 |
93ebd7d60167c291fa394c216e61f8e6 | 86c12f92c2fbcb12f8e1696ec02a4f8c | A bit larger net with no FC layers (global pooling instead). | model = ResNet(Bottleneck, [3, 4, 6, 3], num_classes=num_classes, k_size=k_size)
model.avgpool = nn.AdaptiveAvgPool3d(1)
return model | 1 |
0ac14b9e4b88ab5eead70963c8b3d88d | c7fd4d64c40df68108a98f594ee1df5c | Get the padding-left css property. | @JsType(isNative = true, namespace = JsPackage.GLOBAL, name = "Object")
public class CssProps extends JsPlainObj
@JsOverlay public final CssProps paddingLeft(String paddingLeft) {
setPaddingLeft(paddingLeft);
return this;
} | 0 |
8e6e42d84d9383bbc0c57ab7c4414db5 | d14c13892e7b5cdd16e048460571dcb2 | Called when the game is saved, commits inventory values into save game. | {
if (inventory != null)
{
savedItems[inventory.uid] = new Dictionary<string, int>(inventory.items);
foreach(string uid in inventory.pickedUpItemIds)
{
deletedItems.Add(uid);
}
}
} | 1 |
13aac48a52b51d643ba6fc9e3aecb47a | 51126c6fc5041a2c3477517f31b5b1aa | After 2 seconds have passed, emit buffered values as an array | public function emit(); | 0 |
3c9765368920b22960b1cbe537362195 | 806003185e64ebef12d59daeb517b7ee | 初始化大乱斗 | {
if (m_bigStartTimer == null)
{
m_bigStartTimer = new TimerItemBase();
}
else
{
m_bigStartTimer.reset();
}
m_bigStartTimer.m_internal = 0.5f;
m_bigStartTimer.m_totalTime = 0.5... | 1 |
cfbe578d12604ab967efae8f77a0867f | 39132a137a1cf8ce133fccadfaa938ff | Get portal username | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.4" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PortalsRecord extends org.jooq.impl.UpdatableRecordImpl<jooq.generated.tables.records.PortalsR... | 1 |
4d05352d39b90b871384aef9c1a7df84 | 9099cf3424e4908a7db300486979c99c | Tests that passing an empty list to the constructor doesn't throw an
exception. | public class RecipientListRouterTest
@Test(expected = IllegalArgumentException.class)
public void test_failed_constructor()
{
new RecipientListRouter(null);
} | 0 |
0bbb720f0c6861c519bab59f177b06bf | 40f7d38f3f243a58c6446f6ca617e005 | Display the time in military format | class DateLike
get militaryTimeString() {
const h = this.hour;
const m = this.minute;
const hString = h < 10 ? `0${h}` : h.toString();
const mString = m < 10 ? `0${m}` : m.toString();
return `${hString}:${mString}`
} | 1 |
0e8b9f541007a6d210b5343fb9045e91 | b01e9e46df08e300305cfe61f1a04969 | Campaign builder page - UI verification | {
assertTrue(driver.findElement(By.xpath(obj.mapName("L5_Search_Button"))).isDisplayed());
assertTrue(driver.findElement(By.xpath(obj.mapName("L5_Search_Textbox"))).isDisplayed());
assertTrue(driver.findElement(By.xpath(obj.mapName("L5_Category_Dropdown"))).isDisplayed());
assertTrue(driver.findElement(By.xpat... | 1 |
99a9030eabaa811a71f6801876e47ab2 | a1a3b3ecc0a27d1c62a02506803ae970 | 对渲染器的属性测试 | final class EnclosingElementTest extends TestCase
public function testAttributesRenderAsExpected()
{
$this->el->addAttribute('foo', 'bar')
->addAttribute('bar', 'baz');
$this->assertEquals(
' foo="bar" bar="baz"',
$this->el->renderAttrs()
);
$testA... | 1 |
ebd16a5d1b6631f452626a3295d9abad | 43b544dcd048901d83ae6a11a4efe987 | helper method to check whether height is missing | public class CheckBalanced_4_4
public static int checkHeight(TreeNode<Integer> r) {
if (r == null)
return -1;
int leftHeight = checkHeight(r.left);
if (leftHeight == Integer.MIN_VALUE)
return Integer.MIN_VALUE;
int rightHeight = checkHeight(r.right);
if (rightHeight == Integer.MIN_VALUE)
return Integ... | 1 |
7ed8c58498caa9d24b71c4b26d07ae13 | cf398e2c6f7e96ee3899b469b35737e3 | 让第number个LED灯点亮; | void led_on (uint8_t num) {
if (num < LED_NUM) {
switch (num) {
case 0: GPION->DATA |= led_mask[num]; break;
case 1: GPION->DATA |= led_mask[num]; break;
case 2: GPIOF_AHB->DATA |= led_mask[num]; break;
case 3: GPIOF_AHB->DATA |= led_mask[num]; break;
}
}
} | 1 |
2ded6ea33e7c068fc7be241f3a966b53 | cff7dcb0d134d93e343ebe0f13dc29bd | Sort a sequence of text strings in a reasonable order.
From:
http://lists.canonical.org/pipermail/kragen-hacks/2005-October/000419.html | void smoothsortArray(char *strArray[], size_t arrayLen)
{ heapStatus hStat;
heapStatus *hStatPtr = &hStat;
size_t i, j;
hStat.bitVector = 0;
hStat.lastTreeOrder = 0;
for (i = 0; i < arrayLen; i++)
{ addToLeonardoHeap(i, strArray, hStatPtr);
}
for (i = arrayLen - 1; i >= 1; i--)... | 1 |
4f7efdd681ddbe73b0966d71121dd19e | c3148628e73f1d262a6f523be7a7ded9 | Sets the value of the scale property.
allowed object is
{@link String } | @Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Indexed
public class Lot extends VersionedEntity
public void setScale(String scale) {
this.scale = scale;
} | 1 |
452ebf25b6f3e9aa3972411581252b0f | 3fcda073006ccdd26a1c710cbfacf013 | Helper function to remove celery files if project does not make use of celery. | files_for_removal = [
'settings_file',
'input_file',
'input_generation_traceback_file',
'output_file',
'run_traceback_file',
'run_log_file',
'lookup_errors_file',
'lookup_success_file',
'lookup_validation_file',
'summary_levels_file',
... | 0 |
5fb7d1370eb7e9c825403c5216ed6c0a | 4f32086e3eeae2afb0561528ca13adfc | возвращает максимальный номер символа в строке | int getDigitsMaxNumber(const int *inputMas, int size) {
int maxElementMasA = -1;
for (int i = 0; i < size; ++i) {
if (maxElementMasA < inputMas[i]) {
maxElementMasA = inputMas[i];
}
}
Number unMax = {maxElementMasA};
int digitsMaxNumber = 0;
for (int i = 0; i < 3; ++i... | 0 |
74012053d1c219240969e98a36bf0c87 | a2c00523577c5f81bafa0c6c64fb35d9 | Test that card still has same amount of points after being attached to a customer | class TableTest(unittest.TestCase):
def test_card_payout(self):
self.finish_dress()
self.mock_cards_left("Player0", 4)
self.mock_cards_left("Player1", 3)
self.mock_cards_left("Player2", 2)
self.mock_segment_win("Player3", "Game")
expected_changes = {
"Player0"... | 0 |
69378d47bc3e661bb892ff2ffed610f5 | c334c6964b9205778aff93c2ea1a493a | Encodes steps vehicles spent idled into a vector representation. | v_ids = self.getIds(phases=phases)
stop_ids = v_ids
for v_id in stop_ids:
try:
self.stops_dic[v_id] = (self.stops_dic[v_id] + 1) if increment else (max(self.stops_dic[v_id],1))
except KeyError:
self.stops_dic[v_id] = 1
for v_id in self.waiting_dic.keys():
if v_id not in self.stops_dic.keys():
... | 0 |
c49bcffffc8329d7d37ba35f85e5f5b1 | f39e49ab40d51b1ee438094f2169fb51 | Deletes the orphan content types. | $force_delete = apply_filters( 'wprss_ftp_force_delete', TRUE );
global $sitepress;
if ( $sitepress !== NULL ) {
remove_filter( 'posts_join', array( $sitepress,'posts_join_filter') );
remove_filter( 'posts_where', array( $sitepress,'posts_where_filter') );
}
add_filter( 'posts_where', array( $this, 'any... | 1 |
f8212820c305537e05add6ba46f764d6 | c318d131b5baf8977608a250b342a9a4 | function that returns the order history for all items | items = get_db().execute(
"SELECT id, created, item_names, total_price FROM online_order"
).fetchall()
res = []
for i in items:
tmp = {"id": i["id"], "created": i["created"], "scanned_items": i["item_names"], "total_price": i["total_price"]}
res.append(tmp)
print(res... | 1 |
1fb8f741d0757ce3e7b0bdae809fa6f4 | 0a28e3fc8006cf90198099d88d2bca46 | Metoda elimina toate elementele de cu un Id anume din inventar. | namespace InfServer.Game
public class Team : CustomObject, IChatTarget
public void removeAllItemFromInventory(int itemID)
{
removeAllItemFromTeamInventory(itemID);
} | 1 |
ef9fe374f1367c868174f56c67af407a | f5b11e6f6139f34e9754be59e4f06fbf | Cleans up the properties the text boxes are bound to. | {
originalPricetextbox.Text = String.Empty;
discountPercentagetextbox.Text = String.Empty;
salePricelabel.Text = String.Empty;
} | 1 |
2ca2e37e3369d7ac280b3529899640c9 | dd382cf81a806782a9a9516ee9fda3de | 获取环信用户登录信息 | return new Promise((resolve, reject) => {
app.link.getLoginInfo(function (result) {
resolve(result);
})
})
} | 1 |
63dcc5002a4465d2c04364c291e46c48 | c9cb943179148b5af25d402493c9b691 | 门诊预约排队列表 | class Waiting extends AdminBase
public function queuingList()
{
$map = ['status' => 0];
if (input('sort_sn')) {
$map['sort_sn'] = ['like','%'.input('sort_sn').'%'];
}
$list = model('queuing')->getList($map);
$page = $list->render();
return view('queuingL... | 1 |
20b545bb993d3ecd2c613f403f1b28a7 | 83dd7cb40ade3cd8f5aca43d74ae3eac | stops motors and resets encoders | {
robot.backRightWheel.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.backRightWheel.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
robot.backLeftWheel.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
robot.backLeftWheel.setMode(DcMotor.RunMode.RUN_USING_ENCODER);
robot.... | 1 |
8fae0c1c80fc965ff1d79fa52dd7163d | eff705416ca076e75f3e76af7d8d28b5 | Asynchronously deletes the <see cref="BlogPostFile" /> from the system. | namespace Mindfor.Pure
Task<bool> DeleteAsync(int fileId); | 1 |
50042cbcc4d5d78b8c167d7cfc0a6d87 | 2d363e7e624568dca6b3b65db9b5569e | 首充的红点 | var firstChargeData = this.activityLogic.getFirstChargeData();
this.widget("mainSceneUI/shrink/enterTop/buttonFirstCharge/iconCard2/redPoint").active = firstChargeData.userData.firstChargeTag === constant.RecState.CAN;
} | 1 |
85a910ee63ceef9ce13a5f830a8f7661 | 91bfbbe6e2f60bf05a133a696d978b1e | Acquires the mutex and returns a context object which
must be disposed to release the mutex. | class Resource
public async Task<IDisposable> LockAsync()
{
await mutex.WaitAsync();
return new AnonymousDisposable(() => mutex.Release());
} | 1 |
72b6d86a120797d607831722bc0620da | f131a458aa020f9a901b638aea7b0694 | Calculates which Guppies have died. | public class Robots extends JFrame
public int deadRobots(int robotCount, boolean robotsAlive[])
{
int deadRobotCount = 0;
for (int i = 0; i < robotCount; i++)
{
if(!robotsAlive[i])
{
deadRobotCount++;
}
}
return deadRobotCou... | 0 |
8f7417b432844693bfc8e115b027b4aa | b3f128fd8362238bf0c7b007273bcd41 | 根据yy_mm_dd_hh_mm_ss_uid_originName生成文件名,
如果用户同时提交两个相同文件名,会覆盖.
由于包含UID,不支持未登录用户上传
TODO:暴露UID不好 | class StorageClient():
def getSaveFileName(self,uid,originName=None):
now=datetime.now()
if originName == None:
originName = 'none.jpg'
elif len(originName) > 10:
originName = originName[len(originName)-10:]
return now.strftime('%y_%m_%d_%H_%M_%S_')+str(uid)+'_'+... | 1 |
16bb716774a58fa9d03958258f20d991 | f98257a2f84be02a53579937b04709dc | Una orden puede tener varios articulos | class Order extends \yii\db\ActiveRecord
public function getArtworks()
{
return $this->hasMany(Artwork::className(), ['ArtworkID' => 'ArtworkID'])->viaTable('orderartwork', ['OrderID' => 'OrderID']);
} | 1 |
ca01d96cd33b93509971954ea743e8ae | 2a3210c4577fa262385fc223ea2fbca2 | Get customer invoices by customer partner tenantid and filter by date. | {
using (var db = new CMSdb(_context))
{
var query = db.lk_invoices
.Where(w => w.f_subscr == subscr);
if (filter.Payed.HasValue)
{
query = query.Where(w => w.b_closed == filter.Payed.Value);
... | 1 |
bd6fa2ff1dd39fc2fbbe069c1f61a595 | 5fd63fffc9d864dd18c3bb239801f7ca | Increase kittens collected | public class EggCatcher extends GameEngine
public void increaseEggsCaught() {
eggsCaught++;
gameD.refresh();
} | 0 |
b706f943cab282a7239f4a1f549e274d | afc21cbc0e80cdc0d8e6151422f487a4 | @brief Returns whether the IP task is ready. | {
BaseType_t xReturn = pdTRUE;
short sTask;
for( sTask = 0; sTask < intgNUMBER_OF_TASKS; sTask++ )
{
if( xTaskCheck[ sTask ] == pdFALSE )
{
xReturn = pdFALSE;
}
xTaskCheck[ sTask ] = pdFALSE;
}
return xReturn;
} | 0 |
2070c22bf8a89d4fbbe032059ef56baf | 80f2490961b864e102d949e7f32fdf26 | Actions require login | class OutSideController extends AbstractController
public function before_action() {
$this->_require_login = false;
return parent::before_action();
} | 0 |
2039ef9c6e76347c1300e4944ccbd7a5 | f1a232041b8b6e5880da0799652e7b48 | Cette méthode enregistre les données de l'instance en base de données.
Elle retourne vrai quand l'enregistrement réussi. | {
$values = $this->get(null, ['id']);
$query = null;
if(empty($this->id))
{
$this->id = EntityManager::instance()->pdo()->insertInto(
$this->getSource(),
$values
)->execute();
return $this->id != 0;
}
... | 1 |
ab2d785c2d2e2bb99eed8b13d0d3bca4 | 006ad872e2de6191d03f6f7698cc0663 | 返回所有已behavior为endNode的behaviorLine | {
List<ConnectLine> rtList = new List<ConnectLine>();
IGraph eg = e as IGraph;
if (eg == null)
{
return rtList;
}
foreach (ConnectLine connectLine in eg.ConnectLines)
{
if (connectLine.StartGraph ... | 0 |
d9db9cc29df5fb2507dd65a1ef3fe97d | 971312de48441e760e2afbbd8224003a | 标记虚拟物品已经兑换 | function TooltipPanel:showRuneExchangeItem(item)
end | 0 |
113849989599c45231a40ebf29d5799d | fd1084b838cd4bbaaf3d0e84316ab2ca | función que obtiene el nombre del curso | {
string nombreCurso = "";
GestoraCursosDAL gestoraCursosDAL = new GestoraCursosDAL();
try
{
nombreCurso = gestoraCursosDAL.getNombreCurso(idCurso);
}
catch (Exception e)
{
throw e;
}
... | 1 |
919f0bbd79a6eb52fc3c2d2195638f73 | 431b466a817a77d73fe234e1eccb980f | 帶入距離回傳字串 (距離小於一公里以公尺呈現,距離大於一公里以公里呈現並取小數點兩位) | {
if(distance < 1000 ) return String.valueOf((int)distance) + "m" ;
else return new DecimalFormat("#.00").format(distance/1000) + "km" ;
} | 1 |
abf1cbc91749cb671ff041ffd233362b | 071b10ce4c03510510bc61f923e62675 | Converts object value into a float or returns default value if conversion is not possible. | namespace Common.Utility
public static class Utilities
public static float GetFloatValue(object oValueToParse, float fDefaultValue)
{
try
{
if (oValueToParse == null || oValueToParse == DBNull.Value)
{
return fDefaultValue;
... | 1 |
bc04e4abd4d89e6b33a88ae36b0b8536 | b45b8d9f5a346ad6c35a251160aa64c3 | Create a risk overview table using a model or list of models | md.new_header(level=level, title='Goals')
if model.goals:
md.new_paragraph(model.goals)
md.new_header(level=level, title='Description')
if model.description:
md.new_paragraph(model.description)
md.new_header(level=level, title='evaluation')
if model.evaluation:
md.new_par... | 0 |
48e321f206ef3d9402b78c2818df8ec5 | 7453eb1844cafe1efd2cc103f61a7e19 | Get assigned worker ids. | {
if (empty($roleId)) {
return [];
}
return (new Query)->select('[[user_id]]')
->from($this->assignmentTable)
->where(['role_id' => $roleId])->column();
} | 1 |
4c8544f9aa62a6444ad076d79277b9a8 | 84d369447a10cef47c824d177e8e51cd | setzt den boolean-Wert einer Straße neu | public class Schaltnetz
public void setValueX(boolean value) {
} | 0 |
31bcf61775fe547ec2085f13ed65a564 | 3dad81405288a87d62c0766364a106fe | Calculate geographic north from magnetic north | private fun calculateGeomagneticLatitude(latitude1: Double, longitude1: Double): Double {
val r = 1.0
val dLong = toRadians(MAGNETIC_NORTH_POLE_LONGITUDE)
val dLat = toRadians(MAGNETIC_NORTH_POLE_LATITUDE)
val gLat = toRadians(latitude1)
val gLon = toRadians(longitude1)
v... | 0 |
020e43655489d235d13c4ae495e28003 | 5bba887e9183fe6facb8937a85000f25 | To convert the path column to string type.
:df: dataframe, dataframe that has path column
:visit_path: str, name of column which contains path data
Returns
:df: dataframe, dataframe that contains path column as string type | def path_update(path):
input_df = pd.read_csv(path)
input_df.fillna(0, inplace=True)
input_df.drop(['Sex', 'Age', 'AP/PA'], axis=1, inplace=True)
def vectorize_path_expand(x):
return s.abs_path + x
input_df['Path'] = vectorize_path_expand(input_df['Path'])
input_df.to_csv(s.patients_work... | 0 |
528c7354656c757362ff4550ee01ca61 | 3ca8027288ed60c531d1341fe6a60c36 | If nothing else happens, display usage information. | def default_handler(parser):
def _handler(args):
parser.print_usage() | 1 |
688f46afb0ffaa586ba8238871f1d2bc | ba8d4b46620e44482ded772ad93045f5 | given a list of lists, replace all Entity references in the inner list with ID numbers | function replaceIds(data, results, attribute, isList, showIdInResults) {
isList === true ? replaceIdsInList(data, results, attribute, showIdInResults) : replaceId(data, attribute, results, showIdInResults);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.