Resize JPEG image to fixed width, while keeping aspect ratio as it is

Question: How would you resize a JPEG image, to a fixed width whilst keeping aspect ratio? In a simple way, whilst preserving quality.
Answer: This will scale in the vertical axis only:
    public static Image ResizeImageFixedWidth(Image imgToResize, int width)
    {
        int sourceWidth = imgToResize.Width;
        int sourceHeight = imgToResize.Height;

        float nPercent = ((float)width / (float)sourceWidth);

        int destWidth = (int)(sourceWidth * nPercent);
        int destHeight = (int)(sourceHeight * nPercent);

        Bitmap b = new Bitmap(destWidth, destHeight);
        Graphics g = Graphics.FromImage((Image)b);
        g.InterpolationMode = InterpolationMode.HighQualityBicubic;

        g.DrawImage(imgToResize, 0, 0, destWidth, destHeight);
        g.Dispose();

        return (Image)b;
    }

Answer: If you are reducing the width by 25 percent to a fixed value, you must reduce the height by 25 percent.
If you are increasing the width by 25 percent to a fixed value, you must increasing the height by 25 percent.
It's really straight forward.
Answer: Assuming there is a (double width) variable:
Image imgOriginal = Bitmap.FromFile(path);
double height = (imgOriginal.Height * width) / imgOriginal.Width;
Image imgnew = new Bitmap((int)width, (int)height, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(imgnew);
g.DrawImage(imgOriginal, new Point[]{new Point(0,0), new Point(width, 0), new Point(0, height)}, new Rectangle(0,0,imgOriginal.Width, imgOriginal.Height), GraphicsUnit.Pixel);

In the end you´ll have a new image with widthxheight, then, you´ll need to flush the graphics e save the imgnew.
Answer: I think there are plenty of samples of this if you search for them.  Here's the one I commonly use...
    public static Stream ResizeGdi(Stream stream, System.Drawing.Size size)
    {
        Image image = Image.FromStream(stream);

        int width = image.Width;
        int height = image.Height;

        int sourceX = 0, sourceY = 0, destX = 0, destY = 0;

        float percent = 0, percentWidth = 0, percentHeight = 0;
        percentWidth = ((float)size.Width / (float)width);
        percentHeight = ((float)size.Height / (float)height);

        int destW = 0;
        int destH = 0;

        if (percentHeight < percentWidth)
        {
            percent = percentHeight;
        }
        else
        {
            percent = percentWidth;
        }

        destW = (int)(width * percent);
        destH = (int)(height * percent);

        MemoryStream mStream = new MemoryStream();

        if (destW == 0
            && destH == 0)
        {
            image.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg);
            return mStream;
        }

        using (Bitmap bitmap = new Bitmap(destW, destH, System.Drawing.Imaging.PixelFormat.Format48bppRgb))
        {
            using (System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bitmap))
            {
                //graphics.Clear(Color.Red);
                graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                graphics.DrawImage(image,
                    new Rectangle(destX, destY, destW, destH),
                    new Rectangle(sourceX, sourceY, width, height),
                    GraphicsUnit.Pixel);
            }

            bitmap.Save(mStream, System.Drawing.Imaging.ImageFormat.Jpeg);
        }

        mStream.Position = 0;
        return mStream as Stream;
    }

Example of the calling code...
Stream stream = File.Open(filePath, FileMode.Open, FileAccess.Read, FileShare.None);

resizedStream = ImageUtility.ResizeGdi(stream, new System.Drawing.Size(resizeWidth, resizeHeight));

Answer: A quick search on code project has found the following article. It allows for resizing of images which accepts a boolean to restrain the new image to keep the originals aspect ratio. I'm unsure of what the quality is like as no screenshots were provided. See the article here


Hemorrhoids and Ramadan

Question: I have a really bad case of hemorrhoids and constipation currently. I am wondering that if a lot of blood comes out with the bowel movements, will my fast be invalidated? I can't really control if I bleed (usually always bleeds) or when I have to go to the washroom.
Comment: Note that if you are ill or have medical problems, the general consensus is that you are exempt from fasting.
Answer: Assalamu Alaikum
To begin with, first I'd recommend you to visit a good gastroenterologist because your condition is not to be neglected and should be dealt seriously.
To simply answer your question, No, even if lot of blood comes out from stool, your fast will not be invalidated (Sunni View).
Next, my recommendations for you to fast or not to fast would depend on where you live. Because with these serious health problems, if it turns out that the duration of fast (in your place) is too long to be bearable by you, you could seriously worsen your health condition. Supposing that the duration of fast (duration of daylight) in your place is less than say, 14 hours or so, then under some conditions you can safely fast.
Those conditions are nothing but, during the night (i.e. not while fasting)

Break up your meals and have them in small quantities so that you don't develop ulcer or the like diseases.
Make sure you have enough fiber rich foods and plenty of water (fluids) to deal with constipation.
Also recommended (until you visit the doctor) is have enough multi vitamins and pre and probiotics and a good nutritional diet.
Exercise enough, regularly, to beat hemorrhoids and constipation.
Comment: Thank you for that relieving answer. I have had hemorrhoids for a couple of years now and constipation usually comes and goes. The fast over here is 17-18 hours. I went to the doctor recently too and he just gave me an ointment, so I'll have to visit a gastroenterologist as you said but i think I'll continue the fasting for now.
Answer: the short answer is no, it will not invalidate your fast.
Intentional blood leaving like donating blood or treatment by letting blood out will invalidate the fast. However, blood exiting from a fasting person unintentionally does not break the fast because he/she is excused for that. Examples being nosebleed or the blood from surgery or a tooth extraction.
Recommendations

Drink plenty of water to prevent constipation from fasting
When not fasting, eat fiber supplement to prevent constipation from fasting
Try Calmovil. See calmovil.com They have drops, supplement, and cream for hemorrhoids.

Hemorrhoids and Ramadan


Burninate tag: runtime-analysis

