Color of light after refraction

Question: I know that the color of light depends on its wavelength. Also, when light moves from one medium to another, its wavelength changes.
The question:
So, when light moves from one medium to another does its color change?
Comment: The perception of color is a neuro-biological reaction of the brain to stimuli of receptors on the retina. These receptors absorb a photon and undergo a geometrical change which is registered by the brain as light of a certain color. What is important for the receptor to absorb the light is the energy of the light (or frequency), which does not change after refraction.
Answer: I'm giving a link of a similar question in my answer as I don't have enough reputation to comment. Link Does light color change when refracting?
Answer:
The color we perceive is dependent on frequency and wavelength. The color will not change. What you're not taking into account is the speed of light in the medium. It's not the same $c$ in vacuum. The frequency stays the same. What changes is that speed of light in the refracting medium and as a result the wavelength. This difference for speed is the exact reason we have refractive effects, and I believe this was the observation that led to Snell's Law. In symbols
$λ=c/ν$
where $λ$ is the wavelength and $ν$ is the frequency.
The speed of light changes because the photons have to have its energy ( and therefore it's presence ) propagated across very long molecular chains. Electrons have to absorb the incident photons, re-emit and repeat this in a longitudinal direction. Depending on what the material is made of, this will take variable time in variable media. That notion manifests itself in the different indices of refraction that different objects have.
(just edited the answer to make it more complete, from other answers and comments)
Answer: Another way of saying Apoorv Potnis's answer is to say that the light's color is defined by the photon energy, and this does not change. Since we always "see" light propagating through the vitreous humor of our eye, the only variable here is the frequency: the medium (vitreous humor) is defined and the wavelength follows. So, when we put our eye into water, or other medium, only the frequency can define the color.
There is another sense wherein the color can change subtly on refraction and that is if broadband (white) light is incident non-normally on an interface. Different wavelengths have different transmission co-efficients defined by the Fresnel Equations, so the frequency spectrum of the transmitted light is changed by the refraction. This effect is most pronounced at highly glancing incidence angles.

Color of light after refraction


Why some old voice recordings in Anime has ~15.7KHz  sweep?

Question: Out of curiosity, I was noticing hi-pitched sweep in some old Japanese animation (Serial Experiments LAin; Fushigi no Umi no Nadia; Kimagure Orange). Example voiceprint: https://i.stack.imgur.com/tjK0D.png
Answer: Hi chkktri, Stavrosound is right, the high frequency you can hear is most probably due to the fact that they used an old CRT TV in the studio. The CRT tube creates what's known as 'line whistle' which is a single tone at a frequency of 15.625kHz for PAL territories and 15.734kHz for NTSC. This can easily be notched out by using a very narrow notch filter on max attenuation. It's probably best to gain the notch and sweep around the frequency, until the whistle is amplified, then at maximum level, cut the frequency to max which will get rid of this annoying high frequency.
Comment: Exactly how I notch too - very high Q, boost and sweep, find it then hard cut.
Answer: Possibly noise from a TV used in the ADR studio?  That freq sounds on-point for a TV being the source.  For what its worth, on older Foley recodings I find this a lot, especially when you start pitching things down and thus exposing the tone more easily.  Usually just a matter of notching it out.


New to Access 2013 - Would like to create a dynamic search form

Question: I am new to Access 2013 and would like to create a form that allows users to interactively enter search parameters and see the results listed on the same form as multiple items or a data sheet.
This would work like a search on a web page:
Users will enter search criteria and click a search button.  A data grid will display the results.  Each time the user re-enters the search criteria, the data grid will be reloaded with the query results.  It is important that the user not be required to launch one form to enter the criteria and see the results on another form.  All should be done on the same form.
My questions are:

If I use VBA to handle the click event and perform the query, is it possible to programmatically set the control source of a data sheet or multiple items to the new query results?
Answer: The method that I used to create a dynamic search form is:

Create an Access Form to prompt for search paramaters.  Mine consisted of two text boxes with format set to general date. (I want to list all rows between a start and end date), an unbound list box for the results and a command button to execute the search.
Create an Access Query that uses a Criteria setting that references the starting and ending text boxes on the search form.  The field name I want to use is named EventDate.  In the QBE, I set the Criteria entry for the EventDate field to:

Between [Forms]![frmSimpleSearch]![txtStartDate] And [Forms]![frmSimpleSearch]![txtEndingEventDate]

For the Click event of the Search button, I use the following code:
Private Sub cmdSearch_Click()
' Search for all events between the start and end date
  lstResults.RowSource = "qryEventsInDateRange"
  lstResults.Requery
End Sub


How to add a signature above post content in Blogspot?

Question: I have searched this in google, but only finds how to add signature below the post content.
I want it to appear on the post page and not on the home page. So how to do that?
Answer: Try using conditional tags like this, ff you insert signature inside template

If you use css only to add signature, try add .item-view selector like this:
.item-view .entry-content:after {
  content:url(your url);
 }


Tulip tree in a container

Question: I would like a tulip tree but I don't want a tree that will grow over 70 ft tall! Is it possible for it to grow in a container?
Comment: Where do you live, what climate zone?  Are you in  a house or apartment?  More details please..
Comment: Hi kevinskio, I live in a house with a medium-sized yard in Ontario, Canada - Zone 3-4.
Answer: Liriodendron tulipifera is indeed a splendid ornamental tree of architectural proportions and as you say, left in open ground would grow to monumental size over time and if left close to a house, would compromise building integrity.
However, you will be pleased to know that this tree and a related species, Liriodendron chinense are well prized as Bonsai specimens and as such are perfect candidates for container growing. As a very basic bonsai fan, I think it would be a wonderful challenge to someone willing to put in the hours and years to bring such a beautiful tree to maturity and their 500 year projected long life would make a life long commitment for entire generations of your family.
You would need to read up more extensively on keeping such a tree in a bonsai state if you were to grow it in a container and some bonsai folk report its leaf size and growth potential make it a difficult candidate for both bonsai and by extrapolation container grown. You would need to do extensive root pruning to ensure the tree would remain manageable in even the short term.
Comment: Oh thank you for your comment, Nikki! It was a $100 tree so I suppose it isn't too much loss if it fails. But yes, I love your idea of a challenge. I will research this further!

Tulip tree in a container


PHP: Check if string contains soft hyphen and replace it

Question: I need to check if a string contains a soft hyphen and if it does to remove it from the string. Any suggestions on the best method to locate it and remove it before saving the string to the database?
Comment: Have you checked the PHP docs?  http://us.php.net/manual/en/book.strings.php
Answer: The soft hyphen is invisible here, but this will remove it:
<code>$str = str_replace('', '', $str);
</code>
Comment: @anthony No problem :) You may want to comment this line well or use hakre's answer to make the code much more clear.
Answer: The soft-hyphen you linked (in case your string is ISO 8859-1):
<code>$str = strtr($str, array("\xAD" => ""));
</code>
Otherwise you need to find the byte-sequence for it in the encoding you use, some values given for SOFT HYPHEN (U+00AD) for common charsets:
<code> \xAD      ISO-8859-1; ISO-8859-2; ISO-8859-3; ISO-8859-4; ISO-8859-5;
           ISO-8859-6; ISO-8859-8; ISO-8859-9; ISO-8859-15; Windows 1250;
           Windows 1251; Windows 1252; Windows 1253; Windows 1254; Windows
           1255; Windows 1256; Windows 1257; Windows 1258

 \xF0      OEM 775; OEM 850; OEM 852; OEM 855; OEM 857; OEM 858;

 \xC2\xAD  UTF-8
</code>
Answer: None of the answers here worked for me. The only way I was able to remove the soft hyphens is:
<code>preg_replace('~\x{00AD}~u', '', $str);
</code>
Answer: Try this :
<code>$str = str_replace('-','',$str);
</code>
Comment: That works for regular hyphen but it does not find the soft hypen mentioned here: http://en.wikipedia.org/wiki/Soft_hyphen.


Do electrons truly flow in circuit?

Question: I know this sounds like a stupid question, but do electrons truly flow in a circuit? It doesn't seem logical for electrons to just break away from their atoms to go move through a circuit. If they did, they would probably go through a bunch of reactions and behave oddly (right?). Do the atoms lose/gain electrons to become ions and flow through the circuit? If so, wouldn't they too big to be able to flow easily through a conductor?
Comment: There is no such thing as _"their"_ atoms in the first place.
Comment: I'm voting to close this question as off-topic because this is not a chemistry question and more like a physics related question.
Comment: Solid state physics in particular, where electrons are in wave functions of the solid, not one atom.
Answer: The key here is the concept of metallic bonding. or, the sharing of electrons between metal atoms like those in a copper wire (a typical conductor). In this type of atomic bond, electrons no longer belong to one atom or another; they're shared equally amongst all atoms.  As such, one electron truly does go bouncing around between the atoms in the direction of the electric current.
One atom is close enough to another in metallic-bonded substances that an electron is attracted just as much to one nucleus as the next one over, so it's not so "illogical" to think that an electron might "break free" of its original nucleus.
Chemical reactions occur between atoms, not electrons, and atoms in a metal are already metallic-bonded together, so a few stray electrons wouldn't do anything to create new reactions.  However, the electrons do behave oddly!  That's the beauty of metal conductors: their electrons are free to flow wherever an electric or magnetic field dictates, meaning that they can do some pretty cool things!
The nuclei of a conductor don't become ions because every time one electron leaves, another takes its place.  Think of people at a gas station on a busy day: every time one car fills up and leaves, another pulls in almost immediately.  Thus, the metal atoms never have time to become ions, because there's plenty of electrons to keep them company.
As (nearly) always, Wikipedia has a bunch of information on the subject.
Comment: Thank you so much! This is a great answer and it answers all of my questions! I haven't heard that anywhere on line, but it makes total sense. Sorry that I may have posted this in the wrong stack exchange, but I think it does have a lot to do with chemistry and atomic bonds.

Do electrons truly flow in circuit?


Why do some GPS devices require a GSM SIM-card?

Question: Why do GPS products like [Image A] always require a GSM (or similar; i.e. 3G, 4G, etc.) SIM-card?; Whereas typical in-car GPS navigation devices, etc. like [Image B] don't?
[Image A]

