Basis for the eigenspace of each eigenvalue, and eigenvectors

Question: So we want to find the basis for the eigenspace of each eigenvalue $\lambda$ for some matrix $A$.
Through making this question, I have noticed that the basis for the eigenspace of a certain eigenvalue has some sort of connection to the eigenvector of said eigenvalue. Now I'm not sure if they actually equal each other, because I have some trouble when it comes to eigenvalues with a geometric multiplicity of two or more.
Take the following example:
$$\begin{pmatrix}
    0 & -1 & 0 \\
    4 & 4 & 0 \\
    2 & 1 & 2
\end{pmatrix} $$
This matrix has a characteristic polynomial $- \lambda ^3 + 6 \lambda ^2 - 12 \lambda + 8$. The root of this is $\lambda = 2$, which has an algebraic multiplicity of 3.
When I try to find the basis for the eigenspace of the eigenvalue $\lambda = 2$, I kind of get confused. Because when I solve $(A - 2I)\mathbf{v}$ I simply get $(0,0,1)$ (actually $(0,0,n)$ where $n \in \mathbb{R}$) as the answer for the basis, even though this eigenvalue has two associated linearly independent eigenvectors, namely $(0,0,1)$  and $(1,-2,0)$. This leaves me with the following questions:

Is it true that the "basis of the eigenspace of the eigenvalue" is simply all of the eigenvectors of a certain eigenvalue (so in our example, the basis would be $(0,0,1), (1,-2,0)$)?
If so, why am I not able to get both eigenvectors with my method? And how would I be able to get them both?
Comment: When you solve $(A-2I)v = 0$ you should get two-dimensional solution space. How did you solve it?
Answer: Your first question is correct, the "basis of the eigenspace of the eigenvalue" is simply all of the eigenvectors of a certain eigenvalue.
Something went wrong in calculating the basis for the eigenspace belonging to $\lambda=2$. To calculate eigenvectors, I usually inspect $(A-\lambda I)\textbf{v}=0$. In this case take $\textbf{v}=\left(\begin{array}{c}v_1\\v_2\\v_3\end{array}\right)$ to see:
$$(A-\lambda I)\textbf{v}=\left(\begin{array}{ccc}-2 & -1 & 0\\4 & 2 & 0\\2 & 1 & 0\end{array}\right)\left(\begin{array}{c}v_1\\v_2\\v_3\end{array}\right)=\left(\begin{array}{c}-2v_1-v_2\\4v_1+2v_2\\2v_1+v_2\end{array}\right)=\left(\begin{array}{c}0\\0\\0\end{array}\right)$$
Note that all three equations are in fact the same (i.e. $A-\lambda I$ has three linearly dependent rows), such that the only restriction you have on $v_1,$ $v_2$ and $v_3$ is
$$2v_1=-v_2$$
Three unknowns with only one restriction leaves 2 degrees of freedom, i.e. you arrive at two eigenvectors. Now it is easy to see
$$\left(\begin{array}{c}1\\-2\\0\end{array}\right) \ \mbox{ and } \ \left(\begin{array}{c}0\\0\\1\end{array}\right)$$
are two of such eigenvectors.
Comment: Hmm, up until the $2v_1 = - v_2$ result I did exactly the same. I failed to see the 2 degrees of freedom = 2 eigenvectors. Thanks


Which endstops are most precise?

Question: I have seen mechanical (micro switch), optical  and magnetic(magnet + hall sensor) end stops.
Are there any differences in how exact they switch at the right location? If so which are the most precise?
Answer: There are some different criteria that we should use to select a switch type:

Precision / repeatability: does the switch trigger at the same place every time? How much spread is there in the trigger position? Do environmental changes or machine setting changes affect the trigger position?
Contact distance: does the switch register with enough clearance to its hard-stop that the homing axis can stop before colliding with something?
Noise-rejection: does the switch ONLY trigger when it is supposed to?

It's important to ask, how much switch precision do we actually need? A typical 3d printer drivetrain using a microstepping stepper motor can only accurately position the moving load within +/- one 1/16th microstep (even if using finer microstepping than that) due to error-inducing effects like friction torque and magnetic detent angle error. That's around +/-0.01mm for most printers. The homing switch only needs to be as precise as the motor's positioning! Nothing is gained by having, say, 0.001mm precision endstops.
This precision of +/-0.01mm is achievable for all types of endstop switches, with proper switch selection and configuration.
Then there are three "standard" switching types in use in consumer/hobbyist 3d printers:

Mechanical switches, typically dual NO/NC limit switches, which either pull up or pull down a signal pin by connecting an electrical circuit when triggered
Optical switches, which use transistors to detect when an obstacle ("flag") is blocking the window between the emitter and sensor
Hall effect switches, which use transistors to detect when a magnetic field exceeds a particular field strength cutoff

