Posts

Showing posts from April, 2015

asp.net mvc 4 - How to get select option value inside razor in mvc -

i have <select> tag in view. example: <html><head></head> <body> <div> <select> <option value="">select</option> <option value="alert1">alert1</option> <option value="alert2">alert2</option> </select> </div> <div id="preview"> `enter razor code here`@ { here have write condition based on <select option> tag value, need display respective viewbag. } </div> </body></html> from controller passing viewbag , e.g.: viewbag.alert1="some html template1". viewbag.alert2="some html template2". my requirement is: on selecting <option> , if select 'alert1', in <div id="preview"> need display viewbag.alert1 content. if user selects 'alert2' in <div id="preview"> need display viewbag.alert2 value. i know, c

javascript - Unable to pass values from one js file to another js file protractor e2e testing -

below code unable return value genericutil.js homepage.js i trying implement page objects along hybrid driven framework. //genericutil.js: var blnflag; genericutilities = function(){ this.objclick = function(objlocator){ element.all(objlocator).then(function(items) { if (items.length == 1) { element(objlocator).click(); blnflag='true'; console.log("inside if" + blnflag); } else { blnflag='false'; console.log("inside else" + blnflag); }; }); return blnflag; }; }; module.exports = new genericutilities(); //home_page.js: var blnflag; var gu = require("../genericutilities/genericutil.js"); var home_page = function(){ this.clickcontinue = function(){ blnflag = gu.objclick(home_page_obj.btncontinue); console.log("after return" + blnflag ); }; };

Is it possible to query cpu utilization of a compute instance using the gcloud api? -

when load testing single core compute instance noticed top showing 10% cpu utilization. however, in compute console utilization of instance 100%. believe top showing utilization of host while compute console showing container utilization. since container more relevant load testing wondering if possible query metric via api command? $ gcloud compute cpu-utilization "instance-name". something of sort. you can enable google cloud monitoring api project , query api cpu metric instance(s). you can find more information on cloud monitoring api on link . hope helps.

c++ - Returning a Generic container from a Set of Dictionaries -

i have collection of dictionaries (std::maps) store generic containers foo unique id. given such unique id, return corresponding container. not know before hand in dict foo object given id stored, along line of following: #include <map> std::map<id, foo<double>> mapdouble; std::map<id, foo<int>> mapint; template <class t> foo<t> getval(id id) { std::map<id, foo<double>>::iterator itdoub = mapdouble.find(id); if(itdoub != mapdouble.end()) { return = itdoub->second; } std::map<id, foo<int>>::iterator itint = mapint.find(id); if(itint!= mapint.end()) { return = itint->second; } } void bar() { foo<int> foo getval<int>(3); } but following error message error: no viable conversion 'foo <double>' 'foo <int>' which of course makes complete sense. correct way of implementing functionality? guess implementing here sort of

JavaScript's xor result different than the one of Java -