Question: I think there are already tags for complexity-theory and time-complexity. The descriptions are similar. What benefit does runtime-analysis bring to the table?
Comment: time-complexity is a complexity theory concept, it is about a computational problems's required time to solve independent of what algorithm we are using, runtime-analysis seem to be about analyzing the runtime of a particular algorithm and is an algorithmic concept.
Comment: @Kaveh That seems to conflate the ideas of complexity and complexity class. If what you're arguing is that runtime-analysis is a kind of application of time-complexity, OK; but do we need separate tags for theories and how they're applied?
Comment: time-complexity+algorithms might give a similar meaning to algorithm-analysis, I think people will interpret the pair as asking for an upper-bound on a problem (no algorithms mentioned explicitly) and the second one as asking for analyzing a particular algorithm (which doesn't need to about any problem). How important is this distinction? not much for me personally but it might be for others, e.g. some might want to ignore questions about analyzing people's algorithms while still interested in upperbound questions, or vice versa.
Answer: Time complexity is about asymptotic bounds on worst, best or average case resource consumption needed to solve problems.
Runtime analysis deals with explicit runtimes of a given algorithm on specific inputs (and functions thereof).
Asymptic best/worst/average case behaviour of a given algorithm falls somewhere in between.
Algorithm analysis is way broader than runtime analysis, as it also subsumes space and energy consumption, parallelity, correctness and every other property an algorithm can have.
As we have not used runtime-analysis a lot I guess we can drop it in favor of algorithm-analysis; most will want to analyse runtimes, anyway, so we might need tags to mark other measures but certainly not runtime.
Comment: Is this distinction between "time complexity" and "runtime analysis" common? Is there some (authoritative?) reference that draws this distinction? While I agree that "runtime" does have a somewhat stronger connotation of an *application* to a particular algorithm, it was never my impression that this was institutionalized. In any event, *time complexity* and *runtime analysis* must be very closely related...
Comment: I suppose it's the presence of "run"... since algorithms, per se, don't run... only implementations do.
Comment: @Patrick87: Every formal treatment of complexity I have seen starts with defining runtime on inputs $T_A(x)$ and only then worst-case runtime $T_A(n) = \max_{x \in I_n} T_A(x)$ whose asymtotics are then considered as "complexity". So, runtime and "time complexity" are separate, if related notions. Due to the level of abstraction, complexity analysis most often does not yield any useful information about actual runtimes. What Knuth does in TAoCP, for instance, is (archetypical) runtime analysis.
Comment: So there are lots of references which explicitly draw this distinction between runtime (as in a specific function, not an asymptotic case bound) and time complexity (which only refers to the results of asymptotic analysis applied to case bounds of functions obtained from runtime analysis)? Are any of these references online? Alternatively, does e.g. Knuth say that what he is doing is "runtime analysis, not time complexity" or similar?
Comment: @Patrick87: I don't know about "lots of references"; I know that Cormen et al., for instance, do make this separation. The [Wikipedia article](https://en.wikipedia.org/wiki/Runtime_analysis) is less clear, sadly, but it does mention the separate concepts.

Burninate tag: runtime-analysis


What happens to a druid's AC and ability score bonuses in Wild Shape?

Question: If a druid uses Wild Shape, does he retain his Natural/Dodge/Deflection bonuses to AC? What about ability score bonuses from items (Ring, Amulet, etc) or from spells (Barkskin, Bull's Strength)?
Answer: The natural armor will be dictated by the shape (zero if the shape doesn't give any), dodge will change based on the shape's new Dex mod but otherwise remains in tact. All magic items meld into the new form and become inactive, thus providing no armor, enhancement or deflection bonuses. Only certain magical items overcome this. Spells remain active and provide bonuses, unless the shape somehow negates the spell.
Comment: I find your wording given the dodge bonus to AC confusing, given that 'dodge' AC is an actual type. I assume that he (and you) refer to the dex modifier to AC.
Comment: Note that 'only targets humanoids' spells, like enlarge person, *don't* break when you change shape; its only really esoteric effects that break when you're shifting.
Answer: Wild Shape
The wild shape entry answers most of these questions, but to be brief -

Natural Armour bonus to AC is based on new form - if your normal form has natural armour, that goes away for the duration of the wild shape.  You gain, however, any natural armour the animal you have turned into possesses.
Dodge bonuses from some sources (Spells, feats, class abilities) remain.  Ex or Na racial dodge bonuses, however, will generally go away.  This is a grey area, and an edge case - ask your GM.
Again, racial deflection bonuses may go away depending on type.  This is a grey area.  Those from spells, feats, class abilities, will stay.
Magic Items that you are wearing are 'melded into your new form and become inactive'.  Magic Items that you take off and put back on after you wild shape, since every being has 'magic item slots' for 2 rings, one necklace, one periapt, one cloak, etc, are presumably active.  There's no errata about this, but by RAW, you as a bear can put on a magical necklace and get +6 to Con.  It's not, though, something that you'd be doing at Combat speed, which sort of balances it out.
Spells will generally remain active.  There's some argument over what happens if you cast a spell that requires a 'person' target (like Charm Person) and then turn into a bear (not a Person anymore), does it still work?  Some say that it checks for pre-reqs at casting (which is RAW), and others that it should/would check again when those pre-reqs chance (not RAW).  YMMV.  But things that don't specify 'a person' or 'an elf' or whatever should be fine.
Comment: Wildshape does not change type (like polymorph does). Therefore, the last point about charm person is a bit off.


Turn comment into answer

Question: When I get the best answer to my question in a comment, is it possible to convert this comment into an answer, and accept it? Sometimes the poster don't bother to do the conversion, which is a problem because I would like to accept the best answer.
Comment: What acceptance ratio? We got rid of that nonsense, didn't we?
Comment: The generally accepted process is to: Ask the commenter to write an answer. If, after some time as passed the commenter hasn't done so, go ahead and write the answer yourself with the information and accept it. It's generally considered good form to give credit to the commenter and to mark the answer as Community Wiki, so you don't get any reputation points from it.
Comment: I haven't realized that, thanks :) I will modify the question.
Comment: "[Downvotes are different on Meta](http://meta.stackoverflow.com/faq#vote-differences)". More than likely people are expressing their opinion about your feature request, not on your question's suitability.
Comment: @AlEverett I don't consider CW a good practice when stealing someone's comments and posting them as answers. First it's not what CW is for (it's only meant to encourage edits) and second _most_ comments would require at least some effort to stand as answers. If you put the effort, you deserve the rep, if you don't, you should be downvoted and lose rep.
Comment: @Yannis: I don't necessarily disagree, but that is what I have seen suggested.
Answer: No, it's not possible to convert a comment to an answer, and it's not really a good idea either.
If I choose to post an answer as a comment you can assume that I don't feel it stands as an answer, at least not an answer that I want posted under my name. If you disagree and feel the comment is a good enough answer, feel free to post it as an answer yourself, that's perfectly fine and even encouraged.
Comment: Worth to mention that the other way around is possible for moderators.
Comment: Also, very short answers are automatically converted to comments @ShaWizDowArd (not sure on the exact criteria). But answer-to-comment is not the same as comment-to-answer, we have a high set of standards for answers (and also it's quite common for users with less than 50 rep to post helpful comments as answers because they can't comment yet, which is probably why the answer-to-comment mod feature exists in the first place).
Answer: If you feel a comment is the answer to your question then you can ask the commentor to write one in order to accept it. Most users will do that because everyone likes a little reputation.
But if not then you could write an answer yourself. But don't just copy a comment into an answer. An answer should not just be a one-liner. It should explain the matter.
An automatism to convert comments into answers is not the way to go. That would not meet our quality standards for answers on SE.

Turn comment into answer


How to overlay an earth-like grid on the text in GIMP?

Question: How do I create a text with a grid overlay as shown in this image?
Answer:
Create a new layer above your text layer.
Place your grid element on this new layer.
Create a clipping mask with the layer that has your grid element.(In Photoshop, you right click on the layer and select "Create Clipping Mask")
Re-position your grid element so it is on top of your text!

You can find more information on this technique by searching for how to create a clipping mask or masks in your graphic application of choice.
Comment: And in GIMP, step 3 is to create a layer mask - from the text layer's alpa channel, for example.


Magento 2 get all customizable options

Question: Is there a way I could retrieve all the custom options and their values? (not from a specific product, but just all of the options)
Answer: I found this solution:
<code>    $tableName = $this->_resourceConnection->getTableName('catalog_product_option_type_title');

    $connection = $this->_resourceConnection->getConnection();
    $query = "SELECT * FROM " . $tableName;
    $resultOptions = $connection->fetchAll($query);
</code>
Answer: If you are trying to retrieve custom options and their values for one time you can use mysql query else you can have your own kind of implementations based on the below sql.
<code>mysql> select t4.title as 'Custom Option', t3.Custom_Option_Values from (select t2.option_id, t1.option_type_id,t1.title as 'Custom_Option_Values' from catalog_product_option_type_title t1 left join catalog_product_option_type_value t2 on t1.option_type_id = t2.option_type_id) t3 left join catalog_product_option_title t4 on t3.option_id = t4.option_id;
</code>

Magento 2 get all customizable options


Did I lose Backdoor IRA amount by moving into the wrong account?

Question: I live in California. I have 3 accounts - Trading, Traditional IRA and Roth IRA.
I moved $6000 (IRA limit) from my Trading account to Traditional IRA, and then I intended to move this amount to Roth IRA, i.e. simple backdoor Roth IRA that I do any year I have money. However I seem to have made a mistake and this amount from traditional IRA back to my Trading account instead of the Roth IRA account. Now I can no longer make an IRA contribution as the account says that I have already done it for the last year.
Did I just lose this amount in terms of moving it to my Roth IRA? Will I still have to pay taxes on it?
Answer: You can use the "indirect rollover" process to move the amount into the Roth IRA as you intended, as long as you do it within 60 days of the withdrawal. You can only do one indirect rollover per year.
Comment: The one-per-year rule does not apply to conversions
Answer: In Publication 590-A, section What if You Contribute Too Much?, it says,

Withdrawal of excess contributions.
For purposes of determining excess contributions, any contribution
that is withdrawn on or before the due date (including extensions) for
filing your tax return for the year is treated as an amount not
contributed. This treatment only applies if any earnings on the
contributions are also withdrawn. The earnings are considered earned
and received in the year the excess contribution was made.

So I think that means that if you contribute another $6000 to your Traditional IRA, that would be a total of $12000 of contributions, but since you withdrew $6000 (plus earnings) before the due date of your tax return, that $6000 does not count in your contributions, so you would not have an excess contribution.
Comment: Doesn't this assume they actually did a withdrawal of excess contributions? To me it sounds like they just did a standard IRA distribution. It might be possible to contact the brokerage and get it changed to a withdrawal of excess contributions though.


Accepting an answer when multiple "correct" answers

Question: I've recently asked a question on meta to which I received four very useful and equally "correct" answers.  Each added value; each was helpful to me.  Although one answer did receive more votes than the others (8 to 6 to 3 to 2), I'm not sure there really is one answer that is more acceptable than the others.  Am I under any obligation to accept an answer, or can I just let it stand as is?
Answer: If the answers are different, but all correct, I would upvote all of the correct answers, and accept the one that I actually use.
If the answers are all the same, but came in at different times, I would accept the one that came in first, unless one answer was more clear or went into greater detail.
Pick the one that is better because it is
<code>contains more source code
contains shorter source code
explains things in a simpler way
explains things in a more expilicit way
is written funnier
is written more seriously...
</code>
...or whatever criteria appeals to you that distinguishes one answer from the other. So far I have seen quite a lot of questions with similar answers, but there were always differences, and I would always have been able to find some tiny thing to help me pick one of them as my preferred answer.
Comment: I apologise if this wasn't clear in my question, but each answer was slightly different yet each answer was useful; i.e., I actually used each one.  As is often the case with meta, there may not be a single most correct answer. I also don't feel personal appeal or gravity of style should be factors, but rather correctness of answer. I upvoted each useful answer, but if there's no obligation or expectation to accept an answer I don't wish to favor one over the others. Which is why I'm asking if this is acceptable practice.
Answer: There is no obligation to accept answers if you don't want to, no. Especially now that there is no 'accept rate' given to users to show how many times they accept answers. As you point out there isn't always a correct answer, there could be multiple correct answers, or there could be only one rubbish answer.
What you can do if you're feeling generous is award a bounty to each of the answers - you can do that to multiple answers. That's a way of rewarding multiple answers on one question. But that costs reputation so doesn't get used very often.
If you like them all then upvote them all and don't be too concerned about accepting if nothing stands out as 'the' answer.
Answer: You're never obligated to accept an answer at all, although it's helpful to do so if there's a correct answer. Selecting a correct answer marks the question as answered, and that saves other people time.
Often, in the case of multiple correct answers, people will choose the first correct answer to be posted, or just the one that they like the best or found most clear/helpful.


Avalanche effect in DES

Question: I couldn't understand the avalanche effect in DES. Could someone explain how avalanche effect happens in DES
Answer: First of all, the avalanche effect is a desirable effect: it means that a very small change in the input will lead to a very big change in the output.
A security algorithm that doesn't provide this avalanche effect can lead to an easy statistical analysis: if the change of one bit from the input leads to the change of only one bit of the output, then it's easy to guess / try to find the input: just change one bit of it and verify if it was the right one.
How it works in DES: if you take a look at the DES, you'll see that it has 16 rounds and 2 permutations. The real thing happens in the rounds: for each round, the input bits are used to look up for bits that will be used as the output (the S-box). take a look at this presentation, for example. With the shifts that are made at each round, it means that the "index bits" (the ones used to do the table look up) come from the "data bits" from the previous round.
Changing a single bit in the input will cause more bits to be changed in the following rounds. Slide 6.41 of the above presentation shows how many bits will change at each round.
Comment: the presentation link is broken
Comment: The first paragraph is misleading. A big change is a vague term. This answer needs an update with proper changes. What we expect if one flips a bit in the input then every bit in the output has a 50% chance of flipping. For example, see [here](https://crypto.stackexchange.com/a/64315/18298)

Avalanche effect in DES


Charging for a DIY music player with Li-po battery with TP4056 IC

Question: I am designing a PCB for a DIY DFmini Player based music player. I wanted to know if just putting the TP4056 IC would be sufficient for this application in the PCB or should I use a external TP4056 based charging module with over discharge protection. Also, I want to keep the PCB compact.
Answer: One way or the other you want overdischarge protection. You can use a dedicated IC (DW01 for example), or, assuming your board has a CPU/microcontroller that still operates at the battery's minimum voltage you could use a voltage detection circuit using an input pin on the CPU and shut down the system that way.
Assuming you'll want some sort of battery indicator on the music player, you need to monitor battery voltage anyway.
The other option is the use a LiPo cell with built-in protection circuit.
Comment: I am not using a microcontroller so which one option should I stick with?
Comment: @fghbnhj If you don't have any built-in undervoltage protection, you need to provide it externally. Plenty of ICs on the market for the very purpose.
Comment: The DW01 is almost trivial to implement - it's a 6-pin IC and you need 4 external components (one capacitor, one resistor and two mosfets). The other option if you want it really easy is to use a single-cell LiPo cell with built-in protection circuit.


Money withdrawn from ATM was stolen from tray when momentarily distracted

Question: I had $160 stolen from me after withdrawing it at an ATM with my PayPal card (which is linked to my Wells Fargo checking account). I was momentarily distracted and the funds were swiped from the tray in just a few seconds. Is it possible to get my funds replaced by either PayPal or my bank?
Comment: The bank might be able help with a police investigation if they have video surveillance. Try contacting the police and the bank.
Comment: It seems unlikely since, from your description of the event, neither of them were at fault. Is there anything which makes you believe they should reimburse you for your loss?
Answer: You should report the theft to the police. That is what it is. The police may also want to contact the ATM owner to get access to any security footage.
The ATM owner would only have responsibility if they provided substandard security. But based on all the locations I have seen ATMs I don't expect that there is any standard for security.
If as part of the incident the card was also stolen, then report that to the card issuer.
Depending on where you are it might be a loss you can deduct from your taxes, but the amount is probably too low. There is also the possibility of an insurance claim, but it would depend on the policy you have and any deductible that policy has. If you are going the tax or insurance route you should also get a copy of the police report for proof.
Comment: Thank you for your response. My wife and I decided that the chance of getting the money returned is just too remote to justify the time and energy required in order to pursue any sort of legal action. We're chalking it up to an expensive learning experience and investing more time and headspace into it would drive up the impact of what amounts to a stupid mistake on my part as much as an act of dispicable, underhanded skullduggery on the part of the perpetrator. Many thanks to those who left suggestions, tho. You've made an investment of kindnesses without the expectation of a return on it.


What is the ADA standard toilet height?

Question: Is there an official height that toilet seats are supposed to be at according to the ADA?
Comment: As it looks like you want to install a wall mount toilet I would go with 18" as Niall suggests, since this will be a compromise for short and tall people.  Personally, one of the first things I change when I move into a house is the toilet. I have long legs and I don't like my knees around my ears when I'm "reading" so I always install a taller than normal toilet. So in the case of installing a standard floor mounted toilet, I would say it's more of a preference thing.
Answer: From the source:

4.16.3* Height. The height of water closets shall be 17 in to 19 in (430 mm to 485 mm), measured to the top of the toilet seat (see Fig. 29(b)). Seats shall not be sprung to return to a lifted position. Appendix Note

and from the Appendix Note in question:

Toilet seats 18 in (455 mm) high seem to be a reasonable compromise. Thick seats and filler rings are available to adapt standard fixtures to these requirements.
Comment: It sounds like my wife wrote the "seats shall not be sprung to return to a lifted position" part of that. :)
Answer: If you are putting in more than one toilet in an office, you can meet more people's needs by putting them in at different heights.   Likewise if you are leaving space for a wheelchair next to the  toilet, try to have one with the space on the left and another with the space on the right.    Details like how easy it is to use the lock and light switch are very important, and  just having a handrails on the wall next to the toilet can help lots of people.
A toilet that is too low is better than one that is too high, as it is easy to fit a Toilet Seat Riser if needed. (This does not work for public toilets.)
At all times, think about the why. I have too often seen items like handrails on a wall that can't be reached as it is behind the water heater, etc.  Will it really work for real people?
Comment: I must totally disagree with the too low toilet seat. As someone with two artificial hips and major back surgery, a normal sized toilet is a major burden. For adults, the new higher toilets are not a major issue.

What is the ADA standard toilet height?


Server side event confusion with ASP.NET

Question: I am attempting to create a web page that will allow a user to capture images from a camera attached to the server using ASP.NET. The camera is an olympus and the server side code has access to all of the synchronous calls that are in the sdk of the camera.
The problem arises when I attempt to capture an image.
The way it works in the SDK is that you first tell the camera to take the image, then add a listener to an event that is trigger by the camera to then begin downloading the image from the camera once it is finished capturing the image.
The event is never triggered so I am currently unable to download the image from the camera.
The code that binds the listener to a function and tells the camera to take the picture, is inside a button's server side code.
Essentially I am wondering how one could have an event listener for something that changes on the server, like the state of the camera that is attached.
Comment: Are you binding the event handler on postback?  If not, the event won't fire to your handler.
Comment: That might be the issue, I am actually binding the event on page load rather than on postback, I'll give that a shot.
Answer: I would expect you to have problems with this. For instance, I bet the camera assumes it is in use by a single desktop application at a time. Calling it from a web application is quite different, as each request could be from a different user, and could be unrelated to what's already going on with the camera.
I recommend you communicate with the camera through a Windows Service. The service would communicate with the web application through a WCF Service hosted in the Windows Service. It would tell the camera to take the image, and would attach to the event. When the event fires, it would download the image from the camera and return it to the caller of the web service.
The WCF service would probably have to ensure that only one user is using the camera at a time. If the camera is already in use, it would have to reject the call.
Answer: Server side event captures can get a bit tricky.  It has been a while since I've done this so I'm writing completely from my foggy memory ...
Attaching to a server side event from a page class introduces a problem with the life cycle of the class.  Once the page is delivered, the instance of the class is no longer in scope so whatever event handler you assigned to the camera is no longer in scope either.  We used two different mechanisms for dealing with this.
A) Assign a static method to the event handler.  A static method isn't tied to an specific instance of a class and will persist even after the instance of the page is no longer in scope.
B) Assign a method in the GLOBAL class to capture the event on the Application(or session)_Start event.  This keeps the event handler outside the scope of the page class as well.
In either of these instances your event handlers will need to set some flag that can be read globally to indicate the image is ready and your page will need to poll a page (or handler) or refresh to find out of the image is ready.
You will also need to look at the scope of the camera's API class instantiation. If the class is instantiated as a member of the page's class, it drops off the face of the earth as soon as the page is finished doing it's thing and the event will not get raised.  The camera class will need to be either static, global or spawned off to another independent thread.
Hope my foggy ramplings help.  Good luck.


