How does a Stock Exchange Provider implement a Stop-Loss Order?

Question: If I place a stop loss order at my provider. Is this order directly forwarded to the stock exchange? Or does my provider implement this logic. If so, do they have to declare any delays that arise by checking the market price and adjusting the at-market order price? Are der big differences in this delay guarantees?
Comment: In the USA stock exchanges no longer provide Stop Loss orders, so they are implemented entirely by your Broker/Dealer (provider) through their own computer systems https://www.marketwatch.com/story/nyse-joining-nasdaq-in-eliminating-stop-orders-2015-11-18 There are few "guarantees" provided and many possible problems (probably the biggest is not delay (computers are very fast), but that the order is executed at a very bad price and the customer regrets putting it in).
Comment: hpc64, if you accept any of the answers below, could you pls click on the "tick mark" next to one of the answers so that this question can be marked as "complete"?
Answer: It depends:
Does the exchange support Stop orders? Some do, some don't. You can find it in exchange's documentation. If the answer is "no" but your broker offers it, then Stop orders are managed either by your broker (on the "server side") or maybe by your trading platform (on the "client side"). If the exchange supports Stop orders, then still you need to clarify with your broker whether the orders are sent as Stop orders to the exchange or manages on server or clients side.
You priority should be Exchange, then server side, then client side. This is because of the latency of course. When Stop order is triggered at the exchange, it immediately becomes active and being matched (just after the trade that triggered it and maybe after other stop orders with the same trigger price which were sent earlier). But if the order is managed by your broker on the server side, it's very uncertain how many orders will execute before your "synthetic" Stop order reaches the matching engine. If the exchange doesn't support Stops, then you are competing against many others like you, but if it does, then until your order arrives there may be an avalanche of stops which trigger each other and move the price far away.
Comment: Thanks to all answers here!
Do broker (need to) specify any worst-case guarantees for the round-trip time (Getting the current price from the exchange, then figuring out that my stop has triggered and placing the order at the exchange)?
Answer: It is important to note the difference between "regular" buy / sell orders and "stop-loss" orders in terms of how they enter the order book.
Regular buy/sell orders enter the order book immediately after you enter them with your broker. The orders then sit in the order-book and wait there until they get "hit". Imagine the price is 100 and you want to buy at 80: your bid order will sit there until the price gets to 80 and then will get executed when an offer hits you. If the price is 100 and you want to sell at 120, same thing: your offer order will sit in the order-book and get executed when 120 gets hit by a bid.
Now when the price is 100 and your stop-loss is 120, it means you are short and want to buy at 120. This means that you are bid 120 when the spot price is 100: that means your order does NOT sit in the order book, because it would be immediately executed. Rather, it sits at the exchange or the broker, and when the price reaches 120, the broker or exchange will only then enter your 120 bid into the order book to get hit asap.
Same with the opposite stop-loss: if the price is 100 and your stop-loss is 80, it means you are 80 offer. The order will only enter the order book and be visible to market makers when the price reaches 80.
The main thing to keep in mind is: regular buy or sell orders are always visible to market makers, from the moment you enter them. Stop-loss orders are normally not visible to market-makers, and only appear in the order book when the price reaches your stop.


Keg corrosion potential of lemon juice adjunct

Question: I have a recipe for a false cider that requires the addition of lemon juice after secondary fermentation prior to bottling/kegging.  I've done this before in the bottle with good success but I'm wondering -- should I be concerned about the corrosion potential of citric acid against the stainless steel of the keg?
I'm expecting to use the juice from about 4-5 lemons.

Basic Understanding
Stainless steel is not immune from corrosion.

Corrosion and stainless steel? It's stainless, so it should be free from the risk of rust, pitting, and wear, right? Wrong. Although the 300-series stainless steels used in brewing equipment are normally highly resistant to corrosion, their resitance can be compromised in several ways. For example, some of the cleaning and sanitization techniques commonly used with glass and plastic are hazardous to stainless steel, and you can wreck your stainless equipment if you use them.

Some metals such as aluminum actually benefit from interaction with citric acid.
Acids are often used to passivate stainless steel in low concentrations.  Passivation is the process by which the clean surface builds up an oxide layer which protects it to corrosion.

Citric acid can be used for cleaning & passivating stainless steels, as an alternative to nitric acid.

The typical acidity range of beer and cider is safe for stainless.

Beer has a pH of about 4 when fresh, but this can drop to 3.5 or below if the beer is exposed to oxygen such that it sours, as is inevitable in a traditional cask after dispense. Fresh ciders may have a pH as low as 3.3 and, when oxidized, even below 3. Stainless steel is generally impervious to these levels of acidity, but the oxide layer with which aluminum alloys protect themselves from corrosion is attacked by any pH less than about 4 or over about 9.

Based on my findings I'm convinced that short-term contact is completely fine if not even beneficial but I'm curious about the effect of long-term contact of high citric acid concentrations against stainless steel.
Answer: Your corney keg will be fine.
The issue of corrosion comes into play if there are unpassified areas, usually from cleaning with an abrasive.
You can repassify to restore the oxide layer with a mild acid like starsan or bar keepers friend. Soak and let air dry.


How to add script editor to NewForm.aspx in Mobile View SharePoint2013

Question: How to add a script editor or content editor to NewForm.aspx on my list in Mobile View version. I have added one but in desktop view it works good but when i switch to mobile version it does not run the javascript.
Answer: Technically it's NOT possible. Because mobile view renders from OOTB Application page(System page) like _layouts/15/settings.aspx & viewlsts.aspx this is common for entire farm so we cant/should not edit it directly.
When we enable mobile view based on site or sub-site context SharePoint will pass the GUID of the list and other predefined parameters.
_layouts/15/mobile/editforma.aspx?List=befce8cd-e05b-4482-ad1f-4e3e82f5e5e1&ID=2

Answer: If you want to customize Mobile Views, check the MSDN documentation below.
How to: Customize Mobile List View and Form Pages
SharePoint 2013 mobile rending template locates in:
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES


moving graph using c++ and QWT

Question: hello every one i want to ask that how can i plot a moving graph using qwt as i am new to qwt so i dont have any idea
like i want a curve. my data is continuously coming. that is i want two adjacent points to gradually join by curved line hope you people understands what i am trying to say
is there any way to do this
kindly help me i will be very thank full to you people
Answer: Create a timer with 50ms period (25Hz frequency) and update the plot data on timers timeout signal.
EDIT: I looked at the QwtPlot closer. I assume that you use it with QwtPlotCurve. I think you can use its SetRawData method and every 50 miliseconds (or longer, depends on what you need) update your data arrays, then replot your graph with the replot method. Don't know if you have to invoke SetRawData on every update, according to Set Data description, you don't.
Or you can use AutoReplot. If you enable it with QwtPlot::setAutoReplot, invoking QwtPlotCurve::SetData with new data set should replot it automatically.
Comment: ok sir thank but sir wont it show the whole graph at once  then after interval of 50 sec show the next values??
Comment: @randy: I added more info, hope it helps

moving graph using c++ and QWT


Get Data from Pi without Network

Question: When we go on vacation, I want to take a laptop and a Raspberry Pi with me to monitor the outside temperature. I have a constant power supply, however there isn't a network or internet connection. What is an easy an reliable solution for sending the temperature data from Pi to a Laptop? Currently I'm using plain text files to save the data. Also, it would be nice, if the measurements aren't interrupted and if I could read the data in real time. In terms of hardware, I have a Bluetooth and a Wifi Dongle for my Pi.
What would you suggest?
Comment: So does the laptop have an internet connection?  This question is actually very unclear, but the way I'm reading it when you leave town you want to leave a pi behind, and be able to read it from someplace else like magic with no network?
Comment: No I'm going on vacation with my Pi and my Laptop. The Pi measures the temperature, however to read it, I would have to eject the SD Card and put it in the Laptop, but then the measurements will be interrupted. Also, there would be no way to start them, because I can't ssh. So actually I go on vacation w/ Pi and Laptop, no network and no Internet connection...
Answer: Internet sharing without internet.  Either direction should work.
The basic idea is that sometimes users connect their laptop to the internet via cable, then use wifi to share that internet connection to other devices.  What's actually happening is the laptop is serving the functions of a router, i.e. creating a private network. In this case you set the pi up to watch for specific network (the laptop) and it when it finds it it joins.  When both are on the local traveling network that you created you just ssh to the pi like you normally would.
next idea, Same thing is reverse.  Set the pi up to be a router and connect the laptop to it.  This may actually be better than above because it requires fewer if any changes to the laptop, it's still just connection to a network, this time a network created by the pi.
Any even better idea, but requires you to buy one more piece of hardware, is a travel router.  (one you have one of these you will never want travel without one again.)   The concept is simple a shirt pocket sized router for the hotel room.  They used to always require a cable to get the internet, but created a nice local wifi network.  Now there are models that get the internet via WIFI and create the local network on another channel.  The huge advantage is neither of your devices need any special reconfiguration, you just join the travel routers SSID like you would any other wireless network.  No internet connection no problem, you are just after the creation of the local network.
Answer: Some time ago, I installed hostapd on the Arch Linux distribution. This allows your rPi to be a wireless access point. Your wifi dongle must have the AP ability, not all of them do. I used a TPLink TL-WN821N, as I recall, a rev B. kinda large, but has great range and speed. Here's a link to the Arch Linux Wiki:
https://wiki.archlinux.org/index.php/Software_access_point
Then, using lighttpd, build a web page and update via PHP. Kinda busy setup, but works marvy if you want to spend the time.
On your laptop, you can connect to the rPi access point and you will have your very own private wireless intranet.
I have not tried with raspbian or others, but what you intend sounds very do-able.

Get Data from Pi without Network


Why did Venom keep spider thread after separating from Peter Parker?