solution i had bug in internal conversion logic. original question i need implement algorithm both in java , javascript, whereas java implementation , calculation result reference. however, when invoking xor operator on "negative" value (i know java , javascript make use of 2's complement) causes java's result positive, whereas javascript result negative, shown in output below: java output: hash a: 16777619 hash b: 637696617 hash a: 637696613 hash b: 988196095 hash a: 988196062 hash b: -1759370886 hash a: 1759370917 <-- here javascript implementation behaves different hash b: -1169850945 javascript output: hash a: 16777619 hash b: 637696617 hash a: 637696613 hash b: 988196095 hash a: 988196062 hash b: -1759370886 hash a: -1759370843 <-- result should equal java result hash b: -1883572545 below can see java source code: private static final int fnv_prime = 0x1000193; pr

android - How to draw overlapping circles with radial gradient on the edge in a rectangular? -

i wish draw transparent circles within black rectangular , circles overlap partially. did using porterduffxfermode(mode.src_out) crop off 2 transparent circles black rectangular want add radial gradient (from transparent black) on edge can tell me how ? note not 1 circle. have @ least 2 circles overlapping many thanks! what code : https://www.dropbox.com/s/xbr2abgb4esorrj/img1.jpg?dl=0 what desire : https://www.dropbox.com/s/7ihsz77ukbsj1wf/img2.jpg?dl=0 bitmap bitmap = bitmap.createbitmap(mdimension, mdimension, bitmap.config.argb_8888); canvas canvas = new canvas(bitmap); canvas.setmatrix(matrix); paint paint = new paint(); paint.setcolor(color.black); paint.setalpha(200); paint.setcolorfilter(createdimfilter()); canvas.drawrect(0, 0, canvas.getwidth(), canvas.getheight(), paint); (point p : mpoints) { paint transparentpaint = new paint(); transparentpaint.setcolor(color.transparent)

c++ - Fix of warning "comparison is always false due to limited range of data type [-Wtype-limits]" -

i have problems fixing gcc warning in 1 of template classes (using c++11). have following member function in class: void throwinvalidargumentexceptionifvalueislessthanminimumallowedvalue() const { if (static_cast<std::intmax_t>(value_) < kminimumvalue) { throw std::invalid_argument{"the specified number " + std::to_string(static_cast<std::intmax_t>(value_)) + " less minimum number " + std::to_string(static_cast<std::intmax_t>(kminimumvalue)) + "."}; } } the class has following template signature (using crtp idiom): template <class tclass, typename tvalue, std::intmax_t const kminimumvalue, std::intmax_t const kmaximumvalue> the following warning raised line if condition (which makes sense) when using template signature <decimalpercentage, std::uint8_t, 0, 100> : warning: comparison false due limited range of data type [-wtype-limits] i think problematic if condition ma

Android support for the Square Register API? -

i in in process of developing point of sale applications restaurants both iphone , android. wanted use square process credit card sales seamlessly apps, square register api not available android. would square connect allow app integrate in way customer's food order can taken inside app, , square automatically launched allow customer pay (pre-populating dollar amount), , switch app after payment completed? based on read, square register can (only on iphone), square connect not able this. correct? mean apps won't able integrate square way need them to, have choose different credit card processor work have api functionality need both iphone , android? thanks! @stephen barlow's answer correct @ time, no longer case. square announced register sdk android on may 25, 2016. here blog post: https://corner.squareup.com/2016/05/introducing-squares-register-api-for-android.html

input - Inputting a smaller size vector to a Verilog Module -

i wondering happen if created module size vector declaration input, , fed smaller sized vector while instantiating later. example, create module so: module example(input, ....); input[15:0] input; ... endmodule and instantiate later, pass smaller vector size input so: wire[11:0] foo; example bar(foo, ....); so happens input in case? since input supposed 16 bits, 0 pad foo on left? the default value of wire ' z'(high-impedance) . since 4 bits of inputs not connected remaining input bits [12:15] takes default value in condition remaining bits connected driving input. eliminate these kind of errors in larger rtl designs running static tool on code recommended.

excel - VBA Shell command no longer working -

heyho, earlier today ran issues shell command in vba using excel2010 64bit. have fixed them hardcoded workaround, know why stopped working. here code snipped: dim mypath string dim myfolder string mypath = "d:\somefolder\" myfolder = "somesubfolder\" shell mypath & myfolder & "some.bat" until 2 weeks ago, consistently executing bat, stopped working. i have played around bit , checked other syntaxes using shell command , have yet make sense of it. whenever tried execute snipped "runtime error 5, invalid procedure call or argument" however, working 2 weeks ago, , haven't touched file. according ms documentation other arguments shell optional cannot problem. in end, instead of looping through directories, hardcoded paths in multiple commands this: shell """fullpath_to_.bat-files""" funny thing is, have multiple other vba scripts use old syntax described further up, meaning combining

mysql - Get result with matching all search queries -

i have 3 tables: comics , tags , comictags . comics table id connected through foreign key comictags table while tags table id connected comictags table through tagid . comics table +----+ | id | +----+ | 1 | | 2 | +----+ comictags table +---------+-------+ | comicid | tagid | +---------+-------+ | 1 | 1 | | 2 | 1 | | 2 | 2 | +---------+-------+ tags table +----+-------+ | id | tag | +----+-------+ | 1 | tag1 | | 2 | tag2 | +----+-------+ what i'd achieve is, if i'm searching tag1 , tag2 i'd comic id 2 result. given string 2 tag names. select c.id `tags` `t` left join comictags ct on ct.tagid=t.id left join comics c on c.id=ct.comicid ((t.tag 'tag1') or (t.tag 'tag2')) group c.id with statement i'm getting comic id 1 not want. changing or , doesn't work in statement i've created. could point me in right direction on how comic ids match tag ids?

javascript - Setting breakpoints on function calls in Chrome Dev. Mode -

is there way set breakpoints when specific functions about execute? it needn't explicit breakpoint - want execution pause when console.log() called. or should resort this method. i prefer accomplish without modifying code, or manually setting breakpoints @ every console.log . yes that's trick. create custom logging function, put debugger in , call console.log , have wanted: function log(message) { debugger; console.log(message) ; } edit: you can replace console.log similar fonction calls original: var clog = console.log; console.log = function(message) { if(message == '...') { debugger; } clog.apply(console, arguments); } this code affect log calls within page. check catch message. remove stop always.

oracle equivalent of mysql ifnull (no case, no if) -

i looking quick way do select ifnull(columna, columnb) mytable (i have dozens of columns , don't want write case each of them) you can use standard coalesce keyword, allows pass multiple parameters: select coalesce(columna, columnb, ..., columnz) mytable coalesce keyword documentation

When selecting an item in a datra frame, I obtain the item and the Levels R -

i have data frame , when select item, obtain next result, levels available in column. is there command desactivate this? or how should call element? this doing @ moment: a<-data$column[1] and obtain: [1] 1 1256 levels: 1 10 100 1000 ... 1000000 if want a number use: a <- as.numeric(paste(data$column[1])) [1] 1 if want a string use: a <- as.character(data$column[1]) [1] "1"

c# - Cannot publish web app : Fail to copy -

i able publish web applications thousand times, i'm stuck error (sorry not perfect french translating) error 23 fail copy file : "blabla\bll.dll." "blabla\bll.dll" cannot find file 'blabla\bll.dll'. what about? edit: it's in packagetmp files one of awsome colleague suggested delete "obj" file... worked, don't know learned that. solved problem completely.

AngularJS: $filter 'date' won't change format -

i'm trying filter current date format can accepted web api, format being 01/01/0001 00:00:00. here attempted code @ - var today = date(); var completedt = $filter('date')(today, 'mm/dd/yyyy hh:mm:ss'); however completedt hold "tue jul 14 2015 15:37:36 gmt+0100 (gmt daylight time)" can't seem find answer online, assume simple doing wrong. change today this: var today = new date();

Copy SAP HANA project from Amazon Web Service -

i have hana project hosted on amazon web service. have trial instance of hana. how can copy or export project amazon trial instance using hana studio? importing , exporting in hana done through delivery units , packages. you need create delivery unit in aws instance, add project delivery unit package. export delivery unit. on trial instance, import delivery unit. creating delivery unit importing delivery unit maintaining delivery unit

c# - MVC Model binding issue - list of objects -

the scenario shopping basket - user update text box quantity , hit update button. currently, upon hitting update button, action hit model properties null. my first thoughts there issue binding because ids of controls changed each row. are thoughts correct? if so, how can resolve this? edit: tried use loop, rather foreach didn't work either. code below: <table class="order-table order-table-nomargin order-table-noborder hidden-xs hidden-sm"> <thead> <tr><th>products</th><th></th><th>price</th><th>qty.</th><th>total</th></tr> </thead> <tbody> @foreach (nop.web.models.custom.customorderline ol in model.cart.orderlines) { @html.displayfor(m => ol) } </tbody> </table> this displayfor template: @model nop.web.models.custom.customorderline <tr> <td> <img alt="book image" src=&q

google chrome - How to use the Nacl module compiled by linux Toolchain in Html -

i run "make toolchain=linux" messaging example located under examples/api directory.other toolchains pnacl,newlib,glibc working properly.for linux toolchain generates .so file,nmf not automatically generated,so created using create_nmf command.when change html linux toolchain like <body data-name='messaging' data-tools='linux' data-configs='release' data-path='{tc}/{config}> error "this plugin not supported".i dont know whether possible in way.whether can access .so nexe/pexe.i supposed use linux toolchain because using "alsa/asoundlib.h" available in linux , chrome os platform.finaly tell how access .so file in html. you can run messaging sample linux (native) toolchain invoking: toolchain=linux make run please note, native toolchain support provided debugging aid. shipping applications need built nacl or pnacl toolchain. when run described above, browser launched command-line options allow .so load

get elements in "AND" in logic string with Python -

i want parse logic strings , combinations of elements in "and" logic. instance, string '( , ( b or c ) )' should [[a,b],[a,c]] , string '( , b , ( c or d , f ) or f , g )' should [[a,b,c],[a,b,d,f],[f,g]]. i'm trying use pyparsing. following post here parsing complex logical expression in pyparsing in binary tree fashion manage nested list letters grouped according preferences ("and" has preference on "or", , parenthesis overrides this): import pyparsing pp complex_expr = pp.forward() vars = pp.word(pp.alphas, pp.alphanums + "_") | pp.regex(r"[+-]?\d+(:?\.\d*)?(:?[ee][+-]?\d+)?").setname('proteins') clause = pp.group(vars ^ (pp.suppress("(") + complex_expr + pp.suppress(")") )) expr = pp.operatorprecedence(clause,[ ("and", 2, pp.opassoc.left, ), ("or", 2, pp.opassoc.left, ),]) #print expr complex_expr

Android - wait for animation to finish before continuing? -

i've spend quite while trying find out how wait animation finish before continuing code. far i've tried while(animation.hasended() == false), using thread.sleep, using timer can't seem work. something cropped quite few times add animation listener animation, i've tried not sure how progress further. i create animation, start animation , have line of code after, want executed after animation has finished: animation movedown = allanimstuff(duration); //creates animation image.startanimation(movedown); // start animation displayscore(score); // wait animation finish before executing line and here allanimstuff(duration) method used create animation: private animation allanimstuff(final long duration) { animation movedown = new translateanimation(image.getx(), image.getx(), (-image.getheight()), pxheight - image.getheight() / 2); //creates animation movedown.setduration(duration); movedown.setfillafter(false); mov

php - Merge arrays so they contain only recurring values -

we upgrading webshop filtering little bit different. product id's related 1 or more selected filter values. //filter value '8 gb' $result[] = array(1,6,5,8,9); //filter value 'amd e' (and)or 'intel' $result[] = array(1,5,8,9,10,500,502,503,600,607,608,...); the 'amd e' , 'intel' values same filter 'processor' these combined visitor have products amd e or intel processor. now select id's occur in both array's. we've tried bunch of methods doesn't return expect in atempt. the problem number of key => array pairs in $result dynamic number of id's returned sql. when first array in $result short list of id's, array_intersect() not return expected results when there multiple array's in $result . merge_array() combine everything. visitor see products have 8 gb memory or contain amd e or intel processor. we looking ('8 gb') , ('adm e' or 'intel') solution. things co

R leaflet color scheme not working -

Image
i color code markers on map. unfortunately, markers black (circled in red, because black faded!) what i'm looking for color points based on percent_sep12_assets , i.e. less 33% = red between 33% , 66% = orange more 66% = green code sep <- read.csv("31r_sep_assets_csv - copy.csv") sub1 <- sep[grep("sep.12", names(sep))] sep$newcol <- 100*rowsums(sub1)/rowsums(sep[4:7]) # create new grouping variable percent_sep12_assets <- ifelse(sep[,8] <= 33, "less 33%", ifelse(sep[,8] >= 66, "more 66%", "between 33% , 66%")) color_assets <- colorfactor(c("green","orange","red"), levels = percent_sep12_assets) leaflet(data = sep[]) %>% setview(lng = mean(sep$longitude), lat = mean(sep$latitude), zoom = 12) %>% addtiles() %>% addcirclemarkers(~longitude, ~latitude, color = ~percent_sep12_assets, popup = ~as.character(paste(site,

logging - python filter files by modified time -

i have following code: def filter_by_time(files): print "---list of log files timecheck: " f in files: print f, datetime.datetime.fromtimestamp(os.path.getmtime(f)) print "------" mins = datetime.timedelta(minutes=int(raw_input("age of log files in minutes? "))) print "taking ", mins, "minutes" mins = mins.total_seconds() current = time.time() difftime = current - mins print "current time: ", datetime.datetime.fromtimestamp(current) print "logs after: ", datetime.datetime.fromtimestamp(difftime) f in files: tlog = os.path.getmtime(f) print "checking ", f, datetime.datetime.fromtimestamp(tlog) if difftime > tlog: print "difftime bigger tlog", "removing ", f files.remove(f) print "*****list of log files after timecheck" f in files: print f, dateti

php - phpMailer does not send email -

i have problem phpmailer. when send form, returns error: smtp error: failed connect server: connection timed out (110) smtp connect() failed. here php code $mail = new phpmailer(); $body = "nome: <strong>".$nome."</strong><br> email: <strong>".$email."</strong><br> txt: <strong>".$txt."</strong><br>"; echo "$body"; $mail->issmtp(); // use smtp $mail->host = "smtp.gmail.com"; // sets smtp server $mail->smtpdebug = 1; // 2 enable smtp debug information $mail->smtpauth = true; // enable smtp authentication $mail->smtpsecure = "ssl"; //secure conection $mail->port = 465; // set smtp port $mail->username = 'email@gmail.com'; // smtp account username $mail->password = 'password'; // smtp account password $mail->

java - No method to get stream of byte array -

this question has answer here: why new java.util.arrays methods in java 8 not overloaded primitive types? 1 answer i want stream of byte array came know arrays not have method stream of byte array. byte[] bytearr = new byte[100]; arrays.stream(bytearr);//compile time error my questions, why feature not supported ? how can stream of byte array ? note : know can use byte[] instead of byte[] not answer question. there 3 types of primitive streams: intstream, longstream , doublestream. so, closest can have intstream, each byte in array promoted int. afaik, simplest way build 1 byte array is intstream.builder builder = intstream.builder(); (byte b : bytearray) { builder.accept(b); } intstream stream = builder.build(); edit: assylias suggests another, shorter way: intstream stream = intstream.range(0, bytearr.length

mysql - php match values with a user defined formula stored in a table and perform the requested mathematical operation -

i have user defined formula stored in database table string "({arrival_date}-{departure_date})" . have below rows selected table. departure_date arrival_date 2015-01-01 2015-03-01 2015-02-01 2015-02-10 i want use formula ({arrival_date}-{departure_date}) , difference in days i.e (2015-03-01 - 2015-01-01) = 2 etc rows. suggestions on how can match value formula? thank in-advance. once have stored 2 dates in 2 variables, can try this: <?php $str1 = '2015-01-01'; $str2 = '2015-03-01'; $datetime1 = new datetime($str1); $datetime2 = new datetime($str2 ); $interval = $datetime1->diff($datetime2); echo $interval->format('%r%a days'); ?> btw don't know format datetime accepts (yyyy-mm-dd or yyyy-dd-mm) or if depends on server's international options.. if doesn't work can use datetime::createfromformat manually specify fields. edit: i don't

cloud - Upgrading Azure SDK and Azure Storage version to latest -

Image
i beginner in azure. had soln using old version of sdk 2.1 , have upgraded 2.6 on local. use visual studio team services deploy on cloud(which has old version). working fine. have deployed cloud using team services. cloud service still shows old version. there way can check see of upgraded version 2.6 has been transitioned cloud service ? once have installed latest sdk on machine still have upgrade project within visual studio. this: within solution select azure cloud service project (the 1 contains servicedefinition.csdef etc). press alt+enter or right-click , context menu select properties (found @ bottom). open document page shown below , display version of azure sdk project using. if newer version found on machine see upgrade button.

c# - NoViableAltException in Antlr4.3 grammar -

problem i started using antlr (4.3 .net) , after debugging quite while, have surrender. noviablealtexception in last 4 lines - have no idea how fix ... so have hints me? supposed behavior the generated parser supposed parse strings hello {user.name}! or hello {{ {user.name("}")} }}! user.name , user.name("}") expected derive expression rule , else plainstring . however, not yet able test ... grammar grammar patternstring; @namespace{patternstringparser.antlrgenerated} patternstring: (plainstring | expressionstring)+; plainstring: (plainstringliteral | '""' | '{{' | '}}' )+; expressionstring: '{' expression* '}'; expression: balancedstringliteral+ | '(' expression ')' | '[' expression ']' | '{' expression '}'

python - How to avoid repetitive filter specification in mako %def's? -

i find myself repeating same filter attribute on %def's in mako code: <%def name="mydef1(a,b)" filter="trim"> # something </%def> ... <%def name="mydef2(b)" filter="trim"> # something </%def> is there way specify default set of filters %def's , avoid repetitive 'filter="trim"' in code? i noticed there an option specify default filters expression filters , not find similar %def's. there couple workarounds can use: you can use default_filters argument if okay importing defs programmatically or loading them file . you can nest defs within parent def, , apply filtering parent def (i don't have mako on current machine, can't text this, 99% sure works, please call me out if wrong.) <%def name="filterdefs()" filter="trim"> <%def name="mydef1(a,b)"> # something </%def> <%def name="mydef2(b

php - WooCommerce - Force a selection in dropdown menu -

i'll try explain issue best can. i have woocommerce pizza delivery website. people can log in , select pizzas want extras (olives, mushrooms, , such), , pick between junior size or normal size. the extras checkboxes, must allowed pick different stuff. the size dropdown menu, since have pick either one. normal size full price, junior size full price -1. price isn't showing unless pick 1 of 2 options. the issue comes when visitors forget pick size. if forget so, , order, order goes through 0€. i've tried millions of ways fix this, i'm stuck now. remaining idea force dropdown menu select 1 of options (normal size) upon loading page. so drop down wouldn't "please pick one" right away "normal". visitors could, if wanted to, change junior, @ least if don't , order order go through full price , not 0€. here code of dropdown menu: <div ng-repeat="option in post.food track $index"> <div ng-if="option.typ

Set cursor position in Edit Text android -

how can set cursor position in android edit text? im making button make cursor 1 character forward ie. arrow key like you have use setselection(int position) method of edittext. edt.setselection(0)

java - Disabling Jetty TimeoutException warning messages in logs -

i'm trying hide these timeout exceptions, keep showing in log - 2015-07-13 09:56:13.019:warn:oejs.servlethandler:qtp636718812-758: /feed java.io.ioexception: java.util.concurrent.timeoutexception: idle timeout expired: 30000/30000 ms @ org.eclipse.jetty.util.sharedblockingcallback$blocker.block(sharedblockingcallback.java:223) @ org.eclipse.jetty.server.httpoutput.write(httpoutput.java:159) @ org.eclipse.jetty.server.httpoutput.write(httpoutput.java:408) @ net.bull.javamelody.filterservletoutputstream.write(filterservletoutputstream.java:70) @ net.bull.javamelody.counterresponsestream.write(counterresponsestream.java:83) @ com.fasterxml.jackson.core.json.utf8jsongenerator._flushbuffer(utf8jsongenerator.java:1848) @ com.fasterxml.jackson.core.json.utf8jsongenerator.writestring(utf8jsongenerator.java:447) @ com.fasterxml.jackson.databind.ser.std.stringserializer.serialize(stringserializer.java:45) @ com.fas

javascript - Drag child and parent together -

i've got div structure below. <div id="wrapper"> <div id="innerwrapper"> <div id="obj"></div> </div> </div> currently i'm using jquery's draggable move div around. jquery('#obj').draggable(); now i'm in situation need drag #wrapper dragging #obj . how can this? want able drag #obj , drag #wrapper together. when this jquery('#wrapper').draggable(); it not respond on touch devices maybe because #obj overlapping #wrapper you can use handle option in draggable ui allow restrict parent getting dragged unless mousedown occurs on specified element(s) in child. for code can do: jquery( "#wrapper" ).draggable({ handle: "div#obj" }); for code reference : http://jsfiddle.net/xbb5x/8862/ for library reference: http://jqueryui.com/draggable/#handle

An item with the same key has already been added while Installing nuget package -

in project, using class library . made class lib nuget package, remove class lib , when try install package error apears:"an item same key has been added"? in case, saw error when packages.config file contained duplicate package ids isn't allowed. you can use powershell script below find duplicate packages in solution. finds packages.config files recursively , per packages.config file, checks duplicate package ids. $solutionfolder = "c:\mysolution" $nugetpackagefile = "packages.config" $files = get-childitem -path $solutionfolder -filter $nugetpackagefile -recurse foreach ($file in $files) { [xml]$xml = get-content $file.fullname $nodes = select-xml "/packages/package/@id" $xml $packageids = @{} foreach ($node in $nodes) { $packageid = $node.node.'#text' try { $packageids.add($packageid, $packageid) } catch [system.argumentexception] {

vba - ShellExecute brings Office programs to crash -

i used printout pdf-files ms access 2010 32-bit on windows 7 32 bit code. declare function shellexecute lib "shell32.dll" alias "shellexecutea" (byval hwnd long, byval lpoperation string, byval lpfile string, byval lpparameters string, byval lpdirectory string) long function printattachement() shellexecute 0, "print", "\\s1016d\attachments\40297827.pdf", "", "" end function now, changed windows 7 64 bit, still office 32 bit , office applications crashes when running function. strange, because if use "open" iso. "print" works expected! please help, lost how correct function run again. all want printout pdf-file access without opening file. there many files in row, cannot open pdf-app printout file. thanks michael edit: after long searches found solution! you have declare function in 64bit application, make shure run on machines 32bit declare both. #if vba7 private declare ptrsafe fun

class - Matrix Multiplication with template parameters in C++ -

i have self-defined matrix class , want overload operator * matrix multiplication: template< int r, int c> class matrix{ int *_mat; int _size; public: matrix(){ _size = r*c; _mat = new int[_size]{0}; } ~matrix(){ delete []_mat; } matrix &operator=(const matrix & m){/*...*/} //... template< int d2, int d1 > using matrix_t = int[d2][d1]; template<int r2, int c2> matrix<r,c2> operator*(const matrix_t<r2,c2> &mat) { matrix<r,c2> result; for(int r = 0; r < r; r++) { for(int c = 0; c < c2; c++) { for( int i; < c; i++ ){ /*do multiplication... result._mat[r*c2+c] = ... */ } } } return result; } //... }; then problem comes matrix<r,c2> result . result becomes outside object of class. cannot access private member using result._

uglifyjs - uglify-maven-plugin adding exclude file list -

i trying implement uglifyjs-maven-plugin. while using configuration mentioned here , getting error sourcedirectory undefined or invalid . using configuration <configuration> <sourcedirectory>target/snapshot/javascript</sourcedirectory> <outputdirectory>target/snapshot/javascript</outputdirectory> </configuration> its working fine. how add exclude file list in above configuration. have js file of 900kb, when including js file inside source directory, getting exception during maven build " exception in thread "main" java.lang.stackoverflowerror". can me out of this. it looks while documentation (and current implementation) supports file exclusions, version available in repository (1.0) older , supports sourcedirectory . i have not found newer version published anywhere, guess best thing can compile latest version of plugin manually , see if supports documentation says.

javascript - Sencha Touch 2: itemtap on IE not targeting divs -

i'm working on cordova hybrid app , facing issues on windows 8.1 sencha touch 2. got divs on listitem subelements. defined tap listener. works fine android , ios, doesn't work on win8.1 internet explorer. i'm getting above lying listitem-element not clicked div-containers. this simplified example: view: ext.define( 'app.view.mydataview', { xtype: 'mydataview', extend: ext.dataview.list , config: { inline: false, title: "mytitle", scrolltotoponrefresh: false, cls: 'mydataview', itemcls: 'mydataviewitem', pressedcls: 'mydataviewitempressed', grouped: true, listeners: { tap: { element: 'element', //delegate: '.something', fn: function (e) { console.log(e.target.classname) } } }, deferemptytext: false, infinite: true, variableheights: true, itemtpl: new

A batch file conundrum -

i using windows xp.trying create batch file work location in response user input.it works fine except glitch.if user inputs c:\documents , settings\username\desktop\file.txt the following batch works fine: set /p x= file ? set /p =number: <nul find /v /c "" <%1 %x%> linecount.txt msg %username%<linecount.txt || start linecount.txt del linecount.txt. but if assume user computer saavy , use path %userprofile%\desktop\file.txt with or without quotes batch file fails message system cannot find path!. @ wits end. i might wrong think % has after %userprofile. in case be: %userprofile%\desktop\file.txt

html - Add AND remove eventlistener with arguments and access element and event? - Javascript -

okay. understand there few ways manage events in javascript. inline, eg. <div id=myid onclick="alert('hi')"> - supposedly shouldn't it. event handlers, eg. element.onclick = new function("myfunc('args')"); - supposedly better not best event listeners, eg. element.addeventlistener("click",myfunc,false) -supposedly best way of doing things so, lets want pass arguments function. hear should calling function within function this: myelement.addeventlistener("click",function whatever(event){ myfunk(event,"some argument"); },false); but if want remove it? myelement.removeeventlistener("click",whatever,false); this returns "whatever not defined" error in console. function not have name? "whatever" not name? how remove it? i need way assign event listener , pass arguments, , rid of later. how do this? edit: okay, yes, cannot refer whatever because written

javascript - Change Alphabets keypad as secondary and make Numeric Keypad as Primary -

is there way make numeric keypad primary keypad , alphabets secondary keypad on inputtype=text in particular html file? the reason need this: have list of input box user has enter numbers , occasionally user enters text in webbased mobile app. it hard user switch, default alphabet keypad numeric keypad , type number > , click on next box > see's alphabet keypand again switch number keypad, has same next input box's (it practically hard user if have 200 input's. if use <input type="number"> numeric keypad should appear.

javascript - Using onchange to delete other occurrences of the value in the select element -

so have made couple of attempts of , feel close couldn't find correct ajax. select elements made dynamically on click of button, , have same options, want happen once choose option, other occurrences of option removed select elements leaving 1 chose alone. this 1 removes every select element has class 'theclass' including 1 changed. function removeoptions(optionvalue) { $('.theclass option[value='+optionvalue+']').remove(); } i tried .each() function couldn't call 'this' correct. function removeoptions(optionvalue) { $( ".theclass").each( function () { $(this + 'option[value='+optionvalue+']').remove(); } } any appreciated you can use .not() filter ones want keep, below. $(document).on("change", "select", function() { var val = $(this).val(); $(this).find("option[value='" + val + "']:not(:selected)").remove();

d3.js - How to avoid empty DOM elements in code? -

how can avoid creation of empty elements in svg code? in graph drawn d3, specific nodes circle , other have text. svg.append("circle").filter(function(d) { return d.haslabel; }) .style("fill", "white") .attr("r", 8) .attr("cx", function(d) { return xscale(d.x) }) .attr("cy", function(d) { return yscale(d.y) }); it works somehow, nodes haslabel true show circle, looking @ html page source code see nodes haslabel false have . there way avoid this? just move append after filter , so.. svg.filter(function(d) { return d.haslabel; }) .append("circle") .style("fill", "white") .attr("r", 8) .attr("cx", function(d) { return xscale(d.x) }) .attr("cy", function(d) { return yscale(d.y) });

Stretching of cell in XSL export of Jasper reports -

for vertical stretching of cell in xsl export set cell parameter "stretch overflow", use special xsl property <property name="net.sf.jasperreports.export.xls.auto.fit.row" value="true"/> , cover cells frame element. fine in main report. there problem in subreports. cells not stretching. have such code: <detail> <band height="16" splittype="stretch"> <property name="local_mesure_unitheight" value="pixel"/> <property name="com.jaspersoft.studio.unit.height" value="px"/> <frame> <reportelement positiontype="float" x="0" y="0" width="400" height="15" uuid=""> <property name="local_mesure_unity" value="pixel"/> <property name="com.jaspersoft.studio.unit.y" va