query_id
string
corpus_id
string
query
string
code
string
label
int64
e780a3ffc3622e17d2f9da1dc104d819
f9c575c04e8e8b17294994b18c9fc0ce
Most likely result first
self.results = results label_dict = {'sentiment_positiveness': 'POSITIVE','sentiment_negativeness': 'NEGATIVE', 'sentiment_neutralness': 'NEUTRAL'} sorted_dict = sorted(self.results.items(), key=operator.itemgetter(1)) sorted_dict.reverse() label_key = sorted_dict[0][0] r...
1
322b0c0ea4e868402c849d5f62033534
76346788d9ed2898c9ad1f3d3e9ae965
Returns the foreign key
class Relationship final public function getForeignKey() { return $this->foreignKey; }
1
5f5b888b10d67029a5707391d656fbdd
d8150e99b7110ed4c324ea9cd5c21e82
用当前日期、时间和1000以内的随机数组合成的文件名称
public class RandomToolsUtil public static String createFileNameByTime(String file_name) { String fileSuffix = file_name.substring(file_name.lastIndexOf("."), file_name.length()); String time = sdf2.format(new Date()); Integer num = random.nextInt(9000) + 1000; System.out.println(time + ...
1
25154db8ffdfe4b1572e7c1f9ef11b26
971125d2b403e9561fbc088aeca4d7bf
마우스 오버시 선택한 배경을 설정한다.
function WebDKP_HandleMouseOver(self) local this = self; local playerName = _G[this:GetName().."Name"]:GetText(); if(playerName ~= nil and not WebDKP_DkpTable[playerName]["Selected"] ) then _G[this:GetName() .. "Background"]:SetVertexColor(0.2, 0.2, 0.7, 0.5); end end
1
8f0500b2f0f642977649292accd53839
2a34b76540d82a21edb0fc5118077d07
Tests parsing of a valid job response.
public class ResponseParserTest @Test public void testParseJob() throws Exception { IndeedResult result = responseParser.parseJob(jobResponse); assertEquals(result.getCompany(), MockResponseBuilder.MOCK_COMPANY); }
1
3cf7c1126762a22e76723e6526dd7cee
7b579f58e0a41bc467a1e5af74286197
创建setTimeout, destroy时自动清除
fn = null, time = 500, _this = null, num = 0, isG = false, callBack = null ) { if (!Timer.isStart) { Timer.init(); } if (_this) fn = fn.bind(_this); let str = Symbol(); _this.$once("hook:beforeDestroy", () => { Timer.clear(str); }); let obj = {}; obj...
1
2778fd42674e7646c501e095664a6934
05c12d8aaa877c5e588ae0d093bb5929
save all countries from request to db
public class UpdateService extends IntentService private void getAndSaveCountries() { RetrofitService retrofitService = RetrofitClientInstance.getRetrofitInstance().create(RetrofitService.class); Call<List<Country>> call = retrofitService.getCountries(); call.enqueue(new Callback<List<Country>>(...
1
b93d975f09781d673435a6a60042fdbf
4c4d3deca90ce450fcc09ae65f4a5cda
左右を入れ替えた骨格要素を返します
{ if (m_freeToUse.Count == 0) { var rtn = new List<MyAnimationClip.BoneState>(m_boneCount); rtn.SetSize(m_boneCount); for (int i = 0; i < m_boneCount; i++) { rtn[i] = new M...
0
04dd94b9a175bdcea40af5f5e58e7290
5796f098b8e180162f4eb1fe790428b9
Only select visitor activities who are associated with the specified custom url ids.
for (final VisitorActivityType activityType: activityTypes) { return withCollectionParam("type", activityType.getValue()); } return this; }
0
d8a8067589a6e8747065f4e2886caa73
2dc748cc38188230eb0ba6a2cf33120b
Sets card styles for upgrades type
{ xpPanel.SetActive( false ); coinIcon.gameObject.SetActive( true ); upgradeButtonText.text = LocalizationManager.Instance.getText("CARD_UPGRADE"); int numberOfCardsForUpgrade; int upgradeCost; if( pcd.level + 1 < CardManager.Instance.getMaxCardLevelForThisRarity( cd.rarity ) ) { numberOfCardsForUpgra...
0
06dff01d92b1dc587db03744fb127a3e
ebd793c2af4c863124a40ab278674e06
Devuelve una cadena aleatoria de 3 letras
String cadena = ""; do { int num = ThreadLocalRandom.current().nextInt(0, 9 + 1); cadena += num + ""; } while (cadena.length() < 3); return cadena; }
0
fccd6a4f2cb0334abf66965c6f7e4cbf
688d7f066d4ce230d77303f4e7833f29
装备评分对比
$r=0; $msg=""; do{ $program_id=trim($get["program_id"]); $weights=$get["weights"]; $check_weights=parent::check_weights_total($weights); if(is_string($check_weights)){ $msg=$check_weights; break; } $input=$weights; $input["program_id"]=$program_id; $input["program_type"]=1; $url...
1
55398c796c43a0a910df7f96ba6cfe31
eb06fb71c3cbe6a7440704b7128b1dcb
Get the listener socket.
class ListeningServerStub public function getSock() { return $this->sock; }
1
6536d019fcdff2bca1aacc5ec41efb69
cff428996dc01456e94024e76efac9d4
Returns all available subscription types
List<String> getSubscriptionTypes() throws IOException;
1
253ac0027d0e7ed63bed00e03d7ebba1
6e727372c643b5f513262edba417f45e
Make sure aggregation dict has legal keys
def test_make_agg(stuff): res = make_agg(stuff) assert type(res) is dict for thing in stuff: assert thing[0] in res assert res.get(thing[0]).get('name') == thing[1] for k,v in res.items(): assert type(k) is int assert type(v['name']) is str assert type(v['total'])...
1
7e45b82998c5d30653f5e4d66b5f7b01
23f6bfd8813d8cad9651d375bf6d3349
Testing undeleting a deleted role
class TestDelete_rol(TestCase): def test_delete_rol(self): c = Client() c.login(username='super', password='super') response = c.post('/roles/delete/rol_test/', follow=True) self.assertRedirects(response, '/admin_roles/')
0
3449de7936f1234fd6e69dbd8d091350
dc77160cb463c10cac53f5110bd0f441
Gets a value indicating whether a converted number&apos;s Exponent property will not be higher than EMax + 1 - Precision. If a number&apos;s exponent is higher than that value, but not high enough to cause overflow, the exponent is clamped to that value and enough zeros are added to the number&apos;s mantissa to accoun...
public class PrecisionContext public final boolean getClampNormalExponents() { return this.hasExponentRange && this.clampNormalExponents; }
1
7a94cc93b1d8bef7f73125b5e2527320
2a5cc5a146d490e33e7074367d4849af
Maps each phoneme to its corresponding blendshapes based on either the XML or the inspector configuration
namespace Leap.Unity.GraphicalRenderer [LeapGraphicTag("Blend Shape")] [Serializable] public class LeapBlendShapeData : LeapFeatureData public bool TryGetBlendShape(List<Vector3> blendVerts) { if (!(graphic is LeapMeshGraphicBase)) { return false; } var meshGraphic = graphic as LeapMeshG...
0
72dfbaed2c5dc080d6b06c19417c72b9
5893e71b9460c92110bd1046a6de561e
教师端刷新获取学生的问题并显示
$("#fixdate").text(window.fixcomputerdate); $("#fixcomputer1").children().remove(); console.log(window.fixcomputerdate); $.post("getfixcomputer.php",{date:window.fixcomputerdate,date1:window.fixcomputerdate1}).done(function(data){ console.log(data); try{ var da=JSON.parse(data); }catch(e){ console.log(e...
1
c7654a22c62c629d82682301fcbace96
902daf2315c9fe914cbfa6d12743ea50
当前月天
@SuppressLint("SimpleDateFormat") @SuppressWarnings("static-access") public class DateUtil public static int getTadayOfMonth() { Calendar cal = Calendar.getInstance(); return cal.get(Calendar.DAY_OF_MONTH); }
0
22333c45e7f1c268f3ee483acd45361f
a654f6aad8066c9d0f3ac4f217863d66
test Strict Avalanche Criterion by returning number of bits changed in output
namespace Crypto class FunctionTesting public double TestBitChange(IKeyExtender algorithm, int ratio) { const int length = 100; const int repetitions = 5; double sum = 0; for (int i = 0; i < repetitions; i++) { BitArray x = Utilitie...
1
a76ee67c63f41b9299e58369a0ddc960
f362d912f036b1cb9ca70dc2f97412e6
Deselects the polyline.
namespace Albert.DrawingKernel.Geometries.Primitives public class EllipseGeometry: Geometry2D public override void UnSelect() { base.UnSelect(); }
0
b58d95c83d5d7f5ddbb2b2a0ac23a7ab
4ffc3f6c711712716fe3a14637caf3ed
Create new random inbox Returns an Inbox with an `id` and an `emailAddress`
String newInbox();
0
b43f9ee40d5b8905cfdf14790eedef6b
b7703478d1cd298f7b86ae9f2a780802
defining a function that takes a string and a dictionary and returns an encrypted version of the string
def encrypt(text, rot): final = "" for i in text: newalpha = rotate_character(i, rot) final = final + newalpha return final
0
4a8574d508a2230eb4d7a10ceb8ecbe5
65aca0108eaa5b450acdab426cca0b07
图片URL转base64,返回base64字符串
public class Base64AndPictureUtil public static String getImageStr(String imgUrl) { InputStream in = null; byte[] data = null; try { in = new FileInputStream(imgUrl); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } BASE64Encoder enc...
0
ab6fb2d286eb5ccda3db6b3d3392d595
3b4f9ec4db98acb117fc308735b0f6fd
Uses the API request routing.
class RouterAPIController extends APIController public function __construct(Request $request) { parent::__construct($request); }
0
9ec29a53496c7141cf11230855138ef2
dea24823bb35ff1e516526fb60b77219
查询店铺下所有的打印机(未删除)
public List<MerchantPrinter> selectMerchantPrinterList(MerchantPrinter merchantPrinter);
1
b384e602072ef80e21fce3df9c74a754
e9df6d048ed64881213020199e61824d
Method that adds 1 file to the total number of files.
public class FileSystem implements UserInterface private void decrementFileNumber() { this.totalNumberOfFilesInDisk-=1; }
0
e5121e046f94fa99625581f6d599cefa
8649c6192d126c0437bdf0d334166d1a
注册选择图片和拍照的监听
CallBackManager.registMainResultListener(new TakePhotoListener() { @Override public void dataBack(int requestCode, int resultCode, Intent data) { resolveImageData(requestCode, resultCode, data); } }); }
1
6db50c5585fed175d19bf418c4f032f0
8fafcc1e0024e59b2758fe78fcdbc368
Yılanın başının ekrana çizilmesi
class Snake(): def snake_init(self): self.snake_array = [[self.row // 2, self.col // 2]] self.canvas.itemconfig(self.field_array[self.snake_array[0][0]][self.snake_array[0][1]], fill = self.snake_color)
1
8661afa9fdd6245419c2a709d4230fc2
b7837b39d7bd36910d83948a478656f5
注入数据库拦截器
@Configuration public class MybatisConfig @Bean SqlStatementInterceptor sqlStatementInterceptor() { return new SqlStatementInterceptor(); }
1
a827a7be0c0cc9b4216efce8af9a4de7
750e3553eb535b44e4dc3f9d71f40de6
If we cannot test in Chrome/Chromium directly, we can try to compare output to `example-extension.crx` which was tested.
s = c.solutions.add() s.name = 'webrtc-limited' s.url = ChromeInternalGitURL(c, 'chrome', 'deps', 'webrtc-limited') s.deps_file = 'DEPS'
0
11600408693d5f31c6208038235ff567
ec56c88178397cad3ccedd6a61742d8d
Set the offset in the backlash correction to a small random integer.
public class CamAcq implements ApplicationListener public void setOffset(int _offset) { camModel.setOffsetAcq(_offset); }
0
ad71999948b57c1e047aab08ec8f4b87
b579d8201d556bf8a16c9f96f9dd92c7
Является ли юзер овнером, чтобы создавать организации
class Users extends \yii\db\ActiveRecord implements \yii\web\IdentityInterface public function isDoer(): bool { return $this->getSpecialization()->exists(); }
0
836888ccea7b3500665eb5f11d6e940f
7a60b0d8ac770fc525dfed48be25597b
Gets the kyc flag.
ResultDto queryIsKyc(String name);
1
194a7793281afca86fda1c57690918ed
2c74d84f9289b6b7c115525220dca70a
储存表格价格和数量
resPrice(orderDatas) { let orderData = orderDatas || this.data.orderData let allSheetAmt = this.data.allSheetAmt allSheetAmt[1] == [] let billData = this.data.billData allSheetAmt[0] = 0 allSheetAmt[2] = 0 billData[0] = 0 billData[1] = 0 billData[2] = 0 let selectedNav = this.dat...
1
68e9fbacb2c90b189626885f97887485
2f2fb3f059222cfee55cb64bc4078e52
HDLPlayURL 生成 HDL 播放地址
public final class UrlFactory public String hdlPlayUrl(String streamKey) { return String.format("http://%s/%s/%s.flv", hdlPlayDomain, hub, streamKey); }
1
ed12d44069510972b72ce5ed0bd03727
5ed9006a303a2c152f20112d8cd6c4a2
Test if the sudoku solver gives the same solution Input and output files are from online (Sample problem 9, easy) http://www.nikoli.com/en/puzzles/sudoku/
self.assertFalse(Sudoku(solveable_list).is_solved()) presolved = [[5, 1, 3, 6, 8, 7, 2, 4, 9], [8, 4, 9, 5, 2, 1, 6, 3, 7], [2, 6, 7, 3, 4, 9, 5, 8, 1], [1, 5, 8, 4, 6, 3, 9, 7, 2], [9, 7, 4, 2, 1, 8, 3, 6, 5], ...
0
c735a12d419e669b8bb4656e12cce3b2
1afd7d92b67599191b2690af149c138a
funcao para limpar o vector
for (int i = 0 ; i < vector->size ; ++i){ vector_erase(vector, i); } }
1
259a3647b5162c3f21d1fba50a8c55a4
1aa7df80bed4ce35a8bc9e1d90d097e2
Implements controller autoloader.
function __autoload($className) { if (file_exists( ROOT . DS . 'controllers' . DS . strtolower($className) . '.php') ) { require_once( ROOT . DS . 'controllers' . DS . strtolower($className) . '.php'); } else if (file_exists( ROOT . DS . 'models' . DS . strtolower($className) . '.php') ) { ...
1
8cff23293ada9e0af1aadbedf902daaf
ddd9fba33a57927c8fe29093297ac4ae
执行单返回值SQL语句
namespace MyADO public class SqlDBOperator : IDBOperator, IDisposable public bool ExeSQLResult(string sql, IDataParameter[] parameterArray) { bool bResult = false; int i = ExeSQL(sql, parameterArray); if (i >= 1) { bResult = true; } return bResult; }
0
85875fa870b9d5ac9e5941d1371a4cbe
c7f1e1eeb668010a3307347b0816f5dc
创建文章的文件夹保存图片
for article in articles: print(article.text,article['href']) if not os.path.isdir(os.path.join('download', article.text)): os.mkdir(os.path.join('download', article.text)) res = requests.get('https://www.ptt.cc'+article['href']) images = reg_imgur_file.findall(res.text) ...
1
f8765ad56cd12065ce88b0a7ea9543f6
9bccec387bb12a55268c30902454dbc9
Method to purchase items in Cart
CartDoesNotExistException, CartIsEmptyException { Purchase cart = getCart(); if (cart == null) { throw new CartDoesNotExistException(this.getName()); } else if (!cart.hasAnyOrderedDish()) { throw new CartIsEmptyException(this.getName()); } ...
1
a3764d55a784650dd1a0eb535e17bc71
ef342e4a0613ebfd27acd8a8885fbe67
Affiche la liste des lycéens
class UsersController extends AppController{ public function listLycees() { $query = $this->Users->find('all') ->where(['role' => 'highschool']); $users = $this->paginate($query); $this->set(compact('users')); $this->set('_serialize', ['users']); }
1
5bf76a024ab3b1b147e3423abe51d267
1108bb6b9faf62427db6c73d59a5f507
Function Name : Set_System Description : Set System clock. Input : None. Return : None.
static void SetSysClock(void) { __IO uint32_t StartUpCounter = 0, HSEStatus = 0; RCC->CR |= ((uint32_t)RCC_CR_HSEON); do { HSEStatus = RCC->CR & RCC_CR_HSERDY; StartUpCounter++; } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT)); if ((RCC->CR & RCC_CR_HSERDY) != RESET) { HSES...
1
fc0210bf09cd3ff4dbb14999961288a2
8b0d684d340d4d6a57f4e5d1fedbc2a0
Align palette to scrolled window position.
class TurtleArtMiniActivity(activity.Activity): def adjust_palette(self): if not self.tw.hw in [XO1]: self.tw.move_palettes(self.sw.get_hadjustment().get_value(), self.sw.get_vadjustment().get_value()) self._defer_palette_move = False
1
e3a6957976d15d8501def8cf3474eb1c
c6ea913829d1fb59b9bff34cd7462c8e
标注系统首页数据获取与传递
let getIndexData = () => { let fn = think.promisify(request.post); return fn({ url:articleModule.host + ":" + articleModule.port + articleModule.path + "mobile/dscvinfos", form: {token: token} }); }; let articles = await getInde...
1
72b9af8c361c75aa7a3c6d9830ee1c9c
c6c2c4657774e1b5c28da6d05525db13
test if users in setup were created
def test_setup(): db.create_all() if User.query.filter_by(login_id='felix').first() is None: felix = User.register('felix', 'cat') user2 = User.register('usr2', 'dog') e = Entity.register('Magic Bag', 'DS_MAG_BAG', felix.id)
1
1240a18b017ffa00eb5b29990ac47a3b
da9db3f592722f78ba673febe4595e26
метод для создания нужной разметки формы в зависимости от кнопки, на которую нажал пользователь
function createForm(nF){ nF.innerHTML = ""; let forms = document.createElement("form"); forms.classList.add("form-group"); nF.appendChild(forms); let textForm = document.createElement("textarea"); textForm.classList.add("form-control"); f...
0
100456f1b9134203f0c9420e9a454ac9
aa99786f9cae89b29d7031198de9448f
Transform a `matplotlib.contour.QuadContourSet` to a GeoDataFrame
def polygonize(image, mask=None, transform=None): shape_pairs = rasterio.features.shapes(image.astype(np.int32), mask=mask, transform=transform, connectivity=4) segments_list = [{'properties': {'DN': dn}, 'geometry': g} for i, (g, dn) in enumerate(shape_pairs)] return gpd.GeoDataFrame.from_features(segments...
0
79b63b4219cd552ec22bd9fabf704c9d
a3daf8731347e5757cbadbf6c002237e
retourne vrai si tout les parametres d'ajout/modification d'absence sont bien remplis
boolean test = true; if (this.ADCO.matches("")) test = false; if (this.OPTARIF.matches("")) test = false; if (this.ISOUSC == -1) test = false; if (this.HCHC == -1) test = false; if (this.HCHP == -1) test = false; if (this.BASE == -1) test = false; if (this.PTEC.matches("")) test = f...
1
4509ee3cffec75791fd412eda21d8238
1857e4beafa1a39810f241792dba31de
单个修改互联网边界防火墙开关
return doStuff(arguments, {}, prepare, deal, null, true); function prepare(params, isPost) { var requestParams = {}; requestParams.goformId = "/goform/setFirewallSwitch"; requestParams.formdata = params; return requestParams; } function dea...
1
13e43b7a9b82586ba1ff2c7592eaada6
4d3b5340b71407f6a6fcca7430f6db32
escribe los resumenes numericos en el log de una columna continua
{ report.write(" " + F.f(value,8, F.RJ) + " - " + text + EOL); }
1
1244552cdbb4037de8ca5822c828287c
c5c175b853d83be0ad78b182acf004c3
函数功能:进群
class SocketReq public static function enterGroupReq($client_id, $mr, $bodyObj) { $result = Group::enterGroup($client_id, $mr[SocketHead::H2_ID], $bodyObj); MessageTools::sendMessageToClient($client_id, json_encode($result), $mr); }
1
36a6a4745c137dd24a01b88b152af6d9
a4629ab3d8c184c5591f48b8af4fdbe5
Initializes a Async Modbus Serial Client
class MbClient: def __init__(self): self.errors = 0 self.rr = None self.comport = None self.s = None self.client = ModbusClient() self.log = logging.getLogger()
0
9649c00cc26632a95414950658d064ee
e2648cb4f2305ca3bdadfc5e546dc2aa
Highlight the current row in the graph and table
public function highlightCurrentRow($highlightCurrentRow = true) { $this->attributes->highlightCurrentRow = $highlightCurrentRow; return $this; }
1
181f9e011523225f44db0d71f8fd8c27
96da9f7b2bf9cabbebe60371a95dd03b
Set value to Message Optional Drop Down List field.
public class FeasibilityCheckPage public FeasibilityCheckPage setMessageOptional1DropDownListField() { return setMessageOptional1DropDownListField(data.get("MESSAGE_OPTIONAL_1")); }
1
5486358e04bc95a9ff3439a9b48c202d
b00e18e7f2bb0a0079525057c3b17ce9
Set utiCNomCompletCourt
class CdeFournisseurEntete public function setNomSuite(?string $nomSuite): CdeFournisseurEntete { $this->nomSuite = $nomSuite; return $this; }
0
713757071e7309bb79c798466958fc4a
b976645d5d66572391bfb6595c064614
根据用户通行证识别身份,如果合法返回用户身份信息,否则抛出UserIdentificationExcepiton异常
namespace CourseSystem public class presentationModel public string IdentifyUser(string userId) { string userIdentity = _model.IdentifyUser(userId); return userIdentity; }
0
642ea3c247f40976fe1bbdcc40e1954d
6dc08033bc12d45970d23e7d4a877953
获取cm阈值历史告警条数
{ JsonResponseModel<DescribeCCThresholdListResponse> rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeCCThresholdList"); rsp = JsonConvert.DeserializeObject<JsonResponseModel<DescribeCCThresholdListResponse>>(strRes...
0
8106c029c77f9828cda629b4dde6354e
15ff59d83827b72150de095551d56e1d
获取指定玩家的控制器编号。
{ switch (type) { case Pong.PlayerConstant.Type.Man: return Pong.BoardControllerConstant.Type.Touch; case Pong.PlayerConstant.Type.Cpu1: return Pong.BoardControllerConstant.Type.Cpu1; case Pong.Player...
1
a662f204890f1d1eac311d7362781b6f
20d037818162ac142bc5f7bb72458b0b
Player walking (normal)
{ if (m_WalkDir == eDir) return; if (eDir == WALKLEFT) { m_lpPlayerSprite->ActivateCells(0, (m_nPlayerCells/2)-1, NO); m_lpPlayerSprite->ActivateCells(m_nPlayerCells/2, m_nPlayerCells, YES); m_WalkDir = WALKLEFT; } else { m_lpPlayerSprite->ActivateCells(0, (m_nPlayerCells/2)-1, YES); m_lpPlayerSprite-...
1
1699319eea586210c5f863f791e5912b
84ffc4e5aa480d6fd9e5429cd99c3217
Gets the label of this property's value for the given item or, when the property is absent, the default value. The returned string will include the unit.
const { label, labelFormatter, fractionDigits, moduleCtx: { callbackCache }, } = this; if (label.formatter) { const defaultValue = fractionDigits > 0 ? datum : String(datum); return ( callbackCache.call(label...
0
3d47129522d53945789ff7008492d679
19b90943f858c2e5bda5e93bee1e0d44
Export to file and clear the stream
{ if (File.Exists(savePath)) File.Delete(savePath); using (FileStream fs = new FileStream(savePath, FileMode.Create)) writeToStream(fs); }
1
3abab0b9c37fb1c501dfc414db623909
c1a91254c20e6b217b9877277f9f4ef3
Allows a binary tree to be printed out.
ostream& operator<<(ostream &output, const BinTree &printBST) { printBST.inorderHelper(printBST.root); output << endl; return output; }
1
31a87fd537ceef0941585d90ade65e17
df86d882aa112d0d258a312e71e5cffa
Tìm mã hãng xe theo tên hãng xe nhập vào
{ try { string sqlstr = ""; sqlstr += "select top 1 MaLTT from LOAITHANHTICH where TenTT Like N'%"; sqlstr += TenTT; sqlstr += "%'"; SqlDataAdapter da = new SqlDataAdapter(sqlstr, _cn); DataTa...
0
094343aef67b073ad3917e7823a892cd
923f5a163ee54b21f839867a33e2d7ce
半透明背景隐藏
public class PopAddTaskWindow extends PopupWindow @Override public void showAtLocation(View parent, int gravity, int x, int y) { super.showAtLocation(parent, gravity, x, y); backgroundAlpha(0.5f); }
1
19d81d61cfa6c092ae643b5513d4ba01
6b96aab1ff7dc6898a6fd4193f3faf02
Returns a single :class:`Attribute` with *slug*
slug = "color" variables = { "id": graphene.Node.to_global_id("Product", product.pk), "slug": slug, "channel": channel_USD.slug, } response = staff_api_client.post_graphql( QUERY_PRODUCT_WITH_ATTRIBUTE, variables, ) expected_slug = "color" content = ge...
1
640d2d6e4c1c22d5ae1c6b7519b81ea5
693b48823c47f7271338bcf24057349b
Helper to create operation context url.
namespace ServiceContext::UniqueOperationContext makeOpCtx() { auto opCtx = cc().makeOperationContext(); repl::createOplog(opCtx.get()); return opCtx; }
0
f2d18508361325fecccd8be3c8e6b1dc
723ddbe5055a6e470a4b1315fa200185
イベント終了期限内のデータを返答 <p> イベント終了日時と現在日時を比較して有効なデータを返答する。
LocalDate now = LocalDate.now(); ArrayList<Event> eventsToReturn = new ArrayList<Event>(); for(Event event: events){ if(now.isAfter(timetoDate(event.getEndDateTime()))){ eventsToReturn.add(event); } } return eventsToReturn; }
0
d3f995112523a5cb136f44d55581b309
8339ac1bef307e78656282995f18474f
获取当年的第一天
public final class DateUtil public static String getFirstDayOfYear(){ int yearPlus = getYearPlus(); GregorianCalendar currentDate = new GregorianCalendar(); currentDate.add(GregorianCalendar.DATE,yearPlus); Date yearDay = currentDate.getTime(); SimpleDateFormat df=new SimpleDateFormat(DEFAULT_DATE_FORMAT); ...
0
29d52f9899dcb6317945806253e5b379
586b0e24dd533f1691844e4e3d3c1186
We want the file with the more recent last write time to come first
public class DailyMaxRollingFileAppender extends FileAppender private void sort(List<File> files) @Override public int compare(File file, File newFile) { long o1 = file.lastModified(); long o2 = newFile.lastModified(); return o1 == o2 ? 0 : (o1 < o2 ? -1 :...
1
f660d84c893972c6a8ee83085b7e41b7
2021d46963b37e35bc8f2e0228b68207
add one to account for the bias term
weighs_without_bias = np.copy(self.weights_matrix) weighs_without_bias[:, 0] = 0 P = self.regularization * weighs_without_bias self.D = (1/n) * (self.D + P)
0
25f18e06b24b51e5fe38a4a0e648675d
ef73bb2e523dd24a8031bc8467c6a90b
function to get account name based on the typed value in account field
public class LoginActivity extends Activity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener public String getAccount() { return user_name.getText().toString().trim(); }
1
3b45807406c565717226798667a2e083
d143c64ac220232b693c24f362286456
批量更新sku
{ if (empty($data)) return false; $bool = db(parent::DB_APPLICATION_ID) ->table('shop_goods_sku') ->batch() ->insert($data); if ($bool) object(parent::CACHE)->clear(self::CACHE_KEY); return $bool; }
0
2825c7e919d3f527e55829d9a3caf021
3a53513f07de884839f225143b4615b1
Returns the given list with all duplicates removed.
output = [] seen = set() for value in values: if value not in seen: output.append(value) seen.add(value) return output
1
e3bff0a4f5dd9fe4aab17e5bae1457a1
4ac624161e065e86fc4b73cbe5c361a1
return all of the children of this accessible element.
protected class AccessibleJEditorPaneHTML extends AccessibleJEditorPane int getAccessibleChildrenCount() { if (accessibleContext != null) { return accessibleContext.getAccessibleChildrenCount(); } else { return 0; } }
0
25451447e7a137e141e884c6a8dde0ad
fbec6078fdd22a543f9d9a010fedb8ae
通过request包装学生实体类
public void printJson(Request request, Response response) { Student student = new Student("jack", 20); response.json(student); }
0
af41f2bce48d78e392a4ec8a264cf788
f58bfbd8a93bb9f560dba4ca85503ffe
пропускает элементы в последовательности, пока они удовлетворяют заданному условию, и затем возвращает оставшиеся элементы
function skipWhile($predicate) : IEnumerable;
1
09c0451f12211d990ad810a1151c9f90
c452b21a0417cb8875dcd4f3d2cc538d
Можно ли пользователю проверять жалобы
{ $private = in_array($answer->to_type, [Document::MORPH_NAME, Call::MORPH_NAME]); return $user->can('admin', User::class) || $private && $user->status && $user->lawyer && $answer->from_type == Lawyer::MORPH_NAME && $answer->from_id == $user->lawyer->id || $user->isUser && $...
0
5c723857cefb544a9ebfac216243cce3
719a802296491bf75dee5be580c409bf
从磁盘加载CSV数据
func loadData() []*MnistSample { var samples []*MnistSample fi, err := os.Open("./train.csv") if err != nil { panic(fmt.Sprintf("read data failed:%v.\n", err)) } defer fi.Close() br := bufio.NewReaderSize(fi, 4096*10) _, _, _ = br.ReadLine() for { a, _, c := br.ReadLine() if c == io.EOF { break } a...
1
65b7b8a5659a5ad04509d7ec040a1f12
e699965ee450944329e246a57dccdb5d
No longer being held
namespace GGJ2020.Stages public class ShippingButton : MonoBehaviour, Holders.IHoldable public void Unhold() { }
1
5dccf1ee8852a4712c6f66289d5646f5
33edc089d12a6935e081b9b1634af3df
This sample shows how to use a functional-type semantic script as an input expression for EE. Some preprocessing will be needed to make the script look like C#
{ const string usingCode = @"using System;"; const string evaluationCode = @"Console.WriteLine(""Hello"");"; const string completionCode = @"""World"""; return Task.WhenAll( replServices.HighlightAsync(Guid.Empty, usingCode), replSe...
0
d91d9c6367477ae7c17d3afaf9f433f3
b4e456d914fd5e7af4f54797eaf410a1
The distance to the far clipping plane.
namespace OgrePlugin [NativeSubsystemType] public class Camera : MovableObject public float getFarClipDistance() { return Camera_getFarClipDistance(ogreObject); }
1
57d977212b14845a0164f25a1a48fd68
4f95016e30ef355b1bddb4e134895e6b
@brief This API returns the base address of the input memory node
{ *baseAddress = (uint8_t *)(TPM0_BASE + 0x1000 * TPMNumber); }
0
bf45974955d0bc9a110d3e15a007ac3e
ab29180fd047fc51caa73e2be50102b6
Determines if the specified <c>type</c> is a <see cref="Task"/>.
{ return (method.ReturnType == typeof(Task) || (method.ReturnType.IsGenericType && method.ReturnType.GetGenericTypeDefinition() == typeof(Task<>))); }
1
509f6c2874368f1f9215278fa043d40b
aaa32598327edfae138732db2b87edb6
opens a frame to change the open project properties
def openProp(): for n in nuke.selectedNodes(): nuke.show(n)
0
0636edd138e9fdf898017fc75a4858f5
cb48c8a58d6d117f6cb4d30cefc1f1e9
Linearize logarithmic distribution.
self.alpha = alpha Quad.__init__(self, *args) self._nodes = self.nodes self._wts = self.wts delta_x = self.u - self.l self.y_l = exp(alpha*self.l)/alpha self.y_u = exp(alpha*self.u)/alpha scale = (self.y_u - self.y_l) / delta_x self.scale = scale ...
1
8e1882733f1b26fc6261d582c31bae82
843d0a770ffc8b90d1dbed8c630d2890
fill a piece of memory with null values and returns the next address
void * get_address_map(int size) { char * addr; addr = (char *)((char*)real_memory + mem_offset); memset(addr, (int)0, size); mem_offset += size; return addr; }
1
073bc222b89081eed2c3f4a1ae7a9270
2e784d4b6dd44669dec5e5f7df9882a7
生成时间序列的GUID
{ long i = 1; foreach (byte b in Guid.NewGuid().ToByteArray()) { i *= ((int)b + 1); } return string.Format("{0:x}", i - DateTime.Now.Ticks); }
0
043b9bec5fac1fb856fbde559395abfe
60ce48715943939c17175059aa22c601
sensor locations values into a bitmask.
class Solver: def calculate(self): res = [] for i in range(self.M): sub_res = [] for j in range(self.M): sub_sub_res = [] for loc in range(len(self.point_locations)): if self.euclidean_distance(self.point_locations[loc], (i, j))...
0
08a6ea9547b692cb4e8e61905dacbd9d
4ff4674cc183e21ec2ffe962d4fd67a3
多航段中航空公司二字码是否相同
func MatchingAirline(Legs []*cacheflight.FlightInfoStruct, Airline string) bool { for _, leg := range Legs { if leg.AD != Airline { return false } } return true }
1
0c619d960c4e7f889e1e7e1101a44444
4b4bc7f3c8a689f58d54013137a8b2d0
Reads pairs file, creates node to neighbor mapping, and converts the mapping into the adjacency list.
adjlist* readadjlist(char* input){ unsigned long n1=NNODES,n2,u,v,i; unsigned long *d=calloc(n1,sizeof(unsigned long)); adjlist *g=malloc(sizeof(adjlist)); FILE *file; g->n=0; g->e=0; file=fopen(input,"r"); while (fscanf(file,"%lu %lu", &u, &v)==2) { g->e++; g->n=max3(g->n,u,v); if (g->n+1>=...
1
8f8346b5cdf3fbe73fa4c31477d8b205
b3c90824c58e3a35d47148ef5b3bcdcd
保存课程类型信息
@Service("cTypeService") public class CTypeServiceImpl implements CTypeService @Override public int updateCourseTypeInfo(Map<String, Object> map) { return cTypeMapper.updateCourseTypeInfo(map); }
0
282ec14f905fab4ac4f66367e69dc355
9625919832c0864f4530e74eb23324b1
打印点击的点的坐标
global roi_points if event == cv2.EVENT_LBUTTONDOWN: p = (x, y) print(p)
1
0dd2bc9d15bb51e490e3f9dffc635873
39c8e7e1a3aa1ca0292598f137c7df2a
获得响应返回的数据分块列表。
namespace Aliyun.OSS PartListing ListParts(ListPartsRequest listPartsRequest);
1
3825670153045be34f2314dbbb40cebc
8be562db75d68ed2dcd577d211795130
将一个字串中含有半角的数字字符、字母、空格或'%+-()'字符转换为相应全角字符
{ if (string.IsNullOrEmpty(str)) { return string.Empty; } StringBuilder builder = new StringBuilder(str.Length); for (int i = 0; i < str.Length; i++) { int num2 = str[i]; if (((num2 >= 0x30) && (num2 <= 0x39)) && ((StringFilterOptions.HoldNumber & options) == StringFilterOptions.HoldNumb...
0
f00d6c5ef9fdcab80c9e58317c69180d
a6eab3e34ec24921456504bb6ef82686
defines which Items of the MenuBar are currently visible
public partial class clone_order : System.Web.UI.Page protected void enable_menu_items(List<string> active) { bool _isactive; for (int _ix = 0; _ix < this.dxmnuCommand.Items.Count; _ix++) { _isactive = false; for (int _mx = 0; _mx < active.Count; _mx++) { ...
1
78c6ba2217550a65670745305e48cc18
19b4ba285f2d46689d5ce82933120df7
Bitwise and returns an AndObj BooleanOperation object
class LU: def andr(params): return { 'main': params[0] & params[1], }
0
77d4db63f9f178602dec5e041a76a561
3643c8c6f3512f339cb91792db8a221c
@brief Calculates the CAN FD RAM buffer address.
{ uint32_t msgLength; if ((CAN_MSGFORMAT_CANFD != aFDFCfg) && (CAN_MAX_DATA_SIZE < aCanDLC)) { msgLength = 8UL; } else { switch (aCanDLC) { case 9: msgLength = 12UL; break; case 10: msgLength = 16UL; break; case 11: ...
0