query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d979e189fc31e2f8914e7920d44ee893 | 88e95c0aa8449bf6e34c6f3c0048b603 | Relación belongsTo | class Controlacceso extends ActiveRecord
protected function initialize(){
$this->belongsTo('usuario_id','usuario','id');
} | 1 |
9222547ccf242db536272bab5a80c2ba | aa878e9f92f787ab2f50ec11f9443c09 | Luua meetod, mis küsib kasutaja käest arvu ning teeb seda seni kaua, kuni kasutaja on andnud korrektse sisendi | pin = get_four_dig_input("Pinkod:")
if pin == self.pin_kod:
return True
else:
return False | 0 |
882d7cf94f4e0f258eaf6cd1def228a7 | 020b8b19461cc6f644b6f43eba639408 | FromPrinter copies the configuration from an existing Printer | {
this.scalingType = pp.scalingType;
this.duplexMode = pp.duplexMode;
this.isPageSourceByPageSize = pp.isPageSourceByPageSize;
this.printRanges.AddRange((IEnumerable<PrintRange>) pp.printRanges);
this.numberOfCopies = pp.numberOfCopies;
} | 1 |
d7e78705444412ca06805cba41cb1ff2 | f651fe666a4deb4a67fc1f6596bf7e29 | 返回yyyyMMddHHmmss格式的当前时间 | public class StrUtil
public static String getCurrentTime_yyyyMMddHHmmss() {
return getCurrentTime("yyyyMMddHHmmss");
} | 1 |
dcdf06a34ddded23871940e1142ffc81 | f70a7806c2cc3e2d0fce361f46b91242 | Generates the DTO classes. | {
Console.WriteLine($"TargetFolder: {targetFolder}");
_generatorContext = new CodegenContext(outputFolder: targetFolder);
Console.WriteLine("Reading Schema...");
DatabaseSchema schema = Newtonsoft.Json.JsonConvert.DeserializeObject<DatabaseSchema>(File.ReadAllText(_inputJsonSchema));... | 1 |
8d9414458fce0368484414b4e92661ee | cb0063e6e51aeff807d6f09277ff4432 | 檢查是否與 Photon Cloud 連線 | public class LauncherScript : Photon.PunBehaviour
public void Connect ()
{
if (PhotonNetwork.connected) { return; }
PhotonNetwork.ConnectUsingSettings (gameVersion);
Debug.Log ("Photon connected!");
} | 1 |
7f968900e3d98be4b4e6052fe7d45ad4 | bc8b4a00181820021e795711d7bfac54 | 重设按钮<br>
<p>让所有的按钮均不可见 | public class TitleBar extends RelativeLayout
public void reset() {
if (mLeftImgBtn != null) {
mLeftImgBtn.setVisibility(View.GONE);
}
if (mLeftBtn != null) {
mLeftBtn.setVisibility(View.GONE);
}
if (mRightImgBtn != null) {
mRightImgBtn.setVisibility(View.GONE);
}
if (mRightBtn != null) {
mRigh... | 1 |
0f15d92b5696a5ea2a49f57d391ae7b5 | c62f228a1b0bfb357b151a54a7b60f21 | Returns |z|^2. | if type(x) is np.ndarray:
return np.sqrt(zmul(x, zconj(x)))[...,0]
elif type(x) is torch.Tensor:
return torch.sqrt(zmul(x, zconj(x)))
else:
return -1. | 0 |
d8340cafb1b3461e2176876984a8824f | 337fbc7e4ab2793ef1c77112590f6479 | Converts date from JS (obj) form to NS (string) form | {
jint year = env->CallIntMethod(javaDate, JavaClasses.gregorianCalendarGetFieldMethodID, (jint)1);
jint month = env->CallIntMethod(javaDate, JavaClasses.gregorianCalendarGetFieldMethodID, (jint)2);
jint day = env->CallIntMethod(javaDate, JavaClasses.gregorianCalendarGetFieldMethodID, (jint)5);
jint hour = e... | 0 |
f95bc819dc5501bf93b382e8a938f41d | 725fc9cb26550ab514eb5bcbafa56124 | Testing retrieving an unexisting subscriber | class SubscribeServiceTest extends TestCase
public function subscriber_not_existed()
{
$this->expectException(NotFoundException::class);
$publisher = factory(User::class)->create();
$this->service->subscribe(999, $publisher->id);
} | 0 |
26bf031970c55326fd4b75f735522cd8 | 279c7a91499052ef8e502c8dc278437e | Returns all instances of weapons by room Id | if (weapons == null) return new ArrayList<>();
return new ArrayList<>(weapons);
} | 0 |
479cd39fdd948ce119e0a249dba7f0d6 | 16cf11e9b7b6a195d4826555b14b1703 | コーチマークを非表示 | function hideCue() {
$('#cue').fadeOut('fast');
$('#cueVideoDiv').hide();
setUpDrawing()
} | 1 |
e69a1c0cd8c4b8e9f028be2ea240f87c | 7185d0eec99e8cda90a57db15551d0d7 | Check if the area is owned by the current user (discovered from context) | boolean isOwner(String regionID, World world, Profile profile); | 1 |
d7606d0ba302094954f74455b9cdc759 | 6148321518e3d77ced5c730329472a40 | Required when properties change, such as contrast reversal, or when the video widget changes, such as a resize | class Input(InputOutputOverlay):
def handle_updated_props(self):
if self.has_video():
self._update_video_filter_caps()
for source in self.sources():
source.handle_updated_props() | 1 |
64cc762e2d7468525f773787fe485f9b | 3e6eac276c8ebb30591fe031aa1484d0 | Servicio Web para Ingresar una Cobertura | {
try
{
ENCobertura oCobertura = null;
LNCobertura olnCobertura = new LNCobertura();
oCobertura = olnCobertura.getCobertura_ByID(idCobertura);
return Json(oCobertura, JsonRequestBehavior.AllowGet);
}
... | 0 |
d216a2c50e86c2e1c5f856ae3d5bc8e1 | 472071466bfa9cb5093070a9e4610e41 | Write the initiative results to the report | List<Map> initiatives = (List<Map>)phoenixData.get("initiatives");
for (Map initiative: initiatives) {
List<Integer> values = (List<Integer> )initiative.get("value");
for (int i = 0 ; i < values.size() ; i++) {
if (i >= values.size()) {
values... | 0 |
0a66d9903df9d8cc1054dc52187b6783 | 3c9870f99321b18bffd1c3737213a281 | 如果填写了发货和收货地址,就可以计算运费 | {
using (ISession s = SessionFactory.Instance.CreateSession())
{
ShoppingAddress shippingAddress = s.Get<ShoppingAddress>(shippingAddressID);
if (shippingAddress == null) throw new Exception("不存在该用户收货地址");
decimal price = 0, first_price = 0... | 1 |
2e1231d67f7e577adc73182c30fb4bd9 | dd0286425155872bc0b6cc00b40b3c95 | 根据给定userId获取收藏的SimpleBranch列表 | List<Long> getCollections(Long userId); | 0 |
12488ec1d4fd2bbb82313aab9685605d | 117e4a52fe3cd4ef3f5bb1ad78cbbdc3 | Removes an extension from this format. | public void removeExtension(Extension extension); | 1 |
f8622d3628df3573901e7544b4f34126 | 4f48490d1aa9d5c42300a4e3a0aa39e7 | Loads AttributeCollection object from xml | {
this.ID = Element.AttributeText("ID");
this.ClassroomName = Element.AttributeText("ClassroomName");
this.Capacity = Convert.ToInt32(Element.AttributeText("Capacity"));
this.LocationOnly = Bool.Parse(Element.AttributeText("LocationOnly"));
this.Locati... | 0 |
b1e89dc4c3795a6839a490a8280d09b2 | 3ec20283d1d1cb172f9624c4f3341593 | Tester at reegnskapet er i overenstemmelse over en periode | int minsteAntallMåneder = grunnlag.getMinsteAntallMånederGodkjent();
int minsteAntallDager = grunnlag.getMinsteAntallDagerGodkjent();
return sjekkErErOverAntallPåkrevd(opptjeningPeriode, minsteAntallMåneder, minsteAntallDager);
} | 1 |
0003656c205bcb5a9c32b7684684c332 | 5e4ac321dab7883051531573a50e32fe | Error creating a language with a bad map | config = cleantopo_br.dict
config.update(process=output_error_py)
with mapchete.open(config) as mp:
with pytest.raises(errors.MapcheteProcessOutputError):
mp.execute((5, 0, 0)) | 0 |
c0c3c9f7ea5f71a5d45183a2dcdb5d86 | 419c50a510ac594bbc8d7d414d3ac739 | 根据问题类型Id查问题全名 | {
if (strid != "")
{
Catering_Model.QF_ProblemType model = new Catering_Rules.QF_ProblemType().GetModel(Convert.ToInt32(strid));
if (model != null)
return model.ProblemTypeName;
else
return "";
... | 1 |
fb7a26a24d0214b5968c8752740ab0ec | 8df2abda0328b17e2dfe50afe4fa2da3 | <p>
Updates a stack as specified in the template. After the call
completes successfully, the stack update starts. You can check the
status of the stack via the DescribeStacks action.
</p>
<p>
To get a copy of the template for an existing stack, you can use the
GetTemplate action.
</p>
<p>
Tags that were associated with... | public StackStatus updateCurrentStackStatus(StackStatus updated) throws JSONObjectAdapterException, SynapseException; | 1 |
f9bfae8efdcdc6336396d000fa1c8593 | 920dd0f5e41f993e2b616e72b4d5cb6c | # Stan can only take consecutive integers for groups, so turn factors into consecutive integers | cx = class(x)
x = levels(factor(x))[1]
if (!cx %in% c('factor', 'character')) {
class(x) = cx
}
x
} | 0 |
e66cf9beab7483844ab4d7a0593bc2e9 | 4785bf59e65cd6ba3f5cc17cf741652a | Manage Hyperthreading for an ESXi host system | print "Note: Enabling HA"
try:
with settings(host_string=self.ssh_user + "@" + host.ipaddress):
if fab.run("cat /etc/redhat-release | awk '{ $3 = substr($3,1,3); print $3 }'") == "6.2":
return fab.run("xe pool-ha-enable heartbeat-sr-uuids=$(xe sr-list type... | 0 |
7fe100d0cfcfba417424e5168036619d | 5cd00064bdd9917de34c2326ffbc349f | Returns a cause if the cache is corrupted, and null otherwise. | public MsLinkEventCause getCause(); | 0 |
b7d759f16c30e3920583f358b266fd10 | 0be6ccff9aff4ab21517da48be719b8b | 检测主机连接性 | print('########正在检查网络是否连接########')
flag1 = 1
flag2 = 1
flag3 = 1
while flag1 != -1 or flag2 != -1 or flag3 != -1:
ping_host = 'ping ' + host
info = os.popen(ping_host).read()
target_str1 = '请求超时。'
target_str2 = '无法访问目标主机。'
target_str3 = '一般故障。'
flag1 ... | 1 |
afaaf21bb3ef1ef6c413d897a5fe8968 | 3a167938a1611e859d29de70c0652c91 | Makes initial authenticated request to get Khan Academy user
information | JSONObject parameters = new JSONObject();
makeRequest(LOGIN_URL, parameters, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
JSONObject jsonForm = (JSONObject) new JSONTokener(response).nextValue();
... | 1 |
a55ee1c598d9b04be178140e6f675345 | c520481005aa59630b011002dda3e372 | 域名7天内到期提醒 | class PartnerController extends Controller
public function day7()
{
$barData = $tick = $message = [];
$day_arr = [];
for ($i = 7; $i > 0; $i--) {
$day_arr[] = date('Y-m-d', strtotime('-' . $i . ' day'));
}
$day_num_arr = $this->_stat_month_user_add($day_arr);
... | 0 |
d413737add0f69747a57ed83db2a57a7 | a9611bc8ce7837f18ed05589cb7da516 | This function opens the systems fileChooser | try {
FileChooser window = new FileChooser();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
} | 1 |
2a3440d7dec5a3364fe7815d9a919a4d | a64c78a7223f6c73f6f993d501348140 | Gets a Box2D Body Definition from its name in the Scene | namespace Tso2Pmd
public class T2PPhysObjectList
public PMD_RigidBody GetBodyByName(string name)
{
return body_list[GetBodyIDByName(name)];
} | 0 |
1175385de4bf7e004e6e0e37baf476ca | 3ec45d9c333abdc7f2fd2c04951e655b | Get the default email body from name. | if self.get_template_selected() == 'Default':
name, type, role = person[0], person[2], person[3]
name = name.split()
first, last = name[0], name[1]
employee = self.get_person_selected()
if 'Account' in type or 'Account' in role:
return ... | 1 |
f12b227694de12098eca6ff6b4ae40dd | b0ca60361c754addab6d08390f5b58d5 | Adds a list of lore lines into this stack.<br>
Colouring is provided. | public class ItemMetaMock implements ItemMeta
public void assertLore(String... lines)
{
assertLore(Arrays.asList(lines));
} | 0 |
118eb5c571e3ad6ec7884f897eec87f5 | 37a995e9e15ff72480f399c769ba3a9e | Fungsi untuk mengkonversi bilangan oktal menjadi bilanganhexa | {
char* hexaDeci;
hexaDeci = (char*)malloc(100);
int i = 0;
while (n != 0)
{
int temp = 0;
temp = n % 16;
if (temp < 10)
{
hexaDeci[i] = temp + 48;
i++;
}
else
{
hexaDeci[i] = temp + 55;
i++;
}
n = n / 16;
}
hexaDeci[i] = '\0';
reverse_str(hexaDeci);
return hexaDeci;
} | 0 |
18131fadaa2cc878f8f87957e006dc81 | 30776219a16cf064b5b333bdd3a3a65f | 过渡性的路由,用于使用uid跳转到userIndex的情况 | class UserController extends CI_Controller
function switchUser($uid = 0) {
if (!$uid || !is_numeric($uid)) {
echo 'User id is incorrect!';
return false;
}
header('Location:/test_task/index.php/Welcome/index/' . $uid, true, 302);
} | 1 |
4506de8506caf42ea6ef38d43d84febd | 967a35158346e9c713bf5c675da64150 | Map linearly from the interval [a,b] to [c,d] | function MapRange(a1, a2, b1, b2, s)
return b1 + (s - a1) * (b2 - b1) / (a2 - a1)
end | 1 |
083355c1bc9aa64b316386354b15cd2b | c069fb71e05c0d40903128fe1efba61c | Helper class to create a hex string from bytes | out = ""
hex_len = len(hex_bytes)
while i < hex_len - 1:
out += chr(int(hex_bytes[i:i + 2]), 16)
i += 2
return out | 0 |
26536b4c18e3b443ac76757786ac0716 | 49801711dca8e73b2f452833ed8b30fe | 价格走势 | $list = Db::name('OrderTrend')->select();
$dates = '';
$prices = '';
foreach($list as $v){
$dates .= "'".$v['dates']."',";
$prices .= $v['price'].',';
}
$this->assign('dates',trim($dates,','));
$this->assign('prices',trim($prices,','));
... | 1 |
30209845197dd70a0ddee5ef2c4e1ab3 | d16c2526e22b85131fd30b84705f3fd8 | Initialize a :class:`Molecule` instance. | class MolecularProperties(utils.DotDict):
def __init__(self, mol, **properties):
super(MolecularProperties, self).__init__(positions=mol.positions.copy(), **properties) | 0 |
5be7c66f7bb212d3802e7ab127a685b2 | 384f669785d75b059da3ebf4b7f44454 | Returns the EventAttendanceModel object associated with the given userID and eventID | public Event_User Get(@Named("AEvent_ID") String Event_ID, @Named("BUser_ID") String User_ID) {
Event_User event_user = new Event_User();
try {
ResultSet rs = MySQL_Util.select(null, Table_Events_Users.Table_Name,new String[]{Table_Events_Users.Event_ID, Table_Events_Users.User_ID},
... | 1 |
75b9f18029d6e3bcc3abd1d40e91e081 | 80ee7594123be1c80c370abf79c7e33e | Consigue la fecha de entrega del {@code Prestamo}. | @Entity
public class Ficha extends Model
public Date getFechaPrestamo() {
return fechaPrestamo;
} | 0 |
61ece2e5a7fd1c4265de1f71ebd36e69 | 5b2b1ee9334905d5519a05044eb8b3a0 | Helper method to set hair overlaps for each direction. | state.hand.x = to_overlap.x
state.hand.y = to_overlap.y
state.eye.x = to_overlap.x
state.eye.y = to_overlap.y | 0 |
cc5b3771ee03b6db00386ab207296a90 | 5a199430d12ef35a924ad29912326297 | 查找在矩形rc里的元素,pfnSHCB是回调函数,pfnParam是回调函数的参数 | HDC hWindowDC = NULL;
HGDIOBJ hPrevPen = NULL;
HGDIOBJ hPrevBrush = NULL;
RECT rect;
long lRet = 0;
static HPEN g_hRectanglePen = NULL;
GetWindowRect (hwndFoundWindow, &rect);
hWindowDC = GetWindowDC (hwndFoundWindow);
if (g_hRectanglePen == NULL)
g_hRectanglePen = C... | 0 |
06cb1e625c1bb23a7027925a62ce5425 | 093ff2d354b0dc751340769a4985aab9 | Gets the only buy stock quantity. | class FUTUStockPosition(BasePosition):
def bought_quantity(self):
user_system_log.warn(_(u"[abandon] {} is no longer valid.").format('stock_position.bought_quantity'))
return self._quantity | 1 |
4d2b4cc614672a6a5cf74304b915d393 | 9cedffa720b6bfa81bab9feb8de01e73 | Fire event logout to attached listeners. | {
$event = $this->events->trigger(new LogoutEvent(AuthEvents::LOGOUT, $this->getUser()));
$this->removeUser();
return $event;
} | 1 |
f116c6d39c804f9f8984a354ffc30e92 | d3401cb5cad052119d9281ad8679dc5b | Get a collection of possible check types. | {
$ret = array();
$default_names = array('class', 'function', 'constant');
foreach ( $this->getConfigSetting('bc_checkers', $default_names) as $name ) {
$ret[] = $factory->get($name);
}
return $ret;
} | 1 |
e2e69cad27e7a8e081b4d2bd6be944c0 | b2c3ef874e58920ec410d6e51eae2401 | Just toggle a pin to make some noise | STATIC mp_obj_t pin_toggle(mp_obj_t self_in) {
pin_obj_t *self = self_in;
MAP_GPIOPinWrite(self->port, self->bit, ~MAP_GPIOPinRead(self->port, self->bit));
return mp_const_none;
} | 1 |
bb083082948fd99033edf7637683cb92 | d5e1c4b1c28a5fd2601964fb97673813 | 从小时集合中获取最相近的时间点 | function Time.getNextTime(tList)
local dt = os.date("*t")
local seconds = dt.hour*60*60 + dt.min*60 + dt.sec
for _, sec in pairs(tList) do
if sec > seconds then
return os.time({
year = dt.year,
month = dt.month,
day = dt.day,
... | 0 |
30530d543a37a3096195b143822eb118 | e529a31c7f39f56301e490b51fa76ed8 | Get the total number of bytes sent over the interface since the CPE was last reset. | public int
getBytesSent(); | 1 |
6be301fc319a13764dbe72197891faa0 | 84a79a50f43a49d78816b9d5daad4139 | https://edabit.com/challenge/9iLhKgqZn5exBrmWm | let currentDate = new Date();
let theCurrentYear = currentDate.getFullYear();
let yearDifference = year - theCurrentYear;
let newAge = age + yearDifference;
if (newAge < 0) {
return `The year ${year} was ${-newAge} years before you were born`
} else if (newAge > age) {
return `You will be ... | 1 |
69b69618adb7e292b889f9f2b8121677 | 28e63bb9a6fb8785e99d9fa231b53836 | 根据user的缺失参数列表构造询问消息 | public class ResponseHelper
public static Map<String, Object> missingArgsResp() {
map.clear();
map.put("code", ResponseCodeMsg.MISSING_ARGS_CODE);
map.put("msg", ResponseCodeMsg.MISSING_ARGS_MSG);
return map;
} | 0 |
5a9c241da5bc68fde7831b3946f225d3 | b34c621b30eb00bfaf1d644f470220df | 获取Consumer名称 | String getConsumerQuery(); | 0 |
cca975245ba5f1c152cfabdb98cff798 | 9109ab30761803fc63639a49a839f0a8 | Generates adversarial examples using Carlini and Wagner's targeted L2 attack. | import torch
if y is None:
raise ValueError(
"`ImperceptibleASRPyTorch` is a targeted attack and requires the definition of target"
"labels `y`. Currently `y` is set to `None`."
)
adv_x = x.copy()
self.estimator.model.train()
... | 0 |
ca5fabdbd3e53794dec5e35c13c876cf | 1d9b6a0feafa9803f5a16576c76f5d4f | Get All Permission Display Name. | class PermissionService
public function showAllPermissionByArray()
{
$permissions =$this->permissionRepository->all();
$perm = [];
foreach ($permissions as $permission){
$perm[$permission->id] = $permission->name;
}
return $perm;
} | 1 |
d1fb7cc3f4210f7d2b03d01a4c860537 | 0e4434c9fbe5c969724f515c0efd4aca | 获取所有可用服务器节点的剩余队列大小之和 | class Server(ServerProxy):
def get_routers_task_queue_size(cls, router_id: int) -> int:
remote_sys = cls.get_router_by_id(router_id)
result = 0
if cls.get_running_task(remote_sys) is not None:
result = 1
task_queue = cls.get_waiting_task_queue(remote_sys)
return len(t... | 0 |
4a3182a8c83315083dd2e064a7659f0d | 919eb3cccddfecddbc981efde64c091d | 장바구니에서 주문한 제품 삭제 | public String selectDelete(HttpSession session,
@RequestParam(value = "checkBox[]") List<String> checkArr, CartVo cart) throws Exception {
if(session.getAttribute("login") != null) {
String mem_id = (String) session.getAttribute("login");
int cart_no = 0;
if(mem_id != null) {
cart.setMem_id(m... | 1 |
d947d9265ca92257264159ba7a5cb7f1 | bae806976351c6e9740fc243916ce323 | scalar object for states - run some episodes -> get some states -> normalize along dimensions
with this gathered data
state.size = 2 * n_stocks + 1
number of shares for each n_stocks + prices for each stock + total amount of cash in hand | self.broker.reset()
self.data_buffer.clear()
self.episode_stats = None
self._raw_data = None
self._normalized_data = None
self._midpoint_prices = None
self.tns = None
self.rsi = None | 0 |
461037a901cf02ee78c5e19924159bf7 | 7d3f68203a745d928b9e0cb81996ca8a | 获取样条上的二阶导数 | {
Vector left = Vector.Zero1d(degree + 1);
Vector right = Vector.Zero1d(degree + 1);
List<Vector> ndu = Vector.Zero2d(degree + 1, degree + 1);
ndu[0][0] = 1.0;
for (int j = 1; j < degree + 1; j++)
{
left[j] = parameter - kno... | 1 |
d07f8bf71a9411cf861b9380c08785d9 | 021ec279e462a44f3645d2ce6c132e79 | Draws all the gates of the circuit | Button plusButton = new Button("+");
plusButton.setPrefSize(23d,19d);
plusButton.setFont(Font.font("Helvetica", 9));
plusButton.setLayoutX(105.0);
plusButton.setLayoutY(5.0);
Button minusButton = new Button("-");
minusButton.setPrefSize(23d,19d);
minusButt... | 0 |
259245690e9e6d572b361b222d0830a5 | da5fb710ee554addc1ee0ad750a2df84 | Gera a tabela para gerenciamento de grupos | class Sistema_LogadoController extends Controller_Action
public function cadastrargrupoacessoAction() {
} | 0 |
760e75c2b8c43e6e88636056d6f6f8ba | 1c6eb16de61f7e93c14c3ce8afb9412d | метод который ограничивает движение Ладьи по игровому полю | public class Game_2 extends JFrame implements KeyListener, ActionListener
private void setInLimits(){
int lastBox = (CANVAS_WIDTH/boxSize) - 1;
if (ridingHood.getPosition().getX() < 0){
ridingHood.position.x = 0;
}
else if ( ridingHood.getPosition().getX() > lastBox ){
... | 1 |
b8c60459b3d8938d90d182afa5b05d88 | b250a2d75df618eb8953aac40d6d414f | Will generate the given number of random people | {
var names = new[] {"Connor MacLeod", "Roger", "Klas", "Anders", "Jerker"};
foreach (var name in names)
{
for (int i = 0; i < 10; i++)
{
PostPerson(name);
}
}
Console.ReadLine();
... | 0 |
8897f75aa6962f9c5806829956012837 | 772340934deb42ff1b32a7387de4d5cc | Verify the Request Abstract Types
3.2.1 Complex Type RequestAbstractType
All SAML requests are of types that are derived from the abstract RequestAbstractType complex type. | class Validator
public static function validateAuthnRequestType($authnReq) {
self::checkByValue($authnReq->getID(), self::$BankId_MerchantReference);
self::checkUrl($authnReq->getAssertionConsumerServiceURL());
self::checkByValue($authnReq->getRequestedAuthnContext()->getAuthnContextClassRef()[0... | 0 |
ffabef89412c1475a651d6220b4f0616 | 5e204b8fb0be766672d95ec889c2b234 | 获取指定UID的应用程序接收的流量(KB) | public class NetUtil
public static String getAppFlow() {
long recv = TrafficStats.getUidRxBytes(android.os.Process.myUid());
long sent = TrafficStats.getUidTxBytes(android.os.Process.myUid());
return sizeToSize(recv + sent + "");
} | 0 |
b99d072c6b4fd31adfae2ad36254a5b8 | b6dce31bb7a85d2d9bb6ae269dddb919 | Отправка уведомления при создании жалобы | {
$creatorId = $comment !== null ? $comment->creator_id : null;
if (null !== $request->executor_id && $creatorId !== $request->executor_id) {
$this->addNotification(
$request->executor_id,
ProfileNotification::TYPE_COMMENT_NEW,
Yii::t('app'... | 0 |
2810178276813e98baec9f62cc812c66 | 68cb1502ae22013b8391ec268840e8b6 | 将字节流转换成数组 | namespace System.IO public static class StreamExtensions
public static byte[] ToArray(
#if !net20
this
#endif
Stream stream, bool byStart) {
if (stream is MemoryStream)
return ((MemoryStream)stream).ToArray();
byte[] result = null;
using (... | 1 |
d272f95dda88638991841f5f2fea2d7e | 9cb4193901ffe76921b272b0fda6b7aa | Determines how many milliseconds elapsed between the user navigating to the page and
the current time. | const timeStampInMs = window.performance
&& window.performance.now
&& window.performance.timing
&& window.performance.timing.navigationStart
? window.performance.now() + window.performance.timing.navigationStart
: Date.now();
return timeStampInMs.toString();
} | 1 |
69595d2e98ed4c4fbcf537ca3e9cf048 | 2d49c368c13106d2c22534655b6b0b82 | Returns elements where the second token is ASSIGN
(updating rules with no LABELs) | public class OGBaseVisitor<T> extends AbstractParseTreeVisitor<T> implements OGVisitor<T>
@Override public T visitAssgnments(OGParser.AssgnmentsContext ctx) { return visitChildren(ctx); } | 0 |
544b051b4e0831930d06e3843e40ea95 | ab35857d1ec237661b51ee28b464e1d2 | @brief Constructor for KinectAngleController class. | namespace fawkes
KatanaControllerOpenrave::KatanaControllerOpenrave(fawkes::OpenRaveConnector* openrave)
{
__openrave = openrave;
__initialized = false;
} | 0 |
9a37919048b48563160c72ed4cd9e5b1 | a3eed52cc68eea188292855989b33d3c | 获取BigInteger型属性值 | BigInteger result = null;
try {
JSONObject jsonObject = JSON.parseObject(json);
result = jsonObject.getBigInteger(key);
} catch (Exception e) {
e.printStackTrace();
}
return result;
} | 1 |
59bc26a9b7c0f0320b738411ada86e14 | 97e3b57f31110f817e9e44dc74da812e | Handles player attack mechanics | {
CharacterStats targetStats = m_target.GetComponent<PlayerStats>();
if (m_lastAttacked >= m_attackSpeed)
{
targetStats.TakeDamage((int)(m_myStats.GetDamage() + targetStats.m_currentInsanity - (Mathf.Clamp(m_myStats.GetArmour(), 0, m_myStats.GetArmour()))));
m_lastAtt... | 1 |
2681714c5169c2dca4c339e310feaad7 | 3590adf1c4cec64d8348d84fea8ed6d2 | Visit a bound NotEqual predicate. | namespace Microsoft.Cci
void Visit(INotEquality notEquality); | 1 |
8078a0566cd4d2110b231b0d2f2dcbde | 2cc4966d0d666997dc97966a228f0276 | 按年统计销售额 | {
QSqlQuery query;
float sum=0;
int year=ui->spinBox_3->value();
query.prepare("select sum(total) from ORDERS where YEAR(timing)=:year");
query.bindValue(":year",year);
query.exec();
if(query.next())
{
sum=query.value(0).toFloat();
}
cout<<"in year sum:"<<sum;
orders_... | 1 |
95c88a5e3d4e2dd4d78e69c94ce3b24d | 77920019d953047c1910700cb5c1bce6 | This function will convert the table to a CSV file
where the values are safely encapsulated in quotes,
and quotes appearing in the values are escaped by pairing them | {
string title = "";
FileStream fs = new FileStream(filepath, FileMode.Create);
StreamWriter sw = new StreamWriter(new BufferedStream(fs), System.Text.Encoding.Default);
for (int i = 0; i < table.Columns.Count; i++)
{
title += table.Col... | 0 |
7a8f6fb7465c5a585fa09f9d43314bab | 32a518379f2812b49e33b2c9d3947ba3 | checks if collectorName only consists of letters | public final class CollectorGem extends Gem implements CompositionNode.Collector, NamedGem
boolean isNameInitialized() {
return DEFAULT_NAME != collectorName;
} | 0 |
726cb6990a3c7b51606f61fd3bce88cd | 3c09a7ac9d3a5603ba501713fe487820 | 第三种构造:参数是collection类型
构造一个集合
该集合中维护一个数组
构造器中会将参数(old集合)数组化,赋值给新集合中的新数组
新数组长度就是老数组的长度
新集合长度就是老数组的长度 | class Solution{
public static <T> List<T> newArrayList(T[] arr){
List<T> list = new ArrayList<T>();
for (T item:
arr) {
list.add(item);
}
return list;
} | 0 |
60fe19ad3d002ef9ac64ae64a94fce74 | c16f6ca73bc016102602c9038a03d53c | Make sure datetimes returned from the database are UTC datetimes | data_copy = []
for row in data:
row_copy = {}
for col, val in row.items():
if isinstance(val, datetime.date):
row_copy[col] = datetime.datetime.combine(val, datetime.time())
else:
row_copy[col] = val
... | 0 |
336bd3d0dfd94f09c9333bb9857ed77b | 7754b9a449148aabedf42330e829b637 | 查询所有学生(查看同班同学) | public String queryAllStudent(ModelMap map){
List<StudentVo> students = stuService.queryAllStudent();
map.put("stus", students);
return "stu_list";
} | 1 |
0db755d24ff52a3846cec4605dde2410 | ede69fc7b8e8d034cc8399eed4d41d44 | Returns wether the channel update task is still active or not. | public class ChannelRegistry
public boolean isActiveChannel(ChannelIF channel) {
UpdateChannelTask task = updateTasks.get(channel.getLocation());
return (task != null);
} | 1 |
6868cbb05af820e6709d30e0095a974a | a739c94d15bf5e6e577a2d50a5601867 | remove all columns in model | abstract class TableBase extends PaginatedControl
public function removeAllColumns()
{
$this->blnModified = true;
$this->objColumnArray = array();
} | 1 |
8099f14967ad06fb84cf7c806ee1429a | f2d60bc24e11358d049a55b62a77b319 | Validation rule to test if the supplied collection does not contain the specified value. | namespace Xunit.Extensions.AssertExtensions
public static class CollectionAssertExtensions
public static void ShouldNotContain<T>(this IEnumerable<T> collection,
T expected)
{
Assert.DoesNotContain(expected, collection);
} | 1 |
fadaa9a1f8805ad9ff395fa368d13fd8 | b4c862b6de70e9c14007a9a4439d87ec | 将hex转rgb
需要兼容三位的hex | class BCharts
_colorToRgb(hexColor) {
let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
let sColor = hexColor.toLowerCase();
if (sColor && reg.test(sColor)) {
if (sColor.length === 4) {
var sColorNew = "#";
for (let i = 1; i < 4; i++) {
sColorNew += sColor.slice(i, i + 1).conca... | 1 |
341a3fe4cb144d3e0944b5a6ddc70068 | 602f6ffbc0b3037f4b38f86bc931036b | add a variable that points to the current plugin directory | class ConstantsObj(object):
def plugin_dir(self):
return """--plugin-dir=path""" | 0 |
f70ab3a041c6cccf74044d845cd802ba | 985a5b6f936e8559632e1270e1248faa | Case insensitive ends with | class DataHandling
public static function endsWithInsensitive($stringOrStrings, $optionOrOptions)
{
return self::startsWithInternal($stringOrStrings, $optionOrOptions, true, false, true);
} | 1 |
1e1a190be5a4c39d795fe3d5b737a81d | 54a2a00095f807ce297518b17f2079b6 | This function shows the waiting image while ajax request response is pending | return "<div class='hidden waiting'>" +
"<label handle='label'>nls(Waiting_Label)</label>" +
"<i class='fa fa-circle-o-notch fa-spin'></i>" +
"</div>";
} | 1 |
383013ed5323b549d69e7c95280b1f0c | 93d5547855f042d55d7c7d335308a463 | bool: Whether to enforce detailed balance. | class ErrorX(_BaseTraceHierarchyType):
# array
# -----
def symmetric(self):
return self["symmetric"] | 0 |
1a2edfa92e65ba0682ef7af21961e19e | 8ddfc3c0588644810e753558112911e9 | Indicates that a row has been processed. | abstract class BaseProcessViewModel<T>(app: Application) : ObservableViewModel(app)
private fun itemProcessed() {
current++
updateProgress()
} | 1 |
48e09e00e4f0d30051d8d2c7741f49e2 | 353b5e8838634fa1a2e7c3d9b9bcb9c4 | # this function will join overlapping bed regions | if (length(strsplit(file, "transcriptome")[[1]]) == 2) flanking <- 0
file <- paste0(dir, file)
data <- read.table(file, header = F)
data <- data[,cols]
data <- data[!duplicated(data), ]
for (i in 1:nrow(data)) {
if (data[i,3] < data[i,2]) {
x <- data[i,2]
y <- data[i,3]
data[i,2] <- ... | 0 |
466efb2e22aa241c071005a4775b62a3 | 61ac4f7e4693c73fc2adfaabd300694e | Return a padded localfile.
Local files should be a fully qualified path. If the path is
not fully qualified, this method will add the tools prefix to the
file. | class StorageInterface:
def getLocalFile(self, path): | 0 |
c1c2ecb1fdb3380ff0a7915c71475680 | 76311a5fb5e6341076ba74743a282c80 | 按数据表多线程更新股票数据的多线程启动函数 | errorCode=[]
cur = connect.cursor()
today = datetime.datetime.today()
h5fileDict = {'sh': tb.open_file(dest_dir + "/sh_day.h5", "a", filters=tb.Filters(complevel=9,complib='blosc', shuffle=True)),
'sz': tb.open_file(dest_dir + "/sz_day.h5", "a", filters=tb.Filters(complevel=9,compl... | 0 |
308ed3ddecdfbafdf4082e083872fb14 | dc4bcdc4a55aee22a03ff35b1753092a | Finds the vote for the user on the topic. | class User extends Authenticatable implements JWTSubject
public function getVoteCountAttribute()
{
return $this->userTopics()->typeTopics(0)->count();
} | 0 |
eba23a22ef7d196a8bb1e0ce534b1198 | 71d7ead40059c94a0fe7ce457d1a56f6 | This function returns a date's day field | int Date::getday()
{
return dayy;
} | 1 |
0bbfa959ef9aff8f01fa79daa7bc47d1 | 67714cae71c761ab3c9bcd950833af06 | 自动急救 | function CUnit:EnterAuto()
self:SetAuto(true)
if not self:IsReady() then
local nRndEnemy = self.m_oBattle:RandAliveEnemy(self:GetUnitID())
assert(nRndEnemy > 0)
self:SetInst(CUnit.tINST.eGJ, nRndEnemy)
end
if self:IsRole() then
local oPetUnit = self.m_oBattle:GetPetUnit(self:GetUnitID())
if oPetUnit and n... | 0 |
5a8b49c6bbe364028a55ccab3ff5ea95 | ef4aa580b077e17b168070c38889d54b | Sums the incoming querries up. | class Message():
def add_queries(self, queries):
self.queries = queries
self.header.Nqueries = len(queries) | 0 |
d4eae6ba360ac7487f44e8f234d3a904 | 92593acef118938c58ae10b98640996b | Read and return model metadata and input/output variables as dictionaries from
an MLFlow model directory.
Current implementation only handles simple pickled models. Future feature work
is required to include more types of MLFlow models. | artifact_path = _determine_artifact_path(
project_id, model_id, path, version
)
return mlflow.pyfunc.load_model(artifact_path) | 0 |
ac5896f31affae810c260c129be385cb | 6ccd955d91b39670c80a259208499910 | Acknowledge an bank notification. | class APIClient
public function acknowledgeTransactionNotification()
{
echo Constants::NOTIFICATION_OK_RESULT;
} | 1 |
aa0ee37db1d228250305ed621ddcb76e | 82c0b787442ef854b1b4dd86c27771ed | Reads required options from user input if those
were missed. | void readOptions(int argc, char **argv, uint16_t *portNum) {
int i;
char *opt, *optVal;
for (i = 1; i < argc; ++i) {
opt = argv[i];
optVal = argv[i + 1];
if (strcmp(opt, "-p") == 0) {
if (optVal != NULL && optVal[0] != '-') {
*portNum = (uint16_t) strtol(o... | 0 |
1c70ec040acd1e6959fb3627cda0984e | 492c5c66c03ef155f36bd350f74f936c | Check if required sounds exist locally and download them from server if
required. | function loadSound() {
if(s.server_url) {
createjs.Sound.registerSound(s.server_url, 1);
}
else {
}
} | 0 |
980b7b991ddd41c08cb3cfd6eddfc4a9 | b3f1377744510baccba2143e174857c3 | Comprueba comportamiento normal ante grados inexistentes.\n
Comprueba que ni un docente ni una sesión extraña puedan obtener los alumnos de un grado, con independencia
del grado indicado. | class TestGradosController(BaseTestCase):
def test_get_grados(self):
query_string = [('tamanoPagina', 56),
('numeroPaginas', 56)]
response = self.client.open('/Facultad/grado',
method='GET',
query_string=quer... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.