I have created a class library MultipleConfigFiles, which has a method getConfigData. This method reads data from config files.      public class Class1     {       public string getConfigData()       {         string configData = ConfigurationManager.AppSettings["key"].ToString();         return configData;       }     }   Now I have a console application ConsoleAppConfig, in which I have given the reference of the class library.In the main method, I have created a object for the library class and called the method.  static void Main(string[] args)         {             Class1 c = new Class1();             string data = c.getConfigData();             Console.Write(data);             }   This console application has 2 different config files dev.config and prod.config. In the main App.config file , I have used configSource to map the appropriate config file.  &lt;appSettings configSource="dev.config" /&gt;   Dev.config file looks like this:  &lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;appSettings&gt;     &lt;add key="key" value="dev" /&gt; &lt;/appSettings&gt;   Till here it is working fine.That is, when I run the console app, the method returns dev.  Now,I have created a MSTest project for this class library.  public class Class1Tests     {         [TestMethod()]         public void getConfigDataTest()         {             Class1 obj = new Class1();             var result = obj.getConfigData();                         }     }   Now the problem is, when I run this test, it throws an error saying "An exception of type 'System.NullReferenceException' occurred in MultipleConfigFiles.dll but was not handled in user code. Additional information: Object reference not set to an instance of an object."  Since the config files are in ConsoleApplication , the method is not able to read the appsetting variables from there. Is there any way I can maintain the configuration files globally so that both of them use individually , or is there any better way to handle this.    Any inputs are appreciated.Thanks.
I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties.  The unit test application itself does not have an app.config file.    When I try to unit test a method that utilizes any of the configuration properties, they return null.  I'm assuming this is because the unit test application is not going to load in the target application's app.config.  Is there a way to override this or do I have to write a script to copy the contents of the target app.config to a local app.config?     post kind-of asks this question but the author is really looking at it from a different angle than I am.  EDIT: I should mention that I'm using VS08 Team System for my unit tests.
Dropout: scaling the activation versus inverting the dropout When applying dropout in artificial neural networks, one needs to compensate for the fact that at training time a portion of the neurons were deactivated. To do so, there exist two common strategies:   scaling the activation at test time inverting the dropout during the training phase   The two strategies are summarized in the  below, taken from .  Which strategy is preferable, and why?    Scaling the activation at test time:    Inverting the dropout during the training phase: After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".  How would you explain the following points to college students taking their first course in statistics:   What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value? What is the relationship between a p-value and a t-value? Why only light nuclei are able to undergo nuclear fusion not heavy nuclei? Is it because of the binding energy or the binding energy per nuclei .  I am having trouble with this whole binding energy and nuclear fusion concept. Can't reach wi-fi signal on Ubuntu, but can do it on other OS/devices (ath9k) I have two laptops, both running Ubuntu 13.10, as well as a different OS (Windows 7), dual boot on both.  My wi-fi router is on my bedroom and I want to get the wi-fi signal from the living room. I can reach the wi-fi signal from both pcs when running windows, with a relative good signal, but can't reach it on both of them when running Ubuntu, can't even connect to it.  Is there something that I can do to amplify the wi-fi signal? Is there a Stack Exchange site for both technical and behavioural interview questions? Where I could ask questions about, for example:   Sample questions and solutions, experiences, or seeking advice for interviews A place where I could ask interview questions and what the best way to answer it (not just a correct way or the most efficient).   What to do in a certain situation such as negotiation, unfair interviews, etc.   Experiences interviewing at so-and-so company. Machine learning cookbook / reference card / cheatsheet? I find resources like the  and  incredibly useful. They obviously serve well as references but also help me to organize my thoughts on a subject and get the lay of the land.   Q: Does anything like these resources exist for machine learning methods?  I'm imagining a reference card which for each ML method would include:   General properties When the method works well When the method does poorly From which or to which other methods the method generalizes. Has it been mostly superseded? Seminal papers on the method Open problems associated with the method Computational intensity   All these things can be found with some minimal digging through textbooks I'm sure. It would just be really convenient to have them on a few pages. My laptop has a function key which turns F keys into keys which change volume or brightness. I would like to swap a number of them so that they perform that function under normal operation and are an Fx key while the function key is being held.  I assumed that the function keys were just normal keys codes with the set of keys being large enough to include all the possible speical keys. I tried to so as this tutorial suggests () and use xev to obtain the key codes and then would use xmodmap to swap their value.  This does not seem to work though. The F12 key gives the xev output:  KeyPress event, serial 41, synthetic NO, window 0x4a00001,     root 0xb1, subw 0x0, time 468005, (23,-15), root:(89,37),     state 0x10, keycode 96 (keysym 0xffc9, F12), same_screen YES,     XLookupString gives 0 bytes:      XmbLookupString gives 0 bytes:      XFilterEvent returns: False   Which I think is to be expected. However, the Increase Volume button give this response:  KeymapNotify event, serial 41, synthetic NO, window 0x0,     keys:  65  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0               0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0    And so does the Decrease Volume key. How can I perform the swapping of the keys that I would like?  Thank you enclosing a lstlisting environment inside my own environment using matlab-prettifier The Royal Order of Adverbs I know that the pattern manner-place-time shouldn't be taken too seriously if one wants to speak natural English.   In real life, people rarely use a string of adverbs. Speakers will easily break the pattern for emphatic or stylistic reasons (usually placing the adverb at the beginning of the sentence). Other factors such as length and specificity will also override the arrangement.  But I'm constructing illustrative sentences that highlight (and stick to) the Royal Order of Adverbs.   What all the online sources are doing is mixing adverbs and prepositional phrases, but I can't have the concept of prepositional phrases in my examples just yet. This means I should include only one-word or two-word adverbs (without prepositions).   So, I have these:    He sat quietly upstairs all day. She waited impatiently outside this morning. They gather noisily downtown every Saturday night.   Are the sentences above still correct, as in natural-sounding? Somehow they started sounding a bit off to me. I guess I just need to test them with a second pair of ears. How can gravitions exist without violating GR? What is a tainted kernel in Linux? Prove $\int_0^{\infty}\! \frac{\mathbb{d}x}{1+x^n}=\frac{\pi}{n \sin\frac{\pi}{n}}$ using real analysis techniques only What is the name of the black&white movie about a mirror Earth (universe)? Astronauts in a spaceship have an accident and fall back to the Earth. They are tried in court. It turns out to be a mirror Earth. As I remember (though maybe I'm not totally right) only one professor knows something about that and in the final scene he crashes into a mirror with his wheelchair. In another scene an astronaut realizes that his name can be read from the mirror directly.  Does anybody remember the movie? Gilbert, MacWilliams, and Sloane defined a solution to "perfect integrity" in , unconditionally secure message authentication, not vulnerable to any cryptanalysis on its own even by an adversary with unbounded computational power, provided you have a key chosen uniformly at random the same length as the message. It sounds counter-intuitive that a MAC could have perfect integrity, any hash function can be broken with enough computational power. How does their solution have "perfect integrity"? Diagram of an artificial neural network Let's say there is a user who has found a satisfactory answer to a common question asked on Stack Overflow (or other Stack Exchange website).  This answer may be a snippet of code, or an addon, or a framework, or something else.    Is it acceptable for this user to formulate an answer for one question, find every related question and then copy the exact answer to each of those questions?  And, if not, what should  users who finds themselves in this situation do? is a dove a "she"? how to use "he" and "she" for animals? In the song &quot;Blowing in the Wind&quot; by Bob Dylan, there's a verse that reads:  Yes, and how many seas must a white dove sail Before she sleeps in the sand?  My question is, why he used &quot;she&quot; for a dove? What about other animals and other non-humans? Is there a general rule? Implicit conversion issue in a ternary condition Does $1.0000000000\cdots 1$ with an infinite number of $0$ in it exist? Does $1.0000000000\cdots 1$ (with  an infinite number of  $0$ in it) exist? Here's my problem  I'm trying to do a cleanup of my hard drive, and I'm constantly seeing this scenario:  (1) Aggregate folder size: I check the folder size viewing properties right clicking the folder  (2) Individual folder/file sizes: I check the individual file/folder sizes belonging to that folder viewing properties on the individual file/folder sizes, and then adding them up (with hidden and system files shown).   These two figures are always different, sometimes by a large margin.   For instance, my C drive now, by method (1), shows a consumed space of 42.4 GB.   However, by method (2), by inspecting the respective files/folders, the total consumed space adds up only to 33.1 GB. This is a 28% discrepancy (over the smaller file size) and I have no idea where the rest of the space is going.   My hard drive is constantly in danger of being full (it's bootcamp on a mac with 50 GB of partitioned space), and there's not much I've got installed in terms of software, nor do I have large media files like movies, downloads, temp files, application temp files, torrents, etc.   Most of it's just consumed by the files in C:/Windows, but last I checked, I don't know enough to know which files to delete, and I've heard that you really can't do anything about the space boggling winsxs and system32.   Can you guys recommend a starting point to free up disk space?  Thanks!!  Baggio.