Posts

Showing posts from June, 2013

java - Android: Open alertdialog from part of string? -

i have checkbox string says "i have read , understood terms , conditions". want make words "terms , conditions" link opens alertdialog terms , conditions can read. nothing special. i'm thinking in line of: <string name="cont_agree">i have read , understood <a ref="open alertdialog">terms , conditions.</a></string> is possible, , should use says "open alertdialog"? if can't done way, how should do? addition: open url use code: <string name="cont_agree"><a ref="http://www.stackoverflow.com">stackoverflow</a></string> but how open alertdialog, or screen, string? have seen apps possible, of course, how? edit: code use spannablestringbuilder: spannablestringbuilder text = new spannablestringbuilder(); text.append(getstring(r.string.before)); //now create clickablespan clickablespan clickablespan = new clickablespan() { @override

android layout with fragment breaks when toolbar is there -

couldn't find more appropriate title problem following. have linearlayout contains linearlayout , fragment. want add toolbar when so, see toolbar , other screen white. here layout: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" tools:context="xeniasis.mymarket.mainactivity"> <include android:id="@+id/toolbar" layout="@layout/toolbar" /> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:baselinealigned="false" android:weightsum="4"> <linearlayout andro

c++ - Initializing reference to istream -

i trying write program can process either stdin or file specified on command line. i'm doing trying initialize reference istream either refer cin or ifstream , using conditional. (similar techniques described here , here ) but when try ifstream , seem error basic_istream move-constructor declared protected . istream& reftocin ( cin ); // ok const istream& reftofile = ifstream(args[1]); // ok const istream& instream ( fileisprovided()? ifstream(args[1]) : cin ); // causes error: // std::basic_istream<char,std::char_traits<char>>::basic_istream' : // cannot access protected member declared in class std::basic_istream<char,std::char_traits<char>> processstream(instream); // either file or cin can reasonably done way? there alternative i'm overlooking? the problem code following: your left-hand side of ternary operator temporary (rvalue). however, right hand-side lvalue ( cin lvalue).

android - Does using a lot of nested layouts make the app slower? -

this question has answer here: android nested layouts 2 answers i working on big application , , have use lot of nested layouts linearlayout . times android studio warn me using lot of (weight) attribute , wondering , using lot of nested layouts make application slower ? i yes, in older devices limited hardware capabilities. take instance at: https://developer.android.com/training/improving-layouts/optimizing-layout.html simpler layouts means less work in ui thread in order draw therefore app faster , more responsive.

java - Variable doesn't get updated after function processes -

this question has answer here: how compare strings in java? 23 answers i'm building calculator app 2 textviews (one formula , 1 result). result after calculations stored in variable called result left empty default. when run it, after function executes, works result variable still remains empty string. please me. scientificcalculator.java int prevanswer = 0; textview formulascreen; textview resultscreen; string formuladisplay = ""; string resultdisplay = ""; string result = ""; string operator; public void onclickequals(view view) { toast toast = toast.maketext(getcontext(), "equals to: " + string.valueof(result), toast.length_short); toast.show(); if (operator == "+" || operator == "-" || operator == "x" || operator == "÷") { getresult(); updatere

java - Too much RAM Usage in Android Application -

in application calling activity, in new handler started. later activty gets restarted again long using application. possible handler causing explosive ram usage 450 mb because never closed? final handler handler = new handler(); final int[] = {0}; handler.post(new runnable() { @override public void run() { log.i("pointscopy", pointscopy.tostring()); appear(pointscopy.get(i[0])); i[0]++; if (i[0] < pointscopy.size()) { handler.postdelayed(this, 1500); } } }); thanks answering

vba - Fix database link - Error 3044? -

i have access database developed in access 2003 or 2007 have inherited. database split front-end , back-end, , have come across need programmatically re-link back-end due technical competence of people handling database. problem error 3044 (not valid path) when attempting re-link 2 tables, rest re-link fine. error message displays original, defunct back-end file in directory not exist. able gleam cause of issue this thread : "after looking through issue, appears reason seeing problem these 8 specific tables because each have @ least 1 memo field within them has version history turned on (append property set yes). when property set “yes”, stores additional information these linked tables within 1 of system tables , whatever reason after table linked seems retain original link information these tables." sounds ms access bug, there go. set "no", , far fine! this appears match behavior, , solution indeed work in defunct version. prefer keep option &quo

