Bonding of neutral and ground

Question: I havd a disconnect at meter which supplies a panel about 70 feet inside building.  I upgraded the system based on comments from a previous question.
At the disconnect, when I add the neutral conductor (green wire), I disconnect the wire that ran from the neutral to the case of the disconnect.  So now my question occurred to me as to whether I should bond he neutral and ground at my new panel or reconnect my ground to case at the disconnect??
Comment: Green conductor is safety ground, not neutral. Grounding = Green or Bare = always bonds to case, only carries fault current. Grounded = Neutral = Gray or White = Only bonded to Grounding at one point, normally carries current. Your description leaves questions about what you have done. Please [edit] to add some clear pictures.
Comment: @Ecnerwal  You type fast.
Answer: If you have EMT, IMC or RMC metal conduit run all the way from the disconnect to the subpanel, then you can use that metal conduit itself as the grounding path, and no ground wire is needed.
Otherwise, you need to have run 4-wire cable (or 4 wires).
Sean Connery rule applies.
"There can be only one" bond between neutral and ground.
First, get your colors straight.   Neutral is not ground.
Neutral = white or gray
Ground = green, yellow/green striped, or bare  (that's true 'round the world).
Neutral comes from the utility.  It exists in all places.
Ground is created, by you, at the very first disconnect past the meter.  In that location you:

Establish a Grounding Electrode System (grounding rods)
Have a "ground bar" bonded to the metal frame of the disconnect
Bond neutral to ground, in this one and only place
Carry neutral and ground separately everywhere else.

Since neutral and ground are bonded here in the main disconnect,  you can actually use the same "bar" for both neutral and ground.   It's not my favorite way to do it, though.  I prefer separate, isolated bars, and the fattest wire  you can get as a specific neutral-ground bonding wire.  The reason is, so you can put a clamp ammeter around that wire which is handy for troubleshooting a variety of problems.
As a practical thing, the meter pan itself also gets grounded because you use EMT, IMC or RMC Metal Conduit between meter pan and disconnect. Once had someone try to use PVC... they couldn't find a way to ground the meter pan.  Golly!
Neural and ground are carried as separate wires
At the subpanel, place the white neutral wire on the neutral bar.
Place the green or bare ground wire on the ground bar (or rely on the metal conduit).
Any subpanel must have neutral and ground un-bonded. Can't bond it here; that would be  two bonds!
Comment: Thanks .. sorry for the green colored insulation.   It was all the supply house had in stocks.  Otherwise, I would have used white for neutral.  So I think I need to reconnect my wire from neutral lug in disconnect to the case of the disconnect and not bond the subpanel inside. ??
Comment: @Herb1960 Yeah, shortages.  *But you can't just leave it green!*  You have to get some white tape and wrap it in a spiral so the wire looks white.  If the wire is #4 or larger, you are done; that is Code compliant.  #6 or smaller it's good for temporary but you need to get real white wire when the shortages abate.   Also, is there a separate actual ground wire (green or bare)?

Bonding of neutral and ground


Regression on a constant