Mechanical Switches
Precision/repeatability depends on the switch quality, length of lever arm attached (longer increases contact distance but is worse for precision), and impact speed of the carriage with the switch. It's possible to have a good mechanical switch or a bad mechanical switch. This is typically a reasonable default choice because it is simple and cheap.
A small mechanical switch with a short lever arm (or the lever arm removed) will generally achieve the required +/-0.01mm switching precision. Very cheap switches, high contact speeds, and long lever arms may provide inadequate resolution for Z homing or probing, but will still be adequate for low-precision X and Y homing purposes.
Where mechanical switches tend to cause issues is in noise rejection. Different controller boards use different ways of wiring the switch: some use two wires and only send a signal when triggered. When not triggered, the signal wire is left floating or weakly pulled up by the microcontroller, while attached to a long wire that acts as an antenna to pick up EM noise. It is VERY common for heater or stepper wiring to emit nasty EMR due to the PWM current control. Two-wire endstop cables should always be run away from stepper and heater wiring. Shielding and twisting the conductors is a good idea too.
A more robust approach is to use three-wire switches that actively pull the signal line high or low depending on the switch position. These will tend to reject noise better.
Very cheap mechanical switches may fail within the life of the printer. However, most limit switches are rated for millions of cycles, which is unlikely to occur over any normal printer's lifespan.
Mechanical switches are easy to align and easy to trigger by hand during troubleshooting.
Optical Switches
These rely on a flag blocking a window between a light emitter and a detector. This is non-contact and can be quite reliable, but introduces some challenges. The exact trigger position (and thus precision) may depend on ambient light levels in the room, because the sensor is monitoring for light to decrease below a specific intensity. So it may be very repeatable/precise in the short term but have some drift if the sensor moves in and out of the sun through the day.
Switching tends to be more consistent and reliable if the flag enters the window from the side, rather than the top.
Optical switches will actively pull the signal line high or low, and thus have good electrical noise rejection.
Hall Effect Switches
These measure the intensity of the nearby magnetic field and trigger when it exceeds a certain amount in a certain polarity. This is highly precise/repeatable (better than +/-0.01mm) and extremely resistant to noise and environmental conditions. (Unless your printer is next to something that emits large magnetic fields, anyway.)
The hall switches I've seen have an adjustable trim pot to tune the trigger distance. That's a nice feature when trying to manually calibrate a Delta or a Z-bed for first layer height.
The primary downside to hall switches is that they need a magnet to trigger the switch. This can be difficult to trigger by hand during troubleshooting, and requires attaching a magnet somewhere on the moving carriage. Glue works fine... but don't glue the magnet in place backwards!
Comment: I don't see the "Precision / repeatability" answered for the different switch types. You name the effects that have influence though. I think the question is if a good mechanic switch is more precise as an Hall Effect switch. Or if ambient light makes an optic switch less precise than  bad mechanical switch. And what are the variations anyway. Are we talking millimeters in difference or µm? Some ball park values of the achievable precision would be needed to compare the three end stop types.
Comment: Nice answer, however, do you have any source for the precision of (common) switches being this high? The statement "use transistors to detect" is a bit superfluous since just about everything uses transistors and transistors aren't really key to their operation. RE large magnetic fields; have you considered that the stepper motors themselves emit quite a bit of magnetism. I found that once triggered, my hall endstops stayed triggered due to the magnetic field of the motors, and that to get them to "untrigger", I had to add a magnet of the opposing polarity close to them.
Comment: Repeatability is far more important than precision.  The word "precision" indicates, roughly, how small a distance difference can be determined, and you'd think there's no point in exceeding the stepper motor limit -- **except** that the bed itself can be adjusted far more precisely w/ the four corner bolts. So if you can get super-tight repeatability, you can "home" the bed itself to that position.
Comment: It simply depends too much on the specific switch used to give a concrete answer. In particular, two different mechanical switches can have very different precision. A cheap limit switch with a very long lever arm might be +/-0.5mm with a speed-dependent trigger position, but that's unusually bad. My experience is that all the "typical" endstop switches (hall, optical, short-throw mechanical) are equal or greater precision than the positioning resolution of a typical stepper motor drivetrain (+/- a 1/16 microstep or thereabouts) and thus the exact trigger position repeatability is irrelevant.
Comment: Let me add some detail to the answer to clarify this a bit.
Comment: Carl, within the realm of science, engineering, and switch specification, precision and repeatability are more or less synonymous. The precision refers to the spread in the measurement values from measurement to measurement. What you're thinking of is resolution.
Comment: You've missed the *induction* sensors. No, those are not Hall Effect ones.
Comment: One should also consider how many cycles before failure. In this regard, optical and hall-effect sensors outperform mechanical sensors greatly (in similar price ranges).
Comment: @RyanCarlyle Repeatability and precision are not more or less synonymous. Precision is how far are your measures from the target regarding to an scale. Repeatability is the spread of the measures according his own target. R&R studies can help to determine if tha part can meet your goal. However many electric parts can give  that required repeatability unless the mechanical part gets damages or dirty during usage, but most of them has a limit more than 100,000 clicks as life span and much more. I work as Quality Engineer (30 years)
Answer: Thomas Sanladerer performed exactly the comparison you ask. Check the whole video.
The result is that inductive sensors are the most accurate, but they are highly dependent on the bed material chosen.
Mechanical switches (bare, no metallic arm) are about as accurate and keep the same accuracy with every bed material (however you need a mechanism to retract them, which may or may not decrease the accuracy).
Other sensors are less accurate.
In any case, most of them are already far better than required, since anything below 50 microns is fine and basically all of them reach that accuracy.
Choose based on other factors such as weight, installation, price. Inductive, after a calibration based on your specific bed, may be the easiest since they need no retraction, but they are bulky. BLtouch is probably the second choice, mechanical microswitches the third one.
Comment: Good find of an old question and a good summary of Tom's tests. He did not test an optical breaker circuit though - where a light always hits a photodetector and the moving part pushes a wall inbetween. This setup is very precise.
Comment: I'm not sure it can beat the other ones: as written in another answer, that kind of endstop is based on the light reaching the sensor dropping below a certain threshold. Since it's a measurement based on (infrared) light, the ambient light will impact it. It can be accurate in a specific environment but not immune to various changes to the environment.
Comment: I am talking about light barrier type optical sensors. An LED sends full bright power into a sensor and a "wing" moves in. Such endstops were not tested by Tom but are used extensively in heavy machinery as they are rather foolproof and a broken light source or any item falling into the sensor trips an emergency halt.
Comment: @Trish to explain better: in those sensors the light is converted to voltage, then when the voltage crosses a threshold, the output is triggered. However the threshold will depend slightly on the environment temperature, and since a small change in the threshold translates in a much larger change of trigger height, they may not be better/much better than the other systems. Oh, and you still need retracting them when not in use, which add an additional mechanical component which will decrease accuracy. For example, a 4 cm ABS holder will expand by 80 microns over a 30°C temperature difference.
Comment: Thomas' video was about bed levelling rather than the OP's question about end stops. however it did show the accuracy of microswitch without lever vs relevant alternatives.
Answer: I don't think there is a simple answer.
In my opinion, for a home sensor accuracy doesn't matter.  Firmware usually allows setting an offset between the indicated position and the actual position.  What really matters is repeatability.  Every time the sensor indicates position, the position is the same.
Mechanical Switches
I have found through testing several mechanical switches that the "make" event is less repeatable than the "break" event.  For best results, I move toward the position that closes the switch, then move in the opposite direction until the switch opens.  If I remember correctly, I got "make" repeatability of about 0.02" (0.5 mm), and "break" repeatability of about 0.005" (0.13 mm).
Optical Switches
For a delta 3D printer, I use optical sensors.  Optical sensors have a built-in illumination and sensor, usually on opposite sides of a forked structure.  The sensor side has a slot which masks the light being received, helping to shroud it from ambient light.  The slot is along an axis which is either aligned with the fork or normal to it.  The flag you use for the interrupter should completely cover the slot, and for good repeatability edge of the flag must be parallel with the slot.  In other words, some sensors expect the flag to enter from the side while other expect the flag to enter from the top.  Either will work, but you need to choose the right sensor for the configuration of your machine.
Ambient Light with Optical Switches
Perhaps ambient light could be a problem.  If so, it could be addressed by shading the sensor.
Let's assume that the LEDs in the sensor are the same efficiency as the ambient LED lights.  For reference, here is a spec sheet for a typical optical interrupter used in optical sensors:  http://www.isocom.com/images/stories/isocom/isocom_new_pdfs/H21A.pdf  The package of the optical sensor is designed to reduce susceptibility to ambient light.
Light intensity falls off as distance^2, and the illuminators in the sensor are very close.  How much effect does room light have on the sensor?
In my shop, I use 8-foot LED replacement bulbs for the fluorescent bulbs.  With this, I have 72 watts of LED lighting, which, let's say, illuminate evenly the semi-sphere below the ceiling.  A full sphere is 12.56 sr (steradians, or stereo-radians), so the half sphere is 6.28 steradians, for a power of 11.46 W/sr.  At the sensor, this must be divided by the square of the distance, let's say 8 feet.   This gives us (11.46 W/sr)/(96in^2) = 0.119 W/area.
The illuminating LED has a power (typically) of 1.2 V * 0.05 A, or 0.06 W.  The light cone from a typical LED is about 30 degrees, which is 1 sr, for a power of 0.06 W/sr.  Scaled for an estimate of the distance between the emitter and sensor of 4 mm or 0.157", is (0.06 W/sr)/(0.157in^2) = 2.43 W/area.
It seems unlikely that general ambient light will be a problem.  If it were, the sensor mounting could be designed to shield the sensor from direct exposure to ambient light.
It is important with optical sensors to be sure the interrupting flag is actually opaque to the illuminator light.  As I found, red PLA is not especially opaque to infrared light, so I needed to paint the flags with a black pigmented paint.
Hall Effect Switches
I have no experience with Hall effect magnetic limit switches.  Other answers here have praised them because they have an adjustment which can be used to set the precise detection point.  I don' t like adjustments because they drift.  Pots are subject to wear, oxidation, and both slow and fast variation in their resistance.  I would prefer to have something unadjustable and repeatable in hardware and use software to hold the calibration.
Example of Hybrid Choice
On a 6-axis delta architecture CNC machine I build, I use a hybrid approach to sensing home position.  Mechanical switches indicate a position that is close to home, and the index pulse of a rotary encoder defines the precise home position.  The homing firmware moves toward home until the mechanical switch closes, then away until it opens, then back toward home until it detects the index pulse.   As there are six axes, there are six sets of these switches and encoders.  Using a mechanical switch for the rough homing made sense for this machine because the index sensor is hit once per revolution, so it is not a unique indicator of home, and this machine creates a lot of dust and chips, which could block an optical sensor.
So, without an absolute answer, my preference is for optical switches for repeatability.
Comment: The precision values you got for mechanical switches appear to be extremely high. Granted, they are not perfect, but if mechanical switches only had a repeatability of around 0.5 or 0.13mm, then nearly *every* print on those well-known cheap Chinese 3D printer kits would fail, which is clearly not the case.
Comment: The link has unfortunately died... do you happen to know the title of the document, so that we could search/google for it?
Comment: This link may serve: http://pdf.datasheetcatalog.com/datasheets/105/55275_DS.pdf
Answer: I think there are several factors involved in which sensors are best, but the general ordering for me would be Hall, Optical followed by mechanical. All of the types will be subject to some drift due to vibrations and changes in the printer over usage. Therefore it's the ease of adjustment as well as the accuracy of the stop which counts in the assessment.
In my experience the hall effect sensors are the most accurate and easiest. They don't rely on physical switching (as with the mechanical) meaning there is no "wear and tear" on the component and the point of switching will remain fixed. They have a potentiometer which can be adjusted to make the position of the stop change without any mechanical intervention allowing very fine tuning. They can be very accurate.
Optical are similarly accurate but usually have a fixed component that cuts the beam to switch on/off the sensor. The adjustment of the stop will usually be mechanical because the mount points will need to be adjusted - this reduces their accuracy. There are various adjustable mounts to alleviate this on thingyverse or the like.
Mechanical switches are similar to optical in terms of adjustment with the added inaccuracy of the actual switch mechanism which may degrade over time.
Answer: If you take a look at the RepRap Wiki, they briefly explain these three switches:

Mechanical

"Mechanical Endstops are the most basic form of endstops, made of an ordinary switch, two wires. Changing the switch state signals the electronics.

Optical

"These Optical Endstops observe the light level and reacts to sudden changes."

Magnetic

"These endstops; Hall effect sensors is a transducer that varies its output voltage in response to a magnetic field. Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications."

In regards to your question, it's dependent upon your circumstance. However, most of the time a good 'ol Mechanical Switch is repeatable and serves its purpose well.
I, personally, would place both optical and magnetic switches in the category of a multifunction component. Meaning, both of these types of switches (generally) provide a valuable range for object detection. This can potentially lead (depending on your machine) to a pushed command that tells your machine to slow down when it comes close to the soft stop.
Again, personally, I would be wary of using an optical endstop with potential white light noise from ambient room lighting or other sources. I could be wrong in my concern for some modules that address these kind of issues.
So, if we narrow down between mechanical and magnetic:
 - Magnetic would provide a gentler approach, reducing (potentially) the amount of wear
 - However, I'm assuming, magnetic switches require "dialing in" depending on the components used in the sensor. This could lead to an undesired range that the sensor is triggered.
 - Mechanical switches are simple. They're either touching or not touching (on or off)
 - A possible pro (or con) is the ability to manipulate the trigger manually, more easily. I've run into a situation a few times where I needed to manually trigger the endstop as part of a troubleshooting step. But, if you accidentally bump your endstop while the machine is running, no good.
Comment: Do you know if this "pushed command that tells your machine to slow down" is used on any machine?
Comment: I don't know of a real world use for 3D printing, that's why I said it's a potential option. I have seen similar setups in traditional CNC machining with a third party sensor. The sensor does its thing and essentially pushes a G-Code command to the machine's controller. Typically the command is a subroutine that performs multiple functions like moving the machine to a safe distance, stopping, and notifying the operator. Look up Caron Engineering for an example with their TMAC setup.
Comment: This doesn't answer the question, which asks "which endstops are the most precise?". There's nothing in here that addresses that - this answer mainly seems to be theorizing about a "gentler approach" which isn't even supported by any firmware.
Comment: @TomvanderZanden I'm purposely staying away from answering that part of the question as it is primarily opinion based.
Comment: You could answer that part pretty objectively if you looked in some datasheets for the repeatability characteristics of various endstops.
Answer: A separate issue not addressed in other answers is that the end stops for X/Y axes have different requirements than those for the Z axis.
X/Y Axes
When the printer offers XYZ calibration (like Prusa i3 MK2), the properties of the X and Y switches play a role, since for the Z probing the probe should be centered above the fiducials (copper circles) in the bed. The XY part of the calibration measures the position of the fiducials relative to the end-stop trigger point. Then the Z calibration measures the height of each fiducial.
When the XYZ calibration is not offered, there's usually no need for very repeatable positioning relative to the X and Y travel ends, and on most printers you could simply move the motors until they start skipping steps and call that a day - it will be accurate to within a few steps.
Z Axis
The Z axis always has a high requirement on accuracy and repeatability, and there are two general approaches to determining its position:

No end-stops on the Z-axis drive system, a probe is mounted on the print head and is used to detect when the head is a certain distance above the print bed. This can be used for 9-point calibration of the bed shape and thus removes the need for bed levelling.

