Posts

Showing posts from July, 2013

c# - Problems when P/Invoking CertCreateSelfSignCertificate -

i following this article (in there link .cs file @ bottom of page) generate self-signed x509certificate2 . code in article works want extend it. trying pass optional argument, _in_opt_ pcrypt_algorithm_identifier psignaturealgorithm , certcreateselfsigncertificate . i have created structure it: struct cryptoapiblob { public int32 cbdata; public intptr pbdata; } struct cryptalgorithmidentifier { public string pszobjid; public cryptoapiblob parameters; } the code trying use create is: cryptalgorithmidentifier algorithm = new cryptalgorithmidentifier { pszobjid = "szoid_nist_aes256_cbc", parameters = new cryptoapiblob { cbdata = 0 } }; algorithmpointer = marshal.allochglobal(marshal.sizeof(algorithm)); marshal.structuretoptr(algorithm, algorithmpointer, false); i pass algorithmpointer method. i error when try pass certcreateselfsigncertificate : an unhandled exception of type 'system.runtime.interopservices.comexception' occurred...

c# - Regex blocks of permutations -

thanks kobi resolve problem of checking permutations without repetition given string "abbc". solution (?:(?<a>a)|(?<b>b)|(?<c>c)){4}(?<-a>)(?<-b>){2}(?<-c>) the expression has have 1 "a", 2 "b" , 1 "c" in 4 consecutive characters. now need more complicated, need check expression 2 blocks of permutations: in first 6 positions has find permutations of "abccc" adding each 1 character in 3rd position can of them (a, b or c). in second block has find permutations of "abccc" i don't know if have explained myself well, but: for first 6 positions has have 1 a, 1 b, 3 c , in 3rd position value (a,b or c) no matter order except 3rd position can any for next 5 positions has have 1 a, 1 b , 3 c no matter order. i'm trying explain best way possible. i'm sorry looked copy-paste not. the regex i'm looking "abxccc-abccc" x a, b or c , - separate 2 blocks...

database - Retrieve data from Db set by combobox and display to textbox -

this code s2="select notes atotalno =" + combobox1.selecteditem +"" dim cmd oledbcommand=new oledbcommand(s2,myconnection1) cmd.commandtext=s2 textbox1.text=convert.toint32(cmd.executescalar()).tostring() and getting following error:- erorr: data type mismatch in criteria expression apply tostring() on selecteditem , why convert result set integer, if want show in textbox? try this, s2 = "select notes atotalno = "& combobox1.selecteditem.tostring() &"" dim cmd oledbcommand = new oledbcommand(s2, myconnection1) cmd.commandtext = s2 textbox1.text = "" & cmd.executescalar() here resultset concatenated empty string make whole string. if column atotalno of type varchar decorate selecteditem value single quotes. like, s2 = "select notes atotalno = '"& combobox1.selecteditem.tostring() &"'" hope helps thanks.

html - InnerHtml of div is always empty -

i have next html : <div class="output"> <div id="divinternet" runat="server" class="issue"> <!--this message shows regardless of choice--> <p> if operate service connects internet , intend collect any... </p> </div> </div> on server side try innerhtml of div id divinternet : var q1text = divinternet.innerhtml; but q1text empty. i try add attribute runat="server" inner p throws exception innerhtml must literal. expected result - want <p> , content: <p> if operate service connects internet , intend collect any... </p> what have missed? upd: didn't mention on start, think important. more detailer content of div : <p> if operate service connects internet , intend collect <a href= "<%=project.core.common.publisherconfigurationmanager.navigation%>privacy/faq.aspx#16...

c++ - Filling a std string with memcpy does not set length -

