query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
19e227ed15816cbac906519a50964e66 | cf751b4cf15211629a427efc6a46d8b8 | Constructs a selection box. | class Selection(Value):
def __init__(self, param, values):
self.param = param
self.values = values | 0 |
d96fe7a211c0c999ba1d87f094be19af | acb83b234e423aae1a61e389cb0667c5 | Calculate particle number trajectories
The time course of the particle numbers in the simulation can
be queried with this function. Species can be selected
individually with the `species` key. If a list of species are
given instead the sum of the particle numbers for those species
types will be returned. A regular exp... | self.r = self.particles_r()
self.p = self.particles_p()
self.tau = self.particles_tau()
self.r0 = self.particles_r0()
self.p0 = self.particles_p0()
self.eng = self.particles_energy(self.p)
self.eng0 = self.particles_energy(self.p0)
self.nelastic, self.nion... | 0 |
b2a4cd0a928e91fa20e9682efd924d4c | e926dbd1d58e037ceb03131f5949ed5b | 挂载主表ref 便于父组件使用子组件函数 | class Owl extends Component
componentDidMount() {
this.props.onRef(this);
} | 1 |
d090304a41cd83b6cd7e1b5c9fa8386e | 4d487c3e63dfcffdf738453570d2d034 | Scan a directory and rename files. | {
foreach (scandir($pathOld) as $fname) {
if ($fname != '.' && $fname != '..') {
rename(self::joinPaths($pathOld, $fname), self::joinPaths($pathNew, $fname));
}
}
} | 1 |
1feaae5e78a0627549f91c9362036a58 | 909b3a9ce2cf0b6fb3d9310c93560232 | para evitar alerta de datos enviados por post al ir hacia atras con el navegador | function evitarCopyPaste() {
$("#correo_conf").bind("cut copy paste",function(e) {
e.preventDefault();
});
} | 0 |
c33160e2901b4fa8ff0f1a45d3b96bf2 | 2d2462cabc97cbf1aab8f02a957f4cb9 | 序列化操作 将Java对象转化成json | public class JSONUtil
public static String write(Object o) {
try {
return M.writeValueAsString(o);
} catch (JsonProcessingException e) {
throw new RuntimeException("json序列化失败",e);
}
} | 1 |
1a865d0ca464ce9b2293b945fd6b5fc6 | 730e00e06a0a3eeeb995549f385af5c9 | 通过运单号获取商品相关信息方法 | @Controller
public class ItemHandler
@ResponseBody
@RequestMapping("/get/item/from/ship/order")
public ResultEntity<List<Commodity>> getItemFromShipOrder(@RequestParam("shipOrederNo") String shipOrederNo){
shipOrederNo = shipOrederNo.trim().toUpperCase();
ResultEntity<List<Commodity>> result = mysqlRemoteService.... | 1 |
d89d475cd62f4b4c031259f255e87db4 | ed69550b59e54dd46093ceb699c2498b | Admins can add Multiple Choice questions | UploadFieldDefinition fieldDef = new UploadFieldDefinition.Builder().withName("multi-choice-q")
.withType(UploadFieldType.MULTI_CHOICE).withRequired(false)
.withMultiChoiceAnswerList("foo", "bar", "baz").withAllowOtherChoices(true).build();
return makeSchemaWithFields(fie... | 1 |
f49eb59339603df415f28aa6b342e9d3 | a999898dbe9f7d249053399325a79d05 | 通过神将ID获取碎片ID | for k, v in pairs(self._knightDataDic)do
if(v ~= nil and v.cfgData.knight_id == knight_id)then
return v.serverData.id
end
end
return nil
end | 1 |
8b67fef67879878aaa1274c14c22c780 | d717dae404f1ec779473c909c78a93bb | @brief 从当前光标开始,跳过n个字符 | {
int n = 0;
while (_IsSpace(*m_CharStartPos))
{
if (*m_CharStartPos == c_NewLine)
m_Line++;
m_CharStartPos++;
++m_CharPos;
n++;
}
return;
} | 0 |
c0f5dc4f798ba39a010c3f63d54bafc4 | 9bfeaf68d21306b1578e72881edef4f1 | Build a string from the settings of the Station base configuration | Entity\Station $station,
Entity\Interfaces\StationMountInterface $mount,
string $idPrefix,
int $id
): string {
$charset = $station->getBackendConfig()->getCharset();
$output_format = $this->getOutputFormatString(
$mount->getAutodjFormat() ?? $mount::FORMAT... | 1 |
527f2c4c782fc5f4fa315797a43ff48e | b735b1bd2361d13128b80a8ce4460d27 | Creates a trading session, obtaining session tokens for subsequent API access. | class Dynect:
def _create_session(self, customername, username, password):
try:
self._log_debug("Dynect:_create_session: Enter")
params = {}
params["customer_name"] = customername
params["user_name"] = username
params["password"] = password
self._loginJson = json.JSONEncoder().encode(params)
resu... | 1 |
f303f9f60f2e020beafc062448611f6f | 7856f288d5865064330953070436d497 | # IRLS algorithm for poisson family | loglike=NULL
old.tau=tau;old.parm=parm
itr=1
while(itr<iterations){
fy=rbind(dunif(y),dbeta(y,old.parm[1],old.parm[2]))
p=old.tau*fy;p.scale=apply(p,2,function(t) t/sum(t))
lold=sum(log(colSums(p)))
new.tau=apply(p.scale,1,mean)
logQ<-function(parm) {
sum(p.scale[2,]*dbeta(y,parm[1... | 0 |
b0d3a0eaf6452ecd16ad93df2ebcc913 | 3adcdf4ca000d20bd345e29bdf1e8829 | (Unit Test Method) tests graphical user interface do fill in questions. | {
logger.LogMethodEntry("StudentPresentationPage",
"AnswersSelectionInTestWindow",
base.IsTakeScreenShotDuringEntryExit);
base.WaitForElement(By.XPath(StudentPresentationPageResource.
StudentPrsentation_Page_QuestionCount_Presentation_Xpath_... | 1 |
bb7dba418f52614b07b4bb5d605930ec | 43b0fb8a4b1ac628c6fbc859ce3ecf66 | 将最高成绩保存在文件中 | class GameStats():
#跟踪游戏的统计信息
def store_high_score(self):
with open(self.filename,'w') as f:
json.dump(self.high_score,f) | 1 |
e2aeda0aa75e0f85c0da9065b370b929 | f38f0b656010e40673e617aee3e787ea | check whether there's still content on the list (hatNochInhalt()) | boolean hatNaechstes(); | 0 |
fffab69674b51e959239c8a178bbc473 | 81f8c85de37087f3b68bb5aecca1d7d2 | 文件上传,自定义上传路径 | @Component
public class FileUtils
public String upload(MultipartFile file, String path, String fileName) throws IOException {
String originalFilename = file.getOriginalFilename();
String format = originalFilename.substring(originalFilename.lastIndexOf(".") + 1);
String newFilename = fileName + "... | 1 |
37744f1ec4454e82d1345431e29c3834 | b5f53f9623de8c8f747502324ab14f5d | El metodo aumenta el puntaje segun la velocidad del jugador. | public class InGameState extends BasicGameState
public void keyPressed(int key, char c) {
if (m.getContadorFin() > 10)
if (key == Input.KEY_SPACE) {
PuntuacionState.setPuntuacion(m.getPuntuacion());
int puntuacion = InfoJuego.getInstance().getOroDelJugador(InfoJuego.getInstance().getJugadorMinijuego1());
... | 0 |
53ca6a87353fa75f6d632f63bedc6b79 | c69225d7ec817b4231dcf2c9c57e7af3 | Initiates the asynchronous execution of the GetConnectivityInfo operation. | namespace Amazon.Route53Domains
IAsyncResult BeginGetContactReachabilityStatus(GetContactReachabilityStatusRequest request, AsyncCallback callback, object state); | 0 |
0adb410378064140a5e0e9693fb54e04 | 47829369d3088419e0998e81551909c1 | What response to return when the sequence gets empty | public class ServerThread extends Thread
private String badSequence() {
return "503 Bad sequence of commands";
} | 0 |
cea9016d5df01555586fe711ff87fd62 | ca35491581de8abda39c4a07cf25bb7d | Visit a parse tree produced by {@link PlPgSqlParser#negateExpression}. | void exitExpressionNegation(@NotNull MiniJavaParser.ExpressionNegationContext ctx); | 0 |
d9ffb031ef41e37b9eea693e9dbf595e | 6196ecca1223204ad2e0cf60bbca1615 | -----------------------------------------------------------------------------------------------------
如果有設罝出戰夥伴即載入 | function CWar:BoutStart()
if self.m_iBout == 0 then
local mPlayerPartner = {}
local mWarrior = self:GetWarriorList(1) or {}
for _,oAction in pairs(mWarrior) do
if oAction:IsPartner() then
local iShape = oAction:GetData("model_info").shape
local iWi... | 1 |
ffae8bcd0636fc1e6d6b77e7a262e55a | 64f0f9ced831e74ebad65c30b42b8256 | セーブデータを読み込む。なければディレクトリごと新規作成する。 | {
for (int i = 0; i < m_MaxSaves; i++) {
var saveFilePath = GetSaveFilePath(i);
if (!File.Exists(saveFilePath)) { continue; }
var saveData = new SaveData();
BinaryFormatter bf = new BinaryFormatter();
FileStream file = F... | 0 |
9e081afd622d1374a90f3e8229f1d13b | e75b262a8d3beca32fa1ab6dd185b0cb | SFH5110 infrared sensor external interrupt service routine | {
uint32_t un_temp;
uint8_t uch_temp;
uint8_t uch_i2c_data[6];
maxim_max30102_read_reg(REG_INTR_STATUS_1, &uch_temp);
maxim_max30102_read_reg(REG_INTR_STATUS_2, &uch_temp);
HAL_I2C_Mem_Read(&hi2c1, I2C_READ_ADDR, REG_FIFO_DATA, 1U, uch_i2c_data, 6U, 250U);
*pun_ir_led = 0UL;
*pun_red_led = 0UL;
un_tem... | 0 |
bb0c3615ca15a30631a7cc2ae47c08ed | db78454ab6b9eedb935513f7c7dd6d7e | CMMsg objects are normally re-used, and this method is the recycle bin.
If the msg were to have been garbage collected, it would get returned here
anyway, but this is the nice way to get it done. | public void recycle(String userId, String messageId); | 1 |
26af8930e9e4c9626a8f90b742ac922e | c92232f4d12b096f73c3cafc2a92c571 | Ensure row has all cells, fill missing cells w/ default values | public class RowData implements Types
public void setDefaultForRest(QueryContext context)
throws DatabaseException {
for (int i = 0; i < col_count; ++i) {
if (data_cell_list[i] == null) {
setColumnToDefault(i, context);
}
}
} | 1 |
5ea8120972a9b6000c6fef850a70585c | 9c7a29512a4187bc0c38daa0b3b0c1fa | アイテムブラー時にフォーカスされているアイテムIDを解除 | public class UIFocusItemEquipmentLattice : UIFocus
public override void LostForcus()
{
backLineImage.enabled = false;
} | 0 |
279dbdb096ee9d37e4cdf1e51f537c13 | 99140e36159db952b3a78d4dd80f4740 | Ensure download command fails when metadata has expired | {
$fixtureName = 'TUFTestFixtureSimple';
$updater = $this->getSystemInTest($fixtureName);
$updater->refresh();
$this->serverStorage->removeRepoFile('timestamp.json');
$updater->refresh();
$this->assertClientFileVersions(static::$initialMetadataVersions[$fixtureName]);... | 1 |
1a05e734eb8d46092946a276a5664b1f | 954deb64470e0d36d17e6e624ca10984 | Returns the interpolated state of the supplied animations. | namespace ReactNative.Animated
class SpringAnimationDriver : AnimationDriver
private void Interpolate(double alpha)
{
_currentState.Position = _currentState.Position * alpha + _currentState.Position * (1 - alpha);
_currentState.Velocity = _currentState.Velocity * alpha + _currentStat... | 0 |
fb346249ae35fe288b5a4a0accdd4ea6 | ead5b54c4f70d53717238ff4294ae7bd | lookup falls back to the default when locale is wrong type (e.g. None) | def get_locale_with_proxy(proxy):
from .locale.objects import Locale
if proxy is not None:
locale = proxy.get_locale()
if locale is not None:
return locale
return Locale() | 1 |
4b6a752be5463fa2d93d63add20ae252 | b486100de1715ddcc7d6a033cf2419d3 | odczyt obiektu z pliku xml | {
Document doc = new SAXBuilder().build(input);
Element elem = doc.getRootElement();
editStateFromElement(objectState, elem);
} | 1 |
2cddc60925396ef0a93887a619dad959 | 28247a87b8868cd4b89802ab64ec8ee7 | Prints a Grid sized according to a user provided argument.
This is written to meet the second portion of requirements
for assignment02. | def print_grid(grid):
grid_size=15
for x in range(grid_size):
print('\t'*5+' '.join(grid[x])) | 0 |
d212ed8fdceae07f145406bf12dcd5cc | f98906777eb7f786c7412a7ea0c17b48 | @brief MLDLCfgDMP configures the Digital Motion Processor internal to
the MPU. The DMP can be enabled or disabled and the start address
can be set. | int mpu_get_dmp_state (unsigned char*enabled)
{
enabled[0] = st.chip_cfg.dmp_on;
return 0;
} | 0 |
d513a8eda6bf0e64187921eee7d96d5d | a0f15261eb75f21c54a5753f32fe6f7d | 修改名师 | class About extends Base
public function addteacher()
{
if(request()->isPost()){
$data = json_decode(input('post.data'),true);
unset($data['file']);
$data['createtime'] = time();
$re = (new Teachers)->insert($data);
if($re){
$return = array("msg"=>"添加名师成功",'icon'=>6);
}else{
... | 0 |
7a61bcacc1596bbc09db89abf0d35163 | 50f9dfdea50f4554b68250cca8d5c6f3 | sorting patients by surname | public class Sort
public static List<Person> sortBySurname(List<Person> list){
Person temp;
String name;
String nextName;
for (int i = 0; i < list.size(); i++) {
for(int j = 0; j < list.size()-1; j++) {
name = list.get(j).getSurname();
nextName = list.get(j+1).getSurname();
if (name.compareToIgno... | 1 |
16ef55fc4ce12a126bddcf3bca817479 | 0094c06ee49522dc0e53cae8c0f0912a | quitApp(self) -> None
quit this application | class Application(Gtk.Application):
def ui_quit(self, *_args):
self.quit() | 1 |
66836743c1ef8d46950ff0b15f6586b1 | fb55e762bdb940f3601a5feac0ebff56 | Returns True when REP is enabled | class FritzhomeDevice(object):
def has_repeater(self):
return bool(self._functionsbitmask & self.DECT_REPEATER_MASK) | 1 |
22d6a75bcdb2bf323d7ef13773fed7cc | 6fffd56c6a26932b4dcf22837488e49f | Retrieves an enumeration of personal catalogs available to an end-user at the root level in the store | namespace QuoteFlow.Api.Services
IEnumerable<Catalog> GetCatalogs(int userId); | 1 |
ad5792bd6304cdc38e6cd39310351a31 | 1f605e27540416d2f890b32b8c0b0fc2 | tests deriving with respect to operation nodes | BOOST_AUTO_TEST_CASE(test_eq)
{
BOOST_REQUIRE(( !variant_has_op_v<std::equal_to, static_variant<not_comparable> > ));
BOOST_REQUIRE(( variant_has_op_v<std::equal_to, static_variant<eq_only> > ));
BOOST_REQUIRE(( !variant_has_op_v<std::equal_to, static_variant<eq_only, not_comparable> > ));
BO... | 0 |
f03105c692aa1d2253ddc78b0946f757 | c073a63aee63398aa82a0f1598c9a357 | check if there is an overlap between two ranges | class NetworkManager(object):
def is_range_intersection(cls, range1, range2):
return range1.first <= range2.last and range2.first <= range1.last | 1 |
a810337cea882f9c0ef09b5d510c5640 | 22e35df005e9d1a2cc884b42c34ee824 | @brief Decides whether to turn anticlockwise or clockwise, based on which angle is the smallest.
Used in turning to face the checkpoint. | float dy31, dy21, dx31, dx21;
float theta1, theta2;
previousAngleDifference = currentAngleDifference;
dy21 = robotHeadingPos.y - robotPos.y;
dy31 = goalPos.y - robotPos.y;
dx21 = robotHeadingPos.x - robotPos.x;
dx31 = goalPos.x - robotPos.x;
theta1 = atan(dy21 / dx21) * 180 / PI;
theta2 = atan(dy31 / dx31) * 1... | 0 |
1371f7b54965e55cdf46bbe9d00a2a8e | 5fa72114568673af1635c1f9237e317b | Parse the metadata (units, quantities etc...) from the forcefield XML. | def parse_pfam_xml(pfam_response_xml): | 0 |
8ce13ee4c04ebb603e89e004339a59f0 | 0d8817a7cfa50efcf70828c4b187cb39 | Simple SQL selector, with optional predicate.
Predicate format: field value (e. g.: 'id 14', 'price 120000'). | class Select(ClassedSql):
def __init__(self, cls, where_clauses = [], order: Order = None, offset=None, limit=None):
Sql.__preinit__(self)
self.where_clauses = [self.check(c) for c in where_clauses]
self._order = self.check(order)
self._offset = self.check(offset)
self._limit = s... | 1 |
e17c88a923aa1072751858892405ebcd | 61a6b5a9d84e2a6b265bf7b6c29c216f | Adds an <see cref="AttributeDefinition">attribute definition</see> list to the dictionary. | {
foreach (Attr attr in list)
if (!keyAttrs.Contains(attr, Global.comparer))
AddToKey(attr);
} | 0 |
b6a9bad6db1840dc12f407158fcda725 | 6b060a8964a6afd31f79e31f385c009c | Format uri for namespace endpoints for easier matchup with openapi spec | class EndpointFormatter
def formatted_url
endpoint.path
.gsub('(.:format)', '')
.gsub(/(:(?<param>\w+))/, '{\k<param>}')
.gsub(Brainstem::ApiDocs.base_path, '')
end | 1 |
04b4520bbe56e3267dead355eb118189 | fa2961248bdbc4bb5151dad48258c125 | Construct a UV sphere mesh | radius = radius || 0.5;
slices = slices || 32;
stacks = stacks || 16;
var vertexCount = (slices+1)*(stacks+1);
var vertices = new Float32Array( 3*vertexCount );
var normals = new Float32Array( 3* vertexCount );
var texCoords = new Float32Array( 2*vertexCount );
var indices = new Uint16Array( 2*s... | 1 |
f7d6d256d4e8d74fd426a2ebcb3e0fe0 | 4bfc415b2d52fadf2e0e36920f479128 | dom element를 현재 cursor caret 위치에 삽입 | var sel, range, node;
if (window.getSelection) {
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = window.getSelection().getRangeAt(0);
node = node;
range.insertNode(node);
range.setStartAfter(node);
range.setEndAfter(node);
sel.removeAllRanges();
sel.addRange(range... | 1 |
a23d2216108053892ce8a62750a5408a | fbfbe5ecc4ea43926a8dcb09ee95f2cb | associate a section with a folder in the vfs | {
$conn = $this->_connect();
if (PEAR::isError($conn)) {
return $conn;
}
if ($path != "") {
$paths = explode('/', $path);
$previous = '';
foreach ($paths as $thispath) {
$results = $this->_db->getAll(sprintf('SELECT vfs_... | 0 |
d13a90e4cc7b82dd0f7205c56c5e88db | 0cab8646735800a5bcb1e1810a169610 | Test ConcretePortChannel __eq__ function | class NexusPortBinding(model_base.BASEV2):
def __eq__(self, other):
return (
self.port_id == other.port_id and
self.vlan_id == other.vlan_id and
self.switch_ip == other.switch_ip and
self.instance_id == other.instance_id
) | 0 |
e26e4016f644c37fd6b8b8a65a575004 | 475df59cde3d4795080a87ee2127b368 | Control the display of next word word button and complete game button | public class StudyUIManager : MonoBehaviour
public void NextButton(bool value)
{
nextButton.gameObject.SetActive(value);
} | 1 |
a3af09883f9393177b1834452d37914b | ffd16194b17661a1aaa1a0c787a37876 | Näyttää sivun jossa näkyy kaikki käyttäjät | class UsersController extends Controller
public function index()
{
$user_id = auth()->user()->id;
$role = auth()->user()->role_id;
$users = User::paginate(10);
return view('users.all')
->with('users', $users)
->with('role', $role)
->with('name','Vi... | 1 |
51969e0ab5709c14141d0696ebcdb0bb | ce2c0ce1a72a16a7e0c30d688c727881 | Get JS scripts suffix. | function maipr_get_suffix() {
if ( function_exists( 'mai_get_suffix' ) ) {
return mai_get_suffix();
}
$debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
return $debug ? '' : '.min';
} | 1 |
cb02b093a07da2fb1a26a93a36e484b7 | 1ca74f729b7c25dee1fdcfcce6c7787c | Listen conversation change | interface ConversationListener
@WorkerThread
fun onConversationUpdated() | 1 |
bb6f61fe633034ed967b0267774b1ac3 | 745eab2fd0f222afd219dd3152c62659 | 将dp转化为平台大小的像素 | open class ImagePagerIndicator @JvmOverloads constructor(
private val mContext: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : LinearLayout(mContext, attrs, defStyleAttr)
fun dp2px(context: Context, value: Float): Int {
val scale = context.resources.displayMetrics.densityDpi.toF... | 1 |
21b434e0d746950e351be414d9c7070b | 03dcd4716c62d57b09b23c0e42bf8c32 | 将Notice数据类型转化成一个dict类型 | def _callback(data):
msg2dict = {}
type_ = type(data)
if hasattr(data, "_slot_types"):
msg_keys = type_.__slots__
for key in msg_keys:
value = data.__getattribute__(key)
value = _callback(value)
msg2dict[key] = value
return msg2dict
elif type_ ... | 1 |
df164bc273be3e57daf914c89769467e | 213274a8acf2e0ca12647a43bef40d2a | generation des boutons des activités en fonction du status (préinscription & participation) | if (b_commentaire == false) { document.getElementById("commentaire_destination").style.border = '#CC3300 2px solid'; }
if (b_destination == false) { document.getElementById("commentaire").style.border = '#CC3300 2px solid'; }
if (b_destination == false && b_commentaire) {
alert("Veuillez compléter t... | 0 |
f004410ddd3403b21b6d283b25fe7b70 | 1528b2aa35d31de4fcf5b33f23f64b91 | Test that non matching passwords will be caught. | class TestPasswordMatches(unittest.TestCase):
def test_passwords_dont_match(self):
user = User.query.get(1)
match = password_matches(user, 'wrong_pass')
self.assertEquals(match, False) | 1 |
656cc3c39101bba8433f756f83e08432 | 0b5d1c815e104c49d15472b1f7929725 | 得到全部会员的消费记录 | class MemberModel extends daoBase
getUserTotalConsume(id,type,startDate,endDate){
var whereClause ='';
if (!utility.isNullOrEmpty(type)) whereClause+=' and order_type ='+type;
if (!utility.isNullOrEmpty(startDate)) whereClause+=" and pay_date >='"+startDate+" 00:00:00' ";
if (!utility.is... | 0 |
df7d253fbd36e1480bc90977d3120615 | 385696c74b022d1c06c6146e0f9873d7 | Time to fixation function (for 2 alleles) | if TN == 2*mchi:
return 0.0
elif TN > 2*mchi:
return (0.5*TN - mchi)*(1 + np.sqrt(1 + (2*TN*np.power(mchi + mN, 2.0))/(mN*np.power(2*mchi - TN, 2.0))))
else:
return (0.5*TN - mchi)*(1 - np.sqrt(1 + (2*TN*np.power(mchi + mN, 2.0))/(mN*np.power(2*mchi - TN, 2.0)))) | 1 |
1a81cfc2a2c842bf588978fd8a691a01 | 3028cb510ef23e2743185e565d50d672 | Copy an interval bound. | static void interval_bound_copy(interval_bound_t* dest,
const interval_bound_t* src)
{
dest->start_min = src->start_min;
dest->start_max = src->start_max;
dest->end_min = src->end_min;
dest->end_max = src->end_max;
dest->density_max = src->density_max;
... | 1 |
1e658c0ec12162a066636d1c1e823b19 | 06340c1bf81f77a9de21c10b1cc4c835 | 検索条件をセッションに保存する | class Page extends ManageController
private function saveConditions($data)
{
if (isset($data['mode'])) unset($data['mode']);
if (isset($data['pos'])) unset($data['pos']);
$_SESSION['SEARCH_point_add_reports'] = $data;
} | 1 |
9edb87db42c4ff1d2be01f0866c39b06 | 0a5b356c4e215db667cee9f53c6b9f7f | 去除右括号,包括中文括号 | {
if (!str.StartsWith("(") && !str.EndsWith(")"))
return str;
int nest = 1;
for (int i = 1; i < str.Length - 1; i++)
{
if (str[i] == '(')
nest++;
else if (str[i] == ')')
nest--... | 0 |
1d1a8e7df2bc3e2475829edfd244eb05 | e0fcca26bfe516c9565d250de5c38e34 | function that defines a spectral window, computes absorption and emmision coefficients for this window,
using the atmospheric model profile.
NOTE: This method should be invoked after setting atmospheric profile model by initAtmProfile. | is_high_clouds=False,w=0.75,p_min=1,haze_h=None):
profile = np.zeros((n,9))
profile[:,0] = np.logspace(np.log10(atm.planet.p_surf), np.log10(p_min), n)
profile[:,1] = atm.p2T(profile[:,0])
profile[:,2] = atm.p2p_h2o(profile[:,0])
p_nonh2o = (profile[:,0] - profile[:,2])
if r_h2so4h... | 0 |
0344c8583dca3534c171783db4c24a4e | 2a2662a1d641d5f953b7ec1266b3e65c | Get the CPE's CWMP Version | class InfoKNXLB(InfoKNXXB):
def mpss_version(self):
return self.micp_version() | 0 |
8dbea3409d7f955be00b45ac4641107c | da7ac537c88530b5e57757e0cb2d1d36 | Instantiate a Recurrence rule from an FETCH_ASSOC'd database row | class Event extends Object
protected function createRecurrence()
{
$columns = array_merge(array(), $this->recurrence_columns);
$values = array();
foreach ($columns as $i => $property)
{
$values[] = $this->getQuotedColumn($property);
$columns[$i] = $this->db->quoteName($property);
}
$columns[] = $this... | 0 |
0a32d2fcc8341980a2000fb7d6f171ec | c9481ae9943e8893e5fa9c48bb0d35d0 | MSGPack packs to msgpack using JSON rules | boolPack, _ := json.Marshal(true)
fmt.Println("boolPack:", string(boolPack))
intPack, _ := json.Marshal(1)
fmt.Println("intPack:", string(intPack))
floatPack, _ := json.Marshal(2.5)
fmt.Println("floatPack:", string(floatPack))
stringPack, _ := json.Marshal("Hello")
fmt.Println("stringPack:", string(stringPack))... | 0 |
643fd411c2f8588f12614e37fbc8fcc6 | c68e36a1bbe7f08ae9a303ac2cd8b954 | 根据行数创建指定数量和位置的瓦块儿 | public class WallController : MonoBehaviour
public void createWall(int count) {
for (int i = 0; i < count; i++)
{
int index = Random.RandomRange(0, vList.Count);
Vector2 pos = vList[index];
vList.RemoveAt(index);
GameObject gameObject = Instantiate(wallPre... | 1 |
76339aabecf329a673e1a2c851e4567b | 32ce969d0c347cb7fac6528282761486 | Called when the AutoVacuum is ending. | void AutoHABLine::End() {} | 0 |
f977c2cd0ad357f2d8b767a131d66d37 | af0a89273d6532cc411a64b5714b80e4 | Given a feature dictionary and an ordering on features, returns a ternary
vector version of the dictionary. | def from_feature_dict(d, feature_seq):
value_map = {'0':0, '-':-1, '+':1}
value_mapping = lambda v: value_map[v]
return np.array([value_mapping(d[f]) for f in feature_seq], dtype=INT8) | 1 |
0840a1aae0a09d951f1a084f3284a99c | ba80c054eb8a46b1ac0da66831514c15 | change the time and handle end of time event | function timeChange(byValue = 1) {
countdown -= byValue
document.querySelector('#countdown').textContent = countdown
if (countdown < 1)
finishQuiz()
} | 1 |
a6fb9cd28226e2836a080ab8976630fc | e537b812dffac8f22442a53ac2fea736 | check for matching envelopes | for i in self.envelopes:
money = int(i.Open())
answer = input("do you want to take the money in envelope with " + str(money) + " dollars? (Y/N) ")
if answer == "Y" or answer == "y" or answer == "yes":
break
print("you got " + str(money) + " dollars") | 0 |
a243263052178c1a06bf8c83ef9e3e96 | f582babf43da0c2091be6d70572154e2 | Utility context to use the iPOPO service safely in a "with" block.
It looks after the the iPOPO service and releases its reference when
exiting the context. | def service_with_session(session: Session):
service = TemplateService(session)
yield service
service.close() | 1 |
9124a35f60fa72744367a884f640357e | 57985c1ccb6caa73eacf428d97eefa6b | 设置key毫秒过期时间 | boolean setExpire(String key, long expire); | 1 |
cf39bb30488964a28bb6ab883af00652 | e93a6f0e27d6a0b2af365ef2a2cf5488 | 加入还款计划 | class Finance extends backend{
function make_repay_plan($deal_id){
$deal_info = M("deal")->find($deal_id);
$load_list = M('deal_load')->where(array("deal_id"=>$deal_id,"contract_no"=>array("neq","''"),"is_auto"=>0,"is_has_loan"=>1))->select();
foreach($load_list as $key=>$val){
if($v... | 1 |
c98cdf9d5afa6d7d541702e189804fa0 | 1ebb7a149ad5d01f92a5b0536fffefad | Show settings menu and hide start-screen menu | public class PauseMenu : MonoBehaviour
public void Settings() {
transform.GetChild(0).gameObject.SetActive(false);
transform.GetChild(1).gameObject.SetActive(true);
} | 1 |
58d4b4c9da19d710a1c8045e65c4df5f | 0e6dc9f63477a48fbb00d6ecbafcae1e | function for celsius categories | if(temp >= 40){
console.log(temperature_description[0])
return temperature_description[0]
}
else if(temp < 40 && temp >=30){
console.log(temperature_description[1])
return temperature_description[1]
}
else if(temp < 30 && temp >= 25){
console.log(temperature_description[2]);
return temperature_descript... | 1 |
41983a8deda24651e027958bbae87a2d | 8d389f0a32e963f93cc319eeb67275b8 | Calls the set Vulnerability Assessment APIs for the database Vulnerability Assessment Settings for the given database in the given database server in the given resource group | public class SqlManagementClientImpl extends AzureServiceClient
public DatabaseVulnerabilityAssessmentScansInner databaseVulnerabilityAssessmentScans() {
return this.databaseVulnerabilityAssessmentScans;
} | 0 |
0ac6a957f255e03f87475922af7f86dc | 303c4be87717c6a8cc471f65cfac7af9 | Export current state with security sensitive data removed. You should override that.
Just calls export() by default. | class CDPProvenance(object):
def export_prov(self):
raise NotImplementedError() | 0 |
5839b4aace59949491b3a17f13602d5c | b580dfb18d1c31f9003369d8df8a7a6c | Populate interfaces into the database. | class DashboardServiceProvider extends ServiceProvider
protected function setupInterfaces()
{
$this->app->bind(
'Odotmedia\Dashboard\Repositories\Auth\AuthRepositoryInterface',
'Odotmedia\Dashboard\Repositories\Auth\AuthRepository'
);
$this->app->bind(
'Odotmedi... | 0 |
b7056f4b634a451e8c6f16f7411bc908 | bc06842aed23e58f20a9da654950783a | NAME
uartRxDataCallback
DESCRIPTION
This is an internal callback function (of type uart_data_in_fn) that
will be called by the UART driver when any data is received over UART.
See DebugInit in the Firmware Library documentation for details.
PARAMETERS
p_rx_buffer [in] Pointer to the receive buffer (uint8 if 'unpacked... | {
uPortUartEvent_t *pEvent = (uPortUartEvent_t *) pParam;
uPortUartData_t *pUartData;
(void) paramLength;
pUartData = pGetUartDataByHandle(pEvent->uartHandle);
if ((pUartData != NULL) && (pUartData->pEventCallback != NULL)) {
pUartData->pEventCallback(pEvent->uartHandle,
... | 0 |
a9167cdcd82bcef8ae59f347d38d031b | 16e66b57bae73c1020678d2e9e73949b | GET: RouteTo | namespace WebApplication2.Controllers
[Authorize]
public class RoutesController : Controller
public ActionResult Index()
{
var items = _routeService.GetAll(User.Identity.GetUserId());
return View(items);
} | 0 |
71fef5bf3c4679bda7fc463e3f102ed7 | adf97452559bac7ddd584f0c71baa304 | Nacita test (bez otazok) pre daneho studenta. | {
return jdbc.query("SELECT * FROM \"TESTS\" WHERE \"ID\" IN (SELECT \"TEST\" FROM \"TESTS_USERS\" WHERE \"USER\" = ?)",
new TestsMapper(),
user.getId());
} | 1 |
6a32bd291b3934f9f7585f787c277c6a | cfae12e4ccc1aeeb236af90ab20a3935 | 2D upsampling operator using transposed convolution | class StyleTransferNetwork(object):
def _upsample(cls, x, n_filters, kernel_size, size=2):
out = keras.layers.UpSampling2D(size=size, interpolation='bilinear')(x)
out = cls._convolution(out, n_filters, kernel_size, padding='same')
return out | 0 |
753616ffd390cb1d39ff661c360a9393 | a7788485b86bf40bf9b2557186830ed5 | Gets the current bulk data alignment. | static int
mphi_msg_rx_alignment( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_RX_CHANNEL_T channel )
{
const MPHI_MSG_DRIVER_STATE_T *state = (const MPHI_MSG_DRIVER_STATE_T *)handle;
return channel == MESSAGE_RX_CHANNEL_BULK ? state->rx_addr_align_cached : state->rx_addr_align_uncached;
} | 1 |
c499b0e0af38e94557927d7c5682e433 | 74ae9538b49d34b9d028c22f46813187 | List all Permissions in the Definition. | namespace Spring.Messaging.Amqp.Rabbit.Admin
IList<string> ListPermissions(); | 1 |
1d99f50b3cf91db3e6b3a0e7c88f2ef5 | bc049515bda8e6867899a1bd659d3fa6 | 打印导航栏信息 | function showNavigation(){
navigation = '';
queryStack(topElement );
console.log('导航栏:'+navigation.substring(0,navigation.lastIndexOf('>')));
$('#localHost').html(navigation);
addNavigationClick();
} | 1 |
52e81ee88a8437aedfe5a8e5b03e0ef4 | 0340f5c3d39411f262b3eb331fb2b2bd | Translate OID to ASCII string | class ASN1
static function encodeOID($str) {
$numbers = explode ( '.', $str );
$oid = chr ( array_shift ( $numbers ) * 40 + array_shift ( $numbers ) );
foreach ( $numbers as $num ) {
if ($num == 0) {
$oid .= chr ( 0x00 );
continue;
}
$pack = '';
while ( $num ) {
$pack .= chr ( 0x80 | ($num... | 0 |
dbd334ca26b93cd19cc84e6ec0bd31df | 20da33fe9377f6a4a91f69c1043dd618 | Deletes a
{@link google.iam.v1beta.WorkloadIdentityProvider|WorkloadIdentityPoolProvider}.
Deleting a provider does not revoke credentials that have already been
issued; they continue to grant access.
You can undelete a provider for 30 days. After 30 days, deletion is
permanent.
You cannot update deleted providers. How... | {
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('delete', [$params], Operation::class);
} | 1 |
03cd81837e3d9fc3bc0892807f4eebaa | 0fa9903446d37b9ecb74f0aa61444aff | Test if a model with name `tag` exists in the world description.
> *Input arguments*
* `tag` (*type:* `str`): Local name identifier of the model.
> *Returns*
`bool`: `True`, if model exists, `False`, otherwise. | if isinstance(bodies, str):
bodies = [bodies]
for body in bodies:
if not body in self._model.body_names:
return False
return True | 0 |
de3511f3076ee0559e890d6e86d040f2 | 6ad65ef59e17337882a758af2098424d | update camera goal based on mouse movement | void GamePlayer::injectMouseMove( const OIS::MouseEvent & evt )
{
updateCameraGoal(-0.05f * evt.state.X.rel, -0.05f * evt.state.Y.rel, -0.0005f * evt.state.Z.rel);
} | 1 |
acfb10eafcf1c58f2bed5c8af1c6825a | 2e71254a39f8d08fe7db2a6fd8c6309b | Get Width (px) \
The width of the graph with trailing px unit eg. "600px". \ | class WorkbookChart extends Entity
public function getWidth()
{
if (array_key_exists("width", $this->_propDict)) {
return $this->_propDict["width"];
} else {
return null;
}
} | 0 |
c9e69578cde733a152e7a2a99942306e | f85c80b5cbe3d7707c95b23383346483 | Returns the updated GPS data | class GPSDevice():
def update(self):
return True | 0 |
0ff6078e10a28a69f0343cfb15b08aaf | 5fdf1dcba59a94d0f038c160b637fa3c | オーダー情報コメント(<code>ORDER_INFO</code>)の検索値をセットします。
(ANDまたはOR, OR以外の文字列の場合はANDとみなします) | public class ReviewBukkenAlertCountParamBean
public void setOrderBy(String orderBy) {
this.orderBy = orderBy;
} | 0 |
a3f4383801ffb280ad2fc4d6feee4f71 | 28ade2f771ad4639b50c52b977b13a96 | ジャンプの方向を決める | {
if (dir == RUN_UP)
{
m_jumping = true;
m_vel.y = -RUN_JUMP_VEL;
return;
}
} | 1 |
5345b9b54f1a12b7d2234efb94fa2de4 | 285d859f58b6b643e95b2d65d6586bc1 | Add a bonus marker to the tin plate | void addTinPlate(IBonusMarker bonusMarker); | 1 |
7c55ef4bcf29cdd37a5294a1a586a29d | bc01ea1770d95e800ef053b7f7ac8cf2 | Returns the meta object for class '{@link fr.mleduc.fsmwithmethods.fsmWithMethods.MethodCall <em>Method Call</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getMethodCall_Method(); | 0 |
793f6263b8ca774b29cd5b0dda5a114d | 9cc146f7b35319d703a1ffa39f868a38 | Expands but does not evaluate a macro. Very useful for debugging | cf = sys._getframe(1)
val = eval(expr, cf.f_globals, cf.f_locals)
print(debug_expr_fmt % (cf.f_code.co_name, expr, val)) | 0 |
a0ca27c2273023de65727ca8ff423ad6 | 19dbb07124203fe08719bc5ad502ebb4 | Returns the Klarna confirmation text for the current bill country | {
$text = Yii::t('hipanel:finance',
'{units, plural, one{# unit} other{# units}} × {quantity, plural, one{# day} other{# days}}',
[
'units' => $this->model->quantity / ($this->model->bill_quantity ?: 1),
'quantity' => round($this->model->bill_qua... | 0 |
61e99523653436c8905fbee5fad5b6e0 | 9811290857984ad124a496070b1119db | This method visualises the time and the date on the bottom right corner. | {
String hour = component.getHour();
String minute = component.getMin();
String second = component.getSec();
String amPm = component.getAmPm();
g2.setFont(new Font("Monospace", Font.BOLD, 22));
g2.setColor(color);
int add = 35;
for (int index = 0; index < 2; index++)
{
g2.drawString(":", (xCent... | 0 |
ea0cbcdc10fcabd18e4aaea568a42ecb | b3c53af7e4cd2b7ba2f7dab1491fd0dd | Like stat(path), but do not follow symbolic links. | function stat(path: string) {
return statSync(path, { throwIfNoEntry: false });
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.