Question: If I have observations of $y_{i}$ and $x_{i}$ which are i.i.d. I also have OLS assumptions such as $E(\epsilon_{i} \mid X_{i})= 0$, my qustion is:
If I project $y_{i}$ onto a constant $\mu$, that is, we have model
$y_{i} = \mu + \epsilon_{i}$. Does finding the OLS estimator $\hat\mu$ has anything to do with $x_{i}$? Because in my opinions, $x_{i}$ never emerges.
Thanks~
Comment: Please edit your question instead of add more comments. Then, we can better judge if the question is to be closed or not.
Comment: @denesp I was simply trying to give more details and I'm actually asking the same question. Anyway, you have the right to vote for that.
Comment: So this is actually a problem of my econometrics class. The problem asks me to write down the OLS estimator of $\mu$, while it gives me assumptions as following: (1)$y_{i}$ and $x_{i}$ are i.i.d. (2)$E(\epsilon_{i} \mid X_{i})= 0$ (3) $var(\epsilon_{i} \mid x_{i}) = \sigma^2 x_{i}^2$
Comment: Why do I even need those assumptions in the first place? $x_{i}$ seems irrelevant with $\mu$
Comment: I am voting to close this question as unclear because there is one question in the body of the question and two more in the comments. Each depict different scenarios. It is impossible to guess which one is the real one as we are not in your class.
Answer: So basically the question is:
If I know the average ($\hat{\mu}$) of the daily temperatures ($y_i$) of last year, does that tell me anything about how many people were born ($x_i$) each day?
Unsurprisingly the answer is no.
The most you can get is the average of the $x_i$ series if you have the parameters of an unbiased regression between $x_i$ and $y_i$.
Comment: I have expressed my question in an improper way. What I really want to ask is: Do I really need information about $x_{i}$ to estimate $\mu$? Or, does the formula of my estimator $\hat{\mu}$ include $x_{i}$?
Comment: Do you need to know how many people were born ($x_i$) each day to know  the average ($\hat{\mu}$) of the daily temperatures ($y_i$)? No, you do not need that.
Comment: Indeed this is a very clear explanation. Thx!
Answer: I don't think it will have anything to do with $x_i$. Here is my thought:
Given your setup, in order to find $\hat{\mu}$, we regress $y$ on an $n\times1$ vector of ones, $\begin{bmatrix}1\\1\\ \vdots \\1\end{bmatrix}$ ,which we shall call $\iota$ (iota). Then we will have $\hat{\mu}=(\iota'\iota)^{-1}\iota'y=\frac{1}{n}\iota'y=\bar{y}$. So $x$ doesn't play a role here.
Note the projection matrix $P_{\iota} = \iota(\iota'\iota)^{-1}\iota'=\frac{1}{n}\iota\iota'$, and $P_{\iota}y=\bar{y}$.

Regression on a constant


What is and does a .properties file contain?

Question: I want to know what is the use of .properties file and where it is used?
Currently I am doing dynamic web application with ANT and I have to use a .properties file when I set a property inside the "build.xml" file.
Answer: A .properties file is a simple collection of key-value pairs that can be parsed by the java.util.Properties class.
Properties files are widely used for many purposes in all kinds of Java applications, often to store configuration or localization data.
ANT properties are an ANT-specific concept and not identical to properties files, though ANT properties can be read from such a file, usually in order to have a central point to store frequently used and changing configuration data. Then you can have a line like this in different ANT scripts:
<property file="foo.properties"/>

And all the scripts can then use those properties.
Answer: Properties are used to externalize the data which is configurable and if you put that data in your code you have to build the code each time you want to change the value of the property.
The main advantage of properties is that they are outside your source code and you can change them anytime.
To use properties refer to java.util.Properties class.
Answer: Properties files allow you to separate function (what the build.xml does) from the data it uses to perform that function (the properties).
For example, different developers on a project might have a different project root directories.  The build would need to know which directory is the root, after which the functions it performs would be based on that directory.  So rather than having a custom build.xml per developer, you would put this information in a properties file.
Answer: Given your Ant file contains something like
<property file="build.properties"/>
<property name="prop1" value="value1"/>

if build.properties contains a line
prop1=valueFromPropertyFile

Then all references to prop1 will give you valueFromPropertyFile.
Best practices would be for all properties to be set in build.xml and have build.properties existence be optional to override specific settings for different environments.  These properties can also be overridden on the command line with:
ant -Dprop1=valueFromCommandLine

Command line takes precedence over build.properties which takes precedence over whatever is in build.xml.
Specific examples in the web domain:

Different IP address to deploy to between production, test, and development.
Setting a flag to compile with debugging information off and on
Setting a flag on whether to deploy an exploded war/ear or the packaged version
Choosing whether to run smoke tests, unit tests, integration tests, acceptance tests or everything
Different passwords between environments
Whether to create and populate the database or use an existing one
Which web.xml to package depending if deploying to Tomcat, GlassFish, JBoss, etc.


How could Dudley have wrecked his PlayStation if the PlayStation didn't exist yet?

Question: Harry was born in 1980. Therefore, the fourth book should be set in 1994. Yet, Harry mentions in his letter to Sirius that Dudley chucked his new PlayStation out of the window. The only problem is that the PlayStation wasn't on the market in Britain at that time.
Comment: I think it's kind of a waste of time to ask a question that doesn't truly have an answer based in canon. Pureferret offers an explanation -- it was a mistake -- but it's sheer luck that JKR happened to address it. I don't feel this is a useful question for the site. It's like asking why baby Harry is wearing a Blue's Clues romper in *Sorcerer's Stone* the movie. Because it was a mistake. Period. YMMV. :)
Comment: And WHERE did he get a copy of "Mega Mutilation Part Three"??  I can't get my hands on it at any price!!  ;)
Comment: Whenever you notice something like that, a wizard did it.
Comment: Irrelevant, I know, but I believe it has been shown on moviemistakes dot com that it isn't a Blue's Clues logo on Harry's suit, but just a blue bunny or bear or similar.
Answer:
"As obsessive fans will tell you, I do slip up! Several classrooms move floors mysteriously between books and these are the least serious continuity errors! Most of the fansites will point you in the direction of my mistakes. But the essentials remain consistent from book to book because the story has been plotted for a long time and it is clear in my mind."

—J. K. Rowling on the errors within the franchise
Dudley smashes his PlayStation before it was even released in Japan (Dec '94). This is simply an error on JKR's part, as I doubt she knew the history of PlayStation when she wrote GoF.
The other possibility is that Vernon had signed up for the product tester, and received a PlayStation and a few games before the official release in Europe (Sept '95).
Comment: Love the suggestion that Vernon signed up for product testing :-)
Comment: I see "classrooms move floors" in a (supposedly) magical world as a pro, not a con.
Comment: @n611x007 It's also not very uncommon for a class to be in another classroom in subsequent years, when I was in high school I had to look up where all my classes were at the start of every year. Only things like chemistry, biology and physics classes would remain in the same place because of all the accessoires that need to be present there
Comment: "The PlayStation has too many bugs and inconsistencies... let's smash it!"
Comment: I think I remember seeing a JKR interview where she specifically mentions the playstation as a mistake.  She said something in it like, she's bad with dates (or numbers?).
Comment: another +1 for product testing :)
Comment: @Izkata I couldn't find that quote unfortunately. But I know she has said before she can't do maths.
Comment: As the other answer mentions, Vernon might've signed up as a tester. But a tester of *what* ? It could've been one of the [Nintendo PlayStations](https://www.engadget.com/2015/11/06/nintendo-playstation-is-real-and-it-works/) and then it'd be perfectly understandable to chuck it out in frustration because it was a prototype and those are usually not the most reliable. These were made in 1991 so the possibility is there -- although of course in 1991 Nintendo already broke up with Sony so the chances of one of these finding its way to England in 1994 to a non-industry person are fairly slim but


In the double slit experiment, using only one photon, will it create a diffraction pattern on an ultra sensitive screen?

Question: Given the double slit experiment, send one photon through the open slits, then stop.  With just that one photon traveling through both slits it will appear as a point on the screen.  If the screen was ultra sensitive would we see the typical diffraction pattern in addition to the single point?
Comment: Under ideal conditions, one photon will remain one photon. No amount of precision in your measurement apparatus should be able to measure more than the point where that photon hits the screen. In a practical experiment things will be different. A true single photon source is difficult to achieve. Also one photon may "split" into many after interacting with whatever material your slit is made off (and the other stuff in your vacuum...)
Comment: Several experiment were made to answer your topic question and the answer is univocal yes. Some use extremely weak sources, some use extremely long exposure times but predicted pattern always emerges. See for an example:

http://www.teralab.co.uk/Experiments/Youngs_Slits/Youngs_Slits_Page4.htm
Answer: No.
As a rough guide particles behave like a wave when they they are travelling and they behave like a particle when they exchange energy with something else. During its path from the light source through the slits to the screen the light is delocalised, that is the photon doesn't have a position in the sense that macroscopic objects have a position. That's why it is able to pass through both slits at the same time.
However when the light interacts with the screen to create a spot this is a specific interaction that happens at a well defined position. For example if the screen is a photographic plate the photon will exchange energy with a specific silver atom in the photographic emulsion. The energy exchange happens only at this one spot so there is no faint diffraction pattern to be seen aywhere else on the screen.
This experiment can be done, and indeed has been done with diffracting electrons though I'm not sure about photons. Each particle creates a single spot, but the probability distribution of the spots corresponds to the diffraction pattern. So as more and more spots are recorded the diffraction pattern appears. This has been discussed here before. For example see Anna's answer to this question.
Answer: Here is a sequential picture of single photons accumulating into an interference pattern:

Single-photon camera recording of photons from a double slit illuminated by very weak laser light. Left to right: single frame, superposition of 200, 1'000, and 500'000 frames.

The experiment:

In 2003, A. Weis and R. Wynands at the University of Bonn (Germany) designed a lecture demonstration experiment of single photon interference from a double slit . Light from a laser pointer was so strongly attenuated that at each instant there was only a single photon between the double slit and the detector. The diffracted light was recorded by a single photon imaging camera consisting of an image intensifier (multichannel plate, MCP) followed by phosphor screen and a CCD camera. When adding consecutive camera frames one sees the gradual appearance of the smooth classical interference pattern (Fig. 1).

Study the left photo where single points are seen. Do you see any diffraction pattern? The single photon should be spread as in the last frame on the right after all, if it would be spread all over the x axis.


Transfer Clash of Clans village to another iPhone

Question: I will soon buy a new iPhone. If I log in with my Apple ID in my new phone could I still access my Clash of Clans village without starting from scratch?
Answer: You'll want to use iTunes or iCloud to which to back up your iPhone prior to replacing it. For example, if you backup to iTunes and enable encryption, all your data and passwords will be covered as well as your apps. When you get the new phone, you would then immediately connect it to your system and use iTunes to restore your data to the new phone from backup.
As long as your backup and restore do not have any CoC action in between, your level information should transfer at par.
Answer: Providing you are signed in to Game Center on both devices, your progress will transfer automatically.


Transaction Log file size for Index reorg

Question: I have a DB that is 100GB. It's fixed this way on purpose. It won't exceed this. I have two indices. One with a single value. One with three values.
I'm not a DBA. I'm a guy who's been tasked with working on SQL DB's part time on occasion. They were created by someone else and I'm on the steep part of the learning curve.
I have the transaction log set to 150GB. It works great until I automatically reorganize the indices. At this point I always get a transaction log full. Even if I set it to back up the log, then reorganize.
If I manually reorg it's fine, because I can do each index separately and I BU the trans log first.
So how big do I need the trans log to be, based on the above info, in order to be able to set up a maint task to reorg? Will it be any better if I do a rebuild instead?
Comment: You could stop doing both and just update statistics.
Comment: Again, I'm no DBA so would kindly ask for more explanation. This DB is written to every minute, 24/7/365. The source remembers when it last wrote to the DB, so if no writes are happening the source holds the data and then writes when it can, so no data are lost. However, when an index frags above 90% or so I get timeout errors, because it takes > 1 Min to write to the DB. Will updating statistics get rid of the timeout errors?
Comment: @ThomasCovenant I would say that being the case, the less you're doing manually the better. All the more reason to turn on Auto Update Statistics, and Auto Growth.
Comment: I am going to try turning on statistics and auto update statistics. As I mentioned in my other comment, I cannot auto grow this log. I'm against the HDD limit on these older systems.
Thanks again! I'll let you know how it works out.
When I turn on the statistics and auto update, will I still need to re-org the indices on a regular basis?
Comment: That's a great question. My answer will be the same as it is to most programming situations, try and see. I reckon a lot, or at least some of the gain you're getting from the index reorg IS that the stats are being refreshed. My advice, setup an agent job to rebuild the indexes daily, during a time you KNOW the database is under little to no load.
Answer: You mention that if you run the index rebuild process manually, and take a transaction log backup in between each index rebuild, then you don't have a problem.
As has been noted, you can create a script to rebuild each index, taking a transaction log backup in between each rebuild.
Alternately, you could increase the frequency of your schedule transaction log backups while the rebuild process is running. For example, if you normally perform tlog backups once an hour, do it every ten minutes for the duration of the maintenance job.
There are multiple ways to do this:

Schedule a secondary tlog backup job for the expected duration of the index rebuild.
For instance, if your regular tlog backup runs at 1AM, 2AM, 3AM, etc., and the rebuild job runs at 2:30 AM and usually takes no more than 3 hours, schedule a secondary t-log backup starting at 2:35 AM, running every 10 minutes, and ending at 5:35 AM.
Have a disabled secondary schedule on your t-log job that you enable at the start of the rebuild job, and disable at the end. In this case (with the same theoretical frequencies as in the example above), this schedule would be set to run the job every 10 minutes starting as 12:05 AM. You should be able to use sp_update_schedule to enable and disable the job schedule. I would make sure the schedule had a unique name, and use that in the stored procedure (as that could remain the same across multiple servers).
If the schedule was named "TLog Additional Runs", You would use:
EXECUTE sp_update_schedule @name = N'TLog Additional Runs', @enabled = 1;

to turn the schedule on, and:
EXECUTE sp_update_schedule @name = N'TLog Additional Runs', @enabled = 0;

to turn it off.
Answer: Perhaps AutoGrowth on the .ldf will help you here?
According to Brent Ozar, who is a legend in this space, set your FileGrowth setting for the .ldf to 128mb.
As per Erik's suggestion, I would also make sure that you have Auto Update Statistics turned on.
Comment: To add - they recommend sizing your transaction log equal to 2x the size of your largest index.
Comment: Awesome. I didn't even think of doing this as a job instead of as a maintenance plan. Yes. I think one at a time, with a break to backup trans log will do the trick, running as a SQL job instead of a maintenance plan. Ha! Simple. Thanks very, very much to all of you!
Comment: Thanks for the answer! Unfortunately these systems were put together using 500GB drives and the limit of trans log size is about 150GB. I can't autogrow them without running out of HDD space, which makes things worse. Our newer systems are using dual 1TB drives, with 1TB dedicated to SQL. So this isn't an issue. But the older systems are limited.
Comment: @ThomasCovenant What a conundrum! Is it possible to put the database into simple recovery mode? If I'm not mistaken it reduces writes to the log.
Comment: 2X largest index. Yeah. Is there any way to automatically reorg only one index at a time?
Comment: @ThomasCovenant Yup! `ALTER INDEX IX_Your_Index_Name
  ON Your_Table REORGANIZE ;`
Comment: Reorgs are always single threaded, so, they are already running one at a time.  It sounds like you just need a break between the two and maybe a backup between them.  You could simply create a Sql job which does the reorgs with a backup between them to run in sequence.  Don't forget you will need to update the stats afterwards.


Does focal length change when I adjust the focus?

Question: When I adjust the focus of my camera, in general, does this affect the focal length? I have heard that it does.
Comment: Not obviously. In fact, it might inspire the second question. And this affects non-zoom lenses too. Zooming moves the emements around and *maybe* the complex camming isn't perfect in preserving focal position.  That doesn't say anything about the size of objects "breathing" in a prime lens when the focal point is changed.
Comment: @mattdm sounds like the opposite, not a duplicate.
Comment: @JDługosz Errr, sure. But that means the concepts and answers are the same.
Comment: Iac, the answers there to not address *this* at all.
Comment: Here's the duplicate question: http://photo.stackexchange.com/q/16549/15871
Answer: In general: possibly yes.
You actually adjust focus of your lens, not your camera. It can be an advantage1 to design a lens in a way that it changes its focal length slightly when focusing. This is not very important if you take still images. This is different for video of course and one reason why cinema lenses are so expensive
But even if your lens is not guaranteed to have a constant focal length, it might still have it. Maybe it's just having that issue at certain focal distances and you'll be able to happily modify focus at other distances without seeing any change in focal length. To what extent a feature is partially existent on a product is something you will never see advertised or in a spec list. If a constant focal length is important to you, you should rent the lens and try it out if it is not explicitly labelled to have this feature.

1 advantage as in the lens designers do not have to worry about it. It costs money to make lens designers think about things. If a company decides that a feature of a lens is not important and the lens designers do not have to think about it, it can make the lens cheaper, which can be an advantage (if you don't care about the feature either)
Comment: It might help to clarify why keeping focal length constant wouldn't just happen "by default", or why a lens assembly with a given level of complexity whose focal length changes with subject distance may offer better performance than one *of the same complexity* whose focal length couldn't change (e.g. the required amount of compensation for chromatic aberration may vary with subject distance, and changing the amount of compensation may in turn change the effective focal length).
Answer: I think Alan Marcus is saying that focusing on near objects requires moving the lens farther from the focal plane.  You can see that for yourself with a simple lens like a hand-held magnifying glass. That is, the "length" required to focus diverging rays is longer than initially parallel rays.
And this actual length affects f/stop.
I was assuming the question referred to field-of-view and apparent magnification.
But from the essential physics, the "focal length" is different for each subject distance.  The lens designer needs to add complexity to compensate for the visible effects of this change, such as f-stop labeling.
Comment: Close focus increases the back focus distance. The f/stop as labeled by the detent on the lens barrel becomes invalid. At a near focus distance of about 1 meter (3 feet) the error is about 1/3 of an f/stop. To avoid under-exposure, cameras of old stopped the near focus at about 750mm (30 inches.
Comment: And lenses of new (e.g. my first EF lens in 1987) don't have a aperture ring or markings at all, and the microcontroller can map the desired f-stop number to the physical iris setting taking the focus position into account.
Answer: The focal length is a measurement taken when the camera is focused on a far distant object. By distant we are talking about a star. Opticians often make an artificial star target which is simply an illuminated pinhole. A far distant subject is said to be at an infinite distance (symbol ∞). Technically the object must be so far away that light rays from that object arrive at the camera lens as parallel rays. An object like a coin viewed from a distance of 3000 diameters meets these requirements.  We are taking about a 1 inch disk (25.4mm) viewed from 3000 inches = 250 feet (72 meters). OK that establishes infinity ( ∞).
Now the job of the camera lens is to refract (Latin to bend back or deflect). What happens is: Light rays enter the lens their direction of travel is altered. The new path resembles an ice-cream cone. The image formed is at the apex (pointy end) of this cone of light. We focus our camera by moving the lens forward or backward. The idea is to cause the apex of the cone to just kiss the surface of film or digital imaging chip. If the distance is right a super tiny circle of light plays on the sensitized surface. If the distance is wrong, this circle of light is perceived as a circle and not as a point of light. The size of this circle of light is the key. It must be so tiny that the human eye cannot discern it. This will be 0.5mm viewed from normal reading distance. Because the modern camera produces a tiny image of the outside world, we must enlarge this image to make it useful. We enlarge when we view this image on our viewing devices or make a print. The circle size of 0.5mm holds so the circle size in the camera must be super minuscule so it can withstand the needed enlargement. Typically this value will be a diameter of about 1/1000 of the focal length.  Super high end lenses might be 1/1500 the focal. Thus the typical 50mm lens will deliver a circle size of  0.050mm.
Now the lens has limited refractive power. As you focus on nearby objects, the light rays from these objects do not arrive parallel, they arrive diverging. Nevertheless the job of the lens is to converge these rays to an ice-cream cone shape. To accomplish we must move the lens further away from film or digital sensor. In other words, we provide greater distance so the lens can do its job and attain the tiny circle size. By the way, the circle is called the circle of confusion because under the microscope it is seen as a circle with scalloped edges.
Now you know why the lens is racked further from film or sensor when focusing close. This elongated distance is called back-focus distance. We do not call this the extended focus distance the focal length. That is reserved for an infinity set-up( ∞). However mathematically it plays its part just like the focal length distance. The f/numbers are computed by dividing the focal length by the working aperture diameter. The result of this math is the focal ratio or f/number.  These values engraved on the lens are only valid for the infinity set-up. At close distances the elongated back focus cases an error. This error is called "bellows factor". At super close distances like unity (life-size or 1:1), the error is 2 f/stops. The back focus at magnification 1 is 2x the focal length. In other words at "unity" life-size a 50mm will be 100mm from the film or sensor. When doing close-up work the danger is under exposure due to bellows factor. This is mitigated in the micro lens design and in the modern cameras that measures exposure thru the lens.
More gobbledygook from Alan Marcus
Comment: OK – If an ice-cream cone doesn't do it for you – then how about a dunce cap?
Comment: @JDługosz Not all ice cream cones have flat bottom and a flare near the top. Some are the shape of a true cone.
Comment: Why an "ice cream cone" as opposed to cones in general as a shape? Is it because etable cups commonly called "ice cream cones" are not necessarily cone shaped?  The flat bottom could be a representation of the focal plane (a "truncated parallel half cone" but the step-back near the open end doesn't fit anywhere.
Comment: I know. I was pondering on the literary choice of an "ice cream cone" as if we are not expected to know what "cone" (as a math shape) means, yet contains the word cone anyway. The semi-sarcastic musing might help him improve his literary skills, by seeing how people read such prose.


Does Bill still have his "toe-fungus"?

Question: In the episode Leanne's Saga, Bill is warned not to drink while taking medication prescribed for a form of athlete's foot- but he's seen drinking beer with his friends in later episodes- did he stop taking the meds and let the fungus continue to grow so he could drink with the guys?
Answer: While I am not privy to exactly what you are talking about, I am aware that most fungal medications are not great on the liver, and it is not advisable to drink while taking said medications.  Having said that, it is unlikely that a writer would worry about such things, as the dos and don't of fungal medication are not well known, and few viewers would put that medication and drinking together.
I will also state that many people, especially those who are alcoholics, rarely follow the precautions stated on medicine bottles and do as they please, even if there are severe consequences.

Does Bill still have his "toe-fungus"?


Utilize WCF Service in Asp.net

Question: I hosted some WCF Services on my client machine and this machine is connected to internet through any DSL. So, there is no live IP or any other static IP associated with it. Now, I want to utilize these WCF Services on my webpages through Asp.Net.
I need to ask, is this possible to access WCF services hosted on a machine which is connected through simple internet?
Few other things to keep in mind that, client (WCF services hosted) and server (Asp.Net pages hosted) in totally different domain. But, I know client machine IP or MAC address.
Answer: You can use services like www.dyndns.com to setup something like that.

Utilize WCF Service in Asp.net


How to clean long neglected, partially sunken landscape rocks

Question: Not sure if there is really an easy method, but here is our situation with two pictures. It is a relatively large area (~1100 sq. ft.) inside a vinyl fence, so not easy to get heavy machinery in. I also built a box frame with hardware cloths like this setup, but an hour's back breaking work clears perhaps only 10 sq. ft. area since many of the rocks have sunken and mixed with the soil/dirt.
Answer: Sometimes you just have to bite the bullet. Everything is on the table. A fence is just a fence and can be removed and replaced, or not. Heavy concrete pavers can be removed and replaced, or not. With the pavers and the fence out of the way, a small digger/backhoe on tracks could take the stony soil out, be trucked away to someplace where fill for a foundation is needed, and replaced with good soil. Replace fence and other features as required. It is the long way around, but gets the job done.
Comment: Yeah, I was more and more convinced that perhaps this was the only way out..


Dynamic programming and probability - list of problems

Question: Does anyone have a list of problems where you have to combine dynamic programming  with probability?
Comment: I'm not sure this site is the best place to ask for learning materials of this sort.
Comment: @YuvalFilmus Hm I thought on this site are mainly computer science students so I assumed that someone could maybe provide me certain resources...
Answer: You can use search on this site to find some examples: https://cs.stackexchange.com/search?q=%5Bdynamic-programming%5D+probability


Wide angle lenses that fit a Rebel T3i

Question: Will a Canon EF 28mm f/2.8 IS USM Wide Angle Lens - Fixed work on a Rebel T3i? What does IS UMS mean?
Comment: @PinhollowEuri No. Questions about camera equipment are definitely [on topic](http://photo.stackexchange.com/help/on-topic) for Photo.SE.
Comment: Isn't this a question for a retailer rather tnan for SE?
Answer:
Will a Canon EF 28mm f/2.8 IS USM Wide Angle Lens - Fixed work on a Rebel T3i?

Yes. Any Canon EF lens will work on an EOS camera, which includes the Rebel T3i.

What does IS UMS mean?

IS stands for image stabilization. USM means the lens has an ultrasonic autofocus motor, which is desirable because it's faster and quieter than some other AF motors.
Answer: The EF 28mm f/2.8 IS USM is only a wide angle lens if used on a Full Frame camera like a 6D or 5D Mk III.
On a T3i "crop camera" it would be a normal lens and no longer have a wide angle field of view.
Comment: It's true that *every* lens is subject to the usual 1.6x crop factor on the T3i, and in this case that means that the 28mm lens will have a field of view similar to a  45mm lens on a full frame camera. Nevertheless, the lens will work just fine.

Wide angle lenses that fit a Rebel T3i


"be to do" versus "have to do"

Question: What is the difference between be to do and have to do?
I googled it and searched for other options as well though I couldn't figure out the differences.
Examples:

I am to do these things.
I have to do these things.
Answer: "Have to" expresses obligation, while "be to" is usually about arrangements, giving orders or instructions. It is used in formal contexts. You can find more information on it here and here.
If it expresses prohibition (an order not to do something), then "be to" would be close to "be allowed to, can't", and of course "don't have to" has a completely different meaning:

You are not to leave without permission.

When used for arrangements, scheduled events, it is close to "be going to".

The Prime Minister is to make a further visit to Devon next week.

You can also use "have to" here, it would mean that he is obliged to, based on the arrangements that have been made, while "is to" simply informs us that it has been scheduled.
Only "be to" can be used in an if-clause:

If you were to bake a cake, I would eat it. (= If you baked a cake, I would eat it.)

When giving orders you can use both:

You are to/have to come at 9!
You're to/have to sit in the corner and keep quiet.
You are to/have to carry your passport at all times.

Often "have to" means that there is a rule and what the speaker says is based on that rule, he is only reporting the order, not issuing it. In the last sentence, for example, it is the law.
In a sentence such as this:

All students are to/have to take a written exam at the end of this course!

without any other context we have no idea whether this is a written order, issued by the principal, or a teacher informing the students of that order. The good news is that most of the time "have to" and "be to" are interchangeable when referring to orders.
In the two sentences you have given, the second means that someone told you to do it. It is external obligation. The first sentence could mean 2 things: 1) It is your turn to do it (scheduled) or 2) someone ordered you to do it (obligation).
Answer: I can't really articulate why, but I think "I am to do these things" suggests that someone has ordered or instructed you to do them.  Perhaps it comes from the fact that "You are to do this" seems to be a standard phrase in military orders.  On the other hand, "I have to do these things" just means that for some reason it is necessary for you to do them.
If the sink is full of dirty dishes and I decide this needs to be taken care of, I would say "I have to wash the dishes."
If my family is getting ready for a party and everyone has been assigned chores, I might say "I am to wash the dishes."
Answer: "to be to do" is elliptic. A past participle after to be has been dropped.
Possible is you are ordered/demanded/required/destined/expected/supposed etc to do.
http://www.macmillandictionary.com/dictionary/british/be-to-do-something

"be to do" versus "have to do"


NxTera with PowerBuilder

Question: How to connect the database using Middleware NxTera in PowerBuilder?
Comment: Just thought I'd add that NxTera was formerly known as Entera Tools (or vice-versa). I think IBM owned them and now they are NxTera. There is a huge client in Minnesota that uses NxTera and though it really makes PB development a drag, it is pretty solid and works.
Answer: The whole point of middleware like NxTera is to not allow a client like PowerBuilder to connect directly to the database. Instead the client must call services (CORBA, SOAP, Java Web Services) offered by the middleware to obtain and manipulate data.
Starting with PB 11 Enterprise, the DataWindow can use a Web Service as a data source. In NxTera you would have SOAP web services to retrieve, and if desired to insert, delete, and update. You would create the DataWindow with a Web Service data source, and optionally specify the web services for Insert, Delete, and Update. See the PowerBuilder User's Guide for details. The chapters are "Defining DataWindow Objects" and "Controlling Updates in DataWindows".
Web Service Data Sources are only available in the Enterprise edition. If you're not using Enterprise, you would have to define proxies for the web services, call the web service to retrieve the data yourself, copy the data into the DataWindow, and handle Insert, Update, and Delete yourself. We retrieve data this way for some non-updatable DataWindows because the web service doesn't return data as an array of structures suitable for the DataWindow.
Answer: In NXTera (as in Entera), you connect to the database with a data access server. A data access server is one three types of servers that can be created in NXTera: functionality, data access and transaction server. A data access server provides access to the database via RPC by transforming the SQL into RPC calls within the data access server. Data access servers come in 7 flavors: ora_start (Oracle), syb_start (Sybase), db2_start (DB2), ifx_start (Informix), eda_start (EDA), ing_start (Ingres) and mysql_start (MySQL). An eighth db_start is generic for Windows: cli_start (SQLserver, et al.)
You would not be required to use the DataWindow since you are calling an RPC directly from the PB client. This solution maintains the separation of Presentation layer logic from Business logic from database logic.

NxTera with PowerBuilder


When can you cast Flash after casting Collective Voyage?

Question: After you've cast Collective Voyage, do you wait for everyone to pay and then respond with Flash, or do you have to respond immediately?
Comment: What are you asking? What do you want to accomplish? Your question does not make that clear at all.
Answer: MtG works by a system of timing and priority. The Active Player, player whose turn it is, can cast Sorceries when the stack is empty during their first or second Main Phase. After casting a spell and paying the required costs, including mana costs, the spell waits on the stack for all players to pass priority, then the top object on the stack resolves.
Casting Collective Voyage for one {G} mana places it on the stack, and then priority is returned to you.

116.3c If a player has priority when he or she casts a spell, activates an ability, or takes a special action, that player receives priority afterward.

You may choose to cast Flash before Collective Voyage resolves, in response to it, since Instants may be cast anytime you have priority and you have the required costs including mana cost {1}{U} to cast the spell. In this case, it would resolve first.

116.1a A player may cast an instant spell any time he or she has priority. A player may cast a noninstant spell during his or her main phase any time he or she has priority and the stack is empty.

You may also choose to wait until after Collective Voyage resolves, when you will receive priority again to cast spells and activate abilities. In this case, it would resolve afterward.

116.3b The active player receives priority after a spell or ability (other than a mana ability) resolves.

116.4. If all players pass in succession (that is, if all players pass without taking any actions in between passing), the spell or ability on top of the stack resolves or, if the stack is empty, the phase or step ends.

During the resolution of Collective Voyage, players may not cast spells, but may activate mana abilities to search their library for land cards. The order of how much to pay is written on the card, starting with the player who cast Collective Voyage and continuing clockwise. After all players have decided how much to pay, the lands are placed on the battlefield simultaneously and Collective Voyage is placed in its owner's graveyard (having resolved).

116.1d A player may activate a mana ability whenever he or she has priority,whenever he or she is casting a spell or activating an ability that requires a mana payment, or whenever a rule or effect asks for a mana payment (even in the middle of casting or resolving a spell or activating or resolving an ability).
Answer: When you play a sorcery, you place the spell on the stack.  Players can then respond with an instant spell or an activated ability.
When nobody responds, or all the responses have resolved, the sorcery will "resolve" in one go.  You cannot respond while a spell is resolving.  That means you can't respond to the first part of the spell, when players pay mana.  The spell will resolve in its entirety.
Only after the entire sorcery is done can you respond again.
Answer: You have two options.

You can cast Flash (or a card with Flash) in response to the Collective Voyage
You can cast Flash (or a card with Flash) after Collective Voyage has finished resolving.

To cast a spell in response to a spell or ability is to cast a spell after another has been cast but before it resolves.
If you cast Flash in response to Collective Voyage, Flash will resolve before Collective Journey, so Flash will resolve before anyone has payed any mana.

After Collective Voyage has finished resolving, players have a change to play spells, starting with the active player (which is likely the one who cast Collective Voyage, since it's a sorcery).
You could cast it then if the Active player declines to cast anything then.


Where does youtube-dl download the videos to?

Question: I have downloaded youtube-dl and the video download is complete, but when I
search for the video, I can't seem to find it.
Can anyone help?
Comment: Have you tried downloading the videos in the "/home/user/Videos" folder, I think dash can be configured to check it out. Maybe it won't appear in Dash until you actually play it once.
Comment: I don't have enough rep to give the correct answer but anyway if you do ls -ltr in . and don't see it, it is because the file is created with the date it was uploaded to youtube, not the current date.  So the file will be in the middle of all the other junk in this dir.  So do ls -l *mp4 or whatever and maybe then you will see it.
Answer: There are really two questions here:
1. Why does youtube-dl not feature in Dash?
This is because youtube-dl is run from a Terminal window only and does not come with icons, desktop files and the like. It is simply run from any Terminal window as follows:
youtube-dl [options] url [url...]

Details of the command line options can be easily seen by running the following command:
youtube-dl -h

Experiment a little to make youtube-dl work as you wish.
2. Where does Youtube-dl download YouTube files?
By default youtube-dl will download the files in the current working directory of the Terminal that you have opened. Usually this is your $HOME environment, but not always. This behavior can be modified in either of two ways:

Use the -o option with youtube-dl to manually give a location for the downloaded files:
youtube-dl -o "~/Desktop/%(title)s.%(ext)s" 'youtube file url'

and of course substitute your actual url for 'youtube file url'. This example sends the completed download to your Desktop.
Create a configuration file for youtube-dl as follows:
touch ~/.config/youtube-dl.conf

Then set a default download location in this file:
--output "~/Desktop/%(title)s.%(ext)s"

With this in place all downloaded files will automatically go to your Desktop.

References:

youtube-dl Readme
Comment: This worked for me, except in the first example, you need quotes around the path. The shell threw me this error without them: `sh: 1: Syntax error: "(" unexpected`
Answer: By default youtube-dl downloads files in the same directory from where you run the command. Mostly it's your home directory. If your name is Tom, then it is /home/Tom. To force it to download elsewhere you should use -o option; and to select quality of video, there is -f option. But how would you know the variety of quality of files. That is achieved by -F option. So combine all these in one shell script, make it executable and put it in a bin directory. And life becomes easy going.
I have written one script for my own use. It works fine. You don't have to worry where all those downloaded files are going. I've chosen ~/Videos directory for downloading YT videos; you can choose any other. Also replace 'Tom' by your name. Here is the script:
#!/bin/sh
answer=""
tput clear
tput cup 05 10
echo "Give the YouTube URL: \c"
# Here you paste the YT-video-URL by ctrl+shift+V
read answer
# The follwing command will display a list of video quality options to choose from
youtube-dl -F $answer
echo
# Here you give the number shown in first column as per your choice
echo "Select Quality (Choose a number): \c"
read qual
# If you don't want to download and quit the shell, give 99
if [ $qual -ne 99 ]
then
youtube-dl -f $qual -o "/home/Tom/Videos/%(title)s.%(ext)s" $answer
else
exit 0
fi

Answer: If you run youtube-dl like this:
youtube-dl -o "/home/vasa1/Downloads/%(title)s" http://www.youtube.com/watch?v=rnvK2TIhYns

The video should be in /home/vasa1/Downloads. Of course you need to put your username in place of vasa1.
Answer: by default youtube-dl downloads it's files on your home directory
to access your downloaded filed
please open the terminal
change the directory to your home directory
user:~$ cd /home/user
Notice: user is your user name
Answer: Ubuntu 14 fix of official installation procedure
Create directory here:
sudo mkdir /opt/youtube-dl

Move youtube-dl from installation place:
sudo mv /usr/local/bin/youtube-dl /opt/youtube-dl

Make symlink:
pushd /usr/local/bin/ && sudo ln -s /opt/youtube-dl/youtube-dl

Test symlink:
ls -la youtube-dl
lrwxrwxrwx 1 root root 26 Oct 16 20:41 youtube-dl -> /opt/youtube-dl/youtube-dl

popd

Test file:
ls -la /opt/youtube-dl/youtube-dl

-rwxrwxrwx 1 root root 639567 Oct 15 12:42 /opt/youtube-dl/youtube-dl

Fix permissions:
sudo chmod 755 /opt/youtube-dl/youtube-dl

Remove old cache:
sudo rm -r /home/<user>/.cache/youtube-dl/

e'voila! youtube-dl without having a need for a sudo in front of it
Answer: In case you want to run youtube-dl in python script, simply use -o will no effect.
Instead you need to use outtmpl keyword, e.g.:
youtube_dl.YoutubeDL( params={'-c': '', '--no-mtime': '', 'outtmpl': './%(uploader)s/%(title)s-%(upload_date)s-%(id)s.%(ext)s'} ).download([url])


Not able to tick items in SP Flash Tool after selecting scatter .txt file.How to check Boxes?

Question: I download SP Flash Tool And recovery file zip,extracted recovery zip which contain three files:
1)scatter .txt file
2)recovery image file
3)recovery read me file
After that i opened tool.exe and select the scatter file but don't able to tick the recovery name object
Answer: You need to select a file to write each partition you want to select. Double click on the location column for the partition you want to write to and select an img file, e.g. twrp.


Is there a "bible" for portrait photography like "Light, Science and Magic" is for lighting?

Question: Can anyone recommend a good book on portrait photography, covering gear, lighting setups, posing and so forth?  More interested in the setup and shooting than post processing and retouching.  Would prefer it be suitable for studio lights and small camera flash.
I've read a number of books from the library and was not really thrilled with any of them. Is there a "bible" for portrait photography like "Light, Science and Magic" is for lighting?
Comment: Good question and one I thought about asking the other day while looking through portrait books.
Answer: The answer is simply: no.
Light is a known, measurable quantity, measurable, photons bouncing and hitting film, sensors and eyeballs. You can teach light. You can explain how placing lights in certain positions will give you a certain effect, you generalize as to how most people interpret that light (soft = beauty, harsh = ruggedness, etc). You can talk about even lighting, measurable with a light meter, snoots, flags, angles, filters, gels, etc.
You can't talk about portraiture (or landscape or any major genre of photography) in those categories. The very question of "What is portraiture?" is asked in many photography and art schools, and discussed at length (ad nauseum) during years. A book can tell you poses (there are dozens of free posing guides all over the internet), but all they can really show you is what others have done and how to emulate them. Good portraiture is the result of interaction between the photographer, the subject, and the subject's surroundings.
The frustrating thing is that for every rule I can share with you about photographing people, I can show you a famous, amazing image the refutes it. Show your subjects face and eyes, right? Sure, until you see Moriyama's work.
Personally I find photographing people to be the best thing out there. It's both easy and demanding. People love seeing other people. And it's such a wide area of photography. Portraiture is everything from pictures taken at Sears, senior photos, fashion beauty shots, illustrations for magazines, formal, erotic, expressive, etc. It's 3m high prints fiber prints in museums and pictures we keep in our wallets. It's snapshots at parties and formalized shoots with a cast of dozens.
So I'm afraid that I don't have a satisfying answer to your question. I can recommend you try the ancient method of looking at portraiture you admire. Not just your favorite photos, but your favorite paintings as well. (Don't have any favorite paintings? Welcome to an amazing new world of images.) Deconstruct them, not on a technical level, but in their content. Consider their expressions and what they mean to you. Think about how you're able to shape people's perceptions of your subject by your creative decisions, by the moment you decide to capture. That micro expression, that soulful gaze, that smile, that look of disgust.
Cause that's the thing, light is a tool you can use to express yourself. Portraiture is you using that tool.
Comment: That's a great and well written answer.  But Amazon lists 2,500 books on portrait photography.  Is there not one of them that it comprehensive in covering gear, lighting ratios, lighting styles like rembrandt, lighting setups, posing techniques?  Surely there are some top-notch portrait books out there?
Answer: I bought and read "The Portrait Photography Course" by Mark Jenkinson but I did not find it to be nearly as helpful as "Light, Science and Magic", which is the single best photography book I have ever read. Once you understand light and how to use it you will be able to make whatever sort of pictures you want, and I absolutely agree that good portraits result from thoughtful interaction between you the photographer, your subject, and the environment, rather than any technical factors or even formulas or standard poses or strategies that can be learned by reading a book.
My advice is to get a copy of "Light, Science and Magic" and read and re-read it until it's about to fall apart. You should then try to wear out your digital camera and/or burn up as much film as you can afford (that's my preferred choice, hands-down, by the way), and never stop looking at, enjoying and sharing the resulting images. And finally, never stop looking at portraits by other artists, including paintings, which can teach you more than any book.
Answer: Search out the Rotovision imprint books.  There is one specifically on Portrait Photography, but I find Lighting the Nude to be one of the best books in all of photography.  Anyone serious enough to ask this question (and invoke "Light, Science, and Magic") can take the lessons it teaches to any form of photography; certainly general portraiture is not that big of a stretch.  It was just recently reprinted in trade paperback, too.
Comment: Also, just ask yourself: What Would Vermeer Do?
Comment: The Rotovision books are indeed very good.
Answer: I have found a book that is close to what I wanted.  The Portrait Photography Course by Mark Jenkinson.
The book has 40+ short "tutorials" on a number of topics. It covers the following:

what is a portrait? history of portraiture.  types of portraiture.  conventions and cliches
equipment - cameras, lenses (covering focal length/DOF for portraiture), light meters, radio slaves, reflectors and light modifiers
lighting - light falloff, light and shadow, flash and continuous lighting, fill flash
three point lighting
composition, framing, posing and styling
post processing
environmental portraits
throughout are short interviews and portfolios of portrait photographers

Might fall short of being the "bible" of portraiture, but it is a comprehensive book, and the author is a practicing professional (among other things Vogue, Vanity Fair, Fortune magazines) who also teaches photography at NYU's Tisch School of the Arts, so I'd say those are pretty good credentials.
Sample chapters(PDF)
Answer: Jedrek says almost all there needs to be said on this subject. However, while there are some photographers that use up to 30 light sources to create an image, it is still possible to create stunning images using just one.
In fact, I would encourage newcomers to this particular discipline to stick to one light source along with a variety of modifiers and a reflector! To reiterate portraiture is not about kit or rules, it's about how the photographer interacts with their subject and the working relationship that can be created on the day, and that's more about you rather that what's in your camera bag. While it may be straying off the point it's worth remembering what the early English photographer, Julia Margret Cameron once said:

When focussing and coming to something which, to my eye, was very
  beautiful, I stopped there instead of screwing on the lens to the more
  definite focus which all other photographers insist upon.

At the time she was vilified by other photographers for being 'sloppy' yet her photographs have stood the test of time. I think the point I'm trying to make is...do what you think is best to create the images that you want.


Sending out twitter retweets with Python

Question: I wanted to know if this was possible- I want to use Python to retweet every tweet a person sends out. If yes then how can I implement this?
Answer: Unfortunately, python-twitter does not yet support the Twitter Retweet REST call.
You'll have to make that call directly yourself (using direct calls to api._FetchURL) or apply the patch in issue 130 to add support.
You're better off with using tweepy; read the API documentation, there is a handy retweet(id) method for retweeting.
Quick and dirty example:
import tweepy
auth = tweepy.BasicAuthHandler("username", "password")
api = tweepy.API(auth)
for status in api.user_timeline('someuser'):
    api.retweet(status.id)

This will retweet the last 20 statuses from someuser. You'll want to do some more coding to prevent it from retweeting those same messages again next time you run the script though.
Edit: Twitter no longer accepts BasicAuth authentication, and you'll have to use the OAuth authentication exchange to get a authorisation token. Changing the example above to use OAuth would detract from the retweet API point I was trying to make, see the Tweepy OAuth tutorial for an extensive tutorial.
Comment: @Martijn- got an error- `Traceback (most recent call last):
  File "ret.py", line 7, in
    for status in api.user_timeline('worshiprene'):
  File "/usr/local/lib/python2.7/dist-packages/tweepy-1.7.1-py2.7.egg/tweepy/binder.py", line 184, in _call
    return method.execute()
  File "/usr/local/lib/python2.7/dist-packages/tweepy-1.7.1-py2.7.egg/tweepy/binder.py", line 167, in execute
    raise TweepError(error_msg, resp)
tweepy.error.TweepError: [{'message': 'Basic authentication is not supported', 'code': 53}]
`
Comment: I said it was a quick and dirty example. :-) Use OAuth instead, want me to update the example?
Comment: also, you no more need to care about retweeting same message again, just handle the exception: `TweepError: [{'code': 327, 'message': 'You have already retweeted this Tweet.'}]`
Answer: It's possible to retweet anything the people you follow tweet.You can also retweet all of the public tweets.
Use this link : https://github.com/joshthecoder/tweepy
you will know how to do it in a very simple way .
Answer: Here's the OAuth "Quick and dirty" method, please keep in mind that you will need to have Tweepy installed for this to work.
import tweepy

api_key = 'your_key'
api_secret = 'your_secret_key'
access_token = 'your_token'
access_secret = 'your_secret_token'

auth = tweepy.OAuthHandler(api_key, api_secret)
auth.set_access_token(access_token, access_secret)

api = tweepy.API(auth)

for status in api.user_timeline('someuser'):
    api.retweet(status.id)

Answer: The newest version of python-twitter allows you to retweet with the command
api.PostRetweet(tweet_id)
where api is a logged-in api and tweet_id is the id of the tweet you want to retweet.


algorithm for finding similar items

Question: I have a group of items S, say there are 100 items in S, and I know some features of these items, i.e., color, size, ...Now, I have another group of items P, say there are 10000 items in P. What can I do to find a sub group of items in P that are similar to items in S? I know the corresponding features of all items in P, i.e., color, size... My original thinking is that I can use K nearest neighbor. But it seems that as KNN uses a majority vote, in order to use KNN, at least two different labels are in need in training data set while in my case I only have one label - all items in S would have the same label. Any ideas on how to find items in P that are similar to S??
Comment: Are items in S similar to each other?
Comment: Yes, all Items in S are similar; they have the same label.
Answer: What about a very basic approach like this:
1) Define a distance metric between two items.
2) Find a distance between each item in P and S (you can create a representative item of S, or compare item in P to each item in S, and then sum the scores)
3) Take items in P that have the smallest distance.
Answer: What about canonical correlation analysis (CCA)? CCA takes two sets of variables, one called the DVs and one called the IVs. It then identifies two canonical variables/variates, one for each set, which correlate at maximum. I like to think of these canonical variables as factors similar to FA/PCA, although the analogy does not strictly hold. You can then identify specific IVs and DVs which "load" high on their respective canonical variable. Depending on the canonical correlation and on the weights of the individual variables, you have identified two similar sets of variables. Of course, a second (third, ...) pair of canonical variables can be found up to $min\{k_{IV},k_{DV}\}$. Note that CCA reduces to simple regression if you have only one DV. I think pretty much every statistical software has it, but I don't know about the performance of CCA with 1000s of variables.