End-stops used on the Z-axis drive system. No sensor on the print head. The bed needs to be separately leveled in reference to the nozzle - thus the bed leveling screws.

Delta Z
For Delta, you essentially have three Z axis drivers, and similar to the Cartesian XYZ drive, you don't need any end-stops if you have a probe on the print head. You can also perform multi-point bed leveling with such a probe.
Other Approaches
X and Y endstops become unnecessary once you use closed-loop stepper control, such as Mechaduino or linear digital position sensors (e.g. as used in CNC machines).
The Z probe is still useful if you don't want to perform bed leveling manually.
Comment: While these are interesting points about endstops, it doesn't address the actual question at all.
Comment: Do you have any references to a delta running without endstops?  I'm fairly certain endstops are required to establish axis position otherwise the motion gets screwed up.
Comment: Kinematically they are not required. Similar to a double-Z-axis Prusa mount, you start with a "fairly" middle-of-the-bed position, then all three Z axes move down until the probe detects the first fiducial. It's a large circle (e.g. 1 inch dia) and establishes the Z and radial origin (think of the bed in polar coordinates). Second fiducial is a narrow sector and establishes the angular origin. Now you can find further small fiducials to perform full Z calibration (or full XYZ calibration after assembly). For XYZ cal you need a Prusa-like custom bed. For Z only a circular metal plate will do.
Comment: @KubaOber Could you please explain how you would decide where "fairly middle-of-the-bed" is on a delta without any sensors? The initial position could be literally anywhere...
Comment: You can't. You do it manually, or you use a mostly metal bed where the fiducials are negative, i.e. gaps. The inductive sensors are good at detecting those. This would also help detect the edge of the bed so you don't need any additional sensors at all other than the inductive one. I run a delta like that.

Which endstops are most precise?


How is the review count in the 'header' calculated

