query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7d3cae4925546fcbfea3a3392609a36e | b79fc50ce8a15a587344ab78f64df016 | Anneal temperature using exponential annealing schedule. Consider kT to be a single variable (i.e. ignore Boltzmann constant) | if config[prefix + "t_annealing"]:
temperature_schedule = _schedule_exponential_decay(
step,
decay_steps=config[prefix + "t_annealing_steps"],
kickin_steps=config[prefix + "t_annealing_kickin_steps"],
init_val=config[prefix + "t_init"],
annealing_r... | 1 |
56092b9ac80f8761602cdef78b6aeadd | 39c22546da31bf4a1b2269c1ca2d08ce | Llena la tabla de componentes segun el tipo de componente. | {
if(section == "Installed")
{ createInstalledTable(); }
else
{
var lastSystem = getLastSystem();
var oneComponent = lastSystem[section][0];
var imgPath = "../img/" + section + ".png";
var stringFinal = '<div class="container">' +
'<div class="row">' +
'<div class="col-sm-2">' +
... | 1 |
aff622ed8917aa581a64575073342592 | beacb6eb185181f87ea162b9da649956 | Создание словаря страна - код страны | class mapDataMaker():
def read_countries(self):
countries = {}
with open(self.countryfile, 'r') as inf:
reader = csv.reader(inf, delimiter=',')
next(reader)
for line in reader:
countries.update({line[3]: line})
return countries | 0 |
de151faaf5ba99d86dfe1246d3e1a23d | 88b704c2c253ca55973fb68da5ffa673 | Returns user first and last name as string. user argument can be User.id or User object.
If it is id it will query database for user. | class U2uLibrary
function _getName($id) {
$id = intval($id);
$objUser = \FWUser::getFWUserObject()->objUser->getUser($id);
return array('username' => $objUser->getUsername());
} | 0 |
38492dc23b85255c58db63643390a5a9 | 51ce40461b2d37175c1a64d8262b5741 | Extract data relevant to the calculation of a power plant's MCOE.
Given a PUDL utility_id and a PUDL plant_id, return several data series
relevant to the calculation of the plant's marginal cost of electricity
(MCOE). Both utility_id and plant_id are required because the same plants
are reported by multiple FERC respon... | def get_unmapped_plants_eia(pudl_engine):
plants_utils_eia = (
pd.read_sql("""SELECT DISTINCT plant_id_eia, utility_id_eia
FROM plants_eia860;""", pudl_engine).
dropna().
astype({"plant_id_eia": int,
"utility_id_eia": int}).
drop_duplicates().
... | 0 |
68d84c56f72eff82f05a84042d3df70f | bac9fffabbee857a761cc094d5aec9a1 | The accumulated number of LNs that were not found in the tree anymore
(deleted). | @JsonIgnoreProperties({"numDNF", "numFound", "summary"})
public class GeocachingTour
public int getNumDNF(){
return (int) _tourCaches.stream().filter(gc -> gc.getVisit() == FoundEnumType.DNF).count();
} | 0 |
4100cbfcf81827fb1101499b0ff53c56 | c7e6fd95dd77f803d8783ac6d8ca9b8e | Execute a pipelined write of a marker value into a buffer | namespace Pal
namespace Gfx6
void ComputeCmdBuffer::CmdUpdateBusAddressableMemoryMarker(
const IGpuMemory& dstGpuMemory,
gpusize offset,
uint32 value)
{
const GpuMemory* pGpuMemory = static_cast<const GpuMemory*>(&dstGpuMemory);
WriteDataInfo writeData = {};
writeData.ds... | 1 |
e17f6a479cc3f3e9df03a937b282fe18 | 137901fea40248adb2c242d4ba76ffd6 | 添加券的种类 | $role_id = $this->getRoleId();
$permission_check = $this->is_authorized(CONTROLLER_NAME.'/'.ACTION_NAME, $role_id);
if (true !== $permission_check) {
$this->error('Permission Denied!', U('Coupon/couponCategory'));
}
if (IS_POST) {
$post = I('post.');
... | 1 |
f05f28edb3b69178ee3030b70c81e096 | f62d9c1d337de37fb654fd41dda24726 | 根据memberId查询单独的app信息 | public MemberVO getAppUserInfo(final Integer id) throws ServiceException; | 1 |
9b9871aab1d87bfcc6731460353966be | eec29bd1dd3c7633ef625e00d9b0a0b0 | @brief Get the index of the current item. | int32_t Input::getCurrentIndex() {
return static_cast<int32_t>(m_current_index);
} | 1 |
d7962b549ca3e307474ebcba80da7bc5 | 7d2bbecab485292ff18befc21efc9bb8 | Prompt the user to connect his Metamask account to the app. | if (typeof window.ethereum === "undefined") {
alert("Looks like you need a Dapp browser to get started.");
alert("Consider installing MetaMask!");
} else {
ethereum.enable()
.catch(function (reason) {
if (reason === "User rejected provider access") {
} else {
alert("There was an issue signing you in... | 1 |
5299999cab154cb23e2d7ad517c22948 | 424ffce7491029b836003de601880ad6 | Remove a host from the ssh known_hosts file
Removes the entry for the given host from the known_hosts file using
`ssh-keygen -R`
.. :quickref: SSH Agent; remove known hosts entry
**Example Request**:
.. sourcecode:: http
DELETE /api/v2/known_hosts/compute1 HTTP/1.1
**Example Response**:
.. sourcecode:: http
HTTP/1.1 20... | def delete_known_host(host):
try:
subprocess.check_call(['ssh-keygen', '-R', host])
return jsonify('Success')
except subprocess.CalledProcessError:
err_msg = 'Unable to remove host %s from known_hosts' % host
LOG.warning(err_msg)
abort(500, err_msg) | 1 |
f0697e3cc9144eb8ec2889bac57e3cab | 4676ce41ae98936009de56acb5c262db | 获得微信好友信息列表,并返回之。 | namespace SocialKit.QQPengyou
public class PengyouApiClient
public IEnumerable<Models.UserInfo> GetFriends()
{
return GetFriends(true, null, 0);
} | 0 |
7ce3e6379d8ef77f05590d2068ce3454 | 28fccd0bf92c7703fff7e6ef7f80c72b | 判断支付宝用户是否绑定淘宝账号 | class UserController extends AuthController
public function bindingTaobao()
{
if(trim(I('post.token')) and trim(I('post.tb_uid')))
{
$token=trim(I('post.token'));
$User=new \Common\Model\UserModel();
$res_token=$User->checkToken($token);
if($res_token['code']!=0)
{
$res=$res_token;
}else {
... | 0 |
890fe803408ae0d7fc179aa4d84ffa9b | 1b05caf815dfafd3344bae56188a53bb | Convert all Boolean values into a integer. | class Boolean extends Type
public function toInteger()
{
if($this->bool)
{
return 1;
}
return 0;
} | 1 |
06b8799721bc0d50c8fe0cd8048559b7 | bd4506007495c2e5a4489e182823a7f2 | 查询所有店铺店面人员信息 | public List<StaffInfoDO> queryAllStaffInfo(); | 1 |
40bb6c83b97c27abba2e163879af2a19 | 5d92b2b416b102858b8906ecae54fe2d | functions scatter serial vector data on one process into a parallel distributed vector on all processes (assume serialVector is initialized on root process and parallelVector is initialized on all processes) | void Scatterv(void *sendbuf, int *send_counts, int *displace, MPI_Datatype
sendtype, void *receivebuf, int receive_count, MPI_Datatype
receivetype, int root, MPI_Comm COMM){
#ifdef PARALLEL
MPI_Scatterv(sendbuf,send_counts,displace,sendtype,receivebuf,
receive_count,re... | 1 |
270c7a1c93177697dd6792e2d6274b09 | 27d4f27bbd0d0ca49ff3b4639d12ecb9 | 测试DAO层的getMenuName函数 | class ToolsBaseTester(ToolsBase):
def get_menus_test(self):
menus = self._get_menus()
assert menus == ["my_menu_1", "my_menu_2"] | 0 |
b0c77077339cfe99824b62a7d0244434 | 1fa26b6224dde719ad9332ff0a342447 | Releases a SecDb system from memory. | dmover_backend_release(struct dmover_session *dses)
{
struct dmover_backend *dmb;
mutex_enter(&dmover_backend_list_lock);
dmb = dses->__dses_assignment.das_backend;
dses->__dses_assignment.das_backend = NULL;
dses->__dses_assignment.das_algdesc = NULL;
LIST_REMOVE(dses, __dses_list);
dmb->dmb_nsessions--;
mutex... | 0 |
d46320795a9c03de31845218db17eb7d | f7dbcaedca561efcd45287f13ca4218e | Write the .obj file to visualize the obtain alpha shape tesselations. | class VolMesh(HalfFace):
def to_obj(self, filepath, precision=None, **kwargs):
obj = OBJ(filepath, precision=precision)
obj.write(self, **kwargs) | 1 |
6acb263b0e6b1f99205f0ebbcfc5b3fc | 4eea01217f530841b9ebf220baba537a | Send this NPC out for food | namespace MediumcoreGhostInventories.NPCs
class GhostInventory : ModNPC
private void SendKill()
{
ModPacket packet = mod.GetPacket();
packet.Write((byte)MediumcoreGhostInventories.MediumcoreGhostInventoriesMessageType.KillNPC);
packet.Write(position.X);
packet... | 0 |
d3579edc8ceb9e8beb7503e2617793b5 | 4083d14b1866a7191968f7f5167a42eb | ==================== Decl =============================================
decl : type id ';' | def p_declaration_statement_1(p):
p[0] = p[1] + ' ' + p[2] + ' ;' | 1 |
c7f62c20a8c409788370e94b255fc789 | 6152474184c8c073176293db6b594127 | 완료 슬롯에 완료한 퀘스트를 추가 | public class CompletedQuestActivity extends AppCompatActivity
public void addItem(Drawable icon, String title_ko, String rating, String category, String accepted_date, String finished_date ) {
ListViewItem item = new ListViewItem();
item.setIconDrawable(icon);
item.setTitle_ko(title_ko);
... | 1 |
ab03644bd8693772fc40186a50cc6c93 | c850910931bd81a1b3f561e37bb158ac | 打印目录的具体位置 | public class DiGui
static void printFile(File file,int index){
for(int i=0;i<index;i++)
System.out.print("\t");
System.out.println(file.getName());
if(file.isDirectory()){
File[] files=file.listFiles();
for(File temp:files){
printFile(temp,inde... | 0 |
20dde228960f5d74373a6e326e061164 | d6a4396f97324c01c1e67a66f88cb01a | Generate a username-style field. | def field_names():
def field_name_candidates(draw):
identifer_denylist = (
'Lo', 'Lm', 'C', 'P', 'Sm', 'Sc', 'So', 'Sk', 'M', 'No', 'Z')
field_first_character = draw(
st.text(
alphabet=st.characters(
blacklist_categories=('Nd', ) + identifer_denylist,
... | 1 |
0314a739b5c6db452bb245d719f7347a | 42536f771bf7cd92a1b1726d22b8ab1b | Сохраняет идентификатор сессии в файл | class Session:
def save_session(self):
with open(Session.filename, 'w', encoding='utf8') as file:
json.dump(self._session, fp=file) | 1 |
45ea8d6614354275fdd9a20543019854 | 9ebfec14931bfbec7b694f91a2060512 | Sets the deployment descriptor for the EJB container or
Servlet context provided. | public abstract class EjbDescriptor extends EjbAbstractDescriptor
implements WritableJndiNameEnvironment,
EjbReferenceContainer,
ResourceEnvReferenceContainer,
ResourceReferenceContainer,
ServiceReferenceContainer,
MessageDestinationReferenceContainer
public void setEjbCl... | 0 |
88ecf2673627352abb0970a669ab7023 | 299e3eeb9d0e3c5c563b431fcca3f04f | convert and m by n np.array to a pd.DataFrame with x, y coordinates and intensity values (i) | df2D = pd.DataFrame(data, index=pd.Index(['x','y'],name='Axis'),
columns=pd.Index(['LOCP','ROCP','LICP','RICP',
'NB','ROCE','RICE','LOCE','LICE'],
name='ROI'))
df2D['LOCP']['x'] = data[' eye_lmk_x_51']
... | 0 |
45091681df24f62876e5f7bbbc51572d | 02d5ca2358304203e6be7c4d1b2f34e4 | Diese Funktion wird ausgeführt, wenn sich der Wert der IsFocused-Eigenschaft ändert. | namespace MITD.Presentation.UI
[TemplateVisualState(Name = VisualStates.StateNormal, GroupName = VisualStates.GroupCommon)]
[TemplateVisualState(Name = VisualStates.StateMouseOver, GroupName = VisualStates.GroupCommon)]
[TemplateVisualState(Name = VisualStates.StateDisabled, GroupName = VisualStates.GroupCo... | 1 |
9638e8a4e55d4ee57278b2af61422073 | 09b9b62a69807e3bb2408177f0088c5a | 通过msg_id获取消息 | def get_the_msg_by_id(id):
try:
sys_msg = SysMessage.query.filter_by(id=id).first()
if sys_msg is not None:
return sys_msg
except Exception as e:
logging.debug(e)
raise e | 1 |
c13c522dc545c3c679c47730d93d272b | c874a1454f953ac46320b8254046cf08 | Функция отправляет команду ИБП и возвращает результат выполнения | driver = self.driver
driver.find_element_by_id('command').clear()
driver.find_element_by_id('command').send_keys(command)
driver.find_element_by_css_selector("input[type=\"submit\"]").click()
result = driver.find_element_by_id('lps').text
return(result) | 1 |
2efe74850b227639145f4dc61d92534b | 20e37d250b7ec3ae4aac2a7cd744ea23 | Transforms the 'student_id' field to a normalized (lowercase) string | class Exam extends Model
public function setNameAttribute($value)
{
$this->attributes['name'] = strtolower($value);
} | 0 |
c8246efd3567835323b9ba28276e78a4 | 5a10c01f7ab8ca532d5b56434fc6e2e7 | Creates all background panels by reading a text file | {
MainUISceneTable = Resources.Load<TextAsset>(fileName);
string fileContent = MainUISceneTable.text;
List<string> fileContentList = new List<string>(fileContent.Split('\n'));
fileContentList.RemoveAt(0);
var reg = new Regex("\\s+", RegexOptions.IgnoreCase);
List<stri... | 0 |
f2a54da4594e04a42aa45a9001398de4 | c26adac0cc99ff42565781e7691a1859 | Convert a halo 1 collision model to the halo 2 version | tas = mach2tas(M, h)
cas = tas2cas(tas, h)
return cas | 0 |
4260ce89a5d6455e5e1f4112dbbf9954 | 17675abeb3ecf2c4f7fa7a42122f7bc6 | Set userStoreReader to nill (currently the same as reset) | adb_importCertToStore_set_fileData_nil(
adb_importCertToStore_t* _importCertToStore,
const axutil_env_t *env)
{
return adb_importCertToStore_reset_fileData(_importCertToStore, env);
} | 0 |
48bd84a1072a53b6e23cc372c165f474 | c11c1a87c708e8e9329df6caec178daf | Method that closes the pause menu | public class PauseGameMenu : MonoBehaviour
public void ClosePauseMenu()
{
AudioManager.Instance.PlayUISoundEffect(UISoundEffect.GameStart);
Destroy(gameObject);
} | 1 |
71d6c023bc1b1b96ccb57c679e4ac6a3 | df4233d7bf57a81e6bae43060770f3ac | Looks up a custom plugin argument and returns its value, cast as an integer. Throws FormatException if cast fails. | public abstract class OscCommand : Bindable
public int GetArgumentAsInteger()
{
return GetArgumentAsInteger(_argumentIndex++);
} | 0 |
e1b4221d3b22dc0c57fdff298539a8c4 | 23f5acd5ca8f7099eff0dae409d01bdb | Only select locations with option values set. | class WPSEO_Local_Option extends WPSEO_Option
protected function validate_option( $dirty, $clean, $old ) {
foreach ( $clean as $key => $value ) {
switch ( $key ) {
case 'business_type':
case 'location_address':
case 'location_address_2':
case 'location_city':
case 'location_state':
case 'lo... | 0 |
8bc1e97685a8b9b3d24f617086069606 | ef948c8271ff0a2c92fc3994297be6fa | Get a event filter with the corresponding filter id. | public Filter getFilter(Integer id) {
Filter filter = null;
String orderBy = null;
String selection = FilterTable.COLUMN_ID + " = ?";
String[] selectionArgs = { id.toString() };
this.database = dbHelper.getReadableDatabase();
Cursor cursor = database.query(FilterTable... | 1 |
a42ce6ca22f63b1766c9879664ddd855 | 1866a5ecbb2ba218e19028c015159373 | денормализация изображения | if (!getCfg('path.imagemagick')) throw new Exception("Не установлен пакет imagemagick!!!");
if (!is_file($sourceFileName)) throw new Exception("Не найден исходный файл '{$sourceFileName}'");
$pathinfo=pathinfo($resultFileName);
$dirname=$pathinfo['dirname'];
if (!is_dir($dirname)) mkdir($dirname, 0777, true);
$cm... | 0 |
3ac1349f6aeff7b79801bf64f7b8aab1 | a42e7f40283b0bed86d8ef1483f88084 | Fonction de callback de test. Elle sert principalement a synchoniser les éléments
envoyés et reçus, afin qu'on puisse les afficher ensemble. | function callback(data,status){
$('#text').html('text:' + data.text);
$('#message').html('message:' + data.message);
} | 1 |
d2051f8b513e3c89e508e95bb94fab03 | acac0cbc7c1cb55bee2ed8afc33f5024 | Calcule toutes les rotations d'un mot | total = 0
for letter in mot:
try:
total = total + dico[letter.upper()]['val']
except:
total = total + 1
if len(mot) == 7:
total += 50
return total | 0 |
3ce7ce2549c91d9d09da2db2c37b024f | 12e814629c22cd7982002ea361f6e0ee | returns the number of teams for this size | class Team:
#constructor
def getTeamSize(self):
return len(self.__members) | 0 |
54305b9e0e8aed5c73f55480fade8f7a | 200553bb44f5bb22fe50941d9df36854 | 行情分钟频率消息处理 | class Price_Different(CtaTemplate_2):
def __onTick_huobi(self, tick):
self.__processQueue('HUOBI',tick)
tickMinute = tick.datetime.minute
if tickMinute != self.barMinute_huobi:
if self.bar_huobi:
self.__onBar_huobi(self.bar_huobi)
bar = CtaBarData()
... | 1 |
ffaaaefbb8977b768fa4a1f19e265046 | 8863de8f7698c95135859a59c6a0513f | Opens a base64-encoded string stream to read the file | const path = this.getPath(filename);
return fs.createReadStream(path, {
start: 0,
emitClose: true,
highWaterMark: 43
});
} | 0 |
1c52e2bfa7314ead5b65b4196500f814 | ef23405e564634a4f24b267d39762750 | Cross-reference a single datadev extent record. | from copy import deepcopy
new_extent = deepcopy(self)
new_extent.parent_ref = new_georef
new_extent._set_extents()
return new_extent | 0 |
e75a462300033d8337c572f169bbb2ed | cefa69562d16d1db8b7c57eeafef9417 | places a bet if the player is ready to play another round and has enough in
its stake to place the bet.
if its a come out roll, then places a line bet if not already present.
places no bet if the roll is a point roll. | public abstract BetFuture acceptBet(Selection selection, Integer stake) throws TableClosedException; | 0 |
37c701cb682a4c1c8bee44769d5968fc | 75037e342d7a2b070f753d8a2d90dc25 | Price put option for a given underlying price. | class COption(object):
def time_value(self, underlying_price, trading_datetime):
opt_price = self.quote_1min.ix[trading_datetime, 'close']
if self.opt_type == 'Call':
return opt_price - max(underlying_price - self.strike, 0.0)
else:
return opt_price - max(self.strike - un... | 1 |
680fab64f27cdad1f783a7bedc881315 | 88120ee56184b56e657d7e241bb21deb | 将一行字符串写入文件 | namespace Core.StaticMethod.Method.Utils
public static class FileUtils
public static class FileWrite
public static bool RowWriteFile(string path, string[] strLine) {
try {
fileStream = new FileStream(path, FileMode.Create);
streamWriter = new StreamWriter(fileStre... | 0 |
869e16d6ed088c191a7cc28444c5b5e2 | 2d8297cfa268fa46d3678b516f34f3d6 | POST /location_trackings | export default class TrackingController
public async createTracking(request: Request, h: Hapi.ResponseToolkit) {
const newTracking: NewTracking = <NewTracking>request.payload;
try {
await this.refreshTracking(newTracking);
return h.response(JSON.stringify({ message: 'ok' })).code(201);
} catch (... | 1 |
f4b5a0784d0995f3fc90b2a6637f3364 | 21f20b21129bd74e4d4a7449085b06dd | Create packed color format from rgba
Overdrive is not permitted, so values over 255 (0xff) will get clipped. | namespace SdlSharp.Graphics
public sealed unsafe class PixelFormat : NativePointerBase<Native.SDL_PixelFormat, PixelFormat>
public PixelColor MapRgba(byte red, byte green, byte blue, byte alpha) =>
Native.SDL_MapRGBA(Pointer, red, green, blue, alpha); | 1 |
f8307a7a08a335f3de9ac2441e6ec646 | 72ecd4731691c24e8d3e9ea94dae60a8 | 把某个自定义的聚合块保存到硬盘上。 | {
String dir = SysDir.m_dataDir + "Tag.blk";
if(File.Exists(dir))
File.Delete(dir);
FileStream fs=new FileStream(dir,FileMode.Create);
BinaryWriter bw = new BinaryWriter(fs);
int count = tagList.Count;
bw.Write(count);
... | 1 |
8d7dfd8cc941185bb9402f4fd5c06705 | 5d5690139f4650c89a231e0d262e72f6 | Valider le message signalé d'un topic dans éditer les forums (administration) | $form = $flux['args']['form'];
if (!isset($flux['data']['texte_message_auteur'])){
include_spip("inc/nospam");
include_spip("inc/texte");
$texte_message_auteur = _request('texte_message_auteur');
$caracteres = nospam_compter_caracteres_utiles($texte_message_auteur);
if ($caracteres < 10){
$flux['data']['... | 0 |
053cb19b4b4f3c20efc07fca296dd62d | 61ce85897186e9ff5218b06ea85b23ea | 取得共同好友 | $is_self = $uid == $uid2 ? TRUE : FALSE;
$uids = $this->getCommonFriends($uid, $uid2, $is_self);
$return =array();
foreach ($uids as $uid){
$users = service('User')->getShortInfoByIds(array($uid));
$return[$uid]['username'] = $users[0]['name'];
$return[$uid]['d... | 1 |
317731b8eefa77d449d97c12d115a90e | bc1aba1e974f16db3a049baf043ddbcf | 得到两个字符串的最长公共子串 | string getmaxlencommonsubarray(string str1,string str2)
{
int len1 = (int)str1.size();
int len2 = (int)str2.size();
int** dp = new int*[len1];
for(int i = 0;i<len1;i++){
dp[i] = new int[len2];
}
dp[0][0] = str1[0] == str2[0] ? 1 : 0;
for(int i = 1;i<len1;i++){
dp[i][0] = str1... | 0 |
33b42fbc221d9461a8cc24e76d334d3f | 2255406504a96d43f8d906bc3d7faa47 | <p>Checks whether this <code>Throwable</code> class can store a cause.</p>
<p>This method does <b>not</b> check whether it actually does store a cause.<p> | public final class MoreThrowables
@SuppressWarnings("unchecked")
public static boolean isCausedBy(Exception ex,
Class<? extends Exception>... causeExceptionClasses) {
Throwable cause = ex.getCause();
while (cause != null) {
for (Class<? extends Exception> causeClass : causeExceptionClasses) {
... | 0 |
6ef56e00f4d57c9ea4aa5b213af67eb4 | a738a45cbd334b8530dd89b36944d50f | 获取按评论数排序的最新n条信息 | def get_top_n(num):
ori_data = rds.zrevrange(b'ReadRank', 0, num - 1, withscores=True)
rank_data = [[int(post_id), int(count)] for post_id, count in ori_data]
post_id_list = [post_id for post_id, _ in rank_data]
posts = Post.objects.filter(id__in=post_id_list)
posts = sorted(posts, key=l... | 1 |
881779bb4b8721bb59fd9cfd2cfdf89b | 4d6b3ff8ba5536f58ef8ae4cb3376b6c | Method used for choosing an inside color by JColorChooser | Color oldColor = selectedColor;
selectedColor = JColorChooser.showDialog(this, "Choose color", selectedColor);
if (selectedColor == null) {
selectedColor = oldColor;
return;
}
for (ColorChangeListener l : listeners) {
l.newColorSelected(this, oldColor, selectedColor);
}
repaint();
} | 1 |
3bd2432897726bba5f082b09e518acb5 | c56cebf6dc46f9dcc416bfa1fce6d453 | @brief AHB CNC系统配置参数初始化 | static void ConfigInit(CPSAR_DEVICE *HalDev)
{
#ifdef __CPHAL_DEBUG
if (DBG(0))
{
dbgPrintf("[cpsar]ConfigInit(HalDev:%08x)\n", (bit32u)HalDev);
osfuncSioFlush();
}
#endif
HalDev->dev_base = 0xa3000000;
HalDev->offset = 0;
HalDev->UniNni = CFG_UNI_NNI;
HalDev->ResetBit = 9;
Hal... | 1 |
482c48fcf4525618acbf99606ee738ad | 78bcb897c473942154860b2cb0e727d7 | Gets the lista referencias comerciales. | public class GestorRelacionadoBean implements Serializable
public boolean getChkComercial() {
return chkComercial;
} | 0 |
c00758101f622c0fec8b6cae1f6a2b71 | 26458e394a022d826c9d660a32bc77a7 | Converts an (IPv4) Internet network address into a string in Internet standard dotted format. | {
var separator = string.Empty;
if (includePeriod)
{
separator = ".";
}
return string.Format(
CultureInfo.InvariantCulture,
"{0}{4}{1}{4}{2}{4}{3}",
Convert.ToString(_firstOctet, 2).PadLef... | 0 |
25021bac8a8fcabf6a0639e8645c7c68 | 05da25cba1be1279b4b0364f579682ff | 获得TAX行所有数字 | try :
rawTax = re.split(r'(?<=\w)(\s*[,;]+\s*)|(\s+$)', tax)
taxList = []
for item in range(len(rawTax)) :
if type(rawTax[item]) is str :
match = re.search(r'\w+', rawTax[item])
if match :
taxList.append (rawTax[item])
r... | 0 |
e4f3d523f59fb5d09b31ce1c81478bc7 | 3992b8722914c5579e370189fe2f4f89 | Generate the body with defined attributes | $attrs = apply_filters( 'insight_body_attributes', array() );
$attrs_string = '';
if ( ! empty( $attrs ) ) {
foreach ( $attrs as $attr => $value ) {
$attrs_string .= " {$attr}=" . '"' . esc_attr( $value ) . '"';
}
}
echo '' . $attrs_string;... | 1 |
f5f221854759d717f32bc0246b91af8b | 07808f9322d892f3197437561a217e91 | Free up a list of hosts. | namespace nl namespace Weave
void HostPortList::Clear(void)
{
mElements = mSuffixTable = NULL;
mCount = mSuffixCount = 0;
} | 1 |
0aea1b5179f60f281fed77ada468d284 | 9b90d637960f7201e40a45fb9edd079c | 判断字符串str的GBK长度是否超过maxLength | if (getStringLength(str)>maxLength){
alert("["+msg+"]不得超过"+ Math.floor(maxLength/2) + "个汉字或"+maxLength+"个英文字符或数字!");
return true;
} else {
return false;
}
} | 0 |
a14e65aecf5696e684759c516327eca9 | 64951332bcad32ce0ae07a42537f2e0a | Update the title text info based on current active browser status and login info | class TimeSheetActivity : AppCompatActivity()
private fun updateTitleBar() {
Log.d(TAG, "updateTitleBar")
val format = "%.2fh/%.1fh/%d:%02d | %.2fh/%.1fh/%d:%02d"
val locale = Locale.getDefault()
val hoursPerDay = prefs!!.hoursPerDay
val hoursPerWeek = prefs!!.hoursPerWeek
... | 0 |
c06696118f2353037a29d59711e75157 | 3d7a7f7ee4f1c23e6bba63c8ac41b0b6 | normalize a sparse fileset | def normalize_readsizes(input_paths, output_paths):
split_fastq_files(input_paths, output_paths) | 0 |
6203bc0397ecb8ecec3857fb4551315d | 1e512b9f2d1f4ff3f63428c695f23d6a | Banish for cost, then return at end phase | function C41420027.Cost(card)
local currentChainEffectProcess = card:GetDuelScene():GetCurrentChainEffectProcess();
local myLifeValue = card:GetOwner():GetLife();
card:GetOwner():ChangeLife(-myLifeValue/2);
currentChainEffectProcess:CostFinish()
end | 0 |
159ab07d308514d6d1652dbe965c9cf4 | d2d1b0367742e7cdb79cd33d21bc5f29 | 1マス当たりの幅と高さを計算するメソッド | one_area = (WALL_SIZE[0] * WALL_SIZE[1]) // (img_number)
a = int(math.sqrt(one_area))
row_x, colum_x = get_row_column(WALL_SIZE, (a,a))
one_area = (WALL_SIZE[0] * WALL_SIZE[1]) // ((row_x+1)*(colum_x+1))
a = int(math.sqrt(one_area))
return (a,a) | 1 |
7b0e1b13b0ec0ccc3d7c512a5150f00b | 8318c06751fb802252d5810edcb0578b | Create the tables, insert, and select queries for the test | for qualifier in qualifiers:
echo("")
echo("")
tl("echo 'Test the qualifier "+qualifier+"'")
echo("")
count = 1
table = "T"+`count`
sql("create table "+table+"(i interval "+qualifier+")")
tl("create data source "+table)
count = count + 1
... | 1 |
0c73ce780b372324f5f2c7bc8c44acdc | 0c0eb6cd614daaf3972c9e5cdb540658 | Crea un archivo excel con una pestaña por cada tabla del conjunto de datos | namespace Project
public static class ExcelHelper
public static void CrearExcel(string ruta, DataSet dataSet, bool dispose = true)
{
if (File.Exists(ruta))
{
File.Delete(ruta);
}
using (var libro = new XLWorkbook())
{
... | 0 |
f87198f80c91ee0c584f2e024ac717a2 | 3d9d35c6b025e2818e1c7e3e6ef219ab | Returns a list of all assets in the specified region. | export class AssetsImpl implements Assets
private _list(
resourceGroupName: string,
accountName: string,
options?: AssetsListOptionalParams
): Promise<AssetsListResponse> {
return this.client.sendOperationRequest(
{ resourceGroupName, accountName, options },
listOperationSpec
);
} | 0 |
c4c2dd94ed3518000dd5905a97acb8d2 | fa88d4aef15d2f1893b0142e17f0eba1 | Print the available MIDI output ports. | void ofxKorgNanoKontrol::getListMidiDevices() {
unsigned int nPorts = midiIn.getNumPorts();
cout << "port count: " << nPorts << endl;
midiIn.listPorts();
} | 0 |
9ce58859693798feeb5485ace40e497c | 7243b1fd2d3f3ce6692f2a9a1e91d6f3 | Echoes the admin page content. | function bpdd_admin_page_content() { ?>
<div class="wrap" id="bp-default-data-page">
<style type="text/css">
ul li.users {
border-bottom: 1px solid #EEEEEE;
margin: 0 0 10px;
padding: 5px 0
}
ul li.users ul, ul li.groups ul {
margin: 5px 0 0 20px
}
#message ul.results li {
list-sty... | 1 |
6c6c01270681b0d778216f48ebed26b9 | b035d66111bb3bd384a1725fe50f083c | values指代当前枚举类,将当前枚举类转为Stream,并从中过滤出code值等于给定code值的枚举值并返回,如果找不到对应的枚举值抛出参数异常 | for (BaseExceptionEnum item : values()) {
if (item.getCode().equals(code)) {
return item;
}
}
return null;
} | 0 |
a0b9f55002b68b8fedbe353bea2ff0ae | 580c9897362db89b976c0cb604408eda | Remove the dist directory | function cleanDist(cb) {
return src(BASE_DIR, { read: false, allowEmpty: true }).pipe(clean())
cb()
} | 1 |
6f0fa207089d1df2e592a2e23e38d2f2 | a45dd35eae1c33c55ee454ccb249a3be | Destroys any resources held by this engine. It will terminate all threads
and requests without waiting for them to finish. | public class PhysicsEngine
public synchronized void onDestroy() {
if (mPhysicsThread != null) {
mPhysicsThread.terminate();
}
} | 1 |
23ccbefd2414cada85ee8e7b05999622 | d97079554e3aebe4fffa7d3256ac0d62 | WebGL向けアセットバンドル作成 | public static void BuildAssetBundlesForWebGL() {
var options = AssetBundleEditorUtility.GetBuildOptions();
AssetBundleBuilder.Build(BuildTarget.WebGL, options);
} | 1 |
fdf91cde98eec21915db139d96f619ea | a19ef9f9265adfb200622536217b21bd | Returns all the parent group elements ('n' level up in the hierarchy) for the group. | class GroupModel extends Model
private function parentGroups($groupID)
{
return $this->travelToTop(array($groupID), $groupID);
} | 1 |
8512e917e43a9ad8f2e328787d2ec26a | 6b75a7466708bbf140fc73379ea7eee6 | returns current employee | public class TinyAction extends ActionSupport
protected HRUnit getCurrentEmployee() {
return getEnvironment().getCurrentEmployee(getSession());
} | 1 |
5e03e0867b06b0bf769d942566765d83 | 9e4d581e06c2a76da9fc573e94affa83 | Setter for if the user can complete a trade | {
char ttIndicator = bypassReflection ? tradeThroughIndicator : editor.get(_tradeThroughIndicator, tradeThroughIndicator);
if ((ttIndicator == 'Y') || (ttIndicator == 'y'))
return true;
else
return false;
} | 0 |
4c823a5a3c31bb1ab923d5ad9f8e7b9f | a06e7abf37e6d28e3d4cabf21d8a47d8 | 为了简化逻辑,这里仅维护头指针 | class MyLinkedList:
def __init__(self):
self.cur = None
self.size = 0 | 0 |
8f41b3385381a54958715123c858a628 | 34fab84c545dc800ed79763e7a91868f | +------------------------------------------------------------------+
| right comparison of 2 doubles |
+------------------------------------------------------------------+ | {
int retval;
double D1,D2;
D1=*((double*)d1);
D2=*((double*)d2);
if (D1<D2)
retval=-1;
else if (D1==D2)
retval=0;
else
retval=1;
return retval;
} | 1 |
f88d41f60f0fec9e5d58cf69e07d6107 | 1c31717ace2af8432a4e0d1997c728dd | Manage html page via dom hierarchy | var obj_array=xml_objs.childNodes;
for(var i=0;i<obj_array.length;i++){
var myObj=document.createElement(obj_array.item(i).tagName);
var nseer_name=obj_array.item(i).nodeValue;
if (obj_array.item(i).tagName == 'table') {
var myTbody = document.createElement('tbody');
myObj.appendChild(myTbody);
nseerEl... | 1 |
d8ca49f0cf811df1e617d2c82f657744 | 1d9da4d6ae4bd34f92a56cbb396457df | Returns HTML information about advert owner | public class Advertiser extends Customer
String GetAdvert()
{
return advert;
} | 0 |
32d023129f04b196d00a1732e98a6675 | 1f29a1fc8ebdaa7ffd2f898e5aeaf4ce | Gets the value of the clinic property.
possible object is
{@link String } | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "eRAM", propOrder = {
"dunsnbr",
"primnme",
"adrline",
"posttown",
"primgeoarea",
"scdygeoarea",
"postcode",
"ctrycd",
"tlcmnbr",
"currcntlyr",
"totempl",
"primsic",
"locnstat",
"hqduns",
"hqnme",
"hqct... | 0 |
8842747d5033603cf53631ee49b8e703 | 5e44189b7bab39e22727e5643470b47e | Hides the center guider | public hideGuide() {
this.firstTouch = false;
if (!this.guide) {
return;
}
if (!this.showGuided) {
return;
}
this.showGuided = false;
this.guide.over();
} | 1 |
fb4ad87f44620aa3fc8f1152db5e6244 | 52c3bd33bbe299af7b8aa539a89c3906 | Used instead of gPaletteFade.active in certain weathers | static bool8 IsPaletteFadeNotActive(void)
{
return IsPaletteNotActive()
&& gWeatherPtr->palProcessingState != WEATHER_PAL_STATE_SCREEN_FADING_IN;
} | 1 |
c5737d63ca54b0652e6ae3159d60bf51 | 6ca98d6a40041e05b4ae8dbb6eaf53f2 | Rename a file in the filesystem. | pool_name = p_n()
pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1])
fs_name = fs_n()
make_test_filesystem(pool_path, fs_name)
self._unittest_command(StratisDbus.fs_rename(fs_name, fs_name), dbus.UInt16(0)) | 0 |
86565761c11f90a538b57af53c505fb3 | b3eaafb7fd8dede1ead590bde2463acf | Basic implementation based on bounding rectangles intersection | bool is_intersect_r_r(Shape *a, Shape *b)
{
std::cout << "Is intersect: RECT-RECT" << std::endl;
return true;
} | 0 |
b5bb70cdf6df2e3a6feff642142603ba | bdac5880b5acf8ffac3ee16f969cf7ca | 限制一个字符串必须匹配一个正则表达式 | class Rule
public function regex(string $regex, $msg = ''): Rule {
$this->defaultMsg($msg, '{$alias}不符合格式');
return $this->rule('regex', $regex, $msg);
} | 1 |
341373123161d6f51b2c068e0691d469 | e93a9ead4f2cc1f9d6ced1cd53629751 | 求任意两个日期间的休息日 | Map findHolidayByDate(@Param("beginDate") Date beginDate, @Param("endDate") Date endDate); | 1 |
0d934422266ffc8e2f0a7c1f4389013d | fe10692ade84b93f50b61dcaa9eaab07 | odpowiada za obsluge operatora += | {
for (int i=0; i<ROZMIAR; i++)
{
Mac2.tab[i] = this->tab[i] + Mac2.tab[i];
}
return Mac2;
} | 0 |
ee4a62f311418d9491baa2c6f9a5cd23 | 33705f887ff16702f9d47e1d28df8d5f | handling changing the color of the tile based on win state | if (x == 0) {
changeColor(winbutton[x]);
changeColor(winbutton[x + 1]);
changeColor(winbutton[x + 5]);
} else if (x > 0 && x < 4) {
changeColor(winbutton[x]);
changeColor(winbutton[x - 1]);
changeColor(winbutton[x + 1]);
changeColor(winbutton[x + 5]);
} else if (x == 4) {
change... | 1 |
4b1eff4e1a7146b170f5c0d3caa18a54 | 5a130527e8508ed6b79717a48b52e459 | This function cycles through the active toasts and move them down the screen. | namespace ImprezGarage.Modules.Notifications.DataModel
public class NotificationsModel
public void LowerActivePopUps(int removedId)
{
if (GetActiveToastsCount() == 0)
return;
foreach (var notification in Notifications.Where(o => o.Id > removedId))
{
... | 1 |
22bc7172916f2a019adf1e3a6a57ac90 | d74fafd6d66030724c78008c6dcd88b2 | Unsets the value of the '{@link Powrmart.SESSTRANSFORMATIONINSTType#getISREPARTITIONPOINT <em>ISREPARTITIONPOINT</em>}' attribute.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sesstransformationgroup",
"partition",
"hashkey",
"flatfile",
"attribute"
})
@XmlRootElement(name = "SESSTRANSFORMATIONINST")
public class SESSTRANSFORMATIONINST
public String getISREPARTITIONPOINT() {
return i... | 0 |
42efd17992d5925424d5bec3ed504356 | 723c6eeebdc7dce02822980bbf3310d8 | ! \brief Initialize the Protocol | public class PM5_Communication : MonoBehaviour
[DllImport("PM3CsafeCP")]
static extern ERRCODE_T tkcmdsetCSAFE_init_protocol(UINT16_T timeout); | 1 |
ec349d081d2dd839ffba28e781999029 | df9e6cbf39048ebb8228d3f8a564e96e | Gets the collections being decorated. | public Set<Type> getDecoratedTypes(); | 1 |
6b4311daf172ffde9255859945d42805 | d51433eda16435249a2a794771bfdd3d | Creates an array of all counterparties for a provided transaction list | partners = []
for block in self.transactions:
if not block.link_public_key in partners:
partners.append(block.link_public_key)
return partners | 1 |
365263c8c39da2950f199ee63dc29423 | 712d83a9310de67238cc08569248309d | Restore changed environment variables | function restoreConfigEnv() {
process.env.VIDEOBACKUPPER_CONFIG = _configEnv;
_configEnv = null;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.