Posts

Showing posts from July, 2014

php - Is it possible to inject a method into a service in symfony services.yml -

there plenty of documentation on internet injecting service service this: http://symfony.com/doc/current/components/dependency_injection/introduction.html however, have service called objectcache configured in symfony's services.yml this: object_cache: class: app\bundle\apibundle\service\objectcache this service has 2 methods getting , setting user object. example: $user = new user(); // assume entity database $this->get('object_cache')->setuser($user); // ... $this->get('object_cache')->getuser(); // instance of $user i want create new service depends on user, makes sense inject user @ service creation: class someservice { public function __construct(user $user) { } } how configure services.yml such user injected new service? object_cache: class: app\bundle\apibundle\service\objectcache some_service: class: app\bundle\apibundle\service\someservice arguments: [@object_cache->getuser()????] this didn't wor...

Too few arguments inheritance c++ -

i'm working on learning inheritance making generic list class. list can unordered list, ordered list, stack , or queue . my list class looks this: class list { public: class node { public: int data; node * next; node(int data); }; int sizeoflist = 0; node * head = nullptr; list::list(); virtual void get(int pos); virtual void insert(int data); virtual void remove(int pos); virtual void list(); virtual int size(); }; my unordered list class looks this: class unorderedlist : public list { public: unorderedlist(); void get(); void insert(int data); virtual void remove(); //takes no parameters because first item removed }; in main() , create array of lists this; list * lists[8]; and make unordered list this: lists[0] = new unorderedlist(); my question: lists[listnum]->get(); gives error "too few arguments in function call" because thinks trying c...

c - Difference between a struct and a pointer to a struct -

i trying understand difference between struct , struct pointer. following code example. code example : #include<stdio.h> typedef struct{ const char *description; float value; } swag; typedef struct{ swag *swag; } combination; as can see there 2 structs here swag, combination. struct combination has pointer struct swag. why can't this: typedef struct{ swag swag; } combination; why have swag *swag . can please explain me difference between 2 code examples? both possible, how appear in memory: case 1 +----+-----+----------+ +->| p | value | struct swag | +----------+----------+ | const char* float | | +----------+ +--+ swag | struct combination +----------+ swag* case 2 +-----------------------+ |+----+-----+----------+| || p | value || struct combination |+----------+----------+| +-----------------------+ the...

What's the difference between "deletemany" and "remove" in mongodb? -

what's difference between 2 commands here? db.collection.deletemany({condition}) db.collection.remove({condition}) as far can say, db.collection.deletemany returns: document containing: > boolean acknowledged true if operation ran write concern or false if write concern disabled > deletedcount containing number of deleted documents ref: db.collection.deleteall where as db.collection.remove return writeresult and remove single document, there similar command, db.collection.removeone db.collection.remove need set , option called justone option limit delete 1 document. otherwise guess similar. node.js drivers when talking node.js drivers , remove has been deprecated (and may removed in future releases) , deleteone or deletemany . hope makes sense ....

character encoding - karaf configuration property is garbled -

