Posts

java - Unable to detect class level custom annotation in Spring AOP -

i trying intercept classes in spring following settings interceptor @aspect @component public class myinterceptor { @around("execution(* com.example.services..*(..))") public object intercept(proceedingjoinpoint pjp) throws throwable { if (pjp.gettarget() != null && pjp.gettarget().getclass().getannotation(myannotation.class) != null) { system.out.println("yes annotation present"); } else { system.out.println("annotation not present"); } return = pjp.proceed(); } } and class being intercepted follows @component @myannotation public class myalert implements ialert { } every thing working fine until , unless make following changes @configuration @propertysource(value = { "file:${catalina.home}/conf/my.properties" }) @component @myannotation public class myalert implements ialert { @autowired private environment environment; } i wanted read ...

How do you make sure email you send programmatically is not automatically marked as spam? -

this tricky 1 , i've relied on techniques, such permission-based emails (i.e. sending people have permission send to) , not using blatantly spamish terminology. of late, of emails send out programmatically have started being shuffled people's spam folder automatically , i'm wondering can it. this despite fact these particular emails not ones humans mark spam, specifically, emails contain license keys people have paid money for, don't think they're going consider them spam i figure big topic in ignorant simpleton. use email authentication methods, such spf , , dkim prove emails , domain name belong together, , prevent spoofing of domain name. spf website includes wizard generate dns information site. check reverse dns make sure ip address of mail server points domain name use sending mail. make sure ip-address you're using not on blacklist make sure reply-to address valid, existing address. use full, real name of addressee in field,...

ios - Setting up of View frame is taking more time -

i have uiviewcontroller view frame setting up. taking .6sec set up. please tell me how should that, takes less time. here code snippet hispanel=[[hisimageviewcontroller alloc] initwithnibname:@"hisimageviewcontroller" bundle:nil]; cgrect frame=_deviceview.bounds; frame.origin.x=1; frame.origin.y=1; frame.size.height-=2; frame.size.width-=2; nsdate *methodstart = [nsdate date]; hispanel.view.frame = frame; nsdate *methodfinish = [nsdate date]; nstimeinterval executiontime = [methodfinish timeintervalsincedate:methodstart]; execution time = 0.6 sec

vps - SSL Certificate error for mailserver -

i have vps shared ip. now, want use ssl/tls mailserver. wondering kind of certificate need mailserver. so, need issue certificate on hostname? because untrusted error in outlook, if change settings. think same issue when log in in control panel of plesk, error message, certificate not trusted, because not sign ca. know plesk issue self signed certificate. again. don't know if have issue certificate on domain, think error, because hostname , domain name not same. can support me? yes, have purchase ssl certificate hostname, client use server hostname in mail client setting ssl connection

pandas - Read rows in text file based on different column headers using Python -

i have text file contains data 2 tables 2 column headers. want read each line , save lines or rows in 2 files each table. want lines after (number amount) columns header in 1 file , (code volume dim) column header in other. or, want separate data similar table. first few lines of file. number of rows in tables may vary. number amount 10 34 23 65 54 07 code volume dim 1 56 34 23 57 565 number amount 40 674 73 2365 code volume dim 341 3456 6534 23 0957 908565 number amount 210 4534 2343 4565 same pattern repeats. if text number same in file, , text code too, can use read_csv , filter columns rows subset contains , isnull , notnull : import pandas pd import numpy np import io temp=u""" number amount 10 34 23 65 54 07 code volume dim 1 56 34 23 57 565 number amount 40 674 73 2365 code volume dim 341 3456 6534 23 0957 908565 nu...

javascript - Difference between Constructor pattern and Prototype pattern -

so i'm trying wrap head around different ways create object. i came accross protoype pattern creating objects. now wrote 2 functions below can't see functional difference between both be? when use constructor pattern , when use prototype pattern? constructor pattern function fruit(){} fruit.color = "yellow", fruit.fruitname = "banana", fruit.nativeto = "somevalue" prototype pattern function fruit(){} fruit.prototype.color = "yellow", fruit.prototype.fruitname = "banana", fruit.prototype.nativeto = "somevalue" reusability of components... constructor when create new constructor create new instance of , importantly change made instances affect them , not others. prototype when create new object using prototype reuse logic , change prototype chain affect else. this nice explanation: javascript prototypes , instance creation when use each pattern based on needs - ambiguous answer never...

ndepend - Tools to Find & Fix C# coding standards -

i using tool called ndepend scan c# solution find coding issues. tool nicely list down coding violations according category. question is, tool give auto suggestion on change should done listed coding issues? cannot find related this. looking @ list of default ndepend rules , you'll see come 2 comment sections: <description> , <howtofix> . <howtofix> section contains suggestions how fix issues. this feature came ndepend v6 released in june 2015, maybe using former version? for example looks like: // <name>base class should not use derivatives</name> warnif count > 0 baseclass in justmycode.types baseclass.isclass && baseclass.nbchildren > 0 // <-- optimization! let derivedclassesused = baseclass.derivedtypes.usedby(baseclass) derivedclassesused.count() > 0 select new { baseclass, derivedclassesused } //<description> // in *object-oriented programming*, **open/closed principle** states: // *software e...