Posts

Showing posts from April, 2014

php - Verify if is in array in twig template -

i have question, it's possible make in_array in twig template? example have array call acolors colors of 1 product : array[ 0 => "1" 1 => "2" ] and have class in libraries folder : class colors{ public static $acolors = array( '1' => 'white', '2' => 'black', '3' => 'yellow', '4' => 'red', '5' => 'green', '6' => 'blue', ); } now want verify if values of array colors of product = keys of general array colors, , tried in .twig : {% key,val in acolors %} {% if val in colors::acolors %} {% endfor %} but not work. exist solution? please me. can me? thx in advance!!! twig not intended run php code in it. official position of twig developers: twig template engine , thing templating, doesn't know classes, static class properties , other php-only stuff. options have are: pass array context

How create an EXI file out of an XML and several XSD files? -

i using exificient convert xml data exi. works great xml , xsd pair, not works when try use xsd composed of 2 others xsds ( <xs:import namespace=... ), composed of others xsds. can flatten these xsds manually ? (xsds newbie here, read <xs:import... flatten application not work.) if know exificient, possible use multiples xsds ? you can try having 1 xsd file "root" import xsds (so no nested xsd). , give xsd file exificient.

Can't connect to guest node set up with nat and hostonly vagrant and virtualbox -

i have been trying replace manual vitualbox setup vagrant. create guest node 2 network adapters nat guest(ubuntu) use host internet apt-get operations, , hostonly host connect guest. has been working pretty well. below vagrant file vagrant.configure("1") |config| config.vm.boot_mode = :gui end vagrant.configure("2") |config| config.vm.define "web" |web| web.vm.box = "ubuntu/trusty64" web.vm.network "forwarded_port", guest:22, host:2222, id:"ssh", disabled:true web.vm.network "private_network", ip:"192.168.56.103", :adapter =>2 end end below output: bringing machine 'web' 'virtualbox' provider... ==> web: importing base box 'ubuntu/trusty64'... ==> web: matching mac address nat networking... ==> web: checking if box 'ubuntu/trusty64' date... ==> web: newer version of box 'ubuntu/trusty64' available! ==> web: ha

c# - sitefinity Mvc Widget not redirecting -

i using code below on sitefinity mvc widget redirect index method conrtoller , getting 404 error ideas. [httppost] public actionresult editsubjectdetails(elearningsubjectmodel model) { return redirecttoaction("index", "prmanagercontroller"); } i have found solution login sitefinity click administartion> settings>advantced>pages , tick enablebackwardcompatabilityforpagesurls , code have added works fine.

What's the right way to run a javascript function without getting the object to "jump" right after the page loads -

