What are good methods for tuning the process noise on Kalman filters?

Question: Most often tuning the Kalman filter noise matrices is done by trial and error or domain knowledge. Are there more principled ways for tuning all the Kalman filter parameters?
Answer: You can get experimental data, and perform some statistical analysis to determine the process noise (noise between time steps), and sensor noise (compared to a ground truth).
To get the ground truth for sensor noise, you either need a more accurate sensor, or else experimentally test while keeping the state of interest at a known (usually fixed) value.
If you do not have experimental data, you can use the datasheets or specifications for each sensor to determine its noise. The process noise would be more difficult in this instance, but you may be able to guess at its value by assuming a certain amount of noise due to, for example, an actuator, if the actuator is the primary source of process noise.

Another way is to consider the maximum settling time allowed for estimation. This will determine the ratio between the process noise and sensor noise. This allows you to have the maximum filtering effect while meeting your settling time requirements.
Note that this does not provide a good way to tune the ratio between different sensors, or between different states, so is not perfect.

Basically, if you have experimental data, you can obtain optimal performance. Otherwise, you can only calculate process noise based by assuming the likely noise of the dominant contributor to process noise, or by determining what minimum performance is required (which is not optimal, but at least gets what is needed).
Answer: In the field of machine learning, we look at a Kalman filter as an inference algorithm on a latent variable model. The measurements are visible, but the true state is hidden. You now want to infer the true states.
As usual, this method relies on a set of parameters and -- in principle -- the way to obtain the best point-estimate for the parameters is to look at the likelihood for the data (given the parameters) and optimising your parameters to obtain the maximum value. This gives you the maximum likelihood estimate.
Unfortunately, in the case of the Kalman filter, this approach is not so easy and intractable to do in closed form. This is because we do not observe the hidden states. Therefore, one has to apply some tricks. One of them is to use the Expecation Maximisation (EM) Algorithm, which is an iterative approach: In the first step, you calculate the most likely value for your hidden states (the expected value) under your current parameters. In the second step, you keep the hidden states fixed and optimise the parameters to obtain the solution with highest likelihood. These steps are repeated until convergence.
You can read up on the general concept of EM in a whole bunch of text books on machine learning (only one example: "Bayesian Reasoning and Machine Learning" by David Barber). The process of inferring the parameters for linear dynamical systems (which gives you the Kalman filter type of model) is well described in a tech report by Zoubin Ghahramani and Geoffrey Hinton.
Answer: You might want to read "A Tool for Kalman Filter Tuning" by
Bernt M. Åkesson, et. al.  It describes the autocovariance least-squares (ALS) method.


Electric potential energy of a charge

Question: Potential energy is the work done by the particle against a conservative force. Isn't it?
when a charge is fixed on a free space and then when we bring another charge from infinity to a distance r from the first charge a work was done against electric field force so it gains some potential energy. But as of now the first particle also has a potential energy. Since no work was done on the first charge against the electric field force which was given by the 2nd charge as it didn't move how can we tell that the 1st charge also got a potential energy?
Comment: Possible duplicate of http://physics.stackexchange.com/q/218247
Answer: In your first case you said you were bringing a charge B to the first charge lets say A. Here your reference is A thats why u say you are bringing it to A.
Think of it the other way, put you reference on B then your perception would be you are bringing A to B and now A will have a Potential energy.
Thats how it works both ways.
And Finally i would like to correct you, all this while you were talking about Potential Difference and not potential energy check out the difference for yourself.
Comment: ok I just have one doubt on the situation i mention If the potential energy of B is the work done against the force from A (let the potential energy U) B's PE is U and A's PE is U but the total energy of the system is half of the sums that means (U+U)/2=U or is the total U but the individual energy of every charge is not U.  which one is correct?
Answer: The potential energy is related to a system not to an individual charge.  So when you bring one charge towards another charge the system of two charges gains potential energy.
What this means is that any work which is done by either or both of the charges will result in the loss of potential energy of the system (both charges).
Comment: can we tell specifically what is the potential energy of every particle in the system? or is it not distributed among them?

Electric potential energy of a charge


Can animals train to be noticeably stronger, faster, more agile... than other animals of the same species?

Question: Humans have a huge variation in physical ability because of exercise differences. Olympic athletes are a number of times stronger than average people on the street. It seems that variation in animals is very small, but I am wondering if one could force an animal to follow a specific program and eat specific food to get a lot stronger, agile, etc. than an average animal of the same species.
Answer:
Can animals train to be noticeably stronger, faster, more agile.. than other animals of the same species?

Yes, of course!
Humans are animals, so yes! But even in non-human animals. You can look for example in a tutorial on how to train a dog (or a horse) for specific skills (speed, high jump, long jump, etc...).

It seems that variation in animals is very small