i implement org.osgi.service.cm.managedservice interface karaf configuration. when give chinese value property, garbled.initially, files in etc folder encoded in latin1. have tried set utf-8 encoding, has no effect. can me? in karaf, configurations files (ie etc/*.cfg ) handled felix subproject "fileinstall". fileinstall doesn't support yet specified custom character encoding configuration, uses properties class , properties.load(inputstream) , documents: the load(reader) / store(writer, string) methods load , store properties , character based stream in simple line-oriented format specified below. load(inputstream) / store(outputstream, string) methods work same way load(reader)/store(writer, string) pair, except input/output stream encoded in iso 8859-1 character encoding . characters cannot directly represented in encoding can written using unicode escapes defined in section 3.3 of java™ language specification; single 'u' ch...

SQL Server, Having Clause, Where, Aggregate Functions -

in problem trying solve, there performance values table: staff performanceid date percentage -------------------------------------------------- staffname1 1 2/15/2016 95 staffname1 2 2/15/2016 95 staffname1 1 2/22/2016 100 ... staffname2 1 2/15/2016 100 staffname2 2 2/15/2016 100 staffname2 1 2/22/2016 100 and sql statement follows: select top (10) tbl_staff.staffname, round(avg(tbl_staffperformancesvalues.percentage), 0) averagerating tbl_staff inner join tbl_academictermsstaff on tbl_staff.staffid = tbl_academictermsstaff.staffid inner join tbl_staffperformancesvalues on tbl_academictermsstaff.staffid = tbl_staffperformancesvalues.staffid (tbl_staffperformancesvalues.date >= @datefrom) , (tbl_academictermsstaff.schoolcode = @schoolcode) , (tbl_academictermsstaff.academictermid = @academictermid) gro...

icloud - iOS app with cloud based service -

Image
i'm trying create, update, insert records icloud along app's id. did created record type in icloud dashboard , working when device contains icloud account has been logged in. how use icloud service devices using app ? saw api access , how implement token based access ? please me problem. here screenshot of showing permissions box. you can see here can grant read access anonymous users if wish, although unwise if plan release app on apps store obvious reasons hope.

java - why we are storing the client secret as plain text in database in spring OAuth 2.0? -

i new guy spring oauth 2.0. use "client credentials" grant type our resource server .while implementing type not sure maintaining "client id" , "client secret" plain text in databases. hack these client id , client secret , may miss use these if store client secret plain text. can 1 please let know whether there way keep these values "client id" , "client secret" in encrypted format?. is there default option available in spring oauth 2.0 encode , decode it? please let usknow there specific reason store client secret plain text? thanks, you must not save client secret plain text. client secret must not decryptable. use org.springframework.security.crypto.bcrypt.bcryptpasswordencoder , encrypt client secret using bcrypt algorithm.

Gulp-sass not compiling Bourbon.io @include Transition -

i upgraded version of gulp-sass today , gulp , i'm having issues bourbon.io in sass style reads: .dropdown-is-active { opacity: 1; @include transform(translatey(0)); @include transition(opacity 0.3s 0s, visibility 0.3s 0s, transform 0.3s 0s); } and compiles this: .cd-dropdown.dropdown-is-active { opacity: 1; -webkit-transform: translatey(0); -moz-transform: translatey(0); -ms-transform: translatey(0); -o-transform: translatey(0); transform: translatey(0); -webkit-transition: opacity, visibility, -webkit-transform; -moz-transition: opacity, visibility, -moz-transform; transition: opacity, visibility, transform; } } as can see not adding seconds transitions....any ideas anyone? if change all, or have single property compile correctly, if try chain - breaks. thanks! you're duplicating transition time in function call: @include transition(opacity 0.3s 0s, ...) you have 0s , 0.3s . maybe that's why doe...

camera - libgdx tiledmap flicker with Nearest filtering -

i having strange artifacts on tiledmap while scrolling camera clamped on player (who box2d-body). before getting issue used linear filter tiledmap prevents strange artifacts happening results in texture bleeding (i loaded tiledmap straight .tmx file without padding tiles). however using nearest filter instead gets rid of bleeding when scrolling map (by walking character cam clamped on him) seams lot of pixel flickering around. flickering results can better or worse depending on cameras zoom value. when use "orthocamcontroller" class libgdx-utilities allows scroll map panning mouse/finger don't these artifacts @ all. assume flickering might caused bad camera-position values received box2d-body's position. 1 more thing should add here: game instance runs in 1280*720 display mode while gamecam renders 800*480. wen change gamecam's rendersolution 1280*720 don't artifacts tiles way tiny. has experienced issue or knows how fix that? :) i had simil...

android - Proper notification of AsyncTaskLoader about data changes from background thread -

i want implement asynctaskloader custom data source: public class datasource { public interface datasourceobserver { void ondatachanged(); } ... } datasource keep list of registered observers , notify them changes. customloader implement datasourceobserver . question how notify customloader since loader.oncontentchanged() must called ui thread in case datasource operations (and calls datasourceobserver.ondatachanged() ) done background threads. updated idea selvin tip : public class customloader extends asynctaskloader<...> implements datasource.datasourceobserver { private final handler observerhandler; public customloader(context context) { super(context); observerhandler = new handler() } @override public void ondatachanged() { observerhandler.post(new runnable() { @override public void run() { oncontentchanged(); } }); } } ...

Overloading c# variable -

i'm little new c# , i've achieved i'm confused why has been allowed. public interface ibase { } public interface isub : ibase { } public class thing { protected ibase provider; public thing(ibase provider) { this.provider = provider; } } public class anotherthing : thing { protected isub provider; public anotherthing(isub provider) : base(provider) { this.provider = provider; } } i hope i'm being dense, don't understand how allowed override provider without causing confusion compiler. the code work. i'm surprised not getting warning either. what doing hiding protected member provider providing new declaration in derived class. allowed, should decorate declaration new keyword make more explicit intended hide member , not accident/oversight.

Alternative to Jtable plugin with PHP examples? -

the jtable found here http://jtable.org useful, doesn't have important examples in php cascade dropdownlist , etc. there example asp.net. so there alternative has same crud functionality php example database 7 000 records? i have been using datatables , i'm happy it. there many plugins plugin well.

android - Asynctask heavy usage -

asynctask designed helper class around thread , handler , not constitute generic threading framework. asynctasks should ideally used short operations (a few seconds @ most.) this says in documentation. speaking network language, how long 'a few seconds'? my app following, array list db, send server, list (json), send okay received list, parse jsons, insert list inside db, other processes in db, update ui.. (the list can reach 5000-1000 entries of object instances.) is usage of asynctask such stuff idea? need update gui according results of response server. if no, other alternatives have? i've did similar you. i've downloaded bunch of images (about 5000), saved in sd card , saved row in database. i've used async task no issues , see no problem using it. recommend use progress bar show user app doing , option cancel task (asynctask provides cancelation mechanism)

javascript - Suppress Safari can't open the page because the address is invalid? custom app launch -

i'm launching custom app web browser on iphone. if app not installed redirecting web page on website. if installed goes specific page on app this works expected except 1/2 second safari displays modal window saying following cannot open page safari cannot open page because address invalid. i know address invalid , know if possible suppress error message in safari. thanks i did find solution worked this. had working settimeout of 25ms. reason on nexus 5 needed drop down 5ms. i ended using following: function gotoapp(applocation, fallbacklocation) { settimeout(function() { window.location = fallbacklocation; }, 5); window.location = "nativeappurl://" + applocation; } function gotoweb(baseurl, weblocation) { window.location =baseurl + "/"+ weblocation; } </script> then have 2 buttons have onclick="gotoapp('appdestination', 'location')"...

sql - Mysql Distinct select with replace -

Image
i have following mysql select statement returns below result , battling result after. select `tvshow`.`idshow` `idshow`,`tvshow`.`c00` `showname`, if(count(distinct `episode`.`c12`), count(distinct `episode`.`c12`),0) `totalseasons`, if(count(`episode`.`c12`),count(`episode`.`c12`),0) `totalepisodecount` ((((`tvshow` left join `tvshowlinkpath` on ((`tvshowlinkpath`.`idshow` = `tvshow`.`idshow`))) left join `path` on ((`path`.`idpath` = `tvshowlinkpath`.`idpath`))) left join `episode` on ((`episode`.`idshow` = `tvshow`.`idshow`))) left join `files` on ((`files`.`idfile` = `episode`.`idfile`))) group `tvshow`.`idshow` having (count(`episode`.`c12`) > 0) select result i trying 4th column have seasons listed in e.g "season 1,season 2,season 3" i can the data need running following select select distinct c12 episode idshow = 1 it returns following. so thought use replace change ...

php - Updating data in mysql table -

i trying see if keyword exists in table searchedwords. if does, countr increases one. if not exists in table, used insert. problem is, keyword being passed site not stored in db. other big problem countr not add at. because of if statement? or while loop? <?php date_default_timezone_set('asia/manila'); $today = date('m-d-y'); echo $today; $urltopost = "http://opac.usls.edu.ph/tlcscripts/interpac.dll?search"; $datatopost = "formid=0&config=pac&limitsid=0&startindex=0&searchfield=7&searchtype=1&itemsperpage=20&searchdata=$_post[keyword]"; $ch = curl_init ($urltopost); curl_setopt ($ch, curlopt_post, 1); curl_setopt ($ch, curlopt_postfields, $datatopost); curl_setopt ($ch, curlopt_header, 0); curl_setopt ($ch, curlopt_returntransfer, 1); $returndata = curl_exec ($ch); echo $returndata; $con=mysqli_connect("...","...","...","...")or die ('error: ' . mysql_error()); $sq...

jpa - Issue with weblogic.xml in weblogic 10.3.2 while deploying war file (struts2 and hibernate 4.1) -

i made web application using struts2 , hibernate , created war of it. it working fine in tomcat there issue weblogic since load jpa 1.0 created weblogic.xml given below <?xml version="1.0" encoding="utf-8"?> <weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"> <container-descriptor> <prefer-web-inf-classes>false</prefer-web-inf-classes> <prefer-application-packages> <package-name>antlr.*</package-name> <package-name>javax.persistence.*</package-name> </prefer-application-packages> </container-descriptor> </weblogic-web-app> this solved issue , working fine weblogic 10.3.3 when deployed same war above weblogic.xml in weblogic 10.3.2 giving below error validation problems found problem: cvc-complex-type.2.4a: expected elements 'default-mime-type@ http://xmlns.oracle.com/weblogic/we...

linux - cannot open shared library file while running program in arm machine -

i have build program in linux(ubuntu 12.04) using arm-linux-gnueabi-g++. program compiles fine. when transferred program arm machine , tried run got error: error while loading shared libraries: libpvrocl.so: cannot open shared object file: no such file or directory. i copied library /usr/local/lib folder of arm machine did not work. cannot change conf file or environvent variables of arm machine. arm system stripped down extent doesn't have ldconfig or ldd or else. ldd run on more capable system against executable shows line: not dynamic executable can give me solution or show me path? e appreciated. i tried build code statically , specified libraries full path. not build gives me error: attempted static link of dynamic object `/opencv/opencv/install/lib/libopencv_core.so'

ios - If a cell's detailTextLabel is empty how do I figure out where its right edge would be if it wasn't empty? -

Image
i'm using table view form. when row tapped add text field cell (the cell value1 type) , user can edit contents of detailtextlabel. position text field spans distance right edge of textlabel right edge of detailtextlabel. set frame of text field on detailtextlabel except goes left far possible. visually it's nice--there no jitters when hiding/unhiding text field. it looks (without green , red): this works great when detailtextlabel has in it. when detailtextlabel empty frame not yet defined. if log in frame zero. don't have reference placing text field precisely on detailtextlabel be. i start figuring things out right side of textlabel , go right until number of pixels right edge of cell. but, example, if there's info button there? nice thing using detailtextlabel reference it's right edge correctly placed cell. any ideas? you can put space (' ') instead of empty label. way not visible user, , still nice reference

ruby - Showing two types of "posts" in same view mixed together (Rails) -

i have 2 models...a designs model , products model identical both nested in different models (one nested in collection model , other in assortment model). create product first have create assortment create product in assortment. i show (in view) of designs , of products mixed sorted date. how can accomplish this? way have (which weak solution) have 1 page separates two...but tacky , not user friendly. i know post lean , short if better explanation, please feel free ask. how this: things = design.all.to_a.concat product.all.to_a things.sort! {|t1, t2| t1.date <=> t2.date} #or whatever date field called

if statement - PHP Script not executing second command -

i have script inserts 2 notifications database table it's adding first note , not second. i've tried swapping them around , still posts first of 2. here code: <?php $type = "---"; $title = "---"; $note1 = "note 1"; $note2 = "note 2"; ?> <?php if($business1 !== ""){ $insert_note1_sql = "insert notes (id, recipient, type, title, post, message, date) values('$id', 'business 1', '$type', '$title', '$event', '$note1', '$time')"; $insert_note1_res = mysqli_query($con, $insert_note1_sql); }; ?> <?php if($business2 !== ""){ $insert_note2_sql = "insert notes (id, recipient, type, title, post, message, date) values('$id', 'business 2', '$type', '$title', '$event', '$note2', '$time')"; $insert_note2_res = mysqli_query($con, $insert_note2_sql); }; ?> can see w...

c - How to allocate memory at a specific location -

this c. i think malloc typically allocates next available space on heap after last allocation. is possible have malloc not , choose on heap you'd memory allocated? is there way in general allocate memory on heap , have not next address available "farther"? basically, malloc'd space + more space getting overwritten (as test) i'm losing metadata associated malloc'd space since stored next malloc'd space (even though use different malloc call). thanks, jeremy to temporarily work around memory corruption of blocks of memory allocated malloc , allocate more memory need, blocks larger. give them more space erroneous modifications before program adversely affected. do only temporary debugging purposes, can investigate program’s behavior while figuring out wrong. additionally, there other techniques analyzing improper memory accesses, including analyzers such valgrind , debugger “watchpoint” features interrupt program , inform when chos...

visual c++ - C++ Object reference not set to an instance of an object -

when try compile following program says "build failed. object reference not set instance of object" . i'm kinda new c++ if can me it'll great . i'm trying out example saw in book don't know whats wrong . using namespace std; class matrix { int m[3][3]; public: void read(void); void display(void); friend matrix trans(matrix); } void matrix :: read(void) { cout<<"enter elements of 3x3 array matrix : \n"; int i,j; for(i=0;i<3;i++) { for(j=0;j<3;j++) { cout<<"m["<<i<<"]["<<j<<"] ="; cin>>m[i][j]; } } } void matrix :: display(void) { int i,j; for(i=0;i<3;i++) { cout<<"\n"; for(j=0;j<3;j++) { cout<<m[i][j]<<"\t"; } } } matrix trans(matrix m1) { matrix m2; int ...

android - The method onFetchComplete(List<Application>) of type MainActivity must override a superclass method error -

i trying show content mysql database in listview below listactivity implementing interface fetchdatalistener.but giving errors 1.the method onfetchcomplete(list) of type mainactivity must override superclass method error 2.the method onfetchfailure(list) of type mainactivity must override superclass method error please see below class , interface files class /*package com.example.androidhive; import java.util.list; import android.app.listactivity; import android.app.progressdialog; import android.os.bundle; import android.widget.toast; public class mainactivity extends listactivity implements fetchdatalistener{ private progressdialog dialog; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); initview(); } private void initview() { // show progress dialog dialog = progressdialog.show(this, "", "loading..."); string url = ...

ios - CFBundleDisplayName returns 'null' -

i'm trying app name use navcontroller title, whatever can't cfbundledisplayname value. returns 'null'. this code i'm using [nsbundle mainbundle] infodictionary][@"cfbundledisplayname"] checked bundles = there 1 only. xcode5 / dev target ios5. haven't checked on device though. using simulator. thanks! try code app name nsstring *appname = [[[nsbundle mainbundle] infodictionary] objectforkey:(nsstring *)kcfbundlenamekey];

actionscript 3 - Possible to Publish swf from Flash Pro directly to Amazon S3? -

i naively tried put path amazon s3 publish path in flash professional. it gave me standarad erro, "error creating swf movie file. destination directory not exist. change publish settings." it possible trying do? if can mount server volume ( transmit can this), can publish swf location on volume.

paypal - Is it possible to test two funnels in Content Experiments? -

i looking regarding test ran. although checked tons of websites , articles content experiment didn't find answer questions. here fact. ran test in content experiments test funnel against other funnel, new version of website against old version. funnel 1: homepage 1 => select product 1 => add cart 1 => checkout page 1 => payment card or paypal 1 => thank 1 or thank page paypal funnel 2: homepage 2 => select product 2 => add cart 2 => checkout page 2 => payment card or paypal 2 => thank 2 or thank page paypal (same above) we set final goal using regex. tracks visits thank pages. the result funnel 1 converts better, have doubts because: - funnel 2 looks better (optimized conversions) - checked conversion rates between steps (e.g. homepage select product etc.) , funnel 2 performs better except last step. in first place possible test funnels in content experiments or single landing pages? i consider myself test valid, want hear second o...

javascript - How do I reload a Greasemonkey script when AJAX changes the URL without reloading the page? -

i have application trying create greasemonkey script for. utilizes lot of jquery , ajax load content dynamically. i've noticed url does change each time load new item, though page doesn't refresh. is there listener can place on page relaunch script each time url changes? how depends on site/application , on trying do. here options , easiest , robust first: don't try catch url changes. use calls waitforkeyelements() act on parts of various pages wanted manipulate in first place. neatly handles whole slew of timing issues inherent other approaches. see also: "choosing , activating right controls on ajax-driven site" . just poll url changes. it's simple , works in practice, fewer timing issues technique #1. if site uses ajax changes fragment (aka "hash"), fire on hashchange event . alas, fewer , fewer ajax sites this. use mutation observers monitor changes to <title> tag . most ajax pages nice enough change ti...

c# - How does preCondition="managedHandler" work for modules? -

Image
after reading documentation integrated pipeline i'm confused how iis determines when run managed modules, managed request is, , how determined, e.g.: http://www.iis.net/learn/application-frameworks/building-and-running-aspnet-applications/aspnet-integration-with-iis http://blogs.msdn.com/b/tmarq/archive/2007/08/30/iis-7-0-asp-net-pipelines-modules-handlers-and-preconditions.aspx "managed" requests mentioned several times. there's 1 instance explained managed request request has mapping managed handler. there's quote saying handler "special" module (second link). modules described runs every request , handler has mapping specifies when should run (e.g. http *.aspx) (second , first links). furthermore, modules execute_request_handler [which i'm assuming point handler runs] comes after several stages of pipeline (after begin_request, authenticate, authorize, etc...), implies there's step happens before that, establishes request managed h...

Alternative to views in Xcode -

i'm xcode noob; have created view-based xcode project. in first view, user has choose option list (in list there more 200 options). in second view, has choose sub-option, , list long. each sub-option should have own view, since it's impossible create more 20,000 views in xcode, should use alternative method. can me please? so check over, looking not 1 2 uitable view's both of have lots of data. first need decide , figure out, how store data of information in app: ie: core data, plist, arrays, server end (json,xml) etc... secondly, how information displayed @ once? picture , maybe 2 liens of text ? or want more custom ?? once have decided can start begin basic project (navigation based application)(would easiest new user) or starting blank project (single based view controller) , in ib (interface builder) addend uitableview along uitableview cell. here basic tutorials designing uitableviews. :-) step 1 - learn basics of uitable view - basic uit...

How to invalidate AntiForgeryToken Asp.Net MVC 3 -

i have implemented antiforgerytoken in form. working. want invalidate out side testing purpose because need see happen when antiforgerytoken tamper ? so guide me how invalidate/tamper antiforgerytoken see exception generated. guide me how capture exception action method , redirect user page friendly message. couple of question antiforgerytoken 1) know in details how antiforgerytoken works ? 2) antiforgerytoken generate unique value each request ? if yes why ? 3) web site may have many pages. guide me few example of page or form antiforgerytoken need implemented ? 4) can write multiple antiforgerytoken in same form....if not why? looking discussion. thanks invalidate modifying or deleting __requestverificationtoken cookie before submitting form. i can't explain better steve sanderson . once cookie set reused on user's browsing session. can salt tokens , therefore have different token different forms. don't see reason not apply post forms , act...

android - How to customize the NumberPicker -

Image
i found 2 built-in numberpickers: http://techbooster.org/wp-content/uploads/2011/12/numberpicker_ss_1.png by default, it's first one, when add android:theme="@android:style/theme.notitlebar" in androidmanifest.xml, becomes second one. how can put line (i need it) , still first numberpicker? you setting non holo theme non holo numberpicker. see reference, same thing asked remove titlebar in xml

syntax - The cause of SyntaxError: Unexpected identifier in a JavaScript conditional statement based on the length of a string -

i've created simple if/else statement : var myname = ["mark"]; if myname.length <= 3; { console.log("it's not true"); } else { console.log("variable consists of" myname.length); console.log("i finished first course".substring(0,26)); } unfortunately, console returns error : syntaxerror: unexpected identifier i've tried add square brackets var myname = "mark"; didn't help. with var myname = ["mark"] you assiging array myname , not want in case: var myname = "mark" you have use parentheses around if-condition. semicolon wrong: if (myname.length <= 3){ ... } in else-block you've got first statement wrong. have use + concatenate arguments want print: console.log("variable consists of" + myname.length);

PayPal sandbox recurring payment in one currency failing despite available funds in another currency -

i have paypal express checkout setup create recurring payment profile using brl (brazil real) currency. works fine in sandbox long user has funds in brl. however users without brl funds recurring profile created, transaction never made. it's delayed , ipn saying failed. when sign in user failed recurring payment don't message subscription payment failed, nor can pay manually. (note sandbox users have box credit card added , paypal funds available in different currency) is there way tell paypal use funds in currency user has available pay subscription? from remember, sign sandbox merchant account, , change settings. my account -> profile -> selling tools -> block payments -> accept currency , convert currency radio button. should fix failed message

excel - SUMIFS using two Workbooks - Run-time Error "13" -

this first post on stack overflow.. i've used site multiple times vba questions , of time, i've been able find answer. time, however, i'm finding can't locate helps me out. i've tried figure out problem multiple angles , can't seem figure out. i've gotten sumifs code work correctly using single workbook, 2 presents problem. 2 sheets "activehedge.xlsm" , "livedatafeed.xlsm" , here code: sub call_livedatafeed() workbooks.open filename:="z:\users\toms\desktop\livedatafeed.xlsm" end sub sub createfnma_monthlycoupons() workbooks("livedatafeed.xlsm").activate range("d7").formula = _ "=sumifs('[activehedge.xlsm]active hedge'!$i:$i,'[activehedge.xlsm]active hedge'!$h:$h,">="&u9,'[activehedge.xlsm]active hedge'!$i:$i,"<="&v9,'[activehedge.xlsm]active hedge'!$k:$k,"<"&c5-14)" so, used & before cell references in...

php - updating /changing a value in database using codeigniter -

iam developing using codeigniter , have managed post id number , phone number table named "offers" both fields int, when try update phone number corresponding specific id keep getting following error unknown column 'mysubmit' in 'field list' update offers set phnenum = '078444', mysubmit = 'submit form' idnum = '12' filename: c:\xampp\htdocs\project\system\database\db_driver.php i have listed controller , model , view below newoffer/controller class newoffer extends ci_controller { function addoffer() { //if form submitted $this->load->view("check"); $this->load->model("offer_model"); if ($this->input->post('mysubmit')) { $this->offer_model->entry_insert(); } } function updateoffer (){ $this->load->view("check"); $this->load->model("offer_model"); if (...

How to deploy Rails 4 with Capistrano 2 and precompile assets locally -

recently upgraded application rails 3 rails 4. in deploy scripts precompile assets locally , rsync them server(s). in rails 4 asset pipeline produces manifest- < random > .json instead of manifest.yml . since manifest files named differently, adds multiple manifest.json files shared assets directory. application picks wrong manifest file, , serves old assets. i have read various issues related in github pull request threads: https://github.com/capistrano/capistrano/pull/412 https://github.com/capistrano/capistrano/issues/210 https://github.com/capistrano/capistrano/pull/281 my options seem be: don't share asset directory. this break old clients asking old resources. switch compiling assets on servers. this add complexity server. move manifest file outside of shared asset directory. i have since learned option removed in rails 4. are there other solutions problem? i found best answer after looking @ standard capistrano rails asset precomp...

c# - Importing Data from file into DataGridView -

i made windows forms application in visual studio, , initial form put 1 datagridview (from toolbox). made dataset , extract data file dataset. tried put data dataset gridview when started form nothing happened. grid empty. did wrong? here tried: datagridview1.dock = dockstyle.fill; datagridview1.datasource = makedatatable(); makedatatable() method returns dataset (it's valid). datagridview1 object of class datagridview got toolbox. grid remained empty, nothing happened though there no error in compiling. tried make datagridview on form1 (default form), in similar way. erased datagrid view form design , added line: datagridview datagridview1 = new datagridview(); it didn't work either, didn't know how put visible on form. this worked opened form had 2 forms, 1 empty , second 1 gridview populated data: form form1 = new form(); datagridview datagridview1 = new datagridview(); datagridview1.dock = dockstyle.fill; datagridview1.datasource = makedatatable(); form...

jquery - How to call myScroll.scrollToElement when the page loads -

i using iscroll perform scrolls in webapp , happy it. in case need autoscroll specific li @ page load, having no luck it. here trying do: var myscroll; function loaded () { myscroll = new iscroll('#wrapper', { mousewheel: true, click: true }); } document.addeventlistener('touchmove', function (e) { e.preventdefault(); }, false); myscroll.scrolltoelement(document.queryselector('#scroller li:nth-child(50)'), null, null, true); if insert link this: <a href="javascript:myscroll.scrolltoelement(document.queryselector('#scroller li:nth-child(50)'))"> everything works should... doing wrong? i suggest using window.onload event exact same thing doing in function call should this: window.onload = function() { myscroll.scrolltoelement(document.queryselector('#scroller li:nth-child(50)'), null, null, true); } here more details onload event (you can attach html elements)

Paypal Adaptive Payment completing, despite user with no account -

i had search couldn't quite find answer issue i'm having adaptive payments, using paypal_adaptive gem. users build balance in website, , i'm looking implement functionality them withdraw paypal accounts. i'm performing via implicit payment seem work fine, acting dummy user, if use email address not yet associated paypal account there no email prompt register account or claim funds. the paypal documentation says: "the receiver receives email notifying receiver create account , claim payment. paypal holds payment receiver email address not yet registered or confirmed until receiver creates paypal account , confirms email address" ..but cant see happening in flow test email account use. missing? in advance support. you can use adaptive accounts api method "getverifiedstatus". use devtools test it. devtools link

iphone - UIScrollView with contentsize set can't scroll beyond frame boundary -

i feel i'm missing super obvious here. i have uiscrollview in storyboard, outlet view controller. i programatically add series of views, , set content size of scroll view. even though i've set scrollview's contentsize height high value, can't scroll beyond views bounds. i'm printing content size , frame size after setting it. contentoffset.y when scrollview scrolls. here example of console output: 2013-09-24 21:54:34.531 [redacted] scrollview frame size: 320.000000,460.000000 2013-09-24 21:54:34.531 [redacted] scrollview content size: 0.000000,10000.000000 2013-09-24 21:54:36.259 [redacted] scroll to: 6.000000 2013-09-24 21:54:36.275 [redacted] scroll to: 17.000000 2013-09-24 21:54:36.291 [redacted] scroll to: 29.000000 2013-09-24 21:54:36.308 [redacted] scroll to: 41.000000 2013-09-24 21:54:36.325 [redacted] scroll to: 52.000000 2013-09-24 21:54:36.341 [redacted] scroll to: 65.000000 2013-09-24 21:54:36.358 [redacted] scroll to: 74.000000 2013-09-24...

python - In pyfirmata, how to set up a handler for string messages? -

how set handler receive messages in pyfirmata arduino uno? i have following python code: from logic.moduleclass import module events.eventdispatcherclass import event pyfirmata import arduino, util import pyfirmata class comm(module): """ handles communication between python , arduino attachto: "" """ name = "communicator" def __init__(self, port): super(comm,self).__init__(comm.name) self.board = arduino(port) # start iterator thread serial buffer doesn't overflow = util.iterator(self.board) it.start() self.board.add_cmd_handler(pyfirmata.pyfirmata.string_data, self._messagehandler) def _messagehandler(self, *args, **kwargs): print args def update(self): super(comm,self).update() def writedata(self,data): #print data self.board.send_sysex(pyfirmata.pyfirmata.string_data,data) def dispose(self): ...

php - Generate a unique tinyurl-like ID but randomly (not mysql row id to base64) -

i need generate unique url tinyurl's: domain.com/pgdzs7, domain.com/ab4dh3 (!) problem don't want users have possibility view previous , next urls changing last letters in url. for example, if creates content gets url domain.com/pgdzs7, want next visitor absolutely different unique url (for example, "ab4dh3") nobody can't find out how these urls have been generated , see content of other users unless know url. all found here on stackoverflow convert table's primary integer key base64 form. need different solution not generate collisions , doesn't have for/while cycles (if it's possible) since mysql table has dozens of gbytes. you can make formula next index. like: lastid*2+5 you won't have colisions or loops check if id used before.

javascript - jquery datatables change td class for empty table -

i'm using jquery datatables plugin. ( https://datatables.net/ ) wanna know if there's way change td class when tables empty. saw when there no rows in table datatables inserts row td class datatables_empty . there way change *datatables_empty* *mydatatables_empty* ? i'm using fnrowcallback change other rows classes... seems not working auto inserted row when table empty. you change using jquery quite easily. in (document).ready handler... $('.datatables_empty').removeclass('datatables_empty').addclass('mydatatables_empty'); alternatively use default class name , override in css. otherwise, take @ datatables doco ...

c# - How to get image from WebBrowser control -

i have webbrowser control, after navigating page need download image. used following code: htmlelementcollection tagscoll = webbrowser1.document.getelementsbytagname("img"); foreach (htmlelement currenttag in tagscoll) { ... using (var client = new webclient()) { ... client.downloadfile(currenttag.getattribute("src"), path); ... } } but, in case webclient starts new session, , link in new session not correct. need in same session webbrowser, in case correct link image. how can this? try downloading image using urldownloadtofile , should give same session , cache used webbrowser .

SQL Query works in Microsoft Query, not in Microsoft Excel -

i have complex sql query seems having trouble translating correctly microsoft excel's data connection. this code works when pasted in microsoft query, return excel, excel gives , won't fill sheet data. think stopped working when added left outer join pieces ensure had oldest skittypes in 2 groups of skittpes, thing complicated i'm not entirely sure. left outer join table2 b2 (nolock) on (a.actingnumber = b2.actingnumber , b.actingnumber = b2.actingnumber , b2.skittype in ('180','184','185') ) left outer join table2 b3 (nolock) on (a.actingnumber = b3.actingnumber , b.actingnumber = b3.actingnumber , b3.skittype in ( '980','984','985') ) and full query: declare @clipid varchar(15) set @clipid = 'bus' declare @mnth int declare @bgdate varchar(8) declare @enddate varchar(8) declare @prvmnth int set @mnth = (select max(mnth) table1) set @mnth = (left(replace(convert(varchar(10),dateadd(mm, -5, conve...

java - How to bind to CheckedProvider in guice? -

guice provides way bind provider: bind(a.class).toprovider(aprovider.class); although if provider needs throw exception seems checkedprovider right base interface: public interface configcheckedprovider<t> extends checkedprovider<t> { t get() throws configexception; } public aprovider implements configcheckedprovider<a> { ... } but of classes need instance of injected. , can't change. looks toprovider method doesn't accept checkedprovider types. how can use providers based on checkedprovider inject instances not providers ? as requested, i'm posting comment answer. if have class t , checked provider tprovider extends checkedprovider<t> , cannot inject t : @inject someclass(t t) { // won't work ... } as able if had used plain provider<t> . done intentionally. checked providers needed when creation of object may fail particular type of exception, , failure must handled user code. p...

How do I return a variable from a callback function in javascript? -

i need return value of tempvar can't figure out how since result of callback. correct way handle this? i'm not sure how word problem. hoping work doing var tempreturned = readpwfile('filename.txt'); doesn't obvious reasons if have 'return' somewhere in callback. main goal return results of txt file variable. can point me in right direction? function readpwfile(filename) { var tempvar; window.requestfilesystem(localfilesystem.persistent, 0, function (filesystem) { filesystem.root.getfile(filename, null, gotreadfileentry, fail); }); function gotreadfileentry(fileentry) { fileentry.file(gotfile, fail); } function gotfile(file) { readdataurl(file); } function readastext(file) { var reader = new filereader(); reader.onloadend = function (evt) { tempvar = evt.target.result; }; reader.readastext(file); } } you should provide callback through...

node.js - nodejs python or twisted -

i'm new web development , going make website responses data received request web-service(facebook e.g.) , how choose more useful here: nodejs has callback model allows not wait while gathering data user other services (but i've broken fingers , brain after trying make kind of class in javascript inheritance , whole server drops after unhandled error in script) python convinient in working diff. kinds of data, it's more convinient me, former c++ developer yesterday i've read twisted python uses callbacks help me please choose use, better - performance, simple code the callback model might make code more verbose wait! there solution! check out waitfor . anyway, if it's personal project no 1 forcing use node.js webapp development.you should go makes more comfortable. if developing in python go it! :)