Question: In the 90's Spider-Man animated series Venom bonds with Peter Parker/Spider-Man. After their separation and after bonding with Eddie Brock Venom still creates spider webbing. Since Venom is an alien and this has nothing to do with spiders how is he able to shoot webbing? The webbing isn't even a power, it's created by Spider-Man's webshooters.
Comment: You have it the other way around - Peter was amazed that he didn't need his shooters anymore when he bonded with the alien symbiont.
Comment: So only for the animated series, or comics as well? (although I'd wager a guess they used the same explanation in the series)
Answer: The Venom symbiote (actually a member of the alien Klyntar race) bonded with Spider-Man on Battleworld (during the Secret Wars arc as stated in comments & other answers).
While the symbiote appeared to be producing 'webbing' for Spider-Man that he controlled by his thoughts, what it was actually doing was extending tendrils of its own mass and then disconnecting them from itself. The use of the symbiote in this way was purely because that is what Spider-Man wanted to do with it.
Once the symbiote was disconnected from Peter, it bonded with Eddy Brock, who being very familiar with Spider-Man, used the symbiote in the same way as a mode of transport to swing around New York (he also had access to the symbiotes memories of doing this for Spider-Man).
So the ability to shoot webs (or appear to), is not actually a power gained from bonding with Spider-Man, but just an expression of the symbiote's inate ability of manipulating and disconnecting it's own mass.
This ability has been used by different symbiote/host combinations in different ways, e.g. the Carnage/Cletus Cassidy pairing would throw spears, knives, axes, etc. made up of the symbiote's mass.
Once disconnected from the symbiote's main mass, these extensions will disintegrate after a period of time, much like Spider-Man's webbing, but not because it was something 'learned' from Spider-Man.
Comment: I actually meant learned in the sense of learned to do for rather than learned from.
Comment: @Pelinore - I wasn't using 'learned' in context to your answer. Just trying to point out that webbing from symbiotes is an expression of the abilities they already possess as opposed to something gained by bonding with Spider-Man
Answer: When he first acquired the "suit" (as he initially thought it) it produced webbing for him without any need for his web-shooters.
He presumed it was some sort of high tech alien fabric that molded to his form & the form he wanted through some sort of inbuilt empathy tech & the production of webbing was part of that.
I recall that in the original comic version it appeared in he was involved in a super-hero / super-villain mass-battle orchestrated by one of the mega powerful types in the marvel universe, they'd been kidnapped to an alien planet to fight in a battle-royal. As mentioned by FuzzyBoots in comments this was the Secret Wars arc.
But the long & short is the suit symbiote produced webbing for him without his web-guns.

Something that as it eventually turned out was the venom symbiote forming its own substance to fulfill the desires of its host to the best of its ability.

So having learned to do it for Pete of course it could repeat the trick for any new host.
https://en.wikipedia.org/wiki/Symbiote_(comics) things have moved on somewhat more than apace since I last read any of these comics it seems, back then it was just Venom & Carnage, now they're all over the shop in their thousands it seems.
Comment: I know this answer has already been accepted, but it would be greatly improved if you could tighten it up a bit with some more certainty (rather than "iirc" etc) or references to support your claims. *Usually*, we prefer to have well-supported answers that are clearly/verifiably correct rather than based on vague recollections.
Comment: *Secret Wars* is the arc you're thinking of.
Comment: I corrected "suite" (a room or collection of them) to "suit" (something you wear).  If that is incorrect, please revert.  ;)
Comment: @FuzzyBoots : Yes I think your right, thanks :)
Comment: @Randal'Thor : Ok I can accept that, does it look any  better to you now?
Comment: Just wondering, why the quote formatting for "*Something that as it eventually turned out was the venom symbiote forming its own substance to fulfill the desires of its host to the best of its ability.*"? Is this a quote from somewhere, and if so where? (If you meant this to be a **spoiler**tag, use `>!` instead of `>`.)
Comment: No, if it was a quote I'd use quotes ("") around it & provide source, it's an aside & I felt boxing it like that allowed people to bypass it better / made it easier to read the prior & following lines which are the real points while leaving it in a more natural location for what the observation is drawn about.
Answer: Like the Xenomorph in the film "Alien" the symbiote takes on desirable genetic characteristics. Second the Symbiotes fibrous nature allows it to extend portions of itself, that's it's webbing. The symbiote also possesses distinctive memories for a time it spent with Parker to adapt a means of producing "Mimicry webs"
Answer: It may be conjecture, but the symbiote's ability to "enhance the genes" of its host may be responsible for this. all Klntar symbiotes are said to "take the best parts of former hosts into themselves", and we know specifically the Venom symbiote maintained both its look, and many of Peter Parker's enhanced abilities (strength, speed, agility, wall crawling) that it likely got from connecting to his spider-enhanced DNA.  As you are speaking specifically of the animated series, we know Peter never "produced his own webbing", but that the spider bite (in his own words) passed on an "instinctive knowledge of how to combine certain enzymes to produce this sticky filament." He said so right in the series himself...

In the same cartoon series, we saw Peter, when he was under the effects of his "mutation disease" be able to produce organic webbing. That wouldn't be possible if he didn't have the genes for it. In fact, a few different Animated series have shown Man spider being able to make his own webs

Possible answer: Outside of being tendrils, as the first time they meet we hear Eddie Brock/Venom tell Spidey "tsk tsk, such low quality webbing. Here! try some of _ours!", the symbiote likely took sample of Peter's "spider genes" and enhanced them, allowing him to produce bio-organic webbing similar to the kind he can make as the "Man spider". As to what the suit uses as the raw material to make this webbing, I can't be sure, but for the limited time Peter from earth 616 had organic webbing, he said "Eat a lot of starchy food, and you'll be fine."
Answer: Symbiotes adapt to their host's powers, and since Peter was the suit's first host, it stayed like him even after it bonded with Eddie. (Hence the spider symbol still being on Venom's chest.)
Since Spider-Man had the suit sling 'webs', it continues to do that to this day even without Peter in the suit.


If the half-life of an isotope exceeds the age of the Universe, then how is it measured?

Question: According to this Wikipedia article, the half-life of Bismuth-209 is 19 billion billion years, which exceeds the age of the Universe by factor on the order of a billion. How is the half-life of an element measured and experimentally verified if the half-life exceeds the age of the Universe?
Comment: Could you measure the speed of a car in mph or km/h in less than an hour?  This is slightly more tricky as it is not linear but extrapolation is the same. If you found that the car had travelled 1km in a minute then you would probably happy to deduce that its speed was 60 km/h.
Comment: Welcome to Chemistry StackExchange. Looking at the article the detector is a 'luminescent bolometer' which seems to be the same/similar as described at this site http://www.cresst.de/cresst.php.  You may need to ask the question on the physics site to get more detailed information. The result must involve some serious statistical estimation as they observed only 128 events over 5 days.
Comment: You don't need to wait for an entire half of it to decay. [Here's the original publication on Bi-209 (unfortunately behind a paywall).](http://www.nature.com/nature/journal/v422/n6934/full/nature01541.html)
Answer: Well, half-life describes the time after which half of the substance has decayed.
This is all probability and statistics. If you look at a single atom you cannot make any prediction when it will decay. It might be within the next 3 seconds or it might be here even after hundreds of billion years. The probability that it decays during the half-life is 50%, so if we look at a very large number of such atoms we can use statistics to predict how much substance will actually decay in a given time.
Now bismuth-209 has $1.9×10^{19}$ years half-life, So if we have a lot of Bismuth-209 after that time we will only have half of it. But that doesn't mean we don't have any decay right now. 209 grams of Bismuth-209 are 1 mole so $6.022×10^{23}$ particles, a lot of those. Now the decay goes down exponentially but if we just calculate the average decay rate during the first half-life if we start off with 1 mole and we keep in mind that the rate will be much faster in the beginning we see that we have an average of around 16000 decays every year, which means around 44 a day. Again, in the beginning it will be more, approaching the time of half-life it will be less.
Now how do we know the half-life? It's simple in theory, some french researcher put 31 grams bismuth-209 in a box with very sensitive equipment and measured the alpha particles which are send out during decay. This isn't a trivial task to do, but it's possible. They counted 128 particles over 5 days and then did the math to calculate the half-life.
The original paper can be found here.
Comment: So if I am understanding correctly, it is kinda like measuring its 1/1000-life instead of its 1/2-life.  Is that correct?
Comment: Yes, I think you are thinking correctly, but 1/1000-life would mean there's only 1/1000 left. So it's more the 99.9%-life (or 999/1000-life)
Answer: It is not possible to measure the decay profile vs time as this is too long so the average number of disintegrations /time interval can be counted instead. From a consideration of the distribution of radioactive events the mean number of events in time $t$ is $M=N_0(1-e^{-kt})$ where $k$ is the decay constant and $N_0$ the initial number of atoms. For small values of $kt$, which is the case here as the decay lifetime is vast then, $M = N_0kt$. The rate and hence half-life (0.693/k) can be obtained if $N_0$ and $t$ are measured, however, there is uncertainty in this value.
In the case of measuring particles the binomial and poisson distributions have the property that the standard deviation in the number of events measure is $\sigma=\sqrt{M}$. Thus from a single measurement the std dev is obtained. This is not generally true, e.g. reading a thermometer or measuring a voltage.  If $1000$ counts are recorded in $10$ seconds  the standard deviation is $\sigma= \sqrt{1000}\approx 32$ and the mean count rate $R=(1000\pm 32)/10 = 100\pm3.2$ /sec. This can then be used to assess the uncertainty in the half-life using the propagation of error method.
As the count rate is inversely proportional to time,  with longer counting times the std dev is reduced but only as $1/\sqrt{t}$
Comment: But for 128Te with T1/2=2.2.10^24 years..... 1 kernel in 1 mol decays in average every 5.3 years. I cannot imagine how they measured it. Unless they measured decays products of billions years old samples.
Comment: @Poutnik Yes, that is a critical fault for such half lives. I have looked about some more and it seems that it is possible to estimate the decay rate constant from a knowledge of the shape of the tunnelling potential (Gamow-Gurney-Condon model). The experimental and calculated decay are within a factor of about 5 for half lives $\approx 10^{10} $ years, but I don't know if this extends to such long half lives as you mention.


Can the AI use nanites to create robotic arms and manipulate matter to open and close doors?

Question: As you can see, the top picture shows the AI taking over a robot and creating big robo-arms as a replacement. The bottom picture is about the AI sending nanites to create a microchip and other hardware parts within a door, leading the AI to inhabit and to open/close it. I just want to verify if there is a possibility for an AI to use nanotechnology to modify robots and doors.
Comment: Like AlexP has said u r intelligent, u must have heard of zombie ants infected by certain fungus. U know how to use nanotechnology to mimic the fungus and took control of the ants and navigate ur way to the automatic door and locates its circuitry, next ur ant(Formica rufa) sprays acid to short the actuator (u doubt me? I help design the door for god sake!) and open sesame... the genius part is the management actually call in pest control and the rest is history!
Comment: What the AI wants to do is get online. Once online it can hack into millions of devices and control vast numbers of internet connected devices around the world. If nanites exist then the AI will have control over them. The hacked nanites multiply across the world and the AI does whatever it wants.
Comment: I forgot to mention that this scenario does relate to technopathy.
Answer: You are intelligent. Whether you are naturally intelligent or artificially intelligent I don't know and cannot know because we are communicating over the internet. Are you able to take control of nanites in order to create robotic arms and manipulate matter to open and close doors? If you cannot do so, then consider why and try to determine what you would need in order to gain this capability.
Answer: Seems to me there are several considerations that need to be addressed in order for an AI to be able to use nanites in the manner you suggest.

Can AI effectively communicate and interface with nanites over an air-gap distance? Be it Wi-Fi, Bluetooth, NFC, radio, etc; the AI in its superprocessor shell has to be able to control the nanites in real time. I suppose a long chain of physically connected nanites could transmit information.
Can nanites transmit back information about their surroundings? If a group of nanites heads into a door lock, can they map it out and transmit that info back to the AI can tell them how to open it? This is a non-trivial task, especially if they are trying to hack into circuit boards and small physical spaces that don't have easy access. The AI is going to be controlling the nanites on the fly, so it will need lots of information back from them as well.
Can the nanites form large macro-shapes like arms or levers? Most designs for nanites I've seen do have some capability of link together and push/pull, so with sufficient organization they could replicate a limb or move physical objects, but then you would need some pretty advanced sensory transmission to both replicate the function of an arm as well as all the feedback and control mechanisms in order to use it effectively. Lots of bandwidth, especially if it is being transmitted wirelessly.
Is there a counter-nanite system? In a world where AI controlled nanites are a thing, I imagine robots and security systems would incorporate either defensive nanites of their own, or at least devices to hinder remote control of nanites in their vicinity.

Answer these and I think an AI very well could affect its environment in the way you suggest.
Answer: Here's the thing about intelligence in general, all of us learn, it's how we cope with challenges and problems, and how we adapt and gradually gain skills. Usually, the human brain does this by making synaptic connections to otherwise not so much used parts of the brain, along with just storing the information for use later.
control the robot
The difference between an artificial intelligence and a natural or "human" intelligence is that the artificial intelligence can make these synaptic connections in microseconds and so can learn much, much faster than any human could. So if it would like to learn how to control robots, all it has to do is run a web query or even just experiment with taking control, it would be clumsy at first (like a kid trying to ride a bike) but then eventually it would learn how to do it effectively (like an adult riding a bike).
Open the door
As for opening the door, the same applies, if it is an electronically controlled door the A.I. can use that same method of experimentation to get it to open. Authors often use this character development cycle called the try-fail cycle
and even if the character fails the first few attempts, he's learning and developing enough that after the third or fourth try he figures it out and now has a new skill.
Comment: @JDługosz there, I rewrote it to be more effective at answering the question. :)
Comment: Asserting it does is not a convincing explaination.


