query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0584d9298117e3d16a510731ff918bca | 82e6f94d66a37acd29916dd3c298da96 | 戦闘回数を更新 | public class LastBattleWindow : WindowBase
void updateBattleCountTime()
{
if(nextUpdateBattleCountTime == ServerTimeKit.getCurrentSecond())
{
addCount = CommandConfigManager.Instance.lastBattleData.battleAddTime + LastBattleManagement.Instance.battleCount;
if(addCount >= CommandConfigManager.Instance.lastBat... | 1 |
81489688e7f94725ba885a09a05139de | 13406ce8696d6a9462d1915f16ec480e | Intersect the two continuous_sets of the transforms | static void
*contactSetTrans(void *ptr, void *data)
{
cpShape **shapes = ptr;
cpShape *a = shapes[0];
cpShape *b = shapes[1];
cpSpace *space = data;
return cpArbiterNew(a, b, space->stamp);
} | 0 |
8060082e9214c417805c1a5ac82b2e40 | 860b9a1633e8529b089c0e45d517d8a5 | Asynchronously destroys the specified subscription. | namespace Microsoft.Exchange.WebServices.Data
public sealed class ExchangeService : ExchangeServiceBase
internal IAsyncResult BeginUnsubscribe(AsyncCallback callback, object state, string subscriptionId)
{
return BuildUnsubscribeRequest(subscriptionId).BeginExecute(callback, state);
} | 1 |
132f1d7e4b5992b8c2250b61b7db6a75 | fe669609390d9b404e5368814d3b5284 | Uses the current avatar data to update the database. | if self.avId and self.avId not in self.avList:
self._handleCloseConnection('Tried to name an avatar not in the account!')
return
self.loginManager.air.dbInterface.queryObject(self.loginManager.air.dbId, self.avId,
self.__handl... | 0 |
d770b38a6741d1b0a49123c5eaff141a | d2e291a44eded0fa3dd38650997d5b0a | Test case for patch_namespaced_replication_controller_status | class TestApivApi(unittest.TestCase):
def test_patch_namespaced_pod_status(self):
pass | 0 |
12beb33287a410f7e0c9f2e9eca61dfa | aeff8a913e350ea812dc84c8a30a1411 | Search for meals by country of origin | @org.springframework.stereotype.Service
public class CoffeeService extends Service<Integer, Coffee> implements ICoffeeService
public Set<Coffee> filterCoffeesByOrigin(String origin) {
return coffeeService.filterCoffeesByOrigin(origin);
} | 0 |
3a66038613daa279e046f4be7ec86733 | c9f1096491b892b2122a12a18d95a521 | <p>Yet-another utility-function - to help STANDARDIZE the naming of FILE-NAMES for script that _EXECUTE_ 'aws cloudformation' commands for CFN-Stacks</p> | return key
.toLowerCase()
.replace("aws_", "")
.split("_")
.map(
(part: string, i: number): string =>
i === 0 ? part : `${part[0].toUpperCase()}${part.slice(1)}`,
)
.join("");
} | 1 |
496c552b260d1800ae2475346a702cef | 4b9e695ff6423411d60d66151a1685c2 | Generates a report of users for MA and creates a CSV file at given path. | public class ReportGenerator
public void create(String inputCsvPath, String reportFilePath) throws IOException {
} | 0 |
6a7918335e33470db2b7fba7a5a9adc9 | 2e2f5d98c126020c887b11c4ac5a189e | retourne la liste des numéros de cartes d'une certaine catégorie pour lesquelles on n'a pas de certitude | IdMap<Suit,CustList<HandBelote>> _cartesPossibles,
IdMap<Suit,CustList<HandBelote>> _cartesCertaines,
Suit _couleurAtout) {
if (_couleurAtout == Suit.UNDEFINED) {
return true;
}
return Gam... | 0 |
43f187acf36606667b06f38b227a7328 | 6390e213bab3171afe8ffa5ea70a98f1 | Implementierung von Oddeven Merge Sort | {
int middle=(left+right)/2;
if(right-left+1<=1){
return;
}
batcher_odd_even_mergesort(array,left,middle);
batcher_odd_even_mergesort(array,middle+1,right);
batcher_odd_even_merge(array,left,right);
} | 1 |
56b2c750fd9dd4637202276d1bd02248 | d9ef755e8ac5b37f92be3b1b6cfc5a4c | Randomly sample a part of the mel spectrogram. | overlap = 1 - (spectrogram_config.hop_width / FFT_SIZE)
return spectral_ops.compute_logmel(
samples,
bins=spectrogram_config.num_mel_bins,
lo_hz=MEL_LO_HZ,
overlap=overlap,
fft_size=FFT_SIZE,
sample_rate=spectrogram_config.sample_rate) | 0 |
bb7316e9f88c23320ecebdfb5075a81b | 7934d9b622638741bdbe26da5d90363b | 从给定的Collection返回唯一的结果对象.
如果找到0或多于1个结果对象, 或者如果唯一结果对象不能转换为指定的所需类型, 则抛出异常. | Object uniqueResult(String sql, Collection paras); | 1 |
a70deeaa69f59b493b5dfcfede8b5bec | b9b13b886b2536b546a57365e3ef0703 | When we find a proof, we announce it | class PexCommunity(Community):
def start_announce(self, seeder_pk):
if seeder_pk not in self.intro_points_for:
self.intro_points_for.append(seeder_pk) | 0 |
67ccea8f08abbaf5d97659b9c15ada6e | 56ed36ffd69de7ff4a66d72b53ac79dc | emulates changing prices and populates the priceQuote object | setInterval(() => {
const nextPrice = this.model.nextPrice(this.price);
const {
change,
changePct
} = priceChange(this.price, nextPrice);
this.price = round(nextPrice);
this.socket.emit(Event.PRICE_UPDATE, {
symbol: this.symbol,
current: this.price,
... | 1 |
d8edddd002191cb6326b857dbbdbf34c | 1215c85f83f9ade1e17032c5e65b38c2 | 启动会话子线程 | void TalkThread::start (void) throw (ThreadException)
{
cout << "启动会话线程开始..." << endl;
int error = pthread_create (&m_tid, NULL, run, this);
if (error)
throw ThreadException (strerror (errno));
cout << "启动会话线程完成! " << endl;
} | 1 |
a9dd0ef7d2722a2055eda9b227c7fab4 | 13413fa2a1395ce0957181f9bd4f5b92 | 获取点赞我文章列表 | userId: number,
pageNum: number,
): Promise<UserArticleLikeEntity[]> {
return this.userArticleLikeRepository
.createQueryBuilder('ul')
.leftJoinAndSelect('ul.article', 'article')
.leftJoin('article.user', 'au')
.leftJoinAndSelect('ul.user', 'ulu')
.where('au.id = :userId', { ... | 1 |
e5e4be174c96cc3f183fcc26d8630286 | a68a2af5c5a22f8d3f2dffc5ca1b44ed | 初始化NAT地址转换上下文,预先给每个客户端分配一个虚拟IP
从客户端接收的IP帧源地址都要转换成这个虚拟IP,然后再写入tun适配器
从tun适配器读取的IP帧目标地址都需要转换成源地址转换前的来源地址 | class ClientToIPv6:
def __init__(self):
self.__tcpT6Client = socket.socket() | 0 |
348034f177a20bd3c7cc10d8ea71e9b6 | ee90dd71866f90f94dd1e81f489bec14 | Get Operating system. | class Swift_Plugin_MailSend implements Swift_Events_SendListener, Swift_Events_BeforeSendListener
public function getOS()
{
return $this->OS;
} | 1 |
94fc307a8d81492ef0e8d423f468876e | 5a1f7e10fe3e91302a2997426f3a560f | Move a process to the requested resource queue. | class OrderProductWS extends \SoapClient
public function MoveToQueue(MoveToQueue $parameters)
{
return $this->__soapCall('MoveToQueue', array($parameters));
} | 1 |
14ca9a85fe71d3d71ad372e48f7548c6 | f8884ba7eec6817f865929cf4f978f05 | Shuts down the packet pump thread and cleans up associated data. | {
myThreadRunning = false;
lock (myMemoryStreamLock) { Monitor.Pulse(myMemoryStreamLock); }
if (myThread.IsAlive)
{
myThread.Abort();
myThread.Join();
}
if (myNamedPipeServerStream != null)
{
... | 1 |
63c65cac75f51e96c06f71d49af51446 | 73a5e59e784ba4c45999e83b43cf1c97 | Adjustment type of the scaling rule. | public class Rule
public AdjustmentTypeEnum getAdjustmentType() {
return adjustmentType;
} | 1 |
4ed51b677e433eca2ecec1298ad344de | f59cdbc576f681cc51f5ff1378ec49e9 | Write a program in C# Sharp to find transpose of a given matrix | {
int input_row=0, input_column=0;
int output_row=0, output_column=0;
int i=0,j=0;
scanf("%d %d", &input_row, &input_column);
int input_arr[input_row][input_column];
for(i=0;i<input_row;i++)
{
for(j=0;j<input_column;++j)
{
scanf("%d",&input_arr[i][j]);
}
}
printf("\n");
output_row = input_column;
ou... | 0 |
7085d620136f88541f7db9115b948b99 | 61056e81f511bf6e3bde711b3fa62606 | Register Custom Post Type Featured Hero Carousel | $labels = array(
'name' => _x( 'Slides', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'Slider', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'Slider', 'text_domain' ),
'name_admin_bar' => __( 'Slider', 'text_domain' ),
'parent_item_co... | 1 |
3a367ae6b7dc8027ed4187001217b0cd | 0d386d7ef5f05a7dd433aaba1502aeb7 | Test whether personal data is displayed on the page | response = self.client.get(self.user_profile_url)
self.assertContains(response, self.user_data["username"])
self.assertContains(response, self.post_data["body"])
self.assertNotContains(response, self.user_data["password"])
self.assertNotContains(response, self.user_data["email"])... | 1 |
650d616c649ac9cc7e024a014b684f77 | 1c8f484ac9d608ce510904b9b407c7ab | Create figures for benchmark 8 elastic | f = pylab.figure(figsize=(4,4))
gs = mpl.gridspec.GridSpec(6,1)
for i,d in enumerate(np.array([0.25, 0.5, 0.98, 1.18, 1.40])):
ebc = ebcs[i][4]
ax = f.add_subplot(gs[i])
plot_bout(ebc, ax)
if i == 4:
ax.xaxis.set_ticks_position('bottom')
ax.set_xlabel... | 0 |
a503f7239e0e868b84b1ff7f132dfa84 | 239727a9350eac7f945a46903bc6aa72 | unlink the sheet so that all properties are not synced as it is changed | function unlockSheetList(sheetList: Sheet[]) {
sheetList.forEach(sheet => sheet.protect().remove());
} | 0 |
a4c78500a4a4c4425f0c8c439c17bd68 | 9e290235ba436f524651409a0e782c1f | 检查JCB主卡申请人是否是在18-40岁 | public class IdCardUtils
public boolean isGrownUp(String idCard) {
if (!ValidUtils.getInstance().isValid(idCard)) {
return false;
}
if (idCard.length() < 18) {
return false;
}
long idCardDate = Long.valueOf(idCard.substring(6, 14));
long today = Lo... | 0 |
720b06415c06a77887f25225ebd7812d | 36ade9af4d038e1acd5ccd07acba02f4 | This function calculates the percentage of discount that a vendor will offer based on how many books you purchase. | pack_no = float(input("Please enter the number of packages purchased: "))
if pack_no >= 10 and pack_no < 20:
discount = 0.10
elif pack_no >= 20 and pack_no < 50:
discount = 0.20
elif pack_no >= 50 and pack_no < 100:
discount = 0.30
elif pack_no >= 100:
discount = 0.40
else:
discount = 0.00
gross_price ... | 1 |
6d2b4ba759dd28cea3ccfb7abe3a94d2 | f70725439aa7a1d0251f298622c97190 | Returns the cumulative depth of clay-sized toppling deposition for this cell | double CCellSoil::dGetAllSizeToppleDeposit(void) const
{
return m_dClayToppleDeposit + m_dSiltToppleDeposit + m_dSandToppleDeposit;
} | 0 |
0bba9b513cfe692e09575f48c7ebcde6 | d0586a8dca6bdefea96d54408513694e | Test that the protocol can be overridden on a per-application basis. | class TestTasksApplication(unittest.TestCase):
def test_layout_save_with_protocol_3(self):
state_location = self.tmpdir
app = TasksApplication(
state_location=state_location, layout_save_protocol=3,
)
app.on_trait_change(app.exit, "application_initialized")
memento_fi... | 1 |
b4654399d161849052bf6012892c994e | 8471d39231f3f79c2cfe4bdaa9ce1cd6 | Is NetPlayer on TeamRed. | class ReflexCaptureAgent(CaptureAgent):
def isOnRed(self, gameState, xCoord):
halfway = int(gameState.data.layout.width / 2)
return xCoord < halfway | 0 |
e05c421511c406e7129dff9dc6720795 | 94415e67b098ae3e1b987075e12e73b3 | Compute Date from Julian Day | j = jdn + 32044
g = j // 146097
dg = j % 146097
c = (dg // 36524 + 1) * 3 // 4
dc = dg - c * 36524
b = dc // 1461
db = dc % 1461
a = (db // 365 + 1) * 3 // 4
da = db - a * 365
y = g * 400 + c * 100 + b * 4 + a
m = (da * 5 + 308) // 153 - 2
d = da - (m + 4) * 153 // 5 + 122
year = y - 4800 + (m... | 1 |
f97dce74cbfa4d4e86937947c2de3cd2 | 8e5bf404cf10fdea0ee6de04aee67be0 | 월별기준내용 정보를 조회하는 메소드 | @ResponseBody
public Map<String, Object> getInfo(String year, String month, @RequestParam(value="groupNum") String groupNum) {
List<ScheduleVo> list = scheduleService.getSchedule_month(year, month, groupNum);
Map<String, Object> json = new HashMap<>();
List<Map<String, Object>> jsonList = new ArrayList<>();
... | 1 |
48e3277e72d4c78145cab5b2e12d8d21 | 8fee355d75e63bfa9d9d0d162ba12e34 | NewWorker returns a new Worker with the given server script loaded | func NewWorker(key string) *Worker {
return &Worker{key}
} | 0 |
1f4600bfa97dd4f6b6f18221f2acf90c | 12bec801d7a34abe3542c893fde00623 | this func initializes the time by aligning it to action lag duration,
which makes the npc slowly flips the card so that player can take a good look. | public class EnemyController : MonoBehaviour
IEnumerator ChasePlayerTimer(int time)
{
yield return new WaitForSeconds(time);
runAgressiveTimer = true;
anim.SetInteger("sideMoving", 0);
} | 0 |
ba9d84a40c2e5f765892d41a777f4dd1 | 305b5e9c1a43760fbce17b42180d16e6 | Return the displayName of the user per the SCIM spec. | @AutoEscape
public String getUserDisplayName(); | 0 |
4b0b6b49cb076c4ebc039599932768e6 | 8648ef9171d4adc2b26b2ec35debc13e | 短消息函数,可以在某个动作处理后友好的提示信息 | class AController extends CController{
public function tf($msg){
Yii::app()->user->setFlash(CV::TIP,$msg);
} | 1 |
832d1eb3f57ba2727733c59dbfbee3f0 | adfd4fdaddb17655b64e23305f5bbcb0 | Clears all gun options | {
ms.pAnimator.ResetTrigger("ShotgunFireTr");
ms.pAnimator.ResetTrigger("WeaponTr");
ms.pAnimator.ResetTrigger("GunFireTr");
ms.pAnimator.ResetTrigger("RifleFireTr");
ms.pAnimator.SetBool("ShotgunBool", false);
ms.pAnimator.SetBool("FireballBool", false);
ms.p... | 1 |
be0a1b0d55cf4b512e0dc3361bc0b771 | ef3129f749a5a2b359f20b675f35e330 | Handles removing events for a property | function Functions.removeModelAtrrEvent(model, attrName)
local eventName = string.upper(model.__cname) .. "_" .. string.upper(tostring(attrName)) .. "_" .. "CHANGE_EVENT"
model:removeEventListenersByEvent(eventName)
end | 1 |
c13bf8355ec14635d821a1c95657f723 | ec4c4acb193c26f2b044c8e5ffb97999 | Will toggle the ability to build in an area. | public class GlobalRegionManager
public boolean canBuild(Player player, Block block) {
return canBuild(player, block.getLocation());
} | 0 |
3bb936ad561f41b3f0e48630347843e8 | 34ca0202788b9bc00273aba1ad5f7789 | Получение перестановка массива
@param a - массив для перестановки
@return флаг наличия перестановок | bool swapped = false;
for(int i = 0;i != n;++i){
if(a[i]>a[i+1]){
swap(a[i],a[i+1]);
swapped = true;
}
}
return swapped;
} | 1 |
4da3599408f39293870d82759d996cfa | a4e0d46c4559b8f51fc680999f71c0a7 | Get the IP from the IP boxes | {
if ((bool)this.LocalIP.IsChecked)
{
return "127.0.0.1";
}
else
{
return this.IpAdressText.Text;
}
} | 1 |
4cb86701a2bd5d5ff84a063402154c69 | dd101153c8ab849f991c38d1b7d516c4 | Create initial verified version for new articles | class VerifyArticle(models.Model):
def allow_publishing(id_article):
VerifyArticle.objects.filter(
verification=id_article).update(is_verified=True)
Article.objects.filter(id=id_article).update(draft=False)
Article.objects.filter(id=id_article).update(published=now(),
... | 0 |
f212e3b58bb1ca1cf1c9f0002f4e0a5a | ad4b5ff2aac4176c7e0fb1a7984a17d8 | 사용자 목록 엑셀 다운로드 | class UserController extends Controller
public function export()
{
return Excel::download(new UsersExport(), 'users.xlsx');
} | 1 |
de7504799b2a9cdc3fe998becdd728a9 | b703d907cf2f1f20132a5c266a1daaa9 | Initialize HMM using parsed and formatted data | print('Training HMM3 model')
self.label2index = { label:i for label, i in zip( self.S, range(len(self.S)) ) }
self.label2index['<START>'] = len(self.label2index)
self.label2index['<STOP>'] = len(self.label2index)
i = 0
for x in train_data:
for w in tokenize( x... | 1 |
94dd1d997b460a516621cc01b7a3a578 | ff53af19de08af630b14d824efa4dca0 | Initialise the CyberPro hardware. On the CyberPro5XXXX,
ensure that we're using the correct PLL (5XXX's may be
programmed to use an additional set of PLLs.) | static void
prci_init(void)
{
mmio_write_u32(PRCI_CTRL_ADDR, PRCI_HFROSCCFG,
mmio_read_u32(PRCI_CTRL_ADDR, PRCI_HFROSCCFG)
| ROSC_EN(1));
mmio_write_u32(PRCI_CTRL_ADDR, PRCI_PLLCFG,
mmio_read_u32(PRCI_CTRL_ADDR, PRCI_PLLCFG)
| (PLL_REFSEL(1) | PLL_BYPASS(1)));
mmio_write_u32(PRCI_CTRL_ADDR, PRCI_PLLCFG... | 1 |
8cb469fcad548194272a4da47712511b | eeadf75cc207842974b8ea9eda86e697 | Get the factories that should be used to create values for {@link Property properties}. | public abstract class ConfigurableInjector extends Injector
abstract protected IFieldValueFactory getFieldValueFactory(); | 1 |
a13f1b3dc9e754c8c97ad512d2c3de58 | 4a413bb917ef5bcd35f169c4f4b0845f | Gets the name of the second selector. | public String getSelector1Name(); | 0 |
57ea720218fdd4fd3760ba564bda9223 | a2d84f52b4f18db894ceb450203747cd | Waits for all childs Tasks to complete execution. | namespace ParallelTasks
bool WaitForTasksToFinish(TimeSpan waitTimeout); | 1 |
c383d7dc1855e875ffa87d1c1a999605 | 03e33883015600880ab14c567c84b5cc | @brief the old and famous bubble sort, with a twist - uses pointer
arithmetics instead of classic indexing | void sortPointers (void **ar, int n,
int(*cmp)(const void *,const void *)) {
int i;
for (i = n-1; i >=1; i--) {
int maxPos = selectMax (ar, 0, i, cmp);
if (maxPos != i) {
void *tmp = ar[i];
ar[i] = ar[maxPos];
ar[maxPos] = tmp;
}
}
} | 0 |
bf8b6a6aa999a90b24042bb6c9234f3d | d093952637db3b4a07d5b4f29e8c7b75 | Effectue un tri rapide sequentiel | p = 0
r = self.n - 1
self.__tri_par_fusion(p, r) | 0 |
8f3b8b4cac53d1e6097cf3aaa64a03f3 | 5b8c7342d22b92c8a1f6004dbfdaab76 | A list suitable for Form select lists. | class FormMailerAdapter(FormActionAdapter):
def fieldsDisplayList(self):
return self.fgFieldsDisplayList(
withNone=True,
noneValue='#NONE#',
objTypes=(
'FormSelectionField',
'FormStringField',
)
) | 1 |
23f4a71dc29df534dda43b3a308f3113 | 4007b3a6daca02b8cb957c8733bb2118 | 在点击标题栏时 改变此标题栏的样式 并恢复其他同级标题栏的样式 | class MFWWriggleTab : LinearLayout
private fun changeSelectedStyle(position: Int) {
titleList?.forEach {
it.scaleX = 1.0f
it.scaleY = 1.0f
it.setTextColor(Color.parseColor("#666666"))
}
with(titleList!![position]) {
scaleX = 1.2f
scaleY... | 1 |
5e4c9715df96d635a2abb8c011e1f691 | 959d3e22f0a7b72b0eed73f4d98a6f79 | 统计自助核验机的采集总人数 | Logger.Debug("GetUserAttestionTatalNum input param:", ualr)
o := orm.NewOrm()
o.Using("default")
qb, _ := orm.NewQueryBuilder("mysql")
qb.Select("count(1)").
From("jl_user_attestation UA").
LeftJoin("jl_user U").On("UA.user_id=U.id").
LeftJoin("jl_glossary G").On("UA.card_type=G.id").
Where(fmt.Sprintf("1=... | 1 |
51dbbb41dd6f93db662175da28a1b0e8 | 75081aec957ee3754c3210eebfbffafa | 判断是否是相邻元素 | function PlayDirector:getIsRelate_(stone1, stone2)
local rowIndex1, colIndex1 = stone1:getRowColIndex()
local rowIndex2, colIndex2 = stone2:getRowColIndex()
local temp1 = rowIndex1 - rowIndex2
local temp2 = colIndex1 - colIndex2
if temp1 >= -1 and temp1 <= 1 and temp2 >= -1 and temp2 <= 1 then
return true
else
... | 1 |
fd6e94ae4b7192e4017b825a8496e081 | c5bbf864257daa80b9679cebe27e18a4 | Get all nodes sorted by distance | suspend fun getAllNodes() = mHomeNodeDao.queryAll().reversed() | 0 |
169ff23048ecf2da17e4a9782cb6c8c6 | 30a7df452d304a5e52244a66aa6b9394 | An earlier implementation of this type overrode this method, so we'll continue to do so
to preserve binary compatibility. | public abstract class IPAddressFormat<I extends IPAddress<?>> extends Format
@Override
@Deprecated
public Object clone() {
return super.clone();
} | 1 |
0df342b301530e3e246335bd7fb44f1c | a2a24fc08d6dd8c93edbb0566743dd84 | 保存文件,将图形的顶点保存到文件中 | {
FILE *fp;
char filename[30];
printf("input file name: ");
scanf("%s", filename);
if ((fp = fopen(filename, "wb")) == NULL)
{
printf("File open error\n");
return ERROR;
}
int i;
ArcBox *p;
fwrite(&(G->vexnum), sizeof(int), 1, fp);
fwrite(&(G->arcnum), sizeof(int), 1, fp);
for(i = 0;... | 1 |
5df70c1b93f8dec4ae3db08b381aa475 | 5280f5c02930f38ec7bfa3c7342e17f0 | Adds a scalar value with this color. A new resultant color is returned. | public class LColor implements Serializable
public LColor addition(float v) {
return new LColor(r + v, g + v, b + v, a + v);
} | 1 |
ab0bc6a9a4a38631fda809cad33044eb | 186f821283369f8d27bd1f1be1a8d68f | yield all sub classes of base class | results = []
for subclass in cls.__subclasses__():
results.append(subclass)
return results | 0 |
00a8061d60c98a1110c0c5cbb9521bf7 | 63a249207e507c81fa71bb9f0d63fd4a | 设置其他摄像头模式 | public class VideoActivity extends Activity implements View.OnClickListener
public void SetCamera(int nIndex) {
MainApplication.getInstance().mViGoManager.pub_ViGoGetCameraParam(UGoAPIParam.getInstance().stVideoDevicePara);
UGoAPIParam.getInstance().stVideoDevicePara.usCameraIdx = nIndex;
UGoAPI... | 1 |
db3ae55e88e69159dcd09998e4e56bf1 | 78bdcf04c2ee7cb4c79650fd2774b224 | Uint8 returns a reference. | func Uint8(v uint8) *uint8 { return &v } | 1 |
41c839b65dcb330363b839218ae6940a | 67632351604c2e8c078f433f9112389a | Save connections to file in a format suitable for reading in with\
a FromFileConnector. | def save_data(orth_connections, r_gene_to_trans, q_trans_to_gene, t_trans_to_projections, out):
f = open(out, "w") if out != "stdout" else sys.stdout
f.write("t_gene\tt_transcript\tq_gene\tq_transcript\torthology_class\n")
non_orthologous_isoforms = []
for conn in orth_connections:
conn_class = ... | 1 |
5d3a23ecf87d501bea75269bd623e415 | 405f516ca921307b996a1a059d1b1247 | Sets clock running, updated every second. | function Set_Clock(){
JsClock.classList.add("run");
IntervalId=setInterval(Load_Time,1000);
} | 1 |
9ba3579b3b044a73f9d1c9cfdea71b69 | 2d7b23064d15a57af258a24b8f78f252 | 推送到安卓设备 | function push(){
$deviceToken = "678be32abdf28146158c4edcd22689635126cc8c9459f27fd65b062f8d81b4a3";
$alert = "测试123";
$body = array("aps" => array("alert" => "{$alert}", "badge" => 1, "sound" => 'received5.caf'));
$ctx = stream_context_create();
stream_context_set_option($ctx, "ssl", "local_cert", R... | 0 |
d018cabeec8caaf11bc8d6688e148e1b | 91f75b5a88a698991d1bb5bb0d69338c | Get the active announcement, if one exists. | if block_given?
websocket.subscribe :newannouncements, params: { auth: true }, &blk
else
http.get :newannouncements, auth: true
end
end | 0 |
763a358604742280c90069fd1abc19de | 4181ad8b1451c86c05726b7af0ff903b | Returns the list of mount items associated with the given mount key. | request = service_pb2.MountsRequest()
metadata = [('authorization', "bearer: {}".format(self.token)),
('active-group', group_id)]
try:
mountsResponse = self.stub.Mounts(request, metadata=metadata)
return mountsResponse.mounts, None
except grpc.... | 0 |
c134b7dcea9b7957ca7c6f48a334e24d | ecf97c179ce10941380fbdf9c824efdf | Returns a ```Person``` object with given name. | def person(author):
return stringutil.person(author) | 0 |
0af7e92673dbbd430ae3a3cc8c861ffc | eca7c447c6a38d3e44946d99858f9dcd | Returns the time required by the solver to generate the feasible coalitions | public class GridContainer extends com.act365.awt.Container
implements AdjustmentListener
public double getSolveTime()
{
return solveTime;
} | 1 |
bd73b7a1e40f10079743617e34025a4c | 208b1a5b2299dbcf73ec0b422469f1a6 | Finds the next empty slot starting from the end of the inventory | public class InventoryManager : MonoBehaviour
private void calculateNextOpenSlot()
{
for (int y = 0; y < 10; y++)
{
for (int x = 0; x < 13; x++)
{
if (grid.transform.Find($"Row {y}").Find($"{x}").GetComponent<InventorySlot>().IsOpen)
{
... | 0 |
d0118ea5854e751d9e312b2d264ca152 | 1b691ac163294bea30ef05b76906d990 | Adds plus symbol at the start of the arithmetic operation. | class AddOperation(BaseOperation):
def __str__(self):
return 'add to' | 0 |
b278f15850b8af7288f6db66dd56c51a | 58f4d6b3dcbb2c470da986c1eb7cf7d1 | 取域名,http://占7个字符,https://占8个字符 | function domainURI(str){
var durl=/https?:\/\/(?:[^/]+\.)?([^./]+\.(?:com.cn|cn|com|net|top))(?:PanLi|\/)/;
var domain = str.match(durl);
return domain[1];
} | 0 |
920a2b993bf300ee554e84a51a1e657a | d1e179f3ef80a47ee5b646ce7aaa11a4 | All pins -> output | class LedControl(multiprocessing.Process):
def init_pins(self):
GPIO.setmode(GPIO.BOARD)
for pin in self.pins:
GPIO.setup(self.pins[pin], GPIO.OUT) | 1 |
17cf79bfe7cbe200ba0b0dddf4a8b885 | 5079cc8d705aa8e808906f79ceaa0513 | <playwright-file>network-post-data.spec.ts</playwright-file>
<playwright-it>should return post data for PUT requests</playwright-it> | const testData = {
query_result: {
data: {
rows: [
{name: "yu-suke-dev"},
{email: "contact@yu-suke.dev"},
{message: "This is test email. haha."},
],
},
},
};
doPost(testData);
} | 0 |
7ff7056e60d417cdc9584555d75d52c6 | 1e1dcbd316be048ad91325a26f43d5d6 | Returns the maximum number of terms Solr should return | class SolrQuery extends \SolrModifiableParams implements \Serializable
public function getTermsLimit()
{
} | 1 |
5d03fab76df42c374908994814556a59 | d035bd7e9c1949e22de2e5caa102a03c | Called on button click to enable location capturing for the starting point. | public class MapActivity extends AppCompatActivity
public void fab_onClick(View v) {
mLocationClient.start();
} | 1 |
370b9e8eff399ad7410716dc8135b2f4 | 3f17a021d801c9230b765667f8981984 | 在 RecyclerView 中使用这个布局的时候
当 Item 滑出屏幕 重置 Item 的状态,防止 Item 复用导致视图错误 | public class MainActivity extends BaseActivity
implements NavigationView.OnNavigationItemSelectedListener
private void resetItemLayout(NavigationView navigationView) {
try {
Field mPresenter = NavigationView.class.getDeclaredField("mPresenter");
mPresenter.setAccessible(true);
... | 0 |
5a01dd8edaa0e2bb91689d4aef5ad260 | 9671a8c80c6193c37156afd0f8618d52 | This function updates the autorate statistics periodically. | long currentTimestamp = System.currentTimeMillis();
double delay = (currentTimestamp - this.startTime) / 1000;
double currentPacketRate = (this.currentPacketCount - this.lastPacketCount) / delay;
double currentByteRate = (this.currentByteCount - this.lastByteCount) / delay;
double weight = 1-Ma... | 1 |
20d7e0691131583703860c616190b6d7 | 8425f3490bf2766c52a9f621fd36f7f6 | 修改课程日期 | func ModifySchedule(c *macaron.Context, sess session.Store, params model.ModifyScheduleParams) {
if params.ScheduleId <= 0 {
resultError(c, 3, "错误的课程ID")
return
}
if params.Subject < 2 || params.Subject > 3 {
resultError(c, 3, "参数'subject'错误")
return
}
schedule := model.Schedule{Id: params.ScheduleId}
has... | 0 |
daeae5b2f5359d1c1288457cbca837b1 | 29e392654113241c21baa031b1bed470 | Clear leading zeros | void BigInteger::TrimPrefixZeros()
{
auto size = _magnitude.size();
unsigned int firstNonzero = 0;
for(; firstNonzero < size; ++firstNonzero)
if(_magnitude[firstNonzero] != 0) break;
auto begin = _magnitude.begin();
_magnitude.erase(begin, begin + firstNonzero);
if(_magnitude.size() == 0)
_magnitu... | 1 |
98e139564951564b6c7634f8b3a5a212 | 6111a1731cf83a3a6d27f0f2b4a12967 | Returns machine endian ordered binary data as signed 16-bit integer. | class Decoder
def int16
read(2).unpack("s>").first
end | 1 |
a90e397e3bf224d5430687d3712cdf6c | cd11327ba332fb3e9a61e5c615a8404e | Test to run the analysis command | class TextAnalysisTests(unittest.TestCase):
def test_function_runs(self):
analyze_text(self.filename) | 1 |
672f55a84541487a556787d211b23be0 | 318c95e0f5be5fd7daab2cce11000f6b | 改进的冒泡排序算法
改进点1:若数组已经有序,则提前终止
改进点2:记录最后一次元素交换的位置,作为无序区边界 | let len = arr.length;
for (let i = 0; i < len; i++) {
let flag = false;
for (let j = 0; j < sortBorder; j++) {
if (arr[j] > arr[j + 1]) {
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
flag = true;
}
}
if (!flag) break;
}
return arr;
} | 0 |
e7a84c1f8417c28796c57b37f4f60d42 | 89f78174c6f1685a7d1c407c59941044 | Set a string to be appended to the templates used to render media sites | class Index extends \EkpBase\Helper\Abstr\Route
public function setMediaSuffix($mediaSuffix) {
$this->mediaSuffix = $mediaSuffix;
return $this;
} | 1 |
80db81385c515bc1375e7370897868af | 500210bd614799704a85d68f9a7fdd52 | give checkboxes correct values as per saved variables. | class OptionDialog(QDialog):
def generate_checkbox_list(self):
self.ui.checkBox_check_updates.setChecked(self.model.get('Misc', 'check_updates') == 'True')
self.ui.checkBox_fullscreen_mode.setChecked(self.model.get('Misc', 'fullscreen_mode') == 'True')
self.ui.checkBox_hide_menubar.setChecked(se... | 1 |
607d85cd3e1aa57ae3080dd97b76e696 | 634d859c37f4a43fae51b2bafd077457 | Gets the Query in a relative period range time window. | TimeSeriesId timeSeriesId,
TimeSpan timeSpan,
DateTimeOffset? endTime = null,
QuerySeriesRequestOptions options = null,
CancellationToken cancellationToken = default)
{
using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(... | 1 |
fddd5fe0ce02545cf0ce84ea04bb867b | d11637a2c5061ee9584920f63ac41981 | Pull SDA high | void SDA_Set() {
SDA_Pin_SetHigh();
} | 1 |
3d1a6b9d77527a267cde91661eca9998 | 6973aa83c8e4d745815bad3163e7eb0e | 月度化一个工作簿 | {
int rowCount = dt.Rows.Count;
int colCount = dt.Columns.Count;
sheetCount = this.GetSheetCount(rowCount, rows);
for (int i = 1; i < sheetCount; i++)
{
workSheet = (Excel.Worksheet)workBook.Worksheets.get_Item(i);
w... | 1 |
984b9ef2face8a0943903be7c60f8343 | 1f2de7b7ce9d4781fc8f316c941e68dc | Removes the right subtree of the root of this binary tree. | namespace Todo.Todo
class BinaryTree<T>
public void RemoveRightAll() => Right = null; | 1 |
940e34b3689e1be555129c29fdedc279 | 8c1181174e1794e064e02c169fe21174 | ポップアップのボタンの数を取得 | class ButtonList implements JsonSerializable
public function GetButtonCount() { return $this->buttonCount; } | 1 |
2bb337850c1d8da1081e614ef0848394 | dddf16288cc022917093bff3e7c72646 | disable the load button in the UI | function disableLoadOrderButton() {
document.getElementById("welcome_load").disabled = true;
} | 1 |
bc5022953cc8a9a7088aeb23d2690f23 | 93a9d223f669879364ecf56b8412d920 | Returns a list of human-readable error messages (strings) that give any errors about the schema itself. | class Schema(object):
def error(self):
return self._error | 0 |
41907d98cd5eae06f80fd1430d730457 | 65572a29d63496015e7b636b76948e38 | Setzt die Fehlermeldung in alle Ergebnisstextfelder. | public class DDSRSS20Form extends ActionForm implements Serializable
public void setErrorMsg(String message) {
errMsg = message;
} | 0 |
c2fc395ee52406c8bbbbf50387f24bd8 | f0427a540e3dfd1caeda38b67893ac8b | Método auxiliar que remove da sessão apenas os itens relacionados a este contexto. | public class Context implements JexlContext{
public void removeBean(String pnome,Object object){
String nome=pnome!=null?pnome:object.getClass().getSimpleName().substring(0,1).toLowerCase()+object.getClass().getSimpleName().substring(1);
removeProperty(nome);
removeProperty(nome+".page");
removeProperty... | 1 |
87869b33f112fb119c088a590cdbbd93 | 30066bd624f030b86872ce645251d81e | 修改止损申请 | namespace ManagerSystem.MVC.Controllers
public class DamageAssessController : BaseController
public ActionResult STOPREDUCTIONManager()
{
FIRELOST_LOSTTYPE_STOPREDUCTION_Model m = new FIRELOST_LOSTTYPE_STOPREDUCTION_Model();
m.STOPREDUCTIONID = Request.Params["STOPID"];
m... | 1 |
aace294527b3b1675927cc008696983c | e00b41e5fd713d0c4490e87ade0612e1 | Checks who has bigger army and returns it | class makeMove(object):
def superiorhp(self,enemyhp):
if self.myhp > enemyhp:
return 'me'
else:
return 'enemy' | 0 |
b2a16d453851ad58c77d3b47f4586d02 | c66a3aa05369979c2d58e7ab405937b8 | When the selection changes in the issues grid, enable/disable certain icons. | namespace RouteOptimization
public partial class DataWindow : Window
private void DataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
buttonEdit.IsEnabled = true;
buttonDelete.IsEnabled = true;
} | 1 |
ca0777dbaeae00f10a7809693ca92aaf | 944417a0e60cdf1bbfc6c3606388e126 | Written to allow both:
- LocalizedRecurrence.objects.update_schedule()
- LocalizedRecurrence.get(id=my_recurrence).update_schedule() | class ScheduleInterval(Model):
def value(self, value):
self._value = value | 0 |
909a46c1ce9c929b8e6fa9b039a47aec | d490bd4f862b3347f809a66473ea480e | reverses the bit order of an 8 bit number | uint8_t
Reverse(uint8_t ui8Number){
uint8_t ui8Index;
uint8_t ui8ReversedNumber = 0;
for(ui8Index=0; ui8Index<8; ui8Index++){
ui8ReversedNumber = ui8ReversedNumber << 1;
ui8ReversedNumber |= ((1 << ui8Index) & ui8Number) >> ui8Index;
}
return ui8ReversedNumber;
} | 1 |
ef351d7647ad34ad2052e5d3d819de07 | 8c46aba86eb5620cfab13064d77bd5c1 | additional check on class level for country specific format | case country_code
when 'gp', 're', 'io', 'ap'
'unknown'
else
country_code
end
end | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.