i have following code fill std::string curl response. struct curl_string { std::string tmpstr; size_t len; }; void init_string(struct curl_string *s) { s->len = 0; } size_t writefunc(void *ptr, size_t size, size_t nmemb, struct curl_string *s) { size_t new_len = s->len + size*nmemb; s->tmpstr.reserve(new_len + 1); memcpy(&s->tmpstr[0] + s->len, ptr, size*nmemb); s->tmpstr[new_len] = '\0'; s->len = new_len; return size*nmemb; } the problem is, though reserve correct length, when try read string, size still 0. i wanted avoid using loop add 1 character @ time. there way still have correct string length in std::string ? your problem std::string::reserve reserves memory characters, doesn't alter length of string. size isn't recalculated when underlying buffer modified, because near-impossible detect in cases. the solution use resize instead of reserve : s->tmpstr.resize(new_len + 1...

Iterating json response from google api using python -

i took nearby location google api , json, when try split json receive error { u'status':u'ok', u'next_page_token':u'coqc9aaaahepdlfivauuqz6y6wwaskbmq5aaoyr0bbu97upcmy4ei1ea5t-6s6iobzdz5_rib7ywocdg-lf9ian5jrutqvgl7mwbba_un3efs7xzjmlvx-iksauieio-wu3r25zk9sl3yc5d_vdgvn3vqjka7bbidwhkloj4rfngjbsgvwvqonj5glrbwvvrw9nu6dni70c2wdqqy_65b_jfjjijytawrlfoyl7ggpxk5gng7qgsfdttjii9zdfkxcj3osuzklretjradtgfaqgxr0ka_h5btbuxz3ut6r-dyqdj2qd1tr_0oavfkgb9t0qfbuyse7bdeteawddv7msmmxeyhqusemcbruhu5pb8x4eopbpw9ncaflgqttickqygyy-boaj1_3x3saet', u'html_attributions':[ u'listings <a href="http://www.indiacom.com/">indiacom yellow pages</a>'], u'results':[ { u'name':u'institute financial management , research', u'reference':u'cpqbgwaaal5gg4t18lzupntezvkweah0jlbutyc_rmxoycl3kndgq05wvkovvhiiyhnnqeoxcx1tcwesii0vsvwugaskyy2unj_brtd5zblxzd7nlxp9l-foqletrgbpa6dlnzhm6nmcu3jtjibaoymq...

jquery - Carousel not working in ractive template -

home/index.ract <div class="row owl-carousel owl-theme row"> {{#featured}} <div class="column small-12 medium-6 large-3 pan item"> <a href="{{ link }}"> <div class="griditem boxshadow"> <div class="item-content"> <h1 class="title">{{ title }}</h1> <p class="byline">by {{ subtitle }}</p> </div> </div> </a> </div> {{/featured}} </div> layout/index.ract <!doctype html> <head> <link rel="stylesheet" href="/owl.carousel/owl-carousel/owl.theme.css"> </head> <body> <main> <cromly:content /> /***ractive component**/ </main> <script type="text/javascript" src="/jquery-1.9.1.min.js"></script> <script type="t...

c# - IDynamicMetaObjectProvider set property using literal name -

i need set dynamicobject property using string propertyname. found way property value using answer , when comes setvalue i'm not quite sure how rewrite code in order set property. receive runtime errors , not quite sure expressions logic. wonder if can suggest idea how implement void setproperty(object o, string member,object value) method. in cases expandoobject , can use idictionary<string,object> api instead: expandoobject obj = ... var dict = (idictionary<string, object>)obj; object oldval = dict[membername]; dict[membername] = newval; in more general case of idynamicmetaobjectprovider : borrow callsitecache fastmember: internal static class callsitecache { private static readonly hashtable getters = new hashtable(), setters = new hashtable(); internal static object getvalue(string name, object target) { callsite<func<callsite, object, object>> callsite = (callsite<func<callsite, object, object>>)ge...

linux - How to change ulimit in CentOS6 -

i using centos6.6 , trying install hdp2.2 when do: ulimit -sn value 1024 when do: ulimit -hn value 4096 the recommended maximum number of open file descriptors 10000 , or more. i trying increase value. have checked several link , trying follow steps not getting success. looking increase value. centos different rhel5, need modify file /etc/security/limits.conf , add follow sentences end of file: * soft nofile 655350 * hard nofile 655350 then, relogin system ( very important ). gook luck.

How to update ACL of a file in Google Cloud Storage using Java API -

i trying upload image google cloud storage , add acl of allusers reader java code , question public static storageobject uploadsimpleimageandmakeitpublic( storage storage, string bucketname, string objectname, inputstream imagedata) throws ioexception { inputstreamcontent mediacontent = new inputstreamcontent("image/png", imagedata); storage.objects.insert insertobject = storage.objects().insert(bucketname, null, mediacontent).setname(objectname); insertobject.getmediahttpuploader().setdisablegzipcontent(true); storageobject uploadedimage = insertobject.execute(); // new acl make public objectaccesscontrol publicaclitem = new objectaccesscontrol(); publicaclitem.setentity("allusers"); publicaclitem.setrole("reader"); uploadedimage.getacl().add(publicaclitem); // how update acl ??? // , how fetch public url ?? } i using: <dependency> <groupid>com.googl...

How to load Drools Rule From DB -

i trying load drool rule file database. how can fire rule? kbuilder.add( resourcefactory.newclasspathresource("myrule.drl"), resourcetype.drl ); provide content of rule db (jdbc etc.) , store in variable. (before kie drools) in kbuilder. string rulecontent; // fill db in diffrent method/aspect knowledgebase kbase = knowledgebasefactory.newknowledgebase(); knowledgebuilder kbuilder = knowledgebuilderfactory.newknowledgebuilder(); resource r = resourcefactory.newreaderresource((reader) new stringreader(rulecontent)); kbuilder.add(dsl, resourcetype.drl); if (kbuilder.haserrors()) { log.error(kbuilder.geterrors().tostring()); } kbase.addknowledgepackages(kbuilder.getknowledgepackages()); statefulknowledgesession ksession = kbase.newstatefulknowledgesession(); // prepare fact object ksession.insert(factobject); ksession().fireallrules()

php - How to get response from server every second in JSON? -

i want response server every 1 second, output contain value need process in front end. in backend using queries read data mysql , return me output. things have tried: ajax webserver events amazon cloudfront none of these work me. takes 3-4 seconds me response, classic example see working (getting output in 1 sec) http://madbid.com please let me know if has solution this

asp.net - Web.config file debug="true" setting -

i have run issue when web application's web.config compilation debug set true getting vulnerability error on security scan. what want determine if there way have type of web.config conditional block change debug setting use correct value on debug builds , release builds. have read setting property in each web page , don't know if in fact true , there problems this? i suggest <deployment retail=”true”/> . you put this element machine.config on production server , overrides debug=”true” in web.config , pages. in other words, can happily use debug , trace functionality on developer machines can sure turned off on production server. scott guthrie recommends best practice.

javascript - Making JQuery function Plain JS -

this question has answer here: uncaught typeerror: object #<nodelist> has no method 'addeventlistener' 3 answers hey have following function works great in jquery, many reasons require in plain js. $('audio').on("play pause ended", function () { document.title = document.title.replace("\u25b6", "") $("audio").each(function (index) { if (!this.paused) { document.title = "\u25b6 " + document.title.replace("\u25b6 ", "") return false; } }) }); i've attempted convert plain js (see below) it's coming following error: typeerror: undefined not function (evaluating 'sound.addeventlistener') var sound = document.getelementsbytagname('audio'); sound.addeventlistener('play pause ended', function () ...

AngularJS: Cannot get my directive working -

i'm in second day of learning angularjs , have simple example of how change dom on user's action, somehow not work me. here examlple: html file: <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="../scripts/angular.min.js"></script> <script src="../scripts/controllers/app.js"></script> <script src="../scripts/jquery-1.4.1.min.js"></script> </head> <body ng-app="myapp"> <my-widget> <p>hello world</p> </my-widget> </body> </html> file directive's action: var app = angular.module('myapp', []); app.directive("my-widget", function () { var linkfunction = function (scope, element, attributes) { var paragraph = element.children()[0]; $(paragraph).on("click", function () { $(this).css({ "background...

vb.net - Get an item's id from an array and remove it from the array -

so need item's position in array , remove array. names = {"bob", "jeff", "harry", "carl"} i ask "jeff" example , output 1. i going using item's position remove same position in array. sorting algorithm need code (without array.sort(names) ) if there better way appreciate it. you can "remove" array, it's not call efficient. have resize array.resize , believe in background recreates it. dim arrnames string() = {"bob", "jeff", "harry", "carl"} dim snametosearchfor string = "jeff" integer = 0 arrnames.count - 1 'make sure you're not trying set last value in array if <> arrnames.count - 1 arrnames(i) = arrnames(arrnames.count - 1) end if 'resize array removing 1 , exit loop array.resize(arrnames, arrnames.count - 1) exit next like said, it's not ideal, works. as alternative, might same ab...

MySQL: insert new column into a table with default value from other table -

i want add new column 1 table default value other table's column. 1st table 'sensors' ------------------------------------------------------------- id sensorid location city country userid ------------------------------------------------------------- 2nd table sensordata ------------------------------- id sensorid datavalues ------------------------------- i want add column in sensordata table default value of location sensorid same. how can that? something this alter table `sensordata` s add `location` varchar( 200 ) not null default (select location sensors s s.sensorid = d.sensorid) after `datavalues` please don't tell me why need have duplicate data, there reason :) you need in 2 steps step1 alter table `sensordata` add `location` varchar( 200 ) ; step2 update sensordata sd join sensors s on s.sensorid = sd.sensorid set sd.location = s.location updated: have done , works fine alter ta...

javascript - W3 Total Cache Navigation Hover Disappeared -

i minified , tried optimize js , css code on site, took away navigation drop down when hovering. reverted of changes cannot life of me reappear. whats more odd showing in firefox not ie or chrome. `` .left_nav { border:1px solid #a6e3fc; padding:2%; background-color:#f4fcff; } .left_nav ul { list-style:none; padding:0px; margin:0px; } .left_nav ul li { padding:3% 0; margin:0px } .left_nav ul li { font-family:"latoregular"; font-size:1em; text-decoration:none; color:#45cbfe; } .left_nav ul li a:hover { text-decoration:underline; color:#01b8fd; } .mid_area { border:1px solid #a6e3fc; padding:2%; } } .sub_nav1 { margin:0px 0px; height:30px; border:1px solid #a6e3fc; background-color:#f4fcff; } .sub_nav1 ul { padding:4px 20px; margin:0px; } .sub_nav1 li { list-style:none; float:left; padding: 0px 10px; border-right:1px solid #01b8fd; line-height:18px; } .s...

swift - IOS pushViewController without tabBar and navigationBar -

how can switch new view tabbarcontroller , navigationcontroller , there no tabbar , navigationbar in new view? , need working swipe right old view. self.navigationcontroller?.pushviewcontroller(view, animated: true) you can hide in new view navigation bar in viewwillappear method i.e. navigationbar call [[self navigationcontroller] setnavigationbarhidden:yes animated:yes];

.net - Designing a way to audit changes to tables -

i want able audit activity performed on db tables (updates, inserts etc). effective way design this? 1 solution have in mind have audit table every table , use sql triggers insert previous value before table updated new value. sql server version 2008 include built-in option looking for. named cdc or change data capture. can more information in bol (officially book-on-line) in first link or blog in sec link: https://technet.microsoft.com/en-us/library/bb522489(v=sql.105).aspx https://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-(cdc)-in-sql-server-2008/ there other options can use. in order choose best option need more information on system. if (1) can describe system architecture, , (2) information want store in auditing (do need user name or audit data self), (3) need keep history or events, (4) temporary needs or part of database structure (cdc create elements triggers , not fits temporary audit, better use extended event or profile...

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

i'm running nodejs 0.12.3 - gulp 3.10.8 , gulp-nodemon 2.0.3. gulpfile.js : gulp.task('serve', ['build'], function() { gulp.start('fb-flo'); nodemon({ script: paths.server, env: { 'node_env': 'development' }, // env: { 'node_env': 'production' }, execmap: { 'js': 'node_modules/babel/bin/babel-node --stage 1' //es7 cote server }, delay: '0ms', watch: ['src/shared/', 'src/server/'], ignore: ['src/shared/components'], tasks: function (changedfiles) { var tasks = []; changedfiles.foreach(function (file) { if (path.extname(file) === '.jsx' && !~tasks.indexof('bundlejs')) tasks.push('bundlejs'); if (path.extname(file) === '.less' && !~tasks.indexof('compileless')) tasks.push('compileless'); }); return tasks; } ...

graph databases - neo4j Nodes Deleted (but not Actually) -

i delete nodes of label executing match (p:alabel) delete p; this returns comment "no data returned." states how many nodes deleted, , how long took (5767 ms). however, shell seems stop responding after this, , unable execute other commands. i used command, encouraged this answer : match (n:alabel) optional match (n)-[r]-() delete n, r; executing command took longer (16929 ms). still not return. depending on amount of changes need choose appropriate transaction size, otherwise you'll see excessive garbage collections and/or oom exceptions. use limit clause , return number of deleted nodes. run statement multiple times until 0 returned: match (n:alabel) n limit 5000 optional match (n)-[r]-() delete n,r return count(distinct n) here batch size 5000 nodes.

javascript - How can i collect 4 small triangle shapes to make a big triangle? -

Image
i want make image background triangle made gathering 4small triangles,like image how can make collection of triangle image background shapes?! .block { width: 0; height: 0; border: solid 20px; float: left; } .clear { clear: both; } .top { margin-left: 38px; } .top .left { border-color: transparent green green transparent; } .top .right { border-color: transparent transparent green green; } .bottom .left1 { border-color: transparent red red transparent; } .bottom .mid1 { border-color: blue blue red red; } .bottom .mid2 { border-color: blue purple purple blue; } .bottom .right1 { border-color: transparent transparent purple purple; } <div class="top"> <div class="block left"></div> <div class="block right"></div> <div class="clear"></div> </div> <div class="bo...

wpf - XAML Dependency Property vs Regular Properties -

if have this: public class boardcalc : frameworkelement { public boardcalc() { this.loaded += boardcalc_loaded; } void boardcalc_loaded(object sender, routedeventargs e) { boards = math.floor(lengthrequired / 16); boardsrequired2 = math.floor(lengthrequired / 16); } public double lengthrequired { get; set; } private double _boards; public double boards { { return _boards; } set { _boards = value; } } //public double boards //{ // { return (double)getvalue(boardsproperty); } // set { setvalue(boardsproperty, value); } //} //// using dependencyproperty backing store boards. enables animation, styling, binding, etc... //public static readonly dependencyproperty boardsproperty = ...

Batch command 'for' is not working -

i have following line: for %i in (bin\setup) if not %i == setup.exe del %i this pretends delete files in bin\setup except 1 called setup.exe , it's not working... any ideas on i'm doing wrong? for %i in ("bin\setup\*") if /i not "%~nxi"=="setup.exe" echo del "%~fi" changes made: wildcard included enumerate files in folder. if case insensitive ( /i ) file references quoted avoid problems spaces only name , extension of file ( %~nxi ) tested. can execute for /? retrieve full list of modifiers available. removal of file uses full path ( %~fi ) it this written executed command line. inside batch file percent signs need escaped, replacing % %% for %%i in ("bin\setup\*") if /i not "%%~nxi"=="setup.exe" echo del "%%~fi" del commands prefixed echo files not removed, command echoed console. if output correct, remove echo .

c# - How to extend string to deserialize binary data -

i'm using own extension method serialize strings (and more data types) file custom binary format (external, cannot modify format). method is: public static byte[] serialize(this string str) { if (str.length > short.maxvalue) throw new argumentoutofrangeexception("str", "max length allowed " + short.maxvalue.tostring()); list<byte> data = new list<byte>(); data.add(0); data.add(0); if (str != null) { byte[] buffer = encoding.utf8.getbytes(str); data.addrange(buffer); data[0] = (byte)(buffer.length % 256); data[1] = (byte)((buffer.length / 256) >> 8); } return data.toarray(); } an example of usage: string str1 = "binary string"; byte[] data = str1.serialize(); result is data = { 13, 0, 66, 105, 110, 97, 114, 121, 32, 83, 116, 114, 105, 110, 103 } now i'm trying add extension method deserialize when reading these files: public static void des...

php - one form, multiple submits with onclick event -

i have form 2 submit buttons, in code behind got values each submit, problem when add javascript onclick event on each submit, when try retrieve values in php nothing. input submit values when don't use event. i don't input submit values code: <input type="submit" id="send1" value="send1" name="sub1" onclick="validate1();"/> <input type="submit" id="send2" value="send2" name="sub2" onclick="return validate2();"/> this 1 works: <input type="submit" id="send1" value="send1" name="sub1" /> <input type="submit" id="send2" value="send2" name="sub2" /> here's quick setup want https://jsfiddle.net/d090618g/ your html <form id="theform"> <input type="submit" name="s1" /> <input type="submit" ...

java - Crash when opening email composer -

every time try write text email composer crash message. could me error? e/androidruntime(12948): process: com.samsung.android.email.composer, pid: 12948 > e/androidruntime(12948): android.view.inflateexception: binary xml file line #54: error inflating class com.samsung.android.email.composer.htmleditor.toolbarview > e/androidruntime(12948): caused by: java.lang.reflect.invocationtargetexception > e/androidruntime(12948): caused by: android.view.inflateexception: binary xml file line #63: error inflating class <unknown>

android - Fastboot commands in source code not found in fastboot binary -

i working new device has "secure" bootloader , no 'oem' command integration. upon looking @ source code (official) fastboot, stumbled upon several commands not included in fastboot binary ('fastboot flashing [option]') correspond 'oem' commands, not that, within fastboot protocol (fastboot_protocol.txt), there command specific "secure" bootloaders ("verify:%08x") isn't in source code... is normal? have recompile fastboot myself able access these commands? the 'flashing' commands noticed recently added aosp . first distributed release of android m preview (v23 of platform tools package). unless bootloader on given device supports them, these commands not work. since commands recent, bootloaders should support them have come android m preview factory images released nexus 5, nexus 6, nexus 9, , nexus player. for now, these commands should considered beta, or alpha, since may change in future. after offic...

html - Element on my website overlaps on menu -

Image
as can see countdown seems appear on-top of navigation when drops down social icons. i wondering how able make countdown goes hidden under nav dropdown. see image below of mean > html source code above image <!-- navigation --> <div class="navigation-top"> <nav class="cbp-hsmenu-wrapper animated fadein" id="cbp-hsmenu-wrapper"> <div class="cbp-hsinner"> <ul class="cbp-hsmenu"> <li> <a href="#">connect</a> <ul class="cbp-hssubmenu"> <li><a href="#"><img src="facebook-square.svg" alt="img01"/><span>facebook</span></a></li> <li><a href="#"><img src="youtube.svg" alt="img02"/><span>youtube</span></a></li> <li><a href="#"><img s...

batch file - Command line arguments are not passed in Windows 7 - Java -

i running executable jar using batch expects command line arguments. echo off java -jar myjar.jar %1 %2 %3 %cd% pause i checked code on 1 windows system , works fine. running on windows 7 system, command line arguments not passed jar. args.length gives me 0. have checked following: c:\users> assoc .jar .jar=jarfile c:\users> ftype jarfile jarfile="c:\program files\java\jre7\bin\javaw.exe" -jar "%1" %* i have tested simple batch file echo command line argument, , works fine. accepts argument , prints it. how can fix this? it resolved. think answer might seem silly, since posted question go ahead. problem was running java runtime environment, got resolved when installed development kit instead. i'm quite confused that, installed runtime environment on other windows 7 system , worked fine, why did didn't work , needed jdk instead system running windows 7 well. thank taking time. appreciate if knows why did act way , mention...

laravel - PHP create image file using imagecreatefromstring, without knowing the format of the image -

i'm developing laravel restful app accepts image strings users , must store them. images encoded , sent app. know have receive , decode image this: $imagedata = base64_decode($imagedata); $source = imagecreatefromstring($imagedata); but dont know how save them files, without knowing format of image?is there way find out image extension, can use functions like: imagepng

vba - 1 Working Day Back In SQL DB2 -

i need select data database date 1 day past on working day. there specific function ( excel has got formula =workday)? i downloading data db2 excel vba instructions. here piece of code use calendar day. strsql = "select *" strsql = strsql & " pdb2i.di_his_exh_rat_01" strsql = strsql & " car_dt = current date - 1 day" thanks in advance directions select * mytable mydate = current date - (case when dayofweek(current date) = 1 2 -- sonntag when dayofweek(current date) = 2 3 -- montag else 1 end) days

html - Jquery - Change Glyphicon on click -

i have collapsing div , cannot seem make glyphicon change existing jquery have. i want change glyphicon-plus glyphicon-minus not seem work me. $(function(){ $('a.togglebtn').click(function(){ if($("#toggleglyph").length !== 0) $(".glyphicon").removeclass("glyphicon-minus").addclass("glyphicon-plus"); else if ($("#toggleglyph").length !== 0) $(".glyphicon").removeclass("glyphicon-plus").addclass("glyphicon-minus"); }); }); $(function(){ $('a.togglebtn').click(function(){ if($("#toggletext").text()==="learn more"){ $("#toggletext").html("hide");} else {$("#toggletext").html("learn more");} $('#mycontent').stop().slidetoggle(500); return false; }); }); #mycontent { display:none;} <script src=...

scala - Elastic4s, mockito and verify with type erasure and implicits -

in previous versions of elastic4s like val argument1: argumentcapture[deleteindexdefinition] = ??? verify(client).execute(argument1.capture()) assert(argument1 == ???) val argument2: argumentcapture[indexdefinition] = ??? verify(client, times(2)).execute(argument2.capture()) assert(argument2 == ???) after several executions in test (i.e. 1 deleteindexdefinition , followed of 2 indexdefinition ). , each verify matched against type. however, elastic4s takes implicit parameter in client.execute method. parameter of type executable[t,r] , means need like val argument1: argumentcapture[deleteindexdefinition] = ??? verify(client).execute(argument1.capture())(any[executable[deleteindexdefinition,r]]) assert(argument1 == ???) val argument2: argumentcapture[indexdefinition] = ??? verify(client, times(2)).execute(argument2.capture())(any[executable[indexdefinition,r]]) assert(argument2 == ???) after doing that, getting error. mockito considering both 3 client.execute in first v...