algorithm for finding similar items


What exactly is binding energy?

Question: I've been reading on radioactivity but along the way I got confused, if binding energy is the amount of energy used in holding the nucleus together then why is binding energy also the amount of energy used in breaking the nucleus apart, shouldn't the energy required to break the nucleus apart be greater than the initial energy?
Comment: @Tak The binding energy is defined as the energy you need to supply that *exactly* counters the binding forces, with the final products having zero kinetic energy. If you provide energy more than the binding energy, you will not only break the nucleus apart, but also impart additional energy to the final products in the form of kinetic energy.
Comment: Read your statement again. "binding energy IS the amount of energy used in holding the nucleus together". If you provide that much energy, constituents of the nucleus don't stay 'bound'.  Where are you getting confused?
Comment: Binding energy of a system is the energy required to break that system apart. Equivalently, it's the height of the potential barrier that is holding the system together.
Comment: @Avantgarde: if a force holds the nucleons together, then the force to counter this force must be greater so as to break the bond
Comment: @Avantgarde: but the binding energy in fusion reactions is released, so would there be any force holding the nucleons, since the binding energy has been released?
Answer: This is very basic: we are looking for the minimum energy supply that we must apply.
This is very similar to that thing students use to ask: "Why do we need a force $mg$ to overcome weight? It should be greater". And, okay, rigurously speaking, if you apply a force $mg$ upwards, you won't rise the weight. But you will have cancelled the weight force, so the object will now behave like a free body.
So, if you apply the tiniest increment, say $10^{-9}$ more newtons, for example, that will be enough to rise it, because now the body is free. But I could have also chosen $10^{-12}N$, and the object would also go upwards. The acceleration would be really small, true, but that would be enough to rise it.
So, we obviously need to give a number (not any than I can think of, but an objective figure). We choose to say that you must apply $mg$ to cancel weight, and then, the more you apply, the more you'll get. It is understood that it will have to be greater, but how greater is up to you. We just give the lower limit: the one that just cancels it out.
So this is the same. If we choose a free body to have $0J$ energy, then any bound state has less than $0J$, (negative energy), because it hasn't got enough energy to reach freedom, so it must be less than $0J$.
Let's call that energy $E_b$, and $E_B<0$, so the body has energy $-|E_b|$. You must apply $+E_b$ to overcome that. Like that, the particle would be able to reach freedom (probably at infinity), without any KE. If you want some extra $KE$, that's the extra energy you need to supply.
Answer: You are on the right path, but it needs a little explanation. Let's go from the smallest known particles up.
Let's say that the neutron is made of 3 quarks (it's actually made of a sea of quarks, antiquarks, and gluons, antigluons, the net is called valence quarks), those quarks do have rest mass, right? Sure. Add them up, and you get 1% of the rest mass of the neutron.
Where does the 99% of the rest mass of the neutron come from? It is the binding energy between the quarks, called color force.
Now let's go one size up. Lets look at the nucleus. It is made of neutrons and protons. The rest mass of the (separate) neutrons and protons will add up to 101% of the rest mass of the combined nucleus.
Now how is that possible? How can the constituents rest mass be more then the bound system made of the same constituents?
The answer is binding energy between the neutrons and protons called residual strong force, or nuclear force. But why does that decrease the rest mass of the bound nucleus?
From wiki:

