query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
76a2aec1ca801a9d237f247f7fb52ea7 | b64aecca39fabada1001d047a73f7241 | draw the Kalman filter updates interactively | global wobs
global fobs
global fgen
global ferr
wmask = [(i > (window[0]-interval)) and (i < (window[1]+interval)) for i in wobs_0]
wobs = [wobs_0[i] for i in xrange(len(wobs_0)) if wmask[i]]
fgen = [fgen_0[i] for i in xrange(len(wobs_0)) if wmask[i]]
fobs = [fobs_0[i] for i in xrange(len(wobs_0)) if wmask[i]]
... | 1 |
23b0f8eb058a994ce34f7dddd0ae5561 | 58f484889491deecaffa27b0e31e2ef0 | Set up the DirecTV component. | async def async_setup(hass, config):
hass.data.setdefault(DOMAIN, {})
component = EntityComponent(_LOGGER, DOMAIN, hass)
entities = []
for object_id, cfg in sorted(
config[DOMAIN].items(), key=lambda x: CONF_MEMBERS in x[1]
):
name = cfg.get(CONF_NAME)
off_script = cfg.get(CO... | 0 |
594bc3e9b49387ae703b0479151d50ff | 1bed21f7543c23c3aea6b66fd6ad907b | 版本缓存,强更时删除本地下载文件 | public class ResUpdate : MonoBehaviour
private void UpdateLocalVersionFile()
{
if (NeedUpdateLocalVersionFile)
{
StringBuilder versions = new StringBuilder();
versions.Append(ServerResVersionNum).Append("\n");
foreach (var item in ServerResVersion)
{
... | 0 |
be99ce7fd4fc37f7892e55e9f69b867f | e158b083417577bd67ad53bffc87d3b5 | 为image执行一段渐进的动画 | ValueAnimator rotateLeft = ValueAnimator.ofFloat(image.getRotation(), image.getRotation() - 45);
rotateLeft.setDuration(250).addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
image.set... | 1 |
45224f23e3e5508f17b6b349519a47d8 | 42fd932d8c80e3cf5478a1d2c762d29a | 如果是超级管理员,无需返回菜单列表 | if view.action == 'list':
self.message = '只有管理员可以访问用户列表'
return request.user.is_superuser
return True | 0 |
81e59ae6d49741630a6763e1a6e548c1 | 5425a265a8ced976cc265445ed308343 | 添加月排班计划。 | namespace ServiceCenter.MES.Service.Client.FMM
public class ScheduleMonthServiceClient : ClientBase<IScheduleMonthContract>, IScheduleMonthContract, IDisposable
public ServiceCenter.Model.MethodReturnResult Modify(ScheduleMonth obj)
{
return base.Channel.Modify(obj);
} | 0 |
90f1393cad16aa5cf9f5d98f4c0ec81b | caf69c7982bce8c03047c6e738ad871a | Gets the value of the initialQueueId property. | public class GetQueuesRequest implements Alignable
@RequestField(name="acd_queue_id")
public Long getAcdQueueId() {
return this.acdQueueId;
} | 0 |
af00c2c85669f624a21a3798547a79a0 | e0ea41afd6b21bdf9ce9914fb6e514da | expressoes : expressao | def p_expressoes_expressao(p):
p[0] = p[1] | 1 |
22ba9de1b5adfe5463214994e33316ad | f9ff71f0f12cd0f2de9421954ebf3249 | Test that the basket view will redirect whilst not logged in and no basket. | response = self.client.get(self.basket_url)
self.assertContains(response, 'You do not have any items in '
'your basket')
self.client.force_login(self.user)
total = self.quantity1 + self.quantity2
response = self.client.get(self.basket_url)
self... | 0 |
d6e39cfa6f9f4e68c71219c05e9fe7c4 | 7a8de18599fbe58f1d1a971d0b5f8650 | 小程序svg图标 | return src(projectPath(PATH_CONFIG.src, PATH_CONFIG.svgSprite.src, '*.svg'))
.pipe(svgmin(function getOptions(file) {
let prefix = path.basename(file.relative, path.extname(file.relative));
return {
plugins: [{
cleanupIDs: {
prefix: prefix + '-',
minify: true
... | 1 |
18ed0d59d9b2e98e47d1af2bdaf94190 | 8fd15bdd90a3f147005aa2ce1f0b1371 | 购买攻打次数回调 | function ArenaRobRiceMyRepoLayer:_onBuyToken( data )
if data.ret == 1 then
self:getLabelByName("Label_Revenge_Times"):setText(G_Me.arenaRobRiceData:getRevengeToken())
end
end | 1 |
ae34608f5b9bd8da389a865e19f3874c | a3c5b509edea227aa730e981e903ae0a | 硬件出厂,批量增加调拨记录 | namespace MCSFramework.BLL.PBM
public class PBM_DeliveryBLL : BaseComplexBLL<PBM_Delivery, PBM_DeliveryDetail>
public static int AdjustInit(int WareHouse, int OpStaff, string InventoryIDs)
{
PBM_DeliveryDAL dal = (PBM_DeliveryDAL)DataAccess.CreateObject(DALClassName);
return dal.Adju... | 0 |
6092ebc730bfd2808919e986487b275b | 30f42be1a3e56bb0327ce5f20da9b373 | Make it see through | public class EffectAlphaCtr : MonoBehaviour
void setObjectToTransparent()
{
mat.EnableKeyword("_ALPHACTR_ON");
mat.SetOverrideTag("RenderType", "Transparent");
mat.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha);
mat.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.... | 1 |
51f833a494a67a376c8c5d290e35c894 | 5a0f04ae18e9b71e8ddd6eae7d12e491 | Deals with interaction between two particles. | double factor = sqrt(1.-loss);
double dx = p1.x-p2.x;
double dx2 = dx*dx;
double dy = p1.y-p2.y;
double dy2 = dy*dy;
double distance2 = dx2+dy2;
double sin2 = dy2/distance2;
double cos2 = dx2/distance2;
double sincos = dx*dy/distance2;
double dVx = p1.vX - p2.vX;
double dVy =... | 1 |
8df562b1a07f16406c6bb1b1927f3f1e | 089240a25564ebfbd421382c07e1f126 | Calc the Adamant Orb multiplier | if (allDPSMultiplier != 0) {
var unknownMult = allDPSMultiplier / (allHeroMultiplier * achievementMultiplier);
var maxA = Math.floor(logBase(1.05, unknownMult));
var maxB = Math.floor(logBase(1.1, unknownMult));
var closest = [0, 0, 1, unknownMult];
for (var k = 0; k <= maxA;... | 0 |
d4bed9f6b268e14511bf8bfa8c763180 | 3c598453b4ca625794cf4363df2db1d4 | ストリームに書きこまれた文字列を連結し、返す | public class ProcessReadThread extends Thread
public String getStreamMessage() {
int cnt = 0;
StringBuilder sb = new StringBuilder();
for (String streamMessage : streamMessageList) {
sb.append(streamMessage);
if (streamMessageList.size() != cnt) {
sb.append(System.getProperty("line.separator"));
}
... | 1 |
a8c55768557a78c30fe44a8a206472ec | f287e053b9782db7cd7149847fa90fc0 | 公共逻辑循环处理 | {
for (int i = 0; i < maxMsgCountProcess; ++i) {
if (msgQueue.isEmpty()) {
break;
}
IMessageHandler msgHandler = msgQueue.get();
Assert.notNull(msgHandler);
long begin = System.nanoTime();
try{
msgHandler.execute();
}catch(Throwable t){
Loggers.errorLogger.error("Global Logic process... | 1 |
cf10585f74eac5ea382a890341f8253b | 28037bdc4099be403faba68d505113b3 | Is called before start(). Mainly used for references. | public class ReferencesOnBody : MonoBehaviour
void Start () {
} | 0 |
886d5d2722665ac6a065cf0f95e3755e | 238159f134bfbf7a3cb44ba9ed2081bd | Parses optional extensions to an expression. | class ProtoParser:
def read_extensions(self, location: Location, documentation: str) -> ExtensionsElement:
values = []
while True:
start: int = self.reader.read_int()
ch = self.reader.peek_char()
end: int
if ch in [",", ";"]:
values.append(... | 1 |
9ff350dddbc22a93f52a4fce546d5dcd | 1479c7e0e703f6556b82743b27b59c88 | returns minutes in the difference as a percentage of a day | const secondsInADay = 24 * 60 * 60;
const now = new Date();
const hours = now.getHours() * 60 * 60;
const minutes = now.getMinutes() * 60;
const seconds = now.getSeconds();
const totalSeconds = hours + minutes + seconds;
const percentSeconds = totalSeconds/parseFloat(secondsInADay);
retu... | 0 |
ce4ffc06675a60c82d30dd64c67f2196 | 271f95e4544c361021a393a288aefd5d | Testing the calculate rank weights function when c=0 and n=0 | class TestKabam(unittest.TestCase):
def test_aweight0(self):
try:
self.blackbox_method_int('aweight0')
finally:
pass
return | 0 |
1d8d450bc0f21e7bb58dbf82543ec8c2 | 04208764078d78e32d8c0e77d2399335 | 查询微博用户是否绑定本站会员 | namespace Shangpin.UserService.Core
public class EReportService : IEReportService
public int GetSinaWeiboBindStatus(string userId)
{
SWfsUserInfo uInfo = GetSWfsUserInfo(userId);
if (uInfo != null)
{
return int.Parse(uInfo.BindStatus.ToString());
... | 1 |
bb5dcd3db4a396880c696529004fd453 | 16b53ec36b502303a27fb88b735d1444 | Updates the UI and object state based on the users navigation
of the quiz. No validation is required on the assumption that
the UI state was updated via setNavState(). | statsObject.indexRounds += direction === "roundForward" || -1;
statsObject.indexQuestions = 0;
document.querySelector("#questionBack").style.display = "none";
document.querySelector("#questionForward").style.display = "";
var currentStatObject = statsObject.rounds[statsObject.indexRounds];
var userAnswer = ... | 1 |
23450564436c8a9c4f84b7f21024adc0 | c063776453bac2ac125e90b9ac5c0cb5 | mifareClassic_readDataBlock
@brief Tries to read an entire 16-bytes data block at the specified block address.
Data Sheet: section 7.3.8 InDataExchange (page 127). | uint8_t blockAddr,
int32_t data
) {
MFRC522_StatusCode result;
uint8_t cmdBuffer[2];
cmdBuffer[0] = command;
cmdBuffer[1] = blockAddr;
result = MFRC522_PCD_MIFARE_Transceive( cmdBuffer, 2, false);
if (result != MFRC522_STATUS_OK) {
return result;
}
result = MFRC522_... | 0 |
d4032aa10760fec90103702218b0cc7a | aa47e42630f64fd6d4603032ac1a6513 | Rotates the inventory panels around. | namespace Eleconnect
public abstract class Panel
protected virtual void Rotate(bool isClockwise)
{
if(sp.angle % 90.0f != 0.0f) return;
rotateTo = sp.angle + (isClockwise ? 90.0f : -90.0f);
RotateRoute((isClockwise) ? 1 : -1);
rotateCnt += (isClockwise) ? 1 : -1;
if(rotateCnt == 4) rotateCnt = 0;
... | 1 |
24e66f87d9e9b36121bb347eb2ff9925 | 14c4f0ab3cbb070defcd97383b57b0b0 | 判断密码是否符合规定(长度8-20位) | namespace LetterCount
public partial class Frm_Main : Form
public bool IsLength(string str_Length)
{
return System.Text.RegularExpressions.Regex.
IsMatch(str_Length, @"^.{8,}$");
} | 0 |
b45a5c9883708ab8cd22b84b2c1e8374 | 07cccf678e32745aa3a8dd7aa22513ef | Takes in an array which contains the characteristic traits of a personality type
and returns the normal name of the personality type; | return "Fighter" if x == 0
return "Thief" if x == 1
return "Fighter" if x == 2
return "Magic-User" if x == 3
return "Cleric" if x == 4
return "Bard" if x == 5
end | 0 |
ec817af0448ddea2f9715ed6294d393e | 958a92757d67769500275216a838ebe7 | 获取书籍详情 缓存时间7天 | var data = get_ajax_header();
$.ajax({
type: "post",
url: api_url + "book/get_bookDetail",
beforeSend: function(request) {
request.setRequestHeader("apiKey", data.apiKey);
request.setRequestHeader("timestamp", data.timestamp);
request.setRequestHeader(... | 0 |
4a1a3583741a3ed383b247ac3ab5b1e3 | 8b9eaf79f5e56f73c31941ed377e9fb4 | Access the condvar. | STATUS defaultWaitConditionVariable(UINT64 customData, CVAR cvar, MUTEX mutex, UINT64 timeout)
{
UNUSED_PARAM(customData);
return CVAR_WAIT(cvar, mutex, timeout);
} | 1 |
61d0041a6b99461182fb0edea9de3130 | bff4139f25c7e35a3a00bedc7978d469 | Gets the team count. | namespace HelloWorldWeb.Controllers
[Authorize]
public class HomeController : Controller
[HttpGet]
public int GetCount()
{
return this.teamService.GetTeamInfo().TeamMembers.Count;
} | 1 |
5bbdd4eb3bef875d510bc6bf3e4d21d3 | bab3223043f2896539c4004dcf585686 | Récupère une réponse par Id réponse | class Reponse
public function getIdReponse()
{
return $this->idReponse;
} | 0 |
56efb441c296edbb87c9e379193603c6 | f5a39c797b7619f3f6e504c44f956cd2 | Only write tag if both name and value is non empty | {
if ( StringValidation.isEmpty(name) || StringValidation.isEmpty(value) )
{
throw new IllegalArgumentException("name and value must be defined");
}
XmlTag arg = new XmlTag(name);
arg.setValue(value);
addBodyContent(arg);
} | 1 |
9bbb4a8142463d9526a3225d2fa26ded | 29688f90cea19cf92c2f5313b96f2c59 | Inicjalizacja planszy 5x5. | {
for (int i = 0; i < rozmiar; i++)
{
int r = rand() % 5;
if (r == 0)
{
plansza_w[i] = 'A';
}
if (r == 1)
{
plansza_w[i] = 'B';
}
if (r == 2)
{
plansza_w[i] = 'C';
}
if (r == 3)
{
plansza_w[i] = 'D';
}
if (r == 4)
{
plansza_w[i] = 'E';
}
if (r == 5)
{
plansza_w[i]... | 0 |
58988040c5d9620f2a2570b61493ff17 | 781106268b22f74f8207504528451b65 | 艦娘の装備一覧をクロールして作成する | $("#item_list").html("");
$.getJSON('https://darkstarteam.github.io/destinyflavortext/data/weapons/scouts.json', function(data) {
var container = $('#item_list');
for(var i = 0, k = data.length; i < k; i++){
var name = $(document.createElement('p'),
... | 0 |
d7ae4d2987364928419c1f17604071be | b52dd480753212b77abd68568878da77 | A dictionary that keeps its keys in the order in which they're inserted.
copied from django/utils/datastructures.py | def order_dict():
d = OrderedDict()
d['foo'] = 1
d['bar'] = 2
d['spam'] = 3
d['grok'] = 4
res = json.dumps(d)
print(res)
d['foo'] = 5
res = json.dumps(d)
print(res)
del d['foo']
d['foo'] = 6
res = json.dumps(d)
print(res) | 1 |
314eaaebc4a859fbf408415e4770e586 | 3c98674b0cb8e11d2e16d6d9fa8ada5a | Contenir un polygone revient à contenir tous les cotés du polygone | {
ign::geometry::LineString lsExt = p_poly.exteriorRing ();
lsExt.addPoint( lsExt.pointN(0) );
p_poly.setExteriorRing( lsExt ) ;
return;
} | 0 |
862ea00694698612f895c3b7ba47699a | 4e679b746d29346380721540dcabbce1 | seta o foco no campo de nome | namespace ccbpess.pesquisa
public partial class frmCCBBusca : Form
public void defineFoco()
{
txtNome.Focus();
} | 1 |
fc913f13ff1e3e488489ddaa5ab46ea1 | 1f5c5922f12fd699fcf680ac88302e59 | The bgp community values to filter on. e.g. '12076:5010'. This method has additive effect. | class LogicalRoutingAndServicesApi
def delete_bgp_community_list(logical_router_id, community_list_id, opts = {})
delete_bgp_community_list_with_http_info(logical_router_id, community_list_id, opts)
return nil
end | 0 |
cca63a0447dfac7f7a13a8e273524001 | 4ef760111d29a34d64f67e568e7c5467 | directory in which to run the xcomtcp command | rVal = ''
myenv = self.getDomainEnv()
if self.getWasEnv().lower() == 'prod':
rVal = '/dmp/WDT'
else:
rVal = '/dmp/WDT/' + str( self.getWasEnv().upper() )
myHost = socket.gethostname()
if re.search( 'diploy11', myHost ):
rVal = '/nfs/dist/dmp/WDT/' + str( self.getWasEnv().upper() )
return rVal | 1 |
c3e75303e2876a50aef7cdd71cda2b74 | 463ae9681472378012ad69c39ac1dd17 | 通过产品ID和产品名称判断产品编码是否重复 ---DS2012 | {
UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
string CompanyCD = userInfo.CompanyCD;
string[] IdS = null;
ProductID = ProductID.Substring(0, ProductID.Length);
IdS = ProductID.Split(',');
for (int i = 0; i < IdS.L... | 0 |
80a09f2ccfec231964dcbeea490bff68 | 2a37c3f3735b3d8ab846a2ffbf6281ae | Atom or Molecule method returns the number of hydrogens
Returns:
int: number of hydrogens | class HydroCarbMole(object):
def getNumOfHydroAtom(self):
return self.__numOfHydroAtom | 1 |
eb718ba4aeec8e2163fbf3756e435743 | 2536d570d472486dab90534401235032 | Returns the meta object for class '{@link hotelService.BookingManager <em>Booking Manager</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getBookingComponent_BookingHandler(); | 0 |
3fae98cb575bfdd1f75354f186e54491 | 6c7010a4085e4647f42fb52243eb8ce6 | Launches a new coroutine and repeats `block` every time the Fragment's viewLifecycleOwner
is in and out of `minActiveState` lifecycle state. | expect class CoroutineWorker
fun execute(block: suspend CoroutineScope.() -> Unit): CoroutineWorker | 0 |
282aa13ca0e00a890e0bb217fb0d2ffc | 18f698fcc1f898101e27166f3a53a8e2 | 假如集合含有数组或对象,你应该传入你希望连接的属性的「键」,以及你希望放在数值之间的拼接字符串 | target: object | Array<any>,
chainKey: string,
value: any
): any {
const keys = chainKey.split(connector);
const selfKey = keys.pop();
const parent = keys.reduce((pre, key) => pre[key], target);
parent[selfKey] = value;
} | 1 |
09164b158175e2e43f75362d82a3a55a | 92a1b4c69277d70aa92b5af50fc72b0f | Setter for <code>WETRN.V_OFFR_ALL_WITH_BEST_COST.MP_MRKTG_PROD_RSPBLTY_ID</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.7.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class VOffrAllWithBestCostRecord extends TableRecordImpl<VOffrAllWithBestCostRecord>
public void setPymttProdTypId(BigDecimal value) {
... | 0 |
761252e6e59d47fda56ca8a0085f9ee1 | ae9be795f741deca4d77f7a0c6732965 | Metodo para transformar un UserEntity a dto | @Component
public class UserServiceFacadeImpl implements UserServiceFacade
private UserDto assemblerUserDto(User user){
UserDtoAssembler assembler = new UserDtoAssembler();
return assembler.toDto(user);
} | 1 |
c36fb727afa9e903d7918e86045e1c93 | 7d1df540d417429bd628200ab429e0a6 | <pre>
Optional. The size of the Cloud Composer environment.
This field is supported for Cloud Composer environments in versions
composer-2.*.*-airflow-*.*.* and newer.
</pre>
<code>
.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfig.EnvironmentSize environment_size = 16 [(.google.api.field_behavior) ... | boolean isSetSize(); | 0 |
b2df86c1300b62c523a6fc79aff7c1eb | b4c0290a3c9457e8afdf0b2c34011389 | Disable JAligner logging, which is on by default. | class DomainAxisTest(unittest.TestCase):
def setUp(self):
cfdm.log_level("DISABLE") | 0 |
4ef5170fa232c4914f5f0ffa26fa324e | 76c0ffe59508f38e61943643a6807d97 | Getter for <code>WETRN.SKU.CREAT_USER_ID</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.7.2"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class VBrndRecord extends TableRecordImpl<VBrndRecord> implements Record11<BigDecimal, String, Date, String, String, BigDecimal, String,... | 0 |
b882e3b870ec53c2f8bd20f131dfc6a3 | 37075eb681fcaa0ca27eb8c9a293c74c | Gets the {@link Node} the navigator is currently focused on. | AccessibilityNodeInfoCompat getAccessibilityFocusNode(boolean fallbackOnRoot); | 1 |
9fd6bb7836c17c3509291910f10850e2 | 245aaaf304e232d104384772dad83403 | initialize player names to the default names by default | public class AIGameActivity extends Activity
public void addPlayerNames(){
SharedPreferences sp = getSharedPreferences("your_prefs", Activity.MODE_PRIVATE);
String playerOneName = sp.getString("player1", "");
if(playerOneName.equals("")){
playerOneName = getString(R.string.player1);
... | 1 |
198b47b7a6f9208ac2dad456eceefed3 | 8ef84e2ae0bf57e992719b4ef83c0470 | change datetime str to filename format | class MyTwitterStream:
def convert_datetime_str(self, created_at):
dt = datetime.strptime(created_at, '%a %b %d %H:%M:%S %z %Y')
dt = dt.astimezone()
dst = datetime.strftime(dt, '%Y%m%d_%H')
return dst | 1 |
046d5ffc709f209776f0de669dba5fe1 | 08aff27b0590dc203438501513ce5d45 | 获取pic_id参数,用于post时发送图片信息 | class GetPicView(APIView):##查询pic_id对应的图片
def post(self, request, *args, **kwargs):
data = request.data
user_id = data['user_id']
pic_id = data['pic_id']
try:
obj = PicInfo.objects.filter(id=pic_id)
result = []
for item in obj:
result.appen... | 1 |
10b55861c7e908fc139d49d66b9d1933 | 72e90456060c2d093c0bf3f87364a96e | Update machine vars on disk. | assert isinstance(var, dict), '%r is not a dict' % var
old_vars = get_globals()
old_vars.update(var)
with open('/data/dss_data/local/variables.json', 'w') as f:
f.write(json.dumps(old_vars)) | 1 |
7f72fa3a775dc8ea915eaffc225b37bc | 1e998c18fd43d745292ca9666b425e54 | Native (JNI) implementation of DrumPlayer.teardownAudioStreamNative() | {
if (mRefCnt.get() == 1) {
DisconnectFromGraphAndDestroyStream();
}
NS_IMPL_CC_NATIVE_RELEASE_BODY(AudioParam)
} | 0 |
a76d6f592459f408815c1fc8b98a2778 | bf9cd1d4465cc934a19354048d854834 | Test happy path for 5-min load avg metric. | await init_integration(opp, aioclient_mock)
state = opp.states.get("sensor.home_humidity")
assert state
assert state.state != STATE_UNAVAILABLE
assert state.state == "92.8"
aioclient_mock.clear_requests()
aioclient_mock.get(API_POINT_URL, exc=ConnectionError())
future = utcnow() + timede... | 0 |
a34f76468fa6039df0dfa70bb73913d0 | b72c78b20e157367330b1de706ad7919 | method that configures an AeroelasticHAWTVT instance with
standard components | self.altitude_start = None
self.altitude_end = 10. * Units.km
self.throttle = 0.5
self.air_speed = 100 * Units.m / Units.s
self.state.conditions.update( Conditions.Aerodynamics() )
ones_row = self.state.ones_row
self.state.unknowns.body_angle = ones_... | 0 |
3b338f1d4751037d498ed0b25d502dbf | 2bfee54fac6421b31b48dc59aa0d64ae | 读取样式定义文件,返回样式列表。 | def getMapnikStyle(filename):
f = open(filename, 'r')
i = 0
list = []
for line in f.readlines():
list.append(line)
if '<Style' in line and '<StyleName' not in line:
j = i
if '</Style>' in line:
k = i
i = i + 1
styleList = list[j:k + 1]
f.cl... | 1 |
41568f79e0ebdd9ae0d97a042cb590e4 | 3bb62bdf30bae5326daa4ec90d3443f8 | Initialize the popup for UI feedback that data on the meter is being updated. | ResourceProxy rp = new DefaultResourceProxyImpl(getActivity());
textOverlay = new TextOverlay(rp, getResources().getString(R.string.translink_open_data), dpiFactor());
} | 0 |
4d5f61d8c00e61a8015b66af47a753aa | 9ee543b823b842ad49007bb1124e2d23 | Creates a new ActionScript method definition, adds it to the list of
methods supported by this tyoe, and returns a reference to the
method.
<p>Note that the methods of an {@link ASInterfaceType} cannot have
statements added to them, though this API doesn't make the
restriction apparent.</p>
new method by other ActionSc... | public final class ClassGenerator
public ClassGenerator addMethod(String name, int mod, Class<?> returnType, Class<?>[] parameterTypes, String body) {
return addMethod(name, mod, returnType, parameterTypes, null, body);
} | 0 |
b0e1f4c706bb2aa005103e94c76acc73 | c019bf1de220d5f00ab7c9f029f593e3 | Customizes the legal grid user control. | namespace Argix.Freight public partial class QuickQuoteTool : UserControl
private void OnControlLoad(object sender,EventArgs e) {
this.Cursor = Cursors.WaitCursor;
try {
if (!this.DesignMode) {
#region Grid customizations from normal layout (to support cel... | 1 |
a99be36d9627ece30d8df62f89683d9d | 772fbe370c50fdd796bc7c5749b65ef8 | 更新当前激活的窗口对应的iframe的src为指定的url | var target = $('.J_iframe[data-id="' + $(this).data('id') + '"]');
var url = target.attr('src');
} | 0 |
0e6c96ab55a99b878bd81be078bd1212 | a4c551e81da400f5431e4ac55e30a149 | Teste para verificar se todas as informações serão trazidas. | class TestChamados(unittest.TestCase):
def teste_a_get_chamados(self):
dados = self._c.get(self._url+self._rota).json()
self.assertIn('cabe', dados.keys())
self.assertIn('solicitante', dados.keys())
self.assertIn('corpo', dados.keys()) | 1 |
65586633ea90f02909d8995d406c2a4a | b7de3423736f039b4fe0cc14785807f3 | Modify post meta for enabling builder status and disabling static css if current request is
layout block preview | if(defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE){
return;
}
if (!wp_verify_nonce($_POST['additional_page_meta_fields_noncename'], 'additional_page_meta_fields_nonce' )){
return;
}
if (isset($_POST['post_is_static'])){
update_post_meta($post_id... | 0 |
3f65a26122bbfef3bddc039858d7f669 | fcc55568e370f9a887aed8f765d47b05 | Returns the twitter card type. | public function ctag(): ?string; | 0 |
c5ddd33c991ee5b7248880d003d03267 | bd31956c3f5a624180e44366229b07de | 服务器端不停的接收客户端发来的消息 | class ClientManager:
def client_reveive(self):
while self.running:
try:
data = self.conn.recv(1024)
print(data)
if data != None:
self.recv_msg_queue.append(data)
except socket.timeout:
continue
se... | 1 |
42a16c50f3e208545ea5ffe06d0fe234 | 396609bf02d34134836be55ef9844629 | Takes in a list of numbers and returns the longest increasing subsequence | def longest_steepest_ascending_sublist(ns):
pass | 0 |
59ee0ce6ead43873b6a1ec790ccc3912 | 1c0203d5d69652a7a9c06cd25d3a8adf | determine highest offset from the start time when all tests have completed their ramp-up | {
analyzeHourlyData();
int max = 0;
int maxIndex = 0;
for(int hour= 0; hour < hourCounts.length -1; hour++)
{
if((hourCounts[hour] + hourCounts[hour+1]) > max)
{
max = (hourCounts[hour] + hourCounts[hour+1]);
maxIndex = ... | 0 |
803cecfa4c65b506afb9501c1f5b67a6 | f906229de1cc9b3645259f077d3e995b | 색상비에 따라 흰색 또는 검은색을 반환합니다. | if num % 2 == 0:
return self.light_gray
return self.dark_gray | 0 |
43ddae9037d8fe661e9dfb06257edfcb | f88d10a80ef0e792ba2a8b43b8a196a3 | GetMonthData returns the minimum and maximum values for a single sensor, for each day between start and end | def range_start_end(start, end):
max_date_str = session.query(Measurement.date).order_by(Measurement.date.desc()).first()
format_str = "%m-%d-%Y"
max_date = dt.datetime.strptime(max_date_str, format_str)
max_date = max_date.date()
min_date = session.query(Measurement.date).order_by(Measurement.date)... | 0 |
fb06170a71ff656c8a66326038ad24ce | a17a63664ceacadb4be029e00a96fe11 | Help method used in parseJson implementation to fetch a long value
if set in JsonObject otherwise returns null. | @Nullable
Long getLong(); | 1 |
ff29109afe661376ad70c4c89c9bb33a | ba70f80e8855fa0336f6b57a6f6b565a | returns true if the point is closer to sideA than sideB | bool SameSide(Point p1, Point p2, Line Line)
{
return (Line.a * p1.x + Line.b * p1.y + Line.c) *
(Line.a * p2.x + Line.b * p2.y + Line.c) >
0;
} | 0 |
79eeafe37271053efe44cde1dca0d07f | c9c3fefd7c45c747181612856219f9f4 | calculate time duration from start time till now | def get_time_elapsed(start_time):
end_time = int(time())
time_elapsed = end_time - start_time
time_elapsed = str(timedelta(seconds=time_elapsed))
return time_elapsed | 1 |
e3e1bae992634e03bf0294e2954a8a7b | eae7054b8dff9fa2f796bcb9fcc6bf5e | Perlish OR operator - returns first true value | function isOr() {
$last = false;
foreach (func_get_args() as $arg) {
if ($arg) {
return $arg;
}
$last = $arg;
}
return $last;
} | 1 |
16e165377eddc5b9637055a6ec14325d | 858e78e73bfd18f08f949db783ccde1b | function name: destroyFlight
The function destroys the given flight by freeing all the allocated memory.
f- a pointer to a flight to destroy.
return values:
No return values. | {
flight2->ID = flight1->ID;
flight2->type = flight1->type;
flight2->source = flight1->source;
flight2->dest = flight1->dest;
flight2->hour = flight1->hour;
flight2->minute = flight1->minute;
flight2->T = flight1->T;
} | 0 |
628bd64ac717ebd4b39b9696105e46ad | 405cf408c91b7a543f6fd42d7d47d0d2 | 该方法给nav里的li标签注册hover事件,记住,注册事件一定要在文档加载完成以后执行,所以我在$();里调用这个注册方法 | $(".aui-last").find("li").on({
mouseover: function(){
$(this).addClass("active");
},
mouseout:function(){
$(this).removeClass("active");
}
});
} | 1 |
dce19afdcdb08b4a22e91a99161ad956 | 7d9de50ab440dbaf2a9140fc1a39a2fc | 求概率平方和 | export class TestProbComponent implements OnInit
private prob(a: number, b: number, s: number): number{
let result = this.comb(a, b);
for (let i = 0; i < b; ++i)
result *= s;
for (let i = 0; i < a - b; ++i)
result *= (1.0 - s);
return result;
} | 0 |
50de7fb79944b54e24a070533629456c | 242e49e1b6741cb70bf6688158d61934 | Query DB table <tt>test</tt> for records.
<p>
The sql statement for this operation is <br>
<tt>select * from test where (test_id = ?)</tt> | Test getTest(int id); | 1 |
61ac2515727bfaddfa50699bf2d45e93 | 6ddbcd12fb3f923df6868dd70c0a12e1 | 转义URL地址 | return str.replace(/(http:\/\/|https:\/\/)((\w|=|\?|\.|\/|\&|-)+)/g, function() {
var url = arguments[0];
return '<a href="' + url + '">' + url + '</a>';
});
} | 0 |
8d9aff954c77a65da80272dc79d2a14f | ba79caa81aac4b09511e2516a111ecd8 | 解析传输层,获取源端口和目的端口信息 | @Slf4j
public class IpUtil
public static Object[] parseIpPort(String address) {
String[] array = address.split(":");
String host = array[0];
int port = Integer.parseInt(array[1]);
return new Object[]{host, port};
} | 0 |
6c6dbeec216d1dea3d08f3828de6f12e | 50cfeac265d113f2dbd1b16cb398c911 | 修改物业 | class TenementManager:
def modify_tenement(self):
put_info = request.get_json()
print(put_info)
return ResponseHelper.return_true_data() | 1 |
45e7afa6e940a11128c93291673bc357 | d30d9c057f14439fc25aed93bb789441 | Lists all FinancePending models. | {
$current_page = Yii::$app->controller->id."-index";
$this->view->params['current_page'] = $current_page;
$searchModel = new FinanceOpeningBalanceSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$total_items = $dataProvider->getTotalCount();
... | 0 |
b4dd4f37cb5dfcd68d6744503e2b0d5b | 78317df166a8066f1349325471d41f44 | 根据手术包码获取需要退还消毒的手术包商品信息 | @RequestMapping("/api/hospital")
@RestController
public class HospitalController
@RequestMapping("/outpatientRefund")
public Results<Map<String, Object>> outpatientRefund(@RequestBody Map<String, Object> requestMap) {
return new Results(hospitalService.getPackageHis("outpatientRefund", requestMap));
} | 0 |
3657d18b784476e8a94f30db1f4ec9e3 | 130344cafa41a908c0dba513353b8589 | initializes the container by generating all N-sized tuples from
the word_list. | TupleGenerator tupleGenerator = new TupleGenerator(originalText, tupleSize, synonymGroup);
while (tupleGenerator.hasNext()) {
originalTextTupleSet.add(tupleGenerator.next());
}
} | 1 |
27e2942c440bf7a52e8d2e604ad354c9 | 723b013abfff4a1f456f7605b396ba34 | Copy the Pimcore skeleton website folder to the 'document-root-path', or a sensible default,
if one does not already exist | $config = Artio_MTurbo_Helper_Data::getConfig();
$root = $config->getRootPath();
$this->_delTree($root, $root);
$config->copyAllowAccess($root);
} | 0 |
c7b5a1020daac306e37ea3e7f3adf229 | 034805b5d0c77b67386b6d9a2632579b | Функция умножения 2-х объектов-дробей; | Fraction res;
res.up = f1.up * f2.up;
res.down = f1.down * f2.down;
return reduction(res);
} | 1 |
bd40eb6ca6705e0545081603bc20b21f | c1a1ee300c4ad6de2fb85a1f52bd60ce | 以管理员身份重启程序 | try {
callFile.execFile('./restart.sh', [], null, function (err, stdout, stderr) {
log.printError(JSON.stringify(err))
log.printError(stdout)
log.printError(stderr)
});
} catch(e) {
log.printError(e)
log.printError(errorStr)
}
} | 0 |
5d5aaf2992de415ff7ab5b3d64f4704a | 1c22044e3da6d612b9b9aedae4782c57 | 時間ステップを実際の時刻(string)に直す | public class UIBoard : View
string GetTimeIntString(float time) {
return ((int)time + 1).ToString();
} | 0 |
1e3f9f41a29cd1d4b259849e1d532d35 | f6d49d7cc5157ff6d4d1dabb0e845a86 | 设置星级数,把星添加到容器 | let starNum = this.m_tTreaVo.star;
while (this.m_pStarRoot.numChildren > starNum) {
this.m_pStarRoot.removeChildAt(0);
}
for (let i = this.m_pStarRoot.numChildren; i < starNum; i++) {
let star = new eui.Image();
star.source ... | 1 |
4b079eb4a6ee8f0a636201639c52741e | 12324d0dc8604b9457a555143fd962b3 | Normalizes the values of a given pandas.Dataframe by the total sum of each line.
Algorithm based on https://stackoverflow.com/questions/26537878/pandas-sum-across-columns-and-divide-each-cell-from-that-value | def normalize_data(df):
return df/df.ix[0] | 0 |
b1807eb7406929b6a3a36ba24b028b90 | 2c262e43b93468a968009dc59731c5e6 | Acronym definition fluent setter. | @Deprecated
public class ConfigurationFactory
public static class AdditionalConfigurationData
public void setAt(String string)
{
at = string;
} | 0 |
effee678e99aa32f8c12a6801e76b5b2 | 91fb11160f8f305334f27e5a87a4e4b1 | Get and reset the irq register | {
HWREG(SOC_AINTC_REGS + INTC_CONTROL) =
INTC_CONTROL_NEWIRQAGR;
__asm volatile ( "dsb \n"
"isb \n" );
} | 0 |
dab2ae5cf28285eaf55ccb9f7a0361e9 | a88fd1e23808381452937003fd0745a1 | @brief Get the number of installed CTR modules | {
uint8_t res = (uint8_t) g_ipc_ctom.ps_module[0].ps_status.all;
*output = res;
return 0;
} | 0 |
f45e7da1e017700276546eb3bb52929a | 5d14c4abfd043f5ac280e91f9939d7f8 | Set 函数初始化执行超时时间 | void time_out_set (TIMER* stimer, u32 timeout)
{
if (stimer == 0)
{
printf ("stimer memory error!!\r\n");
return;
}
stimer->time_out_val = timeout;
stimer->rec_tick_val = HAL_GetTick ();
stimer->is_time_out = 0;
} | 1 |
5194226f436b72b09773f7b94a263be7 | 8d986dfcfbb2de784ec7e75853ff8920 | Get the Limb data. | class Limb:
def to_string(self):
if not self.val:
return 'ivalid'
s = 'p1 :\n'
s += self.p1.to_string()
s += '\np2 :\n'
s += self.p2.to_string()
return s | 1 |
ef7d2eb16155e999e87b8f58b0688aab | d7de7687b91fcc3c69036fb091a01558 | !
Function sets the pause variable to false and the motor control will continue with the present action. | {
pause();
CPhidgetAdvancedServo_setEngaged(servo, LEFT_MOTOR, 0);
CPhidgetAdvancedServo_setEngaged(servo, CENTER_MOTOR, 0);
CPhidgetAdvancedServo_setEngaged(servo, RIGHT_MOTOR, 0);
} | 0 |
264d2b877d4b2905a39efb78b4fde261 | 8341f4fd7d15940b2daa58f0b6273082 | Carrega a base de dados que se trabalha. | class Controller
public function load_database()
{
if(!isset($this->db)){
$this->db = new MySqlDataAdapter(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME,DB_PORT);
}
} | 1 |
35f1e8ac082aad788a7bb04dd9cff1d2 | e3072f0a9d012382aebd5ab7898abb72 | <para>Loads the specified registry hive as an application hive.</para> | namespace Vanara.PInvoke
public static partial class AdvApi32
[DllImport(Lib.AdvApi32, SetLastError = true, CharSet = CharSet.Auto)]
[PInvokeData("winreg.h", MSDNShortId = "ms724897")]
public static extern Win32Error RegOpenKeyEx(HKEY hKey, [Optional] string lpSubKey, [Optional] RegOpenOptions ulOptions, [Optional... | 0 |
38d6aae66817cb7bf5e54b4d8577de39 | 59cbb740286a5e2d29b55ca32ad12ac1 | Reads Flink's state meta data file from the state handle. | namespace Orleans.Core
Task ReadStateAsync(); | 0 |
78f9865f7bddce9cb37fabe1f971fb45 | 8103cce95b3f05ba0dc33081f7e1ab62 | 根据标签页获取成就ID列表 | class PMAchievementManager(Util):
def getPMAchievementList(self, jsonInfo):
info = json.loads(jsonInfo)
tokenID = info['tokenID']
(status, userID) = self.isTokenValid(tokenID)
if status is not True:
errorInfo = ErrorInfo['TENDER_01']
return (False, errorInfo)
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.