query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
80da1bcf335ac9491d9ef533141cd908 | 52e97d83b2ca35790c74b4f2c5114dc9 | Returns the Locale Path | class Translator
static getLocalesPath() {
return this.localesPath;
} | 1 |
c3624a0568aac75321b66dcef0816d0a | a0fa6f257ce440ad2485ce7610eba6a3 | 维护全局用户权限变量 | permission_list = [permission['role__permission__url'] for permission in
user.values('role__permission__url').distinct()]
request.session['permission_list'] = permission_list
menu_permission_list = \
[permission for permission in user.values('role__permission__url', 'role__per... | 1 |
90358efc3c45597853d0c1965585e1ab | 0fdccfc8c26f1074d1af26245dca9aac | store the JLab Configuration including connectioninfo, Users UI-Modules and workspace infos. | FileInputStream in = null;
Properties pro;
try {
pro = new Properties();
File f = new File(System.getProperty(Messages
.getString("LibConfig.64")) + File.separator
+ Messages.getString("LibConfig.65"));
if (!f.exists()) {
f.createNewFile();
}
in = new FileInputStream(f);
pro.load... | 0 |
4b4e7b884409e8f7406a5298047e19bb | a80188555ccc101326f420f40b53340d | scoreTextに合計点数を表示 | public class ResultController : MonoBehaviour
public void ShowTotalScore() {
float nowAdd = addScore / (GOAL_TIME * (1.0f / Time.deltaTime));
GameController.nowScore += (int)nowAdd;
if ((GameController.timerCont.remainTime - Time.deltaTime) > 0.0f) {
GameController.timerCont.remainTime -= remainTime / (GOAL_TI... | 0 |
e52d0d03a18ba5f33b7084b6934419cf | 8d48bb9df9c1163fa918dd2bda39f53f | Wyswietlenie wszystkich rozwiazan danego uzytkownika | def show_UserProblem(request):
_email = request.session.get('user')
context = {}
context['email'] = _email
candidates = problem.objects.filter(ID=_email)
context['candidates'] = candidates
return render(request, 'generator/Show_UserProblemList.html', context) | 1 |
344823de8a7579fe44729a29c470832f | 51d40dc0c7630d86a235e5d7f84bfcdf | _bcm_petra_bfd_uc_convert_uc_error
Converts uController error code to corresponding BCM error code.
uc_rv - (IN) uController error code to convert.
BCM_E_XXX - BCM error code. | {
unifycr_error_e ec = (unifycr_error_e)rc;
switch (ec) {
case UNIFYCR_SUCCESS:
return 0;
case UNIFYCR_ERROR_BADF:
return EBADF;
case UNIFYCR_ERROR_EXIST:
return EEXIST;
case UNIFYCR_ERROR_FBIG:
return EFBIG;
case UNIFYCR_ERROR_INVAL:
return EINVAL;
... | 1 |
6c97341c4d171b83f449ad28147ec6bc | a6c61a13be66696836b0537105ec3033 | 分组统计每个类别书的平均格价 | public class LambdaTest
@Test
public void test10(){
Map<String, Double> collect = bookList.stream().collect(Collectors.groupingBy(Book::getType, Collectors.averagingDouble(Book::getPrice)));
System.out.println(collect);
} | 1 |
50c9dcb7438e912695dbecc2f80c6138 | 0f5dc7c36cb32e49bfea1736068464e2 | Sets and loads the language file based on the requestedLanguage parameter | $ci = &get_instance();
$ci->load->helper('language');
$lang_data = unserialize(LANGUAGE);
$siteLang = $lang_data[$language];
if ($siteLang) {
$ci->config->set_item('language',$siteLang);
$ci->lang->load('message', $siteLang);
$c... | 1 |
8b040fa0c13d9d86dd1e7023f1618d55 | c7df90fcb175c99cc8846e2f55035da2 | Issue a sell order on the maker (limit) side. | class AsyncClient:
async def order_market_sell(self, **params):
return await self.client_helper("order_market_sell", **params) | 0 |
b14fcd782678d45c79be98b90da13e60 | bb7fb8cdfccbafe539e0c6baf02e6d7e | 拍图搜题 - 通过base64图像搜索试题 | @Component
@Slf4j
public class BaiDuWeiZiApiUtil
public R<String> form(InputStream in) {
HashMap<String, String> options = new HashMap<String, String>();
byte[] fileByte = readImageFile(in);
JSONObject res = client.form(fileByte, options);
return R.success(JSON.toJSONString(res));
} | 0 |
b7c3a210b4d127638e769e4816b032e8 | de81f2b685cbe2389ea9197892611ba1 | Compute the confusion matrix.
Input
cs - prediction label, n x
cTs - ground-truth label, n x
k - #label
Output
D - confusion matrix, k x k | cmsl = list(cms)
ccm = np.zeros((2 * len(cmsl), 2))
for i in range(len(cmsl)):
(tp, fp, fn, tn) = cmsl[i]
ccm[2 * i + 0, 0] = tp
ccm[2 * i + 0, 1] = fp
ccm[2 * i + 1, 0] = fn
ccm[2 * i + 1, 1] = tn
return ccm | 0 |
843b7446f3c398ac281b0ed4b964c171 | 0964c129153535f639e327789140357a | Serial implementation of the Monte Carlo integral approximation
with importance sampling | double test_monte_carlo(int n)
{
double integral = 0;
double exact_val = 1.0;
double x = 0;
srand(time(NULL));
for(int i = 0; i < n; i++)
{
x = (double) rand()/RAND_MAX;
integral += 4*pow(x, 3);
}
integral = (double) integral/n;
return fabs(integral - exact_val);
} | 0 |
5e49b81c978fa2dab5cd5280c24856d7 | 28f36029d3e8d0a140d3a3350fc5ce73 | 判断是否显示外呼按钮 | function ServiceOrderListController($scope, $state, $stateParams, $ionicActionSheet, $timeout, rt, ServiceOrderService)
function _showButton(phone) {
if (rt.isNullOrEmptyString(phone)) {
return false;
}
return true;
} | 1 |
5d385439af4eeddaa0c1400072212d43 | 24c4c721b6ef4f18490f92379cd0cbf5 | True if has "Message" element | class DojoMsgBlob extends \DrSlump\Protobuf\Message
public function hasMsgs(){
return $this->_has(1);
} | 1 |
12dafc18e3438cfb0c67ad8bd0943473 | 890a311570e941bc674536c8604a6376 | The prediction for each timestep is the input
from the previous time step plus the delta
calculated by the model. | input_data = np.hstack((current_state, control))
delta_next_state = self.model.predict(input_data.reshape(
1, self.memory.n_inputs))
next_state = current_state + delta_next_state[0]
return next_state | 1 |
7a58553c99a31f12c2089b8e8f45c0e9 | 8aa31ade04e0432f0d079edeeb7d1b8a | Is this string a link? | def isitLink?(message)
uri = URI.parse(message)
%w( http https ).include?(uri.scheme)
rescue URI::BadURIError
false
rescue URI::InvalidURIError
false
end | 1 |
aee50bf40bdc293347e039841a3b7ffc | 7b2762647a917c7a742dba7f82c72970 | vCPU preparations when entering from usermode. | {
u32 *p = addr;
unsigned int i;
struct uasm_label labels[2];
struct uasm_reloc relocs[2];
struct uasm_label __maybe_unused *l = labels;
struct uasm_reloc __maybe_unused *r = relocs;
memset(labels, 0, sizeof(labels));
memset(relocs, 0, sizeof(relocs));
UASM_i_LW(&p, T0, offsetof(struct kvm_vcpu_arch, pc), K1);... | 1 |
7ca29f2ae829507124c89dcdb2fcf8ea | fd90aa058d1e0aac3030f4acf8cd145f | Supprimer l'observateur passé en paramètre | public void supprimerObservateur(monObservateur o); | 1 |
b0f819ec17ae25d285bee45460b6f42d | 4e5fc87cba880579743da1dccffb3199 | 安装结束信息 | def installEnd():
try:
with open('/usr/lib/install.log', 'r') as f:
line = f.readline()
print(type(int(line.strip())))
res = {"res":int(line.strip())}
except:
res = {"res":1}
return jsonify(res) | 1 |
f70dc3affa6150540fb08b6d4f95d70f | 94b6822edf8c0c4f5b700fa2dcacb6f8 | 获取可流转药品信息 | {
try
{
string sqlGetReplaceImte = "select * from EMR_MEDICINE_NODE WHERE valid = '1'";
return DS_SqlHelper.ExecuteDataTable(sqlGetReplaceImte, CommandType.Text);
}
catch (Exception ex)
{
throw new Excep... | 1 |
7a87976eebe939b6d221903be3d44117 | 83bc8156d0d9976bf4d5a7d18d163c71 | Function fillComputerTypeComboBox @return void
Fills the Computer Type combo box in the Computer section
with all Computer Type names in the database | Map<Integer, GeneralPositionsDto> fillComboBoxControl() throws Exception; | 0 |
0bd2d57d2c4dd01564bd6600c0d6468d | f38383d572fcd5d3931712cf5e0a71b2 | 获取屏幕最大亮度 | var window = act.getWindow()
var lp: WindowManager.LayoutParams = window.getAttributes()
return lp.screenBrightness
} | 0 |
20999c3ec4bdec6766d9a03b73c570ac | 41473d43aaed06123923a7ce10b45e38 | Load collection batch special prices | class Innoexts_Warehouse_Model_Catalog_Product_Price_Observer
function loadCollectionBatchPrices($observer) {
$this->getWarehouseHelper( )->getProductPriceHelper( )->loadCollectionBatchPrices( $observer->getEvent( )->getCollection( ) );
return $this;
} | 1 |
f229a25fd4037ecb3eef69f9700432d3 | 7c9788449ce6ca333b87aea4b08b1f54 | Adds an action to execute to this fluent builder. These actions will all run at the same time. | public class BaseUnit public static class Builder
public Builder action(Action action) {
skill.add(action);
return this;
} | 1 |
531ed2566b972147bfc5929e1187f341 | e0669dda14a8149cb4f95ec25f2fb296 | Mapping from label num to label name | with open(os.path.join(app.config['MODEL_FOLDER'], "labelmap.txt"), 'r', encoding='utf-8') as f:
lines = f.readlines()
labels = {}
for row_number, content in enumerate(lines):
pair = re.split(r'[:\s]+', content.strip(), maxsplit=1)
if len(pair) == 2 and pair[0].strip().isdigit():
label... | 1 |
a4a2da60258ed8c8e19b865602faef4e | 2a06598424532e73fed8103accca3e2e | Set sleepwalking match mode. | void twihs_set_sleepwalking(Twihs *p_twihs,
uint32_t ul_matching_addr1, bool flag1,
uint32_t ul_matching_addr2, bool flag2,
uint32_t ul_matching_addr3, bool flag3,
uint32_t ul_matching_data, bool flag)
{
uint32_t temp = 0;
if (flag1) {
temp |= TWIHS_SWMR_SADR1(ul_matching_addr1);
}
... | 1 |
52f6eb5cfb386cfbc4be10b432627404 | 692103a79d02189f5e38113bb507d8f9 | 创建消息体前缀 | int dataLen = msg.getBytes().length;
String prefix = String.format("%06d", dataLen);
return new StringBuilder().append(prefix).append(msg).toString();
} | 1 |
f03361ae293e1cd3f7fc8370209bf0db | a305e1b53540114f34aeb05b42a2dbce | Test if model's source table name matches. | class TestFindTimeSeries(TestCase):
def test_find_time_series_model(self):
actual = self.creator._set_module_name_by_model()
expected = "gamebench_api_client.models.dataframes.time_series.time_series_models"
self.assertEqual(actual, expected) | 0 |
17f81bf133ddace6870e9770a995fc5c | fecd3b30bd9107d5445c0ba99552e413 | Test to make sure the method succeeds when a folder doesn't exist | class TestStagingService(unittest.TestCase):
def test_stage_runfolder_does_not_exist(self):
with self.assertRaises(RunfolderNotFoundException):
self.mock_runfolder_repo.get_runfolder.return_value = None
self.staging_service.stage_runfolder(runfolder_id='foo_runfolder', projects_to_stage=... | 0 |
2188fb311ffa1e3b9af21f4b2f699182 | 553893af2e1d71ceb2a84043d32e5254 | Builds a particular instance of a multistage problem | from pyomo.core import Objective
model = self.model_function(data)
for theta in self.theta_names:
try:
var_validate = eval('model.'+theta)
var_validate.fixed = False
except:
print(theta +'is not a variable')
if self.... | 1 |
67ca4bd73413287b2d81ec00879bf677 | 14a31001e2b8856226b5100ee97ab2f0 | Disparado antes de efetuar a seleção da linha através do checkbox padrão do datatable.
Podendo, neste momento, inibir a seleção retornando <b>setOk(false)</b> do evento.<br/>
Conexão com o banco encontra-se aberta. | @Dependent
public abstract class BaseBean<T extends Parent, U extends AbstractService<T, ? extends AbstractDao<T>>> implements Serializable{
public void beforeDetalhar(){} | 0 |
e3ac146154df33ac07bac48edc12457a | c462b66c5b73ef2c1b6ea5612e1bec6c | Toggle currently selected guideline | class LayoutUtils extends React.Component
toggleGuides() {
this.setState({ guidesOn: !this.state.guidesOn });
} | 0 |
9c2b3c1925b09ea02a489f585bd92164 | a74ef017877c3f5acb9b43e7ae38a0a3 | Delete alerts with optional filtering. | function listAlerts(params, cb) {
params.resourcePath = config.addURIParams(constants.ALERTS_BASE_PATH, params);
params.method = 'GET';
params.data = params.data || {};
mbaasRequest.admin(params, cb);
} | 0 |
b52998bb725c04fe7b3b8343bdf6189e | 42a76c6996074675f27d7df537148261 | 收到消息后,把消息中的调查客户信息,补充进调查客户端对象中。
调查客户端是在客户端上线事件中产生的,这里只补信息。 | self.checkState(self.STATE_GAMING)
decoded = msg.getDecoded()
self.players = decoded[self.KEY_PLAYER]
self.enemies = decoded[self.KEY_ENEMY]
self.process = decoded[self.KEY_PROCESS]
self.keepTime = decoded[self.KEY_KEEP_TIME]
self.updatePlayerFromMsg(
... | 0 |
fa2490034410abb219f96e4a72b67d36 | 09bded9d218e8a05cd42d26f093604c0 | https://discord.com/developers/docs/resources/user#leave-guild | export class BotAPI
public async leaveGuild(guildId: Snowflake): Promise<void> {
await this.requests.send(EndpointRoute.UserBotGuild, { guildId }, HttpMethod.Delete);
} | 1 |
05869fadd204aace6360eca94c5d2c01 | c3aeeb37eab402eab64c778259b43e9d | 创建福禄猪点击之后炸开特效 | function JiangJunFuLayer:ZhuangBei( index )
local JiangJunFuShiPuZhuangBei = requires("src/fsgl/layer/JiangJunFu/JiangJunFuShiPuZhuangBei.lua"):create(index,self)
self:addChild(JiangJunFuShiPuZhuangBei)
JiangJunFuShiPuZhuangBei:show()
end | 0 |
aa2a2ff90096dc8cf268acf3e2e41ffd | 36902c2b29c2f6e4ebe7d4aa7fb0e198 | 遍历购物车列表myList,将每一个商品的isSelected做一个逻辑与运算,将与运算的结果给isAllSelected | for (int i = 0; i < Result.size(); i++) {
stateCheckedMap.put(i, isSelectedAll);
List.setItemChecked(i, isSelectedAll);
}
} | 0 |
bb750ee8afdfda359769090ebf375089 | 00a648a2cd14bcf1b54fba0104a02320 | one-time initialization of different paddle sizes | pub fn init_global_sprite(reg: &mut Reg) {
reg.register_sprite(PADDLE_FLAG + BLUE + SMALL, 0., 64., 32., 16.);
reg.register_sprite(PADDLE_FLAG + BLUE + MEDIUM, 32., 64., 64., 16.);
reg.register_sprite(PADDLE_FLAG + BLUE + LARGE, 96., 64., 96., 16.);
reg.register_sprite(PADDLE_FLAG + BLUE + HUGE, 0., 80.... | 1 |
c2bab0368adb4b79a6b4210d20896d1c | 8957688e6acc0dfa1fdbd0a01256a077 | 根据所属公司id 获取合伙人 | function getPartners(params) {
return new Promise((resolve, reject) => {
https.post('/common/getPartners', params).then(
(res) => {
const result = Object.assign(res, {})
resolve({
status: !result.code,
result,
... | 1 |
43b0b945b0f62bfaf4745694095c6b14 | 3a561c802debbff12810982107a39ffa | Finds empty tile and moves it right | if (!canMoveRight(board)) {
return false;
}
for (let i = 0; i < 4; i++) {
for (let j = 2; j >= 0; j--) {
if (board[i][j] != 0) {
for (let k = 3; k > j; k--) {
if (board[i][k] == 0 && noBlockX(i, j, k, board)) {
move(i, j... | 1 |
a1b6b1d7fb2119226ba7571c2fea7630 | 3eea845e8fc916a66a3877e0d380b7f1 | 商业公司预付款的回款方式审核通过,生成商业公司(配送公司)入库单 | @Controller("billCheckInfoController")
public class BillCheckInfoController{
@DataResolver
public String deleteReceipt(BillCheckReceiptVo receiptVo){
Timestamp creTime = JAppContext.currentTimestamp();
String creator = JAppContext.currentUserName();
String creatorId = JAppContext.currentUserID();
receiptVo.set... | 0 |
67befbfa4dad5d6caeeea6d92be6176e | 96f107b6f6dbc50e75eaa0f9db27c7b3 | Replaces anchors by values in virtual DOM node (mutates node). | if (isVirtualNode(virtualNode) && values) {
const { props } = virtualNode;
let { children } = virtualNode;
for (const propName in props) {
const propValue = props[propName];
if (hasAnchors(propValue)) {
props[propName] = values[propValue];
}
}
for (let index = 0; index < ... | 1 |
12a1cbc1e689acf0bc4d8904ba0039b9 | 1974a1703144064cd89186e13e2058f8 | If pyjwt was not imported, confirms OptionalDependencyError | class TestGrortir(unittest.TestCase):
def test_dependency_import(self):
try:
import testpackage
assert True
except ImportError:
self.fail("dependency not installed") | 0 |
aecdd58dd6e69257acce98376ff6b590 | ab649e6d0a41b1227f950481ebcfceab | returns the list of event types found from given file | def common_event_list_read(file_name):
common_event_list = []
fl = open(file_name, "r")
for line in fl.readlines():
line = line.replace("\n", "")
common_event_list.append(line)
fl.close()
return common_event_list | 1 |
0274a40015b51cc414d0553e213b770e | 2947f614b26dcadedef31da74d003312 | 公共需要添加的设置,如 sdk 目标版本,jdk 版本,jvm 目标版本等 | public class MainConfig extends JFinalConfig
@Override
public void configConstant(Constants me) {
loadConfig();
me.setDevMode(prop.getBoolean("dev_mode"));
me.setBaseUploadPath(prop.get("base_upload_path"));
me.setBaseDownloadPath(prop.get("base_download_path"));
me.setViewType(ViewType.JFINAL_TEMPLATE);
m... | 0 |
7698a716cd3b261a80fc46344867c240 | e2f60e2d816bf3284fbf563f94096e81 | Kick off the background thread that fetches the latest stock prices | function fetchTickerPrices() {
store.dispatch('fetchTickerPrices');
setTimeout(fetchTickerPrices, 60000 );
} | 1 |
afa3ef511356991d1cf3bae35abb75c4 | 65927d863e842e375446b04caa576bcb | Get the name of the tonic and append the mode. | class Scale:
# private final ScaleModeEnum scaleEnum;
# private final List<KeyLetterEnum> notes;
# private KeyLetterEnum tonic;
# public Scale(List<KeyLetterEnum> scaleNotes, ScaleModeEnum scaleName) {
def getTonic(self):
return self._notes[0] | 0 |
5ca2654b54a1664151fbed4c8e4b1f04 | acfcfea41fd2867f75ef9043abbe333e | Удаляет коллекцию. | namespace Com.Apiomat.Frontend.Offline
public abstract class AbstractStorage
public virtual int RemoveCollection(string url)
{
RemoveCollectionETag(url);
return 0;
} | 1 |
a2246489a27aa7096d91e20ee505eb4d | ae94f92e95e6acb4f4d8477c5c74ccfd | 忽略掉Object对象中未有的属性字段的XML序列化 | @SuppressWarnings("deprecation")
public class JsonBinder
public JsonBinder setSerializerIgnoreProperty(List<String> ignoreProperty) {
mapper.setSerializerFactory(new MyCustomSerializerFactory()
.setIgnoreProperties(ignoreProperty));
mapper.getSerializationConfig().setSerializationView(String.class);
return th... | 0 |
8453d5851bf8eead15ea1100987e7b4a | 7be9a0e729ce18c98e4612a43a778d30 | This funciton is to standardize the name of city and state
For example, it will return "Los Angeles,CA" if city is given as
" los angeles, ca | name = re.sub('[.]$','',name)
if not re.match('^[A-Za-z0-9 ]+$',name):
return ''
name = re.sub('^[NSEWnsew]{1,2}[.]? ','',name)
name = re.sub(' [NSEWnsew]{1,2}[.]?$','',name)
name = re.sub('^(North|South|East|West|Northwest|Northeast|Southwest|Southeast) ','',name)
name = re.sub(' (North|South|East|West|Northwe... | 0 |
b5507a40d74159df9d77abf638174b9f | c8c275bb3137c2ff07d0fc91168d33e1 | Server와의 연결을 끊습니다. | namespace Hik.Communication.ScsServices.Service
internal class ScsServiceClient : IScsServiceClient
public void Disconnect()
{
_serverClient.Disconnect();
} | 1 |
48ed0a4728345c0c4541d3c3f862becb | e8e108ba25960387abde5e2a29e2999c | Is not Read Only | class Wsu_Dropshipper_Block_Adminhtml_Dropshipper_Allprolist_Tab_Product extends Mage_Adminhtml_Block_Widget_Grid
public function isReadonly() {
return false;
} | 1 |
eb13bf7a41963fcf2c0a7f9aea625046 | f28ac9f7cf399e03274eb92e7e66fd1c | 'default' enter sequence for region r_handler | static void enseq_main_region_default(Test_geometry_sc* handle)
{
react_main_region__entry_Default(handle);
} | 1 |
7ecbf53766fe79a197c837e823cd17b0 | e663045d6ea28c03f98416e14827f546 | Test case for create_pipeline_and_version
Creates a new pipeline and a new pipeline version in a single transaction. # noqa: E501 | self.cwl_populator.run_conformance_test("""v1.0""", """Test single step workflow with Scatter step and two data links connected to
same input, flattened merge behavior
""") | 0 |
63a6d70b280225d7ff1bf1646b5aff39 | f42aeb2fb58649761bf5f4193eed36a3 | 判断一个值是否在枚举中定义.
比较时使用value的equals方法. | if (StringUtils.isBlank(value)) {
return false;
}
return getEnum(value) != null;
} | 1 |
739526481cddbf4860f293cc9171c599 | 7b493c27f7c09c0486293a19eb96c9b8 | Gets SCL Low Timeout | void I2C_ClkLowTimeoutConfig(M4_I2C_TypeDef* I2Cx, uint16_t u16TimeoutL)
{
DDL_ASSERT(IS_VALID_UNIT(I2Cx));
CLEAR_REG32_BIT(I2Cx->SLTR, I2C_SLTR_TOUTLOW);
SET_REG32_BIT(I2Cx->SLTR, u16TimeoutL);
} | 0 |
bfef9202c9b6186c785604927fc07320 | c323309baddd9a2a967d104654080b0d | Verifica se o protocolo principal ou o protocolo a ser vinculado / desvinculado já foi apensado a outro. | public class ValidateSubstituicaoProtocoloBuilder
public void verificaDepartamentoProtocolos() {
String mensagem = "";
Long destinoProtocoloSubstituido = substituicaoDto.getProtocoloSubstituido().getUltimoMovimento().getIdDepartamentoDestino();
Long destinoProtocoloSusbtituto = substituicaoDto.getProtocoloSubsti... | 0 |
32beb054cbe0886d2c5dde4bcd19a4b2 | 9346715398c53e7a73fec2b45148448c | 取得JavaLib扩展目录路径 | public final class EnvInfo
public static String[] getJavaLibraryPath() {
return get("java.library.path").split(getPathSeparator());
} | 0 |
5c409e69d7285c362acd12a555bcc2b4 | 688a0df0c2e9a25aacd0125288829f87 | Extracts the common name part of an abbreviated or canonical name | fun getCN(x509: X509Certificate): String? =
DistinguishedNameParser(x509.subjectX500Principal).findMostSpecific("cn") | 1 |
7c38686525977e0ab1a3bbf3fd9c64a9 | 48ff2dad6e0b300755e55c283611f423 | Equipment_ListSuggestItems | {
if ($request->initSession() && $request->isReferer() && Login::isMember()) {
$search = $request->post('equipment')->topic();
$where = array(
array('I.status', 1),
);
if ($search != '') {
$where[] = Sql::create("(I.`equipment` ... | 1 |
4f8287b171d346c7ba864d94d0b382a3 | 93083e33d5119562854c6f6d76c3b512 | Fill memory with pattern using 16 bit access | class Swd():
def fill_mem16(self, address, pattern, size):
index = 0
data = pattern * ((min(size, self._drv.maximum_16bit_data) // len(pattern)) + 1)
while size:
chunk_size = min(size, self._drv.maximum_16bit_data)
self._drv.write_mem16(address, data[index:index + chunk_s... | 1 |
c0dac6a1ee5ac00e27ca6a524e0b9549 | 0500eb8c957b78a26fef67253b9ef021 | 根据ProductID或SKU获取中英文产品信息 | class ProductController extends UebController
public function actionGetsku(){
$sku = Yii::app()->request->getParam('sku');
$key = Yii::app()->request->getParam('key');
$arrProduct = UebModel::model('Product')->getBySku($sku);
if($arrProduct){
$arrProductDesc = UebModel::model('Productdesc')->g... | 1 |
324ca954862740a24d4eb3634b75aa21 | 89d55d93429f4558673474f3023d49e5 | Clone video tags to new FLV file.. | {
if (MediaHelper.IsValidVideoFile(FileName) || MediaHelper.IsValidAudioFile(FileName))
{
string outputFileName = Path.GetFileName(this.FileName).Insert(Path.GetFileName(this.FileName).LastIndexOf("."), "_temp");
string extension = FileFormatHelper.GetExte... | 0 |
95ac75d8500946797a4a9f4eef9c1b9a | c3b0649eb45ebbe157e59a8c1c6ee6ae | insert forecast data to local Room db | class ForecastRepository(private val database: ForecastDatabase)
suspend fun insertLocation(lat: Double, lon: Double, title: String) {
Timber.d("Inserting forecast data from location lat: $lat, lon: $lon")
withContext(Dispatchers.IO) {
database.forecastDao.upsertLocations(LocationEntity(lat,... | 1 |
3823861f2dfb396cd5c5ae435d515d22 | d89ac38c252ae9378937789f116339a4 | Dispenses the buffer's memory when it is closed. | cgBillboardBuffer::~cgBillboardBuffer( )
{
dispose( false );
} | 1 |
f8bd1914e6f07cb2d0f100a0e112899f | 2d190ee9a31b89263c27df9a07b91bc6 | FTP下载器登录界面的登录按钮触发的事件 | web.data['username'] = self.userEdit.text()
web.data['password'] = self.passwordEdit.text()
web.data['ranstring'] = self.ranstringEdit.text()
r = web.session.post(web.login_url, data=web.data, headers=web.headers, verify=False)
r.encoding = r.content
text = r.text
... | 1 |
7febbf975162a1d30a6a2cfd1f67ff10 | 918aa569ea2678797eb8e8f77af20ece | 性別のオプションを取得する | class Profile extends \xii\db\ActiveRecord
public static function sexOptions() {
return [
10 => Xii::t('xii-core', 'Male'),
-10 => Xii::t('xii-core', 'Female'),
0 => Xii::t('xii-core', 'Other'),
];
} | 1 |
e5e6c560d50daa902977baea224b9367 | 286a99b81c00f3c27d82ae1518dc7356 | realiza uma cópia profunda do objeto e seu conteúdo | public class Saude extends AtividadeEconomica
public Saude clone(){
return new Saude(this);
} | 0 |
0b36e54129c67175f47e664ce320eb01 | 8d6b86acc2b1626d0d558760f8524ac0 | Calls <paramref name="someFunc"/> if <paramref name="option"/> has value,
and <paramref name="noneFunc"/> otherwise. | namespace Optional.Async
public Task<TResult> Match<TResult>(Func<T, TResult> some, Func<TException, TResult> none)
{
return InnerTask.Map(option => option.Match(some, none));
} | 1 |
b7a4067a4a22b6036f03bf6f1f315a87 | b3c737f44f8c616ca6dd4d28c5794b59 | Get reverse complement of sequence | int seqLen = seq.length();
StringBuffer rcSeq = new StringBuffer(seqLen);
char test;
for (int i=seqLen-1; i>=0; i--){
test = seq.charAt(i);
switch (test){
case 'A': rcSeq.append('U'); break;
case 'C': rcSeq.append('G'); break;
case 'G': rcSeq.append('C'); break;
case 'U': rcSeq.append('A')... | 1 |
2b3172cce644f5aedd48d85fe12a10fa | 8f0e47d19836c8ca41f63d19c3c76981 | Representing Car | class Car():
def __init__(self, make, model, year):
self.make = make
self.model = model
self.year = year
self.odometerReading = 0 | 1 |
2ba6ffa7ec1375827cf4f1cf7202d8df | c7abb836bfd046f16bc7005b0ba02a78 | Backup catalog database to the given path. | os.makedirs(datapath(conf["backupdir"]), exist_ok=True)
with self._connect() as con:
backup_path = os.path.join(datapath(conf["backupdir"]),
f"{time.strftime('%Y-%m-%dT%H:%M:%S')}-{conf['dbfile']}")
backup_db = sqlite3.connect(backup_path)
... | 1 |
153e70089e649d32927d9af4b63c7e32 | e6ec3363833b813a9177c60d0bf4e298 | 以node为根节点的avltree中是否包含索引为key的节点 | int search_key_avl(avl_t *t, key_t key){
return search_key_by_node(t->root, key);
} | 1 |
80260db5c94571e88858c443ad59af1c | e5f7aa26df568fade953f6a3cd3a7c5c | 执行拍一拍的动画 | function M:playAnimate()
local indexs = self:getImgIndexs()
local imgs = ZTools.getImgs("bdcutcake/candle/candle_", indexs)
self.actionImg = ZTools.stopAction(self, self.actionImg)
self.actionImg = A.cycle({
{"fileNames", imgs, 1.0 / 5},
})
self:runAction(self.actionImg)
end | 0 |
4c0b2affd69c683c3706f22802e4efd2 | 6db2f577cb2e97ff0a184f3fb077db66 | Registers the specified stringWrapper, so that it is updated whenever the
language changes | class YITH_WCMAP_Frontend
protected function _register_string_wpml( $key, $value ){
do_action( 'wpml_register_single_string', 'yith-woocommerce-customize-myaccount-page', 'plugin_yit_wcmap_' . $key, $value );
} | 1 |
cf2055a5d9c1860951e6dc9002894589 | e7ac877811ac0e782f85dec40bfa9d2e | Creates an association between health monitor and pool | class ControllerWorker(object):
def create_health_monitor(self, health_monitor):
db_health_monitor = self._health_mon_repo.get(
db_apis.get_session(),
id=health_monitor[constants.HEALTHMONITOR_ID])
pool = db_health_monitor.pool
pool.health_monitor = db_health_monitor
... | 1 |
3304c1dd86166f0f87bf9879477d7aed | c1b1c0675fa9547365883f3c67a6a026 | 设置第三年租金总额 | @Table(name = "fn_fund_ranking")
public class FundRanking
public void setThreeMonth(BigDecimal threeMonth) {
this.threeMonth = threeMonth;
} | 0 |
d94308991e14b00357dbc7f30f7ad38d | 3865a2ed9faf7388991fbe5655f11b9d | @brief funkcia triedi subory podla velkosti | double s = double(size);
size_t i = 0;
for (; i < FILE_SIZES.size() - 1 && s > 1024; s /= 1024, ++i);
return (std::to_string(s) + FILE_SIZES[i]);
} | 0 |
881e2dda8b456a1027ff46b50f9d1d8a | b274f55ceabb9db0a5c399efb15e3e77 | Calculates a due date and time of a given task | self.validateInput(submit_date, turnaround_time)
remaining_days = turnaround_time // 8
remaining_minutes = int((turnaround_time % 8) * 60)
remaining_from_start_day = self.remainingMinfromDay(submit_date)
due_date = submit_date
while remaining_days > 0:
if ... | 1 |
922c61211fe1d1a85d839ef848f0564b | 0d5cb6b71f4dedf424620730732908de | Сохранять можно, если открыт какой-нибудь файл и что-то менялось | {
if (is_changed)
{
DialogResult tr = MessageBox.Show("Сохранить изображение перед закрытием?", this.Text, MessageBoxButtons.YesNoCancel);
if (tr == DialogResult.Yes)
{
if (Filename != null)
{
... | 1 |
41d8b3e9f4e38a5cc732af55a43928f4 | deccd8fdf1103efa90c40d8d933b6bc5 | Returns ReflectionClass for called class | {
if (!class_exists($this->targetFullyQualifiedName)) {
throw new ClassNotFoundException($this->targetFullyQualifiedName);
}
return new ReflectionClass($this->targetFullyQualifiedName);
} | 1 |
bd94b43d9d2c3b0bd4e6af9eb38cd305 | 79dd5b616623fdb300bd75ba422af80e | 获取Emoji对应的Drawable | public class FaceUtils
public static ArrayMap<String, Integer> getEmojiMap(int EmotionType) {
ArrayMap EmojiMap;
switch (EmotionType) {
case FACE_CLASSIC_TYPE:
EmojiMap = FACE_CLASSIC_MAP;
break;
default:
EmojiMap = EMPTY_MAP;
... | 0 |
9191aed5c94a22311f124cfe002ad9a4 | 7c53841e4b6740d1a3e97b94d6ea4554 | 竞价人选择 | {
$rstArr = array('status' => 'ok');
$planInfo = Model_Plan_EsfAjkPropSpread::data_access()
->filter_by_op('id', '=', $planId)
->filter_by_op('status', '=', Model_Plan_EsfAjkPropSpread::ONQUEUE)
->find_only();
if (empty($planInfo)) {
return ar... | 1 |
551e8a0777793949c1ede640530c060e | 2997a8f54648015b1c4b7f1eedeff3a7 | 得到建表语句 | public String getSql(TableModel tm, List<ColumnModel> cms) {
TableInfo ti = (TableInfo)CacheUtils.getCacheInstance("tableCache");
Map<String, ColumnModel> currentColumn = ti.getColumns(tm.getUuid());
StringBuffer buf = new StringBuffer();
Iterator<ColumnModel> it = cms.iterator();
while(it.hasNext()){
Col... | 0 |
57cd9ba0e08e98d10cc3a946e508b490 | 08d8040bb19b638e1d066d0e5fde37b5 | 为当前选择集调用 Accept 回调函数. | {
if (!shouldSendAll())
{
int oldChangeFlags = changeFlags;
changeFlags = changeFlags | SEND_SELECTION_ACCEPTED;
if (oldChangeFlags != changeFlags) notifyChange();
}
} | 0 |
d659c988abce74ee1e5d3613547d946e | f4d49bad7cf4586f6c94d7333ee72200 | 根据订单id查询订单sn号 | String getShipmentSn(Map<String, Object> map); | 0 |
4c50404a5d8fed22b106e1d79484e0c5 | 399032564954b846089c1a684d037d85 | 定义数据处理函数来处理每个数据包的关键信息,将关键信息存入列表中 | logging.info("-----putPcaptoList-----")
while ( Util.pass_bytes < len(Util.string_data)):
if( len(Util.string_data [Util.pass_bytes:]) < 16):
break
Util.pcap_packet_header['caplen'] = Util.string_data[ Util.pass_bytes + 8:Util.pass_bytes + 12]
Util.pca... | 1 |
f27e04ce3783a2a6a603a9ec0ce2e0c0 | 307cecc49188b19dd2a2c9a5c209e15d | Assigns a random position to a building. | int index = Random.Range (0, positions.Count);
return positions [index];
} | 1 |
56de5088c5bd8b753ef19102b16025a7 | 1c12e41b927849ed9b1e3946b4a69ea3 | Returns the m_strBinId. | public class ATLBinMovePosIdxVO extends BaseVO
public String getBinId()
{
return m_strBinId;
} | 1 |
774111ad766f150f741e3cc6943911a5 | e56eeff76b92cdebba451346a9801011 | TestNoTags verifies a repository without tags is handled correctly | class StorageTestCase(TestCase):
def test_get_tags_no_tag(self):
tag_path = storage.path_spec.get_tags_path(self.repo_name)
os.makedirs(tag_path)
self.assertEqual([], storage.get_tags(self.repo_name)) | 1 |
09c5007ec71a649fd26611a993f61dcc | 500ede05fd3114b073b1499733d3fb06 | Enable Writing Assistant Preference Settings. | namespace Pegasus.Pages.UI_Pages
public class GeneralPreferencesPage : BasePage
public void EnableGeneralPreferenceSettings()
{
logger.LogMethodEntry("GeneralPreferencesPage",
"EnableGeneralPreferenceSettings", base.IsTakeScreenShotDuringEntryExit);
try
{
... | 0 |
bb74fbdc238948af9d6f334b6f86935b | 5841ec21e16484189654fc21cfac9788 | this function Read the Services classes (Tasks) and the user preferences
for CIA | {
BinaryReader rd;
List<ServiceInfoNetAdap> _lServiceInfoNetAdap;
List<ServiceInfoWifi> _lServiceInfoWifi;
List<string> _lAddresses;
try
{
rd = new BinaryReader(new FileStream(Application.StartupPath +@"\data.bin", FileMode.... | 1 |
31f8c6214f99883a1e317f6c043e82b9 | fe140be330fa28b28ff9a200f2b90298 | Generate combinations allowing duplicates. | combs = itertools.chain()
for i in xrange(2, len(lst)+1):
gen = itertools.combinations(lst, i)
combs = itertools.chain(combs, gen)
return combs | 0 |
89071081359b4864daefcdfa8c86efd4 | 05b598db46d4ab5fb52fcc5c3881d307 | Get details of a fe_user | $where = ' tx_datec_feusermanagement_hashvalue="'.$dbHash.'"';
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'fe_users', $where);
if ($res) {
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
}
return $row;
} | 1 |
d8f8f00ddc6a881b16989741a514adb1 | 98e2ce61d43fb4127932938777c7f7a2 | 2次元データをcsv文字列に変換する関数 | function csv_string($str){
$csv_data = $str;
$csv_data = str_replace('"','""',$csv_data);
$csv_data = str_replace(',','、',$csv_data);
return '"'.mb_convert_encoding($csv_data, "sjis-win", "utf-8").'"';
} | 0 |
ba8887433ea330efa22e72f23821e845 | 974ec37fe6606a03201f189d7a6edb79 | Set the 2d Animation Lock. (if needed). | public class States : MonoBehaviour
public void SetLockOn(bool f)
{
IsLockon = f;
} | 0 |
d87bbfab2e75a3a59c3f14cd76411ec8 | 51f5f118efdc6cc94aa3a0b43edddee0 | Publishes the draft version of product changes (pending product changes) for each product code specified in the request, and changes the product publish state to "live". | postProductsIdPublish(productId: string, options?: any): AxiosPromise<ProductResponse> {
return ProductsApiFp(configuration).postProductsIdPublish(productId, options).then((request) => request(axios, basePath));
} | 1 |
589443ce98edaea85876018867249059 | 1e15a11de7b4f7d043982c8e850530d1 | Create a quantum gate by multiplying existing gates
The multiplication will be done from left to right starting zeroth
element of the qu_gates list. For example:
qu_gates = [H, X, H] will be H * X * H | self.reset()
length = min(self.gene_num, self.qubit_num)
[self.set_pauli_op(i, i, pauli_op_str) for i in range(length)]
return self | 0 |
c24f1d82946f8db7117843775ddbc69d | f38c90d1461b2e2fe885c33be28ee05b | 弹出选择信息 | this.confirmBox.show({
entryMode: 2,
label: this.data.label || '',
chooseData: this.data.chooseData
})
} | 1 |
448c2ff84cbadc1d272db07c9e8753fa | 457c0c1ee50302bfbb68310c994955f9 | Returns ID of created user from trade platform Solaris | class PaysonCredentials
public function getUserId() {
return $this->user_id;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.