query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
5ab75a590750ae660253f023ad1ffeb3 | dbbac97d3880dd08d67d8ac717e1a67f | 選択された範囲の行を全てインデントする | let selectionText = selection.toString()
let tdAnchor = selection.anchorNode
while (tdAnchor.nodeName !== 'TD') {
tdAnchor = tdAnchor.parentNode
}
let tdFocus = selection.focusNode
while (tdFocus.nodeName !== 'TD') {
tdFocus = tdFocus.parentNode
}
let firstLineNumber = parseI... | 0 |
919dd956be288016134362b8d9d8f711 | ed3767ec39c3d65bbbc10ef43206213f | Sign extend 16-bit immediate fields. | int16_t immed = ((uint16_t)fields.immed << 4);
immed >>= 4;
return immed;
} | 0 |
ca6656330c3a60d7cdb30b6d938cdcfa | ad279f93257ac204beb6003b3ba6c0de | Complete PayPal Checkout | {
try {
$this->_initCheckout();
$customer = Mage::getSingleton('customer/session')->getCustomer();
if (!($this->_quote->getCustomerId()) && $customer && $customer->getId()) {
$this->_checkout->setCustomer($customer);
}
$rs = $this->_checkout->start();
if(i... | 0 |
b436375e7c59f018b5f03fc945c8a7a3 | f998ec3d1a6a99044ff96ccae00cf307 | Reads the current direction of the IO Port pins. | uint16_t io_get_bus_direction()
{
return read_word_data(IOADDRESS, IODIRA);
} | 1 |
7da9e33c1671b08bd184cbb92a47f239 | 0c973c0bf9aba8a83d07693621781cd2 | Registers placeholders on fields inside a specific context. | export class MappingManagementService
addPlaceholders(
count: number,
mapping: MappingModel,
basePadIndex: number,
isSource: boolean
) {
let padField = null;
for (let i = 0; i < count; i++) {
padField = new MappedField();
padField.field = new PaddingField(isSource);
padField.... | 1 |
ab9a0e4564db410b7e75036badc1ecb8 | e6f9e5aaa9ed97ffb4c0d49b75cb564e | Update the browser cookie and reload the page. | return new Promise((resolve, reject) => chrome.tabs.reload(this.id, opts, () => {
if (chrome.runtime.lastError) {
return reject(new Error(chrome.runtime.lastError.message));
}
resolve();
}));
} | 0 |
0ec8fb5def5adadbec9ce97b633c1b7e | 3aea264e2fa2cc2ef08be9ebcb8b3055 | 添加一个界面在目前的scene上面 | class MScene{
public addWindowScene(scene){
this.addSceneToLayer(this._windowLayer,scene,this._lastwindowScene)
this._lastwindowScene = scene
} | 1 |
265c7dec4f99af071b13e45ec40fcc01 | 96837b7252a0b642c02f40221a8b9f07 | メール送信後の後処理 | class SimpleEmailProcessor implements EmailProcessor
public function after_send( callable $c )
{
$this->_after_send = $c;
} | 1 |
dd1936257c99e908b053afda459cd298 | 4b83a37b3a0786142090bae540f94112 | Gets the name for the section to grant permission to from
the specified XML. | namespace System.Security
[ComVisible(true)]
[Serializable]
public sealed class NamedPermissionSet : PermissionSet
public override void FromXml(SecurityElement et)
{
base.FromXml(et);
this.name = et.Attribute("Name");
this.description = et.Attribute("Description");
if (this.description == null)
{
... | 1 |
6fbce498e1de3038e57e3a4d3439885c | bada9070fa60473d226d288b948f3576 | function that submits forms | function tosubmit() {
var myform = document.getElementById("myForm");
myform.submit();
} | 1 |
c821617009826c3d0cd2ef7d065163ca | 034a589fd99dddad81080614e9e1b2cb | Gets orx version absolute numeric value (compiled) | int CEngine::GetVersion(const char** version) {
if (version) *version = AVATAR_VERSION;
return (int)atof(AVATAR_VERSION);
} | 1 |
ceee6f0b5b40bfc9930dae58ea11ebcb | 6ba82ef5b116f73d06d9e963be802e59 | Gets the ms build executable path. | {
return (Path.Combine(mBuildOutputPath, mBuildCompanyName + "." + mBuildProjectName + ".apk"));
} | 0 |
9c1037adbf1495fe82c04fb06c4f7d78 | b0b8c3ab3effb554a15a97cf3b68c379 | This will call GetControlHtml() for the bulk of the work, but will add layout html as well. It will include
the rendering of the Controls' name label, any errors or warnings, instructions, and html before/after (if specified).
This one method can define how ALL controls should be rendered when "Rendered with Name" thr... | namespace Contoso
namespace Retail.Ecommerce.Sdk.Controls
[ComVisible(false)]
public class RetailWebControl : WebControl
protected virtual string GetHtml()
{
return string.Empty;
} | 0 |
bccfe875c119ec9c7a2e123bb49fecae | 326f5128986a0cc710e12bb59ae61cfb | update entries in file menu in all windows | static void update_win_all_text(MYUSER_WINDOW_T *win)
{
update_win_text_ele_text(&win->text.list_head);
update_win_text_ele_text(&win->com.list_head);
update_win_edit_ele_text(&win->edit.list_head);
} | 0 |
8c56f957a30087826e1f20f2d2fb73a2 | 6a859cea74901e698c5dc6d8c73efb7b | This method list the keys of the files inside a certain bucket within a given key (prefix) in AwsS3. | System.out.println("Listing objects " + bucketName);
try {
ObjectListing objectListing = s3
.listObjects(new ListObjectsRequest().withBucketName(
bucketName).withPrefix("My"));
for (S3ObjectSummary objectSummary : objectListing
.getObjectSummaries()) {
System.out.println(" - " + objectSum... | 1 |
8312a91ebe71241ed388e731533aefa1 | 28bf67e3e79d85baa88bbdb1673a40c4 | Change positions from cartesian to direct coordinates | def Return_direct(position_sigle):
n0,n1=position_sigle[0],position_sigle[1]
return [(n0-1,n1),(n0+1,n1),(n0,n1-1),(n0,n1+1)] | 0 |
b065c094b76303caa720db5db7a4544f | b8bfabf5343effffbcdf4ec1552854db | this function prepares a drop-down of all districts to use for selection of preferred school option 8 and checks whether an option has been selected during a session for data persistence | public class ChemicalDrugPopulateAction extends BaseAction
public void dropdown(HttpServletRequest request, HttpServletResponse response) throws Exception {
System.out.println("<ChemicalDrugPopulateAction dropdown> Entering... ");
NewDropdownUtil.populateDropdown(request, Constants.Dropdowns.SEXDISTRI... | 0 |
74ec97820fc1b7bf48b56b48434d8fbe | d915dc696b72261c0f835beac2c36384 | 取得有指定多个爱好的员工列表,爱好通过数组参数确定 | $sql = "SELECT first_name,a.person_id FROM " . $this->_table_employees . ' AS a,' . $this->_table_people . " AS b
WHERE a.person_id = b.person_id AND a.deleted = 0 AND a.department_id IN ($array_id)";
$data = $this->db->query($sql);
return $data->result_array();
} | 0 |
8470359e541c88fe495de1fedf9d240f | a40085cc8f53b1ed1143419d52b20f19 | Sorts using Insertion Sort | class Insertion(Sort):
def __init__(self, a):
self.a = a | 0 |
8e06eba698be4c0df932e836d39fe03a | 0d478cc45fa61b460392ec1cb07daf08 | Calculate specific humidity from relative humidity.
This uses the approximation as in Kraus 2004, section 8.1.3. | extern PetscScalar calc_q(PetscScalar rv)
{
PetscScalar specific_humidity;
specific_humidity = rv/(1 + rv);
return specific_humidity;
} | 0 |
cb4159269c6cb419c13b023b0ad2d3e7 | e017c5dea04b3d24909027805668b8ae | Saturation pressure calculation, Antoine Equation-------------------------------------- | pstar, dh, temperature_ref, temperature_new, ideal_gas_const):
psat = pstar * np.exp(dh * ((1.0/temperature_ref) -
(1.0/temperature_new)) / ideal_gas_const)
return psat | 0 |
414e8cb58fd00c6d1d75cf783efef703 | 2a3981181df3a671346d9b1ce0e5bc1c | 设置day属性的值。 | public class DateHelper
public void setDay(int value) {
mCal.set(Calendar.DATE, value);
} | 1 |
1e96a15984c7a8a88a1bab405751edaf | f217031533af0a8384b63c37b34ab370 | Empirically measured indel size distribution | void BCFGenotypingBufferedReader::compute_indel_pl(std::vector<int32_t>& alleles, std::vector<uint32_t>& quals, uint32_t ploidy, std::vector<uint32_t>& pls)
{
if (ploidy==2)
{
double pRR = 0;
double pRA = 0;
double pAA = 0;
double p = 0;
double q = 0;
for (uint32... | 0 |
efe7cf94627d31d98ced196b433aa874 | 43ba8ef1e25519d8d750d7017f576e38 | Generic method to pull connection from a stack
If there are no connections in the stack, a new one will be created until the max number
of connections has been reached | class DBConnectionStack
public static function popConnection($close = false)
{
LogUtil::log(__f('Warning! %1$s is deprecated.', array(__CLASS__ . '::' . __FUNCTION__)), E_USER_DEPRECATED);
if (!self::$manager->count()) {
throw new Exception(__('Attempted to pop connection from empty conn... | 0 |
068407e68799be27aefed5129044de79 | f307d566de46e8cbfc45b9d18c8f2ae9 | If this value is set to true, then the OutputKeys.INDENT property
on the transformer will be set to true. This will cause the
rendered XML file to be indented as appropriate.
<p>This defaults to true. | if (indent) {
m_format.put(OutputKeys.INDENT, "yes");
} else {
m_format.put(OutputKeys.INDENT, "no");
}
} | 1 |
09dda63af28c34ceaa0c62a9030c2c56 | 85e1ab50c401a0eea379e35e8562b627 | Function Parameter: Integers Total Rows, Total Columns and Pixels in the image
Function Return Type: void
Function Description: This function converts colored PPM image into grayscale using parallel for. Grayscale value is average of the 3's color in a pixel. | void grayscale(PPMImage* img)
{
int counter = 0;
while (counter < img->x * img->y) {
float total = *(img->rpixNorm + counter) + *(img->gpixNorm + counter) + *(img->bpixNorm + counter);
total = total / 3.0;
*(img->rpixNorm + counter) = total;
*(img->gpixNorm + counter) = total;
... | 0 |
21528c06d8f5b542f676e50ebf9db5b5 | 827292183b51f1e959f43f2a5b980527 | read a condition value from a JSONObject | boolean ret = false;
try {
if ((o != null) && (!o.isNull(name))) {
ret = o.getBoolean(name);
}
} catch (JSONException e) {
e.printStackTrace();
}
return ret;
} | 1 |
bb1a90ec23b146b6abf465354903ee5e | d0fbadb4b80cfbb8c61411b1daa96435 | Rotate player order so that start goes first. | class Game
def set_turn_order(player1, player2)
players = [player1, player2]
players.sort! { |one, two| one.roll_dice <=> two.roll_dice }.reverse!
end | 0 |
e66c239f380b761b9d6922661eff8ff3 | 2c2998be58911f2261d6c4d88b0cbc3d | Parse the XML response and populates Climate Information VO | function parseMessages(responseXML) {
if (responseXML == null) {
return false;
} else {
var clients = responseXML.getElementsByTagName("clients")[0];
var ipradate = responseXML.getElementsByTagName("ipradate")[0];
var regions = responseXML.getElementsByTagName("regions")[0];
... | 0 |
d7165e4d27069abe1811e5a81b8d1a8c | 089da5d78e8755d37daa2ce190156179 | Creates a column in a datatable if it does not exist and binds it to the control.
Added controls: Control name starts with txtInt: integer. Control name starts with "txt" - TextBox bound to Double. If textbox ends with "Name" - string.
Control name starts with "radio" - Radio button. Boolean.
Control name starts with ... | {
this.container = container;
switch (templateType)
{
case DataControlRowType.Header:
Label lc = new Label();
lc.Text = "<b>" + columnName + "</b>";
container.Controls.Add(lc);
if (this.control != null)
{
container.Controls.Add(control);
}
break;
case DataCont... | 0 |
77634c89adc52c759471003c0ccf2e27 | 0d6617db4c5c186fe0341574aad33ef8 | Sets up an instance with a text file associated. | class markdown_file(object):
def __init__(self, filename, program_options=None):
self.program_options = program_options
self.filename_md = filename
self.load_textfile() | 1 |
2c75648923fc6af2a64afdbc9f701dc5 | 2eba98ae943ab4b3b7d5c8b9b985f267 | Вывод списка языков через GridView. | public partial class SurveyPage : CmsPage
protected void LanguageSwitch_LanguageChanged(object sender, WR.Cms.LanguageChangedEventArgs e)
{
InvalidateListGridView(true);
} | 0 |
50962be6cf2c7caa7b59546148d2463a | f86ba313bbfab01ee89c1bdfd468c79e | выбор сортировочных таблиц по категории | foreach ($_GET as $k => $i){
$j = explode('/', $k);
$k = $j[0];
}
foreach ($arr1 as $key => $item ) {
foreach ($item as $key1 => $value) {
foreach ($value as $index => $sub_category) {
if (isset($_GET["$key1/$index"])) {
... | 0 |
532b5b9b0075b62834f2e818c6a90ef7 | db61f8b4fd23f3de1fad3e3ec59d9d6b | Use the memblock information to find the MBus bridge hole in the
physical address space. | uint size,
ulong *physAddr,
ibool contiguous,
ibool below16M)
{
return 0;
} | 0 |
f7ff89398d265b179eb4596b4bfc3985 | 34ed44d4907219060b5119e56e9d4fed | Gets query for [[Entidade]]. | class Entidade extends \app\models\MainModel
public static function find()
{
return new \app\models\query\EntidadeQuery(get_called_class());
} | 1 |
3d38eaae4b38e6f847d062627357f70e | bd6ba09cb255b15a73574b67d9d7db60 | POST experiences/ | class ExperiencesController extends Controller
public function index()
{
$experiences = Experiences::orderBy('id', 'desc')->get();
return ExperiencesResource::collection($experiences);
} | 0 |
093fe0e05234b35bab20167ec45fada7 | 2042a0a1cb440f8862bf86968f3402b5 | Gets the current view of the controller depending on the action | throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String url = ERROR;
try {
String action = request.getParameter("action");
if("getProduct".equals(action)){
url = GET_PRODUCT;
} else if("getL... | 1 |
0eb9521acdb1e120af116e820659f1c1 | b8290c767ef52732baec94151ac5c028 | \brief 주어진 메시지를 공개키로 암호화. | void encryptoMessage(char publicShareKey_KStr[SOCKNUM][CIPHERSIZE],char *cryptoMessage){
char messageStr[CIPHERSIZE];
CIPHERTYPE_BIG messageBig;
CIPHERTYPE_BIG publicShareKey_KBig;
CIPHERTYPE_BIG bignummul_ResultBig;
messageBig = mirvar(0);
publicShareKey_KBig = mirvar(0);
bignummul_ResultBig = mirvar(0);
print... | 1 |
f859003886724906a41ee6b6c8b5711c | 21184aa2043b395bd89eb420b45ffc5e | 获取指字标的的除权日期列表 | def EXPIREDATE(env, contract):
from lib.datalib.dbdata import Source
from lib.mathlib import EXPIRE_DATE
if not re.match("[a-zA-Z]{1,2}[0-9]{4}",contract):
contract = REF(env, contract)[0]
r_d = Source(env.content_variety).get_record(EXPIRE_DATE, 1, env=env,
... | 0 |
e6a9bbe75cf5760521fc9b23e99842d5 | cdbd4cc6d3f15f4f848d694e88630775 | Turn the clock off | class AcquisitionCardDummy(Base, EmptyInterface):
def stop_clock(self):
self.clock_running = False
return | 1 |
de8adf0df1992d8788957886c4195f6a | dbcf58bd2a7cd2cf26cf3ea7087f33a6 | Returns the ROI informations for the specified ROI. | self.ROI_value = ROI_value
self.ROI = value2ROI(ROI_value)
assert len(ROI_value) == 2 | 0 |
cc5e3342762f6a2dcc2552e8ed7f91a0 | e394a364fa6a5eb2f8b899a8e0b4d1cb | 设置平台服务费 | public class QueryMoneyDto
public void setServiceFee(BigDecimal serviceFee) {
this.serviceFee = serviceFee;
} | 1 |
cdb89cb5624f023870c77d5e0302ef0b | 8ab0e0cbee3b40558d01ca34f1cc02c2 | Print star triangle single side
*
**
***
****
***** | function printStars(number) {
let line = "";
for (let i = 0; i < number; i++) {
line = line + "*";
}
console.log(line);
return line;
} | 0 |
edfec08e53a0964d4545e7ed5d685714 | a6345dab2d9b50fc4561bb6a2af05578 | This method is called to create each necessary buttons page to the <code>PagingComponent</code>.
You can also set common styles to the buttons page here but for the styles specific to the state of the button (button with current page or not),
you have to override {@link StyleCustomizer} or , better, use {@link GlobalCu... | class AxLinkListPager extends CBasePager
protected function createPageButton($label, $page, $class, $hidden, $selected) {
$title = 'Page nr ' . ($page + 1);
if ($class == self::CSS_FIRST_PAGE) {
$label = $this->firstPageLabel;
$title = ($hidden) ? '' : 'First Page';
}
... | 1 |
e8cbecff66d5391b5aa95c3194dcdc91 | ce05e07cecfc58f7630da68183d8c555 | Площадь, покрытая плиткой | class Street
public function ras_kp(){
$kp=0;
foreach ($this->doma as $dm) {
$kp+=$dm->ras_kp();
}
return $kp;
} | 0 |
5812680db63df604a459d2d42b80bc57 | 9c72f1b7ec35b24215e018456043db4f | GET: Wycieczka | public ActionResult Index()
{
cat_wars.Dal.IDal dal = new cat_wars.Dal.Dal();
User user = dal.getUserByPseudo(HttpContext.User.Identity.Name);
ViewBag.chats = user.chats;
return View();
} | 0 |
750079206de8f34622fd4ff7f9f30a3a | a48e6a75ac570cfb53d2844f98b12169 | On a char switch, manually check intersection with the trigger. | void ATrigger_NonFocus::OnTriggerExit(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{
if (IsInRange && OtherActor->IsA(ATechDemoCharacter::StaticClass()))
{
IsInRange = false;
Cast<ATechDemoCharacter>(OtherActor)->InteractingTrigger = nul... | 0 |
8c8a0d0caeaae82f407377cf1c222b68 | 3fcf6a0b5a0a6f80233df612c070a995 | Check if 'pin_protection' has a value | class EquipPosData extends \DrSlump\Protobuf\Message
public function hasProtectalways(){
return $this->_has(5);
} | 0 |
88d3baec9209c3f35f4de97438d902e9 | 26b2fb9f732a8bab20e02381fb3e9785 | Basic headers for Jira server requests | class Nse(AbstractBaseExchange):
def nse_headers(self):
return {"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
"X-Requeste... | 0 |
511e927e0850c698d42dc590b5a9b2f0 | c7c644a42d69ead33398570b08728484 | 这个是用来获取当前时间戳的 | function getTimestamp(){
var time = new Date().getTime();
return time;
} | 1 |
e1b460e692d1ee54b3fa87112f0c23d2 | d89ba2ab46d942fb567dd836104f332c | Returns the number of contact types used in the modelled call center. | public int getContactCount(); | 0 |
8131ec38086a69588f37e62492f658d9 | 853c449b7373e250f99f372029b292ce | Test identification of lat/lon pairs using N/E with degrees/mins/secs | e7 = Equi7Grid(500)
x_should = 5138743.127891
y_should = 1307029.157093
lon, lat = 15.1, 45.3
sgrid_id, x, y = e7.lonlat2xy(lon, lat)
assert sgrid_id == 'EU'
nptest.assert_allclose(x_should, x)
nptest.assert_allclose(y_should, y) | 0 |
82a5dc9e22733510f43a2fe94a0364dd | 627860f9588e5f219b90f0d2bed20620 | 실시간 라벨을 만든다. | new Thread(() -> {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy.MM.dd(E) HH:mm:ss:SSS", Locale.KOREA);
while (true) {
Calendar curTime = Calendar.getInstance();
Platform.runLater(() -> {
lbnCurrentTime.setText(formatter.format(curTime.getTime()));
});
try {
new Robot().delay(1... | 1 |
048947dc8c3e4b036c85d780f3e65875 | 976b8325f9341760a410c73b8d0278df | !
\brief Send data to LCD
low byte => character, high byte => control (EN1, EN2, RS) | lcdwinamp_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
{
unsigned char enableLines = 0, portControl;
if (flags == RS_DATA)
portControl = RS;
else
portControl = 0;
portControl |= p->backlight_bit;
if (displayID == 0)
enableLines = EnMask[0]
| ((p->numDispl... | 0 |
5ef34aa13dd1e1d24216ea9663d0af37 | 4cd7120d1993694984906c2383afa3c1 | box to show Stripe product or local storage product in a small or large square with loading shine behind | return(
<Dimmer active style={styles.dimmer} >
<Loader> Loading Products...</Loader>
</Dimmer>
)
} | 0 |
66080bcfe123a09159cdfb0069424da0 | 2d1ea54b63b8f60ff018962d26c9e12b | Get the list of LCIO event sources. | def sources_get():
return list(database.get_sources().values()) | 1 |
d60a3ff5a606185ea6aefcd7aa1e75dd | e80d733851473c8112df7583569cc490 | Returns the shared peaks from spectrum 2 | peaks_feat = sp_feat[ np.ix_(np.array( sp_info[:,1], dtype=int) )][:,:2]
peaks_info = sp_info[:, -2:]
check = (peaks_feat == peaks_info).all()
self.assertTrue( check ) | 0 |
73785e010fef02c1386c7759e6df9e67 | a352f1e30fc80ff097b637b9c53a9bd7 | Method to multiply an unknown number of arguments. | def multiply(arg, *args):
count = arg
for num in args:
count *= num
return count | 1 |
12457945478ac412cc14f0fd51a4cd08 | b4a1f0cfe41f9628d5512cef7df08221 | Get the property union of input entities. | internal class LxmQuantifiedGroup : LxmObject
fun getMainUnion(memory: LexemMemory) =
getDereferencedProperty<LxmPatternUnion>(memory, AnalyzerCommons.Identifiers.Index)!! | 1 |
8646e4c6f733f58ccb6ae77b410a2f4e | 78304ee1a63e8a0360c9568685d04341 | 获取查询出的成果总数和指定成果在查询结果中的位置 | int[] iRets = new int[2];
string SN = GetSN();
string strSQL = "select count(*) from TemperResult where SN like '" + SN + "'";
iRets[0] = Convert.ToInt32(m_db.QueryOne(strSQL));
strSQL = "select count(*) from TemperResult where SN like '" + SN + "' and Result ... | 0 |
9eb134928895d1ef2b0e9ef827efa98d | 2b66a136d3eadb0afed72fd6e339509c | Returns a uvec3 from component-wise application of Min (Math.Min(lhs, rhs)). | namespace GlmSharp
public static uvec3 Max(uvec3 lhs, uint rhs) => new uvec3(Math.Max(lhs.x, rhs), Math.Max(lhs.y, rhs), Math.Max(lhs.z, rhs)); | 0 |
ed76774919dbd91809bf0d14f2b4c587 | 9281cd1a80d454139bc62d4a7e5c9944 | Method called from remote.<br>
Gets the game list from the server status and returns it to the client | public class CElizationClient
public HashMap<String, Integer> getGamesList(String ip) throws UnknownHostException, IOException {
HashMap<String, Integer> retVal;
retVal = new HashMap<>();
Object response;
ObjectInputStream objectInputStream = null;
ObjectOutputStream objectOutput... | 1 |
c37ea79d32006ff53df979eb031783ca | 4893b064b5ccbaa9fc649784cfe16948 | Gets rows from the datasource based on the PK_RoomFunc index. | namespace Budget.BLL
public class ItemsBll
public static string GetItemsByRoomID(int key, int index, int size, string sortField, string sortOrder)
{
Hashtable ht = ItemsDal.GetItemsByRoomID(key, index, size, sortField, sortField);
return JSON.Encode(ht);
} | 1 |
d7731ebc5553ba69b53965ef09d4c5b5 | 65abf1cc0ce6562eb59c47ac786781bb | 查询电影的所有分类,返回值是分类的id | @Service
public class MovieTypeServiceImpl implements MovieTypeService
@Override
public List<String> selectTypeIdByMovieId(String movieId) {
return movieTypeMapper.selectTypeIdByMovieId(movieId);
} | 1 |
bd3a86878a1841fb8be5613b5f2dc8bd | f7ab1f750cc9de664c0de644e849e552 | init object with i2c address, default is 0x20, 0x21 for IOPi board,
load default configuration | self.i2c =i2c= machine.I2C(scl=machine.Pin(scl), sda=machine.Pin(sda), freq=100000)
self.address=address
i2c.start()
i2c.writeto_mem(address, 0x0, b'\x01110000')
i2c.writeto_mem(address, 0x1, b'\x00100000')
i2c.writeto_mem(address, 0x2, b'\x00000000')
i2c.stop()
... | 1 |
2a5ba08758c0f4bbb2f9c9acecdbec97 | 6c5cddb001bd189bea5f1358a0d0fd7a | Sets the test_ratio of this DatasetConfig.
Ratio of test set to divide the source dataset | public class RFMapReduce
public void setTrainSubsetFraction(String trainSubsetFraction) {
this.trainSubsetFraction = trainSubsetFraction;
} | 0 |
fb777b78e5ed4ee6efc6be589b874d3c | 0baf3c358c8cdbce1df534915bd1e235 | https://open.kattis.com/contests/e3hoii/problems/cold | D, N = [int(item) for item in input().split()]
temps = [int(input()) for _ in range(D)]
clothes = [[int(item) for item in input().split()] for _ in range(N)]
dp = [[0 for _ in range(N)] for _ in range(D)]
memo = [[-1 for _ in range(N)] for _ in range(D)]
for i in range(D):
for j in rang... | 1 |
e87e490a7eaee17d15f35b953c034e9c | 65fdc069dfc2ccf1edaecd0a66614679 | Redirects to the root path | class RootHandler(BaseHandler):
def get(self, *args):
self.redirect("/") | 1 |
b970825152a8a2dcc11065f73056c6d0 | 2b70b97396fc0814508acce79590108b | <inheritdoc />
<remarks>
Если радиус круга неположительный, будет возвращён ноль.
</remarks> | {
if (R <= 0)
{
throw new ArgumentException("R > 0");
}
double res = 2 * Math.PI * R;
return res;
} | 0 |
d1ccf070ced1b3de6d7640233e1ff42f | a950de7cbebfa48d78c7f1c1ced67c82 | カバレッジを通すため、何もしないメソッドを実行するテストを走らせている。
ひとまず、例外がスローされないことだけを確認。 | class JacocoTest(unittest.TestCase):
def test_has_branch_coverage(self, mock_url_read):
mock_url_read.return_value = 'dummy'
self.assertTrue(self.__jacoco.has_branch_coverage('dummy')) | 0 |
8da38b04d2fe610cdc92d6afd72ab089 | 4742883a34b367aac0437ca404a61559 | Initialises the CourseStud.fxml GUI | i=1;
Parent root = FXMLLoader.load(getClass().getResource("/application/selectCourse.fxml"));
Scene scene = new Scene(root);
Main.primaryStage.setScene(scene);
} | 0 |
56eabb16ce4dffc36be27a81ed60899f | 4fd52dfcb4bc71dbf2f711dc30785669 | 设置采购员信息 | @Table(name = "t_bus_order")
public class TBusOrder
public void setBuyPerson(String buyPerson) {
this.buyPerson = buyPerson;
} | 1 |
7c0e4023480bba136dd58e998618f2b4 | 0b844bba328c5bb889b0f5db82b7c21b | Показывает командную строку. | namespace FileManager
public class Help : ICommand <ConsoleKeyInfo>
public bool Execute()
{
new View().Help();
ConsoleKeyInfo key;
do
{
key = Console.ReadKey(true);
} while (key.Key != ConsoleKey.Escape);
Desktop.GetInst... | 0 |
7b9843b6a046f238011851bce3ef4683 | 774f0da50c75502a34c8a13b7a5fbf72 | Unload the SCAN configuration. | scanagent_table_unlock(int argc, char *argv[])
{
return scanagent_table_entry_sub_cmd(argc, argv, SCAN_TABLE_OP_UNLOCK);
} | 0 |
9c232f9fba67d70e46d45f31831e489e | cb0e4f2b9fd31f71496c896f7e19590b | Records a writeup submission | const values = {
account_id: account_id,
name: name,
time_created: new Date(),
time_updated: new Date(),
};
return await queryAsync('INSERT INTO `writeup_submissions` SET ?', values);
} | 1 |
6db3e1cedc9211446bd65dfb75a22141 | 8d0a0c7733a243ebd216c5b27395a49b | Number of datasets. | class BaseLoader(object):
def __len__(self) -> int:
return len(self._datasets) | 1 |
d74281b3ac727b917ab0ef422f725214 | 020a6192e57771d5465459344efef0cf | 获取学员家长信息 | public class PersonalFragModel extends BaseModel
public void getParentInfo(Map<String, String> patameter, final PresenterCallBack<ParentMessageBean> callBack) {
Call<ParentMessageBean> call=mService.getParentInfo(patameter);
call.enqueue(new MyCallBack<ParentMessageBean>() {
@Override
... | 1 |
66e69ee184255eaf1f9fcb511a22a960 | 2b054efb5126125ebd4c805de1217276 | 功能描述:判断文件名是否是补丁文件
参数:文件名
返回值:bool | {
if (!File.Exists(filename))
{
return false;
}
byte[] filedata = File.ReadAllBytes(filename);
if (filedata.Length == 0)
{
return false;
}
ushort code = BitConverter.ToUInt16(filedata,... | 1 |
e46a0d9371a2e41d8e8178e21a7a56f9 | b9b096305328c9fb020d57400f7724a1 | Calculate a telescopes approximate limiting magnitude. | ra_image_list, dec_image_list = self.Multiband.image_positions(kwargs_ps=kwargs_ps, kwargs_lens=kwargs_lens)
source_x, source_y = self.lensModel.ray_shooting(ra_image_list[0],dec_image_list[0],
kwargs_lens)
dist = np.sqrt((source_x - s... | 0 |
2a0934f6a59aa02ef1b15814379bf2cb | f11666376c08a846597e1e61750190e6 | Add multiple floors to building | function setFloors (a, b)
floors = {}
for i=a,b do
floors[i] = instance:getScreenEntityById("ScreenShape." .. tostring(i), true)
screen:addPhysicsChild(floors[i], PhysicsScreenEntity.ENTITY_RECT, true,0)
end
end | 1 |
a8b83eecf81e5a9e14d2b4efbd9fe6c8 | 25d6b078db695f5fb38ec72f0ea2cb92 | Получить перечисление значений на основе элементов двумерного массива | {
return from m in Enumerable.Range(0, 1 << list.Count)
select
from i in Enumerable.Range(0, list.Count)
where (m & (1 << i)) != 0
select list[i];
} | 0 |
4ddd6e3067f849cf93dfed6b2d673341 | b6a6e9ae71f01035d82a389be53c5ea4 | Swap two cities. | p = len(sol)
i = randint(1, p-1)
j = randint(1, p-1)
while(j == i):
j = randint(1, p-1)
city1 = sol[i]
city2 = sol[j]
sol[i] = city2
sol[j] = city1
return sol | 1 |
6c756019a4232e236e789a40718f8541 | d44434e970e6d5e83534f25c2169e9d5 | Registers a new OAuth consumer application with the provider. | class GitHubBlueprint(OAuth2ConsumerBlueprint):
def register(self, app, options, first_registration=False):
if first_registration:
with app.app_context():
self.load_config()
return super().register(app, options, first_registration=first_registration) | 1 |
3a326fe5b14b77f3b1dcfe39806a53c5 | 8e7033f7d2603279ddfff6910efe946a | Return true if the file is a socket. | try:
mode = os.stat(path).st_mode
return stat.S_ISSOCK(mode)
except FileNotFoundError:
return False | 1 |
e128135326e007380ce4c24a60e6ad40 | aa7e4736512b3ba9ec4b07fe45b3ed84 | Returns number of answers for every time period | def answer_count(data, subject):
total = pd.DataFrame(data)[subject].count()
return total | 0 |
71a5312be0f2a5520d53a0372017bb21 | ed82521d1d7ef2680b8d394b4ecb7a85 | Function that takes two polynomials, constructs and returns
Returns NULL if either p1 or p2 is NULL | Node nullp = null;
if(poly1 == null || poly2 == null) return nullp;
Node pol1 = poly1;
Node com = null;
int fcase = 0;
while(pol1 != null) {
float co1 = pol1.term.coeff;
int deg1 = pol1.term.degree;
Node holder = null;
Node curr = null;
Node pol2 = poly2;
while(pol2 != n... | 1 |
a2d8499c9865f9e460acde8955d60a08 | b47fdcfb004eb5cce00485d236ec2834 | # Render a ticket creation date. | {
$value = $row[$this->fieldName];
if ($value===null || $value==='' || $row[$this->fieldName]===self::$openDate)
{
return '<td></td>';
}
$date = \DateTime::createFromFormat('Y-m-d', $row[$this->fieldName]);
if (!$date)
{
return '<td>'.Html::txt2Html($row[$this->fieldName]).'</t... | 1 |
65b5e42d262c44fb1f7fe3db1b355778 | 46142f609e8ae2871b616fa5700b4b47 | Checks if current web client is Search Engine. Returns true on success. | public static partial class UserAgentHelper
public static bool SearchEngineSpiderName([CanBeNull] string userAgent)
{
return userAgent.IsSet() && Spiders().Match(userAgent.ToLowerInvariant()).Success;
} | 1 |
4b217cb0508e3f5c35676ca511145414 | d502a2b03bf28bdb68515462a51278a7 | Get endAt | class Event extends Model
public function getEnd()
{
return $this->date_to;
} | 1 |
d4950e9825d72d221c170da626bd8d5c | c556291a5816ffb3dcae3ebe1b435493 | Metoda obslugujaca zmiane w polu tekstowym z maksymalna liczba egzemplarzy zasobu. | {
if(managedCopy != null)
{
using(var db = new BibliotekaDB())
{
Text = "Modyfikowanie egzemplarza";
managedCopy = db.Egzemplarz.Find(managedCopy.Nr_inwentarza);
copyInventoryNumber.Value = manage... | 0 |
559c48b0d35949e32d5fe0bfed7ae58f | 911d6780523aaed6ad3cc2bb880d25c2 | Tests the analyze_cron method. | async def test_cron(hass: ha.HomeAssistant, skip_history):
async with IUExam(hass, "test_every_n_days.yaml") as exam:
await exam.run_all()
exam.check_summary() | 0 |
a8df58e8e50851e307d0f8c2cda03bb2 | 68a847f80bb5e90ea2a9398f01eaadcc | 格式化Variation的First_pic_url及RelationshipDetails、删除公共variation specific数据 | {
$relationshipData = [];
$relationshipData['Relationship']['ParentSKU'] = $data['parentSku'];
foreach ($data['childSkus'] as $k => $childSku) {
$relationshipData['Relationship'][$k]['Relation']['SKU'] = $childSku;
$relationshipData['Relationship'][$k]['Relation']['Ty... | 0 |
d77a5a7046f20f4ebc1900cbddbdb44b | 4b76a96e1fc6b291caf7ecc902a95c5b | Returns the width of tiles in pixels | public class GameApplication extends Application{
public int getTileWidth() {
return TILE_WIDTH;
} | 1 |
8de7d01a942435e95d06ecca46a162d4 | 16f58db74ba6454a3f81ba34fa6520a4 | Creating a new subscriber populates the correct data, and sets the
subscriber's account inactive. | class Subscriber
def activate!
@activated = true
self.activated_at = Time.now.utc
self.activation_code = nil
self.remember_me
save(true)
@activated = false
end | 0 |
c239cb77c7cc4eda1621e957889a5df3 | 5260d4e904b6635dfd7ae35d83f3ae57 | 水位线性插值 | func interpolate(c0, h0, c1, h1, height float64) float64 {
return (c0*(h1-height) + c1*(height-h0)) / (h1 - h0)
} | 1 |
f0ae46ec7ceb99ddfc528b59e6257e8a | e809e7feb8506dbc7d8858ec0ee829fb | Gets all listeners registered for getting suspend/resume notifications. | List<XTaskMgrListener<B>> getListeners(); | 1 |
4e2a158b9820e73717fbc7d1f6f698e2 | 17074b1f81baaab77a2272ccd97f7393 | 检查空字符串,或者" "字符串 | if(!String(o)) return false;
if ( o == "" ) return true;
var regu = "^[ ]+$";
var re = new RegExp(regu);
return re.test(o);
} | 1 |
cdccd0e54ed5f40e706b24bb0077009c | 5f9ad86590bc99b0cc1a1296a54e6bac | 判断上次登陆的时间信息 | namespace WT_Platform
public partial class LoginWindow : Window
private bool IsFirstTimeLogin(string LastLoginDateTimePath = "./lastloginindatetime.json")
{
DateTime lastLoginDate = DateTime.MinValue;
if (File.Exists(LastLoginDateTimePath))
lastLoginDate = JsonConvert... | 1 |
a9317dd9bda277f2da57b946e4b70ba2 | 89d9b03d62b2883a9feec61d2ff9e375 | Sorts the elements of this sequence in ascending order according to a key. | public static class SeqExtensions
[Pure]
public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this Seq<TSource> source, Func<TSource, TKey> keySelector) =>
Enumerable.OrderBy(source.Value, keySelector); | 1 |
9b60a8ee35298e8fe788ffcea0fabc58 | 8a5da79f87c1a418a28990e185040d8e | we need to clear Sites' cache, because after post_migration signal,
there's some junk in the cache that prevents from adding comments
(the site in CACHE is not a real Site) | class DjanrainSiteManager(models.Manager):
def clear_cache(self):
global JR_SITE_CACHE
JR_SITE_CACHE = {} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.