Question: My review count, which appears at the top (see image below) shows 805 items need attention, but, when I click on it and see the screen below, the maths doesn't add up! It has been like this for many days now.
Comment: I believe it's just heavily cached.
Comment: It must be very heavily cached @slhck, that number alters quite often. As soon as I posted the above screen, the number had changed from 805 to 800 (although the maths still didn't add up). I mean, it does (if you hover over the 805) show a tilde  (~) which means 'about' ... Again, thank you for your time/answer
Comment: If you're an active reviewer, that'd explain the discrepancy. I'm pretty sure that posts *still in the queue but handled by you* count towards the top bar, but not for the per-queue numbers.
Answer: It's a count of everything everyone needs to review rather than what you can review.
I think this is how it's intended, from Anna Lear's and shog9's answers over on meta.stackexchange.

... this is everything in review, even stuff that you, personally, can't
  review. Super-expensive to personalize this - so the alternative is
  simply not having an indicator ...

As well as the caching...
oh, also here is another discussion about its functionality Modulate the review notification's color ...


'What is magic about __len__()?

Question: So a list object does not have a simple length attribute len but rather the "magic" __len__(). Why is it preferred to use the function len() on a list rather than its attribute? Does the function len() not simply query __len__()? Why that detour and not have my_list.len()?
Comment: See https://stackoverflow.com/questions/496009/is-there-any-case-where-lensomeobj-does-not-call-someobjs-len-function/497096#497096
Comment: [You should only ask practical, answerable questions based on actual problems that you face.](https://stackoverflow.com/help/on-topic) ["Why?" questions on language design do not fit this criteria.](https://meta.stackexchange.com/questions/170394/what-is-the-rationale-for-closing-why-questions-on-a-language-design)
Comment: Possible duplicate of [Is there any case where len(someObj) does not call someObj's \_\_len\_\_ function?](https://stackoverflow.com/questions/496009/is-there-any-case-where-lensomeobj-does-not-call-someobjs-len-function)
Comment: https://stackoverflow.com/questions/16249418/how-to-python-count-list-length
Answer: It might be helpful to think of __len__ as a method you can customize for any object.  Part of the reason for the len function vs using .__len__() or .len() is that python was intended to be a language that is easy to learn.  For a beginner programmer, understanding that you use the length function to get the length of a list seems very intuitive to me.
For example:
class MyObject:
     def __len__(self):
          return 100

a = MyObject()
assert len(a) == 100

So it's just a construct of all python objects that you can set how length is calculated.  This example isn't useful, but perhaps if you had a Circle object, you might want length to be it's Circumference, ie.
 class Circle:
     def __init__(self, radius):
         self.radius = radius

     def __len__(self):
         return 3.14 * self.radius * 2

A benefit of having len as a function as well as a method is the ability to map-filter-reduce len onto arrays.  It is very easy to write:
map(len, [[1, 2], [4, 5, 6]])

However, if you really think that .len() is an attractive way to present the length of an object, you could just add a method.
class MyObject:
    def __len__(self):
        return 10
    def len(self):
        return len(self)

Comment: Thank you, Rob. Spot on, that was really helpful!

'What is magic about __len__()?


Detect unused steps - Behat

Question: Are there any tools or extensions to detect unused steps in Behat?
We have a huge number of tests code, it is time consuming to check each single step is in-use or not. So I'm thinking if any tools can do that. Any suggestions?
Comment: https://github.com/exakat/php-static-analysis-tools
Comment: https://github.com/nicwortel/behat-unused-step-definitions-extension
Answer: One approach is to copy files into a cucumber based project and run
cucumber --dry-run -f stepdefs

Which will print 'NOT MATCHED BY ANY STEPS' for any non-matches.
If you have steps that are only used by other steps, then omit --dry-run to get allow for that. With --dry-run, steps are not executed and cucumber will not find out that the referred step is used.
Answer: This is just an idea, but it should work.
You need to check all the regular expressions from steps in a result report.
For example:
1) create a complete report running all active scenarios with --dry-run
 2) save all the regular expressions using running behat with -dl
Now you have 2 files all scenarios and all regular expressions, now all you should need to do is to do a foreach in the regular expressions and look it in the report file and maybe count the matches as well.
The search could be done in php or with any other tool that can handle regular expressions.
Answer: You can make use of code coverage tools for PHP.
xdebug has Code Coverage Analysis.
Check this chapter of the PHPUnit Manual

Detect unused steps - Behat


Does the optical transmittance of pulsed laser through a transparent material differ quantitatively from a continuous wave laser?

Question: The absorption & transmittance of light through a transparent medium is described by the Beer-Lambert law. But the equation does not factor in the time parameter so I assume it describes continuous light rather than optical pulses. So the question is: Does the optical transmittance of pulsed laser light(assuming its fairly low power, << 1 Watt)for an arbitrary wavelength change quantitatively compared to a continuous beam of the same wavelength? Is so, is there a mathematical relationship between the pulse duration and transmittance?
Comment: 1 W peak power? Or 1 W average power with an unspecified (possibly very low) duty cycle?
Comment: In general ....no.  If the power is similar for both then power out is the same minus whatever losses as a %.  The losses in general are due to reflection and absorption, it's the absorption that can be non-linear at high power densities, for example the absorbing transitions can get saturated, unable to absorb photos at the same rate as at more normal powers.
Answer: The propagation of an electric field through a linear medium is affected by the refractive index of the material, which is usually frequency dependent
$$\bar{n}\left(\omega\right)=n\left(\omega\right)+i\kappa\left(\omega\right)$$
For a monochromatic electric field then
$$E\left(x,t\right)=E_{0}e^{i\left(\bar{k}x-\omega t\right)}=E_{0}e^{-\frac{\alpha}{2} x}e^{i\left(kx-\omega t\right)}$$
where I used the relation $\bar{k}=\frac{2\pi\bar{n}}{\lambda_{0}}=\underbrace{\frac{2\pi n}{\lambda_{0}}}_{k}+i\underbrace{\frac{2\pi\kappa}{\lambda_{0}}}_{\frac{\alpha}{2}}$. If that's all the field you have, then you can immediately recover Beer-Lambert law $I=I_{0}e^{-\alpha x}$. However, in the general case your electric field at the interface with the material is made out of many frequencies, and you can use the Fourier decomposition to write
$$E\left(0,t\right)=\int E\left(\omega\right)e^{-i\omega t}{\rm d}\omega$$
Each of these components advances as a monochromatic light, and you get at the output
$$E\left(L,t\right)=\int E\left(\omega\right)e^{-\frac{\alpha\left(\omega\right)}{2} L}e^{i\left(k\left(\omega\right)L-\omega t\right)}{\rm d}\omega$$
The pulse duration is inversely proportional to its spectral width, and thus short pulses would get distorted and unevenly attenuated. To get more specific information, you will need the profile of $\bar{n}\left(\omega\right)$.


How to restore a deleted unmanaged Apex class

Question: I accidentally deleted a wrong class via the Force IDE and want to restore / undelete it.
I found no way to do this....
Answer: There is an option to Restore from Local History in Eclipse. You could give that a go.
Comment: I knew I can do that, but I thought Salesforce.com would also track it and allow me to restore it. At least for managed classes this is possible via Package > View Deleted Components
Comment: No afraid not. The best you can get is "View Setup Audit Trail" which shows who done what in the admin area. It would be nice if deleted components ended up in the Recycle Bin.

As Pavel mentioned, look into using version control.
Comment: You can't undelete "View Deleted Components." They are historical in nature. Interestingly, ApexClass, the representative of a class, doesn't have a IsDeleted member, which would be required to find deleted classes through a query.
Comment: BUt I did try using getdeletedrecords, and my recently deleted class was in the result set - but you can't undelete on ApexClass apparently
Answer: As BarCotter mentioned you can do it via Local History. Also you can retrieve it back by updating class directory from server (in case this class was saved on server).
Also you need to use a version control like git or svn, if you don't - this is very significant thing in software development.
Answer: Any chance the class still exists in some other Sandbox ? Or even in Production if you deleted from Sandbox...
Answer: This isn't directly an answer, but whenever something like this happens it's a great time to start looking at source control.  While I've always felt that Salesforce should be versioning these things for us, that doesn't appear to be likely anytime in the near future.
A simple solution we've used is just to do a daily checkout of all of our apex code and push it to a repo.  It lacks much insight into why those changes were made, but does save us from accidental deletions and other common mishaps.
For a more full-fledged solution, take a look at StratoSource RedHat's internal Salesforce project management tool which includes auto-repos and other powerful goodness to manage your internal Salesforce projects.
Answer: I did get this technique (Bascially, querying for the deleted class in Dev Console, and then using the Id to display class which seems to work even when class was deleted) to work for me once, but trying it in a dev org now didn't seem to work - but wanted to throw it out in there in case
Comment: Doesn't work anymore. Salesforce.com changed the Undelete behavior in Winter '15 which leads to severe problems with our managed packages. For more see http://salesforce.stackexchange.com/questions/56112/customer-org-corrupted-public-class-deleted-in-1-2-magically-gets-deprecated-in
Answer: They way I do it is to use the execute anonymous function from the Developer Console and run the following:
<code>system.debug([SELECT Id FROM ApexClass WHERE Name = 'NAME' all rows]);
</code>
Then open the class via https://instance.salesforce.com/Id click edit then save and voila the class is back.
HTH
Comment: Doesn't work anymore. Salesforce.com changed the Undelete behavior in Winter '15 which leads to severe problems with our managed packages. For more see http://salesforce.stackexchange.com/questions/56112/customer-org-corrupted-public-class-deleted-in-1-2-magically-gets-deprecated-in


Gone into deep hole with client. What next?

Question: I have been working with a client on an elaborate website for more than 12 months. The project is almost at completion, but there's some technical barriers stopping it from being finished: they have asked for extremely complicated features that, at the time (time being 8 months into the project), I said may be feasible, but now I know it is not. They expect the site to be ready now. (Update..) I would like to add that this was not communicated well to the client recently due to a whole host of personal problems, which unfortunately had serious impacts on my ability to work. They are aware it was a difficult time for me.
The problems arise with the fact that as the project has been under development, more and more requirements have been added to it. It's now at a stage where it is so complicated that I do not believe the infrastructure the business can afford is going to handle it at all. On top of all this, as the additional requirements are so demanding I have struggled to dedicate the time or resources to complete the project, leading to an angry client (I only work part-time on this, generally evenings).
To top this all off - I have completely finished my freelance career now. I enjoyed it and feel as if I have been relatively successful at it, but I'm moving onto a different career path. I'm extremely worried about this project and the client though, as they are friends (a big no no I now understand in the freelance world..!) and I do not want to harm my reputation (on both professional and personal level) nor lose a friend.
My question is... How do I get out of this situation? How can I break those kinds of facts to a client so late into a project?
I understand this may be a vague question in some ways, but I don't know where to turn. Any help would be deeply appreciated.
Answer: Take Control.
Given that you have learned the importance of stopping project creep, what can you do now.

Finish it
Abandon it

The choice is yours, but you have to control this. Without further knowledge of the price and initial agreements and payments made etc it is impossible to advise properly, but here are some ideas. You need to take control of the situation, no more meetings or discussions, compromise is not going to work, just make some fair decisions and stick to them.
Finishing it.
First, get to where you should have been in the first place. Make a list of all the outstanding work. This list is final. Accept no amendments. Do not discuss it with them, write it out according to previous meetings and emails and list it out as as 'To be completed'.
For each item, add a timescale. Add up all the timescales and create an estimated completion date. Email it to them, without grandstanding, and get on with it. If infrastructure cannot cope, for instance, you just email them and tell them what they need. It is not your job to get it, source it or implement it as this is not on the todo list.
Abandoning it.
Again with no numbers to talk about, this is hard to advise on. I would suggest that you spend a week getting it to a stand alone, working stage as quickly as possible. Get all the files together, document them (actually do not spend too long on that, just make the document long, technical and providing passwords, DB access etc. with some code structure breakdown).
Email them with a simple handover email. The reason is that despite your best intentions the project continues to expand exponentially and has far exceeded the original concepts outlined at the outset. That despite your best efforts to communicate these issues the project continues to expand at a relentless rate and that you no longer feel able to continue. Remember that this is their fault, not yours. Do not apologize nor take any responsibility. Be polite, but you have nothing to explain other than the obvious, here is what I have done, here is the docs you need to continue, here are all the files, good luck and good bye.
You MAY want to include a summary of the work and hours you have done to account for any payments pre-empting any refund claims.
Then walk away, and get on with your life. Always take at least 24 hours to respond to any emails or questions. Do not get into a protracted discussion, it is over. Do not offer advice, insights or anything else. Do not attend any further meetings.
Good luck
What you do is up to you. Given the tone in your OP I would suggest you walk away. They are not going to suddenly treat you better, this is now a lose lose situation.
They have probably been abusing the friendship in this work relationship, so put that to one side completely. Sort out the work stuff, then get back to the friend stuff (if that is possible) afterwards. If this is how they make their money you can be sure they will be putting their business before you.
I hope you get a chance to let us know how this works out.
Best wishes,
Paul.
Comment: A the well structured answer. In the end, it was finished with infrastructure changes that were also implemented by myself. Thanks for the tips, some valuable lessons were learned!
Answer: You should have been more clear on the difficulties during the development of the project... now is a bit problematic...
You can ask for a quotation to other freelancers that will be able to finish the job. Then you can talk to your client and explain more clearly as possible that you will need extra payments to finish the job since the last requests are too complex and cannot be included in the original price.
If they will accept you can hire freelancers to end the work.
Answer: Find compromise, talk with the client and tell them that you need work with them on an exit plan. Set a hard date so its not just coffee talk. Three months? Six months? Be generous, but also, be realistic. If you cannot commit to six months, don't agree.
It is not the end of the world. Yes, they might be upset, but things could be worse. Once you co-operate with the handover it will help take some of the sting your absence will bring. Make sure you are remunerated for handing the project over otherwise it will go on forever (which neither side will want). One advantage to passing the project on is your customer/friend will get a better idea on the real cost of the project and how valuable your contribution was. Agree how many hours a week you will contribute to the hand over too.
Any project, regardless if you are an employee or a freelancer should have a project plan that in its most basic form should describe what is in scope and out of scope, and it should summarise stage gates (where they review progress before you both agree that the next step should commence). It also means that as they add new features ("feature creep") they'll appreciate the impact on delivery, the risk to the project, and possible cost over runs.
Best of luck!


Monitoring server room power

Question: I'm looking for a good way to audit the per-rack power utilization in an existing server room.    Each rack is powered, for the most part, by a pair of single phase 30A/208v feeds.  Is there something like a network-accessible clamp meter I could attach to the power cords that would let me record current draw over time?  Would something like the TED 5000 work for this purpose?  Actually replacing the PDUs (with, say, metered PDUs like the ones available from APC) isn't an option at this time; this is part of a planning effort for a new data center, and it has to be minimally disruptive to the existing environment.
Answer: The problem that you're going to run into with a clamp-on ammeter is that you can't actually clamp it over the entire power cable - if you do this, you'll read a zero-amp current. Assuming that you're dealing with single-phase power, you'd need to clamp over either the hot or neutral (I'm going to assume that there's little if any current going back down the ground) to get an accurate reading.
Most of the modern servers I've worked with allow you to monitor their power draw in real-time via their iLOM/ipmi controllers. Have you looked into this possibility?
Comment: ...which I would strongly advise against in a datacenter environment.
Comment: Agreed, some stripping of the cables is usually necessary.
Comment: Yeah, that would not be "minimally invasive".  Thanks for the info.
Comment: It all depends on how your data center is wired. If you trace the leads for the sockets feeding the PDUs back to the central input rails you'll usually find that the connections are a set of single wire leads. If the armor sheath is not too close to the rail connection point then you can fit in a ammeter clamp without any problem. If the armor sheath is too close to do this then you'll have to power down the attached PDU and have an electrician strip the sheath back a little. As long as your rack is redundantly wired you can do this without any downtime. I've done this for 20+ racks 0 downtime
Comment: Also note that iLO/DRAC/IPMI power monitors are reading the output from the power supply to the motherboard.  Add about 20% for an 80Plus certified power supply.  Also also note that power on readings will be much higher than normal usage for all modern machines.
Answer: I'd suggest contacting your state or local governments energy efficiency entity or even your power provider. They usually have such equipment and are typically happy to come out and do such work for free or for a minimal charge.
Answer: What's the kit in the rack?  Most ISS servers should by now have power consumption data accessible via SNMP.  You could use this to build a rack tally.  Granted, SAN switches, Ethernet switches and the like will most likely not have such data available.

Monitoring server room power


For which systems is the equipartition theorem valid?

Question: Under what conditions does a system with many degrees of freedom satisfy the equipartition theorem?
Comment: There are many comments on the conditions that must be satisfied in the wikipedia article: http://en.wikipedia.org/wiki/Equipartition_theorem
Comment: Thanks Rafael. The section on ET for systems described in terms of generalized coordinates makes all very clear.
Answer: the system must be in a thermal equilibrium - a condition that allows one to assign a uniform temperature to the whole system. Strongly interacting systems reach it more quickly, weakly interacting systems may need a longer time.
But once a system reaches the thermal equilibrium, it is guaranteed that each subsystem and/or each average degree of freedom of a certain kind carries the energy that is attributed to it by the equipartition theorem - e.g. $kT/2$ for a typical classical degree of freedom (translations or rotations). This is a statistical statement, so you need to look at many atoms or degrees of freedom of the same kind ($N$ of them) and take their average energy. When you do it right, the average energy will be given by the figure implied by the equipartition theorem plus minus an error - the relative error goes to zero as $1/\sqrt{N}$ for many atoms or degrees of freedom.
Of course, one must be careful what the actual prediction of the equipartition theorem for a "degree of freedom" is. The figure $kT/2$ only holds if the degree of freedom is de facto classical and more or less decoupled from others - at the given frequency. For very strongly coupled systems, the "number of degrees of freedom" is less clearly defined, and so is the energy predicted by the equipartition theorem for one of them.
Cheers
LM
Comment: @Johannes: I just noticed this--- it's 1/2kT kinetic and 1/2kT potential for a Harmonic oscillation, and only 1/2kT kinetic for translation and rotational degrees of freedom, where there is no restoring potential. It interpolates between 1/2kT and kT for potentials that bend up more than quadratic.
Comment: Thanks for your answer Lubos. I was puzzled as (in another discussion here) the remark was made that equipartition holds only in very particular circumstances. The way I now understand it is that we need to distinguish two issues: the 'generic idea' of equipartition (which holds for virtually any equilibrium system) and equipartition with a precise energy of 1/2 kT assigned to each degree of freedom (which, strictly speaking, only holds for weakly interacting classical harmonic oscillators).
Comment: Sure, @Johannes, one must carefully distinguish "any [but fixed] prediction for the distribution of energy" and "a particular value for a degree of freedom". The latter is a much stronger statement.


Associative division subalgebras of split Cayley-Dickson algebra

Question: Let's consider the split Cayley-Dickson algebra $C$ over an arbitrary field $F$
(It is well known that all split composition algebras having the same dimension over base field are isomorphic, e.g., all split Cayley-Dickosn algebras are isomorphic to Zorn's vector-matrix algebra).
The question is: what are the conditions for existence of associative division subalgebra $A$ of $C$ with $dim_F A = 4?$
Of course, it is necessary for $F$ not to be algebraically closed. It also seems to me that it's not possible for $A$ to be a field because of its dimension and $A$ being a composition algebra, so $F$ must be infinite by Wedderburn's theorem.
I'm also wondering if $A$ is unique, because there may be more than one division composition algebra of dimension $4$ over $F$, but I'm not sure that all of them can be proper subalgebras of $C$.
Let's consider this subspace of $C$:
$
  V = \left\{\begin{pmatrix}
   0 & 0 \\
   \alpha & v \\
  \end{pmatrix}|\ \alpha \in F, v \in F^3\right\}.
$
It's easy to see that $dim_F V=4$ and $V \cap A =0$ because every element of $V$ is not invertible, so by dimension counting we have $V \oplus A = C$.
We also have $F \subset A$, so i think $A$ must look like
$
  A = \left\{\begin{pmatrix}
   \beta & u \\
   \varphi(u) & \beta \\
  \end{pmatrix}|\ \beta \in F, u \in F^3\right\},
$
where $\varphi$ is an invertible linear map of $F^3$ satisfying certain identities (for example, $\varphi(v) \cdot u = v \cdot \varphi(u) $ , where $\cdot$ is the ordinary dot product — it can be easily obtained by multiplying elements from $A$ and comparing results).
For example, quaternions are the only division subalgebra of split octonions, and they can be represented (with multiplication mentioned above) as $
  \mathbb{H} = \left\{\begin{pmatrix}
   \alpha & v \\
   -v & \alpha \\
  \end{pmatrix}|\ \alpha \in \mathbb{R}, v \in \mathbb{R}^3\right\}
$ ,
where $\varphi(v)=-v$.
So, that's another question: am I correct about the construction of these division subalgebras? If yes, what else can we say about $\varphi?$
Sorry for my poor English and LaTeX skills.
Thank you in advance.
Answer: It seems likely to me that an exhaustive answer to your question would fill in a couple volumes. I will write a summary of a point of view I know about. Others can hopefully shed more light.
Let $D$ be a 4-dimensional associative division algebra over its center $F$. Assume that $char F\neq 2$. If $a\in D\setminus F$, then $E=F(a)$ is a Galois extension of $F$ (this was the reason, why I excluded characteristic two). As the minimal polynomial $m(x)$ of $a$ over $F$ is quadratic, both its roots are in the field $F(\theta)$, where $\theta=\sqrt d$ and $d$ is the discriminant of $m(x)$. Therefore $E=F(\sqrt d)$ is Galois, and $\sigma:\theta\mapsto -\theta$ gives the non-trivial element $\sigma$ of the Galois group $G=Gal(E/F)$.
Because $D$ is a central simple $F$-algebra, it follows from the Skolem-Noether theorem that $\sigma$ can be realized as a conjugation by an element $u\in D^*$, i.e. for all $z\in E$ we have
$$
\sigma z = u^{-1}zu,
$$
or $u\sigma z=zu$ for all $z\in E$.
Consequently we also have
$$
u^{-2}zu^2=u^{-1}\sigma(z) u=\sigma^2(z)=z
$$
for all $z\in E$, so $\gamma=u^2$ commutes with all of $E$.
The element $\gamma$ thus commutes with $E$ and it obviously
commutes with $u$ also. As $u\notin E$, we see that
$\dim C_D(F(\gamma))\ge3.$
The double centralizer theorem
states that
$$
\dim F(\gamma) \cdot \dim C_D(F(\gamma))=\dim D=4,
$$
so the only possibility is that $\gamma\in F$.
The element $u\theta$ cannot be in the $F$-span of $1,\theta,u$ for then we would have $u\in E$. Therefore $\{1,\theta,u,u\theta\}$ forms an $F$-basis of $D$, and $\{1,u\}$ is a basis of $D$, when viewed as an $E$-space with $E$ acting from the right. The left regular representation of $D$ thus gives rise to the following homomorphism of $F$-algebras $\rho:D\rightarrow M_{2\times 2}(E)$
$$
\theta\mapsto\pmatrix{\theta&0\cr0&-\theta\cr},\qquad u\mapsto\pmatrix{0&\gamma\cr1&0\cr}.
$$
The image of this homomorphism consists of the matrices of the form
$$
A=\pmatrix{z_1&\gamma\sigma(z_2)\cr z_2&\sigma(z_1)\cr}
$$
where $z_1,z_2\in E$ are arbitrary. As $D$ is simple, the homomorphism must be injective.
When do we get a division algebra from the datum $(E/F,\sigma,\gamma)$? The only thing we need to check is that all those matrices are invertible, i.e. the determinants are non-zero. Here $\det A= z_1\sigma(z_)-\gamma z_2\sigma(z_2)=N(z_1)-\gamma N(z_2)$, where $N:E\rightarrow F, z\mapsto z\cdot\sigma(z)$ is the norm map. We see that (assuming that $A\neq0$)
$$\det A=0\Leftrightarrow N(z_1/z_2)=\gamma.$$
We have proven.
Theorem. The above construction gives a 4-dimensional division algebra with center $F$, iff $\gamma\notin N(E^*)$.
Thus the answer I offer reads. There exists a 4-dimensional associative division algebra with center $F$, if the field $F$ has a quadratic Galois extension $E$ such that the norm map $N:E^*\to F^*$ is not surjective.
This condition is clearly sufficient also, when $char F =2$. We showed that it is necessary, when $char F\neq2$.
The task of classifying those 4-dimensional associative division algebras is a formidable one. For number fields it is known that there will be infinitely many non-isomorphic associative division algebras like htis. A more precise answer in that case is given by global class field theory. I am the wrong person to say more about that. I am also the wrong person to say whether the above condition is necessary also in characteristic two. I would think that we can always find a separable quadratic extension of $F$ inside $D$, when the above argument would go through??
Note that the determinant of the representation of $D$ as 2x2 matrices over $E$ always gives you a multiplicative norm $N:D\to F$ (as required in the definition of a composition algebra).
Comment: But a big question that I cannot answer is, whether all the algebras I described can be described as subalgebras of a Cayley-Dickson algebra? I think so, because this looks a lot like a (generalized) quaternion algebra, but I'm off to bed, now.
Comment: Yes, it seems to be that all 4-dimensional division algebras must be generalised quaternions; I found some information about that in Cohn's _Algebra, Vol.3_. Theorem there states that every division algebra possessing a two-dimensional split field must be quaternion algebra. It's also interesting to notice that your proof mirrors the proof of Frobenius theorem once given to me, except for Galois Theory — I'm still not familiar with that.
Comment: But still, it would be interesting to find a way to represent these generalised quaternion algebras (in this case it's easier to identify them, because if restriction of norm to this subalgebra is nondegenerate, then it must be a generalized quaternion algebra) as proper subalgebras of $C$. Construction suggested above _seems_ to be right, but I think there must be a way to describe $\varphi$ explicitly. Since the expression for $C$ norm remains the same in $A$, $\varphi$ must have something to do with «native» norm in $A$.
Comment: And yet another comment, I realized that I still can't vote up your answer. So… Thank you, @Jyrki :)


Use of the adjective "young" in the comparative form

Question: Is correct to use the adjective "young" for objects? For example, in a sentence like this: "This painting is younger than that one.", I think it would be better to use "new" for "painting", but then, using the comparative form "newer" doesn't seem appropriate either. So, my question is: Is "This painting is younger than that one." correct?
Comment: This painting is more recent than that one.
Comment: @Giselle Trajano Generally, for objects we use "newer" and "older".  And with paintings, we sometimes use the word "work" instead of "painting". "This is one of Monet's newer works".
Comment: "Younger" is usually associated with age of something. If you Google search "define newer", the very first thing you see would be "comparative adjective" in the results. So "Painting B is newer than Painting A" is correct
Comment: For a painting I would use "newer" or "more recent".
Answer: To answer the question, yes it is still correct. However it can be more ambiguous than "newer"
If you want to explicitly reference the chronology of things, using younger can sometimes be ambiguous. For example:
<code>Her recent paintings lack the depth and allure of her younger works.
</code>
In this case you can see that younger is referring to something further in the past, not closer (and is interchangeable with "older" strangely enough)
Using "most recent" or "newest" is probably the least ambiguous way to explicitly communicate that the painting has no peers created after it was.


What is the origin of the phrase "bush league"?

Question: I know it's baseball terminology, but I've never heard anyone explain why a feeder or low-level league is associated with shrubs.  Is there some relation in the phrase to "farm system"?
Comment: GR: http://www.etymonline.com/index.php?allowed_in_frame=0&search=bush+league&searchmode=none - via "Bush" In British American colonies, applied from 1650s to the uncleared districts, hence "country," as opposed to town (1780);
Comment: What does your research show, Jim?
Comment: Kirstina, my research discovered the first half of the definition from Etymonline (small-town baseball leagues), but not the second half, which Choster did a nice job of elucidating.
Answer: According to Etymonline,

"mean, petty, unprofessional," 1906, from baseball slang for the small-town baseball clubs below the minor league where talent was developed (by 1903), from bush (n.) in the slang sense of "rural, provincial," which originally was not a value judgment.

In other words, we're speaking not of bushes, but of the bush:

1) an uncultivated or sparsely settled area… 2) the countryside, as opposed to the city.

Americans do not commonly refer to rural areas as the bush these days (though Australians and South Africans do), but we do speak of the sticks, the boondocks, and the backcountry among others— "places" which are in the middle of nowhere, and as a result whose natives lack refinement in etiquette or skills.
Bush remains in baseball, but it seems only as a pejorative.
Comment: @mplungjan It was better to put it as an answer, not a comment.
Comment: I already posted that in a comment
Comment: It was better ignored as a General Reference :) and citing the same  reference as I did, did not add much in my opinion
Answer: Here is the entry for "bush league" in Paul Dickson, The Dickson Baseball Encyclopedia (1989):