Nuclear binding energy is the minimum energy that would be required to disassemble the nucleus of an atom into its component parts.
  The mass of an atomic nucleus is less than the sum of the individual masses of the free constituent protons and neutrons

If you want to tear a nucleus apart, and that is nuclear fission, you need to add at least as much energy as the energy that binds the constituents together. When you reach that energy limit, you will get a peanut nucleus. What the energy limit is, depends on how much energy binds the nucleus's constituents (neutrons and protons) together. That energy is the residual strong force or nuclear force. When you add enough energy (meaning you add a high energy neutron), that is at least as much as the binding energy, the nucleus will fission into two separate daughter nuclei. First, it will be a peanut nucleus, and at that point, the EM repulsion between protons in the daughter nuclei will be enough (it will overcome the nuclear force) to shoot the two daughter nuclei apart at 3% the speed of light.
Comment: Are you sure that "The rest mass of the neutrons and protons will add up to 1% of the rest mass of the nucleus"?
Comment: @ÁrpádSzendrei You are misinterpreting that sentence from Wikipedia.  It's correct for fission of very heavy nuclei into medium-mass nuclei, but it's not correct for removing a single nucleon from any (non-dripline) nucleus, and it's not correct for disassembling a nucleus completely into nucleons (which is how the binding energy is properly defined).
Comment: This answer has a lot of issues.  The relativistic QCD vacuum, whose properties mean that the "bare quark masses" sum to much less than the mass of a nucleon, isn't a good example of a binding energy.  The mass of a typical nucleus is $\sim 99\%$ of the mass of its constituent nucleons, as is usually verified (by doing arithmetic) during introductory discussions about why fusion and fission release energy.  This answer says that the bare nucleons are much less massive than the bound nucleus, which is not correct.  Also I know of no fission model that includes a "donut nucleus."
Comment: @rob wow. sorry, it is peanut, not doughnut. thank you I edited. And about the mass, this is from wiki "The total rest masses of the fission products (Mp) from a single reaction is less than the mass of the original fuel nucleus (M). "
Comment: @HolgerFiedler thank you I edited.
Comment: @rob you are correct, I edited.