html - simple PHP contact form not sending one input form value -

as title says, have simple php contact form 1 of input values not being post rest of values. it part of div hidden jquery until value clicked, value part of same div post, unsure if causing problem. the attending , song_choice inputs hidden jquery until accepts radio button clicked. attending input 1 input not post. unsure issue may be, must simple missing googling, cannot figure out. below code: html: <form action="email_form.php" method="post"> <h5 class="rsvp-text">please respond <strong>august 15, 2015</strong></h5> <input class="rsvp-input" type="text" name="name" placeholder="please enter first & last name:" ><br> <input type="radio" class="rsvp-radio" id="accepts-button" value="accepts pleasure" name="rsvp_response"> accepts pleasure <input type="radio" class="rsv

jQuery Deferred not working like expected -

i work jquery , deferred , there (for me) unexpected behavior. hope can explain me. what plan is: want iterate on list of keys. every key create deferred , call function (dosomething), pass key , callback method (where resolve deferred). after call add deferred list. function dosomething async , calls @ end overgiven callback method. after iteration, await deferreds , display alerts. the following snippet first try, isn't working correct. expected 3 alerts '0', '1' , 'first,second'. '1'. var dosomething = function(key, callback) { window.settimeout(function() { callback(key); }, 0) } var items = new array(); var processes = new array(); var keys = ['first', 'second']; (var idx in keys) { var deferred = $.deferred(); dosomething(keys[idx], function(item) { items.push(item); deferred.resolve(); }); processes.push(deferred.promise()); } processes[0].

c# - SignalR: Receive Custom Id on Every Call Including OnConnected -

i using signalr relay messages webapi server back-end javascript web page. these messages relayed users need map signalr connectionid custom id of user of webpage. currently webapi uses formsauthentication , custom id need in cookie. initially inherited iuseridprovider pull value off of cookie: public class customidprovider : iuseridprovider { public string getuserid(irequest request) { cookie formsauthcookie = request.cookies[formsauthentication.formscookiename]; try { formsauthenticationticket ticket = formsauthentication.decrypt(formsauthcookie.value); var obj = jsonconvert.deserializeobject(ticket.name) jobject; return (string)obj.getvalue("userid"); } catch (exception) { return null; } } } which worked far getting custom id correctly. value never set on identity far tell. unable edit of identity values due context.user.identity.name being rea

Upload to Azure Blob from Xamarin.Forms PCL -

i'm trying upload image's stream azure blob xamarin.forms pcl app using windowsazure.storage 7.0.2-preview. reason, storagecredentials doesn't recognize accountname of sas token. var credentials = new storagecredentials("https://<account-name>.blob.core.windows.net/..."); cloudstorageaccount account = new cloudstorageaccount(credentials, true); and uploading this: public async task<string> writefile(string containername, string filename, system.io.stream stream, string contenttype = "") { var container = getblobclient().getcontainerreference(containername); var filebase = container.getblockblobreference(filename); await filebase.uploadfromstreamasync(stream); if (!string.isnullorempty(contenttype)) { filebase.properties.contenttype = contenttype; await filebase.setpropertiesasync(); } return filebase.uri.tostring(); } how can resolve problem?

Capistrano and Git Deploy Rails App -