bush league 1. n. Lesser minor league teams in small cities or towns, such as when a player has slipped from "the big leagues to the bush" or one who has "just come up from the bush league."
ETY[MOLOGY:] From the nickname for the lower levels of the minor leagues, which were traditionally typified as out where the bushes grow, where all the land has not been cleared.
2. adj. BUSH [that is, "unprofessional, unsportsmanlike, amateurish"]
1ST [OCCURRENCE] 1908. (Sporting Life, February 10)

As noted in choster's answer, Etymology Online traces "bush league" in the sense of small-town baseball clubs to the year 1903. However, an Elephind newspaper database search for "bush league" turns up several instances of the term from the turn of the century. First, from "Ten on the Ground," in the Kansas City [Missouri] Journal (April 4, 1899):

"Notwithstanding the weather conditions that have prevailed for the past twenty-four hours, several of the Blues reported for the regular spring practice yesterday morning," said Old Sport last night. I was on the ground myself, but I can give you every assurance that the snowy sheet that covered Manning's lot was not marred in its virgin whiteness by the cruel foot of any member of the coming champions. The boys passed the time telling pipe dreams of the past winter and the contracts they were offered by the Bush league, but were prevented from accepting on account of their filial affections for the greatest baseball town in the West.

And from "Where They Are: Gossip of Old-Time Western League Players Gone from Here," in the St. Paul [Minnesota] Globe (June 10, 1900):

