Posts

Showing posts from July, 2015

html - relative URI in sidebar with subfolders -

i have designed website subfolders , sidebar navigation menu, when enter page in subfolder, links refers current folder instead of root, using tilde doesnt resolve issue, if example type this: <a href="~/editor.aspx"> it not lookup tilde ad root folder in path , fail, if im in subfolder "articles" , on page "resume.aspx" try lookup for: http://www.website.../articles/~/editor.aspx how can correctly use root reference in <a> tag without using server.mappath on sidebar (masterpage) links? edit : happens when current folder set "articles" , click on "/register.aspx"? wont page under "articles" folder? a root-relative url starts / character.so, <a href="/editor.aspx"> fine.

swift - Referencing App Object Across Multiple Build Targets iOS -

Image
i need make several versions of ios application each different target , name. of differences between applications in applications resources , not source code. trying share source code across versions possible. my issue arises when try access application object in version not have same name original. instance, have 2 versions of application named userapp , userapp2 , following code references data store: var user = userapp.user when try run code in userapp2 target, throws error saying userapp undefined. my question is: how can make code load proper application object depending on target running? solution can used across targets without need change code. edit: userapp object xcdatamodel. the userapp class might not added in of application targets. verify target membership class.

javascript - How to slide down dynamic content using jQuery? -

i have comment system , implement "show replies (2)" slide down effect. this example of setup. <div class="comment"> <div class="main-comment"> message. <a href="#" class="show-replies">show replies (1)</a> </div> <div class="sub-comment"> funny comment there, mate. </div> </div> but because both main comment , sub comments dynamically generated using ajax, setting event handlers little tricky. how did it: $(".comment").delegate('.show-replies', 'click', function(event) { $(this).parent().next(".sub-comment").slidedown(); }); i've tried make setup simple , close real thing possible. what doing wrong , how solve it? <div class="comment"> <div class="main-comment"> message. <a href="#" class="show-replies">show replies (1)</a> &

java - JAX-WS service deployment -

i new web service programming , trying create jax-ws web-service. have created following jax-ws web service in eclipse: creating service interface: package test; @webservice @soapbinding(style = style.rpc) public interface additionservice { @webmethod int add(int a,int b); } after 1 implementation class: package test; @webservice(endpointinterface = "test.additionservice") public class additionserviceimpl implements additionservice{ @override public int add(int a, int b) { return a+b; } } last step: using following code publishing service: package test; public class addtionservicepublisher { public static void main(string[] args) { endpoint.publish ("http://localhost:9999/ws/additionservice", new additionserviceimpl()); } } i can view wsdl using bellow local url: http://localhost:9999/ws/additionservice?wsdl but don't have server installed. how, getting published? server inbuilt eclips

android - updating setListAdapter from AsyncTask -