What exactly is binding energy?


How to decide crank arm length?

Question: I'm 1.74 meter tall. I've two MTB's, one of them being 26" frame and the other one is 27,5". They both have crank sets with 175mm crank arm length. As a chondromalacia sufferer I wonder if replacing my crank sets with those have 170mm crank arms would be better for my knees. What is the point of having shorter crank arms for a rider?
Answer: Shorter cranks mean a smaller rotation circumference your feet/pedals have to travel to do 1 revolution.
That also means your knees and hips move through a smaller angle, your knee won't come up quite as far.
Downside is that you have less leverage on the pedal, and therefore you'll be putting less power into the crank, so the physical reaction is to pedal faster.  This is because your knees and shins and feet are moving a shorter distance and not building up as much momentum.
The upshot of that is with everything else being equal, a shorter crank arm will result in a slightly higher cadence, so you will "spin" more.

For the average rider, changing crank length between 170, 172.5 and 175mm is no great deal. Those three lengths are extremely common, and picking up a replacement set used on ebay or similar is easy.
What's hard is looking at results from any of the "crank arm calculators" - My height of 195 cm and long-legs suggests a crank arm length of 195-200mm and they are exceedingly rare.
In your case, find a donor bike with shorter cranks that suit, swap them to one of your bikes, and try it out.