In the Western association there are quite a number [of former Western League players]. ... But we are not able to find the names of Jack Pickett, Lou Camp, Pepper, Eddie Boyle, Mullane, Tim O'Rourke, Lefty Marr, Tacks Parrott and many others who have either quit or torn for the "Bush League." When you stop to think, they come and go pretty fast. Of the Western players who went to the big league this spring not much can be said.

And from "Prairie Baseball: Where the Game Is Played to Enthusiastic Galleries: Great North Dakota League," in the Minneapolis [Minnesota] Journal (August 19, 1901):

To see a typical "bush" league, Minneapolis fans should go out to North Dakota, out on the wide, endless prairies, where trains are sometimes seen three times a week, where a town of 2,000 is a metropolis, and where managers fall dead when they see 200 "paid admissions" in the baseball park.For all that, the North Dakota league will furnish some of the more pretentious teams with some fast players and there is more than one embryo National leaguer out on the prairies of the flickertail state.
...
The ladies [who attend games] are fully as enthusiastic as the men. They understand all the intricacies of the great sport and "root" loyally and heartily. They come to the games decked out in the club colors, with horns and other instruments for manufacturing noise, and the small boys often bring tin cans full of stones, a device for "rattling" the opposing pitcher.

Four additional articles in the Minneapolis Journal or the St. Paul Globe mention "bush league" baseball through the end of 1901; and by 1902, a new minor league seems to have acquired the nickname "the Bush league." From "Sioux City's Decision: Its Club Will Enter the New North Tri-State League," in the Minneapolis [Minnesota] Journal (February 20, 1902):

Sioux City, Iowa, Feb. 20.—W. E. Lockhart, C. E. Hughson, Henry Metz and D. E. Kirby, promoting baseball in Sioux City, at a meeting yesterday afternoon decided not to accept the proffer of a berth in the Western League. Instead, Sioux City will belong to the North Tri-State League, composed of Rock Rapids, Sheldon, LeMars, Iowa; Flandreau, Yankton and Sioux Falls, S. D., generally known as the "Bush League."

All of these early newspaper accounts come from cities (Kansas City, Minneapolis, and St. Paul) that hosted teams in the Western League—a step down from the "big league" (the National League) but considerably larger than even the largest of the Northern Tri-State cities. Although the 1899 reference to "the Bush league" as a place where Western League players might hope to receive relatively appealing contract offers seems utterly bogus, the league itself is treated as so remote that it seems rather exotic.
Subsequently, though, the league's environment comes into focus, with rudimentary field conditions and rowdy crowds trying to rattle opposing teams' players. The pejorative sense of "bush league" as amateurish or unprofessional surely flowed from the real or imagined conditions in small towns like those in the Northern Tri-State League around 1900.
On the basis of the Elephind newspaper database search results, it seems very likely to me that "bush league" as a term originated during the very late nineteenth century, in the U.S. Midwest, in a region bounded by Kansas and Missouri in the south and North Dakota and Minnesota in the north.
Answer: I've been working with Paul Dickson to antedate earliest uses for a possible new edition of the Dickson Baseball Dictionary. The two earliest I've found for "bush league" are from January 1896:
"The baseball public has been very kind to me. But I could not get my price here, and, as I could not go to any club playing under the national agreement, I must go into a 'bush' league." Ted Breitenstein, quoted in St. Louis Globe-Democrat, January 13, 1896, p9
"The Southern Illinois league consists of Belleville, Cairo, East St. Louis, Springfield, Edwardsville, Chester and Sportsman's Park, St. Louis. It is a 'bush' league, outside the pale of the national agreement." Rockford Daily Register-Gazette, January 15, 1896, p7
Answer: Can't speak to accuracy, but I played ball all the way up to a reasonably high level, eventually down south. I remember vividly what we all thought it meant from what everyone told us down there (TN, AL, TX, MS, etc.)... The imagery was just too funny to forget: "bush league" was ball played at such a low level the management couldn't afford to rid the outfield of weeds and small bushes. Bushes could also include those used as an outfield wall, especially when the dimensions and location of the infield was built around a natural barrier.
Comment: add citations if you please.  It will increase the value of your answer.
Answer: Bush League is an old baseball reference.  It does make reference to baseball played not in the traditional professional or feeder systems.  The Bush Leagues was the reference to the black only leagues in the country deriving from the term Bushmen.  Bushmen is the slang term used to refer to the indigenous South African group called San. The term became popular as an insult in the white leagues to suggest a player or team was lesser.


How to modify the shell environment seen by apps initiated via desktop?

Question: Suppose that some random program Foo

modifies its behavior according to the values of environment variables; and
can be started by clicking on some Foo icon available through a graphical desktop.

Let's assume, for the rest of this post, that every instance of Foo under discussion was, or will be, started as described in (2) above.  IOW, for this post, rule out the possibility of starting Foo via some command line.
For concreteness, let's also assume that the current X11 session was started "manually" by the user; i.e. by typing startx on the (text interface) command-line at some point after a (text-interface) login 1.

