Must I cancel the return portion of an airline ticket if I decide not to fly it?

Question: I'm considering not using the return leg of my plane ticket since I can't extend the return date beyond a year but I still have enough money to continue travelling.
When I told some friends that I should call the airline to cancel the return part of my ticket some said "Why bother since you're not using it and won't get any money back anyway".
Well I checked and indeed I can't get any refund. But if I don't cancel and don't board the plane, will an airline (Korean Air in my case) consider this as causing them some hassle and perhaps have some repercussions should I fly with them again in the future?
For instance perhaps they could've put somebody else in my seat if I had warned them by cancelling, but maybe they overbook all flights anyway so I'd actually be doing them a favour?
Comment: Well I knew about that question and know that I'll lose the rest of the flight. The other question is about skipping a medial leg and still using the final leg. Mine is about skipping the final leg. The answers to the previous question tell you you'll lose the rest of your ticket. In this question obviously whether you take the final leg or not the ticket is done... but what I want to know is does it get you some kind of "black mark" or not for **not informing the airline that I'm not showing**?
Comment: Good point.  +1'd.
Comment: possible duplicate of [Do you have to take the second leg of a flight?](http://travel.stackexchange.com/questions/4440/do-you-have-to-take-the-second-leg-of-a-flight)
Answer: I'm presuming that you've got a non-refundable fare otherwise this is a fairly pointless question - just contact the airline, cancel your ticket, and get your money back.
If it's not a refundable fare, the best option is to NOT cancel it - yet.
There are a number of things that can happen between now and when the flight is scheduled that can give you cause go to the airline and ask for a full refund, even for tickets that don't allow it.
The first of these is a "schedule change", where the airlines sometimes rearrange their schedules and thus change the times of flights.  If the change is sufficiently large (eg, more than about 2 hours) the you can normally contact the airline and ask for them to refund the ticket.
The second is "waivers", which airlines sometime publish around times of bad weather/strikes/etc.  These waivers are basically the airline giving passengers the option to cancel/change their plans in order to reduce the number of services they have to fly. Generally these waivers are short (often a day or two, occasionally as much as a week) and will only cover one or a small number of airlines.  Keep an eye on the airlines website in the days before the flight to see if they have such a waiver covering your flight.
The odds of either of these happening are low - but they do happen so it's worth checking!
If neither of those happen, then it's generally good form to contact the airline a day or so before your flight and cancel the ticket.  It's possible that by doing this you'll end up with a "credit" for future travel, as even most non-refundable tickets can be canceled - but there'll normally be a fee involved.  If the value of the ticket is less than the fee you'll get nothing.  If it's more, you'll get the difference.
If you know that you're not going to get a credit back, then there's no "need" to cancel the ticket - the airline won't "black mark" you or anything like that - but it's still good practice to do it anyway.  If nothing else, think of the person who needed that seat but wasn't able to get it because the flight was full - by canceling your ticket a day or two before, you give them the option of getting onto the flight!
Comment: Also, for non-refundable tickets, there are often taxes/fees that can be refunded (less admin fees), which can be worth doing for expensive tickets
Comment: Best option is to pickup and phone and call.  Ticket rules can be complex and vary a lot between airlines and fare classes - don't take anything you read on the website as being correct as it could be for a different fare class.
Comment: schedule change has happened to me when I had decided not to fly and I felt like the luckiest person on Earth! Got a full refund :D
Comment: The ticket was I assume a non-refundable ticket since it was the cheapest I could find, but since it's a 1-year Australia-Turkey return that still cost about $2,000. But reading around on the Korean Air website they say I can only get a refund if I cancel a month or more before the expiration of the ticket, which is now 13 days away. But maybe I'm missing something! (-:
Comment: In general, canceling your ticket will not get someone onto the plane who would not have otherwise flown. Instead, it will move someone from standby to a reserved seat. That person would have flown on standby anyway, since we are assuming that you don't show at the gate.


Why do solar panels not have focusing mirrors?

Question: Most of the solar panels that I have seen do not have any mirrors, etc., but usually solar cookers have mirrors. What is the reason for solar panels not having focusing mirrors?
Comment: If you use heat sinks to keep them cool you can use mirrors or other techniques to focus the energy.  http://www.greenrhinoenergy.com/solar/technologies/pv_concentration.php
Comment: In Space SE: [Temperature of photovoltaic cells vs efficiency - is it ever actively controlled?](https://space.stackexchange.com/q/17344) solar panels are very dark by design yet you need to keep them cool. [Floris' answer](https://physics.stackexchange.com/a/113968/83380) nails it, the highly upvoted and accepted answer misses this critical point completely. Consider un-accepting the current answer? This will trigger the question back into the active queue and allow more voting on the better answers.
Answer: The simple answer is that the two devices work in completely different ways.
Solar cookers, as well as so-called 'solar thermal collectors', focus the light of the sun to heat something (a pot in a cooker, some oil or ceramics) and the heat is then transferred somewhere, where it generates electricity, usually by some steam engine. So, the more heat, the better.
Solar panels on the other hand use the photovoltaic effect, which directly converts light into electric energy. Light excites electrons to the conduction band and the current is then transmitted somewhere. Too much heat, however, destroys the materials used, so focusing might be a very bad idea.
Comment: Efficiency of solar cells drop quickly as they heat and this is the limiting factor of using mirrors.  About 12% of the energy is turned into electricity, and the remaining 88% becomes heat.
Comment: @user6972 This is the case for conventional solar cell materials like doped silicon and GeAs etc. But within the past 5 years, new classes of photovoltaic materials have been found, such as the [perovskites](https://www.perovskite-info.com/perovskite-solar), which show much less dependency on temperature. These may be promising future materials to use.
Comment: @user6972 Would it not then be worthwhile to convert/direct the heat to a heat to electricity converter then to make solar cells more efficient, or to perhaps use a hybrid cell that uses thermoelectric and photovoltaic methods to create energy? Or, what if we just convert the light directly to heat and then use that to power a mechanical to electrical device or otherwise which we know are more efficient?
Comment: @AMDG Converting light to heat is what is done in "solar thermal collectors". If you want to power a turbine or convert the heat to electricity, the resulting efficiency is less than for photovoltaics. However, if you want to heat stuff, then it's better. That's why it's a good idea to have solar thermal collectors to heat your water.
Trying to combine the two makes the system way to complex, if it works at all.
Comment: How about reflecting _only_ the wavelengths not used in the photovoltaic cells, which would sit behind the (partial) mirror? That way, it's a win-win!
Answer: Although the other answers are correct, I think they are missing the main point.  Ordinarily, solar panels work regardless of their orientation.  Their performance may be optimal when oriented directly toward the Sun, but if the Sun shines at 45°, 90°, or when it's cloudy, they still receive photons and still generate electricity.
Focussing mirrors, however, need to be directly exactly toward the Sun to be of use.  To use them on a solar photovoltaic array would require the user to constantly rotate the array, requiring a Sun tracker and considerable mechanical overhead.  For a cooker, that is used for perhaps half an hour or so and largely supervised by a human, this is no problem.  But solar PV arrays should operate unsupervised all day, while the Earth rotates causing the relative position of the Sun to change.
Finally, sunlight is not scarce.  If we need more electricity, it is usually  cheaper to add more solar panels, than to go through the full overhead of adding focussing mirrors and infrastructure to rotate our entire array.

See also: https://physics.stackexchange.com/a/78848/6319, https://physics.stackexchange.com/a/78918/6319, https://sustainability.stackexchange.com/a/2788/106.
Comment: I disagree, *the main point is that they are black yet you must keep them cool*, so there's a maximum power per unit area beyond which it becomes more expensive and challenging to actively cool them. See [comment](https://physics.stackexchange.com/questions/113104/why-do-solar-panels-not-have-focusing-mirrors#comment1463869_113104) and links therein.
Answer: The concept of using mirrors to focus light on a photovoltaic cell has been considered.
See for example MIRROR REFLECTING COST EFFECTIVE PV SOLAR ENERGY CONCENTRATING SYSTEM
The relative costs of the mirrors versus the cells needs to be considered.
Some light will be lost due to imperfect reflection and geometry.
Also, if the light is too intense the cell could be damaged or saturated.
Answer: Every so often there are products with some kind of focusing equipment. Some concepts use mirrors, and others use cheap plastic lenses.
Aside from the "damage" described in the other answers, there are a few other compelling reasons not to take this approach:

Cost: this might be less intuitive, but manufacturing and installing solar panels is a pretty straight forward process. In a lot of ways, solar panels are now commodity hardware modules. You want the the manufacturing process to be simple, the shipping to be simple, and the installation to be simple as well. Lets assume you could squeeze out an extra 10-20% more wattage (significantly more than this might cause overheating). At a current cost of  0.70 USD/watt on the low end for low end solar panels, it would potentially be cost effective for a large 200-watt panel (200*0.70 = 140 USD) if the wholesale cost of the mirrors would only add up to 20% the cost, so in this case $28 USD. My hunch is that the costs associated with installation and shipping would make this less competitive, but I can't speak to those numbers.
damage: I don't think that most PVs could handle more than 20% extra sunlight without additional temperature regulating hardware. You could add heat sinks and/or fans, but this equipment would add to your cost. Even if you could maintain a comfortable temperature, how would the lifetime of the PV cell change? (I'm not sure.) By the way, it also possible to harness the heat coming off of your PV cells and use that energy to provide hot water or heat your home. This would make the question a lot more complicated, so I won't go into it.
installation and maintenance: a flat structure is much easier to maintain, less chance of breaking, easier to clean. And if one mirror/panel breaks, gets dirty, or gets more sun than the others you're output is the same as it would be without mirrors because of #4:
shading and the effects of uneven exposure: wikipedia has a good piece on this, http://en.wikipedia.org/wiki/Photovoltaic_system#Shading_and_dirt , to summarize: "Photovoltaic cell electrical output is extremely sensitive to shading. The effects of this shading are well known. When even a small portion of a cell, module, or array is shaded, while the remainder is in sunlight, the output falls dramatically due to internal 'short-circuiting' (the electrons reversing course through the shaded portion of the p-n junction)." If the opposite is true, that one PV cell gets extra sunlight relative to the others, the same limiting effect would be observed. So if you put mirrors on one panel in an array and not the others, it would have no effect really.
space: this is not always a concern, but for many projects the goal is to cram as much wattage into the usable space. Mirrors are inherently less efficient than additional photovoltaic cells.
Answer: Solar panels are semiconductors. The sunlight pushes charge carriers "up stream" - crossing the junction in the direction of higher energy.
When a semiconductor gets warm, charge carriers are excited into the conduction band - this causes leakage of the charge. The hotter the device the worse this gets - until you get to a point where you irreversibly change the material properties.
Here is a simile:
Imagine you are trying to move water from below the dam to above the dam so you can run a hydroelectric power station. The dam is the junction, the water is the charge carriers, and the incident light provides the energy to carry the water upstream. Heat makes the dam leaky - if you like it creates waves on the lake so water sloshes over the dam. And when the waves get too big the dam breaks.
Answer: Although the shortfalls of focusing more light on the array have been described, a similar question is why you would not mount mirrors to reflect sunlight toward the array only when the incident angle is well off normal.  This might provide some of the advantage of tracking the angle of the sun during the day.  I think in this case the placement and size of the mirrors would not be practical for some of the same reasons as described above.  They would be above the array and difficult to mount, would likely block the sun during part of the day, and would also likely reflect at a neighbor's house during part of the day.  The people without any of these issues form too small of a market to see ads for big mirrors.
Answer: The problem with mirrors will be pointing them constantly to the panels.
Constant Heat reduces the output of a panel and too much light will burn the panel and shorten it's life. If you added mirrors you would bake the panels in full sun.
And solar cookers have them because they are used for only a limited time and no damage is caused. Besides using mirrors would result in efficient cooking
Answer: Something else that I don't think has been mentioned - most solar panels are limited by the lowest power generated by any cell in the array. So, to boost the power by reflection, you would have to ensure that the reflected light covered the entire panel to gain anything from it. This of course reinforces what has been suggested - adding power by adding reflectors is not as simple as it sounds. It adds a great deal of complexity to the design of the system. Adding another panel is likely to be more economical both from the direct costs and labor/design costs.


wordpress exclude directory

Question: I have a simple problem but that i not found a solution online: i need to exclude fisical directory from a test webserver on my pc called "stopdebiti2012b" that contain wordpress core,in the wp-content/themes/ i have the theme "stopdebiti" and i have created a directory named "blog/" i need to exclude that from mod_rewrite but nothing is happened.
I have used all of common solution explains on internet..but nothing it happened?
How can i solve this?
   # BEGIN WordPress
   <IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteBase /stopdebiti2012b/
   RewriteRule ^index\.php$ - [L]
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule . /stopdebiti2012b/index.php [L]
   </IfModule>

   # END WordPress

thanks!
Answer: Try adding this line
RewriteCond %{REQUEST_URI} !^/(blog|blog/.*)$

after
RewriteBase /stopdebiti2012b/

wordpress exclude directory


Row-column scanning to control an 8x8 LED matrix

Question: https://www.arduino.cc/en/Tutorial/RowColumnScanning
This code really confused me because I don't know if the pixels[x][y] is HIGH or LOW in void refreshScreen().
As you look at the code, pixels[x][y] is HIGH and then LOW in void setup(), and then pixels[x][y] is HIGH again in void loop(). Could anyone explain this to me, please?
Answer: The pixels array in initialized to all HIGH in setup(). Then one element of the pixel array is set to LOW in readSensors()  which turns on one LED.
The tricky bit is you have to remember to turn off the previous LED. That is why in readSensors() there is the line where an element of pixels is set HIGH while the pixels' array pointers are still pointing at the former (already lit) LED.


Electric sails power consumption

Question: According to Wikipedia, the E-sail consumes about 540 W (https://en.wikipedia.org/wiki/Electric_sail#Fast_missions_to_planet_Uranus)
But this consumption is continuous, and considering an engineering point of view, how viable is this?
Answer: The original concept was conceptually simpler

An artistic rendering of the current concept shows as spinning spacecraft with radial tethers again with an electron gun ensuring the sail has a positive charge. With this configuration there are also auxiliary thruster units at the tether tips. This more advanced version would allow the direction of thrust to be controlled. There are also new concepts such as negatively charging the sail with an ion gun.
This paper talks about proposing a Uranus mission including a power budget.

At 1 au, the 0.5 N E-sail needs nominally 540 W of electric power
to keep its tethers charged (Janhunen et al., 2013). The electric power
requirement of the E-sail scales as $\frac{1}{r^2}$ i.e. in the same way as the
illumination of solar panels (Janhunen et al., 2010; Toivanen and
Janhunen, 2009) although the thrust scales as 1/r (Janhunen et al.,
2010). Thus, if enough solar panels are used to power the E-sail at
1 au, the same panel area is sufficient also at larger solar distances,
excluding a small constant power needed by E-sail control systems.
During cruise, the E-sail spin plane is typically inlined by at most
45$^o$ with the solar direction so that the illumination of the solar
panels is reduced by a factor of  0:7. This is a conservative estimate
because significant inclination occurs early in the mission where solar
illumination is strong. If we require that the total power is 1 kW at
1 au (at 451 orientation) and assuming 20% overall efficiency for the
panels, then the required panel area is 5.35 $m^2$. This panel area fits
easily inside the 4 m diameter disk configuration which was discussed
above. It does not fit on a 2 m diameter disk area, however, so that in
the 2 m diameter cylinder solution which was discussed above, one
has to use deployable solar panels.
Comment: What is the source of the quote?
Comment: The quote is from the link. 'A comprehensive review of Electric Solar Wind Concept and its applications' Bassetto et al.  Progress in Aerospace , January 2022
Comment: @OrganicMarble  sorry the other link within the paper https://doi.org/10.1016/j.pss.2014.08.004
Comment: do you have any paper or report about positively charging using an ion gun? I can't imagine how an ion gun could positively charge tethers
Comment: @RicardoCasimiro  my typo, I meant negatively charging the sail, which is harder with an ion gun emitting positive ions.
Comment: The quote is not from that link. Is it from the full paper?
Answer: I found my answer in the power source of Voyager 2, link: https://en.wikipedia.org/wiki/MHW-RTG
Basically at launch it provides 470 W (and decay with time), so I think is viable and reliable to use it in electric sail.
I hope it can be useful for others in the future :)

Electric sails power consumption


Increase screen resolution with VGA Intel GMA 3150

Question: is there any way to increase the aspect ratio resolution netbook with intel GMA 3150 chipset from 1024x600 to be larger than 1280? I use Ubuntu Precise beta 2
Comment: Could you tell us a little bit about your configuration so that we can answer?
Your screen native resolution. and could you provide the output of these commands:
xrandr -q
&&
lspci | grep VGA
Comment: I use netbook 10.1, and standar resolution 1024x600. and I want to raise to 1280x750 or above, if it could?

this is output script for:
~$ xrandr -q && lspci | grep VGA –
Screen 0: minimum 320 x 200, current 1024 x 600, maximum 4096 x 4096
LVDS1 connected 1024x600+0+0 (normal left inverted right x axis y axis) 222mm x 125mm
   1024x600       60.0*+
   800x600        60.3     56.2
   640x480        59.9
VGA1 disconnected (normal left inverted right x axis y axis)
grep: –: No such file or directory
Comment: Sounds like the maximum and native resolution of your netbook screen is 1024x600. The screen you have does not support higher resolutions. If you try to force it, you may damage it. And to be sure, please provide me with the name and model of your netbook (e.g: Emachines or Acer Netbook 10.1).
Comment: my Netbook is Axioo Pico PJM A615 see these page: [link](http://axiooworld.com/region/index.php?act=product&goto=detil&id=PICO&type=PJM&hal=2)
Answer: Ok. I now have learned that the screen you have is manufactured to support a maximum of 1024 x 600 as resolution. It's physically impossible to force it to handle a higher resolution whatever the OS.
In another hand, to feel more comfortable, reduce the desktop font and launcher icon size. (Install Ubuntu Tweak for example:  )

And if you're not afraid to damage your screen, you can upscale its resolution to 1280 or even higher using the NewRez Script ( A script that uses the XRANDR utility for intel graphics). Download and instruction through here:
http://www.omgubuntu.co.uk/2010/11/set-your-screen-resolution-higher-than-you-should-with-newrez/
Comment: thanks for the help. actually when I using ubuntu maverick, I can change the size to 1280x750 with a nautilus script "newrez" but somehow since ubuntu uses gtk-3 script was not working well.
Answer: xrandr --output LVDS1 --mode 1024x600 --scale 1x1.28
works to a degree =)


App do not run on iPhone 3G in XCode 4.3.2

Question: I already know that issue related with armv6, and new "required device capabilities" plist entry.
Interestingly, I compiled and run fine in Xcode4.2 in exact settings. When I updated to 4.3.2,  I just can't run my app on iPhone 3G, but it fines newer versions of iPhone.
Here some screenshots from my project's settings;
Build Settings:

Executable Settings:

Plist file

Summary Page
Answer: Check your info.plist for "Required device capability". It should have "armv6" entry and not "armv7". XCode4's default is "armv7".


Is this proof correct (Rationality of a number)?

Question: Is $\sqrt[3] {3}+\sqrt[3]{9} $ a rational number? My answer is no, and there is my proof. I would like to know if this is correct:
Suppose this is rational. So there are positive integers $m,n$ such that $$\sqrt[3]{3}+\sqrt[3]{9}=\sqrt[3]{3}(1+\sqrt[3]{3})=\frac{m}{n}$$
Let $x=\sqrt[3]{3}$. We get $x^2+x-\frac{m}{n}=0 \rightarrow x=\frac{-1+\sqrt{1+\frac{4m}{n}}}{2}$.

 We know that $x$ is irrational and that implies $\sqrt{1+\frac{4m}{n}}$ is irrational as well (Otherwise $x$ is rational). Write $x=\sqrt[3]{3}$, multiply both sides by $2$ and then raise both sides to the power of $6$ to get:
$$24^2=\left(\left(\sqrt{1+\frac{4m}{n}}-1\right)^3\right)^2\rightarrow 24=\left(\sqrt{1+\frac{4m}{n}}-1\right)^3=\left(1+\frac{4m}{n}\right)\cdot \sqrt{1+\frac{4m}{n}}-3\left(1+\frac{4m}{n}\right)+3\sqrt{1+\frac{4m}{n}}-1$$
Let $\sqrt{1+\frac{4m}{n}}=y,1+\frac{4m}{n}=k $.
We get: $25=ky-3k+3y\rightarrow y=\frac{25+3k}{k+3}$, So $y$ is rational. But we know $y$ is irrational (again, otherwise $\sqrt[3]{3}$ is rational)  which leads to a contradiction. So the answer is No, $\sqrt[3]{3}+\sqrt[3]{9}$ is irrational.
Is this proof correct? Is there another way to prove this? Thanks!
Comment: This seems like a lot of work.  We know $x$ satisfies a cubic polynomial over $\mathbb Q$,namely $x^3-3$.  If it also satisfies a quadratic then the quadratic and the cubic would have to a common factor, which is clearly not the case (since the cubic has no rational roots).
Comment: Notice that after raising both sides to the power of 6, your next step is to take the square root of both sides. Why not just raise to the power of 3 to begin with?
Comment: @Théophile You are right, no reason not to just raise to the power of 3. Is this proof correct?
Comment: The proof looks correct to me.
Comment: Yes, it looks correct; the reasoning stands. Now, as lulu said, it is a lot of work and can be greatly simplified. Even if you keep the general structure here, you can save some writing in several places: apart from the power of 6 that I mentioned, also look at $1+\frac{4m}n$. This is clearly rational, and it's a bit cumbersome to write out, so why not replace it with something else? Indeed, you call it $k$, but why not make that substitution earlier, on the previous line? But let's be consistent and call it something like $\frac{m'}{n'}$ instead of $k$ to show that it is rational.
Comment: Another small thing that can be cleaned up: you have "Write $x=\sqrt[3]3$, ...". But we've already defined $x$ to be that value, so this statement is quite redundant and might even cause confusion because the reader now has to think, "hold on, is this the same $x$ as before? What's happening?"
Answer: Alternatively, denote $x=\sqrt[3] {3}+\sqrt[3]{9}$ and cube it to get a cubic equation with integer coefficients:
$$x^3=3+3^2(\sqrt[3]3+\sqrt[3]{9})+9 \Rightarrow \\
x^3-9x-12=0.$$
According to the rational root theorem, the possible rational roots are: $\pm (1,2,3,4,6,12)$. However, none of them satisfies the equation. Hence, $x$ is irrational.
Answer: Your proof is correct.
Let $\alpha = \sqrt[3]{3} + \sqrt[3]{9} = \sqrt[3]{3}(1+\sqrt[3]{3})$. We have
$$\alpha^3 = 3(1+\sqrt[3]{3})^3 = 3(3 + 3\sqrt[3]{3} + 3\sqrt[3]{9} + 3) = 12 + 9(\sqrt[3]{3} + \sqrt[3]{9}) = 12 + 9\alpha$$
Hence $\alpha^3 - 9\alpha -12 = 0$.
However, the polynomial $x^3-9x-12$ is irreducible over $\mathbb{Q}$ by the Eisenstein criterion for $p = 3$ so it cannot have any rational roots. Therefore $\alpha$ is not rational.
Answer: As everyone else has said, your proof is correct but more laborious than necessary. Here's an approach that I think may minimize the amount of calculation.
Let $x=\root3\of3$, so we're interested in $y=x^2+x$. The fact that $x$ is a cube root suggests thinking about things involving $x^3$, and if you're lucky the following identity, involving both $x^3$ and $y$, may come to mind: $x^3-1=(x-1)(x^2+x+1)$. Aha! The left-hand side of this is a rational number, namely 2. And if $y$ is rational then the second factor on the right is also rational. But that would require $x-1$, and hence $x$, to be rational, which it certainly isn't. So $y$ can't be rational after all, and we're done.
(An easy generalization of the argument shows that things like $\root5\of7+\root5\of{7^2}+\root5\of{7^3}+\root5\of{7^4}$ are always irrational.)


How to pass custom data in GeoJSON point?

Question: I have an application, which creates a GeoJSON stream on the server, which is then rendered on the client (using CesiumJS). GeoJSON is created using GeoTools.
I want to pass some custom data to the client about a particular point. This custom data will determine, how the client renders that point.
I add points using this code:
protected void addPoint(final double lon, final double lat,
    final GeometryBuilder builder, final SimpleFeatureBuilder fbuilder,
    final List<SimpleFeature> features) {
    final Point point = builder.point(lon, lat);
    fbuilder.add(point);
    final SimpleFeature feature = fbuilder.buildFeature(null);
    features.add(feature);
}

If I wanted to add a string property to GeoJSON, with, say, name id and value fooBar123.
How do I do it in Java (how can I modify the code above in order for id:fooBar123 to appear in the results GeoJSON string) ?
Answer: For the ID simply pass it in to the featureBuilder instead of null;
For other properties you need to modify the schema you generated the featureBuilder with. The easiest way to do this is to use DataUtilities.createType
SimpleFeatureType TYPE = DataUtilities.createType("Test",
   "ian:String,location:Point");
final Point point = builder.point(132.159633, 43.350116);
SimpleFeatureBuilder fBuild = new SimpleFeatureBuilder(TYPE);
fBuild.add("testing testing");
fBuild.add(point);
SimpleFeature feature = fBuild.buildFeature("foo123");

which will generate GeoJSON like:
{"type":"Feature",
 "geometry":{"type":"Point","coordinates":[132.1596,43.3501]},
 "properties":{"ian":"testing testing"},
 "id":"foo123"}

As you can see id is a special case and you can end up with two if you name a property id.


Question about correlations and independence

Question: My professor was discussing correlation and when it implies independence. It was fairly clear to me that, if $X$ and $Y$ are independent, then their correlation is zero. The reverse direction is less clear. Correlation being zero doesn't imply independence. This makes some sense to me because correlation measures linear association in some sense, but I am having trouble coming up with a concrete example of this. He also stated that, if $X$ and $Y$ are bivariate normal and correlation is zero, then $X$ and $Y$ are independent. Can someone provide a proof/intuition about this?
Comment: Uncorrelated variables can be dependent see https://stats.stackexchange.com/q/188242/35989
Comment: Another example: if $Z \sim \text{Normal}(0, \sigma^2)$, then $Z^2$ and $Z$ are uncorrelated but dependent.
Answer: Examples where the Pearson correlation coefficient is zero but variables are dependent (from Wikipedia):

if X and Y are bivariate normal and correlation is zero then X and Y are independent. Can someone provide a proof/intuition about this?

Consider Gaussian random variables $X, Y$ with means $\mu_X, \mu_Y$, and variances $\sigma_X^2, \sigma_Y^2$. Suppose $X$ and $Y$ are jointly Gaussian, and their correlation coefficient is $\rho$.
The joint distribution is:
$$p(x,y) = $$
$$\frac{1}{2 \pi \sigma_X \sigma_Y \sqrt{1-\rho^2}}
\exp \left [
  -\frac{1}{2 (1-\rho^2)} \left (
    \frac{(x-\mu_X)^2}{\sigma_X^2}
    + \frac{(y-\mu_Y)^2}{\sigma_Y^2}
    - 2 \rho \frac{(x-\mu_X)(y-\mu_Y)}{\sigma_X \sigma_Y}
  \right )
\right ]$$
In the case of zero correlation ($\rho=0$) this reduces to:
$$p(x,y) = \frac{1}{2 \pi \sigma_X \sigma_Y }
\exp \left [
  -\frac{1}{2} \left (
    \frac{(x-\mu_X)^2}{\sigma_X^2}
    + \frac{(y-\mu_Y)^2}{\sigma_Y^2}
  \right )
\right ]$$
This expression can be factored as follows:
$$p(x,y) = \frac{1}{\sigma_X \sqrt{2 \pi}}
\exp \left [
 -\frac{(x-\mu_X)^2}{2 \sigma_X^2}
\right ]
\frac{1}{\sigma_Y \sqrt{2 \pi}}
\exp \left [
 -\frac{(y-\mu_Y)^2}{2 \sigma_Y^2}
\right ]$$
We can see that this is simply the product of the Gaussian marginal distributions of $X$ and $Y$. The joint distribution being equal to the product of the marginal distributions implies independence.
Comment: You haven't addressed the case in which a density does not exist, a so-called singular Multivariate Gaussian
Comment: @MarkL.Stone Do you mean when the covariance matrix is singular? In the bivariate case this would imply perfect correlation between X and Y, no? So it would be outside the scope of the question, which starts with the premise of zero correlation.
Comment: "In the bivariate case this would imply perfect correlation between X and Y, no?"  No. If Y has variance of zero, then it is a constant (with probability one), and therefore independent of X (and not perfectly correlated with X).  I am not disagreeing with the statement to be proved, merely with the adequacy of the proof as presented.
Comment: True, I wasn't considering zero variance. But, then the correlation would be undefined. I'd be happy to improve the proof if needed, but I'm not seeing a bivariate, singular case with zero correlation as the OP asked for. Am I missing something?


How to interpret GRASS v.kernel results?

Question: GRASS manual reads:

v.kernel - Generates a raster density map from vector points data using a moving 2D isotropic Gaussian kernel ...

Ok, but how do I interpret the results? I understand that v.kernel is the more advanced than v.neighbor function but I'm unsure as to which advantages it has.
Answer: The results estimate points per unit area.  As a check, you should multiply the density values by the area of a cell and add up these values over the grid: the total should equal the sum of the original data.  (These two values often differ for two reasons, boundary effects and numerical imprecision.  The boundary effects occur because the density map can spread data off the edge of the map and those values don't get recovered from the density grid.  But the differences ought to be small.)
One image I have used in classes asks students to imagine the kernel as a bucket of sand: you upend the bucket at a point, allowing the sand to slump.  The slumping barely occurs for short half-widths but is extensive for large band-widths (maybe the sand is wetter ;-).  Regardless, it's always the same amount of sand left, no matter how slumping occurs.  Now go dump one bucket at the location of each point (or, more generally, if there is a positive value x associated with each data point, first put an amount of sand in the bucket proportional to x and then dump it).  The sand slumps.  It piles up in areas where there are lots of buckets.  The density grid gives you the height of the piled sand at the center of each grid cell.  Multiplying this by a cell's area estimates the volume of sand occupying each cell.  Summing this cell volume over any region (such as a Census block) estimates the total volume of sand in that region, which represents the total amount of quantity x you think is in the region.
Comment: +1 - I'm always looking for alternative dimensions of explanation for students (and myself ...) and this analogy is excellent.
Answer: Have you seen the Geospatial Analysis web book? They have a quite detailed section on point density, which covers Gaussian functions. Even in general I feel it's a very useful resource.
Answer: Here's a grossly oversimplified way to think about it:
Imagine a dartboard with several rings radiating out from the center. At each location in the result, a score is computed by putting the dartboard over the location and seeing where the vector points are on the dartboard. From that the score is tallied and the raster is made.
There are many variables to how this is computed:
-- the size of the dartboard (the kernel)
-- the shape of the dartboard (2D isometric or 'the same in every direction in x/y', i.e. a flat circle)
-- the way the dartboard assigns points (Gaussian implies a 'normal' distribution, i.e. higher scores as the point gets closer to the center, in a bell curve shape)
The advantage is that it will compute a much smoother version without large (discontinuous) jumps that can take in information with a wider and more consistent radius. It also will be less affected by the differences in size/shape of the areas used.
Think about using Nearest Neighbors on counties: On the east coast they are much smaller than the Midwest, but the number of neighbors is similar and largely affected the geometry of the boundary. Which is more dense? If your kernel radius is 50 miles you'd get a much different answer that described their relative density much more accurately.


finding work required to pump water out of a tank

Question: The tank has the shape of a horizontal cylinder with radius $r$ and length $l$. The water exists through a small opening on the top right side of the cylinder. It seems that there are two ways to solve this problem:

integrate horizontally
integrate vertically

My first attempt was done by integrating vertically. Slicing the cylinder horizontally produces a rectangle of length $l$ and width $2x$. Using Pythagorean theorem we obtain $x=\sqrt{r^2-y^2}$.
The volume can be found by adding up small rectangular prims, i.e., $V = 2xl\Delta y = \int_{-r}^{r}2l(\sqrt{r^2-y^2})dy$.
To make sure this is correct let $l=5$ and $r=2$. The volume of this cylinder is $V=\pi r^2h = 62.83$. The volume obtained using the integral is also $62.83$.
I encounter problems when I try to find the work required to pump the water.
The mass of the water is the volume times the density $$m = 2000l\sqrt{r^2-y^2}\Delta y$$
The force due to gravity is $$F = (9.8)\left(2000l\sqrt{r^2-y^2}\Delta y\right)=19600l\sqrt{r^2-y^2} \Delta y$$
The water must travel a distance of $-y+r$ to exit through the small hole, thus the work required to pump the water is $$W = 19600l\sqrt{r^2-y^2}(r-y) \Delta y$$
Which is $$19600l\int_{-r}^{r}\sqrt{r^2-y^2}(r-y)dy$$
After taking this (nasty) integral we get $$W = 9800\pi lr^3$$.
For some reason I seem unable to understand the horizontal integration.
I know the volume can be expressed as $V = \pi r^2 \Delta l$. Thus, the mass is $1000\pi r^2 \Delta l$, force is $9800 \pi r^2 \Delta l$ and the work is $$9800 \pi r^2 \int_0^l dl = 9800\pi r^2 l$$
Where does the other $r$ come from?
Answer: In short, all you've computed in the last integral is the weight of the water, not the work applied to pump it out of the tank.  The missing factor is the vertical displacement to the opening.
Honestly, I'm not sure if there's a general way to integrate horizontally and include the vertical displacement without adding an additional step where we integrate each "slice" vertically.
That said, in this case, it's simple enough to see that the center of gravity of the water in a filled tank lies $r$ below the level of the opening.  This vertical displacement from the center of gravity to the opening is where you find the missing $r$.


Does "peculiar" imply "unusual"/"hard to expect"?

Question: When something is called peculiar or having a peculiarity what does that mean? Does it just mean it has some specific features or does it mean that those specific features are unusual, not normally expected?
Answer: Pecularity means "an odd or unusual feature or habit", but also "a characteristic or quality that is distinctive of a particular person or place".

For all her peculiarities, he finds her personality quite endearing.
  Her essays characterized decency as a British peculiarity.

Peculiar means "strange or odd", but also "unusual", or (in peculiar to) "belonging exclusively to".

Her accent was a peculiar mixture of Cockney and Irish.
  The air hung with an antiseptic aroma peculiar to hospitals.

Peculiar and having a peculiarity have both the meanings you supposed.
Informally, peculiar means also unwell: she felt a little peculiar for a while.
[Reference: the New Oxford American English.]
Comment: The sense of "characteristic of" is now rather literary: in informal speech it almost always has the connotation of being strange or wrong.
Comment: I think you could say "How peculiar!" to mean that something was unexpected in the same way that [Alice](http://intranet.dalton.org/ms/alice/7.html) said "Curiouser and curiouser!"


The site template requires that the Feature {GUID} be installed in the farm or site collection

Question: I thought Microsoft did a good job documenting sp2010. I am so frustrated that I can't find anything related to this. I have a web template project. All I want is to run bunch of code when a web is provisioned. I put the code in the featureactivated of the webtemplate and it seems the code is not kicking in (and no error is given).
Comment: For reference, what is the GUID it can't find? Some of us are sad enough (no names!...) to be able to identify an out of the box GUID from one generated on the fly. Does it match the GUID that's in the feature in your WebTemplate project?
Comment: Yes sir, I copied the featureid from it's manifest file and made sure it's in onet.xml file.
Comment: Cool. Now ensure that the Feature exists in the Package in your project. Also, check in the SharePoint Root / 14 Hive under TEMPLATE/Features to see if your feature folder actually exists in there, once deployed.
Answer: Site Collection scoped features are not automatically activated on the Site Collection when you create sub sites.
Comment: In a round about way I hope my post includes this point :-)
Comment: lol, didn't see your post until I posted mine...
Comment: right on the money! Both of u beat me to this one. Saw it no more than 2 hours ago where i reactivated the web template solution and got the same error due to creating a subweb and site scoped feature didnt get activated. Actually in SP2007 site scoped features were activated at web level too, but that was a bug that is now fixed in SP2010
Answer: I'm not really a developer but I'll take a stab at this one given that our team is currently looking into replacing our custom site definitions with Web templates for SP2010. Feel free to correct me if any of this is incorrect - I'm certainly at the learning stage when it comes to Web templates.
At a basic level you will need to ensure that the feature (be it custom or out of the box) is activated. However, a more complex scenario involving sub site creation and feature dependency is described below.
One possible cause for this issue is attempting to create sub sites (Webs) using a Web template which depends on a site collection scoped feature that is not activated - i.e. you put an inactive site collection scoped feature in the "SiteFeatures" section of the ONET.xml file.
From what I understand SharePoint checks features in the SiteFeatures section of the ONET.xml file in the order specified. If a required site scoped feature is found but not active the above error is thrown. Note that this behaviour differs from that in SharePoint 2007 - back then any site scoped features were also activated for sub sites (this is a deliberate improvement in flexibility, not a bug).
To get around the situation described above, one option is to remove the site collection (Site) scoped from the "SiteFeatures" section in the ONET.xml and instead use a Web scoped feature to activate the required feature using an event receiver. If you choose this option you will need to ensure that this new feature is placed above the other Web scoped features in the "WebFeatures" section of your ONET.xml file.
Of course, the suitability of this fix depends on the scope of your Web template. If this is just a one off scenario you may wish to simply enable the required farm or site collection scoped feature manually using PowerShell.
As James has said it would be helpful to know whether the required feature is custom or out of the box in order for us to assist further.
See this post from Vesa Juvonen for more information: Link


What is the relative size of the radical of an ABC-triple relative to the number of primes up to its largest element?

Question: Write $\bf N$ for the set of natural numbers, and $P$ for the set of primes. For $x$ in $\bf N$ let $p(x)$ be the product of the primes dividing $x$ (that is, the "radical" of $x$). Also write $\#(x)$ for the number of primes up to $x$. Let $S$ be the set of triples $(x,a,b)$ of naturals with $\gcd(a,b)=1$ and $x=a+b$. For $s=(x,a,b)$ in $S$, let $f(s)=\#(x)/(p(x)p(a)p(b))$. What is $\limsup_{s{\rm\ in\ }S}f(s)$?
Answer: In more classical notation you seem to ask for
$\frac{\pi(c)}{\operatorname{rad}(abc)}$
for an ABC-triple $c= a+ b$.
By results of van Frankenhuysen one has infinitely many triples
such that
$$\log c \ge  \log \operatorname{rad}(abc)  + k \sqrt{\log  c / \log \log c}  $$
for some positive $k$.
Written differently
$$ \frac{c}{\operatorname{rad}(abc)}    \ge \exp(  k \sqrt{\log  c / \log \log c} ) $$
Now $\pi(c) \sim c/ \log c $, so for sufficiently large $c$
$$ \frac{\pi(c)}{\operatorname{rad}(abc)}    \ge k'\frac{\exp(  k \sqrt{\log  c / \log \log c} )}{\log c} $$
for some positive $k'$.
The right-hand side tends to infinity as $c$ tends to infinity, and so the limsup you ask about is infinite.
Machiel van Frankenhuysen, A lower bound in the $abc$ conjecture, J. Number Theory 82 (2000), no. 1, 91--95.


Create Windows/Macintosh Projector from Flash Builder 4

Question: Am I able to publish a Windows/Macintosh projector from Flash Builder 4? I would like a solution that stays within the IDE, rather than having to open FlashPlayer.exe and export the EXE/App.
Answer: You can display your swf in the standalone flash player, and then create the projector from there (file -> create projector).
http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_sa.exe
Answer: Closing this question...doesn't seem possible. I'm sticking with Flash CS5 to publish projectors.
Comment: I just tested this and Flash Player 10 standalone DOES work to export projectors. 11 for some reason did not.
Answer: I've had to do this with FB As3 projects. You have to convert your project type to Flash Professional Project: right-click project in the Package Explorer / Add/Change Project Type / Add Flash Professional Project Type. You'll have to create a fla to use as the source. Set the fla Class in the Properties panel to the main class of your project, and add all your resource libs & SWCs to Flash Professional Project: File/ActionScript Settings/Library path tab. This is important or you'll get compile errors. Seems like FB should do this for you, but it doesn't. Now in Flash professional: Commands/Export as Projector.
Many Years too late, but for future reference.
Comment: Yeah, I'm not even a Flash dev anymore. Thanks for answering, though! Hope it helps someone.


does ordering by lot of columns hit the performance badly?

Question: I just ran into a SQL query with about 5 different columns in the ORDER statement, is it a good practice and how does it play with performance?
Answer: The number of columns isn't very significant. The most important part is, whether the order matches and index, and whether the database engine is able to recognize this and use the index properly. However, there is some difference, of course. The primary key is usually much faster than other indexes because the other indexes need to do a primary key lookup afterwards, and and indexing a single integer field performs much better than indexing string fields.
There are several religions with regard to how to structure a database. Usually, you can minimize the amount of data by using integers as primary key, but many large databases in enterprises use several string fields in the primary key. There can be several reasons for that, but performance isn't usually one of them.
Comment: +1 By the way, you probably should say that ordering on the *clustered* index is fast.  It's not always the primary key index that is clustered.
Answer: Ordering on 5 or more columns is not question of good practice, it's about business rules: do you need it or not. If you must sort, then try to optimize it.
Some general steps:

First, check execution plan for target database.
If performance is at least "tolerable", then you're done.
Else:

vary number of fields in order by clause and see what performance difference it makes   in execution plan. It should give you some hints about bottlenecks.
try to improve performance by "appropriate" indexing.
check hints your database has - maybe you can make query analyzer do it better way.
Answer: If the business requirement stipulates that results be sorted by five columns then the only question to answer, assuming that there are at least a client and a server involved, is where to perform the sort?
So I'd guess that any answer to the question about good practice is going to have a huge dose of "it depends".
As to performance, if the requirement is for the sort, and performance is an issue, then again, look to see if there's a chance that sorting could be carried out away from the server.


verification of wallet to be verified

Question: To have btc transferred into a wallet does it need a certain amount of btc in the wallet for it to be verified. Does this amount depend on total btc to be transferred
Answer: No,
It is normal to be able to receive money into an empty wallet. Anyone who says otherwise is a thief trying to trick you and steal your money.
Wallets are not verified in any way by the Bitcoin network. Again, anyone who says otherwise is probably a confidence trickster trying to fool you into giving them your money.
Scammers like to use words that have some special meaning in the Bitcoin world and twist them to confuse their victims into doing what the scammer wants. In the Bitcoin world transactions are verified but not wallets. You can use Bitcoin without using any trusted third party such as a bank or exchange. If you do use a Bitcoin exchange they may ask questions as part of the Know-Your-Customer (KYC) laws, but this isn't verification of a wallet.
When you use Bitcoin to pay someone, your wallet creates a proposal for a transaction and sends this to a few other Bitcoin nodes (wallets etc). Those other nodes verify the transaction. The transaction has a transaction-fee included in it but the fee does not depend on the amount of money, only on the complexity of the transaction. The fee is usually very small (cents) but may need to be larger (a few dollars) when the Bitcoin network is very busy.

If you suspect someone might not be being completely honest with you, you can read some answers to questions here that will prepare you for some of the ways in which these kinds of thieves work:

fraud (Bitcoin)
scams (Personal Finance)
Answer: So obviously there is only one way to adjudge the providers and the users is to perform a detailed KYC and AML checks. There are a lot of solutions that provide this service providers like Shufti Pro and others are all about KYC services. In today's world one cannot overlook the entirety and severity fo the cause, so there are always solutions present when it comes to KYC and AML.  And as far as the wallet is concerned anyone who says other wise is just part of a large scam, but one can only be vigilant when it comes to bitcoin services.

verification of wallet to be verified


Full-SBS 3D movie bitrate when ripping

Question: When ripping movies from iso to full side by side format, 3840x1080 usually (1920x1080 each eye). Shouldn't the bitrate double? I've always wondered that,  what do you think?
Answer: Bitrate isn't linearly proportional to frame size. As frame size increases, it becomes more efficient to compress each uniform-sized block of the picture*. Consider that Youtube recommends that users encode a 720p video at 5mbps, and a 1080p video, containing 2.25 times as many pixels, at 8 mbps - 1.6 times the bitrate.
Also, in case of a stereo image, the two pictures have to be very similar to each other, in order to produce a coherent 3D image perception, so there's a lot of redundancy to be exploited by the encoder.
*if there's a lot of fine detail in the image, then it is not as efficient.

Full-SBS 3D movie bitrate when ripping


How to show $ \sin x \geq \frac{2x}{\pi}, x \in [0, \frac{\pi}{2}]$?

Question: I have tried the following:
$$
f(x) = \sin x-\frac{2x}{\pi} \\
f'(x)= \cos x-\frac{2}{\pi} \\
f''(x) = -\sin x \leq 0
$$
But this doesn't seem to be heading in the right direction as it would appear $f'(x)$ is decreasing and has a zero within the domain, so I'm not sure how this might be used to prove the inequality.
Answer: $\sin(x)$ is concave on that range and the line pass through $(0,0)$ and $(\pi/2,1)$ is $y=\frac{2}{\pi}x$
Answer: Let
$$f(x) = \frac{\sin{x}}{x} \quad\implies f'(x) = \frac{g(x)}{x^2}~~ \text{with} \quad g(x) = x\cos{x} -\sin{x} $$
and
$$g'(x) = -x\sin{x}\le 0$$
For $x \in [0,\frac{\pi}{2})$, we have $g'(x) \le 0$, then $g$ is decreasing whereas  $g(0) = 0 $.
Thus $g(x) \le 0$ on this interval. As a result, $f'(x) \le 0$ too, hence $f$ is decreasing on $[0,\frac{\pi}{2}]$. That is $$\frac{\sin{x}}{x} =f(x) \ge f(\pi/2) =\frac{2}{\pi}~~for ~~~0\le x\le \pi/2$$
Answer: Note that $f$ first increases from $0$ to some value and then decreases again to $0$, so it must be greater than $0$ all this time. The precise value is where $f'(x)=0$ and the graph of $f(x)$ will roughly look like a parabola.BTW, i.e. $f(\arccos(2/\pi))=\sin(\arccos(2/\pi))-(2/\pi)\arccos(2/pi)=\sqrt{\pi^2-4}/\pi-(2/\pi)\arccos(2/pi)$.
Answer:
Let $f(x) = \left\{\begin{array}{ll}\frac{\sin(x)}{x} & \mbox{if $x \in \left(0,\frac{\pi}{2}\right)$.} \\ 1 & \mbox{ if $x=0$.} \end{array}\right.$
By Mean value theorem applied to the function $g(x)=\sin(x)$ we get a $t\in (0,x)$ such that $\cos(t) =\frac{\sin(x)}{x}.$
Note for $t \in (0,x)$ we have $$f'(x)=\frac{x\cos(x)-\sin(x)}{x^{2}} =\frac{\cos(x)-\frac{\sin(x)}{x}}{x}=\frac{\cos(x)-\cos(t)}{x} < 0$$ for all $x \in (0,\frac{\pi}{2}]$.
Comment: I don't understand what you want to prove...
Answer: I would say, you have sort of completed this question. What you want to show is that f(x) >= 0 . You can say f' has critical point at around 0.881 (solve f'(x) =0 ). Then you plug 0, 0.881, pi/2 into f(x).
Then you show the statement sin(x) >= 2x/pi is true. It would be easier if you plot the graph and think about it. For plotting, I recommend, https://www.desmos.com/calculator
you can type, f(x) = sin(x) -2pi/x
g(x) =d/dx f(x)
and so on, to create 2nd, 3rd,,, derivative.


Android lost some apps - how do I dl Whatsapp again?

Question: My HTC Evo 4G piece of trash all of a sudden deleted some of my contacts and apps - including the app market (google play?).  How do I get Whatsapp back - which I paid for through paypal - if I can't access the market store?  Google play asks me to sign in with a gmail account - but I didn't use a gmail account when I bought the app so it doesn't show up when I sign in.
Comment: So you didn't use your GMail account to sign in, and payed using Paypal? For even one of the two, it cannot have been *Google Play* where you did that, as it required logging in with your GMail account long before the first version of WhatsApp became available. And they never accepted Paypal for payments. So you must have been in a different universe then.
Answer: You can pay for Whatsapp with PayPal on their own site, so it must have been from there.  You can download the app here...
http://www.whatsapp.com/android/
and, as it says on that page...

If you already paid for the service you will not be asked to pay for it again.
Answer: If you bought it with Paypal, it must not have been through the market.   Suggest you contact the developer for advice.


HB100 range extension with dish antenna

Question: I have interfaced an HB100 sensor with an ATMega microcontroller. It easily detects my hand movement upto 5-6" away only.
I want to extend the range of the sensor so that it detects movement upto at least 10 m. I see people use a dish antenna.
For that it requires LNB. I have no knowledge of RF, can someone please suggest how do I select LNB for the HB100? Or any other way to extend the sensing range which can save me from using LNB stuff?
Comment: A 5-6 inch detection range would indicate something is wrong with your setup.  Are you *moving* the target?  Although sometimes misrepresented as a "distance sensor" (shockingly in places that should know better, like Mouser) **this is a *doppler* sensor only able to detect motion.**  Also make sure it's not being distracted, eg any sort of fan can easily trigger these.  That said you're probably not going to get 10 meters from something like this.
Comment: Thanks for your reply. i am not detecting distance, I am detecting speed but the problem is it detects movement from a few inches only. It does not responds to any movement happened beyond this distance.
Comment: Then there's something wrong with your particular unit or setup.  You should get at least a few meters.
Comment: Any idea what can be wrong with my setup?
Comment: Maybe coupled noise, maybe a bad module
Comment: Regarding noise can you please have a look at my circuit. attached in the question.
Comment: Your circuit doesn't include any of the coupled components - power supply, Arduino, etc.  But rather than posting those, do a test which eliminates them - batteries, simpler output, etc.  Also get another example of such a module to try.
Answer: Taking a look at a teardown of the HB100 module, it appears that the antenna is a pair of two-element patch arrays (one for TX, one for RX) on the back of the board. There's no coaxial out. It'll be very difficult to bodge it into a standard feed horn for a dish.
You might be able to install the module itself at the focus of an old VSAT dish, with the antenna face of the module pointed at the reflector. This isn't super ideal: the patches aren't designed to be a dish feed, so your aperture efficency will likely be pretty awful as you won't illuminate the whole dish and/or you'll have signficant spillover. But, it might work in a pinch.
Either way, keep in mind that you are increasing the EIRP of the module by doing this, and that you may run into regulatory issues if it's too high. I'd suggest learning more about RF and radar before attempting this.
Comment: I have placed the sensor right in the center of the dish without any LNB etc. it still responds to really close motion only.

HB100 range extension with dish antenna


How do I write a successful book at a young age?

Question: I am 10 years old (almost eleven), and I'm trying to write a novel. I discovered it is a lot harder and stressful than I thought. I'm also scared of people judging it negatively. This seems a lot more complicated than I thought, and I don't have anyone helping me, other than suggestions. Help! :'(
Comment: I'm voting to close this question because the minimum age for use of SE is 13.
Comment: Also, way to go, user59719! Way to rock that kid power(I'm also a kid, but I'm older than you by about 4-5 years)!
Comment: SE? What's that stand for?
Comment: @Holythe4th 'SE' stands for Stack Exchange' Chenmunka is referring to one of the Terms of Access rules. (See [this post in Meta.SE,](https://meta.stackexchange.com/questions/195939/minimum-age-on-stack-overflow) plus whatever's linked there.)
Answer: Writing a successful novel at a young age is the same as writing a successful novel at any age.
Working backward, you write a novel that people will pay money for. To do that, you have a write a novel. As you've learned, that is hard. Fortunately, there is no external reason for it to be stressful. By that, I mean writing a novel is not like running into a burning building to save a family of nuns and orphans. Therefore, learn to not stress out. You are inhibiting your own creativity. Of course, how you go changing your behavior is a really big question beyond the scope of this discussion.
To write a novel, sharing your work is an absolute necessity. This means you need to set your expectations realistically. Some people will react negatively. They might be well-intentioned and actually doing their best to help but are ineffective at being helpful.  Some might actually be being very honest, but not tactful. As the author, it doesn't matter what anyone says or thinks about your writing, its your creation. Your opinion is the only opinion that matters, in the end.
This means there is no reason to be scared when sharing your work. Of course, it's natural to feel that way. In fact is understandable. It feels very vulnerable. But, in the end, all it ever amounts to is people will tell you stuff about what you wrote and sometimes you'll be appreciative and find it useful and other times you'll get mad and sad and discouraged.
But, you'll think about what they said and decide for yourself whether they are making a good point badly or are articulating a bad point very skillfully. You might change what you wrote like they said or write it differently or ignore them. That is all people being negative about your writing amounts to.
The most important thing to do to learn to write is to read and read and read some more. You do this to learn to read critically. Because you want to understand why the author wrote each of their sentences they way they did. It's important to read good writers and bad writers.
Fortunately, Amazon self-publishing has unleashed a torrent of bad writers in practically every genre. I know that sounds harsh, but that doesn't change the truth. The "Look Inside" feature on Amazon books, lets you read the first chapters of e-books.  And e-books with ratings of 1 star are usually really bad. You can learn by reading them.
Answer: There are basically two types of writers, plotters and "discovery" writers.
A Plotter basically makes an outline of the entire story, decided how everything is going to go (the plot of the story) before they actually write much for a reader to read at all.
A Discovery writer does not figure out the whole plot at all. I am a discovery writer, and I would recommend this approach as a way to start. Some famous authors are discovery writers, including Stephen King (writes horror), George R.R. Martin ("A Song of Ice and Fire", the novel that became the TV series "Game of Thrones". Ray Bradbury, writing science fiction and fantasy. JK Rowling, the author of the Harry Potter series.
What Discovery writers do is really focus on their characters, and the personality of their characters. They get into their heads. They imagine the normal lives of these characters, how they behave, how they treat other people, what they do for a living, what they are good at and (this is important) what they are bad at. Their weaknesses.
They can start to write then, in most books the first 1/8th of the book is following the main character(s) in their normal life.
At that point, something happens. We call this the "Inciting Incident" (call it II). It is a problem that our main character has to solve. Often, for a discovery writer, this II was the idea of the story, like, "What if (II) happened to somebody?"
Now what is going to happen in the story is the Inciting Incident happens, and our MC (Main Character, or if we have a team, the Main Crew) is going to try and deal with the II, but they are going to fail. The II is going to get worse or bigger, and by the time we get to 1/4 of the way through the story, the II will have grown into a problem so bad, the MC has to leave their normal life and devote all their time to dealing with the II.
That first 1/4 of the story is called Act 1.
Now you could plot that out, but Discovery writers basically just get into their characters head, pretend they are that character, and figure out what a person like that would do, or would try. Just remember they have to fail, their attempt is going to backfire and make the problem worse.
What we are going to do is follow what is called the "Three Act Structure". But it is really 4 Acts, so Act 1, Act 2a, Act 2b, and Act 3. Each of these 4 acts is broken into 2 parts. Like the Act 1 is Act 1 part 1, the Normal World (of our MC and maybe our Villain). At the end of Act 1 part 1 is the II (Inciting Incident), then Act 1 part 2 is "Consequences of the II", where the MC tries to deal with the II, and it backfires. At the end of Act I is a dramatic moment, the MC is forced to (or feels they must) "Leave the Normal World".
Below is a graphical representation of the Three Act Structure for a story, which is by far the most followed in professional fiction. It has suggestion points along the way for what kind of story you are writing in each section, the milestones you should be reaching.

Now this has more milestones than I use, I typically use the Green Boxes, Gold Circles, Green and Purple Diamonds. You can see those occur every eighth of the story. The little Brown Circles break it down into 16ths of the story, which you can use too if you want.
These milestones can be used for plotting to begin with, but for a Discovery Writer, they can also be used like a compass, a direction for writing, and the type of story you should be telling for that eighth of the story, the kind of event you have to invent for this next part of the story.
It is important that your hero, your MC, has flaws, and they really have to matter. Watch the stories on TV. Although the hero usually wins in the end, notice that in the good stories, the hero usually gets the living crap beat out of him, but keeps getting up and fighting some more. You can see this in Die Hard movies, especially.
Readers don't tend to like heroes that always win and never lose. Those are "wish fulfillment" stories, and beginning writers love to write them. But they are boring. In successful fiction, the main quality of a hero is that they would rather die than give up, and they prove that by getting kicked, beaten, run over, blown up, shot, stabbed, burned, and losing again and again, but they keep getting up to fight again, until they frikkin' win.
Watch your favorite Hit movies, but try not to get immersed in the story. Watch them to learn how it is done, and count how many times the hero gets hurt, or tricked, or set back, or tries something and it backfires, or they lose something (or someone) they loved, or they make things even worse. Notice how much it hurts, physically and/or emotionally. Sometimes they may seem to give up. But despite the hurt, eventually they do get up and keep on trying. They would rather die than fail. That is what makes a compelling hero.
Because in real life, readers can relate to people that make mistakes, but they do not relate well to people that never make a mistake and end up rich and successful. Real people like to fantasize that they can still succeed and win despite the mistakes we've all made in life.
Now in the finale, the chart says "all ends well and the hero marries their  sweetheart", but that isn't how I learned it. What I learned is the finale is called "The New Normal".
Basically the MC returns to their normal world, or if that was destroyed, then they find a new Normal life for themselves. You don't have to write a write a romance!
In the Movie "E.T.", for example, the 10 year old Elliot doesn't "marry his sweetheart". Just think of the finale as a satisfying final success, and what Elliot does is succeed in helping E.T. return to his own people, evading all the government people that were hunting him. The movie poster takes the iconic snapshot of this moment: Elliot on his bicycle, E.T. in the basket, framed by the Moon and flying above the forest. That is the final victory for Elliot and E.T.
At 10 yo, I would not try that if I were you. In your place, I would try writing a world you can understand better. It doesn't have to be something you have experienced. Just like Harry Potter isn't anything a 10 year old has ever experienced, but it is fun for a 10 year old to imagine, and it doesn't contain any romance at all. I'd put your MC in a position you can understand, perhaps for a 9 to 11 year old.
There is a maxim (a well known piece of advice) out there called "Write what you know", but it doesn't have to be literally. For you, it would mean writing from the point of view of a 10 year old, but that could be a 10 year old discovering something magical, or experiencing some adventure, or like "E.T." Elliot finding and meeting an Extraterrestrial alien.
The other notes on this graph, you can also take metaphorically. You don't have to have a McGuffin, for example. At plot point 81% the "twist" doesn't have to mean everything is the opposite, it can be some other twist. The hero learns a member of his team is a traitor, or the hero finally understands something that happened earlier, and that gives him the key to defeating the villain.
Also note that the "villain" doesn't have to be a person: In some stories, the villain is just nature. In "Cast Away", with Tom Hanks, Tom is stranded alone on a deserted island. He struggles against nature to survive, to maintain hope, and eventually finds enough to build a raft and escape, then gets rescued. But then, having been gone for four years, he cannot return to his Normal World. His wife, thinking he was dead, remarried. He basically has to start a new life, and find a "New Normal". There never was a human villain.
Also villains do not have to be evil. They can be regular people people trying to do their job. In "The Fugitive", Harrison Ford is wrongfully convicted of his wife's murder, but due to a bus accident, he escapes and runs because he wants to prove his innocence. The "villain" is Tommy Lee Jones, a US Marshall, but he isn't evil, he is just a cop doing his job, and doing it very well. He has to pursue a convicted killer (as far as he knows), and Tommy Lee is very smart and doesn't break any rules, so this puts enormous pressure on Harrison Ford to try and stay one step ahead of Tommy Lee Jones; and sometimes he fails and has to risk his life, again and again, to both get away and at the same time find the real killer. In the end, they both win: Harrison Ford finds the evidence and the real culprit and the real motive, Tommy Lee Jones promises to help Harrison Ford get acquitted, and Harrison Ford surrenders to Tommy Lee Jones.
Again, nobody marries anybody, but the finale is a satisfying conclusion to the mystery and the hero's problem in the story.
If you have questions or want more detail, write another question, and let me know in the comments below.
Answer: As a fellow young writer, I understand the doubts that one may face while writing on the side. First off, no worries, there is no pressure on anything because writing takes time and effort. My first tip is just write, don't worry about judgement or anything like that as ideas (any ideas) can truly make a difference. If you are thinking that your book is complicated or that you can't easily find inspiration, maybe you should seek for the inspiration deeply. It took me around 3 books that I felt overwhelmed to finish, to actually find the moment and scene in my head that screamed "This is what you will write!", and it came after watching a movie in the cinema that inspired me to do that. If your current book is not working out, don't worry as it may need some time to take off in your head. In the meantime, maybe there's another book you feel more compelled to write, and that's okay! The least you want right now is to feel like writing is complicated...it's not really if you are compelled by your book. I would personally worry about the opinions of others when I finish my book, so I can have it ready and feel good with what I've written first. The priority is your opinion of your book, not what others think. If something does not feel right about it, maybe it needs some time. This does not mean that you are giving up writing the book, the other three books that I never finished are not books I've rejected from finishing. They are just books that I will finish later, when I have a better idea of how to handle them, as the book I am writing now is making me feel less worried and more inspired to keep it up. In the end of the day, there is no chance that the book you are writing is not good! Not a single chance, because art and literature are subjective. If someone says a negative review, there is also someone that will way a positive review. Lastly, don't worry about time, books take a while to write, and you may publish it whenever you feel confident to publish it. You don't need to make headlines saying "young teenager publishes book", it's okay to wait a few years and you'll still say that "I started this when I was [insert age] young", it's just as impressive.
Answer: Very likely, you don't.
Writing requires training, just like any other skill. Which is why most writers publish their first novel at around 40 years of age.
Also, most writers cannot live from their writing. In 2018 in the US, the average writer earned $6080 per year.
If you want to be a successful writer, you will need:

patience, tenacity, perseverance, dilligence, and
a job (other than writing) that you enjoy, that pays well, and that allows you to work part time.


In Saekano S2, why does Kasumigaoka and Sawamura leave Tomoya?

Question: I thought Kasumigaoka enjoyed being with Tomoya? And Sawamura was his childhood friend...
Answer: Originally; both were content just to be with Tomoya, but after being scouted out by professionals far more experienced than them (in the last arc); they realized that they had more to go in terms of experience/skill.
Adding to the fact that a rare opportunity to work in your desired field (being scouted no less) is just too good of an opportunity to pass on.
This is one of the reasons why I liked the second season, it's because the theme: "We can't stay the same forever" or that "Nothing lasts" was very well executed.

In summary: Katsumigaoka, and Sawamura felt that their skills won't improve any further by being with Tomoya, so they left in an effort to improve their skills so they can make even better games with Tomoya in the future.


static.domainname.com

Question: I see more and more sites that create vhosts and host files on static.theirdomainname.com. What's up with this? Why is this a pattern I've seen?
Answer: Splitting files across multiple domains tricks the browser into opening more pipelines, speeding downloads for clients on broadband connections. Older versions of IE had way too few pipelines by default.
Using a hostname without cookies also reduces the amount of data the client sends the server, slightly speeding things up.
Answer: Sometimes companies will pay a 3rd party company to host their static content (images, stylesheets, video, etc) on something called a Content Delivery Network (CDN), which has nodes (aka servers) all around the globe. They'll keep copies of your content on all those nodes, so that when people visit your site, the content will be delivered quickly, from the node closest to them. You create a sub-domain (like static.domainname.com) and point it at the CDN's DNS, then they take care of forwarding requests for your static content to the perfect node. Some popular CDNs include Akamai, Amazon CloudFront, and Nirvanix.
Answer: A browser supports only 2 concurrent connections to the same domain. A subdomain or another site will bypass that limit, so many sites create a site for static content to both help with caching and speedup the loading of their site.
Comment: @Ólafur Waage: Ok, I removed the comment.
Answer: With most websites, you use a server which runs your code. In most cases, this is something like Apache. The problem with Apache is that it's very heavy: it uses a lot of resources, it has to load a bunch of stuff that it may or may not end up using, etc. etc.
Effectively, Apache does a lot of beating around the bush before it actually does anything. Granted, if you're running a script, all this beating around the bush may be necessary: loading PHP, initializing settings, etc.
But if the user requests something like, say, and image, you're wasting server resources. Having a separate server with its own subdomain (i.e.: static.xyzcorp.com) lets the programmer offload all of that static file hosting to a server software like lighttpd that FLIES through static files. This server can't run scripts, though (or at least not very complex ones), and really has no other purpose than sitting there and throwing out files.
You might think, "Well, it's only static files. How much could it be?" I've personally had issues where static file hosting on my servers accounted for more than 40% of CPU usage. Offloading the static files to a separate server (or in my case, a CDN) freed up a chunk of bandwidth and a block of CPU time.
Hope this helps!

static.domainname.com


Exchanging hash value over the internet

Question: Assume I want to exchange a hash value between two machines for some purpose, how do I prevent Man-in-middle from capturing it without encrypting the hash value itself?
Comment: @Stephane: sign is to prevent modification. To prevent interception you need encryption...
Comment: Digitally sign it
Comment: The good old way: write it on a removable media on one side. Use plane, trains, boats, horses, bicycles or simply your feet to ge to the other machine and use it there.
Comment: More seriously what answer do you expect? Only encryption be it payload itself or through an encrypted channel can prevent MITM attack...
Answer: You can create an ssh tunnel between the two participating machines and can send the unencrypted data.
Say you are using linux.
1) First create a ssh server on the machine receiving the data you can use openssh to create it.Install openssh-server and then add port to listen in /etc/ssh/sshd_config

sudo apt-get install openssh-server

2) Now after the server is created you can access it from other machine using ssh clients available like putty or ssh command line.

ssh username@ip -p port

3) Now you can copy file using scp.

scp -P port file username@ip:new_file
Comment: This answer is really short. Can you expand it at all by giving more details?

Exchanging hash value over the internet


How can I reference the 'active' item in an instance of jQuery serialScroll?

Question: I'm coding a feature for a photographer that is very similar to a slideshow. I've decided to use the jQuery serialScroll plugin (which piggybacks on the scrollTo plugin) to achieve this affect. I based my code off of the slideshow on the serialScroll demo page, which is almost exactly the functionality that I was looking for.
I've got the code working successfully, but I'd like to achieve one more effect. If possible, I'd love for the items in my slideshow (in my case,
 elements), to be semitransparent by default, with only the current (or "active," or "selected") item showing at 100% opacity.
I can control the transparency with CSS easily, but I am struggling to track the last item that serialScroll has animated to. How can I interact with the currently "active" item via jQuery so that I can give it a class or perform other actions?
Answer: you can do this is different ways,you can add an attribute to your
 tags, or you can use class like this:

test1

test2

test3

and with this code in jQuery you can change the active element.
$('ul li').click( function () {
$(this).parent().children().removeClass('active');
$(this).addClass('active');
});

and with this one you can grab the active one
$('ul li.active').html()


How can I connect Rasberry Pi to internet via a 4G network?

Question: I want to connect Rasberry Pi to internet via 4G network.
The idea of my project is to take a picture (or stream a video) with Rasberry Pi camera and send it to a distant cloud (say a Docker container) or a server (I don't wanna process images on Rasberry Pi) via 4G network or Wifi network. I've seen people send small data over 2G network (GSM), but the problem is that my data will be large so I need to send it over 4G or Wifi.
I want to know how to make Rasberry Pi send data to a distant Cloud or a server.
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Comment: I removed the "or at least wifi" and improved the focus of your title, since asking how to connect a Pi to wifi is already dealt with here, there, and everywhere exhaustively.
Answer: The answer is the same as it would be for "how can I connect my laptop to a 4G network", etc.

Using a 4G USB modem; these come in stick size form factors and start at ~$20 US.

Using a portable 4G wifi router.

By connecting via phone (or other 4G connected device) hotspot.

All three of these require a valid SIM, obviously.
Answer: If you're saying WiFi is an option, then go for this. You need a WiFi capable Raspberry Pi board or a USB dongle. In addition to @goldilocks answer, there are also 4G HATs (e.g. from Waveshare) for the Raspberry Pi that allow for a compact integration and sometimes even have GPS included.


What are things you can do to insure your plot doesn't have hole while you're writing after you wrote the plot?

Question: What are things you can do to insure your plot doesn't have hole while you're writing after you wrote the plot? Is there some kind of trick or tip to insure that after the plot is written, the subplot or parts of the plot doesn't cause some kind of plot hole down the road?
Comment: ["A wizard did it"](https://www.youtube.com/watch?v=sVgVB3qsySQ) Just ensure your story has wizards. Having test-readers will also help.
Comment: what have you tried so far?
Comment: What do you mean "while you're writing after you wrote the plot". Does that mean after you've finished writing the story? Are you writing the main plot first and then putting in subplots? Have you plotted out the work before writing? Or something else? Please explain your process in a bit more detail.
Comment: @Stuart F My understanding is that OP wants to polish the plot _before_ writing an actual story.
Answer: There are any number of times and places to discover and deal with plot holes.
First, you mentioned writing out the whole plot before writing the story. This is a good way to make sure it all makes sense.
But sometimes, you get to the big twist and as part of your research you discover your big twist actually would not work. Those institutions have a 3 year waiting list, or you have to agree to be nominated for that award so you couldn't be surprised with a win, or whatever. This is where your second approach comes in. You're the writer, fix the hole. Invent a different award where you don't have to consent to being nominated. Go back to Chapter 2 and have the character join the actors union grumpily just because they want to be able to walk in and out of their office where a movie is filming outside. This feels at the time like you just included it to show the character's personality or to contrast them with someone who didn't  -- but then the union card in their pocket fixes what would have been a plot hole in Chapter 22.
Or, take a third approach - no-one is going to notice with all these bombs going off! Sometimes after I finish a book I slowly become aware that the Big Thing couldn't have actually worked that way, but I didn't notice during the action packed climax because there was so much going on. I forgive these books for that.
The fourth approach is to lampshade it. Have one character tell another that normally, [reason the thing they're doing could never happen], so it's amazing that [the pandemic, the election, the lottery, whatever] made it different this year. And then just carry right on.
If your characters, your setting, all the rest of your plot, and so on are all delightful, only a tiny handful of people are going to spot small holes. You plan in advance to minimize them, you go back and add stuff earlier to prevent them, you invent similar-but-not-the-same scenarios to which the plot hole doesn't apply, or you breeze right past it and hope it doesn't matter in the end. Lots of choices.
Comment: I've sometimes even gone with the "I don't understand. That shouldn't have worked," approach. Imply there are additional extenuating circumstances the characters are not aware of that made the plot hole work. Then you can leave it as a mystery OR if you later think of a clever way to close the hole, it becomes a new story element.
Comment: I read an article by a novelist once where he said that he spends a lot of time putting doors in alleys. He explained that he means, If in chapter 10 you say the hero ran into an alley to escape the villain, and there just happened to be a convenient door in the alley that he went through and locked behind him and now he was safe, that sounds lame and the reader will say, Aw, come on, how did he know he'd find that door? But if in chapter 8 you have the hero have some reason to go down that alley and find that door, then when he uses it in chapter 10 it seems fair.
Answer: Alpha and Beta Readers:
No, there is no magic formula as you are composing a story to be sure you have exposed all the possible plot holes that may disrupt internal logic. But what you can do is mobilize the resource of another brain to look at the plot and say, "Huh? Didn't you say Rupert was going to die of thirst in the desert in chapter 3?"
Sometimes you can get so fixated on your beautiful scenes or stories, and the sheer poignant agony of what is happening to the characters, that you lose track of stuff. A new set of eyes (and it sounds like you would benefit most from an alpha reader or even a co-author) will be able to back up and take the 10,000 foot view, exposing problems you can't see yourself. At the earliest stages, this person can even just be someone you bounce ideas off of to see if things make sense.

A careful outline of the story won't solve the problem, but may make problems more apparent. Some people will write a timeline of what is happening to various characters, so if B happens before A, it gets noticed in a story where A-B-C happens in order.

But in the end, nothing beats another set of eyes to notice when something smells fishy. Wait, I thought this story was in a desert. WHERE DID THE FISH COME FROM?!!??
Answer: I don't think there's any magic trick. I think it's just, Read back over your story looking for plot holes. Get others to read your story and tell you if they see any plot holes.
As others have noted, sometimes you can get away with plot holes. I've read or watched plenty of stories where the hero does impossible things. If it comes across as, "Wow, isn't it cool that the hero can do all these amazing things? Wink, wink.", that can be a great story. But if it's presented as if this was totally plausible, and the reader can easily see that it's not plausible at all, the story is going to fail.


Ineffective setting: Wi-Fi non-persistent MAC randomization

Question: Sometimes I want to use a certain hotspot providing free 1-hour Wi-Fi multiple times, but the provider remembers the MAC address of my smartphone.
I enabled the developer setting "Wi-Fi non-persistent MAC randomization" and enabled the advanced connection option "Use randomized MAC". However, no matter how many times I click "Forget" on the connection next time the phone assigns the same MAC address.
So currently I can only connect two times: with the "randomized" address and then switch to the physical address.
The phone is Pixel 3 XL, Android 12
Answer: It seens that the MAC address is assigned each time you activate Wifi. So turn off wifi  and then turn it on again.
More discussion here


Chow's test and serially correlated model errors

Question: how can one handle a time series with the Chow's test (in order to find a structural break) so that the assumption of independent model errors holds? I'm using the R function chow.test {gap}
Comment: I'v found an interesting article on this topic. The title is "The Chow test with serially correlated errors" by Isabella Consigliere. This article is archived in Jstor. For your reference, the detailed information of this article's publication is the following: Anno 89, No. 2 (aprile-giugno 1981), pp. 125-137 Published by: Vita e Pensiero – Pubblicazioni dell'Università Cattolica del Sacro Cuore Article Stable URL: http://www.jstor.org/stable/41624786
Comment: I am also interested in this question, as the autocorrelation will cause the Chow test to be more likely to detect structural breaks that don't actually exist, so a way to compensate for this would be very useful.
Answer: I implemented the CHOW Test in AUTOBOX by forming an appropriate ARIMA structure and then simply using all estimated parameters (both regressor coefficients and ARIMA coefficients) in the test. In fact in the case of just 1 group/class this test is used to find the point in time where the greatest contrasts exists thus testing the hypothesis of constant parameters over time. You can do the same in R or any other programming language just be careful about outlier effects and possible non-constant error variance. See How can I programmatically detect segments of a data series to fit with different curves? for an application of the CHOW test to detect possible regime changes.
Comment: Congratulations on reaching 10,000 points, I have personally benefited on reading your posts on time series forecasting and outlier correction methods.
Comment: I really appreciate your frankness and your very evident scholarship.


Expanding universe as predicted by the Einstein Field Equation

Question: Without the cosmological constant, the Einstein field equation predicts the universe is expanding. Why is that? It is counter-intuitive because generally gravity should pull things closer and shrink the universe.
Answer: The Einstein field equations predict that the universe can expand, not that it is expanding. The fact that the universe is expanding was first observationally discovered by Edwin Hubble in 1929. Before this discovery, Einstein had introduced the cosmological constant to keep the universe from collapsing under the influence of gravity. When he heard of Hubble's discovery, he removed the cosmological constant from the equation, as expansion could explain why the universe wasn't collapsing due to gravity. The inflationary universe theory gives us clues on how the expansion first originated/occurred after the big bang.
Answer: Let's consider the motion of a ball in the Earth's gravitational field:

if you just let go of the ball it falls down
if you throw the ball up it first rises then falls down
if you throw the ball really hard it rises, escapes the Earth's gravity and flies off never to be seen again

So with the same ball and the same Earth we can get three different types of behaviour. The difference is of course in the initial conditions i.e. the velocity of the ball at $t = 0$. If we know the equation of motion of the ball then we can work out what initial velocity it had.
The FLRW metric is sort of the equation of motion of the universe, but there's a big difference from the equation of motion of the ball because we can't just choose any initial conditions we want. We only get a solution to Einstein's equations for particular initial conditions, and those are the conditions that the universe was expanding at the Big Bang.
Sp the universe had to start off expending. And you're quite correct that the combined effect of all the matter in the universe is to slow that expansion. If the matter density in the universe is high enough then it slows the expansion to a halt and the universe recollapses, sort of like a thrown ball falling back to Earth. This is called a closed universe. If the matter density in the universe is very low then it can't halt the expansion, sort of like the ball escaping the Earth's gravity. This is called an open universe. We think our universe is in between and it's a flat universe.
The point of all this arm waving is that you are quite correct to say:

gravity should pull things closer and shrink the universe

and actually gravity does to that. However the universe was expanding to start with so gravity has to work against the initial expansion.
Answer: Expansion of the universe is not related to gravity. Gravity pull things around mass by bending space. But overall space in the universe just keep expand by other reason


Drupal MySql database design question

Question:
I was just looking at the MySql database created by drupal after I installed it.
All the tables are in MyISAM.

With a complex software like drupal, wouldn't it make more sense to
use foreign keys and hence InnoDB tables to enforce referential integrity?

Without foreign keys all the constraint checking will happen at the
PHP end.
Comment: One would think that Drupal would want to preserve this referential integrity, but they thought that the ability to use any database vendor was more important. For more info/discussion see http://drupal.org/node/911352

P.S. I know I am posting in an old post, but I want to help those who search.
Answer: MySQL offers a variety of database engines for a reason - different engines offer different advantages and disadvantages. InnoDB is a great engine that offers referential integrity as well as transaction safety, but it is poorly optimized for the use case of web site where you have order of magnitude more reads then writes.
MyISAM offers the best performance for a web site where most hits need only read access to the database. In such cases referential integrity can most often be maintained by writing your data inserts and deletes in a way that they cannot succeed if they compromise integrity.
For example, instead of writing
DELETE FROM mytable WHERE id = 5
you can write
DELETE mytable FROM mytable LEFT JOIN linkedtable ON mytable.id=linkedtable.ref WHERE id = 5 AND linkedtable.ref IS NULL
This will succeed in deleting the row only when the are no external references to it.

Drupal MySql database design question


How did the Shitim tree grow in the desert?

Question: According to the Mefarshim, the source for the woods for the Mishkan was the Cedar trees that Yakov planted in his way to Egypt. According to the size of the woods needed for the Mishkan the mefarshim says that these are Cedar tree and not Acacia. How can Cedar trees grow in desert? Moreover, they need plenty of water. If you say that it was a miracle, so it is known that you can't trust on a miracle (אין סומכים על הנס). So why did Yakov decide to take the chance and plant them and how did they actually grow in desert?
Comment: There is evidence that the Sinai and Negev was less arid a few thousand years ago than it is today.  Still a wilderness and a desert, but less dry.
Comment: Whoever wrote the Heb. Wikipedia entry on shitta disagrees with your cedar identification, per other sources. The acacia has been found to grow in hot areas such as the Negev and in Egypt (but a reminder - the Nile area is very fertile). What are your sources?
Comment: Even if we don't _rely_ on miracles, it doesn't hurt to plant them.  If they die they die and we're no worse off than if he hadn't planted them in the first place.
Comment: "The meforshim" is a dangerous idiom. It usually means someone took sides in a machloqes. We are talking of dozens of voices over the course of centuries. If a topic requires something said about it, it is very unlikely there is a consensus opinion.
Answer: As pointed out in the comments, the identification of the tree is debated. However, as Prof. Zohar Amar, who specializes in the natural history of ancient times, and in particular, the identification of plants and animals in traditional Jewish sources, pointed out in this blog post, the most common identification is that which was first suggest by Rasag, the acacia. Prof. Amar thought that the subspecies brought out of Egypt by Bnei Yisrael was either A. nilotica, which grows near the Nile, or A. albida, which grows in northern Israel, thus fitting this tradition about the origins of the shittim used for the Tabernacle.
As the acacia is a tree that can grow in desert areas, then we can understand the Yaakov was not expecting a miracle. Moreover, if the particular variant was the Nile variant, then all the more so - they were trees befitting Egypt.
Perhaps you were basing yourself on this gemara that says that the shitta and other trees are considered cedars (ארזים)? I think the simple understanding is that the gemara meant that all of these trees can be classified as types of cedar within a certain context, but that doesn't mean that all of these trees are actually cedars (and see here). I think it would be difficult to imagine myrtle as literally a type of cedar, for example...


Android lollipop Nexus5 mobile network exclamation mark

Question: I am using nexus5 and I have never had problems using mobile data network. Some days ago I updated to 5.0.1 and problems started occuring, exclamation mark on mobile network icon, internet stopped working. Anyone hade same issues ? I probably flash back to Android 4
Answer: Not sure whether it can help or not, but I also noticed this, and the indicator otherwise seemed to say I was having great cellular signal. The exclamation mark would mean that there is no data connection. So, I tried calling someone, and had no problem. Please note that I also have NO DATA PLAN with my provider and this is by choice. I also had data (LTE/3G/4G) disabled on the phone, as well as at the provider's web site. What I do not know is whether I will be able to know the strength of the cellular signal or not. I also would like if I will ever be able to get LTE/3G/4G data on this phone, should I choose to do so.
Comment: I can assure you my data were fine. The only difference was 5.0 and 5.0.1. Where in 5.0 internet connection was working fine.
Answer: Try finding the Access Point details for your carrier, and changing the Access Point Settings in the Settings app. The exclamation mark is to represent a lack of internet connectivity, hence if you shut off your data plan, the exclamation mark comes up.


Timeline of "Quick opinions" in math journal refereeing

Question: Some years ago a fair number of mathematics journals started to ask for one or more "quick opinions" by experts on a received manuscript before sending it out for peer-review (with the obvious goal of avoiding the hassle of peer-review for papers that clearly don't make the cut). In your experience, how long does it take on average to receive a quick opinion? Or, phrased differently, how long after submission can you usually deduce that your manuscript has survived quick opinions and is sent out for peer-review? This question is only within the scope of mathematics.
Comment: The answer is clearly journal dependent. I would guess that when the web submission portal says the status is "under review" that the paper has survived that cut.
Comment: The two quick rejections I've gotten took 1 month and slightly under 2 months, respectively.  Small sample though.  @EthanBolker, for both of these journals submission was by email, no web portals in sight.
Comment: In a third instance, the editor forwarded me a comment from a quick-opinionated expert after 2 months and a week.
Answer: I've been asked for "quick opinions" from a variety of good-to-best journals, and I try to meet the obvious goal of "quick...", if nothing else.
In some cases, I've easily seen the need for various sorts of revision, and immediately recommended that, with a promise that I'd look at it again later when it was more readable.
In some cases, I do also easily confess that, while I myself may not see the point or interest of a project, perhaps there is one... and, if nothing else, the author(s) perhaps should revise to make that clearer (if possible).
Anyway, usually I succeed in giving "quick responses" in a week or less, as one data point.