[Image B]
Answer: Because the first is a GPS tracker that you can call and it replies via IVR or SMS or has a data connection so you can see it online or periodic emails. Maybe automatic geo fencing warnings.
The second is not, it's a full blown computer with a high quality GPS system with maps built in and no need for a data or voice connection.
As @Eugene had commented though, the first also use AGPS, which provides assistance to GPS sensors, allowing it to lock on faster via a AGPS Internet service. They can also use GSM tower locations. This allows for tracking in locations were a direct GPS signal is hard to get. At least they advertise as using both. But it's mainly for tracking updates.
GPS only devices don't need GSM for anything. The two are independent of each other.
Comment: I've commented about AGPS before seeing your answer and actually looking at the devices. Then it made me *facepalm*... I guess it is not the case of AGPS, so I removed it.
Comment: @eugene you weren't wrong. A quick Google shows they all at least state AGPS.
Comment: So it's just the fact that a cell phone service (or similar) is required to transmit the GPS coordinates to another device?
Comment: Yes. Basically that


What would Aurora look like if no magnetic field was present around the Earth?

Question: The greatest part of the Earth is protected from the Solar wind by its magnetic field. This field makes the wind particles (mainly protons and electrons) the beauty of Aurora appear.
Suppose the magnetic field wasn't present. The Solar wind particles hitting the southern and northern parts of our planet would distribute themselves over whole the Earth's surface.
How would Aurora look like?
For certain it would be not slowly swirling (following the slowly changing magnetic field lines). Will we see a sparkling sky? Or what?
Comment: It would be fairly similar to Mars. If Earth had no magnetic field, the Earth's atmosphere would be thinner, and Auroras would occur wherever the solar wind hits the atmosphere.
Comment: related factoid: there is an answer or two either here in Astronomy SE or in Space Exploration SE that explains why Mars (for example) still has a magnetosphere even though the planet has no intrinsic global dipole field. It comes from currents produced as the solar wind encounters the planet, forms a shock front and then flows around the planet, at least something like that. The shape of the field is of course different than a planetary dipole, but there can be one nonetheless.
Comment: See:  https://physics.stackexchange.com/a/335325/59023
Answer: One way to look at this question is to consider the case of Venus, which lacks a geodynamo-created magnetic field. Despite this, there have been observations of the green emissions of excited oxygen atoms in the aftermath of solar flares, which result in higher electron density in the ionosphere. Without an intrinsic magnetosphere, the magnetic phenomena appear to be related to Venus acting directly as an obstruction to the solar wind, and would therefore not be focused on the planet's polar regions. A non-magnetic Earth might be expected to behave in a similar manner.
Answer: I was looking through some sites and came across this - https://www.livescience.com/earth-magnetic-field.html
This clearly mentions how, if the magnetosphere surrounding the Earth weakens, the Auroras might penetrate into the Atmosphere and light up the skies closer to the equator. So, I also looked it up but, to my astonishment, I found no sources that answered this question to my satisfaction.
Though, intuition says that If there is no Magnetosphere, there should be no Aurora either.
Comment: If anyone can confirm what exactly happens if there is absolutely 'no' Magnetosphere around the Earth?


recover sort order/position values using magmi with multiple website/store/storeviews

Question: I've been using Magmi with great success, creating and updating our magento products on a daily basis.
Our production retail site generally uses the default/admin values for store.  When I make new categories and populate them I generally use the category_reset=0 column to preserve the handmade sort order or position values for all of the original categories.
I've been working on a wholesale site set up with a seperate filesystem for all 3 levels of the Magento hierarchy.  I did an import with magmi setting the store column to the wholesale site, with 2 additional collumns - sku and category_ids (without category_reset) using a sub-set of data exported from the admin store view (filtered the manufacturer column for only one manufacturer) to try to populate the wholesale site categories (same root catalog with certain categories disabled or not visible) with the same category products.
For some reason, I'm not sure why, (ouch, I realize now there was a typo in the header name for store) it did not update the right store - it defaulted back to admin and lost
the sort order for many categories, about 3k products imported ok.
I have 2 non-production sandbox sites with duplicate category data.  I've been manually copying the category product listings with the desired position values into a new csv so I will have sku,category_id (singular),position_value
Many products are members of more than one category.  My question is...
In order to regain the position values or sort order, what syntax should I use under category_ids?  The products are already in the category so I would use a category_reset=0 column, right?
for an example record:
sku           category_ids
45000         39,262,353

my next import might look like:
sku           category_ids      category_reset
abc           39::10            0
def           39::20            0
45000         39::30            0
ghi           262::10           0
45000         262::20           0
jkl           262::30           0
45000         353::10           0
mno           353::20           0

does this seem workable?  I'm feeling very gunshy after having borked my production site with a typo and need some validation before I take steps to confuse myself further.
Thanks in advance for any insight.
Answer: As stated in the Magmi Documentation for Importing item positions in categories (from magmi version 0.7.18), the syntax is as follows:
sku,....,category_ids
000001,...,"8::1" < = put sku 00001 at position 1 in category with id 8
000002,...,"9::4,7" < = put sku 00002 at position 4 in category with id 9 and at position 0 in category with id 7
000003,...,"8::10" <= put sku 00002 at position 10 in category with id 8

So yes, your method should work.  Be sure to do a full database backup before doing major import changes ;)


Openning link in Slack oppens up new instance of Firefox, which shows up as 'child' of Slack

Question: I have started using Ubuntu 18
When I click on a link in Slack, new Firefox opens. And in dock/panel, it shows as child application of Slack. This causes them to be grouped together. When ungrouped in panel, the Firefox still shows under Slack and has Slack icon. I've noticed similar behavior when opening an application from different application. So it is not a problem of Slack or Firefox, but general Ubuntu UI problem.
Is there any way to change this behavior so Firefox opened from Slack shows up as Firefox application itself?
Answer: Did you install Slack using snap?
I had this problem and removed the snap install
sudo snap remove slack
then reinstalled from the .deb download from here: https://slack.com/intl/en-nz/downloads/instructions/ubuntu
sudo apt install ./slack-desktop-4.7.0-amd64.deb
and the problem went away.
I can't pretend to understand why(!) but it fixed the problem for me.


Where is the Dark Brotherhood?

Question: In Oblivion some of my favorite quests were the Dark Brotherhood quest line. Where can I start the dark brotherhood quest line a in Skyrim?
Answer: Head to Rorikstead and ask the inn keeper about rumors. He'll inform you about a kid. (The kid is Aventus Aretino in Windhelm, if you want to skip the rumor gathering) This will start the dark brotherhood questline.
Comment: If you went to Aretino and killed Grelod the Kind, then you _have_ started the Dark Brotherhood questline.  Just wait a couple days and they'll... contact you...
Comment: Don't just *wait*, the Dark Brotherhood will 'recruit' you for your work with Grelod after you *sleep*. They work fast, too. Only needs to be a quick 1 hour nap in any bed.
Comment: by mistake i went to aretino and killd this old woman. and now i dont think i can begin the darkbrotherhood quest. any ideas?
Answer: Another option to start the Dark Brotherhood questline can be found in Riften. Head to the Honorhall Orphanage and listen to the horrible, disgusting woman who runs it as she belittles and verbally abuses the children inside. Upon viewing this small conversation, you can then speak to one of the children in the orphanage. They will tell you about Aventus Aretino, and ask you to find him. This also begins the Dark Brotherhood quest.

Where is the Dark Brotherhood?


Browsing PDF page content. Problem with color space and DPI

Question: I am writing a program that would validate PDF file. I am using iText java library to get content of a file, but I have some problems with parsing it. I need to get info about color space and DPI of each image. How can I get info about position and dimensions of image in PDF? I tried to browse each XObject of PDF but I stuck, I cannot find any information about width and height of file in PDF.
Are there any other libraries which can help me?
Thank You for all answers and tips.
Answer: The image object in the PDF file stores only the Width and the Height of the image in pixels. In order to know the position and size of the image on the page, in PDF points, you have to execute the page content stream, to create a virtual rendering. The image is painted on the page using the 'Do' operator and its position and size are given by the current transformation matrix that is in place when the 'Do' operator is executed.
The DPI for a specific drawing instance is computed as 72*imageSizeInPixels/imageSizeInPoints, imageSizeInPoints being computed as described above.


95% confidence interval for a given data set