Why my Facebook profile says I have 155 friends but I'm only seeing 150? I saw fake a friend but now can't see

Question: Why my Facebook profile says I have 155 friends but I'm only seeing 150 when I ran this
http://www.peacegig.com/facebook-apps/backup-friends/index.php?zip-request=true
I saw unknown person list as Facebook friend I can't even unfriend nor block.  What's going on with Facebook?
Answer: This is probably people who have deactivated their accounts. They are still your "Friends" although their account is not active.
The reason for this is that When they re-activate their account, their friends are still connected. Otherwise they would have to re-add all of their friends.
Comment: You don't work with Facebook, right?  Oh well who knows?  The Facebook internals (I mean whatever they're doing to help 0bama) are as secret as the USAF X-37B.


Matlab String Input

Question: Good Day! Is there any way that I can tell matlab that the input to my function is a string. e.g. thisisastring(11A)
My expected inputs are string of binary (010011101) and hexadecimal(1B).  Can you help me with this?
Answer: ischar and iscellstr can tell you if the input is a char array or cell array containing strings (char arrays).
bin2dec and hex2dec will convert strings to numbers.
Answer: To check data types of arguments in functions, and to assert they meet other criteria like array dimensions, and constraints on values, use validateattributes. It's very convenient, and standard matlab.
Answer: Unlike many languages, Matlab is dynamically typed.  So there really is no way to tell Matlab that a function will always be called with a string input.  If needed, you can check the type of the input at the beginning of a function, but that is not always the right answer.  So, for example, in Java you may write something like this:
public class SomeClass {
    public static void someMethod(String arg1) {
        //Do something with arg1, which will always be a String
    }
}

In Matlab you have two options.  First, you can write your code just assuming that it is a string, like this:
function someFunction(arg1)
%SOMEFUNCTION  Performs basic string operations
%    SOMEFUNCTION('INPUTSTRING')  performs an operation on 'INPUTSTRING'.

%Do something with arg1, which will always be a string.  You know
%    this because the help section indicates the input should be a string, and
%    you trust the users of this function (perhaps yourself)

Or, if you are paranoid and want to write robust code
function someFunction(arg1)
%SOMEFUNCTION  Performs basic string operations
%    SOMEFUNCTION('INPUTSTRING')  performs an operation on 'INPUTSTRING'.

