Posts

Showing posts from April, 2012

CakePHP: finding data after save -

CakePHP: finding data after save - i'm working on edit method. after saving data, email sent out changes made during edit. works except 1 infuriating crucial bug. here distilled downwards simply: $data = $this->supportticket->readforview($st_id); $this->supportticket->id = $st_id; if ($this->supportticket->save($this->request->data)) { //call custom model method pull view info $data = $this->supportticket->readforview($st_id); //do info } the issue $data comes out pre-save data. seek new info doesn't work. can't utilize $this->request->data because doesn't have total info want in it. the save work. if refresh view method same record, shows updated. it's saving, when find after saving giving me old data. any ideas? update: doesn't happen findbyid($st_id) must custom method. code: public function readforview($id) { $data = $this->find('first', array( 'cond

javascript - dc.js Number Display Widget -

javascript - dc.js Number Display Widget - i'm new dc.js... , have little clue what's going on number display widget. tried looking @ illustration , copied sections of verbatim code hoping work (but knowing wouldn't). goal display average of line graph (sat scores) (that alter based on crossfilter). suggestions?... var ndx = crossfilter(csv); var = ndx.groupall(); var bysat = ndx.dimension(function(d) { homecoming d.compositesat; }); var boxnd = dc.numberdisplay("#number-box"); var satavgnum = bysat.group().reduce( function (p, v) { ++p.n; p.tot += v.compositesat; homecoming p; }, function (p, v) { --p.n; p.tot -= v.compositesat; homecoming p; }, function () { homecoming {n:0,tot:0}; } ); var average = function(d) { homecoming d.n ? d.tot / d.n: 0; }; boxnd .formatnumber(d3.format(".3s"))

C++ pointer to class method -

C++ pointer to class method - i want this: struct cli_command{ cli_command(char* s, void (*h)(void)){ command_string = s; handler = h; } char* command_string; void (*handler)(void); }; class cli { public: cli(); private: cli_command cli_table[no_cli_commands] = { cli_command("command1", handler1), cli_command("command2", handler2) }; void handler1(){}; void handler2(){}; }; i know need similar cli::*handler, can't syntax right. maintain running errors this: "error: no matching function phone call 'cli_command::cli_command(const char [4], <unresolved overloaded function type>)" this illustrates right syntax: class cli; struct cli_command { cli_command(char* s, void (cli::*h)(void)) { command_string = s; handler = h; } char* command_string; void (cli::*handler)

excel vba - Class of a Class -

excel vba - Class of a Class - i'm getting killed trying create class of class. have shopped around site , seen several examples maybe because 1:43 having hard time understanding them. i able utilize class automate huge info entry project @ work. created class called catdist category distribution of types of agricultural products company manufacture or sell. catdist contains 6 properties: private selfworth string private q1 double private q2 double private q3 double private q4 double private activated boolean they have standard , allow codes. there 48 possible categories. have module creates 48 instances of them 48 different values selfworth (e.g "cottonseed", or "maize" etc), , sets q1 through q4 0 . module worked userform type in values , nail enter. if saw had entered value within particular textbox (yes there 48x4 textboxes) set activated true , changes relevant q's values entered. what want now. it great success. wa

traversal - Java - finding a parent of a node in a Binary Tree? (converted from a general tree) -

traversal - Java - finding a parent of a node in a Binary Tree? (converted from a general tree) - i have binary tree converted general tree. meaning, left node of given node node's child, , right node of given node node's sibling. my question - how can write method take node , find parent? (by traversing entire tree guess) thanks! this help you private static binarynode getparent(anytype x, binarynode<anytype> t, binarynode<anytype> parent) { if (t == null) { homecoming null; } else { if (x.compareto(t.element) < 0) { homecoming getparent(x, t.left, t); } else if (x.compareto(t.element) > 0) { homecoming getparent(x, t.right, t); } else { homecoming parent; } } } java traversal

68000 - TRAP 14 on 68000 and TRAP 15 on EASy68K -

68000 - TRAP 14 on 68000 and TRAP 15 on EASy68K - are these same? trap 15 on easy68k same trap 14 on 68000 board. ive tried looking reply , under notion right create sure. could somone please confirm this? what mean "the same"? the instruction trap , takes 4-bit immediate vector index controls handler invoked. so of course of study 2 instructions trap #14 , trap #15 not same. the handlers can of course of study same, causing 2 instructions have same result, that's impossible reply since don't specify software. 68000 easy68k

jquery - How to do a custom transition using Javascript -

jquery - How to do a custom transition using Javascript - so developing site scratch (first time ever) , i've made general layout psd made , great, @ point want refine site bit javascript effects-functions. when @ index page, have banner, sidebar , content (articles). when press articles goes article (obviously) want create custom loading page @ 0:22: https://www.youtube.com/watch?v=k1q6y_snurw#t=20 i've got create or find gif i've done that, how add together site? the articles in class although guess have utilize id each specific article go respective article. edit: pop in file , add together reference in every page has link: class="lang-js prettyprint-override"> function loadxmldoc(name) { var xmlhttp = new xmlhttprequest(); xmlhttp.addeventlistener("load", transfercomplete, false); xmlhttp.open("get", name, true); document.getelementbyid("loading").style.display = "block"; xmlhttp.s

javascript - Trouble with Angular Validation -

javascript - Trouble with Angular Validation - i'm new angular , have problem debugging utilize of form validations. namely want disable sumbit button if form invalid. problem stays invalid if i've inserted apparently valid input. goes far invalid empty form: this template (original code commented out): <div> <div class="row"> <div class="col-xs-6"> <a href ng-click="companiesctrl.newedit()" class="btn btn-primary">uus asutus</a> <table class="table"> <tbody> <tr ng-repeat="company in companiesctrl.list"> <td><a href ng-click="companiesctrl.load(company)">{{company.name}}</a></td> </tr> </tbody> </table> </div> <div class="col-xs-6">

django - How to implement job scheduling in python? -

django - How to implement job scheduling in python? - i implementing task scheduling scheme in django. user select task e.g. send email , set specific time , date task execution. i found celery can set task @task def email(address): // send email logic but how can trigger @ specific time? periodictasks in celery 1 have specify execution time , frequency upfront. how can add together execution date , time on fly? is method in celery e.g. add.schedule(date="some_data") or other ways can solve utilize case. periodic tasks 1 feature of celery. there hell lot of other features supports. you can utilize celery case. can define simple celery task something. later when user submits/clicks particular task, write simple code connect task. task executed celery. checkout first steps django. also, celery advanced async task delegation , processing system. redis queue much simpler async task processor , lightweight. if have simple tasks do,

asp.net mvc - Security update for MVC 3.0.0.0 did not work? -

asp.net mvc - Security update for MVC 3.0.0.0 did not work? - i see windows update has installed security update kb2972107 mvc 3.0.0.0, not see new assembly or publisher policy in gac. windows server 2008 r2, .net 4.5, mvc 3 update: uninstalled update , reinstalled using wu , no effect. update: looking wrong kb. should have been looking kb2993937. still know why update has not automatically installed. update: se's blocked update wsus... nevermind question can closed. i had same problem days ago. prepare downloaded mvc library nuget manager , kept using 4.0 version. font: http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx asp.net-mvc asp.net-mvc-3

apache - HTTP/1.1 505 HTTP Version Not Supported php curl -

apache - HTTP/1.1 505 HTTP Version Not Supported php curl - i attempting implement paypal's future payment server (https://github.com/paypal/paypal-ios-sdk/blob/master/docs/future_payments_server.md), running issue server platform. whenever seek curl code: $headers = array( 'content-type: application/x-www-form-urlencoded' ); $userpwd = "client_id:secret"; $ch = curl_init("https://api.paypal.com/v1/oauth2/token?grant_type=authorization_code&response_type=token&redirect_uri=urn:ietf:wg:oauth:2.0:oob&code=".$code); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_header, $headers); curl_setopt($ch, curlopt_userpwd, $userpwd); $response = curl_exec($ch); curl_close($ch); i next response: http/1.1 505 http version not supported server: apache-coyote/1.1 date: wed, 22 oct 2014 21:30:35 gmt connection: close what causing issue, , how configure server back upwards curl code? thanks update: new

java - Controller is being called 3 times in Spring MVC -

java - Controller is being called 3 times in Spring MVC - i simplified code in project , left web.xml ,webcontext configuration , simplest controller phone call counter problem remains in result have 3 calls 1 after another, why ? web.xml <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>spring mvc application</display-name> <welcome-file-list> <welcome-file>main.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>

Gradle Build Error on Android Studio in Ubuntu 12.04 LTS -

Gradle Build Error on Android Studio in Ubuntu 12.04 LTS - well, after much googling 2 days , trying of recommended work arounds suggested on platform, problem not solved yet!! it goes this... i have started android app development android studio on ubuntu 12.04 lts. whenever open project, gradle build finishes next 2 errors;- executing tasks: [clean, :app:compiledebugjava] configuration on demand incubating feature. :app:clean :app:prebuild :app:predebugbuild :app:checkdebugmanifest :app:preparedebugdependencies :app:compiledebugaidl :app:compiledebugrenderscript :app:generatedebugbuildconfig :app:generatedebugassets up-to-date :app:mergedebugassets :app:generatedebugresvalues up-to-date :app:generatedebugresources :app:mergedebugresources /home/vivek/androidstudioprojects/myapplication3/app/src/main/res/drawable-mdpi/ic_launcher.png: error: cannot run programme "/home/vivek/documents/android-studio/sdk/build-tools/21.0.1/aapt": error=2, no such file or direct

c++ - Does any stl::set implementation not use a red-black tree? -

c++ - Does any stl::set implementation not use a red-black tree? - has seen implementation of stl stl::set not implemented red-black tree? the reason inquire that, in experiments, b-2b trees outperform stl::set (and other red-black tree implementations) factor of 2 4 depending on value of b. i'm curious if there compelling reason utilize red-black trees when there appear faster info structures available. some folks on @ google built b-tree based implementation of c++ standard library containers. seem have much improve performance standard binary tree implementations. there catch, though. c++ standard guarantees deleting element map or set invalidates other iterators pointing same element in map or set. b-tree based implementation, due node splits , consolidations, erase fellow member functions on these new structures may invalidate iterators other elements in tree. result, these implementations aren't perfect replacements standard implementations , couldn&

windows phone 8 - WP8 MPNS custom sound file not played completely -

windows phone 8 - WP8 MPNS custom sound file not played completely - i have implemented custom sound force notifications in wp8. works fine , custom sound file not played (when app in background). sound file 8 seconds , meets requirements. can allow me know why sound file not played ? windows-phone-8

angularjs - $on('value...) gives me "undefined is not a function" in angularfire -

angularjs - $on('value...) gives me "undefined is not a function" in angularfire - i have started utilize angularjs , next tutorial angularjs angularfire. in tutorial there section larn how utilize child_added angular.module('firebaseapp').service('messageservice', function(fburl, $q, $firebase) { var messageref = new firebase(fburl).child('messages'); var firemessage = $firebase(messageref).$asarray(); homecoming { childadded: function childadded(limitnumber, cb) { firemessage.$on('child_added', function(snapshot){ console.log(snapshot); var val = snapshot.val(); cb.call(this,{ user: val.user, text: val.text, name: snapshot.name() }); }); }, and main controller : messageservice.childadded(5,

php - MySQL Insert <--Unknown column 'nomePersona' in 'field list'' in -

php - MySQL Insert <--Unknown column 'nomePersona' in 'field list'' in - insert code: insert calendarappointment (`codicategory`, `codipersona`, `nomepersona`, `comment`, `day`, `description`, `from`, `shortdescription`, `to`, `modificatoda`, `datamodifica`, `idmodifica`) values ('ouqz/ejwafoadaw7jm+w1cfkenh8n26zbbcvhwwxpaa=', 'ouqz/ejwafoadaw7jm+w1cfkenh8n26zbbcvhwwxpaa=', 'huwzqywsany9rez0q0+zrbvrhreagvug9th1q3ttlpw=', 'q46vm3asgjseo6noj3r5xkhlmvvy+sy05e76krkhino=', '2014-10-29', 'q46vm3asgjseo6noj3r5xkhlmvvy+sy05e76krkhino=', '2014/10/13 09:00', 'q46vm3asgjseo6noj3r5xkhlmvvy+sy05e76krkhino=', '2014/10/13 09:30', '2014-10-29 11:11:34', '2014-10-29 11:11:34', '1') show create table calendarappointment: | calendarappointment | create table `calendarappointment` ( `idappointment` int(10) not null auto_increment, `codicategory` blob, `codipersona` blo

Send object as hex through web service ¿Its a good programing practice? -

Send object as hex through web service ¿Its a good programing practice? - i wondering how object bytes , convert them hex in order send through web service, , in client side, convert hex same object. seek , works, don't know if practice. give thanks you. web-services object hex byte

actionscript 3 - sendToURL not working in flashplayer 14 -

actionscript 3 - sendToURL not working in flashplayer 14 - this piece of code working in flashplayer 11 it's not working in flashplayer 14. as3 code : private function savepdf(pdfbinary:bytearray, urlstring:string):void{ try{ //result comes binary, create new url request , pass server var header:urlrequestheader = new urlrequestheader("content-type", "application/octet-stream"); var sendrequest:urlrequest = new urlrequest(urlstring); sendrequest.requestheaders.push(header); sendrequest.method = urlrequestmethod.post; sendrequest.data = pdfbinary; sendtourl(sendrequest); } grab (e:error) { // handle error here trace("error in savepdf "+e.message); trace("stacktrace : "+e.getstacktrace()); } } and these errors got : error in savepdf error #3769: security sandbox violation: simple headers can used navigatetourl() or sendtourl(). sta

c# - Will PropertyInfo from Expression be equal to PropertyInfo from GetProperties() -

c# - Will PropertyInfo from Expression be equal to PropertyInfo from GetProperties() - i know typeof(t) == typeof(t) true because type objects static , 1 type instance exists per class type (if wrong, please right me...i have several programs function on assumption). i having hard time finding in documentation whether or not propertyinfo objects exhibit same property. my application this: i have reflector<t> class takes result typeof(t).getproperties(...) , stores resulting propertyinfo objects keys in dictionary. separately, have look parser attempts parse look describing access of property of type func<t, tresult> (e.g. t => t.someproperty t beingness t.gettype() , tresult beingness type of someproperty ). after computation, propertyinfo object coming memberexpression.member passed expression . the resulting propertyinfo used key in dictionary.trygetvalue phone call additional info property stored in reflector<t> 's dict

php - Doctrine doesn't store ArrayCollection -

php - Doctrine doesn't store ArrayCollection - i have entity has array field this: ... /** * @var array * * @orm\column(name="tels", type="json_array") */ private $tels; ... i fill using form , fills correctly after submit var_dump($entity->gettels()) returns this: object(doctrine\common\collections\arraycollection)[448] private '_elements' => array (size=1) 0 => string '123' (length=3) but after persist doctrine ignores fields value , stores empty array: +----+------+ | id | tels | +----+------+ | 1 | {} | +----+------+ what problem? the type json_array expects array converted json using json_encode. while doctrine arraycollection technically traversable doesnt nicely cast array. either need phone call ->toarray() on or alter type array $entity->settels($thearraycollection->toarray()); php symfony2 doctrine2 arraycollection

sql server - Does ADODB.Stream have a maximum file size it can handle? -

sql server - Does ADODB.Stream have a maximum file size it can handle? - i'm using microsoft sql server 2005, , exporting image info types files (from sharepoint database), using script not dissimilar 1 found here it works well, reason fails on files more ~45mb: msg 0, level 11, state 0, line 0 severe error occurred on current command. results, if any, should discarded. msg 0, level 20, state 0, line 0 severe error occurred on current command. results, if any, should discarded. so, i've had add together argument where datalength(content)/1024 <= 45000 runs through files can without failing. does know if adodb.stream has maximum file size can handle? i'm not much sharepoint's nor sql server processes , stuff, however, looking regarding classic asps (that's how reached question). in case seems response.binarywrite method has 20mb limitation , had send stream in several smaller parts. maybe there's same thing here. check

ti basic - Why won't finding polynomial whole number routes work? -

ti basic - Why won't finding polynomial whole number routes work? - so want find me roots of polynomial. however, everytime run it, never gives me roots, if utilize obvious 1 2x-2. why won't work? input "degree?",θ disp "left right" disp "coefficients" 1→v for(z,0,θ) input q→r p→q o→p n→o m→n l→m k→l j→k i→j h→i g→h f→g e→f d→e c→d b→c a→b if v=1 a→s v=0 end end for(t,–a,a) for(u,–w,w) if t≠0 u/t→x rx+q→y yx+p→z zx+o→y yx+n→z zx+m→y yx+l→z zx+k→y yx+j→z zx+i→y yx+h→z zx+g→y yx+f→z zx+e→y yx+d→z zx+c→y yx+b→z if z=0 disp x end end end prgmreset reset resets variable values. wrong it? request: have absolutely no thought operation working off of, if please state that observation: you're using lot of variables haven't had value assigned them or cleared, can see you're trying create 'stream' of variables work with, if without clearing variables ahead of time create problems in later calculations. coding

sql server - Function has too many arguments specified in Sql query -

sql server - Function has too many arguments specified in Sql query - in below code have function , query function homecoming batchrelease quantity.i have include function in select sqlquery throws error"procedure or function dbo.getbatchreleasequantity has many arguments specified.".please help me overcome issue. select p.productid, p.productname, isnull((select isnull( currentstock,0.00) productstatus ps ps.productid =p.productid , ps.locationid = 1 , ps.statusdatetime= '2014-08-27' , ps.productid=p.productid),0) openingstockquantity, isnull((select isnull( (currentstock*ps.unitprice),0.00) productstatus ps ps.productid =p.productid , ps.locationid = 1 , ps.statusdatetime= '2014-08-27' , ps.productid=p.productid),0) openingstockvalue, isnull((select isnull( currentstock,0.00) productstatus ps ps.productid =p.productid

java - Check that error page is only displayed in response to a real application error and not by the user typing in the URL -

java - Check that error page is only displayed in response to a real application error and not by the user typing in the URL - i have requirement display error page in jsf application when http errors or java exceptions encountered , provide user form on error page can utilize study error possible bug. @ same time need ensure error page displayed in response real application error , not result of user accessing error page straight typing in url , potentially submitting spurious bug reports. i have tried locating error pages in web-inf prevents user accessing page directly, http post method on form fails when user tries submit bug report. a quick search on stackoverflow shows there several similar questions, none of them relate utilize case trying meet. closest question have found how observe whether user have reached page jsf navigation rule redirect or typing url? suggests checking referer request header says overzealous proxy/firewall/security software can hide referer

sql server 2008 r2 - Is there any risks involved with changing a table's schema -

sql server 2008 r2 - Is there any risks involved with changing a table's schema - i want know if there risks involved when changing table's schema, illustration dbo. xyz. or visa versa. would hear views on this. first crossed mind when have views, stored procedures etc contains query like select * [sch].[tbl] once move table new schema 'invalid object name 'oldschema.tablename'. sql-server-2008-r2

javascript - setup main url for REST service calls in $.ajaxSetup() and only service methods in subsequent calls -

javascript - setup main url for REST service calls in $.ajaxSetup() and only service methods in subsequent calls - i wanted see if there way rest, know can $.soap. i want this, possible? see: $.ajaxsetup({ cache: false, crossdomain: true, datatype: "json", url: "http://localhost:8080/warfile/rest-api/cmds/", }); then subsequent calls like: $.ajax({ method: "setport", type: "post", data: json.stringify({ "port": "8431" }) }); after researching bit, discovered possible however, highly unadvisable per standards of using ajax. javascript jquery ajax rest

windows - How can I add a storyboard animation to my page resources in C#, then call it again later? -

windows - How can I add a storyboard animation to my page resources in C#, then call it again later? - hubpage landing page. on hubpage.xaml, have grid of 3x3, containing rectangle, i'm calling "cell". in hubpage.xaml.cs, particularly in hubpage() constructor, create storyboard each cell: createstoryboardforcell("column0row0"); createstoryboardforcell("column0row1"); ... createstoryboardforcell("column2row2"); i want add together storyboard page.resources, in xaml, attempting c#. now, here createstoryboardforcell implementation: private void createstoryboardforcell(string cellname) { // create 2 doubleanimations, 1 scalex , 1 scaley, , set properties. duration duration = new duration(timespan.fromseconds(0.2)); doubleanimation mydoubleanimation1 = new doubleanimation(); doubleanimation mydoubleanimation2 = new doubleanimation(); mydoubleanimation1.duration = duration; mydo

ios - How to center a bunch of horizontal views in a UIScrollView -

ios - How to center a bunch of horizontal views in a UIScrollView - i have uiscrollview fills width of device , contains several uiviews laid out horizontally. views have same width, on iphone 1 has scroll see views, on ipad of views visible. my question how can horizontally center views on screen? when available space big plenty display views, need centered when it's not big plenty display views can laid out now, left right. the interface has been set exclusively in interface builder. scroll view set fill entire device width - leading , trailing superview. first view in scroll view has leading set superview it's stuck far left. lastly button has trailing set superview - far right of scroll view, define scrollable content area. each view in middle laid out relative view left of - leading previous button. here's graphical representation of current layout: here's graphical representation of i'd obtain: additional info: scroll view doesn't ha

Convert RDD of Vector in LabeledPoint using Scala - MLLib in Apache Spark -

Convert RDD of Vector in LabeledPoint using Scala - MLLib in Apache Spark - i'm using mllib of apache-spark , scala. need convert grouping of vector import org.apache.spark.mllib.linalg.{vector, vectors} import org.apache.spark.mllib.regression.labeledpoint in labeledpoint in order apply algorithms of mllib each vector composed of double value of 0.0 (false) or 1.0 (true). vectors saved in rdd, final rdd of type val data_tmp: org.apache.spark.rdd.rdd[org.apache.spark.mllib.linalg.vector] so, in rdd there vectors create def createarray(values: list[string]) : vector = { var arr : array[double] = new array[double](tags_table.size) tags_table.foreach(x => arr(x._2) = if (values.contains(x._1)) 1.0 else 0.0 ) val dv: vector = vectors.dense(arr) homecoming dv } /*each element of result list[string]*/ val data_tmp=result.map(x=> createarray(x._2)) val data: rowmatri

ios - CollectionView nil -

ios - CollectionView nil - i'm trying update value 1 of cells. however, first time function, cellforitematindexpath , called, viewwithtag returns nil . value still changes, though. /// llena el contenido de las celdas de la vista func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell { var cell = uicollectionviewcell() switch collectionview.tag { // primer condicion para llenar las celdas de productos estrella case 1: cell = collectionview.dequeuereusablecellwithreuseidentifier("cellestrella", forindexpath: indexpath) uicollectionviewcell if var image = cell.viewwithtag(1) as? uiimageview { image.image = wsmanagerimages().selectimageatindex2("1", intable: tablas.galeriaproductos) image.clipstobounds = true } homecoming cell // segunda condicion para llenar las celdas de productos

java - How distinguish from which test suite was junit test run in case the same tests are run more times? -

java - How distinguish from which test suite was junit test run in case the same tests are run more times? - i have junit main test suite. suite contains many suites - each testing configuration @runwith(progresssuite.class) @suiteclasses({ simpletest.class, abouttest.class, cdh4_jdbc_testsuite.class, cdh5_jdbc_testsuite.class, cdh4_metastore_testsuite.class, cdh5_metastore_testsuite.class, cdh4_jdbc_kerberos_testsuite.class, cdh5_jdbc_kerberos_testsuite.class, cdh4_metastore_kerberos_testsuite.class, cdh5_metastore_kerberos_testsuite.class, }) public class testsuite { } suites each testing configuration contains same test cases, contains different setupclass() , teardownclass() methods @runwith(suite.class) @suiteclasses({ perspectiveswitchtest.class, newfolderfromtoolbartest.class, renamefolderfromtoolbartest.class, renamefilefromtoolbartest.class, openfilepropert

web services - How do I add this webservice to work in my C# app? -

web services - How do I add this webservice to work in my C# app? - i have programme i'm building college class needs utilize webservice, never covered webservices in class... through research i've found need add together service reference, adding ?wsdl end tells me keeps on giving me "error downloading metadata" error. the webservice mis.upb.pitt.edu/dixon/webservice.asmx the solution close virtual studio , open again. worked fine after that! i think that's solution should seek before next time. c# web-services visual-studio

java - File operations JNI -

java - File operations JNI - i'm new android , jni. want access files in device. i've added permissions manifest yet doesn't work. the java code: public class mainactivity extends actionbaractivity { public native string setfilepath(string path); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textview tv = new textview(this); tv.settext( "1111" ); setcontentview(tv); string path = environment.getexternalstoragedirectory().getpath()+"/xyz"; log.i("java ", path); setfilepath(path); } } the c code: jint java_package_mainactivity_setfilepath(jnienv* env, jobject this,jstring path){ path = (*env)->getstringutfchars( env, path , null ) ; __android_log_print(android_log_debug, "so", "fopen(%s)", path); file* file = fopen(path,"ab+"); (*env)->releasestringutfchars( e

r - Merging files on the basis of columns -

r - Merging files on the basis of columns - i have multiple files many rows , 3 columns , need merge them on basis of first 2 columns match. file1 12 13 13 15 b 14 17 c 4 9 d . . . . . . 81 23 h file 2 12 13 e 3 10 b 14 17 c 4 9 j . . . . . . 1 2 k file 3 12 13 m 13 15 k 1 7 x 24 9 d . . . . . . 1 2 h and on. want merge them obtain next result 12 13 e m 13 15 b k 14 17 c c 4 9 d j 3 10 b 24 9 d . . . . . . 81 23 h 1 2 k 1 7 x the first thing comes mind these types of problems merge , perhaps in conjunction reduce(function(x, y) merge(x, y, = "somecols", = true), yourlistofdataframes) . however, merge not efficient function, since looks want "collapse" values fill in rows left right, not default merge behavior. instead, suggest stack 1 long data.frame , reshap

Better MySQL Query Performance -

Better MySQL Query Performance - i want sum of qtys of item# grouped months, query takes long (15 - 20) seconds fetch. -total rows: 1495873 -total fetched rows: 9 - 12 the relation between 2 tables ( invoice_header , invoice_detail ) (one many) invoice_header header of invoice, totals. linked invoice_detail using location id ( loc_id ) , invoice number ( invo_no ), each location has own serial number. invoice detail contains details of each invoice. is there's improve way enhance performance of query, here it's: select sum(invoice_detail.qty) qty, month(invoice_header.date) month invoice_detail bring together invoice_header on invoice_detail.invo_no = invoice_header.invo_no , invoice_detail.loc_id = invoice_header.loc_id invoice_detail.item_id = {$itemid} grouping month(invoice_header.date) order month(invoice_header.date) explain: invoice_header table structure: create table `invoice_header` ( `invo_type` varchar(1) not null, `invo_no` int(20) n

javascript - How can I edit form data before setting a model property using Ember and ember-data? -

javascript - How can I edit form data before setting a model property using Ember and ember-data? - i'm relatively new ember , trying figure out how can process info form input before saving ember model. (i'm using ember-data). the field phone number, , want able strip out non-numeric characters before saving, 555-555-5555 or (555) 555-5555 etc. become 5555555555 when saved. were in rails utilize before_save callback, best way in ember this? you can utilize computed property, documented here http://emberjs.com/guides/object-model/computed-properties/ in case "real" property saved model, , bind computed property in template. when computed property is set can remove non-numeric characters , set "real" property. javascript ember.js ember-data

Remove web / app.php of reference. Symfony2 -

Remove web / app.php of reference. Symfony2 - all requests go through file web / app.php (similar index.php), such request main page - adwords-up.com/web/app.php, input - adwords-up.com /web/app.php/login. want part of web / app.php removed link. in configuration .htaccess, redirect default web / app.php, request such main form - http://adwords-up.com/, , page login - http://adwords-up.com/login. there /etc/apache2/sites-available/adwords-up.conf <virtualhost *:80> # servername directive sets request scheme, hostname , port t$ # server uses identify itself. used when creating # redirection urls. in context of virtual hosts, servername # specifies hostname must appear in request's host: header # match virtual host. default virtual host (this file) # value not decisive used lastly resort host regardless. # however, must set farther virtual host explicitly. servername adwords-up serveradmin webmaster@localhost documentroot /var/www/adwords-up/web # available logleve

windows - Type command issue -

windows - Type command issue - i have issue type command needs concatenate 2 files of same header , set file 2 info appended in file 1. operation done fine while executing batch script directly. when calling batch 3rd party tool (informatica cloud), type works rewrite. file 2 info overwrites file 1 data. can help me way out? batch script: if "%time:~0,1%"==" " (set hh=0%time:~1,1%) else set hh=%time:~0,2% set timestamp=%date:~10,4%%date:~4,2%%date:~7,2%%hh%%time:~3,2%%time:~6,2% re-create sample_transaction_inbound_veeva-i19.txt sample_transaction_inbound_veeva-i19_%timestamp%.txt /f "skip=1 delims=*" %%a in (f:\ots_veeva_crm\targetfiles\ing2\smpl\sample_order_transaction_inbound_veeva-i19.txt) ( echo %%a >>f:\ots_veeva_crm\targetfiles\ing2\smpl\remove_header\newfile.txt ) type f:\ots_veeva_crm\targetfiles\ing2\smpl\remove_header\newfile.txt >> f:\ots_veeva_crm\targetfiles\ing2\smpl\sample_transaction_inbound_veeva-i19_%tim

ruby - using NSJSONSerialization in RubyMotion -

ruby - using NSJSONSerialization in RubyMotion - i'm using rubymotion , trying serialize object json. i'm not getting error message causes app crash. class foo attr_accessor :name end e = pointer.new(:object) testitem = foo.new testitem.name = "test" testjson = nsjsonserialization.datawithjsonobject(testitem, options:0, error: e) can see if im using class correctly? (or know alternative) there nil wrong call. problem data. top level object in testitem must nsarray or nsdictionary . you can utilize rubymotion arrays , hashes since array < nsmutablearray < nsarray , hash < nsmutabledictionary < nsdictionary . try these sample testitems call: testitem = ["test"] testitem = {"names" => ["fred", "joe", "mike"], "ages" => [17, 63, 28]} from nsjsonserialization.h: /* class converting json foundation objects , conver

jquery - I need to make a fade in/out slider but I've hit a wall -

jquery - I need to make a fade in/out slider but I've hit a wall - hey guys i've been using stack overflow sometime help teaching myself code think must missing basic principles since when seek find slider like, cannot figure out how works. tried create own figure out methods , rules little bit i've nail finish wall. i'm trying create slider starts out cycling through images , 1 time have working i'll figure out buttons , things. anyway here's html test file: <div id=slider> <img class="active" src="slider 1.jpg"/> <img src="slider 2.jpg"/> <img src="slider 3.jpg"/> </div> the css: #slider{ position: relative; } img { opacity: 0; position: absolute; } and javascript: $(document).ready(function(){ var repeater; var $active = $("img.active"); var $next = $active.next(); var $nonext = $("#slider:first

ruby on rails - Git: Merge test repository into master repository -

ruby on rails - Git: Merge test repository into master repository - i new git/heroku/ror, know basics of these technologies. i have git repository repoa has 2 branches, master , feature. i continued working on repoa/feature , upon completion, because changes huge decided launch separate app on heroku test them first. so deployed repoa/feature repotest/feature on heroku. made fixes feature , finalized code in repotest/feature. another developer made commits in repoa/master during time. now want create repotest/feature live , merge repoa/master. please help me how can ? note: have tried doing git rebase master did nil after long manual conflict resolve exercise. as below steps operations: 1. git checkout repoa/feature 2. git fetch repotest/feature; git merge repotest/feature repoa/feature; git stash 3. git checkout repoa/master; git pull origin 4. git checkout repoa/feature; git rebase repoa/master (maybe here should resolve conflicts); git stash pop 5. git stat

c++ - How to use default template parameters in partial template specialization with variadic templates and multiple parameter packs -

c++ - How to use default template parameters in partial template specialization with variadic templates and multiple parameter packs - i have problem specialization of template class using 2 different kinds of variadic parameter packs. in detail, have "variadic type" like template< typename... arguments > struct variadictype{}; the template class using single type , 2 different variadic parameter packs is template< typename type , class , class > struct foo{}; we specialize template gaining access 2 different parameter packs follows: template< typename type , template< class... > class firstpack_container , class... first , template< class... > class secondpack_container , class... sec > struct foo< type , firstpack_container< first... > , secondpack_container< second... > > { // foo(first... first , second... second){ std::cout << "sizeof...(fir

crm - Vtiger login error in version 6.10 -

crm - Vtiger login error in version 6.10 - i using vtiger crm 6.1.0 , installed correctly after login getting error {"success":false,"error":{"code":"illegal request","message":"illegal request"}} how resolve error did not solutions forums official reply vtiger developers: create sure $site_url in config.inc.php configured same crm accessing url. difference in leads error reported. source: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8237 crm vtiger

firebird - insert with 2 linked servers -

firebird - insert with 2 linked servers - i'm connected in sql server 2012, connect sql server 2005 after can connect firebird base. my query 2 linked server: insert openquery(2005server, 'select test_id, age openquery(firebirdserver, ''select test_id, age firebirdbase'')' ) values (1, 22) a exemple 2 linked server works me is: insert openquery(firebirdserver, 'select test_id, age firebirdbase') values (1, 22); error 2 linked servers (first code up): ole db provider "sqlncli11" linked server "2005server" returned message "multiple-step ole db operation generated errors. check each ole db status value, if available. no work done.". msg 16955, level 16, state 2, line 1 not create acceptable cursor. anyone have error? thanks! i've encountered same issue before way solve insert in exec @ seek this... exec ('insert openquery(firebirdserver, ''select test_id, age fi

loopbackjs - Can loopback use indexeddb for offline sync? -

loopbackjs - Can loopback use indexeddb for offline sync? - i started using loopback create api server. has offline sync capability built in. can loopback framework utilize indexeddb offline sync? at moment, loopback uses localstorage offline storage. however, should reasonably easy write connector (adapter) indexed db. disclaimer: loopback developer working strongloop. loopbackjs strongloop

awk - How to get a field by counting the column ( number of character) -

awk - How to get a field by counting the column ( number of character) - i have logfile.txt , want specify filed $4 based on number of column not number of field because fields separated spaces characters , field 2 ( $2 ) may contain values separated space. want count lines don't know how specify $4 without causing problem if field 2 ( $2 ) contain space character. here file: kjkjj1kljkjkj928482711 piejhhkia 87166188177633 ajhhhh77760 00666667 876876800874 2014100898798789979879877770 kjkjj1kljkjkj928482711 hkhg 81882776553868 hghaljlka700 00876763 216897879879 2014100898798789979879877770 kjkjj1kljkjkj928482711 uut uggt 81762665356426 hgjhghjg661557008 00778787 268767860704 2014100898798789979879877770 kjkjj1kljkjkj9284827kj arth hgg 08276255534867 hgjhghjg661557008 00876767

android - Separating Numeric values from Text Values -

android - Separating Numeric values from Text Values - i retrieving info rest api , displays: "per 78g - calories: 221kcal | fat: 12.65g | carbs: 16.20g | protein: 10.88g" i have imported items listview , when user clicks item string each numeric value individually below without text. based on illustration above: string calories = 221; string fat = 12.65; string carbs = 16.20; string protein = 10.88; i got rid of "per 78g" with: string sd = food.getstring("food_description"); string[] row = sd.split("-"); tems.add(new item(food.getstring("food_name"), row[1])); which displays next in each list item. "calories: 221kcal | fat: 12.65g | carbs: 16.20g | protein: 10.88g" when user clicks on list item: how separate , eliminate text well? 1 time numeric values individually fine. @override public void onitemclick(adapterview<?> arg0, view arg1, int arg2, long arg3) { // todo auto-generat

c++ - How to pass compare object or function to class function -

c++ - How to pass compare object or function to class function - i'm going implement info structures, segment tree, heap(priority queue). however, want write 1 time , can pass compare object or compare function can set max-heap or min-heap (in past, have write 2 classes). the question how pass compare object or compare function class function this want do struct heap{ sometype comp; void init(sometype f){ comp = f; } ... } and when want compare i'll utilize comp(a, b); // << want homecoming bool how can set compare object greater<int> or less<pair<int, int> > struct ? and if want write compare object or function, how can it. sorry bad english language give thanks you. make heap template, next : template<typename sometype, typename compartor = std::less<sometype> > struct heap { // .... }; then can : heap<int, std::greater<int> > h; otherwise can have std::function&

php - Saving select with multiple -

php - Saving select with multiple - this question has reply here: saving multiple select in input 3 answers i have select input multiple set true. how save info cakephp way along validation. <?php echo $this->form->input("user_id", array('multiple'=> 'checkbox' )); ?> if(is_array($this->data['your_model']['user_id'])){ foreach ($this->data['your_model']['user_id'] $single){ $this->request->data['your_model']['user_id']=$single; $this->your_model->create(); $this->your_model->save($this->request->data); } } else{ $this->your_model->create(); $this->your_model->save($this->request->data); } if array , save in loop in database using request->data .else save is php cakephp

python - Getting dot to move along curved trajectory -

python - Getting dot to move along curved trajectory - i'm trying create dot moves around screen, bounces off edges, , curves in random direction every 50 frames or so. what i've done ball move , bounce off of screen edges. please note uses psychopy: win = visual.window(size=(1600, 900), fullscr=false, screen=0, allowgui=false, allowstencil=false, units='pix', monitor='testmonitor', colorspace=u'rgb', color=[0.51,0.51,0.51]) keys = event.builderkeyresponse() dot1 = visual.circle(win=win, name='dot1',units='pix', radius=10, edges=32, ori=0, pos=(0,0), linewidth=1, linecolor='red', linecolorspace='rgb', fillcolor='red', fillcolorspace='rgb', opacity=1,interpolate=true) x_change = 10 y_change = 10 while true: dot1.pos+=(x_change,y_change) if dot1.pos[0] > 790 or dot1.pos[0] < -790: x_change = x_change * -1 if dot1.pos[1] > 440 or dot1.pos[1] <

c# - that name does not exist in current context -

c# - that name does not exist in current context - in case 3: wrote mutteer(ba, bb, bc, bd, be); seems give error (the name ba not exist in current context). gives same error bb bc bd , be . what did wrong? i removed of unnecessary code: static void menu() { int loop = 4; console.writeline(" 3 mutteer voorraad"); while (loop > 2) { var ans = console.readline(); mp3(); int selection = 0; if (int.tryparse(ans, out choice)) { switch (choice) { case 3: console.writeline("mutteer voorraad."); mutteer(ba, bb, bc, bd, be); break; default: console.writeline("wrong selection!!!"); thread.sleep(1800); console.clear();