Question: I have a data set $\mathcal{S}$, which is univariate. I would like to discover the data points which can be thought of as outliers of $\mathcal{S}$. I use   $\bar{\mathcal{S}}+2*\sigma(\mathcal{S})$ and $\bar{\mathcal{S}}-2*\sigma(\mathcal{S})$ to compute the upper and lower threshold in terms of 95% confidence interval. $\bar{\mathcal{S}}$ is the mean of $\mathcal{S}$ and $\sigma(\mathcal{S})$ is the standard deviation. I know it assumes the normal distribution. I would like to know are there any loopholes for this approach from the statistical analysis perspective. Moreover, are there any other better statistical approaches to give this kind of threshold.
Comment: have you made any graphs or done any tests to check for normality? There are Kolomogrof-Smirnoff and Shapiro-Wilk tests in R.  qqplot in the car package tests quantiles of a variable against a distribution you can compare.  Normality might be a really poor assumption for your data (and then so might your confidence interval)
Comment: To me, this approach sounds fine, provided you do assume your data are normally distributed (surely you ought to check for approximate normality first). Another concern would be that your sample be large enough (to be able to establish the distribution of your data, among other things).
Comment: You don't necessarily need to assume normality. Normality will guarantee that 95% of the distribution will lie w/i +/- 1.96 SDs (although that assumes sigma isn't estimated from the same sample). Nonetheless, you can still form confidence intervals. You might want to read up on [Chebyshev's inequality](http://en.wikipedia.org/wiki/Chebyshev%27s_inequality).
Comment: Why do you need to identify outliers? What does this have to do w/ ANOVA?
Answer: A few comments:

Your title "95% confidence interval for a given data set" is misleading. Confidence intervals are calculated for computed values like means. It doesn't mean anything really to have a confidence interval for a data set.
Your proposed method will work with huge data sets, but will fail with small data sets. Why? Because the outlier itself increases the SD (assuming you are computing the SD from your actual values). With small data sets (say n=4), it is impossible for any outlier to be more than 2 SD from the mean. Try it! The most SD that a value can be from the mean is (n-1)/sqrt(n), where n is sample size.
There are established methods for determining outliers assuming the other values are sampled from a Gaussian distribution. Look up Grubbs test, for one of the most widely used tests.
Deciding what to do with outliers is tricky.
Answer: An outlier is a surprising value.
Therefore, your method is flawed.
If the data set is large, then, if it is normally distributed, you expect some values beyond 2 sd from the mean. If the data set is small, and normally distributed, you don't expect values even 1 sd from the mean. e.g. it is not surprising that there are some 7 foot tall people in the USA.
In addition, you have calculated the mean and sd with the possible outliers IN the data. If the outliers are truly not part of the data (e.g. they are data entry errors; they got picked for the sample by mistake) then you should not have done this.
I would say that there are no really good statistical tests for outliers, even univariately. At best, there are ways to identify points that might be worth looking at.  A better way than the one you propose is to graph the data. If you suppose it is normal, you could do a normal quantile plot. Even if you don't suppose it is normal, you could do a density plot.
In addition, you should always think of the substantive nature of the values. Is it *possible? E.g., among human adults, a weight of 500 pounds is possible (albeit very large). A weight of 5000 pounds is not.
Answer: Another approach you might consider is Tukey's Outlier Filter. It is robust as well, since it is based on quantiles.
The idea behind is to classify as outlier data points that lies:

above 3rd quartile + 1.5 times the Inter Quartile Range (IQR, distance between the 1st and  3rd quartiles), and
below 1st quartile - 1.5 times the IQR.

The 1.5 range is arbitrary and was suggest empirically. You might use 3 instead to be more strict. Take care with asymmetric data, which would need an adjustment in the classification criterion.
Boxplot is a good plot to evaluate the points that may be considered outliers through this filter. See R example below applied to data posted by user603:
<code>x <- c(-2.21,-1.84,-.95,-.91,-.36,-.19,-.11,-.1,.18,.3,.31,.43,.51,.64,.67,.72,1.22,1.35,8.1,17.6)
boxplot(x, range=3)
</code>

Reading suggestions:

SEO, Songwon. "A review and comparison of methods for detecting outliers in univariate data sets" (http://d-scholarship.pitt.edu/7948/1/Seo.pdf)
MASSART, Desire Luc et al. "Visual Presentation of Data by Means of Box Plots". (http://www.lcgceurope.com/lcgceurope/data/articlestandard/lcgceurope/132005/152912/article.pdf)


Which shifters are compatible with dura ace 740x?

Question: I've read that Shimano updated the cable pull ratio on their other series early on but not for Dura-Ace until 1997 with the 7700. Which downtube shifting levers are compatible with their 7400/7401/7402 deraillers?
Answer: The 740x rear derailleurs are unicorns that only index with 7400 shifters. I believe there is an SL-7402 downtube shifter.
7400 shifters have a cable anchor routing trick that allows them to work with latter generation RDs, but there is no such trick that works the other direction for RD-7400 et al.
Comment: Early Dura-Ace was special in the way that nothing else of the Shimano range was compatible. When I laid a hand on bar-ends they only worked with Ultegra tri-color in friction mode. Setting indexing was impossible.
Answer: When I bought bar-end shifters for my 8-speed drivetrain bike, I had to select the bar-end shifters marketed as "8-speed Ultegra". Those ones marketed as "8-speed Dura-Ace" are the ones intended to be used by the early Dura-Ace systems. I did not have an old Dura-Ace rear derailleur so I had to use the Ultegra bar-end shifter. I suspect downtube shifters have a similar product naming.
Typically, Shimano has a policy of selling its bar-end and downtube shifters under the "Dura-Ace" brand, but the 8-speed ones intended for regular cable pull ratio had to be marketed as "Ultegra" as they were not compatible with the Dura-Ace rear derailleurs of that time. The 8-speed Dura-Ace shifters are sold separately, being only compatible with 8-speed (and lower gear count) Dura-Ace rear derailleurs.
I don't think you will find any ≥9 speed bar-end or downtube shifters for the old Dura-Ace cable pull ratio as the shift to 9 speeds happened when the cable pull ratio was harmonized.
Today, the new Shimano systems with huge gear counts have lots of similar incompatibility issues. For example, MTB 10 speed systems use a nonstandard cable pull ratio different from MTB 9 speed systems. Road 11 speed systems also use a nonstandard cable pull ratio different from road 10 speed systems. However, the new Tiagra 10-speed system (4700 series) actually uses the 11 speed road cable pull ratio even though the system has only 10 sprockets in the rear!
I suspect you may be able to find downtube and bar-end shifters for 6-speed, 7-speed and 8-speed indexed Dura-Ace systems. However, those products are not made anymore so they have to be new old stock (NOS) or used.
Unfortunately, both you and me favoring traditional shifters (you favoring downtube and me favoring bar-end) have to be disappointed. New bikes with downtube or bar-end shifters are hard to find and if you have some special requirements (such as if you want an electric road bike like I wanted), you probably can't find a bike equipped with downtube or bar-end shifters. As users of downtube and bar-end shifters reduce in number, some day Shimano may completely stop making these durable, cheap, reliable and in almost all ways superior shifters and then we all will be forced to use shifters combined with brake levers and are unable to replace a shifter without replacing a brake lever or vice versa! If a rear shifting system fails to work as intended, I can very easily change it from "Index" to "Friction" and still have functional shifting with my bar-end bike. Unfortunately such a thing is impossible with these "modern" brifters.


Is pbkdf2 with hmac using md5 still secure?

Question: I have an old system that can do PBKDF2 with HMAC using MD5, but not SHA-2.  Now I know that MD5 is insecure and shouldn't be used for new applications, but https://crypto.stackexchange.com/a/9340/7075 seems to indicate that HMAC-MD5 is still secure. If I use a strong password, and PBKDF2 with a reasonable number of iterations and a random salt, can an attacker that gets the salted hash reverse-engineer the password?
Comment: Yes, it is secure. The attack on MD5 is an imminent collision attack ( see korkami MD5 ) that has no relation to passwords. Also, HMAC doesn't carry the current [weakness of MD5](https://crypto.stackexchange.com/q/88150/18298). Still migrate if possible
Comment: HMAC with MD5 or SHA-1 is secure when used as a MAC or in a KDF like this, but it is not _always_ secure.  For example, [HMAC-MD5 is insecure when used as a commitment scheme](https://crypto.stackexchange.com/questions/25584/is-hmac-md5-still-secure-for-commitment-or-other-common-uses).  That's why it's better to avoid weak algorithms whenever possible, because in many cases, it requires a lot of cryptographic knowledge to know when they're secure.
Answer: Within the limitations of PBKDF2 in general, yes, HMAC-MD5 is still secure. The attacks on MD5 concern collisions, which are fatal for signatures but basically irrelevant for an iterated password, and HMAC also mitigates the risk. You may need a higher iteration count for MD5 than for newer hash functions, because it's a faster algorithm in most implementations (you should aim for work factor that requires a certain amount of time - generally as much time as you can afford - and increase it as hardware gets faster and/or implementations get better).
With that said, it's a good idea to move away from MD5 if possible. Even SHA1 is some amount better, if you can't do SHA2. If nothing else, MD5 is going to set off alarms on code scanning tools, and may mislead a developer into thinking it's safe to use it elsewhere. SHA1 has those problems too, but it's at least slightly less vulnerable than MD5. I recommend also clearly documenting the exception to the usual policy of not using deprecated hash functions.
On the other hand, if possible, you should move to something better than PBKDF2 at all. PBKDF2's only tunable factor is iteration count, and it is extremely parallelizable. All newer password hashing functions deliberately require non-trivial memory as well, which makes parallelization harder. Bcrypt is probably the most popular, but its fixed memory requirement is perhaps insufficient to provide strong protection today. Scrypt and argon2 allow tuning the memory cost, as well as the CPU cost. Argon2 in particular is the winner of large contest to develop a modern password hashing algorithm, and its argon2id variant is considered the state of the art and commonly used in new systems (as of this writing, Sep 2021).
Obviously an old system isn't going to support argon2 - and quite possibly doesn't support bcrypt - but this may be an added incentive to upgrade to a newer system.
Comment: Unfortunately, this system only supports pbkdf2 with md5.  In the interest of not rolling my own crypto, I'm trying to work with the vendor-provided functions.


How to prevent Merging in TFS

Question: I have a parent project that is branched to many dependent child projects.  I do not want to allow changes in the child projects to be merged back into the parent.  i.e. I only want to allow a 1 way merge (parent to child).
How do I accomplish this?
Answer: Easiest way is to only grant read permissions to the parent branch. To merge you need to check-out/in so without these permissions it's not possible to merge from child to parent. They will still be able to merge from parent to child though.
Answer: If you can't set security permissions as William Bartholomew suggests - another approach would be to write a custom check-in policy.  The problem with this is that it CAN be overriden (but you could receive notifications when that occurs)

How to prevent Merging in TFS


Echo a image in cakephp after uploading it

Question: I am trying to echo an image after i upload to logos folder which is under the app folder. The uploading is working but the challenge that i have right now is to echo the image in the view. Below is my upload function and the view code
function uploadFile() {
$file = $this->data['Logo']['file'];
if ($file['error'] === UPLOAD_ERR_OK) {
$id = String::uuid();
if (move_uploaded_file($file['tmp_name'], APP.'logos'.DS.$id)) {
$this->request->data['Logo']['filename'] = $file['name'];
$this->request->data['Logo']['filesize'] = $file['size'];
$this->request->data['Logo']['filemime'] = $file['type'];
return true;
}
}
return false;
}

and for the view code, i using this code.
<?php echo $this->Html->image(APP. 'logos' . DS. $logo['Logo']['filename']); ?>

Thanks you for your help you will provide.
Answer: There is a .htaccess at app folder, which will not allow to access any content directly outside webroot folder. For ease of use, you should upload images inside webroot folder somewhere.


Can I save my avocado seed that has broken in two

Question: My avocado seed was growing fairly well, good size root and was staring to grow a stem, until I knocked it over and it has slpit in two, one have got the root, the other half got the stem, will it still grow? How can I hope to fix this?
Answer: Likely yes, just put the two pieces back together they way they were and this time plant up to the neck in potting soil, not water, leaving the top of the main shoot just visible. Keep the soil moist and well drained. Even though you have lost the main tap root it may generate another, depending on what cells are left with the main shoot. This is quite a bad shock for the seedling, so it will take some time to recover. If you don't see a sign of the shoot appearing in 6 weeks or so, or if the tip of the main shoot looks brown, black or just disappears then remove it and check the inside again.
Answer: I would agree with previous answers, it appears to be mostly intact. So will probably survive. Although the shock may kill it, depends how severe the drop was. If it fell over and gently came apart, it will probably survive.
However I would note (and you are probably already aware) that avocado seems are not true to the parent plant. Ie. it may never fruit, it may have terrible tasting fruit, or it may taste better than the parent plant. Something to keep in mind.


Is Zermelo set theory finitely axiomatizable?

Question: I know that ZF is not finitely axiomatizable, but what about Z (i.e. ZF without Replacement)?
Answer: No. It is not.
You can find the proof as Theorem 8 in:

Mathias A. R. The Strength of Mac Lane Set Theory, Annals of Pure and Applied Logic, 110 (2001) 107--234.

(The article also appears on Mathias' homepage without the need for a paywall)
Comment: @Sumac - see Hao Wang, [A Survey of mathematical logic](https://books.google.it/books), Chapter XVII: Relative Strength and Reducibility, page 438.
Comment: Thank you very much. In the article that you quote Mathias writes (above Theorem 8) that this result has been known since work of Wang and others in the fifties. I did not find anything relevant in the references. Do you know if there is any previous proof of this fact?
Comment: I have no idea really. I have to admit this is the first time I saw this result explicitly... In the commentary file Mathias writes: "Theorem 8 gives a new, set-theoretical, proof of a result that proof-theorists, but not set-theorists, would
regard as standard". It might have been known to proof theorists as a folklore (or a common exercise), but I can't really tell.
Comment: I know. It seems like it is a wll known fact but I have searched through all standard set theory (e.g. Jech, Kunen) and model theory books (e.g. Chang & Keisler, Marker), and I can't find anything that is relevant. It would be interesting if some old logician could show us a way to prove this through model theoretic methods.
Comment: If I were to look for this I would look for proof-theoretic papers dealing with finitely axiomatizable theories, and showing why ZF is not one of them. Just following my nose I would guess that Shoenfield's book about proof theory would be a good place to start.


Financial applications on GPGPU

Question: I want to know what sort of financial applications can be implemented using a GPGPU. I'm aware of Option pricing/ Stock price estimation using Monte Carlo simulation on GPGPU using CUDA. Can someone enumerate the various possibilities of utilizing GPGPU for any application in Finance domain,
Comment: Also provide links to any material/resources for the same
Answer: There are many financial applications that can be run on the GPU in various fields, including pricing and risk. There are some links from NVIDIA's Computational Finance page.
It's true that Monte Carlo is the most obvious starting point for many people. Monte Carlo is a very broad class of applications many of which are amenable to the GPU. Also many lattice based problems can be run on the GPU. Explicit finite difference methods run well and are simple to implement, many examples on NVIDIA's site as well as in the SDK, it's also used in Oil & Gas codes a lot so plenty of material. Implicit finite difference methods can also work well depending on the exact nature of the problem, Mike Giles has a 3D ADI solver on his site which also has other useful finance stuff.
GPUs are also good for linear algebra type problems, especially where you can leave the data on the GPU to do reasonable work. NVIDIA provide cuBLAS with the CUDA Toolkit and you can get cuLAPACK too.
Answer: Basically, anything that requires a lot of parallel mathematics to run. As you originally stated, Monte Carlo simultation of options that cannot be priced with closed-form solutions are excellent candidates. Anything that involves large matrixes and operations upon them will be ideal; after all, 3D graphics use alot of matrix mathematics.
Given that many trader desktops sometimes have 'workstation' class GPUs in order to drive several monitors, possibly with video feeds, limited 3D graphics (volatility surfaces, etc) it would make sense to run some of the pricing analytics on the GPU, rather than pushing the responsibility onto a compute grid; in my experience the compute grids are frequently struggling under the weight of EVERYONE in the bank trying to use them, and some of the grid computing products leave alot to be desired.
Outside of this particular problem, there's not a great deal more that can be easily achieved with GPUs, because the instruction set and pipelines are more limited in their functional scope compared to a regular CISC CPU.
The problem with adoption has been one of standardisation; NVidia had CUDA, ATI had Stream. Most banks have enough vendor lock-in to deal with without hooking their derivative analytics (which many regard as extremely sensitive IP) into a gfx card vendor's acceleration technology. I suppose with the availability of OpenCL as an open standard this may change.
Answer: F# is used a lot in finance, so you might check out these links
http://blogs.msdn.com/satnam_singh/archive/2009/12/15/gpgpu-and-x64-multicore-programming-with-accelerator-from-f.aspx
http://tomasp.net/blog/accelerator-intro.aspx
Comment: How can it be used a lot given that it's a 1-2 years old language?
Comment: @Adal: F# is partially based on OCaml which is used and well-known in the finance business. Plus if you look, the first release of F# for the community is about 5 years old, so lots of people have delved into it already.
Answer: High-end GPUs are starting to offer ECC memory (a serious consideration for financial and, eh, military applications) and high-precision types.
But it really is all about Monte Carlo at the moment.
You can go to workshops on it, and from their descriptions see that it'll focus on Monte Carlo.
Comment: It is "Monte" not "Monty" - the famous casino.
Answer: A good start would be probably to check NVIDIA's website:

CUDA's Finance Showcases
CUDA's Finance Tutorials
Answer: Using a GPU introduces limitations to architecture, deployment and maintenance of your app.
Think twice before you invest efforts in such solution.
E.g. if you're running in virtual environment, it would require all physical machines to have GPU hardware installed and a special vGPU hardware and software support + licenses.
What if you decide to host your service in the cloud (e.g. Azure, Amazon)?
In many cases it is worth building your architecture in advance to support scale out and be flexible and   scalable (with some overhead of course) rather than scale up and squeeze as much as you can from your hardware.
Answer: Answering the complement of your question: anything that involves accounting can't be done on GPGPU (or binary floating point, for that matter)
Comment: Yeah, so I want to know what are those typical financial apps that can be ported on a GPGPU platform

Financial applications on GPGPU


How can I give someone a lethal disease?

Question: I am writing a story in which one character will kill another character by inducing a life-taking disease like cancer so that it will not be shown as a murder to anyone and it will be a slow death. I know fewer of poisons like toadstool extract etc. Is it really possible in real life to induce a disease?
Comment: Best to make something up.  What if you use something real and then your story gives some malefactor an idea about how to kill his landlord, who was not a bad guy?  What if you are that malefactor and an enthusiastic worldbuilder gives you that idea?  Related reading:  https://worldbuilding.stackexchange.com/questions/166951/question-regarding-plant-based-poison-for-a-short-story/166953#166953
Comment: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
Answer: Easy
You take some of the microbes that make up the disease. Careful not to get any on yourself! You can grow them in a petri dish:

Then apply the microbes to the person. If it is an airborne disease then dissolve the petri-goo in water and spray it into the victim's face. This is an artificial version of a sick person coughing in your face. If it is foodborne disease then spike the victim's chocolate with the goo. If it is a bloodborne disease then you can use a needle and syringe, or apply it to an existing wound.
The hard parts are (a) not infecting yourself and (b) them not noticing. There is also (c) If the disease is rare they will suspect foul play.
Note: This will not work with cancer, arthritis, MS, allergies, or the other illnesses that are not spread by microbes.
Comment: Note:  do not knit them.  Actually grow them
Comment: Funny enough, while not guaranteed, you CAN cause cancer indirectly on the target through a disease. Certain viruses, such as HPV, can result in infections that result in changes and damages to cells, damages which, in certain cases, can cause them to stop communicating with other cells and multiplying rapidly, turning into cancer cells. Again, the main """issue""" here is that (thankfully) such viral infections aren't guaranteed to result in cancers.
Comment: @ProjectApex If you are a Tasmanian Devil you can get cancer by rubbing your face on another devil's tumors.
Answer: Radioactivity has a random effect, but a massive continuous exposure to radioactive events eventually may bring the chance close to 1.
If you are in the future your character might have invented a cheaper and easier isotope separation system. With that system he would extract enough radioactive potassium $^{40}$K to kill a man. All he would have to do use that potassium to fertilise a banana tree and find a way to feed the bananas he grows to the victim.
Answer: You can't induce cancer in a single individual but you can induce other illnesses
Cancer is produced randomly, so without being very obvious by say giving someone a massive dose of radiation, you can't reliably produce it in a single individual, you can only increase the chances of that person getting it. You can produce lots of other sicknesses with arsenic or thallium or atropine or aconitine or digitalis if you dose them carefully.
Doctors may spot it
A lot of serial killers thought the same way you do, and used poison since it's harder to track. If you get an incompetent doctor or pathologist checking the corpse you may be fine, a more on the ball one may spot it.
Comment: It depends on the time you have to do it.  Hide an x-ray emitter above their bed, pointing down.  10 rem/day won't produce obvious symptoms but eventually (years) it will give them cancer.  Remove it when they're diagnosed so it's not there to be found if anyone gets to wondering.
Answer: Absolutely!
There are endless ways to give someone a disease. This is how disease spreads, after all. Similarly, poison is time-honored and can mimic various diseases. I'll concentrate on the example of cancer, since you mentioned that directly.
There are viruses that can cause cancer. But they won't do so consistently. Same issue with carcinogens. To cause someone to get cancer and make it perfectly plausible, you need an identical twin with cancer. Barring that, there are more complicated alternatives that could work.
Tasmanian devils experienced a severe genetic bottleneck in the recent past. Today, they are being wiped out by a cancer spread through bites. A few cancer cells transfer in a bite and the new host is so close genetically that they don't recognize it as foreign.
If someone has an identical twin with cancer (leukemia would be easiest), that cancer could readily be transferred by a fairly small transfer of blood. Extracted cancer cells grown in culture would work just as well. Since the first twin already HAD cancer, and the cancer matches the second twin, it would be virtually undetectable.
Next best is a cancer that is HLA matched to the victim. Like an organ transplant, the close similarity makes an immune response significantly less likely.
Finally, The victim's cells could be transferred with oncogenes via a delivery system like viruses or the like. This would be easier, but with less guaranteed effects.
Answer: -Place quantities of asbestos powder in close proximity to the individual and have them develop mesothelioma. Wait time: 40 odd years.
-Infect the individual with AIDS, whether through sexual contact, or by poking them with an infected thumbtack or needle as you pass by them in a crowd. Wait time: 11 years(on average)
-Introduce them to an animal infected with the rabies virus, in such a way that it seems merely like an unfortunate accident, such as placing a (large) rabid dog in their backyard. Other fun animal induced diseases are malaria, though its fatality rate is middling, and leprosy, should you find any armadillos nearby and are feeling particularly medieval.
-Gaslight them into insanity or even induced schizophrenia by altering events around (This depends on how powerful the individual is and their ability to influence events around the murder victim), then proceed to either have them do something lethally stupid, commit suicide, or take lethal amounts of drugs or alcohol (The credibility of this is... limited, but would still be darkly amusing to see implemented in a story)
In regard to cancer, if you somehow managed to bombard them with radiation frequently (But not enough to cause noticeable, and well, messy, radiation sickness), they will becomer cancerous.
Comment: Rabies, don't worry about a source.  It will be assumed to be some unnoticed bite.  Just be careful that they don't notice when it happened.


How can I add a custom attribute to a link field?

Question: For analytics/tracking purposes, I would like to add a custom attribute to a link field. Is there a way to add an additional text field to the link, similar to the title attribute field?
Comment: I can propose you the [field_collection](https://www.drupal.org/project/field_collection) module, which is quite easy to set it up or to go with your own custom implementation of another field which cannot be developed in a comment of course. For both solutions you'll have to bind that attribute to your link I guess.
Comment: What kind of attribute do you want to add? Link fields already have many attributes at their edit form pages (`admin/structure/types/manage/ct_name/fields/field_name`) like, class, title etc. Moreover do you want that attribute to be editable per node or not?
Comment: Yes, I would like to add a custom attribute (other than class or title) which is editable per node.  This will be used for link tracking/analytics purposes.
Answer: On Drupal 7 there are several ways to go about this depending on your setup.
If you are using Display Suite you can add custom attributes to the link field (and all the various wrappers) by setting the field template to Expert:

You could also use template_preprocess_field() in a module or your theme to add additional attributes to the link before it is rendered.
Display Suite is more limiting but often easier (particullarly if it is already in use). Since the preprocess function is in PHP it will give you more flexibility that may or may not be useful.
Comment: For that you'll want to use a preprocess function, likely on the content type instead of the field (although details matter here). The advantage of doing it in the preprocess is that you pull data from other places -- like other fields --  more easily.
Comment: Thank you for posting an answer.  Although I'm not sure if those solutions will work in my case.  The attribute value needs to be entered into a textfield on the node edit form by a Drupal user.  That's why I was wondering if it's possible to add an additional textfield there.  It would be similar to the title attribute field.


ASIHttpRequest ignores setValidatesSecureCertificate parameter

Question: Can ASIHTTPRequest ignore 'setValidatesSecureCertificate' parameter under certain conditions ?
If i do this:
<code>NSURL *url = [NSURL URLWithString:@"https://someselfsignedurl"];

ASIHTTPRequest *r = [[[ASIHTTPRequest alloc] initWithURL:url] autorelease];
[r setValidatesSecureCertificate:YES];
[r startSynchronous];

// Should not work:
NSLog(@"Result: %@", [r error] ? [[r error] description] : [r responseString]);
</code>
i've got the expected behaviour, i.e. a NSError telling the certificate is self-signed and a null response.
However, in some other part of my source, the exactly same code seems to ignore validation and actually gets result instead of returning a SSL error.
Could any "global" configuration done, in a third-party library or instance, interact with SSL validation in anyway ?
Answer: Ok, it is a bug, apparently from CFNetwork.
Fixed it, see here on GitHub: https://github.com/pokeb/asi-http-request/issues/263


Brush in .PSD file format not showing

Question: So I have a few brushes in PSD file format, but when I try to append them into Blender they don't show up.
Answer: To import brushes in blender, you would have to convert it to jpg or png first. You can do it using GIMP. Open GIMP, drag and drop the PSD file and export it as jpg or png.
Also, appending them wouldn't work since it is not a .blend file. You would have to import them. Open user preferences, add-ons and search for 'Import Brushes'. Activate it and from the file menu, select Import, 'Brush Set' and browse to where you have saved your file.
Comment: There is no 'import brushes' in my add-ons
Comment: Maybe it is not updated for 2.8 yet. This will help you https://youtu.be/Y8IEt-a6AnU

Brush in .PSD file format not showing


can I extend the the antenna of a magnetron with a cable?

Question: If I connect a piece of heavy copper wire or copper rod to the antenna cap of a magnetron can I guide the current so that microwaves would be emitted further away ?
Answer: Yes, but at microwave frequencies most cable connections are lossy. So instead, a waveguide is used which is a hollow metal pipe that exhibits low losses, confines the microwaves, conducts them to where you want them, and beams them out into space through a special antenna called a feed horn.
Lots of info on waveguides and feed horns can be found on the amateur radio stack exchange, which is populated by very helpful people.
Comment: Hi Manu, good to hear from you. Short sections of wire are used all the time in microwave systems, so do not fear. The other trick would be to design the structure so that the magnetron itself is as close as possible to the load, to minimize the wire run. Note that if the wire has no grounded shield, it will radiate like crazy all along its length which is hazardous! best regards, Niels
Comment: ah cool to see you again Niels. I am precisely trying to avoid the waveguide (with a 6x3cm cross section), I want something more compact in order to deliver the heat in food (microwave penetration not that good contrary to pop belief). I can machine and perhaps solder (it's copper on the tip, and welding/brazing too risky) whatever would be needed to get a good contact
Comment: I would need about 25 cm of wire


How do I stop a monster from dropping a quest item once the related quest is finished?

Question: I'm trying to make a quest. When the quest is activated (switch is on), monsters should drop a certain quest item. After the quest is finished (switch is off), those monsters should stop dropping the quest item. How can I do this?
Comment: have you by chance seen this plugin? http://www.yanfly.moe/wiki/Quest_Journal_System_(YEP) . It is free at the time of this comment and works great for making quest options in RPG Maker MV. PS. I don't work for them and am not trying to advertise for them, just to point you in the direction of a tool to help you with your purpose. -Not posted as an answer because it doesn't directly address your question and uses a 3rd party plugin.
Answer: I think this is what your looking for. Go to "Troops" Tab in "database" and pick the troop
you want to use and look in the conditions window and select "conditional branch".From the
selections click "switch" type or choose a desired switch and click ok, in this case we
are naming our switch "quest item potions". Then click inside the conditional branch and select "change items" and choose a potion. Make sure increase is checked and not decrease or else it will take away a potion. so now if you choose to turn on (switch)"quest item potions" it'll give you a potion. BUT WE ARE FORGETTING SOMETHING STILL! Make sure to change the conditions window to the desired one in this case I picked "turn end".
Comment: Also don't forget after all this is done you still need to turn the switch "ON" for it to work. a nice example would be to make an "Event" have it tell you to hunt some bats and bring them a "potion" and then have that "Event" turn on the "Switch" "quest item potions" and then when you give the potion to the "Event" have the "event" turn the "Switch" back off.
Answer: If you have something like a loot table system where you can change the chance of the item appearing, you could set it to 0% to make sure it doesn't show up.
Other options are

The quest adding the item to the loot table while the quest is active
and removing it when it's inactive.
Having a locked state on your item, so it means that it cannot spawn.

And there are probably a lot more ways to go about this problem. Look at your architecture and see what's the best for your game. I would go for the second option, but it all depends on what kind of architecture you have for your game.
Comment: This answer would be better if it included some details about how to apply this advice in the specific framework of RPG Maker MV
Comment: Yeah, this answer sounds very generic. When i sat down and generalized my RPG's framework in Unity, some of these kind of things would work with it.


language-pack-uk-base error

Question: I got error when updating elementary juno
rytsar@rytsar-laptop:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  libsox-fmt-alsa libsox-fmt-base libsox3 sox ubuntu-minimal
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/372 kB of archives.
After this operation, 4.096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'language-pack-uk-base': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

any solution to fix this?
Answer: Your dpkg (package manager) can't read the listing file, required to install the 'language-pack-uk-base' package because of input/output error. Possible cause:
file system corruption. You can try solutions suggested here, or check your unmounted system partition with fsck from a bootable USB drive.

language-pack-uk-base error


Loading Satellite Imagery Into Trimble GeoExplorer

Question: How would I go about loading satellite imagery in TIFF format as a background file or image into my Trimble GeoExplorer?
Comment: It is up to the software you run on your GeoExplorer. Is is TerraSync, ArcPad or something else? Select the manual to read accordingly.
Comment: It is TerraSync
Comment: Do you have a manual? I have lost mine but I have used images in TerraSync and I know it is possible. I probably used jpeg + world files which is actually a bad option but OK for small images. I would recommend to use some tiled GeoTIFF variant but you must find out what kind of tiffs are supported.
Answer: The easiest and most straigh-forward method is to use Pathfinder Office.  Load the images into Pathfinder Office as backgrounds, be sure to provide projection information.  Once they are in Pathfinder Office you can use the Data Transfer Utility to send them to the device.  TIFFs are supported in TerraSync, but I have had issues with some of them not wanting to draw.  Keep in mind that there is very little onboard storage on most GeoExplorers, so the smaller the files the better.
You can also just move the file directly to your device using Windows Explorer.  Copy it over to the MyDocuments/TerraSync folder on the Geo (the same folder where your data dictionary is stored).  Before loading it in as a background, you will need to be sure that the correct coordinate system is set in Terra Sync. Once you have done that, just load it in as a background and TerraSync will display it.
To use it as a background in Terra Sync go to Map > Layers > Background and select the TIFF.
You might want to indicate the version of Terra Sync and Pathfinder Office and model of the GeoExplorer you are using for future questions.
Comment: I can attest to the fact that GeoExplorers (even with additional on board storage) do not like displaying aerial imagery rasters - very slow to load as a background file and long refresh times if you have to move your map screen extents. I would suggest clipping your imagery to the smallest extent that serves your purposes before loading.


Admin's node set to published by default?

Question: I currently have nodes set to unpublished by default because I want to approve user submitted content before publishing it live. However, admins should have their nodes published by default. How can I accomplish this?
Answer: Assuming Drupal 6.
Define a hook_form_alter function in your custom module and set the '#default_value' of the status element to TRUE. This will only run if the user has the correct permission. This way, nodes can also be unpublished by unticking the 'Published' checkbox.
<code>function mymodule_form_alter(&$form, &$form_state, $form_id) {
    if (user_access('administer nodes')) { // or other permission
        $form['options']['status']['#default_value'] = TRUE;
    }
}
</code>
Now your admin's nodes will be automatically published.
Thanks to andy for his comments.
Comment: Careful - this effectively _prevents_ the admin from being able to have unpublished content (whether they've ticked the checkbox or not): it would be better to simply change the default value of the published checkbox to be published. Also, rather than checking against roles, I think it's a bit nicer to check against a permission. And you're not gonna be checking against a single form ID, as each content type has its own node form.
Comment: You've raised some good points. However, even if #default_value was defaulted to published, wouldn't the problem of never being able to unpublish still exist? Perhaps we should check if the node has already been created. Also, do you mind explaining your last point some more?
Comment: Just kidding, #default_value works. Changing my answer.


Does an Egyptian need a visa to transit in Istanbul?

Question: I am an Egyptian citizen going to Mozambique with a 2-hour connection in Istanbul. Do I need a visa for that?
Answer: The official website states:

If you will not leave the transit lounge at the airport you are not required to have transit visa. Otherwise, you have to make visa application to the nearest Turkish Representation.

So you do not need a transit visa if you have a 2-hour layover at Istanbul.


Can i restore a previous version of my SharePoint 2013 workflow

Question: I did some faulty modification to my workflow 2013 inside SharePoint designer 2013 for our SharePoint online site. and i want to restore the previous version of my workflow , but can anyone advice if this is possible inside SharePoint designer? as inside SharePoint designer i did not find any option to do so? also the workflow is not showing inside "All Files", as follow:-
Answer: It is not supported since there is no version history for SharePoint 2013 workflow in SharePoint Designer 2013.
The Workflow catalog is not showing under "All Files" probably because you have never used SharePoint 2010 workflow in this site before. The Workflow folder will be automatically generated once you have (or have tried to) publish a SharePoint 2010 workflow to this site.
But still, this method does not apply to SharePoint 2013 workflow since this catalog does not store SharePoint 2013 workflows.
Comment: ok thanks for the info, so in other words i can not restore a workflow 2013?
Comment: @SharePointTestDev As far as I know, no. Your last chance would be previous versions in List settings > Workflow Settings. But if you have published or run the workflow successfully, there won't be any additional records here.
Answer: Follow the below steps, seems this is doable :
Here's how to revert to a previous version:

In the left pane of SharePoint Designer, click the little pin icon next to All Files.
Once All Files is expanded, scroll down and expand out your folder called Workflows. Note that if you have not actually created any workflows yet, you will not have this folder. Each workflow will be a "subfolder" under workflows. One weird little thing to point out also is that if you changed the name of any workflow after you created it, that new name will not show here, only the original name of each workflow will show in this list.
The workflow that I want to restore a previous version of is called "Check Audit Month", so I'll expand out that folder. Now I can see all of the files that my workflow is comprised of.
Each of these files has a set of versions. Right click on the XOML file, and choose Version History. I want to get rid of all the changes I made today, and revert back to the 4/12 version which I know worked correctly. I scroll down and click on the most recent 4/12 version. (I've blurred out the domain name I'm working in)
Click Restore.
Right click on the next file, the XOML.rules. Go find that exact same date/time of the file as the one in the previous step, and restore it. Note that the version number may NOT be the same.
Right click the next file, which is xoml.wfconfig.xml. Do the same thing by finding that same date/time that matches the one you restored at step 4. Restore it.
In this case, I don't need to change anything about my InfoPath XSN file, which is the task form as part of tasks that are assigned in the workflow. I'm skipping that one.
Important step after you've restored the old versions… EXIT SharePoint Designer. This is because of a cached version of your workflow needing to be refreshed.
Re-open your site in SharePoint Designer. When you open your workflow in the normal way now (as opposed to the funky way we did in step 2), you will see that good old version that you just restored.
Click Publish. Now your restored workflow is live and in use on the site.

The above solution applies to
This solution applies to all versions of SharePoint 2010, 2007, and SharePoint Online with Office 365. This does NOT apply to SharePoint 2013 workflows, but DOES apply to SharePoint 2010 workflows created in SharePoint 2013.
Reference:
SharePoint Designer – Restore Previous Workflow Version
Comment: but under All files i can not find a folder named "Workflows", as shown in the screen shot i provided


Bottle conditioned brew has condensation

Question: Is condensation okay in a finished bottle conditioned homebrew? It has been two weeks and I just tested one, it tasted fine but I am curious if that is ok. Also, some of the bottles have some white stuff floating on the top... are those okay to drink?
Comment: Most things that grow in beer won't kill you. But they will taste bad and may give you gastrointestinal discomfort. ;-)
Comment: This is not really an answer, but I can think of a few sources of white floaties: krausen residue from fermentation in the bottle, bacterial infection, wild yeast infection.
Answer: The condensation is fine.  You have a liquid at one temp and the exterior can experience a temp swing causing condensation.  It has nothing to do with the beer, its just science.
Without knowing your process its hard to guess at what the white floaties may or may not be.
Answer: What did you condition with?  I've heard some of the carb tabs can leave white particles.  If you've used a sugar water mixture, I wonder if this could be an infection of sorts.
Did you taste anything off in your sample?
Comment: Probably dextrose A.K.A corn sugar. You'd know "off" if you tasted it.
Comment: I am not sure exactly what it was that I conditioned with. It came with the kit I had. It was too fine to be regular sugar though. as for the taste, sadly this is my first batch, I don't know what "off" means.
Comment: haha, makes sense. It does not have any off tastes then.
Answer: I've had the 'floaties' twice. If I lager over a long period, even in winter, they occur. I researched it and just rack the beer of from below. They won't affect the taste, but will turn into a full-blown infection if left for too long; pretty much like any beer will, even without floaties.


image of render squashed after saving as image

Question: when i saved my render which was in 1:2 aspect XY ratio, it got squashed to the original camera ratio of 1:1. screenshots are given. please help!!
original render

saved image
Answer: The Aspect X and Y you can set in the output settings are used if the rendered image is intended for anamorphic display or on devices that have non-square pixels.
The Resolution X and Y is the real amount of pixels in width and height which get rendered (when you set it to 100%), no matter which Aspect you have set. You could say they are more or less independent from each other.

So, with the guess that you have left the resolution at the default 16:9 ratio with 1920 × 1080 pixels, you tell Blender your image should be rendered with this amount of pixels (left in the image below if the pixels were square) but the device where you are watching it will show this with pixels that are just half as wide as they are high (right in the image below), the grid physically having a pixel amount in a 16:9 ratio, but optically being displayed only with a 16:18 (or 8:9) ratio.

Now the problem is, since an image format like JPG or PNG always saves square pixels, in order to get an undistorted output on the device with the non-square pixels, the render camera has to adjust the width of its field of view to the X/Y aspect ratio, so in this case 1/2. Now this is important: it will not render half the amount of pixels in width! It will render 1920 × 1080.
And this means, to have an image of a perfectly round sphere on your device with non-square pixels (left in the image below) the camera has to capture an image with half the width stretched to the full width (right in the image below).

The thing is, and this is where it seems your question is lacking some information, usually by default the render result is shown with square pixels, i.e. as a stretched image in this case like below - and this is how the image gets saved.

But your render result shows an unstretched image so I can only suspect that you have set the Aspect X and Y in the Image Editor to 1:2 as well, to display the image as you expect to see it. However, this is a squashed version of the actual pixels - as it says there in the options, this is the Display aspect ratio. But only the actual pixels are saved with the image, not this squashed visualization because as I said before, image formats like JPG or PNG save square pixels. And this is why it looks correct after rendering but the saved image is stretched.
Answer: In the Output panel, make sure that the Aspect XY ratio is 1:1
Comment: I thought of just changing the _Aspect X_ and _Y_ as well, but then I realized that alone would not explain why the render result has (or rather seems to have) a certain aspect ratio and look normal while the saved image has a different ratio and looks stretched.
Comment: oh ok it may be that


Can a copyright be made in the name of a fictional writer?

Question: Is it possible to copyright a work in the name of a fictional writer? For example, like Nicolas Bourbaki or some pen name of some author? Can I use my own fictional name to copyright the work?
Comment: Note in case of copyright violation persecution occurs on demand of copyright holder. You need some way of proving that fictional person is you if you ever plan to make use of that copyright; Nicolas Bourbaki can't demand a torrent site takes down his books.
Comment: @SF. I see, thanks. Actually, I am more worried about it the other way. I am more worried of people not honoring the CC-BY-SA license. :-)
Answer: Yes, at least you can in the United States.

If you write under a pseudonym and do not want to have your identity revealed in the Copyright Office's records, give your pseudonym and identify it as such on your application. You can leave blank the space for the name of the author.

Reference: U.S. Copyright Office - Pseudonyms
Answer: Also: there are two ways you can indicate your pseudonym with the Copyright Office. You can either use just your pseudonym or you can use your real name and indicate you are "writing as pen name." Using the pseudonym as the copyright claimant can pose potential legal problems should such issues arise, so the Copyright Office rightly suggest that if you go that route, you should check with legal counsel.
Keep in mind, too, that because of tax requirements for payment, if you receive payment from a publisher, they will have to have your real name and social security number, unless you can work out some "middle-man" arrangement with an agent.
Finally, using a pseudonym doesn't offer any legal protection if you were, for instance, sued for slander or plagiarism.
Answer: Of course that depends on the country and internal laws but, since there may be Brazilian and Portuguese writers here, I'll answer based on those countries.
I just registered a book with IGAC, the institute that handles such requests in Portugal and it required my real name — which makes sense since it has to track who I really am — and my pen name — Eduardo Fernandes — which I think is for public consult of the archives.
If you want to use only the pen name, it's not possible, which — in my opinion — makes all the sense since no copyright institute can register a manuscript without proper documentation and, if they have your documentation, even if they would accept your pen name only, they would also have access to your real name. I don't see how it's possible to copyright a manuscript without knowing who — in legal terms — you are.
Of course, you can create your own legal fictional identity — for example, a small one-man company — and let the company have the rights on your work, not you. That would make the YourPenName Company be displayed as the owner, not you. Of course, again, your company will need to have papers and you would be listed as responsible for it, which would make your real identity findable.


How to make the output axis of hingejoint with rotational motor not affected by physics?

Question: I want the rotational motors be affected only by my controller, not by the physics of the world. The problem is shown in this video. How to fix this?
Answer: The problem comes from the fact that the environment is applying some forces and torques on your motor and the motor cannot hold its position because it is not strong enough. To fix this problem, you should simply increase the strength of the motor. For a RotationalMotor, increasing the maxTorque value should resolve the problem.
You should also ensure that you didn't override this value with a lower value using wb_motor_set_available_torque or wb_motor_set_torque. That means that you should not perform torque/force control, but either position control or velocity control (so that you don't limit the motor torque).
For a LinearMotor, the same applies with the force settings of the motor instead of torque. But I believe that in your case, you only have rotational motors.
Comment: oh that makes sense, thank you very much! I also experimented with turning the dampingConsant high in Hingejoint parameters, is this also a viable solution? somehow it also works
Comment: Yes, increasing the value of `dampingConstant` will have basically a similar effect. However, it will have a different impact on the dynamics of your simulation.
Comment: Hi Oliver, please read the meta answer https://robotics.meta.stackexchange.com/a/1485/37 and the question associated with it. Your teams has been flagged as a possible voting ring, and we would like to help avoid that in the future.


Exit Stellar app on Ledger Nano S

Question: Once I enter the Stellar wallet on my Ledger Nano S, there is no option to "Quit App".  This option exists for the other wallets on my Ledger (Bitcoin, Ethereum, Litecoin).  The only way I have found to exit the Stellar wallet is to disconnect the USB cable.  Am I missing something?
Answer: It is possible to exit Stellar app on the Ledger. On the main view with the following text:
Use wallet to view accounts

Press right button 3 times, it should display Quit app. Now, press 2 buttons at the same time.

Exit Stellar app on Ledger Nano S


What is the difference between using Docker Machine with Swarm and using Swarm through the Docker daemon?

Question: What exactly is the difference between having multiple docker machines in a swarm (a manager and many nodes) and having multiple replicas of a docker service in a swarm?
Answer: Well, since nobody answered this, I carried on reading more on the Internet trying to understand what's the difference between this two concepts. This is what I understand so far:

A Docker Machine is a very small virtual machine that runs an instance of the Docker Engine. This means we can run Docker containers inside it. It can be understood as a container of containers.
The Docker Engine has (since the 1.12 version) a module called Swarm Mode, which offers built-in support for connecting and orchestrating many machines (physical or virtual -- like Docker Machines) containing the Docker Engine. This basically builds a network of nodes that are directed by a manager -- a central node. At this point, an instance of a service could be replicated, and the manager would spread the replicas over the nodes efficiently.
Alternatively, Docker Machines can run Swarm containers (based on the Swarm image), which can be set up to behave in a similar way as in the previous case. Again, we can have a Docker Machine behaving as a manager and many others behaving as nodes, only this time the manager will not balance replicas of a service, but whole containers. When launching a new container, the manager will distribute it to a certain node. This is the standalone version of Swarm, and is only recommended when using a version of Docker previous to 1.12 -- otherwise the Swarm Mode is a better option.

I hope this helps.
Comment: This isn't correct. Docker Machine is not a VM. It's a mechanism for remotely managing potentially multiple Docker machines. When you connect your machine to another Docker host, you can execute commands locally (e.g. `docker-compose up -d` but they will actually be executed against the remote server. Read more at https://docs.docker.com/machine/concepts/. You're misconception is probably coming from how Docker for Windows and Docker for Mac create Linux VMs to host Docker in, but that has nothing to do with Docker Machine.
Comment: You're close but you're confusing the fact that docker-machine (the command) can be used to initialize Docker Engine into a virtual environment with "Docker Machine" BEING a VM. Docker can be hosted on a physical host and you can interface with that physical host using "docker-machine" as well, it doesn't have to be virtualized. For example, the way I sometimes use Docker Machine is I setup a physical Docker host, then I use docker-machine to initialize Docker Engine on that host and establish a connection to it. That host is not a VM and no virtual machines are created.
Comment: it seems to me that docker swarm is enough, why do we need docker-machine?
Comment: @Alan "Docker Machine is not a VM.". [Check again](https://docs.docker.com/machine/reference/create/). Your misconception is coming from how docker containers work. A docker-machine is not the same as a docker container.
Answer: Docker Machine is a tool for provisioning and managing your Dockerized hosts (hosts with Docker Engine on them). Typically, you install Docker Machine on your local system. Docker Machine has its own command line client docker-machine and the Docker Engine client, docker. You can use Machine to install Docker Engine on one or more virtual systems. These virtual systems can be local (as when you use Machine to install and run Docker Engine in VirtualBox on Mac or Windows) or remote (as when you use Machine to provision Dockerized hosts on cloud providers). The Dockerized hosts themselves can be thought of, and are sometimes referred to as, managed "machines".
https://docs.docker.com/machine/overview/#whats-the-difference-between-docker-engine-and-docker-machine
Docker Machine:
Tool for provisioning and managing docker hosts (virtual hosts running docker engine).
It automatically creates hosts, installs Docker Engine on them, then configures the docker clients.
You can use Machine to create Docker hosts on your local machine using a virtualization software like VirtualBox or VMWare Fusion.
Docker machine also supports various cloud providers like AWS, Azure, Digital Ocean, Google Compute Engine, OpenStack, RackSpace etc.
Docker Swarm:
A swarm is a group of docker hosts linked together into a cluster.
The swarm cluster consists of a swarm manager and a set of workers.
You interact with the cluster by executing commands on the swarm manager.
With swarm, you can deploy and scale your applications to multiple hosts.
Swarm helps with managing, scaling, networking, service discovery, and load balancing between the nodes in the cluster.
https://www.callicoder.com/docker-machine-swarm-stack-golang-example/


Prove coefficients of polynomial are elementary symmetric polynomials

Question: I want to show that for the $k$-th elementary symmetric polynomial $s_k:=\sum_{i_1\lt\cdots\lt i_k}X_{i_1}\cdots X_{i_k}\in R[X_1,\ldots,X_n]$ a monic polynomial that factors $\prod_{i=1}^n (X-\alpha_i)$ has the elementary symmetric polynomials as coefficients, e.g.
$$\prod_{i=1}^n (X-\alpha_i)=X^n-s_1(\alpha_1,\ldots,\alpha_n)X^{n-1}+\cdots+(-1)^n s_n(\alpha_1,\ldots,\alpha_n).$$
Is this possible by induction?
Comment: Yes, just write it out.
Answer:
"Is this possible by induction?" Of course it is!

Write $$\prod_{i=1}^{n-1}(X-\alpha_i)=X^{n-1}-s_1(\alpha_1,\ldots,\alpha_{n-1})X^{n-2}+\cdots+(-1)^{n-1} s_{n-1}(\alpha_1,\ldots,\alpha_{n-1})$$ and multiply this by $X-\alpha_n$. You get $$X^n-(s_1(\alpha_1,\ldots,\alpha_{n-1})+\alpha_n)X^{n-1}+\cdots+(-1)^{n} s_{n}(\alpha_1,\ldots,\alpha_{n-1})\alpha_n.$$
Maybe this is not very convincingly (because only two coefficients are explicit), but if you look at the coefficient of $X^{n-k}$ you can see that this is $$s_{k}(\alpha_1,\ldots,\alpha_{n-1})+s_{k-1}(\alpha_1,\ldots,\alpha_{n-1})\alpha_n=s_{k}(\alpha_1,\ldots,\alpha_{n})$$ (times $\pm$, of course).
Answer: The coefficient of $X^k$ is the sum of all products of $n-k$ distinct terms of the form $-\alpha_i$. This is the elementary symmetric polynomial of degree $n-k$ in $\alpha_1,\ldots,\alpha_n$ times $(-1)^{n-k}$ as we may identify these distinct terms by the sequence of their indices in increasing order.


What is the range of an IR sensor in a prototype comparing to real life application?

Question: I'm currently having a prototype which involve using an IR sensor for obstacles detection. But the results required a comparison of the range result I obtained from the prototype to compare it to a real life application. I have been surfing the Internet but none of the information was useful. I hope someone could help me to sort this up. Thanks and have a great day.
Comment: There's no obvious reason why a soundly engineered prototype would necessarily differ from a product.  You're going to need to be more specific about your system, results, and expectations.  Do you used pulsed IR to reject other sources?
Comment: Well, why would it be different?
Answer: Just like Friis Loss in RF calculations , the same applies to optical power.
Therefore the half beam width HBW of both emitter detector and bandwidth BW of Tx, Rx path loss and gain, noise threshold of Rx and interference come to play.
Often these rated in kbps-meter products. thus if using DC only, filtering and integration for changes make garage door sensors very sensitive to 10m and Remote controllers good for perhaps 10 to 50m , more or less depending on emitter current (mA) pulse and emitter HBW for transmission with ceiling reflection. Here the carrier was in the 30kHz region with AGC and 3kHz BW in the Rx with a Q=10 BPF integrated in Rx. (Sharp/Vishay)
But without these design choices, the range might only be cm or m . Laser diode emitters obviously give more range.  Object reflection depends on reflectivity and scattering, while Object path sensitive depends on beam width.  I have used 100mA 10 deg emitter pulses and using IrDA2 detectors with binary codes to get error free detection in recessed apertures to 1deg to detect a resistor wire crossing a 1m path. You cannot do this with reflection.
Comment: Thank you so much for helping with such detailed information. Much appreciated and sorry for the late reply.
Comment: Any questions? Understand this yet?
Comment: Don't forget to upvote or improve your question
Comment: upvoted. Thanks and have a nice day.
Comment: I guess you need credits to vote
Answer: Back in university, a friend examined various optical distance detection methods.
Importantly, he found DUAL sensors (one LED, two photodiodes/transistors) with an OFFSET DISTANCE between the 2 sensors, allowed a more robust detection system.
In later years, I modified the sensor interfaces, using regular diodes to post-process the photodiode currents into LOGARITHMS of the photon flux.
By taking the LOG, thus compressing the dynamic range, we would get a uniform change in output (differential) voltage, regardless of the target reflectivity.
We experimented with 8" by 8" washcloths, from off_white to dark_blue; quite useful results for distance detection.
Comment: I had actually generated the analog result which obtained by using an arduino. The problem that im dealing with now is that my so called lecturer wanted a scaling factor of the distance of the sensor compare to the real life application. But anyways thank you so much for helping. Much appreciated.


Expected stopping time

Question: Let $X_1,X_2,\ldots,$ be iid uniform in $[0,1]$ and define $S_n:=\sum_{i=1}^n X_i$. Let $\tau$ be the smallest $n$ for which $S_n>1$. It is known that $E[\tau]=e\approx 2.7183$, and this can be easily shown using the
Irwin-Hall https://en.wikipedia.org/wiki/Irwin%E2%80%93Hall_distribution
distribution. Indeed,
$$ P(\tau\ge n) = P(S_{n-1}< 1)=1/(n-1)!,$$
whence
$$ E[\tau]=\sum_{n=1}^\infty P(\tau\ge n) = \sum_{n=0}^\infty 1/n! = e.$$
Here, all of the heavy-hitting is done by the
Irwin-Hall distribution, and I'm wondering: is there a clever "soft" martingale argument that gives the answer with less heavy-hitting?
Comment: Typo in the discussion: $S_n$ should be $S_{n-1}$. It should read $P(\tau \ge n)=P(S_{n-1} \le 1)=1/{(n-1)!}$
Comment: Thanks @yuval, fixed.
Answer: The linear map  $T(x):=(x_1,x_1+x_2,\ldots,x_1+\ldots+x_n)$ taking a vector in $[0,1]^n$ to its partial sums is volume preserving, as it corresponds to a triangular matrix of determinant 1 (or by induction.) Consider the set $A_n$ of vectors $x$ in $[0,1]^n$ such that  $x_1+\ldots+x_n  \le 1$. The image $T(A_n)$ is the simplex  $\{y \in [0,1]^n:  y_1 \le y_2 \ldots \le y_n \}$ that has volume $1/n!$ by symmetry. Therefore Vol$(A_n)=1/n!$ as well. In other words,  ${\bf P} (\tau>n)={\bf P}(S_n \le 1)=1/n!$.
Answer: For $x \in [0, 1)$, let $\tau(x)$ denote the smallest $n$ for which $S_n > x$.  Let $g(x) := E[\tau(x)]$.  We're interested in $g(1)$.
Using its definition, $g$ satisfies an integral recurrence
$$ g(x) \ = \  \int_{y = 0}^{x} [1 + g(x - y)] \ dy   \ + \ \int_{y = x}^{1} 1 \ dy   $$
which if I'm not mistaken, is satisfied by the function $e^{x}$.  It also satisfies the "limit boundary condition" $\lim_{x \rightarrow 0} g(x) = 1$, which I believe can be established using crude arguments.  I am not going to attempt to argue that these two conditions force the unique solution $g(x) = e^{x}$, but it looks true and doable.
(Note, this might be isomorphic to some of the work on Irwin-Hall; I haven't checked.)
Comment: Hi Andy- indeed, the same argument as the one in my answer above shows that ${\bf P}(\tau(x)>n)=x^n/n!$ . Summing this over all $n \ge 0$ yields ${\bf E}(\tau(x))=e^x$.
Comment: Please excuse the fact that my answer is basically the same as this one. Mine is a little bit different in that it emphasizes that this technique is quite general for calculating expected hitting times of Markov processes, but for this particular problem they are almost exactly identical.
Answer: One way, although it does not use martingales, is to consider a discrete time Markov process whose state space is $[0,1] \cup \{ \square \}$ (the choice of symbol for the extra state is not important). This process says that $X_{n+1}$ conditioned on $X_n$ is equal to $X_n+u$ for $u \sim U([0,1-X_n])$ with probability $1-X_n$ and is equal to $\square$ with probability $X_n$. And $X_{n+1}$ conditioned on $X_n=\square$ is $\square$. Define
$$(Pf)(x)=E[f(X_{n+1}) \mid X_n=x]$$
Explicitly:
$$(Pf)(x)=\int_x^1 f(y) dy + x f(\square) \quad x \in [0,1] \\
(Pf)(\square)=f(\square).$$
Then define $L=P-I$. Renewal theory tells you that if $\tau$ is the time to hit $\square$ then $E[\tau \mid X_0=x]$ satisfies the equation
$$(Lu)(x)=-1 \quad x \in [0,1] \\
u(\square)=0$$
which expands out to
$$\int_x^1 u(y) dy - u(x) = -1 \quad x \in [0,1].$$
You want $u(0)$. Differentiating, you get $-u(x)-u'(x)=0$ so that $u=Ce^{-x}$. Plugging back into the integral equation you get $-\frac{C}{e}=-1$ so $C=u(0)=e$. Alternately you could note that $u(1)$ must be $1$ (why?) and get the same result.
When I say "renewal theory" this is not really something complicated; it is just saying that $E[\tau \mid X_0=x]$ is $E[\tau \mid X_1=y]$ integrated in $y$ against the conditional distribution of $X_1$ given $X_0=x$. Then the thing being integrated is the same as $1+E[\tau \mid X_0=y]$, where this $1$ takes into account the fact that a step takes $1$ time.

Expected stopping time


200 magic number

Question: 2005 Pontiac Bonneville 3.8 SE. Temperature steady at 200 degrees constantly. Never goes higher even in stalled traffic. I have actually let the car idle for 1/2 hour and electric fan has NEVER came on and temperature just stays at 200. Fans come on when I put the a/c on, but even then temperature will stay the same. Car runs great and no leaks, codes or other wise. Is this normal or should the fan come on? 195 thermostat. Temperature drops gradually as it cools down after I park it.
Comment: Sounds like your thermostat is working well to me.  How and where are you testing for the temp?  Are you in a cold/cool climate?
Comment: Are you sure your temperature indicator sensor is working correctly, and that it can measure above 200 degrees? Seems like it would go above 200 when idling for a while, unless the fan was running.
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: I agree with Tedwin ... it sounds like it's running right where it needs to be. Most GM vehicles I've run (and that's quite a few of them) have had the temp gauge read right about the middle of the gauge. While the dash gauge isn't uber accurate, 200°F is right about where a 195°F stat should be running at. As long as it isn't going above it and you have no other signs it's doing anything but running right, I believe you're good to go.

200 magic number


The Google Maps Wikipedia Layer

Question: Is there a way to programmatically list all geo-tagged Wikipedia entries within a radius of a long/lat point? I'm thinking this is possible with the google maps API but I am interested in any method. NOTE: I do not want to display a googlemap.
Answer: Yes, it's possible.  The hard part is either:
(1) Screen-scraping Wikipedia (bad idea, unless you already have a (small) list of target pages)
(2) Downloading and parsing the massive Wikipedia data sets (better idea)
Once you have lat/long coordinates, which I assume are in the wiki page's geotag format, you can use the great circle formula to compute relative distances, and bypass Google's API entirely.
The moral of this story?  When you've dealing with datasets this massive, you're going to want to do as much of it offline as possible.
Answer: I've solved a slightly similar problem by using the GeoNames webservices.
You can use the webservice to request cities and so on. There is a per-ip-limitation you may not exceed.
I searched a little further and there's something interesting for you. The webservice is called findNearByWikipedia. It may be the thing you're searching for...
Answer: Another option is using DbPedia SPARQL interface. For example, the following SPARQL query gets wikipedia articles within bounding box limited by coordinates.
SPARQL libraries widely available, for example for SPARQL Endpoint interface to Python
To test it, just paste the query below to this online query editor:
http://dbpedia.org/sparql
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX onto: <http://dbpedia.org/ontology/>

SELECT * WHERE {
?s a onto:Place .
?s geo:lat ?lat .
?s geo:long ?long .
FILTER ( ?long > 30.3 && ?long < 30.5 && ?lat > 50.4 && ?lat < 50.5)
}

LIMIT 100

Gets the following result:
"s","lat","long"
"http://dbpedia.org/resource/Kotsiubynske","50.48972320556641","30.32888793945312"
"http://dbpedia.org/resource/Akademmistechko_%28Kiev_Metro%29","50.46555709838867","30.35499954223633"
"http://dbpedia.org/resource/Zhytomyrska_%28Kiev_Metro%29","50.45583343505859","30.36416625976562"
"http://dbpedia.org/resource/Sviatoshyn_Airfield","50.47833251953125","30.38500022888184"

The Google Maps Wikipedia Layer


When does strong duality fail in linear programming?

Question: When does strong duality fail in linear programming? I have considered the case when both primal and dual solutions are infeasible, but then there are no optimal solutions at all.
Comment: Can I ask why you deleted this question?  For future reference, we normally prefer that you avoid deleting your question after you've received an answer -- that might be considered impolite to people who take the time to answer.  Part of our mission is to build up an archive of high-quality questions and answers that might help others in the future.  Deleting your question prevents others from benefiting from the answer; people writing an answer might be hoping that others would also be able to benefit.  I realize this might not be obvious at first glance!
Answer: The strong duality theorem of linear programming states that (quoted from "Algorithms" by S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani, 2006) "If a linear program has a bounded optimum, then so does its dual, and the two optimum values coincide." Hence, it never fails.
Answer: There is a very good exercise - 5.23 - in Boyd's book on Convex Optimization (the solution might also help).
They prove that strong duality holds for the following LP and its dual provided at least one of the problems is feasible.
In other words, the only possible exception
to strong duality occurs when $p^*= \infty$ and $d^*
= − \infty$.
LP:
$\min c^Tx$
st $Ax=b$
DUAL:
$max −b^Tz$
st $ A^T z + c = 0$ and $ z \succeq0$


How well will the Arduino Uno survive in a vacuum?

Question: Im doing some experiments with Pocketlab and Arduino, Vacuum will get to around -30inHg. I tried with my raspberry pi and it just kept dying everytime a vacuum was pulled. The only problem I can image is the arduino heating up.
Comment: http://www3.telus.net/schmaus2/vacf/vace1.html
Comment: This is a SE Electrical Engineer question.
Answer: Interesting question. You're right- heat is your enemy. Given the power dissipated by a Pi even when idle I'm not surprised it died. Most chips depend on convection to get rid of heat. A loaded Pi might require a (convective) heat sink and/or fan to keep it's core temperature down to an acceptable level, and that's at normal pressure and temperature. An Arduino -might- be able to work in a vacuum- it can lose some of it's heat through lead conduction- it'll only draw ~.25 watts normally vs 2.5 watts plus for a loaded Pi.
Ultimately it will depend on your application. If you have idle time when you can put the Arduino to sleep that will help keep it cool. If you have a conductive heat sink you can use then that would certainly help.
Comment: Also (assuming an Uno as it's tagged) the electrolytic capacitors on the board will most certainly pop. You'd want to replace those with tantalums at the very least.
Comment: Thanks, I've never had problems with capacitors in a vacuum before so I dont expect problems with that, I do expect the on board LED's to die though.


Windows 7 takes 4 minutes to mount a USB mass storage device

Question: I Have a custom USB Mass Storage Device that has been used in Windows XP for years as part of a product. In XP, the device mounts within seconds, with a drive letter and a window. In Windows 7, it takes 4 minutes to do the same. What is the difference between the way Windows 7 and Windows XP mounts a USB Mass storage device?
Comment: What size? Filesystem?
Comment: Windows 7 is nosy too, it scans all the files on the drive to see what options to present you on it's little pop-up menu... pictures, music, programs.    "Show me my files Dangit!!"  is the option I always want... knock it off!
Answer: Windows 7 performs a consistency check when USB storage is mounted, though I don't know the exact details of the process. I have a couple thumbdrives that I sometimes mount in Linux that always get a little hiccup from Windows 7 the next time I move them over after messing with files.