Posts

Showing posts from July, 2015

c++ - How can I use POCO to parse an xml file and extract a particular node to a std::string? -

i want extract individual node using poco's libraries can't figure out how it. i'm new xml. the xml looks (abbreviated): <?xml version="1.0" encoding="utf-8"?> <!-- created xmlprettyprinter on 11/28/2012 --> <sbml xmlns = "http://www.sbml.org/sbml/level2/version4" level = "2" version = "4"> <model id = "cell"> <listofspecies> </listofspecies> <listofparameters> <parameter id = "kk1" value = "1"/> </listofparameters> <listofreactions> <reaction id = "j1" reversible = "false"> ... stuff here .. </listofreactions> </model> </sbml> i want extract in listofreactions node , store in std::string, later md5 hashing. i have tried this: ifstream in(joinpath(gtestdatafolder, "test_1.xml").c_str()); inputsource src(in); domparser parser; autoptr<document>

.net - Virtual Host in Apache downloads the file instead of displaying it -

i'm using apache2 w/ mono mod , works fine when go local ip. 192.168.1.210 but when try go virtual host www.example.com it download webpage instead of displaying it. file: mod_mono.conf gnu nano 2.2.6 addtype application/x-asp-net .aspx .ashx .asmx .ascx .asax .config .ascx directoryindex index.aspx # include web application definitions generated mono-server{2,4}-update. # # if want use asp.net 2.0 (via mono-apache-server2), use: # include /etc/mono-server2/mono-server2-hosts.conf # # if want use asp.net 4.0 (via mono-apache-server4), use: # include /etc/mono-server4/mono-server4-hosts.conf include /etc/mono-server4/mono-server4-hosts.conf <virtualhost *:80> servername example.com serveralias www.example.com serveradmin web-admin@example.com documentroot /var/www/html # monoserverpath can changed specify version of asp.net hosted # mod-mono-

java - Large file does not download with jsp -

i sending ajax post request script inside jsp. inside controller reading file location , return byte array. fileinputstreamreader = new fileinputstream(file); byte[] bytes = new byte[(int) file.length()]; fileinputstreamreader.read(bytes); filedata = base64.getencoder().encode(bytes); response.setheader("content-disposition", "attachment; filename=" + filename); response.setcontentlength((int) file.length()); fileinputstreamreader.close(); then on front end crating invisible link , downloading file. $.ajax({ url : url, type : 'post', data : nodedata, beforesend : function(jqxhr, settings) { setcsrfheader(jqxhr); }, success : function(data) { hideloader(); /* window.open("data:"+contenttype+";base64, " + data); */ var uri = 'data:'+contenttype+';base64,' + data; var downloadlink = document.createelem

android - loading only a specific element properly in webview -

i trying load specific element in webview webpage ('contentbody'). dont know how modify code load only. can block elements in webview using simple javascript. public void onloadresource(webview view, string url) { super.onloadresource(view, url); // removes element id = 'masthead' view.loadurl("javascript:(function() { " + "(elem = document.getelementbyid('smsform')).parentnode.removechild(elem); " + "})()"); } an option might use jsoup , load html page website, extract desired portion of html, , load webview. small example of how done: document doc = jsoup.connect("http://example.com/").get(); mywebview.loaddatawithbaseurl("http://example.com/", doc.select(".contentbody").first().outerhtml(), "text/html", "utf-8", null); with this, use jsoup extract first item contentbody class html, , directly load web

ruby - Rails create task or model to update the schema -

i have list of tables(postgres database), , want create rake task or method not know 1 better change schema existing table. i have done lot of googling , found multi schema used multi tenant applications, have 2 schema alone , use in db this i have list of tables user profile projects , more, update schema while rake db:drop or rake db:migrate example: user , profile stays in public schema , task should create new schema "dashboard" , move project table dashboard. how create task or method update schema while drop , migrate?

java - Spring error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in URL -

i learn spring , have problem: org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in url [file:/c:/users/pantau_acc/desktop/spring/target/classes/applicationcontext.xml]: invocation of init method failed; nested exception javax.persistence.persistenceexception: [persistenceunit: com.donutek] unable build hibernate sessionfactory @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1578) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:545) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) @ org.springframework.beans.fac

how to insert anchor tag in export csv report php? -

i want insert anchor tag ( url open csv report ) in csv export. i have 2 variables header , data respectively $csv_header , $csv_lines. in $csv_lines have urls , want export it. my csv code $csv_header = "\"developer name\",\"url\" \n"; $csv_lines =eregi_replace(" ", " ", "\"$developer_name\",\"$url\" \n"); for example $url = <a href="http://www.example.com">example</a> $file_time = date("y-m-d h:i:s"); $csvfilename = "report_$us$file_time.csv"; header('content-type: application/octet-stream'); header("content-disposition: attachment; filename=\"$csvfilename\""); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); ob_clean(); flush(); echo $csv_header; echo $csv_l

