query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
323f6213b935d7fc528b6a4b4f3e4d95 | 297967ce086c13884d42564e7c4364d8 | 查询指定类型的所有已托管公众号 | {
$GhManage = new GhManage();
$this->list = $GhManage->getAll();
foreach ($this->list as $key => $value) {
switch ((int)$value['gh_type']) {
case 1:
$this->list[$key]['gh_type'] = '订阅号';
break;
case 2:
... | 0 |
4dc347d1fb92e3dc264ee0938fbcb46f | 6673bb3e3a22b7565aa00ed900c0d3fa | 创建一个容量为len的Stack | class LinkedStack(object):
def __init__(self):
self._top = None
self.__len = 0 | 0 |
e5e6e20a27024d0eef0fa6bf1ff5c295 | d7b3737119628f7bbe1be64da897c479 | get posts written by a given user | class PostRepository implements PostRepositoryInterface
public function getUserPosts($author_user_id, $offset){
return $this -> model -> where('author_user_id', '=', $author_user_id) -> skip($offset) -> take(10) -> orderBy('created_at', 'desc') -> get();
} | 1 |
3da473b3832b4102cd02de2701d1025d | ec472c56479da078d583437562761f5d | Returns the gross paycheck, before any deductions are subtracted | double Payrecord::getGross() const{
return gross;
} | 1 |
286a25c17ad659370e2d24a1868fc817 | ff98046837a75984b6814fdd71a3631d | Draws two circles. t is a turtle. | circle = rg.Circle(rg.Point(x, y), radius)
circle.fill_color = color
circle.outline_thickness = 3
circle.attach_to(window.initial_canvas)
square = rg.Square(circle.center, 2 * radius)
square.outline_color = color
square.outline_thickness = 5
square.attach_to(window.initial_canvas)
wi... | 0 |
32cdf55d8dde086564a8fbd29555e2d9 | 3af6001ba68f76b20fa82590ef5c027e | Returns the meta object for the attribute '{@link tr.edu.metu.ceng.megamodel.hypomethod.hypoMethod.Query3#getLevel4 <em>Level4</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_RGGoal_level_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_RGGoal_level_feature", "_UI_RGGoal_type"),
Reqgoa... | 0 |
df1c7276f47c8889a2bc99cb22b158d6 | 95c928fad4d968ed604f999316de5f53 | 获取文档结束位置 | public int endPos(); | 1 |
fe627940b06c2be66d7a0d388878e760 | 21ed4b36db1bf1303e47ae74c6da4ee2 | POST: /Magazine/New | {
ViewBag.AuthorsId = new SelectList(db.Authors, "Id", "FullName");
ViewBag.CountryPublishedId = new SelectList(db.CountryPublisheds, "Id", "CountryName");
return View();
} | 0 |
b39bc72a257fa49eb84cba3473bbd6cd | 605357a1d318984c73a18832ca6dda8f | Авторизация на фронтенде из админки | namespace SocialProject.Controllers
[SocialApiAuthorize(typeof (User))]
public class AccountController : ApiController
[AllowAnonymous]
[HttpPost]
[Route("account/login")]
public IHttpActionResult Autorization(AuthUserDto auth)
{
_loginCommandHandler.Handle(new LoginU... | 0 |
d0a0630c6a972a80a686b0e2a8993376 | 6ee3e3a6ac7d06554e2553fb3b5772e9 | Send file to server. Using linux system call 'sendfile'. | {
struct sendfile_args args;
convert_args(argc, argv, self, &args);
return OFFT2NUM(sendfile_full(&args));
} | 1 |
dd37212e54ee790e951d90f08adcf0ec | 689229ac580ebb76f370bb723b4eaa68 | 创建一个空错误链表 | func NewErrLinkedList(message string) *ErrLinkedList {
return &ErrLinkedList{
message: message,
}
} | 0 |
ac8ce947248c8a82955ea3da138409cd | f63386036949080363550bb912c877df | !
calculate atmosheric density
after meteorology textbooks (see e.g. http://wahiduddin.net/calc/density_altitude.htm ) | if alt >= 80000:
rho = 0
elif alt < 0:
rho = 0
else:
rho = aerocalc.std_atm.alt2density(alt, alt_units='m', density_units='kg/m**3')
return rho | 1 |
f359b5fb6e8ee553fbbaa046af2f7cff | 17efbe635382b74c817729639cfd4c6d | 根据配置编号获取信息 | Config getConfigByCode(String code); | 1 |
935d503758b5757964533b7d2a85dc29 | 03538eba6fedbf63500dba8a11ab7e33 | この四面体の外接球の中心座標と半径を計算する.
計算結果はCenterとRadiusに格納する. | void computeSphere(double& a, double& v, double r){
assert(r >= 0 && r <= 10000);
const double PI = 3.14159;
a = 4 * PI * r * r;
v = (4.0/3) * PI * r * r * r;
} | 0 |
9bd2593707e847dfec442b80bf495ec6 | 64612652b41e59fe01c77265c0d9d0be | Through Geolocation, find closest server | distance_map = {}
(lat1, lng1) = get_location(ip)
for host in HOSTS:
(lat2, lng2) = LATLNG[host]
distance = get_distance(lat1, lng1, lat2, lng2)
distance_map[host] = distance
sorted_results = sorted(distance_map.items(), key=lambda x: x[1], reverse = True)
(server_1, distance... | 1 |
e76df43af72c7f620c0b02a7f463ace6 | ec3be688abf3893aa903687a69d16a1d | Schedule I2C multi read | {
uint8_t i;
Start_I2c();
SendByte(sla);
if(ack==0)return(0);
SendByte(suba);
if(ack==0)return(0);
Start_I2c();
SendByte(sla+1);
if(ack==0)return(0);
for(i=0;i<no-1;i++)
{
*s=RcvByte();
Ack_I2c(0); ... | 1 |
f9710381f1af7ab1449614f2fd61977c | 7acf91375714e2c9d37fe9c2f933c5b0 | 让Trader可以使用with语句 | def with_(mgr, body):
exit = mgr.__exit__
value = mgr.__enter__()
exc = True
try:
try:
if isinstance(value, (tuple, list)):
return body(*value)
else:
return body(value)
except:
exc = False
if not exit(*sys.... | 1 |
2bd1da098273093e748b697a3d61ce74 | e7756b71524f2cdcfbbe3b8d93745a21 | This should be called when a component has been moved, sized or re-parented, but the change was not the result of a property change. All property changes are monitored by the selection UI service, so this is automatic most of the time. There are times, however, when a component may be moved without a property change ... | namespace Chimera.GUI.WindowSystem
public partial class UIComponent : DrawableGameComponent
protected virtual void OnMove(UIComponent sender)
{
Refresh();
} | 1 |
c4c30b66cbf6e94b17ad6589990700ca | aa1c94d742efeab85919051712ae94ba | 字面意思:检查一个sprite与Spritegroup里任意一个对象有碰撞 | for i in group:
if i.tag == spriteTag:
return i
return None | 0 |
1e7a2d84ebae29430fe1b47f1dcf4954 | 61bfa5a9dffa3f7d3f6b2467b5b95739 | Obtains the oauth token of the user from Building Depot
Returns:
Oauth token of the user | res = requests.post(OAUTH_OBTAIN_PATH, headers={
'Authorization': 'Basic ' + BASE_64_BEARER_TOKEN_CREDENTIALS,
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
})
return res.json()['access_token'] | 1 |
ad14c0a338d6ab199b8546dc1eeb2ac9 | 5c25e3a89ab2b6510e70d5d1c28c8e01 | 服装周次(1—52周,共五十二个枚举,整型数字)
Example Value: | class InlineResponse20055Result(Model):
def week(self) -> List[InlineResponse20055Category]:
return self._week | 0 |
d0a13647068ac19eb2550a4ca0a71ef6 | 53795a4b5c841c62f08579f95cad13ed | * maybe_additive_exp : maybe_mult_exp { ( '+' | '-' ) maybe_mult_exp } | PARSESTATE
AParseAddExpr( PARSESTATE State )
{
State = AParseMultExpr( State );
while (State.Error == SUCCESS) {
TCHAR Op = ANextChar( &State );
LONG Value = State.Value;
if (Op != TEXT( '+' ) && Op != TEXT( '-' )) {
break;
}
State.Token++;
State = APa... | 1 |
c0c4966c21224af8e1258d7efa254fe2 | 60ba9e6953ca3de09b65b2a61c4f5725 | This function prints the Hybrid Graphics PEI phase policy. | {
cm_policy_config_s_type *pm_ptr = cmpm_ptr();
if( (asubs_id > SYS_MODEM_AS_ID_NONE) &&
(asubs_id < SYS_MODEM_AS_ID_NO_CHANGE) &&
(asubs_id < POLICY_ITEM_ARRAY_SIZE)
)
{
CM_MSG_HIGH_3("PMPRX: RATs supported = 0x%x, Service scan mode = %d, UE mode = %d",
... | 0 |
26696714318b5c6c7ac9ba554707c2b9 | 293d3840bf9d039411aaaa892401ddb7 | Added pagination information to http header. | class Api::BaseController
def set_respons_header
response.headers['total-count'] = @index&.total_count
response.headers['total-pages'] = @index&.total_pages
end | 1 |
002bd420a781391901998e727d37a699 | 7744c706c1e3768d28567bc7cbc592cb | 返回第一个读取的非空文件的内容 | public class FileUtils
public static String getValidFirstTextLine(String pathName) {
File file = new File(pathName);
if (file.exists() == false) {
return null;
}
FileReader fr = null;
BufferedReader br = null;
try {
fr = new FileReader(file);
br = new BufferedReader(fr);
String firstLine = null;... | 1 |
540532a3b5438f085c49fa535a1a4e37 | 129f548804e3c5777e425b3a4e6ebd6b | Link: https://leetcode-cn.com/problems/next-greater-element-ii/ | func nextGreaterElements2(nums []int) []int {
ret := make([]int, len(nums))
for i := 0; i < len(ret); i++ {
ret[i] = -1
}
stack := make([]int, 0)
for i := 2*len(nums) - 1; i >= 0; i-- {
cur := nums[i%len(nums)]
for len(stack) > 0 && cur >= stack[len(stack)-1] {
st... | 1 |
1b35c71f6a4cbd97e4231776d7d86b81 | 9a77aa3210c6aa346c0775c4acfdd933 | CHECK TO REMOVE OLDEST DISTRIBUTION DAY | count = 0
for directory in os.listdir():
if directory.startswith(datetime.now().strftime("%Y%m%d")):
count += 1
self.assertTrue(count > 0) | 0 |
7e066228d64cbb177b052e7b21ad95c6 | 6ec3f90e1392454e659b0c90f1ac51ab | Pull device out of reset | void L6474_ReleaseReset(uint8_t deviceId)
{
L6474_Board_ReleaseReset(deviceId);
} | 1 |
59af872fd6e2865d4ed59dd32e9288f7 | 8a885b234f5a15e639d3761dac7850c9 | Convert a 3D nrrd image to a tiff series | class AveragePatient:
# typedefs
def write_image_series( self, image_series, output_form):
region = image_series.GetLargestPossibleRegion()
start = region.GetIndex()
size = region.GetSize()
first_slice = start[2]
last_slice = start[2] + size[2] - 1
name_generator... | 0 |
628b24ec4ef2b8a32748c5ac213df35b | 8c507af616c899eccc990cfcd251ad3b | The pivot element is taken to be the element at
the start of the subrange to be partitioned | int64_t qs_partition(int64_t *input, int64_t start, int64_t end)
{
int64_t firsthigh = start;
int64_t pivot_index = end;
for (int64_t i = start; i<end; i++)
{
if (input[i] < input[pivot_index])
{
swap(input, i, firsthigh);
firsthigh++;
}
}
swap(in... | 0 |
5c8dc2a397b8e4856042d932adf2e3e5 | 7a6d4f19e728a85c38b667f5b342e8b0 | et les ajoutes dans la base de donnee. Elle initialise les scores à O | class Score
def initialize()
@@db.execute "CREATE TABLE IF NOT EXISTS score (
score_id integer primary key autoincrement,
niveau integer NOT NULL,
score integer NOT NULL,
utilisateur integer,
FOREIGN KEY(utilisateur) REFERENCES utilisateur(utilisateur_id)
);"
@difficulte = nil
e... | 0 |
27b6318c1dd62c518b05a77a0d9d81bc | d0a202f70e89fa017514ce02c5c595cf | Set the value of the website_user.nivel_visibilidad column for the current row. | class usuario
public function nivel($id_nivel, $id_usuario = "") {
if (!$id_usuario)
$id_usuario = $this->id_usuario;
$this->db = new db;
$this->db->query("UPDATE usuarios SET id_nivel='$id_nivel' WHERE id_usuario='$id_usuario'");
if ($this->db->num_error == 0) {
... | 0 |
f92027eba23d66005f98234d6290a39d | ed7a67925350f4e88833969c2002a07f | Delete a kart object from the database. | def delete_card(card_id):
card = Card.select().where(Card.id == card_id).first()
if card is None:
return HTTPResponse({'error': 'Not Found'}, 404)
card.delete_instance()
return HTTPResponse('', 204) | 1 |
9825c8f25e4625eb53d5ac9891047b48 | e2dee982fc4647d7399e4204bb68bd03 | Returns a stream from which the caller can read the content from the specified
Amazon S3 bucket and key.
The caller of this method is responsible for closing the stream. | InputStream read(String srcKey) throws AmazonWSException; | 1 |
170abcc146cc646235582c7cad43add2 | 2638f2b333592c3c1d81987effb360b4 | make sure to deselect custom resources before destroying the DC | {
APP_CHANNEL << "delete d3d resources" << endl;
mFont->deleteDeviceObjects();
CDeviceResourceManager::getInstance().deleteResource();
return S_OK;
} | 0 |
db7e1362a64a5e32e5f5fd380a27ec15 | a7594ed2bb26ff8bb8e61515fe9fbba9 | eBucks member's card number/Identification. | @JsonProperty(value = "e_ticket_number")
public String getETicketNumber() {
return eTicketNumber;
} | 0 |
a4538e0960683742dc8b565dbc14eb30 | 4ad7d9f9ff68e4f9e716e4fdfc645387 | The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. | namespace Microsoft.Azure.CosmosRepository.Providers
class DefaultCosmosUniqueKeyPolicyProvider : ICosmosUniqueKeyPolicyProvider
public UniqueKeyPolicy GetUniqueKeyPolicy<TItem>() where TItem : IItem =>
_uniqueKeyPolicyMap.GetOrAdd(typeof(TItem), GetUniqueKeyPolicyFactory); | 1 |
95c2c3a041e9b56284a1624b4c0fc225 | d0a0b13978e60de6dff7d3036d225440 | эта функция вызывается, когда пользователь выбирает другое значение в списке читателей | @FXMLController
public class ReaderController implements Initializable public void addReader()
@Override
public void changed(ObservableValue<? extends Toggle> observable, Toggle oldValue, Toggle newValue) {
System.out.println(group.getSelectedToggle().getUserData().toString());
... | 1 |
f67c7c5f6dd17080faf7bc2764fe9ba0 | ea46149bf70d4471c8f862d04ff42588 | Returns the meta object for the reference '{@link org.gemoc.execution.engine.trace.gemoc_execution_trace.SolverState#getModel <em>Model</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EDataType getTraceModelType(); | 0 |
cc06224bc2d67ba90d0cde968c61d050 | 8560eeddc4b0014d662b4b58c464f9f9 | function returns records of complaints with a given status | {
if (request()->get('filterstatus') * 1 !== 10) {
if (auth()->user()->role * 1 === 2) {
$cols = 'complaints.status = ' . request()->get('filterstatus') * 1 . '
and complaints.user_id = ' . auth()->user()->id . ' and (
complaints.title like... | 1 |
873d5174c232a7f904f7343bea3ed460 | 5b38bea11cc8368ee3592b34f8194bb1 | Description : Clear bit of the specified port's SYSCFG DRPD register.
Arguments : USB_UTR_t *ptr : USB internal structure. Selects USB channel.
Return value : none | void HW_USB_HClearStsPddetint (usb_utr_t *ptr, uint16_t port)
{
#if USB_NUM_USBIP == 2
if (port == USB_PORT0)
{
if (ptr->ip == USB_USBIP_1)
{
#if defined(BSP_MCU_RX64M) || (BSP_MCU_RX71M)
ptr->ipp1->INTSTS1.WORD = (uint16_t) (~USB_PDDETINT & INTSTS1_MASK);
#endif ... | 0 |
cfc54b5760b3174dc9d8a08ca5dca7cc | 71911aeccc70e7f2082a5dc80212a0c7 | <p>
Enables the actions for the specified alarms.
</p>
API Documentation</a> | suspend fun enableActions(alarm: String) {
val request = EnableAlarmActionsRequest {
alarmNames = listOf(alarm)
}
CloudWatchClient { region = "us-east-1" }.use { cwClient ->
cwClient.enableAlarmActions(request)
println("Successfully enabled actions on alarm $alarm")
}
} | 1 |
fc800a3ab2530d0f409e0a5809e9d326 | a23b83528698c3efeb39f9001c7d619e | Event handler for the ITlaRunControl.RunCompleted event. | {
if (e.Cancelled == true)
{
tbLastStatusMessage.Text += "Canceled!" + Environment.NewLine;
ScrollToEnd();
}
else if (e.Error != null)
{
tbLastStatusMessage.Text += "Error: " + e.Error.Message + Environme... | 1 |
aaba452fe3f3d76ddedd2e171d6c3483 | 9d942b60ba247ca4ee18e91d737c1d96 | 通过redis实现点赞和取消点赞功能,每篇文章,都有一个key(用到时创建),用来存放点赞的用户
当用户点赞时,会把该用户放到该key中,即记录每个用户只能点赞一次,同时可以用于取消点赞功能
还有一个集合是changeKey,用来存放改变的文章,用于定时任务持久化点赞数量(定时将Redis中点赞总数持久化到MySQL) | @Service
@Slf4j
public class ArticleServiceImpl extends ServiceImpl<ArticleDao, Article> implements ArticleService
@Override
public void saveArticleLike(Integer articleId) {
String articleLikeKey = ARTICLE_USER_LIKE + UserUtils.getLoginUser().getUserInfoId();
if (redisService.sIsMember(articleLikeKe... | 1 |
6405410b317f2d71fe6b38d189bda790 | 9b9c1dad11e02b68b390c441329c8443 | Returns a SOAP 1.2 sender with MTOM attachment support | {
$transferObject = $this->getMockBuilder(
\Magento\Payment\Gateway\Http\TransferInterface::class
)->setMethods(['__setSoapHeaders', 'getBody', 'getClientConfig', 'getMethod'])->getMockForAbstractClass();
$transferObject->expects(static::any())
->method('getBody')
... | 0 |
4d842b0975c150f72a9d88f2d3f71032 | f3437a85a4ab4d8b7de7a2dfca90207e | Finds all lectures | class LecturesController extends Controller
public function index()
{
try {
$response['code'] = 200;
$response['data'] = $this->lecture_service->getAll();
} catch (\Exception $e) {
$response['code'] = 500;
$response['data'] = $e->getMessage();
... | 1 |
5255184fa7e3f4a965571ef306fdeac2 | 57b47ef3a5704d6c6141ae52ea993a39 | 得到最大VIP等级 | export class PrivilegeVipCfgData extends PrivilegeVipBaseCfgData
public static getMaxLevel(): number
{
return this._dataArr[this._dataArr.length - 1].vipLevel;
} | 1 |
311924bdf92229d1ed3307d2067500c7 | 3135bce2d4a46544fd0ff4aff673f662 | Gets the id of the next thread to run and sets its state to running. | atomic_start ();
int threadID = scheduler_getNextThreadToRun();
if (threadID == ERROR_THREAD) {
atomic_end();
return;
}
switch (threadList[threadID].state) {
case RUNNING: break ;
case WAITING:
if(currThread == -1){
currThread = threadID;
threadList[currThread].state = RUNNING;
atomic_end ();
... | 1 |
e3a2de267324cb47853a89fa647cf389 | d21619d7b272a6f1894e430f884c5890 | Comprueba si el usuario tiene el chat abierto, en caso de tenerlo
marca los mensajes como leídos | class User extends BaseModel
public function openChat(Chat $chat){
$user_chat = UserChat::model()->findByAttributes(array('id_user' => $this->id, 'id_chat' => $chat->id));
if (is_null($user_chat)){
$user_chat = new UserChat;
$user_chat->id_user = $this->id;
$user_chat... | 0 |
6a36bb323d19ed94b917233905b37680 | c2481ab80cbcaf9132959efb007a5944 | Regression test for https://github.com/pymanopt/pymanopt/issues/49. | class BoltonOptimizerTest(keras_parameterized.TestCase):
def test_context_manager(self, noise, epsilon, class_weights):
@tf.function
def test_run():
loss = TestLoss(1, 1, 1)
bolton = opt.BoltOn(TestOptimizer(), loss)
model = TestModel(1, (1,), 1)
model.compile(bolton, loss)
model.l... | 0 |
7f74c563e0f309594f4cce4a93a185c2 | 7e2f67188f6a09cea36f28edea92a184 | Check if string contains regex. | {
$matches = [];
return \Safe\preg_match($pattern, $this->string, $matches, $flags, $offset) > 0;
} | 1 |
3ef7508255a538b8f4c037e5f4665bf3 | 20284bb3ce919215be4a8748e179f9d3 | Gets messages in conversation. | {
$qb = $this->objectManager->createQueryBuilder()
->select('m', 's')
->from($this->getMessageClass(), 'm')
->leftJoin('m.sender', 's')
->where('m.conversation = :conversation')
->setParameter('conversation', $conversation->getId())
->s... | 1 |
387bf1725e7cba8ded0833dd348b131d | d9bbf4f563e9ed66a9452a6d0c6d00da | {@inheritDoc}
<p>This method returns the rule tag formatted with {@code <} and {@code >}
delimiters.</p> | if (ruleId != null) {
return String.format("%1$2s (%2$2s)%3$s%4$s", desc, ruleId, (extraDesc == null)?"":System.lineSeparator(), (extraDesc == null)?"":extraDesc);
}
return desc + ((extraDesc == null)?"":(System.lineSeparator() + extraDesc));
} | 0 |
01a1e52a41438ce67144d7bd115c8844 | 457c8cc83774a19d414da89cf81184fd | Set Harvest Start Date. | public class X_FTA_Farming extends PO implements I_FTA_Farming, I_Persistent
public Timestamp getHarvestStartDate ()
{
return (Timestamp)get_Value(COLUMNNAME_HarvestStartDate);
} | 0 |
3c2eaa6edea721fe059fd6c070d700f7 | 6f61c644e4a6c7516427ba665d6a9481 | Start a RLC procedure, if a neighbour table entry to previous_hop of a routing msg
is missing and RLC is enabled. | pyneigh = self.neighs[neigh]['pynode']
rasp = self.RT[prefix]['AS_PATH']
newAS_PATH = rasp + ',' + self.ID if rasp != "" else self.ID
rt4update = Route(prefix, {'AS_PATH': newAS_PATH})
update = (self.ID, rt4update)
pyneigh.processRXupdates(update, now)
self.RT[pre... | 0 |
6680ccc291604c4546867f9e9345179d | 418fd3434d00b866ab7cffd3500d1bb7 | Launches the server application with no parameters. | public final class TestServerAttach extends AbstractApp
public static void main(String[] params) {
var game = new TestServerAttach();
game.start();
} | 1 |
7f313b50245dac13e5158afc9a56f397 | 63a706ac543a3671c8ced5e76adedbe4 | Returns the meta object for the containment reference list '{@link Components.BasicComponents.Component#getRealization <em>Realization</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getCapabilityRealization_RealizedCapabilities(); | 0 |
5af011d45cfca5e492ade64ccb2b37b8 | 469eb1e48a50e8995563f5cd3a0b2bc2 | ISO-8601 date without timezone indication.
YYYY-MM-DD
The format is supported by native \DateTime constructor.
Checked stringified, and accepts stringable object. | function isoDateWithoutTimezone(date) {
return date.toISOString().slice(0, -1);
} | 1 |
aca6950e06ae47ea3ed5f659f4c64249 | 32ab09437c0b54e1ff134420b41f4b37 | Obtiene todos los controles de un formulario con recursividad | namespace ActPluginHelper
public static class ACTInitSetting
public static Control[] GetAllControls(Control top)
{
ArrayList buf = new ArrayList();
foreach (Control c in top.Controls)
{
buf.Add(c);
buf.AddRange(GetAllControls(c));
... | 1 |
2cd7c60747d5c8c9a14888b191b74b7b | 85c85a587da09276ac999dbffee01c72 | (Optional) Initializes the lib with a cell size (see detault at the begining of file) | void DCellInit(DCell c, double xs, double dx, double ys, double dy ) {
c->x = (rand() % 100 ) / 100.;
c->x = xs + c->x * dx;
c->y = (rand() % 100 ) / 100.;
c->y = ys + c->y * dy;
int r = 100;
c->size = rand() % r + r;
c->coorX = (double *) malloc(c->size*sizeof(double));
c->coorY = (double *) malloc(c->size... | 0 |
1194e3c766c371f26faed750ef6b6140 | 3522cbf766f7dfdff0d017a5f602bbe9 | Test that Review class has place_id, user_id and text
attributes. | cls.rev = Review()
cls.rev.place_id = "modern_honolulu321"
cls.rev.user_id = "modern123"
cls.rev.text = "Cool hotel" | 1 |
9a3e5ec8204ffb2f409dcafc0ed96aba | 42f1f127181afa38d904b801663abd3c | Check to see if VpnId property is set | namespace Amazon.WorkSpacesWeb.Model
public partial class UpdateNetworkSettingsRequest : AmazonWorkSpacesWebRequest
internal bool IsSetVpcId()
{
return this._vpcId != null;
} | 0 |
fb4ad04b19d1ebca5e65d6fa97274944 | ae3844f2267d643eadb0668637f10c6e | Display a listing of the intervencion. | class InterventionController extends Controller
public function show(Intervention $intervention)
{
return view('interventions.show',compact('intervention'));
} | 0 |
665d923ec4e8a596dc67c85936e67255 | 08db49461908fd000fdee8cd6d28a561 | Reload reloads the app and prints the progress to system out. | public class AppletViewer extends Frame implements AppletContext, Printable
void appletReload() {
panel.sendEvent(AppletPanel.APPLET_STOP);
panel.sendEvent(AppletPanel.APPLET_DESTROY);
panel.sendEvent(AppletPanel.APPLET_DISPOSE);
AppletPanel.flushClassLoader(panel.getClassLoaderCacheKey(... | 0 |
f578bc19748e570913897f9fa38abe7d | 4e9cb798e3b6293cf0deacbc7d86b366 | default parametrs to run BNNs with | params = {}
params['batch_size'] = 420
params['nworkers'] = 5
params['lr'] = 0.3 * params['batch_size']/256
params['momentum'] = 0.9
params['wd'] = 1e-6
params['warmup'] = 10
params['bn_correct'] = True
params['temp'] = 0.5
params['out_dim'] = 128
params['data_dir'] = '/ds2/YFCC100m/image_packs'
params['out... | 0 |
550fa7478f78bb79e70e431acb7b7f9a | 3e628b22f25e5169369f0f9956422471 | PID logic. It should do the following:
read the encoder counts to determine an error
use that error along with some PD constants in order to determine how to set the motor speeds
then actually set the motor speeds. | public void autonomousPeriodic() {
pidOutput = my_pid.calculate(rightEncoder.getDistance(), desiredSpeed);
pidOutput = MathUtil.clamp(-pidOutput, -.4, .4);
myRobot.arcadeDrive(pidOutput, 0);
} | 1 |
eb9e98c5e10ff67dc8d8339cf304c7be | 28526c81ffa056b25ac0c356219704ea | =========================================================================
Multi-selection Node Drag
------------------------------------------------------------------------- | {
e.Handled = true;
IsDragging = true;
IsNotDragging = false;
IsDraggingNode = true;
IsNotDraggingNode = false;
var eventArgs = new NodeDragStartedEventArgs(NodeDragStartedEvent, this, SelectedNodes);
RaiseEvent(eventArgs);
... | 1 |
c1829b1bd7e5abff9b38d00d17cf391d | 2d740a9e1e4b43d81c840ce9a48d6731 | use cookies on each request (cookies stored in $cookie_file) | {
if (file_exists($file)) {
curl_setopt($this->_curl, CURLOPT_COOKIEFILE, $file);
}
return $this;
} | 1 |
aa9cb061299ada4ac6ccf6ff42caf8e7 | a3d823e9efe80d4204b1eeffc7e2a057 | Comprueba si el dia d es un dia de recogida. | namespace SimuLAN.Clases
public class ConexionPairing:Conexion
public bool GetAplicaDiaSemana(int dia)
{
return _aplica_dia_semana[Utilidades.IntToDiaSemanaEnum(dia)];
} | 1 |
1376b6b4b9dcdb90918fde31f7ce20a9 | 15c53de5889af9a8e9bf652b9fd4e918 | Enables scrolling when its called | function enableScroll() {
$('html').css('overflow', 'initial');
window.scrollTo(scrollPosition[0], scrollPosition[1]);
} | 1 |
6a9cbe93849ef06ac9cd152ab4d493b0 | 2e7b7d6e7c6b1c62ed6b53c2c89f3e18 | Wrapper function for Iterative Deepening A* | public static double iterativeDeepeningAStar(int[][] tree, double[][] heuristic, int start, int goal) {
double threshold = heuristic[start][goal];
while (true) {
System.out.printf("Iteration with threshold: %.2f\n", threshold);
double distance = iterativeDeepeningAStar(tree, ... | 1 |
59ecc922bfe881007ad08476f5d3a6f2 | 80435aa49d1f5ddda64a1ae4030f6e78 | 删除样式表 | function clearXtabStyleSheet() {
$ARR.forEach(this.xtabStyleSheets, function (sheet) {
var parentNode = sheet.parentNode;
if (parentNode) {
parentNode.removeChild(sheet);
}
});
} | 1 |
fcc51272fc7997f8b1988809211f2f0a | dcc005a3cb29df37799d9786a56aebcc | Registers an existing ISO into the CloudStack Cloud. | host_dir, image_meta):
pvm_op = self.pvm_operator
if not pvm_op.check_media_library_exists():
LOG.error(_("There is no media library"))
raise exception.IBMPowerVMMediaLibraryNotAvailable()
vopt_img_name = image_meta['id']
if not ... | 0 |
cd63646c9672f4aa068f5e6283219d1b | 3fdf573ce82881f74317a4faeaf216b1 | Utility function. Computes the player ID, i.e. absolute position on table, of the target of the action. | assert abs(player) == 1
if player == 1:
return 0
else:
return 1 | 0 |
7f893dbbd6017a7479145288c03ecd4e | 50becf50aa805fff97c4f0341c4d04a3 | Итеративно ищем красную точку | namespace process_image
const_rgb8_pixel_iterator find_white_pixels(const_rgb8_pixel_iterator begin, const_rgb8_pixel_iterator end)
{
auto it = std::find(begin, end, White_rgb8_pixel);
if (it != end)
{
auto last = std::find_if(it, end, [](const rgb8_pixel& p) {return p != White_r... | 0 |
c8ebffb03c3a6984ce2f5af61e8f83c0 | f9527a30c32515b75288c358000cb9f2 | Удаляет администратора из указанного помещения | function delete_admin ( &$sql, $user_id, $login ) {
$result = sql_update( $sql, 'user', array( 'admin' => '0' ), array( 'user_id'=>$user_id, 'login'=>$login ) );
return $result;
} | 0 |
375c38cab39195bf9d6d42bd166066a1 | 5eefcf92c8926527a0e65c960d1570fb | Initiates the asynchronous execution of the ListEntitiesForPolicy operation. | namespace Amazon.ResilienceHub
IAsyncResult BeginListSuggestedResiliencyPolicies(ListSuggestedResiliencyPoliciesRequest request, AsyncCallback callback, object state); | 0 |
c95e4102687200fbfc6f94f3c4857b49 | 1cbedc32783d57599986117d7b82d748 | Function to add plain new collaboration, independent of papers, from other sources | if author1==author2:
try:
new_author=self._collab_graphml_vertex_id_to_gt_id[author1]
except KeyError:
new_author = self.collab.add_vertex()
self._collab_graphml_vertex_id_to_gt_id[author]=self.collab.vertex_index[new_author]
... | 1 |
241c962f6a4e590d0b7347eda99eb614 | 7cec861866c9c90408ac392a3f9f6115 | Returns the subscription status of the given application instance
If user is specified, only that user is retuned | $query = DB::table($this->_tableName);
$query->where('UserId', $userId);
$query->where('ApplicationId', $applicationId);
$result = $query->first();
if (!$result) {
return false;
}
return $result;
} | 1 |
504a62efb8e2607d4eba04e75202ad38 | 260c5b6bb862e76ee3560d625dfce7e0 | 指定サイズの商品単価で展開しているサイズリストを返す | StringBuffer sql = new StringBuffer();
sql.append("SELECT distinct size " +
"FROM tb_product_size " +
"WHERE product_id in (" +
"SELECT id " +
"FROM tb_product " +
... | 0 |
1acfe061fb7148c85a649741f56ac932 | 4b6d9bfd2a040601e3cfbd45ba60e8ac | Include the upper bound term in the result set | class SolrQuery extends SolrModifiableParams implements Serializable
public function setTermsIncludeUpperBound ($flag) { } | 1 |
f332e19dfd2aaab95f5f07ded28a31f9 | 93530f95a4851820e76b0a2ce8970bcb | Sets the color used for the user's own messages.
Listeners are notified of the change. | messageTextColor = colorId;
if (currentCore != null) {
currentCore.setColor(backgroundColor, messageTextColor, actionTextColor, progressBarColor);
}
return this;
} | 0 |
88be0b34783d01b96c34bff8395a9bee | 7761dcac35c7bf67680a3b9885b4a850 | Check to see if the current folder path passes validation tests. | def checkFolder(folderName):
if ('invalid' in folderName):
return False
return True | 1 |
adf8d5b1136b3118735e58af65806ec8 | a810aeaeffd74c10d0c8e77ce1ff3d9d | initWebEditors | {
initBrowsers();
initJSEditors();
initPasteEvent();
initAjax();
initDictionaries();
document.onclick = handleClick;
document.onkeydown = handleKeyDown;
document.onkeypress = handleKeyPress;
document.addEventListener("textInput", handleKeyPress, false);
} | 0 |
642ab1e5fb04fa62d7d27df00b175833 | 2963f35ba03b3bec7cbe5a77c12fae8f | Sets the allocate count tracker. | AllocateStackTracker (
IN VM_CONTEXT *VmPtr
)
{
EBC_STACK_TRACKER *StackTracker;
StackTracker = AllocateZeroPool(sizeof(EBC_STACK_TRACKER));
if (StackTracker == NULL) {
return EFI_OUT_OF_RESOURCES;
}
StackTracker->Size = STACK_TRACKER_SIZE;
StackTracker->Data = AllocatePool(StackTracker->Size);
if... | 0 |
c646682cbd4f804dbcce68c5152f3831 | 50bfe03914ca804f5af67f419c51d11f | get all active characters (with log entry) | class CharactersController extends Controller
public function index()
{
$chars['chars'] = Character::where('active', 1)
->where('delete', 0)
->where('sold', 0)
->orderBy('created_at', 'DESC')
->paginate(8);
$world = file_get_contents('js/api-worlds.js');
$worl... | 1 |
92572341d12d6dcea42b00feefa0b963 | 7f61448ad6da3ef0f9cb03f40c5be655 | Full Recommendation Because | cases like (1) | 0 |
65b9b74dd3e2dcd1b101515517605f98 | 47df4d5fa5197cf61a7566bc025fcd70 | <p>
Enables the APNs VoIP sandbox channel for an application or updates the status and settings of the APNs VoIP
sandbox channel for an application.
</p>
service.
target="_top">AWS API Documentation</a> | namespace Amazon.Pinpoint
public partial class AmazonPinpointClient : AmazonServiceClient, IAmazonPinpoint
public virtual UpdateApnsVoipChannelResponse UpdateApnsVoipChannel(UpdateApnsVoipChannelRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UpdateA... | 1 |
69bc21c8e5f5b876e6a54dce56d3ba33 | 8ee11ee5ce951e9a43fd36a1bb65016f | Fonction initialisant la nourriture, vérifiant si ses coordonnées sont valides, et l'affichant. | void ResetFood()
{
bool collision = true;
while(collision)
{
food.x = rand() % mapHeight + 1;
food.y = rand() % mapWidth + 1;
collision = false;
for (Point p: body)
if(p.x == food.x && p.y == food.y)
collision = true;
for (Point p: wall) ... | 1 |
acdc42f91e64012e698854ca1f629126 | 913adbd4b29915adff7f2620040194c9 | 根据输入id查询其好友信息 | public String getFriendsById(int userId); | 1 |
7be707d1ec434a98b007ab5b8e2df380 | f85f5bdb9d10be0e94dfed8f19657fb8 | Include a file which can act as a reference file, from an arbitrary location. | public function includeFile($path, $once = true); | 1 |
5fd7a38b1ce4d8106fc56112168233f3 | f759ec393822ca5269484308098db490 | 从t复制n个字符到s | {
int i, j;
i = j = 0;
while (s[i++] != '\0')
;
while ((s[i++] = t[j++]) != '\0')
;
} | 0 |
4026632077c187d528e6b7f03f14ecdd | 6ab99100a3a43b24c8ffc81874fa0268 | Here implementation of Nth fibonacci number using recursion. | if n == 0:
return 0
if n == 1:
return 1
else:
return nth_fibonacci(n-2) + nth_fibonacci(n-1) | 1 |
16bed298de8293bad7b2e50001c32391 | 34d36f252561ede8da640ab551cbaea2 | Getter for <code>WETRN.CLSTR_MRKTG_PROD_RSPBLTY.CREAT_USER_ID</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.7.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class MrktMrktgProdRspbltyRecord extends UpdatableRecordImpl<MrktMrktgProdRspbltyRecord> implements Record11<BigDecimal, BigDecimal, Str... | 1 |
70beda83d616eec5300278b91da8b0f8 | 8d4b13435394d2aecaa1ef1ffa65162b | Gets the current stream element.
Thrown if the stream contains no more elements. | E getElement() throws IllegalStateException; | 1 |
6a7f834f61fbd312828d667c1e6f6d71 | a6ded55caa8a17ee9998d32d320467fe | 字典遍历(非线程安全),可根据委托返回值提前结束遍历 | public void Dictionary()
{
for (var iter = 0; iter < ITERS; iter++)
{
for (var i = 0; i < Names.Length; i++)
{
var name = Names[i];
DictionaryLookup.TryGetValue(name, out _);
}
}
... | 0 |
2c7f9d0ff7c325e1ebdd34e7f621e909 | 62ff5840fcdcc177b477723eadcaf29c | # It returns the year where abundance drops below the value provided (argument N=) | row_max_Pres <- which(y$Pres_db == max(y$Pres_db))
DN_CAST <- y[1:row_max_Pres,]
P1 <- DN_CAST$Pres_db[-length(DN_CAST$Pres_db)]
P2 <- DN_CAST$Pres_db[-1]
... | 0 |
617b76edcb555fd4fe826b3750c263d0 | 53f639c5f054159d5e4f093acd0fd8d1 | Sets the action of this OwnOrder. | void setAction(String action); | 1 |
b7a5567a2336ecc5d251a6437449fe81 | 3de9c85cb4d0c0ee3e52cc7a20097949 | Fetch Project data from GCP API. | url = API_GET_PROJECT.format(project_id=project_id)
response_obj, _ = _CallAPI(url, None, None)
return response_obj | 1 |
e199c68e662c47e0bc02a5ce4b364730 | 284a03b83506ff6efcdc8ce95d3f21ce | Test calculating the principal moments of inertia | def moment_method_test ( ):
import numpy as np
from normal_01_moment import normal_01_moment
print ''
print 'MOMENT_METHOD_TEST'
print ' MOMENT_METHOD uses the method of moments for a quadrature rule.'
n = 5
tnp1 = 2 * n + 1
moments = np.zeros ( tnp1 )
for i in range ( 0, tnp1 ):
moments[i] = nor... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.