SharePoint 2010 / 2013 Designer workflow - people picker as workflow initiation parameters cause workflow to fail in create list item

Question: I created a number of workflows in Designer 2010 and I have an issue with passing data from a people /person initiation parameter to a discussion list in which I created a "recipients" field.
The workflow simply fail to start. (The create item action is first). If I remove "recipients" from the fields to be populated by the workflow using the initiation parameter as input, then the workflow works fine.
Any ideas?
Thanks
Answer: Just checking, when you specific the Value Assignment. Do you set your people picker's Return field as: "As String"? Try setting the return field as "Email Address" and give it a try.
I want to put this as comment instead of answer but i can't do that yet.
Comment: Glad it helps =)
Comment: Hey, thank you for your suggestion. I actually tried that, yes... and still failed on start.
Comment: Hey, thank you for your suggestion. I actually tried that, yes... and still failed on start. I created a very small test workflow using 2013 platform this time, which generates an aspx form. Same action, create a list item, and well it works beautifully... no error there, so there is definitely something wrong with the people picker, going from the people picker field in the InfoPath initiation form to the SPS 2013 list people picker fields. So Either I design a 2013 WF and cannot really design the form as I want it or design 2010 WF but cannot have people as parameters. Latter is not a option
Comment: Apologies, tried it again and it does work! Thanks much. I must have forgotten to publish my changes!
Comment: Why was this never marked as answer?


What conserved quantity does Supersymmetry imply?

Question: According to Noether's theorem, for every continuous symmetry there is a conserved quantity. What is the quantity that corresponds to Supersymmetry?
Comment: Is it just me or is Noether's theorem a fancy way of saying $\frac{dy}{dx} = 0 \implies y(x) = y(0)\ \ \forall x$?
Comment: @Mehrdad No, not really, because the quantity that is invariant and the one that is conserved are not the same. Also $x$ in your first equation can be anything, while $x$ in your second equation is time.
Comment: @Mehrdad, Well, yeah, in a sense. But the physics details and implications are important.
Comment: @Javier: Thank you! That's a really great point about the quantities being different.
Answer: A supercharge is the conserved quantity that corresponds to a supersymmetry. It generates a supersymmetry & commutes with the Hamiltonian.
A supercharge is a Grassmann-odd quantity. Noether's theorem works fine for supermanifolds, cf. e.g. this Phys.SE post.
However, note that one cannot measure (the expectation value of) a Grassmann-odd quantity directly in an experiment, cf. e.g. my Phys.SE answer here. In other words, the experimental consequences of a conserved supercharge are extracted by other indirect means.
Answer: The conserved charged is the supercharge, as @Qmechanic told you. But then, what is supercharge? Supposing a particle of momentum $P_\mu$, the simplest SUSY implies a supercharge $Q=ip_\mu\Psi^\mu$, where $p_\mu$ is the momentum and $\Psi_\mu$ is the Grassmann variable, and you can also prove that this thing is secretly a sort of Dirac operator. I have explained some details in my blog, see the appendix of this blog post of mine:  http://www.thespectrumofriemannium.com/2015/08/08/log177-scherk-susy-and-sugra/
Moreover, two tips, FOR THE SIMPLEST SUSY: 1) the SUSY transformation of the supercharge is, up to a multiplicative constant, THE SUSY LAGRANGIAN, and 2) the SQUARE of the supercharge is THE SUSY HAMILTONIAN.
In addition to all this, the most general SUSY algebra, as far as I know, can include beyond $P_\mu$ extra topological extensions of the SUSY algebra including central charges. So, in addition to spacetime symmetries, and mixed entities like the supercharge above, you can also get topological charges in non-trivial way.
References:
https://arxiv.org/abs/hep-th/9711009
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.63.2443


If I buy a game or pre-order a game in a different storefront language that I use, will my game be the same language?