when trying deploy rails app production server capistrano, doesn't seem recognize project being git repo, despite me having cloned project directly github. the git log: $ git status on branch master branch up-to-date 'origin/master'. nothing commit, working directory clean cap log: $ cap production deploy triggering load callbacks * 2016-06-01 16:30:26 executing `production' triggering start callbacks `deploy' * 2016-06-01 16:30:26 executing `multistage:ensure' * 2016-06-01 16:30:26 executing `deploy' * 2016-06-01 16:30:26 executing `deploy:update' ** transaction: start * 2016-06-01 16:30:26 executing `deploy:update_code' executing locally: "git ls-remote git@github.com:mitigation/mpm.git r1" command finished in 662ms * refreshing local cache revision 8c86d067abde1464f88902566324a99e22cd3147 @ /var/folders/xs/5qz1glwj30v51rwpxhyclw880000gn/t/mpm executing locally: cd /var/folders/xs/5qz1glwj30v5

reactjs - how to update a route in React Router without re-mounting the component in a single page app? -

i'm looking way "cosmetically" update route in address bar of react/redux/react-router/react-router-redux application, without causing component remount when route changes. i'm using react css transition groups animate entering route. when user goes from /home/ to /home/profile/bob , an animation fires. however, once on /home/profile/bob , user can swipe left/right other profiles -- /home/profile/joe etc. i want url in address bar update when happens, causes profile component re-mount, re-triggers css transition group, causing animation trigger -- want animation trigger when going non-profile route profile route, not when switching between profile routes. i hope makes sense. i'm looking way "cosmetically" update app url without forcing re-mounting of component manages route. if using react router, mount/unmount when change url. that's normal behaviour. it's same thing transitioning between pages, can declare , in/o

websocket - myWebSocketSubject.multiplex(..).subscribe().unsubscribe() closes connection, event further observers exists -

the following code close connection, event further observers exists on mywebsocketsubject: mywebsocketsubject.observable.websocket('ws://mysocket'); mywebsocketsubject.subscribe(); mywebsocketsubject.multiplex(..).subscribe().unsubscribe() // connection closed my expectation was, connection gets closed last unsubscribe() call (and not first one). use case if right, multiplex(..) operator, on create , complete message send socket, e.g. allows un-/subscribe on server side specific event. my preferred web socket service therefore below. there exists 1 connection, , single connection provides several streams. on first subscription web socket connection gets created; , last unsubscribe call connection gets closed. each data-stream un-/subscribe message sent once. i haven't found solution use websocketsubject.multiplex(..) method... preferred example web socket service export class websocketservice { connection: websocketsubject<any>; construct

ios - Swift: Why does switching over textfields work? -

for example: func textfielddidbeginediting(textfield: uitextfield) { switch textfield { case statefield: print("editing state") case countryfield: print("editing country") default: break } } is because looking @ address fields? right way use switch statement? under hood, switch statement uses pattern matching operator ( ~= ) in order define comparisons can do. in case, it's using this version : @warn_unused_result public func ~=<t : equatable>(a: t, b: t) -> bool this takes 2 equatable arguments of same concrete type. in switch statement, each case passed a , , statement switch on passed b . bool returns defines whether case should triggered, in case return value of a == b . uitextfield inherits nsobject , conforms equatable via isequal . therefore valid use 2 uitextfields operator, , therefore valid use them in switch . as base implementation, isequal checks pointer equality.

c# - How do update an item in an ObservableCollection? -

i have , observablecollection reason code not work. private void updatechildreninclass() { var item = childreninclass.firstordefault(i => i.name == currentchild.name); if (item != null) { item = currentchild; } } item displays currentchild properties if in chidreninclass item properties have not been updated. the problem item pointing object in observablecollection wanted update, set item point object(currentchild)

swift - Why do I get an NSInvalidArgument Exception, reason: 'Unable to parse the format string' -

although there ton of threads subject, haven't been able find answer problem. when refactored function below pass search argument nspredicate instead of hard coding search value, error: *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'unable parse format string "formulaname == %0"' func fetchformula() { let fetchrequest = nsfetchrequest(entityname: "formula") let calculation = calculator.selectedformula let name = calculation.formulaname // name = baechle let predicate = nspredicate(format: "formulaname == %0", name) fetchrequest.predicate = predicate { let results = try managedobjectcontext.executefetchrequest(fetchrequest) as? [formula] if (results != nil) { formula.text = results?[0].formulaname } } catch { fatalerror("error fetching data!") } return } even though think syntax correct, i've tried every other