In your specific case of chondromalacia (knee pain) I'd also look at shoes, pedals, placement of foot on pedal, and make sure your pedal axles are not bent.
If you use cleats/clips then also consider how they affect your entire leg and the pedal stroke.  Even something as simple as a miss-aligned saddle can affect your pedal stroke.
I've also had relief using knee straps, thick reinforced and formed pads that velcro around the knee above and below.
The last resort is always see someone with medical AND riding skills, in person.   A sports-physiologist may be able to advise better than some randoms via the internet.   This is also something that may be helped by a proper bike-fit using any of the systems out there like Retul / Retu:l etc.  Downside is these visits have significant costs.
Comment: I also come out needing unreasonably long cranks if I try to calculate. Pedal strike would be a real issue then. But in general, a rider is more likely to have serious issues with too-long cranks (leading to too much knee movement) than too short. So it's not a problem for us tall people but might be for the OP 175mm seems like it could be a bit long for their height (depending on how much of it is in the legs); I know riders a little taller than that who switched to 170 or 172.5mm cranks for their knees.
Comment: 170mm sounds more suitable for my case. My chondromalacia is due to patellar tilt. Probably too tight IT band which causes the patella to a lateral tilt. Resting, stretching and dry needles help. Also walking and keeping the knee fluid get enough blood stimulation is crucial not to make things worse. Never sit too long.

How to decide crank arm length?


Prevent Finder from restoring previous tabs?

Question: For some reason Finder always restores all my previously open tabs even after I've restarted the system. This is unnecessary for me and in just several days my Finder is really clustered up and I had to close the tabs one by one. There must be a setting to disable such behavior?
Answer: You have the option at Shutdown or Restart for whether or not to reopen windows...
though it does include whether to reopen Apps, too

If you want only the Finder to not save its state, try this in Terminal
defaults write com.apple.finder ApplePersistenceIgnoreState YES
You can revert the setting using NO instead of YES
Comment: That's not what I mean. I don't click this option and Finder doesn't automatically reopen upon restart. However, whenever I *manually open* Finder again, it immediately displays all the *tabs* that were previously on in the last session.
Comment: Why are you closing/quitting Finder anyway? If you restart it, it will normally use its previously saved state, from `/Library/Saved Application State/com.apple.finder.savedState` Adding a terminal command to my answer,to prevent Resume, but I'm not sure if it works for Finder, you'll have to test it


GTA V won't load online

Question: I've been playing GTA V online for a while after I installed the game I took it out. When I put in GTA V after playing something else it took me to story mode. I tried loading GTA online, but it says I need to be connected to PSN, which I am. I've  tried uninstalling the game and update then reinstalling and I also tried restarting my ps3 and my Wi-Fi modem but nothing worked. Could there be something  wrong with the Rockstar servers or is it my ps3?
Answer: I had the same issue with steam version on my laptop. When I connected to another WiFi it worked without any error. But when I connected back to the first WiFi it would give the same error. So I followed these steps:

Go to "cmd" and run as administrator.
Than copy all this one by one
ipconfig /flushdns         : (clear dns cache)
nbtstat –RR                : (release and refesh NetBIOS names)
netsh int ip reset         : (reset ip settings)
netsh winsock reset        : (ResetWinsock Catalog)
Finally restart your computer.

I know you have ps3 but try to connect to another WiFi.
Answer: I would try to use a Ethernet cable that connects straightly into your ps3, for better connection to online services and would probably fix your issue.

GTA V won't load online


Is there any point in using MSE loss in modern deep neural networks?

