query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
50ff8578bc0e453b88cf8716de67091e | bc0b146643e06c5c8e89a1a2762e2c07 | bound value to -1.0, 1.0 | static void thresh_ft1(t_thresh *x, t_floatarg f)
{
if (f < 0)
f = 0;
x->x_thresh = f;
} | 0 |
8af368cdf71887821247c54635ab01a3 | f7248f8ba182d76ebdd772fd63c7c703 | Initialize an empty QR code. You can define the `qr_type` (size)
of the code matrix, or have the libary auto-select the smallest
match. Default `error_correct` is type L (7%), but you can select M,
Q or H. | qrInit(int version, int mode, int eclevel, int masktype, int *errcode)
{
QRCode *qr = NULL;
qr = (QRCode *)calloc(1, sizeof(QRCode));
if (qr == NULL) {
*errcode = QR_ERR_MEMORY_EXHAUSTED;
return NULL;
}
qr->dataword = (qr_byte_t *)calloc(1, QR_DWD_MAX);
qr->ecword = (qr_byte_t *)calloc(1, QR_ECW_MAX);
qr->... | 1 |
b1fd99c603ae7e2ac860707d474299df | 5a0b13db2ba35b02f06b5119d87c68d4 | obtain the latest list of notes and tell the adapter to refresh the recycler view. | public class MainActivity extends AppCompatActivity
public void updateNotes() {
noteEntities = noteRepository.getAll();
mAdapter.updateNotes(noteEntities);
} | 1 |
1d0290a6b953db4ef277df4ae2d8e00e | 949ebc0ecb828069fee060274e16a765 | 从Excel奇怪的浮点数日期格式转为普通的date类型 | export default class MyUtil
public static getDateFromExcelDatetime(excelDatetime: any) {
if (isNaN(Number(excelDatetime))) {
Logger.error(`MyUtil.getDateFromExcelDatetime / No valid parameter : ${excelDatetime}`);
throw new Error(`ERROR: MyUtil.getDateFromExcelDatetime / No valid paramet... | 1 |
70918e6f46df3ed5f717dbcd709c7303 | a33e30691eaa50ad5baee08e164e85c6 | 这个是生成word的例子: | def generate_file():
words = ['a1','b2','cc','de','23']
with open('words.txt','w')as f:
for i in words:
f.write(i)
f.write('\n') | 0 |
979cc5a9bdfafcd1f03dc9faf3e348fe | dae37f2f574f13de30e3083881199edc | 对文件进行保存时,先判断其是否已经被保存过,如果没有被保存过,就要先对其进行另存为操作。 | void CameraDialog::do_file_Save()
{
if(isSaved){
saveFile(curFile);
}
else{ do_file_SaveAs();
}
} | 1 |
f8541689d826d464979c180e9a08b170 | e309ec0acdb3be4586df1db64bc96796 | Function that generates UI elements from data, received from Backend | function updateDataToUI(location, weather, temp) {
weatherIcon.innerHTML = `<img src="${weather[0].icon}" />`;
weatherCon.innerHTML = weather[0].main;
loc.innerHTML = location;
temNum.innerHTML = `${temp.toFixed()}`;
if(weatherCon.innerHTML == "Clouds")
{
weather_background.style.backgroundImage = "url(... | 1 |
2531e81a7719d6f9b393f5adb45b6a8e | abf0a83f8d80a45eec737766345827ef | 企业锁定-新增 | class McardController extends BasehlyController
public function lockNum() {
$d['region'] = I('region');
$d['telnum'] = I('telnum');
$d['price'] = I('price');
$d['offer_id'] = I('offer_id');
$d['username'] = I('username');
$retList = D('Hly','Service')->lockNum($d);
... | 1 |
ca9aee584cc3cbbd9609a85d5076aea7 | 15c12b636543a65ca8eeff48b2915871 | Build the control graph of the conditional instruction | void LTAC_Builder::build_cond_cmp(AstCond *cmp) {
auto jmp = new LtacJmp;
auto default_jmp = new LtacJmp;
switch (cmp->get_op()) {
case CondOp::Equals: jmp->op = Operator::NotEqual; break;
case CondOp::NotEquals: jmp->op = Operator::Equal; break;
case CondOp::Greater: jmp->op = Opera... | 1 |
468b1680e19640a5d7367e153407928b | a29223874d3d86e2a4e2c9b9a4741278 | Returns an ``int`` of the total number of rebounds during the season. | class Center(AbstractPlayer):
def get_num_rebounds(self):
return self.num_rebounds | 1 |
6dc34d046b51aadb172afd196bc96758 | 838fe1f92faedd3386a2bd6efd9307df | 添加选中省份下的城市项到city的select中 | var se_city = document.getElementById("select_city");
var option = document.createElement("option");
se_city.appendChild(option);
var txt = document.createTextNode(All_City[0].cityList[0].name);
option.appendChild(txt);
var sed_province_now = document.getElementById("select_province");
sed_p... | 1 |
910924a3764e1b87f0c65d3897af3002 | b7026e31459e2a7e4cc366d5db798db4 | Processes the trace queue | if (tracingService == null && !bootupQueue.isEmpty()) {
Log.i(SharedClassesSettings.TAG, String.format("Flushing " + "boot-up queue of %d elements...", bootupQueue.size))
val communicator = ServerCommunicator(bootupQueue)
val items = ArrayList<TraceItem>(bootupQueue.size)
... | 1 |
ed2eca4004df5ad35ee579cf7e996159 | d006d65140c567e68b999911b01f5f20 | ¿Está llena la cola? | class Cola
def vacio
@list.length() == 0
end | 0 |
049a6e31051dacc832403074c7d32d5e | 9fafc8e4d6c55839f7ce9bdd68aa0873 | Získá komentáře, které nebyly schváleny administrátorem. | {
$querybuilder = $this->createQueryBuilder('c')
->where('c.status=0');
$comments = $querybuilder->getQuery()
->getResult();
return $comments;
} | 1 |
2d1992516c083e528f08b2eb7efab640 | 4836abcc39db1fe78420d9230dda4406 | Set the legacy distributor ID. | public class OrdCustomerDO extends BaseDO{
public void setDistributorId(java.lang.Long distributorId) {
this.distributorId = distributorId;
} | 1 |
1ede94cf96f11b44d4cc8de0532ef367 | 5d828dbddf01c582d3b718975f9f9d22 | установка типа Modbus соединения | {
switch (this.TypeModbus)
{
case 0: this.IsConnection = this.DisconnectClient(); break;
case 1: this.IsConnection = this.StopServer(); break;
default: break;
}
} | 0 |
d3d261d532fb7045a20c6f8829f58448 | 8f0e5417d1e380f2d8321133c33d079b | Retrieves a {@code Ruleset} for the classification. | namespace Pulumi.GoogleNative.FirebaseRules.V1
public static class GetRuleset
public static Output<GetRulesetResult> Invoke(GetRulesetInvokeArgs args, InvokeOptions? options = null)
=> global::Pulumi.Deployment.Instance.Invoke<GetRulesetResult>("google-native:firebaserules/v1:getRuleset", args ?? new Ge... | 1 |
d73741dcdf013bec479e91f6d826c4ef | 57f7226c1e71a53f8fdcceee33004998 | withinBox 条件を追加します。 | {
var newBox = new NumberRule() { ErrorMessage = errorMessage }.ToValidBox();
return ValidBox.Merge(box, newBox);
} | 0 |
e29e67767f01afea24931ec49a72d2f5 | 1736ce1b32cfc3dc05268b3b73470bc9 | 得到系统当前的日期 格式为YYYY-MM-DD | public class DateTool
public static String getSystemDate() {
return getCurDate(Constants.DATEPATTERN_NOSEP);
} | 0 |
f68e3761af996f9a66d483dd70e3c42f | 4457387b0e4d20e12a5cf0b72309805e | 显示待审核统计 | if(WSTGrant('GROUPON_TGHD_00')){
$m = new DM();
$num = $m->getAuditCount();
echo '<li>
<div class="icon">
<span><a class="menuItem" href="'.Url('/addon/groupon-goods-pageByAdmin').'">'.$num.'</a></span>
... | 1 |
f2a6478c9bbe97beec439f53923bcfbc | e2d09eb2d4b89eb33e95aa1a54c20802 | Get ids of users from whom you won't receive retweets. | namespace Tweetinvi.Models
IEnumerable<long> GetMutedUserIds(int maxUserIdsToRetrieve = Int32.MaxValue); | 1 |
19f965d0335fbfc5818c93f3728fb509 | 053b6b550c20f143d5a8c51aee50db5e | Get long weekends for a given country | {
$res = array();
if ($year == 1959) {
$res[10] = DJ_CROWN_PRINCE_HIROHITO_WEDDING;
}
if ($year >= 2007) {
$res[29] = DJ_DAY_OF_SHOWA;
} else if ($year >= 1989) {
$res[29] = DJ_GREENERY_DAY;
} else {
$res[29] = DJ_THE_EMPEROR_S_BIRTHDAY;
}
if ($this->getWeekDay(mktime(0, 0, 0, 4, 29, $year)... | 0 |
ab28ce2809ae63e8730c35a204dbbc3e | 3f602dca48bed775c1fd0b08e92c341f | перезагрузка рабочей области для работы с товарами | {
using (SqlConnection conn = new SqlConnection(@"Data Source=DESKTOP-9IUFQMM\SQLEXPRESS;Initial Catalog=PateticoPractic;Integrated Security=True"))
{
string query = "SELECT bp.[id_product], pr.[product_name], bp.[count], bp.price FROM [BasketProduct] AS bp " ... | 1 |
b12af5e6442c006e718624e663207031 | b4c1db24c8e8cce8ae21649feb54b718 | Destructor for keyboard listener | keyboard::~keyboard()
{
} | 1 |
5a3eee0865155f13e0d1ccf152054d00 | 6fd91f23364b34781cbc08116b9af953 | Funkcia vytvorí pavúkový turnajový systém. Vezme 8 resp ak je málo tímov
tak 4 najlepšie tímy a vytvorí postupového pavúka.
timov | {
Round roundToRet = new Round();
SortedList<int, Player> randomList = new SortedList<int, Player>();
foreach (Player player in this.PointsTable)
{
if (player.Active == false || player.SuperBYE == true) continue;
bool added = false;... | 0 |
ecd8cdc6c8e65807111813ff5b2fdbe6 | dde33a0d96ecf60e6e2d6c6b916445a0 | Returns a list of the pieces of the given type. | class Board:
def _get_peices_in_board(self, team=None):
return (self.piecesInBoard if team is None
else self.piecesInBoard[team]) | 0 |
0b1b9c5f8bc6abdd7ff8cd8170605ffa | 2e9f2d5789b68be3b4ca3b5aab67be23 | Create the DOM SDocument with root namespace and root element name | class HermeneusTextDocumentCreator
public function createDocumentRoot()
{
$XMLSchema = $this->DOMDocument->createProcessingInstruction('xml-model', 'href="' . Path::path_public_tei_hermeneus_xml_schmema_rng() . '" schematypens="http://relaxng.org/ns/structure/1.0"');
$TEINodeNS = $this->DOMDocument-... | 1 |
ad8c62ce57ab3864c9664880811ec3b8 | 99299495e2667787b3210fee77eb6709 | Initialise the ADC peripheral to do fast single ended 8-bit conversions with AVCC as a reference. | ADMUX = _BV(ADLAR) | (1<<REFS1) | (1<<REFS0);
ADCSRA = _BV(ADIE) | _BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0);
} | 1 |
8812eaf050519818e1ec0563a6203e8b | 6360bdea9f9248abafda42af005b080b | Returns the last tai san thue chap in the ordered set where phatVayId = ?. | long phatVayId, OrderByComparator<TaiSanThueChap> orderByComparator)
throws com.mb.exception.NoSuchTaiSanThueChapException {
return getPersistence().findByPhatVayId_Last(
phatVayId, orderByComparator);
} | 1 |
4f27d135d029b0a7927e623af261ead7 | 593851982983e50bd5f616eeb8cf235b | The number of interactors that are presently registered | public class AgentRegistry
public int getNumRegistered() {
return agentIds.size();
} | 1 |
546c1f0c35cdaf5ff228062b3c8fd32e | c88c9951f429bc4a350104729f45c043 | <p>
Given a device ID, returns the invokable methods associated with the device.
</p>
404 response
400 response
500 response
Documentation</a> | public JSONObject getDeviceAllFunctionsJSONObject(String deviceId); | 1 |
1c9196347a09ff76178131c86ff94404 | 3bcf5984b5c1432fd5099cdf93b5bd1b | Unite adjacent gaps | Boolean Continue=TRUE;
DDE_AddGapToStartOfAllRows(pEditInfo, FALSE);
DDE_AddGapToEndOfAllRows(pEditInfo, FALSE);
while (Continue) {
Continue = FALSE;
if (DDE_IsLeftAlignedGapInRows(pEditInfo)) {
DDE_ShiftLeftBoundaryRight1(pEditInfo, 0);
Continue = TRUE;
}
if (DDE_IsRightAlignedGapIn... | 0 |
0002c7de3189a230b483060f3d12e5cb | 06ed248ceacec1739f85f0008bf4130f | ============================================================================
更新上一次上线时的数据
============================================================================ | local onlineData = apiXmlGet("minecraftData",p)
local data = onlineData == "" and
{
time = 0,
last = "offline",
ltime = os.time(),
} or jsonDecode(onlineData)
if data.last ~= "online" then return end
data.last = "offline"
data.time = data.time + os.time() - data.ltime... | 1 |
b5f1e322f202d4ead1169334437938c5 | d49f398baf4239fc2df3a1e4988d5f58 | Exp - Calculates the exponent of e | int QFloat::getExp()
{
string exp(15, '0');
for (int i = 112; i < 127; i++)
{
exp[126 - i] = this->getBit(i) + '0';
}
int x = 0;
for (int i = 0; i < 15; i++) {
if (exp[i] == '1')
x = x | (1 << (14 - i));
}
if (x == 0) return -EXPONENT_BIAS_VALUE + 1;
return x - 16383;
} | 0 |
b3b5bf52f079e0a207ff9deecd03c585 | e87b909af64bd588441edecb2b3bcd12 | VerificationCode constructor. | class VerificationCode implements ShouldQueue
public function __construct($phone, $code)
{
$this->phone = $phone;
$this->code = $code;
} | 1 |
eb177fdbffdacdb2fe6cc5cbe5c2abbf | 2820f77e52f758e137197b792883352b | Get an available Stream or return an error | namespace Argus.Imaging.Video.Vfw
internal class Win32
[DllImport("avifil32.dll")]
public static extern int AVIFileGetStream(
IntPtr pfile,
out IntPtr ppavi,
int fccType,
int lParam); | 1 |
f76a49cac8489ac7f4ec85231a31c0a3 | cbc513012f8860a0dafe857527ae1cf0 | .. note::
:class: toggle
CAA V5 Visual Basic Help (2020-09-25 14:34:21.593357))
| o Sub SetGridVPrimarySpacingLock(boolean iLocked)
|
| Locks or unlocks the GridV Primary Spacing setting parameter
| value.
| Refer to SettingController for a detailed description. | {
int hr;
volevariant *argVar;
volevariantList *argList = volevariantCreateList();
argVar = volevariantCreate();
volevariantSetBool(argVar, arg0);
volevariantAppendList(argList, argVar);
hr = voleInvokeControlSite(site, 23, INVOKE_PROPERTYPUT, argList, NULL);
volevariantDestroyList(argList);
} | 1 |
2adfd28b60a2b0c82117466f869cb1cf | dc7fa673af6d1cec89065d65d2665389 | Test that given correct values, the function outputs the correct result with 'le' comparator
le = lower equal | test(compare(5, 4), 1)
test(compare(7, 7), 0)
test(compare(2, 3), -1)
test(compare(42, 1), 1) | 0 |
63071965044c4e744c34c1790745d4a5 | f218acf5ba8e5a8a5d4582a026fbb4ac | Function Name: PWM_C_WritePeriod
Writes the 16 bit period register with the new period value.
To cause the counter to count for N cycles this register should be written
with N-1 (counts from 0 to period inclusive).
None | void PWM_LED_B_WritePeriod(uint16 period)
{
#if(PWM_LED_B_UsingFixedFunction)
CY_SET_REG16(PWM_LED_B_PERIOD_LSB_PTR, (uint16)period);
#else
CY_SET_REG16(PWM_LED_B_PERIOD_LSB_PTR, period);
#endif
} | 0 |
f49039b506980354c607b6022ba80876 | 4d95ce4c34d7713e74c280d2b436768b | Gets the resource collection API of MigrationRecoveryPoints. | fabricName: string,
protectionContainerName: string,
migrationItemName: string,
options?: MigrationRecoveryPointsListByReplicationMigrationItemsOptionalParams
): PagedAsyncIterableIterator<MigrationRecoveryPoint> {
const iter = this.listByReplicationMigrationItemsPagingAll(
fabricName,
... | 1 |
b737a57b22a3d8623cb5f4a3d494d498 | 2741c28298a25319bc13fd8cb58094f6 | Make sure it doesn't take too long. Don't actually verify correct results here | class CsFibonacciTest
def test_raw_performance
assert_nothing_raised do
Timeout::timeout(20) {CS::matrix_fibonacci(10000)}
end
end | 1 |
cb5ca1ee60ca602fae5490827302f541 | ac119fe284970f1a2e5c6117e24f0abb | Vereinfacht Tags aufgrund ihrer Zugehörigkeit - sind die Tags in der Gruppe des
Standards, dann werden die Attribute gelöscht.
Außerdem werden Mappings von Font-Größen vorgenommen und einige überflüssige
Tag-Attribute gelöscht. | if (!is_string($text)) {
$text = '';
}
if (isset($semantics->tags)) {
$tags = array_merge(array('div', 'span', 'p', 'br'), $semantics->tags);
if (in_array('table', $tags)) {
$tags = array_merge($tags, array('tr', 'td', 'th', 'colgroup', 'thead'... | 1 |
8137c7247632b7fc5a3ff6743d3209f3 | 45dd1a37e46ed2a79067d55268703e88 | Calculate the smallest power of two that is equal or greater than given
number. | def pow_2_gt(n):
k = int(math.ceil(math.log(n) / math.log(2)))
return 2**k | 1 |
d6854900c94379aae316fd02b5adbcc0 | 753c475e1dda2bb67d4cb47b6fd2b332 | Set volume with mouse wheel | void VideoAudioVisualizerApp::mouseWheel( MouseEvent event )
{
Vec3f eye = mCamera.getEyePoint();
eye.z += event.getWheelIncrement();
mCamera.setEyePoint( eye );
} | 0 |
758756c38de03619f3fa920b31d8022f | 9affcec1d16a8097deba7c73cbb0785e | !
This does only a single pass of simplifications and returns true if it made changes. | namespace dd
bool grobner::simplify_using(equation_vector& set, equation const& eq) {
unsigned j = 0, sz = set.size();
for (unsigned i = 0; i < sz; ++i) {
equation& target = *set[i];
bool changed_leading_term = false;
bool simplified = !done() && try_simplify_using(ta... | 1 |
97fd090c48d33f4aea560c43f308dfc1 | 7e2f97d972c96e55cee22b5a90d118b5 | 如果导购编号不空,并且消息内容也不空,则转发消息给导购 | getGuildInfo(guideMemberNo,memberNo,shopNo){
var self = this;
var url = config.baseUrl + '/mec/orderGuide/getGuideInfo.do';
var params = {
guideMemberNo,
memberNo,
shopNo,
};
$.post(url,utils.autograph(params),(data)=>{
if(data.result){
self.show = 1;
self.guideInfo = data.retu... | 0 |
f301bb854d69d7b906e32a25cda3f12d | 5a1710f7d40a2f6f29483a11a4b7904e | 보수_대상_항목_그룹(TN_RPAIR_TRGET_GROUP) 보수공법 별 통계 목록을 조회한다. | @Controller("rpairTrgetGroupController")
public class RpairTrgetGroupController extends BaseController
@RequestMapping(value = { "/api/rpairtrgetgroup/selectRpairTrgetGroupListTotalSummary.do" }, method = RequestMethod.POST, consumes = { MediaType.APPLICATION_JSON_VALUE }, produces = { MediaType.APPLICATION_JSON_VALU... | 1 |
d08f719c9fd5eb88cf01ae528621f619 | 6ec8d8ffac1dd67c17e14851238290e0 | Create a DDATA message suitable for use as the first argument to
trigger_message. | def touch_message_datagram(address="touch", pos=0.0):
dgram = b''
dgram += pad_dgram_four_bytes(("/" + address).encode('utf-8'))
dgram += pad_dgram_four_bytes(b',f')
dgram += struct.pack('>f', pos)
return dgram | 1 |
d4e1251e2bc6647d50ec9be400ebe3a0 | a0dadd460d086511d29125a5ed91e288 | u""""查询Bc锁下的摄像机Id | @ResponseBody
public List<BdmCameraDto> findCameraByRoomId(@RequestParam("id") Integer id) {
return service.findCameraByRoomId(id);
} | 0 |
e770cc5d576ca24cf929ae0f990873a5 | 50d30cb05620067ee3a337f33e5a57d3 | Called by the LanguageServerConnection in its message pump context when a
notification message arrives. | const textDocumentMessage: protocol.DidOpenTextDocumentParams = {
textDocument: {
uri: documentInfo.uri,
languageId: documentInfo.languageId,
text: documentInfo.text,
version: documentInfo.version
} as protocol.TextDocumentItem
};
this.connection
.sendNotifi... | 0 |
a5ea4c9fe7bec61ae9d1d684e5e3f1f8 | f61c5b34b4e78278d76f25da5df00cf3 | ポイント単位をpixelに変換する。 | public class UIRatio
public void toUnit( final Vector3 _pixel, final Vector3 _unit )
{
_unit.setXYZ( toUnitX( _pixel.x ), toUnitY( _pixel.y ), toUnitZ( _pixel.z ) ) ;
} | 0 |
c31058e270c458f7f85266e9ac41ab3e | 3b5584b4720c8c0f7fb99f0ae0a813ab | Is BEM Class | class BEMHTML{
static function is_elem($ctx){
if(is_array($ctx))
return array_key_exists('elem', $ctx);
return false;
} | 0 |
628055e815bbb2dc450886e4dbbf8e76 | f96c9f0152891fb03fdf348150c8d34a | 線が存在するかどうかだけ判断するメソッド | {
if (handlesLineGetPattern(line) != null)
{
return true;
}
return false;
} | 0 |
48b25e25f084d9079110ea850d855b40 | 7ecc65eb83409ace385481ab08e9bc3f | combines single secret shares to SIMD secret shares | newBigFloat := func(x float64) *big.Float {
return big.NewFloat(x).SetPrec(BIGINT_SIZE * 8)
}
f := newBigFloat(0)
for i := 0; i < len(shares); i++ {
term := newBigFloat(0).SetInt(shares[i].Y)
for j := 0; j < len(shares); j++ {
if i == j {
continue
}
term.Mul(term, newBigFloat(0).Sub(newBigFloat(... | 0 |
735ee8829b7c21eb6f428908701c51e8 | 8f42b7af66b047f7d5dc972037a2a54d | ==================================================================
加速度センサーの線形加速度のRAW値に乗算する係数を取得する | namespace BT
public partial class DeviceDialog : DialogViewController
float calcAccel(sbyte rawX)
{
float v;
v = (float)((rawX * 1.0) / (64));
return v;
} | 1 |
8d303e00cdd293c0303a3820723f7a5f | 52406f6b107dc76f72e2b350ca0078ad | 还原筛选前的数据 | function resetData(){
if( !cacheDataOriginal ) return false;
unChooseData = newObj(cacheDataOriginal);
vmPop.unChooseData = newObj(unChooseData);
isChooseData = filterData();
vmPop.isChooseData = newObj(isChooseData);
hideDetail();
vmPop.hideNameBox();
} | 1 |
2c5ee56aa62dd53aecb7bd493829eae1 | bf0f36e936e4226e81311d822bc37c6b | Retrives the InvoiceNum of the newly created Invoice | namespace GroupProject3280.Main
public static class clsMainSQL
public static string SelectNewInvoiceNumber()
{
return "SELECT MAX(InvoiceNum) FROM Invoices";
} | 0 |
2865df574bbbfa362f6e1f6eda3cd6d3 | 032691ab73a8a158da51bcea8f373bb2 | Reads back the output of the "number of particles" observable. | void getNumParticles(int argc, const char **argv, int numDevs, uint *n){
int num = 0;
if (numDevs == 1)
num = 256*1*4*devProps[0].multiProcessorCount;
else
{
num = 0;
for (int i = 0; i < numDevs; i++)
{
num += 256*1*(devProps[i].major >= 2 ? 4 : 1)*devProps[i].multi... | 0 |
c4780b3bdcaabe74831c6ca52f3e72f0 | 011ebdd30148163731382c723e39fd6f | Überprüft, ob die beiden Objekte ungleich sind. Zum Vergleich
wird der !=-Operator genutzt. | class Calculation:
def __ne__(self, other):
return not self == other | 1 |
af39671b68dbcb6de0651d5c989ea3e8 | f949c03c0d4a4ab1854a18eaa3b61062 | Calculates the total investment amount for the stock available | amt = 0.0
for name, shares, price in self.stocks:
amt += shares * price
return amt | 1 |
51cd0eb59e5b42c0358ef4743adebac4 | 61a344b632350a3f88d85998a264fe10 | Edit Kecamatan | class PerumahanController extends Controller
public function editKecamatan(Request $req, $id_kecamatan)
{
$message = [
"required" => ":attribute harus diisi"
];
$validator = Validator::make(
$req->all(),
[
"nama_kecamatan" => "required"
... | 1 |
04d8ee51b986413e431b7e4199156dbd | b94bacac45f716114670028078c9bb7a | the Update loop contains a very simple example of moving the character around and controlling the animation | public class character1 : MonoBehaviour
void Update()
{
} | 0 |
b9343d0a556b2698a4cc1460071a28bf | b97e2f9260ff024aca1f2bcea7690197 | Method to create the Panel that will contain the two main "cards" of
the application (Album view / Category view) | try {
m_homeCard = new HomeCard();
} catch(IOException ex) {
m_message = new StringBuilder("Error: Exception in home screen\n");
m_message.append(ex.getMessage());
m_operate.showError(m_message.toString());
}
m_quoteCard = new QuoteCard();
... | 0 |
9514ad9e03de1a3a2504c664cd67d23d | a58feb645d50df5544721b83fa3490c6 | Handles what to do after taking damage | [AddComponentMenu("Dark Tonic/Killer Waves/Listeners/Killable Listener")]
public class KillableListener : MonoBehaviour
public virtual void TakingDamage(int pointsDamage, Killable enemyHitBy) {
} | 1 |
aaa4386fef36210e57c108f05ec93e53 | 59fea523deb5b0e0f371e16231db22b0 | Return a Script instance. | @Nonnull
Script add(); | 1 |
df825c06dc4d6352e6dce6e3a391ca15 | 3d4697d60c84425cbca87f6e12e7cecb | 2、实现一个函数,输入字符串,判断该字符串是否不含有重复字符 | def check(s):
a = set()
for i in s:
if i in a:
return False
a.add(i)
return True | 1 |
73737f850286d4c61094c22569b4f489 | f76224e8fc69dc936b1712d572d1ac67 | calculates the matching index (0,9+ for digital, 1-8 for analog values) and the position (no) in the data set (1-16 for digital, 1-4 for analog) | uint16_t ForceSensor::GetAnalogData(uint8_t index)
{
uint16_t rearrangedAnalogData[PRESSURE_SENSOR_COUNT];
rearrangedAnalogData[0] = _analogData[5];
rearrangedAnalogData[1] = _analogData[7];
rearrangedAnalogData[2] = _analogData[6];
rearrangedAnalogData[3] = _analogData[2];
rearrangedAnalogData[... | 0 |
b86168409eb8788aa1a3ff66c3be0508 | 24b3b5682f8d7eca3ea5deb893bb9f14 | Sets the codebase of the currently connected external JVM. This should be called only once per connection to an
external JVM and should occur before users of the API can send objects over RMI. | void setCurrentEnvironment(String newEnvironment); | 0 |
b7e50d3bced61822b55a6774cc2cef6f | 7bd0ef23c856ee49f6501d6610b89185 | Edición de Propuestas | {
List<data.Propuesta> aux = new List<data.Propuesta>();
using (var cl = new HttpClient())
{
cl.BaseAddress = new Uri(baseurl);
cl.DefaultRequestHeaders.Clear();
cl.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.Me... | 0 |
8a12484b4115b88eca157293cc326514 | 6467457acefb64b3857f183eda8c0f40 | (1) all outputs claimed by {@code transaction} are in the current UTXO pool,
(2) the signatures on each input of {@code transaction} are valid,
(3) no UTXO is claimed multiple times by {@code transaction},
(4) all of {@code transaction}s output values are non-negative, and
(5) the sum of {@code transaction}s input valu... | public class TxHandler
public boolean isValidTx(Transaction tx) {
ArrayList<UTXO> claimedUtxos = new ArrayList<>();
for (TransactionInput input: tx.getInputs()) {
UTXO utxo = new UTXO(input.prevTxHash, input.outputIndex);
if(this.utxoPool.contains(utxo)) {
claimed... | 1 |
5991d47830fe50ed241a61fe93586f89 | 802dc18c12be27625125ea227086ae7a | 删除指定的文件夹,包括所有子目录及文件 | namespace GPSoft.Helper.Files
public class FileHelper
public static void DeleteFolderCompel(string path, bool delRoot)
{
if (Directory.Exists(path))
{
Directory.Delete(path, delRoot);
}
} | 1 |
12de408cb0734d93626b8027b1ef94f5 | e13059daf2a6f1e000641aa5284ffcdd | Generate the SQL column definition | {
if (isset($field['columnDefinition'])) {
$columnDef = $this->getCustomTypeDeclarationSQL($field);
} else {
$default = $this->getDefaultValueDeclarationSQL($field);
$check = (isset($field['check']) && $field['check']) ?
' ' . $field['check'] :... | 1 |
3d41a97f7300c645940aa01c3a0d7be2 | ef2a7e700db21ac32abe103dd4ff6f00 | Make sure predictions is same as in uncached case. | model = Algo()
model.fit(train_data)
pred = model.predict(test_data)
saved_predictions = load_predictions(shared_datadir / f"{Algo.__name__}_pred.csv")
pred = drop_column_if_exists(pred, "upperbound")
saved_predictions = drop_column_if_exists(saved_predictions, "upperbound")
assert_frame_equ... | 1 |
8e936e663ef7c9420c1ded7e6106b8ae | a7015ff91ae249b7015dc5dc2148a6f0 | Decrypts a file, writing the decrypted result to a separate file. | {
if (string.IsNullOrWhiteSpace(FilePathIn)) throw new ArgumentException("The input file path cannot be empty or null.");
else if (string.IsNullOrWhiteSpace(FilePathOut)) throw new ArgumentException("The output file path cannot be empty or null.");
else if (string.IsNullOrWhi... | 1 |
99ad7fcea1d652b8228c644c983f8457 | 5e5a665ba4bce5f55637a473382436b3 | Generate a changelog entry from a git commit. | timestamp = datetime.datetime.now(GMT1()).isoformat()
changeset = ""
changeset_long = ""
fake = False
skip = False
source_or_checkout = False
for commit in payload["commits"]:
commit_data = get_info_from_commit(commit)
files = "\n".join(commit_data["files"])
if "[fc]"... | 1 |
3e2fe3bf2952cabdbadb60e86be6abb8 | b59b23fe14e6d2075f150f1755883bfe | Timer tick event which will update the current image in the animation sequence for each of the sprites, as well as their position | {
timeElapsed += gameTime.ElapsedGameTime.TotalSeconds;
currentAnimation = (int)(timeElapsed * animationFPS);
switch (currentAnimation)
{
case 0:
currentAnimationIndexX = 0;
currentAnimationIndexY = 0;
... | 1 |
dd0a5a24e5b5432bbb915310e9d6c0b1 | 13189abe44ec6ec168828988284f8de5 | 插入condition_item表数据 | $id=DB::table("condition_group")->insertGetId(['uid'=>1,'name'=>$condition['name'],'satisfy'=>$condition['satisfy'],'num'=>1,'time'=>time()]);
if ($id){
foreach ($condition['condition'] as $k => $v){
$condition=DB::table("condition_group_attach")->insertGetId(['group_id'=>$id... | 0 |
a3c6fe468c7ba61f86fa631fb9f3066c | 1a376d26d7dc212857c0d817be3eaca2 | Возвращает имена элементов управляющих группами | namespace zapad.Public.WebInterface.Models.Tools
internal class SignalrGroupManager : ISignalrGroupManager
public string[] GetGroupNames()
{
lock (_locker)
{
if (groups != null)
return groups.Select(g => g.Name).ToArray();
else
... | 1 |
04021bbba0f4f562520fba548e4ee650 | d8e83a5f6c458ff3aa0d78f71ae8cf37 | Retrieves an argument at supplied index or revert to default value | public function getArg($index); | 0 |
4bf429c28a00b269b5a4770b33d17568 | 76e5c8202091376747ae5d827b9754f4 | <p>
Deletes a usage plan of a given plan Id.
</p>
The DELETE request to delete a usage plan of a given plan Id.
Asynchronous callback handler for events in the lifecycle of the request. Users can provide an
implementation of the callback methods in this interface to receive notification of successful or
unsuccessful co... | @ServiceMethod(returns = ReturnType.SINGLE)
Mono<Void> deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName); | 0 |
695b8321065e2f9e5b3c54f8de6197bf | afc0433b9cc3c18158157cb373f3c074 | 函数防抖:保证n秒内函数只会执行一次,如果n秒内再次有事件触发,则重新计算时间 | function debounce(func, delayTime) {
let timer = null
return function() {
if (timer) {
clearTimeout(timer)
}
timer = setTimeout(() => {
func.apply(this)
}, delayTime)
}
} | 1 |
ba88ada93373048f2132d74950f7b668 | 295a545719654c0cd670a0146ab07b6d | Clears the lore of the {@link ItemStack} | m.setDisplayName(null);
m.setLore(null);
lore = new ArrayList<>();
for(Enchantment e : m.getEnchants().keySet()){
m.removeEnchant(e);
}
return this;
} | 1 |
e96100edabd998d028811da1c4280405 | 321031f5f8196ee7a8baf084afe9e069 | Returns true if report was processed and false otherwise. | class ReportWrapper():
def _reportReproduced(self) -> bool:
return self.getState() != 'new' | 1 |
5ae55874da05c1f698b3e990319aca5b | b0ab6c05b22813cf41a32f97e235737c | Input data의 work_package들을 분류하여 BootstrapTable이 이해할 수 있는 형태로 변환한다 | def batch_create_workpackages(dataframe):
result = []
for i in range(len(dataframe.columns)):
parent = dataframe.iloc[:, i].name
children = dataframe.iloc[:, i].unique()
p, _ = WorkPackage.objects.get_or_create(package_name=parent, parent_package=None)
result.append(p)
fo... | 0 |
62592cf3a3f252b17e4b3aa7552bfd26 | 96927265f9f9e86a89215fc13eca427c | 最优页面置换算法 | int optimal_replacement(int * parray, int npages, int nframes) {
const int size = npages * nframes;
int frame[size];
int lg[size];
int m, index, i, j ,k , f, nfaults, flag1, flag2;
f = 0;
nfaults = 0;
flag1 = 0;
flag2 = 0;
for (i = 0; i < size; i++) {
frame[i] = -1;
lg[i] = 0;
}
for (j = 0; j < npag... | 1 |
c44de64da6e008f5af3ea21f1792b7d8 | 862a3d05a60d366f055ce03a411df995 | Convert Polygon FeatureCollection to new Point FeatureCollection | var results = [];
var coords = getCoords(poly);
coords.slice(1, coords.length).forEach(function (coord) {
results.push(lineString(coord));
});
return featureCollection(results);
} | 0 |
b53d27ef0cd1b057d9b7a665028d1a7d | 0cb0d42ba362df5b14ee6f3d025f1739 | The longest vertical line segment drawn through the Box's source contour. | {
int count = 0;
int thicknessTotal = 0;
for(int x = 0; x < contourImage.cols(); x++)
{
int minPoint = contourImage.rows() - 1;
int maxPoint = 0;
boolean anyPoints = false;
for(int y = 0; y < contourImage.rows(); y++)
{
if (contourImage.get(y, x)[0] > 0)
{
if (y < minPoint) minPoint... | 0 |
4181897c79a5bcd01f96294de7f42f4b | 3c8be2babb58aef21eb23374fbc7086b | 根据牌局Id请求战绩 | {
GameInfo.isPYQExploits = true;
SendGetUserRecord sendGetUserRecord = new SendGetUserRecord();
sendGetUserRecord.UserID = GameInfo.userID;
sendGetUserRecord.openid = GameInfo.OpenID;
sendGetUserRecord.unionid = GameInfo.unionid;
sendGetUserRecord.GroupID = (int)groupInfo.GroupID;
Debug.Log("请求圈子战绩" + gr... | 0 |
46d4cceeab0c8e49d61948811c500ffd | 79cc4ce483113e890a860913f921d9c8 | Запрос всех мониторов | namespace Uptime_Robot.Controllers
public class MonitorController : Controller
public async Task<IActionResult> Index()
{
var userId = (await _userManager.GetUserAsync(User)).Id;
var monitors = await _monitorService.GetAllMonitors(userId);
return View(monitors);
} | 1 |
2e1c8222364b097ec397d5ae1089a150 | a6219310c66571273eb68b830b07a9d6 | Test API used to unsubscribe to a message with a specific AppId | class TestMarketDataApi(unittest.TestCase):
def test_iserver_marketdata_unsubscribeall_get(self):
pass | 0 |
0527df589f64548902ae9f4bc1fdf77f | d37ca85550d6630d3ad38fb897fba1d1 | Internal method for writing a sprite to disk | def dump_zspr(basesprite, basepalette, baseglove, outfilename, author_name, sprite_name):
palettes = basepalette
palettes.extend(baseglove)
HEADER_STRING = b"ZSPR"
VERSION = 0x01
SPRITE_TYPE = 0x01
RESERVED_BYTES = b'\x00\x00\x00\x00\x00\x00'
QUAD_BYTE_NULL_CHAR = b'\x00\x00\x00\x00'
D... | 1 |
554fb35f2a0129253fd937093291002e | 9553709023ffbc6b7cf791e48e586c11 | Insert és Edit ablakok bezárásakor lefutó metódus, amely frissíti az adatokat. | namespace PESt_Server.Mapper
abstract class DataBaseMapper
public void endEdit()
{
this.row.EndEdit();
if (row.RowState == DataRowState.Modified)
this.backend.updateRow(this.row);
} | 1 |
28c74de0bb6feb9b8090164aad328e98 | 8a29038c8f8bb0c66a4173846152ebcd | Create a streaming tick data request. | class StreamingTickDataRequest(DataRequestForContract):
def has_data(self):
return len(self._market_data) > 0 | 0 |
e35e0855f9f190d528a563330ef904fe | 5168d8f2569b63027dd9e6b3e896fe6b | Set the active MIDI instrument. | public class OldBasicMidiConverter extends OldMidiConverterAbstract
public void setInstrument(Instrument instr) {
throw new RuntimeException("Method not implemented");
} | 1 |
9fca8c7ad4402c3444dd4099ef10246f | 9ce04da782df34980c159b0c03d9d934 | Sets the ending Ip address of SQL server's Firewall Rule. | SqlFirewallRuleOperations.DefinitionStages.WithIpAddressRange define(String firewallRuleName); | 0 |
a66f5d463f15408a6e04aae7ce4d4c3a | f56d79889fa2c6e6d4ac21bf9c037698 | SGMファイル書き出し | {
file_num++;
if (file_num > 99999)
{
cout << "Error! Overflow!";
exit(-1);
}
char file_name[10];
sprintf_s(file_name, "%05d%s", file_num, ".pgm");
string pwd = "./Images/";
if (0 != _access(pwd.c_str(), 0))
{
int s = _mkdir(pwd.c_str());
}
pwd ... | 0 |
650eb570c1dcb3b2ccbf2413c3e913f5 | 0aab61fa36ba9ae0fa5b5583514eba74 | # Remove the last n characters from a string | rm.csv = function(x, n){
substr(x, 1, nchar(x) - n)
} | 1 |
a7f8c8392ded6e7b81999a4576f2b007 | 0bde2b11d7ea16acbdea910be60e99f1 | Return the (simplified) preparation layer operator given by `layerlbl`.
Returns | if layer_num == 1:
return '{:01b}'.format(0)
elif "conv" in find_type(layer_num, "layer type:"):
if nnbaton_divcase % 2 == 1:
return '{:01b}'.format(0)
else:
return '{:01b}'.format(1)
else:
return '{:01b}'.format(1) | 0 |
651147cf3aa373500e617055d03ce82b | 56617c62834051a580474ff6f47194aa | Date fixing (ex: 1/1/2019 to 01/01/2019) This will break in 2101 | def fixOldDate(x):
x_split = x.split("/")
if len(x_split[-1]) == 4:
return x
else:
x_split[-1] = "20" + x_split[-1]
return "/".join(x_split) | 0 |
512564434960542736b5121d57b3b24e | 614ba908f1c1957abc2aac4ddc8fc11c | Returns a list of telegraf configs for specified organization. | ListNotificationChannelsAsync(new ListNotificationChannelsRequest
{
OrganizationName = gax::GaxPreconditions.CheckNotNull(name, nameof(name)),
PageToken = pageToken ?? "",
PageSize = pageSize ?? 0,
}, callSettings); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.