How do I set a custom zoom in Chrome?

Question: In IE 9 you can type in whatever number you want to get the perfect zoom but in Chrome all I see is the + and - in the drop menu.  How do I choose a custom zoom and set it as the default?
Answer: Update 01-Oct-2015: The Zoom extension suggested by Thomas Ploeger now also works with Google Spreadsheets. Remember to change zoom via extension button 'Z' right to the omnibox, don't try using Ctrl-+/-). If his answer helps you, go ahead and vote for it.
(For Google Spreadsheets specifically, it now has built-in Zoom feature as of 03-Dec-2017).
Another extension not mentioned here is Custom Zoom. Unlike Zoom, it:

supports keyboard shortcuts for Zoom In & Zoom Out
allows setting custom increment
don't have bloated Options that heavily advertise other extensions

Earlier answer (which also still works):
This solution by Ciprian Stan needs elementary HTML skills and  need re-doing it every time you restart Google Chrome. But unlike both extensions mentioned here I tried (Zoom and ZoomAll), it works even for Google Docs Spreadsheet--allows truly custom zoom levels.
It affect only zoom levels available for default zoom, but not the zooming increments in Wrench>Zoom or Ctrl-+/- behavior.

Open Settings in Google Chrome.
Inspect the zoom chooser element with the Developer Tools (right click -> Inspect Element).
  Expand the select and double click on any of the choice values (where you see value="1.1") to edit. Set the value of your choosing (e.g. value="1.15" for 115%). Then select the value from the list (the text may remain the old one, but it doesn't matter). When you close the settings and open them again, you'll find your value.
Comment: Worked perfectly, and most importantly, I didn't need to redo it after restarting Chrome (as suggested in the answer): it saved my 105% default zoom, and even still shows 105% in the Settings dropdown.
Comment: The manual method does _not_ require overwriting existing zoom levels. Just right-click the `Elements` panel in Dev Tools, then choose `Edit as HTML`. You may insert a completely new `` in between the two closest values. Once you actually select the new option one time from the `Page zoom` dropdown in `Settings`, it becomes part of the list used by `Ctrl`-`+` and `Ctrl`- `-` hotkeys.
Comment: This answer should be updated to say how to find the Web Content section of the dev tools.
Comment: @skylize I tried your method and it works great if you set the customized zoom option as default. However, if you then select another zoom option as default, the customized zoom option, though still in the list of the options at the settings page, won't appear in the list used by Ctrl-+ and Ctrl- - hotkeys, which is a pity.
Comment: It is crazy that this solution actually works but it does and it did exactly what I needed it to. My custom zooms disappear every time I open the zoom settings, but until I do, they remain an option.
Comment: This is a brilliant answer and exactly why superuser is so awesome
Answer: Background
The devs got a lot of pressure about implementing a built-in default-zoom function. They did implement this in version 10 and reports have confirmed that it works as far back as December, 2010.
Since verve asked this question in August, 2012, either you are using an extremely old version of Chrome (<10), or your browser did (does?) indeed have the function. The same goes for Thomas Ploeger; an extension should not be necessary.
Solution
If you are using an older version, then you need to enable tabbed-options to see the setting, otherwise it is not accessible (figure 2). You can either use the command-line option --enable-tabbed-options or toggle it in about:flags or chrome://flags (figure 3). If you are using a newer version (Chrome ~11+, Chromium ~12+), then tabbed-options is the default setting (actually, the only setting). Look for the the Page Zoom field in chrome://settings under the Web Content section (figure 1).
Work-Around
If you have to use a very old version that does not include tabbed-options at all, then you can try manually entering the setting (before the "exited_cleanly" entry) in the preferences file in your User-Data-Directory. However, there's two problems with this method. First, (for some reason) the setting uses floating-point numbers instead of a simple integer to represent the zoom-level. This makes it difficult to set it manually, but you can refer to the chart below (table 1). Second, a version that predates the inclusion of tabbed-options at all probably won't include the default-zoom setting anyway.
Caveats
In any case, you should be aware that the default-zoom setting (currently) only affects pages that you have not already zoomed. Any pages that you have modified the zoom for will not be affected by the new default scaling and will retain the previously assigned zoom setting. This is a nuisance because there is currently no way to modify the list of page/site-specific zoom settings, so you will have to manually set previously-zoomed pages to use the default setting.
Note however that simply zooming a page to 100% is not sufficient to reset the zoom for a page/site. To reset it, you can press Ctrl+Numpad-0 or click the magnifying glass on the toolbar and then click the Reset Zoom button. Another way to reset the zoom is to zoom it to match the current default-zoom setting. For example, if the current default zoom is set to 125% and the page has previously been zoomed to 110%, you must zoom the page to 125% to remove its page-specific setting. (This is actually a bug because if you then change the default zoom to 150%, the page will not retain its 125% zoom!)
 Appendices
Figure 1: Default-Zoom setting in newer versions of Chrome

Figure 2: Non-tabbed settings dialog in older version has no default-zoom setting

Figure 3: Enabling tabbed-options in about:flags (or chrome://flags)

Figure 4: Default-Zoom setting in Tabbed-options page of older versions of Chrome

Figure 5: Reset page-zoom to the default setting with the Reset Zoom (in case they fix the bug of zooming to reset)

Table 1: (Non-obvious) values for default-zoom settings in the Preferences file:
 25% :     "default_zoom_level": -7.6035680338478615,
 33% :     "default_zoom_level": -6.0311726618503405,
 50% :     "default_zoom_level": -3.8017840169239308,
 67% :     "default_zoom_level": -2.2293886449264093,
 75% :     "default_zoom_level": -1.5778829311823859,
 90% :     "default_zoom_level": -0.5778829311823857,
100% :     "default_zoom_level": 0.0,
110% :     "default_zoom_level": 0.5227586988632231,
125% :     "default_zoom_level": 1.2239010857415449,
150% :     "default_zoom_level": 2.223901085741545,
175% :     "default_zoom_level": 3.069389038663465,
200% :     "default_zoom_level": 3.8017840169239308,
250% :     "default_zoom_level": 5.025685102665476,
300% :     "default_zoom_level": 6.025685102665476,
400% :     "default_zoom_level": 7.6035680338478615,
500% :     "default_zoom_level": 8.827469119589406,

Comment: Is there no `110%` line in the `Preferences` file?
Comment: Using the most recent version of Chrome I would like to set default zoom to 110%. I see how to set 100%, 150%, ... but is there an option to do custom, such as 110% ?
Comment: Thank you for posting the default_zoom_level table
Comment: It's mind-boggling how they used logarithms of actual zoom ratios to the base 1.2 as `default_zoom_values` while not providing a 120% (1.2x) zoom at all.
Answer: There is a Google Chrome extension called Zoom which allows you to set custom zoom percentages via a slider, or by entering a certain percentage. It remembers the zoom percentages per website (like Chrome already does, but now you can at least set a custom percentage).
Chrome does not allow you to set a universal zoom setting as far as I am aware. But, to set a universal default zoom for all webpages (again, in a percentage of your choosing), you could use the Zoom All extension.
I would suggest you try these extensions, they might work for you.
Comment: Ugh, the extensions does not use same method as Chromes inbuilt zoom. They don't for instance work correctly pages with media-queries as Chromes own zoom does. I can't understand why Google didn't simply make the percentage number clickable so one could write own number there.
Comment: The extension does not work with pdf files.
Answer:
I'm looking way to set different custom zooms for specific websites (not for ALL websites) but I can't find a way to do it using Chrome settings. If you're looking to set a default custom zoom for all pages looks like some answers here could work.
As a workaround (other than installing an extension that does this) you could also try using javascript. Enter in your browser address bar and press Enter
javascript: document.body.style.zoom = 2;

This will double your zoom. You can enter any other zoom level you want.
You have to type the 'javascript' part, if you paste it chrome will remove it for security (you could type the 'j' and paste 'avascript: ..." which is allowed).
The downside is that it's not saved, you have to run the javascript each time you visit the page, but you can bookmark this, create a bookmark and write your javascript code instead of a url, then every time you click it it will run. This is called a bookmarklet.
This might not work sometimes, depending how the website was designed
Pro tip: If you want to write javascript code and run it automatically on a page every time you visit it, you could look into using Tampermonkey

Another bookmarklet you might find useful:
When you click it it increases the zoom by 25%, after 4 clicks it resets it to 1.
javascript: z = document.body.style.zoom; if(!z) z=1;
document.body.style.zoom = z<2 ? z*1.25 : 1;

I use it when I want to change the zoom temporarily, without the setting being saved. When I visit the page next time it will show me the normal zoom amount.
Comment: or `javascript: document.body.style.zoom = parseFloat(prompt('Set zoom level!'))` :) also if you don't want to use the mouse, you could press ctrl+L so it'll focus on the url bar, then type the first letters of the name you give to the bookmark and it will show up for you to run (I also run some bookmarlets on my phone's browser from the url bar. I mentioned one I use here https://android.stackexchange.com/a/129752/138255)
Comment: Added the option to set the zoom level manually with a prompt(): `javascript: var z = prompt('Set zoom level!');  document.body.style.zoom = parseFloat(z)`. This was EXACTLY what I was hoping for. It's the perfect solution for me. Now I also have a keyboard shortcut that takes my mouse cursor to the bookmark location, so I can zoom very easily, at will!
Comment: Does not work in pdf files.
Answer: you can try this Chrome extension, wZoom. It can customize custom zoom factors.
Answer: Zoomba simply let you set a desired % increment/decrement step and assign it to a keyboard and/or mouse shortcuts. Thus you can reach any custom zoom like 136% or 87% and since it uses the browser built-in zoom engine it will be automatically set as the default zoom of that particular website.
E.g. you can set 10% increment/decrement step and assign it to the default zoom shortcuts which are Ctrl++/- and Ctrl+mouse-wheel up/down.
And/or set 1% increment/decrement step and assign it to Ctrl+Shift++/- and/or Ctrl+Shift+mouse-wheel up/down.
Comment: It sounds like spam.  Is it your website ?
Comment: No, it's not. I just was a little bit excited after finding something which correctly works. I edit it and I hope it will be helpfull.
Answer: Easy solution

Open dev tools with command + shift + j on macOS, or ctrl + shift + j on windows.
In the console tab, click next to the little > so you can enter some code
Enter this and press enter:

document.body.style.zoom = "48%"

Obviously change 48 in the above to whatever level of zoom you prefer.
Answer: Works out-of-the-box for custom zoom levels per (sub-)domain, e.g.:

https://pupco.net/...every-page-in-here-can-be-at-a-custom-zoom-level
https://subdomain.pupco.net/...every-page-in-here-can-be-at-a-different-zoom-level

Steps:

Open tab to url at domain of choosing.
Set custom zoom level with CTRL or ⌘++/-
Open new (empty) tab.
Set default zoom level with CTRL or ⌘++/-
[Chrome 33.0.1750.146 m, Windows 7] (I've not verified on Mac)

Also helpful:

Press Ctrl+Numpad-0 to reset a page's zoom level.

Credit goes to the "Caveats" section (below) of Synetech's awesome answer. I posted this solution because it was all I needed in my case.

...the default-zoom setting
  (currently) only affects pages that you have not already zoomed. Any
  pages that you have modified the zoom for will not be affected by the
  new default scaling and will retain the previously assigned zoom
  setting.
Comment: what is wrong with this solution that would garner a downvote??
Comment: What people are looking for is a way to set your own values for zoom, with ctrl +/- you change the zoom, but you have only limited options, predetermined by chrome. People are looking to set their custom values

How do I set a custom zoom in Chrome?


How can I clean mold from the defrost drain on my refrigerator?

Question: I own a Blomberg Refrigerator with Ice maker model number K70520NLU.
Water is leaking onto the floor from the freezer. The coils keep freezing every two weeks. I need to empty the contents, take off the back cover and unfreeze the ice buildup along the coils with a hair dryer. Doing this does not solve my problem because the ice buildup and water leaks start again within 7-10 after unfreezing the ice buildup. Upon inspecting the back portion of the freezer, I noticed that there is a lot of black buildup in the water hose. I suspect this is what is causing the issues, but I am not sure. How can this part be cleaned or should it be replaced? What is the purpose of this part and can this be the reason I am having the problem? The ice maker works and produces ice. Any info is greatly appreciated. I've owned this fridge for the past 7 years.
Answer: Two issues.
There should be a drip pan over the compressor that is used to evaporate access water. Check if it is clogged.
Second issue:
The freezer has a built-in timer that defrosts the coils about every 7 hours. That function might not be working. It is a electric function.
How to clean the part. Remove it and use bottle brush.
Golden rule: If they have assembled it, you can disassemble unless it is glued.
Comment: To add, often the defroster has a little metal tab attached to the heater element; the tab is supposed to stick down into the defrost drain tube to prevent the drain tube from icing up.  Sometimes, the tab is simply not designed properly so that it actually goes far enough into the tube, or gets moved out of position.  When this happens, the drain tube can get blocked with ice, and the melted defrost overflows into the refrigerator cabinet.


Intuitive explanation of $S(p,w)\cdot p=0$

Question: Can anyone provide an intuitive explanation of why the Slutsky matrix right multiplied by the price vector yields a zero matrix?
I know this is true but I do not really understand why it is true. Can anyone help here?
Answer: This is a general mathematical property of the second derivative/Hessian matrix of multivariate functions that are homogeneous of degree one.
The Expenditure function $E$ is homogeneous of degree one in prices. Why?
If all prices change in the same proportion (which is how we check for the mathematical property of homogeneity), relative prices do not change. If relative prices do not change, the quantitative composition of the minimum-cost compensated consumption bundle in order to achieve a given utility does not change at all. Then, since all prices have increased by the same proportion, budget shares remain the same, and the Expenditure needed to achieve the same utility, rises in that same proportion: homogeneity of degree one.
By duality, the Hicksian demand vector is the gradient of the Expenditure function, $H = \nabla_p E$.
The Hicksian demand vector, gives us minimum-cost quantities demanded. Due to the homogeneity of degree one of the Expenditure function, the inner product of the Hicksian demand vector times the price vector equals the Expenditure function. This also should be intuitive: we just multiply each quantity demanded by the unit price that must be paid for it, and by summing these products we obtain the total Expenditure we must incur in order to acquire the minimum-cost bundle for given utility.
So we have  (simplifying differentiation notation) $ E = H\cdot p$ while also $\frac {\partial}{\partial p}E = H$. Therefore also
$$\frac {\partial}{\partial p}(H\cdot p) = H \implies H + \frac {\partial H}{\partial p}\cdot p = H$$
and it must be the case that
$$\frac {\partial H}{\partial p}\cdot p = 0$$
So the Hicksian demand vector is homogeneous of degree zero in prices (mathematically, this is a consequence of Euler's theorem for homogeneous functions, i.e. that if a function is homogeneous with degree of homogeneity $k$, its gradient has degree of homogeneity $k-1$).
But the 1st derivative (Jacobian) of Hicksian demand (which is the Hessian-matrix of second derivatives of the Expenditure function) is the Slutsky matrix, $\frac {\partial^2 E}{\partial p^2}=\frac {\partial H}{\partial p} = S(p,w)$. So $S(w,p) \cdot p = 0$.
So the result stems from the homogeneity of degree one of the Expenditure function. Is there an intuitive explanation, analogously with the intuition behind the homogeneity of degree one of the Expenditure function? Well, the former comes directly from the latter, so it is difficult to come up with a "separate" intuitive argument. One could informally say that compensated quantities demanded are "independent" of (not affected by) price variation when relative prices remain the same. Then in geometric terms, this means that the vectors of rates of change of compensated quantities demanded (which is what each row of the Slutsky matrix contains), are orthogonal to the price vector.
Comment: Wow. This is a fantastic answer.
Answer: I don't know if you will regard this as an explanation, or rather as a proof.
What we have a better understanding from univariate calculus is the first order Taylor approximation, i.e. a function satisfying some regularity conditions can be well-approximated by a linear function at a point. Say $f:\mathbb{R}\rightarrow\mathbb{R}$, then around $p^\ast$ (i.e. when $\delta$ is small)
$$
f(p^\ast+\delta)\simeq f(p^\ast)+\delta\times \left.\frac{df}{dp}\right|_{p=p^\ast}
$$
Now, we can do something similar for multivariable functions. If $h_i:\mathbb{R}^n\rightarrow\mathbb{R}$, then
$$
h_i(\mathbf{p^\ast+\delta})\simeq h_i(\mathbf{p^\ast})+\left.\frac{\partial h_i(\mathbf{p})}{\partial p_1}\delta_1\right|_{p=p^\ast}+\dots+\left.\frac{\partial h_i(\mathbf{p})}{\partial p_n} \delta_n\right|_{p=p^\ast}
$$
Now, it should be apparent that when we multiply all prices by the same number, the Hicksian demand does not change. So let's say we increase prices from $\mathbf{p^\ast}$ to $\mathbf{p^\ast(1+\Delta)}$. So each price ${p_j^\ast}$ changes proportionally at the amount of $\Delta \times {p_j^\ast}$. We should see no change in the value of $h_i$ above if we replace $\delta$ with $\Delta \mathbf{p^\ast}$. Then it must be true that the additional terms including partial derivatives would sum to 0, which basically results in your $S(\mathbf{p},w)\cdot \mathbf{p}=0$
Put another way, since the Hicksian demand for any good is not responsive to a change in prices that keeps the relative prices the same, then if we look at the total of the individual affects of these price changes on a good, we should observe a 0 change.
Answer: I suppose that you know already the answer given in Mas-Colell, this property has to do with no money illusion in fact (under some regularity conditions) it is if and only if with the property of the demand $x(\alpha p,\alpha w)=x(p,w) \forall \alpha > 0$. Now, it is trivial to show that this means that $D_px(p,w)p+D_wx(p,w)w=0$, under Walras' law $p'x(p,w)=w$ or equivalently $x(p,w)'p=w$, replacing it in the firs expression one gets $S(p,w)p=0$. We can go the other way using integration. In other words, I think that the robust intuition is that your consumer does not suffer from money illusion. Note that the consumer may not be rational but she will at least not be subject to this behavioral bias.
Answer: This property arises from the fundamental concept of homogeneity in economics. Let's explore this idea more intuitively:
Consider the Expenditure function E, which represents the cost of achieving a certain level of utility. This function is considered homogeneous of degree one in prices. Why? When all prices change proportionally (maintaining the same relative prices), the essential composition of the minimum-cost consumption bundle needed to attain a given level of utility remains unchanged. In other words, if the prices of all goods increase or decrease by the same factor, the relative affordability of different goods doesn't shift. As a result, the budget shares allocated to each good remain constant, and the total Expenditure required to achieve the same utility level increases proportionally. This property is known as homogeneity of degree one.
Now, in the dual perspective of economics, the Hicksian demand vector (H) represents the quantities demanded at minimum cost. Because of the homogeneity of degree one in the Expenditure function, the dot product of the Hicksian demand vector and the price vector equals the Expenditure function itself. This aligns with our intuition: we calculate the total cost by multiplying each quantity demanded by its corresponding price and summing these products to find the total Expenditure needed to obtain the minimum-cost bundle for a given level of utility.
In mathematical terms, we have E = H ⋅ p and ∂E/∂p = H. Consequently, we can derive the following relationship:
∂/∂p (H ⋅ p) = H ⟹ H + ∂H/∂p ⋅ p = H
It follows that ∂H/∂p ⋅ p = 0. This implies that the Hicksian demand vector is homogeneous of degree zero in prices, which is a mathematical consequence of Euler's theorem for homogeneous functions. Specifically, if a function is homogeneous with a degree of homogeneity k, then its gradient has a degree of homogeneity k−1.
Now, let's consider the first derivative (Jacobian) of Hicksian demand, which is the Hessian matrix of second derivatives of the Expenditure function. This matrix is known as the Slutsky matrix, represented as ∂^2E/∂p^2 = ∂H/∂p = S(p, w). Here, "w" represents wealth or income.
Now, when we multiply this Slutsky matrix by the price vector (S(p, w) ⋅ p), we get the result S(w, p) ⋅ p = 0.
This result can be traced back to the homogeneity of degree one of the Expenditure function. In an intuitive sense, it suggests that the quantities demanded at minimum cost are independent of price variations as long as relative prices remain the same. Geometrically, this means that the vectors representing the rate of change of compensated quantities demanded (each row of the Slutsky matrix) are orthogonal (perpendicular) to the price vector. This orthogonality conceptually reflects the idea that changes in prices do not impact the compensated quantities demanded when relative prices are held constant, consistent with the homogeneity property.


How to use amixer to change the volume in pulseaudio?

Question: I suspect that the volume of pulseaudio is off so I want to use amixer to turn it up from the command line. Can I do this? The amixer syntax is a bit confusing.
Answer: I use this:
mute/unmute:
amixer -q -D pulse set Master toggle

Raise volume:
amixer -q -D pulse set Master 5%+ unmute

Lower volume:
amixer -q -D pulse set Master 5%- unmute

-D pulse: to make sure we are using pulseaudio (optional)
unmute:   so we do not accidentally raise the volume in muted state and be surprised when unmuting
Answer: Try these, for example:
amixer set Master 5%+ -q

amixer set Master 5%- -q

... and experiment with other percentages.


Shape of planetary orbits

Question: What makes Venus' orbit almost circular, though mercury's is highly elliptical,even though it is closer to sun ? Further, Why is mercury's orbit most elliptical right after Pluto ?
Comment: I'm voting to close this question as off-topic because OP showed no research efforts.
Comment: @mafia36790: I think this question is a bit more complicated than you're thinking it is.
Comment: Indeed @kyle, I'm not talking about the intricacies which are sure to be lying in this very concept; what I'm saying is OP showed no research effort on it at all. I'll retract my vote if some efforts come from OP.
Comment: "Why" is not a good question. Be more specific.
Answer: All these trajectories are solutions of a  many body gravitational problem. In reality they approximate ellipses and spheres, because they perturb each other's trajectory due to the gravitational attraction among them. The real solution can only be found numerically, as it is done for planetaria .
So it is only to first order that the differences in the trajectories of the  planetary bodies can be compared. The first order answer to "why these differences" is "because the boundary conditions on the formation of each planet were different, so the trajectories will be different". This moves the goal posts to "why were the boundary conditions different" which forces to look at a specific model of the formation of the planetary system. For example

According to the nebular hypothesis, stars form in massive and dense clouds of molecular hydrogen—giant molecular clouds (GMC). These clouds are gravitationally unstable, and matter coalesces within them to smaller denser clumps, which then rotate, collapse, and form stars. Star formation is a complex process, which always produces a gaseous protoplanetary disk, proplyd, around the young star. This may give birth to planets in certain circumstances, which are not well known. Thus the formation of planetary systems is thought to be a natural result of star formation. A Sun-like star usually takes approximately 1 million years to form, with the protoplanetary disk evolving into a planetary system over the next 10–100 million years

So there is a lot of modeling space to get different boundary conditions for different segments of coalescing matter about the new star, and be able to model the final state differences in the planetary trajectories.

Shape of planetary orbits


Term for activity or system when something is fed its own power

Question: For example, if someone fed a cow its own milk what would that be? Maybe the term is related to the cow being content with this set up, almost thankful, even though they're the ones being exploited and don't actually need the other person, the person needs the cow.
Comment: Doomed by entropy.
Comment: "Doomed" is, I think, the proper term.  A cow cannot survive on its own milk.  A hydro power plant cannot run forever by using the power to pump more water uphill.   As @JackO'Flaherty says, entropy will get you, one way or another.
Comment: *Perpetual motion* for the situation where it's exclusively fed its own output. Really unclear what the second part of your question is about - do you think a cow would be happy being fed only its own milk? Adult cows are lactose-intolerant, like the adults of most mammals. There's a big difference between one time giving a cow its milk (and it being sick) and a situation where an animal can survive eating only its own outputs. It's common for e.g. a power station to use some of its own output to power some systems, is that the sort of thing?
Comment: Nuclear chain reactions are *self-sustaining*.
Comment: I don't think there's a general term for this relationship.
Answer: Self-sufficient / self-sufficiency would seem to fit the scenario described in the question. Also consider self-sustaining.


How to Close all Layers but keep Tables on MapInfo using MapBasic

Question: I'd like to know how to close all the layers on MapInfo but keep the tables open using MapBasic code. The idea is to be able to keep the tables open so that I can create multiple different maps using the same tables. Basically, for every map I create and export as an image , I want to close the layers for that map and then start creating my next map with the same tables as before. I don't want to Close all and then reopen the tables.
Answer: What you need to do is loop through the layers of the map window and remove them individually from the mapper window. This way they are not closed, just removed from the map. e.g.
Dim nLayers, i, nMapWinID as Integer

nMapWinID = FrontWindow() '// make sure the map window is at the front before running this

nLayers = MapperInfo(nMapWinID, MAPPER_INFO_LAYERS) '// get the total number of layers in the mapper

'// remove each layer starting at the last and working down to layer 1
For i = nLayers to 1 Step -1
    Remove Map Window nMapWinID Layer i
Next

Remember that you need to start at the last layer and work down otherwise the layer indexing will go wrong and you'll get an error.
Comment: Removing all layers will eventually also close the map window. It might be faster to just close the map window and then make a new map window. Or change the layer settings in the existing map to match the new layer settings
Comment: Good point Peter, I hadn't considered that! Perhaps you should put that into an answer as it's certainly a better solution to this question.
Answer: As I stated in a comment above, removing all layers from a map window, will eventually close the map.
It might be faster just to close the map window:
nMapWinID = FrontWindow() 'make sure the map window is at the front before running this
Close Window nMapWinID

Now the map window has been closed and you can create a new one. By the way, you can have more than one map window as a time if needed.
Alternatively, you can change the layer settings for the existing map to match the requirement of the next map. You don't have to start over everytime.
Comment: Thanks Peter. Unfortunately I am unable to test this because the project was just released, and the requirement was no longer deemed necessary. Therefore I cannot test it, but I understand your logic and it makes sense to do it your way


Does a strong law of large numbers hold in the continuum?

Question: Can we construct an i.i.d. family of Rademacher random variables $(X_t)_{t\in\mathbb{R}}$ defined on some probability space $(\Omega,\mathcal{F},\mathbb{P})$ (so, in particular, $\forall t \in \mathbb{R}, \forall i\in\{-1,+1\}, \mathbb{P}[X_t=i]=\frac{1}{2}$) such that for $\mathbb{P}$-a.s. $\omega \in \Omega$ we have that
$$\mathbb{R} \to \{-1,+1\}, t\mapsto X_t(\omega)$$
is measurable?
If so, and $-\infty<a<b<+\infty$, what could be said of the random variable
$$\omega\mapsto \frac{1}{b-a}\int_{[a,b]}X_t(\omega)\operatorname{d}t?$$
Does it satisfy some kind of strong law of large numbers? Intuitively - and here my intuition could be very wrong - this integral "should be" just a series of infinitesimal i.i.d. random variables of zero mean...
Comment: How do you define independence for an uncountable collection of random variables?
Comment: Maybe you can appeal to an appropriate ergodic theorem?
Comment: Nice question: in fact it could be part of having a negative of positive answer. What I had in mind was the classical "finite" definition, i.e. that for every two finite disjoint subsets of the real numbers, say $A$ and $B$, we have that the $\sigma$-algebras generated by $(X_t)_{t\in A}$ and $(X_t)_{t\in B}$ are $\mathbb{P}$-independent. But probably at this point we would require a stronger definition in order to obtain something sensible, maybe something like if $A$ and $B$ are two disjoint intervals of the real numbers then $(X_t)_{t\in A}$ and $(X_t)_{t\in B}$ are $\mathbb{P}$-independent
Comment: Could you clarify what kind of behavior you're interested in for that integral?  E.g. thinking of $|b-a| \rightarrow 0$, $|b-a| \rightarrow \infty$, or just a general question of what its distribution is for arbitrary $a,b$?
Comment: I'm mainly interested in the behaviour for fixed $-\infty<a<b<+\infty$
Answer: I will show that joint measurability is impossible.  That is, you cannot cook up such a probability space with $(\omega,t) \mapsto X_{t}(\omega)$ jointly measurable (that is, as a map from $\Omega \times \mathbb{R}$ with product of $\mathcal{F}$ and Lebesgue to $\mathbb{R}$.)  This seems to be a stronger assumption than what you asked for.  At the same time, it is somewhat awkward to say "$t \mapsto X_{t}(\omega)$ is measurable for $\mathbb{P}$-a.e. $\omega \in \Omega$" since it's not clear that "is measurable" will be in $\mathcal{F}$ or how to build such a $\Omega$.
Given $a,b \in \mathbb{Q}$, define $Y_{a,b} = \int_{a}^{b} X_{s} \, ds$.  Notice that Fubini's Theorem implies
\begin{equation*}
\mathbb{E}(Y_{a,b}^{2}) = \int_{a}^{b} \int_{a}^{b} \mathbb{E}(X_{s} X_{\xi}) \, ds \, d \xi = 0.
\end{equation*}
Therefore, $Y_{a,b} = 0$ $\mathbb{P}$-a.s.  $\mathbb{Q} \times \mathbb{Q}$ is countable so, in fact, $\{Y_{a,b} \, \mid \, a,b \in \mathbb{Q}\} = \{0\}$ almost surely.  Since $t \mapsto X_{t}$ is measurable in this event, we are left to conclude that $X \equiv 0$ almost surely.  (A bounded, measurable function whose integral vanishes in every interval with rational endpoints equals zero almost surely.)  This contradicts your specification that $\{X_{t}\}_{t \in \mathbb{R}} \subseteq \{-1,1\}$.
The argument is taken directly from Chapter 1 of Revuz and Yor (see Section 3).
Comment: Can you explain why should it be awkward to say that $t↦X_t(ω)$ is measurable for $\mathbb{P}$-a.e. $\omega \in \Omega$? If I'm not wrong, here I'm just asking that the trajectories of the process are $\mathbb{P}-a.e.$ measurable (a milder condition than the continuity of the trajectories, that is used for example in brownian motion).

If I'm not wrong the joint measurability is such a strong requirement, that the reference to which you point to establishes that gaussian processes satisfying such condition don't exist...
Comment: "If I'm not wrong the joint measurability is such a strong requirement, that the reference to which you point to establishes that gaussian processes satisfying such condition don't exist..."  Brownian motion is Gaussian and jointly measurable (suitably defined).  Revuz and Yor show that there is no way of getting a jointly measurable Gaussian process with each time independent of the other (i.e. your example, but with Gaussians replacing Bernoulli r.v.)
Comment: "Can you explain why should it be awkward to say that..."  To check that $(X_{t})_{t \in \mathbb{R}}$ is measurable requires checking the behavior at uncountably many times.  Uncountable intersections of events aren't necessarily events.


zelda skyward sword falling maneuver

Question: Need directions on how to use the wii remote to maneuver link while falling towards a target. I keep falling short of my target.
Comment: Can you elaborate a bit more on what _exactly_ you want to know? It's better to be a bit too verbose than having those who want to help you with your question guess everything
Answer: hold the wii remote flat, buttons up, facing the TV. Tilt it left to move him left, right to go right, dip it down to move forward, and tilt it up to move backwards. Also, I do believe if you hold down A you will slow down. And holding B will bring up the sailcloth.
Hopefully these tips help!

zelda skyward sword falling maneuver


Does anyone know why after I updated my android phone, that it doesn't unlock?

Question: I literally just updated my phone (I have a BLU X2 if that helps) to the new Android thing last night and my phone shuts down whenever I have any new updates. But I can't seem to unlock my phone this time. Like my password isn't working once I turn it back on and I've also tried all my old passwords and none of them work D:
Answer: BLU pushed a bad update. Just google for BLU OTA lock. Looks like a factory reset is the only solution for now.


Is it possible to check birthday?

Question: I have a list that contains 2 columns. The first one is full name and the second one is birthday.
It is possible to do new calendar list and put there the birthdays from the other list?
Thanks.
Comment: do you want to just copy the 2nd column (birthday) to a new calendar list?
Answer: You can do this just adding the Look up column in the Calendar list, which will pull the Birthday column for the list and display in calendar.
here is detail who you can do this(they use the task list but you do it according to your need).
http://tutorial.programming4.us/windows_server/sharepoint-2010---working-with-lookup-columns-in-document-libraries-(part-1).aspx
Answer: Firstly, you have to create a Calendar View for the First List having birthdays.
Then you can use the concept of 'Calendar Overlay' to achieve your requirement.
Details : http://deannaschneider.wordpress.com/2011/09/28/calendar-overlay-a-simple-sharepoint-2010-ootb-master-calendar/
Comment: I didn't understand how it helps me..
Comment: Lets say you have a List A where you added names & birthdays. If you want to show birthdays in another Calendar List B then you have to some way link it up with List A. You can do it simply by using Calendar Overlay or using Look-ups as mentioned by @waqas If you want to go a complex route you can use Event Receivers or Timer Jobs too to push data from one list to another.

Is it possible to check birthday?


primeng primeflex add a reset css

Question: In all the UI I have used up to now (bootstrap and material) a css reset was always included now for a new project the choice was on primeng with primeflex which has no reset as far as I could see.
what is the best practice to include a default css reset file such as bootstrap or use the available classes?
For instance
with a reset file I can use
h1 class="mb-3"
without
h1 class="mt-0 mb-3"
I don't really know why a reset file is not by default ^^
It's the first time I'm using primeng so be patience :)
Answer: Please note that mb-3 is a PrimeFlex class. It doesn't have anything to do with your component library (PrimeNG). Why no resetting is done by PrimeFlex could only be answered by the creator of that library. It's not documented. My guess would be to keep it lean and make resetting a choice to be made by the user of PrimeFlex.
Apart from the reseting issue, I would not use classes to style margins on a heading one. Instead create a CSS file with the margins you want to use on a h1. This allows you to simply use

...

on each page instead of having to do

...

And, if you ever want to change the margin, you can simply modify it in your style sheet.
Comment: The question was about how to best handle general css reset not specific margin handling
Comment: @jansolo you are right. Updated the answer.

primeng primeflex add a reset css


Are my shocks bad?

Question: My 2008 Ford Fiesta makes a sound like air coming out of a bicycle pump (in my opinion) when going over speed bumps. I noticed the rubber buffer on the back right shock is damaged. Can you help me diagnose the problem? Is it serious? From the little tests I have done, the car seems to be running fine.
Comment: Under normal conditions and with stock shock, they will have sort of a squishing sound as they compress/decompress. This is the liquid going through valves. When you say "rubber buffer", what exactly are you talking about? Is it the rubber piece on either end of the shock? Also, did you actually finish the question ... looks unfinished to me.
Comment: hi yes the rubber parts at the top and its a bit torn. thanks for your reply. is this sound OK? the car seems to be running fine. is the end of my first post.
Comment: @ChaseSandmann ... Sorry, your edit was correct. I hadn't seen the OP's comment yet when I was looking at the edit in the review section. I've asked a mod to go ahead and accept your edit. My apologies.
Answer: As Paulster2 stated in the comments, good shocks will make a whooshing type noise when going over speed bumps, which is created by the fluid rushing through the shock valves. This is completely normal.
Also, considering the age of your vehicle, it is highly unlikely that your shocks are blown out unless you have been driving on extremely rough roads  for long periods of time, or live in an extreme weather environment (think Death Valley with sand storms and a pinch of locusts type of extreme).
Rather than noise, the best way to see if your shocks are blown out is feel. Shocks are used to dampen the movement of the spring. A un-dampened spring (spring without a shock) will bounce up and down, slowly oscillating until it comes to a rest. You can test the shock by bouncing all your weight on one corner of the car. If the spring compresses, releases, and stops moving, the shock is functioning properly, if it compresses, releases, and keeps on bouncing without you adding more weight, the shock is no longer restraining the movement of the spring, and needs to be repaired or replaced.

Are my shocks bad?


How to upgrade Python version on Qubole?

Question: The current version on Qubole is 3.5.3, and some packages, like PyMC3 and future XGBoost need higher versions.
How do I upgrade? And would that affect other clusters' settings?
error message
Answer: There are a couple of options:
If you are using Environments, you could reach out to Qubole support and get updated to the latest version which comes with Python 3.7. However, this would affect the whole cluster and would not be limited to your job.
In case you are managing your packages on your own, then you could install miniconda with Python 3.7 via node bootstrap and then point your job to use that environment.
pushd /tmp
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
./Miniconda3-latest-Linux-x86_64.sh -bfp /media/ephemeral0/py_37_env

Then you can use Spark property spark.pyspark.python to point you job to use this miniconda environment. You might have to reinstall dependencies accordingly.
Comment: Thank you!!
Yeah, I'm using Environments, I contacted Qubole Support for that.
There is an option to upgrade to Python 3.7 from a drop-down menu in Edit button in Environments, but for some reason it's greyed out.


Why is Bobby Munson's cut different than everyone else's?

Question: Did they ever explain in the TV series Sons Of Anarchy why Bobby Munson's cut (his gang jacket) has a border around the shoulders?  There's a white pattern around what would be his sleeves (if it wasn't a vest) and that pattern isn't on any other character's vests, including all of the characters who are no longer in the show.
Comment: He also wears a lot of jean stuff and IIRC he wears a jean style cut too. The group is allowed to customize (to a point) their cuts. For example, Jax has a patch to memorize Opie. Opie's dad Piney also wore a jean style cut. This may be a relic of an older style within the club. The white trim may have been from the style back when JT was the president.
Comment: @DustinDavis - I left your edit, but he's more often referred to as Bobby Vegas than Bobby Munson.
Comment: @JohnnyBones Can you provide a reference to that? I haven't heard anyone call him that or at least I've never noticed. Are you sure you don't mean "Elvis" ? http://en.wikipedia.org/wiki/Bobby_Munson
Comment: @DustinDavis - That was probably me having a brain fart.  :o)  The point is, even *he* refers to himself as "Bobby Elvis" (like when he called Jury to get the intel on the two kids that got killed, not knowing one of them was Jury's son).
Comment: I know that this won't answer your question about Bobby's cut but it does about the whole Bobby Elvis thing. Bobby is referred to as Bobby Elvis early in season 4. AUSDA Potter called him that while briefing Sheriff Roosevelt about the RICO case. Fairly certain that there are a few other instances in the early seasons.
Comment: No idea about the embroidered vest hems. But he is referred to as Bobby Elvis early on in season one. He is seen in two or three episodes as an Elvis impersonator. Once at a school fundraiser, another at a Bar Mitzva and even travels out of town with Jax to Nevada to do a show.
Answer: According to a post on this website (which obviously can't be confirmed), the embroidery indicates a status of Treasurer, which Bobby held.  In addition, I have found a photo which indicates that it's not unthinkable for Bobby to have a jacket with a border:

So, while not conclusive about exactly why his cut is different, we can at least know that it wasn't some wardrobe mistake for him to have it.


How do third-party ETF websites know the holdings of ETFs at any given time?

Question: Fund management companies' (e.g. Vanguard, BlackRock iShares, etc.) annual reports include a complete list of securities held by each ETF. This complete list is only published in annual or semi-annual reports, so the data is likely outdated as soon as the report is published. I noticed that there are several third-party websites that list the holdings of ETFs. How do the websites know each ETF's holdings at any given time? Do they have some kind of special arrangement with the fund management companies to obtain the data?
Comment: Do you _know_ that the 3rd-party sites are showing anything other than what was in the last published report?
Comment: Some of the sites provide information how recent the data is. I guess everyone can buy the information from the indexing company
Answer: The premise of the question does not appear to be true. Here's an iShares webpage for the EEM ETF that shows the complete list of holdings as of the previous trading day:
https://www.ishares.com/us/products/239637/ishares-msci-emerging-markets-etf
Comment: @Flux isn't that saying the same thing? Today is Monday 12 July; the last trading day was Friday 9 July. I pulled up an archive copy from a Tuesday and the data given was from Monday so it seems to be a "most recent available" thing.
Comment: This appears to vary by region. For example, both Vanguard UK and iShares UK show less information than Vanguard US and iShares US. In the US version, they provide the list of all holdings along with the exact number of shares of each holding. In the UK version, they don't publish the exact number of shares of each holding.
Comment: "Here's an iShares webpage for the EEM ETF that shows the complete list of holdings as of the previous trading day: ..." — No, that is a list of holdings from last Friday (2021-07-09, i.e. four days ago).


Comparison between MDL and BIC

Question: I'm currently studying Hidden Markov Models. There's a set of observations from which I need to determine the optimal number of states. After having found the maximum likelihood using Baum-Welch, I considered two model selection criteria for determining the optimal states. These are Minimum Description length (MDL) and Bayesian Inference criterion (BIC). However, with MDL, the number of states=2 whereas with BIC it's 4. Does this mean that MDL performs better than BIC?
Answer: The Bayesian Infomration Criterion (BIC) is given as:
\begin{equation}\label{eq_BIC_FINAL}
BIC = \log f\left( {\bf{x}}|\hat{{\bf{\theta}}}_i ; H_i\right) - \frac{1}{2} \log  \left| I\left(\hat{{\bf{\theta}}}_i \right)\right| + \frac{n_i}{2} \log 2 \pi e \overset{i}{\rightarrow} max,
\end{equation}
where $i=1,\cdots,M$  is the model order index, $\left| \cdot \right|$ is the determinant, $I\left(\hat{{\bf{\theta}}}_i \right)$ is the Fisher Information Matrix for parameter ${\bf{\theta}}_i$ and $n_i$ is the number of unknown deterministic parameters under each hypothesized model.
MDL is derived directly from the BIC when $N\to \infty$ assuming i.i.d samples. Assuming $N$ i.i.d. samples we can write $I\left(\hat{\theta}_i \right) = N i\left(\hat{\theta}_i \right)$, where $i\left(\hat{\theta}_i \right)$ is the Fisher information matrix based on only one sample evaluated at $\hat{\theta}_i$. Inserting this into the BIC we get
\begin{equation}\label{eq_MDL1}
\log f\left( {\bf{x}} ; H_i\right) = \log f\left( {\bf{x}} |\hat{\theta}_i ; H_i\right) - \frac{n_i}{2} \log N - \frac{1}{2} \log  \left| i\left(\hat{\theta}_i \right)\right| + \frac{n_i}{2} \log 2 \pi e,
\end{equation}
where $H_i$ is the hypothesized model order.
Now taking $N$ to infinity will leave only the first two terms in the above equation so we get
\begin{equation}
\log f\left( {\bf{x}} ; H_i\right) = \log f\left( {\bf{x}} |\hat{\theta}_i ; H_i\right) - \frac{n_i}{2} \log N \overset{i}{\rightarrow} max.
\end{equation}
Usually in the literature the signs are in the opposite direction so we wish to minimize the MDL:
\begin{equation}
MDL = -\log f\left( {\bf{x}} |\hat{\theta}_i ; H_i\right) + \frac{n_i}{2} \log N \overset{i}{\rightarrow} min.
\end{equation}
So, obviously if one of the assumptions made above, namely, a lot of samples and i.i.d of the samples, does not hold, MDL will not give the same results as BIC.
Answer: No, if MDL is minimized by a model with two states while BIC is minimized by a model with four, that would not of itself imply that MDL is better.
But it's possible I missed something. What would make you think so?
Comment: Thanks for your response. Model selection criterion are known to compress the observed data into a reduced form by using a particular model. Here's a very readable link to  [Google books][1]. According to me, if MDL is giving a model which is smaller than BIC, this might reduce the computational burden for Viterbi algorithm. Your opinion and ideas will be much appreaciated. Thanks again                                                     [1]:MICAI 2006:How Good Are the Bayesian Information Criterion and the Minimum Description Length Principle for Model Selection?By Carlos Carlos Alberto Reyes
Comment: Is your criterion for preferring MDL 'whatever gives the smallest model'?
Comment: In fact I've got several observations for different types of events. There are 4 events each divided into 4 data types. BY data types I mean data smoothing, data wavelets, raw data and data smoothed wavelets.   I trained all these 4 types of data individually with BIC and MDL and half of the results shows BIC = MDL and the other half shows BIC giving 2 or 3 more states than MDL.
Comment: And this difference might be because of the BIC equation itself. BIC consists of a likelihood term and a penalty term. The penalty term depends on the amount of free parameters in the trained model for different states. And MDL does not depend on free parameters. The equation for MDL is as follows:              Log L(current state) - Log L(prev state) > (N+ d^2/4 +3d/4)        where L =likelihood; N= number of states and d=number of columns in the training data set (which equals to N).
Answer: In a mathematical sense, there is no such thing as "better."  There is only larger or smaller according to some sort of norm or other function producing real numbers and/or intervals as output.
If you ever hear anyone say something is "optimal," I recommend asking, "In what sense?"  This forces them to tell how they came to that conclusion, and if it is not with a comparison between real numbers/intervals, it is probably not a scientific method.
Comment: Your response is more a philosophical statement about epistemology than a direct answer to the question. The OP seems to seek a description of *what* the MDL and BIC are measuring, and *how* to distinguish appropriate contexts of application for each.
Comment: Thanks @DonWalpola. You are correct, my comment was a bit snarky. MDL appears to be Bayesian in character, whereas AIC is apparently neither Bayesian nor frequentist so if you want to avoid that kerfuffle I recommend AIC.  That is one good reason for using it, which I fully intend to do with vigor.

Comparison between MDL and BIC


Using Camel Processor as custom component

Question: I want to make a custom camel processor to behave as a custom component.I read it as it as possible from http://camel.apache.org/processor.html - section--> Turning your processor into a full component.
Here the Custom Processor created will have to do the job when i call
someComponent://action1?param1=value1&param2=value2
in the route.
For this i created a sample component using maven catalog.This created Endpoint,Consumer, Producer and Component classes.
The link says that the component should return ProcessorEndpoint which i have done.
So, Endpoint looks as below
public class SampleEndpoint extends ProcessorEndpoint{
 // Automatically Generated code begins
  public Producer createProducer() throws Exception{
            return new SampleProducer(this, processor);
  }

  public Consumer createConsumer() throws Exception{
   throw new UnsupportedOperationException("This operation is not permitted....");
 }
 // Automatically generated code ends here

 //added below to make custom processor work for custom component
  public Processor createProcessor(Processor processor){
     return new SampleProcessor();
  }
}

But, here the code in the processor is not getting executed instead the code in the SampleProducer gets executed.
Here i want the processor to be excuted.How do i do that?
Answer: When extending ProcessorEndpoint, the Producer from createProducer() will handle the exchange, i.e. Producer.process(Exchange exchange).
This is why you are seeing SampleProducer being used. But if you wanted to delegate to a processor, you could probably just change your code to be:
return new SampleProducer(this, new SampleProcessor());

My best advice would be to attach a debugger and put breakpoints in your SampleEndpoint, SampleProducer and SampleProcessor methods to see what gets called and when.


How to find out if a logo has already been used/exists?

Question: I have few concepts of logos for a website. How do I know a specific concept that is finalized, is already used by some other website or not?
Comment: Not a full answer, but http://tineye.com/ might find logos similar to yours.
Comment: If the logo is trademarked, you can do a trademark search (for US trademarks): http://www.uspto.gov/products/library/ptdl/services/tmsearch.jsp : *If your mark incorporates a design or logo you must search for trademarks that might be confusingly similar. Use the index in the back of the Design Code Manual to locate the appropriate six-digit code for each design element in your mark. For example, a logo depicting an eagle would be coded 03.15.01. Each element in a logo is assigned a design code. Carefully review the guidelines for each category.*
Comment: @artlung, I think that's the closet approach that you have suggested. As a test, I tried to upload Google logo & the site did show me several Google logos indicating that the logo exists. Now I took the logo of this website (webmasters.stackexchange.com) & tested it. There were no results to be found. So this means that the website was unable to find the match, although it existed. So under this situation, I think the chances of finding out if the logo exists is just 50-50 or maybe even less. What do you say?
Comment: @Devner, I agree, there's not a perfect mechanism to find out if a logo exists. I'm comfortable adding comments here, but not adding an answer per se. I'm hoping you find a way that is useful.
Comment: @JasonBirch, that is one good resource that you have mentioned. I am still in the process of testing the website. Have you ever used it yourself? If yes, any helpful results that you might want to share? Thank you.
Answer: In order to avoid trademark violations, there is no way around involving a lawyer. They can assist you in doing a search. Even then, there could be challenges. In the US, at least, a logo does not have to be registered to enjoy trademark protection. Prior evidence of trade using that mark (or one sufficiently similar under a "reasonable person" test) in a similar area of trade constitutes precedence. Defending and losing a trademark battle can be expensive due to costs of implementing changes and the possibility of penalties, not to mention legal fees. I am not a lawyer, so this is just a rough approximation.
Comment: Thank you for the reply. I understand that. But even a lawyer can do only so much. There may be more than a billion websites out there & more than a million unique logos (at least I hope). So what are the chances that a lawyer can really search a million logos(at the very least) & come up with accurate findings? Even a lawyer will have no option other than to search. So why don't we do the 'search' ourselves? Just a thought.
Comment: @Devner: It's called "due dilligence" and it spreads the blame, er, risk.
Answer: I use reverse image search on Google. It has always worked for me.
But the significant disadvantage is that you should get a coarse "keymage" (key-image) ready for searching.
All the best searching.
Comment: Reverse image? Are you referring to the image search feature on Google?
Comment: Yes. You are right.


Is this type of question for MESE?

Question: This question just came up. I sympathesize with the asker but I don't think this is a good fit here, perhaps Math.SE. Should we allow space for similar questions from now on?
Answer: Generally speaking, I think yes, it is fitting here. I'll repeat my comment from there:

If a lecturer would have asked "What learning strategies for undergraduate mathematics should I recommend when I am asked by students?", would that question be more appropriate? Is there a fundamental difference between OPs question and my hypothetical one?

What's interesting on this question is that it's concerned with "how to learn math", not "what to learn". Thematically, it fits well with MESE. You are right, it could have been posted in maths.se as a soft-question, or in academics.se as a mathematics question, but it fits here as a self-learner question, too.
Maybe the focus of this kind of questions needs to be adjusted slightly to get more generalizable answers, including some with citations, but in essence, I think that this question is fine.
As we decided to include self-learners, I don't think that excluding this question is a good idea.
Comment: I completely agree with this and will be deleting my comments on the main question.

Is this type of question for MESE?


High output current hex inverter in SMD capsule

Question: I am trying to find a hex inverter which has as high output current as 74AC04E (50mA) but surface mounted.
I haven't had any luck so far...
Comment: Capsule?        (fifteen chars)
Answer: You'll have better luck searching for what your after as a "inverting buffer" or "inverting line driver" or simply a "buffer" as many have an invert option.  They often come with 4,8,16,32 I/Os.
Texas Instruments has a few, I chose them at random though, there are plenty of companies that make such parts.  likely at whatever voltage/current/propagation delay you could want.
Answer: You might want to use a Darlington driver chip with six or more channels. Some come with built in inverters, and some come in versions with inverters and without. These can output up to 500mA per channel, depending on thermal dissipation and the output current for all other channels.
Answer: You could try using a p channel mosfet.  Pull up the gate to your logic level, say 5 V, and connect a series resistor from your logic source to the gate.  This will invert a logic level of 0 and turn the p-channel mosfet on, and a logic input of 1, will turn the p-channel mosfet off.
So you have inversion, and current is only limited by your choice of mosfet.
Answer: The 74AC04E has a rated operating of current of +-24mA. The 50mA is the absolute
maximum rating which you should not be operating at. There is also an absolute maximum
rated current of 100mA into Vcc or GND for the package.
IIRC LVC family form TI has the same +-24mA output currents. TI also has some power logic
devices. Not sure is they have a hex inverter or just a shift register. You could also
try Allegro.
For CMOS devices you can parallel the input and outputs of gates within the same package
to increase the current drive. Do not parallel gates from different packages.


Does Android USB host mode depend on an OTG cable?

Question: In order to take advantage of USB host Mode on the Nexus 7 (Android 4.1.1) is it necessary to have an OTG cable? Can I do it using the standard micro to male cable, then use a female to female adapter?
Comment: See also this question for more info on testing Host mode and getting it working [How can I determine if my device has USB Host Mode (OTG) support?](http://android.stackexchange.com/questions/36887/)
Answer: Yes, you need a specific OTG cable, or you need to modify your cable. An OTG cable has pins 4 and 5 shorted, which is how Android knows it needs to switch over to host mode. You can manually short (cross) the wires on a standard cable, then use a f-f adapter.
For my Nook Simple Touch, a kernel patch is needed to be able to use OTG. I also need to manually activate Host mode while using a OTG cable, so I know the grounding of pins 4 and 5 do more than simply tell Android to go into host mode.


Can I place a picture in the email signature on an iPad Air?

Question: I am new to apple, so please forgive the simplicity, but I cannot figure out how to paste my logo pic in my mail signature.  I just  bought the IPAD Air last week, and I want to set up my company signature in the mail app.  I tried to copy and paste the signature from my GoDaddy workspace email, but the picture would not paste.  I couldn't figure out how to save and upload it either like you could on a PC.
Answer: You cannot put an image in your signature on iOS. If you use Macmaniman's strategy of pasting in an image, the image will show up in settings, but not in an email. (tested on iOS 7)
A workaround is to insert the company logo into each email as you are writing it. However, I don't see why you would want to do this. It's a lot of work and your recipients will probably be annoyed because your images are wasting space in their mail account.
Answer: settings - mail, contacts, calendar- signatures
also just tap and hold to save an image from anywhere... basically your "control + c/v/x" are all done from tap and hold
Comment: what happens if you first copy your image in the photo app then paste the image in the signature?
Comment: Ok, but how do I insert the photo into my mail signature? When I tap the space I want to put it, the only options are paste and select all


Creating xml files from a database or list of variables

Question: I have a template and need to create several xml files. The file contains one variable -this- to replace several times, save it as that name -this-.xml and then repeat for each of the values in my text or excel list or from a database  - How would I best go about doing this?
Answer: Old school unix way (bash shell syntax):
<code>for var in $(cat replacelist.txt); do sed "s/-this-/$var/g" < template.xml >$var.xml; done
</code>
Comment: You risk producing not-wellformed XML. At the very least, you should escape $var before!
Comment: Well, it's a fairly well constrained case: we're not talking something coming from a random user input web form: this is old-school automation of an individual's work: if it breaks, you can keep both pieces.
Answer: Are you looking at doing this in code, or using a template-driven generator?
Several choices:

inside Visual Studio, you could use a T4 template to achieve this
you could use a code generator such as CodeSmith, MyGeneration or others
you could write your own little program to do this (in C#, VB - anything)

Which of these are you really looking for?
Marc
Comment: I am just looking for the simplest way - there's know way that I would be able to write a program to do this - I got the idea form using BK Replaceem and thought I may be able to use a list to kind of do the opposite of that program - Thanks
Comment: Well, in that case, I would say have a good look at MyGeneration - it's a template-driven code/textfile generator - you should have no trouble creating your template and then filling in the blanks from a CSV or XML file or something. Go to http://www.mygenerationsoftware.com/


What is the difference between an "interned" and an "uninterned" symbol

Question: What is the difference between an "interned" and an "uninterned" symbol.  Is it only Racket that has uninterned symbols or do other dialects of scheme or lisp have them?
Answer: Interned symbols are eq? if and only if they have the same name. Uninterned symbols are not eq? to any other symbol, so they are a kind of unique token with an attached string. Interned symbols are the kind that are produced by the default reader. Uninterned symbols can be used as identifiers when generating code in a macro, such an identifier cannot be shadowed by any other identifier. Most Lisp dialects have this concepts, in Scheme it is rarer, since hygienic macros are supposed to reduce its usefulness.
Answer: Common Lisp has uninterned symbols.  As Juho's answer says, an uninterned symbol is guaranteed not to be equal to any other value.
Common Lisp-style requires uninterned symbols in order to write many macros correctly (particularly macros whose expansion requires introducing and binding new variables), because any interned symbol you use in a macro expansion might capture or shadow a binding in its expansion site.
Scheme's hygienic macro systems, on the other hand, do not have this problem, so a Scheme system does not need to provide uninterned symbols.  Still, many of them do.  Why?  Several reasons:

Some Scheme systems offer a Common Lisp-style defmacro capability.
In others, the hygienic macro system's implementation may use uninterned symbols internally, but the concept of an uninterned symbol may be exposed.
Uninterned symbols can be useful in many programs that use s-expressions to represent a language, and transform this language into another s-expr language.  These sorts of tasks often benefit from an ability to generate an identifier guaranteed to be new.
Answer: The other two excellent answers nevertheless fail to mention the virtue of interned values generally, which is that they can be compared in constant time. This typically means that these values are represented as pointers to a table without duplicates. In Racket, as of a few months ago[*], other values--floating point values and strings used as literals, for instance--will also be interned. In addition to allowing faster comparisons, I believe that this enables better compile-time optimizations, because these values can be compared for equality without running the code.
Are there other systems that do things like this? I bet there are.
[*] I'm sure someone will correct me if I'm wrong :).


How to automatically update folder modified date in Windows

Question: In Windows, is there a way to update automatically (or with a simple script) the date of a folder with the latest modified date of any of its files (recursive)?
Answer: You can do this in PowerShell. Something like this to update the current folder based on files it directly contains:
<code>$lastModified = (dir . | ?{!$_.PSIsContainer} | sort LastWriteTime | select -last 1).LastWriteTime
$folder = get-item .
$folder.LastWriteTime = $lastModified
</code>
(This will fail if there are no files in the folder or if the user does not have suitable permissions.)
EDIT: Ensure only one file (the last) is found so sort pipeline has a singular result.
Comment: on Win7 I get the error `Exception setting "LastWriteTime": "Cannot convert null to type "System.DateTime"."` when running this. It has to do with the first line, the `.LastWriteTime` suffix is resolving to null. Removing it creates a value for `$lastmodified`, but not the one we want.
Comment: solved first line, one needs to grab first item from list and not the list itself: `$fileList = (dir . | ?{!$_.PSIsContainer} | sort LastWriteTime)`, followed by `$lastModified = $fileList[0].LastWriteTime`. Still doesn't work though, setting the last mod time says  `Exception setting "LastWriteTime": "The process cannot access the file 'D:\bugs' because it is being used by another process."` but for the life of my I can't figure out what that process might be (and I've tried many different folders.) I think the offending process is itself!
Comment: @Matt: fixed your first issue (forgot to only return a single item to get the date). For your second: it could be that PSH is holding the folder open, I would use `Handles` or Process Explorer (both Sysinternals) to determine what has the folder open.
Answer: I just did a simple test - if you create an empty file in the directory, it changes the folder modified date to to that time. When you delete the file, that still counts as a modification, so it stays modified at that time.
To do so recursively, you'd have to create an empty file in every folder you wish to have the date changed in. This is still a fairly simple solution if you're willing to do some simple programming.
If you want to change the date to something other than the current time, this solution obviously will not work.
Answer: You can use Bulk File Changer.

BulkFileChanger is a small utility
  that allows you to create files list
  from multiple folders, and then make
  some action on them - Modify their
  created/modified/accessed time, change
  their file attribute (Read Only,
  Hidden, System), run an executable
  with these files as parameter, and
  copy/cut paste into Explorer.
Comment: +1 for highlighting a useful utility that can change file and folder dates. -1 that it can't be used in the manner asked for (set folder date based on contents, recursively)
Comment: would this require manual intervention other than running it of course?
Comment: Indeed, this is a good program by Nir Sofer, but the folder mod/creation date can only be set manually. Nir wrote another program which does this much more elegantly, see my answer on [FolderTimeUpdate](https://superuser.com/a/1328361/360796).
Answer: FolderTimeUpdate
Really good choice for non-scripting program. Aside from not being configurably automatic (in the GUI), its functionality is exactly that desired:

FolderTimeUpdate is a simple tool for Windows that scans all files and
  folders under the base folder you choose, and updates the 'Modified
  Time' of every folder according the latest modified time of the files
  stored in it.

Most of this can be accomplished on the command line as well, so conceivably you could automate it by setting it to run at intervals, or perhaps even monitor certain folders.
The GUI allows control of subfolder depth to recurse, inclusion and exclusion wildcards, and even whether to change the file creation time also (same as modified time, or match oldest creation or modified time).
Program by the excellent and prolific Nir Sofer (the same author of Bulk File Changer in a less relevant answer).
Answer: Not pretty, but functional.  Done in bash / cygwin
<code>==================
find -maxdepth 1 -type d | grep -v "^\.$" | while read D ; do
  cd "$D"
  F=`ls -1tr | tail -1`
  cd ..
  touch -r "$D/$F" "$D"
done
==================
</code>
Brian
Answer: Here is a modified version of Richard's answer. It's also PowerShell script. Instead of setting the modified time of the current directory, it sets the modified time of all first-level subdirectories of the current directory. Another difference is that it looks recursively for the last modified time. Hope it's helpful for someone else.
<code>$parentPath = Get-Location
Get-ChildItem | where {$_.PsIsContainer} | foreach {
    cd -LiteralPath $_.FullName
    $files = dir -Recurse . | where {-Not $_.PsIsContainer}
    if ($files.Count -eq 0) {
        echo "note: $($_.Name) contains no files"
    } else {
        $_.LastWriteTime = ($files | sort LastWriteTime | select -last 1).LastWriteTime
    }
}
cd -LiteralPath $parentPath
</code>
Answer: Do Nothing! Mission accomplished!
The last modified date of a folder is always that of the last modified file in it.
Comment: If the last modified file has been deleted/moved, the date doesn't go back, so in some cases, this doesn't work if you want to have the date of the last modified file currently in the folder.
Comment: The OP said "update" not "postdate".
Comment: It also doesn't work recursively
at least on windows 7 with the structure
\1\2\3.exe
1 and 2 are from 2016
I've pasted 3.exe which is from 2003
result:
1 is still in 2016
2 is in 2017
3.exe is in 2003.


HGST 1TB in Mid 2012 MacBook Pro not working in SATA bay but drive seems fine

Question: In my Mid-2012 13 inch MacBook Pro I have a 500GB HDD in the standard SATA bay and I replaced the DVD drive with a drive cage which has a SSD in it. I bought this Hitachi HST 1TB drive \to replace my 500GB drive, but when I put it in the standard SATA bay I can't format it and I couldn't install Windows or Linux on it.
I took it out again and I connected it with a SATA to USB cable and it worked perfectly, so the drive is not broken, I suspected the data cable is broken because that happens sometimes with this model MacBook Pro.  I put the old 500GB drive back in, and it works fine. So it can't be the cable, this doesn't really make sense to me but I'm going to try to put the 1TB drive into the drive cage and the SSD into the standard drive bay.
Any ideas or suggestions what I should try?
Answer: Solution: So I swapped the drives, put the 1tb HDD into the cage and the ssd into the standard drive bay. I don't understand why exactly but it works :)


Intermittent "ORA-01458: invalid length inside variable character string" error when inserting data into Oracle DB using SQLAlchemy

Question: I am working on a Python 3.5 server project and using SQLAlchemy 1.0.12 with cx_Oracle 5.2.1 to insert data into Oracle 11g. I noticed that many of my multi-row table insertions are failing intermittently with "ORA-01458: invalid length inside variable character string" error.
I generally insert a few thousand to a few tens of thousands of rows at a time, and the data is mostly composed of strings, Pandas timestamps, and floating point numbers. I have made the following observations:

The error occurs on both Windows and Linux host OS for the Python server
The error always occurs intermittently, even when the data doesn't change
If I don't insert floating point numbers, or if I round them, the error happens less often but still happens
If I insert the rows one at a time I don't encounter the error (but this is unacceptable for me performance-wise)

Additionally, I have tried to insert again if I encountered the error. The first thing I tried was to was put a try-except block around where I call execute on the sqlalchemy.engine.base.Connection object like the following:
try:
    connection.execute(my_table.insert(), records)
except DatabaseError as e:
    connection.execute(my_table.insert(), records)

I noticed that using this method the second insertion still often fails. The second thing I tried was to try the same in the implementation of do_executemany of OracleDialect_cx_oracle in the sqlalchemy package (sqlalchemy\dialects\oracle\cx_oracle.py):
def do_executemany(self, cursor, statement, parameters, context=None):
    if isinstance(parameters, tuple):
        parameters = list(parameters)

    # original code
    # cursor.executemany(statement, parameters)

    # new code
    try:
        cursor.executemany(statement, parameters)
    except Exception as e:
        print('trying again')
        cursor.executemany(statement, parameters)

Strangely, when I do it this way the second executemany call will always work if the first one fails. I'm not certain what this means but I believe this points to the cx_Oracle driver being the cause of the issue instead of sqlalchemy.
I have searched everywhere online and have not seen any reports of the same problem. Any help would be greatly appreciated!
Answer: I had the same problem, the code would some times fail and some times go through with no error. Apparently my chunk size was to big for buffer, the error did not occur anymore once I reduced the chunk size from 10K to 500 rows.
Comment: Same intermittent issue with Oracle, decreased buffer from 10K to 2K and issue is gone
Answer: We found out that if we replace all the float.nan objects with None before we do the insertion the error disappears completely. Very weird indeed!


Are departure briefing and take-off briefing the same thing? If the same, when is it appropriate to brief?

Question: Are departure briefing and take-off briefing the same thing? If the same, when is it appropriate to brief? (before starting the engine, while taxiing, just before takeoff) I am asking the question as a student pilot, so I'd appreciate it if you could answer the question assuming I'm flying a light aircraft.
Answer: This would depend mostly on academy/company procedure.
For me, the departure review or briefing is a preflight item that revolves around an IFR clearance, the initial routing, and navigation setup.
Takeoff briefing can be an abbreviated repetition of the runway safety items prior to receiving a takeoff clearance.  Depending on the operation, it can be normal for an hour or two to elapse between the first departure review and the takeoff briefing.
Answer: I see them as being separate.  Back when I am gathering ATIS I am thinking about direction of departure, which runway, does that runway have a run up pad, pattern direction.  It's so casual I hesitate to call it a brief.  But then, at the run up pad,  I have a more formal takeoff briefing than any GA pilot I have ever known.  It only takes me 5-10 seconds longer than most others.

Based on my weight, performance, and recency of practice, what is the lowest altitude I will ever consider the return-to-field "impossible turn" on loss of takeoff thrust.

At that altitude, based on wind and terrain, will my turn be left or right, and I note the target bank and speed.

What is my DMMS (Minimum Maneuver Speed or 1.4 Vs), a speed below which I will not perform any maneuver that increases wing loading, decreases speed, or increases lift demand.  (Banking, pulling back on yoke, retracting flaps)

What is my best glide, at my weight.

"I'm on Rwy 14 and I have 3,000 feet.  Rotate at 50, no maneuver below 59.  LOTOT above x00 feet, I will turn left at X degrees bank and X KIAS."  Literally takes me 5-6 seconds.
BTW, I also re-arrange my checklist a bit from the POH.  GA POHs almost have you do things like set TO flaps and TO trim before doing quite a few other things, including an autopilot function check.  That's a hard no from me.  Setting my final takeoff configuration for flaps, gear handle, prop, and mixture are at the bottom of my checklist, after any test of them is complete.  Example, testing the autopilot's pitch servo after setting the takeoff trim, that's a non-starter for me.


Opera in 16-04 Missing Opera button to set preferences

Question: I have downloaded the latest stable version for 16-04, according to my Terminal.screenshot Where is the Opera button?  I know there should be an Opera button in the top left of the browser so I can set preferences.  Not there.  Has anyone any suggestions?
Answer: The page you are looking at on the screen-shot is an old version of Opera with a totally different user interface.
The Opera version you are using does have a button in most desktop environments, but in Unity, which is what you are using, there are regular menus instead. Hover with the mouse over the title ("Getting started with Opera - Opera"), and the menus will be revealed.


Customs duty for bringing two laptops into France

Question: I'm a PhD Student who will come to Toulouse to work on a computer science project. I have one little concern since laptops are especially important to my work, I would like to bring two with me, one is a Macbook Air 13in, while the other is a Macbook Pro 15in, both are mine and used for a year. I have read somewhere that I can only bring less than 500EUR of goods to be exempt from duty tax. Has anyone got the same experience?
Comment: How much time are you going to spend in France? Are you registered at an university in Vietnam or are you moving to France to start a PhD? If you want to do everything completely above board, your best bet is some sort of moving or student exemption but it does require some paperwork.
Comment: Where are you coming from?
Comment: I'm coming from Vietnam
Comment: Yes I already had a contract with me before I move there.
Comment: @HoàngĐìnhThịnh A contract for what with who? What about the duration of your stay? What kind of visa do you have?
Comment: The contract I have is with a French university, I will be staying for 3 years under the visa Talent/Scientist.
Answer: As I understand it in most western countries.
Generally duty and/or tax are due on items that are permanently imported into a country. There is usually an exception for small amounts of items imported for personal use or as gifts.
The reasonable personal effects of a short-term visitor, that enter and leave with the visitor are normally not subject to any duty, tax or customs paperwork.
Other temporary imports are also usually not subject to duty and tax but may be subject to customs paperwork and/or deposits to ensure that they do-in fact leave the country again.
There are often exceptions for people moving thier residence to a country allowing them to bring their personal and household items without paying duty/tax. There may be some paperwork and conditions (such as not immediately selling the items) associated with such exceptions.
If you are just visiting to do some short-term research then you most-likely count as a short term visitor. OTOH if you are doing a whole PHD course in France then that may well count as taking up residence, which may in turn mean that paperwork is needed to bring your belongings in without paying duty/tax.
The reality is that a couple of laptops that look like they are being used (i.e. are in a laptop bag, not in their original boxes) are highly unlikely to raise any concerns on the part of customs. Even if some paperwork should theoretically be done.
Comment: (+1) That's a good summary of the rules applying to short-term visitors but it's still not 100% clear (to me, at any rate) whether the OP really is one.
Comment: You should declare them anyway. Most likely it will go like this: "Anything to declare?" "Yeah I have these laptops for my computer science studies" "Show me" *pulls out laptops* "When did you buy them?" "*answer*" "And you're a computer science student?" "Yeah" "You're good, go on through". Small chance they'll ask you to pay tax though. You'll be better off than if you don't declare them, and then get randomly checked...
Answer: The limits mentioned in many regulations mostly apply to the case where a French national buys stuff abroad, and brings it back unused. This they have to declare if they are over a certain value (430,- EURO I believe).
However for visitors to France this is not applicable, as it is assumed that the stuff you bring with you, you also intend to take back with you. Just imagine, that you could not even take a camera with you to France as a tourist, or a laptop as consultant. (As I am, travelling to France quite regularly...)
And in the case of someone moving to France to study the French customs even explicitly state here that anything you bring with your for the purpose of your studies is not subject to import taxes.
In practice you are unlikely to even encounter a customs officer when arriving. After passing immigration you just pick up your luggage, and pass through the green channel, and you are in France....
Comment: It's also incorrect to imply that everything you bring to France to study is automatically exempt of all taxes or duties. It is only the case if you submit an inventory to the customs, together with proof of your registration *at a French institution.*
Comment: Note that generally, if you pass through the green channel when you were supposed to declare something, that's illegal and you could get a big fine (much bigger than the amount you would've had to pay for importing the thing if you'd declared it). Also note that there's a reasonable chance that the customs officers won't ask you to pay, if it looks like your personal stuff (and this *is* legal as long as you declared it). I've never been to France - this is general advice.
Comment: You're not necessarily wrong in this case but there are too many inaccuracies in this answer. These restrictions are not specific to French *nationals* or new goods. The rules apply to all EU *residents*, even to something that's old and was bought second hand (laptops lose value but think, e.g., of jewellery). There is also no blanket exception for visitors. In practice, a midrange camera or office-grade laptop might be OK but for really expensive professional equipment even visitors have to fill in some paperwork.


Can Moss Stone (Mossy Cobblestone) be found in SMP?

Question: I recall finding Moss Stone on one of my single-player maps some time ago... however I haven't seen it recently (after taking a break from MC around Beta 1.2, I've now started playing again on Beta 1.5).  I do almost exclusively play on my friends' SMP server now, and so I was wondering if Moss Stone naturally occurs in SMP on Beta 1.5?
Answer: Yes, Moss Stone occurs naturally in SMP. It can only be found on dungeons walls. The quantity varies, but my friend got around 55 blocks with only one dungeon, playing in SMP of Beta 1.5. The minimum seems to be 30 blocks, with a maximum of 64 per dungeon.
Dungeon, with part of the floor composed of moss stone:

Source of some information: https://minecraft.wiki/w/Moss_Stone
Comment: You can now control the spawning of buildings when you create a world - if your SMP server has 'Generate Structures' turned off dungeons will not spawn
Comment: Cool, just wanted to make sure this still showed up in SMP! I've got a pretty extensive strip mine running and haven't found any yet so I was starting to wonder!


Rotate a UIViewController

Question: I have a navigation view controller. When i select a tableview cell it push a new ViewController from UIInterfaceOrientationPortrait state.
Now if i Rotate the new ViewController Landscape mode and pop the new ViewController and go back the table view Navigation Controller main page then i can see that, NavigationController main page is its previous UIInterfaceOrientationPortrait mode and i can't see the downstair part of my tableView interface.
How i am gonna fixed this such a way that if i pop up the newViewController, the Main Navigation ViewController page will view such a way that achieve the Orientation mode of newViewController.
That mean's if the newViewController is in landscape mode than the main page will automatically landscape mode and if the newViewController is in Portrait mode then the main Navigation page will be automatically Portrait mode.
Any solution ????
Answer: Add the following in all your view controllers (in the navigation stack) implementation files.
<code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{

    return YES;
}
</code>

Rotate a UIViewController


In Level 5-3, where do I use the final red key?

Question: I have an extra red key and have scoured the entire level for a red lock barrier, but cannot find it.  What am I missing?
Answer: The key is there because you need to be able to open all the gates to 100% the level; therefore, each gate has to have a key behind it so the other gates can open. If one chamber had been empty instead, it would have left you out of luck on the level if you opened that door first (or at any time other than last).
Comment: Thanks!  I asked this question because my game was locked at 99% and this level had not been marked 100% completed, but I couldn't figure out what to do (so I assumed the extra key was related.)  After a game update, the level and the overall completed went to 100%, so I'm left to assume this "99%" thing was a bug that was fixed.


How do I protect my assets in a will from being passed to potential second spouse if my wife should remarry and die?

Question: Jurisdiction in in the USA . I do have children and want them to have my assets should my wife remarry and --pass away-- and not to her  second spouse.
We are writing our will out and someone mentioned to us that if either one of us should remarry and die - any assets would go to the surviving spouse instead of
to our children. I want my assets to stay within our current family and want to know of a legal way to do this.
Answer: Don't give them to your wife
A bequest is a gift and gift's can't have conditions subsequent (conditions precedent are OK - like the one where you have to be dead first). It's a funny thing, but when you no longer own something you no longer get a say in what happens to it.
So you have two options:

Trust your wife to do the right thing by her kids after you're gone.
Bypass your wife and give your stuff to your kids directly. You can set up a trust with a trustee you trust and rules for them to follow until your kids are old enough to manage the wealth themselves.

And one essential requirement:

Hire a lawyer.
Answer: Someone I know has a trust from their parents that says they can use the money during their life for their needs (and lists a fairly comprehensive set of examples) and upon her death the remainder goes to their children.  I think you can has some control over what happens to your money after you die.
Your attorney may be able to structure a trust like that where the surviving spouse does not the money outright but through a trust with provisions you desire relative to any remainder going to your children. I assume you want this to be symmetric - your second (or N+1th) wife not getting the family's wealth.


what is my network doing?

Question: I'm trying to determine what sort of data is coming or going from my domain. The activity light on my modem and firewall are flashing like crazy regardless of the number of actual computers connected.  When I disconnect the systems I still see the traffic. How can I peek onto that side of the firewall?
Comment: Check if your router supports SNMP (most of them do), and run a daemon on one of your boxes to pull the info into a file which you can then analyse.
Answer: From the Snapgear Administration Guide you can do a packet capture direct from the firewall.  From the firewall's System menu, click on Diagnostics, then Packet Capture.  Once you've got a few seconds worth of packets, you can view it right from the firewall.  Alternately, and what I'd probably recommend, is that you can download the cap file, and view it in something like Wireshark.  This should at least let you see the type, source, and destination packets of your traffic.
Probably random crap from the Internet being spewed in your direction...

--Christopher Karel
Answer: Direct packet dumps (tcpdump, wireshark, and friends) are good but you'll probably like something more high-level. If you can get all the traffic (via an hub as already said or via a linux or other unix system with two ethernet cards in bridging) you can run ntop on that host and see detailed realtime reports of your network traffic.
Comment: It should be noted that ntop can read pcap files as input.  (`-f ` flag)  So you can perform analysis on a cap file you download from the firewall using the instructions I included above.  Otherwise, a very good answer.
Answer: Probably not a whole lot of exciting things are going on. The lights flash like crazy even when small amounts of data are going across the wire.
If you want to see what's going on, you can sniff the packets. Download and install Wireshark on your computer. Then hook up a hub (hub, not a switch) between your firewall and modem. Plug your computer into the hub, launch Wireshark and start sniffing away.

what is my network doing?


My toilet wont flush properly,but it does flush properly like 1 out of 10 flushes

Question: Okay, my toilet onny flushes once properly out of like 10 to 20 flushes. I've already checked the flapper, toilet handle and chain, and checked and tested the fill valve and float. It all is fine, but my toilet still doesn't flush. It acts like it's completely clogged when I try to flush it so I plunged it and then snaked it, and still doesn't flush. So I then went to my basement and snakes my clean out thinking there might be a clog deeper in the pipes. But none. I did notice air bubbles coming out from underneath where the flapper is found whenever I try to flush the toilet. Could this be caused by a block in my toilet vent? And it you guys think it might, my toilet used to flush fine but recently stopped working properly. But I'm at a loss here. I work for a home improvement company so I run into this kinda stuff almost everyday. But I am no licensed plumber so I don't know all the ins and outs of that particular trade. I know a lot, but when it comes to drain vents is where I lack in my expertise
Comment: Could be a clogged vent or the holes under the toilet rim might be blocked.  Any other large water holders(full tubs/full sinks) have problems when draining?
Answer: The toilet trapway could have an object stuck in it. Give it a visual with one of those little camera-on-a-flex-stick thingies. I've been flummoxed several times by that sort of blockage. There's no connection at all between the flapper and flush channels and the drain/trap channel.


Difference between CAPM and mean variance optimization

Question: Is the mean variance optimization the same thing as the capital asset pricing model? Or is the mean variance only a part of CAPM?
Answer: Mean-Variance Optimization is a generic framework that creates optimal portfolios relative to two measures of risk - mean and standard deviation (covariation). It holds in general for elliptical distributions where the scale and location of the distribution are the only sources of risk and return. For a Normal Distribution this is $(\mu, \Sigma)$.
CAPM is a strict set of equilibrium assumptions made on the mean-variance framework to obtain certain results for the behaviour of the representative agent in the market. Namely, that is all agents were rational, with concave quadratic utility functions dependent on the first two moments, then the market portfolio would be the optimal portfolio and all other returns could be determined by their "$\beta$" to the market. The key idea behind this is that all risk and return originates from a single factor, the market. So risk can be decomposed into two components, the systematic and the idiosyncratic. But, diversification (ala Mean Variance) can remove the idiosyncratic risk, so no rational agent should price it. As a result, all expected returns are given by the beta (covariation, regression coefficient) to the market.
Answer: The CAPM is basically mean variance optimisation plus equilibrium.
Mean variance optimisation answers a simple question: what portfolios have the greatest expected return for a given variance? Those are the efficient portfolios. The set of efficient portfolios is convex: any portfolio of efficient portfolios is efficient again.
Now, the CAPM proceeds like this:

all investors are mean variance optimisers, so they each want an efficient portfolio.

equilibrium obtains, so each investor has an efficient portfolio. Then, by convexity,

the market portfolio (which is just the portfolio of all individual portfolios) is efficient.

Then the famous CAPM formula holds:
$E[r_p] = r_f + \beta_{p,m}(E[r_m] - r_f)$
where $p$ is any portfolio (or simple asset), $E[r_m]$ is the expected return of the market, $r_f$ is the risk free return (or the expected return of the zero covariance portfolio of the market if there's no risk free asset), and $\beta_{p,m}$ is the beta of $p$ with respect to the market.
Note that this famous formula holds (by pure math) whenever $m$ is an efficient portfolio. So all that is necessary for the CAPM to hold is above 3 (which in turn follows from 1 and 2).
Answer: Mean variance and CAPM are not the same thing.
Neither the mean-variance model are the part of the CAPM. Rather the CAPM, in certain sense, is an part of the mean variance model.
To put it better, if we have $N$ risky assets plus a riskless one then we can achieve the a la CAPM representation. Moreover if the tangency ptf overlap the market ptf, as the CAPM assumption impose (equilibrium), we have the standard CAPM.
In other way, if the mean variance model do not hold neither the CAPM hold. Instead if the CAPM not hold the mean variance can hold still. The mean variance is more general.