Question: Is there any point in using MSE loss -- (a-b)^2 instead of L1 loss -- abs(a-b) in modern DNN/CNN architectures which use ReLU/ReLU-like activations? If so, why?
Comment: To add some flavor to shiamo's comment, what context does the use of leaning algorithm (DNNs vs boosting vs regression) add to this kind of decision?  What leads you to believe that DNNs would alter the appropriate choice of loss function?
Comment: is there any reason to use L2 over L1 loss for a linear regression problem?
Comment: I have wondered the same thing. The MSE is derived from the assumptions made for linear regression namely that the errors are normally distributed. Clearly the neural network regression models are not limited to these assumptions…far from it as the point is to handle non-linearity quite explicitly. And yet we use MSE still.
Answer: Suppose you want an unbiased prediction and that the conditional distribution of your dependent data is asymmetric. Then you want to minimize the squared error, or $L^2$ loss.
Minimizing the absolute error, or $L^1$ loss, is equivalent to finding the median of the conditional distribution (Hanley et al., 2001, The American Statistician), not the mean. If the distribution is asymmetric, this will typically mean that the output is biased.
This is a purely statistical effect. It is completely independent of your ML algorithm, NN architecture, fitting method etc.
Comment: So what if the output is not converging to the mean? Unless your domain loss requires the mean as the optimal point, it is not very relevant. Besides if we are going to feed this output as an input to another system unless the output is gaussian and the system that it is fed into is linear then you will end up with a bias anyways at the final output.
Comment: @CagdasOzgenc: regarding your first point, I explicitly started with "Suppose you want an unbiased prediction". Of course if you have a different loss function than $L^2$, then you shouldn't use $L^2$. I see people use $L^1$ and then complain that their forecast is biased. Regarding your second point, if you know your second system, then you may be able to correct for such effects, e.g., adding a $e^\frac{\sigma^2}{2}$ factor in lognormal models. Plus, in such a situation you should tailor your loss to the system, anyway - but the OP seems to suggest that $L^1$ is good *in general*.
Comment: Sorry, can you please explain in simpler terms why looking for quadratic mean is supposed to be superior to looking for arithmetic mean? If what you want as an end result is to minimize expected L1 difference between truth and expected predictions based on test data. I didn't get it. Also, I'd like to note that L1 loss seems to me a lot more stable and less explosive, compared to the quadratic L2 loss, which seems to me like a really good reason for preference. As we know, with large loss values there's a large chance of exploding the network and getting "NaN" weights.
Comment: I don't fully understand what you mean by "quadratic" and "arithmetic" mean. I assume you refer to $L^2$ and $L^1$ loss. Here is the problem: your realizations, *conditional on your predictors*, are random. They have a conditional distribution. Loss functions come in if you try to summarize this conditional distribution with a single number fit (or forecast). (It's better to model the entire density and use [tag:scoring-rules]). $L^1$ loss is minimized by the *median* of the density, $L^2$ by the mean. ...
Comment: ... If your conditional density is asymmetric, this means that the median is different from the mean. If you want the conditional median, great, use $L^1$ loss. However, usually people want an unbiased fit or forecast, and then the conditional median may not be correct. Here is an example: *intermittent* time series have "many" zeros, e.g., more than half the realizations. That is, the median is zero. Lots of people did not understand why a flat zero forecast was "optimal" under $L^1$ loss ([Kolassa, 2016, *IJF*](https://www.sciencedirect.com/science/article/pii/S0169207016000315)).
Comment: I understand it's frustrating and your explanation sounds completely trivial to you, but can that, please, be explained with less, or no jargon? It's really not very comprehensible to a non-PhD.
Comment: Let's try it step by step. Your realizations, *conditional on your predictors*, are random. They have a conditional distribution. Can we agree on that?
Comment: Thanks! So lets take a visual image autoencoder autoencoding selfies as an example, to be on the same page. Sadly, I can't say I was able to understand the stuff about realizations, conditional on predictors and in what sense they are supposed to be random. As for the conditional distribution, I understand it that you mean that depending on what input set we choose we'll get a different distribution of variables in correct prediction results? That arithmetic mean, std, etc of different variables we predict, in this case, of each pixel, is going to be different based on what input set we choose
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/78736/discussion-between-stephan-kolassa-and-ihor-me).


Effect of flow through a static hydraulic pump on its RPM

Question: What happens when fluid flows through a static hydraulic pump? Will there be a negative RPM to impede the flow?
By static pump, I mean a pump with initial RPM = 0.0 and is not driven by external forces during the transients of flow.
Comment: Depends on the type if pump and where it is in the cycle - even though there may be pressure at the inlet it may not cause rotation.
Answer: First I would state the question differently. What happens when there is a negative pressure difference across an unpowered hydraulic pump? This is actually a common situation occurring when a pump's electric motor is turned off but pressure still exists downstream because of a compressible accumulator or gravity storage device.
There are 3 possibilities in this situation. I'm using numbers for a typical application to help explain the effects. The actual numbers would vary for different pumps and fluids.

0 - 50 psid (0 - 3.5 bar) pressure difference: Likely no pump rotation. Some leakage is able to flow through clearances in the pump from outlet to inlet. Fluid will also exit the case drain.
50 - 200+ psid (3.5 - 14 bar) pressure difference: Pressure is sufficient to overcome static friction in the pump seals and motor bearings. Pump rotation will occur until supply pressure is depleted. Leakage flow through clearances will be additive to the positive displacement flow.
Any pressure difference against a check valve: Negligible flow. Many pump and system designs include check valves to prevent any flow traveling from pump outlet back to the inlet. Generally forcing a pump to rotate backwards (motoring mode) is undesirable unless the pump was designed to allow bi-directional flow. Also there must be some way to deal with the incoming energy from pump shaft back to electric motor. Storing in a battery / dissipate through resistors / turning other rotating devices / etc.


Playing audio in C?

Question: Every audio engine I've tried (SoLoud, cAudio, openal-soft) hasn't worked on my pi zero. I just want to be able to play audio in a program without too much hassle. I can use a system call like system("aplay sound.wav") but system() calls are expensive and supposedly a security problem. Are there any alternatives to using a system call that I can use without being a major hassle? Thanks
Comment: What about SoLoud, cAudio, openal-soft. They crashes? What is system()? Python?
Comment: Every engine I've tried has had a separate problem with it. SoLoud (eventually) compiles correctly using a custom-made CMakeLists.txt file, but produces no sound. The other two fail at compile time, and have various problems that seemingly have no fix (at least that can be found from compile errors, documentation and online resources). I'd rather avoid them for now than spend a huge amount of time trying to fix them as the project has a fast looming deadline.
Comment: Please edit your question and put your comment in there
Comment: This is a general programming question. There are dozens of audio libraries out there. `alsa`, `pulse`, `sdlmixer`, `gstreamer` etc. etc. Never heard about SoLoud, and cAudio/OpenAl are a strange choice unless you need 3D sound.
Answer: For simplicity, I can recommend gtkIOStream's ALSA Playback class. It is in C++ however.
For a dead simple standard setup, run like so :
<code>  const string deviceName="hw:0,0"; // open the device
  Playback playBack(deviceName.c_str());

  snd_pcm_uframes_t pSize; // find out the number of frames per write
  playBack.getPeriodSize(&pSize);
  cout<<"period size "<<pSize<<endl;

  cout<<"sample rate "<<playBack.getSampleRate()<<"Hz"<<endl;

  unsigned int ch=playBack.getChannels();
  cout<<"channels "<<ch<<endl;

  if (!playBack.prepared()){
    cout<<"should be prepared, but isn't"<<endl;
    return -1;
  }

  Eigen::Array<int, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor> buffer(pSize, ch);

  while (true){
    buffer.setZero(); // write your audio data to the buffer here.
    playBack<<buffer; // play the audio data
  }
</code>
For a more complex example, consult the gtkIOStream example here.
If you want to install it, the tutorials are here.

Playing audio in C?


Best Practice for relationships shared among multiple tables

Question: I keep running into this design problem, and I'm not happy with my solution so far. The problem is this:
I have two or more entities, like People and Dogs, and they both have a relationship with a Notes table, that stores a message field and some meta data about the message like maybe the author.
1) First option is to not enforce the Foreign Key. That way I can store the FK like peopleId or dogId (no matter what it is) in the same generic FK field like fkId. Then I'd store the tableId in another column--one can hope to get the table id from the RDMS meta data, but you could also have a dirty hack and explicitly make a table full of tables that you'd have to update manually. This is really sloppy and I just mention it for completeness.
2) Clone the Notes table for each table that needs it, like PeopleNotes, DogNotes, CatNotes, etc. This creates a pretty major normalization problem.
What have other people done in situations like this?
Answer: If these are your 'model' tables:
dog Table:
id | name | ...
1  | Rex
2  | Fido

people Table:
id | name | ...
1  | Bob
2  | Alice

notes Table:
id | text | ...
1  | A nice dog.
2  | A bad dog.
3  | A nice person.

You can have the relationships kept in separate tables:
dog_note Table:
dog_id | note_id
1      | 1
2      | 2

note_people Table:
person_id | note_id
1         | 3
2         | 3

I usually stick with the convention of using the alphabetical order of my models for naming the relationship tables.
Answer: How about two new tables - Dog2Notes and People2Notes? Dogs, People, and Notes are all entiries with Keys that relate to each other. Dogs and People can have more than one note, and notes can be shared.
If Dogs and People can only have ONE note each then add a NOteID to each of those tables?
Answer: I prefer the idea of storing the owner of the note in two columns, one for ID, and one for class/table.
Answer: it really depends on how you query your data, but how about something like this, assumes there are multiple notes per person/dog:
PeopleTable
PeopleID
NoteID
.....

DogTable
DogID
NoteID
...

NoteTable
NoteID

NoteDetailTable
NoteDetailID
NoteID
NoteText
...

Answer: Wouldn't a better solution than the one currently suggested be to have a master id table?
dog Table:
id | name | masterId
1  | Rex  |  1
2  | Fido |  4

people Table:
id | name | masterId
1  | Bob  |  2
2  | Alice|  3

masterId
id
1
2
3
4

notes
id | note       | masterId
1  | "Hi"       | 3
2  | "Good day" | 2

This would make scalability easier because if you needed to add a new entity type (e.g. cat), you wouldn't need to add another table (cat_note), it is particularly useful if you add a new note type (e.g. book) because then you would need to add new tables for all your entity types (person_book, dog_book, etc.). Lastly you could directly associate any entity table with the note table.
The only "issue" would be you would need to have a procedure run that would automatically add a new record to the masterId table when a new record is added to an entity table and associate it with the new entry.
P.S.
I Know this answer is like nine months after the fact. Just happened upon this while doing other research and thought I put my own two cents in.


Map & widgets that fill browser window

