query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9ac308dcbbcce1a40290615b17faad87 | 4e8830421fa4acffca6786ac05fc8cec | Función para verificar si pelicula existe | val realm = Realm.getDefaultInstance()
val item = realm.where(Movie::class.java)
.equalTo("id", id)
.findFirst()
realm.close()
return item!=null
} | 1 |
38ad1d6ebe5ccc7d912e8874be3d005b | 9f1e69f19d40cd3376eb4199bbfbf1b5 | Test get and set quarantine effectiveness | public void SetGetAffinityTest()
{
string testAspect = "fire";
var am = new AffinityMap(_rand);
Assert.AreEqual(0, am.Count);
Assert.IsFalse(am.AspectList.Contains(testAspect));
Assert.AreEqual(0, am.GetAffinity(testAspect));
am.Set... | 0 |
18d7783d9fc31e1932dbd76b44653d7c | e2a4b4c41e423fc4c1546e3811a67658 | 根据用户ID获取在借中的借阅清单 的数量 | public int findUserborrownum(@Param("id")int id); | 1 |
5aa675b33581a8530120f1d18c2f3530 | 4f3112eef2a5a79af60675bc32cdc1a5 | This method resets the attack timer. | public class PlayerScript : MonoBehaviour
public void resetAttackDisableTimer()
{
this.attack_disable_timer = 0.0f;
} | 1 |
167f70dabfe80457693d9245147610a8 | 16a94052e1fb314e60808fa0114957fa | 输出城市JSON列表 | public class CityFragment extends Fragment implements OnItemClickListener
private List<City> getJsonCitys(){
List<City> citys = new ArrayList<City>();
City city = null;
try {
JSONObject jsonObject = new JSONObject(jsoncity);
cityname = jsonObject.getString("name");
jsonCityArray = new JSONArray(
jso... | 0 |
804ae4c8959ac35d426d68a139313c0f | bb6ac9b1001f556afdcf512277a2ed91 | This is the total number of items that were changed in the sis import. There are a few caveats that can cause this number to not add up to the individual counts. There are some state changes that happen that have no impact to the object. An example would be changing a course from 'created' to 'claimed'. Both of these w... | public class ReportResponse
public int getTotalUpdated()
{
return totalUpdated;
} | 1 |
999d992a07d845fea4d714ddc36ca2fa | 4bcbc1035ba8d53109ec5cbe594cb103 | Hook handler: sets company ID and storefront ID when creating a theme instance. | function fn_ult_themes_area_factory_pre($area, &$company_id, &$storefront_id)
{
fn_ult_bootstrap_company_storefront($company_id, $storefront_id);
} | 1 |
d68dc178b9b9e2b8f6ea0a4d20297aa6 | cbba343e2eeb7857ceba6ea615d95359 | Test that the endpoint returns 401 if the user is not authenticated | class VersionDailyTestCase(_VersionTestCase):
def test_endpoint_url_no_auth(self):
self._assert_get_without_authentication_fails(self.endpoint_url) | 1 |
6a443d9dcd2625f362104e28ce0b059e | 21a3096dbb402e58e9ebd260dece8f29 | returns a unique customer ID. *DOES NOT CREATE CUSTOMER | global $con, $email, $addr;
$result = $con -> query("SELECT custId FROM customers WHERE email = '$email' AND address = '$addr'");
if ($result -> num_rows == 1) {
$row = $result -> fetch_assoc();
$custId = $row["custId"];
echo "<script>console.log('Customer was found')</scri... | 1 |
3e7b630f33406b1a1f9f708cb6faca67 | 5d2c053f41bae38c6ea38a1337aa1c78 | Tests that constructors enforce type. | class TestClass(object):
def test_constructor_wrong_type(self):
with pytest.raises(TypeError) as pytest_wrapped_e:
configdb_json = ConfigDBJson(123)
with pytest.raises(TypeError) as pytest_wrapped_e:
configdb_json = ConfigDBJson([])
with pytest.raises(TypeError) as pytest... | 1 |
efe891f739c546413df0a71f2ca7b1b4 | ce0926cad828aa6877b67ec5ada54645 | runs processes in the foreground and waits until completion to allow more input | while (TRUE) {
char* userInput[MAX_INPUT_SIZE];
int success = getUserInput(userInput);
updateProcessStatuses();
if (success) {
executeUserInput(userInput);
}
updateProcessStatuses();
}
return 0;
} | 0 |
b3e595d0a3da20b5d9a25f4cfe62e1b9 | a61eb955433a3ffc60750ff1477d7067 | Retrieve an email with a given ID. | class e107MailManager
public function retrieveEmail($mailID, $addMissing = FALSE)
{
if (!is_numeric($mailID) || ($mailID == 0))
{
return FALSE;
}
$this->checkDB(2);
if ($this->db2->db_Select('mail_content', '*', '`mail_source_id`='.$mailID) === FALSE)
{
return FALSE;
}
$mailData = $this->db... | 1 |
d1b0be589d36c02dc98294759d65e57d | 7ace888ed5172a1e9530ad8e5c62b078 | Generate subprocess invocation arguments for parallel run. | mpi_arguments = ["mpiexec", "-n", "1"]
arguments = default_make_ipkernel_cmd(*args, **kwargs)
return mpi_arguments + arguments | 1 |
137a594e049595431efcf508ab3dcec1 | 63d0d707495812b5d8f90a6e727440ba | The YDirectReportUtils class is not meant to have any instances. | namespace GreenLeaf namespace GLUtils
Utils::Utils()
{
} | 0 |
dc02c0f0824cb20729e4c2d7ea3fadf8 | 7e9a895f8987215472043b005146ecff | Assert that this entity can be deserialized from a JSON object. | public class RefreshTest extends AbstractDomainTest
@Test
public void testJsonDeserialization() throws IOException {
Refresh notification = objectMapper.readValue(SERIALIZED_REFRESH, Refresh.class);
assertThat(notification.refreshFrom()).isEqualTo(REFRESH_FROM);
assertThat(notification.refre... | 1 |
bcad2e3ea4195c2f33b6df9e35a371fa | 8c9e73e91b56c6df90eb10e50e017c8e | Returns the text decoration used for the box. | class GmagickDraw
public function settextdecoration(int $decoration): \GmagickDraw {} | 0 |
31b4ec6d974a7bf84e592706e684982b | f9e4df777e31fb200535b32e3fc5467a | Updates the Pokemon based on its state | self.pokedex.next_pokemon()
new_url = f'data/images/{self.pokedex.curr["id"]:03d}.png'
lblimg.image = tkinter.PhotoImage(file=new_url)
lblimg.config(image=lblimg.image)
lblname.config(text = f'{self.pokedex.curr["name"]}: {self.pokedex.curr["id"]}')
types = self.pokedex.g... | 1 |
fa5f2019feb660631f36125eac669b0d | 13e3780fc084cf1f98a149d633295aaf | Returns the formatted endpoint URI to use for interacting with the Messenger API. | class Twilio implements Driver
public function getEndpoint(): string
{
return "https://api.twilio.com/2010-04-01/Accounts/$this->accountId/Messages.json";
} | 1 |
2ed84a8639b65d0ddf7ed5860b75c7aa | af5d53cfc31f8cb96bbb28b2fde3fb6f | Get the longest contour. | {
std::vector<std::vector<cv::Point> > contours;
std::vector<cv::Vec4i> hierarchy;
findContours(img.GetCVImage(), contours, hierarchy, CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cv::Point(0, 0));
int longestIdx = GetLongestContourIndex(contours);
return ConvertList<cv::Point, AVector>(contours[longestIdx]);
} | 1 |
d823c8ae7607a6ba22604d821e3c6c6d | ec6dfe0ddde11c23b995233d69c00c8a | Creates a Grid structure with specified size. Instantiates node objects and names them so tracking is easier. | public class Grid : MonoBehaviour
void Awake () {
nodeDiameter = nodeRadius * 2;
gridSizeX = Mathf.RoundToInt(gridWorldSize.x / nodeDiameter);
gridSizeY = Mathf.RoundToInt(gridWorldSize.y / nodeDiameter);
randomSeedS = (int)System.DateTime.Now.Minute;
CreateGrid();
} | 0 |
7d9cf9a62f36ea3e48d9645ad1ea2233 | f86a16c385dca12e33fa55320d486372 | Método que permite modificar el símbolo que representa a la unidad de la métrica | namespace EarthView
namespace World
namespace Spatial
namespace Carto
public class Iscalebar : EarthView.World.Spatial.Carto.Imapsurround
public virtual void SetUnitLabelSymbol(EarthView.World.Spatial.Display.Isymbol symbol)
{
EarthView_World_Spatial_Carto_IScaleBar_setUnitLabelSymbol_void_ISymbol(... | 1 |
8cca27de208e2dd2b6460c6a17bc9508 | 919debca4ab32c967bcc48375c4c4811 | 获取一定距离远的平行线 | namespace RoadNetworkSystem.GIS
class LineHelper
public static IPolyline CreatLineByOffset(IPolyline line, double offset)
{
IConstructCurve curve = new PolylineClass();
object o = System.Type.Missing;
curve.ConstructOffset(line, offset, ref o, ref o);
IPolylin... | 1 |
bef03d92a91f6b04946f809f4481a432 | e282e95fa64f658115075538fa49c83c | generates random points uniformly distributed on the unit disc | void genPointsOnUnitSphere(const int N, float *x, float *y, float *z) {
if (x == nullptr || y == nullptr || z == nullptr || N <= 0) {
std::cerr << "invalid pointers or size, aborting...\n";
std::exit(1);
}
std::srand(std::time(0));
const int BD = 10000000, BD2 = 2 * BD;
const float inv_bd = 1.0f / B... | 0 |
eca5fca3ec03e5d004ae94e6863738da | 8eb5b0de0b7dc3f8600b1f5f490f1477 | Create a string which describes a position in a source file. | {
if(Location != null)
{
return Location.ToString();
}
else if(MarkupMax == 0)
{
return File.ToString();
}
else
{
return String.Format("{0}: {1}-{2}", File.ToString(), File.Markup[MarkupMin].Location.LineIdx + 1, File.Markup[MarkupMax - 1].EndLocation.LineIdx + 1);
}
} | 1 |
ce65290a0eda3f20471b055e81c7ef03 | 97a78087e8abdd7e0a9516c63cd15855 | # Prjections on ball | def p_ball(x,c,r):
return c + (r/np.max([np.linalg.norm(x-c),r]))*(x-c) | 1 |
dbc7b5c419f6d0c0cb1af327ed15bb2f | b0ea8818995aa7405e5d954d55289ce5 | Retrieve all to-do item belong to specified account. | namespace Homework_Adform.Services
public class TodoItemsService : ITodoItemsService
public async Task<List<ItemDto>> GetAll(long userId) => await _itemDalLayer.GetByUserId(userId); | 1 |
94fc7462a9c35c95e39cd8351614104f | 0b30ffaebca35fd3a79e952117c79b31 | 挂载异常钩子 | {
Plugin::hook('alpha.before_throw_exception', $e);
$error = array();
$error['message'] = $e->getMessage();
$trace = $e->getTrace();
foreach ($trace as $key => $val) {
$error['files'][$key] = $val;
}
if (!$GLOBALS['debug']) {
Log::em... | 1 |
32dee61d0abde037910d4e28a6951719 | c3df2acf663acab5db4972a40d6c6e3e | Get the list of allowed values for the openclose field. | class SalesOrderLineDto implements ModelInterface, ArrayAccess
public function getOperationAllowableValues()
{
return [
self::OPERATION_ISSUE,
self::OPERATION_RECEIPT,
];
} | 0 |
f45713e0e544901b8d17fa1a4dc6a96e | bd408c9ee9f3b6ecce2a856f2d163b63 | 获取运行时泛型的类型 | Type genType = cls.getGenericSuperclass();
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
Type type = params[0];
Type finalNeedType;
if (type instanceof ParameterizedType) {
finalNeedType = ((ParameterizedType) type).getActualTypeArguments(... | 1 |
6a0f722d099aeb1cb0517afedc517c06 | b8933200eec52f2e967f1e86287dd2a8 | Get the output of ffprobe. | class Posterselect():
def sniff(self, url):
source_filename = self.source_filename(url)
source_path = self.source_path(source_filename)
return self.ffprobe(source_path) | 1 |
b0f6dff31c72595e5b7d14f3820b3e98 | bb86a574f1fc6a792db40e5f3ec07029 | remove all records which are having null values for a specific column | public class ResultSetARS implements java.sql.ResultSet
public void updateNull(String columnName) {} | 0 |
59a75c0147ae87e89c699bb59010469e | 8e32fce1f4eedfde3ee2aaa6b1a77236 | Filters the scanned types to include only those in the provided namespace
or one of its sub-namespaces. | public class Type<ClassType>
extends NameFilter<Type<ClassType>, Class<ClassType>>
public Type<ClassType> inPackage(final String packageName)
{
String constraint = "in any package";
if (packageName != null)
{
constraint = packageName.length() == 0
? "in defaul... | 0 |
799cb63f5926433675333a3c70c17cae | b5d797a58efc23680ab47e0daccf635f | Initializes the hyperparameters to default values | class BCELoss(Loss):
def _init_hyperparams(self, hyperparam_dict):
self._loss_parameters['label_smoothing'] = hyperparam_dict.get('label_smoothing', DEFAULT_LABEL_SMOOTHING)
self._loss_parameters['label_weighting'] = hyperparam_dict.get('label_weighting', DEFAULT_LABEL_WEIGHTING) | 1 |
f74eac5cd1682a784b4fb740d71d2325 | 70d55c2fb2bc4618d1b1c303f668bba8 | 短期借贷拒绝 | {
if(request::instance()->isPost())
{
$id = request::instance()->post('id');
$data['jie_id'] = Session::get('manage_id');
$data['status'] = -1;
$result = DB::name('shop_toloan_list')->where('id = '.$id)->setField($data);
if($result)... | 1 |
ea4494b474a35599b8fb5b124fa94bf0 | 0bf6450f39450c3eb74301cff2d87c1c | this will randomly set active the drawings to display in the UI | public class Day : MonoBehaviour
public void randomMarkers() {
int acOn;
int scOn;
int wcOn;
acOn = (int)Mathf.Floor(UnityEngine.Random... | 1 |
a5f319191714aab71b0604f560fb5cfb | 385438d908f3425d7c9eb52ea492a3d1 | Fixes-up the old DYLD file offsets in the given link edit data command so they are correct
for the newly packed DYLIB | InternalPrelinkKext (
IN OUT PRELINKED_CONTEXT *Context,
IN PRELINKED_KEXT *Kext,
IN UINT64 LoadAddress,
IN UINT64 FileOffset
)
{
OC_MACHO_CONTEXT *MachoContext;
MACH_SEGMENT_COMMAND_ANY *LinkEditSegment;
UINT64 LinkEditFileOffset;... | 1 |
a13cf3c4db189503b4e119cc48a7fc66 | 0ca04905df0415d42ad60f23c8e599f9 | 设置分析线索编号 | @Table(name = "cl_weituo")
public class ClWeituo
public void setZsbh(String zsbh) {
this.zsbh = zsbh;
} | 1 |
b2e141f1465baf155b8225500d00a6e7 | d3e7b4c649a32ecdc7384f86b3711e10 | adds item to queue based on priority (speed) | void EventQueue::enqueue(CustomerEvent* event) {
if (mSize < maxSize) {
int i = mSize;
eventArr[i] = event;
int parent= ((int) ((i - 1) / 2));
while ((i > 0) && (eventArr[i]->getPriority() < eventArr[parent]->getPriority())) {
CustomerEvent* tmp = eventArr[i];
eventArr[i] = eventArr[parent];
eventArr[... | 1 |
4ae752b6952ba597fb36c6cc44b6ce53 | 56a422f2df59c5fc653c8c5879f1f9e3 | Assumes that the sub trees rooted at children of node at i are MAX heaps but A[i] is smaller than it's children hence violating the MAX HEAP property. Propagates A[i] downwards recursively. | void maxHeapifyBottomUp(int A[], int node_index)
{
int parent_index = (node_index-1)/2;
if(parent_index > 0){
if(A[node_index] > A[parent_index]){
maxHeapifyBottomUp(A, parent_index);
}
}
} | 0 |
8e0f50c15ab14765b096e4ab4f9929ec | 689f95b4b8494e0e1cc451cc4d443b64 | 复制文件,目标目录不存在则创建目录 | {
if (false == is_file($filePath)) {
return false;
}
if (is_file($targetPath) && $overwrite == false) {
return false;
} elseif (is_file($targetPath) && $overwrite == true) {
if(false == self::delete($targetPath)){
return false;
... | 1 |
e9142b220e53b203bd7377ea694c7d6a | 7cc64b17780d68c2c208a6fe2a744903 | Возвращает пакет байтов для чтения архива по тепловому вводу 1 | namespace EnergyTechAudit.PowerAccounting.DeviceReader.Ecl300.API
internal sealed partial class Functions
public byte[] GetOpenAirTemp_X1_1_RS485()
{
return _modbusPackageHelper.GetCommand(_commands.GetOpenAirTemp_X1_1_RS485);
} | 0 |
7113d2aa07fec6c12cf51f20f8f3f71d | b38b8c8f793d8f02c273aba222e08568 | Function calculates the diversity loss between different experts.
The loss is adapted from https://arxiv.org/abs/2002.05709 | self.reset()
if self.observation_only:
trajectory = [t['observation'] for t in trajectory]
else:
trajectory = [np.concatenate([t['observation'], t['action']])
for t in trajectory]
trajectory = self.scaler.transform(trajectory)
trajectory_weights = 1./len(trajectory) *... | 1 |
842d34840e4f627a1a0aaaf95544dac7 | 70bf5a9f7e6c60bd9e054f526401d22c | Method performing integration with respect to a given unknown variable. The integration constant is zero.
This transformation is rigorous as the order of the expansion is increased by one. In other words, the output
lives in another algebra, of higher dimension. Overwrites multivariate implementation for performance. | Expression leftMult = new Pow(super.getLeftExpression(), super.getRightExpression());
Expression right = new Mult(super.getRightExpression().differentiate(var)
, new Log("e", super.getLeftExpression()));
Expression left = new Mult(super.getLeftExpression().differentiate(var)
... | 0 |
728fcf4b7baf022fdcfd2db1cd86ca94 | ee2ce17724e7de25a3d58f63b51a610a | 4.public int getNumberWaiting()
【作用/描述】
获取当前就绪/正在等待的线程数,在没有发生异常的情况下,该值等于当前循环中调用await的线程数。
【出/入参记录】
【使用注意点】 | public class PoolMetrics<K> implements Serializable
public int getWaitingCount() {
return this.waitingCount;
} | 1 |
49e6b038cb3645e2a6d94ffb9c378bce | 5a3c3503f940cd823525d1673fc31b1f | Unsets the "enddate" element | @XmlRootElement(namespace ="http://bp.comverse.com/data")
@XmlAccessorType (XmlAccessType.PROPERTY)
public class GlobalContractObjectData extends BaseExtObjectData implements Serializable
public void unsetEndDt () {
this._EndDtSet = false;
} | 1 |
cbd1d474a79ec085d18736f27c2f95b6 | 6ccf4366a5679c6c9d364219c47eaa10 | Decorator function which verifies that expected services are running etc. | @decorator
def decorate(fn, *args, **kw):
with expect_warnings(assert_=False, *messages):
return fn(*args, **kw)
return decorate | 0 |
a2768cf9e6603031471340e0db0f2e44 | 4c82647eb7717b14c7eb85a14582c276 | Adds an item to a group. | namespace GH public class Group
public void AddItem(ref long hwnd) {
if (hwnd == 0L)
return;
Items.Add(new GroupItem(ref hwnd));
} | 1 |
daedeac2d9447d2400dd5b3393abb4c8 | bdc895869332812daf4fef9dedcabdeb | Returns a list of Posts. Returned items are paginated with a default page size
of 5 items upto a max of 10 items. | namespace Charm.Forum.ForumServiceClient.Api
ApiResponse<List<PostRequest>> GetPostsWithHttpInfo(); | 0 |
c1eb5b4aa27d246bff20294f2d06dde8 | 747792f2b607d2b9de46f7f1867116d2 | Free the audio slice buffers | {
int err;
if (pa_simple_flush (audioconn, &err) < 0)
fprintf (stderr, "pa_simple_flush: %s\n", pa_strerror (err));
pa_simple_free (audioconn);
free (audio_samples_buffer);
} | 1 |
d9ccefb581e0f6be7c54d4dddf99fbef | 000983fa73808157c1625c76a6c590bd | 设置右侧Progress的值 | class DownProgressView : View
fun setProgress(progress: Int) {
this.sProgress = progress
invalidate()
} | 1 |
dcc537f3b29b547c89bfb670dfbe5503 | 6ccfe643dd7da5f790d0f7a025771b8e | returns a monster id to load for floor generation | s16b m_pop(void)
{
int i;
if (m_max < max_m_idx)
{
i = m_max;
m_max++;
m_cnt++;
return (i);
}
for (i = 1; i < m_max; i++)
{
monster_type *m_ptr;
m_ptr = &m_list[i];
if (m_ptr->r_idx) continue;
m_cnt++;
return (i);
}
if (character_dungeon) msg_print("Too many monsters!");
return (0);
} | 1 |
eabba30ec78a5380f332e61470a76e4f | 020cdf52eeafa4c7438fb85e99062974 | Is called when the Player releases the left D-Pad Button | public class PlayerScript : MonoBehaviour
public void GetMyLeftButtonUp() {
this.isLButtonDown = false;
} | 1 |
3e318a8f178280f68127ae02ab540c9d | c4652321589ad6d674498f55770127c8 | untuk menangkap result dari aksi yang dilakukuan ex : memilih kontak telfon | protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(data != null) {
ContactBean contactBean = (ContactBean)data.getSerializableExtra(AppConstants.EXTRA_KEY.CONTACT);
et_safe_phone_num.setText(contactBean.getPhoneNum());
}
} | 1 |
4b9d8fd27f2dd6a2586b710b4ecf4c85 | b91c556f45b00ef98788a1b986da5aec | GuzzleAdapter constructor. | class GuzzleAdapter extends BaseGuzzleAdapter
public function __construct(ClientInterface $client = null)
{
parent::__construct($this->getClient());
} | 1 |
230ba50681823faf5ccd83ee6accbfc4 | 8c7062ab21da3ca0011ca51bee30256c | Closes the ffmpeg process and returns stdout, stderr | {
$descripts = array(
1 => array("pipe", "w"),
2 => array("pipe", "w"),
);
$process = proc_open($command, $descripts, $pipes);
$result = array(
'stdout' => stream_get_contents($pipes[1]),
'stderr' => stream_get_contents($pipes[2]),
... | 1 |
ada782d67757fcfaab33589bcd604c31 | f3f1bea3f23ff9d534636f95337b12da | Retrieve a TH1F* containing the correctted data distribution | def prepare_TH1D(name, binsiz, xmin, xmax):
nbins, xmax = get_nbins(binsiz, xmin, xmax)
return prepare_TH1D_n(name, nbins, xmin, xmax) | 0 |
3873a45661f49656bbac18bbb8d493af | eea48dfc76e67bd1f9e71c96762bc28a | Called when a match instance has been created | this.publish(EVENTLISTENER.TOURNAMENT_CREATED, this.teamsPerMatch, this.numberOfTeams, tournamentId);
this.tournamentId = tournamentId;
this.matchesCompleted = 0;
} | 0 |
bf1bb52722e37247620c23948a042f8c | 9f62e18b7525318c93f98ed09a6c5ce3 | Initialize this object's instance variables using the provided parameters
and any defaults.
or a write accessor exists. In other words, given a [var, value] pair,
the following MUST be true in order for the instance variable corresponding
to `var` to be initialized:
self.respond_to?( :var ) or self.respond_to?( :"#{va... | method(@method).call(new_value) if @method
case @type
when :switch
set_switch(new_value)
when :variable, :bar
set_variable(new_value)
end
end | 0 |
e6f6b8acf328e984d23d46439b9135d6 | d26bf622a24a48200c4cb481f6674ddb | Returns latest 100 saved messages. | class MessagesListView(mixins.ListModelMixin,
generics.GenericAPIView):
def get_queryset(self):
queryset = Message.objects.all()
recipient = self.request.query_params.get('recipient')
if recipient is not None:
queryset = queryset.filter(recipient__iexact=recipi... | 1 |
19874b50fe89501ecf21fc7213f60f26 | 39a09ed2e29a9e032e597e33d0072afb | Returns a DataStream object with metadata of a stream and data for a given day. | class Stream(metaBase):
def get_data(self, start_date=None, end_date=None, level=None):
payload = {"sid":self._id}
if start_date is not None:
payload["sd"] = start_date
if end_date is not None:
payload["ed"] = end_date
if level is not None:
payload["le... | 0 |
11bad7d17d558080ba92bf30ab8ecb3c | 25d214949319762b7a574c52418ba3b0 | Calculate the size of the cells based on the grid size | function getGridCellSize() {
return (min(width, height) / 2 - 50) / gridSize;
} | 1 |
461f96b8873b6e1d30814ba155ef1d96 | 540e5084aab93911a386bca5b32b3713 | 設定 設置錄製的音頻採樣率 | namespace Jtext103.CFET2.Things.DAQAIThing
public partial class AIThing : Thing
[Cfet2Config(ConfigActions = ConfigAction.Set, Name = "SampleRate")]
public void SampleRateSet(double sampleRate)
{
basicAI.StaticConfig.ClockConfig.SampleRate = sampleRate;
int gcd = Caculator.GC... | 1 |
18970ad6bb9e005ccca9b2c0082882e3 | 305da82ee314ce8e97229cc82362cc0f | 确定指定方法上是否标注有指定类型的注解 | public class AnnotationUtil
public static boolean testAnnotation(HandlerMethod handler, Class<? extends Annotation> annotationClass) {
boolean result = false;
Target target = annotationClass.getAnnotation(Target.class);
if (null == target) {
return handler.hasMethodAnnotation(annotat... | 1 |
1918a93f2b8205ec6750d575f47d01d3 | 5d0cf04d351f18c2d95964866a9c7611 | Should create new order using item in cart. | class ShoppingCartController extends Controller
public function createOrder()
{
return response()->json(['message' => 'this works']);
} | 0 |
cc2f5119699f1b267a4cc61fefef0059 | 01c5241260d573599f7e2c7189e8712e | 文字水平滚动(新闻停顿滚动,只显示一条) | try{
var $news = $('div.scrollNews>ul');
var $lineHeight = $news.find('li:first').height();
$news.animate({ 'marginTop': -$lineHeight + 'px' }, 600, function () {
$news.css({ margin: 0 }).find('li:first').appendTo($news);
});
}catch(ee){
}
} | 0 |
ec060b10a72f2ddc6c36dad514e75673 | f7b833ee65de94496d6d249e17702055 | Download articles that are missing from the file storage. | wantedYid := []string{}
data, err := ioutil.ReadFile(inputFile)
if err != nil {
Logger.Fatalf("FetchMissing ioutil.ReadFile: %v", err)
}
for _, rawYid := range bytes.Split(data, []byte("\n")) {
yid := string(rawYid)
if yid == "" {
continue
}
wantedYid = append(wantedYid, yid)
}
entries, err := iouti... | 1 |
5990f0bc00a0e7bc0768e1fcbfb04927 | 916ba4948732b5002f1e3c30b5308bd5 | Skaičiuoja pažymių vidurkį | {
double s = 0;
for (int i = 0; i < DarbuotojaiKont.kiek; i++)
{
s += DarbuotojaiKont.ImtiDarbuotoja(i).DarboLaikas().TotalHours;
}
return s / DarbuotojaiKont.kiek;
} | 0 |
f61158ba6b825b6fddac8ba5b39b6e27 | 34f97109a113f486e77e95740f834b90 | B -> GiB
将字节转化为GiB(1KiB = 1024B)。
Convert Byte to GiB (1KiB = 1024B). | fun Long.GB(): Double = "%.2f".format(this / (1000 * 1000 * 1000).toDouble()).toDouble() | 0 |
30137c8455f8c79ec2dc6c6319d93ae3 | e080ee2f9aaf6ebcc2579b76a6cecdca | ExStart
ExFor:ListFormat.ListLevel
ExSummary:Shows how to modify list formatting of the current list level. | class ListsTests extends BaseTestContext
public function testUpdateListLevel()
{
$localName = "ListsGet.doc";
$remoteName = "testUpdateListLevel.doc";
$subfolder = "Lists";
$fullName = self::$baseTestPath . $subfolder . "/" . $remoteName;
$file = realpath(__DIR__ . '/../../..... | 1 |
b51d3b22a22a360fb28352cf8fc829bd | 90259612b01766c3a04bb7b5290451aa | True if has "reportTablePeriods" element | int sizeOfReportTablePeriodArray(); | 0 |
cf0f3c59683033f7215e122408d89e45 | d2afc74f7cac91e823993fa06a165767 | [确认订单页面形成订单列表] | OrdersConfirmListVo ordersConfirmListVo = new OrdersConfirmListVo();
Integer addressId = ordersConfirmListDto.getAddressId();
ReceiveAddress receiveAddress;
Integer cityId = null;
if (addressId != null) {
receiveAddress = receiveAddressService.findById(addressId);
... | 1 |
5cbbbd6c5b0a5b9ae79fab25e24d493d | 03a5b57136759678017942ee4af71cf4 | Unpacks the waranty date code. | void unpackdate(char* retval, int val) {
for (int i = 0; i < 8; i++) {
unsigned int value = val << 4 * i;
value = value >> 28;
retval[i]= value+'0';
}
retval[8] = 0;
} | 1 |
492f8acfcace16d595d7d765a2e96ee2 | 8693d7487ff7bae75737040c0d696740 | Test case for list_namespaced_replication_controller | class CoreV1ApiTest extends \PHPUnit_Framework_TestCase
public function testListNamespacedReplicationController()
{
} | 1 |
eb93c88af1406d4b9a886220003479e4 | 2510a7fca5d7f72f72dc24f84548da6e | 根据出生日期,计算出在某一个日期的年龄 | @Controller
@RequestMapping("/xiels")
public class XielsController
public int getAgeByBirthday(String birthday){
String [] date=birthday.split("-");
int b_year=Integer.parseInt(date[0]);
int b_month=Integer.parseInt(date[1]);
int b_day=Integer.parseInt(date[2]);
Calendar c=Calend... | 1 |
817ad3fc42cae2b7965a3b000e81d6c1 | 6e76be97af58f0713edbdae1a5c91714 | Setter to set the status of if a blink was detected or not | {
if(millis() - time_of_last_blink >= 100)
{
time_of_last_blink = millis();
info.toggle();
}
} | 0 |
60ff5066554aa06e794a6b459e522ece | c983dcf0e2985ba9199d28298671f79a | Generate Password based on Group Policy Password Complexity | $h = 1; $e = 2; $b = 3; $a = 4; $d = 0; $g = null; $c = null;
if ( strlen( $password ) < 4 )
return $h;
if ( self::_has_word( $password, array($member_data->get_display_name(), $member_data->last_name, $member_data->first_name, $member_data->email) ) )
return $h;
if ( preg_match( "/[0-9]/", $password ) )
... | 0 |
ad600739b68da3c921c66c3a38e12676 | 0dc73ac7ba8957da907fa6d964178d4b | 增加员工,有图片 | public void addWithoutPhoto(EmployeeModel employee) throws Exception; | 0 |
ce6efeb57ce329a77b7ea87369d188b9 | 088d0b31a070d55b8995bbf4cb9dcdde | Fetches the invocation status for a request. | class ServiceManagementRestProxy extends RestProxy
implements IServiceManagement
public function getOperationStatus($requestId)
{
$context = new HttpCallContext();
$context->setMethod(Resources::HTTP_GET);
$context->setPath($this->_getOperationPath($requestId));
$context->addStat... | 1 |
25b207594f4bb8159809b9da58c38571 | 39241db67daeccb534bdd5167bf8c490 | Make a request to server and combine all responses
into a single response.
If server tell we to stop we return last response. | {
var connections = GetAllConnections();
foreach(var connection in connections.OrderByDescending(c => c.IsConnected))
{
try
{
var response = await SendRequestAndReceiveAsync(connection, request, deserializer, requestId, cancellationToken);
return response;
}
catch(Exception ex)
... | 0 |
a177e6a13384841954d9311fca166f76 | 35f01de9e36cb9ccebf75f3557b5570b | used to get unique audio Id. | public class DetectionEnvAndSoundQualityRespData extends AbstractModel{
public String getAudioId() {
return this.AudioId;
} | 1 |
ddec7207761c1ca7bd248884085bf089 | c15f083349d4c7876a3145b32755621c | Reads in the messages from the other snorklers and determines which
point on the board to swim to. | pthread_mutex_lock(&((ThreadData*) args)->lock);
pthread_mutex_lock(&otherDepots.lock);
pthread_detach(pthread_self());
char message[BUFFER_SIZE];
char* pmsg = message;
char buffer[BUFFER_SIZE];
memset(&message, 0, sizeof(message));
memset(&buffer, 0, sizeof(buffer));
GetInstructionA... | 1 |
1877481cc7048ee9ffd4645af8524387 | ec27103d447e851e0a9eaf64f2518557 | 转换模板中的事件链接 | String holder = content;
Set<Map.Entry<String, String>> set = getReplacePairFromRegex(regex, holder, true);
for (Map.Entry<String, String> n : set) {
holder = activityLinkBuilder(c, t, holder, n.getKey(), n.getValue(), mode);
}
return holder;
} | 1 |
59660108b71538fd9fb2f9a80191c298 | 7ece9ed5dc929705a96fd7dc3561a2ff | Fonction appelée à la fin du constructeur, il enregistre le personnage dans la list, ou l'actualise | public class Case
public void set(Personne p){
if(p!=null){
p.goTo(this);
this.statut=p.get_statut();
}
else{
this.statut=0;
}
person=p;
} | 0 |
a7b0f6901cb5fe36a486d35308d6ed40 | e296c438bbb2e8640a6e4c03b5716d20 | The intensity-weighted mean position | {
debug()<< " ==> weightedMean() " <<endmsg;
StatusCode sc;
int strips=cluster->size();
int intDistance=0;
double centre=0., totalCharge=0.;
unsigned int sensorNumber=cluster->channelID().sensor();
const DeVeloSensor* sensor=m_veloDet->sensor(sensorNumber);
for(int strip=0; strip<strips; ++strip){
s... | 1 |
59b043f364b7b92e42e1612a4ebf70ba | 339a0ae571a428c91222307d3af8e8bc | GET: KitchenBankAccounts/Create | [ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "Id,BankAccountTypeId,Name,Balance")] BankAccounts bankAccounts)
{
if (ModelState.IsValid)
{
var userId = User.Identity.GetUserId();
var house = db.Users.Find(userId).MyH... | 0 |
7fc70ebd162233eba6f0e185f830e797 | bf202541d30202fd05dff3b73418ad9f | 文字列バッファ出力用ストリームの初期化 | class util_fileService(object):
def initStreamBuf( self, stream , streambuf ):
streambuf["buf"] = stream
streambuf["pos"] = 0
streambuf["buflen"] = len(stream) | 1 |
990b0827c67456d83ae5495d6ee7a3de | ce04b996e967586839adaac9f5e98414 | Make a disk `Shape`. | namespace yocto
void make_disk(vector<vec4i>& quads, vector<vec3f>& positions,
vector<vec3f>& normals, vector<vec2f>& texcoords, int steps, float scale,
float uvscale) {
make_rect(quads, positions, normals, texcoords, {steps, steps}, {1, 1},
{uvscale, uvscale});
for (auto& position : positions) {
... | 1 |
ce3f126b4fff17e1a4221182cd2a7ae5 | cbacb96df0e4b36c10ff08046ff26c89 | Sets smaller difficulty parameter used to create a new game with only 3 squares. | void DifficultyWindow::setDifficultyToEasy() {
mRasen->setDifficulty(3);
} | 1 |
b77d32cbeb437a8d7759e1665bcfdf9a | 4470f195f086cdb7fadf483ff8422439 | 按指定编码按行读取文件 | public final class FileHelper
public static List<String> readLines(File file, String encoding) {
List<String> list = new ArrayList<>();
try (
BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), encoding))
) {
String line;
... | 1 |
29cf24a30b50564f3cd0c22d1395ae44 | e7447631aadb0c896a2972c815b13452 | # Extrcats param from format: name=base64_encoded_value | x <- scan(text = x, what="character", quiet = TRUE, sep = split.char);
x.keys <- sub("^(.*?)=(.*)$", "\\1", x, perl = TRUE) ;
x.values <- sub("^(.*?)=(.*)$", "\\2", x, perl = TRUE) ;
if (all(x.values == x.keys)) {
x <- x.values;
}
else {
x <- setNames(x.values, x.keys);
}
return(x);
} | 1 |
22e13681fc474eec86bc1e62513af919 | 99b7fe6e30297bdf796bf71ace787b8b | # Function to split those genes that occur in two different regions at
# the region borders
# ARGS:
# geneData: dataframe with gene data
# regionData: dataframe with region data
# RETURNS:
# geneData dataframe with splitted geneDatas | .splitGenes <- function(genes, block.sizes) split(genes, rep(seq_along(block.sizes), times=block.sizes)) | 0 |
18208c193cecda051b94dc9f730faf3b | 0c5b452c9387b36037c53ab56cc27e0e | Checks the version of the Python interpreter running the script
Returns:
The major revision of the current Python interpreter | class Environment(object):
def python_version(self):
return self._python_version | 0 |
028c039898bda23789cf7ab540a5db52 | 1f05ec791f45be22ebff2bbd224c5182 | Fired after saving a field. | {
if (Mode == FieldEditorModeEnum.ClassFormDefinition)
{
string errorMessage = null;
DataClassInfo dci = DataClassInfoProvider.GetDataClassInfo(ClassName);
if (dci != null)
{
dci.ClassNodeNameSource = string.IsNullOrEmpty(documentSource... | 1 |
668eb3e96bb3b0f83042fa73022b1f2d | 6b6d068b5c4ff2eccb0f12d668ddf95c | ProductParts datagridview Cell click event. | {
try
{
if (this.PartsGridView.SelectedRows.Count > 0)
{
int selectedRowIndex = this.PartsGridView.SelectedRows[0].Index;
if (this.slicePermissionField.deletePermission)
{
... | 0 |
964aa1e8ab7badc2936e1c3fbfd809dd | 3be1e1a3d6a119c0cd3bb5911bf8de67 | Before nodeCreate check field value for file, if present create file and replace with fid
Field should be in format 'file;__file_source__;__file_name_ | class CuckooJSONReport(object):
def _add_file_creates(self, node, files):
for file in files:
if file:
nextid = len(self.nodemetadata)
fcnodename = "FILE CREATE {0}".format(nextid)
self.nodemetadata[fcnodename] = dict()
self.nodemetadata... | 0 |
71cff3d9a0ee0311e7d01274ca22561c | d69734832b2c799df7991913d1f11ad3 | Method to add serviced packet to results. Additionally it writes data to output file,
it also specifies the flow number of serviced packet | uint32_t IPAddress;
int result;
double searchingTime;
struct timespec initialTime, finalTime;
result = readInputPacketFileLine(&IPAddress);
while(result == OK){
(*processedPackets) = (*processedPackets) + 1;
clock_gettime(CLOCK_MONOTONIC_RAW, &initialTime);
if((FixedArray[IPAddress >> 8] & 0x80... | 0 |
943ca5206cdccd27300a3d776b46ac58 | ec12bf486b1b82774bd6f2899aa4892e | defining function to determine number of books to be ordered | if num_wanted <= 15 :
return 15
elif num_wanted <= 30 :
return 30
else :
return 50 | 1 |
d7c8f3a060ab16f08d2c93456a72f322 | d92634d86e4f71519a1879dafd80421c | Set the users and groups who are allowed to view a report. | group_ids: Optional[Sequence[str]] = None,
user_ids: Optional[Sequence[str]] = None):
if group_ids is not None:
pulumi.set(__self__, "group_ids", group_ids)
if user_ids is not None:
pulumi.set(__self__, "user_ids", user_ids) | 1 |
85d4f6ee2b099b266575169a2af6728d | af75e15720cfc9f0934769b269605bcb | 根据指定的属性值过滤异步获取实体。 | namespace MiCake.DDD.Domain.Freedom
Task<IQueryable<TEntity>> FindMatchAsync(Expression<Func<TEntity, bool>> propertySelectors, CancellationToken cancellationToken = default); | 1 |
4c6edede7221c329dd442709845c8cd4 | abc6d2671aa17fc5fd04a0a171667d6d | Performs a complete inverse round over a block using the provided roundkey | {
addRoundKey(state, expandedKey, Nr);
for (int r = Nr - 1; r >= 1; r--) {
invShiftRow(state);
invByteSub(state);
addRoundKey(state, expandedKey, r);
invMixColumn(state);
}
invShiftRow(state);
invByteSub(state);
addRoundKey(state, expandedKey, 0);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.