Such a general statement can only be wrong. Consider dogs as an example. The fastest dogs go at 72 km/h (~45 mph) while many dog breeds barely reach 5 km/h (~3 mph; and they're all considered as the same species). So, there is a lot of genetic variation among dogs.
Now when it comes to variation caused by training it is a little harder to estimate. Consider having a look at Guy and Snow (1977), McKeever et al. (1987), Evans and Rose (1987) and Rivero and Piercy (2008). For what it is worth, note for example that trained racing horse can go up to 70km/h while most horses can go only up to 40-45 km/h. There are a number of studies showing the effect of training on horses.
Comment: I don't think that dog breeds are a great example. Clearly, breeds differ substantially due to *genetic differences*. It doesn't take much thought to understand that certain anatomical features would be better suited for fast running, say. However, the OP is looking for differences *due to training/exercise/diet*. It doesn't matter that they are in the same species, the differences are still due to non-training related causes. Therefore, I think that it would be better to use an example of variation *within* a breed (Although, even this could be partly due to genetic differences)-
Comment: @Eff Highly agreed! If you want to use dogs as an example then take two same sex pups from the same litter and provide a life of luxury to one but take the other on for police K-9 training and five years later let them play and I am positive you will notice great differences.
Comment: @Eff The claim I was responding to was `It seems that variation in animals is very small`. I indeed considered a case where a fair part of the variance is likely genetic. I never meant that the observed difference between a chihuahua and a greyhound is caused by training. But I very much agree that this is a confusing phrasing, so I clarified that I talked about genetic variance and added a paragraph with papers on the effect of training in horses. Thanks for your comment!
Comment: @Remi.b Okay, there is no disagreement then. And yes, your edits clarify things a lot.
Answer: When I visited the Cheetah Outreach Center in South Africa, the guides there told us that their captive cheetahs couldn't run nearly as fast as wild ones, and that wild ones were much more muscular than the ones in the center; their point was that actually having to run full-out or starve caused much more rigorous training than occasionally jogging after a fake rabbit on a string. That's supported by this article:

The cheetahs being studied didn't come close to the speeds reported for wild cheetahs — the zoo animals reached 38 mph (61 kph), while the greyhounds topped out at 43 mph (68 kph).
The researchers said this was probably because the captive-born cheetahs have never really gotten the chance to let loose in the wild and run full throttle.
"They have lived in a zoo for several generations and have never had to run to catch food. They have probably never learned to run, particularly," Wilson said.

Cheetah Speed Attributed To Animal's Ability To 'Switch Gears' While Running
Comment: In other words, animals in the wild *are* training like they are Olympic athletes,
Comment: @ArcanistLupus It's almost like they trained as hard as if their lives depended on it... :)
Comment: I once visited a zoo that had a large enclosure for cheetahs, and "feeding" the cheetah entailed hooking meat on to a zip wire running across the enclosure's longest side. The meat hook was then propelled at high speed along the zip wire and the cheetahs had to "chase" it in order to eat. The idea was to simulate hunting to provide physical exercise.
Comment: Related question https://biology.stackexchange.com/questions/40367/how-do-crocodiles-stay-fit
Answer: Definitely when it comes to horses. They are selectively bred for generations to work in different sports: dressage, show jumping, endurance, racing and so on. As one example: to train a horse for olympic level dressage takes ten years or more in order to build muscles and coordination.
Some example of horse sports, several of them describes how horses are trained:
https://en.wikipedia.org/wiki/List_of_equestrian_sports#Olympic_disciplines
Comment: Welcome to Biology.SE! Thank you for answering the question. I'm not sure, though, what the link to a list of horse sports does to help support or add to your answer.
Comment: Even our ordinary trail-riding horses will be out of shape in the early spring, and will get tired doing rides that they can easily handle later in the year.
Answer: Wild animals may have less variation in traits such as speed of running, if they predominantly eat similar diets, and if the slow ones are regularly getting eaten and failing to breed. Wild animals likely run at around the optimal speed for their environment.
The process of training implies some level of domestication - humans protecting the animals, perhaps modifying their diet, and expecting them to perform a service in return.  In this situation, the animal's day-to-day activities would likely change, together with the change in diet.  Animals' physiology tends to be able to change substantially in response to these kinds of environmental and behavioural changes (phenotypic plasticity).
So I guess the answer is yes to whether animals can be trained to perform differently, but the question of whether they would want to is maybe open.
Comment: One could argue that it isn't a matter of wild animals having "less variation" but rather that the variation is harder to observe because the weaker ones are so much less likely to survive.
Answer: There are actually two questions here:

Can animals train to be noticeably stronger, faster, more agile...
than other animals of the same species?'

As a couple of others have stated, yes.  This is, in fact, evident in horse racing, dog racing, dog agility course competitions, and a few other similar competitions.  If animals couldn't be trained to become stronger/faster then those sports would not exist as they are.

Is there natural variation in strength/agility/speed/etc in animals they way there is in humans?

This question is implied by your statement "It seems that variation in animals is very small..."  In fact, statistical analysis asserts that virtually every measurable difference between organisms falls on a Normal Distribution (see also Bell Curve).  However, this only works if we compare like populations, or "apples with apples".  For example, I certainly would not compare a bull dog's running speed with that of a whippet (racing dog similar to a greyhound, and a cool Devo song).  But if I compared all whippets then they would be normally distributed.  Now, if I had a trained whippet vs a non-trained whippet then we are again going to run into problems (see point 1).
Here is the thing with the normal distribution though, 68% of the population lies within 1 standard deviation of the average.  This means that over 2/3 of the population is pretty close to average.  Further, 95% of the population lies within 2 standard deviations of the average.
Here is a slightly more realistic example of this:  The average height of men worldwide is roughly 5'10" and the standard deviation is roughly 3".  Thus 68% of men worldwide are between 5'7" and 6'1" tall.  (Yes, I'm rounding these numbers a bit but you get the point.)  You can do something similar with weight, strength, etc, though certain attributes are difficult to measure.
What does this really mean?  Well, the natural speed of say a cheetah in the wild is normally distributed.  That is, if we could measure them all.  However, in the wild, not all cheetahs survive.  As part of survival, only the fastest and strongest survive so what we actually have is a much smaller set.  This is why animals might appear to have less variation.
If you look then you can see the variations in nature.  Go to a park and stop and look at the pigeons.  Some are actually quite fat while others are not.


No Java Applet support for Mac OS-X on Chrome 10.7.5 after 2012-006 update

Question: Since the 2012-006 update to Apple Java, the Java Preferences pane has disappeared. Apple says that you install the latest version of Java from Oracle in order to reinstate support for Applets. But the JRE 7 is 64 bit only and explicitly doesn't support Chrome. Has anyone worked out how to get Applets working again on Chrome since 16 October??
Comment: Did you try Settings -> Security -> Web Content ->Enable Java?
Answer: I had the same problem too. I have a Macbook Pro with OS X Lion. I too updated my mac with the 2012-006 update and it broke Java applets on Google Chrome.
After a lot of researching, I got to know that Chrome is a 32-bit browser and does not support the 64-bit Java 7 from Oracle and there was no way to run applets on Google Chrome on a mac until we get a 64-bit release of Chrome for the mac.
So, I went to the Mac App Store > Purchases tab and downloaded OS X Lion and installed it over my existing disk. Note that it seems like a big deal, but it went well for me and your data and settings do not get erased/reset. The old 32-bit Apple JRE 6 gets installed and until Google Chrome 64-bit is released, you can keep using it without problems as long as you don't reinstall the 2012-006 update.
It worked for me, so it should work for you too. I'm not sure if you have Lion or Mountain Lion, but I think the same trick should work for Mountain Lion too.


My prints have a psychedelic mottled surface — did I make a mistake in developing?

Question: my prints have a hazy psychedelic mottled surface. Someone told me it is because I have them in the developer for only a few seconds and they need to be in for 30 seconds, but then they would get too dark. Should I dilute the developer more or close down my aperture or decrease my exposure?
Comment: Can you post a (scanned) example?
Answer: It takes time for development to come to completion. If you pull the print out of the developer too quickly, you will get a blemished that is dappled, we call it blotchy. As a rule of thumb, print development time averages about 90 seconds. Some developers are more energetic yielding a developing time of 60 seconds. Others are sluggish with a developing time of 120 seconds. Time in solution is a variable based on temperature and chemical strength. I often told my students to plop the print into the developer upside-down and wait 90 seconds before turning them over for viewing.  This way, they quickly got it, you must adjust the enlarger exposure time so that the prints develop up within the recommended time span  = 60 to 120 seconds.
Comment: Thank you so much. I have had my students putting them in for only a few seconds. I am a painter who has to teach darkroom as part of my job and I really appreciate your wisdom and suggestion to put the prints in upside down.
Comment: Since you are a novice as to teaching this subject – some added tips: Do use a stop bath after the developing step. This is a mild acid (vinegar) solution. Its job is to stop developing fast plus it prepares the print paper for the next step which is the fixer. Since a mild acid is a chief ingredient of the fixer, the stop bath prolongs the life of the fixer by neutralizing the alkaline developer that otherwise would rid piggyback into the fix and contaminate it. Next, make sure the prints are fully washed to rid them of residual chemicals that stain. Best of luck
Answer: Without seeing the print, it sounds like uneven development resulting from a very short development time. What's your developer and paper, and what are the recommended dilutions and times? Most print developers have a one to two minute development time at the recommended dilution.
If your source image is underexposed, you would control this not by decreasing your print development time but rather by using shorter print times and/or stopping down (at the enlarger). It could be that it's so underexposed that a well exposed print is unattainable in the darkroom.
Comment: @JillCallahan - You should read about creating a test strip. Basically, choose one aperture (say f/8) and expose a sheet of paper for, say, three seconds. Cover part of the paper, and expose for another three seconds. Continue until you have a range of timed exposures on the paper (like 3 to 18 seconds). Then pick the time that shows the best exposure to make your final print. Your developer is fine. Continue to use 1:9 and always develop for at least one minute or as instructed.
Comment: This issue is occuring in a classroom setting with many kids. I mixed the Ilford developer at 9:1 so I think it has to do with the enlarger aperature choice.
Answer: If you need to pull your print from developer before it gets too dark then you are overexposing it. It will look no good; prints are supposed to be developed till completion.
Dilution of the developer is not the problem, provided you did stick to the manufacturer recommended dilution.
You need to close the aperture and/or shorten your time. Or some combination of both - remember that 1 step of aperture means doubling (halving) your exposure time.
Comment: Thank you Jindra, do you mean that when I close the aperture a stop down I halve the time/exposure and if I am opening it I double the time/exposure? Intellectually this seems like the same thing to me but maybe in physical reality it's not.
Comment: I meant that these two things are equivalent; to decrease your exposure by 1 unit you have to either halve your time (e.g. from 10 seconds to 5) or increase your f stop (e.g. from 4 to 5.6). In reality it is impractical to work with very short (<5 seconds) nor very long (>30 seconds) times. You also do not want your lens fully open (you would run into sharpness issues) nor too closed (when diffraction kicks in). The "correct" time also depends on your paper size (or head elevation) and how powerful is your light source. It sounds difficult, but it is not :) A notebook is your best friend.


RF PCB Design Difference Between Controlled Impedance Track and Impedance Matching Circuit

Question: Im new on RF circuit designing. Im designing an circuit with GSM and GPS capabilities. I know when using high frequency signals the RF traces must be impedance matched. Now what I understand is, I can make it by impedance mathing circuits like pi-network but this will require antenna tuning and I dont have the tools for that, or I can use impedance controlled traces(microstrip line) on my PCB. What I don't understand is: which one is better or must I use impedance controlled lines and impedance matching circuit?
Answer: It is not an either/or situation.
Impedance controlled traces make feedlines of a known characteristic impedance, just like most coax is 50 or 75 ohms, and ladder-line is often 300 or 450 ohms. As a rule of thumb, any trace or wire longer than 1/10th the wavelength has to be considered a transmission line, in which case you must know the characteristic impedance. Trying to use a transmission line in your circuit without knowing the characteristic impedance is like trying to use a resistor without knowing the resistance.
Impedance matching circuits are circuits which transform one impedance to another. Designers usually try to keep them to a minimum since they cost something both in money and signal power. The matching circuit might consist of short (usually 1/4 wavelength or less) sections of transmission lines, but also inductors, capacitors, transformers, and (less commonly) resistors.
Answer: To add to Phil's answer: if your antenna, source and transmission line (the impedance controlled traces) are all of the same impedance, you don't need an impedance matching circuit. Most common impedance for RF applications is 50 ohms.
The impedance matching circuits are only there to connect two systems with a different impedance to each other.
Creating impedance matched traces is not necessarily hard to do. Take a look at a page like https://www.eeweb.com/tools/symmetric-stripline-impedance to calculate which dimensions to use. However, the frequencies you are talking about are rather high so things get harder to do "right".
Then again, you might not require the "perfect" board to get your "product" to work, it depends on the application... So try it out and see where you end up.


Rewrite phtml file and js file in Magento 2

Question: Currently, I have cc card HTML in

MyModule/Testing/view/frontend/web/template/form.html

I want to rewrite this to phtml file with my module and js in web/js folder.
How can I achieve that?
Answer: Please note that both .phtml and .html files are part of the view layer in Magento 2.
The difference is that phtml files work with Block in which according to Magento Docs is a special PHP class that is usually (but not always) connected to a template.
Blocks usually work with a model layer to manipulate data and return results/response to templates (.phtml or .html files). These files are used by layout files in setting up templates for certain blocks and so on.
html files on the other end are solely used to display content on the frontend and javascript libraries such as knockout JS and use them accordingly. These files are also used for AJAX content loading.
Reference: Difference between .phtml and .html
In your case, you can convert or rewrite your form.html file to form.phtml and store it in:

MyModule/Testing/view/frontend/templates/form.phtml

You can then initiate your .phtml file in a layout file through a layout block.
You can specify your .phtml file in the template attribute of the <block> layout.
Take this example:

app/code/MyModule/Testing/view/frontend/layout/mymodule_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

        <referenceContainer name="content">
            <block name="mymodule_testing" class="MyModule\Testing\Block\Hello" template="form.phtml">
                <arguments>
                    <argument name="label" xsi:type="string">The Form Template</argument>
                </arguments>
            </block>
        </referenceContainer>

</page>

As you can see the mymodule_testing block is rendered by your form.phtml template.
Template Reference: Template Override Magento 2
Note: Your layout block has a class named Hello which is located in the path MyModule\Testing\Block\Hello.php
Hope this helps or at least gives you an idea or reference to start with.


Is it possible for visual systems in AI to have Inattentional Blindness?

Question: Inattentional Blindness is common in humans (see: https://en.wikipedia.org/wiki/Inattentional_blindness ). Could this also be common with machines built with artificial vision?
Answer: Presumably what happens to people in the famous Invisible Gorilla experiment, is that an incongruous object is simply filtered out of human perception.
If we wish to interpret this mechanistically, we could hypothesize that a 'gorilla object' is simply not presented by low levels of perception to our higher level pattern recognizers because the lower levels are not biased towards the construction of 'gorilla-like' features in such a context.
The recent Tesla fatality (arising from a failure to distinguish between the sky and a high-sided white truck) could conceivably be considered to be an example of this.
See this AI SE question.
Answer: Although there might not conceptually be any sort of inattentional blindness associated with an AI system, there might be cases of partial blindness.
Inattentional blindness could occur to a person due to either over-exhaustion limiting cognitive abilities or overuse of frequent cognitive patterns. Our mind takes short-cuts to prevent processing of too much information -- more than what the mind thinks is necessary. But this sometimes backfires when the minor anomalies are not seen (or rather, perceived). Another form of this could also occur when events occur as part of the peripheral vision while the person concentrates only on the foveal vision.
This doesn't happen to a AI system because:

Machines are not designed to accidentally break defined rule sets by taking mental short-cuts like humans do.
Computers, in general,  do not have peripheral and foveal visual distinctions.

There may be, however, cases where it cannot be able to capture detail as much as humans can and hence could not perceive what it is actually intended -- partial blindness.
An AI agent is constantly processing its input percept sequence and validating it with its knowledge base and forming action sequence based on the its rule set. It does not make mental shortcuts in terms of perception as humans do (at least as part of its standard definition). So whatever it is good at perceiving, it would be good all throughout the vision it captures.
Answer: Yes, it is possible. For instance, if your vision system can only track one object at a time and is currently tracking one, any other object in the scene cannot be tracked. So there is inattentional blindness.
A feature like this could be used in artificial vision system as a means of "graceful degradation" when the available computation power is not enough to allow for the tracking/labelling of all elements of a scene.


Dog's cotton allergy

Question: My dog has a cotton allergy. It began by seeming like mange. The vet gave steroids which worked for a couple days back during the mange diagnosis.
Lowering the immune system with allergy shots seems a bit much. What can I do?
Answer: A few things to consider
If your veterinarian suspected Mange you would need an anti-parasitic such as Bravecto. Steroids will not kill parasites.
To rule out food allergies your dog will need a diet with a novel or hydrolyzed protein. A veterinary diet is best when determining food allergies as there is no risk of cross-contamination. It can take up to 12 weeks to see a difference, the pet cannot have any other food items while doing the trial (no treats allowed!).
Treatments for Allergies
If you cannot determine the source of your dogs allergies there are a couple options for you.

Steroids - the cheapest and highly effective way of getting rid of that inflammation. It is safe short-term however being on steroids long-term is hard on the body and can bring out illness in your pet (such as diabetes, cushings, obesity).

Apoquel - This medication targets the "itch" receptors in your pet, it is an expensive drug but is much better tolerated for long-term use. It is VERY effective and our go-to if the owners can afford it.

Diphenhydramine or Cetirizine - these over the counter medications work great for low-grade allergies. We recommend Cetirizine first as it can be given once a day and does not make your pet drowsy. Contact your veterinarian for a proper dosing. Be sure that whichever you choose does not contain any other medicinal ingredients besides Diphenhydramine or Cetirizine.

Allergy injections - We use Spectrum Labs for this treatment. Essentially a blood sample from a pet is taken and sent off to the lab, they run a test on the blood sample to figure out what your dog is reacting to. Once the test is complete they create a serum specific to your dogs allergies which will then need to be injected subcutaneously into your dog over a set amount of time. The "medication" works through hypo-sensitization towards the allergens. Typically allergy testing in dogs isn't overly accurate and is only recommended when doing the allergy injections.

Douxo Calm Shampoo or Sprays - This product works great when it comes to strengthening and soothing the skin barrier by having Phytosphingosines and Pseudofilaggrins in the product. There is a protocol that needs to be followed and that will depend on your dogs state.
Answer: First of all, when an allergy is found to be present, more tests are needed to see if any similar allergens do trigger the immune response (the body often reacts to other plants in the same family); in your dog's case, cotton.
The next thing is to try to avoid the allergen. This can be hard in your case, as cotton is very common in the environment.
If avoiding the allergen is impossible, the vet might give steroids for short time relief. However, this is not a lasting solution so you might need to start giving systemic allergy medication. Your vet will help you finding the right type and dosage.
And last, try to keep the floor and furniture clean to limit your dog's exposure to the allergen. Carpets and fabric do trap a lot of dust, so try to keep them clean.
Answer: I don't think you have much choice.
Allergic reactions occur when body's immune system attacks foreign substance, here cotton tissues.
So either you have to be careful to keep your dog completely away from cotton or give treatment of lowering immune system.

Dog's cotton allergy


Can you use Wild Shape to meld a Bag of Holding into your Wild Shape form while creatures are inside the Bag of Holding?

Question: My players are planning a heist. Two of the players each have a Necklace of Adaptation and do not need to breathe. They want to go inside a bag of holding (which is allowed from what I know), then give the bag to the Druid who wild shapes into a rat and chooses to "merge their equipment into their new form". Thus allowing the rat to carry the two PCs into the mansion easy-peasy. This is super creative, but would that be possible?
Comment: Welcome to RPG.SE! I really like this kind of interesting question, so thanks for posting it. Another user and I have made some minor edits to your question. If we got anything wrong or you see something else you would like to change, you can always [edit] the question. We also have a [help] and a [tour]. Happy gaming!
Comment: *Somewhat* related questions: "[What happens if a creature with a Bag of Holding is polymorphed/wild-shaped, then is placed inside another Bag of Holding?](https://rpg.stackexchange.com/q/170382)" And "[Can a druid use Wild Shape to get rid of a cursed item?](https://rpg.stackexchange.com/q/174611)"
Comment: Depending on their races and armor, be wary of the 500 pound weight limit! For 2 Humans + normal equip it should be absolutely fine, but if they want 2 battleaxes and full plate each you'll reach the limit rather quickly
Comment: Question about the tag here... This was originally posed with no system specified and responding to comments Alan put in the 5e tag as the game he was playing. That usually is appropriate, but I wonder if it is limiting here. The fact is, the correct answer for 5e is also the correct answer for *every* edition of D&D (with some caveats for bag of holding weight limits--only 200 lbs in 4e).  In addition, it is the correct answer for both editions of Pathfinder. Since we do not want seven versions of the same question, would it be wise to change the tags to dnd and pathfinder?
Comment: They don't need the necklace of adaptation, see my answer here: [Can a target escape a Wild Shaped Portable Hole/Bag of Holding](https://rpg.stackexchange.com/a/180363)
Answer: Easy peasy
As long as the players can fit through the neck of the bag they can exist inside until you're nice enough to let them out, thanks to the necklaces of adaptation.
Even without them, it would still be possible but how long they can hold their breath would then become an issue.
Just don't die because no one else will know to let them out...
I think using Bags of Holding like this is always a great idea. My players have used a BOH to fly team members across chasms, hide them from magically tracking hunters, sneak extra people into a party, etc.
It can subvert a lot of what the DM thinks might be a challenge for the players and turn tricky situations into slight inconveniences so some DMs may place limits on what can be done.
Comment: Definitely watch the weight limit (500 lbs. in 5e), as most characters are probably already over 150 lbs. each, not counting their gear plus whatever else might be in there. Also...make sure neither of them are carrying their own BoH, portable hole, handy haversack, or the like.
Comment: Don't die.  They canot exit by themselves and would be trapped until someone else let them out
Answer: Yes.
Yes, this is possible. Characters may enter a bag of holding, they have solved the potential problem of running out of air, and there is nothing about a bag of holding that would prevent it from merging with the druid's wild shape form like any other magical item or piece of equipment.
I would carefully track the weight of the two characters going into the bag to make sure they do not exceed the limit, but apart from that limitation, the plan seems solid.
Perhaps they're rendering moot some hard work you did on the mansion exterior and defenses, but this is a fun and creative idea that shows your players are engaged and having fun. This should be encouraged.
As a side note: this answer is valid in every edition of D&D and in Pathfinder 1e and 2e, as well. There may be some limitations with the Bag of Holding's capacity from edition to edition--it is only 200 pounds in D&D 4e, though Handy Haversqack holds 1,000--but as long as the weight limit is not exceeded, this plan is feasible in every edition plus both Pathfinder editions.
Comment: Yes, the question originally did not specify the edition. It was edited since my answer was posted and now I have been able to correct it. Hopefully that clears up the negative reception I was getting.
Comment: You don't do much in the way of explaining why it's possible or how the rules work to permit this. You just say "yes" and then explain how it would play out. This seems like half way to a decent answer.
Comment: I'm not sure how the information from other editions and games is relevant.
Comment: @ThomasMarkov I believe the answer was written when the specific edition that the question was talking about was unclear; though now it has been clarified so this answer should match that change by restricting itself to the fifth edition of Dungeons & Dragons
Comment: My second sentence explains why it is possible.  The rules allow PCs to enter a bag of holding; the PCs have found a way not to run out of air; there is nothing about the bag of holding that would make it an exception to equipment blending into a wild shape. What more do you need, exactly?


How to create Document objects with JavaScript

Question: Basically that's the question, how is one supposed to construct a Document object from a string of HTML dynamically in javascript?
Comment: If you look at the [specification of the `send()` method](http://www.w3.org/TR/XMLHttpRequest2/#the-send-method), you'll notice that strings are covered by the "DOMString" case. Therefore, the "Document" case cannot mean a string, it's an object that implements the `Document` interface specified in the DOM standard.
Comment: It's a real Document object. Not sure what you mean by "mere xml/html structure"...
Comment: I mean text, sequence of tags.
Comment: Yes, I read it, just wanted to clarify, maybe you know any examples of XMLHttpRequest used to send Document object? Side-question still stays though - maybe it's not that wide-spread usage, but how do you construct Document object?
Comment: Now that we cleared that up, I recommend that you edit your question so that the side-question becomes the main question - "How to create Document objects with JavaScript".
Comment: If you don't get a good answer in the next 45 hours, remind me to set a bounty on this...
Answer: There are two methods defined in specifications, createDocument from DOM Core Level 2 and createHTMLDocument from HTML5.  The former creates an XML document (including XHTML), the latter creates a HTML document.  Both reside, as functions, on the DOMImplementation interface.
var impl    = document.implementation,
    xmlDoc  = impl.createDocument(namespaceURI, qualifiedNameStr, documentType),
    htmlDoc = impl.createHTMLDocument(title);

In reality, these methods are rather young and only implemented in recent browser releases.  According to http://quirksmode.org and MDN, the following browsers support createHTMLDocument:

Chrome 4
Opera 10
Firefox 4
Internet Explorer 9
Safari 4

Interestingly enough, you can (kind of) create a HTML document in older versions of Internet Explorer, using ActiveXObject:
var htmlDoc = new ActiveXObject("htmlfile");

The resulting object will be a new document, which can be manipulated just like any other document.
Comment: I note you don't include working code. The only methods I've seen (e.g. on [MDN](https://developer.mozilla.org/en-US/docs/DOM/DOMParser)) rely on either built–in browser support for `DOMParser.prototype.parseFromString` or on setting the `innerHTML` property of the new document's HTML element. However, [according to MSDN](http://msdn.microsoft.com/en-us/library/ie/ms533897%28v=vs.85%29.aspx) (and shown in testing) the innerHTML property of HTML elements (and a number of others) is **read only** and can't be set in IE up to and including IE 9.
Comment: All good information, but handy to see code. An approach using `document.open` etc. seems to work back to IE 6 and is a useful alternative, however it doesn't work in older Firefox and others whereas the `stringToXMLDoc` function I posted does, as does the `stringToHTMLDoc` function.
Comment: @RobG: Sure, it's always handy to see code, but the question wasn't *"How to create document objects with JavaScript and populate them with HTML?"*, so code like that may be considered unnecessary bloat for an answer, especially considering the OP might have intended to construct the entire document using DOM creation methods. Otherwise, I would genuinely consider adding the code to my answer.  I'd also like to confidently guess that the number of worldwide users with a browser that doesn't support `document.open` is minuscule (Firefox supported it in 1.5), probably not enough to worry about.
Comment: @RobG: there's `document.open()`, `document.write()` and `document.close()`. They all work in any browser including IE6 and lower. The only downside is that all the methods for IE6-8 parse and execute JavaScript, which is probably not desirable (it wasn't in [my case](http://stackoverflow.com/questions/7474710/can-i-load-an-entire-html-document-into-a-document-fragment-in-internet-explorer)).
Answer: Assuming you are trying to create a fully parsed Document object from a string of markup and a content-type you also happen to know (maybe because you got the html from an xmlhttprequest, and thus got the content-type in its Content-Type http header; probably usually text/html) – it should be this easy:
var doc = (new DOMParser).parseFromString(markup, mime_type);

in an ideal future world where browser DOMParser implementations are as strong and competent as their document rendering is – maybe that's a good pipe dream requirement for future HTML6 standards efforts. It turns out no current browsers do, though.
You probably have the easier (but still messy) problem of having a string of html you want to get a fully parsed Document object for. Here is another take on how to do that, which also ought to work in all browsers – first you make a HTML Document object:
var doc = document.implementation.createHTMLDocument('');

and then populate it with your html fragment:
doc.open();
doc.write(html);
doc.close();

Now you should have a fully parsed DOM in doc, which you can run alert(doc.title) on, slice with css selectors like doc.querySelectorAll('p') or ditto XPath using doc.evaluate.
This actually works in modern WebKit browsers like Chrome and Safari (I just tested in Chrome 22 and Safari 6 respectively) – here is an example that takes the current page's source code, recreates it in a new document variable src, reads out its title, overwrites it with a html quoted version of the same source code and shows the result in an iframe: http://codepen.io/johan/full/KLIeE
Sadly, I don't think any other contemporary browsers have quite as solid implementations yet.
Comment: Thank you! I didn't check, and it seems an embarrassing enough bug to fix (or at least we can hope for the best) somewhat swiftly. :-)
Comment: Unfortunately, the last method fails in Opera (12.12): `doc.open()`   `write` / `close` affects the current document instead of the `doc` document. IE6+, Firefox 4+, Chrome 1+ and Safari 3.2+ correctly supports this method. I've already submitted a bug report to Opera.
Answer: Per the spec (doc), one may use the createHTMLDocument method of DOMImplementation, accessible via document.implementation as follows:
var doc = document.implementation.createHTMLDocument('My title');
var body = document.createElementNS('http://www.w3.org/1999/xhtml', 'body');
doc.documentElement.appendChild(body);
// and so on

jsFiddle: http://jsfiddle.net/9Fh7R/
MDN document for DOMImplementation: https://developer.mozilla.org/en/DOM/document.implementation
MDN document for DOMImplementation.createHTMLDocument: https://developer.mozilla.org/En/DOM/DOMImplementation.createHTMLDocument
Comment: Note that the MDN code fails in IE 9 and lower since it doesn't support setting the HTML element's innerHTML property (it's read only). If you insert a complete HTML document (including a head element) into a BODY element, you are depending on browser error correction of what becomes invalid markup at the moment it is assigned.
Answer: The following works in most common browsers, but not some. This is how simple it should be (but isn't):
// Fails if UA doesn't support parseFromString for text/html (e.g. IE)
function htmlToDoc(markup) {
  var parser = new DOMParser();
  return parser.parseFromString(markup, "text/html");
}

var htmlString = "<title>foo bar</title>
a div
";
alert(htmlToDoc(htmlString).title);

To account for user agent vagaries, the following may be better (please note attribution):
/*
 * DOMParser HTML extension
 * 2012-02-02
 *
 * By Eli Grey, http://eligrey.com
 * Public domain.
 * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
 *
 * Modified to work with IE 9 by RobG
 * 2012-08-29
 *
 * Notes:
 *
 *  1. Supplied markup should be avalid HTML document with or without HTML tags and
 *     no DOCTYPE (DOCTYPE support can be added, I just didn't do it)
 *
 *  2. Host method used where host supports text/html
 */

/*! @source https://gist.github.com/1129031 */
/*! @source https://developer.mozilla.org/en-US/docs/DOM/DOMParser */

/*global document, DOMParser*/

(function(DOMParser) {
    "use strict";

    var DOMParser_proto;
    var real_parseFromString;
    var textHTML;         // Flag for text/html support
    var textXML;          // Flag for text/xml support
    var htmlElInnerHTML;  // Flag for support for setting html element's innerHTML

    // Stop here if DOMParser not defined
    if (!DOMParser) return;

    // Firefox, Opera and IE throw errors on unsupported types
    try {
        // WebKit returns null on unsupported types
        textHTML = !!(new DOMParser).parseFromString('', 'text/html');

    } catch (er) {
      textHTML = false;
    }

    // If text/html supported, don't need to do anything.
    if (textHTML) return;

    // Next try setting innerHTML of a created document
    // IE 9 and lower will throw an error (can't set innerHTML of its HTML element)
    try {
      var doc = document.implementation.createHTMLDocument('');
      doc.documentElement.innerHTML = '<title></title>

';
      htmlElInnerHTML = true;

    } catch (er) {
      htmlElInnerHTML = false;
    }

    // If if that failed, try text/xml
    if (!htmlElInnerHTML) {

        try {
            textXML = !!(new DOMParser).parseFromString('', 'text/xml');

        } catch (er) {
            textHTML = false;
        }
    }

    // Mess with DOMParser.prototype (less than optimal...) if one of the above worked
    // Assume can write to the prototype, if not, make this a stand alone function
    if (DOMParser.prototype && (htmlElInnerHTML || textXML)) {
        DOMParser_proto = DOMParser.prototype;
        real_parseFromString = DOMParser_proto.parseFromString;

        DOMParser_proto.parseFromString = function (markup, type) {

            // Only do this if type is text/html
            if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
                var doc, doc_el, first_el;

                // Use innerHTML if supported
                if (htmlElInnerHTML) {
                    doc = document.implementation.createHTMLDocument("");
                    doc_el = doc.documentElement;
                    doc_el.innerHTML = markup;
                    first_el = doc_el.firstElementChild;

                // Otherwise use XML method
                } else if (textXML) {

                    // Make sure markup is wrapped in HTML tags
                    // Should probably allow for a DOCTYPE
                    if (!(/^$/i.test(markup))) {
                        markup = '' + markup + '<\/html>';
                    }
                    doc = (new DOMParser).parseFromString(markup, 'text/xml');
                    doc_el = doc.documentElement;
                    first_el = doc_el.firstElementChild;
                }

                // RG: I don't understand the point of this, I'll leave it here though
                //     In IE, doc_el is the HTML element and first_el is the HEAD.
                //
                // Is this an entire document or a fragment?
                if (doc_el.childElementCount == 1 && first_el.localName.toLowerCase() == 'html') {
                    doc.replaceChild(first_el, doc_el);
                }

                return doc;

            // If not text/html, send as-is to host method
            } else {
                return real_parseFromString.apply(this, arguments);
            }
        };
    }
}(DOMParser));

// Now some test code
var htmlString = '<title>foo bar</title>
a div
';
var dp = new DOMParser();
var doc = dp.parseFromString(htmlString, 'text/html');

// Treat as an XML document and only use DOM Core methods
alert(doc.documentElement.getElementsByTagName('title')[0].childNodes[0].data);

Don't be put off by the amount of code, there are a lot of comments, it can be shortened quite a bit but becomes less readable.
Oh, and if the markup is valid XML, life is much simpler:
var stringToXMLDoc = (function(global) {

  // W3C DOMParser support
  if (global.DOMParser) {
    return function (text) {
      var parser = new global.DOMParser();
      return parser.parseFromString(text,"application/xml");
    }

  // MS ActiveXObject support
  } else {
    return function (text) {
      var xmlDoc;

      // Can't assume support and can't test, so try..catch
      try {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(text);
      } catch (e){}
      return xmlDoc;
    }
  }
}(this));

var doc = stringToXMLDoc('<books><book title="foo"/><book title="bar"/><book title="baz"/></books>');
alert(
  doc.getElementsByTagName('book')[2].getAttribute('title')
);

Comment: Like I said in reply to your comment on my answer, IE6-9 can be coerced into parsing a document using a combination of the `open()`, `write()` and `close()` members of `document`, and this can be done in conjunction with `new ActiveXObject("htmlfile")`.  If you're not worried about script execution in IE 6-8, this is a much shorter/easier approach. Your modification to Eli Grey's code could also use these methods and cut the size down significantly.
Answer: An updated answer for 2014, as the DOMparser has evolved. This works in all current browsers I can find, and should work too in earlier versions of IE, using ecManaut's document.implementation.createHTMLDocument('') approach above.
Essentially, IE, Opera, Firefox can all parse as "text/html". Safari parses as "text/xml".
Beware of intolerant XML parsing, though. The Safari parse will break down at non-breaking spaces and other HTML characters (French/German accents) designated with ampersands. Rather than handle each character separately, the code below replaces all ampersands with meaningless character string "j!J!". This string can subsequently be re-rendered as an ampersand when displaying the results in a browser (simpler, I have found, than trying to handle ampersands in "false" XML parsing).
function parseHTML(sText) {
try {

    console.log("Domparser: " + typeof window.DOMParser);

    if (typeof window.DOMParser !=null) {
        // modern IE, Firefox, Opera  parse text/html
        var parser = new DOMParser();
        var doc = parser.parseFromString(sText, "text/html");
        if (doc != null) {
            console.log("parsed as HTML");
            return doc

        }
        else {

            //replace ampersands with harmless character string to avoid XML parsing issues
            sText = sText.replace(/&/gi, "j!J!");
            //safari parses as text/xml
            var doc = parser.parseFromString(sText, "text/xml");
            console.log("parsed as XML");
            return doc;
        }

    }
    else  {
        // older IE
        doc= document.implementation.createHTMLDocument('');
        doc.write(sText);
        doc.close;
        return doc;
    }
} catch (err) {
    alert("Error parsing html:\n" + err.message);
}
}


Is whisky matured in a sherry cask Kosher?

Question: Is whisky matured in a sherry cask Kosher? I know there is a Machlokes about this. Who holds what?
Comment: Most Chabad rabbonim with whom I am acquainted hold that Macallan (prime example) is completely kosher as it is 1) free of grapes and is 2) considered a great whisky.
Comment: I went to a discussion on this where it was mentioned, uncited, that the London Beit Din never had any concerns about the kashrut of Scotch.
Comment: What suprises me about the cRc opinion is that they follow the idea that the entire volume of the aging barrel wood has to be nullified by the whiskey. However, i think it is very unlikely that the wood is as porous as a sponge, so that close to the volume of the wood absorbs wine. I would be surprised if the wine made it much deeper than a centimeter or two into the wood, and even there, the wood is much denser than a sponge. In other words, I bet the actual amount of wine that would need to be nullified is probably no where near the volume of the barrel wood!
Comment: @noach mi frankfurt regular Macallan  is not aged in a sherry cask. if they have a specific one which is then that one would not be kosher. this would have no affect on the other scotches which are not aged in sherry casks. having any type of wine product used to affect the flavor of the whisky is a problem. The crc does a good job with identifying alcohol which is and isn't recommended and are willing to answer any question concerning specific products which are not on their list
Answer: See here.

Kosher and Sherry Casks
Rabbi Pinchas Teitz of Elizabeth, NJ, first reported in 1949 that
  there may be sherry wine in blended whisky – which would obviously
  create a problem for observant Jews who are also whisky lovers. It
  would then follow that any single malt Scotch that is exclusively
  matured or finished in sherry casks would pose a problem as well.
Rabbi Teitz raised the issue regarding the permissibility of drinking
  sherry-infused blended whisky to Rabbi Moshe Feinstein. Rabbi
  Feinstein, one of the 20th century's great minds regarding Jewish law,
  had 3 responsa (rabbinical rulings) on the topic.

Essentially Rabbi Moshe Feinstein does not seem to have a problem with whisky matured in sherry casks. However he is reported to say that a "Ba'al Nefesh" should be stringent.
There is a very full discussion here  where you can find all the sources.
Amongst Kashrus authorities, a search showed
1) Jersey Shore Orthodox Rabbinate

Scotch  There are two types of Scotch commonly available, Blended and
  Single  Malt. All types listed as being aged in sherry casks" "sherry
  finish" "port  finish" or dual cask finish" are not recommended.

2) cRc - Liquor List - Chicago Rabbinical Council
Similar to 1
3) Star-k

Scotch and Irish whisky would be acceptable unless specifically
  stated that the beverage has been aged in sherry casks finished in
  sherry or port casks. We do not have to assume that this is the case
  unless the company asserts that it is so. Our recommended liquor list
  reflects those products that do not specify aged in sherry casks.

My personal experience is that most people including our LOR are not worried about whisky matured in sherry casks.
Comment: could you source Rav Moshe's responsa?
Comment: So my question is why those major Kashrus agencies are worried about Sherry Casks if Rav Moshe is not. In other words, what posek has given the opposite opinion?
Comment: @andrewmh20 You are right. To get the answer, we need to summarize this large article referenced above http://www.crcweb.org/Sherry%20Casks%202.pdf. I have not been able to do that.
Comment: It's in 2 Teshuvos in Igros Moshe: Yoreh Deah 1:62-63
Comment: why do you write 'It would then follow that any single malt Scotch that is exclusively matured or finished in sherry casks would pose a problem as well.'? There are strict regulations about Scotch - you cannot add sherry and still call it Scotch!
Comment: the reference cited at the beginning of this answer is brilliant
Answer: There's a good article that summarzies the opinions here:
http://doseofhalacha.blogspot.co.uk/2013/07/kashrus-of-scotch.html
Read through the comments, too:

The Poskim agree that ordinary Scotch whisky (whether single malt or blended) which has no mention of any wine casks is perfectly Kosher. The question arises when whisky has been matured in wine casks, such as the Macallan Sherry Oak. R' Moshe Feinstein famously addresses this issue in 2 responsa: Igros Moshe YD 1:62-63. While the Shulchan Aruch (YD 134:13) forbids drinking a gentile's beverage when it is customary to add non-Kosher wine to it, R' Moshe follows the more lenient Rema. Providing the wine is nullified against 6 parts whisky (as opposed to the usual 1:60 ratio), the wine is Kosher. While R' Moshe advises that a baal nefesh should best avoid such whisky, seemingly he was specifically referring to a scenario where wine had actually been added to whisky. As Scotch Whisky Regulations dictate that Scotch may only contain water, grain yeast and caramel colouring, we can be assured that wine is not added.
Many American Poskim are concerned that as the entire sherry (or port, Madeira, etc.) cask is saturated with non-Kosher wine, the wine is no longer battul 1:6 in the whisky. Others, including R' Akiva Niehaus (Sherry Casks, A Halachic Perspective) argue that R' Moshe wasn't referring to Scotch, but to American or Canadian whiskey. Accordingly, they forbid Wine Cask Finishes, arguing that the wine adds a recognizable taste to the whisky.
  Nonetheless, Rabbanim in the UK (including the London Beis Din) maintain that R' Moshe's rulings apply to Scotch, and follow Dayan Weiss's permissive ruling, too (Minchas Yitzchak 2:28).
Note, that distilleries outside of Scotland (including Ireland) are not bound by the same regulations, and their whiskies may be problematic. Thus one must consult their Kashrus authority.
Comment: Having researched this extensively, I'd add to this very good answer that the issue with sherry casks is when the whiskey was finished (matured) entirely in sherry casks. When it has been matured in say bourbon, oak and sherry casks, there is no issue because the sherry cask is only there for part of the time (source: R Niehaus very complete monography)
Answer: Rabbi Moshe Feinstein was addressing blended whiskey, but the issues are basically the same with regards to a sherry-cask scotch as far as I know.
Rabbi Feinstein said it was allowable, but not preferable; he personally made reasonable attempts to avoid such a product (as a chumrah) , and gave his blessing to those who would make a product certified as free of non-kosher wine. So authorities such as the cRc and Star-K who don't recommend "sherry-finished scotches" are following Rabbi Feinstein. They're not necessarily saying they're certifiably not kosher, just that they're not endorsed.
The Star-K's position, for instance, is if it says on the label "this contains sherry" (in one language or another), then they don't recommend it. If you don't know, then you can rely on its permissibility if it happens to be there.
Comment: why do you say that R' Moshe was only ' addressing blended whiskey'? He didn't write that, and most certainly knew about the different types. If he didn't specify so, then surely his hetter applies to all whiskys and whiskeys?!
Comment: @Zvi his responsum --YD1:62 -- is to Rabbi Teitz regarding "blended yash", that's what it says explicitly. (New York Jews 50 years ago drank that more than single-malt, from what I understand.) The concern there was that wine and glycerin were added as ingredients. However the poskim cited here (and R' Dovid Miller of the Gruss Kollel) all say that the same logic would apply to a single-malt that may contain some non-kosher wine due to the sherry cask.
Comment: so what if they drank that more?! R' Moshe knew about single-malt and would have specified that his hetter doesn't apply to single-malt if he wanted to. Glenfiddich has long been the world's most exported whisky..
See http://www.scotch-whisky.org.uk/media/12744/scotchwhiskyregguidance2009.pdf Other than caramel, no ingredients may be added.
The English Rabbanim who know first hand what's going on are generally Mattir.
Comment: @Zvi I think we're agreeing here, the same heter would apply according to Rav Moshe, though he said it was better to be machmir. It's just important for history's sake to accurately describe Rav Moshe's words.
Comment: @Zvi one argument suggested why sherry casks are less of an issue than a blended containing wine -- the wine in a blended is there for color/flavor. The sherry cask may not actually be there to impart the sherry flavor, but instead to tone down some of the wood flavors.
Answer: Well, I'm the new Jewish boy around here. Please note that I´m also frum. Recently, I started to try beers more "pro" like, since I completely HATE vodka (what kind of Chabad am I, I don´t know, but smirnoff is definetly NOT my style), whiskey, many kinds of wine and, specially, gin and rum.
But in beer I really found my spot, and started doing a "world tour" on different types, having a different one for every Shabbos. Last year though, when my mother, my father and I went into vacations for Sukkos, we decided to go to an empty pub the night before. There, she asked for a "beer that looks like wine" of course WITHOUT wine (there are some beers that mimic that taste without grapes, only the usual kosher stuff- yeast, malt, hops, sugar and water); the waiter came back with a Flanders Red Ale, at the time I had never heard of that type (there´s only like 5 or 6 brands that do that style, being the two most famous Verhaeghe-which is the best one and only does that- and Rodenbach). It tasted EXACLTY like balsamic vinegar and sour cherries, so my mom, apart from HATING balsamic, spewed it out thinking there were real grapes in the beer. Of course, this wans´t the fact. That beer had NOTHING of grape inside, but it had been matured in casks for months (between eight and eighteen months). Later I would learn from the brewery owner (without him knowing that i was asking for halachic purposes) that those casks (or tanks, since they are REALLY bigger), besides NO grape adding or wine (I told him I was allergic), hasn´t seen real wine for MANY years. Of course, I went directly to my rabbis concerned about the fact, specially because I know that Yeyn Nessech Eino Batel, and two of them permitted whilst one didn´t want to answer. I´m at the moment finishing my Smicha and the good thing is that I had a contact with the Shulchan Aruch in a closer way than bochur yeshives normally get. In Siman 137 of Yoreh Deah says that if the cask spent 12 months without wine, its ok. Even if in the meantime you put there beer or water (and some sustain even other liquids), the clock does not stops (although some maintain that that is only when there is a Sheish to batel the wine in the walls of the tank or cask)! Plus, there are many opinions that beer, more than ANY other liquids, POGEM the wine (see the Taz on Yoreh Deah 99, and Avodah Zarah where, I believe, Rav permits Ravina to store beer in a Kli that has been previously used for wine). I also heard, on the other hand, that Rabbi Landau Shlit´´a from Bnei Brak DEFINETELY prohibits ANYTHING that had been placed on those barrels, although many other poskim suggest that that´s just a stringency. I won´t say that Lechatchila it´s ok, but maybe bedieved there is where to Somech since it is not only one or two poskim, but MANY that maintain that beer Pogem the Wine (and even for a good Cheilek of people, the beer I just mentioned has a VERY PAGOM taste - specially those that aren´t in the "sour" type of beers). I would like to ask you guys opinions on this. Also, the first thing to mention is that this specific beer is matured on oaken casks that is about almost ten times the size of a Sherry normal cask, and has probably about a hundred years.
Comment: You can "paskin" 1000 times over that beer is pogeim, but that doesn't change the fact that companies are doing it to taste better and high paying customers agree. Ruling about Natlap isn't an ontological statement about the relationship between specific flavors.
Comment: Welcome Michel Guendler Gruenberg
Comment: How are you explaining the need to mature the beer isn casks. If the taste is not good, why. See Gemara of the עכברא בשכרא in Avoda Zara, following most rishonim (not following Raavad). If we have really 2 steps: 1- pogem wine, less than Achilat Ger (the Raah Shita in natlaf for the blia itself) and furthermore using the casks, it is good. But if this is an instantaneous process, it is prohibited because the way is to shevach without interruption. Even if Beer pogem the wine, wine (the Issur) meshabeach the beer!!!
Comment: Thanks Kouty. Achbara BeShichra is in the 104 of Y"D S"A. Already studied it. The thing here is not that the wine is meshabeach the beer, the thing is that the Tannins on the Wood make it look like "wine beer". There is no influence of wine whatsoever in the beer, plus a single cask can receive up to 11071 Liters (meaning that of course there is enough to levatel a sheis of the walls).
And plus, Avida LeTaama is a machlokes and many sustain that that is only true regarding things like salt, peppers and other type of spices (not wine, maybe).
Comment: Again Chevrei, we are talking about Bedieved, not Lechatchila. Of course, if we are talking about Mehadrin min HaMehadrin any beer that involves that process would be definetely assur, as well as the Whiskies from Sherry Casks. That is like Chalav Stam x Chalav Isroel, there is no comparison. By the way, Kouty, what do you mean by "Instantaneous Process"?
Comment: I believe you cannot compare with Achbar sheNafal leShechar because there it is widely stated in this Gemarah and Shulchan Aruch that the Achbar Noten Taam LeShebach in the Shechar, and even if you would say me that the wine would also N"T LeShebach in the beer, there are strong poskim that says the opposite. Plus, i never looked myself, but many friends told me that the Shulchan Aruch HaRav permits wine that has been placed on a Beer cask for Pessach because beer pogems the wine. The main question is: if for me its considered shebach, but for most of the world, pagum, mah hadin?
Comment: @MichelGuendlerGruenberg I see only now your post, because there was no@ for me


How do I recognize whether a Gorgonzola has gone bad?

Question: Is there any way to know when moldy cheese (in my case, Gorgonzola) is no longer good to eat, without trying it?  Mine is about three weeks old and I really can't tell any difference.
Comment: you can eat your cheese without problem, ripe cheese lasts in the fridge much longer than three weeks
Answer: If it grows a grey or pink mold around the edges, or a black mold, throw it out. That's an undesirable mold. Those molds aren't usually dangerous, but they can make the cheese taste bad. With gorgonzola cheese specifically, the mold is injected in to the cheese via needle-like things, and then it grows veins from there. If a mold is a different color and it's coming from somewhere other than the veins, that is probably not a good mold. See also this question.
.
Comment: is this the same for most blue cheeses? also, does grey or pink mold also grow when it goes bad from not being refrigerated for a while?
Answer: If the cheese smells strongly of ammonia it's time to chuck it. You will also notice a pink tinge of colour. The cheese from the rind in will be turning peachy pink. Best rule if it smells like cheap perm lotion it's time to throw it away.
Answer: Does it still smell tasty? I noted a distinct ammonia smell in a package of crumbled gorgonzola that had been sitting in our fridge a while - it still looked good, but upon trying a small sample, it was inedible, tasting more of industrial cleaner than cheese.
Answer: The only time I had Gorgonzola go off it went slimy and wet looking so if it does that or develops a new mould that looks a new colour I'd throw it out.


Is my fast valid if I do ghusl after eating sohor?

Question: Sometimes when I wake up for fasting, I notice I had ejaculated (not the result of masturbation, but a wet dream). Despite that fact, I eat and drink completely, then I do ghusl in order to pray al-fajr.
Given I ate while not pure, will this fast be accepted?
Comment: Unless you follow the Ibadi sect https://islam.stackexchange.com/questions/17755/what-theological-and-historical-factors-distinguish-ibadi-islam-from-either-shia, (only then) no!
Comment: @Medi1Saif  you mean yes? I.e his fast is valid
Comment: @Medi1Saif I do not understand what you meant. From what I understand from the article you pointed me to, it seems my fast is valid but I do not understand you answer "no".
Comment: @youssouf the "no" is in case you followed the Ibadi sect, else of course your fast is valid.
Answer: Inshaallah your fast will still be valid. The hadath (impurities) including farts, urinating, janabah, etc. are not the requirement for doing starting the fast. Those are the requirement for other obligation such as the five prayer.
See: https://islamqa.info/en/answers/14225/delaying-ghusl-from-janaabah-in-ramadaan-until-the-sun-has-risen-does-not-invalidate-the-fast
Allahualam - only Allah knows best
Comment: There are two kinds for hadath one requiring ghusl and one only wudu'.
Comment: @Medi1Saif correct, but hadath is not the requirement to begin fasting. But indeed, if you have janabah later during fasting, then your fast is invalidated


Melody Extraction from Music

Question: How would I extract a monophonic (single notes) melody from a song? I'm thinking in particular from ABC notation, but that doesn't matter. Is it reasonable to always take the highest pitch when the notes are polyphonic, or is that too simple to work well?
Answer: If it's a pop song, 9/10 times its the singer's melody. Don't assume its always the highest note though. There is no strict rule. The melody can change between instruments and voices.
Answer: A vital concept for extracting such a "melodic skeleton" from a more ornamented melody is with the notion of melodic fluency.
To put it simply, melodic fluency simply means that the melody is as stepwise as possible. If one were to only go with the highest pitches, your melodic skeleton may have random leaps: up a seventh in one measure, down a ninth in the next, etc. If you work from a standpoint of melodic fluency, however, you'll notice that these high pitches are likely subsidiary to the "truer" melodic background.
This doesn't mean that every note will be a step away, but try not to have too many intervals larger than a third.
Answer: Instead of attempting to decipher the melody in a song, consider first understanding the chords. By analyzing the chords of a song, you can often determine the key in which a song was written, which points out the notes you should look for.
Comment: The question was specifically about the melody, not chords.

Melody Extraction from Music


What could be the downsides of using Redux instead of Flux

Question: I just recently discovered Redux. It all looks good. Are there any downsides, gotcha or compromises of using Redux over Flux? Thanks
Answer: Redux author here!
I'd like to say you're going to make the following compromises using it:

You'll need to learn to avoid mutations. Flux is unopinionated about mutating data, but Redux doesn't like mutations and many packages complementary to Redux assume you never mutate the state. You can enforce this with dev-only packages like redux-immutable-state-invariant, use Immutable.js, or trust yourself and your team to write non-mutative code, but it's something you need to be aware of, and this needs to be a conscious decision accepted by your team.
You're going to have to carefully pick your packages. While Flux explicitly doesn't try to solve "nearby" problems such as undo/redo, persistence, or forms, Redux has extension points such as middleware and store enhancers, and it has spawned a young but rich ecosystem. This means most packages are new ideas and haven't received the critical mass of usage yet. You might depend on something that will be clearly a bad idea a few months later on, but it's hard to tell just yet.
You won't have a nice Flow integration yet. Flux currently lets you do very impressive static type checks which Redux doesn't support yet. We'll get there, but it will take some time.

I think the first is the biggest hurdle for the beginners, the second can be a problem for over-enthusiastic early adopters, and the third is my personal pet peeve. Other than that, I don't think using Redux brings any particular downsides that Flux avoids, and some people say it even has some upsides compared to Flux.

See also my answer on upsides of using Redux.
Comment: In short, mutations make it hard to check which parts of state changed to efficiently redraw only changed parts of UI. They also make debugging harder, and libraries like https://github.com/omnidan/redux-undo impossible. Finally time travel in https://github.com/gaearon/redux-devtools would not work if state was mutated.
Comment: Awesome answer. Is there a simple explanation of why mutations are avoided in redux and the complementary packages?
Comment: @DanAbramov how does immutability help to have efficient redraws in Redux?
E.g. in react-redux `shallowEqual` check is used to determined if the state changed. But it can be replaced with deepEqual or JSON.stringify and compare.
Eventually it's somewhat lower performance - but it's pure computations without dealing with DOM - so fast enough.
And in any case rendering itself is the same
Comment: @amakhrov deepEqual or JSON.stringify are quite slow. They're not "fast enough" for real apps, especially if you compare data for every view.
Comment: Ok, I got it. Sounds that immutability makes dirty checks more efficient, rather than making redraw more efficient.
Comment: @DanAbramov In such an opinionated industry it's very refreshing to see someone (especially the author) providing both the pros and cons of software packages/libraries. This is how discussions about software should take place and how informed decisions are made, rather than the "newest library on the block" approach. Please keep it up!
Answer: Both Redux and Flux require a considerable amount of boilerplate code to cover many common patterns, especially those that involve asynchronous data fetching. The Redux documentation already has a handful of examples for boilerplate reduction: http://redux.js.org/docs/recipes/ReducingBoilerplate.html. You could get everything you might need from a Flux library like Alt or Fluxxor, but Redux prefers freedom over features. This could be a downside for some developers because Redux makes certain assumptions about your state that could be inadvertently disregarded.
The only way for you to really answer your question is to try Redux if you can, perhaps in a personal project. Redux came about because of a need for better developer experience, and it is biased towards functional programming. If you aren't familiar with functional concepts like reducers and function composition then you might be slowed down, but only slightly. The upside for embracing these ideas in data flow is easier testing and predictability.
Disclaimer: I migrated from Flummox (a popular Flux implementation) to Redux and the upsides far outweigh any downsides. I prefer much less magic in my code. Less magic comes at a cost of a little more boilerplate, but it's a very small price to pay.
Answer: Flux and Redux . . .
Redux is not a pure Flux implementation but definitely inspired by Flux. Biggest difference is that it uses a single store that wraps a state object containing all the state for your application. Instead of creating stores like you'll do in Flux, you'll write reducer functions that will change a single object state. This object represent all the state in your app. In Redux you will get the current action and state, and return a new state. That mean that actions are sequential and state is immutable. That bring me to the most obvious con in Redux (in my opinion).

Redux is supporting an immutable concept.
Why Immutability?
There are few reasons for that:
1. Coherence - store's state is always being changed by a reducer so it's easy tracking who change what.
2. Performance - because it's immutable, Redux only need to check if previous state !== current state and if so to render. No need to loop the state every single time to determined rendering.
3. Debugging - new awesome concepts like Time Travel Debugging and Hot Reloading.
UPDATE: if that wasn't persuading enough, watch Lee Byron excellent talk about Immutable User Interfaces.
Redux require a developer(s) discipline through the codebase/libraries to maintain this idea. You'll need to make sure you pick libraries and write code in a non-mutable manner.
If you'd like to learn more about the different implementation of Flux concepts (and what works best for your needs), check out this useful comparison.
After said that, I must admit that Redux is where JS future development is going to (as for writing these lines).
Answer: One of the largest benefits in using Redux over the other Flux alternatives is its ability to reorient your thinking towards a more functional approach. Once you understand how the wires all connect you realize its stunning elegance and simplicity in design, and can never go back.
Answer: I prefer using Redux as it uses one store which makes state management much easier compare to Flux, also Redux DevTools it's really helpful tools which let you see what you doing with your state with some useful data and it's really inline with React developing tools.
Also Redux has got more flexibility using with other popular frameworks like Angular.
Anyway, let's see how Redux introduces himself as a framework.
Redux has Three Principles which can introduced Redux very well and they are the main difference between Redux and Flux also.
Single source of truth

The state of your whole application is stored in an object tree within
  a single store.
This makes it easy to create universal apps, as the state from your
  server can be serialized and hydrated into the client with no extra
  coding effort. A single state tree also makes it easier to debug or
  inspect an application; it also enables you to persist your app's
  state in development, for a faster development cycle. Some
  functionality which has been traditionally difficult to implement -
  Undo/Redo, for example - can suddenly become trivial to implement, if
  all of your state is stored in a single tree.

console.log(store.getState())

/* Prints
{
  visibilityFilter: 'SHOW_ALL',
  todos: [
    {
      text: 'Consider using Redux',
      completed: true,
    },
    {
      text: 'Keep all state in a single tree',
      completed: false
    }
  ]
}
*/

State is read-only

The only way to change the state is to emit an action, an object
  describing what happened.
This ensures that neither the views nor the network callbacks will
  ever write directly to the state. Instead, they express an intent to
  transform the state. Because all changes are centralized and happen
  one by one in a strict order, there are no subtle race conditions to
  watch out for. As actions are just plain objects, they can be logged,
  serialized, stored, and later replayed for debugging or testing
  purposes.

store.dispatch({
  type: 'COMPLETE_TODO',
  index: 1
})

store.dispatch({
  type: 'SET_VISIBILITY_FILTER',
  filter: 'SHOW_COMPLETED'
})

Changes are made with pure functions

To specify how the state tree is transformed by actions, you write
  pure reducers.
Reducers are just pure functions that take the previous state and an
  action, and return the next state. Remember to return new state
  objects, instead of mutating the previous state. You can start with a
  single reducer, and as your app grows, split it off into smaller
  reducers that manage specific parts of the state tree. Because
  reducers are just functions, you can control the order in which they
  are called, pass additional data, or even make reusable reducers for
  common tasks such as pagination.

function visibilityFilter(state = 'SHOW_ALL', action) {
  switch (action.type) {
    case 'SET_VISIBILITY_FILTER':
      return action.filter
    default:
      return state
  }
}

function todos(state = [], action) {
  switch (action.type) {
    case 'ADD_TODO':
      return [
        ...state,
        {
          text: action.text,
          completed: false
        }
      ]
    case 'COMPLETE_TODO':
      return state.map((todo, index) => {
        if (index === action.index) {
          return Object.assign({}, todo, {
            completed: true
          })
        }
        return todo
      })
    default:
      return state
  }
}

import { combineReducers, createStore } from 'redux'
let reducer = combineReducers({ visibilityFilter, todos })
let store = createStore(reducer)

for more info visit here
Answer: Redux require discipline regarding to immutability. Something I can recommend is ng-freeze to let you know about any accidental state mutation.
Answer: As far as I know, redux is inspired by flux. flux is an architecture like MVC (model view controller). facebook introduce the flux due to scalability problem when using MVC. so flux is not an implementation, it just a concept. Actually redux is the implementation of flux.


Code Review Strategies

Question: As per my information, there is no hard and fast rule for doing a security code review but we all develop our own strategy for the same. I was wondering if we all can share the different strategies involved or used in security code review.
Answer: As @sonofaaa mentioned, in the book, "The Art of Software Security Assessment", the authors discuss code-auditing strategies in Chapter 4 (end of Part I).
In particular, external flow sensitivity (data flow and control flow) and tracing direction (forward or backwards slicing) are discussed along with many neutral methods of review. Other topics are discussed in great detail. It's the best written material on the subject of secure code review.
I should also mention "Secure Programming with Static Analysis" -- a book by Brian Chess and Jacob West of Fortify Software. They cover the internals and use of security-focused static analysis tools and compare them to other forms/tools in the secure code review world.
If you want to check out modern security-focused static analyzers, I suggest that you first get involved with some open-source or free tools such as CAT.NET for .NET (typically C#, VB.NET, and/or ASP.NET), find-sec-bugs (or the older LAPSE+) for Java Enterprise and JSP, and RIPS Scanner for PHP. You won't commonly find security-focused static analyzers that support dynamic languages, because they don't rely on a type system, but let me know if you are interested in support of Python, Ruby, or another dynamic language (or any other language) and I'll try to point you in the right direction. For starters, try Bandit (OpenStack project for Python code) and Brakeman Pro for Ruby.
Commercial security-focused static analyzers are meant for highly trained and specialized application security oriented developers. The cost of them assumes that someone will be running and analyzing these tools daily, as a full-time job, all year round. If you are interested in seeing quick results -- check out HPFOD -- but if you are interested to integrate these tools into a long-term, at-risk application portfolio for a large-installation -- check out Cigital ESP. There are also many application security boutiques and consulting shops that run and tune these tools for their clients. Depending on your locale and strategic direction, I would choose to partner with one regardless of anything else I mentioned, as they can be invaluable to success of an appsec program. Searching on LinkedIn for "application security consulting" should work if you don't where to go next.
Comment: Hi atdre, do you have any suggestions for Python static analysis?
Comment: @ paj28: for which parts of the app stack in Python? in webapps, there's -- https://github.com/sdelements/django-security -- from the people who make this product -- http://sdelements.com/features/ -- not static analysis, but clearly all huge wins for appsec that go beyond the norm
Answer: Contrary to your statement, I believe that (security) code review should not be a mostly ad-hoc activity. There are some pretty strong methodologies for doing an efficient code review. For best results, this should be done incrementally and iteratively.
Here is a sample of a high-level outline of such a methodology, with some guiding principles:

Understand your system (architecture, design, ...). Use a prepared question list...
Decide clear objectives

scope
constraints
goals
non-goals!
types of security issues
time limit

Analyze threats (e.g using Threat Modeling) to help focus on high-risk areas
Preliminary scan using automated tools
Review complex / fragile sections

Complex code (e.g. Cyclomatic complexity)
Areas with high number of historical bugs
Even many "false positives" from automated scan

Identify data validation for all input

Account for trust issues

Data output in web pages
Specifically review all security mechanisms in depth (e.g. authentication, crypto, etc)
"Interesting" junctures, e.g.

Creating processes
Threads and synchronization (especially in static methods and constructors)
Resources Access (e.g. data access, file system, etc)
Default code
Elevated privileges
Unauthenticated access
Networking

Language specific issues,

e.g. for C/C++: buffer overflows (stack/heap), integer overflows, format strings, dynamic LoadLibrary()s, "banned" APIs, etc.
or for .NET: InterOp, reflection, dynamic Assembly.Load(), CAS/Full/Partial trust, unsafe code, etc.
Comment: Don't you agree that a few of the above mentioned points are part of the design review. Code review compliments the design review too but still I was looking for an approach which could be used independently and save my time and help me in finding most of the vulnerabilities. Your well defined points would always help but by asking this question, I wanted to see if there are any methodology/strategy/checklist which can be followed.
Comment: @p_upadhyay - I think in order to do it effectively, you should be tied in as early as possible in the process - in design
Comment: @p_upadhyay I absolutely agree with @Rory's comment. However, in situations where that is not possible, or you're pulled in only at that late stage - then yes, I would agree with your comment that this has some design review built in. But that is "by design" - if you don't understand the architecture and design of the system, your code review will not be effective, nor as efficient. So yes, you definitely need to base your CR on your DR...
Comment: Agree with both of you..
Answer: I usually start with a checklist. Say the OWASP top 10 or the CERT C coding guidelines (or the section in my own book!). I get the team to evaluate the code with relation to the checklist, and also to do undirected testing and review. "popular" issues from the open review get added to the checklist, replacing non-issues which were on there originally.
In addition, static analysis tools are used where available.
The benefit of this approach is also its biggest drawback. Issues from the checklist are easily spotted, but are often the only problems found as creative bug-hunting is not easy.
Answer: TAOSSA Part I covers several approaches and hybrid scenarios, and Brandon Edwards does a great job of going over technology agnostic review strategies and common pitfalls of large reviews in the videos here (http://pentest.cryptocity.net/code-audits/)
Answer: Some methodologies can slightly differ depending on what you are auditing - for web applications it can be one, for C/C++ applications another. Also, it depends on whether source code is available. But, generally, it involves following stages:

Black-box software testing - using scanners, fuzzers or manually;
Source code auditing when available - again using scanners or manually.

During this process static or dynamic code analyzers are used. Which one to use is up to you, links I gave might help you.
However, very often you have to check software that was previously audited by you, then you can make your job easier. For source code you can use WinMerge, that would allow you to find differences between old and new version. For binary you can use Darungrim, BinDiff.
Topics that might have sense to read regarding current question can be found here around:

Automated tools vs. Manual reviews,
Code Analysis: Binary vs Source,
Can anyone suggest good open source tools for scanning source code for vulnerabilities?.

Code Review Strategies


How to determine fixed end moment in beam?

Question: Why the Fixed End Moment (FEM) for  BC is 3PL / 16?
It's clear in the first figure that  that when one end is fixed, while the another end is pinned, then the fixed end moment is 3PL /16 ... But for the span BC, we could see that B is the roller and C is the pinned connection, there's no fixed support in the span BC
Answer: If you look at the structure (ignoring the loading), it is symmetrical: two spans of equal length, with pins on the extremities and a roller in the middle. It is also a hyperstatic (or statically indeterminate) structure, with more unknowns than static equilibrium equations.
You might therefore be tempted into simplifying this model into a single fixed-and-pinned beam. After all, a symmetrical load on both spans will cancel out the rotation at B, and a point with bending and no rotation is equivalent to a fixed support. So why not simplify the model into a single span? Sure, it's still hyperstatic, but it's a classic condition with known reactions as given by your tables.
Well, obviously the problem is that, in this case, the loading isn't symmetric. So what do you do?
You ignore that little detail and momentarily pretend that you are in fact dealing with two fixed-and-pinned spans. You then calculate the moment reaction at the "fixed" point B for each span. You then use slope-deflection equations to figure out what the actual rotation around B is and use that to recalculate your reactions.
So let's take this one step at a time.
Assume AB and BC are pinned-and-fixed beams and calculate the moment reaction at B in each case using your tables:

$$\begin{alignat}{4}
M_{B,AB} &= \dfrac{P}{L^2}\left(b^{2}a + \dfrac{a^{2}b}{2}\right) &&= 52.5\text{ kNm} \\
M_{B,BC} &= \dfrac{3PL}{16} &&= -30\text{ kNm}
\end{alignat}$$
Note that $M_{B,BC}$ used the top-right case from your table since the load was centered, while $M_{B,AB}$ used the next one below since the force is off-center. Also note that the structure in both cases is the same: a fixed-and-pinned beam.
Also note that the results for $M_{B,AB}$ and $M_{B,BC}$ aren't equal, which tells you that the assumption that point B was the same as a fixed support with no rotation was incorrect.
You therefore use the slope-deflection equations to figure out the relationship between bending moment and rotation for each span, use them to calculate the actual rotation around B, and then use that to calculate the actual bending moment around B:
$$\begin{alignat}{4}
M_{B,AB} &= \dfrac{3EI}{8}\theta_B + 52.5 \\
M_{B,BC} &= \dfrac{3EI}{8}\theta_B - 30 \\
M_{B,AB} &= M_{B,BC} \\
\dfrac{3EI}{8}\theta_B + 52.5 &= \dfrac{3EI}{8}\theta_B - 30 \\
\therefore \theta_B &= \dfrac{-30}{EI} \\
\therefore M_B &= \dfrac{3EI}{8}\theta_B + 52.5 &&= -41.25\text{ kNm} \\
&= \dfrac{3EI}{8}\theta_B - 30 &&= -41.25\text{ kNm}
\end{alignat}$$
(I just calculated $M_B$ twice to show that you can use either of the equations to find its value, obviously)
With that you have the actual moment at B and have solved the problem.
Answer: The fixed end moment is the moment at the joint if it were held to not be rotated, or if it were fixed. This is why the moment is 3PL/16, because B is "fixed" and C is pinned.
Answer: The problem mentioned that support A and C are both pins, therefore you should use the modified slope-deflection equation.
Comment: This doesn't really answer the question of **why** to use $\dfrac{3PL}{16}$ in this case, given that there are no fixed supports. Or of what's the relevance of those calculations before the slope-deflection equations.


Unable to transfer ETH from contract wallet to main account

Question: I have installed Mist 0.9.3 on Linux.
I have a main account with 0 ETH and a contract wallet with 0.21 ETH.
I am in full sync.
I try to transfer ETH from the contract wallet to the main account in Mist: the 'transfer' window shows the icon for my main account (with 0 ETH) but displays: My wallet: 0.21 ETH.
when I try to transfer, I get 'insufficient funds for gas * price + value, probably because it's trying to draw from the main account, which has 0 ETH.
How can I transfer the ether from my contract wallet to my main account?
I've tried on myetherwallet, but that only imports the keystore for my main account, which has 0 ETH. I think I'd need to import from the contract wallet first - so back to square one.
This is similar to Can't send from wallet contract to main account with Ethereum Wallet 0.9.0 - but with version 0.9.3
I'd try on Windows but I am not sure how to import my contract wallet there. I will soon run out of space with this full sync mode, but I do not think the light (beta version would work better).
Answer: In order to interact with contracts on the Ethereum network, you need gas to pay. Transactions also can't be made from contracts, only by private/public key pairs. So the account you're using to interact with your contract wallet needs to have Ether in it in order to interact with the contract wallet, hence why you're getting the "insufficient funds for gas * price + value" error.


Need help identifying adult tricycle

Question: I picked up an old adult tricycle to restore at a yard sale. It needs plenty of work and needs a bunch of new parts (spokes, fenders ect.), however I do not know anything about the tricycle except for the serial number that was found on the headtube. The numbers being HC0755083, I have seen no other identifiable markings, leaving me to wonder if it is perhaps a custom made tricycle. Any help would be greatly appreciated!
Comment: Your new bike will use standard bike parts for almost everything.    Spokes will be normal, the front fender/mudguard will be normal.   The parts that could be odd will be the transmission from the chain out to the drive flanges on the two back wheels.  I'd recommend adding a front brake too.
Comment: Please upload photos. Without a photo or two we really can't help you. The serial number would possibly help the manufacturer identify the exact trike, but that doesn't help us.
Answer: HC start to the serial number is for   Huffy Corp. . The front sprocket styling is common Huffy style . Likely mid/late 60's or early 70's production . Are the tires 24 x 1 3/8 ? these should be available at bike shops .  If your rear wheels have 28 spokes this is a lighter duty unit and replacement rims could be hard to find . Commonly equipped with a Shimano 3 speed coaster brake mid-hub and a Peerless differential (used on lawn equipment and go-karts ) yes 2 wheel drive .
Good luck and happy hunting for restoration parts , patience too .
Comment: Yeah, the front fork is a classic Huffy design from 1970 or so.
Answer: Most bike shops have access to parts for adult trikes, no matter who the manufacture was, taking the trike in is always a plus (I know it's a hassle) but call first to make sure your working with a shop willing to help you before you haul it in.
I've sent a message with the serial # to one of my vendors to see if it's one of their models (I'll respond later with an answer), no matter; adult trikes used pretty standard bike parts.
please upload Pics I'd like to see it.
later,
Sun trikes informed me that it's not one of theirs, and by seeing the pics
it's probably not a (professional) custom built.
you should be able to find parts for it, just make sure the frame isn't compromised or it's just not worth fixing, you can buy a new one for 300-500 US.
I hope this helps & if you do decide to get rid of it gift it to a local bicycle collective they maybe able use parts off it.
Answer: That is a Huffy 3 speed trike.
Comment: Welcome to the site - Yes, that is already in Hamish's answer from 2016.   Consider upvoting that answer instead of duplicating.  You can also take a moment to read the [tour] and learn how SE's Q&A format works.
Answer: I have one of these and it's a Free Spirit Ted Williams Jr. Edition Tricycle. Shimano 3 speed hub. Sold by Sears and Roebuck. I Just started the restoration of mine.

Need help identifying adult tricycle