Question: My PS4 storefront is in Spanish and I can't change it to English to make purchases in the PS4 store.
If I preorder a game in my Spanish storefront, will I get the game in English or Spanish?
Comment: Why can't you change it to English? What kind of store are you connecting to?
Comment: I can change it to English, but can't make purchases from that store because ps4 doesn't let you change storefront
Comment: I'm not sure how PS Store handles this, but the inteligent thing would be just handling the DRM license and letting you download the game depending on the region you're accessing to the Store. Anyway, depends how the publisher distributes the game.
Answer: That depends on the game.
Most games feature multiple languages, with the notable exception being Japanese games, which usually only feature Japanese (with some few exceptions also including English, and nothing more).
If you're using the Spanish (Spain) storefront, chances are you will be getting the European version of the game, which will probably include German and French (and with very high likelihood English too).
If you're using the Spanish (Latin America) storefront, chances are you will be getting the American version instead, which will likely include English and French as well.
Some games only have an international version, in which case they'll include all supported languages, regardless of which storefront you buy them from.
So, while it's very likely your game will support English, there is absolutely no guarantee it will. It's different for every game.
As an anecdote, I've been buying games in the Swiss German storefront for decades, and have only encountered 3 games that didn't support English: Deus Ex: Human Revolution (PS3), Wolfenstein: The New Order (PS3, German edition), Wolfenstein II: The New Colossus (Nintendo Switch, German edition).
Wolfenstein is one of the few games, where the German version is completely separated from the rest of Europe, due to Nazi references being illegal until very recently.
I have yet to encounter a PS4 game, where English isn't included in the European version.


What does "int 0x80" mean in assembly code?

Question: Can someone explain what the following assembly code does?
 int 0x80