Question: I have a webpage that has a Map (google), Chart, and Grid. They share the screen via Splitters and TabStrips. I am having an impossible time making them expand to 100% of height/width of the space that they have available to their
An example is worth more than 1,000 words:
I have created a stripped down JsFiddle that shows the problem:
http://jsfiddle.net/drysg/Rh7cL/
Full Browser version: http://jsfiddle.net/drysg/Rh7cL/embedded/result/
I have tried all sorts of CSS tricks (display layout, block, using height: 100%, width: 100%, explicit setting of all width/height in the hierarchy. But nothing is working. I simplified the CSS to illustrate.
I am looking for a pure CSS solution that:

Expands Grid, Chart, and Map to fill the screen at outset
Browser Resize will dynamically resize the Grid, Map, and Chart
(they will shrink to available space like any good WPF or Silverlight app!
If needed, I would tolerate a JQuery approach that responded to window resize events.

If you look closely you will see there are actually 4 issues:

The map height is not 100% of the needed space
The TabStrip that holds the Chart & Grid is not filling 100% of the height
There is a scrollbar on the TabStrip that holds the Chart
 and Grid (I want that removed since they should be filling the space)
What I do want is the scrollbar of the Grid to be working (and that way I won't have a scrollbar on the TabStrip)

The layout hierarchy is as follows:
I. Top Window
    1. Title DIV
    2. Splitter
        A. Map
        B. TabStrip
            i. Table DIV
                a. Menu
                b. Grid
            ii. Chart
Answer: Set both BODY and HTML elements to <code>{ height:100%; overflow: hidden}</code> and then reinstate  your commented DIV height rule back to 100%;
See http://jsfiddle.net/t4dzj/1/ - does that take care of it?

Map & widgets that fill browser window


In cases where it's legal, is it feasible to use a phone for a call in the normal way?

Question: In a country that allows cell phone use on planes, or with VoIP using satellite Internet, how feasible is it to use a phone by the normal method of holding it to your face on a small GA plane such as a Cessna 172? Is it too loud?
Comment: Blue tooth headsets work well for this.
Comment: My way of using a cell phone for many years has been a bluetooth headset, [similar to this one from Amazon](https://amzn.to/3QvNRBP). They don't cost much. A must for driving, but basically anywhere - around the house, office, walking, etc. In other words, I don't consider "holding it to your face" to be "normal method".
Answer: I've made a call 3 times from a light GA aircraft. 2 of those were on the ground with the engine running - once using a noise cancelling bluetooth headset and the other holding the phone to my ear. The time the phone was held to my ear it was very hard to hear the other end and they were very aware that I was in a very noisy environment. The time using my headset the callee was completely unaware that I was in the aircraft and I could hear them clerarly.
That probably says a lot about a decent directional microphone and decent noise cancelling - but I'd say that anecdotally with very little data the answer to your question is that it is indeed too loud to realistically use a phone in the normal way in a light GA aircraft such as a C172.


Reaching cm (inch) level elevation precision using drones

Question: A road construction firm needs altitude data of road path before and after the construction and the error should be less than 3 cm (2 inch). Normally, they put a ground station and workers manually read altitude data every 10 meters. How this precision would be achieved using drones? The RTK receiver on drone only tells the exact location of drone, not the location (altitude) of the ground below the drone. One way that came to my mind is combining RTK+LiDAR. The RTK gives altitude of drone and laser tells its distance to ground. However, the error in RTK plus error in laser would more likely reach above 3 cm. Thus, how the drone companies solved this issue?
Comment: I have worked with uav data and using an rtk base station and targets getting much better than 10 cm is difficult. And the distance to the ground is what it solved by the photogrammetry software, depending on different variables the distance calculated from the drone to the ground can be very accurate. The ground control adds the physical location and scale to the project. Be careful of aerial lidar and comparing it to drone data,sometimes it's accuracy is far less and it is a lot lower resolution data. If you are having lidar collected anyway,I would recommend a truck based mobile lidar unit.
Comment: Without ground control its all rather meaningless http://www.joomag.com/magazine/mag/0625065001446660895?page=30
Comment: What is the measure of altitude error relative to? If there is actually a road, then you probably don't need to fly - your drone could just drive along the road. That could eliminate the lidar part.
Answer: Drone companies typically solve this issue by using structure from motion (SFM) software, made available by commercial programs like Pix4D and Agisoft, and open source software like VisualSFM. These software programs create point clouds, orthoimages, DEMs, etc., similar to those created using LiDAR, but with SFM instead. With an RTK mounted on your platform, the accuracy you desire is not unreasonable. It will depend on the altitude of the drone during acquisition, the sensor width, sensor focal length, and image width. You can compute the ground sampling distance (GSD) to determine your required parameters. It will also highly depend on your use and distribution of ground control points for georeferencing, and the complexity of your landscape.
I have achieved this level of accuracy in forested and urban environments, but it sometimes takes a few tries, and adjusting your parameters, to get it right. It sounds like your AOI isn't too complex, so you can probably fly relatively low, and get the results you desire. This project will require some processing software, so I suggest you look into one of the programs I mentioned earlier.
Comment: Just some quick comments: 1) The technology is called SfM-MVS. SfM finds points in 3D space from overlapping images, MVS densities between these points. 2) Depends on the texture of the surveying area, the z might have a bit higher SD to accommodate your specs. c) There's a wonderful project, about drones and sfm-mvs (https://github.com/OpenDroneMap/WebODM) which you might want try if you have the aptitude.
Answer: Be aware of the well-known SfM doming (elevation) error which typically is present when imagery is collected using traditional (linear/parallel) flight lines (drone and/or piloted aircraft).  Curved flight lines help mitigate this error.  Google "Gently Curved, Convergent, Non-traditional Drone Flight Paths".  The justification for curved, convergent flight lines is as follows:
Minimising systematic error surfaces in digital elevation models using oblique convergent imagery
Rene Wackrow
Jim H. Chandler
First published: 16 March 2011
https://doi.org/10.1111/j.1477-9730.2011.00623.x
Results of the simulation process, the laboratory test and the practical test are reported in this paper and demonstrate that an oblique convergent image configuration eradicates the systematic error surfaces which result from inaccurate lens distortion parameters. This approach is significant because by removing the need for an accurate lens model it effectively improves the accuracies of digital surface representations derived using consumer‐grade digital cameras. Carefully selected image configurations could therefore provide new opportunities for improving the quality of photogrammetrically acquired data.
Answer: Most UAV image processing software can output a DEM / Point Cloud.
For example ERDAS Imagine will then allow you to do volumetric calculations based on these. The vertical error will depend on the flying height, and resolution of the imagery - and so would differ from project to project.
Answer: I've been adapting my curved flight lines for use on long narrow corridors (electric power transmission corridors).  For this example, a fixed-wing drone was used flying at a speed of 31mph and a height of 400' AGL.  The objective is to mitigate the SfM doming (elevation) error.
Comment: Welcome. How this answers the question? Can you add more details focusing on how the system works and how the precision/accuracy is achieved? Also avoid acronyms first time they are cited. For example, what is SfM doming error? What exaclty did you want to show with that picture?
Comment: The curved flight lines work equally well for large regularly shaped or irregularly shaped areas.


How do I make my armature visible through my mesh

Question: There seems to be no option to see my armature through my mesh unless I use wireframe but I want to see how it looks while it's textured to see how it stretches the UV's. I can't believe that this question hasn't been asked before since the major 2.8 release came out and swapped everything around.
Someone told me to check the properties tab but no luck.
Answer: So some workarounds might be like previously mentioned, use wireframe. I found this really annoying and tedious. Then I found some help and told me to use x-ray, that is actually not the same thing in 2.8 and now will make your mesh see-through. You can do this by going to your header on the 3d viewport and it should be the last tab to your right. That should bring a drop-down menu out and there should be a checkbox that says "x-ray"
So the REAL solution is that they changed the name from, "x-ray" to "in-front". Now you can find this by going to your properties window and under the "object" tab there should be a header that reads "Viewport Display". This is where the "in-front" option is.


How do I create a custom sort order in Salesforce Analytics Cloud

Question: I'm just trying to create the custom sort order of the Opportunity pipeline stage in Salesforce analytics cloud. Can anyone tell me how to do this properly?
Answer: You could create a bucket field using a recipe and assign the stages 1:1 and sort by that. However, it can only sort alphanumerically, so if its a completely custom sort, you might need to create a formula field in salesforce to assign them correctly.


The word [these] is plural distributive pronoun and the two verbs "like" and buy" are singular. Why is that please?

Question: In the second sentence above that states "I'd like to buy [these]" The general rule is that if you use a singular noun you must use a singular verb and if you use a plural noun you must you a plural verb. The word [these] is plural distributive pronoun and the two verbs "like" and "buy" are singular. Why is that please?
Answer: Not singular, infinitive.  And infinitive verbs don't change their form.
The basic rule is that the subject must agree with the verb in regards of number and person. For simple present tense verbs, that mean changing the form when the subject is third person singular (he/she/it)
In this case the subject is "I".  That is first person singular.
The verb is a bit hard to see. The full verb phrase is "'d like to buy"
You can understand this to be "would like to buy"  This is a chain of verbs. The first verb and the only one which agrees with the subject is "would".  However this modal verb is invariable, it doesn't change form at all. This is because it has the form of a past tense verb, even though it doesn't express anything to do with past time.  All past tense verbs (except was/were) are invariable.
After that there are a bare infinitive "like" and a to infinitive "to buy" which are just chained together. But infinitives are always invariable. They have no plural or singular form.
The plural pronoun in the predicate "these" is completely irrelevant to deciding the form of the verb.  Here are some examples:

I would like to buy these.
He would like to buy these.
They would like to buy these.

I like to buy these.
He likes to buy these.  verb changes to likes
They like to buy these.

I like to buy it.
He likes to buy it. verb change, the change from "these" to "it" is irrelevant

I liked to buy these.
He liked to buy these. no change in past tense.

I can buy these.
He can buy these.  modal "can" is also invariant
They can buy these.

I buy these.
He buys these.
They buy these.
Comment: To be very very clear: "these" is the **object** of the verb *to buy*. The object could be "this" or "these" or "it" or "five hundred sandwiches" and "I'd like to buy" would not change at all.
Comment: Yes..  "these" is the object and the verb conjugation doesn't depend on the object, even if it did, these are infinitive verbs which don't change form, and even if they did change form, the "plural" form of the simple present is "buy".