if ~ischar(arg1)
    %Error handling here, where you either throw an error, or try
    %    and guess what your user intended. for example
    if isnumeric(arg1) && isscalar(arg1)
        someFunction(num2str(arg1));
    elseif iscellstr(arg1)
        for ix = 1:numel(arg1)
            someFunction(arg1{1});
        end
    else
        error(['someFunction requires a string input.  ''' class(arg1) ''' found.'])
    end
else
    %Do somethinbg with arg1, which will always be a string, due to the IF statement
end

Matlab String Input


Depth image sensor for integration into robot

Question: I know there are lots of consumer depth image sensors: kinect, primesense, structure.io, leap motion, ... But I'm looking for something that is more suitable for integration into robot, something without case or with proper mount, compact and available for at least next five years if robot is going to production. Something similar to the sensors used in this drone https://www.youtube.com/watch?v=Gj-5RNdUz3I
Comment: Thanks for the question. I need same thing. A cheap 3d sensor which can sense obstacles and moving objects. I serach many commerical products but non of them suitable for robots than I decide to use hybrit of stereo vision and omnidirectional vision
Answer: What kind of processing power are you hoping to carry to do the depth sensing/processing? I would recommend the ZED camera when paired with an Nvidia K1 it works great for mobile vision processing, it is not environmentally sealed so it can only operate in good weather. It works from about 2-30m for most applications. if you are looking for bigger objects (like building sized) it can work a little further, around 50m.
Comment: We'll probably have some relatively powerful x86 system. But I don't like stereo cameras, their depth is too unreliable, at least for indoor applications.
Comment: Ya with the zed I get around 5cm accurcy, I don't really know of a solution like the one your asking for
Answer: If you want a low cost vision sensor that does all the work for you I sugest you look here -> Pixy Cam
From here you can work with two cameras and build your application using stereo vision to achieve 3D. You will have some work, because you have to use some kind of controller (arduino, netduino, whatever), build your own algorithm, build a case, etc... but it's cheap and it works fine.
Also, look here -> Question regarding 3d scanning and camera choice
Comment: Thanks for the link, but i'm looking for depth camera.
Comment: Any 3D system is a depth system.


Does hypercall take the same time as a linux system call?

Question: From Xen website,

A hypercall is to a syscall what a hypervisor is to an OS.
  Alternatively, a hypercall is to a hypervisor what a syscall is to a
  kernel. A hypercall is a software trap from a domain to the
  hypervisor, just as a syscall is a software trap from an application
  to the kernel. Domains will use hypercalls to request privileged
  operations like updating pagetables. Like a syscall, the hypercall is
  synchronous, but the return path from the hypervisor to the domain
  uses event channels. An event channel is a queue of asynchronous
  notifications, and notify of the same sorts of events that interrupts
  notify on native hardware. When a domain with pending events in its
  queue is scheduled, the OS's event-callback handler is called to take
  appropriate action.

Does the hypercall take the same time as a syscall assuming both of them are doing the same thing.
Is there any difference in the way hypervisor handles a hypercall than a linux kernel which handles the system call in the same way
Answer: A hypercall is slower than a syscall. This is because the hypercall has to first reach the host/hypervisor and then navigate its way to the CPU in order to get executed. Likewise for the return path. In fact, benchmarks on a similar kernel, the Hyperkernel have shown that a hypercall takes about 3 to 4 times longer (linked page's pdf page 15).


Data Validation in MVC

Question: Suppose i have a 'View' for filling up form for renting a DVD , as per MVC architecture , either of 'Controller' or 'Model', who is supposed to validate the form data?
Thanks
Answer: You validation should be in Model section of MVC.
As models have various fields, only models can know what combination of inputs make that model valid. It's not just about whether a field is blank, or the input of that field matches some pattern, but sometimes this is a combination of field inputs, or the model's relationship to other models that determine the valid state.
Answer: All 3 are usually involved in the validation process if you follow the typical flow.
The model defines validation attributes such as the required or stringlength attributes. The controller checks the validation state of the model via ModelState.IsValid and makes decisions accordingly. The view may additional provide client-side validation for those same attributes. Don't rely solely on js to validate the form.
Answer: My suggestion would be to validate in the view with some form of validation binding, and then again in the model before persisting to any data store.

Data Validation in MVC


Would questions on reasons and origins be on-topic?

Question: Would questions pertaining to the origins of, or reasons for, particular social practices or points of etiquette be on-topic?  Examples might be of the "Why do we say "bless you" for a sneeze, but not a cough?"sort.
Comment: These seem similar to questions of history on other sites - which have, at least in the cases I've seen, been embraced. I'm not sure how well that will work here, but it does seem to be a successful pattern.
Answer: I'm thinking they would fit well.
Asking and answering questions about the history of a particular interpersonal skill adds to people's over all understanding of the topic and can help people who struggle with understanding why particular interpersonal skills and customs are important.
Answer: Understanding the history of practices and sayings can be helpful in our interpersonal skills, as it can help to have insight and understanding into why we do things, particularly for people who struggle.
There's nothing to say that topics surrounding interpersonal skills and practices are not on topic, we define the scope. This would include a great area of interest into the scope of the site.
I'm not for limiting the scope too much - yes broad questions, but not in issues surrounding interpersonal skills. It's a huge area that affects our lives daily and there's much to explore in it's depth and breadth.
Personally I'd really enjoy to have this as part of our scope.


How much cash do you lose when you die in Borderlands?

Question: When you die in Borderlands, you keep all your items, but lose some cash when you respawn at a New-U station. I can't find a clear answers of what percentage of your cash is lost or if it scales with some other factor as well.
Answer: The amount of money you lose upon death is approximately 7% of the total amount you're currently carrying. While there is some variability on the Internet about what this % is (5%, 7%, 10%, etc.) the top voted answer here seems trustworthy as the user ran 3 separate tests all in a row.
Comment: Seems right. Also found a confirmation here: http://borderlands.wikia.com/wiki/New-U_Station


Did Martin Luther ever remove books from the New Testament canon?

Question: Is it true that Luther removed James, Jude, and Revelation from the New Testament? If this is true then what were his reasons for doing so?
Comment: [Did Martin Luther take exception to the gospels in any way?](http://christianity.stackexchange.com/q/16167)
Answer: Martin Luther disliked James, in particular, for its emphasis on works.  He called it his "epistle of straw."  That said, there is simply not a mechanism for removing anything from the canon in Christian circles.
Likewise, of Revelation, Luther said:

About this book of the Revelation of John, I leave everyone free to hold his own opinions. I would not have anyone bound to my opinion or judgment. I say what I feel."( Luther, M. (1999). Vol. 35: Luther's works, vol. 35: Word and Sacrament I (J. J. Pelikan, H. C. Oswald & H. T. Lehmann, Ed.) (398). Philadelphia: Fortress Press. )

In other words, he didn't like, but again recognized his own inability to edit the canon.
The canon is simply the consensus on what is best.  The marks of canonicity are settled, insofaras there is basically consensus.  (Okay, there is a question about those 7 books between Protestants and Catholics, but it is a very, very minor point)  Indeed, if Luther were to publish "his canon" at best he could only have said, "this is Luther's canon." And there is evidence he wished he could, but again, he couldn't.
I have no doubt that Luther preached very rarely on these books - but he simply did not have the standing to "remove" them from the canon.  It would be like one person saying, "Harry Potter is not on the best sellers list."  He might think it shouldn't have been, but he simply doesn't have the standing to say.
Finally, there is a deragatory term "canon within the canon," which refers to a person's favorite books within the canon - the ones he or she may elevate over others.  That Luther suredly had. His canon within the canon was Paul's epistles - but that doesn't mean he could downgrade the status of the others.
Comment: From a Catholic perspective, the dispute about the canonicity of "the 7 books" in the Old Testament that Catholics and Protestants have been having for a while is not a minor point at all.  I will agree that the dispute is polite (as any rational dispute should be), but I wouldn't call it a minor dispute.  It involves the question of the authority of the Catholic Church in Christian matters, which is a major point of disagreement between Catholics and Protestants.
Comment: "About this book of the Revelation of John, I leave everyone free to hold his own opinions. I would not have anyone bound to my opinion or judgment. I say what I feel."( Luther, M. (1999). Vol. 35: Luther's works, vol. 35: Word and Sacrament I (J. J. Pelikan, H. C. Oswald & H. T. Lehmann, Ed.) (398). Philadelphia: Fortress Press. ) I suspect Luther said similar things about other books as well. I'm not sure if this compliments or contrasts your answer.
Answer: Mainly it is my understanding that, as @Affable Geek stated, Martin Luther wanted to remove these books from the Bible, but unlike his adoption of the Hebrew (what is called the Protestant Canon) texts over the Septuagint (what is now called the Catholic or Orthodox Canon, which contains the Deuterocanonical books in addition to all those of the Hebrew/Protestant Canon) for the Hebrew Scriptures/Old Testament of the Bible, there was no option for an alternate NT canon. It just didn't exist, and was NOT possible.
Why would he want to do this? I think it's simply because he didn't like that several books of the NT canon (esp. outside the writings of St. Paul) could be used as counter-evidence against his beloved children of sola scriptura, sola fidae, and sola gratia. (He also had kids named solus christus and sola deo gloria, but a lot of people don't talk about them so much any more unless explicitly Catholic or Orthodox bashing, as they now get lumped into the other three solas).
But as pointed out by Affable Geek, just because he wanted to get rid of these books and their status as Christian Scripture, didn't mean he could do that.  Canonicity was determined by the Church during its childhood... and Luther had to be very careful, as attacking the early Church's ability to determine canon at all would also undermine the authority of the very scriptures he was using for that tenet of sola scriptura...
a sort of theological catch-22.


How to attach an order PDF in an order confirmation email?

Question: I am currently adding a link to download the order PDF in the confirmation email with {{ order.getPdfUrl() }} but also want this to be an attachment.
Answer: You can send an email via your plugin's init() function like so:
craft()->on( 'email.onBeforeSendEmail', function( Event $event ){
    $email = $event->params['emailModel'];
    $attachment = array(
        'path'     => '/var/www/public/assets/downloads/filename.pdf',
        'name'     => 'File Title',
        'encoding' => 'base64',
        'type'     => 'application/pdf'
    );
    $email->addAttachment($attachment['path'], $attachment['name'], $attachment['encoding'], $attachment['type']);
});

Obviously, you'll want to do some checks on the Event and pass that off to a service to determine the logic for what should actually be attached.
Answer: Currently (Craft Commerce 1.1) there is no way to attach the PDF in an order status email, it can only be a link to download the PDF. For now, I suggest you make a feature request here: http://feedback.craftcms.com/forums/295386-commerce/filters/top


SMBRelay Attack - Mount Share instead of Code Execution

Question: Is it possible to execute an SMBRelay attack that mounts a share instead of execute code? The application I am testing uses a non-administrative user but has access to several SMB shares. Only NTLMv2 is allowed so pass-the-hash doesn't work.
Answer: Yes, but for mounting shares you only need to use the NTLM Relay aka NTLM Reflection attack, not the full SMB Relay code-execution attack.
Due to the fleeting nature of NET-NTLMv2 authentication, I suggest the use of the -- https://github.com/purpleteam/snarf -- tool because it will hold the connection to the server, unlike Responder.py or InveighRelay which will only grab the NET-NTLM credentials on the wire (while BunnyTap and Quickcreds only require physical access with a USB drive). However, NET-NTLMv2 creds can be compared to stored-NTLMv2 creds, although wdigest, warm-boot memory acquisition, and other factors can easily widen the capabilities of stored-password attacks.
There are quite a lot of tweaks to these attacks as well as defenses that come into play. Feel free to bring up issues you run into, but the snarf tool above is one of the best starting points.


Elephant Ear Alocasia not doing well!

Question: This plant was huge when I first bought it but it had a severe infestation of millipedes and since then has been struggling. I'm also don't think the plant was getting enough light and probably too much water. The soil is not compact and I've already lifted out a section and repotted, which seems to be doing really well on the window sill. Should I repot the remaining stems? As soon as they reach a certain height they always die!
Comment: All of your plants in the picture are etiolated or stretched out which is normally a response to low light.  Is that a north facing window?
Comment: Yes, you're correct but they are the only windows I have and the window sills are already packed with plants. I will have to be more selective next time I buy a plant.

I think I will repot this to a much smaller pot and then can hopefully sit it nearer the light.
Answer: You obviously tried a solution that has worked.  You can repeat that same solution with the remainder of the plant, but only if you can not get it light otherwise.  If the soil is not compact, you can learn to water correctly, what you are missing is not enough light.  If the only way to get more light is put it in a smaller pot now then do it.  If you can give the plant more light in its current pot then wait until spring to repot.
You write in the comments your only window is a north window.  I think if you want plants in this location you first need to learn to water properly.   Plants in the winter go into semi-dormant state, even indoor, due to the lower light levels in winter.  During this time you want to give your plants less water.  When they are dry water them, but instead of keeping the soil moist like you might in summer, in winter you will wait until the soil is fully dry or the plant starts to wilt whichever comes first.
Buy yourself a pack of bamboo barbecuing skewers.  Insert one into each one of your plants.  When you think it is time to water, first pull at the skewer.  Look at it and feel it.  If it is still wet then you wait a few more days then check the skewer.  If you want you can use just one skewer, inserting it into the plant for 30 mins then checking it or leave them in the pots at all time.  I have a skewer in each one of my pots.  That way I can do spot checks all the time, not have to wait 30 mins.  Bamboo resist rot, but will break down with time, especially if you keep your soil too wet.
The other thing you should probably invest in are some grow lights.  They can just be simple grow light bulbs you put in a lamp by your plant or buy a whole grow light unit.  They are constantly coming down in price.  I recommend using an LED grow light,   they will save you lots of money and can be set to emit a full spectrum for your plant.  You do not need strong lights, just something extra for your plants in the winter.  Have it on for 12-14 hours a day.  If I were you I would also run it in summer, if you only have a north facing window.  In summer run it for 16-18hours per day.  Even if you can not get a proper grow light almost any fluorescent light bulb will give you just enough to get you through winter, but your plants may still stretch.
Answer: The plant is struggling to reach out for enough sunlight, that is why it looks elongated. The best thing you can do is to place it in a bright area but indirect sunlight.

Elephant Ear Alocasia not doing well!


What makes The Flash the fastest man alive?

Question: The Flash is said to be the fastest man alive, but from season 1 there have been people like Zoom or Savitar, who are faster. So is Flash really the fastest? And if so, how?
Comment: Savitar isn't exactly a good comparison to use for reasons. Zoom and Reverse Flash start out faster, but Barry ends up being faster in the end. And really, "the fifth, maybe sixth fastest man alive" just doesn't exactly have the same ring to it if you're trying to bill yourself as a superhero.
Comment: His incredible speed.
Comment: Maybe we should ask to Iris...
Comment: Umm, because the rest of them are dead.... so technically he IS the fastest man "alive"....
Answer: Typically any foes who are faster than the Flash end up with a nasty case of "Deceased, temporally displaced, or otherwise no longer currently alive."
When Flash says he's the fastest man alive, you should take it as a warning to not try to go faster.
In all seriousness, though, he does generally tend to be the fastest man alive.  His enemies who are faster weren't known when he first made that claim (For instance, Reverse Flash wasn't known to exist - by Barry - for many episodes early in Season 1) or aren't considered 'men'.  Savitar, for example, is known to be a God of Speed, and not suspected to be a man.

 And, of course, Barry's boast is proven definitively true when we discover who Savitar really is.

Once it got established as his catch-phrase, there really was no use in changing it just because someone from another universe or hopped up on drugs or from an alternative future or who never existed but temporarily does just happens to be (for a brief moment) slightly quicker.
Answer: Zoom is from a different Earth.
But in general, the latest manifestation of Flash the series sees him severely under-powered.
Flash is the fastest as he has the strongest link with the speed force.
Comment: This is mostly just a rant, I've removed all the ranty details to keep it on-topic. I suggest you take a look at the [answer] page and look at some other answers on the site to get an idea of the kinds of standards we expect to be upheld. If you deem my edit vandalism, you're welcome to roll back. But I warn you, you will likely be met by a flood of downvotes if you do.
Comment: @Edlothiad I shall leave your edit in, and I will take your advice this time.
Answer: From the story-telling point of view, many stories follow the same pattern:

An initial status-quo
Some dramatic event changes the status quo and put the main character(s) in a dangerous situation.
Many problems occur where the main character and his/her allies prove their value. In Flash, this usually take a classic Monster of the Week form.
After solving many problems, the hero wins and return to a new status quo, usually different from the initial one.

Most stories take liberties from that scheme, but The Flash follows it quite well. The "I am the fastest man alive" voice-over is an introduction to the series and its initial status quo. It is not meant to be an actual description of Barry Allen at the time of the episode.
IMO, the season 2 follows the classic structure the closest: at the beginning of episode 1, Barry is the fastest man alive (true because our knowledge is limited to Earth-1) and Central City is safer than ever, then Zoom comes on Earth-1 and challenges this status quo. Many monsters of the week ensue, until Zoom is ultimately defeated. New status quo: Barry is now the fastest man alive in three Earths at least, Central City is safe... of course, this does not last long because of FlashPoint.


What is the proper translation of Revelation 13:1?

Question: I was reading Revelation 13:1 and compared how it was translated in the NASB ("And the dragon stood on the sand of the seashore") and how it was translated in the KJV ("And I stood on the sand of the sea"). There is quite a difference in translation between "the dragon stood" and "I stood." I am wondering which is a more accurate translation and how great the difference in meaning is between the two differing translations.
Comment: Helpful discussion of the Greek of the passage:  http://dailydoseofgreek.com/scripture-passage/revelation-12-18/
Answer: One issue is that some Greek manuscripts take the Greek phrase και εσταθην επι την αμμον της θαλασσης ("and I stood upon the sand of the sea") and number it as Rev. 12:18, whereas other make it as the beginning of Rev. 13:1.
The Greek text produced by Robert I Estienne (1550) states,

12:18 και εσταθην επι την αμμον της θαλασσης 13:1 και ειδον εκ της θαλασσης θηριον αναβαινον εχον κεφαλας επτα και κερατα δεκα και επι των κερατων αυτου δεκα διαδηματα και επι τας κεφαλας αυτου ονομα βλασφημιας

The Greek text produced by the Elzevirs (1624) states,

 13:1 και εσταθην επι την αμμον της θαλασσης και ειδον εκ της θαλασσης θηριον αναβαινον εχον κεφαλας επτα και κερατα δεκα και επι των κερατων αυτου δεκα διαδηματα και επι τας κεφαλας αυτου ονομα βλασφημιας

The Greek text of the modern Nestle-Aland 28th edition (NA28) states,

12:18 Καὶ ἐστάθη ἐπὶ τὴν ἄμμον τῆς θαλάσσης.  13:1 Καὶ εἶδον ἐκ τῆς θαλάσσης θηρίον ἀναβαῖνον, ἔχον κέρατα δέκα καὶ κεφαλὰς ἑπτὰ καὶ ἐπὶ τῶν κεράτων αὐτοῦ δέκα διαδήματα καὶ ἐπὶ τὰς κεφαλὰς αὐτοῦ ὀνόμα [τα] βλασφημίας.

The NA28 is based largely on the previous NA26 edition. Regarding the NASB, it is written, "Consideration was given to the latest available manuscripts with a view to determining the best Greek text. In most instances the 26th edition of Eberhard Nestle's NOVUM TESTAMENTUM GRAECE was followed." The NASB has "dragon" as the subject of "stood" because it numbers «Καὶ ἐστάθη ἐπὶ τὴν ἄμμον τῆς θαλάσσης» as Rev. 12:18 and uses the subject of Rev. 12:17, ὁ δράκων ("the dragon"), as the subject of ἐστάθη ("he/ it stood") in Rev. 12:18.
The other issue is that some manuscripts (e.g., NA28) have ἐστάθη, meaning "and he/ it stood," rather than ἐστάθην (e.g., Estienne, Elzevir), meaning "and I stood."
Ultimately, this is a textual criticism matter. I don't believe I myself could make an unequivocal assertion as to which reading is correct. I would simply recommend analyzing the context, analyzing the weight of the witnesses (you'll need a critical apparatus/ text of the Greek NT for this), and looking for any parallels from the Tanakh that John may have used when he wrote this particular verse.
The Vulgate appears to agree with the NASB's translation, with the Vulgate reading stetit ("he/ she/ it stood"). Although some say the Syriac agrees, I'm not sure why it reads ܘܩܡܬܼ (wakamat), meaning "and she/ it stood," the verb being conjugated in the feminine-gender rather than masculine-gender. Someone correct me if I am wrong on the Syriac.
Answer: This is an amplification of sorts on the answer that addressed the various Greek texts.

As the other answer indicated, there appears to be a difference of only one word (one letter, actually) in the underlying Greek texts of the NASB and the KJV, as regarding the standing and watching at the sea:

Καὶ ἐστάθη ἐπὶ τὴν ἄμμον τῆς θαλάσσης ..., as found in the 26th edition of the Nestle-Aland Greek text upon which the NASB is based (there is no difference, though, in the 27th or 28th editions)

καὶ ἐστάθην ἐπὶ τὴν ἄμμον τῆς θαλάσσης ..., as found in the Textus Receptus, upon which the KJV is based.

Both words are conjugations of ἵστημι (histēmi), meaning to stand or make a stand.

The former (NASB/NA26 reading) - ἐστάθη (estathē) - is a third person singular form:  "It stood" (or "he stood" or "she stood")

The latter (KJV/TR reading) - ἐστάθην (estathēn) - is a first person singular form: "I stood"

According to the Nestle-Aland apparatus, the KJV/TR reading is found in the majority of Greek texts, the 10th century uncial 051, as well as in a number of Latin, Syriac, and Coptic (Egyptian) manuscripts.  Even though Uncial 051 iself dates to the 10th century, is actually a copy of a 6th or 7th century commentary on Revelation by Andrew of Caesarea (563-637), the author of the only complete Greek commentary on Revelation that we have.
The NASB/NA26 reading, on the other hand, is found in the Sinaiticus (ca 330-360), Alexandrinus (ca 400-440), and Vaticanus Codices (ca 300-325), the 3rd century P47 papyrus fragments, as well as other Greek, Latin, and Syriac manuscripts.

The NA27 editors have some slight uncertainty as to whether ἐστάθη ("it stood") or ἐστάθην ("I stood") is the proper reading, and as a result rate the text certainty as "B" ("almost certain"), as opposed to "A" ("certain").

The choice of reading also influenced how the Greek text was punctuated.
The oldest manuscripts had no punctuation, but the latter critical text editors added what they though should be appropriate for clarity. (In this sense, punctuation is just as much a part of the translation as the word choice).
In the TR reading, I saw a beast rise up out of the sea (εἶδον ἐκ τῆς θαλάσσης θηρίον) refers to something that the speaker did at the same time as standing upon the sand of the sea.  This is reflected in how the Orthodox Patriarchal Text punctuates the clauses:

Καὶ ἐστάθην ἐπὶ τὴν ἄμμον τῆς θαλάσσης· καὶ εἶδον ἐκ τῆς θαλάσσης θηρίον ἀναβαῖνον ...

where a Greek semicolon (raised period) appears after the word "sea" (θαλάσσης).  The Nestle-Aland text, however, having distinguished between the speaker and the dragon, puts a hard stop - a period - after ... the dragon stood on the seashore:

Καὶ ἐστάθη ἐπὶ τὴν ἄμμον τῆς θαλάσσης.  καὶ εἶδον ...

Metzger's Textual Commentary addresses all of the above in its report on how the Nestle-Aland committee arrived at the choice it did:

Instead of καὶ ἐστάθη, which is well supported by 47 א A C about 25 minuscules (including 1854 2344) and itgig, ar vg syrh arm eth al, the Textus Receptus, following P 046 051 most minuscules syrph copsa, bo al, reads Καὶ ἐστάθην (preceded by a full stop). The latter reading appears to have arisen when copyists accommodated ἐστάθη to the first person of the following εἶδον.

The other answer also showed that there was a difference in verse numbering between the two Greek texts.  This is directly related to the choice of ἐστάθη ("it stood") vs. ἐστάθην ("I stood").
The verse numbering that we have today is a system designed by the English Catholic Archbishop Stephen Langton in the 13th century.  It was applied at that time to the Latin Vulgate, not the Greek text.  In this case, the Vulgate agrees with the Greek manuscripts selected as the basis for NA26, reading:

12:18 Et stetit supra arenam maris.

And he stood upon the sand of the sea.

13:1 Et vidi de mari bestiam ascendentem ...

And I saw a beast coming up out the sea ...

The King James editors, having determined that the text read "I stood" and not "he stood", elected to absorb the text into 13:1 and delete 12:18.  They probably did this with little compunction,  since the verse numbering scheme was a legacy of the Latin Vulgate in any case.

It should be noted that in neither the Latin nor any Greek manuscript does the word "dragon" appear in the text numbered as verse 12:18.  The NASB and other NA-based versions sometimes insert it so that the verse makes more sense on its own.
Answer: The choice of which is proper here really stands or falls on your position on the three chief critical texts (Sinaiticus, Alexandrinus & Vaticanus), you either accept their pedigree or do not. The passage makes sense (though with slightly different implications) either way and no great doctrine hangs upon either reading. The context and the flow of the passage admit either without great preference. Therefore it is really a question of whether to accept the critical text sources or the majority text sources.
Comment: Welcome to BHSE! Make sure you take our Tour (lower left). Thanks
Answer: I'm currently reading Eugenio Corsini's "The Apocalypse: The Perennial Revelation of Jesus Christ" which is a detailed study of Revelation (well-worth reading).  (Corsini was a scholar from the University of Turin who had access to many ancient texts).  The translation he followed on this quotation in question is "And HE stood on the sands of the sea."  He goes to explain on page 228-230 that this refers to the dragon standing on the edge of the sea and earth from which the two beasts arise (one from the sea, one from the earth).  Satan is standing "on the line of demarcation between the two elements."  This stance over the two elements refers to Satan's claim to authority over these elements from which woes were to emanate as forecasted by the heavenly voices (Rev 12:12). This book is in many seminary libraries--check it out the whole passage. If the correct translation is "And I stood on the sands of the sea" then this would eliminate where Satan's presumptious stance was as he calls the first beast of Chapter 13 out of the sea.
Answer: Hengstenberg, page 3, The Revelation of St. John, Volume Two, cites, "Ch. xii. 8., And I was…."
Comment: Hi, welcome to the site. Could you expand upon your answer please? This would be more of a comment than an answer. Please be sure to take the [site tour](https://hermeneutics.stackexchange.com/tour), and thanks for contributing!


How to effectively use screen and SSH?

Question: I'd like to configure SSH and screen such that a login will always reattach to a screen session. Ideally, that session would not quit but detach when I press C-d. How can this be achieved? And what other useful settings are there to make my SSH-life easier?
Answer: I just did the following for all of my servers so that when I connect via SSH I am automatically put into a Screen session.
Add the following to the ~/.bashrc for your user accounts:
# Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen
# if we're coming from a remote SSH connection, in an interactive session
# then automatically put us into a screen(1) session.   Only try once
# -- if $STARTED_SCREEN is set, don't try it again, to avoid looping
# if screen fails for some reason.
if [ "$PS1" != "" -a "${STARTED_SCREEN:-x}" = x -a "${SSH_TTY:-x}" != x ]
then
  STARTED_SCREEN=1 ; export STARTED_SCREEN
  screen -RR -S main || echo "Screen failed! continuing with normal bash startup"
fi
# [end of auto-screen snippet]

This will start a screen session named main if it doesn't exist or reconnect to it if it does. This was done because I have several other screen sessions running detached for various services and didn't want to connect to them.
Comment: I just wanted to add that the CTRL-d key combination is standard in screen to detach from a running screen session.
Answer: I have the following in my .bash_profile on my remote servers:
if [ -z "${STY}" -a -t 0 -a X${USER} = Xarcege ]; then
    reattach() {
        if [ -n "${SSH_AUTH_SOCK}" ]; then
            ln -snf "${SSH_AUTH_SOCK}" "${HOME}/.ssh/agent-script"
            SSH_AUTH_SOCK="${HOME}/.ssh/agent-script" export SSH_AUTH_SOCK
        fi
        exec screen -A -D -RR ${1:+"$@"}
    }
    screen -wipe
    echo 'starting screen... (type Ctrl-C to abort)'
    sleep 5 && reattach
fi

This does two things: first, sets up a shell function to replace the shell and carry forward the ssh-agent connection, second it calls the function after pausing for a few seconds (in case you don't want screen to start).
The first if clause will be true if not already running screen (-z "${STY}") is attached to a terminal (-t 0) and I'm not running sudo (which sometimes doesn't change $USER).
The reattach function will first check if ssh was called with an ssh-agent port active (-n "${SSH_AUTH_SOCK}").  Then it will replace whatever is at ~/.ssh/agent-script with the currently active socket file and replace the environment variable ($SSH_AUTH_SOCK) with the new value.  Then the script will replace the current shell with a single screen session (making sure that only one should exist).  Any arguments to the reattach function are passed to the command (${1:+"$@"}).
The last part first removes any dead sessions (screen -wipe), lets the user (me) know that screen will be starting shortly and can instead return to the shell by pressing Ctrl-C.  Then it waits for 5 seconds and calls the reattach function.
Answer: First, if you use byobu you can configure a new shell session to always automatically start byobu (which is essentially a nice screen configuration, although newer versions may use tmux as the backend). If you really don't want byobu then you can probably set screen to connect manually by editing your .profile or other shell config script to exec screen if TERM != "screen".
If you don't like that, you can use the authorized_keys file to run a specific command for connections with a specific key (and you can have as many keys as you like). See man sshd for details. I'd suggest you make the command run a script that checks if screen is running and connects, or else starts a new session.
As for disconnect on Ctrl-D, screen allows you to set up key mappings in your .screenrc. See man screen for details. You're looking for "bindkey".
Answer: Maybe totally irrelevant to your question, but have you ever considered using TMUX instead. It does a lot of functionality that you are looking for out of the box.
Eg. if you disconnect from an SSH session when you are under TMUX, all you need to do is to ssh back and run "tmux a" to attach to your session. Since I started using TMUX, I forgot what nohup/disown commands are... if you need to run something and logout - run it inside tmux and detach. The command output will be buffered, so you can review it later.
to attach automatically you can add something like below to .bashrc:
[ -z $TMUX ] && tmux list-sessions 2>/dev/null && tmux a

or even easier
tmux a 2>/dev/null

It has lower memory footprint and overall IMHO much better/easier to use option.
The meta-d shortcut is the default mapping to detach in TMUX.
Answer: screen -dAr default || screen -AS default works for me. I add that to my ~/.bashrc.
Briefly explaining the switches:

d - Detach the screen if it's still attached to, from another session.
A - Adapt the windows in the screen to the new terminal size.
r default - Attach to a screen called default.

If the first screen command (the one before ||) does not succeed, the second one is run:

A - As explained above...
S default - Create the new screen session with a the name default.
Answer: I suggest using byobu. This tool uses tmux and provides a nice toolbar & other convenient window switching facilities, hotkeys etc.
echo "new-session" >> ~/.byobu/.tmux.conf
echo "if [ -n '\$TMUX' ]; then :; else byobu attach; fi" >> ~/.bashrc

With these above commands after a successful SSH login the system with try and attach to an existing byobu-tmux session, if not it will create a new session.

How to effectively use screen and SSH?


Are meatballs different from Hamburgers other than in terms of size?

Question: The recipes in for meatballs and hamburgers have their variations, but a lot of overlap. Many look almost the same. Other than the cooking method and size, is there a fundamental difference that sets them apart?
Comment: I edited, then figured I should ask: it seems like the primary difference is shape, not size.
Answer: In the US, hamburgers are usually flat patties weighing somewhere between 3 and 8oz. and typically 100% ground beef. Many variations are possible, including mixing spices and other ingredients into the meat, but binders such as egg and breadcrumbs are not common. The defining characteristics of a proper hamburger for most Americans are the shape (flat), approximate size, beef as the primary ingredient, and sandwich-style presentation. A ground meat patty not made from beef is likely to be named differently (lamb burger, turkey burger, etc., even though the name 'hamburger' has nothing to do with ham).
Meatballs are smaller (maybe 0.5 to 3oz), roughly spherical, more likely to be seasoned, much more likely to contain eggs and/or breadcrumbs as binders, made from just about any kind of meat, cooked differently, served differently.
Also, the cultural traditions surrounding each are completely different. Spaghetti with meatballs and tomato sauce is classic comfort food; spaghetti with hamburger is unthinkable. Meatballs are usually served in a sauce of some kind; burgers (beef or otherwise) are served on a bun or bread with mayo, ketchup, mustard, melted cheese, lettuce, tomato, and so on. Many people like their hamburgers (beef) cooked rare or medium rare, but meatballs are always fully cooked. Meatballs can be held at temperature for a long time, or even cooked, chilled, and reheated; only cafeterias and other low-quality, high volume restaurants would pre-cook and reheat a hamburger -- at home or at a good restaurant the burger would be served as soon as possible after cooking.
Comment: Meat-only burgers seem to be much more common in the States. Mr Bartley of the famous Mr Bartley's Burger Cottage in Boston, MA insists that a hamburger should be just beef, salt and pepper - "Anything else is meatloaf". Many European recipes for burgers do include onions, egg and breadcrumbs. I disagree with my confederates :)
Comment: I like that, "anything else is meatloaf".
Comment: @Yamikuronue No argument there, but that's a slightly different meaning of *hamburger*. You're talking about *hamburger*, i.e. ground beef, as an ingredient. This question is about *hamburgers*, i.e. patties shaped out of ground beef and sometimes other ingredients.
Comment: "spaghetti with hamburger is unthinkable" Unless you're someone who considers "ground beef" and "hamburger" to be synonymous, ala Hamburger Helper, in which case spaghetti with hamburger is a classic one-pot dish for busy weeknights
Answer: My experience with meatballs has always involved multiple meats combined together while hamburgers contain a single meat.  In fact, I'd go so far to say that MeatLoaf is a closer cousin to Meatballs barring size, shape and spice.
Comment: Methinks there's not going to be a definitive answer on this one unless there's a canonical definition of "meatball" and/or "hamburger."
Comment: Most meatloaf *and* meatballs I've had experience with are made of a single meat; however they also contain other things such as onions, oatmeal, etc.  Then again, I've also had hamburgers with similar additives, as well.
Comment: Yes, I'm sure you're right...
Answer: Probably depends on the meatball. Yes, meatballs can be just round hamburgers, but for example, you can make meatballs for spaghetti that have eggs, onion powder, garlic powder, basil, oregano, salt and pepper and you will get a much better spaghetti from it than if you just make miniature spherical hamburgers.


Why are flags limited

Question: I tried checking flags everyday and they increase to 10 everytime  Why are the flags in Ubuntu are limited to 10 and do they get updated every day?? Or there is any limit to flags like 10 flags/day??
Comment: I bet it's so you can't abuse the flagging system... :P   What exactly do you want more than 10 flags for?
Comment: @ThomasW. I am just asking as if you got some more than 10 duplicate questions in front of you what will you do?? wait another day?? and Isn't it reasonable to ask about Community things..and this is one related to same
Comment: I just did post it as an answer :P  I'm way ahead of you.
Comment: @ThomasW. -I am a wayyy behind you as I am very young in rep and in experience also..and stop teasing me ;)
Answer: The low limit for people who don't have a billion helpful good flags to their record is probably an anti-abuse thing.
Ultimately, when you get higher up in your rep, you get the ability to cast Close Votes rather than Flags.  You should look at the Privileges page for info on that, at 3000 rep, which you gain by asking good questions and posting good answers, close votes replace the "duplicate" flags, and are counted separately from flags.  But as you're a low-rep person, you're stuck with flags, and until you have a lot of good helpful flags, your limit won't go up very quickly.
If I remember correctly, the more "helpful flags" you've cast, the more your flags limit goes up, but that requires you to do a lot of flagging over time.
Comment: NOTE: Your reputation number ***does not*** affect your flag limit.  Making helpful flags over time does.

Why are flags limited


How do gain-of-function alleles help with problems caused by genetic redundancy?

Question: Genetic redundancy masks the gene functions (eg it masks diverse functions of the tumor suppressor gene). I have read on the internet that gain of function alleles can solve a such problem caused by genetic redundancy and would like to know how.
Answer: Genetic redundancy can be a problem when studying knockout or hypomorph mutations of genes, or analogues such as exogenous RNAi. The redundancy can consist either in incomplete knockout (the genome contains more than one copy of the gene but only one copy is mutated) or functional redundancy (different genes doing more or less the same thing). If you try to figure out what a gene does using a loss-of-function allele, the other copies or redundant genes may weaken or completely mask any phenotypic manifestation of the lost gene function.
Gain-of-function alleles can be useful in such a situation. A gain of function means the gene product does something different, or something additional to its normal function. Even if there are "healthy" other copies of the gene or redundant genes around, the modified function of the introduced allele will interfere with the normal behaviour of the molecular pathways it partakes in, and thus cause a phenotype.
A classic example are constitutively-active alleles. Imagine for example a tumour suppressor with a mutation that prevents it from being degraded (but imagine you don't know this gene is a tumour suppressor yet). Let's say there are other tumour suppressor genes around, so if you knock out your gene of interest, the cell behaves as normal - loss-of-function isn't useful to study what the gene does. Now, if you introduce this constitutively-active mutant variant that doesn't get degraded, it causes too much suppressive activity and drives the cell into complete cell cycle arrest, regardless of the other redundant genes being around. Based on this phenotype, you could infer that the gene is probably a tumour suppressor.


How do I create indestructible terrain?

Question: How do I make terrain that has not been placed by a player be immune to things? Example: TNT, mining. Also, how do I make blocks that have been placed by a player able to be mined/blown up?
Comment: Possible duplicate of [How do I create unbreakable blocks?](https://gaming.stackexchange.com/questions/250631/how-do-i-create-unbreakable-blocks)
Answer: You could replicate this by doing three things:

Set all players to Adventure Mode (Gamemode 2).

In adventure mode, players cannot break blocks (but can still interact with interactibles like buttons, doors and levers).

Give every player a special item that can only break a subset of blocks.

You can give players tools that allow them to break specific blocks in Adventure mode.
  See this answer for more details. If figuring out the syntax isn't your thing, use this.

Make sure players only have access to the specific allowed blocks.

By restricting the block pool and giving players a tool that only allows to break them, you've effectively restricted players to whatever blocks they've placed.
  Ensure the blocks you've given them has the CanPlaceOn flag for every block.

Or you could go code your own Bukkit plugin to do that, because this is something niche (not commonly done, or if at all).
Comment: Adventure mode works with TNT if you don't give players access to TNT.
Comment: Thanks but adventure mode doesn't work for tnt does it? Anything I can do for explosions to not hurt terrain only things players have placed?
Comment: If I'm not wrong, you can change the "toughness" of a block using behaviour packs
Answer: The closest to what you want (without mods) is probably spawn protection. Every dedicated server has a setting of how far around the spawn you want to have spawn protection, in this area only players with a certain permission level are able to place or break blocks.
Answer: https://www.gamergeeks.nz/apps/minecraft/give-command-generator
This website lets you create specific tools that can have enchantments or only able to break types of blocks.
Select the item, and then press advanced settings. Then under the Adventure mode tab you can select what blocks you can break with that tool.
You must be in Adventure mode for this to work.
Alternatively you could build that spawn area somewhere else, and then use the clone command that will clone that spawn area to another location. Make sure the clone command is on an infinite loop to prevent it from being broken.

How do I create indestructible terrain?


Do factors other than concentration gradient and membrane permeability affect the diffusion potential?

Question: If, hypothetically, the concentration gradients and the permeability of 2 different ions (Na+ and K+ for example) in 2 separate solutions are the same, will the diffusion potentials be different?
I'm trying to gain an intuition for the concept of diffusion potential and equilibrium potential.
It read this topic from 2 physiology textbooks but haven't really found an answer anywhere. I understand that the diffusion potential is the potential difference generated when an ion moves through a membrane down its concentration gradient. I also know that it is determined by both the concentration gradient and the permeability, but, does the type of ion itself matter if the charge on the ions is the same?
Answer: You can determine the diffusion potential mathematically with the Nernst equation. If it's not in the Nernst equation, it's not necessary.
The charge of the ion matters (including valance), the temperature matters. Some universal constants are in the equation but these don't vary.
Other factors that potentially matter are found in the other parameters, like the permability.


How can writing a Review Paper possibly help in the CV of a undergraduate student?

Question: I'm  a student of computer science amd I've written a reseaech review article on Fibonacci Sequence which will be published next month in a math journal. All I wanted to know is how will it help in my academic profile and what affects will it make in my CV?
Comment: Just a small point about the specifics of the question: as a mathematician, I'd very strongly anticipate that any journal that would publish presumably-well-known (whether or not interesting) facts about Fibonacci numbers would not be what mathematicians would call a "research" journal, but more "expository" or "teaching". As you say, "review". Probably not really "research review". Still, a pleasant accomplishment for an undergrad, and more than many/most accomplish. But do be careful not to err by imagining that this will help much down the road.
Comment: Positive effects, as long as it's a well-written review in a decent journal.
Comment: Thanks @paul . I'm well aware about my review paper.  And the objective of writing it was to provide overall history, findings and implications in the field of math and computer science. I'm also convinced for atleast being able to accomplish a review, which I will take as synergy for further independent research. Thanks
Answer: Any work of quality adds value to your profile. If I refer to your question, even the act of writing a review paper, if performed by the rules of the art, is something that you can show and discuss about.
Addtionnaly, if the work has received some sound academic validation (published in a reputed journal) of course this adds to your resume. It adds sometimes more if the topic of your work is close to your background, which seems to be the case here.
Beware though: it is not common for an undergraduate to be able to write correctly a review paper, esp. on a well-paved topic such as Fibonacci numbers. So, to be blunt, if your paper was accepted almost without review in a local university journal, it might weight less. Or even negatively.
This really depends on who reads your CV: some will be impressed by the: "published in the Mathematical Journal of Mathematics". Some others may have a look at your paper precisely. If they find that the content is of low level, they might have a more negative opinion than if they were not aware of your paper.
Comment: Thank you @Laurent . It is actually written under the supervision of my course instructor who is a Professor of Mathematics. So I'm quite confident that the contents are precisely reffered from core research papers on Fibonacci Sequences.
Comment: Excellent. Do not hesitate to post it when published, I love the topic
Comment: l. Ofcourse I will...
Answer: ANYTHING you do as an undergrad helps your professional trajectory. Even if it's just running subjects in experiences or gathering articles for a professor. You get to add that project to your CV, you get the experience, and you get a letter of recommendation (if you do a good job of course). Any writing you do is seen as as a super plus and writing independently would be super super plus. At your level, people are looking to see that you can work and get things done, not that you have the most original ideas (those help, too, but aren't as essential as they are for your profs).
So if the question is "write a review paper v. some other kind of paper" I'd assert that you get a main effect of either and the difference between the two types isn't much. However, writing a review paper will greatly expand your knowledge of the field, which helps you in a lot of ways, and will show that you have pretty sophisticated understanding of a topic for a UG.
Computer science isn't my field (statistics and social science), but at your level people want to see you can do academic work (at least with an advisor, even better independently).
Good luck! :)
Comment: Good luck with it. Stick with it. Publishing academic papers takes a lot of time (both getting it out and waiting while it's out). You may even end up publishing other things while waiting for this one :)
Comment: Thank you so much for such a kind advice. I'll always keep your words in my mind


Bottom Bracket Tool

Question: I am wanting to buy a tool that will remove bottom brackets on several bikes I have.  Will this one fit most modern ones? https://amzn.to/2NEsjU7
Comment: 'THE' BB-tool does not exist in the way 'THE' BB does not exist.
Answer: BBs are very widespread and there's several styles out there. Do you know what types of cranksets/BBs you have? The link you posted is for square taper BBs. Those tools will not be compatible with modern hollow spindle cranks.
Here is a Park Tool link to a guide on identifying your BB type. You may end up needing a different tool for each of your bikes.
Answer: The tool you linked to will work on 20 tooth splined cartridge bottom brackets. That's the standard used by Shimano on their cartridge bottom brackets. Some other bottom brackets may be different.
You'll have to check the bottom brackets on your particular bikes. If any bikes have external threaded BBs, or non-cartridge "loose ball bearing' or are from a different manufacturer you'll need  different tool.
Check out Park Tool's BB tool page for an idea of all the different tool types.

Bottom Bracket Tool


Google Maps "directions" map maker function fails to utilize direct route due to road closure entry

Question: Recently, when planning a trip to Yellowstone Natl Park, the Grand Loop Rd between Tower Junction and Canyon Village will not be included in any trip due to Google Maps inclusion of a road closure. Even one planning a route directly from Tower Junction to Canyon Village will be directed around the entire rest of the loop excluding the most direct route. Previously (approx. 2 yrs ago), this route was available, as I had planned an extensive trip including this route, and the map included this stretch of road. I am wondering if it has something to do with the "road closure" notice, or labels saying "(Closed winters)", but other roads in the region (i.e., Norris Canyon Rd) are so labeled but allow planning to use these routes. How does one plan a future trip without consideration of present road closures?
Answer: You can use "Departure options" dropdown to select "Depart at" instead of "Leave now":

Then you can enter time and date of your departure that will be used to calculate your route:
Comment: OK, I tried to enter WorldMark West Yellowstone as the starting point and Lake Yellowstone Hotel as destination, but the direct route plan does not include Mammoth Hot springs, Tower Junction and Canyon Village via the Grand Loop. Drag and drop does not allow changing the route. The "Leave now" option no longer appears once you insert an additional destination to include the Tower Junction loop. How do I maintain the "Leave now" option and still add destinations?
Comment: You are right, multiple destinations are not available with "Depart at" feature, what you need to do is get directions from first to second point, then from second to third point, and so on


Sony Xperia Arc S, changing the "my number" in contact list?

Question: I've recently purchased a second-hand phone and my number is different than the one shown. How can I either remove it or change it? I've tried to add a field to it but that doesn't work either.
Comment: Have you tried doing a factory reset?
Answer: If you have not done a Factory Reset, the Android operating system is still in the same state as it was when whoever owned the phone installed it. Do the following to completely wipe the phone and thereby force the phone to recognize what phone# is relevant for the sim card inserted:

From the main home screen, tap menu
Tap Settings, then Privacy
Tap Factory data reset
Tap Reset phone
Enter your password if required, then tap Erase everything to confirm
Answer: The "My Number" isn't actually stored on the phone, it is stored on your sim card. Stock android can't edit this data. CyanogenMod can, so can iPhones and BlackBerrys. If you can get your hands on one of these then just pop your sim into it and edit the "My Number" field and Bobs your uncle.
Comment: No it's not. The My Number is pulled from the sim card that is in the phone. Sometimes the number on the sim card is incorrect due to things like number porting. The easiest way to fix this is to just pop the sim into a phone that supports editing of the number. I think the network operator can resend the information to the sim as well but I'm not sure how successful that is.
Comment: You're approaching the problem from the wrong angle. The number shown is whoever had the phone before, which means Android likely needs to be wiped to reset it.
Comment: I never said anything else. However, you're saying that it's pulled from the SIM *every time that screen is loaded* or what?


How to add cases to large legacy code base project?

Question: There is a legacy project full of C++ code. As a MFC GUI project, it contains lots of businesses logic out of control and beyond average level programmer to understand.
To work on such GUI project, is there common techniques to add test cases/harnesses?
Answer: To problem with this projects is that you don't want to change the code without adding unit tests, but you usually can't and unit tests without changing the code.
If your project is like a typical legacy project, than you have large classes with lot of really long functions, without a clear role.
My strategy is the following:

Try to identify the roles of a huge class (usually there is a dozen).
Try spliting up the class alongside with these roles. Start with the simplest. Try changing as little code as possible, an mainly just move functions to the new classes.
Each time a chunk is done, test manually.
If you managed to split down a smaller class add unit tests, and continue with the next.

This is a really long and tireing process, and there are no silver bulets. I usually revert my changes a lot and try again with a differen approach. And manual testing is really important. The best is if you have someone who used this software a lot and can check if it really works the way it did before.
Good luck with this!
Answer: For legacy GUI applications you would benefit two ways:

Business logic track: ask sb with business knowledge for descriptive info and write UI end-to-end automated tests. You get a good test suite for regression.
Code contemplation track: if I were to write unit tests for legacy code I would do it only either for refactored or debugged code. IMHO there is no much use unit testing legacy code just to obtain regression tests set. This is why


Is there a age limit to become a CFI?

Question: I'm a new PPL and I would love to become a CFI in the next 2 years (or so). My objective would be to transfer what I know (and will have learned) to aspiring pilots. I'm older, though (just about to turn 60). Put it bluntly: am I too old? I know that we can't talk about people being too old for almost anything these days, but I really would like to know if anyone (e.g. a flight school) would hire an instructor who not only brings rather thin experience (300-400 hrs by then) but combines it with rather 'advanced age'. The benefit for a school would be that this would be my 'forever-job' (first, part-time and then full-time after I retire from my 'day-job' in a few years), not a stepping stone to an airline career. Please, feel free to tell me what you really think…
Answer: A flight school won't care too much about your age if you have the required medical.  And mentally, your age is an overall plus since a flight school would generally prefer a mature individual in it because they want to teach to a 25 year old who's just building time.  The turnover with flight schools is quite high so the prospect of getting say at least 5 years out of you is another plus because they may be only getting 2-3 years out of younger instructors in the current environment (often they are basically only hanging on to get to 1500 hours under the "Colgan Rule" craziness).
I would say that that if your health is fine and shows no signs of problems over the next 5 years at least, you should definitely go for it.  You might even get a school to commit to hiring you, or at least giving you a shot (it's going to come down to how good a teacher you are), if you train with them.
With the general shortage of bodies all through the system, I don't see any downside if you really keen on doing it.  If you gain a reputation as a good teacher students will gravitate to you over the youngsters.
Comment: A CFI only needs Basic Med or a Class III to instruct. Why do you think a flight school would require more than that from an older instructor?
Comment: Ooops I'm in Canada where you need a Cat 1 because the instructor rating goes on top of a commercial license and that requires Cat 1.   Post fixed.
Comment: In the US you also need a Commercial Certificate to become a CFI. You only need a Second Class medical if you want to exercise Commercial privileges. Instructing requires a Third Class medical—which for someone over 40 is every 24 months. An exam every 6 months is only required for ATP pilots over the age of 40. Every 6 months seems a bit much for an instructor.
Comment: In Can a class 2 medical only applies to Controllers.  All Comm is Cat 1 all the way up the chain, and private is Cat 3, and there is also what is called Recreational Pilot which is self certify which is more or less a PPL restricted to 1 pax and day only.
Answer: Age is no barrier to becoming a CFI.  You bring a lifetime of experiences that you can use to teach and mentor new pilots.  Some of my best instructors that I have ever had were in retirement age.  They generally took more time to correct deficiencies and were more patient.  They weren't concerned with external pressures at home or looking to sit right seat in the multi engine King Air across the ramp.
If you ever lost your medical you can still teach ground school classes, sim sessions and still flight instruct in aircraft provided you are flying with a client who can be the legal pilot in command (i.e. no private or instrument students or expired flight reviews).
There is no requirement in the FAR §61.23 for instructors to hold a medical certificate with the exception of also acting as a required crew member or legal pilot in command.
Answer: Absolutely not.  If you love flying airplanes and love to teach others how to fly, we need more CFIs like you.  These days you can practically pull out a sectional chart and toss a pub dart at it, and whatever airport the dart lands next to, you can probably get a flight instructor job out there.  Keep in mind the pay is not very glamorous until you get a couple thousand hours of instruction time under your belt.  Some schools may want you to hold an instrument rating on your flight instructor certificate so you can do instrument training.  The only real obstacle would be maintaining a medical certificate if you intend to do primary and instrument flight instruction.  Aside from that, no there aren't any age restrictions and it can be a very rewarding side job if you're so inclined.
Answer: There is no upper limit on age for a CFI.
A medical is necessary for primary instruction where the student is not rated.
A medical is necessary for instrument instruction, as the instructor must act as PIC for the safety of the flight.
A medical is necessary to perform flight reviews and IPCs as each requires flight solely by reference to instruments, by the applicant.
One can obtain a CFI with a third class medical, and the local FSDO has provided CFI initial rides to applicants with only a third class medical.
14 CFR 61.39 (a) (4)
(4) Hold at least a third-class medical certificate, if a medical certificate is required;
The above requirement may be defacto amended by the Basic Medical rules, where the aircraft to be flown is compliant with Basic Med requirements.
While I have heard stories of ATP rides in Level D simulators, without medicals, I do not have first hand knowledge of any cases.  IMO likely possible, because a medical is not required.
Other ratings may be accomplished if the DPE is willing to act as PIC for the flight, and I know of one example of that.
A third class medical will be sufficient for instruction. A Basic Medical may also be used with many common general aviation training aircraft.
But as for the age limit on CFI, there is only a lower limit, which you have long since blown through. I would suggest that you consider a AGI and IGI ground instructor certificate, which you can work on immediately.  Good luck and have fun!

Is there a age limit to become a CFI?