Comment: See also [The Definitive Guide to Linux System Calls (on x86).](https://blog.packagecloud.io/eng/2016/04/05/the-definitive-guide-to-linux-system-calls/), and also https://stackoverflow.com/tags/x86/info.
Answer: int means interrupt, and the number 0x80 is the interrupt number.
An interrupt transfers the program flow to whomever is handling that interrupt, which is interrupt 0x80 in this case.
In Linux, 0x80 interrupt handler is the kernel, and is used to make system calls to the kernel by other programs.
The kernel is notified about which system call the program wants to make, by examining the value in the register %eax (AT&T syntax, and EAX in Intel syntax). Each system call have different requirements about the use of the other registers. For example, a value of 1 in %eax means a system call of exit(), and the value in %ebx holds the value of the status code for exit().
Comment: @mfaani Yes the Kernel is a program.
Comment: You mean to say the kernel is just another program? i.e. programs get interrupted with other programs. And that program in this case happens to be the kernel?
Answer: It passes control to interrupt vector 0x80
See http://en.wikipedia.org/wiki/Interrupt_vector
On Linux, have a look at this: it was used to handle system_call.  Of course on another OS this could mean something totally different.
Comment: by shorten long story that's instructions mean **DO IT** for instruction was before.
Comment: @YudaPrawira: you should think of the earlier instructions as setting up args in registers, and `int 0x80` as a special kind of `call` to a function in the kernel (selected by `eax`).
Comment: Why did you say "WAS used?" Is it used no longer?
Answer: Keep in mind that 0x80 = 80h = 128
You can see here that INT is just one of the many instructions (actually the Assembly Language representation (or should I say 'mnemonic') of it) that exists in the x86 instruction set. You can also find more information about this instruction in Intel's own manual found here (page 626).
To summarize from the PDF:

INT n/INTO/INT 3—Call to Interrupt Procedure
The INT n instruction generates a call to the interrupt or exception
handler specified with the destination operand. The destination
operand specifies a vector from 0 to 255, encoded as an 8-bit unsigned
intermediate value. The INT n instruction is the general mnemonic for
executing a software-generated call to an interrupt handler.

As you can see 0x80 is the destination operand in your question. At this point the CPU knows that it should execute some code that resides in the Kernel, but what code? That is determined by the Interrupt Vector in Linux.
One of the most useful DOS software interrupts was interrupt 0x21. By calling it with different parameters in the registers (mostly ah and al) you could access various IO operations, string output and more.
Most Unix systems and derivatives do not use software interrupts, with the exception of interrupt 0x80, used to make system calls. This is accomplished by entering a 32-bit value corresponding to a kernel function into the EAX register of the processor and then executing INT 0x80.
Take a look at this please where other available values in the interrupt handler tables are shown:

As you can see the table points the CPU to execute a system call. You can find the Linux System Call table here.
So by moving the value 0x1 to EAX register and calling the INT 0x80 in your program, you can make the process go execute the code in Kernel which will stop (exit) the current running process (on Linux, x86 Intel CPU).
A hardware interrupt must not be confused with a software interrupt. Here is a very good answer on this regard.
This also is good source.
Comment: Linux System Call table link is broken =\
Comment: *Most Unix systems and derivatives do not use software interrupts (except int 0x80)* seems like a weird way to put it.  The `int 0x80` i386 Linux system call ABI is extremely similar to the DOS `int 0x21` ABI.  Put a call number in a register (AH for DOS, EAX for Linux), and other args in other registers, then run a software-interrupt instruction.  The main difference is in what the system calls let you do (access hardware directly in DOS but not Linux), not in how you invoke them.
Comment: Here is a non-broken syscall table link. https://syscalls.kernelgrok.com/ Just expand it to show all calls at the top.
Comment: When using linux 64bits, You can see the system call available at `/usr/include/x86_64-linux-gnu/asm/unistd_64.h`
Answer: Minimal runnable Linux system call example
Linux sets up the interrupt handler for 0x80 such that it implements system calls, a way for userland programs to communicate with the kernel.
.data
    s:
        .ascii "hello world\n"
        len = . - s
.text
    .global _start
    _start:

        movl $4, %eax   /* write system call number */
        movl $1, %ebx   /* stdout */
        movl $s, %ecx   /* the data to print */
        movl $len, %edx /* length of the buffer */
        int $0x80

        movl $1, %eax   /* exit system call number */
        movl $0, %ebx   /* exit status */
        int $0x80

Compile and run with:
as -o main.o main.S
ld -o main.out main.o
./main.out

Outcome: the program prints to stdout:
hello world

and exits cleanly.
You cannot set your own interrupt handlers directly from userland because you only have ring 3 and Linux prevents you from doing so.
GitHub upstream. Tested on Ubuntu 16.04.
Better alternatives
int 0x80 has been superseded by better alternatives for making system calls: first sysenter, then VDSO.
x86_64 has a new syscall instruction.
See also: What is better "int 0x80" or "syscall"?
Minimal 16-bit example
First learn how to create a minimal bootloader OS and run it on QEMU and real hardware as I've explained here: https://stackoverflow.com/a/32483545/895245
Now you can run in 16-bit real mode:
    movw $handler0, 0x00
    mov %cs, 0x02
    movw $handler1, 0x04
    mov %cs, 0x06
    int $0
    int $1
    hlt
handler0:
    /* Do 0. */
    iret
handler1:
    /* Do 1. */
    iret

This would do in order:

Do 0.
Do 1.
hlt: stop executing

Note how the processor looks for the first handler at address 0, and the second one at 4: that is a table of handlers called the IVT, and each entry has 4 bytes.
Minimal example that does some IO to make handlers visible.
Minimal protected mode example
Modern operating systems run in the so called protected mode.
The handling has more options in this mode, so it is more complex, but the spirit is the same.
The key step is using the LGDT and LIDT instructions, which point the address of an in-memory data structure (the Interrupt Descriptor Table) that describes the handlers.
Minimal example
Answer:
int 0x80 is the assembly language
  instruction that is used to invoke
  system calls in Linux on x86 (i.e.,
  Intel-compatible) processors.

http://www.linfo.org/int_0x80.html
Answer: The "int" instruction causes an interrupt.
What's an interrupt?
Simple Answer: An interrupt, put simply, is an event that interrupts the CPU, and tells it to run a specific task.
Detailed Answer:
The CPU has a table of Interrupt Service Routines (or ISRs) stored in memory. In Real (16-bit) Mode, this is stored as the IVT, or Interrupt Vector Table. The IVT is typically located at 0x0000:0x0000 (physical address 0x00000), and it is a series of segment-offset addresses that point to the ISRs. The OS may replace the pre-existing IVT entries with its own ISRs.
(Note: The IVT's size is fixed at 1024 (0x400) bytes.)
In Protected (32-bit) Mode, the CPU uses an IDT. The IDT is a variable-length structure that consists of descriptors (otherwise known as gates), which tell the CPU about the interrupt handlers. The structure of these descriptors is much more complex than the IVT's simple segment-offset entries; here it is:
bytes 0, 1: Lower 16 bits of the ISR's address.
bytes 2, 3: A code segment selector (in the GDT/LDT)
byte 4: Zero.
byte 5: A type field consisting of several bitfields.
    bit 0:  P (Present): 0 for unused interrupts, 1 for used interrupts.*
    bits 1, 2: DPL (Descriptor Privilege Level): The privilege level the descriptor (bytes 2, 3) must have.
    bit 3: S (Storage Segment): Is 0 for interrupt and trap gates. Otherwise, is one.
    bits 4, 5, 6, 7: GateType:
        0101: 32 bit task gate
        0110: 16-bit interrupt gate
        0111: 16-bit trap gate
        1110: 32-bit interrupt gate
        1111: 32-bit trap gate

*The IDT may be of variable size, but it must be sequential, i.e. if you declare your IDT to be from 0x00 to 0x50, you must have every interrupt from 0x00 to 0x50. The OS does not necessarily use all of them, so the Present bit allows the CPU to properly handle interrupts the OS does not intend to handle.
When an interrupt occurs (either by an external trigger (e.g. a hardware device) in an IRQ, or by the int instruction from a program), the CPU pushes EFLAGS, then CS, and then EIP. (These are automatically restored by iret, the interrupt return instruction.) The OS usually stores more information about the state of the machine, handles the interrupt, restores the machine state, and continues on.
In many *NIX OSes (including Linux), system calls are interrupt based. The program puts the arguments to the system call in the registers (EAX, EBX, ECX, EDX, etc..), and calls interrupt 0x80. The kernel has already set the IDT to contain an interrupt handler on 0x80, which is called when it receives interrupt 0x80. The kernel then reads the arguments and invokes a kernel function accordingly. It may store a return in EAX/EBX. System calls have largely been replaced by the sysenter and sysexit (or syscall and sysret on AMD) instructions, which allow for faster entry into ring 0.
This interrupt could have a different meaning in a different OS. Be sure to check its documentation.
Comment: Fun fact: FreeBSD's i386 system call ABI passes args on the user-space stack.  Only `eax` is used for the syscall number.  http://asm.sourceforge.net/intro/hello.html
Answer: It tells the cpu to activate interrupt vector 0x80, which on Linux OSes is the system-call interrupt, used to invoke system functions like open() for files, et cetera.
Comment: Strictly speaking, it doesn't tell the kernel...  It tells the CPU, which looks up the handler in the IDT, which ends up being a pointer to some kernel code.
Comment: True. I suppose the better phrasing would be it tells the CPU to activate the vector, and the vector (as part of the kernel) invokes the function.
Comment: which ends up doing this, which inturn ends up doing that, which then does this, which then goes there **confused**. :/ Amber has an answer that is understandable..thats it..
Answer: As mentioned, it causes control to jump to interrupt vector 0x80.  In practice what this means (at least under Linux) is that a system call is invoked; the exact system call and arguments are defined by the contents of the registers.  For example, exit() can be invoked by setting %eax to 1 followed by 'int 0x80'.
Answer: int is nothing but an interruption
i.e the processor will put its current execution to hold.
0x80 is nothing but a system call or the kernel call.
i.e the system function will be executed.
To be specific 0x80 represents rt_sigtimedwait/init_module/restart_sys it varies from architecture to architecture.
For more details refer
https://chromium.googlesource.com/chromiumos/docs/+/master/constants/syscalls.md


Lie group definition

Question: Lie group is a group equipped with a smooth manifold structure such that multiplication and inverse are smooth maps.
What I don't understand is why we require multiplication and inverse to be smooth maps? I know it has something to do with compatibility of group structure and manifold structure but I am not able to reason it.
Hope for a clear explanation and an example which shows what goes wrong if those two maps are not smooth.
Comment: Multiplication in this case is composition of mappings.  The composition of smooth maps is a smooth map.
Comment: I assume you at least want the maps to be continuous - if so, is this what you have in mind? https://en.wikipedia.org/wiki/Hilbert%27s_fifth_problem
Answer: The reason is simply because if the group structure and the manifold structure were not compatible, then there would be no connection between them and therefore the group-theoretical properties and the differential geometry properties would have to be studied separately. Here's an example: every connected Lie group is generated by any neighborhood of the identity element. There would be no reason for this to be true if the group structure was not compatible with the manifold structure.
Comment: @peterag I see no reason to add something to what I already wrote.
Comment: I added a comment to the original question.... I'm certainly no expert - would you care to add a comment, given https://en.wikipedia.org/wiki/Hilbert%27s_fifth_problem?  Lie groups (and operations) always came with (real) analytic structure, for me, if it ever mattered.

Lie group definition


ART option in Developer mode Cause a Issue

Question: In my android phone i have a problem,i just select ART option in Developer settings.Then my phone ask me to restart your phone.I just restart my phone.Then when it starts a strange problem occur.
I was not able to type my password i click on password place many times but not at all any response.Then i type on emergency call to use numbers,a message appear that keyboard has stopped working.
I also drawn out my sim card and memory card but still the same issue.
Guys what should i do now.I have no option(not any factory data reset and my phone i think not have recovery option).
My mobile is Q mobile LT250.
Comment: ART on KitKat is an experimental runtime, so it's (unfortunately) understandable that it could be buggy on some devices. Note that using ART will increase space usage, that's why you have "low storage" message.
Comment: I can only suggest factory reset in this case, or at least try to access recovery option (e.g. holding vol up+vol down+power, or similar combination)
Comment: Also a icon of less storage is appear above,it was not before this issue.
Comment: Guys is there not any one to solve this issue?
Comment: Had you USB debugging enabled before switching to ART? There might be a shell command (which could be executed via `adb shell`) to witch back to Dalvik (I vaguely remember having seen something like that).
Comment: Thank you guys for all of you comments,before your comments i try to figure it out on google.I go through sites which told to get recovery option in many ways.Some said vol, up+vol.down+power and some power+vol.up.But any of them failed to work.
Answer: Thank you guys for all of you comments,before your comments i try to figure it out on google.I go through different sites which told to get recovery option in many ways.Some said vol. up+vol.down+power and some power+vol.up.But any of them failed to work.Then i try different combinations then finally i got That Two Options "Recovery mode"and "Factory mode ".I applied factory mode,guys i lost my all saved data but i,m happy my phone is now working fine.That method was, switch off phone after a few seconds press and hold power button.When you feel vibration then at once press both volume buttons(Both in same time).Then that two options will appear.vol.up and vol. down for scrolling.Home and left most touch buttons are for selection and starting procedure.


Is it possible to use Google Lens from the desktop version of Google Photos?

Question: I frequently use the Google Photos application on my Android phone, where I make use of the Google Lens feature there. Right now I'm managing my photos from the Google Photos web application in Firefox and I notice the Google Lens feature seems to be missing completely. I checked the Google Lens page and although this question is not addressed explicitly, it looks as if Google Lens might only available be Android and iOS? Is that really true? It makes no sense to me at all. Am I missing something or is this feature really just not available from a desktop OS like Windows 10?
Comment: I'm just commenting to get notified whenever this changes or gets solved ^_^
Comment: I've recently found that, although not exactly like Google Lens, putting an image in to Google Image search on desktop can yield similar information.
Comment: I believe now you can use the 'Copy text from image' feature on photos.google.com .
Comment: @TeddyC I don't see the option... care to submit and answer with a screenshot?
Answer: (This is the reply to Brian's comment:)
'Copy text from image' feature on photos.google.com:

(Chrome PWA on macOS, with photo redacted)


Automated testing with Ruby on Rails - best practices

Question: Curious, what are you folks doing in as far as automating your unit tests with ruby on rails? Do you create a script that run a rake job in cron and have it mail you results? a pre-commit hook in git? just manual invokation? I understand tests completely, but wondering what are best practices to catch errors before they happen. Let's take for granted that the tests themselves are flawless and work as they should. What's the next step to make sure they reach you with the potentially detrimental results at the right time?
Answer: Not sure about what exactly do you want to hear, but there are couple of levels of automated codebase control:

While working on a feature, you can use something like autotest to get an instant feedback on what's working and what's not.
To make sure that your commits really don't break anything use continuous integration server like cruisecontrolrb or Integrity (you can bind these to post-commit hooks in your SCM system).
Use some kind of exception notification system to catch all the unexpected errors that might pop up in production.
To get some more general view of what happened (what was user doing when the exception occured) you can use something like Rackamole.

Hope that helps.
Comment: The Rackamole website seems to have changed.
Answer: If you are developing with a team, the best practice is to set up a continuous integration server. To start, you can run this on any developers machine. But in general its nice to have a dedicated box so that its always up, is fast, and doesn't disturb a developer. You can usually start out with someone's old desktop, but at some point you may want it to be one of the faster machines so that you get immediate response from tests.
I've used cruise control, bamboo and teamcity and they all work fine. In general the less you pay, the more time you'll spend setting it up. I got lucky and did a full bamboo set up in less than an hour (once)-- expect to spend at least a couple hours the first time through.
Most of these tools will notify you in some way. The baseline is an email, but many offer IM, IRC, RSS, SMS (among others).


Manage files with no checked in version - CAML query

Question: I am using Office 365. We have a document library containing more than 12000+ documents, with  a number of folders and subfolders.
I need to find a way to get all document which have no checked in version.
I tried to use "Manage files with no checked in version" in library settings, but no luck since its already reached the maximum threshold.
Can anyone shed some light on this?
Answer: Not possible in client side scripting...i wasted my hours before quitting..


Do the FACs compute every speed value shown on the PFD speed scale, or only stall speed and maximum speed?

Question: On an Airbus aircraft, the Flight Augmentation Computers (FACs) control the rudder and have windshear detection, and the FACs also are responsible for speed computations. I know the FACs continuosly compute stall speed and compute the maximum speed but do the FACs also compute every other speed on the speed scale; VLS, alpha protection, alpha floor, green dot speed, flap retraction, etc., so basically the FACs compute every speed on the speed scale?
Comment: Do you have an idea of where the numbers would come from if they were not all computed?  Knowing that would help us to understand what you are asking.
Comment: @WayneConrad They can come from the FMS. In the A320 architecture, the FAC computes characteristic speeds based solely on sensor inputs like AOA, trim, altitude, fuel level. The FMS computes the same with the addition of user-input data like ZFW/CG. The FMS speeds are more accurate but are subject to user error. Which is actually displayed on the PFD depends on the model and generation of aircraft.
Answer: Yes. Kind of--the air data computers do some of the computations and display those based on hard coded limits.  For example, an ADC will compute current AOA and may have the AOA limits hard coded therein.
The air data computers also provide input to the FACs, which further limit the aircraft speed envelope based on altitude, speed, and configuration.  The FACs are necessary for configuration information and flight control positions.
A detailed explanation of the what the FACs accomplish is here.
There is a related question.
Other examples of ADCs and their respective displays appear here and here.  The first shows mechanical systems which compute a normalized AOA based, and later in the same article, a Gulfstream display shows feathers for Max AOA on the ADI, as seen here.
Comment: No, Max AOA is the same regardless of speed, altitude, bank angle, etc.  An airfoil will always stall at the same AOA.
Comment: So the FACs get all their information from the ADC and the FACs compute all the data they get and display it? Could you give me another example of an ADC computation and display?
Comment: Answer edited to include other examples of AOA displays.
Comment: I dont understand what you mean when you say the AOA has hard coded limits? Doesn't AOA limits depend on altitude, weather, speed, configuration, and so on?


VS 2010, Git, and a Solution with Multiple Projects

Question: Do I need to create a repository for each project or just one that encompasses all of the projects in this solution?
Answer: It depends if you are using a lot of shared code via libraries or services. If you are sharing libraries that you need to have at different versions, it's easier to separate them and use git submodules (via git slave, if you like). If you need the libraries to be the latest for all projects (because they access a common data store) you may be ok with one repo.
Separate repos may be easier to do access control, but gitolite is great as it can restrict by branch and many other things.
You can later join repositories and graft histories together via "git rebase --root --onto branch1". Or you can split one into many with git filter-branch.
So I wouldn't sweat it too much. You're using git for a reason. You can change your mind later and still keep the history.
Answer: You can go either way depending on your requirements, particularly how the projects are related - If projects are in the same repository it is easier to add references between them. If they are in different repositories it is easier to have different access control settings.
If the projects are in the same solution though you will definitely want a single repository.
Answer: I've worked with Git with a very large project set (200+) in which the application was a group of core projects with a lot of plug-in projects. We used Android's Repo script (http://source.android.com/source/git-repo.html) to help manage them.
It was necessary for us since we had a dozen or so plug-in configurations for different products. It is a pretty slick tool. The major drawback is the lack of documentation for repo and the horrible choice of name (not search friendly).


Development environments offered from the cloud

Question: Would cloud based development servers be a valid alternative for local development environments?
The cloud based dev environment might consist of a separate physical SQL server, and a SP dev image used to creating new dev environments quickly on the fly (for temporary developers, for example).
Has somebody tried this? How would the efficiency drop with more simultaneous developers? (I wonder if any charts exist for this etc)
Answer: That's one of the purposes of CloudShare you can use one of their standard environments of build your own and then share a snapshot of that with your developers
Comment: Cloudshare is fantastic, we use it for demos. It would even be cost effective to use it as standard dev box ($500/year/person).
Comment: Thanks. However, developing for many years with a large number of developers using CloudShare would become costly. Setting up an own cloud might work better in our scenario as we have most of the infrastructure in place already. Thus i'd ike to know more about the performance issues etc related to sp development. I wonder if CloudShare'd like to share that kinda info =)
Comment: Remember to include license costs for MSDN as well on a own setup
Comment: I suppose developers could use their own individual MSDN licenses for development.
Comment: Yes if they have them. Using CloudShare they provide the licenses. Just something you might consider when calculating the cost. But if it's for full time then a own solution os probably cheaper.


Redrawing an NSView

Question: Sorry if this has been asked before or it's a really dumb question, but I can't figure it out. I have an NSView in my interface, and I have created a subclass of NSView in Xcode. Then using the identity inspector, I set my NSView's class to be the newly created NSView subclass. The view draws fine, but now I need to redraw it to change a string inside the view. I'm pretty sure this has to do with setNeedsDisplay, but what do I send the message to? I don't have a particular instance of my view in the code, since it's in Interface Builder, so what do I do?
Again, sorry if this is dumb. I haven't done much with NSView yet. Ask for more info if you need it. Thanks!
Comment: How are you "drawing" the string in the view? With a label (AKA `NSTextField`?)
Comment: [string drawAtPoint:point withAttributes:attributes] is how I'm drawing it. I figured I could change 'string', and then tell the view to redraw.
Answer: In the view controller subclass you have, add an ivar with type of your NSView subclass. Declare a property on it, and mark it as an outlet.
// ViewControllerSubclass.h
ViewType *myView;

@property(readwrite, assign) IBOutlet ViewType *myView;

// ViewControllerSubclass.m
@synthesize myView;

Now you have an outlet, connect it to the view you designed via IB. To do so, right click in IB on your view controller subclass (the file's owner), you should see the outlet in the list.
Once you have done that, you are now able to send messages to the view in your code.
To mark the view as needing redraw :
[myView setNeedsDisplay:YES];

Redrawing an NSView


How do I prevent AppleScript from using short numbers?

Question: So AppleScript by default uses the exponential notation of numbers - for example, 2.99E+68.
How do I prevent that from happening? I want the number written out as it is.
Answer: An AppleScript function convertNumberToString is provided by Apple.
Mac Automation Scripting Guide: Manipulating Numbers

Converting a Long Number to a String
In AppleScript, long numeric values are displayed in scientific notation. For example, 1234000000 is displayed by a script as 1.234E+9. When this value is coerced to a string, it becomes: "1.234E+9". The handler in Listing 20-3 converts a number, regardless of length, to a string of numeric characters instead of a numeric string in scientific notation.
on convertNumberToString(theNumber)
    set theNumberString to theNumber as string
    set theOffset to offset of "E" in theNumberString
    if theOffset = 0 then return theNumberString
    set thePrefix to text 1 thru (theOffset - 1) of theNumberString
    set theConvertedNumberPrefix to ""
    if thePrefix begins with "-" then
        set theConvertedNumberPrefix to "-"
        if thePrefix = "-" then
            set thePrefix to ""
        else
            set thePrefix to text 2 thru -1 of thePrefix
        end if
    end if
    set theDecimalAdjustment to (text (theOffset + 1) thru -1 of theNumberString) as number
    set isNegativeDecimalAdjustment to theDecimalAdjustment is less than 0
    if isNegativeDecimalAdjustment then
        set thePrefix to (reverse of (characters of thePrefix)) as string
        set theDecimalAdjustment to -theDecimalAdjustment
    end if
    set theDecimalOffset to offset of "." in thePrefix
    if theDecimalOffset = 0 then
        set theFirstPart to ""
    else
        set theFirstPart to text 1 thru (theDecimalOffset - 1) of thePrefix
    end if
    set theSecondPart to text (theDecimalOffset + 1) thru -1 of thePrefix
    set theConvertedNumber to theFirstPart
    set theRepeatCount to theDecimalAdjustment
    if (length of theSecondPart) is greater than theRepeatCount then set theRepeatCount to length of theSecondPart
    repeat with a from 1 to theRepeatCount
        try
            set theConvertedNumber to theConvertedNumber & character a of theSecondPart
        on error
            set theConvertedNumber to theConvertedNumber & "0"
        end try
        if a = theDecimalAdjustment and a is not equal to (length of theSecondPart) then set theConvertedNumber to theConvertedNumber & "."
    end repeat     if theConvertedNumber ends with "." then set theConvertedNumber to theConvertedNumber & "0"
    if isNegativeDecimalAdjustment then set theConvertedNumber to (reverse of (characters of theConvertedNumber)) as string
    return theConvertedNumberPrefix & theConvertedNumber
end convertNumberToString

Comment: just tobe sure, will this work even when I need to work with it as a number afterwards?
Comment: @Prokop If you want to work with it as a number, just keep it as the original number and work with that until you want to output it as a string.
Comment: a'ight, thanks. mind checking out my other unanswered question as well?
Answer: You can coerce the number to a unit of measurement and then into a string, like this:
1.2345E+9 as inches as string

which will return "1234500000".
You can use any unit of measurement, such as kilograms, cubic centimetres, gallons, degrees Kelvin etc.
Comment: What does inches etc add to the expression? I don't see any inch symbol `"` and when I myself test with different units the result is the same, independently of the unit.
Comment: @d-b Yes, that's correct.  There's no symbol for any of these units.  They're class object specifiers used for conversions.  I chose `inches` as it has the fewest letters, but isn't otherwise special in and of itself.  However, the act of coercing between types using a measurement unit class as an intermediary _is_ special.  As for _why_ this would be or should be the case, I don't know. It may not be a feature that was intended to be part of AppleScript, but rather a bug whose consequences are advantageous rather than detrimental (it wouldn't be the only example of such a phenomenon).


SQL ID Problem with order by ID DESC

Question: i using in my application IDs with 5 Digits (11000, 11001...), but now i wont to use 6 Digits (110000, 110001...)
So the Problem is the ordering! 11010 is bigger then 110000 what can i do?
Thx
Answer: It sounds like you are storing your IDs as strings (varchar) rather than as a numeric type. Can you not use a numeric type?
If not then is it an option to update all existing IDs and prefix with a zero, e.g. "11010" becomes "011010"?
Answer: I think your id column is varchar it schould be int
but maybe did can help you
http://support.microsoft.com/kb/209632
to order string as numeric

SQL ID Problem with order by ID DESC


Will an egg hard boil faster at higher heat?

Question: The water in a pot of water will boil at $100°\text{C}$ regardless of how much heat is applied to it after it begins to boil. The higher the heat, the faster the water boils off (but at $100°\text{C}$). The water is getting more thermal energy and dissipates into steam more quickly. Will a fully immersed egg hard boil faster, similarly absorbing more cooking heat energy per second at high heat vs. a low boil? Or, is the hard boiling time only affected by the temperature of the water the egg is immersed in?
Comment: Does this answer your question? [If you submerge a bottle of water in a boiling pot of water, why doesn't the water inside the bottle start to boil as well?](https://physics.stackexchange.com/questions/127429/if-you-submerge-a-bottle-of-water-in-a-boiling-pot-of-water-why-doesnt-the-wat)
Answer: Water is a good conductor of heat, but the heat is transferred much more rapidly by convection (i.e. bulk motion of the water).  High heat input will cause very active convection (enhanced by steam bubbles in a "rolling boil"). The rapid motion and turbulance in the water will disturb and thin the boundary layer around the egg surface. The boundary layer is a region of laminar flow where the temperature transitions from the egg surface temperature to the boiling water temperature.  When the boundary layer is disturbed, boiling water will get very close to the egg surface and the heat transfer will be more rapid.
High heat input does not actually make a big difference to the cooking time because the heat still has to travel through the material of the egg itself.  There are membranes in the egg and anyway the protein coagulates and prevents convection in the egg.
Answer: A rapid boil will have a higher percentage of the egg's surface area in contact with the higher temperature steam bubbles at any given moment. This will heat the egg slightly faster than a slower or simmering boil.


Maintaining the size and position of the Control in the form

Question: I want to maintain size and position of the control relative to its container eg,size and position of the richtextbox in the form should be maintained when form resize.
Answer: If I understand you correctly, you need to use the Anchor property.
Have a look at Control.Anchor Property.
Answer: If you have more complex designs, just a anchor and docking is not enough. Imagine you have two textboxes and while resizing you like that both boxes grow and shrink (by 50% for each one). In that case you can use the TableLayoutPanel with relative sizes and within these panels you arrange your controls with anchoring and docking.
Another helpful thing: In a more complex design you should take a look into View - Other windows - Document Outline, while you're in Design View and you get a great overview about where which control resides.
Answer: Use the 'Anchor' property of the control. Set it to Top, Left, Right, Bottom accordingly to anchor it's edges to the form as required.
Answer: You can use the anchor property which will allow you to lock the edges of your control relative to the windows edge.
This is what the designer adds in when setting Top, Bottom, Left and Right
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
Alternatively a docking panel can be useful in keeping controls docked to one side of a window.


Will symbol size impact buffer size?

Question: I'm using ArcMap 10.1. I want to create buffers that represent CO2 equivalent from landfills.  I used graduated symbols to label each landfill site, based on amount on incoming waste per year.  Will the size of the symbols impact the size of my buffers? Or do buffers always measure diameter from the centroid of the point?
Comment: Have you tried testing your theory that the symbol size may matter by running the same size buffer on a point with a massive symbol and another with a tiny symbol and pulling out the Measure tool?
Answer: Points have no size, so any buffer is measured from the centroid of the point and symbol size has nothing to do with buffering.
You can test this by creating a point and setting a small symbol and buffering by 5m, and then changing the symbol to something very very large and buffering again by 5m.  When you measure the diameter of the buffer polygons you will find that both polygons will be the same diameter - 10m.

Will symbol size impact buffer size?


What do I do with this csv dataset I just downloaded from dbpedia?

Question: I just downloaded this csv of infoboxes of wikipedia from dbpedia. However I have no idea how to use it :-S I want to import all this data into a database but am not so sure how to take it from here. I downloaded it from http://wiki.dbpedia.org/Downloads32#infoboxes
I'm working in Php

Just for the record - this csv file is around 1.8 GB. I'm actually going through all this trouble for well just to get a select set of infoboxes from a select set of articles form wikipedia. I would do it manually except I need the infoboxes for over 10 000 entries which includes countries and cities. I'm just looking for an easy way to do this and frankly have been using all my options :(
Answer: To import CSV data into MySQL you can use a LOAD DATA INFILE statement, e.g.
<code>LOAD DATA LOCAL INFILE '/importfile.csv'
INTO TABLE test_table
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(field1, filed2, field3);
</code>
Sometimes such data might need a little massaging, it's not tricky to write a script in Perl or similar to parse a file line by line and spit out SQL statements.
Answer: If you want to massage the data before importing it, you could take a look at my CSV stream editor, CSVfix - it's FOSS. It can also generate SQL INSERT statements for your database if for some reason your database's bulk loading of CSV data doesn't suit you.


epi-mono factorization in regular categories

Question: I know that in a regular category, every morphism $f$ can be factored as $f=ip$, with $i$ a monomorphism and $p$ an epimorphism. In abelian category, the codomain of $p$=domain of $i$ is the cokernel of the kernel of $f$. Assuming the existence of kernels and cokernels, is this true also in regular categories? If yes, I would also be interested to a sketch of the proof.
Comment: Those where $p$ is regular (or even strong), yes. But for example the injection $\Bbb Z\to \Bbb Q$ is both an epi and a mono in the category of rings, so it has at least two non-isomorphic factorization as an epi followed by a mono.
Comment: I guess you mean "regular epimorphism" instead of just "epimorphism"? Otherwise, your question would not really make sense, since there can be more than one epi-mono in general.
Comment: yes , I meant regular. But if I have many, are they isomorphic, aren't they?
Answer: It's not necessary true in any pointed regular category : for example, in the category of monoids, the addition map
$$p:\mathbb{N}\times \mathbb{N}\to \mathbb{N}:(x,y)\mapsto x+y $$
is a regular epimorphism, since it has a section; but it is not the cokernel of its kernel, because said kernel is simply $0\to \mathbb{N}\times \mathbb{N}$, whose cokernel is the identity.
What is true, however, is that if $f=ip$ with $i:I\to Y$ mono and $p:X\to I$ a regular epi, then $p$ is the coequalizer of the kernel pair of $f$. Indeed, any epimorphism is the coequalizer of its kernel pair, and since for any two parallel arrows $u,v:W\to X$ we have $fu=fv$ if and only if $pu=pv$, $p$ and $f$ have the same kernel pair.
Comment: It's certainly true that any cokernel is the cokernel of its kernel. The map $p$ is just not a cokernel.
Comment: I was convinced that in ANY category (with kernels and cokernels), every cokernel is the cokernel of its kernel, as proved here: https://math.stackexchange.com/questions/2185870/in-an-abelian-category-every-kernel-is-kernel-of-cokernel in the dual case of kernels. What am I missing?


How do I view $k$ as $kG$-module?

Question: How could I view $k$ as $kG$-module? Does $kG$ acts on $k$ by $rg\cdot r'=rr'$, just ignore $g$? Could we do that?
Answer: Yes, Hopf algebras generally act on the field via the counit which in the case of group algebras can be defined as the linear extension of the map $$\epsilon:\mathcal{G}(kG)\longrightarrow k$$ $$x \mapsto 1_k$$ where $\mathcal{G}(kG)$ denotes the set of all group-like elements, that is, elements $x\in kG$ such that $\Delta (x)= x\otimes x$, where $\Delta$ denotes the comultiplication. Note that this set can canonically be identified with the set of elements of the group $G$ itself.

How do I view $k$ as $kG$-module?


how to replace the MR-16 bulb from this lamp fixture?

Question: I am wondering how to open this lighting fixture to be able to replace the MR-16 bulb.
The fixture seems smooth with no openings or bolts. It is a bi-pin halogen MR16 bulb. The is a indented ring in front of a glass plate protecting the bulb. Everything seems really air tight with no moving parts.
A real mind boggler!
thank you.
Melvin
Comment: Hi Melvin, it looks like you've accidentally created 2 accounts. See [this article](https://diy.stackexchange.com/help/merging-accounts) for help merging your accounts, this will let you edit your question more easily and accumulate reputation points.
Answer: I've seen a few fixtures like that.  See that tabbed ring around the outside of the face of the bulb?  Try compressing it with needle-nose pliers right where the missing tooth is.  It should pull out and then you will be able to pull the bulb out.
Installation is the reverse of removal. :) It should just snap in after the pins of the bulb are seated.
Comment: @melvin your questions about this answer should go here, not as a new answer.  I will answer here as if you asked it here.   I do not think this answer means to push "out".  I think it means in.  Where there is a missing tooth, you push the two adjacent ones toward each other.  That's what the answer says and it makes some sense.  You can use any tool that allows you to do that.  Maybe even your fingernails.  Just try it!
Comment: If it's like the ones I've seen, that ring is a metal spring clip. It uses tension against the outside rim of the light fixture to stay in. The right-angle tabs hold the edge of the bulb in. By grabbing the two teeth surrounding the missing one and pressing them toward each other, you release the tension and then you should be able to work it out toward you. Once that's out of the way, you can pull the bulb with a suction cup or by just working it from the back with something narrow.
Comment: Apparently its general case is an "internal circlip".  If you haven't read enough about them yet look [here](https://www.industrialautomotiveparts.com.au/blog/2021/08/13/circlip-charts) and [here](https://www.engineeringchoice.com/retaining-rings/).
Comment: Hello thanks for the quick responses. Does compressing the rig mean inserting the plyier and pushing out between the open teeth to spread it open flat to the glass? Is it a rubber ring you think? Thanks.
Answer: Assuming these are push-in, two pin bulbs, you don't need to take it apart.
Use a small suction cup to pull the lamp out from its face.
Use a small wooden stick stuck between the louvers to push the bulb out from behind.
Use a plastic (non conductive) screwdriver stuck under the base of the lamp, through the louvers, to pry it away from the fixture.
Maybe the louvered part of the fixture unscrews from the domed part of each bulb holder.  That would make it easier.
Comment: If the other answer is correct I need to delete this one.  :)
Comment: Usually MR 16 are open that hade a bubble lens so the spring clip is the more likely answer if not screwed together.


Javascript: client-side webservice with

Question: I'm trying to implement sort of client-side webservice client.
To get over the same server policy, i'm thinking of including the external page whose content I need to read via the

Javascript: client-side webservice with


Acceleration of radio waves

Question: Is it possible to accelerate the speed of radio waves? If so then how? Radio waves go at the speed of light.
Comment: Do you know special relativity?
Comment: @JMLCarter Actually, the OP needs general relativity because gravity can accelerate photons (light gets bent? ;))
Comment: I don't think that's necessary, (I got it form special in my day). SR shows you how equal changes in k.e. make increasingly small difference to velocity as c is approached.
GR would probably help too, but it's slightly more difficult in some ways.
Comment: I think the OP asked for the acceleration of light but not acceleration of objects which are approaching the speed of light.
Comment: Possible duplicates: http://physics.stackexchange.com/q/20289/2451 and links therein.
Answer: You put a block of dielectric material in its path. When the wave enters the material the speed reduces to the material speed of light. When it exits speed goes up again. In the broadest sense of the term 'acceleratiom' this would be it.
Answer: Nope. Radio waves are oscillating EM radiation at a constant velocity of $3 \times 10^8 ms^{-1}$ in a vacuum. That is the speed limit.
$300 000 000 ms^{-1}$ is actually a round-off figure.
According to text books on the subject, the exact figure is $2,9978 \times 10^8 ms^{-1}$.
However, this error factor is so small (less than $0.001$ percent) that $3 \times 10^8$ is normally used for general purpose.
Comment: Isn't the question "can they be accelerated", rather than can they travel faster than c?
Comment: @Clive Welcome to Physics SE!  The speed of light does not change but the direction can change. [General Relativity](https://en.wikipedia.org/wiki/General_relativity)
Comment: Please use mathjax to format mathematical expressions. To learn more about mathjax, please read [MathJax basic tutorial and quick reference](http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference).
Answer:
Source: Electromagnetic Spectrum (Wikipedia)
The electromagnetic wave spectrum consists of vaguely defined categories as shown in the picture. Radio waves are a part of it.
In the quantum world, the electromagnetic radiation is carried by a stream of photons. These photons are said to have zero rest mass within the limits of experimental error. A particle having zero rest mass must travel at the speed of light.
We have the following equation from Einstein which holds good in all frames of reference:
$$p = m_ov\gamma = m_ov\frac{1}{\sqrt{1-\frac{v^2}{c^2}}} \tag{1}$$
We also have another equation from Einstein which relates $p$, $m_0$ and $E$:
$$E^2 = (m_oc^2)^2 + (pc)^2 \tag{2}$$
where $m_o$ is the rest mass of the particle, $c$ is the speed of light, $p$ is the momentum of the particle and $v$ is the velocity of the particle.
Since the photon is massless, we get $p$ to be:
$$p = 0 \times \frac{1}{\sqrt{1-\frac{v^2}{c^2}}}  \tag{3}$$
If $p$ is zero, then from equation $(2)$, you get $E$ to be zero.
$$E^2 = (0\times c^2)^2 + (0\times c)^2 = 0$$
A particle with zero momentum and zero energy cannot be detected because it does not interact with other particles. For example, if a particle with zero momentum collides with another particle, the particle will not alter the momentum of the other particle if it has to always have zero momentum. We are not interested in undetectable particles for obvious reasons.
So photons don't exist? If you check equation $(3)$ again, you'll notice that if $v = c$, you get a $\frac{0}{0}$. This being indeterminate allows $p$ to take any value (there is one value but we cannot calculate it using equation $(1)$; that's what it means).
We know that photons do have momentum and carry energy. Therefore, we can safely conclude that photons travel at the speed of light ($c$).
If the photons travel at a fixed speed, does that mean that the acceleration of photon must always be zero? Not necessarily. Light can change direction. From general relativity, we know that light gets bent by gravity. By our classical definition of acceleration, light can be told to be accelerated but, however, light is actually moving along the curvature of spacetime, so saying that light is accelerating is not really correct.
Check this question to get an intuition about light moving in space.
Comment: Yashas, there are some inaccuracies in your answer. Light follows a geodesic path due to surrounding matter and this isn't an acceleration. Also, it is a weakness to conclude something in circles. It was **measured** that light has a unique speed all other the spectrum and from this the theory about the massless of photons and the equation (2) were derived. Also you can't say "These photons are said to have zero rest mass within the limits of experimental error." because nobody never weighed a photon. Per **intuition** a particle carrying momentan has to have a mass. Science decided otherwise.
Comment: I added the word 'classical' before acceleration and also a bit about light moving along the curvature of spacetime. Maybe it is bad to mix theories up. Probably that fix of adding 'classical' was also wrong. By experimental error, I meant, our measurements which when plugged into the equations indicate that there isn't much (if not zero) rest mass. What was the circular argument?
Comment: Yes the circumference was about that it could not derived from something that light has to move with c.

Acceleration of radio waves


"call out" vs "call in"

Question: When I am ill and cannot go into the office to work I say "I called out sick". I now live in Texas and people like to correct me and say that it's "call in sick".This doesn't make sense to me. Is it a regional thing, like ya'll vs. you guys?
Comment: I've always heard "called in sick" (in Kentucky and Minnesota).  You're calling "in" to the office.
Comment: We usually say "call in" in Australia.
Before the days of text messages it was literally a phone call to the place of business, so "call out" makes no sense to me (although I have occasionally heard it that way on American TV). Where did you live before Texas?
Comment: Where are you from? I would consider *call in sick* to be universal in American English. I've never heard *call out sick*. Maybe there are regional differences, like *stand on line* vs *stand in line*...?
Comment: It's normal in British English too.
Comment: To "Call out" compresses the *calling* with stating you'll be *out* sick: Lee called out in the morning.
Comment: call in sick or **be out sick**, no calling with the latter.
Answer: Apparently, both call in sick and call out sick are used and there is a regional difference in usage in U.S. English. Based on a poll where 7493 US adults surveyed, calling in sick is the most popular phrase in the United States and regionally most popular in the Midwest, while calling out sick is most popular in the Northeast, and possibly used in New York area also.

Source: today.yougov.com
I believe call in sick is the phrase used in British, Australian, New Zealand and Canadian English also. Personally, I've never heard or used call out sick before, mainly in Canadian English and talking to people from the UK, the US, NZ in business settings.
OED provides both phrases and the earlier one is call in sick. Here are the definitions and the earliest citations from OED:

to call in
5. Originally U.S.
c. intransitive. With adjectival complement: to contact one's employer, school, etc., typically by telephone, to report one's absence that day, esp. due to illness; esp. in to call in sick.
1943   Washington Post 3 July b1   This being a holiday weekend, employees in Treasury's loans and currency section..were warned yesterday not to call in sick either today or Monday under any circumstances.

to call out
8. intransitive. Originally and chiefly U.S. To contact one's employer, school, etc., typically by telephone, to report one's absence; chiefly with complement, esp. in to call out sick.
1976   Sentinel & Enterprise (Fitchburg-Leominster, Mass.) 16 Apr. 1/6   Bray said no one called out sick in the DPW at all this week..[due] to his demands that anyone out sick must have a doctor to certify illness.
Comment: Nice Statistics , +1 , I have this "Observation" : When considering the age , that has the ratio 61:15 for the group "55+" which gradually reduces to the ratio 35:29 for the group "18-24" , indicating the change in meaning , over the Decades !
Comment: You cite: "his demands that anyone out sick"  but not call out sick.
Comment: Those definitions say both are originally American English.
Answer: I'm 34 and from Massachusetts and calling "in" sick sounds very strange to me. You're calling out sick to say you will be out of the office that day. Calling in sick sounds like you're sick and "calling in" by phone or video call for a regular work from home day. I do understand that calling something in means to call and give a report about something though (calling work about your sickness or calling the city when a tree is blocking the road, for example)
Comment: You call in to say you will be out sick. But, I'm from where you are and call in sick is pretty standard.
Answer: If I am in the office, I'd say: John called in sick.
OR
If I am in the office, I'd say: John called to say he was out sick.
I might call the office and say: I'm calling in sick.
**I would never say "call out" sick.
Summary:
To call in sick
To be out sick
Reference: logic
Answer: Word Web gives :

call in

Make a phone call

call out

Challenge to a duel

[[ these 2 are the meanings relevant to the Post ]]
Unless you want a confrontation , use "call in" to take time off.
If you want to fight with your Boss who is not letting you take time off , then use "call out" to start a verbal fight.

"call out" vs "call in"


Avoiding Nested Subscriptions and Passing Values to Error Handler

Question: Is it possible to change the property of an emitted value from a Subject before passing it to another Observable? For example:
this.subscriptions.push(this.myService.mySubject.subscribe(value => {
    value.property = true;
    this.subscriptions.push(this.myOtherService.myMethod(value.propertyTwo).subscribe(value => {
    // do things with value
    });
}, (error) => {
    // how can I still access said value in the error handler?
});

I push my subscriptions to a private subscriptions array so that I can unsubscribe from them in my ngOnDestroy. I'd like to get to get rid of the nested subscription in this case and was wondering if it was possible to do so?
Also, how can I still access the value variable in the error handler of my subscription?
Thanks
Answer: Chain them up with switchMap and handle error with catch. In well written observable chains usually you don't need many subscriptions
this.subscriptions.push(this.myService.mySubject.switchMap(value => {
value.property = true;
return this.myOtherService.myMethod(value.propertyTwo)})
.catch(e=>Observable.of(e)).subscribe())


netStream with groupSpecifier not sending handler, FLEX

Question: I have a simple video/chat application built in FLEX. I've created a groupSpecifier, netGroup and a NetStream for the different functionalities.
NetGroup is mainly used for the messaging (Posting) and keeping track of the users who enter.
NetStream is (or would be used) to control some functions like "start video, stop video" for everyone under the same group.
The most important functions I will post on here. The first is setupGroup.
private function setupGroup():void{
    var groupspec:GroupSpecifier = new GroupSpecifier("vid"+GROUP_ID+"_sid_"+SESSION_ID);
    groupspec.serverChannelEnabled = true;
    groupspec.postingEnabled = true;
    groupspec.multicastEnabled = true;
    groupspec.ipMulticastMemberUpdatesEnabled = true;

    trace("Groupspec: "+groupspec.groupspecWithoutAuthorizations());

    netGroup = new NetGroup(nc,groupspec.groupspecWithoutAuthorizations());
    netGroup.addEventListener(NetStatusEvent.NET_STATUS,netStatus);

    netVideo = new NetStream(nc,groupspec.groupspecWithoutAuthorizations());
    netVideo.addEventListener(NetStatusEvent.NET_STATUS,netStatus);

    user = "user"+Math.round(Math.random()*10000);
}

The second is sendMessage
private function sendMessage():void{

    var message:Object = new Object();
    message.sender = netGroup.convertPeerIDToGroupAddress(nc.nearID);
    message.user = txtUser.text;
    message.text = txtMessage.text;

    netGroup.post(message);
    receiveMessage(message);

    txtMessage.text = "";
}

And then startVideo
private function startVideo():void{
    netVideo.send("publishVideo");
    ns.togglePause();
}

There is another function called "publishVideo" which I hope would be called for the rest of the members in the group, but this is not happening.  Most of this code is straight from the example Tom has provided from http://www.flashrealtime.com. Any help / suggestions would be appreciated!
p.s. I am not using group object replication because of the latency.
Answer: Answer is prosaically simple.
You need to start video with:
netVideo.publish("channel");

NetStream.send() is for invoking callback method on receiver NetStream.client object.
http://www.flashrealtime.com/multicast-explained-flash-101-p2p/


reclaiming exhaust from 'on demand water heater'

Question: Is there some way to recover the heat which is lost through the exhaust system from a 'on demand water heater' ?
Comment: Many of the newer models are so efficient, that there is hardly any heat loss through the exhaust. If the exhausted through PVC, then it would probably not be worth trying to capture the heat loss.
Answer: It is generally not worth the time and money to try to capture the lost heat through the exhaust system of the vast majority of tankless/on-demand water heaters. The heaters are now so efficient that they can vent the exhaust through plastic (PVC) pipe.
Since these heaters also only operate when there is a call for hot water, they do not run very often. Compare this to a traditional water heater that needs to keep many gallons of water in the tank at a certain temperature all the time.
Because a tankless system only runs on demand, and is extremely efficient when it runs, there is very little heat loss from this type of system. It would not be economical to modify the system to glean the tiny bit of lost energy. It would most likely take decades just to break even from this sort of modification.
Comment: Depending on the layout and insulation of your system, and whether you use a timer (the norm here in the UK), stored hot water systems can be pretty good.
Answer: Modifications to the flue are likely to be unwise and may be counterproductive or cause your heater to be dangerous or fail any safety checks.
There are fairly strict back pressure requirements for proper function. Even some models from 20 years ago recaptured some of the waste heat into the incoming air (concentric balanced flue).