i have simple page object gets "top" property javascript. how run function without getting things on page "jump" ? <script type="text/javascript"> function changeheight () { //gets height var h = window.innerheight; //alert(h); console.log(h); var categories = document.getelementbyid("cat").offsetheight; //alert(categories); var x = 0.32 * categories; var cattop = h - x; //gets cats document.getelementbyid("cat").style.top = cattop+"px"; } </script> </head> <body onload="changeheight()" onresize="changeheight()"> <div class="main"> <div class="cat" id="cat"></div> </div> </body> </html> i used "onload" on tag run function. know that's not good. the object jumps because move after dom has been rendered. tha

.net - How to make Entity Generator put classes in different files -

i have model.edmx generated db. when add code generation item -> ado.net self-tracking entity generator, model.tt file created partial classes every table in model. how can make generator separate classes different files? can edit these partial classes? (change names of properties, etc.) thanks

How can this MP4 be played in Firefox? From what I know Firefox doesn't support MP4 -

i found mp4 site giphy. surprise plays in firefox. know how can be? have generate 2 versions of every video file, mp4 , webm. nice not have that. here's file: http://media2.giphy.com/media/yojc2ng0mlnsoepjia/giphy.mp4 firefox use mp4 library suitable 1 on system firefox running on: firefox/firefox android/firefox os supports format in cases, when third-party decoder available, , device hardware can handle profile used encode mp4. source

javascript - Send message to thin clients trough angularJS -

i have web application developed angularjs. there form workplace accidents saved database. when new record saved need send information computers on network. of them thin clients related terminal server. web application won't running ot clients. alert/message should shown there, "new accident recorded.". i couldn't find technology should use. suggestions please? thank in advance! regards there has server part of application takes care of saving data database. in function saves data, @ end create mailing list of target users (or predefined group of receivers) , create mail sent message want em receive. popping message boxes on network computers far practical solution. don't need special technology, have need.

java - How to open a contact detail card in listView with contact names with onListItemClick in Android? -

i have contact app displays names of contact, arrayadapter. works fine want to open native contact app details of contact whenever click on name. thank in advance! public class mainactivity extends listactivity { private customadapter customadapter; list<string> contacts = new arraylist<string>(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); listview lv = (listview) findviewbyid(android.r.id.list); customadapter = new customadapter(this); lv.setadapter(customadapter); } @override protected void onresume() { super.onresume(); log.d("tag","onresume"); loadapps(); } public void loadapps(){ //cursor cursor = getcontentresolver().query(contactscontract.commondatakinds.phone.content_uri, null, null, null, null); cursor cursor; contentresolver contentresolver = getcontentresolver(); cursor = cont

"Attempted to read or write protected memory" error when changing SQL query in View Table in Visual Studio -

i don't it, why visual studio 2008 shows me such error: attempted read or write protected memory. indication other memory corrupt. (microsoft visual studio) ------------------------------ program location: @ system.windows.forms.unsafenativemethods.intdestroywindow(handleref hwnd) @ system.windows.forms.unsafenativemethods.destroywindow(handleref hwnd) @ system.windows.forms.nativewindow.destroyhandle() @ system.windows.forms.control.destroyhandle() @ system.windows.forms.form.showdialog(iwin32window owner) @ microsoft.datawarehouse.datawarehouseutilities.showdialog(form form, iserviceprovider serviceprovider, iwin32window owner) @ microsoft.datawarehouse.datawarehouseutilities.showdialog(form form, iserviceprovider serviceprovider) @ microsoft.analysisservices.controls.namedquerybuilderdialog.showdialog(datasourceview dsv, datatable datatable) @ microsoft.analysisservices.design.datasourcedesigner.editnamedquery(boolean replacetable) what i'

javascript - Angular service variable not updated in the view -

i have following service: app.service('cart', function() { this.data = []; this.addfont = function(font) { return this.data.push(font) }; this.removefont = function(i) { return this.data.splice(i, 1); }; this.count = function() { return this.data.length; }; }); and following directive, displays cart icon number of items in it: app.directive('cartbutton', ['cart', function(cart) { return { restrict: 'e', replace: true, template: '<button class="selection"><i class="fa fa-shopping-cart"></i> {{ cart.count() }}</button>' }; }]); but counter doesn't work, , there no error. how access cart.count() inside directive? angular expressions evaluated against scope. try set function on scope count cart : return { restrict: 'e', replace: true, template: '<button class="selection"><i class="

how i find relief from this error the error is undefined index: host in C:\wamp\www\serp-tracker\get_serps.php on line 42 -

i'm getting output code server giving me error notice: undefined index: host in "c:\wamp\www\serp-tracker\get_serps.php on line 42" any body can me provide me solution error <div class="form-group" <input class="form-control" type="text" placeholder="host" <?php if($_get["host"]!=""){ echo 'value="'.$_get["host"].'"';}else{ echo 'value="'.$myhost.'"'; }?> name="host"> </div> use empty() check if available. try - if(!empty($_get["host"])) if($_get["host"]!="") generate error if host not present.

python - ImportError: No module when running uwsgi -

Image
i can run server in flask development mode correctly. i think missing params run uwsgi server got error message. run uwsgi command uwsgi --socket 127.0.0.1:4245 --module web --callable app --processes 4 --threads 2 error log *** operational mode: preforking+threaded *** traceback (most recent call last): file "./web.py", line 19, in <module> model.release_schedule import releaseschedule importerror: no module named model.release_schedule web.py #!/usr/bin/env python3 # -*- coding: utf8 -*- flask import request, url_for flask import flask, request, jsonify flask_request_params import bind_request_params flask import g import datetime import pandas pd import pymongo import json webargs import arg webargs.flaskparser import use_args, use_kwargs import yaml import time, functools pdb import set_trace pandas_helper import pandashelper import errors app_helper import * model.release_schedule import releaseschedule model.history import history model.r

javascript - Unset css animation property with jQuery.css method -

i know css3 animation property removed setting none !important , , tried (and did, within css code). but, using jquery.css() method change animation property mentioned, doesn't work. i have tried $('#site-title, #site-description').css( { 'animation':'none !important', '-webkit-animation':'none !important', '-moz-animation':'none !important', '-o-animation':'none !important' } ); and tried (knowing jquery in many cases handles prefixes automatically ) $('#site-title, #site-description').css( { 'animation':'none !important' } ); ...no good. note, haven't mess node selection, when test purposes inser display:none they're gone. how resolve this? you have set this: function stopanimation() { $('#site-title, #site-description').css("-webkit-animation", "none");

github - Where to put documentation relating to multiple git repos -

i have project includes 4 forked repos. have kept these separate quite different things, work across project. the project requires repos , want keep documentation in 1 place people have 1 single point modification , configuration notes config options affect more 1 repo (such initialising forked libraries in core application. so best practice put single point of documentation? should put on 1 project , link others or there 'git' way handle this? the technical documentation subject versioning , source control. recommend making separate repository it. can later included submodule each of 4 projects. here's example of such documentation repo jetbrains: https://github.com/jetbrains/intellij-sdk-docs also, if plan use github wiki pages - stored in hidden repository. 1 can clone , other git things it.

c++ - libCurl write data with WriteFile WINAPI -

i using libcurl download data form internet. if using file write data downloaded ok. want pre-allocate data , write it. im using createfile setfilepointer setendoffile to pre-allocate file prefix size data. after im using writefile write data downloaded not successful. file corrupt or fail, cannot open or using it. simple code, have idea fix writedata method. all #include "stdafx.h" #include <stdio.h> #include <iostream> #include <fstream> #include <string> #include <conio.h> #include <curl\curl.h> using namespace std; size_t writedata(void *buffer, size_t size, size_t nmemb, handle *userdata){ bool berrorflag = false; berrorflag = writefile( userdata, // open file handle buffer, // start of data write (size*nmemb), // number of bytes write 0, // number of bytes written null); return nmemb; } int progressdata(void *ptr, double dltotal, double dlnow

Javascript: Check the URL is working / existed / reachable (returning Status 200 / non-broken) or not -

with javascript, want check url reachable (existed, returning http status 200, not 404, etc). let's say, how know (by using js) that: " https://www.google.com " (website) .. reachable link. and, " http://code.jquery.com/jquery-1.11.3.min.js " (js file) .. reachable link. and, " https://www.microsoft.com/library/errorpages/images/microsoft_logo.png " (image) reachable. (they not: broken, non-existed, 404, etc). again how know, such: " http://www.asderafsdfefrasdfsdfasf.com " or, " https://www.google.com/xxxxxxxxxxx.js " .. are broken, not-reachable, non-existed, 404 , etc?

How can I pass data from one page to another in PHP and Javascript without from? -

how can pass data 1 page page in php using javascript without from? in blog have post comment email id , routing using foreach loop problem occur when email id , comment how can this? plz help you can make use of client side cookie this. 1 page create cookie , on second page read cookie.

c# - Auto Re-sizing Windows form and its Tabs and its Controls in Tab Based on Resolution in VC# using Visual Studio 2008 -

good day! using visual studio 2008. have designed windows form in c#. in windows form have inserted 1 tab control, in tab control have 9 tabs. in these 9 tabs have controls label, text box, combo, etc.. now want maximize windows form, tab control, controls in tab based on resolution. in windows form property changed window state maximized. in getting windows form maximized want maximize tab control , controls. how it. can please give me suggestion solve issue. you can use dock or use anchor property. setting anchor left, right, top, bottom control scale window.

objective c - iOS URL Request Not Working -

This summary is not available. Please click here to view the post.

itext - 2D barcode generation issue in Java -

Image
i generating barcodes using itext api, looks when linear barcodes when 2d barcodes barcodes placed pdf document images, hence reducing quality of barcode on low resolution printers , unable scan barcode. below code barcodepdf417 pdf417 = new barcodepdf417(); string text = "barcodepdf417 barcode"; pdf417.settext(text); image img = pdf417.getimage(); document.add(img); now alternative draw barcode , found palcebarcode method might favor requirement. i have seen below code in barcodepdf417 class in itext source , not able find out way how use it public void placebarcode(pdfcontentbyte cb, basecolor foreground, float moduleheight, float modulewidth) { paintcode(); int stride = (bitcolumns + 7) / 8; cb.setcolorfill(foreground); (int k = 0; k < coderows; ++k) { int p = k * stride; (int j = 0; j < bitcolumns; ++j) { int b = outbits[p + j / 8] & 0xff; b <<= j % 8; i

algorithm - Solve recurrence 2T(n^1/2 )+c assuming T(1) and c are constants -

Image
got 'essential algorithms' exam doing bit of revision. came across question , unsure whether answer right. this imgur link has question , working. http://imgur.com/sfkurqo could verify whether right / ive went wrong? i can't follow handwriting point out went wrong, here's how it: t(n) = 2t(n^(1/2)) + c = 2(2t(n^(1/4)) + c) = ... = 2^kt(n^(1/2^k)) + 2^(k - 1)c so need find smallest k such that: n^(1/2^k) = 1 (considering integer part) we can apply logarithm expression: 1/(2^k) log n = 0 (remember we're considering integer parts) => 2^k >= log n | apply logarithm again => k log 2 >= log log n => k = o(log log n) because log 2 constant so have: 2^o(log log n)t(1) + 2^o(log log n - 1)c = o(2^log log n) = o(log n) i see got o(sqrt(n)) , isn't wrong either, because log n < sqrt n , if log n upper bound, sqrt n . it's not tight bound.

java - Android MediaPlayer not stopping by clicking another button -

when click on 2 buttons hear 2 sounds. how can stop first sound , play second sound or when play first sound, second sound stops? how can create this? here media player final linearlayout lm = (linearlayout) findviewbyid(r.id.linearmain); linearlayout.layoutparams params = new linearlayout.layoutparams( layoutparams.wrap_content, layoutparams.wrap_content); jsonarray songs = (jsonarray) response.getjsonarray("songs"); ( int = 0; < songs.length(); i++) { // create linearlayout audio = songs.getjsonobject(i).getstring(tag_audio) ; string chanson = songs.getjsonobject(i).getstring("title") ; string duration = songs.getjsonobject(i).getstring(tag_duration) ; linearlayout ll = new linearlayout(getapplicationc

jquery - Rails Issues with Rendering Javascript -

i'm using jquery-tokeninput (loopj.com/jquery-tokeninput/) in rails app. works well, when load page, doesn't render should. when refresh, works perfectly. i'm not sure if javascript incorrect, i'm having similar issues other parts of app (rating system using 5 stars renders when refresh page). this javascript have: $(function(){ $("#ingredients_tokens").tokeninput("/ingredientsynonyms.json", { crossdomain: false, prepopulate: $("#ingredient_token").data("pre"), theme: "facebook", searchdelay: 1 }); });

c - How to parallelize 3 Two-dimensional arrays -

i need check best way parallelize 3 two-dimensional arrays. 2 of them (a , b) have values set in loop, , other (the c) have sum of , b. i have use mpi achieve want. i'm thinking in separate process , check "if myrank == 0 make work", don't know if best option. code have parallelize this: for (i=0; i<1000; i++) { (j=0; j<1000; j=j+2) { a[i][j] = 1.0; a[i][j+1]=-1.0; } } (i=0; i<1000; i++) { (j=0; j<1000; j++) { b[i][j] = 1.0; c[i][j] = 0.0; } } (i=0; i<1000; i++) { (j=0; j<1000; j++) { (k=0; k<1000; k++) { c[i][j] += a[i][k] * b[k][j]; } } } result=0.0; (i=0; i<1000; i++) { (j=0; j<1000; j++) { result=result+c[i][j]; } }

Spring Websockets 4.1.6 with Tomcat 7.0.54 and Apache 2.4 -

Image
i'm having troubles running simple application using spring websockets 4.1.6, tomcat 7.0.54 , apache 2.4.16 web server. i have read lot of posts in internet, , don't know what's happening. server starts without problems. have index.html published in server project starts websocket connection. if access file directly tomcat, works perfectly. http://localhost:8080/myserver/messaging/index.html but if access file apache server, doesn't work. http://localhost/messages/messaging/index.html in apache server have configured proxy pass: proxypass /messages http://localhost:8080/myserver proxypassreverse /messages http://localhost:8080/myserver my server websocket configuration looks follows: @configuration @enablewebsocketmessagebroker public class puiwebsocketconfig extends abstractwebsocketmessagebrokerconfigurer { @override public void configuremessagebroker(messagebrokerregistry config) { config.setapplicationdestinati

Adding layout to the bottom of screen in Android -

i want add layout this: <header layout>(fixed) | | <scrollview> | | <footer layout>(fixed) here's i've tried far: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <scrollview android:id="@+id/container" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_above="@id/footer" > <linearlayout android:id="@+id/limain" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" >

javascript - Angular JS resolve in a resolve -

what mean resolve in resolve want able resolve user first, , resolve additional info, eg, addressess, contacts, friends. what have: .state('website', { url : '', abstract : true, resolve : { // request current signed in user > current_user : ['auth', function(auth){ return auth.requestuser(); }] }, views : { 'main' : { templateurl : 'template.html' } } }) what i'll following: .state('website', { url : '', abstract : true, resolve : { // request current signed in user > current_user : ['auth', function(auth){ auth.requestuser().then(function(){ // here want resolve other resources

java - vaadin setItemCaptionPropertyId more then one caption in combobox -

i using beanitemcontainer fill combobox, : //filling combobox userdto's beancontainer beanitemcontainer<subcategorydto> beancontainer = new beanitemcontainer<subcategorydto>( subcategorydto.class); arraylist<subcategorydto> subcategorys = qpc.getsubcategorys(); beancontainer.addall(subcategorys); cmbcategory.setcontainerdatasource(beancontainer); cmbcategory.setitemcaptionmode(itemcaptionmode.id); cmbcategory.setimmediate(true); cmbcategory.setnewitemsallowed(false); cmbcategory.setnullselectionallowed(false); cmbcategory.setitemcaptionpropertyid("name"); the dto has following fields : public class subcategorydto extends observable implements serializable { private static final long serialversionuid = 1l; private int subcategoryid; private string name; private categorydto category; ... i let itemcaption of combobox show both name , category name (dto has name field), : categoryname subcategor

How to tell the framework to copy static files to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files when building the website -

i have been bothered troubling issue regarding asp.net project (mvc5 more specific) last 2 days. tried search internet solution, discover cause know. in case i'm having mvc5 project referencing third party's dll consumes c++ dll, , 2 other text configuration files, apparently these files has reside in same folder third party's dll. after compiling necessary files (the 3rd party's dll , of dependencies) correctly copied bin folder. however, when browsing site hosted iis7.5, framework takes 3 party's dll \temporary asp.net folder, cause lot of run-time errors when instructions dll executed process. how can produce way of configuration show framework these dependencies in order gain behavior i'm expecting ?

javascript - ng-options with one object -

i have callback either can array multiple objects, or 1 object: $http.get($rootscope.appurl + '/nao/abb/getstationdata/' + selectedsupercustomer.superkund_id).success(function(data) { $scope.stationoptions = data; if($scope.stationoptions instanceof array) { //array of objects angular.foreach($scope.stationoptions, function(option) { console.log(option); if(option.nao_adsl_stationer_id === $scope.abbdata.nao_adsl_stationer_id) { $scope.selectedstation = option; } }) } else { //only 1 object if($scope.stationoptions.nao_adsl_stationer_id === $scope.abbdata.nao_adsl_stationer_id) { $scope.selectedstation = $scope.stationoptions; } } }); if array multiple objects, don't have problem loop them out ng-options, when callback 1 object, this: {"nao_ads

IOS Objective C - error while passing parameter between two view controllers -

i have 2 viewcontrollers : registerviewcontroller & register2viewcontroller i have segue registerviewcontroller register2viewcontroller. i want set value of textfielduser in register2viewcontroller value user entered in textfieldemail in registerviewcontroller. so far here i've done. in registerviewcontroller.m - (ibaction)nextpage:(uibutton *)sender { [self performseguewithidentifier:@"toregister2" sender:self]; } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring:@"toregister2"]) { register2viewcontroller *controller = (register2viewcontroller *)segue.destinationviewcontroller; controller.user.text = self.email.text; } but when run , fill values of textfields in registerviewcontroller , go on register2viewcontroller textfield user empty, can me please? thank you instead of directly passing value textfield, try passing text using nsstri

javascript - Hover function does not work in Google Chrome when using jQuery-1.7.2.min.js -

i use adminlte template create admin page. encounter problems included jquery source. have part of function nested sort refer jquery-1.7.2.min.js work. runs okay in firefox, when try run in google chrome, sidebar hover function not work. tried replace original template jquery jqyery-2.0.2.min.js, after hover function work, nested sort function no longer works. there can differentiate 2 jquery functions? here sample code. have nested sort function : <!-- nested sequence reference--> <script type="text/javascript" src="js2/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="js2/jquery-ui-1.8.16.custom.min.js"></script> <script type="text/javascript" src="js2/jquery.ui.touch-punch.js"></script> <script type="text/javascript" src="js2/jquery.mjs.nestedsortable.js"></script> <!-- sequence script--> <

android - Google Places API Picker display Only Certain Types of Places -

i making android app requires user choose place. planning user google places api.link: https://developers.google.com/places/android/ this api gives gives nice way through through place picker. https://developers.google.com/places/android/placepicker now suppose want show user places of food type (restaurant, hotel etc.) . using places browser api can done adding "type=restraunts" attribute in requests. is there way show places of types using google places picker android ? we in 2017 , apparently feature still not implemented yet. even so, can check type(s) of selected place on activityresult , use it. in case, wanted app accept hospitals , related services, here's code: @override protected void onactivityresult(int requestcode, int resultcode, intent data) { //... boolean isanhospital = false; selectedplace = placepicker.getplace(this, data); (int : selectedplace.getplacetypes()) { if (i == place.type_doctor || == place.type_health || == place

javascript - Angularjs - ng-click function vs directive -

i can't decide method use in following case. i'm trying alert when clicking on buttons. can using 2 methods. best practice , please tell me why? method 1 <div ng-app="app"> <button alert>directive</button> </div> var app = angular.module('app', ['ngroute']); app .directive('alert', function(){ return { link: function(scope, element, attr) { element.on('click', function(){ alert('clicked'); }) } } }) method 2 <div ng-app="app" ng-controller="mainctrl"> <button ng-click="go()">ng-click</button> </div> app.controller('mainctrl', ['$scope', function($scope) { $scope.go = function() { alert('clicked'); } }]); thank you, rushan let me explain using example. html <div ng-app="myapp"> <div ng-controller="

Extend C++ OO methods in python -

i require documentation/example extend c++ methods in python. went through python documentation , existing questions on forum, did not exact details. to precise, if have classes c++: class manager { manager *instance; std::list<user*> userlist; manager(); public: user* getuser(const char* name); static manager* getinstance(); } class user { user(); public: void dosomething(); } in python expect like: m = getinstance() u=m.getuser('x') u.dosomething() so way write python wrapper methods internally call above methods. able write wrapper methods in non object oriented way. ie: able write can call stand alone methods getuser('x') , dosomething(), not object based ones m.getuser('x') , u.dosomething(). by doing m = getinstance() , suppose want object instance. define constructor class. add self calls method particular object only class manager: def __init__(self, args): self.user_list = [] # list of user def ge

java - Code quality - order of @Autowired member variables? -

how order member variable fields when using injecte @autowired , @value annotations spring ? would consider following example best practice? public class myexample { private static final logger logger; private static final int static_var = 1; @autowired private webservice service; @value("${my.property}") private string property; //to set setter or constructor private mailservice mail; } i'm not sure order of instance members matters. said, set them through constructor can final: public class myexample { private static final logger logger; private static final int static_var = 1; private final webservice service; private final string property; private final mailservice mail; @autowired public myexample(webservice service, @value("${my.property}") string property) { this.service = service; this.property = property; mail = new mailservice(); } }

logging - WSO2 Change Log File Location -

in wso2 log files in folder wso2_home/repository/logs . need put logs in separate directory outside of wso2_home. typically log files wso2carbon.log , audit.log , ... where can location of these wso2 log files changed? you need go wso2_home/repository/conf/ , need edit log4j.properties file wso2carbon log file need edit "carbon_logfile" , give full url "log4j.appender.carbon_logfile.fil" property log4j.appender.carbon_logfile.file=${carbon.home}/repository/logs/${instance.log}/wso2carbon${instance.log}.log for audit log need edit audit_logfile appender , change "log4j.appender.audit_logfile.file" property log4j.appender.audit_logfile.file=${carbon.home}/repository/logs/audit.log

ios - Replace a Controller in Hierarchical Navigation Stack in WatchKit -

is there way replace current controller in navigation stack watchkit? this question how i'm doing in iphone app, have not been able find way duplicate watchkit. the closest alternative i'm looking popping , somehow having controller know push new one. still haven't figured out yet. i defined bool property in first interface controller. when call second interface controller, set property to true. then, when dismiss second view controller, first view controller's method willactivate called. check bool property , pop first interface controller if true. this approach works has disadvantage: user sees first view controller short while , disappears via animation. if has better idea, interested in it.

android - How can I customize the MediaRouteButton's and RouteDialog's style? -

i'm develop android sender application googlecast . in design_checklist page, noticed that: mediaroutebutton's image has been customized, dialog's style customized. not same default style. but, in android-support-v7-mediarouter library , did not find functions allow me customize them. in castvideos-android project, found yellow cast icons , same picture showed before. not used in project. is there sample project used customized style? or how can customize them? thanks. update: gave up, choosed default style.

Sencha app build production successfully,but the production page fails to load with .js not found error -

i using extjs 5 ,sencha cmd 5 , extjs sencha charts. my app's index.html in 'app' directory works fine,and sencha app build successfully. when go production package load production index.html,the console gives me error '.js not found' ,the log below: get http://localhost:8080/build/production/recommendation/.js?_dc=1431411762018 404 (not found) ext.boot.ext.boot.d.fetch ext.boot.ext.boot.r.fetch ext.boot.ext.boot.r.loadsync ext.boot.ext.boot.r.load ext.boot.ext.boot.k.loadentries ext.boot.ext.boot.d.processrequest ext.boot.ext.boot.d.loadsync ext.boot.ext.boot.d.load ext.apply.loadscripts ext.apply.load ext.apply.require ext.apply.syncrequire ext.function.o.alias ext.classmanager.ext.apply.create ext.classmanager.ext.apply.instantiatebyalias ext.apply.factory ext.cmd.derive.applyaxes k ext.configurator.configure ext.base.r.addmembers.initconfig ext.cmd.derive.constructor ex

php - Populate HTML table from AJAX response -

i have data in mysql database. want show data in html table based on parameter selected user. following input section (html) <form class="form-inline"> <div class="input-group"> <div>enter person name</div> <input class="form-control" id="tags"> </div> <div class="btn-group"> <button type="submit" id="btnsubmit">search</button> </div> </form> this table want populate data coming ajax response. <div class="datatable_wrapper"> <table class='table table-striped table-bordered table-hover' id='records_table'> <tr class='odd gradex'> <th>name</th> <th>group</th> <th>work</th> <th>grade1</th> <th>grade2</th> <th&g

PHP switch is not working -

i have made calculator in php using post , 2 params - num1 , num2 . when want calculates numbers answer not showing. should do? here code: if ($_post) { $first_number = $_post['first_number']; $second_number = $_post['second_number']; $cal = $_post['cal']; switch ('$cal') { case "addition": $result = $first_number + $second_number; break; case "subtraction": $result = $first_number - $second_number; break; case "multiplication": $result = $first_number * $second_number; break; case "division": $result = $first_number / $second_number; break; case "modulation": $result = $first_number % $second_number; break; } return $result; } echo "$cal <br /> <br /> 1st number: $first_number <br /> 2nd nu

android - Where should i mention copyright permission in store listing? -

i have received permission copyrighted image's owner use image in android application. now should mention permission in store listing while publishing?? i.e how let google know got permission image usage.thanks in advance!!

php - How to use two isset condition in single page -

how use 2 isset() conditions in same page? this how code looks: if (isset($_post["location_from"]) && !empty($_post["location_from"])) { ......... ......... echo json_encode($returnvalues); } if (isset($_post["location_to"]) && !empty($_post["location_to"])) { ......... ......... echo $value; } if (isset($_get["id"]) && !empty($_get["id"])) { ......... ......... echo $value_id; } so in above code when pass value in ajax $_post['location_from'] works perfectly, , when pass value in ajax $_get['id'] works perfectly, when pass value in ajax $_post['location_to'] function inside $_post['location_from '] working , echoing. appreciated. if want write max 1 value (the first condition met), use elseif s instead of if s.

c# - How to get product price, condition using Amazon MWS API -

i using amazon mws api's end point getmypriceforsku returns empty offers if not have offers contains item condition, price etc. instead, want product price, item conditions not have offers. how can product price, condition info without "getmypriceforsku" ? using scrachpad in order test it. you have implement notifications service. take at: https://images-na.ssl-images-amazon.com/images/g/02/mwsportal/doc/en_us/notifications/mwspushnotificationsapireference. v343959826 .pdf they have shutted down price infos apis,because of new api.

Calling ASMX Web Service From C++ MFC Project -

i have web service have functions retrieve data database. ( http://exampledomain.com/webservice/webservice.asmx ) it's easy add web service in c# (project->add service reference->advanced->add web reference) don't have knowledge c++. there no option in project tab adding reference. how can add web service c++ project , access it's functions , retrieve data? standard c++ or mfc no provide way consume web services. however, possible c++ rest sdk . it's cross-platform library allows consume services, use json, asynchronous streams , other things.

java - Smack 4.1 Re-connection issue -

Image
i developing chat application in which i have background service continuously running. the application running smoothly , able receive , send messages without issue. i using default smack 4.1 re-connection manager, connecting connection lost (almost 90% of time). but sometimes, when connection lost, smack re-connection manager stops working. i have not been able find out causing issue. when check phone, after delay of 12 14 hours, can see android service still running, xmpp re-connection has stopped working. must force-stop application in order restart service , have connect xmpp server again. my assumption is happening when "phone network switches wifi-to-data or data-to-wifi" . in meantime, smack 4.1 re-connection manager stops working. although, not sure it. and have questions what use of pingmanager? can pingmanager helpful in case? what streammanagement? how can enable it? helpful in case? any other solutions conquer problem? thinking of foll

ios - how to store data locally in iPhone -

i have many form in application want store data locally when net not available. , if net available send server. please let me know how implement this. thanks you can use core data, sqlite fmdb, plist serialisation of plain , simple nscoding .

ruby on rails - Password being removed from parameters in my controller despite being allowed -

in kidscontroller have def kid_params params.require(:kid).permit(:firstname, :lastname, :gender, :pseudo, :birthdate, :avatar, :password, :longitude, :latitude, :parent_id) end while kid defined follow: class kid < activerecord::base has_secure_password end however when try post json create new kid, password cannot blank error. the log shows: started post "/kids" 127.0.0.1 @ 2015-05-12 14:28:34 +0900 processing kidscontroller#create html parameters: {"firstname"=>"testpaw", "lastname"=>"qwdqwd", "password"=>"[filtered]", "kid"=>{"firstname"=>"testpaw", "lastname&quo

node.js - Unable to insert into subdocument -

i have following schema var childschema = new schema({ name: string, value: string }); var parentschema = new schema({ children: [childschema] }); now, wish insert entries parent.children. i did following: parentrecord.children.push({ name:"foo", value: "bar" }); when use console.log, can see here record has been added parent record's children property. has been give id. now, attempt save record: parentrecord.save(mycallback); while save success, see entry not added children property. i tried use parentrecord.markmodified("children"); not help i have ensured declare childschema before declare parentschema . i @ wits end trying figure out what's wrong. have set debug property of mongoose true. can see it's identifying new entry can't see getting saved in database. following output debug messages: mongoose: parentrecord.update({ _id: objectid("5551895182d9adbe1da34d6a") }) {