Now, AFAICT, by default, the environment inherited by every instance of Foo is the one in place at the time the user executed startx2.  (Please, correct me if I'm wrong.)
My question is: Is there some generic way (i.e. independent of Foo) for me to modify the environment inherited by subsequent instances of Foo (or at least by the next instance of Foo that gets started)?

Anticipating the possibility that the answer to the (general) question above is "No", below I provide some specific details, in the hope that the more specific variant of the question will have the answer "Yes":

at the moment I'm particularly interested in the case where Foo happens to be Terminator (a terminal emulator);
my shell is zsh;
my desktop is xfce4 + xfwm4.

1If the answer to this question would be different if X11 session was started automatically after the user logged in via a graphical login, please let me know.
2Or perhaps it would be more precise to say that the inherited environment is that consisting of the exported shell variables, and their values, as they were when the user invoked startx.  I expect that even this more carefully worded description is, at best, an oversimplification, but I hope not such an extreme one as to render the rest of the post moot.
Answer: If you are starting your program from a link on your desktop, you can modify the link file to include your desired variable and value.  I'm not experience with zsh (yet), but I think you can still modify the link simply by adding env VAR=VAL at the beginning of the Exec value in the link.  For further reading I've found an ArchLinux article explaining a lot of the entries in a desktop file.  This is an Arch article, but the format of these files is standard accross distros.
You may also be able to modify this variable for your whole session using your window manager.


Install printer driver for a wireless Canon Pixma MX340 on Fedora 21

Question: How do I install and configure a wireless Canon printer on Fedora - specifically a PIXMA MX340 on Fedora 21? I've searched around and found that Canon provide RPMs for this printer but they're very out of date and are only 32bit
Comment: This question does not make sense.  You say you searched and the only drivers you found were out of date, then 4 minutes later you indicate you performe a quick search and discovered them the link to a personal blog which I assume has links to the drivers.  This seems like an attempt to drive traffic to your blog.
Comment: @Ramhound The user is saying he searched probably because he already knew the answer and had to write a question about the problem. (See: http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/)
Comment: @slhck - I have no problem with self-answered questions.  I just have a problem with self-answered questions, which indicate the author looked for a driver but found no results, then 4 minutes later submitting an answer saying they performed a search and located them.  If the only thing it contained was the first sentence, which is a question, I would find the question helpful instead of confusing.
Comment: @Ramhound I was just trying to help other people who had the same issue. I found plenty of posts about how to force the Canon drivers to work at great difficulty. After finding the solution with gutenprint I decided to write a quick blog article and then record the solution here too as a self answered question. I'll leave the link off next time. I don't think I deserve to be down voted by doing something that StackExchange supports
Comment: @AndrewDwyer - Which is the reason I didn't down vote your answer only your question because of the approach you took, I shared my concerns with how the question is written, easy enough to address those concerns.  The answer no longer has a link to your blog, it was self contained, and thus is a decent enough answer so it is helpful.
Answer: I did a quick yum search canon and found gutenprint-cups.x86_64 : CUPS drivers for Canon, Epson, HP and compatible printers. A quick google shows me that my printer is supported.
Just install the package:
sudo yum install gutenprint-cups.x86_64
Then add the printer from the system settings by entering the IP address. If the printer is on the system should be able to find it. Just select it and find the model number in the list of canon printers provided by Guten Print.
Comment: @duDE - Technically its more of an answer then a comment except it also appears to be an attempt to draw traffic to the linked website which happens to be the author's blog.  I don't disagree the anwer should sustain itself and it currently does not do that.
Comment: @AndrewDwyer I agree with Ramhound, there is no need to include the link to your blog, since you answer would be equally complete without it.  Then add to that the lack of effort shown in the question...
Comment: -1 because this is not an answer. Write it as comment please.
Comment: We have a regular Stack Exchange user here, and I don't see any bad intentions. Andrew clearly found a solution that he wanted to share with others. The purpose of this post does not seem to be to draw traffic to the blog. I agree the link is not necessary though.


A very general complex torus is simple

Question: Let us parametrize the set of lattices inside $\mathbb{C}^g$ with the open dense subset $U = \text{GL}_{2g}(\mathbb{R})$ of $\mathbb{R}^{4g^2}$. Does there exist a countable family $(Z_n)_{n \in \mathbb{N}}$ of algebraic real hypersurfaces of $\mathbb{R}^{4g^2}$ such that for every matrix $M \in U \setminus \bigcup_{n \in \mathbb{N}} Z_n$, the only complex subtori of $X = \mathbb{C}^g/\Gamma_M$ are $X$ and $\{0\}$?
Answer: I think yes. Let $J$ be the complex structure on $\mathbb{R}^{2g}$. Let $L$ be the lattice. Then there is a complex subtorus if and only if $L$ intersects some complex-linear subspace in a full sub-lattice. Thus, there are no complex subtori if and only if for all $x_1,\dots,x_k\in L$ there do not exist $y_1,\dots,y_k\in L$ such that $$\textrm{span}\{x_1,Jx_1,x_2,Jx_2,\dots,x_k,Jx_k\}=\textrm{span}\{x_1,y_1,x_2,y_2,\dots,x_k,y_k\}.$$ This is countably many real-algebraic conditions.
Comment: Some linear independence conditions probably should be thrown in for good measure. Also, clearly $k<g$ as otherwise we would get the whole space.

A very general complex torus is simple


Create product with json request using SOAP API in magento

Question: How to create simple product with json request using SOAP API in magento?
Answer: That's a very vague, broad question. You're asking for an entire lesson on Magento flow and implementation. What have you tried to far? What exactly is the problem you're running into right now?
I reckon there's a route to a controller somewhere that takes a data array which will create a product from that data.


definition of uniform motion

Question: uniform motion means equal distance in equal intervals of time. Suppose, a particle travels on a straight line with constant acceleration, than can we say, in this case, uniform motion can be equal displacement in equal intervals of time instead of equal distance in equal intervals of time?
Answer:
Uniformly accelerating motion refers to a state of motion that accelerates at a constant rate in a single direction. Gravity is an example of uniform acceleration; an object in free fall accelerates at a constant 9.8 meters per second per second towards the center of the gravitational field.

Uniform motion describes the situation that occurs when an object travels in a straight line in uniform motion, the distance it has traveled can be calculated by multiplying the velocity by the time it took to travel the distance. Any object that moves with deviations in its speed or direction is said to be undergoing non-uniform motion.

They are not the same concept.
Comment: so basically i can replace distance with displacement in the definition, if the particle is traveling on a straight line?
Comment: Distance is when   your dog runs in a mad dash all around the garden, around every single thing  there and then stops at a tree 10 metres from the house and waits for you there. Displacement is  **just** the straight line distance you have to go to the tree , 10 metres, to get him. So your dog has run a distance of 25 metres, you have undergone a displacement of 10 metres. But don't forget, if you go 5 metres to your left, and turn around and go back 5 metres to your start point your displacement is zero, but your distance is 10. Look at the graph axis in the both definitions.

definition of uniform motion


Difference between +1+1 and +1+1 counters

Question: Is there a difference between creatures receiving 2, +1+1 counters and recieving +2+2. My problem is that Jarad, Golgari Lich Lord recieves +1+1. But if I also have Corpsejack Menace, would that double the amount of power and toughness received?
Answer: The short answer is yes, they're different. Changes to power and toughness are effects that can be caused by a bunch of different things. Jarad gets a boost based on the number of creatures in the graveyard, there are abilities that let you spend mana for boosts (e.g. firebreathing), and there are spells that do it, typically until end of turn.
A +1/+1 counter is a counter that provides a +1/+1 effect. You can represent it by placing a physical counter of some kind on the creature. With Corpsejack Menace, you place twice as many counters.
Jarad's boost does not mention counters anywhere, so you do not get any benefit from Corpsejack Menace.


Why do vapour cones appear for such short periods of time?

Question: Is it just because the air they are going through is more humid than the surrounding air so when they leave that patch the cone disappears?
Comment: [How are condensation cones created by supersonic airplanes?](https://aviation.stackexchange.com/q/9724/3201)
Answer: You'll want to check out NASA SP-514.  In particular Chapter 2.
The vapor cone you see is actually a cloud.  It is condensation of vapor into tiny water droplets when the temperature and pressure are just right (based on the local humidity).
So, changes can occur due to local changes in humidity and temperature -- but the biggest effect is changes in pressure due to the aircraft.  For example, sometimes the condensation only occurs when the aircraft is "pulling g's" -- it is highly loaded during a turn or other maneuver.  During this state, the aerodynamics are working hard -- which leads to more extremes of pressure and a greater likelihood of condensation happening.  However, the pilot doesn't sustain that maneuver for a long period, even relaxing a slight amount can make the condensation vanish.
Answer: Also note that the precise conditions required to produce a cone cloud of condensate right behind a shock front are transient- they disappear quickly after the shock passes as the ambient air strives to come back into pressure and temperature equilibrium.


Which dates are optimal for monthly rebalancing of a futures portfolio?

Question: As there are microstructure issues with the commodity market, e.g. the Goldman roll, is there any research on when it is optimal to monthly rebalance?
Answer: Yes, considerable. My old firm did loads of it. However knowing that the research exists is not the same as getting hold of it or using it.
In general we could say that it is going to be a good place to start by avoiding periods where there is limited liquidity. In many commodity futures contracts, these are usually seasonal. In general I can also tell you that there isn't one point every month that is a "good" time in this respect, and in many cases it isn't even every month.
My old firm took the approach of rebalancing the portfolio every night after all the settlement closes were known, and then treating rolling out of "soon to expire" contract expiries as separate issues. The contract "rolls" were at most monthly, and at least 6 monthly. This approach is fairly straightforward to engineer into an algorithm that can be consistently applied and backtested on historic data.
To avoid "churn" on limited liquidity contracts, the portfolio rebalance trades were subject to some histeresis. That is to say, we set minimum trade size thresholds and didn't trade until these were exceeded. This saved trade costs vs holding optimum positions, but in some markets this was a net positive.


How can I explain C# interfaces, and constructors to a 8 years old kid?

Question: How can I explain C# interfaces and constructors to a 8 years old genius kid?
Comment: Are you trying to say that you are an 8 year old genius? Where are my hover cars?
Answer: I would get them one of these toys:

And would make an analogy that the yellow piece on top has holes in it with a specific shape, and the shapes that you are allowed to pass through these holes is a concrete type of that shape. The interface, although is not creating any action on the shape, implies that the shape has to have a few characteristics, like size, how many sides, is it round, etc.
As for the constructor, I'd tell them it's the "recipe" + action of building one of these little toys: (a) It's something that is specific for that type of toy; (b) it can be applied to other toys that are similar to first toy; (c) I can build it slightly different next time, like changing the color or having it's height different from the original height; etc.
So after these analogies, I could point to the code (assuming you're showing code to your kid) showing the interface not interfering with the concrete class behavior, tells the class some of the features it should have, and the constructor of the class is the subroutine of building that type.
Makes sense?
Comment: +1, Brilliant analogy. I look forward to teaching my daughter using this one day!
Answer: You point the kid to the appropriate MSDN pages. If he's a genius, it'll suffice ;)
Otherwise sit down with him, write some simple code showcasing both. The same console examples you would show a grown-up. Nothing fancy, just some lines printed in constructors to show how an object graph is created and maybe the classic animal example for the interfaces (the one with different animals implementing a Speak or Move method).
If the kid is genuinely interested in programming, that will keep him entertained. If he'll lose interest after a few minutes, let him be. Have a normal childhood. Give him the "interface talk" when he'll grow up a bit.
Answer:
Interfaces - the bumps on Lego/Mindstorm pieces, allowing you to connect bits to each other easily
Constructors - A method that prepares the object for usage, so perhaps a cooking analogy is a good one. Adding boiling water to soup powder in order to make soup?
Comment: Continuing with the Lego metaphor, constructors would be the instruction booklet.
Answer:
Interfaces - The buttons and the volume tuner from the 90's on a TV - the part you use for interaction. You can change or the fix the internals of your TV when it breaks after the 2 year warranty is over while leaving the interface intact.
Constructor - A special method that gets called every time the object instance from a class is created (If you're explaining interfaces to him(?) than he propably knows what an object and a class is).


Any differences between 'fund' and 'funding' when used as a noun?

Question: Are there any differences between fund and funding when used as a noun? They seem both to have a meaning of "money made available for a particular purpose", and I was wondering why we need "funding" when "fund" means the same. Is it because "funding" is the gerund of the verb form of "fund", and therefore more emphasizes on the action than fund(n.) does?
Comment: Actually, due to [blocking](http://en.wikipedia.org/wiki/Blocking_(linguistics)), they couldn't mean the same thing no matter how hard they tried.
Answer: A fund is an existing collection of money. Funding is the source of that collection. In other words, funding is the money coming into the fund. They can often be used interchangeably, but they do mean slightly different things.
Comment: Nearly, but I don't quite agree. I would say that _funding_ is rather the situation that the fund exists. To me _our funding_ doesn't mean the bank, donors or whatever, it means the state of affairs, or the arrangement, by which funds are supplied to us.
Comment: @ColinFine I agree with both of you but, to me, the main difference is that "the fund" that can be drawn on exists either as a physical collection of money or a  balance on an account while "the funding" includes, or consists entirely of, money which is pledged or committed to the purpose but has not actually been transferred to the control of those carrying out the purpose. For instance a community group may have _the funding_ for a new playground from the council but the actual payment will be made by the council when the work is done. Also only 'fund' can take an indefinite article.
Comment: @ColinFine I've just had another thought. A "fund" can be empty if it has only just been set up. It can have been defined legally or exist only as a new bank account but not, as yet, received any donations. When funding has been secured (for instance from a local authority as above) money can be drawn against it as soon as the terms of the funding arrangement have been met. If the community group are going to collect for a new playground they can't start the work until the fund contains enough money but if they have funding from the council they have no money but they can start work.
Answer: Consider some of the following sentences:
Fund/funds
The school has a building fund for repairs.
Funds are available to start a business.
The church has a fund to assist the homeless.
I shall make the purchase as soon as I am in funds.
Mike has a fund of anecdotes which he uses at social events.
There is no money left in the fund.
Funding - as a gerund
We will start the work as soon as we get funding.
Funding for the project may be difficult to obtain.
Funding has been approved.


Cichlid fish in Africa

Question: Are the cichlid fish in Africa an example of divergent or convergent evolution? On the one hand they have evolved similar features to each other indicating convergent evolution, but on the other, they formed as a result of an adaptive radiation which indicates divergent evolution.
Comment: Writing "convergent evolution" in google images is one of the most fascinating pages out there: https://www.google.fr/search?biw=1572&bih=857&tbm=isch&sa=1&ei=-9bBW5fILoi6ac7ltrAC&q=%22convergent+evolution%22&oq=%22convergent+evolution%22&gs_l=img.3..35i39k1l2j0l8.72634.74183.0.746220.127.116.11.0.0.0.90.126.96.36.199....0...1c.1.64.img..0.2.166....0.iTe5In6n1qg#imgrc=7pBcz3R6hTpCHM: ........ and ..... https://www.google.fr/search?q=convergent+evolution+in+fishes#=100&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjk0OLMp4PeAhUIz4UKHXnRDOgQ_AUIDigB&biw=1572&bih=857#imgrc=u293tbb5Xe8mzM:
Comment: The level of lake malawi has dropped by 200 meters at least 20 times in the previous 1.3 million years, forcing them into small lakes, and there are lots of theories about "cichlid evolution" on google, including a 54 minute talk video. Fish have a lot of convergent evolution too, there are kinds of holotype fish forms which appear again and again in different continents and different seas, the same as an australian and european magpie. Cichlids are similar to many species like snappers, even dolphins are said to be convergent with sharks.
Comment: They have diversified to fit into many different niches.
Comment: You might want to read about [adaptive radiation](https://en.wikipedia.org/wiki/Adaptive_radiation)
Answer: Both.

Recent theoretical models, however, predict that convergence should be common within species-rich communities, such as species assemblages resulting from adaptive radiations. Here, we present the most extensive quantitative analysis to date of an adaptive radiation of cichlid fishes, discovering multiple instances of convergence in body and trophic morphology. ...

Independent adaptive radiations often produce convergent phenotypes
In Lake Tanganyika, convergent phenotypes evolved within a single adaptive radiation
These convergent morphologies are associated with adaptations to the same niche
Distantly related yet morphologically similar species coexist in the same habitat

--Convergent Evolution within an Adaptive Radiation of Cichlid Fishes

Cichlid fish in Africa


Member not found IE error (IE 6, 7, 8, 9)

Question: Let me just first point out to any IE users right now (this is not a problem in Chrome, Safari or Firefox)  hint hint ;)
So... I have a issue with my tooltips in IE, I have a onmouseover listener for all the elements which are to be hoverable and then in my mouseover function I have a very basic cross browser declaration as such...
var event = e || window.event,
    el = event.target || event.srcElement;

I've been having issues with the window object not existing in IE or something, this has been a issue after I added a flag to ignore mouseover's from one element mouseover on the way to the tooltip itself (during the time cycle allowed, 300ms).  In other words the flag is to ignore mouseovers on route to the tooltip from the original mouseover.
So that logic looks like this...
loadtip.refMouseOver = function (e) {

    var event = e || window.event, el = event.target || event.srcElement;
    //console.log(window); // <-- throws error in IE (Member not found)
    // Reset the lastHoveredRef data.
    tipManager.lastHoveredRef = null;
    tipManager.lastHoveredRef = [el, event];

    // true means there is a tip open still, so if no tip is open.
    if (tipManager.tipState !== true) {
        tipManager.processTip(el, event);
    } else {
        return; // do nothing
    }

}

The "Member not found" error will occur when I hover from one element quickly to the next in IE with the tooltip still open.
I read about window.open and close stuff with a try catch but I didn't see how that was relevant.  Any help is greatly appreciated.
Answer: Ok I have found the problem.
To sum it up, basically IE will not pass a event to another function if that function call is within a setTimeout.
So you can trick IE by creating a copy of the event and passing that, here is a example of that...
var eventCopy = {};
for (var i in event) {
    eventCopy[i] = event[i];
}

Then just send your function the eventCopy, even though this is a 'total' hack.
setTimeout(function () { yourFunction(eventCopy), yourDelayTime);

And voila it will work.
I should add, that Internet Explorer will merely create a reference to the global window event which is why we need the copy of event.  This is because by the time setTimeout calls the function, windows.event has already passed,
Bottom line... don't try to send a event inside a setTimeout because IE won't accept it.  This is true for IE 6, 7 & 8 from my testing.
Answer: I realize this question/answer is pretty old and seems to be resolved. That being said, I have another alternative I've used to handle a similar -- yet slightly different -- issue with 'Member Not Found' in IE versions prior to MSIE 9.  I hope this helps someone out!  ...this can also be used to work around issues with Firefox not having window.event.
First I extended jQuery and added a function to get the MSIE version or -1 if the browser is non MSIE.  You can do the same or just create a pure JS function to accomplish this.  Then create an event override function (it might be necessary to add a global 'event' variable in some cases), that's more of a per individual situation basis.  Then override the event in your event handler(s) as needed.
Extending jQuery
// So this will give you the version of IE (or for non IE browser -1)
$.fn.msieVersion = function()
{
    if ( navigator.userAgent.toLowerCase().indexOf( 'msie' ) !== -1 ) {
        return document.documentMode;
    }
    return -1;
};

Override the global event
var setEvent = function( evt ) {
    // Set the event if MSIE version is >= 9 or is -1 which means it's not IE
    if ( $.fn.msieVersion() >= 9 || $.fn.msieVersion === -1 ) {
        // NOTE: I have a global 'event' variable I'm using that comes from another previously loaded JS file
        // Why? I didn't do it. I'm updating some SUPER old code the best I can. (old enough it has references to Netscape....)
        event = evt || window.event;
    }
    return true;
};

Usage Example
$( 'img.myImageID' ).bind('mouseover mouseout', function ( evt ) {
    setEvent( evt ); // Override the event
    // DO WORK! ...continue all other awesomeness here!
    // Maybe setTimeout(...)
};


What will be a good microphone to record folding clothes?

Question: I have been trying to record folding clothes with a zoom H2 and obviously I get more noise than the signal and then when I try to eq the noise the signal also get very weak. What would be a better microphone to record this at home?
Thanks,
Answer: Are you trying to do this as foley? If so, I would say to stop "folding" the clothes and do more handling noise. Rub the fabrics together, snap them, get any kind of louder sounds you can out of them. These will be far more useful to you as a source of foley, as you can always decrease their volume to have them better fit what you're mixing them in to.
Answer: I'm assuming this is for sound to picture? Because chances are that your folding sounds in your mix will also be pretty soft compared to the rest of the sounds and so you don't need to crank up the gain. If you only have a Zoom H2 at hand then you can easily make that work for you.
Also, if you want to have the sound of folding cloths, then chances are you do not need the actual sound of folding cloths, but pick louder fabric and "perform" them louder, then bring it down in your mix later. As I'm typing this, I see @Shaun just wrote the same thing... haha.
You can also use a parametric EQ to hone in the frequency of your noise. I know my mic/recorder setup usually gets that pre-amp noise around 10KhZ.
Hope this helps.
Comment: They say great minds think alike ;)
Comment: @shaun haha. Sir Shaun and Andrew - answering your questions in sync.
Answer: Here's a previous SSD thread that may help you a bit:
How to capture very low volume sounds?
Answer: Agree with the others, best to record louder sounds than trying to record sounds that are too quiet.
Quiet sounds = need microphone close = proximity effect, or distant = noise floor.
Answer: Solid, or even mediocre shotgun mics, I've found, are the best for recording that type of low dB foley.  If you're getting a lot of background noise, just build yourself a little "booth" and cover it with a blanket if you have to improvise.
Answer: In all honesty, this is a good example of Good Mic + Good Mic Preamp + Good A/D Comverters (+ Good Skill) = the sound you're looking for.  There truly is no substitution for a good signal chain.
Early on in my recording days I had a crappy Yamaha 16 channel mixing board and an Audio-Technica 4033 mic.  After a while I purchased an Avalon 2022 mic pre and Neumann U67 mic. After that Eureka moment of "ohhhhhhhhhh.....so THIS is what it should sound like" I never went back to cheap gear again.
Now, we all record with the best possible gear we can get our hands on and an unfortunate reality of our line of work is that we can never have enough variety of microphones, mic preamps, etc.  I would love to own one of everything but my wallet disagrees.
The louder the sound source the less "work" your mic and pre have to do.  That translates to less electrical noise in your signal chain.
Comment: Thanks a lot all! these were some really helpful suggestion, actually I am not recording a foley, this is for an art video installation and all thats happening in the video is clothes being folded and thats the only sound, and the idea is to bring these subtle sounds to audience's attention. You can see an example of what I am talking about here vimeo.com/13875345 But I guess I need to go to a quieter space and try using a shotgun instead since the sound needs to be fairly in sync with the actions.. thanks again! –