i using tutorial , sourcecodes make listview in android. had implemented using tutorial during updating setlistadapter cannot update listview dynamically. have gone through many stackoverflow questions , giving adapter.notifydatasetchanged() solution. unable implement in asynctask. itemlistfragment.java public class itemlistfragment extends listfragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view v = super.oncreateview(inflater, container, savedinstancestate); setlistadapter(new itemadapter(getactivity(), setarray(getactivity()))); return v; } public arraylist<item> setarray(context context) { arraylist<item> items = new arraylist<item>(); realm realm = realm.getinstance(context); realmresults<books> bs = realm.where(books.class).findall(); (int = 0; < bs.size(); i++) { bitmap url = bitmapfactory.decodefile(bs.get(i).getcover());

android - SIze Imageview Placeholders -

i using recyclerview imageviews in each cell.each imageview loads images web , can square or more width height or more height width i.e sizes.i going display placeholder each image while loads in background(with progressbar).but problem dimension of images unknown , want size placeholders size of images 9gag app in placeholders size of images while loading in bacground.how achieve in android ?i don't want use wrap-content(produces jarring effect after image has been downloaded) or specific height imageviews(crops images).i using uil , planning switch fresco or picassa. if use fresco, need pass width , height of image web server, set layout params of drawee view width , height. like this: relativelayout.layoutparams draweeparams = new relativelayout.layoutparams(desiredimagewidthpixel, desiredimageheightpixel); yourdraweeview.setlayoutparams(draweeparams); from width , height of image pass web server, can calculate/

python - Passing objects to Spark -

i try understand capabilities of spark, fail see if following possible in python. i have objects non pickable (wrapped c++ swig). have list of objects obj_list = [obj1, obj2, ...] objects have member function called .dostuff i'd parallelized following loop in spark (in order run on aws since don't have big architecture internally. use multiprocessing, don't think can send objects on network): [x.dostuff() x in obj_list] any pointers appreciated. if object's aren't picklable options pretty limited. if can create them on executor side though (frequently useful option things database connections), can parallelize regular list (e.g. maybe list of constructor parameters) , use map if dostuff function returns (picklable) values want use or foreach if dostuff function called side effects (like updating database or similar).

Changing match to allow null input in javascript -

i have inherited code causing problems in safari. the problem comes few lines in code things this: if ( ... && $("#element1").val().match(/regex/) && ...) the javascript programmatically generated. the problem $("#element1").val() returns null , can't put typeof check before it, because needs treat null empty string. the easiest (and manageable) solution either create nullmatch function , call instead or override .match function itself. new function check null first , (if null) pass empty string match instead of null. i not sure how either, or best. it better either replace, or add (e.g. $("element1").val().nullmatch(/regex/) or $("element1").val().nulltoempty().match(/regex/) that isn't possible, because .nullmatch or .nulltoempty need method on possibly null value. if want write in fashion, or it's easier backend generate, write mini-plugin: $.fn.valnulltoempty = f

How can I have git ignore the root level .vs directory? -

i know git (as of 1.8.2) ignore entire directories (e.g. "bin") @ level using .gitignore file (in root directory) contains like: bin/ however, doesn't seem work for: .vs/ is there special syntax directories begin "."?

amazon s3 - nginx try_files with s3 bucket and proxy_pass for html pages without extension -

i have s3 bucket contains directories , html files. i'm using nginx in front of bucket , have configured proxy_pass bucket, works fine. want clean urls without html extension, , these urls resolve properly. example, instead of foo.com/bar/my-file-name.html , must accessible @ foo.com/bar/my-file-name the primary question here how prevent requiring .html @ end of every url. in, want nginx handle routing each requests , try looking file .html extension, , return it. my problem can't figure out how force nginx try_files on non-s3 site. when try , add configuration of try_files , breaks site returning http 500 errors on paths. for comparison, here configuration works great on non-s3 backed site (with files on server itself): location / { try_files $uri $uri/ @htmlext; } location @htmlext { rewrite ^(.*)$ $1.html last; } my goal replicate behavior proxy_pass s3 bucket , force try filenames .html extension other index.html , works out of box. here current c

xcode - Reset users default app brightness in applicationDidEnterBackground with swift -

i've been trying reset user's default device brightness in app delegate method: applicationdidenterbackground using code: uiscreen.mainscreen().brightness = screenbrightness! the code gets called brightness not reset. know how working using swift (not obj-c) this code looks correct, note not work in simulator, take effect on physical device. also, ensure value of screenbrightness between 0 , 1. you not able change screen brightness while in background. apple's documentation: brightness changes made app remain in effect while app active. system restores user-supplied brightness setting @ appropriate times when app not in foreground.

c# - How Can I Unfold This Event into an Observable Sequence? -

well, when think i've got handle on things, thrown curve. i'm trying create observable sequence instead of doing this: ((outlook.mapifolderevents_12_event)calendarfolder).beforeitemmove += calendar_beforeitemmove; private void calendar_beforeitemmove( object item, outlook.mapifolder destfolder, ref bool cancel){ /*...*/ } i'm trying use observable.fromeventpattern<tdelegate, teventargs> (func<eventhandler<teventargs>, tdelegate>, action<tdelegate>, action<tdelegate>) method, because of required parameters i'm meeting little success. closest have been able come is: var itembeforemovedobservable = observable .fromevent<outlook.mapifolderevents_12_beforeitemmoveeventhandler, object>(handler => { outlook.mapifolderevents_12_beforeitemmoveeventhandler bimeventhandler = (obj, f, ref cx) => // <-- cannot resolve symbol 'cx'; identifier expected {

javascript - How can a MDL menu be made to stay open after clicking in it? -

i need place input in mdl menu. problem when click input or in menu closes menu. how can made work? this example of problem. <button id="demo-menu-lower-right" class="mdl-button mdl-js-button mdl-button--icon"> <i class="material-icons">more_vert</i> </button> <div class="mdl-menu mdl-menu--bottom-right mdl-js-menu mdl-js-ripple-effect" for="demo-menu-lower-right"> <form action="#"> <div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label"> <input class="mdl-textfield__input" type="text" id="sample3" /> <label class="mdl-textfield__label" for="sample3">text...</label> </div> </form> </div> the solution hide , show div instead of using built in

c++11 - Undefined Reference issue with C++ and Netbeans -

i have following files: listaenc.hpp #include "elemento.hpp" #include <cstdlib> #include <iostream> template<typename t> class listaenc { public: listaenc(); ~listaenc(); ... } //implementation: template<typename t> listaenc<t>::listaenc() { head = null; size = 0; } template <class t> listaenc<t>::~listaenc() { } main.cpp: #include "listaenc.hpp" using namespace std; int main(int argc, char** argv) { listaenc<int>* teste = new listaenc<int>(); return 0; } poligono.hpp #ifndef poligono_hpp #define poligono_hpp #include "ponto.hpp" #include "listaenc.hpp" #include <string> using namespace std; public: //construtores poligono(listaenc<ponto> pontos, string nome); poligono(const poligono& orig); virtual ~poligono(); //metodos string obternome(); void adicionarponto(ponto); listaenc<ponto> obterp

mongodb - PyMongo is deleting instead of updating document -

i'm using mongodb maintain list of broadcast locations , geolocation of antennas. i'm using pymongo push locations array [{lat: nnn.dd, lon: nnn.dd}, {lat: nnn.dd, lon: nnn.dd}] i'm reading file of location data. update looks this: stations.update( {"facility-id": fac_id}, {"$push": {"antennas": {"lat": lat, "lon": lon}}} ) the first time update runs on given facility id indeed update document in database correctly. second update same facility id deletes document entirely. why happen? want add new coordinates antennas array. note, duplicate geocoordinates ok. per comments here program. run once , existing document updated. run again , document deleted: from pymongo import mongoclient client = mongoclient() dbname="test" db = client[dbname] stations = db.stations lat=456.45 lon=-321.90 fac="2" stations.update( {"facility-id": fac}, {"$push": {"

facebook - 'FacebookSDK/FacebookSDK.h' file not found work with Parse -

Image
i working parse , facebook have following 2 errors: 'facebooksdk/facebooksdk.h' file not found failed import bridging header i imported both parsefacebookutilsv4/pffacebookutils.h , parsefacebookutils/pffacebookutils.h bridging-header because doing swift. but when used parse working fine, think problem facebooksdk . after installed pod file , start project here files: this app delegate import uikit @uiapplicationmain class appdelegate: uiresponder, uiapplicationdelegate { var window: uiwindow? func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { // override point customization after application launch. parse.enablelocaldatastore() // initialize parse. parse.setapplicationid(“my_apllication_id”, clientkey: "my_apllication_key") pffacebookutils.initializefacebookwithapplicationlaunchoptions(launchoptions) // [optional] track s

Azure Logic App HTTP Listener -

Image
https://azure.microsoft.com/en-us/documentation/articles/app-service-logic-connector-http/#using-the-http-listener-in-your-logic-app says after creating http listener, need to: create new logic app. open “triggers , actions” open logic apps designer , configure flow. http listener listed in gallery. select it. you can set http method , relative url on require listener trigger flow i have followed steps religiously yet no matter do, see different tutorial! in particular, see double cilck here configure api app i have looked @ many different tutorials online , have same instructions same example photo. none of them appear see see. double clicking takes me apiapp blade can see api definition don't see way add new api endpoint. appears have put, delete , post endpoint created me (all defaults presume) , can download swagger file nothing how can add new or post trigger. i'm hoping can tell me doing wrong or missing here. perhaps api app missing critical piece

How to call grandparent constructor with parameters in Java? -

this question has answer here: jump on parent constructor call grandparent's 10 answers maybe question have many people ask, still don't know how answer. i have a, b, c class. c extends b, b extends a. the main method in c class. if want call constructor method parameters in c class, how can do? thanks much. a class public class { public a() { system.out.println("a construtor"); } public a(int a, int b) { system.out.println("a.a:"+ + "/b.b:"+b); } } b class public class b extends a{ public b() { system.out.println("b construtor"); } public b(int a, int b) { system.out.println("b.a:" + + "/b.b:" + b); } } c class public class c extends b{ public static void main(string[] str) { c c = ne

Meteor collection2 field in $unset list -

i have simpleschema: imageurl: { type: object, optional: true, autovalue: function() { if (meteor.isclient) return; var imagefield = this.field('imageid'); if (!imagefield.isset){ this.unset(); } else { var imageobj = mealsimages.findone(imagefield.value); if (imageobj){ return {thumb: imageobj.s3url('thumb'), big: imageobj.s3url('big')}; } } }, autoform: { label: false, type: 'hidden', affieldinput: { type: "hidden" } } }, for reason, when update record field appears in $unset array: meteor.methods({ mealupsert: function(doc, mealid) { check(doc, meals.simpleschema()); console.log('test7'); console.log(doc); if (mealid){ meals.update({_id: mealid}, doc); } else { mealid = meals.insert(doc); } return false; } }); will print: i20150830-21:49:39.560(

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

i have 2 simple dokku sites on 1 server. first static html site, , second simple rails app. each app has own tld. sake of argument give them domains: static.com , rails.com. ive used dokku domains plugin set both naked , 'www' domains each site. domain names purchased , setup through namecheap the namecheap domains each have 2 entries: @ | http://www.static.com | url redirect www | static.server.com | cname(alias) @ | http://www.rails.com | url redirect www | rails.server.com | cname(alias) i encountered this issue on dokku github page indicate can overcome using naked domain app name when creating original git remote. git remote add dokku dokku@server.com:static.com however, issue closed 2 years ago, , same result seems accomplished domains plugin. im wondering if should restart point both apps? so far above steps has resulted in traffic both domains being sent static.com. has encountered before? t

Creating a hash map in PHP using array -

i'm trying create hash map or 2d array using arrays in php. values hardcoded in, have. tried code in comments, realized wasn't making 2d array. $hash_map = array(); $query = $this->students_m->getstudentclasses('2'); foreach ($query->result_array() $key1=>$value1) { $query2 = $this->students_m->getstudentsinfo('2', '10', '3'); foreach ($query2->result_array() $key2=>$value2) { /* if (!in_array($value2['name'],$hash_map, true)) { array_push($hash_map, $value2['name']); } */ hash_map[$value1['id']][] = $value2['name']; } } id , student_name names of columns sql table. ran code , couple variations of it: foreach ($hash_map $student) { echo $student; echo "<br>"; } and wasn't able correct output. i'd each value maps array of unique values, example of i'm going looks like: hash_

java - Is accessing data from database faster than accessing from Arraylist -

i have 10000+ records in file. read file , keep records in arraylist, web application reads arraylist frequently. i perform reading operation on arraylist. however performance of web application slow. will better keep data file in database , read database. or there other collection can use. with arraylist<myrecord> don't have lookup method, code doing sequence searches whenever need find record. if ever lookup 1 value, e.g. name, change hashmap<string, myrecord> . allow direct lookup without need sequence search. if lookup various values, keep arraylist<myrecord> around, build multiple maps, 1 each lookup field (or set of fields). the maps same indexes in database. now, if data updated , things different. update require write entire file again, immediately? if program dies halfway through write? databases have built-in guards prevent data loss, , allow sharing data among multiple programs running @ same time.

cordova - iPhone app developed with PhoneGap emulated on an iPad -

background using xubuntu linux distro phonegap write iphone (and android) app. i own first generation ipad (ios 5.x); neither own nor wish procure more apple devices; additionally, not want pay third-party software. problem phonegap provides ios simulator , requires xcode 6+ (previously 4.5+). xcode software requires apple device. attempted solutions virtualbox can run hackintosh, solution painfully slow, , buggy. qemu/kvm can run mac os x, configuration , setup daunting , overwhelmingly complex. using jailbroken ipad might make possible run xcode, i'd rather not jailbreak ipad. questions can leverage ipad simulate iphone run app? note: alternative solution this answer implies ipad might not necessary, conflicts aforementioned documentation. if leveraging ipad testing purposes possible, possible submit app app store via ipad? you can use phonegap app on ios , android simulate app on devices using local server, more info here on how setup:

php - cakephp no such file or directory -

i have no knowledge on php , try install php web , shows error: notice: use of undefined constant cake_core_include_path - assumed 'cake_core_include_path' in /usr/local/crowdfunding/app/webroot/test.php on line 79 warning: include(cake/bootstrap.php): failed open stream: no such file or directory in /usr/local/crowdfunding/app/webroot/test.php on line 91 warning: include(): failed opening 'cake/bootstrap.php' inclusion (include_path='/usr/local/crowdfunding/lib:cake_core_include_path:/usr/local/crowdfunding/app/:.:/usr/share/pear:/usr/share/php') in /usr/local/crowdfunding/app/webroot/test.php on line 91 fatal error: cakephp core not found. check value of cake_core_include_path in app/webroot/index.php. should point directory containing /cake core directory , /vendors root directory. in /usr/local/crowdfunding/app/webroot/test.php on line 100 on test.php: (cakephp test): set_time_limit(0); ini_set('display_errors', 1); /** * use ds separ

pagination - Display object rank count in views with rails -

i have page displaying list of movie. movies voted on users , in order of vote count. i'm using pagination, split every 15 movies. need put basic rank field under each movie. movie name rank #1 movie name rank #2 movie name rank #3 i can't think of best way this. tried use each index , display index, pagination breaks this. , count starts new every time pagination moved next group. does have ideas of how might accomplish this? thanks in advance. sorry not posting code in first place. scrapped each index idea wasn't working way expected. moved making rank method on movie class still producing odd outcome. ** movie.rb def rank movie.all.order(vote_count: :desc) end ** index.html.erb <%= @movie.rank %> when call adds rank, if 2 movies have same amount of votes ranks still out of order. also apologize poor stack overflow etiquette. review guidelines, , better in future. controller: def index @movies = movie.order("vo

objective c - How to search in UITableview which have multi section in iOS -

my uitableview have 2 section "local currency" , "all currencies" . no problem when search , both section return results. when search , return results within section 2 no cell in section "all currencies" displayed. 's display header of "local currency" 0 cell. i want when search if section no have in result header of session hidden , secion have result display header , content. this code , searchresultslocal,searchresultspopular 2 results nsarray when search: -(nsinteger)numberofsectionsintableview:(uitableview *)tableview { //if (searchresultslocal.count > 0 && searchresultspopular.count > 0) { // return 2; //} return 2; } -(nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { if (section==0) { return [searchresultslocal count]; } return searchresultspopular.count; } ay appreciable. in advance. tks u much.i have figure out so

How can I get the ssh host key for a new Azure Linux VM created using PowerShell? -

Image
if create azure linux vm using powershell, how can new ssh host key, can install in local ssh/putty? preferably solution powershell code. the rsa, dsa, ecdsa, , ed25519 keys generated on first boot, , available in boot diagnostics log. if don't catch on first boot, don't think it's listed anywhere else in portal. there's 1 feasible, secure option of can think recovering fingerprint already-deployed vm. create new vm. attach vhd of vm need fingerprint. verify connection new vm using fingerprint in boot diagnostics. check fingerprint generated /etc/ssh/ssh_host_rsa_key.pub file on other disk. ssh-keygen -lf /{path}/ssh_host_rsa_key.pub you may need add -e md5 switch if need hexadecimal encoded md5 hash. powershell to boot diagnostics data via powershell: get-azurermvmbootdiagnosticsdata -resourcegroupname examplegroup -name testlab -linux connecting putty azure computes host key fingerprints base64 encoded string of sha-256 hash

c# - Calling Form2's function from Form1 with Form1's public variables -

so basically, program logs game sockets, , once log in "control panel" button appears modify stuff in game, sending message in game. "control panel" button brings out of these features through new form. provide code snippet of form1 opening form2. private void cpanel_btn_click(object sender, eventargs e) { form2 cpanel = new form2(); cpanel.show(); } as can see, brings form2. trying form2 communicate form1. basically, form2 can communicate form1 far running simple voids (functions)-- that's all. here form2's constructor class. gave public name "main", , it's set "public form1 main;" on top of form2's class. form2's full class. namespace windowsformsapplication2 { public partial class form2 : form { public form1 main; public form2() { this.formborderstyle = formborderstyle.fixedsingle; initializecomponent(); this.main = new form1(); }

mongodb - How to know status of a elasticsearch river -

i testing elaticsearch-river-mongodb data transfer between mongodb elasticsearch. doing daily updates in mongodb.. in case, how can know status of river.. times seeing river stopped in elasticsearch log. there way raise alert if river not working ? here logs [2015-08-31 14:39:48,047][info ][cluster.metadata] [slave1_dev] [[_river]] remove_mapping [[test]] [2015-08-31 14:39:48,086][info ][org.elasticsearch.river.mongodb.mongodbriver] closing river test [2015-08-31 14:39:48,088][info ][org.elasticsearch.river.mongodb.mongodbriver] stopping river test [2015-08-31 14:39:48,088][info ][org.elasticsearch.river.mongodb.mongodbriver] stopped river test [2015-08-31 14:39:48,089][warn ][org.elasticsearch.river.mongodb.mongodbriver] failed start river test – thanks in advance.

tree - How to list paths through DAG in Scala -

i have dag of words following type: hashmap[string, set[string]] . want build collection of paths through graph. method i've written doesn't behave expect @ all: def buildchain(wordgraph: hashmap[string, set[string]], path: listbuffer[string], accumchains: listbuffer[listbuffer[string]]): listbuffer[listbuffer[string]] = { val children = wordgraph(path.last) (word <- children) { path += word if (wordgraph.keyset.contains(word)) buildchain(wordgraph, path, accumchains) else accumchains += path } return accumchains } when pass in graph: map("chow" -> set("how", "cho", "cow"), "how" -> set("ho", "ow"), "cho" -> set("ho"), "cow" -> set("ow")) i expect get: listbuffer(listbuffer("chow", "how", "ho"), listbuffer("chow", "how", "ow"), listbuffer("chow", &qu

javascript - Getting value from variable causing a extra line -

Image
i need html formatting. using bootstrap build page .if hard code value appears fine pull value variable format becomes bad. the code :-- <div class="col-md-3 col-sm-6 col-xs-12"> <div class="info-box"> <span class="info-box-icon bg-blue"><i class="fa fa-certificate"></i></span> <div class="info-box-content"> <span class="info-box-text">total</span> <span class="info-box-number"></span> <p id="total"></p> </div><!-- /.info-box-content --> </div><!-- /.info-box --> </div><!-- /.col --> <div class="col-md-3 col-sm-6 col-xs-12"> <div class="info-box"> <span class="info-box-icon bg-green"><i class="fa

javascript - I want to create a countdown watch in react, in which user puts in the input, probably in seconds and then it goes down to 0 -

this clock class. totally new react started yesterday , still don't have full grasp of state , props. thought componentdidmount() react function keeps executing function in console see.it working not perfectly. start decrementing more should. thank you. import react, {component} 'react'; import './app.css'; import './app'; class clock extends component{ constructor(props){ super(props); this.state = { seconds: 0, } console.log('this.props',this.props); } // componentwillmount(){ this.timer(this.props.time); } componentdidmount(){ setinterval(()=> this.timer(this.props.time),1000); } timer(time){ console.log('time in timer', time) let count = 0; time = time - setinterval(count++); this.setstate({seconds: time}); } render(){ return ( <div> <div classname="clock-seconds">{this.state.seconds} seconds</div> </div> ) } } export default clock;

php - Doctrine :: Relation ManyToOne will not work -

i got parentclass this /** @orm\mappedsuperclass */ class basevalue { /** * @var int * * @orm\id * @orm\column(name="id", type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id; /** * @var field * @orm\onetomany(targetentity="field", mappedby="value", cascade="all") */ protected $field; /** * @return int */ public function getid() { return $this->id; } /** * @param int $id */ public function setid($id) { $this->id = $id; } /** * @return field */ public function getfield() { return $this->field; } /** * @param field $field */ public function setfield($field) { $this->field = $field; } } and child this * @orm\entity * @orm\table(name="integers") */ class integer extends basevalue

android - Get email account into textfield using cordova -

can please show me how email registered phone cordova application? in application, there registration page users must register emails , instead of them typing in, want use cordova current email on phone textfield of registration page named "email" , if possible firstname , lastname user used in registring email on phone textfield so can use following plugin [user-info-plugin][1] the way add use following command cordova plugins add https://github.com/xarv/userinfo-cordova-plugin.git after adding check config.xml proper entries. usage: var success = function(string){ alert(string); }; var error = function(string){ alert("error"); }; getinfo("email",success,error,"email",[]);` the getinfo method 1 should use action "email". should done after cordova has been loaded i.e. inside ondeviceready after deviceready has been fired. document.addeventlistener('deviceready', ondeviceready, f

c++ - Json: Unicode charecter '%' escapes at the end of the statement -

in code when try print '%' character on command line escapes(i.e not printed on command prompt), believe json compiler escaping character. i using cajun - c++ source code json what should retain '%' character. below snippet of code , writter.cpp code snippet: progval = mrldprogress_.fgi.reprogress.progress; objvd["progress%"] = json::number((int)((u32)(progval)* 100 /0xffff)); if(progval == 0xffff) { objvd["status"] =json::string("completed"); objvd["estimated time left"] = json::string("-"); } else { objvd["status"] =json::string("in progress"); } code snippet of writter.cpp prints json "name":"value" : if(it->name != "my message" && it->name != "begin table" && it->name != "end table") { if(neednewline){ writer::putchar(','); writer::p

javascript - How to stop contentEditable="true" inserting <div> instead of <p> when pressing return? -

i have div <div contenteditable="true"> <h1> headline</h1> </div> if editing text inside <h1> tag, , press return, adds new div under, instead of normal paragraph tag inserts when entering return making it: <div contenteditable="true"> <h1> headline edited</h1> <div> tapped return</div> </div> what want is <div contenteditable="true"> <h1> headline edited</h1> <p> tapped return</p> <p> return again</p> </div> whats strange when write somewhere , press return adds new <p> , not when editing <h1> . possible fix javascript/jquery/html5? i using safari on ios-device adding format blocker inside onkeyup p force contenteditable (div) add <p> tag on return. editable.onkeyup = (e)=> { e = e || window.event if (e.keycode === 13) document.execcommand('form

javascript - IE 11 crashes on setting required level in dynamics CRM 2013 hosted -

internet explorer crashes whenever try setrequiredlevel field in dynamics crm 2013 hosted org. below code causing issue. try { if (xrm.page.getattribute("new_cvv") != null) {xrm.page.getattribute("new_cvv").setrequiredlevel("required");} } catch (e) { alert(e.tostring()); } i have tried using settimeout did not worked. there no debug information this. have updated ie 11 11.0.3 went in vain.

Delphi 7 and decode UTF-8 base64 -

in delphi 7, have widestring encoded base64(that received web service widestring result) : pd94bwwgdmvyc2lvbj0ims4wij8+dqo8c3ryaw5nptiq2lpyqjwvc3ryaw5npg== when decoded it, result not utf-8: <?xml version="1.0"?> <string>طھط³Ø·Ú¾</string> but when decoded base64decode.org, result true : <?xml version="1.0"?> <string>تست</string> i have use encddecd unit decodestring function. the problem have using decodestring . function, in delphi 7, treats decoded binary data being ansi encoded. , problem text utf-8 encoded. to continue encddecd unit have couple of options. can switch decodestream . instance, code produce utf-8 encoded text file data: {$apptype console} uses classes, encddecd; const data = 'pd94bwwgdmvyc2lvbj0ims4wij8+dqo8c3ryaw5nptiq2lpyqjwvc3ryaw5npg=='; var input: tstringstream; output: tfilestream; begin input := tstringstream.create(data); try output := tfilestream.

axapta - Convert Common to and from XML -

in ax2009, possible convert record xml following: salestable salestable; salestable.xml(); is there method somewhere convert xml string record? no, there no build-in method convert xml string record. record fields can assigned container, though, using custgroup example: public initfromcon(container con) { [this.custgroup, this.name] = con; } what remains extract field data xml convert container. static void xml2contest(args _args) { str xml = @"<student> <number>001</number> <name>stud_a</name> <class>8</class> </student>"; xmldocument xmldocument = xmldocument::newxml(xml); xmlnodelist nodelist = xmldocument.selectnodes('student/*'); container xml2con(xmlnodelist list) { xmlnodelistiterator = new xmlnodelistiterator(list); xmlnode node; container ret; while (it.morevalues())

php - Loop random background image -

i want show random background image, starts loop of random other background images after 5 seconds. first create array background-images: <?php $bg = array('bg1.jpg', 'bg2.jpg', 'bg3.jpg', 'bg4.jpg', 'bg5.jpg', 'bg6.jpg', 'bg7.jpg', 'bg8.jpg', 'bg9.jpg', 'bg10.jpg', 'bg11.jpg'); $i = rand(0, count($bg)-1); $selectedbg = "$bg[$i]"; ?> second append random image body: <style> @media screen , (min-width: 600px) { body { background-image: url(<?php bloginfo('template_url'); ?>/images/backgrounds/<?php echo $selectedbg; ?>); } } </style> now use php or jquery select random image , change background. how can achieve this? if want loop background image every 5 seconds (without having user reloading page), can't on php, must done client side (javascript). php tool generate html code rendered on user's

php - Open automatically .ics on Android -

on website have button, , when click on button, download file called "event.ics". on iphone, when file downloaded, automatically read , can choose calendar, on android , windows phone, need click on file downloaded or go in folder "download" execute .ics . there way read/execute .ics on android , wp automatically ? here can see code download calendar file : public function createeventcalendar($start, $end, $description, $location) { $event = array(); $rand = rand(5, 1000000000); $event['name'] = "event"; $event['data'] = "begin:vcalendar\r\nversion:2.0\r\nprodid:-//test//test//en\r\nbegin:vevent\r\ndtstamp:".date('ymd\this')."\r\nstatus:confirmed\r\nuid:".$rand."\r\ndtstart:".date('ymd\this', strtotime($start))."\r\ndtend:".date('ymd\this', strtotime($end))."\r\nsummary:blablabla\r\ndescription:".$description."\r\nlocation:".$locati

Does GPIO Linux framework support to change mode between GPIO and IRQ -

i checked sysfs of gpio, supports configure direction (in, out), active_level, edge. i don't see supports change mode between gpio , interrupt. know ? or suggest. example: gpios can supports either gpio or irq. change mode under linux via sysfs. thanks in advance. the gpio controller (and driver) provide support if any. in case gpio controller registered interrupt controller. there lot of examples, gpio-intel-mid.c have: retval = gpiochip_irqchip_add(&priv->chip, &intel_mid_irqchip, irq_base, handle_simple_irq, irq_type_none); if (retval) { dev_err(&pdev->dev, "could not connect irqchip gpiochip\n"); return retval; }

java - How to call SOAP Web Services in many threads in Wildfly? -

i have external soap web service receive text message sms gate. receiving operation blocking operation waits few seconds (i can configure it) , returns message or null. i want receive messages multiple gates. in order create multiple threads (managed threadpoolexecutor). use jpa , cdi inside use managedthreadfactory create threads. the simplified version of code looks follows: import org.slf4j.logger; import org.slf4j.loggerfactory; import javax.annotation.postconstruct; import javax.annotation.resource; import javax.ejb.singleton; import javax.ejb.startup; import javax.enterprise.concurrent.managedthreadfactory; import javax.inject.inject; import java.util.list; import java.util.concurrent.synchronousqueue; import java.util.concurrent.threadpoolexecutor; import java.util.concurrent.timeunit; @singleton @startup public class testbean { private static final int core_pool_size = 0; private static final long keep_alive_time = 60l; private logger logger = loggerfact