query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
17d39565ecb87d7939b7f11a6dbe86ce | f354b961e061f00fc506439be05991db | Trigger a callback from the kernel to propagate the event out to listeners.
This allows us to use a single uniform model for all run events (even when some are really originating here in SML). | namespace UnityEngine.XR.MagicLeap
public sealed partial class MLCamera : MLAPISingleton<MLCamera>
private void GLPluginEvent()
{
GL.IssuePluginEvent(MLCameraNativeBindings.GetPluginRenderCallback(), 0);
} | 1 |
ded5435cdb7558e5d926d74a91e7e3cd | 689018bb8b7693ca3e9a125668572557 | Flags an outlier according to a percent difference threshold | if len(iData.shape) == 1:
iData = iData[:,None]
median = np.median(iData,axis=0)
diff = np.sum((iData - median)**2,axis=-1)
diff = np.sqrt(diff)
med_abs_deviation = np.median(diff)
modified_z_score = 0.6745 * diff/med_abs_deviation
return modified_z_score > iThresholdValue | 0 |
96d35f6f91ced4ee8b78cdeaaba6e7ca | 5b7634e56ff65fda730b8a4390d64b90 | 일반 외부 명령어 처리 함수 | switch (param.element) {
case "조회":
{
viewOption(param.element);
}
break;
case "추가":
case "수정":
{
closeOption({});
... | 0 |
5e8ea5e69b6358669fd9e28f81f2f69e | e78b2ac8b001b1ff12e0ab63adf18ed9 | Obtiene la lista de todos los adjuntos. | class AttachmentController extends Controller
public function index() {
$attachments = Attachment::all();
$data = [];
foreach ($attachments as $attachment) {
$item = new \stdClass;
$item->id = $attachment->id;
$item->name = $attachment->user->profile->name;
$item->document ... | 1 |
8565d3d4df71e8e91fe116399a3db75a | 062f91c3cce020b82c899dd4934609ea | Try for an exact match first: | namespace System.Management.Automation
internal abstract class HelpProviderWithCache : HelpProvider
internal override IEnumerable<HelpInfo> ExactMatchHelp(HelpRequest helpRequest)
{
string target = helpRequest.Target;
if (!this.HasCustomMatch)
{
if (_helpC... | 1 |
38c9812894f14a0e5a73c596f37a1da5 | 69d0164103a56e55043afc162eb5e58d | 多括号匹配 | public class RegexUtil
public static final boolean checkBrackets(String str) {
return str.matches("^(.*?)\\((.*?)\\)(.*?)$");
} | 0 |
d6e44193f63c375aa3b8126e6ace7939 | 789b5c6c9891794a4d3811b47e514b09 | 跳转到添加FdMemberDoctorSh页面 | @RequestMapping(value = "/toDoctorAdd",method = RequestMethod.POST)
public String toDoctorAdd(@ModelAttribute Doctor doctor) {
try {
doctorService.insert(doctor);
return SUCCESS_MSG;
}catch (Exception e){
return ERROR_MSG;
}
} | 0 |
c712350b345ce1f81d5b000a9c04084f | 2a897db3febb446e23555e4c1fe21ee7 | Collect WebSdk Order Parameters | {
$params = array(
"acceptReturnUrl" => $this->config['accept_return_url'],
"amount" => $amount,
"callbackUrl" => $this->config['callback_url'],
"cancelReturnUrl" => $this->config['cancel_return_url'],
"currency" => $this->config['currency'],
"language" => $this->config['language'],
"merchant" =... | 1 |
252d6c97807b8bbfbdbcb7fae79c3ea0 | 51510368cce1f61c97743d968416cc14 | Metóda zistí počet roomiek pre daného usera | class DB
getRoomsWhereAreUser(userId) {
return this.db.all(
'SELECT * FROM rooms INNER JOIN usersAndRooms ON rooms.id = usersAndRooms.roomId WHERE usersAndRooms.userId = ?',
[userId]
);
} | 0 |
443dcacc8a466b6bb084f54c42017c6e | 359fb2e0dc9e85a98f7993f58bf43a20 | HostPCが立ち上がっているかの確認 | {
pcName = Utility.getPcDir();
if (pcName == string.Empty)
{
MessageBox.Show("このコンピュータがOCR出力先として登録されていません。", "出力先未登録", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
this.button2.Enabled = false;
this.button3.Enabled = false... | 0 |
b60270e5c343a69e464a8b0015e6abd4 | 681200adb93f3bf4701323dcb1e62b48 | Does the HTTP get to etcd to get the keys at the path specified. | def read_etcd_key(key_name, key_path=""):
client = etcd.Client(host=ETCD_HOST_1, port=ETCD_PORT, allow_redirect=False)
value_list = {}
try:
r = client.read(str(key_path) + str(key_name), recursive=True, sorted=True)
for child in r.children:
try:
dict_value = json.... | 1 |
37a8f825ebdf3d58edb0eca58c8d12b5 | 8755a6f7e34ba75e3c722f4221eaf7bf | POST /linens
POST /linens.json | class LinensController extends Controller
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['admin']);
} | 0 |
1e4153d942332e38173b5c24d659c4f4 | 7fe841a13f150daa64028a4d4c0bb865 | Xóa phòng ban | {
$data = $this->RoomRepo->find($id)->load('user');
$this->RoomRepo->delete($id);
$room['room_id'] = 0;
foreach ($data['user'] as $value) {
$this->UserRepo->update($value['id'], $room);
}
return response()->json(['success' => 'Xóa Bộ Phận Thành Công.']);
... | 1 |
abcd87fb972b46f337f5b6a310e0c1d3 | 8402ed950e07c5f72815b4be73ab32f8 | Migrate old cell Auth() data into a HiveAuth(). | if ($oldversion < 2014123000) {
$config = get_config('auth/drupalservices');
foreach ((array)$config as $key => $value) {
set_config($key, $value, 'auth_drupalservices');
}
unset_all_config_for_plugin('auth/drupalservices');
upgrade_plugin_savepoint(true, 2014123000... | 0 |
986a386faa35cb54231d05bb0df45d64 | 45751dd232bf754d271b7c1bc069eb86 | Remove all the pending queries with arrival time earlier than the deadline | public class UdpProxyServer implements Runnable
private void clearExpiredQueries() {
long now = System.nanoTime();
for (int i = mQueryArray.size() - 1; i >= 0; i--) {
QueryState state = mQueryArray.valueAt(i);
if ((now - state.mQueryNanoTime) > QUERY_TIMEOUT_NS) {
... | 1 |
239d3c93a925956131692f5eac9b470e | 9605eea9ded4093195479d44fec994e2 | Insert hyphens into given license id or activation request to
make it easier to read | s = s.strip()
if s.find(' ') > 0:
if s.find(' ') > 3:
s = s.replace(' ', '')
else:
s = s.replace(' ', '-')
if s in ['BRKA', 'BFB', 'LGFA']:
s = s[:-1] + '-' + s[-1]
if s == 'GOOG':
s = 'GOOGL'
if s == 'DXPBN':
s = 'DX'
if s == 'NSA-... | 1 |
7a98357863b0949bae4507a30e55356c | d5e46bd5fb64356068973e9694e40436 | removes all blocker objects from the scene | public class SkylineManager : MonoBehaviour
public void ClearBlocks()
{
while (blocksInScene.Count > 0)
{
RemoveBlock(blocksInScene[0]);
}
} | 1 |
ff74a8c4eff3aacd2f0b8584860df793 | fc94eb90573efe56253f33faaf13d8f2 | Gets the 0-origin sequential position of a subelement within a series
of subelements. | if position < 0 or position > 1.0:
raise PositionNotInElementError(
f"Expected position to be between 0.0 and 1.0. "
+ f"Position given was {position}"
)
start = self.get_element_start_end(element=element)[0]
length = self.elements[element]... | 0 |
dd097e9788474c640a6f3ff37371b7b7 | 8ac08bb164db1cfa4a9532962d426f3c | As each button in the command field is created, it detects if the button is the delete button.
If it is, an attribute is added to make a javascript prompt display to confirm the action when pressed. | function addDeleteButtons() {
let deleteButtons=document.querySelectorAll(".deleteButton")
deleteButtons.forEach(button => {
button.addEventListener('click',() => {
email = event.currentTarget.dataset.email
deleteOrder(email)
})
})
} | 0 |
6d47e5a7fe96333e0825c9a2cbec11aa | a5f4367a94caed81da298f5b009d8ed1 | Simply returns the reported skill level. | namespace WildBlueIndustries
string GetCheckSkill(); | 0 |
e9b8501d22250fad17a37a302ab1a825 | 253df07bbc7b907f9acac8fb71c532b2 | 是否合法访问,不合法访问抛出异常 | public class AvailableUtil
public static void mustAvailable(Object object) {
if (!isAvailable(object)) {
throw new NotAvailableException();
}
} | 1 |
80d7041fbe46d2a994d858faef4d29b5 | 7a9a4987d4bcdcb55732c8ba0e9ac0bd | 根据厨师id获取厨师的信息 | class CrowdFundingDishModel extends RYPDModel
public function getCookidById($id)
{
$sql=' SELECT
cookid
FROM
cook_dish
WHERE
id = :id
';
$key=Tool::getPreArr($sql,
array(
':id'=>$id
)
);
return $this->one($... | 0 |
b040342c3ce35a272d7ef7c854f26f80 | 779182554fff59fb2f6faa8498409b9a | Sets the visibility of the pseudo adiabats. | namespace SmartAdServer.Unity.Library.UI
public abstract class AdView
public void SetVisible(bool visible)
{
GetNativeAdView ().SetVisible (visible);
} | 0 |
cf268229f99c0b19dcf3ca9aa9d0719b | 91c0879fef8c85eada774e835ef59035 | To verify whether the given communicator is a rectangular communicator.
Copied from mpid/bgltorus5/src/coll/mpid_collective.c:MPIDI_BGLTS_findRect().
The reason for not using using comm->bglts.rectcomm is NOT valid: was not sure
whether every communicator tried to construct the comm->bglts.rectcomm.
Can go further: giv... | {
return ((width == height) && (width > 1));
} | 0 |
86349ffd5fc764487d4acdd3956165a5 | 854e05d4474fc33b0dca987c58d632ce | Tests bijective coordinate conversion. | rsun = 1*u.m
D0 = 1*u.km
L0 = 1*u.deg
observer_1 = HeliographicStonyhurst(lat=0*u.deg, lon=0*u.deg, radius=D0)
observer_2 = HeliographicStonyhurst(lat=0*u.deg, lon=L0, radius=D0)
hcc_frame = Heliocentric(observer=observer_1)
hpc_frame = Helioprojective(observer=observer_2)
hcccoord = Sky... | 1 |
69af7668670d426c760c1cc046592849 | 8bdd16b74e6ea2dfeaf6b2cb8da25067 | 调整字体大小,使其适应文本框的宽度 | public class UIChatPanel : TTUIPage
Vector2 Adapt(Text _text, RectTransform _rect)
{
float limitWidth = scrollRect.content.rect.width * 0.6f;
float width = _text.preferredWidth + baseRectText.offsetMin.x * 2;
float height = baseRectTextBg.sizeDelta.y;
int lines = (int)(width / limitW... | 0 |
b25beccae55c97eef824940159240ee4 | 790c4a310b00d28ffb57d675af1f7d66 | Returns an array of all of the airport codes in the route. | export class Aircraft
getAirportCodes(distinctOnly?: boolean) : string[]
{
distinctOnly = !!distinctOnly;
var result = [];
var addAirportCode = function(code) {
if(code && (!distinctOnly || VRS.arrayHelper.indexOf(result, code) === -1)) {
r... | 1 |
55e83c419544da80eb7dab5e73623e0c | ad8b8cfaaae467d918145dc7f779cfe5 | Formata uma data de banco em data para o usuário | function data_bd($data_br) {
return implode('-', array_reverse(explode('/', $data_br)));
} | 1 |
b26b92cc540d039cfaebfbac85277d9c | 7940a7213df13a0e65d66b47fd52af57 | 不当机更新leader,auto模式。一个leader和一个follower,测试changeleader的结果 | self.start_client(self.leader)
metadata_path = '{}/metadata.txt'.format(self.testpath)
name = 'tname{}'.format(time.time())
infoLogger.info(name)
m = utils.gen_table_metadata(
'"{}"'.format(name), None, 144000, 2,
('table_partition', '"{}"'.format(self.lea... | 1 |
d1d82d3db8e87bce98ebce29f9334812 | 8281a9edeaec168fe82cfe5869d97586 | 火车车厢重排 | public class Solution
public boolean carPooling(int[][] trips, int capacity) {
int[] nums = new int[1001];
for(int[] trip : trips){
nums[trip[1]] += trip[0];
nums[trip[2]] -= trip[0];
}
for(int i = 1; i < nums.length; i++){
nums[i] += nums[i-1];
... | 0 |
116dcda07d41ec57bf7e9a98bc7b31c8 | 290867b665e7dfcb27f5ba259d9046a6 | Tell if the field is disabled. | class FormField extends mix().with(ViewMixin)
isDisabled() {
return this._disabled
} | 1 |
4be21685b5697f5b4178fac59cd407de | c154b681cf403b5404bec79ff09e8b92 | 取得Controller和Service的集合 | Set<Class<?>> classSet = new HashSet<Class<?>>();
classSet.addAll(getControllerClass());
classSet.addAll(getServiceClass());
classSet.addAll(getProxyClass());
return classSet;
} | 1 |
a35b5391f48ca3ce5dfcb5aeac346787 | 299733669bc4d211b9b4b598b62cf6b6 | Appends messages from another bundle to the current message bundle.
If message has the same messageID that already exists in the
current bundle, it will be overwritten. | public void mergeFrom(Input input, T message) throws IOException; | 1 |
bdfb118ad21310fa6a3edd5fa0766b1f | 163ba6944db712c908de0327947dac99 | ritorna il numero di Celle che compongono il blocco | class CellBlockStructure(NxStructure):
def num_cells(self):
return len(self.struct) | 1 |
c33a935ef0baf896b9d0cd800d036de5 | 4db914f6890d1739b6a1abae2764fa81 | 文字超出标签宽度时,左右流动处理 | class Tick
public handleOverflow(xy: PositionObject): void {
const tick = this,
axis = this.axis,
labelOptions = axis.options.labels,
pxPos = xy.x,
chartWidth = axis.chart.chartWidth,
spacing = axis.chart.spacing,
leftBound = pick(
... | 1 |
b8ec8cfaf1c4911ac309ba81167970f6 | d0ff3460b6079b4efc56a940838c7a6d | 得到指定类的指定成员方法 ,兼容该成员在父类中的情况 | public class ReflectUtils
public static Method getMethod(Class clazz, String methodName, final Class[] classes) throws Exception {
Method method;
try {
method = clazz.getDeclaredMethod(methodName, classes);
} catch (NoSuchMethodException e) {
if (clazz.getSuperclass() == ... | 1 |
69846628970c22bb23e2acaf66248c47 | 8df28b3dfd17c2f4121571694ef1f366 | <code>false</code> if the text box was not found, or the box | {
long sx,sy,lnheight;
long width,height;
struct GuiBoxOption *gboptn;
sx = gbox->pos_x + 8;
sy = gbox->pos_y + 8;
gboptn = gbox->optn_list;
lnheight = LbTextLineHeight()*((long)pixel_size) + 2;
while (gboptn->label[0] != '!')
{
height = LbTextStringHeight(gboptn->label)*((long)pixel_size);
if... | 1 |
d2594ed13e9dd016bdbbd556914fd81d | 8c35155115e5029495c1645687718042 | prints result in the format needed for output.txt to stdout for testing | {
fout << std::left << std::setw(50)<< testNumber << std::setw(20) <<
result.c_str() << std::endl << std::right;
} | 1 |
f1456e35608a5f15b041b8958b1ac861 | af897abeae00b96c0c07ecee85f2c881 | Get data stored in last node of list. | class LinkedList:
def get_last(self):
if self.length == 0:
print("The list is empty")
else:
current_node = self.head
while current_node.next is not None:
current_node = current_node.next
return current_node.data | 1 |
d254bc302cf9fe0ed3e0b73095585887 | a5e9b4ec9295f50c82043c32f4374aa1 | Calculate the average phase synchrony of all electrode pairs.
Input: | class LFPBandV1(dj.Computed):
def compute_signal_phase(
self, electrode_list: list[int] = None, **kwargs
) -> pd.DataFrame:
if electrode_list is None:
electrode_list = []
analytic_signal_df = self.compute_analytic_signal(
electrode_list, **kwargs
)
ret... | 0 |
36050ac7de5d861ef381f02a4723c346 | 0294645326746f39f89f3a943ca7fea0 | Subset of the examples containing only the examples where attribute at
index has value s | data = data[:]
finalList = []
if not data:
return finalList
else:
record = data.pop()
if record[attr] == value:
finalList.append(record)
finalList.extend(getExamples(data, attr, value))
return finalList
else:
finalList.exten... | 1 |
1184e861927504d2aceeeb78e3944e66 | 9486a6a390c1b412cc06db9c70cfbdb8 | This method saves unauthenticated requests so we can redirect
the user to the page they
were trying to access once they’re logged in | class ApplicationController
def store_location
if (!request.fullpath.include?("/users/sign_in") &&
!request.fullpath.include?("/users/sign_up") &&
request.fullpath !~ Regexp.new("\\A/users/password.*\\z") && !request.xhr?)
session[:previous_url] = request.fullpath
en... | 1 |
6b58161f04b05e7bf9d2627cbb31bf34 | b26503d47753b2797c12afe63f61c78d | Возвращает объект клавиатуры для телеграма | bt_rub = KeyboardButton('RUB')
bt_usd = KeyboardButton('USD')
bt_eur = KeyboardButton('EUR')
kb = ReplyKeyboardMarkup(resize_keyboard=True)
kb.add(bt_rub, bt_usd, bt_eur)
return kb | 1 |
6894bcd5433c773b08fe38a74806f230 | 7aeea99e173a593a057bbefde3617587 | The interface general query timer has expired. | static void
gmph_process_group_query_packet (gmph_intf *intf, gmp_version ver,
gmp_query_packet *pkt, gmph_group *group)
{
if (ver > intf->hintf_ver)
return;
if (gmpx_timer_running(group->hgroup_query_timer) &&
gmp_addr_list_empty(&group->hgroup_query_list) &&
gmpx_timer_time_remaining(group->hgroup_que... | 0 |
158282bfc09c5c456b82865b192b17a4 | 56f685898cf39afbac4d741baaadb3f6 | DataFile must already be in it's own container | public class m3Files1 implements AppFileComponent
@Override
public void importData(AppDataComponent data, String filePath) throws IOException {
} | 0 |
eb4a2efad419b0555271d3c51467680a | e1770d31f63886526b9d50d7abaec747 | ナビゲーションバーの高さを考慮してスクロール位置をずらす | function scrollMove(event){
let windowToTop = window.innerHeight;
let length = $(window).scrollTop();
if(length !== 0){
$("#myNavbar").css("background-color", "#f8f8f8");
if(length > 400){
$("#topButton").css("opacity", "0.4").css("visibility", "visible");
} else{
... | 0 |
5b5057d62060840eef4e3a989e755a19 | b7bad0104a981f2ec6a63efe41e47eb6 | always send this entity to players (for now...) | if (doBlind()) {
Entity eTarget = game.getEntity(nEntityID);
Vector vPlayers = game.getPlayersVector();
Vector vCanSee = new Vector();
vCanSee.addElement(eTarget.getOwner());
Vector vEntities = game.getEntitiesVector();
for (int x = 0; x < ... | 0 |
39fe3ce37f862ab3ddd08a101d20fb04 | d76b50f8fb5fc66515d00ddfac964865 | Clears the suggestion text from the terminal but does not clear temporary variables | class searchSuggestResponse extends \framework\protocolbuffers\Message
public function clearSuggest()
{
return $this->clear(self::suggest);
} | 0 |
fa6be735972c815a4ce4c9769c19996e | 2464e1caffcadaa38993cf336bcaa36d | 判断是否全字以及全部是幺九 | class Handel(HandleManger):
def isQuanYaojiu(self):
if self.isSevenPair():
return False
for i in self.pongTiles:
num = getTilePoints(i)
if num not in [1, 9]:
return False
for i in self.kongTiles:
num = getTilePoints(i)
i... | 1 |
0d96f41d49c11dd0988e35a89bc465bf | 24c27d3322fa39bc5424b883c7a250aa | 隐藏正在显示的活动指示器 | if DEBUG > 1 then
printInfo("device.hideActivityIndicator()")
end
if device.platform == "android" then
luaj.callStaticMethod("org/cocos2dx/util/PSNative", "hideActivityIndicator", {}, "()V");
elseif device.platform == "ios" then
cc.Native:hideActivityIndicator()
end
end | 1 |
f16204d266643c1d29eb3cc792a7cd7a | 32f89a39b22bd7b8c661a8cab8326bfe | Get UTC time in seconds since 2009. If parameters year, month, day, hour, minutes and seconds are UTC time, parameter local must be set to 0. If parameters year, month, day, hour, minutes and seconds are local time, parameter local must be set to 1. | export class As3Date
public getUTCSeconds():number
{
return this._date.getUTCSeconds();
} | 0 |
21faebca8aec3d2a9925fe0161e0299c | 6e473add3f292a5c4ee520ea6b7bf316 | Get ReturnDirectFlightsOnly value | class DisplayRequestConfiguration extends AbstractStructBase
public function getReturnDirectFlightsOnly()
{
return $this->ReturnDirectFlightsOnly;
} | 1 |
4744162e78baeb33e3bb77c3447059e4 | 58c0481214727165080182e4719ba0b1 | Shows popuplist with strings loaded from resources | public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Resources res = getResources();
String[] names = res.getStringArray(R.array.views_available);
this.setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, names));
} | 1 |
b1e7116eacff986487060221182d7935 | 69aa2728979e788826851177f476c008 | 将三角形顶点坐标 和 颜色 加入数组中 | [UpdateInGroup(typeof(InitializationSystemGroup))]
public class CellSystem : JobComponentSystem
void AddTriangle(Vector3 v1, Color bottomColor, Vector3 v2, Color leftColor, Vector3 v3, Color rightColor, ref DynamicBuffer<ColorBuffer> colorBuffer, ref DynamicBuffer<VertexBuffer> vertexBuffer)
{
color... | 1 |
143cbdd6313d78295ab3bff6e03a499d | 1fdc92cc4cc03b5dcc6058a3d46e4627 | Convenient method to show GRF position's trajectory. | class FGTrajectory(BasicTrajectory):
def position(self, time): | 0 |
3def047fb536da56a43e49f3f6f27c49 | c0e6c2acfe3dda9247c9e49f39502962 | 将发送文本框中的内容以HEX方式显示 | print(str(sys._getframe().f_lineno) + "=============")
if self.textEditNetSend.document().isEmpty():
pass
else:
hexMsg = ascii_to_hex(self.textEditNetSend.toPlainText())
self.textEditNetSend.clear()
self.textEditNetSend.setText(hexMsg)
try:... | 1 |
149e473c3cfc71576b045a1b112edb5b | a3780b6c19ffd85f1dd1fc19e925c085 | Delete all likes of a user without deleting also his favorites
CodesReturned.PROBLEMCONNECTIONDATABASE if the database isn't
running | class Likes
public function delete_all_user(int $userID) : bool {
return CS::get()->db->deleteEntry(
$this::LIKES_TABLE,
"ID_personne = ?",
array($userID)
);
} | 1 |
35567579f7d6c8ad9586093097a6a48e | a7d6106c9b420d1c1d1b663763e7f4e9 | Adds a given city to the start and end of each route | public class SalesmanService
public void addStartingCityToStartAndEndOfRoutes(List<List<Integer>> routes, Integer startingCityId) {
for (int i = 0; i < routes.size(); i++) {
List<Integer> tempList = routes.get(i);
tempList.add(0, startingCityId);
tempList.add(startingCityId);
routes.set(i, tempList);
}
... | 1 |
5a5aaee44d8fa534a67efe009a39f914 | c90b27f99023f7deed626cf9f4cc09b1 | Move the player forward according to thrust value.
thrust: the speed that will be added to the player. | this.position.x += this.thrust.x * Time.dt;
this.position.y += this.thrust.y * Time.dt;
this.setPosition(this.position);
this.thrust.x -= this.thrust.x
? Math.sign(this.thrust.x) * this.decelerationSpeed * Time.dt
: 0;
this.thrust.y -= this.thrust.y
? Math.sign(this.thrust.y) * thi... | 1 |
3d513da468123a4b550ff69c0021d91f | 7f487923ff578c6ee092c05b5c02af84 | Set the wake up interval for the motion sense thread.
It is set to the highest frequency one of the sensors need to be polled at. | const struct bmi160_dev *dev)
{
int8_t rslt;
uint8_t data = 0;
uint8_t temp = 0;
uint8_t data_array[2] = { 0 };
uint8_t dur;
rslt = bmi160_get_regs(BMI160_INT_MOTION_0_ADDR, &data, 1, dev);
if (rslt == BMI160_OK)
{
dur = (uint8_t)any_motion_... | 0 |
1a048b31a1fa42f09dfbe04d42968fbd | ec9a628154cd7f66719a0de69554e024 | Gets the parameters for the WebServer group. | {
security_group_load_balancer_id: network.security_group!(:load_balancer).group_id,
security_group_web_server_id: network.security_group!(:web_server).group_id,
subnet_ids: network.subnets!.map(&:subnet_id),
vault_bucket_name: vault(:web_server).bucket!.bucket_name,
iam_in... | 1 |
f1cc6005baff33cd48dfeac5343da4ff | d3e2ec94e0b0abd4a759dfa8198cf73a | Checks if an images feature is enabled. | @Named
@Scope(org.springframework.web.context.WebApplicationContext.SCOPE_REQUEST)
@Component
public class FeatureReportBean
public boolean isImagesIncluded() {
return imagesIncluded;
} | 1 |
e48e89442ab9a208d7c7690f162b1a86 | ccc8b24cb50970e4cc19d5e5f6ede1fa | Allocate the datastructures of a mac_hashset and initialise the parameters. | {
MyHashSet *re = (MyHashSet *)malloc(sizeof(MyHashSet));
re->size = 0;
re->loadFactor = DEFAULT_LOAD_FACTOR;
re->initialCapacity = DEFAULT_INITIAL_CAPACITY;
re->dataList = (MyList **) malloc(sizeof(MyList*) * re->initialCapacity);
re->hashCode = hashCode;
re->equal = equal;
for (int i =... | 1 |
7c310e6f4f1ebdd6f93055c1fdbd7aff | 921ded144f34aa19475e16b74f020873 | Обработка команды Списания средств. | message = _cut_command(update.message.text)
context.user_data['author'] = update.effective_user.first_name
response = 'Трата была добавлена'
try:
expenses.add_expense(message, context)
except MessageException as exc:
logger.error(exc)
response = str(exc)
except Exception ... | 0 |
01fb7e321c3070f003854edae6eb4d3b | 640f81f84f13df0ef849c1a4899aed9f | Registers the linter for pylint. | return dict(
name='pylint',
task_dep=[
'submod',
'version',
],
actions=[
f'pylint -j{JOBS} --rcfile {PREDIR}/pylint.rc {SOTADIR} || true',
]
) | 1 |
384c4d10134d5f66bf8f78b1731237b0 | 92f1387f86ae955a4d91794b1678abac | Gives you the integral data for this interpretation (check with
isIntegral() first). | IInterRep getInterRep(); | 0 |
d0d07b2fe9340ded49a2b5fc704a068c | 9fe4bd05c1b9b669e8ef4574a267c543 | ============================================================
<T>根据唯一编号搜索显示对象。</T>
============================================================ | IDataSet responseData = new DataSet();
try {
FBLTNBRDMGMT001 fu = (FBLTNBRDMGMT001) lookupFunctionUnit(FBLTNBRDMGMT001.class);
responseData = fu.fSearchBltnBrdByPk(requestData, onlineCtx);
}
catch (BizRuntimeException be) {
throw be;
}
catch (Exception e) {
throw new BizRuntimeException("P... | 1 |
fa526273674d9b6846346bacd79ea719 | dad1ddabffb7a076a6c109116f2705fb | Gerando nome do arquivo no padrão 00100001.jpg | {
$imagem_info = pathinfo($dir.$imagem['name']);
$imagem_nome = $this->trata_nome($imagem_info['filename']).'.'.$imagem_info['extension'];
debug($imagem_nome);
$conta = 2;
while (file_exists($dir.$imagem_nome)) {
$imagem_nome = $this->trata_nome($imagem_info['filename']).'-'.$conta;
$imagem_no... | 0 |
8a5039599913dc5af4af4619149b1994 | 1d1f7cdcde30125dac2d6e255a313908 | 是否存在开放主页 | public class APIRequestServers
public static MCResult existOpenPage(Context context, String groupId)
throws Exception {
MCResult mcResult = null;
String url = URLProperties.GROUP_JSON;
String params = new LeaguerPermissionInfoParams(context,
"existOpenPage", groupId).getParams();
L.i(TAG, "existOpenPage ... | 1 |
9891ee810f53b6bb33eb3ca5c5c77a0d | 0390c8b1df9fe06e45b5f12670e0cbea | Remove event subscriber | abstract class SubscribeManager extends \Enlight_Event_Subscriber
public function removeListener(\Enlight_Event_Handler $handler)
{
$this->listeners = array_diff($this->listeners, [$handler]);
return $this;
} | 1 |
73e06b92e9ae2c8e57a9db28e3a364bc | cc12328879408ec5744a76fb3a9973e2 | 如果该Entry是版本号控制的Entry | {
if (this.ItemKey is { } itemKey && itemKey == entry.ItemKey)
{
return true;
}
return false;
} | 0 |
82a01bb27b8d06a802c52bca76904558 | c00b04e6545eac7808015060c190c778 | Searches the repository for a specific vendor | public function findFirstByID(int $externalvendorID); | 1 |
d36f41a574d85ba70214c062ef0d8dfb | ea613fbaf60f0c3f3bd3d772d82cf6b9 | !
\brief Sequential internal evalution function.
\ingroup internal
\rst
Description
Evaluates all strings that need to be evaluated using one processor.
\endrst | void load_eval_impl()
{
{
std::ifstream ifsKK(path_combine((string)Options["EvalDir"], KK_BIN), std::ios::binary);
if (ifsKK) ifsKK.read(reinterpret_cast<char*>(kk), sizeof(kk));
else goto Error;
std::ifstream ifsKKP(path_combine((string)Options["EvalDir"], KKP_BIN), std::ios::binary);
if (ifsKKP) ifs... | 0 |
7b8a180e5a2a00c6cd4116549d56af2b | 147689c31ac599aaaa4628578641fe80 | The GET action for adding a quest | public String createQuest(QuestForm questform) {
String title = questform.getTitle();
String description = questform.getDescription();
questService.createQuest(title, description);
return "redirect:/quests/";
} | 0 |
91f152850f0005649026bdc7fa5befc7 | 325d3e6641683d794f5bd78cfff74221 | Parses the IPv6 information from the output of `ip addr show <device>` | dic = {}
parsed_data = [i for i in parsed_data if not i.startswith('lo')]
for lines in parsed_data:
line_list = lines.split('\n')
devname = line_list[0].split()[0]
macaddr = line_list[0].split()[-1]
ipaddr = line_list[1].split()[1].split(':')[1]
break
dic['ip'] = ... | 0 |
6a9f73313efce8274c490cb2ebcd091b | ae6ef6d78a888864500aedada80b1e36 | Split dataset into sub-datasets, except the current column with index passed in | retdataset = []
retyset = []
for i, row in enumerate(x):
if (row[axis] == value):
if axis == 0:
reducerow = row[axis + 1:]
elif axis == len(x[0]) - 1:
reducerow = row[:axis]
else:
reducerow = np.stack((row[:axis], ro... | 1 |
a87c8d16f2a2a7306e8d9f66e30608f3 | dcf95fa30def36805132749ae6e2c054 | Implements the "equal" operator.
We accept either a like sized processed_data object, a like sized
numpy array or a scalar value. The comparison operators always do a
element-by-element comparison and return the results in a sample mask. | class CArray(_CArrayInterface):
def __eq__(self, other):
if is_scalar(other) or is_bool(other):
return self.__class__(self._data.__eq__(other))
elif isinstance(other, CArray):
if self.isdense is True and other.issparse is True:
other = other.todense()
... | 1 |
6d7b663e376ffc03b17a7034cfbbd741 | ca7b91cc77a786acbe003e975dd1a42e | 主播{@link TRTCCloudDef#TRTCRoleAnchor}离开了当前视频房间
主播离开房间,要释放相关资源。
1. 释放主画面、辅路画面
2. 如果您有混流的需求,还需要重新发起混流,保证混流的布局是您所期待的。 | void onAudienceExit(TRTCKaraokeRoomDef.UserInfo userInfo); | 0 |
ea5203e621e2097436ea25e7ddc01365 | 4ba6be44435992db2ae4a82e39b95fba | Does a prefix,depth-first traversal through an Exceptions InnerException.
Includes special treatment for AggregateException which has many children. | namespace Axinom.Toolkit
public static class ErrorReport
private static IEnumerable<Exception> FlattenException(Exception ex)
{
var currentException = ex;
do
{
yield return currentException;
currentException = currentException.InnerException;
} while (currentException != null);
} | 0 |
e8a413a2a12235abf97fd1ed6fc1a7e8 | 6c58cc8511d01b10ced60bfe3c33e588 | Represents a AES_GCM crypto provider. | class CryptoMsg(object):
def __init__(self, aes_cbc_key=b'aes_cbc_key', aes_cbc_iv=None):
self.aes_cbc_key = aes_cbc_key
if aes_cbc_iv is None:
self.aes_cbc_iv = self.aes_cbc_key
else:
self.aes_cbc_iv = aes_cbc_iv | 0 |
aeecf813f6bff09a9546dbe7f4209c40 | 4c2f31fe95c8166970ed0314501144ce | Ensure the response returns an X-Throttle field with status and next attributes
set properly. | class CourseListViewTestCase(CourseApiTestViewMixin, SharedModuleStoreTestCase):
def test_throttle_rate_2(self, user_scope, throws_exception, expected_rate):
self.assert_throttle_configured_correctly(user_scope, throws_exception, expected_rate) | 0 |
b05e19cb2a2bc083218790b65521d49d | 1bbd1ea27c3874a9ebdc1bb74703cf1f | 由主线程调用,初始化一个子线程,并且让子线程开始运行event_loop | EventLoop* EventLoopThread::startLoop() {
assert(!thread_.started());
thread_.start();
{
MutexLockGuard lock(mutex_);
while(loop_ == nullptr) {
cond_.wait();
}
}
return loop_;
} | 1 |
7310bda4b5b4f2367bffa2fe636d5263 | b467942a7ca6bef8abf1d196eba0b44d | Test for addition resource | class ResourceTest extends TestCase
public function testExample()
{
$this->assertTrue(true);
} | 0 |
e7e565b3c22314280fe6abb9c8157213 | 968d59efa4f5ab151fb082656b068c30 | 根据RFPId绑定回复信息 | {
RFPBO rfpBO = new RFPBOImpl();
rfpList = rfpBO.GetEntityList("RFPId", RFPId,"RFPDate");
dvRFPInfo.DataSource = rfpList;
dvRFPInfo.DataBind();
} | 1 |
ed67ef48b7fb5827cb433289585010d6 | 506cdf033e621fd072140257d81bbc2b | https://stackoverflow.com/a/4322940 | def chunks(iterator: Iterator[T], n: int) -> Iterator[Iterator[T]]:
for first in iterator:
rest_of_chunk = itertools.islice(iterator, 0, n - 1)
yield itertools.chain([first], rest_of_chunk) | 1 |
b0015edd990e746010c4c8869784a9b7 | d7d6df9a7f5f0634c02512ec91b033d7 | Получить разницу высот между клеткои и соседом в определенном направлении | namespace h3
public class BaseCellData
public static int _getBaseCellNeighbor(int baseCell, Direction dir) {
return baseCellNeighbors[baseCell][(int) dir];
} | 0 |
2ef78ec5b1bd99b0fed93a32461444c4 | 0ed2db2caf57e1b64dd57c945be2981a | Função que retorna um dicionário com elementos DOM necessários e outras coisas | var info = {
"NOME" : "casoJS",
"X" : sonico.baseX,
"Y" : sonico.baseY,
"LX" : sizeX,
"LY" : sizeY,
"FOCOS" : [],
"EXTINTORES" : [],
"PAREDES" : [],
"BLOQUEIOS" : [],
"ESCADAS" : []
}
for (var i = 0; i < sizeX; i++) {
for (var j = 0; j < sizeY; j++) {
if (matrix[i][j] == 'FOGO') {
... | 0 |
c099d228f0d8181ebbeecab4cb25c03d | 3998307dc0c256aa15372bc178ee3d90 | 前のレコードを取得します。 | {
var rs = GetRecordset(key);
if (rs.Count == 0)
{
return null;
}
var e = rs.GetEnumerator();
var ret = e.MoveNext();
return (RecordBase)e.Current;
} | 0 |
866a116a4ab7b35a2bec18bfd7f968fa | f766b15af6823856189bcf4f3bee9a5d | <summary>
Obtiene una cadena con el listado de las materias que
tiene una tesis determinada.
<param name="ius">el IUS de la tesis de la que se buscarán las materias.</param>
<returns> Las materias a las que pertenece una tesis determinada.</returns> | {
List<string> listaMaterias = new List<string>();
SqlConnection connection = new SqlConnection(connectionString);
SqlCommand cmd;
SqlDataReader dataReader;
string miQry;
try
{
connection.Open();
... | 1 |
99916b14b04fd478e855a9df5cf9d9d8 | 443857c6b072fc23777d199c56f5849b | This is a convenience method that provides direct access to the value of the record's Category_.LastEditBy field. | namespace FPCEstimate.Business
public class BaseEstLineAdjRecord : PrimaryKeyRecord
public void SetLastEditByFieldValue(string val)
{
ColumnValue cv = new ColumnValue(val);
this.SetValue(cv, TableUtils.LastEditByColumn);
} | 0 |
249b5cc91c06defedd58824c3062bed6 | 6ec9021ac1d9df52a071abc59cae8c83 | 获取所有身份分类ID | List<Integer> getAllCaIds(); | 1 |
d33ec96590e409299ef56af3a46741c7 | be4c6927695bbd104f7c01eb04df4510 | Método: Cria todos os "Group Box" | self.groupInput = QtGui.QGroupBox()
self.groupInput.setTitle(u'')
gridup = QtGui.QGridLayout()
i = 0
for className in self.classDict:
classIndex = i
for name in self.classDict[className]:
width = self.widthDict[name]
qLabe... | 1 |
2d3be0dea772082f1db40b9edb53865d | 179f3d9968d9b6f6178e8e907d5d78c0 | Routine added by AK to write out the number of B&B node and CPU time. | {
#ifdef CONFIG_HOTPLUG_CPU
pr_cont("onoff: %ld/%ld:%ld/%ld %d,%d:%d,%d %lu:%lu (HZ=%d) ",
n_online_successes, n_online_attempts,
n_offline_successes, n_offline_attempts,
min_online, max_online,
min_offline, max_offline,
sum_online, sum_offline, HZ);
#endif
} | 0 |
0e4aa0abf1c0f096f035188a25c1f9c5 | fd1af0a1169657a621f0bef198cb06cf | Scans and returns all valid drive items. | namespace WpfTreeView.Directory
class DirectoryStructure
public static List<DirectoryItem> GetLogicalDrives()
{
return System.IO.Directory.GetLogicalDrives()
.Select(drive => new DirectoryItem{FullPath = drive, Type = DirectoryItemType.Drive})
.ToList();
} | 1 |
5e9304ed004aea082970bb7c84b4fe66 | c45af377c655bb0c1af0d3553d21e8f1 | Verify if indexes are cleared after node stop
Old value must be erased from indexes | on_neo_started_without_reindex(neo_instance)
Neo4j::Transaction.run do
Neo4j.all_nodes do |node|
node.update_index if node.respond_to?(:update_index)
end
end
end | 0 |
36acf8cc44131e94361f3f7f69d705ea | 3d33a5a596ef082b92ac1105436ffa96 | 计算局部均值和标准差 | def calculate_avg_var(values):
avg = np.average(values)
var =np.average((values-avg)**2)
return (avg, var) | 0 |
754333412afbc35f69433e159a512fed | 0debae54f1b6ff8cba0398828735ff09 | Desenha uma casa vazia | int x = i * TILE_SIZE;
int y = j * TILE_SIZE;
GreenfootImage image = getBackground();
int lgrayVariation = LIGHT_GRAY + Greenfoot.getRandomNumber(GRAY_VARIATION);
image.setColor(new Color(lgrayVariation, lgrayVariation, lgrayVariation));
image.fillRect(x, y, TILE_SIZE, TI... | 1 |
bd1f685ec4eaff455dbc1456ebf0d4c1 | e2c4904773a124d8252b3d4c7dd28b67 | Function for shift -> enables a alternate set of input from the view | namespace GalacticChaos.view
public sealed class UserActionProcessor
private void ShiftClickHelper(bool val)
{
mSelectionManager.SetPlanetSelection(val);
AggressiveMove = val;
} | 1 |
37adc8a20e54177ce7d76cbff359fe15 | d376334dd69e997e3f4ed50316d0b285 | 広告クリック数を記録 | $data ['adid'] = Input::get ( 'adid' );
if (empty ( $data ['adid'] ) || strpos ( $data ['adid'], '_' ) === false) {
return false;
}
$data ['cid'] = Input::get ( 'cid' );
$data ['idfa'] = Input::has ( 'idfa' ) ? Input::get ( 'idfa' ) : 0;
$data ['androidid1'] = Input::has ( 'androidid1' ) ? Input::get ( '... | 1 |
6aa7a10cb5516b633f069a1818ef0f2e | 54ff9034a605db51bfc5a4578f93655a | Analyze an RDF distribution under given IRI. | if (!iri) {
throw new ReferenceError(`Invalid id. id is '${iri}'`);
}
if (!graph) {
throw new ReferenceError(`Invalid graph. graph is '${graph}'`);
}
this._iri = iri;
this._graph = graph;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.