c# - How to integrate NLog to write log to Azure Streaming log -

currently using nlog write application errors text file. how can configure nlog write error messages azure streaming log apart writing azure blob storage? thanks the azure streaming log captures sent trace interface. if configure nlog send target, can access through output window in visual studio instance. here how configured nlog.config obtain result: <targets> <target xsi:type="file" name="f" filename="${basedir}/logs/${shortdate}.log" layout="${longdate} ${uppercase:${level}} ${message} ${exception:format=tostring}" /> <target xsi:type="trace" name="trace" layout="${logger} ${message} ${exception:format=tostring}" /> </targets> <rules> <logger name="*" minlevel="info" writeto="f" /> <logger name="*" minlevel="trace" writeto="trace" /> </rules> the first target sh

iphone - Getting image from image picker causes memory warning -

i working on app requires both thumbnail version , compressed full version of image selected uiimagepickercontroller . when selecting relatively large image (such taken iphone 4s camera), receive memory warning. cannot determine whether or not resizing algorithm or getting image picker. can done prevent this? there must solution, simple photo picker used in countless apps. - (void)imagepickercontroller:(uiimagepickercontroller *)picker didfinishpickingmediawithinfo:(nsdictionary *)info { //show progress hud while image retrieved [svprogresshud showwithstatus:@"getting picture" masktype:svprogresshudmasktypegradient]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_high, 0), ^{ uiimage *originalimage = [info objectforkey:@"uiimagepickercontrolleroriginalimage"]; //currentimage = [originalimage scaletosize:cgsizemake(100.0f, 100.0f)]; cgsize size = cgsizemake(51, 43); uigraphicsbeginimagecontext(

visual studio 2015 - asp.net 5 cannot find rc2 nuget packages -

i have simple asp.net 5 web application. project.json file contains dependency: "microsoft.identitymodel.tokens": "5.0.0-rc2-301060021" when restore nuget packages, package restored on machine. project.json file in source control, not work on other machine. says package not found. anyway, in nuget configuration im pointing local nuget packages repository, not contain asp.net 5 nuget packages. of these packages come from? rc2 has not yet been made public, we're still on rc1. here roadmap schedule , indicates sometime year. if somehow have package on machine, setup nuget feed others on project point -- place package in there, it's on shared feed. here helping documentation shows how that.

jquery - Bind Complex Json to Html Grid -

i trying render complex json array structure html grid. tried used kendo ui grid , datatables.js bind json array not quite sure how should bind that. here json. {"data":[{"cemetry_record":{"info":{"application_id":"020.2009.00000004.001","cemetry_name":"gore","cemetry_section":"roman catholic","service_type":"burial","first_name":"david","middle_name":"charles","family_name":"smith","birth-date":"2000-01-01","date_of_death":"2015-01-01","service_date":"2015-01-01","last_modified_date":"2009-03-09t09:35:05+11:00","description":"cemetry entry david charles smith","age":15,"photos":"yes","lodgement_date":"2009-03-09t00:00:00+11:00","status":"deceased&q

c# - Trace the soap message in windows form application -

i developing windows form application in visual studio 2010. consuming soap webservice on https. need trace messages debug. found out soap extension solution that. but, can used web applications. have u checked service trace viewer tool. here link in app config file use: <system.diagnostics> <trace autoflush="true" /> <sources> <source name="system.servicemodel" switchvalue="information, activitytracing" propagateactivity="true"> <listeners> <add name="sdt" type="system.diagnostics.xmlwritertracelistener" initializedata= "sdrconfigexample.e2e" /> </listeners> </source> </sources>

ssl - How to use trust store with pentaho Data Integration / Rest Client? -

i'm using pentaho data integration (kettle). goal consume existing rest api https. achieve this, use rest client provided pdi. on local environment, i'm able consume api. however, once push on production server (redhat) , run job, i've got error related ssl certificate : javax.net.ssl.sslhandshakeexception: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target to provide target certificate, i've first added in new keystore using keytool [in /home/user/] : keytool -importcert -keystore spoc.truststore -alias spoc-preprod -file cert.crt -noprompt to make pdi use truststore, i've configured rest client : rest client ssl truststore configuration once pushed related transformation in production , run job, i've got different error : keystore tampered with, or password incorrect @ org.pentaho.di.trans.steps.rest.res

orchardcms - Error: [$sce:unsafe] AngularJS 1.2.20 -

i'm creating web site using orchard cms , angularjs 1.2.20 , i'm trying render html code i'm getting error error: [$sce:unsafe] http://errors.angularjs.org/1.2.20/$sce/unsafe v/<@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:6:450 be/this.$get</e@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:117:34 be/this.$get</<.gettrusted@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:118:327 @http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:120:71 kd</</<@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:191:341 zd/this.$get</k.prototype.$digest@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.min.js:109:170 zd/this.$get</k.prototype.$apply@http://www.angularjshub.com/code/angularjs/repository/angular-1.2.20/angular.m

angularjs - ngOptions use a later initialized value as result -

i have select ng-options : res.blob res.name group res.title res in exerciseresources.images the array has such style: { name: "bee", title: "animals", path: "/images/animals/bee_1.2.png" } the res.blob initialized during page load, undefined in html. on pageload convert image blob stored in .blob (i refer in ng-options). the init function in controller refers function in service: $q(function () { constants.initblob(); }); $scope.exerciseresources = constants.exerciseresources; i think loaded afterwards. there way refresh html , value working?

css - HTML not displaying as expected in outlook -

Image
i have following html: <html> <table align="center" cellspacing="0" border="0" cellpadding="0" width="600" style="text-align: center;"> <tbody> <tr> <td valign="top" style="height:78px; width:528px"> <a href="link" style="display:block; height:78px; width:528px; color: #2a3379; text-decoration: none !important; padding-top:32px; font-family:arial; font-weight:bold; font-style:italic; border-radius:5px; font-size:40px; display:block; margin:0 auto; background-color:#b5e61d;"> apply </a> </td> </tr> </tbody> </table> </html> which display in browser: the problem is, when add html template email, displays in outlo

javascript - Jasmine and angular mocks : mocking a service that handles local storage -

i have 1 service called wd$cache, wrapper localstorage.setitem , get.item. now i'm trying test controller uses service achieve result. main problem have if statement gets triggered if have localstorage set driving me nuts! (we doing tdd here) service (function () { angular .module('hub') .controller('promotionnotificationctrl', promotionnotificationctrl); promotionnotificationctrl.$inject = [ 'hub$promotions', 'hub$client', 'wd$cache' ]; function promotionnotificationctrl( hub$promotions, hub$client, wd$cache) { var vm = this; activate(); ////////// function activate () { hub$promotions.get(hub$client.brand, hub$client.subbrand).success(function (data) { if (!wd$cache.get('hub$notification')) { wd$cache.add('before', 123); } else { wd$cache.add('after', 321); } });

android - Retrieving an Image(saved in sqlite) from onClickListener -

i created book app, can save books internet (googlebooksapi). bookdata (title, author, image) saved in sqlite db. can view books in listview. if click on row ( book) bookdata shown in new activity (bookinfoactivity) problem is, dont know how pass image of row clicked bookinfoactivity. i tried following, , know pass image of first row. bookinfoactivity @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_book_info); bookdbhelper = new bookdbhelper(this); typeface mytypeface = typeface.createfromasset(getassets(), "lobster.ttf"); textview mytextview = (textview) findviewbyid(r.id.yourbookinfo); mytextview.settypeface(mytypeface); imageview = (imageview) findviewbyid(r.id.passed_bookimage); btn_update = (button) findviewbyid(r.id.button_update); btn_delete_book = (button) findviewbyid(r.id.btn_delete_book); intent intent = getintent(); string s

javascript - excel export in server side vs client side -

what pros/cons of exporting excel server side , client side? i know, depends on situation, want know exact risks using one? i have java/angularjs(with restful ws) app shows datatables in client side. need excel export functionality. normally, best use server side guess(like apache poi). come across js(angularjs) solutions. before hard export excel client side(needed flash). , rising power of client side coding , html5 there many plugins exporting excel in client side. and wonder if time use client side, , adventages styling , network traffic decrease. suggestions? usually, download client side flash security issue. in html5 can use download property of <a> but not compatible in browser. think actual best way (for cross browser) download server side. see more w3school

javascript - how to rotate leaflet.js map -

i'm trying rotate map (or tilelayer) x degrees. research didn't produced results not dirty hacks , in case doesn't work. is there native leaflet.js way of rotating map ? (css rotate doesn't affect mouse movement) sorry say, there no way of natively rotating leaflet map. you'll need 1 of ugly hacks or switch away leaflet , take @ mapbox gl js or open layers 3: http://www.mapbox.com/mapbox-gl-js/example/navigation/ http://openlayers.org/en/v3.13.0/examples/rotation.html

javascript - Fetching Mail Id in Login with Facebook? -

how can fetch mail id in login facebook option.i created sample project , can fetch username,but cant fetch mail id. my coding following. i created app id , implement in following code. window.fbasyncinit = function () { fb.init({ appid: '###############', cookie: true, // enable cookies allow server access // session xfbml: true, // parse social plugins on page version: 'v2.5' // use version 2.2 }); fb.getloginstatus(function (response) { statuschangecallback(response); }); }; function statuschangecallback(response) { console.log('statuschangecallback'); console.log(response); if (response.status === 'connected') { testapi(); } else if (response.status === 'not_authorized') { document.getelementbyid('status').innerhtml = 'please log ' +

c++ - Why crtp works for structs and not for class? -

let's consider following code: template<typename t> struct base{ }; struct derived: base<derived>{ }; int main() { base<derived>* base_ptr = new derived(); } and works, mean compiled. , same version of class: template<typename t> class base{ }; class derived: base<derived>{ }; int main() { base<derived>* base_ptr = new derived(); //error ‘base<derived>’ inaccessible base of ‘derived’ } because struct default access base classes public , , class it's private . use class derived: public base<derived>{ ^^^^^^ to make equivalent first example. this has nothing crtp, same error without crtp: class base { }; class derived : base { }; base* base_ptr = new derived();

java - how decode ascii code from json -

i received json file ascii code in middle, example: &#226;mbito da comemora&#231;&#227;o dia de s&#227;o valentim, 14 de fevereiro. how decode special chars in java. thanks you. that "âmbito da comemoração dia de são valentim, 14 de fevereiro." string s = "&#226;mbito da comemora&#231;&#227;o dia de s&#227;o valentim, 14 de fevereiro."; pattern p = pattern.compile("&#(\\d+);|."); stringbuilder sb = new stringbuilder(); matcher m = p.matcher(s); while (m.find()) if (m.group(1) != null) sb.append((char)integer.parseint(m.group(1))); else sb.append(m.group()); system.out.println(sb.tostring()); // -> âmbito da comemoração dia de são valentim, 14 de fevereiro.

Highcharts - creating chart with same scale axis -

i'm trying create combined chart line , semi-circles numerical x , y axis. have problem because can't create chart axis in same scale. how every try different proportions of x , y scale. here example: https://jsfiddle.net/nje5cj6x/ . var data = [ [10, 100], [20, 150], [30, 200], [40, 250], [50, 300] ]; so, container has same width , height, both axis same, still x , y axis not same proportions: measured width , height so, on graph each point on line should intersect corresponding semi-circle @ 90'. can done? also, can add data in data var? example, i'd pass variable r, besides x , y radius? if that, values not calculated in same scale, if edit code to: chart.renderer.arc(point.plotx + chart.plotleft, point.ploty + chart.plottop, point.r, point.r, -math.pi, 0) i worse result. thanks! in example, canvas element has same width , height. however, there more room used @ bottom labels/legend used on left

css - Where is the source of this Heisenbug for a Wordpress twentysixteen child theme? -

Image
i working on child theme wordpress's twentysixteen theme, , 1 boilerplate move restore text-decoration underline links. for links, below, results in 2 lines, not one, under text, unless hover over. if hover on link 1 of them goes away. (in other words, may have heisenbug defeats usual song , dance when css bit off.) needless say, complicates process of using chrome's inspect element feature. working hypothesis there border-bottom or in twentysixteen, possibly due accessibility concern people handle descenders more if underline lower browser defaults. however, after inspection via chrome's inspect element, , effort wade through basic twentysixteen's style.css, not entirely sure correct way say, "i want links underlined, , no double underlining." if want keep text-decoration: underline links, how can remove additional underline?

java - Why is Ant using Jar library twice? -

i ran across problem building .apk file using ant. before added game.jar libs folder allright , ant succesfully produced .apk file. after added game.jar libs folder trouble starts. during [dex] phase seems still allright. [dex] input: path\to\project\libs\game.jar but in [apkbuilder] phase ant failed message: [apkbuilder] found duplicate file apk: classes.dex [apkbuilder] origin 1: path\to\project\bin\classes.dex [apkbuilder] origin 2: path\to\project\libs\game.jar game.jar added libs folder. any idea cause problem? need specify setting? can prevent ant using game.jar in [apkbuilder] phase ?

Android debug setDisplayHomeAsUpEnabled what does it mean? -

i'm using setdisplayhomeasupenabled set of fragments, i.e. activity a, b, c, d fragments. upon pressing setdisplayhomeasupenabled, directs fragment x.... have not idea why happening, thought have declare following in oncreate() of activity actionbar bar = getactionbar(); bar.setdisplayhomeasupenabled(true); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fraga fragment = new fraga(); fragmenttransaction.add(r.id.frag_container, fragment); fragmenttransaction.commit(); everything else works fine, except setdisplayhomeasupenabled button... directs fragment x(the settings page actually, thought directing frag a!!) does have clue? big thanks!! you can override behaviour of setdisplayhomeasupenabled . if want redirect screen want override behaviour following this: @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case android.r.id.home:

How to map a port in VHDL? -

i want build full adder in vhdl , read result 1 of pins. entity main port (foo: out std_logic); end entity main; given code, how map foo real pin on fpga? here details of fpga i'm using: manufacturer: xilinx family: spartan 3e device: xc3s500e package:ft256 in xilinx ise, add file project; should automatically set top level entity. in 'processes' panel (typically near bottom left), expand 'user constraints' , double click 'i/o pin planning (planahead) - pre-synthesis'. opens planahead pin planning tool. using this, can drag port onto pin of device. saving in program should create 'constraints' (.ucf) file. can edit file manually. ise use constraints file when compiling fpga.

How to install previous veriosn of jrebel for EE into eclipse -

Image
i'm using liferay 6.0.6+ jrebel 5.2 seems jrebel 5.2 causing liferay server's every page load stuck couples of seconds. previous version doesn't has issue, online installation doesn't give option select version install, instead install latest version. how install previous version of jrebel ee eclipse? i've tried replace jrebel.jar in eclipse plugins jrebel.jar of 5.1.3, no effects. thanks. you can download 5.1.3 zip archive , in help -> jrebel config center select alternative jrebel.jar

archiving - cassandra data purging for time series data based on timestamp column -

i storing time series data in cassandra on daily basis. archive/purge data older 2 days on daily basis. using hector api store data. can 1 suggest me approach delete cassandra data on daily basis data older 2 days? using ttl approach cassandra row not feasible, number of days delete data configurable. right there no timestamp column in table. planning add timestamp column. problem is, timestamp alone cannot used in clause, new column not part of primary key. please provide suggestion. ttl right answer, there internal timestamp attached every mutation used don't need add one. manually purging never idea. may need work on data model bit, check datastax academy examples time series also thrift has been frozen 2 years , officially deprecated (removal in 4.0). hector , other thrift clients not maintained anymore ( see here ). using cql , java driver give better results more resources available learn well.

Does phpredis support redis 3? -

i have been searching information. have used phpredis redis server 2.x, due server migration have redis server 3.x. phpredis support redis 3? yes, support redis 3.0.x. , in present time (winter 2016): does not support redis cluster. does not support redis 3.2.x new commands geo family.

cron - connect to an url in php -

i want through project create cron script connect server has remote url: http: // test / folder /. , in folder ago csv file them , put them in local application. $url = 'http://test/folder/'; $url=str_replace(" ", "%20", $url); $infos = pathinfo($url); //if (preg_match('/\b(https?|http?):\/\/*/', $url) !== 1) /*{ echo "<h1>téléchargement impossible !</h1><br /> le fichier demandé n'est pas disponible (<b>".$infos['basename']."</b>)."; die; }*/ $username = 'test'; $password = 'test'; $context = stream_context_create(array( 'http' => array( 'header' => "authorization: basic " . base64_encode("$username:$password") ) )); $data = file_get_contents($url, true, $context);

Permutations of Boolean values in ruby hash -

i need implement function gets array symbols parameters [:a :b :c] , , returns array contains possible permutations of boolean values mapped symbols in hash like [{a: true, b: true, c: true}, {a: false, b: true, c: true}, {a: true, b: false, c: true}, {a: true, b: true, c: false}, {a: true, b: false, c: false}, {a: false, b: false, c: true}, {a: false, b: true, c: false}, {a: false, b: false, c: false}] what elegant way implement such thing in ruby? i use repeated_permutation task: [true, false].repeated_permutation(3) .map { |a, b, c| { a: a, b: b, c: c } } #=> [{:a=>true, :b=>true, :c=>true}, # {:a=>true, :b=>true, :c=>false}, # {:a=>true, :b=>false, :c=>true}, # {:a=>true, :b=>false, :c=>false}, # {:a=>false, :b=>true, :c=>true}, # {:a=>false, :b=>true, :c=>false}, # {:a=>false, :b=>false, :c=>true}, # {:a=>false, :b=>false, :c=>false}] or array of key

java - Does trigonometry need some library -

i trying run code nothing get..is wrong code or compiler? can point me still new on java public class mathtrigonometricexample { public static void main(string[] args) { double radians = 45.0; double sine = math.sin(radians); system.out.println("the sin of " + radians + " = " + sine); double cosine = math.cos(radians); system.out.println("the cos of " + radians + " = " + cosine); double tan = math.tan(radians); system.out.println("the tan of " + radians + " = " + tan); double asine = math.asin(sine); system.out.println("arcsine of " + sine + " = " + asine); double acosine = math.acos(cosine); system.out.println("arccosine of " + cosine + " = " + acosine); double atan = math.atan(tan); system.out.println("arctangent of " + tan + " = " + atan);

php - saving data in JSON object and sending online -

my idea have contact form encode input data json file , sending somewhere, can access google spreadsheet, using this method. this current php part of form: <?php $errors = array(); $data = array(); if (empty($_post['name'])) $errors['name'] = 'name required.'; if (empty($_post['email'])) $errors['email'] = 'email required.'; if (empty($_post['superheroalias'])) $errors['superheroalias'] = 'superhero alias required.'; if ( ! empty($errors)) { $data['success'] = false; $data['errors'] = $errors; } else { $data['success'] = true; $data['message'] = 'success!';} echo json_encode($data); this displays success message on form, that's it. need do something information. tried add post email function, see if mail.. $to = "email@email.com"; $from = $_post['email']; $first_name

cordova - phonegap JQUERY.GET() doesnt work on blackberry app -

im developing phonegap xml data remote site. code works on riple simulator not work on blackberry app any idea how solve problem ? here 's code jquery.get(rss, {}, function(res, code) { entries = []; var xml = $(res); var items = xml.find("artikel"); jquery.each(items, function(i, v) { entry = { title:$(v).find("title").text(), subtitle:$(v).find("subtitle").text() }; entries.push(entry); });

angularjs - How to echo JSON array as Smart Table data with Angluarjs -

i'm pretty new angular, , trying build table using smart table based on data i'm fetching rest api. can build table fine manually entered data, when try insert json array of data server resulting table empty. currently have following set up: datafactory.js - calls api , gets json response: app.factory('datafactory', ['$http', function($http) { var urlbase = 'http://myurl.com/api'; var datafactory = {}; datafactory.getorders = function() { return $http.get(urlbase + '/orders'); }; return datafactory; }]); my view basic , looks using smart table extension: <div ng-controller="maincontroller"> <table st-table="orderstable" class="table table-striped"> <thead> <tr> <th st-sort="createdby">name</th> <th st-sort="id">id</th> <th st-sort="state">state</th