C#,Inheritance Polymorphism, Overriding
Calling the base constructor in C#
Why is the accountsd process eating so much CPU? How do I create a list of Python lambdas (in a list comprehension/for loop)? I want to create a list of lambda objects from a list of constants in Python; for instance:  listOfNumbers = [1,2,3,4,5] square = lambda x: x * x listOfLambdas = [lambda: square(i) for i in listOfNumbers]   This will create a list of lambda objects, however, when I run them:  for f in listOfLambdas:     print f(),   I would expect that it would print  1 4 9 16 25   Instead, it prints:  25 25 25 25 25   It seems as though the lambdas have all been given the wrong parameter. Have I done something wrong, and is there a way to fix it? I'm in Python 2.4 I think.  EDIT: a bit more of trying things and such came up with this:  listOfLambdas = [] for num in listOfNumbers:     action = lambda: square(num)     listOfLambdas.append(action)     print action()   Prints the expected squares from 1 to 25, but then using the earlier print statement:  for f in listOfLambdas:     print f(),   still gives me all 25s. How did the existing lambda objects change between those two print calls?  Related question: Why is `[` a shell builtin and `[[` a shell keyword? How do I get the result of a command in a variable in windows? I'm looking to get the result of a command as a variable in a Windows batch script (see  for the bash scripting equivalent).  A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome. what are the meanings of &quot;treated observation&quot; and &quot;non-treated observation&quot; in this context ?  Further, propensity score matching is a more robust method of matching that quantitative accounting researchers frequently use (Rosenbaum &amp; Rubin, 1983). With this technique, the researcher first estimates a logit or probit regression with the treatment effect as the dependent variable (i.e., S&amp;P 500 membership, continuing with our earlier example) and independent variables that are known determinants of the treatment (possibly economic performance, firm size, age, industry, etc. in our example). From this first-stage regression, the researcher obtains propensity scores. 6 The researcher then matches each treated observation to a non-treated observation based on the distance between their propensity scores (i.e., those observations with the closest propensity scores are matched). 7 Hoi et al. (2013) utilize propensity score matching in their study that links irresponsible CSR activities with tax aggressiveness. They first generate predicted propensity scores for each firm-year using a model of the determinants of a firm engaging in a high level of negative, irresponsible CSR activity. Then, they match a treatment firm (one with a high level of negative CSR activities) to a non-treatment firm (one with a low level of, or no, negative CSR activities) by matching observations with the closest propensity scores. Hoi et al. (2013) then re- test the relation between negative CSR activities and tax aggressiveness using this matched sample. These matching techniques help mitigate the researcher’s potential failure to consider certain firm characteristics that differ between treatment and non-treatment firms (Dhaliwal et al., 2012). save as a video as .mp4 So I made an intro using animation and it saves it as a .blend and I want it so save as a video like .mp4 or something like that. I've tried changing the codec because I tried opening the intro with windows media instead of blend. I didn't try all the codec's but I tried some of them. In other words, what is the Drupal 8 equivalent of ?  Drupal 8 still uses hook_menu(), but for what I can see, the information returned by the hook is different from what the hook returned in Drupal 7. For example, the definition given in user_menu() for user is the following.    $items['user'] = array(     'title' =&gt; 'User account',     'title callback' =&gt; 'user_menu_title',     'weight' =&gt; -10,     'route_name' =&gt; 'user_page',     'menu_name' =&gt; 'account',   );   The route_name property links to an entry in the  file.  user_page:   pattern: '/user'   defaults:     _content: '\Drupal\user\Controller\UserController::userPage'   requirements:     _access: 'TRUE'   This is different from what done with Symphony, and it confuses me about how a module can alter the route defined from another user.  The only function that is still invoking hook_menu_alter() is menu_router_build(), but that function still contains code that needs to be updated, since it is still using the now deprecated drupal_alter().    // Alter the menu as defined in modules, keys are like user/%user.   drupal_alter('menu', $callbacks);   foreach ($callbacks as $path =&gt; $router_item) {     // If the menu item is a default local task and incorrectly references a     // route, remove it.     // @todo This may be removed later depending on the outcome of     // http://drupal.org/node/1889790     if (isset($router_item['type']) &amp;&amp; $router_item['type'] == MENU_DEFAULT_LOCAL_TASK) {       unset($callbacks[$path]['route_name']);     }     // If the menu item references a route, normalize the route information     // into the old structure. Note that routes are keyed by name, not path,     // so the path of the route takes precedence.     if (isset($router_item['route_name'])) {       $router_item['page callback'] = 'USES_ROUTE';       $router_item['access callback'] = TRUE;       $new_path = _menu_router_translate_route($router_item['route_name']);        unset($callbacks[$path]);       $callbacks[$new_path] = $router_item;     }   } How do I calculate if a spell hits and how much damage it does? I'm not entirely sure I understand what the PHB is telling me about spell attacks.  Say I'm a wizard who's casting Fire Bolt (I could also be a Cleric casting Inflict Wounds or what-have-you), the spell itself doesn't say anything about making an attack roll or the enemy making a saving throw.    So do I make an attack roll and then add in my INT mod + proficiency bonus?  Or does the target have to make a saving throw against a DC of 8+ my INT mod + proficiency bonus?  And, assuming I hit, do I add my INT mod + proficiency bonus to the damage? Automatically use specific language in Notepad++ for files with no extension We have given isosceles triangle $ABC$ with baseline $AB$. Point $M$ is midpoint of AB. Draw perpendicular line to side $AC$ through $M$ which intersects $AC$ in point $H$. Let $P$ be midpoint of $MH$. Show that lines $BH$ and $CP$ are perpendicular to each other.  I also have "hint": Construct height $BD$ to side $AC$ and look at the triangles $ABD$ and $MCH$.  Analytically there is no problem but I get stuck in geometrical approach to solution. The sine inequality $\frac2\pi x \le \sin x \le x$ for $0<x<\frac\pi2$ As I navigate through physics stackexchange, I noticed .  Electrons radiate light when revolving around nucleus? Why is it so obvious?  Note that I do not know anything about quantum mechanics - and I just want classical stories. Terminal flashes on empty backspace with Yosemite Since using Yosemite, I've had the annoying problem of my current Terminal window flashing when backspacing on an empty line. I know on previous versions of OS X this flashing was not default, and could be toggled in accessibility settings, but I cannot find the same setting and I'm dying to get this turned off. Any known ways to get rid of it? Cannot log in with Apple ID after performing password reset My wife forgot the password to her Apple ID account. Her Macbook Air (OS X Yosemite) restarted to install some updates. She has her user account set up through her Apple ID account.  Since she forgot the password she reset it from my laptop.  She can log in to iCloud and Apple ID with the new password, but cannot log in with the new password on the Air.  When she tries to log in she is greeted with this message:     "This account uses an iCloud password to log in. If you need to change   the password, use another device to change it at appleid.apple.com." New passport and entrance Schengen I am from Brazil and travel a lot in Schengen countries. Under the rules of Schengen visa (3 months stay in a 6 months period). In my passport are the entrance and exit stamps, also to chec the days I stay in Schengen.  I need a new passport and will get this in Brazil. So in this new passport are NOT the stamps. Does this mean I start new with the Schengen visa rule? I seems like. The new passport is empty. Or do I miss something? It would be great because I am almost on my 90 days stay in the period of 180 days. Why does the Stern–Gerlach quantum spin experiment conflict with classical mechanics? My understanding of the Stern–Gerlach experiment is that neutral (0 total charge) particles are sent through a non-homogeneous magnetic field, with the expectation that the field will push that particle's path higher or lower on a detector because of the collective spin of that particle. While the detector can detect particles in a two-dimensional surface, the results of the experiment are that particles appear in only two localized areas directly above the path of the particle stream, or directly below the path of the particle stream - spin up or spin down. The conclusions from these measurements are that the particle, when measured, will always have about the same magnitude.  Why does this not follow from classical mechanical theory related to magnetism? If you shot a magnet through a similar apparatus, I would expect the magnet to be rotated to align with the magnetic field in some way which, at high enough field strengths relative to the mass of the magnet, would cause us to measure basically the same magnitude as if the magnet entered the apparatus pre-aligned with the field.  How is my explanation incorrect? I'm running the Storm King's Thunder campaign, and we are at the portion where the PCs get an airship to travel around in, the airship is about 1000ft in the air. There are approximately 5-6 lvl 7 PCs, and they have 3 or 4 hard encounters a day. There are two wizards, a warlock, ranger, paladin, blood hunter, sorcerer, and fighter. For the most part, they have had fun with the different weapons and enemies they have faced; however, I find that one or two spellcasting PCs have been using spells such as mind sliver, polymorph, and hypnotic pattern to defeat more challenging encounters, such as one with a roc and wyvern. They make the creature make saving throws with hypnotic pattern and cause the enemy to fall to its death, and using mind sliver makes it even harder, especially on low wisdom creatures like rocs. Or with the polymorph spell, they cause the enemy to become a fish or chicken and throw it off the edge, and since the damage carries over, it kills the monster. I realize it was legal and made fights funnier, but it does get annoying when it's happening in almost every fight. Are there any suggestions on how to keep them on track without them making every encounter easy? I thought of giving the monsters immunity to these effects, but it just sounds like a bad excuse for me not being prepared. Showing inequality for harmonic series. I want to show that $$\log N&lt;\sum_{n=1}^{N}\frac{1}{n}&lt;1+\log N.$$ But I don't know how to show this. how to loop through arguments in a bash script I get this error: dpkg: unrecoverable fatal error, aborting: files list file for package `fonts-tlwg-kinnari' contains empty filename