lambda - IncompatibleClassChangeError in Java -

Image
after learning lambda expressions in java, tried practice simple examples. in first example getting following error. exception in thread "main" java.lang.incompatibleclasschangeerror @ java.lang.invoke.methodhandlenatives.linkmethodhandleconstant(methodhandlenatives.java:384) @ com.example.lambda.hellolambda.main(hellolambda.java:15) caused by: java.lang.nosuchmethodexception: no such method: java.lang.invoke.lambdametafactory.metafactory(lookup,string,methodtype,methodhandle,methodhandle,methodtype)callsite/invokestatic @ java.lang.invoke.membername.makeaccessexception(membername.java:763) @ java.lang.invoke.membername$factory.resolveorfail(membername.java:880) @ java.lang.invoke.methodhandles$lookup.resolveorfail(methodhandles.java:1019) @ java.lang.invoke.methodhandles$lookup.linkmethodhandleconstant(methodhandles.java:1284) @ java.lang.invoke.methodhandlenatives.linkmethodhandleconstant(methodhandlenatives.java:382) ... 1 more caused by: java.lang.nosuchmethoderror:

c# - Name doesn't exist in the current context LEFT OUTER JOIN in LINQ -

i doing left outer join on multiple tables. getting following error "the name 'ep' not exist in current context" getting error on 2 nd join onwards. doing wrong. from c in corporates join ep in employeepositions on c.id equals ep.corporateid eps epsj in eps.defaultifempty() join e in employees on ep.employeeid equals e.id es esj in es.defaultifempty() join ee in employeeevaluations on e.id equals ee.employeeid eels eelsj in eels.defaultifempty() join ees in employeeevaluationstatuses on ee.evaluationstatusid equals ees.id eevls eevlsj in eevls.defaultifempty() join v in vouchers on e.id equals v.employeeid vs vsj in vs.defaultifempty() select new { ep = ep, empevals = ee, empevalstatus = ees } if have outer join (a groupjoin , actually), range variable changes. let me explain. in example, first part ... from c in corporates join ep in employeepositions on c.id equals ep.corporateid ... inner join. range variable ep here. that's v

opencart - Fatal error: Call to undefined function session_id() when installing -

i've installed opencart version 2.2.0.0 in freebsd server 10.3-release-p3. followed installation instructions linux of install.txt file. in step 5, visit store homepage e.g. http://www.example.com or http://www.example.com/store/ , in response fatal error: fatal error: call undefined function session_id() in /usr/local/www/opencart/system/library/session.php on line 23 this happens when installing both freebsd package , source. ideas? it seems don't have session php extension. try run: php -m | grep session in case empty output, install php-session extension via pkg or ports tree.

ios - Doing http request with silent notification -

i want use silent push notification in app. enabled background modes on app , phone. when silent notification arrives didreceiveremotenotification delegate method calling. can't http request in method. using following code: func application(application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject], fetchcompletionhandler completionhandler: (uibackgroundfetchresult) -> void) { print("step 1") let request = nsmutableurlrequest(url: nsurl(string: "url")!) request.httpmethod = "post" let poststring = "search=\(username)&me=\(anonid)" request.httpbody = poststring.datausingencoding(nsutf8stringencoding) let task = nsurlsession.sharedsession().datataskwithrequest(request) { data, response, error in print("step 2") if error == nil { let jsonresult: dictionary = (try! nsjsonserialization.jsonobjectwithdata(data!, options: nsjsonreadin

using group by in subquery in sql -

how around error : unable use aggregate or subquery in expression used in group list of group clause. here query : select id, name,daya,montha,yeara, sum(x) x, (select sum(x) group month) total, table_a group id,name,montha,daya,yeara, sum(x) in other words : sample data : id name daya montha yeara x =========================== 1 name1 2 3 2016 4 2 name2 2 3 2016 3 3 name1 2 3 2016 2 expected result : id name daya montha yeara x total =================================== 1 name1 2 3 2016 4 6 2 name2 2 3 2016 3 3 3 name1 2 3 2016 2 6 thanks in advance you're query has more problem. (select sum(x) group month) total , same table, not since column month not mention inyour group by. when using sub query in query, must guaranteed return 1 record. based on sample data , expected results... create table table_a( id int, name varchar(25), daya int,

