Logging of each working method as default in log4net? The question is actually this; I need info message for every method's start and end. For example I have a code block:      public void MethodName(ObjectName object)         {             try             {              LOG.Info(MethodBase.GetCurrentMethod());                // Some codes in here             }             catch (Exception e)             {                 LOG.Error(e.Message);             }         }   I don't want to write Log.Info for every method. Any suggestion ?
How do I intercept a method call in C#? For a given class I would like to have tracing functionality i.e. I would like to log every method call (method signature and actual parameter values) and every method exit (just the method signature).      How do I accomplish this assuming that:     I don't want to use any 3rd party AOP libraries for C#, I don't want to add duplicate code to all the methods that I want to trace,   I don't want to change the public API of the class - users of the class should be able to call all the methods in exactly the same way.     To make the question more concrete let's assume there are 3 classes:     public class Caller   {      public static void Call()       {          Traced traced = new Traced();          traced.Method1();          traced.Method2();       }  }   public class Traced   {      public void Method1(String name, Int32 value) { }       public void Method2(Object object) { }  }   public class Logger  {      public static void LogStart(MethodInfo method, Object[] parameterValues);       public static void LogEnd(MethodInfo method);  }   How do I invoke Logger.LogStart and Logger.LogEnd for every call to Method1 and Method2 without modifying the Caller.Call method and without adding the calls explicitly to Traced.Method1 and Traced.Method2?  Edit:  What would be the solution if I'm allowed to slightly change the Call method?
I am using postgreSQL, postGIS and pgrouting. Now I am really confused on how am I going to find the shortest path between multiple points.   I know how to find it between two points through dijkstra but I am confused how to accomplish the same result with more than two points.   I have done some research and found this:    But still I did not understand if its the right way and how to install it. What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the options form I provide.  Now, I want to save the path value to a file for later use. This would be one of the many settings saved to this file. This file would sit directly in the application folder.  I understand three options are available:   ConfigurationSettings file (appname.exe.config) Registry Custom XML file   I read that the .NET configuration file is not foreseen for saving values back to it. As for the registry, I would like to get as far away from it as possible.  Does this mean that I should use a custom XML file to save configuration settings?  If so, I would like to see code example of that (C#).  I have seen other discussions on this subject, but it is still not clear to me. What is the value of lim$_{n\to \infty} a_n$ if $\lim_{n \to \infty}\left|a_n+ 3\left(\frac{n-2}{n}\right)^n \right|^{\frac{1}{n}}=\frac{3}{5}$? Let $\{a_n\}$ be a sequence of real numbers such that $$\lim_{n \to \infty}\left|a_n+ 3\left(\frac{n-2}{n}\right)^n \right|^{\frac{1}{n}}=\frac{3}{5}.$$  What is the value of $\lim_{n\to \infty} a_n$? How to set up passwordless SSH access for root user I need to configure a machine so software installation can be automated remotely via SSH. Following , I was able to setup SSH keys so my user can access the machine without a password, but I still need to manually enter my password when I use sudo, which obviously an automated process shouldn't have to do.  Although my /etc/ssh/sshd_config has PermitRootLogin yes, I can't seem to be able to log in as root, presumably because it's not a "real" account with a separate password.  How do I configure SSH keys, so a process can remotely log in as root on Ubuntu? Determining if an Object is of primitive type I have an Object[] array, and I am trying to find the ones that are primitives. I've tried to use Class.isPrimitive(), but it seems I'm doing something wrong:  int i = 3; Object o = i;  System.out.println(o.getClass().getName() + ", " +                    o.getClass().isPrimitive());   prints java.lang.Integer, false.  Is there a right way or some alternative? Using proof by contradiction vs proof of the contrapositive How do I set a default host for nginx? I'm trying to figure out how to set a default host for my nginx installation. I found this article in the nginx Wiki:    Unfortunately, this doesn’t work. After restarting I get this:  Restarting nginx: nginx: [emerg] unknown directive "http" in /etc/nginx/sites-enabled/catchall:1 nginx: configuration file /etc/nginx/nginx.conf test failed   After removing the http directive I get this:  Restarting nginx: nginx: [emerg] unknown log format "main" in /etc/nginx/sites-enabled/catchall:7 nginx: configuration file /etc/nginx/nginx.conf test failed   I’m on Ubuntu 10.04.3 where I’m using the official nginx PPA. Version 1.0.9 of nginx is running. How many elements of order $k$ are in $S_n$? Practically speaking, how do people handle ANOVA when the data doesn't quite meet assumptions? This isn't a strictly stats question--I can read all the textbooks about ANOVA assumptions--I'm trying to figure out how actual working analysts handle data that doesn't quite meet the assumptions. I've gone through a lot of questions on this site looking for answers and I keep finding posts about when not to use ANOVA (in an abstract, idealized mathematical context) or how to do some of the things I describe below in R. I'm really trying to figure out what decisions people actually make and why.   I'm running analysis on grouped data from trees (actual trees, not statistical trees) in four groups. I've got data for about 35 attributes for each tree and I'm going through each attribute to determine if the groups differ significantly on that attribute. However, in a couple of cases, the ANOVA assumptions are slightly violated because the variances aren't equal (according to a Levene's test, using alpha=.05).   As I see it, my options are to: 1. Power transform the data and see if it changes the Levene p-val. 2. Use a non-parametric test like a Wilcoxon (if so, which one?). 3. Do some kind of correction to the ANOVA result, like a Bonferroni (I'm not actually sure if something like this exists?). I've tried the first two options and gotten slightly different results--in some cases one approach is significant and the other is not. I'm afraid of falling into the p-value fishing trap, and I'm looking for advice that will help me justify which approach to use.  I've also read some things that suggest that heteroscedasticity isn't really that big of a problem for ANOVA unless the means and variances are correlated (i.e. they both increase together), so perhaps I can just ignore the Levene's result unless I see a pattern like that? If so, is there a test for this?  Finally, I should add that I'm doing this analysis for publication in a peer-reviewed journal, so whatever approach I settle on has to pass muster with reviewers. So, if anyone can provide links to similar, published examples that would be fantastic. Why do people sometimes use the past perfect form of a verb when the past would suffice? (e.g. "you had mentioned") Rotate whole animation by 90 degrees I make my animation and now I realized that its pointed in wrong direction I used -y (native blender) as direction but I need to be pointed at x axis so what would be the easiest way to rotate whole animation, to switch -y with x :) solving third-order nonlinear ordinary differential equation Is there a rule of thumb for objective questions asked out of curiosity? Ward model implementation: specular component too weak I'm trying to implement the Ward shading model, the anisotropic, computationally efficient version:       This is how I made it:    float alphaX=0.5, alphaY=0.5; // asinotropic roughness float minFloat= 1.e-6;   vec4 Ward(vec3 L, vec3 N, vec3 V) {     vec3 H= normalize(L+V);     float NdotL= max(dot(N,L),0.0);     float NdotV= max(dot(N,V),0.0);      vec3 e= vec3(1.0,0.0,0.0);     vec3 T= normalize(cross(N,e));     vec3 B= normalize(cross(N,T));     float HdotT= max(dot(H,T),0.0);     float HdotB= max(dot(H,B),0.0);     float HdotN= max(dot(H,N),0.0);      float beta= -2.0 * ( pow(HdotN/alphaX, 2.0) + pow(HdotB/alphaY,2.0) ) / (1.0 + HdotN);     float den= max(minFloat, 4.0 * pi * alphaX * alphaY * sqrt(NdotL * NdotV) );     vec4 specular= Ps * 1.0/den * exp(beta);     return (Pd + specular) * NdotL; }   But I get a result similar to a lambertian surface or Oren-Nayar model, where the specular component is absent: Difference between $\Delta$, $d$ and $\delta$ I have read the thread regarding , but it does not answer my question.  I am confused about the notation for change in Physics. In Mathematics, $\delta$ and $\Delta$ essentially refer to the same thing, i.e., change. This means that $\Delta x = x_1 - x_2 = \delta x$. The difference between $\delta$ and $d$ is also clear and distinct in differential calculus. We know that $\frac{dy}{dx}$ is always an operator and not a fraction, whereas $\frac{\delta y}{\delta x}$ is an infinitesimal change.   In Physics, however, the distinction is not as clear. Can anyone offer a clearer picture? Langage to declare a circuit board When the phrase is used as an object, why so many native speakers are saying "you and I" instead of "you and me"? I'm not a native speaker but I thought "you and me" is correct. Not sure if this falls into the same category, but "Just between you and me" sounds more natural than "Just between you and I". Exterior power "commutes" with direct sum I know that for vector spaces $V, W$ over a field $K$, we have the following identity :  $$ \bigoplus_{k=0}^n \left[ \Lambda^k(V) \otimes_K \Lambda^{n-k}(W) \right] \simeq \Lambda^n(V \oplus W) $$ which holds in a canonical way : for $0 \le k \le n$, the maps  $$ \Lambda^k(V) \times \Lambda^{n-k}(W) \to \Lambda^n(V \oplus W), \\ (v_1 \wedge\cdots \wedge v_k,w_{k+1} \wedge \cdots \wedge w_n) \mapsto (v_1 \wedge \cdots \wedge v_k) \wedge (w_{k+1} \wedge \cdots \wedge w_n) $$ factors through the tensor product's universal properties, which gives us a map $\varphi_k : \Lambda^k(V) \otimes_K \Lambda^{n-k}(W) \to \Lambda^n(V \oplus W)$, and since the category of $K$-modules has biproducts, we get a canonical map  $$ \varphi = \bigoplus_{k=0}^n \varphi_k : \bigoplus_{k=0}^n \left[ \Lambda^k(V) \otimes_K \Lambda^{n-k}(W) \right] \longrightarrow \Lambda^n(V \oplus W) $$  What if I replace $K$ by a (commutative ring with $1$) ring $A$? Does this map have a kernel? I know it is surjective (it suffices to "look at it", i.e generators of the codomain are obviously all hit by $\varphi$). I don't know if it helps, but I am working in integral domains. In the field case, this is obvious if $V$ and $W$ are finitely generated, since one can use dimension arguments. I wouldn't mind if the above identity held only in the finitely generated case either. If it worked in general it would be cool though.   Note that when trying to compute the inverse map with the universal property, there seems to be a problem... my guess would have been $$ (v_1 + w_1,\cdots,v_n + w_n) \mapsto \bigoplus_{k=0}^n (v_1 \wedge \cdots \wedge v_k) \otimes (w_{k+1} \wedge \cdots \wedge w_n) $$ and this map is obviously $A$-multilinear, but there is a problem with the alternating property ; I get some terms left. I'm guessing this is the wrong map... if there is one. How would I use Takeown to take ownership of all folders on one drive? I have a hard drive which I need to recover specific files from but all the folders in the K:\ drive are denying me access even though I took owner ship of the full drive I.E      C:\Windows\System32>takeown /F K:\   This granted me access to the drive and see the folders but I can not access any of the folders after that.   Is there a way in which I can use Takeown to apply ownership to every directory on the drive> Sometimes you spend a day or more solving a technical problem, and when you finally solve it, you may want to post it on your blog (if you have one) to share with the community.  However, most developers don't have a lot of time to update their blogs, and that is why personal blogs are not ranked very highly on Google/Bing.  So even if you describe a brilliant idea, chances are that, except a few of your friends, nobody will ever find it. This is a common reason why some developers start their blogs and soon give up; it is not interesting to write for the community if you have no feedback on your posts.  Unlike personal blogs, Stack Exchange sites are highly ranked in Google (I was amazed when I saw that a question asked on SO just an hour ago appeared 3rd in my Google search!), so if your question and answer are valuable for others, they will be rated highly and will be visible for other developers.  With this in mind, is it good practice to post a question and answer it yourself immediately when you want to share an idea with the community?