query_id
string
corpus_id
string
query
string
code
string
label
int64
f51d8f8a4adcc81d0b9fd2d5e1f8ed7e
0bca5a294f7d07a40d4fe213b01ff235
funcion que se encarga de rellenar el select con los cursos
if($('#opts2-carrera').val() != ""){ getDatosSelectCarreras3(); } $.ajax({ type: "POST", url: "src/registro/actionReadCarreras.php", data: { opt : 2, id : $('#opts1-carrera').val() }, error: function(p1, p2, p3) { alert(p3);...
1
8781004aa86f8a3da87652dbab8668a2
d0215e5a1884aaf207c9b7e51839466b
Function controls the visibility of progressbar using [visibility] If [visibility] is true, progressbar is made visible and the recyclerview and textview are hidden. Else, progressbar is hidden and the recyclerview only is made visible
abstract class BaseFragment : Fragment(), CoroutineScope, HasSupportFragmentInjector fun progressBarVisibility(isVisible: Boolean) = if (isVisible) progressBar?.visible() else progressBar?.gone()
0
5dbc914b93a634a0fc234d585d5959e3
57cd50bc0db086bc1ddb0b9a0ec4a2a0
解析宝具卡
function TmjPlayer:buHuaCard(cardInfo) if self.operationFun then self.operationFun(self.pType,TmjConfig.cardOperation.BuHua) end self.cardsArray = self:setCardArray(self.handCards) self:checkToSetLastHandCard() end
0
e3fd84d081b3ed6ec13631b802108bf2
b27d9063d1c05588a9ef6911cb7373d2
获取浏览量前9的9本书数据列表,作为首页轮播图
class Mpvue extends Controller{ public function bookhots() { header('Access-Control-Allow-Origin: *'); $book=new Books(); $res=$book->order('count','desc')->field('id,count,image,title')->limit(9)->select(); return json(['code'=>0,'msg'=>'成功','data'=>$res]); }
1
e76cd678d36bcb6013050b483218edc0
1f7d87de2e290eabf43f736ad8d1ee1f
将js值转成c#值,参考凹大神的 https://gitee.com/aochulai/NetMiniblink
public static string SimpleMinJs(string i) { return reMinJs.Replace(i + "", ""); }
0
e2dafd9c940f35f316d80d084aaddefd
28dd7c43130018819707180ddc112005
解析用户删除背包礼包列表
String str = new SPUtil(context).getFromSp("del_pkg_list", ""); if (str.equals("")) { return null; } return StringUtils.replaceNullArray(str.split("%")); }
1
a6179a8a467717060c88858bf57ed853
1f255416115f07fb5e7c70d9a110b683
Metodo que comprueba escenarios tipo 1a que pueden dejar el nivel irresoluble.
public class testSolverEquipo @Test public void testNoCumpleRequisitosMinimos() { Modelo modelo = new Modelo(); cargarPocosEmpleados(modelo); modelo.agregarMalaRelacion("Lider", "Arq1"); modelo.agregarMalaRelacion("Lider", "Arq2"); modelo.setCondicionArquitecto(1, 2); modelo.resolver(); assertFalse(mod...
1
8065a0b33464e195653f1519f462aa3a
eb4d45e23abc756f59b7b8fb3d765326
Add the node to the set, and add all of its connected nodes to the set.
class UnionFind(): #init with the partition sets and a parent table #can be optimised using only 'parents' dict def insert(self, node): if node not in self.parents: self.sets[node].append(node) self.parents[node] = node
0
f93c7c338c22768a75936e7540c28cfd
f02bfa1a3f313a8929b908cd86bb17f9
下载补丁并显示在进度条中
{ int newResourceVersion = PatchManager.Instance.GameVersion.Revision; string url = PatchManager.MakeWebDownloadURL(newResourceVersion.ToString(), PatchDefine.StrPatchFileName); WebDataRequest download = new WebDataRequest(url); yield return download.DownLoad(); if (download.States != EWebRequestStates...
0
af9a6eac450a3aca2fade127e0c63861
be43c1ec3652aea30fe3f851f88500df
抓分集
{ Dapei::where('cate_name', '7dapei')->where('is_splice', 0)->chunkById(500, function ($data) { foreach ($data as $vo) { $arrCover = explode(',', $vo->cover); $content = $vo->content; $arrContent = json_decode($content, true); if (!...
1
a83cc98d118cf4d77f4b667728388340
58c8e57890174e8971722dfa01b4cf5a
Método que devuelve la descripción asociada al ID de un centro.
o = self.connection res = '' denom = o.GiscedataCts.read(ct_id, ['descripcio'])['descripcio'] if denom: res = denom return res
1
7460723645adcb121be03f12d7969bf0
0839aea54c4a2721fd40e7e9df7cf000
The amount the user has spent in the last month.
class UserSessions extends Analytics public function monthlyTotal() { if (is_null($this->mTotal)) { $this->_monthlyAvgs(); } return $this->mTotal; }
0
2aa0d8596bf22f8f265dde2dffdfd53a
b42c96a841554213df510fad7b43de9d
Provides a string when no past tasks is found.
public class Ui public String showTaskNotFound() { return "OOPS!!! The tasks you are searching for is unavailable."; }
1
27e01ec9aea377661bb80b18d3aad254
0605a5430b76f7287bd584c147c1f5e4
Dreht den Spieler.
{ if (drehungen < seitenLaenge) { if (putLeaf) { kara.PutLeaf(); } putLeaf = !putLeaf; } }
0
890345d929233e4fe4ab700342da9fde
9b3d503beb4a5842ae4848da415b8190
如果需要再请求服务器之前做一些操作, 则重新返回一个做过操作的的request如增加header, 不做操作则直接返回request参数
requestBefore(options){ options.header = { token: 'token' } return options }
1
a98ef5963ba310c448f8ec305a3e484f
0a194b54ffcdfb87dceb5ecb4431d33b
Check that "require ssl" works on h2 connections See <https://bz.apache.org/bugzilla/show_bug.cgi?id=62654>
url = env.mkurl("https", "ssl", "/requiressl/index.html") r = env.curl_get(url) assert 0 == r.exit_code assert r.response assert 404 == r.response["status"]
0
0f3202a15a7bf6c6734ef075981ef808
35cc7b5f34f80f26c538e2eba8c4a9c6
根据书号获取粉丝数
@Component("blogDAO") public class BlogDAOImp extends BaseDAOImp implements BlogDAO @Override public int getFans(int uid) { try{ return getSqlSession().getMapper(BlogDAO.class).getFans(uid); } catch (Exception e){ return 0; } }
0
ba439bd26cdb9675607c3ee8f8b35285
e85ab7190cb6a026083173489a0e261c
Returns listen address serial from a LibvirtLiveMigrateData
vm_cp_info = self.vm_cp_info(cp_name) if vm_cp_info: return vm_cp_info.ip_address else: return "0.0.0.0"
0
ed327e92a1b3edb7ea77137838249ddd
044a60761316278dd05021f3d1c4666e
初始化 勾选框点击事件
function init_check_box() { $(".code-box").unbind("click").bind("click", function () { if($("#all_select").css("display")=="none"){ $("#all_select").show(); $("#un_all_select").hide(); } if ($(this).hasClass('active') && !$(this).parent().hasClass('disable')) { ...
1
c38a6a0729277792ec36c576b1c6542f
6242ee68e92eaf0435625743f41a7093
Page du tableau de bord pour afficher les statistiques du mois
{ $infos['clients'] = Client::all()->count(); $infos['autos'] = Auto::all()->count(); $reglements = Reglement::forDate(Carbon::now()->format('Y-m-d'))->get(); return view('home',compact('infos','reglements')); }
1
7a1a4721ecb281949cf896e1dc266b00
a5b6e2c55ee6494286015f0d17cbf866
Convert MySQL select result to tab separated Copy and paste it to spread sheet easily.
{ echo '<table border="1">'; $array = $this->assoc($result); $keys = array_keys($array); echo "\n <tr>"; foreach($keys as $key) { if($key == '') echo "\n <td>&nbsp;</td>"; else echo "\n <td>".$key."</td>"; } echo "\n </tr>"; while($array = $this->assoc($result)) { echo "\n <tr>"; ...
0
9a6436c2d63e12064a6b3fa7895360ff
39103bae4e92dc869046195ee2da8ddd
Ecrit le footer JPEG (marqueur EOI) dans le fichier de sortie.
class GIFEncoder public function addFooter(): void { $this->output->writeString(";"); }
0
962cf6cdef5210be6bd512cefa6c1303
a1f1ecb57edec0e1e5ef226c4b8c5a26
添加弹窗的背景色
class XDialog(private val mCtx: Context?) fun setBackgroundColor(@ColorInt color: Int): XDialog { this.backgroundColor = color return this }
1
bdf21c13f6781e3f500f8f5dc88a27a2
2b674834ad9863c3206594af99b48821
check that the standard file is enumerated correctly by the vfs
{ int fd; const char *filename = "disk"; for (int i = 0; i < NANVIX_OPEN_MAX; i++) { uassert((fd = nanvix_vfs_open(filename, O_RDONLY)) >= 0); uassert(nanvix_vfs_close(fd) == 0); } for (int i = 0; i < NANVIX_OPEN_MAX; i++) { uassert((fd = nanvix_vfs_open(filename, O_WRONLY)) >= 0); uassert(nanvix_vfs_clo...
1
4cb3e235ecac89eaea5e700d20a75537
9e51c806dd738a61030c26a95ac6b289
Setup function pointers
{ fp_begin_initialize = (fp_begin_initialize_type)function_pointer_array[0]; fp_end_initialize = (fp_end_initialize_type)function_pointer_array[1]; fp_define_translation_file = (fp_define_translation_file_type)function_pointer_array[2]; fp_get_trans_string = (fp_get_trans_string_type)functio...
1
77ddc9190ba127daa3951df929163b2e
49782c8dd620d94d03c10663f29e4e28
Überprüft Mitarbeiterliste ob bereits vorhanden
class Employees extends Db private function checkEmployees(){ $sql = "SELECT full_name FROM employees WHERE full_name = '$this->full_name'"; $result = $this->query($sql)->rowCount(); return $result; }
1
58394e755b3f55b7bcc1fd2cb8266ea2
b327605414333bf9768b8bea6d64f68b
Register a callback to be invoked when a seek operation has been completed. the callback that will be run
public class MusicPlayer void onSeekComplete(MusicPlayer mp);
1
68c3c038da8ffe088cfdeb13f6193df0
ba2693b01397c9ab073af2788f223012
Returns whether model directory already has a PipXP table
{ $this->get_model_file(); if (file_exists($this->model_path.$this->model_file.'.php')) { return true; } return false; }
0
d9316e92317090daac17c7c5b80bf47a
4302742e62c7d2f419da80fbcdd5f85b
Visits a proto map field. Which is represented by a soy map.
public class Protobuf3BaseListener implements Protobuf3Listener @Override public void enterMapField(Protobuf3Parser.MapFieldContext ctx) { }
1
37d29c5b72efbe5c7e1b9b76c94743dc
83dae68e6182ee5b371a8b549c3847ae
Update the profile for the logged in user
class MPIData def update_profile mpi_service.update_profile(user_identity) end
1
9c63310ab2cf66fb485dbe9b7179c975
fc0c24f8e6c7d4c6113d8db7391bfad2
Register registers formatter for specified media type.
namespace GenHTTP.Modules.Functional.Provider public class InlineBuilder : IHandlerBuilder<InlineBuilder> public InlineBuilder Formats(IBuilder<SerializationRegistry> registry) { _Formats = registry; return this; }
0
0bb02738b818342f3370157827ea45a6
371b24916e298dd84dea3d63685dd95c
This method constructs the application data element. load information from database.
public HashMap<String, String> prepareData(hunelBaseForm form) throws SQLException { String S_C_CD = ehrbean.getCCD(); HashMap hmPreparedData = new HashMap(); ComboDS comboDS = new ComboDS(conn, request, response); hmPreparedData.put("BE130", comboDS.getCodeCombo(S_C_CD, "BE130",...
1
b14019bc9bdc534dde09f93fe1452565
f9a71744db608b4da2a54ad6ee2fa11a
Utility method to convert Flash friendly constructor info instances to JMX constructor info instances.
public class ConstructorsSourceImpl implements ConstructorSources private TypeConstructor createConstructorFrom(ConstructorDescription constructorDescription) { return TypeConstructorInstance.create(constructorDescription); }
0
44ba95a7cd8e0d8a4e129a53e622cd32
13eeb9cab85e13d359f324b9ab98daed
根据仪表类型,仪表编号,年份获取月度能耗值
BigDecimal getEnergyByYear(@Param("equipType") Integer equipType, @Param("year") Integer year);
0
18ecf994d12813fe1363d9088eb98a7e
6093b9a831a30f28acad281def19a30b
world_view上のキャラを削除。initCharaの前に
void CharaSellListLayer::initCharaSelect() { for (int i = 0; i < _chara.size(); i++) { if (!_chara[i]->getDeckUsedFlg()) _chara[i]->setColor(Color3B(255, 255, 255)); _chara[i]->getChildByTag(CharaSprite::T_Node)->removeChildByTag(T_Circle); } _sell_chara_list.clear(); }
0
660f3dd1104d87891df3dfb54b302c57
51b73cd0d3c7ed805d26de582e9b2d0c
Convert to Unix EOLs unless the original file was Windows encoded.
def dos2unix(str): return str.replace('\r\n', '\n')
1
7f7f7892e72a4979762bdf18b859070c
2a646a7e5b9614383d2fbd881bd521bb
Realiza a devolução de um empréstimo
public async Task<ActionResult<Emprestimo>> DeleteEmprestimo(int id) { var emprestimo = _context.GetEntityById(id); if (emprestimo == null) { return NotFound(); } await _context.Delete(emprestimo); return emprestimo...
0
d92e59612437a9e062e790368291c560
258af7ca0e9ec3a6cca813f6deb6a620
鼠标离开时延迟十秒后触发隐藏功能
onHide() { let that = this; clearTimeout(that.data.timer); }
0
d9e88129944f1f12716c3425008971e9
e0d796c76e73b32fefa9701ce9c84eaa
returns the single unique feature which has this tag
public function getFeatureByTag(string $featureTag) { return $this->features()->where('tag', $featureTag)->first(); }
1
716d6a54bbe0866fb37f67974387557a
6f7f4c2982880f3d35bd510176feba3c
Determines if a move is valid input: potential move to be made as an integer Ouput: Returns boolean corresponding to validity of move
def valid_move?(board, position) position = position.to_i position = position - 1 if position_taken?(board, position) || !(position.between?(0, 8)) false else true end end
1
3644bc3a8eafdc7e4a5528d4e5289f55
78abe124f2fd57ae53d70873ab1cb04a
<p> Description:获得未分配的订单提醒<br /> </p>
public List<Opportunity> getUnAssignOpp();
1
102d37fdfae8f940c7b09d15c036a06f
86ddd923a4b2b5f7d5d78184edea1e2d
Cambia el directorio raíz del TreeView Principal mediante un cuadro de diálogo de selección de folder. Si se presiona cancelar, el directorio no cambiará.
DialogResult result = BrowseFolderMonitorDialog.ShowDialog(); if (result == DialogResult.OK) { string dir = BrowseFolderMonitorDialog.SelectedPath; SetMonitorDir(dir); } }
1
6f9272415f1799bb0b6f6b18b8964960
ff204fd4288f8b0b7b544c2d724f52aa
Modify the cover page of the book. Add new if it doesn't exist before
if self.has_element('cover'): raise EPubError(f"{Path(self.file).name} already has a cover. Use \ set_cover if you want to change it") mime = mimetypes.guess_type(path)[0] if mime not in IMAGE_TYPES or not Path(path).exists(): raise EPubError(f...
1
dacf8db36a64b9112684fb8081c311a4
6c6537bb48ea3862f1318e5c33162b70
Reset the YM's state.
void setupYM2149(){ write_data(ADDR_NOISE, 0x00); write_data(ADDR_MIXER, 0x38); setVolumeYM2149(0x00); }
1
d53b14fd5a312340f8e260e1664d7796
d035bf7bab37206844334bd3842dd885
The path in the agent class loader from which to get the content for the resource.
String getResourceLocation();
1
cc34ed6abe0a4a2e8274de1850ce6e01
bb84bda1cc486e7612b17b7956b92f87
Generates confirmation email message text.
{ $templateName = $this->parameters['template']['confirmation']; $context = ['user' => $user]; $fromEmail = $this->parameters['from_email']; $toEmail = [$user->getEmail() => $user->getUsername()]; return $this->sendMessage($templateName, $context, $fromEmail, $toEmail); }
1
e61a44246522672285e1f6a18f481bca
80c2784134d6a241adbf901291b0c46e
Periodically refresh twitter results
class Articles extends Action public function publishTwitter(Request $request, Response $response, $args){ $ArticlesModel = new ArticlesModel(); if($this->app->twitter['api.frequence_execution'] > 0){ $from = date('Y-m-d', strtotime("-".$this->app->twitter['api.frequence_execution']." day") ); } ...
1
e6fcf699369d295078efca7c9ebe987f
2fdb13024942fdba93f82e4ae5fa7bbb
Run osprey-worker.
target = __file__ if target[-1] in ("c", "o"): target = target[:-1] data = self.module.dumps((proto, obj), proto) worker = subprocess.Popen([python, target, "worker"], stdin=subprocess.PIPE, stdout=subprocess...
1
f48a2fad539991ec13e575511a959771
91b5073bc95394c22d085e7be890f307
# возвращает прямых потомков
{ $a = array(); for ($i = 0; $i < $this->getSiblingCount(); $i++) { $a[] = $this->getSibling($i, $r); } return $a; }
0
a6339dddc1deba3195d253d7e79ee6ae
05e64abff698d06510091d1f1adfec71
Convert a test result status in to a number.
function statusStringtoInt( status ) { var statusInt = -1; if ( 'locked' === status ) { statusInt = 0; } else if ( 'unlocked' === status ) { statusInt = 1; } return statusInt; }
1
d42ba3d0b8ee69915c007d89c9b8bbc0
1e38a2b41e5e4f83ff31801243c47550
Returns the index of the second fastest time in an input array.
def faster_solution(a) i = 0; length = a.length min_average = (a[0] + a[1]) / 2.0 position = 0 return 0 if length==2 for i in 2...length do temp1 = (a[i-1] + a[i]) / 2.0 temp2 = (a[i-2] + a[i-1] + a[i]) / 3.0 if (temp1 < min_average) position = i - 1 min_average = temp1 end i...
0
410fbfead101e71a3b3d560b7cc2d3e0
a2dae1fea5f7140c60f13e2034cebd5c
Returns true if the log entry is out of the selected range date
return !this._max ? true : this._max && this._util.getMonthDistance(this.date, this._max) > 0; }
1
5837801f80e246e7af13bd18b1008f53
03f728fe736feb21b93cbe43897787e4
Parse partial query.
clauses = [] for partial_string in partial_strings_array: stripped_partial_string = partial_string.strip() if stripped_partial_string: clauses.append(field.like('%' + stripped_partial_string + '%')) if len(clauses) == 0: return None elif len(clauses) == 1: ret...
1
dc68f01947b34fa8e46903e0205b2052
ca1077fd2f0ddc3fca24879a7d6f2249
각종 메세지를 팝업으로 표시한다.
{ switch (MessageType) { case PopupMessageType.Error: lblMessagePopupHeading.Text = Resources.Resource.CONTROL_MESSAGE_TYPE_ERROR; ltrMessagePopupImage.Text = "<img src='" + Page.ResolveUrl("~/images/error.png"...
1
afe6bc0ac9edb94e8a4230ad14c06a68
573f12df848a5456338cb8bbac5e614d
缓存查询 xml结果解析成 Purge对象的列表
class PurgeApi(object): def purge(self, purgeBatch, domainId=None): if domainId is not None: url = self.HOST + "/api/purge/" + str(domainId) else: url = self.HOST + '/api/purge' try: if domainId is not None: post = purgeBatchForOneDomainToXml(p...
0
9e022fe814604f1637743cf42442ff00
5e82c958ecb33bd9b5284a7a31019f10
Test count for empty collection.
{ const pointer_uint_q EXPECTED_COUNT = 0; QBinarySearchTree<int> TREE(3); pointer_uint_q uCount = TREE.GetCount(); BOOST_CHECK_EQUAL(uCount, EXPECTED_COUNT); }
1
4360f607b3188ed8f8bf17b7f3cb49e1
a5fac6e3dbdfcaaa08b0304d2facefb0
Returns an <see cref="IntPtr"/> pointing to the start of the method's jitted body.
namespace System.Reflection.Emit public sealed class MethodBuilder : MethodInfo internal byte[] GetBody() { return m_ubBody; }
0
c0b8cf4440f7423abbcfc3f57362ea9b
19b011890364a77a03ca6ab78de8c257
Retrieves a line of text from the document.
public class TextSelectionUtils public static String getLine(IDocument doc, int i) { try { IRegion lineInformation = doc.getLineInformation(i); return doc.get(lineInformation.getOffset(), lineInformation.getLength()); } catch (Exception e) { return ""; } }
1
71370114c475b0af2047147bb6c72624
e165eb5a1c875dcb05bcd944e98dda72
构造函数实例化编译类Compile
class CompileReact public function __construct(Config $config) { $this->config = $config; }
1
e042ba02cbcd65944a375e07b92ec346
26bfc74f729bf748f1d76f31ff92e0ca
Find the two tangent points on the circle that form lines to point <paramref name='b'/>.
public static (double a, double b) GetLinearPolynomialFromLinearBezierAndPoint( double aX, double aY, double bX, double bY, double x, double y) { var t1 = (aX * aX) - (2d * aX * bX) + (bX * bX) + (aY * aY) - (2d * aY * bY) + (bY * bY); var t0 =...
0
f4627c9a18334a10ead8d592a2b96fdc
a6171693a68b43275478288908e975e8
keyEq does case-insensitive comparison of ASCII strings.
func CaseInsensitiveEquals(firstString, secondString string) bool { return strings.ToLower(firstString) == strings.ToLower(secondString) }
1
d303835365b707460c9f184d5f24d09c
e43ab8aeef9a628f73e3909abff1d032
Atualiza se a empresa entrega material medico(se pode ou nao entregar).
public class VoluntarioMedicamentos extends Voluntario implements VoluntarioMedicamentosI{ public void aceitaMedicamentos(boolean state){ setDisponivelParaMedicamentos(state); }
0
1dd3481528f0da5a4651520ecb96da14
706f4e08670889cd2d3df1ad3a169407
Tests if the method detects a address request with a missing zip code field
class AddressModelViewTest(TestCase): def test_post_invalid_address(self): data = { "address_nickname": "New York Headquarters", "country": "USA", "address1": "156 Street Way, New York, NY 67809", "city" : "New ork", "postal_code" :...
0
cfecadd70a8535b96cef1107fca079b3
56dd3be3de265982e7742fa9e09ac68d
Create config interactively
def create_config() -> Config: det_bg = termenv.get_background_color() det_ansi = termenv.detect_ansi_mode() asc = get_distro_ascii() asc_width, asc_lines = ascii_size(asc) logo = color("&l&bhyfetch&~&L" if det_bg is None or det_bg.is_light() else "&l&bhy&ffetch&~&L") title = f'Welcome to {logo}...
1
0aa471ef4540a5a03c67b1d08c779736
7d32077b10c3e6b69773604c37341f99
Devolve os dias uteis entre dois periodos tendo em conta feriados e fins-de-semana
namespace Milaneze.Helpers public static class Utilidades public static IEnumerable<DateTime> GetFeriados(DateTime dataInicial, DateTime dataFinal, bool contarCarnavalComoFeriado, bool contarTodosDiasCarnavalComoFeriado, bool contarCorpusChristi) { for (int i = dataInicial.Year; i <= dataFinal.Y...
0
2779ee16d984a9cc758dc2c87ab4ac2f
2f90909eb5a3101d340972743d316563
增加奖品数量
int add_gift_zy( int gift ) { return set_gift_zy( GiftZY + gift ); }
1
d9701c6386e2966c5af00ead2f80b7ae
5a7a427fee5c18b0e5a791bcf9744c1a
定时赛更新玩家积分
namespace Com.Glassblade.Group1 public class OMode : MonoBehaviour void Update () { playerCnt = hostPlayer + guidePlayer; if (!stoped) { if (currentTime > 0) { currentTime -= Time.deltaTime; } ...
1
e1e7d0b91a374bc7389ca8386887abc1
e451bdadebe0833bd446b4dd7091a1d8
Compare two primitive floats for equality
namespace TGC.Tools.MeshCreator.EditablePoly public class EditablePolyUtils public static bool equalsFloat(float f1, float f2) { return FastMath.Abs(f1 - f2) <= EPSILON; }
1
44e028e08128a37d1780e7b2b4ff5497
8d10efc007e48219ee7116060baa7416
rewrite!!
class DataRewriter: def rewriteData(self, start=1, train=True, header=True): fn = "train.csv" if train else "test.csv" fin = open(fn, 'rb') fout = open("data_" + fn, 'wb') if header: ocolnames = ["invited", "user_reco", "evt_p_reco", "evt_c_reco", "us...
1
5001a71237b28133f161e39f120aa34a
8852cda630790b78c63227126d5be0cb
Adds labels to the training data images depending on how the trainer should perceive them. It uses 1 for images to be considered correct and -1 for the opposite.
for i in range(len(labels)): if labels[i] == -1: first_minus = i break face_weight = float(0.5) / first_minus background_weight = float(0.5) / (len(examples) - first_minus) return [float(0.5) / first_minus] * first_minus + [float(0.5) / (len(examples) - first_minus)] * (...
0
8a7568d04918b99df604a7186a7b71e9
51fe12c2fd72ade10b0572ad96a6e6b2
Create new instance of object which is used for managing revision inside the specified directory.
class RevisionPrinter public function __construct(DateHelper $date_helper, OutputHelper $output_helper) { $this->_dateHelper = $date_helper; $this->_outputHelper = $output_helper; $this->_resetState(); }
0
945aa59737d23a3c633bb5d2a3212e79
176e97ab8dbaf876732c90b71268a753
Handles clicks on the start button in Welcome screen.
class StartScreen(tk.Frame): def start_button_click(self): if self.player_name_entered.get().strip(): self.master.player_name = self.player_name_entered.get() gm.start_game(self.master.player_name) self.master.update_variables() self.master.button_sound() self.master....
1
9a6330a8d304ebc1f3b5e20aa81c7f47
2713cea3466e01d3ef30af9c620a770d
Inserts a process and its IO Burst amount at the end of the linked list of processes in IO burst mode
void insert_new_process(int process_id, int computing_time, int process_priority){ queue_pointer new_process = initialize_process(process_id, computing_time, process_priority); _insert_at_head(new_process->priority, new_process); }
0
f8a8e1580c3255d151dc6dfb55ed2c50
7694e58e2fb995cd378c98199a2b4ef8
添加联盟boss组基础数据
local hfuben = Fuben.createFuBen(conf.fbid) if getPkMode(conf) == PkMode.belong then Fuben.setBelong(hfuben) end local ins = instancesystem.getInsByHdl(hfuben) if ins then ins.data.id = conf.id ins.data.bossid = getBossId(conf) ins.data.type = conf.type ins.boss_info = {} else print("worl...
1
c3790e48a5bec2491de7d28e949889d0
3a0775d98e0aea9321cbef46a3de3e0c
Delete Event Control from Event Controls list
public class SampleController @FXML private void deleteEvent(ActionEvent e) { eventList.getItems().removeAll(eventList.getSelectionModel().getSelectedItem()); }
1
75a71e352b6ec6463cf551f071134c57
66849378d4d0c020f73f78b050d0797f
The delayed *initialisation* method for planner visualiser.
class KlamptPlannerVisualiser(BasePlannerVisualiser): def init(self, **kwargs): super().init(**kwargs) if self.planner_data_pack is not None: if self.planner_data_pack.visualise_klampt_paint_init is not None: self.planner_data_pack.visualise_klampt_paint_init( ...
1
7e8207629b3ee487f4972d17a2b51ece
95828342eebc9d21f16bbe64f7b87bde
check if device network is fully usable.
namespace MyCensus.Droid.Services public class NetworkConnection : INetworkConnection public bool isNetlocUsable(Context context) { return isNetLocEnabled(context) && confirmAirplaneModeOff(context) && isWifiConnected(context) && isMobileConnected(context); }
1
e50400ea6c527f325daeea8cc1f7af09
64fa05b0b19cea170c6dcb54e0d638d3
Use for attribute searching as primary key, forcing exact matches.
self, attribute_name, attribute_value, candidates=None, typeclasses=None ): cand_restriction = ( candidates is not None and Q(pk__in=[_GA(obj, "id") for obj in make_iter(candidates) if obj]) or Q() ) type_restriction = typeclasses and Q(db_typeclas...
1
212baa30a8ef30f526a25dfa40f80bdf
9de698df7cfc959fa6b500805dadc150
Maps the interfaces of the provided <paramref name="implementationType"/>.
{ if (!this.mappings.TryGetValue(implementationType, out var invokerMap)) { invokerMap = mappings.GetOrAdd(implementationType, CreateInterfaceToImplementationMap(implementationType)); } if (!invokerMap.TryGetValue(interfaceType, out var interfaceTo...
1
fa7ef5cf8d037654b59e702c07c00842
4bc479139fc0edf48ce1768b6d9cd070
check if the VM execution state has changed. Useful on resume.
def has_state_changed(current_state): global last_state if current_state != last_state: last_state = current_state return True last_state = current_state return False
1
c41b79f883d67c137ec5e376c2e35f3c
b5473bcc9903cdb7cf79a53aee1cda51
# The dropping of highly collinear variables, based on Variance Inflation Factor:
removeVariablesWithHighPvalue <- function(model,data){ variablesHighPvalue <- names(summary(model)$coef[,4][-1][which(summary(model)$coef[,4][-1] > PVALUE)]) allvariablesModel <- names(summary(model)$coef[,1])[-1] newVariables <- allvariablesModel[!(allvariablesModel %in% variablesHighPvalue)] f <- as.formula( ...
0
ed0a8c723260d03573e95a9f824e7ddd
6a5abfc44bf95b5de440747d140c3ea0
Декодируем изображение и записываем его в файл.
class work(object): def dpicture(self, img_path, wm_path, res_path, password): self.pdecode.decoder(img_path, wm_path, res_path, password)
1
2a4b871f28e0889877ab9b0e7d13e086
02f1496202293a9d9f210211d4165831
Test signal set management.
saw = {} def on_settings_saved(*args, **kwargs): saw['signal'] = True settings_saved.connect(on_settings_saved, sender=self.extension) self.settings['test_new_key'] = 'Test new value' self.settings.save() self.assertIn('signal', saw)
1
f092d48541a9399898446ea44b8cf220
09f3f9d4dc05b86a956968f931f49768
把前端传递过来的数据进行散列加密 强度为10
async encrypt(req ,res, next){ req.body.passwd = await bcrypt.hash(req.body.passwd, 10); return next(); }
1
b5e7d4483e01db4c9ee2149e01dd8e5e
3b14c9396623abee2060c3e2a9c64263
for users to input information about PCB (process order, arrival time & burst time)
cout << "Enter the probability of pcb generated" << endl; cin >> probability; cout << "Enter the priority levels" << endl; cin >> priority_level; cout << "Enter the file name with file extension" << endl; cin >> filename; cout << "Enter the simulation time" << endl; cin >> simulationTime...
0
bd927715152b6d3a288dce696c38a329
c0b32d18fa4136386ea94e34867cb803
Test the api has machine creation capability.
public void testCreatePositive() { MachineType machineType = new MachineType("Type"); machineType.save(); MachineTemplate node = new MachineTemplate(); node.setName(NAME); node.setCapacity(100); node.setMachineType(machineType); Http.RequestBuilder request = new Http.RequestBuilder().method(PUT).session(...
1
78e09b4203ffb947340424959d2eaa00
54a025ce7532697751cfce1e4e49f61b
在层表中添加记录,并返回层表记录
public class LayersAdapter extends BaseExpandableListAdapter void addLayer(boolean isAdd, GeodatabaseFeatureTable geotable,String gname,String cname);
0
9d65836ecdf4a2e792eca940064638b1
4554d673d403528ed8726b4060ca7018
Compute radii using the contour method.
radius = [] for c in contours: area = cv2.contourArea(c) equivalent_radius = np.sqrt(area/np.pi) radius.append(equivalent_radius) radius = np.array(radius) return radius
1
ad957f413d49166034e04b19f9b9d730
6a81927e3eefa687f2c4e38d41d750ae
Generates code to exit the monitor on an object loaded on the stack.
public class GeneratorAdapter extends LocalVariablesSorter public void monitorEnter() { mv.visitInsn(Opcodes.MONITORENTER); }
0
89bf92c3b9c57b1427c2f2ead91b4051
0da5a48e919389a5f843d998e40c18bb
Emulates the end of a horizontal blanking period.
void atarigen_state::halt_until_hblank_0(device_t &device, screen_device &screen) { int hpos = screen.hpos(); int width = screen.width(); int hblank = width * 9 / 10; if (hpos >= hblank) hblank += width; device.execute().set_input_line(INPUT_LINE_HALT, ASSERT_LINE); timer_set(screen.scan_period() * (hblank - hp...
1
5d493657b8a95460efd69b628252c78a
626a51f1fbb4f6b5aff6722acf83ab6f
la funzione crea una stanza all'interno dei valori in input
static void inizializzare_nuove_stanze(struct Stanza *stanza_attuale, struct Stanza *stanza_prec){ stanza_attuale->avanti=NULL; stanza_attuale->sinistra=NULL; stanza_attuale->destra=NULL; stanza_attuale->stanza_precedente=stanza_prec; stanza_attuale->info=tipo_stanza(); stanza_attuale->emergenza_chiamata=fa...
0
1e70c06a97f8798a3ae8a36424969010
f5de61e092ad14cfc696fd7c1ee16a4e
Resume normal movement speed and toggle Attack off
public class PlayerSkillsAttackScript : MonoBehaviour public void Skill03_IsOver () { anim.SetBool (AssassinHashIDs.HashID_isReady_Skill03, false); playerMoveScript.moveSpeed = playerMoveScript.originSpeed; anim.SetBool (AssassinHashIDs.HashID_IsInSkillState, false); }
1
d340c3efe80d0b5b5ccce6e8b3264a85
72d953bd3df980ade981743074403e76
保存网页字节数组到本地文件,filePath 为要保存的文件的相对地址
if(data == null || TextUtils.isEmpty(filePath)) { return false; } InputStream in = null; OutputStream os = null; byte[] buffer = null; File file = new File(filePath); boolean result = true; try { if(file.exists()){ file.delete(); } file.create...
1
10d89fa75c29c6b6528ecac3732a772a
7f61448ad6da3ef0f9cb03f40c5be655
adapted from Raymond Chen: http://blogs.msdn.com/b/oldnewthing/archive/2005/05/05/414910.aspx
cases like (1)
0
470422e4aaa27b8b2b55d115d006284d
cae7842db2d659a406de6328609a6af5
ゲーム開始演出(レディー表示)
{ myredyBoard->show(); scoreBoard->move(-350,100); birds->move(60,250); replay->move(120,-400); createPipe(); birds->setRale(-50); gamemod=redy; scoreLCD->setValue(0); thisGround->play(); birds->play(); }
1
280864e3c9146aef567abc98a59b15b3
96f14cf4d2e9611fd60b5c86a43fafbd
Unwrap timestamps into one nondecresing series
def simplify_timestamp(timestamps): return [timestamp_to_time(timestamp) for timestamp in timestamps]
0
bb56fc27406aaddedbee047c14fc519f
618373ff8a410a0d3749ef39ed330116
runs the prime generator menu
int main() { choice(); return 0; }
0
d07214b791f025c0178e58637224b4ee
ad32d52b92881ac9f6471ee840ef25cb
Returns the width in pixels of the user interface for the calling SageTV UI context. the width in pixels of the user interface for the calling SageTV UI context 5.1
ZPseudoComp uiComp = getUIComp(stack); if (uiComp != null) { return new Integer(uiComp.getWidth()); } return null; }
1
b586f8f54823651cf7dde94577833ec5
e6532c06fb9965084b15692ae847b64e
checks that reader-level statistics are the same
local_path = self.reader.get_cache_file_path(**self.kwargs) if os.path.exists(local_path): os.remove(local_path) df_1 = self.reader.read(**self.kwargs) time_1 = last_modified_time(local_path) time.sleep(self.sleep_seconds + 0.01) df_2 = self.reader.read(**self...
0
a1e31ff53fa90d909025d950518d6cf7
c027e2cca9b570f938c0ea64bb6ee236
Triggers the ES update on related models
@Service @RepositoryEventHandler public class QuestionService @HandleAfterCreate @HandleAfterSave @HandleAfterDelete public void onRelatedPublicationChanged(RelatedPublication relatedPublication) { List<String> questionIds = relatedPublicationChangesProvider.getAffectedQuestionIds( relatedPublication....
1