Posts

Showing posts from April, 2012

java - Is it good to declare a local variable in the middle level of your code? -

while reading book "clean code" came across following instruction: "local variables should declared above first usage , should have small vertical scope. don’t want local variables declared hundreds of lines distant usages." see following example: public class { public static void main(string[] args) { string name = "robert"; string country = "iiiii"; int age = 21; string hobby = "soccer"; system.out.println("my name "+name+"i'm "+age+" , i'm "+country); /* * * lot of code here * * */ system.out.println("my hobby is: " + hobby); } } here variable hobby throw stone usage , want make sure if clean write code bellow?, because see local variables declared in top level of function : /*the previous code here*/ string hobby = "soccer"; sys

c# - routing and integration testing webapi via selfhosting -

i using code: [fact] public void valuecontroller_withgetmethos_shouldreturnvaliddata_nobaseclass() { var configuration = new httpselfhostconfiguration("http://localhost:64466"); configuration.includeerrordetailpolicy = includeerrordetailpolicy.always; configuration.services.replace(typeof(iassembliesresolver), new webapiclassbase.testassemblyresolver(typeof(valuescontroller))); configuration.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional } ); var server = new httpselfhostserver(configuration); try { server.openasync().wait(); var request = new httprequestmessage { requesturi = new uri("http://localhost:64466/api/values"), method = httpmethod.get }; var client = new httpclient(server); using (httpresponsemessage response = client.sendasync(re

javascript - How to receive a ajax callback in ajax post -

i using ajax codeigniter application. i've manged make "ajax checkbox", when click on checkbox, in background specific function called. how make callback, mean know if operation done ok, or maybe problem/error . my html: <input type="checkbox" onclick="change_parameter(<?=$dane_leada['lead_id']?>, 'my_parameter');" > js: function change_parameter(lead_id, parametr) { $.ajax({ type : "post", url : '<?=base_url();?>leads/change_parametr/' + lead_id, data : "lead_id=" + lead_id, data : "parameter=" + parameter, }); alert("status changed"); //here should message "ok" or "error" } php in controller: public function change_parameter($lead_id, $parametr=false) { if ($lead_id != "" , isset($_post['parameter'])) { $parameter = $_post[&

meteor - Collection is not defined (but rest is OK) -

this not duplicate question! in app, have collections directory (in project root) files (every file corresponds 1 collection). tempates (in client/templates/...), of course, use collections. perfect 1 small exception. 1 of collections undefined rest ok. every collection defined in same directory , in same directory level. problem? edit: tryed inserting collections inside lib. not works. tryed deep nesting. not works. edit: tell me, why have 2 downvotes. downvotes nothing questions, question may in future meteor users. so, why downvoting quetion? bug has interesting roots. i'm using fedora 21, , in theese times, chrome has bug causes complete freeze (1-5 hours). bug has many linux distributions. after restarted chrome after freeze, error vanished. so, result chrome has 2 bugs instead of 1 :) edit: no. it's premature conclusion. works while failed again. in chrome , in firefox too. i'm confused.

android - TextView scrollable in ScrollView -

i have scrollview @ top node of activity, several textview inside. want of these (1 out of 2) textview scrollable themselves. doing more 5 lines each want visitor see 5 lines , have scroll watch complete text. do... doesn't work: <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textstyle="italic" android:text = "blabla"/> <textview androi

javascript - Mocha async tests, calling done() issue -

i'm developing postcss plugin , want test mocha. here test: function exec(cb) { postcss() .use(regexp) .process(source) .then(cb); } it('should add warnings messages', function(done) { var expected = 'somemessage'; var message = ''; function getmessage(result) { message = result.messages; assert.equal(message, expected); done(); } exec(getmessage); }); but fails , error: timeout of 2000ms exceeded. ensure done() callback being called in test . what doing wrong? your callback not getting called within default timeout of 2000 ms. if sure there nothing wrong in exec plugin , expected take more 2s , can increase time using in mocha testing while calling asynchronous function how avoid timeout error: timeout of 2000ms exceeded.

database - How to share a variable in concurrent JSF queries? -

i have jsf 1.2 / richfaces 3.3 / oracle 10g based application. have <h:inputtext> search query @ database on pressing return key. if multiple queries submitted 1 after another, program fires multiple queries database (which returns list of results). program requires show result of submitted query. this sample code fired every time enter pressed <h:inputtext> . public void searchuser() { resultlist = null; // getters , setters defined resultlist, resultlist directly accessed in .jsp pages. resultlist = getuserserviceinterface().getfilteredusers(searchstring); //results in jpa query database. } suppose, if query1 submitted @ t second, , answer arrives @ t+10 seconds. meanwhile, query2 submitted @ t+2 seconds, , answer arrives @ t+7 seconds. the .jsp page using resultlist shows result of query2 @ t+7 seconds, , switches result of query1 @ t+10 seconds. want avoid showing result of query1 here. the approach using ignoring result of non-recent queries

c# - Can Roslyn be used to generate dynamic method similar to DynamicMethod IL generation -

i have been using dynamimethod generate il using method.getilgenerator(); this works of course hard use since don't want work low level il in high level language c#. since there roslyn though can use instead. have tried figure out how use roslyn similar thing: generate dynamic method , create delegate it. way able have full class this syntaxtree syntaxtree = csharpsyntaxtree.parsetext(@" using system; namespace roslyncompilesample { public class writer { public void write(string message) { console.writeline(message); } } }"); then instead of write method can insert method inside using string concatenation. after dynamic assembly generated in memory , loaded , reflection used required method , generate delegate. this method seems work fine seems bit of overkill case need use multiple independent methods possible leading lots of assemblies being loaded. so question is: there easy way similar dynamic method ros

variables - Using parameter in constructors C# -

i'm abit new in c#. have code this: namespace example { public partial class example_setting : form { public example_setting(string somethings) { } private myplace() { messagebox.show(somethings); } } i don't know how value of somethings variable in myplace() .how can do? an example be: namespace example { public partial class example_setting : form { string somethings; // <-- declare variable in class public example_setting(string somethings) { this.somethings = somethings; // save param variable } private myplace() { messagebox.show(somethings); // data here use } }

c# - Unable to search a text in generated PDF from word -

we generating pdf word document, using "microsoft.office.interop.word.application" our code. problem when open generated pdf , search text , saying not found though text there. thinking content inside pdf coming image instead of text, other things displaying tables, images coming good. there way make pdf searchable? i attaching code here. please let me know thoughts. appreciated. thanks sri code: using system; using system.collections.generic; using system.collections; using system.diagnostics; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using word = microsoft.office.interop.word; using system.io; using microsoft.office.interop.word; namespace doctopdfconverter { public class doctopdfconverter { static int main(string[] args) { string inputfilename = args[0]; string outputfilename = args[1]; console.writeline("started converting word

c# - Strange behaviour: Added object to ObservableCollection -

i'm having strange behavior when adding object observablecollection , looking it. after adding found , same code isn't anymore? public class testclass { public testclass(string s) { str = s; } public string str { get; set; } } private observablecollection<testclass> testcollection = new observablecollection<testclass>(); private list<string> newvaluelist = new list<string> { "one", "two", "three" }; private void test() { var tmplist = newvaluelist.select(p => new testclass(p)); foreach (var v in tmplist) { testcollection.add(v); if (testcollection.contains(v)) console.writeline("yes"); else console.writeline("no"); } foreach (var v in tmplist) { if (testcollection.contains(v)) console.writeline("in"); else console.writeline("o

How to implement form area box in meteors JS? -

i new meteorjs. 1 please provide info form area text tag.i tried add text area , tried implement using event. i got answer refer few docs.. below correct one html: js: template.body.events({ "submit .new-task": function (event) { // prevent default browser form submit event.preventdefault(); var message=event.target.newmessage.value;

javascript - google map marker is not working -

problem i need implement more 1 marker in google map. marker not visible in google map. html code <span class="latitude" data-val={{value.latitude}} value={{value.latitude}} data-long={{value.longitude}} data-name="{{value.name}}"></span> js code var zindex = 0; var locations = []; $.each($('.latitude'), function(index, value) { //console.log($(this).data('val')); var lat = $(this).data('val'); var longs = $(this).data('long'); locations.push($(this).data('name')); locations.push($(this).data('val')); locations.push($(this).data('long')); locations.push(zindex); console.log(locations); // console.log("---------"); // console.log(longs); // console.log(zindex); var map = new google.maps.map(document.getelementbyid('map'), { zoom: 10, center: new google.maps.latlng(lat, longs),

Repeat a phrase in Latex throughout document -

Image
i set reference phrase in beginning of latex document, such can reference later in document , insert phrase. purpose create cover letter template personalized each company. later can change reference phrase , latex rest, changing name of company throughout document. such as, \documentclass[]{letter} \include{*company reference package*} \ref{company xyz}{manufacturing , distribution company of americas, inc.} \begin{document} dear \ref{company xyz}, have heard great work @ \ref{company xyz}. member of \ref{company xyz} \end{document} you can use \newcommand , so: \documentclass[]{letter} \newcommand{\companyxyz}{manufacturing , distribution company of americas, inc.} \begin{document} dear \companyxyz, have heard great work @ \companyxyz. member of \companyxyz \end{document}

spring - FileSystemPersistentAcceptOnceFileListFilter is incompatible with CompositeFileListFilter -

i watching several remote folders using int-sftp:inbound-channel-adapter having trouble local-filters. <int-sftp:inbound-channel-adapter id="inboundchannelpmse" session-factory="sftpsessionfactory" channel="chan" remote-directory="${rdir1}" filter="remoteunseenfilter" preserve-timestamp="true" local-directory="${ldir1}" auto-create-local-directory="true" temporary-file-suffix=".writing" local-filter="localonlyxmlfilter" delete-remote-files="false" local-filename-generator-expression="#this.tolowercase()" > <int:poller fixed-rate="10000" max-messages-per-poll="-1" /> </int-sftp:inbound-channel-adapter> <int-sftp:inbound-channel-adapter id="inboundchannelofcomdefault&

osx - swift subclass init tangle -

i have base class 2 init methods - 1 designated list of parameters, other convenience init obtains parameter values nsdictionary (which used serialise objects). until attempt create subclass - convenience init produces error if attempt call matching super.init(...) , demands call designated init of subclass. superclass contains keys used extract parameter values , don't want duplicate code or have public key values. i set dummy values , use separate loadfromdict() method (which can overridden) seems awkward. there way? the error seeing normal, if follows rules initialization in swift. convenience init must call init in same class. other init convenience, or designated. @ point though designated init needs called in subclass before calls super class. swift enforces designated init can call super class init. swift language reference to simplify relationships between designated , convenience initializers, swift applies following 3 rules delegation calls between

java - weblogic deployment InternalException : Transaction marked rollback or not expected transaction -

i have ear application, , when try deploy weblogic server, following error: <[standby] executethread: '6' queue: 'weblogic.kernel.default (self-tuning)'> <<wls kernel>> <> <> <1439994186702> <bea-149078> <stack trace message 149004 weblogic.application.moduleexception: weblogic.ejb.container.internalexception: transaction marked rollback or not expected transaction status: 1 @ weblogic.application.internal.extensiblemodulewrapper.start(extensiblemodulewrapper.java:140) @ weblogic.application.internal.flow.modulelistenerinvoker.start(modulelistenerinvoker.java:124) @ weblogic.application.internal.flow.modulestatedriver$3.next(modulestatedriver.java:216) @ weblogic.application.internal.flow.modulestatedriver$3.next(modulestatedriver.java:211) @ weblogic.application.utils.statemachinedriver.nextstate(statemachinedriver.java:42) @ weblogic.application.internal.flow.modulestatedriver.start(modulestate

programmatically open a bootstrap select -

i need programmatically open bootstrap select , not show documentation says (it affects displaying) it seems missing method, how can done? i tried documentation , wasn't working me either, did research , apparently opening select list not easy thing programatically javascript. check out post , post . what recommend use bootstrap .btn-dropdown instead of select list if possible?

entity framework - Mapping Data Model to Domain Model -

i using automapper map data model domain model, causing performance issue. in repository lazy loading employee record. inside repository when employee correct, when return employee.todomain() automapper causes of properties employee loaded, resulting in multiple queries being sent database causing page take several minutes load. there way prevent happening or should not use automapper in data access layer map domain model? repository: public employee getemployee(int employeeid) { efmodels.employee employee = context.employees .singleordefault(e => e.employeeid == employeeid); return employee != null ? employee.todomain() : null; } employee: public class employee : basemodel { ... public domain.models.employee todomain() { return mapper.map<domain.models.employee>(this); } } update maps: mapper.createmap<efdataaccess.efmodels.employee, employee>() .formember(dto => dto.division, con

ios - Ionic and ngCordova FileOpener2 Plugin issue -

Image
i building app ionic framework. , need ability open pdf. using ngcordova plugin fileopener2 task. i no error , success message prompted shows. this controller : module.controller('newsctrl', function ($cordovafileopener2) { $cordovafileopener2.open( '../img/newsletter.pdf', 'application/pdf' ).then(function() { console.log('success'); }, function(err) { console.log('error' + err ); }); }); i running in emulator command ionic emulate ios --livereload --target="iphone-4s" i have tested in actual device similar results. i did stumble upon error when changing of files , livereload server refreshing app on tab controller , got error : error: undefined not object (evaluating 'cordova.plugins.fileopener2') no need complicated plugin! in our company app need able open pdf/s well. use https://github.com/sayanee/angularjs-pdf . works wonderfuly. her

How can I replace the contents of a link with CSS? -

is there way replace link's content using css only? not want hide link, replace text in it, e.g. changing <a href="">text</a> <a href="">bla bla</a> . i know of after , before, still need link, can't hide <a> tag. you can use font-size:0 reset on pseudo-element. a { font-size:0; } a:before { content:"new text"; font-size:1rem; } <a href="">text</a> note broswer (perhaps older chrome) won't let reduce font-size below values [4px?] (iirc)

angularjs - How to get prevent multiple promises from different functions -

in angular-app , have 3 queries, each depends on others. putting promise() each of them. in case how can $q.all depended promise once done? can clarify me, please? here code : "use strict"; angular.module("tcpapp") .controller("projectsummarycontroller", ['$scope', '$routeparams', '$location', 'server', 'modalservice', '$q', function ( $scope, $routeparams, $location, server, modalservice, $q ) { $scope.projectid = $routeparams.projectid; $scope.subprojectid = $routeparams.subprojectid; $scope.phaseid = 0; $scope.disciplineid = 0; $scope.contractorid = 0; $scope.queryconractorinfo = function ( contractorid ) { server.contractorinfo.get({ projectid:$scope.projectid, subprojectid : $scope.subprojectid, contractid : $scope.contractorid, disciplineid : $scope.di

java - Trailing slash is not inserted in Spring Boot application -

tomcat in spring boot not inserting trailing slash after context name @ url. it should done automatically server case not specified. example: /user changed /user/ server anyone have idea how enable it? thanks it not supposed insert trailing slash. it in case of contextroot (which in spring boot application usally /, going http://your.server.here:8080 redirect http://your.server.here:8080/ ) what use case redirects? in case want functionality, should quite trivial add filter redirects you. check out answers on question how spring mvc: urls trailing slash redirection

python 2.7 - How to check if class is initialized using the with statement? -

i'm using class example answer make sure files cleaned up: https://stackoverflow.com/a/865272/651779 what when call pacakge_object = packageresource() instead of with packageresource() package_obj: # stuff it gives error explaining class can used with statement. there way of knowing if class initialized with packageresource() package_obj: instead of pacakge_object = packageresource() ? set flag in __enter__ function, , if properties / methods of class called without flag set, cheating on you.

ios - Xamarin Forms IPA generation on Jenkins -

i'm having trouble generate ipa xamarin forms ios project on jenkins. follow documentation ( http://developer.xamarin.com/guides/cross-platform/ci/jenkins_walkthrough/ ) , post question on xamarin forums problem, it's difficult have answer there i'll try here. i'm able build application mdtool there isn't ipa file in project after end of jenkins' job. i see discussion on forum tell use archive method instead of build mdtool. didn't change either. i try use xcrun create ipa file after application build, have kind of error : error: unable copy application 'ios/bin/iphone/release/application.ios.app/' '/var/folders/v2/gnnclzrd2g98zqc89qn204km00007h/t/vxebxe7wnv/payload' there's not lot of explanation on how ipa generated on documentation i'd have clarification on that. is manage create ipa in jenkins ios xamarin forms project ? if how do ? give more information jenkins' job use, ... if necessary. regards

hadoop - Nested json to Hive table -

my json file looks like: {values:[{"utagid":"system_chiller1","tagname":"p1","tagvalue":"10","tagtime":"2015-07-23t14:29:30.731z","tagquality":"128"}' ...........}]}; i wrote json schema as: create table t1(values array<<struct<utagid:string, tagname:string, tagvalue:string, tagtime:string, tagquality:string>>) row format serde "org.apache.hadoop.hive.contrib.serde2.jsonserde" stored textfile; load data local inpath"/tmp/jsonstreaming.json"into table t1; but i'm still getting error parseexception missing < near struct keyword. reason? i think have < try create table t1(values array<struct<utagid:string, tagname:string, tagvalue:string, tagtime:string, tagquality:string>>)

sorting - Sort Item in ListView by Attribute Windows phone 8.1 RT -

i want sort item in listview attribute. it's not working. try lview.orderby(p=>p.attribute); list<object> lvnew = lview.itemssource list<object>; lvnew.sort(story.cmp_new); public static int cmp_new(story a, story b) { return (int16.parse(a.storyid) > int16.parse(b.storyid)) ? 0 : 1; } help me friend i know i'm late if can : sort list of objects have extends object's class icomparable add method in class : public int compareto(object obj) { var second = obj yourclass; return yourattribute.compareto(second.yourattribute); } last, have call sort method on yout list : list<yourclass> mylist = ... mylist.sort();

wix msi install: registry is removed on upgrade if removeexistingproducts is scheduled after installFinalize -

hi trying incremental upgrade ( modified files updated) meaning scheduling removeexistingproducts after installfinalize goes fine till end when registry keys gone. clueless might cause registry wiped out? if removeexistingproducts scheduled before installinitialize registry keys there. thank time, regards konstantin this can happen if there violation of windows installer component rules. might happening that, registry keys being created in same place have different component guids in both of base upgraded installer. in such case, components not reference counted correctly , hence, registry keys removed when older product uninstalled part of major upgrade using removeexisintproducts. do components create registry entries have different component guid's between both versions of installers (i.e base version upgraded version). if so, have make sure have same component guid's associated them. open both of msi packages using orca , observe component guid'

Meteor + Ionic + Meteoric : Is Ionic's Floating Labels for Text Input supported in meteoric package? -

i trying use floating labels meteoric package - https://atmospherejs.com/meteoric/ionic available @ http://ionicframework.com/docs/components/#forms-floating-labels . however, once click inside textbox, floating labels not appear. somehow, opacity of span tag class input-label not change opacity 0 1 i have created meteorpad @ http://meteorpad.com/pad/bn38rssh3cldjbaay/ionic%20floating%20label however, think meteorpad still not support scss , hence, app not working expected on meteorpad server. perhaps, can download , run locally. please rename style.css style.scss. p.s.: issue has been added @ meteoric github page - https://github.com/meteoric/meteor-ionic/issues/283 the meteoric package support css, 'floating labels' feature require little javascript add , remove class name. add following page floating labels: $('.item-floating-label>input').on('keyup', function(){ $(this).val() ? $(this).prev().addclass('has-input')

java - CPLEX minimize piecewise linar functions -

i'm setting java program using cplex. want find minimum of cost function lots of terms. now turns out of these cost terms should not linear piecewise linear. know cplex can - how? can hardly find information or tutorials on that. does have experience , can recommend/show me tutorials or code snippets? this super helpful... in advance! philipp here code: ilolinearnumexpr tominimize = cplex.linearnumexpr(); for(float hour = start; hour <= end; hour += stepsize){ ilonumvar purchase = cplex.numvar(0, double.max_value, "purchase_" + hour); purchaseperhour.put(hour, purchase); tominimize.addterm(rate, purchase); ilonumvar esale = cplex.numvar(-double.max_value, 0, "sale_" + hour); saleperhour.put(hour, sale); tominimize.addterm(salerate/4000, esale); /* here should term similar sale/purchase ones above being piecewise linearly dependent variable */ } cplex.addminimize(t

c# - Prevent web.config change on web deployment -

we have web deployment package app developed in c#, when installed in iis web.config has several settings in it, example: <appsettings> <add key="webpages:version" value="3.0.0.0"/> <add key="webpages:enabled" value="false"/> <add key="clientvalidationenabled" value="true"/> <add key="unobtrusivejavascriptenabled" value="true"/> <add key="reportfiles" value="http://localhost/reporttemp/"/> </appsettings> a setting may changed (for example reportfiles above) @ each site deployed , if there update app install latest web deployment package. unfortunately overwrites settings may have changed, default. means every time update application have take copy of web.config, update copy back. is there way of stopping web.config being updated once created? or during web deployment allowing installer see existing settings , decide whether

ios - UINavigationController issue - if i return to first view, i see the color of second view -

i creating uinavigationcontroller , it's uiviewcontrollers this. first yellow color, second blue color. then adding stack. yellow displayed while, second blue. what's problem - if press button in top bar previous controller, don't see yellow background blue, thought title of window "one" correct. why happening? thx uiviewcontroller *one = [[uiviewcontroller alloc] init]; [one.view setbackgroundcolor:[uicolor yellowcolor]]; [one settitle:@"one"]; uiviewcontroller *two = [[uiviewcontroller alloc] init]; [two.view setbackgroundcolor:[uicolor bluecolor]]; [two settitle:@"two"]; uinavigationcontroller * navcontroller = [[uinavigationcontroller alloc] init]; [self.view addsubview:navcontroller.view]; [navcontroller pushviewcontroller:one animated:yes]; [navcontroller pushviewcontroller:two animated:yes]; i figured out what's reason. because navcontroller relased memory.

javascript - jQuery File Upload in Bootstrap Modal -

i having issues jquery file upload integration onto project. in previous post, javascript dropzone dynamic issue , couldn't find solution looking alternatives. want able use in bootstrap modal, couldn't working. if set outside of modal, working fine. simplify code, pretty copy , paste jquery file upload website: https://blueimp.github.io/jquery-file-upload/index.html . can find code below. setting code below inside modal, won't work. outside of modal, it'll work fine. what tried setting z-index of table 9999, didn't good. table not showing thumbnail or anything. suggestions? <div class="container"> <!-- file upload form used target file upload widget --> <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="post" enctype="multipart/form-data"> <!-- redirect browsers javascript disabled origin page --> <noscript><input type="hidde

Set background color in java Graphics object -

good day, know in java graphics object, can user setcolor() method set object color. apply object border. anyway set color whole object? means background of graphics object. void draw(graphics g) { g.setcolor(color); g.drawrect(left, right, width, height); } kindly advise. use fillrect() method . g.fillrect(left, right, width, height); from javadoc drawrect() draws outline of specified rectangle. left , right edges of rectangle @ x , x + width. top , bottom edges @ y , y + height. rectangle drawn using graphics context's current color. fillrect() fills specified rectangle. left , right edges of rectangle @ x , x + width - 1. top , bottom edges @ y , y + height - 1. resulting rectangle covers area width pixels wide height pixels tall. rectangle filled using graphics context's current color. " this apply object border " because drawrect draw outlines only. " is anyway set color whole obje

Regex match and split string in C# -

i have ascii documents in following format: [section heading] paragraphs...... [section heading] paragraphs...... ... note: heading text enclosed in specific pattern (e.g. [ ] in above example) i want split file separate sections (each heading , content ). what efficient way parse above document? using regex.match() can extract headings, not subsequent text content. using regex.split() can grab content, not related headings. is possible combine these 2 regex methods parse document? there better ways achieve same? (\[[^\]]*\])\n([\s\s]*?)(?=\n\[|$) you can try this.grab group 1 , group 2.see demo. https://regex101.com/r/gu4ag0/1

xml - Error while deploying Java based Webservice on Tomcat server 8.0 -

i trying deploy java based web service apache tomcat server 8.0. when try deploy following error : severe: end event threw exception java.lang.reflect.invocationtargetexception @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.apache.tomcat.util.introspectionutils.callmethodn(introspectionutils.java:379) @ org.apache.tomcat.util.descriptor.web.callmethodmultirule.end(webruleset.java:1034) **caused by: java.lang.illegalargumentexception: servlets named [axisservlet] , [cxf] both mapped url-pattern [/services/*] not permitted @ org.apache.tomcat.util.descriptor.web.webxml.addservletmapping(webxml.java:308)** ... 32 more aug 19, 2015 5:42:23 pm org.apache.tomcat.util.descriptor.web.webxmlparser parsewebxml severe: parse error in application web.xml file @ fil

android - How to display multiple Texts and Images in an item of RecyclerView or ListView? -

i'm using recyclerview display list of data server. data contain text , uncertain number of urls of images html tag. each item, i'm using html.fromhtml() imagegetter parse data, images , display them in textview . however, images in textview cannot interact user. events on images click, magnifying , save not supported textview . , tried using webview instead, performance poor. tried write compound view extends linearlayout , , add textviews , imageviews dynamically (the number of images each item not certain), behaved strangely in recyclerview . is there better idea or should improve solutions forementioned? thanks in advance! the solution has been found myself of other programmers on stackoverflow. may see question, please check android - custom dynamically-generated compound view recreated in recyclerview, causing poor performance . idea simple, creating compoundview extending linearlayout adds textview s , imageviews dynamically based on data attached

how to create dynamic key and valuse in javascript array -

input json 0===>{"eid":12,"gender":"1","age":1,"pass":["2","1"]} 1===>{"eid": 11,"gender":"0","age":1,"pass":["1","3"]} 2===>{"eid":20,"gender":"1","age":1,"pass":["2","3"]} how create new array.. push ids based on pass numbers ex: in loop display passid => 2 .... eid => 12, 20 2 ==> ["12","20"] 1 ==> [12, 11] 3 ==> [11,20] use filter , some check contents of pass array , return respective eid values: function grabber(data, pass) { return data.filter(function (el) { return el.pass.some(function (num) { return +num === pass; }) }).map(function (el) { return el.eid; }); } grabber(data, 1); // [12, 11] grabber(data, 2); // [12, 20] grabber(data, 3); // [11, 20