html - Choosing how far you scroll before a jquery animate activates -

i have code $(window).load(function () { $elem1 = $('#div1'); $elem2 = $('#div2'); var scrollstate = 'top'; $(window).scroll(function () { var scrollpos = $(window).scrolltop(); if ((scrollpos != 0) && (scrollstate === 'top')) { $elem1.stop().animate({ opacity: '1.0' }, 300); $elem2.stop().animate({ marginleft: '50px' }, 300); scrollstate = 'scrolled'; } else if ((scrollpos === 0) && (scrollstate === 'scrolled')) { $elem1.stop().animate({ opacity: '0.0' }, 300); $elem2.stop().animate({ marginleft: '0px' }, 300);

postgresql - Errors with an easy PL/pgSQL Function -

i'm trying write first pl/pgsql function. right supposed return number of characters in value passed it. create or replace function public.cents(money) returns int language plpgsql leakproof $function$ declare new_price money; size int; begin size := char_length(money); return size; end; $function$; when try test $66.66 1 error: select cents($66.66); error: syntax error @ or near ".66" line 1: select cents($66.66); ^ and if use $66 different error: select cents($66); error: there no parameter $66 line 1: select cents($66); ^ using integer 66 gives me third error: select cents(66); ^ hint: no function matches given name , argument types. might need add explicit type casts. what doing wrong here? are sure want use data type money ? consider: postgresql: datatype should used currency? if need type money , sure understand role of locale settings type. read manual

c# - Add Include to repository -

i have working repository. public class repository<tentity> : irepository<tentity> tentity : class { protected readonly dbcontext context; public repository(dbcontext context) { context = context; } public tentity get(int id) { return context.set<tentity>().find(id); } public ienumerable<tentity> getall() { return context.set<tentity>().tolist(); } public ienumerable<tentity> find(expression<func<tentity, bool>> predicate) { return context.set<tentity>().where(predicate); } public tentity singleordefault(expression<func<tentity, bool>> predicate) { return context.set<tentity>().singleordefault(predicate); } public void add(tentity entity) { context.set<tentity>().add(entity); } public void remove(tentity entity) { context.set<tentity>().remove(entity);

testng - How can we pass a single test method as parameter in jenkins? -

in testng file have <test name="tests" parallel="false"> <classes> <class name="packagename.testplanname"> <methods> <include name="testmethod"></include> </methods> </class> </classes> </test> how can pass testplanname , testcase name parameters in jenkins? use maven. if want execute entire class test methods can use mvn test -dtest=testplanname if want execute particular test in class mvn test -dtest=testplanname#testmethod

php - How can I wrap page numbers from the_posts_pagination in WordPress into my own div? -

in wordpress, i'm using the_posts_pagination spit out prev/next buttons , page numbers in between. don't how wordpress spits out own markup when i'd group elements divs. this current code: php <?php the_posts_pagination( array( 'mid_size' => 2, 'prev_text' => __( 'previous page', 'textdomain' ), 'next_text' => __( 'next page', 'textdomain' ), 'screen_reader_text' => ( '' ) ) ); ?> it spits out this: html <nav class="navigation pagination" role="navigation"> <div class="nav-links"> <a class="prev page-numbers" href="#">prev page</a> <a class="page-numbers" href="#">1</a> <span class="page-numbers current">2</span> <a class="page-numbers" href="">3</a> &

ruby - Rails normalize csv file data -

i'm trying import tsv (tab separated data) file database it's not formatted properly. columns price , count separated space (with exception of header line) , values both placed price key, moving data wrong key value pairs. tsv file: purchaser name item description price count merchant address merchant name alice bob $10 off $20 of food 10.0 2 987 fake st bob's pizza example name $30 of awesome $10 10.0 5 456 unreal rd tom's awesome shop name 3 $20 sneakers $5 5.0 1 123 fake st sneaker store emporium john williams $20 sneakers $5 5.0 4 123 fake st sneaker store emporium in /models/purchase.rb : class purchase < activerecord::base # validates :item_price, :numericality => { :greater_than_or_equal_to => 0 } def self.import(file) csv.foreach(file.path, :headers => true, :header_converters => lambda { |h| h.downcase.gsub(' ', '_')},

ios - Xcode 7.3 - Unknown class <MealViewController> in Interface Builder file -

i'm beginner developer , i'm following getting started apple tutorial learn basics. this "unknown class" has appeared in few other threads none of answers seemed fix problem time. checked references class , storyboard source code project builder/compile sources. keeps failing. the breakpoint appears in part of code @ custom class mealtableviewcontroller.swift override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "showdetail" { let mealdetailviewcontroller = segue.destinationviewcontroller as! mealviewcontroller if let selectedmealcell = sender as? mealtableviewcell { let indexpath = tableview.indexpathforcell(selectedmealcell)! let selectedmeal = meals[indexpath.row] mealdetailviewcontroller.meal = selectedmeal } } else if segue.identifier == "additem" {

gis - Exponare 5.6 zoom & pan no longer works in embedded browser -

Image
previously our clients work on exponare 3.5. didn't have issue zoom & pan in embedded browser. after updating exponare 5.6 eventhough map working fine zoom & pan longer works. ideas please. i have manage rectify issue. issue due embedded ie version. exponare 6 doen't work ie 11 properly. client machine using ie 11. in our installer have change registry use ie 11 well. if change value application name in following path "software\microsoft\internet explorer\main\featurecontrol\feature_browser_emulation" either in "hklm" or "hkcu" ie 10 (see image) works.

javascript - Authentication Credentials with the SendPulse API for Node -

i'm using sendpulse client library written in node smtp. here's snippet example.js: var api_user_id="user_id" var api_secret="user_secret" var token_storage="/tmp/" sendpulse.init(api_user_id,api_secret,token_storage); i've tried using email address i've created account with, , password gave me on smtp settings page, user_id , user_secret, respectively. when run code, error message: { error: 'invalid_request', error_description: 'the request missing required parameter, includes invalid parameter value, includes parameter more once, or otherwise malformed. check "access token" parameter.', message: 'the request missing required parameter, includes invalid parameter value, includes parameter more once, or otherwise malformed. check "access token" parameter.', error_code: 1 } however, doesn't seem matter do, you'll error message. can run sendpulse.ini(); ,

javascript - Splitter doesn't work until weird sequence of steps is performed -

trying working: https://github.com/nathancahill/split.js for reason, have disable css height of container, drag splitter random amount, , re-enable height property in order splitter work. until can't move splitter @ all. idea why might or how simulate effect work? to clarify, have vertical splitter of 2 divs , if try drag splitter, nothing happens. however, if hit f12 in chrome (latest version), disable height on container, drag little bit, , re-enable height, works flawlessly. just disabling , re-enabling height doesn't work , dragging it. has dragged while height property disabled. it's extremely weird , took me forever figure out workaround. idea why might or how can fix it? here settings on initialization: split(['#txtchatwindow', '#txtguesswindow'], { "direction": 'vertical', "sizes": [50, 50], "minsize": [75, 170], "guttersize": 15 }); figured out. i'm using bootstrap ta

python - MDB_INVALID : File is not an LMDB file -

i having problem going form lmdb files generated on mac (64-bit) jetson tx1 (32-bit) after full day of trouble shooting, i've come conclusion lmdb files work on tx1 dont work on mac, , lmdb files work on mac don t work on tx1. creating lmdb files mac, , using external drive bring them on tx1. know how convert lmdb file 64-bit format 32 bit format?? everything else works smoothly.. ^^ thanks j edit : conclusions questions the jetson tx1 32 bit , makefile caffe had modified , lmdb part, compile. thus, lmdb created 64bit machine not work 32 bit machine , vice versa. have feeling making same changes while making caffe on mac solve problem, haven't tried out yet.

Embed node.js, socket.io and mongodb chat code -

i have created chat application using node.js, socket.io , mongodb , hosted on server. now want use chat application on different website taking link or code , embed in normal website hosted in server uses apache.

java - checking if a method is called using ASM -

i working on deobfuscator application heavily obfuscated. there lot of redundant methods remove simplify code. unfortunately, don't have enough knowledge asm , bytecode able this, please enlighten me on how use asm check methods called? gathering list of methods called class straightforward. if using asm sax api override public void visitmethodinsn(int opcode, string owner, string name, string desc) and collect method name, owners , signatures. if use tree api same information available methodinsnnodes. generating list of methods class declares/defines straight forward - each 1 result call visitmethod or method node in tree api.

Is there a way to collect address info via Paypal donation IPNs -

i've got scenario need collect address details paypal when user donates site. can tell in paypal sandbox details aren't returned via ipn or pdt when transaction related donation. is there i'm missing account setting or paypal variable can make possible? at moment i'm using buy option below return address details: input type="hidden" name="cmd" value="_xclick" simply changing cmd donation , address info stops coming in via ipn: input type="hidden" name="cmd" value="_donations" i don't believe address given on donations. best bet call donation in title & send still xclick. change displayed button image donation button, use xclick instead of _donation. believe that's possible way.

python - PySpark: Calculate grouped-by AUC -

spark version: 1.6.0 i tried computing auc (area under roc) grouped field id . given following data: # within each key-value pair # key "id" # value list of (score, label) data = sc.parallelize( [('id1', [(0.5, 1.0), (0.6, 0.0), (0.7, 1.0), (0.8, 0.0)), ('id2', [(0.5, 1.0), (0.6, 0.0), (0.7, 1.0), (0.8, 0.0)) ] the binaryclassificationmetrics class can calculate auc given list of (score, label) . i want compute auc key (i.e. id1, id2 ). how "map" class rdd key? update i tried wrap binaryclassificationmetrics in function: def auc(scoreandlabels): return binaryclassificationmetrics(scoreandlabels).areaunderroc and map wrapper function each values: data.groupbykey()\ .mapvalues(auc) but list of (score, label) in fact of type resultiterable in mapvalues() while binaryclassificationmetrics expects rdd . is there approach of converting resultiterable rdd the auc function can applied?

android - How to remove colored EditText focus border -

Image
i wanted remove bottom edittext focus border on edittext . want edittext looks this: that being said, have looked online make bottom focus color of edittext removed tried set edittext android:background="#00000000" , android:background="@android:drawable/editbox_background_normal" . however, hte first hides entire underline border (which want hide focus underline color, not underline itself) , latter makes edittext big white box. there way replicate want above? thanks! try this edittext_bg.xml <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <!-- draw 1dp width border around shape --> <stroke android:color="#d3d3d3" android:width="1dp" /> </shape> </item> <!-- draw botto

office365 - How to get AppKey using Microsoft Graph API -

i'm creating new application using post https://graph.microsoft.com/beta/applications i can appid back, can't find way appkey. access app later using application credentials. update: send password credential during application creation: newappobj.passwordcredentials = new list<aobj.azurepasswordcredential>(){ new aobj.azurepasswordcredential() { customkeyidentifier = "t1rexhnmuumvqimnbpkirw==", keyid = guid.newguid().tostring(), value = "wgjbf8vg3gm1xrgpc43fvtio7scptgwh0jd6cjird40dcx3kp8lmlcdcrrepbridi4cxw1ocnsqjqxozx+oiuw==", startdate ="2016-06-01t13:59:30z",// datetimeoffset.utcnow, enddate = "2017-06-02t13:59:30z"//datetimeoffset.utcnow.addyears(2) } }; when generate authorization token using secret key set before value, response back, when trying use call microsoftgraph api: { "

Angular2 Installing 3rd party plugin with Angular-cli -

my angular-cli's angular 2 version 2.0.0-rc.1. trying install angular2-grid , followed exact way described in tutorial, shwos me error. zone.js:101 http://localhost:4200/node_modules/angular2-grid/dist/nggrid 404 (not found)scheduletask @ zone.js:101zonedelegate.scheduletask @ zone.js:336zone.schedulemacrotask @ zone.js:273(anonymous function) @ zone.js:122send @ vm6591:3fetchtextfromurl @ system.src.js:1154(anonymous function) @ system.src.js:1735zoneawarepromise @ zone.js:584(anonymous function) @ system.src.js:1734(anonymous function) @ system.src.js:2759(anonymous function) @ system.src.js:3333(anonymous function) @ system.src.js:3600(anonymous function) @ system.src.js:3985(anonymous function) @ system.src.js:4448(anonymous function) @ system.src.js:4700(anonymous function) @ system.src.js:406zonedelegate.invoke @ zone.js:323zone.run @ zone.js:216(anonymous function) @ zone.js:571zonedelegate.invoketask @ zone.js:356zone.runtask @ zone.js:256drainmicrotaskqueue @ zo

regex - Putty command to find files that are not named in Roman letters -

i need command through putty or find file in server isn't named in roman alphabet. result of command gives me path of file(s) match this. my website's server uses ubuntu linux 12.04.1. and want search in path (/var/www/) , sub-folders of it. this should work find files , directories in /var/www contain characters other upper/lowercase z: find /var/www -iregex '^[.]*[/a-za-z]*$' -o -print leave out -o see is matching. leading [.]* lets use find . -iregexp ... without needing change regexp; can drop /var/www case. you might need adjust [a-za-z] if mean classical roman, didn't have j, u, or w. i still liked erroneous first interpretation, thought looking files weren't named roman numbers , had solution along lines of: find /var/www -iregex '^[.]*\(/\|/m*c?d?x?c*x?l?i*x?i?v?i*\)*$' -o -print (same note on "[.]" on prior example) if you're looking filenames containing non-ascii characters: find /var/www -i

javascript - How to access $.widget.prototype in web page -

on web page, $.widget.prototype not contain functions _trigger, _setoption. i new jquery , want know why , how see private functions on web page? $.widget base class of $.widget , _trigger defined in $.widget. , in jquery ui widget.js, $.widget.prototype assigned jquery ui widget object prototype created $.widget. so $.widget.prototype._trigger not exist, _trigger exists in prototype of real ui widget.

generic code to reverse alternate words in a sentence using python -

can please on how reverse alternate words in sentence end using python. note: not use reversed() eg: aspire systems in america acirema in si systems eripsa s = 'aspire systems in america' l = len(s) - 1 rev = '' for in range (0,l): rev = rev + str(a[l]) l-- i couldnt find way jump "in" , print it. can use split/join ? s = 'aspire systems in america' li = s.split(' ') #["aspire", "systems", "is", "in", "america"] #reverse alternate words index in range (0,len(li),2): #0, 2, 4 rev = '' ch in li[index]: #'a', 's', 'p' ... rev = ch + rev li[index] = rev #now reverse list of words revli = [] word in li: revli = word + revli print ' '.join(revli) #should print expected result it should equivalent following code, uses reversed : s = 'aspire systems in america' li = s.split(' ') #[&qu

javascript - Change cursor on mousedown fails with SVG on Chrome -

i'm trying change cursor when drag on svg cursor change fires when mouse button released. works perfectly, however, in firefox. i'm using chrome version 50.0.2661.102 m. this jquery i'm using: $('#map') .mousedown(function(){ $(this).css( 'cursor', 'move' ); }) .mouseup(function(){ $(this).css( 'cursor', 'auto' ); }); but code snippet added below works should, yet the fiddle created doesn't , nor actual code on site i'm building. how can differently chrome works always? var graph = { "nodes":[ {"name":"1","rating":90,"id":2951}, {"name":"2","rating":80,"id":654654}, {"name":"3","rating":80,"id":6546544}, {"name":"4","rating":1,"id":68987978}, {"name":"5","rating":1,"id&quo