query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
e7f31d89c52cfc81b6c335ae5abec175 | 508008e67c0d3957764ec5eb42f0a106 | Sets the color for the background and text in the textfeild | {
m_InfoTextColor = color;
m_InfoTextBgColor = bgColor;
ui->text_mat->SetColor(color, bgColor);
ui->text_weight->SetColor(color, bgColor);
} | 1 |
0ecab2337998fbb682eaf52d71ce7645 | 642b44e29f8f74bdd2f5f9b39b571377 | Get utilization of hops for given bigness and boil time factors
Part of Tinseth formula for IBU | eps = 1000 * (alpha - 1)
NIST951 = 4.04367
pBO4 = 10**-pKB / (10**-pH + 10**-pKB)
pBO3 = 10**-pH / (10**-pH + 10**-pKB)
if mode is 'bo3':
return (NIST951 * ((((d11BT - eps * pBO3) / (pBO4 + alpha * pBO3) + eps) / 1000) + 1)) \
/ (NIST951 * ((((d11BT - eps * pBO3) / (pBO4 + alp... | 0 |
7769b59913ce17a52237b44ebe4e11d7 | b7133eaa02fed955483a261b62f66270 | start process like calculator or lxterminal | func main() {
env := os.Environ()
procAttr := &os.ProcAttr{
Env: env,
Files: []*os.File{
os.Stdin,
os.Stdout,
os.Stderr,
},
}
pid, err := os.StartProcess("/bin/ls", []string{"ls", "-l"}, procAttr)
if err != nil {
fmt.Printf("Error %v starting process!", err)
os.Exit(1)
}
fmt.Printf("The proce... | 0 |
1fea7b5642af59ddd59f791851bfded2 | d8c9639ac9b1074f964c69522300cd4e | get all class storage define by ds id | public List<Zpsd> getZpsddl(Zpsd zpsd); | 0 |
95b3de442247f02d4d8156b5929bdfd9 | e3b43338312857e4acae72697724f5e2 | Initialize a QueuedLock instance. | class LockQueryData(object):
def __init__(self, lockdata):
self.lockdata = lockdata | 0 |
ba8e0d6eebbd0f2462626be135106841 | cf6378a7c25148bb496a4fd61a10edcd | 注册APP中所有的activity | for (Class<?> cls : clss) {
if (isContainsActivity(cls))
popOneActivity(cls);
}
} | 0 |
c045b22465c25307761a602fead709d3 | 2472404a77b13194f48a110148950f95 | Tests resetPath() method, which sets all the cells as unexplored except
those marked as walls. It loads the maze to condition where wall is drawn
with some path attempted.After resetPath() method is applied , it checks
whether all the cells where set as unexplored except those where wall was
drawn. | {
prepareMaze();
Stack<Point> pathStack=new Stack<Point>();
Random rng=new Random();
Point current;
boolean checked [][]=new boolean[height][width];
for(boolean[] row:checked)
Arrays.fill(row,false);
Point p=new Point(0,0);
checked[p.getY()... | 0 |
5e9bdaa03016c4353f8e14492583a1b0 | 3b6b428951d6f5a39e26904886203d36 | Creates a new duration of zero value.
# Examples
```
# use ros_message::Duration;
assert_eq!(Duration::new(), Duration { sec: 0, nsec: 0 });
``` | impl<N: Num + NumCast + Clone + PartialOrd> Zero for Deg<N>{
fn zero() -> Deg<N>{
Deg(zero())
} | 0 |
9571818ad95e94ee36c5a18c9f948e6f | b5cbabd4e3f317151fd8e028a5312d46 | close the claw using the servo | void openClaw(){
wait1Msec(250);
motor[clawServo] = 127;
wait1Msec(250);
} | 0 |
eb7fa116a57080dbc349d6402324386c | 3a2c22a8a2682dd64c438746eeecb829 | Validates the query string with the GET method
return True if its a valid query string, False otherwide | class Request
public function validRequest(){
$_SERVER['QUERY_STRING'];
return 1;
} | 0 |
68e9af1493ae1631817fa78fca21199f | bb3c3ce590ea448d42e234644ed21f8b | The docs test environment should include a validation of README.rst | lint_obj = nf_core.lint.PipelineLint(PATH_WORKING_EXAMPLE)
lint_obj.minNextflowVersion = '0.28.0'
lint_obj.check_readme()
expectations = {"failed": 1, "warned": 0, "passed": 0}
self.assess_lint_status(lint_obj, **expectations) | 1 |
e01e6741b1014809ecee60984776f631 | b1b5199914182c6f04bcf6788f8a1380 | Test case for delete_iceberg_profile_data_summarization_raw_by_id
Delete raw-data-summarization by ID # noqa: E501 | class TestConfigurationApi(unittest.TestCase):
def test_update_iceberg_retention_policy_retention_policy_by_id(self):
pass | 0 |
53c3b39ea961a93a88b25986b068a3be | 21596eb80f8f86c07f87899a844e08b8 | Obtient l'information du navire à partir de la classe de navire. | public class ShipBean
public ShipDto getShip() {
return ship;
} | 1 |
d592feb2f1388c358f291bceae30f3ee | 03dfd3483acaf616abd8a6fe64207a1e | 查看是否按照到相机的距离排序 | namespace EarthView
namespace World
namespace Spatial3D
namespace SystemUI
public class ComponentSelectTool : EarthView.World.Spatial.SystemUI.Itool
public void SetSortByDistance(bool sort)
{
EarthView_World_Spatial3D_SystemUI_CComponentSelectTool_setSortByDistance_void_ev_bool(this.NativeObject, C... | 1 |
a1737667b68aa67d8f2b43b9f59af450 | 55c16726947d476cfc71cdca8fbb1fd6 | 随机1张涩图,库中数量为0则返回null | Observable<List<Image>> getRandPic(Integer num); | 0 |
275d7e473d229665e948676ab0ea663c | 9b0c7e0a788d5fd1b23da0eeab66e10a | Disables a table (takes it off-line) If it is being served, the master
will tell the servers to stop serving it.
Synchronous operation. | @Override
public DisableTableResponse disableTable(RpcController controller, DisableTableRequest req)
throws ServiceException; | 1 |
f3eaac972aa4cce1f0320bde309aef4a | da5c9ebe0ccf4aafd013f89dd77f5b29 | 切换审批列表 | var approvalList = $("#approvalList");
var content = '';
if(approvalInfo.length > 0){
$(approvalInfo).each(function (i) {
if(i%2==0){
content +='<tr bgcolor="#ffffff">';
}else{
content +='<tr bgcolor="#f8f8f8">';
}
var subtitle = this.title;
if(subtitle.lengt... | 0 |
210626238bb0fc84dffaac9a6e988a9b | e9225dabf55b71f632d7da9595e3fbd1 | 获取一级图片比率 | public class NineGridView extends ViewGroup
public void setSingleImageRatio(float ratio) {
singleImageRatio = ratio;
} | 0 |
54008e58117b0a5ac576847ba927db77 | 9bb96d50febced41edd0fe96337908ce | Just delegate to another method | public class AbstractDelegatingPosition implements Position
@Override
public void submit() {
mDelegate.submit();
} | 1 |
7a2a07f429012b4b777b11211d6343d6 | 87d00f1541e731f91a874a404bcc54d9 | Get the specified field value for the specified opportunity as a string (or empty string if no value). | namespace Tsi.Web.Api
public partial class OpportunityApi : IOpportunityApi
public async System.Threading.Tasks.Task<List<TsiWebCustomField>> OpportunityGetCustomFieldsAsync (int? opportunityNumber)
{
ApiResponse<List<TsiWebCustomField>> localVarResponse = await OpportunityGetCustomFieldsAsyncW... | 0 |
76c89cd669bfd522793860a30f682abd | cf6e4c12e0c6efdf0739c947c95b902f | Unary masks to labels. | y = y.copy()
neg_idx = y < 0
y[neg_idx] = self.labels[0]
y[~neg_idx] = self.labels[1]
return y | 1 |
0f88ddccedcf7610cde9c66916ec3f8a | b5a711f57425121135d0eb6337754897 | 获取组件使用的el-pagination的ref | getPaginationRef() {
return this.$refs.elPagination;
} | 1 |
3a9b94834984ba12eabcc5f7e27a5687 | 01d92ee0c4b273f07a55e4b50ce337d6 | 領養動物 | $dog = OBJ('dog_table')->get(intval($this->data['dog_id']) ?: 0);
$images = [];
$pater = [];
$mater = [];
if (!empty($dog)) {
$dog['dog_birthday'] = $dog['dog_birthday'] ? date('Y-m-d', $dog['dog_birthday']) : '';
$pms = OBJ('dog_table')->akey()->get_all([... | 0 |
25995feab34f451cbfaefa6261488841 | f3c30219ec82ec51047dbd33cd536369 | Commands the I/O device to turn on the given output.
Returns True if the device responds with an ACK | class OtherMixin:
def enable_device(self):
self.send_command(DEFS.CMD_ENABLEDEVICE)
self.recv_reply()
return self.recvd_ack() | 1 |
238eef6ea69adcab1ea358baf96e3f31 | ebb4d494ec2c624e21d404a83bfb7a06 | 跳转页面--带数据传递 | fun goPage(page:String,key:String,value: Parcelable?)
{
ARouter.getInstance().build(page)
.withParcelable(key,value)
.navigation()
} | 1 |
6e6d89b4128fcd576c5270cf34bb7394 | b114b75874572b738f8c304b79baf9ab | Run after rest is loaded (like interaction with other mods). | public class FunitureModMain extends BaseMod
public void postLoadProcessing(){
} | 1 |
b453042389f41ebff7e52862b867bb5c | c6f083771395536852cb16953269ae08 | Set the after-surgery years recommended for a given follow up care procedure | void setCareOfArray(int i, com.walgreens.rxit.ch.cda.AdxpCareOf careOf); | 0 |
adf7cce7e5592234991e108c9698ae38 | 48947a82f3bbffcae2027b385e783d00 | Tests responsiveness. | class TestHttpSession(WebserverTestCase):
def test_streaming_response(self):
s = self.get_client()
r = s.get("/streaming/30")
self.assertGreater(self.runner.stats.get("/streaming/30", method="GET").avg_response_time, 250)
self.runner.stats.clear_all()
r = s.get("/streaming/30", s... | 1 |
33c129ceab98493b5f8fff05e7861b65 | c1fd3d8c438cdb2a4e5a1a4cf9d3c845 | Called when relocation of a started shard is initiated. | default void relocationStarted(ShardRouting startedShard, ShardRouting targetRelocatingShard) {} | 1 |
6e097cd70e0717a837e7f227539ce784 | abb4606001231f291eb4e4a6a68988fc | 使用簡單工廠模式(SimpleFactory Pattern)實現簡易計算機 | namespace FactoryMethodDesignPattern
class Program
static void Main(string[] args)
{
IOperationFactory factory = new PowerOperationFactory();
Operation operation = factory.CreateOperation();
var result = operation.GetResult(15.0, 3.0);
System.Console.WriteLine... | 0 |
a92be6ca0577db1cf3823a6c43ea43c0 | ccce036921e9814cc2bef3843dab7d24 | Callback function called when the "Check At Startup" checkbox is checked or unchecked. | void StartFrame::OnCheckAutoLoad(wxCommandEvent& WXUNUSED(event))
{
theApp->auto_load = chckbx_autoLoad->IsChecked();
config->Write( wxT("/auto_load_last_state"), theApp->auto_load );
} | 1 |
782c765cae8d9b95ef936eed65460c99 | fe719a1b52cf937b94f171448219289e | Partial content. | fun PartialContent.Configuration.partialContentConfig() {
maxRangeCount = 10
} | 1 |
1c089455c91cab7aa36a71e80328dc57 | 0eceb7102f1cd05dea0e75c5ac653505 | Go to 0, 0 (start of first line) | func CursorHome() {
emitEscape("H")
} | 1 |
122e0554544fe72e994395eebe79602d | 2fe454a801034603c1321ebd17cfbd5a | Unexposes a shadow copy either by deleting the file share or by removing the drive letter or mount point. | namespace Maple.Core
[DebuggerDisplay("Drive: {Name} IsContainer: {IsContainer}")]
public class MapleDrive : MapleFileSystemContainerBase, IFileSystemDrive
public override void Delete()
{
} | 0 |
b780040d6995bc7442dde2ba485f6291 | 03f5f3ede8da9c8473ef922d13acbe35 | Draw a transparent circle | GlStateManager.pushMatrix();
GlStateManager.color((float)color.getRed() / 255.0F, (float)color.getGreen() / 255.0F, (float)color.getBlue() / 255.0F, (float)color.getAlpha() / 255.0F);
GL11.glEnable(2848);
GL11.glDisable(3553);
GL11.glEnable(2848);
GL11.glEnable(3042);
... | 1 |
88d3161397eb7c6c6abf9a750cc9b54c | 24a5b1e7c764d8af1e7bf052db0463bb | 將全形英數字、標點符號、空白轉成半形字後回傳 | namespace BIN.DataAccess.Define
public class Public
public static string Half2Full(string input)
{
char[] cc = input.ToCharArray();
for (int i = 0; i < cc.Length; i++)
{
if (cc[i] == 32)
{
cc[i] = (char)12288;
... | 0 |
1175778c65968ec9591e9996409e18d9 | 63d0974883a17d07361698f409a1ea9a | Open all groups | public class DPSYActivity extends AppCompatActivity implements HttpResult
private void openAll() {
for (int i = 0; i < dealGroupDatas.size(); i++) {
listContent.expandGroup(i);
}
} | 1 |
54643768080a92e583a40498d2e82bb0 | ee9eca3296fa39d3d482462e71b6032e | Setter of filter is checked error checkbox status. | if (!Verify::naturalNumber($checked) && !in_array($checked, array(0, 1))) {
return false;
}
$this->objSphinxClient->SetFilter('product_checked', array($checked), $exclude);
return true;
} | 1 |
f01ae77ec5383ef4295d26c345e8aa17 | 02d033441cd88e2c3af43b2e287530e8 | Função que recebe a raiz de uma árvore binária e informa se ela é binária de busca. | boolean result;
if (node == null || node.children == null || node.children.size() == 0) {
result = true;
} else if (node.children.size() > 2) {
result = false;
} else {
result = (isBinary(node.children.get(0))
&& (node.children.si... | 0 |
40454442ea8558e550b8b99c6fefeb14 | e83225fbe78d05f7b30a37120812c74e | Render item position | class Ip_Ajaxnavigation_Model_Price extends Mage_Catalog_Model_Layer_Filter_Price
protected function _renderItemLabel($index, $value)
{
$store = Mage::app()->getStore();
$index1 = explode('-', $index);
$fromPrice = $store->formatPrice($index1[0]);
$toPrice = $store->formatPr... | 0 |
1e3ba2ca2ca62742fbee90ea8d73335c | e29485605df797d907591eeaab496a01 | Check that data is correct in the workshop tutor data file. | def test_workboot_data():
wb = WorkbookData(test_file)
assert isinstance(wb, WorkbookData)
assert wb.worksheet_count >= 1 | 0 |
55afe23b0970067a813dd0dc7af41ea6 | 813f523d57d9df25e6a51acc4c46eb69 | getICBill
获取IC卡账单 | public List<Map<String, Object>> getICardTwo(Map<String, Object> maps) throws BaseASException; | 0 |
444ed6960eed8e3d2f861f13d2751f3c | a13eb72b1699e000dee37deb823361e6 | Executes the get products by category procedure. | {
$filter = $this->_filterBuilder
->setField(self::ATTRIBUTE_CATEGORY_ID)
->setConditionType(self::FILTER_CONDITION_TYPE_EQ)
->setValue($categoryId)
->create();
$this->_searchCriteriaBuilder->addFilters([$filter]);
$this->_searchCriteriaBuilder... | 1 |
8665da8572bd2f7da1ca3e0a384e9f62 | e66950fd3647119975939657e8d278b6 | 播放语音 开启了语音反馈才播放音效提示 | public class MSAIBossProxy : Proxy
private void PlayForeWarnVoice(bool isplay)
{
if (!CanPalyNormalBattle())
{
return;
}
if (isplay && !m_AreadyPlayForeWarn)
{
m_AreadyPlayForeWarn = true;
if (IsInAIArea())
{
WwiseUtil.PlaySound((int)SoundID.CombatWranEnd, false, null);
WwiseUtil.PlaySoun... | 1 |
a293fa7d3f5242f86f20769b520466e1 | ad825fae8e96a933dbed3fb693cbf525 | tests that invalid variable throws exception | namespace SpreadsheetTests
[TestClass]
public class SpreadsheetTests
[TestMethod]
[ExpectedException(typeof(InvalidNameException))]
public void TestVariableLooseValidator2()
{
Spreadsheet s = new Spreadsheet();
s.SetContentsOfCell("_", "");
} | 1 |
352a7aa6bc460999e304312c108d3dc0 | f89f0a8d32fa15fdf7c4338881ea0b8d | 储值车辆类型设置 | var id = that.getAttribute("data-id");
var box = document.getElementById(id);
var inputArr = box.getElementsByTagName("input");
var i = inputArr.length;
while (i--) {
if (inputArr[i].checked) {
window.global.varCarType = inputArr[i].value;
break;
}
}
t... | 1 |
82c0ef3903fb5d2d5085a062a5d3f02c | 39251ead3f88bbec4b827d41609b8e93 | @brief Enable the timer that generates ADC trigger signal | void ADC_TimerTrigCmd(u8 Tim_Idx, u32 PeriodMs, u32 NewState)
{
ADC_TypeDef *adc = ADC;
if (TrustZone_IsSecure()) {
adc = ADC_S;
}
RTIM_TimeBaseInitTypeDef TIM_InitStruct;
assert_param(IS_ADC_VALID_TIM(Tim_Idx));
adc->ADC_EXT_TRIG_TIMER_SEL = Tim_Idx;
if (NewState != DISABLE) {
RTIM_TimeBaseStructInit(&TIM_I... | 1 |
9ffc066a11a21614e664afac15fb595f | c7d4345156a215cee05858b59ad4a8b2 | Realm server can handle multiple disconnections. | rfbBool
webSocketCheckDisconnect(rfbClientPtr cl)
{
return FALSE;
} | 0 |
bb21c5a1274b1203fb14b6435a32ebde | 2de1e65af152893e97eff27c72643f81 | Hiding the selected stage on the current form load | function pageLoad() {
$('.addFormArea').hide();
} | 1 |
de5ac39741090c32b6076ee3b55d3723 | aa345234f2564adad8e461ac76c93e66 | Return <tt>true</tt> if the integer argument includes the
<tt>TACC_EXCEPTION</tt> modifer, <tt>false</tt> otherwise.
<tt>TACC_EXCEPTION</tt> modifier; <tt>false</tt> otherwise. | boolean isIsException(); | 0 |
5cae0f85c1fd20008491182678f694ae | e8d60a9f8347a8649125e82bc953088e | Used to display the Exploration UI that is the map | MapUI.SetActive (true);
selectedTownText.text = "";
foreach (SceneInteractionData si in GameManager.GameMan.sceneInteractions) {
Button curMapBut = mapButtons.Find (but => but.name == si.sceneName);
curMapBut.interactable = si.discovered;
}
if (GameManager.GameMan.sceneInteractions.Exists (si => si.scen... | 1 |
557568c9c24a1714117f649928d20fe6 | 41256bca1728b4f30fd0c21453efe3dc | 组件初始化声明周期钩子函数 | onInit(options) {
} | 1 |
cf47e4ca77144a037de0e4712a74025d | 0b9360d16c2e967492762c2419f9ca64 | Calls late-bound property setter. | {
object[] args = Invoker.ValidateParamsArray(argument1, argument2, newValue);
value.Invoker.PropertySet(caller, name, args);
} | 1 |
0fce9b20e70e627bf3dea7d411f16c81 | 66aacfc3ab1cf8e9f6c9f7dfa0e98c69 | Check to see if Maya Python libraries are available | def isMayaEnvironment():
try:
import maya.cmds
return True
except:
return False | 1 |
104f76780568e022a7200a10972493a5 | 0e41223889b38a38c27e071e29f512c6 | 單點增值,注意 1-based 。 | {
int tmp = TotalPoint;
int p = 0;
_counts.TryGetValue(rank, out p);
_counts[rank] = ++p;
RoundPoint = tmp == 0 ? TotalPoint : tmp - TotalPoint;
} | 0 |
37aff77dcae12559afb6b60f7354cfef | 7b6468bf2d5dd5aca6277e25c97f4d0c | Sets value for ComDayCqWcmCoreImplVariantsPageVariantsProviderImplProperties.DefaultExternalizerDomain property. | class Project(object):
def default_domain(self, default_domain):
if default_domain is None:
raise ValueError("Invalid value for `default_domain`, must not be `None`")
self._default_domain = default_domain | 0 |
6e518a43076e62a9bc05a7213b9dbfc9 | 62414c9243ac1502fbe41e67a2d0d286 | Rotate a point around a given point.
Adapted from `LyleScott/rotate_2d_point.py` <https://gist.github.com/LyleScott/e36e08bfb23b1f87af68c9051f985302>`_ | def rotate_around_point(xy, radians, origin=(0, 0)):
x, y = xy
offset_x, offset_y = origin
adjusted_x = (x - offset_x)
adjusted_y = (y - offset_y)
cos_rad = math.cos(radians)
sin_rad = math.sin(radians)
qx = offset_x + cos_rad * adjusted_x + sin_rad * adjusted_y
qy = offset_y + -sin_rad ... | 1 |
0c43ad2f3e713691ad92ef32ed5e005d | d42071303bf05911fab437f69aeaba1a | Aplica um filtro passa alto ideal no dominio da frequencia | Phi=2*np.pi*1*F0mean/fs
Rho=0.9
rep=filtfilt([1., 0., 0.],[1., -2*Rho*np.cos(Phi), Rho**2],res, padtype = 'odd', padlen=9)
y=rep/np.max(np.abs(rep))
return y | 0 |
ae1afa4b8e3a1191284d0ed3cbfc8017 | dafce643ac5ae9da1e79cfd22a8e2740 | Specify a dictionary containing extension-specific max counts | if len(count_distribution_dict) == 0:
self.count_distribution_dict = None
else:
self.count_distribution_dict = count_distribution_dict | 0 |
262e98f48a683ac8a9844d8b6db34783 | 259de94d2f2f00b36fd207cb1a04ed55 | 印刷可否5を設定する | class EntryExecTranCvsInput
function setReceiptsDisp5($String) {
$this->execTranCvsInput->setReceiptsDisp5($String);
} | 1 |
14db189e444e1f9f9d171d50f9d1f72b | e2e06f403260a391257351dac3d0d790 | Gets the pediatric fields. | {
CE[] ret = null;
try
{
Type[] t = this.getField(17);
ret = new CE[t.Length];
for (int i = 0; i < ret.Length; i++)
{
ret[i] = (CE) t[i];
}
}
catch (System.InvalidCastException )
{
throw new Exception();
}
catch (NuGenHL7Exception)
{
throw new Exception();
... | 0 |
edeacb2d59a82453d344feefa48d34cc | 34a5ff81118c950d05937173404e5d9f | get_mechanic view for fetching the list of mechanics | namespace DealerManagement.Controllers
public class MechanicController : Controller
public ActionResult Index()
{
return View(_mechanicManager.GetMechanics());
} | 1 |
23125c255a7883b1f0ef94cc503b98c6 | 209337a467639057033211d5a7b69db8 | This adds a property descriptor for the Acquisition Mode feature.
<!-- begin-user-doc -->
<!-- end-user-doc --> | public class RegionItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, ITableItemLabelProvider
protected void addAcquisitionModePropertyDescriptor(Object object) {
itemPropertyDescriptors... | 1 |
ac3aea804d9b0869de80113341aa8221 | bcfcf268f586ac574e1849617a1f9842 | Insere um valor no histórico | class HistoryRepository
public function insertHistory($historyData){
if(count($historyData) > 0){
$this->history->insert($historyData);
}
} | 1 |
99b5922101132f5127af800b5b8ae4f8 | b652d1ff1c300d724ada4c9a679335a6 | 代理IP定时获取任务1 | getter = Getter()
while True:
print('开始抓取代理')
getter.run()
print('schedule_get 休息1min')
time.sleep(cycle) | 1 |
e07948c86fc25ff7af87a4f53d16cb7b | 0b9120b9267ff06a3dc3f1cf613aca88 | 读取配置文件中该请求的报文编码方式 | public class HttpClient
public void setRequestCoding(String requestCoding) {
this.httpRequest.setRequestCoding(requestCoding);
} | 0 |
83a5b5329d59b63fc800765957d6aa3a | f5857bc7e347b7457cfc3d402f4240e3 | Sets all indexes in 2D array T[][] to false. | for(int i = 0; i < validMoves.length; i++) {
for(int j = 0; j < validMoves[0].length; j++) {
validMoves[i][j] = false;
}
}
} | 1 |
029582f4d1ef347ce4e07b35f9b16b0c | c4b54e6101b93e6190ecf9254040a083 | Adjusted OPS (OPS+) | public class Offense
public static double getOPSPlus(double hit, double bb, double hbp, double ab, double sf, double tb, double lgOBP, double lgSLG){
double obp = getOBP(hit, bb, hbp, ab, sf);
double slg = getSLG(tb, ab);
double opsPlus = 100 * ( (obp/lgOBP) + (slg/lgSLG) - 1);
return opsPlus;
} | 1 |
44411b7048a78da92b509541c687d3b8 | 64fbfe08d1bae10983fc6bad17374e5e | Returns a session length based on a session distribution | class SkewCostComponent(AbstractCostComponent):
def getSessionSegment(self, sess, start_time, end_time):
timestamp = sess['start_time']
if timestamp == end_time: timestamp -= 1
ratio = (timestamp - start_time) / float(end_time - start_time)
return min(self.state.skew_segments-1, int(self... | 0 |
b94b44de6a25ed5961609db4b19e91f2 | 7b02ea47ec7a8792970c520b80d791cf | Retrieves the ASN.1 BER encoded value of the LDAP extended operation
response. Null is returned if the value is absent from the response
sent by the LDAP server.
The result is the raw BER bytes including the tag and length of
the response value. It does not include the response OID.
contents of the LDAP <tt>ExtendedRes... | {
ASN1OctetString tempString =
((RfcExtendedResponse)message.getResponse()).getResponse();
if (tempString == null)
return null;
else
return(tempString.byteValue());
} | 1 |
8189ddd6d00ed107c4d47d6023285d9a | 37a11415856071c7d4790786583a0139 | Whether this is an index for a VCF/BCF file. | {
if (file is ViCFCFile)
return true;
return false;
} | 0 |
7d30f5ede6295a00270823d1f587e976 | 279d796c3bfac87a4a30f277acfc774b | 将UploadCheckPoint中的字段数据写入CheckPointFile文件 | namespace DBSqlite
public class SqliteHelper: SQLAcess
public void SetCheckWalPoint(int size=1000)
{
this.ExecuteUpdate(checkPoint + size.ToString());
} | 0 |
d1661c9aa833f57f9471ab9189cf296f | 8fca1b2edf88e93c416e7c26ad18c8a1 | Gets the homeRealmDiscoveryPolicies | {
$queryBuilder = $this->idpRepository
->createQueryBuilder('role')
->select('role.schacHomeOrganization')
->distinct()
->orderBy('role.schacHomeOrganization');
$this->compositeFilter->toQueryBuilder($queryBuilder, $this->idpRepository->getClassName())... | 0 |
2fb5926e6924ee8c20cbb73ae606364b | cf70107e32dfa9ecf28c5f99abaf779b | Кто ссылается | class Link extends Model
public function creator()
{
return $this->belongsTo(User::class, 'creator_id');
} | 0 |
8c8ea698f3c49a9dbc8a7c67871c2972 | d9f027d2bd52988d7346bbba6e9d828b | Geeft aan of de computer slim of dom speelt | public class Spiel implements BedienerInterface
@Override
public boolean getSpielerAmZugIstComputer() {
if (this.spielerAmZug != null && this.spielerAmZug instanceof ComputerSpieler) {
return true;
}
return false;
} | 0 |
2062cd39b7082ca108c231d17c46d623 | b5f8021f4b4f40697d915cb3f5da8afc | GET: Admin/AppInfos | {
HomeViewModel model = new HomeViewModel();
model.ContactInfoss = db.ContactInfos.ToList();
model.MoreInfoss = db.MoreInfos.ToList();
return View(model);
} | 0 |
082db17226beb8c6998d57cb9add7f2b | 24d9c4153b49e3e04002ef7f28477171 | create and run templates, filling member data variables | {
if(p_airconditioning)
{
ActorTemplate::fill(p_airconditioning);
if (p_templ_animations)
{
p_airconditioning->setAnimSet(p_templ_animations);
if (p_templ_animations->getAirconditioningBodyDefaultAnim() != nullptr)
p_airconditioning->setAnimationBody(p_templ_animations->getAirconditioningBody... | 1 |
00fc58ac7b86047cd0aa7f7cac47b659 | 30d5197731bafe0b3e46767bfda47038 | Executes the Asynchronous workflow in synchronous fashion and returns the WorkflowResponse object | class AomAsyncClient(Client):
def execute_workflow_async(self, request):
return self._execute_workflow_with_http_info(request) | 0 |
d7fe96268885046432a738756e8b67b7 | 65cca14c28732c622a0d2a1034b09df6 | 当调用了submit()方法后会立即返回一个FutureTarget对象,然后Glide会在后台开始下载图片文件
FutureTarget的get()方法就可以去获取下载好的图片文件了,如果此时图片还没有下载完,那么get()方法就会阻塞住,一直等到图片下载完成才会有值返回。 | FutureTarget<File> future = Glide.with(mContext)
.load(url)
.downloadOnly(400, 400);
try {
File cacheFile = future.get();
String absolutePath = cacheFile.getAbsolutePath();
UtilTool.Log("fengjian","圖片地址:"+absolutePath);
retu... | 1 |
1a1cd7a90ba29976e0695680e903d488 | 40b20d9d48e27ce73c52e8d34028426f | Pass the seq# of your segment's first byte, your segment's length, and
the seq# that your TCP stream wants next. Returns whether 1) this segment
can advance your TCP stream right now, 2) you should buffer it for the
future, or 3) you should discard it. | tcp_write(struct TcpPcb* pcb, const void* arg, size_t len, uint8_t apiflags)
{
struct PacketBuffer concat_p;
struct TcpSeg *last_unsent = nullptr, *seg = nullptr, *prev_seg = nullptr, *queue =
nullptr;
uint16_t pos = 0;
size_t optlen;
uint8_t optflags = 0;
size_t oversize ... | 0 |
a4afe4ce36a4a82273681925d9359dce | 9f8a4b1a431c9adb1d80b81070504ffa | Checks validity of values entered into quest preference input text
fields.
the input. | function validate_user_preferences() {
logDebug("validate_user_preferences, started");
var isValid = true;
isValid &= validateTime("default");
logDebug("validate_user_preferences isValid=" + isValid);
if (isValid) {
enableSaveButton();
} else {
disableSaveButton();
}
logD... | 0 |
47ca322df3284ff79b1878bc6ebcce98 | 4e8376856d5f278ce1469faaf5e9de03 | @brief 관심_상품_옵션_내역 테이블에 데이터 입력 | @Repository
public class HotdlDataAccessObject extends SqlSessionDaoSupport
public void insertHotdl(HotdlValueObject hotdlValueObject) throws Exception {
Logger.info(null);
getSqlSession().insert("hotdlMapper.insertHotdl", hotdlValueObject);
getSqlSession().update("hotdlMapper.updateInsertHotdlProdctType", hot... | 1 |
8e190275ba83c9e820462f77975d86bf | 4f70ddb8b4d5537bfb216d6926bee5f2 | Set the parameter max to the given value | public void setMax(long v); | 1 |
0d58a2681642d4cee23167e17e10d04c | ac1be4a15f56b21237e29bce0a7c903d | This enables your API key. | public class ClientConfiguration
public String getApiKey() {
return "yEXj2LbU4";
} | 0 |
791ebae99aa2bcb8efac9bc7e55cb415 | e26cc74857e2cb717b2c99b8112a16ba | Returns a tuple with the objects's position and heading. | class Robot():
def get_pos_and_orientation(self):
pos, rot = p.getBasePositionAndOrientation(self.pybullet_id)
euler = p.getEulerFromQuaternion(rot)
return np.array(pos), euler[2] | 1 |
cff6b004a95499296c7976a0c24426d8 | 5077a42afdd5b8b31232bb136ba67b19 | Stops listening for PS4 controller events | {
if (MLInput.IsStarted)
{
MLInput.OnControllerButtonDown -= OnButtonDown;
MLInput.Stop();
}
} | 1 |
b748ed552650967ab57c66231619463b | 5f4feea6d7c6d7d77b6c9735242137e4 | Extracts all non-terminal and terminal symbols, defined in grammar | global grammar
for g in grammar:
for value in dict(g).values():
for ch in value:
if str(ch).isupper():
unterminalSymbols.add(ch)
else:
terminalSymbols.add(ch) | 1 |
45e0e7d1a8e6d03d44dbaf6225afbaa3 | 1c13a53092d879373e12681e60e0a356 | returns the cov matrix of the dataset | def get_covar(df):
df_data = df.copy()
return df_data.cov() | 1 |
2a48461eb3767bf6a373148d998dae69 | c93f0d546d0d4a8d8c91707b81fc7502 | Tests involving type variables. | TYPEINFER.with(|ti| ti.reset());
let ts = TypeScheme::new(vec![tyvar("a"), tyvar("b")], tyvar("c"));
assert_eq!(ts.tyvars, [tyvar("a"), tyvar("b")]);
assert_eq!(ts.tpe, tyvar("c"));
assert_eq!(ts.to_string(), "∀ (a,b) . (c)");
let t1 = ts.new_instance();
assert_eq!(t1.to_string(), "c");
} | 1 |
2780fe247e7e6750a24f4a29cf8f6583 | 64a9372115c98f10cf3e0ec1698daa1b | https://github.com/liuspencersjtu/awesome-algorithm/blob/master/docs/Leetcode_Solutions/Python/0224._Basic_Calculator.md | def lc_basic_calculator(string):
class Solution(object):
def calculate(self, s):
s = s.replace(' ', '')
while '(' in s:
tokens_before = s.split('(')
token_after = tokens_before[-1].split(')')
value = self.calculate(token_after[0])
... | 1 |
7428c7dfd2ef214faf8a46c8db3a642d | c84cb3384d1fa7db3cd319aa649e7300 | 携带当前记账类型参数,跳转到添加分类页面 | public String toAdd(HttpServletRequest req, HttpServletResponse resp,Model model,ClearCheckErr info) {
List<CortexSysParameter> list=CortexService.getSysParamListByParamType("FS_TRAN_TYPE");
model.addAttribute("fsTranTypeList", list);
return "modules/fs/clearCheckErr/clearCheckErrAdd";
} | 1 |
c79acd22875ac273e247b77a2ba6aa81 | 3db3900adecdc7c4d20e32c64186671a | Si está en el aire (si ha sido disparada), se le aplica una velocidad al rigidbody | public class shot : MonoBehaviour
void Update () {
if (airborne) {
transform.Translate (0f,0f,velocity);
}
} | 0 |
88dbac2795926488cf3877850edfc61d | 30a790842657610d85ae18222c368f4a | Given a qconfig, decide if the activation needs to be
dynamically quantized or not, this includes dynamically quantizing to
quint8, qint8 and float16 | def activation_is_dynamically_quantized(qconfig):
activation_dtype, _, activation_is_dynamic = \
get_qconfig_dtypes(qconfig)
return activation_is_dynamic | 1 |
644363a7cb0da83af6f92a589ba9241a | 950a94a3471142dedb4b9f11f65ccae8 | initialize all simulators to the current simulationTime | {
{
rtsiSetSimTimeStepPtr(&bicycle_kin_sim_M->solverInfo,
&bicycle_kin_sim_M->Timing.simTimeStep);
rtsiSetTPtr(&bicycle_kin_sim_M->solverInfo, &rtmGetTPtr(bicycle_kin_sim_M));
rtsiSetStepSizePtr(&bicycle_kin_sim_M->solverInfo,
&bicycle_kin_sim_M->Timing.ste... | 0 |
a30a804f1222f81ebe52d6be5b67705b | dcadf45c72229512c9c42c6a52c2d3e0 | 跳转到修改支付订单 | try {
this.payOrderManagerDao.modifyPayOrder(payOrder);
addActionMessage("Update successfully!");
} catch (Exception ex) {
this.addActionError(ex.getMessage());
addActionMessage("Update fail!");
}
return "edit_success";
} | 0 |
011051da84f6e544f7ff1e7e2b229e37 | a385626b1cd7933a02029889613b4bde | Given a path and a button, apply the image to the RawImage component inside the button | image = QImage(str(path))
self.model.image_path = path
self.canvas.update_canvas(container_width, container_height, image)
self.model.announce_update() | 0 |
87c8e419aa4aee29448069cfe78afbf0 | df80d6f78b2c870ef619b9c5c80b3eb2 | returns the output of both Q-Networks | qval1 = self.critic1.get_qval(sess, observation, action)
qval2 = self.critic2.get_qval(sess, observation, action)
return np.minimum(qval1, qval2) | 0 |
754b00fb6cbb9f98862ef5d0234c5ba6 | 0a1471ae6877a750d7e3454c193d8723 | Css selector defining the container where the tooltip will be appended. If the
container is null (or empty string, the tooltip will be added after the element targeted by the tooltip.
<p/>
If the <code>container</code> is equals to 'parent', the tooltip will be appended to the parent element of the
element.
<p/>
If the... | namespace Kendo.Mvc.UI.Fluent
public partial class ContextMenuBuilder
public ContextMenuBuilder AppendTo(string value)
{
Container.AppendTo = value;
return this;
} | 1 |
f58c273b2378d82f051c5bae99c85787 | be050e4f4350b3eb85c9959587a5923a | 读取mat文件数据 | x = loadmat(filename)
data = np.asarray(x['val'], dtype=np.float64)
new_file = filename.replace('.mat','.hea')
input_header_file = os.path.join(new_file)
with open(input_header_file,'r') as f:
header_data=f.readlines()
return data, header_data | 1 |
cebdc4058d39d53075477e23213fa155 | 2430134f10b7cd8c56b110fa2420252c | call all lights off | namespace Simon
public partial class Simon : Form
private void TurnAllLightsOff()
{
TurnGreenLightOff();
TurnRedLightOff();
TurnYellowLightOff();
TurnBlueLightOff();
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.