Closing MySql Connection in Drupal7

Question: How can I explicitly close a MySql Connection in Drupal 7?
I have a requirement of inserting back to rows to a DB table in Drupal..
I tried using db_insert/db_update and db_query.. In both cases I got the error Max number of SQL connections reached..
I am speculating that Drupal is maintaining these connections one per query and not closing them..
Hence I need to know if there is any way I can do it explicitly.
Comment: Most webservers reuse connections, and they are closed or freed for reuse at the end of PHP script anyway, so either 1) you have simply not enough of them to serve your traffic and explicit close is not likely to help or 2) your server is seriously misconfigured and explicit close is not likely to help. Also, if you close connection before Drupal ends it's natural flow, you may encounter errors, like Drupal failing unable to write to watchdog about some minor issue. So **don't do it**. Not until you really, really well know how DB access works in Drupal.
Answer: The specific function you are looking for in the database abstraction API is db_close() but you may be able to solve your problem through another route by increasing your max connections.
See this earlier thread on drupal.stackexchange for guidance on increasing max_connections. You might also be having a problem with slow / stalled queries that are trying up limited query slots, this thread offers advice on how to debug.
Comment: I am running just 1 script with multiple db operations i dont think incresing DB connections should be an advisable solution as this is just being called for a single user..
Comment: I will try db_close and see if that helps .. Thanks

Closing MySql Connection in Drupal7


What are some practical things we can do to bring Moshiach?

Question: I am looking for the best and most practical suggestion as to what any average person can implement on a daily basis to help bring Moshiach. This could be either a positive action or refraining from a negative action. Please provide sources for why your answer should be effective, and be specific as to why you think your answer is most practical.
Comment: I feel like this is something someone could write [a whole book about](http://en.wikipedia.org/wiki/Shulchan_Aruch).
Comment: @msh210 Fair enough. But FTR my first comment stands.
Comment: Duplicate: http://judaism.stackexchange.com/q/9617/759
Comment: @DoubleAA, nice find. This one has more answers (in fact the only one there is sort-of duplicated here, and by the same answerer) and this question is I think worded better, so I'm closing the *other* as duplicate.
Comment: What is the meaning of life?
Answer: In short, do Mitzvot. The Rambam writes (Teshuva 3:4):

Accordingly, throughout the entire year, a person should always look at himself as equally balanced between merit and sin and the world as equally balanced between merit and sin. If he performs one sin, he tips his balance and that of the entire world to the side of guilt and brings destruction upon himself.
[On the other hand,] if he performs one mitzvah, he tips his balance and that of the entire world to the side of merit and brings deliverance and salvation to himself and others. This is implied by [Proverbs 10:25] "A righteous man is the foundation of the world," i.e., he who acted righteously, tipped the balance of the entire world to merit and saved it.

This article brings lots of practical suggestions of Mitzvot that are "Particularly Propitious for Hastening the Redemption". It brings sources from our sages about various Mitzvot that were told bring the Redemption.
Here's a bullet point list of some of them, see there for more, as well as explanations and sources:

Yearning
"Even if the Jews have only the yearning for Moshiach, they are worthy of redemption" --Midrash Yalkut Shimoni.
Teshuvah (Repentance)
"If Israel does teshuvah, they will be immediately redeemed." --Talmud (Sanhedrin 97B)
Charity
"Great is charity for it hastens the Redemption" --Talmud, Bava Batra 10a.
Love and Kindness
"Why was the Temple destroyed? Though the Jews were involved in Torah, mitzvot and acts of kindness, they were guilty of harboring baseless hatred towards each other" --Talmud, Yuma 9b.
Study Jewish Law
"The ingathering of all these exiles will be only in the merit of the Mishnah" --Midrash Rabbah, Leviticus 7:3.
See (and Thank G-d for) the Miracles
"G‑d wished King Hezekiah to be the Moshiach. Said the Attribute of Justice to G‑d: 'Hezekiah, for whom You performed so many miracles, has not sung Your praise. You will make him Moshiach?!'" --Talmud, Sanhedrin 94a.
Have Children
""The Son of David will not come until the heavenly soul repository is emptied" --Talmud, Yevamot 62a.
Keep Shabbat (and encourage others to do the same)

Learn Torah -- From the Ohr HaChayim HaKadosh quoted in this answer.
Comment: I don't have a source, but pretty sure I saw something in the name of the Vilna Gaon zat"zukl along the lines that specifically learning "sod" brings the redemption nearer (not sure if that is his commentary on the Zohar Chadash brought in the Ohr HaChayim HaKadosh bullet or not)
Answer: Be as machmir (stringent) with mitzvos bein adam lechavero (commandments concerning interpersonal relations) as most people are with mitzvos bein adam leMakom (commandments concerning Divine service).
We lost the first Beis HaMikdash because of Avoda Zara (Yoma 9b).  Correcting this sin brought us the second Beis HaMikdash.
We lost the second Beis HaMikdash because of Sinas Chinam (ibid).  It stands to reason that we must correct this sin to bring the third.
For practical approaches to this, I would personally recommend in-depth study of Likutey Moharan (especially ל״מ א:רפב) and Chofetz Chaim.
Comment: @Fei23 That's a very different thing. Basically Herod "decked out" the already existing Second Temple, which was constructed by Ezra and Nehemiah.
Comment: is not true that Herodes also built pagan temples?
Comment: @juanora - Herod did not build the Second Temple. Nehemiah and Ezra did.
Comment: @Ezra Herod built the second "second" temple, pretty sure it's in Taains/Bava Bathra
Answer: The Baal Shem Tov wrote in a letter to his brother in law that he went up to the spiritual palace of Moshiach and asked him "When will you come?"
Moshiach answered him "When your teachings will be spread out and will become known in the world, and your wellsprings (of what I taught you and what you understand) will be spread out, and everyone will be able to do Yichudim and Alyiyos like you. Then all of the Klipos will be destroyed, and the time will be auspicious for the redemption".
Comment: How do you do yechidim and aliyoyos?
Answer: We are not allowed to "bring Moshiach" or do anything which would "hasten the End", as the Rashbash (Shailos v'tshuvos #2) writes:
אמנם מצוה זו אינה מצוה כוללת לכל ישראל בגלות החל הזה, אבל היא נמנעת כלל כשז"ל בגמרא כתובות פרק האחרון שהיא מכלל שבועות שהשביע הקדוש ב"ה את ישראל לא ימהרו את הקץ ושלא יעלו בחומה, וצא וראה בני אפרים מה קרה להם שמהרו את הקץ
"that we are are not allowed to "hasten the end" and see what happened to the children of Ephraim who hastened the End."
The bnei Ephraim were said to have left Egypt earlier than they were supposed to and were described as דוחקי הקץ, people who forced or hastened the end. (For more info see here)
So our mission is just to keep the Torah and not worry about God's plans for the End; the idea that we should actively attempt to bring about the End is highly problematic.
Comment: I think there is a difference between what the Bnei Efraim did and "bringing Moshiach". See my answer for several statements of the Sages that explicitly talk about actions that bring Moshiach, the most blatant being "Great is charity for it hastens the Redemption" --Talmud, Bava Batra 10a. The way your answer is presently worded implies that one is forbidden to give Charity, since it would "bring Moshiach".
Comment: @Menachem I don't think my answer is worded in such a way to give that impression; it seems clear to me that there is a difference between doing the mitzvah of charity l'shma (for which God may then decide to redeem us), and doing the mitzvah of charity "in order to bring Moshiach", which seems to be forbidden. I understood the original question to be, what can we do "in order to bring Moshiach"? Otherwise, yoel is correct that the question should just be, "What should Jews do? period.
Comment: Wouldn't all the other answers apply just as well if the question had been asked as "what can we do to avoid impeding Moshiach?"
Comment: What would you do with the story in Bava Metzia 85a, where Rebbi, having found out that R. Chiya and his sons have the power to bring Moshiach, indeed called on them to lead the prayers in an attempt to do so? It is true that the Gemara there continues that Hashem sent Eliyahu to halt the attempt, but the point is that Rebbi wasn't concerned about inappropriately "hastening the end." So I think @Menachem is correct: doing mitzvos (even with that intention in mind) is one thing, a mass movement to leave galus - which is what Rashbash is talking about - is something else.
Comment: @Alex I think you will like the tshuva in Mishneh Halachos 11:1, who uses precisely that proof that we can pray for moshiach and the redemption. But, I think you are making my point -- prayers for redemption are part of our tefillah, they are nothing special or beyond what the Torah commands. What the Rashbash is talking about is some sort of action or campaign with the purpose to "bring Moshiach" (like I explained a few times now). Obviously, we should fulfill mitzvos like tefillah.
Comment: @Curiouser: but that's just the point! It wasn't just Rebbi himself davening for Moshiach, but appointing as shluchei tzibur the three people whom he knew to have the power to actually bring him.
Answer: Stop lashon hara, stop accepting lashon hara. I'd say this is the #1 thing keeping Moshiach from coming, if we stop lashon hara, we stop senseless hatred, and ahavat yisroel is our biggest motive for bringing Moshiach. Learn Kabbalah, study Chofetz Chaim (laws on lashon hara), Mussar, and give Tzadakah! Make that 10% into 15%. And finally, motivate others to do the same!
Comment: Can you provide a source that Lashon Hara (specifically) is what is holding back Moshiach?
Comment: The Chafetz Chaim's hakdamah to the Chafetz Chaim.
Answer: Lubavitcher Rebbe says living a life like moshiach has already come and learning about the geula is what will hasten the moshiach.
Comment: Where did he say this?
Comment: What does "living a life like moshiach has already come" include? Does that mean making Aliyah? Keeping Tumah/Tahara rules? Eating on Tisha Bav?
Comment: @user613 Of course if you write something sufficiently ambiguous with sufficiently imprecise sourcing, it's almost impossible to have said something wrong. That's hardly a reason to upvote an answer which is of practically no use to us.
Comment: @DoubleAA While there's nothing wrong in the answer, it's very incomplete. The Rebbe discussed this topic a lot. I'll try and post a complete answer when I have time. But it doesn't not mean doing the halachos that only apply for when moshiach comes.
Answer: Learn Days Are Coming by Rabbi Moshe Silberstein.
It's an In-Depth Analysis of the Practical Halachos Relevant to Visiting the Bais HaMikdash.
Why? The Chofetz Chayim says, "If we were truly yearning for the final Redemption and waiting each day for its arrival, then we would be preparing ourselves by learning the relevant halachos, for there are many halachos to be learned and they cannot all be covered in a short time…  For if it would be revealed that in a short time the final Redemption would arrive, then certainly millions of Jews would quickly learn the halachos to the Beis HaMikdosh, since at that time all of these halachos will be applicable, not only for kohanim but for all Jews, for instance, the halachos regarding eating karbonos and visiting the Mikdash… Therefore, if we are truly waiting and yearning for the final Redemption… we too should arouse ourselves and learn these halachos with all our strength" (Torah Ohr, chapter 12)
Another seifer that one can learn is Geulah BeRachamim by Rabbi Pinchas Winston. It contains 60 daily lessons to yearn for redemption. Yearning for redemption is not only a mitzvah, it is crucial for surviving the events at the End-of-Days. How does one develop such a yearning? By reading this book and taking its 60 lessons to heart.
Comment: -1 See the question: "Please provide sources for why your answer should be effective, and be specific as to why you think your answer is most practical."


position expression

Question: Im trying to do an expression to my object. I want to make him come out from the side to center. I searched a lot but I didnt find any expression. I can do it with keyframes but I need expression only.
Please, can someone help me with expression?
Answer: Expressions work by returning a value to the property to which they are applied. So if you apply an expression to the position property and you put in the expression
<code>[1,2]
</code>
in the expression editor, it will return the value [1,2] so that will be the position of that layer, i.e x= 1 y=2. Because the values 1 and 2 don't change, it will stay there forever.
If you have an expression on the position where the x value increases over time then the layer will move right. So for example if you put the expression
<code>[time, thisComp.height / 2]
</code>
the layer will start at [0, 540] (if the comp is 1080 px high) and move right at the rate of 1 pixel per second. For a HD frame it will reach the right side at around 1:17:20. That might be too slow, but you can use maths to adjust it. For example to make it twenty times as fast you could multiply it by 2, like so:
<code>[time * 20, thisComp.height / 2]
</code>
So in the expressions editor you can see the drop-down with the available objects, properties and methods. You can use these along with the pick-whip to build up the expression to do whatever you need.
You might want to start looking at Dan Ebbert's site. I can't quite believe that anyone could spend any time researching expressions and not find this site in the search results.

position expression


Who should be driving performance discussions? The manager or the employee?

Question: Whose responsibility is to setup one-on-one meetings? Is it the manager or the employee? What about performance reviews? My manager just sent a schedule for performance review and said I will work with you but did not setup any meeting. Does this mean I have to schedule one?
Comment: Welcome to The Workplace @C6225510.While I appreciate your acceptance of my answer, I want to point out that we generally encourage you not to accept an answer too quickly. You may want to give other people a chance to submit an answer as well and accepting early tends to discourage other people from replying. You are free to change or remove the mark-as-answered tick at any time and you may want to do so and wait [one or two days](http://meta.stackexchange.com/a/5235/260382) before evaluating the answers you received and accepting the one that you found the most helpful.
Answer: Generally the person who wants the meeting sets it up
As a general rule, it makes more sense for the person requesting it to set it up as they are the one who may need to prepare for the meeting. If you are seeking a raise and want to prepare a case for that, scheduling the meeting yourself could make sense.
If you want to have this meeting, prompt your manager to schedule it or schedule yourself. Who does it exactly in that case is irrelevant.  If you don't want it, you don't need to schedule it and there is a decent chance it will be forgotten. I find virtually any kind of meeting to not be terribly useful, so am usually happy to let ambiguity lead to not having a meeting. 80% of the time, the hypothetical meeting is never mentioned again and the other 20% of the time, they schedule it.
Answer:
Who should be driving performance discussions? The manager or the employee?

The manager. As the name implies, managing people should be the most imporant part of the job and performance discussions and reviews are some of the most important responsibilities in people management.
It should be up to the manager to give consistent and regular feedback to the employees that they manage. Managing is all about building a strong team that can deliver results. A manager needs to coach his reports so that those who are struggling have a realistic path towards improvement but also so the ones that are doing well are given what they need to do even better.
All this means that it's the manager's responsibility to provide feedback moments to their employees in whatever way that they prefer. Typically the company has procedures on this but each manager will have a different way of giving feedback and preparing for formal reviews.
The actual scheduling itself is a simpler matter. That's more of an admin task so managers will routinely ask their employees to schedule those feedback moments themselves. The manager will give some indication of how often to meet or when specific formal steps need to be done. Some will prefer to schedule things themselves, some will just ask you to do so.
In your case, it sounds like your manager didn't tell you who should schedule the actual feedback conversation. So just ask them.
Of course this assumes a semi-competent manager and there are plenty out there who aren't. In case the issue is less about scheduling and more about an overall lack of feedback or a manager who's not taking performance meetings seriously, you need a different approach. While it should be up to the manager to give good feedback and have performance discussions, if they don't that doesn't mean you can't push for that! And you should. You can set-up additional feedback comments, ask for actionable feedback, discuss ways to improve and so on.
As an example, plenty of managers only do the bare minimum of feedback conversations that are required by company procedures. But that doesn't mean you can't set-up additional conversations outside that formal process. You get to push for feedback and input from your manager. It may take more work from your side than it should but it's absolutely worth doing. Even bad managers shouldn't object to you asking for more feedback.
Comment: +1 for **Just ask.** That may well be the short answer to about half of all Workplace questions.
Comment: @O.Jones: "Just ask" may we very well bad advice, depend on the  local culture.
Answer:
Whose responsibility is to setup one on one? Is it the manager or the employee?

It's just a meeting. I wouldn't overthink it. I would just ask my manager if they would like to set up the 1:1 meeting or if they would like me to set one up. Usually I would say the onus is on the manager to set up the performance 1:1 with their direct report. But if you have regular 1:1s with other people or if you have skip level 1:1s, then I would say the onus is on you.
Answer: The responsibility for 1:1s and performance reviews are not always the same.
Performance reviews, whether held quarterly or annually are the managers responsibility to ensure these meetings take place. This does not necessarily mean that they will own the calendar appointment, they could for example tell you to book a free slot in their calendar but if you do not then they should follow this up with you directly.
1:1 checkups for building working relationships, development, coaching, etc. are not so straight forward. The ownership will depend upon organisation and the individuals involved. Personally, I send my directs a list of available times with the request to select a slot that works for them and I create the booking, but if you let the report own the meeting this has the benefits of the manager needing to consult the report to change the calendar item.
If your manager has sent you a list of available times (or a schedule) for your performance review, it is possible they are simply waiting for a response with a time that suits you. It's impossible to say without seeing the email so as the other answers mention, rather than waiting and wondering who is responsible, please ask them. Being proactive and showing initiative when communication breaks down is what you should do in this situation.
Answer: Who is first is not always important, but if you offer 2, 3 or 5 suitable slots to your manager so they can easily pick one it can make it quicker for them.


Litecoin - how to calculate the difficulty from 2^-N

Question: In the following list I always see difficulty values like 2^-12
How to calculate the actual difficulty from it?
Comparison of mining pools
Answer: First of all, actual difficulty is defined as the number d such that the probability of a random hash being valid is 1/(d*2^32). In other words, the hash needs to have at least 32 + log_2(d) zeros in front of it to be valid. (This is not exactly the case if d is not a power of 2, but you get the general idea.)
In that article, a difficulty of 2^-12 means that the probability of a random share being valid is 1/(2^-12 * 2^32) = 2^-20. Note that typically, pool difficulty, is measured in multiples of 2^-16 for reasons discussed in the article, so a difficulty of 2^-12 would be a pool difficulty of 2^4 = 16.
Answer: These figures represent the difficulty at which the respective mining pool accepts a hash as a share of the mining pool's work. The actual network difficulty cannot be calculated from these figures.
Explanation:
While Bitcoin uses SHA256 as the hashing algorithm, Litecoin uses Scrypt which is much more complex.
Therefore, a Litecoin difficulty of 1 represented a much greater amount of work than a Bitcoin difficulty of 1. If Litecoin mining pool operators would have accepted only hashes that fulfilled a difficulty of 1 or greater as valid shares, they would have only accepted valid blocks as shares, essentially reducing their contributors to solo miners. In order to estimate the work done by their contributers, they allowed hashes that fulfilled a much lower difficulty as shares, as seen in the linked website.


Why was Kakashi Hatake doing all of the hard work in the episode when they first fought Zabuza?

Question: Naruto, Sakura, and Sasuke were standing back, and Kakashi was fighing Zabuza all by himself. Why?
Comment: Why *wouldn't* Kakashi do most of the fighting that battle? Criminal mercenary, demon of the hidden mist, one of the 7 legendary ninja swordsman vs 3 rookie genins wouldn't really be an even fight
Comment: Because all of them were rookie.
Comment: but with naruto and them wouldnt it have been easier if the all helped
Comment: Naruto, Sakura, and Sasuke at least couldve hit a combo move
Comment: what do yuo meen by rookie naruto still had power right?
Comment: Like @Wondercricket said, why wouldn't Kakashi take care of it by himself? Doesn't it make sense for a highly experienced ninja to fight another? The rookies would have caused trouble for themselves or put Kakashi in a hard spot, if they intervene. Also, Kishimoto decided that will be the plot.
Comment: Naruto had power but he was inexperienced in combat. That's why Kakashi took the charge.
Answer: At that time, the members of Team 7 has just passed from the Academy, they were just kids. Sakura couldn't help much because she was very weak, she hadn't learnt medical ninjustsu to reinforce her punches. Sasuke may have been a bright child but he was still an amateur and he hadn't awakened his Sharingan. Even if he had awakened it, Zabuza was a formidable opponent, one of the Seven Ninja Swordsmen. And Naruto didn't know any jutsu other than Shadow Clones, and he didn't have control over Kurama's power. But Naruto and Sasuke did fight against Haku if not Zabuza. It's obvious that the strongest team member Kakashi should fight against Zabuza since he's so strong.
P.S. I think you have not watched the Naruto series and you've only watched the Shippuden series.
Comment: @F1Krazy It's not really relevant to the the answer but what I meant is that he would have understood if he had watched Naruto. because it seems like he thinks Naruto was very strong even in that time period.
Comment: I don't see how your PS is relevant.
Answer: If you are talking of the very first fight that happened between Zabuza and Team 7 then you are talking of the incident when they were still escorting the builder back to the 'Land of Waves'.
In that case there are a couple of things to consider. First, the trio of the Team 7 genins were fresh out of the academy and this was their first mission which was meant to be C or D class but turned to be a A class mission. Second, Naruto might have just taken the oath to never fallback from a fight when they were attacked before by the brother assassins from the Mist but the essence was he was still a child who could not control his chakra well and only had one proper move which was the Shadow Clone Jutsu. At the same time though Sasuke was smart and talented, his experience was quite lackluster in front of Zabuza. As for Sakura, she was not at all in the race to begin with, even thiugh she had better chakra control then the other two.
So it made sense that Kakashi fought one on one with Zabuza. Even after that though it was not as if Naruto and Sasuke did not lend a hand with their combo-sneak attack by helping Kakashi Hatake out of the tough spot when he gets caught in the Water prison of Zabuza's creation.


Can I keep my Dracaena cutting in water long term?

Question: A while back I was given a Dracaena (I'm not sure of the species, but its leaves are narrow and about 12 x 0.5 cm) that was in pretty poor shape (it was grown to around 1.3 m high and had three branches) but I took a cutting, placed it in a jar and roots have emerged. The longest roots are now around 7 cm long. I really quite like how it looks, and it's putting on good leaf growth as well as the roots. Could this be a long term setting for the Dracaena? The only potential issue I see so far is a wet stem up to about 1cm of the water line, I'm unsure whether this may cause issues in a few weeks/months.
Answer: You can keep it in water long term, but only the roots the stem should be kept dry.  What you have is a very very basic hydroponic set-up.  You will need to change the water often to keep fresh water that is full of oxygen.  You will want to use a heat mat to keep the temp of the water around 20°c (70°f).  You do not want the water to get too hot, because warm water holds less oxygen, but you do not want it to be cold, because this a tropical plant.    You will need to add nutrients.  It is important that you use nutrients developed for hydroponic crops.   You also want to make sure your container is not see through.  A see through container will get algae build-up once you start adding those nutrients.  This becomes a much bigger project than it would be if it were planted in soil.
Comment: I have seen dracenae kept in water with lots of a porous medium like lava rock or fired clay pellets for years.


How do I sync my music and video from iTunes to new iPhone 6?

Question: In trying to sync my music and video to my new iPhone 6, I noticed that all of the music and videos that I purchased downloaded to my new phone but all of the ones that I had ripped from CDs did not. Is there a way to sync all of my music and videos from iTunes to iPhone 6? Thank you.
Answer: Its simple.

Open iTunes.
Connect the iOS device to your computer using the
included USB cable.

After clicking on your iOS device, tabs appear on the left side of the iTunes window under Settings.
You can turn on syncing for Music, Movies, TV Shows, Podcasts, Books, Audiobooks, Tones, Photos, and Info. To turn on syncing, click the content type from the list under settings, then click the box next to Sync [content type]. If there's a check in the box already, syncing is turned on for that tab. To turn off syncing, uncheck the box.

Click the Sync button in the lower-right corner of the screen to sync your content. Only the information in the content list you've enabled syncing for will sync to your computer. If you made any changes to any of the settings, first click the apply button.
Answer: The ability to sync the contents of your old iPhone to a new phone is contingent upon your backup method. If you have an iCloud-based backup, you may find the following article helpful:
http://support.apple.com/kb/TS4036
If you've been backing up your iPhone to iTunes, the basic idea is the same; erasing setting and data from the phone, which then causes the phone to prompt whether you wish to configure it as a new phone or restore from backup. Restoring the phone from backup will import all your existing data.
http://support.apple.com/kb/HT1766
Answer: Plug in the new iphone to iTunes, then select the iPhone within iTunes. Click on the Music tab, and chouse 'Sync all music..."


Using 2 piezo buzzers to emit the same tone with phase difference

Question: For a physics project, I want to record the effect of 2 speakers emitting 100hz at different phase differences. Trouble is, the Arduino can only send one tone() signal at a time. How do I create a phase difference effect using one Arduino?
Comment: Hint: Start by understanding how tone() works.
Answer: Since the frequency is so low, you can generate the signals in software.
That would not be as clean as timer-generated signals, but it will be
much easier. And probably clean enough for the intended purpose.
In order to generate a tone, you have to repeatedly switch the pin
connected to the piezo. This is very similar to blinking an LED, only
somewhat faster. Blinking an LED is the very first thing you learn to do
with an Arduino, but you may notice that blinking two LEDs is a
little bit trickier. The problem – and the solution – is
discussed in the Arduino tutorial Blink Without Delay. Building on
that tutorial, here is an example program that generates two 100 Hz
signals in quadrature:
const uint8_t PIN_A = 8;
const uint8_t PIN_B = 9;
const uint32_t HALF_PERIOD = 5000;  // 5000 us
const float PHASE_SHIFT = 0.25;     // 1/4 period

uint8_t state_A = LOW;
uint8_t state_B = LOW;

uint32_t last_A_toggle = 0;
uint32_t last_B_toggle = - 2 * HALF_PERIOD * PHASE_SHIFT;

void setup() {
    pinMode(PIN_A, OUTPUT);
    pinMode(PIN_B, OUTPUT);
}

void loop() {
    uint32_t now = micros();
    if (now - last_A_toggle >= HALF_PERIOD) {
        last_A_toggle += HALF_PERIOD;
        state_A = !state_A;
        digitalWrite(PIN_A, state_A);
    }
    if (now - last_B_toggle >= HALF_PERIOD) {
        last_B_toggle += HALF_PERIOD;
        state_B = !state_B;
        digitalWrite(PIN_B, state_B);
    }
}

If you compare this with the above mentioned tutorial, there are a
couple of differences worth noticing:

The timings are measured using microseconds rather than milliseconds,
for getting a better accuracy
The variables holding the times of last toggle are updated like
last_A_toggle += HALF_PERIOD rather than last_A_toggle = now (the
equivalent of previousMillis = currentMillis). This is needed to
keep an accurate average frequency. Otherwise the time taken to
execute the code would make the frequency slightly off.

There is a little trickery in the initialization of last_B_toggle,
which is an unsigned number initialized to a negative value. The
initialization is valid and works modulo 232. Using a small
positive value would have the ill effect of now - last_B_toggle
overflowing to a very large positive number on the first run of
loop(), putting last_B_toggle effectively in the distant past.
Answer: For a very simple example you can do something like this:
#define SPEAKER1_PIN    5
#define SPEAKER2_PIN    6

void setup() {
  pinMode(SPEAKER1_PIN, OUTPUT);
  pinMode(SPEAKER2_PIN, OUTPUT);
}

void loop() {
  int phase_delay = 1000;   // Phase delay (in us)
  int freq_delay = 5000;    // Half of square wave at 100Hz (5000us)

  // Generate 2 square waves (out of phase)
  while(1) {
    digitalWrite(SPEAKER1_PIN, HIGH);
    delayMicroseconds(phase_delay);
    digitalWrite(SPEAKER2_PIN, HIGH);
    delayMicroseconds(freq_delay - phase_delay);
    digitalWrite(SPEAKER1_PIN, LOW);
    delayMicroseconds(phase_delay);
    digitalWrite(SPEAKER2_PIN, LOW);
    delayMicroseconds(freq_delay - phase_delay);
    }
}

By the way, 100Hz may be to low of a frequency to get much sound out of a Piezo speaker.  You'll likely have better success by using higher frequencies.


How to sing Karnei Farah and Yerach Ben Yomo

Question: Hi I'm looking for different traditions (and sources!) about how to properly sing these very rare trop found in the Torah exclusively in Bamidbar 35:5 Does anyone have any idea which version is better / closer to the original?
Comment: I know both of them for Megillat Esther, sometimes they're pretty similar to the Torah's. Would that help you?
Comment: This is a good question, but how do you know what melody trop originally had?
Comment: @CharlesKoppelman I don't! Hence my very first Mi Yodeya question. How someone could know? I don't know for sure, but age of the source involved, possible recorded testimony, or connection to the shape of the trop might be indicators.
Comment: https://hebrewbooks.org/pdfpager.aspx?req=40241&st=&pgnum=179 for neviim
Answer: This is the ways Sefer Hanigunnim (Chabad) says it is supposed to sound:
Trop for normal laining: http://www.770live.com/En770/nigunim/nigunPlay.asp?nigunId=Dovid_Hurwitz/172.rm&gif=172
Trop for Megillas Ester: http://www.770live.com/En770/nigunim/nigunPlay.asp?nigunId=Dovid_Hurwitz/175.rm&gif=175
Comment: Though the person singing says that he doesn't bring any alternatives to the way Sefer Hanigunim plays it because there is no way to know which nusach is the right one without Ruach Hakodesh ;)
Answer: Karnei Farah - according to Minhag Askhenaz - is Pazer, Telisha Ketana and Telisha Gedolah together (meaning one after another).  I don't have the source for that though - I heard it from a local Rav and then from a Ba'al Koreh.
As for Yerach Ben Yomo, I try to imitate the guy at http://bible.ort.org/books/cant4.asp since my teacher never taught me that one.
http://taamim.org/ has the Sephardic Ta'amim.
Answer: Regarding Ashkenazi traditions, I have compiled below the chants recorded by three early Christian humanist sources from the sixteenth century and by numerous Ashkenazi informants from around Europe.
These were brought together analyzed by Avenary in his book "The Ashkenazi Tradition of Biblical Chant between 1500 and 1900".
Answer: Here's wikimedia's version. Listen from about 41 seconds.
Is it just me, or does it remind you of the 1812 Overture? "Alpayim Ba'amah ... <CANNON BOOM!!>"
Comment: Yes.  And there's another version on the web - I can't seem to find it anymore - that sounded like church singing.
Answer: Ish Masliah Tikun Korim (these Halachot were written by HaRosh Yeshiva HaRav Meir Mazuz Shalit"a): Karne Para sounds like Pazer Gadol. Yareh Ben Yomo sounds like Shofar Holech.
Answer: The main thing you should be aware of is that a yerach Ben Yomo is a 'meshares' (was also taught that it's a long or embelished Munach - as mentioned)  A Karnei Farah is a 'mafsik' & is mentioned in minchas shai & several other places as 'Pazer Gadol'  - which could mean a big or long Pazer. (I was taught Pazer with Tlisha Gedolah) Regardless of how you sing it, a Karnei Farah needs to end with a mafsik, (it certainly should not end with a Tlisha Kitana-which is a meshares)


what is the ontology-ideology distinction in phil of math

Question: Quine proposed a distinction between ontology - the doctrine of what there is - and ideology - the complex terms and predicates expressible in one's theoretical language (though in his 1971 paper he expanded the category to include concepts that one could discern even if one does not have the verbal resources to express). I am curious how this distinction manifests itself in the context of phil of math. Quine used an example of first-order theory of real numbers - if the theory has the predicate ``x is a natural number,'' then that predicate is a part of the theory's ideology, otherwise it is not, and this does not change the theory's ontology. However, if we endorse the set-theoretic reduction of mathematical objects, does it follow that our mathematical theories are only ontologically committed to sets, while all mathematical concepts - numbers, groups, functions, spaces - are part of the ideology but not ontology of our mathematical theory?
Comment: Technically, Quine accepts as ontological those and only those objects  that can be values of quantified variables of a first order theory after the paraphrase. Since functions, structures, relations, etc., paraphrase into sets they can be said to be "derived" ontology (so can desks and chairs, they are paraphrasable into atoms). The rest of machinery, including predicates, connectives and quantifiers, are mere ideology. See also his [Ontology and Ideology Revisited (1983)](http://www.naturalthinker.net/trl/texts/Quine,W.V.O/Quine%20W%20V%20-%20Ontology%20And%20Ideology%20Revisited.pdf)
Comment: Quine was greatly influenced by logical empiricists and he holds a more thorough empirical stance even than many other empiricists (see his *Two Dogmas of Empiricism*). As such he's not a Platonist regarding sets and want to reduce naive set-theory to FOL ontologically committing to only those quantifiable concrete objects in the relevant domain of discourse per his famous ontic parsimony selection requirement of a good theory. Certainly groups, spaces and functions don't sound like his empirical commitments...
Answer: You must take into consideration that much of Quine's "technical" and philosophical work on logic and set theory can be read as a comment and refinement of W&R's Principia.
For an overview, you can see at least the introductory chapters of Set Theory and its Logic, revised ed.1969.
See page 9:

The schematic predicate letters 'F','G',... attach to variables to make dummy clauses 'Fxy', 'Gx', 'Gy', etc., as expository aids when we want to talk about the outward form of a complex sentence without specifying the component clauses.
So the letters 'F', 'G', ... are never to be thought of as variables, taking say attributes or classes as values. Abstract objects, these or others, may of course still belong to our universe of  discourse, over which our genuine variables 'x', 'y',... of quantification are allowed to range. But the letters 'F', 'G',... are withheld from quantifiers, indeed withheld from sentences altogether, and used only as dummies in depicting the forms of unspecified sentences.

And see page 35:

We might therefore do well hereafter to speak of the abstraction notation '{x: Fx}' not as virtual, for us, but as noncommittal: its use merely carries no general presumption of existence of the class (nor, if it exists, of its sethood).
Whether to say in particular that there is such a class as {x: Fx}
will depend on what sentence we interpret 'Fx' to represent and what axioms of existence we may eventually decide to adopt.

Thus, about e.g. natural numbers, because in set theory every object is a set, and because we can prove, from the axioms of set theory, that there is a set N that behaves like the set of natural numbers, we can conclude that in the framework of set theory, numbers are "real".
See page 81:

We have been admitting the numbers into the range of values of our variables of quantification, but we have not yet considered what sorts of things numbers are to be. We did see how to define 'N' given '0' and 'S'; the construing in turn of '0' and 'S' is what is needed, now, to fix the idea of number.


A patent for a specific wallet

Question: Hi friends I would like to know if there is a patent for this wallet: http://zenlet.co
The ZENLET wallet
(https://i.stack.imgur.com/pRKNh.jpg)
Answer: According to this page, there is the notation "[Patent pending]" below one of the pictures. Unfortunately, I couldn't find any patents where Zenlet was listed as the owner or assignee on either patents.google.com or www.lens.org/lens. At this point it gets tricky since the patent assignee might be the inventor and we don't know who that is and the actual inventor or patent number doesn't seem to come up in a Google search. You could try just searching for "wallet" on patents.google.com, but there are 17,168 hits for documents after 2014. You best bet might be to contact Zenlet and ask.
Comment: I tried some combinations of wallet and rfid protection etc., but nothing sticks out. The name of the inventor would help a lot. Without it, this seems to be the only possible answer.

A patent for a specific wallet


"This post was deleted and cannot be edited" on audit

Question: On a recent review audit on SU, I clicked "Edit" and was greeted with the plain text "This post was deleted and cannot be edited". It wasn't in a popup box or anything; the actual page consisted of just that text, with no formatting (as though it were the only content of the HTML page). This makes it really obvious I'm dealing with an audit.
Comment: Indeed, some of these review audits are way too easy to see through. The entire page changing to *just* "This post was deleted and cannot be edited" isn't very user-friendly either.
Comment: @Emmett I just got the same behavior on ServerFault (for [this review](http://serverfault.com/review/first-posts/60700)). I accidentally hit edit instead of flag and I was redirected [here](http://serverfault.com/posts/486062/edit).
Comment: When you clicked "edit" the first time, did you right-click then "open link in new tab"? Or just left-click it?
Comment: @Emmett Left click.
Comment: @cpast It looks like you managed to [pass the audit](http://superuser.com/review/first-posts/89728) a few seconds later. Do you recall going back and having it work the second time?
Comment: I went back and hit "add comment" (at that point, I knew it was an audit, and I know adding a comment passes the audit)
Comment: @cpast Based on our logs, I can confirm that the behavior you're reporting did, in fact, happen. But unfortunately I've been unable to reproduce. I'll continue to keep an eye out.
Comment: @Emmett I just saw it again, I think a day or so ago? I hit "back", "edit" again, and got the same thing then too. (I then hit "add comment" to pass the audit)
Comment: This just happened me also in the late answer queue for an audit.
Comment: Possibly related: http://meta.stackexchange.com/questions/193830/why-doesnt-attempting-to-edit-count-as-a-pass-for-a-review-audit
Comment: Also possibly related: http://meta.stackexchange.com/questions/217781/opening-the-post-editor-in-a-new-tab-does-not-pass-a-review-audit
Answer: This should probably not be considered a bug.

If someone clicks Edit on a post, it's difficult to know their full intentions, but probably they think something is wrong with it that is worth fixing. Most of the time, this could be a reasonable action to take. Once someone clicks edit, they'd usually pass the audit.
Suppose someone clicks the link link to view the post (outside review). They'll see it's deleted then, too. Clicking that is a more efficient way to check if a post exists than trying to edit it (see point 4 below for details about that). Nothing should be done about that (non-)issue, and for the same reasons, nothing should be done about the user discovering a post doesn't exist when they click to Edit it.
Even if people's edits are bad (perhaps especially then), we don't want people spending lots of time writing edits that can't be submitted. This is why editors are notified when a post is deleted while they're editing. Having people spend time editing a nonexistent post is cruel and pointless.
The current behavior is actually quite reasonable. Clicking Edit usually lets you edit the post. When the post is deleted and present as an audit, clicking Edit gives you a non-user-friendly page and requires you to use your browser's back button, or similar facility, to return to reviewing. So this is a very inefficient way to determine if a post is an audit. Imagine someone clicking Edit on everything! That would likely be slower than actually paying attention.

Arguably, this is a low-impact interface bug. It is not a hole in the review system. If this is considered a bug and fixed, the fix should still inform the user that the post cannot be edited.
Potentially, instead of saying it's deleted, it could say that someone else is editing it (since under some circumstances that prevents a new edit from being started). People would get wise to that almost immediately, though, and even if they didn't, they're not very likely to fail the audit if they thought the post needed editing and were unable to edit it.
Therefore, there are two good responses to this.

The best response would be to fix the minor interface bug by making Edit tell the user that the post does not exist, but in a way consistent with the Stack Exchange interface.
This should probably be a little bit slow. That way, no incentive (compared to the current situation) is created for people to click Edit to determine if the post is an audit.

One option would be to actually bring up an edit screen, but with a bar at the top informing the user that the post has been deleted.
But I think a better way would just be to introduce 2 or 3 second delay after clicking Edit (which sometimes happens anyway) and then tell give the user one of those little message windows (which are blue, currently) to tell the user it cannot be edited because it has been deleted.

Another completely acceptable response, as argued above, is to leave the system's current behavior as it is.
Comment: It definitesly seems like a bug to me - if you pass the audit, the message informing you that you've passed states that downvoting, *editing* or flagging would all be considered successful audits. Therefore, clicking edit should presumably just make your audit succeed, as stated by that message.
Answer: As mentioned over on this other question, this has been fixed. If you click "edit" you should now get a notice saying you passed the audit.


Are all licensed and published Battletech novels considered canon?

Question: Are all professional Battletech novels also part of the official Battletech canon? The two works of whose canon status I'm not certain are "Far Country" and "No Limits", since they ignore fundamental premises of the Battletech universe. Additionally, I'm not sure, if novels which were first published by non-English publishers are considered canon.
Comment: what's a 'professional novel'?  Do you mean published?
Comment: I mean non-fanfic, any books by publishers having the license to publish Battletech novels. This includes non-English first publications as well.
Comment: I edited to echo your response.  Feel free to edit your own question back if you feel I redirected your intent, and apologies if so.
Answer: This site is pretty clear on Battletech canon.  I won't post the whole article on 'Canon' here, but a relevant excerpt:

Whatever we establish for research material for the authors is canon.
Currently, that list includes:
All sourcebooks and novels produced for BattleTech by FASA and Roc in
the United States
All sourcebooks and novels produced for Classic BattleTech by FanPro
and Roc in the United States
All sourcebooks and novels (including electronic publications, such as
BattleCorps) produced by InMediaRes (and its subsidiaries, BattleCorps
and Catalyst Game Labs) in the United States
All material produced by WizKids for the MechWarrior: Dark
Age/MechWarrior: Age of Destruction game lines
GENERAL INCLUSIVE NOTE: There are a few select instances where a story
or article appearing even in these sources may be considered
non-canon, but generally this is because the material was in error
[...], or it was specifically published as a gag [...].

The same site actually specifically says which books are canon and which are not on their individual articles.  It appears Far Country is, and No Limits is not.
Comment: Thank you very much for the answer. Considering-non-English novels I've just found the answer [here](http://www.sarna.net/wiki/Novels#Original_German_Language_BattleTech_books).
Comment: @schlossblick Yep, the site is evidently the go-to for Battletech.
Comment: Before I go on to the next life, I wither want a sequel to Far Country or to find out the eventual canon fate of Clan Wolverine!


Dynamically connect Google Sheets to Excel with protection of privacy of information

Question: I know of only one way to import information (live) to Excel from Google Sheets, but it requires "publish to the web" on that Google sheet, and adding a "connection" to Excel.
My concern with this is that there could be sensitive information that anyone who obtains a URL to the published Google sheet can have access to information that should remain private.
Is there another way to connect Google Sheets to Excel?
(Or) does one need to scramble the information on the published sheet (a la enigma machine + key) and decrypt it on the Excel side when receiving it?
Answer: You could use the Google Sheets API, the Google Apps Script Execution API or a third party Excel plug-in.


Tackling loops and discontinuations in PID line follower

Question: We are making a PID line follower using arduino for a competition. According to the rules of the competition they will have loops and discontinuations in their track. Can anyone give some idea how we can tackle them using code.
Comment: pretend that you are the line follower robot and you can only see what the sensor sees ...... what would you see at a discontinuation in the track? ...... what would you do to re-establish view of the line? ..... turn those thoughts into code
Answer: What you need is a hierarchical fuzzy controller for crossing detection. The situation, that the black line on the ground has complicated shapes like zigzags and loops is a good opportunity for implementing a program flow which contains of if-then-statements and subfunctions. In contrast, a normal line following robot will need only a simple table, which produces for an input signal of the sensor an output action of the motor, in case of a crossing layout of the path, a more complicated information processing is needed, namely a dedicated program flow which is done in C, Java or Python.
In the easiest implementation, the robot stops if he detects an unusual pattern on the ground and waits for new commands from the human operator. He can drive to the left and follows the path1 or he can stay on the main line and follows path2.
<code>class Detectcrossring:
  def __init__():
    if getsensor()=="crossing":
      askhumanoperator()
    else driveforward()
  def getsensor():
    result ="normallane"
    result ="crossing"
    result ="zigzag"
    return result
  def driveforward():
  def askhumanoperator()
    print "crossing detected."
    print "Should i move forward, left, right?"
</code>


Can carbon monoxide from a floor-heater in a poorly ventilated room eventually be ignited by the fire and explode?

Question: I have often wondered about carbon monoxide accidents caused by free-standing heaters burning in a poorly ventilated room causing fatalities. I am aware that CO is explosive between 12 and 75% volume air and wonder why it doesn't eventually ignite from the flames or glow present when the CO level reaches 12%? (This never seems to happen). Or does the decreasing oxygen content in the air due to the combustion cause the fire to die out before the critical level of 12% is reached?
Comment: Maybe it happens but nobody ever notices as anyone in the room died a long time earlier from CO poisoning.
Comment: Your last sentence seems reasonable.
Comment: I would be much more concerned about dying in CO, it takes less that required for an explosion. If you have any" CO" in your room, you will get a headache.
Comment: In a completely unventilated room, with only CO being produced, to get 12% CO implies that you have used up 6% of the O2 (out of ~21% in the air). The remaining gas mix besides CO is no longer 'air' as understood in explosive/flammability ranges.
Answer: Another possibility:  the "carbon monoxide" formed by combustion is not pure enough CO to get to flammability (12% total CO) in air.  The gas could be mostly carbon dioxide but still enough CO to poison you.
Answer: I know from experience that carbon monoxide/air has a very low fame velocity. I think that air/carbon monoxide mixtures would make a very poor fuel air explosive.
I think however that by the time you get to the point of having sufficient carbon monoxide in a room to allow a flame front to start to travel from one side of the room to the other that unless you are wearing self containing breathing apparatus you will be dead of carbon monoxide poisoning.
Jon Custer is very right, if we consider methane as the fuel then we can write the equation.
$\ce{2CH4 + 3O2 -> 2CO + 4H2O}$
Thus to reach 11% carbon monoxide in a sealed room with a methane flame burning under very special and rich conditions to only form water and carbon monoxide. I think that all the oxygen in the room will be used up long before we reach 11% $\ce{CO}$ in the air. I think that the highest $\ce{CO}$ concentration we could get in the room would be 6.67% by volume. I think that as the oxygen level in the room will be so low that even with additional $\ce{CO}$ added to the room air then the room gas/air mixture will be unable to explode.
The only time I imagine you could get a carbon monoxide/air mixture to "explode" would be if a carbon monoxide cylinder was to leak and then an ignition source was to be added.


Replacing a steel wheel

Question: My girlfriend is looking for a replacement steel wheel for a 2012 Honda Fit, as one of hers is currently bent. I think they are 15" rims, but I was hoping to find the best option on where to purchase a replacement steel rim. Some local Firestone shop was about to charge her $180 for a new rim, and to move the tire onto the new rim. It was my impression that, that was ridiculously high.
Answer: That sounds about right for a new factory steel wheel.  You could also try TireRack.com to see if they have any, or some local junkyards for used.  Odds are you're going to have a hard time though, not a lot of junked Fits laying around to get wheels from.  Or, you can use it as an excuse to upgrade to some nice new wheels.  :-)
Answer: Slightly off-topic, did you considered repairing it?
Depending on how much deformation you have on the rim, you could restore it in a wheel shop. They could hammer it or use a special equipment for reshaping too. Costs in my area start at about 20% of new rims cost.
Comment: My guess is that, that's too risky, but not a bad idea either. She'd rather just have it taken care of.
Comment: Risky in what way? Shops usually give you guarantee on their work.

Replacing a steel wheel


Why the Neutral wire is hot

Question: One of the outlet has no power in my house. I found the neutral wire is also hot like the black wire. There are only two wires, no ground wire involved. The wiring in the house is very new (~ 1 year). What would be the problem?
Comment: How did you determine that the neutral wire is hot?  If the wiring is new, why is there no ground?
Comment: Where in the world is this?
Comment: Did you identify this wire as a "neutral" because it is white? Is it a switched hot connected to one side of a switch? A white wire connected to one side of a switch is NOT a neutral, it will be, and is designed to be, hot when the switch is on.
Comment: is the neutral wire marked with a black tape or marker? is the black/red wire hot?
Answer: Any plugged in and turned on device, for example a light bulb, makes a connection between the hot and the neutral. This enables current to flow through the light bulb and power it. If the neutral is disconnected anywhere between the light bulb and the panel, then the neutral from the light to the point of the break in the neutral will become hot (and the device will be unpowered, because no current will be flowing through it). Look for a disconnected neutral.
To test whether you have a broken neutral, turn off everything in the circuit which has the hot neutral. If the neutral is then no longer hot, this confirms that a neutral is disconnected in the circuit.
For the purposes of this test, if you have any lights with 3-way switches in the circuit, you will not know if the light is switched on (and the neutral path broken so the light is not lighting) or if the light is switched off. It might be best to temporarily unscrew any such bulbs. Also, unplug any floor or table lamps because you can't tell it they are switched on or not.
There could be a loose neutral at any connection of the neutrals in wall boxes or at the neutral connection block in the electrical panel. Check the wall receptacle boxes first. Look for evidence of heating of a neutral wire or a loose neutral wire. Are your wires connected to the receptacles by "back stabs" into the receptacles or are they looped around the screws? Do you have copper or aluminum conductors in this circuit?
Answer: Because the neutral wire is broken -- but a load is still plugged in downstream, connecting neutral to hot.   See the first two illustrations in my answer here, where I describe how it normally works.
Answer: somewhere down the line the neutral got connected to a hot instead of the neutral. Trace back the wire and fix that.
Comment: @JimStewart that's what the word "instead" was supposed to signify

Why the Neutral wire is hot


Quadcopter Stability Modelling

Question: We know software like XFLR5 to model fixed-wing aircraft to determine aircraft dynamics and stability. Is there any software which we can model our quadcopter geometry in so we can know it's CoG, thrust, lift, stability, etc?
Comment: CoG can be determined in CAD suites if your program in the density/mass of all of the parts and materials.
Answer: Solidworks works great and is very intuitive for beginners for a CAD software. Given that you have the entire simulation suite it can perform stress analysis and automatic optimization for the frame, air flow simulation for the propellers, etc etc (nice video to start with here: https://www.youtube.com/watch?v=6y_G6om74Mc). If you want to go deeper in the analysis of a custom flight controller, then you should investigate solutions through Matlab - a bunch of mechatronics students have produced a lot on the subject and you can buy drone focused video courses like this one to get up to speed: "Model, Simulate and Control a Drone in MATLAB & SIMULINK" on Udemy.
But unfortunately I'm yet unaware of a dedicated piece of software to do all this; my approach is to use engineering "general purpose" CAD softwares and model everything because I've learned these tools at work.

Quadcopter Stability Modelling


Why does cpu benchmark increases faster than cpu frequency?

Question: Since duration of an instruction is just the number of cpu cycles needed times the time of a cycle, which is the inverse of the frequency, I do not get why the ratio of cpu benchmark of a two processors of a same trademark is not exactly the inerse of the ratio of the frequencies. Cpu is supposed not to loose time by being inefficient but only to obey and realize the processors instructions that we ask, which are the same in a test of benchmark of the two processors. Could you enlight me ?
Comment: There's a lot more going on in modern CPUs, which execute many instructions in parallel.
Answer: Part of the benchmark might be limited by CPU time; other parts might be limited by IO or memory latency or other factors.  Speeding up the clock frequency will speed up the first parts but not the second parts.  As a result, doubling the clock frequency won't necessarily double the speed at which the benchmark is executed.  So, the two ratios aren't necessarily equal.
Comment: Hank you. Everything is clear
Answer: If processor A and processor B took exactly the same amount of processor cycles to do the same work, and processor B had exactly twice the clock speed of processor A, then the time for a benchmark running on processor B would be exactly half the time of the same benchmark running on processor A.
But they don't take exactly the same number of cycles.
One big effect is that historically, the speed of RAM hasn't increased as much as the speed of processors. On an Apple II computer, every memory access took exactly one processor cycle. On a modern desktop computer, a memory access takes in the order of 100 processor cycles. If processor B has twice the clock speed of processor A, but the RAM isn't twice as fast, then a benchmark will not run in half the time.
But on the other hand, there are effects that make modern processors take less cycles for the same work than older ones. Examples are:
Larger and larger RAM caches, which mean there is less use of slow RAM.
Vector units, which may process for example 16 byte operations or four double precision floating point operations just as fast as a single byte or floating point operation.
Multiple processing units; where the processor can decode and process multiple instructions in the same cycle.
Shortened latency; for example a floating point multiplication might take7 cycles on an older processor, 5 on a newer, and 3 on the latest processor.
64 bit operations, more registers: A modern processor can add two 64 bit numbers in a single operation, while an older processor would need multiple operations. More registers means that more values can be kept in registers and need not be loaded and stored to memory all the time.
And so on.
Comment: Thank you so much for the explanations


Where did John Carter (2012) find drinking water on Mars?

Question: In the movie John Carter did he ever drink water?  Humans needed it to survive and I thought there was no water on Mars.
Comment: You say there's no water on Mars. So what is the river he boats down made of then?
Comment: Where did you get the idea that there isn't water on Mars or Barsoom? Even on the real Mars there's a ton of water, it's simply in ice form on the surface.
Answer: The fictionalized world of Mars as envisioned by Edgar Rice Burroughs was called Barsoom. It is not Mars as we know it, but a more fantastic planet populated with a variety of creatures. Barsoom is a romantic representation of a Mars at the end of its resources with various races struggling for survival.
There is plenty of water on BARSOOM. But not nearly as much as there used to be. The last river, Iss is a customary river used by Martians who wish to seek to end their very long lifespans.

The sole remaining river upon Mars, for ages green and red Martians upon their thousandth year of life would take a pilgrimage to the River Iss, they would travel down to the river to what they believed was the afterlife.

As for why John Carter might marry one of the Red Martians:

All Barsoomian races resemble Homo sapiens in most respects, except for being oviparous (egg-laying) and having lifespans in excess of 1,000 years unless killed.

The traditional Martian lifespan of 1,000 is based on the customary pilgrimage down the River Iss, which is taken by virtually all Martians by that age, or those who feel tired of their long lives and expect to find a paradise at the end of their journey. None return from this pilgrimage, because it leads to almost certain death at the hands of ferocious creatures.

While the Martian females are egg-laying, Martians have mammalian characteristics such as a navel and breasts. While they have skins of various colors, and their bodies differ in some cases from traditional humans, they are very similar to varieties of Earth humans, and there is little examination of difference. There is only one spoken language across the entire planet, but a variety of writing systems.

Given the egg-laying nature of the Martians it is unlikely without technology that Carter could successfully produce offspring. Such technology must have existed since he and Dejah Thoris have a son.
Comment: Doesn't the part about traveling down the River Iss also cover the 'there's no water' part of his question? Unless it's not actually a river made of water.
Comment: hmm, birds on earth need no special technology to produce offspring... It's just a matter of plumbing, rather than the child growing in the womb of the female, the egg develops there.
Answer: It is not quite correct to say that there is no water on Mars:
http://en.wikipedia.org/wiki/Water_on_Mars
However, Mars that exists in the fictional universe of John Carter might not be the same as the real Mars and might have extra water etc.
I am guessing that when you ask about the genetic compatibility of humans and martians then you are asking about them having children?  Genetically anything can 'marry' anything they like - you could marry a goat if it was legal, that does not mean you could procreate with it.
I am not sure if children came up in their marriage but being as Martian and Humans are different species they, by definition, cannot have viable offspring.  If they do then either they were the same species all along (perhaps descended from a lost common ancestor but considering how close we are to apes whom we cannot breed with this is unlikely) or the Martians have a currently unknown genetic or scientific enhancement which allows this.
Answer: Barsoom (ERB's Mars) was dry, but no dryer than high desert on earth. There are plants, there is some dew at night. There is enough moisture to fill the river Iss, albeit only to a low flow channel, and it covers most of Barsoom.
Where there is plantlife that needs water, there are stores of water.
It's important to note that the movie is a moderately loose adaptation (and works in elements from at least the first 4 Barsoom novels, while covering the first primarily); several elements, like John Carter finding water in the desert, are simply not covered. Still, it is fairly faithful to the first novel, A Princess of Mars in the overall story. The movie shows surprisingly great respect for the book.
Also not explicit in the movie is that John Carter was not himself entirely human. This is fairly explicit in the novels - his ability to transfer to Mars is not his only inhuman ability. Mention is made in a later novel of having been of great age already when the civil war was fought, and the first novel is set some years after that. He has some abilities of the Therns - he might be a half-human half-human Martian.
He eats moist foods, and drinks various beverages in the novels; in the movie, we see beverages upon the table, and moist foods as well. Certain of the plants can be cut and wrung for water.
Now, as for finding water upon arrival - he doesn't. What you see in the movie is, almost exactly, what the novel tells, only extended in time a bit from what the novel implies. His capture is a scant few minutes after awaking on Barsoom - tho', yes, Carter himself, in both movie and novel, recognizes it as Mars.


Extracting a variable from an executable

Question: I'd like to extract the M__hello_ variable of this code from the executable (for learning purpose). I'd like to have this array back in a variable in any programming language Do you know how can I do this ?
Comment: Please clarify what you mean by "extract" the variable.  It's a static variable, if you meant the value of the variable, it's right there. Here is the string representation of that array : "cs dGHdS(sHello world...N((((shello.pys?s"
Answer: Find the offset of the variable in memory. Using either your debugger or a look like Cheat Engine.
After this you can use ReadProcessMemory() from kernel32.dll in Windows to read the variable in your own program.
Comment: strings -o msgbox.exe | findstr Great ---------------------------------------
2073:Win32 Assembly is Great!  --------------------------------                                                      strings is from sysinternals findstr is an inbox utility
Comment: Thanks for the answer. After looking at how an executable is made, I found that the variable's content was stored in a data segment, since it's a global variable. With p7zip, I got this data segment, but is there a way to parse it or to know where each fragments begin and end by disassembling the EXE?

(I'm knew to reverse engineering, so I'm just wondering how everything is working.)


KPA on Feistel cipher?

Question: I heard that DES is technically "broken" because of attacks involving large amounts of known plaintext. These attacks are obviously academic and highly complicated, so for some intuition I was hoping that somebody could explain (for example) how much plaintext is required to determine the key in a generic/simple Feistel scheme with mangler function very simply linear in the key and so on?
Answer: Feistel networks were broken in DES but not triple DES. Some final AES candidates not approved also used Feistel networks $2^{36}$ plain text attacks. Reduction of $2^{16}$ possible keys for single DES: $4^{48/6} = 4^{8} = 2^{16}$.
First for a one round Feistel network: $R_0$ and $f (R_O, k_1) = R_1 \oplus L_0$, $k_1$ becomes known.
For two round Fiestel: Use the same method twice: $$(R_0, f(R_0,l_1)=L_2 \oplus L_0) \ (L_2,f(L_2,K_2)= R_2 \oplus R_0)$$
A nice reference would be CryptoLecture 04 (PDF) from Daniel Boneh's crypto course on Coursera.
Comment: Two good references icg.isy.liu.se/courses/tsit03/forelasningar/cryptolecture04.pdf Daniel Boneh's crypto course on Coursera –

KPA on Feistel cipher?


How does health link work, exactly?

Question: I'm kind of confused by this mod on elite enemies. Is it supposed to make it harder to kill each one individually? If so, how does it work?
Comment: Possible duplicate: http://gaming.stackexchange.com/questions/66116/what-are-the-special-abilities-the-unique-champion-monsters-can-have
Comment: @fbueckert I'm looking for a bit more detailed explanation than in that question. As per Sadly Not's answer below, there may be a subtle discrepancy in how the damage is dispered.
Answer: The Health-Link description taken from here says:

This trait is for champion monsters only and it activates only if more
  than one champion is present. Health Link reduces the amount of damage
  taken by the champion with that trait by linking his HP to that of all
  other Health Link champions in the area.
This trait can occur only for
  monsters equal to or greater than level 51

In short, any damage one monster takes is divided between all monsters in the link, so providing X monsters with health link stay near each other, it takes X times as long to single-target dps a monster with Health Link than one without.
It should be noted that if monsters are far enough apart, their "link" isn't active, so you can dps them one at a time if you can separate the group
Answer: Health Link means that the elite enemies pass some damage off to each other, i.e. if you focus one elite, the damage will be reduced because it is shared with nearby pals.
If they have no nearby pals, the damage doesn't seem to be shared. If you separate them it is possible to nuke one, and in practice because they spend some time separated so they will not die at exactly the same time.
So yes, it is harder to kill each one individually. However, if you use area-of-effect abilities you won't notice the difference.
For example, think about an ability that hits all three elites, and say anyone hit takes 33% damage while 66% is passed off to the other two elites (combined). So elite A takes 33% damage while B and C take 33% each. However, if you also hit elite B the same applies - he takes 33% while A and C take 33% each. Same goes for elite C, so added together each elite takes 33% directly, plus 33% x 2 from the other two elites passing damage off. Overall you still dealt 33% + 33% x 2 = ~100% damage to your main target.
This doesn't mean that area-of-effect abilities are better at dealing with them - it only means that you won't notice the effects of Health Link.
Answer: It shares the health of the linked monsters, and any damage done to any of them is taken from the pool.
For example:  If a monster normally has 100hp each, and three of them are linked, they all share a pool of 300 health.  You would have to deal a total of 300 damage to any of them, and then they would all die at once.
So the disadvantage is you can't kill them one at a time.  You have to fight all three until their pool is drained and they all die at the same time.
As per the player's guide: "Health link reduces the amount of damage taken by the champion with that trait by linking his HP to that of all other Health Link champions in that area.  This makes it much harder to clear an area of Champion monsters.  When a Health Link Champion takes damage, that damage is divided amongst all other Health Link Champions in the vicinity."
Monster level minimum: 51
Comment: This doesn't quite match up to experience; they DON'T all die at the same time.
Comment: That may be due to a glitch, or because one of the monsters was out of range, as the description specifically states "all health link champions in that area" but otherwise, as far as blizzard is concerned, they should all be dying at once.
Answer: Health Link means that your companion or group members will get damage when you get damage. For example: You play with the Scoundrel and he dies. If your lifepool is squishy  you too will die with him. Same to non KI group members. That's what Health Link do. and nothing like they got more HP or something - health link is offensive and not defensive.

How does health link work, exactly?


If a living being is not self aware than can he experience suffering or pleasure?

Question: When some living being like dog or any mini bacteria are killed, since they are not self aware or concious do they feel the same type of pain as we do? what is the difference between their suffering and our suffering?
Comment: What do you mean by self-aware? Being conscious?
Answer: Dogs don't forget pain. You only have to look at a dog that has been continuously beaten and then cringes or tries to bite anyone who tries to pet it.  Yes it has become an automatic reaction but there must be some kind of memory there about humans not being trustworthy.
Answer: Its very clear that dogs are conscious  and feel the same pain as humans do and the suffering is the same suffering
If by self aware you mean mindful- than most people arent mindful 99.9999% of the time     ---  many many monks if good ones are not mindful most of the time
About bacteria i cant say much
Answer: I think that (according to Buddhism) humans, animals, ghosts, and residents of hell all belong to the same kind of category: all "sentient", all composed of the five skandhas, and all subject to suffering.
Since all belong to the same continuum (i.e. samsara), I expect that they all "lose memory" and that their "suffering finishes" in much the same way.
I don't consider a dog as like a bacterium, by the way: IMO a bacterium is more like a plant than an animal. I think different schools of Buddhism differ on whether plants are "sentient" and have any "consciousness".
don't they just forget or loose the momory of their suffering after it is finished?
Isn't that more-or-less true (or untrue) of people too?
Answer: It is hard to say unless you are an animal or bacteria.
In general observation, it appears animals such as dogs enjoy the sex and they feel the pain.
According to Buddhist teaching animals possess five aggregate same as the human.
Interesting video to watch. In this video, it is explained in plain English that any living and breathing organism has consciousness and how we interpret pain and pleasure.
Your brain hallucinates your conscious reality | Anil Seth
Answer: More primitive life forms, such as worms or fish, have a nervous system, therefore their nervous system experiences physical pain. Dogs are probably more complex and have emotions such as lust, love, emotional attachment; that makes them experience emotional sorrow & unhappiness.
However. as we can directly experience, homo sapiens (people) have the egoistic attachment (upadana) of self-identity (sakkaya ditthi), which is born from thought conception. This upadana of sakkaya ditthi is the 'suffering' ('dukkha') Buddhism seeks to eliminate.
I think it is a fair assumption worms & fish cannot create the upadana of sakkaya ditthi; and probably also dogs.

Bhikkhu, 'I am' is a conceiving; 'I am this' is a conceiving; 'I shall be' is a conceiving; 'I shall not be' is a conceiving; 'I shall
  be possessed of form' is a conceiving; 'I shall be formless' is a
  conceiving; 'I shall be percipient' is a conceiving; 'I shall be
  non-percipient' is a conceiving; 'I shall be
  neither-percipient-nor-non-percipient' is a conceiving. Conceiving is
  a disease, conceiving is a tumour, conceiving is a dart. By overcoming
  all conceivings, bhikkhu, one is called a sage at peace. MN 140
Answer: In all 31 planes of existence there is attachment to life except for the plane for Unconscious Beings (asaññasatta). So a dog feels pain thus like us.
Also any being in any plane are self aware except for enlightened beings who do not have self conceiving.
Also we all lose some notion of suffering otherwise hence why 1st Noble Truth is not readily comprehensible.


Is there a term for people who hate (or don't prefer ) things that are mainstream?

Question: There are people who hate (or don't prefer ) things that are mainstream, is there a term for them ?
Any references to cognitive reasons for some people being odd in that way would be helpful.
Comment: Relevant: [Not all observations necessarily need a term in psychology](https://psychology.meta.stackexchange.com/questions/2374/not-all-observations-necessarily-need-a-term-in-psychology)
Comment: @Eoin *Hipsters ?
Comment: Outside of psychology, the colloquial term would have to be "Histers", wouldn't it?
Comment: As I said, it's a colloquial term in English. See [here](https://www.google.co.uk/search?q=hipster+definition), for example.
Comment: Hipsters are too mainstream for that purpose. Especially in London.
Comment: There are many different possibilities for a term, but I am not aware of any official term **within psychology**.  This question **may** be closed for being "[not framed in psychology or neuroscience](https://psychology.meta.stackexchange.com/q/2277)" unless an official answer is found soon.
Comment: Contrarian is the word you are looking for.
Comment: Pretentious?????????????????????
Comment: contatrarion : opposing or rejecting popular opinion or current practice.
Comment: Depending on a case by case, it could be "different", "flat-earthers" or "dreamers".
Answer: This is more an anthropology question than psychology. Counter cultures and cults definitely are against mainstream society.
In America during the 60s there was a counter culture revolution. People found ideas from other cultures or invented cultural ideas and tried to bring them into mainstream. We called them all hippies at that time but now they are just ordinary people because their cultural revolution was largely popularized. People primarily associate hippies with a leftist movement but the Jesus freaks or Jesus movement was the equivalent in the religious conservative realm. Jesus freaks moved outside the realms of ordinary church. They were fundamentalist but spawned a diverse set of beliefs. The Jesus movement was also absorbed into mainstream culture and these two polar groups are a large reason why American belief systems are polarized between left and right in certain demographics at the moment.
Cults aggrandize a certain person, group of people or idea above family, government and the typical place of religion. I lived in Texas for a while so the first example that comes to my mind is Waco's Koresh who formed the group that was destroyed at their compound by the Clinton administration. He had a messiah complex mixed with some kind of hypersexualism. He was very charismatic and drew many people into his group with his pazazz. The of course the oft rumoured but very oft not found fundamental mormons which allow their people to be polygamist but god forbid any of those women ask to do polyandry. Putting a leader of a mormon church breakaway in jail became a national priority because in addition to the the polygamy there was incest in his groups.
Subcultures tend to be inside the realms of mainstream but hold to specific values that set the distinct. This might include the cowboy subculture, city dweller, yankee and southerner, various sexuality types, religious in various degrees and types. Freud had an interesting view that I've chosen to cherish his idea was like don't let yourself be defined by your sexuality (or other characteristic) instead embrace being human and all that it means.
Indeed people are drawn into counter-cultures outside of mainstream sometimes for positive and negative reasons. In general disenfranchisement by mainstream policies or values tends to lead people into depressive states which allows them to make atypical decisions to escape the pain of sadness. Oft people are drawn into cults by the charisma and happiness offered by the cult head or central idea. People tend to be born into subcultures and then choose to remain or seek out another group.
Answer: Consider iconoclast:

n.
  One who attacks and seeks to overthrow traditional or popular ideas or institutions.

The previous answer covers various forms of reasoning on a larger scale. It can also be something much simpler, like being burned by popular trends, or finding that mainstream culture doesn't suit you (more unique individuals, etc).
Comment: This sounds relevant. However, it does not answer the second part of the question, arguably the only one on topic on this site.
Comment: Related: https://en.wikipedia.org/wiki/Hipster_(contemporary_subculture)


Better Circular Polarizer for Sigma 150-500mm APO HSM

Question: I recently used my Sigma 150-500 lens to shoot my son surfing. I was using a circular polarizer. The shots all appear out of focus even though focus was good and depth of field was good, even though the filter was clean. As a guess, I removed the filter and the problem went away. I did not have the same problem with my other lens and its polarizing filter, so I'm thinking I have a cheap filter and need a better one. I was using AGFAphoto CPL 86mm. Do you agree, and if so, what is a recommended circular polarizer please? Thank you
Comment: Any sample images?
Comment: What is the camera? Some modern cameras are like old cameras in that they don't need polarizers to be circular. Potential for huge savings here ;)
Answer: That AGFA one cost, what, $20? The Firecrest is $200 and the Lee $240...Singh Ray goes up to $400, though your 86mm would be ~$320...ish...
I don't think that AGFA found some super cool way to manufacture quality CPL's for less than 1/10 of the guys at the top. Fact is, with filters, manufacturer quality does generally go up with price. There are some good ones lower down and some junk ones up above, as with everything, but the general trend is: you get what you pay for.
I highly suggest you look for reviews on landscape photography sites. Look for reviews that mention build quality, color cast, ghosting, contrast loss, and other items that additional glass in front of your lens can cause.
Also, check out this question: How do I choose a polarizer?
And this one: How do you handle the varying sizes of filters in your kit?
Your best bet is to spend the money and get quality filters, at the largest size that you need, and use step-up rings for smaller lenses. Now, whether that's a few circular filters or a square kit (Cokin, Lee, Formatt-Hitech, etc)...that's a whole other question.
Comment: Any actual scientific observations/data to back this up?
Comment: @MichaelC https://www.lenstip.com/115.1-article-Polarizing_filters_test.html
Comment: "During the tests we needed to use a special reduction ring to put the filters on our reference lens, then. As a result of that we weren't able to correctly measure vignetting it introduces. However to place the polarizer in the overall ranking we took an arithmetic mean of other filters' vignetting for it." Hmmm...
Comment: Their results argue against your thesis that higher priced polarizers are demonstrably better than lower priced ones. The score ranks are all over the place when sorted by price, or the prices are all over the place when ranked by score. There's not much difference between the highest and lowest scores, other than a couple of flyers that are probably defective. Their comments regarding the filter that was DQ'ed because it was linear instead of circular indicate they didn't even consider that some of the filters may have been counterfeit.
Comment: "Looking at the ranking, you can see that we can find both expensive and lousy, and cheap and good filters."
Answer:
The shots all appear out of focus even though focus was good and depth of field was good, even though the filter was clean. As a guess, I removed the filter and the problem went away.

That probably indicates that you were using a linear polarizer like we used back before the invention of autofocus. AF doesn't work with linear polarizers. When AF came out, polarizer filters were modified with a quarter-wave plate placed behind the actual polarizing material to reorient the polarized light waves in a non-intuitive circular pattern. Thus, we started calling them circular polarizers. This allows AF to continue functioning when using a CPL.
Even though the very cheap AGFA filter you were using is supposed to be a CPL, it appears to have either a defective quarter wave plate placed behind the actual polarizing material or the quarter-wave plate is not oriented as required at an exact 45° angle to the orientation of the main polarizing material. Or maybe it is an out-and-out counterfeit that does not even have a quarter wave plate behind the polarizing material.
Roger Cicala at lensrentals.com did a survey of circular polarizer filters a while back and wrote a blog article about it: My Not Nearly Complete, But Rather Entertaining, Circular Polarizer Filter Article
He compared six different CPLs in 77mm diameter ranging in price from $102 to $200 purchased from a reputable major online seller (listed in alphabetical order).

$102 - B&W XS-Pro High-Transmission Circular Polarizer MRC-Nano
$200 - Heliopan Circular Polarizer
$140 - Marumi EXUS Circular Polarizer Filter (EXUS is an acronym for a form of High-Transmission)
$150 - Sigma Water Repellent Circular Polarizing Filter
$103 - Tiffen Ultra Pol Circular Polarizing Filter
$180 - Zeiss T* Circular Polarizing Filter

He found that all of them were at least 99.9% efficient at polarizing light. He couldn't say any were more efficient than that because 99.9% was the limit of his measuring setup.
He found that all of them were flat enough to not affect IQ more than any of the others. In his words, "They all passed with flying colors."
Where they differed was in how much light they let through when not polarizing light. In other words, he shone already polarized light through them with the filter turned to let as much of it as the filter could allow through. Here are the results from least to most transmissive:

55% - Tiffen ($103)
58% - Heliopan ($200)
66% - Zeiss ($180)
68% - Sigma ($150)
88% - B&W ($102)(HT)
91% - Marumi ($140)(HT)

Roger did point out that some shooters might actually want the ND effect of less transmission when using a polarizer, which is often used in bright sunlight. So it is not always necessarily true that more transmissive translates to better in terms of CPLs.
In terms of spectral response, the two high transmission CPLs (B&W and Marumi) had near identical graphs between 430-700nm, with a flat line from around 500-700nm and a drop off on the blue end of things with significant limiting of UV wavelengths.
The rest had curves similar to each other but different from the two high transmission filters. There was no UV cut or drop off in the blue sections, there was a slight rise through the green wavelengths, then a very modest dip from green to red before a slight rise to infrared.
Neither type had individual differences between color when oriented to block the most light and when turned to block the least.
Roger's first conclusion:

If you are buying a circular polarizing filter because you want some circular polarizing, it doesn't seem to matter much which one you choose; they all polarize like gangbusters. So I saved you some money today.

He then went on to say:

The second point, one which I've been told before I did all this testing, is set the white balance after you put the CP filter on, not before. Because CP filters will have a color cast. Or just shoot in raw and fix it later, which is what we mostly do anyway.

The final major conclusion he drew was what he termed "the painful one":

I didn't want to test filters; I really didn't. But people wanted me to. So I chewed up my testing equipment budget to buy laser transmission stuff and an optical spectrometer, spent a few weeks getting everything calibrated and establishing norms, and then a couple of days testing these CP filters. I did this in clear violation of Roger's Third Law: No Good Deed Goes Unpunished.
After I was done, I told Aaron I had just documented that CP filters had different light transmission percentages and different color casts. And that high transmission filters had one look, and it was different than regular CP filters, which all were really similar. Because I was proud that my investment in time and money had paid off.
Aaron took the filters from me, put them on a piece of paper, took this picture with his cell phone, and said, "Yeah, you're right."

Later on Roger followed up with another post in which he tested a couple of cheaper CPLS:

$35 - Tiffen 77mm Circular Polarizer
$45 - Hoya 77mm HRT Circular Polarizer UV (ostensibly a High Transmissive filter)

And he measured the following:

38% - Tiffen CP with a spectra very similar to the four non-HT filters above.
53% - Hoya HRT with a spectra very similar to the two HT filters above.

He observed that the lower transmision seemed to be related to the lack of anti-reflective coatings on the cheaper filters. They were also as flat as his test could measure, just like the first six filters.
His final conclusion:

... There's not much question that as far as polarizing light, cheap CP filters do it very well. They also, as you would expect from uncoated or partially coated filters, reflect a LOT more light. This is a significant issue on a clear or UV protection filter. I'm honestly not confident if it's as big of a deal for a polarizing filter.


Intersection of Deterministic Context-Free Languages

Question: If deterministic context-free languages (DCFLs) are not closed under intersection, does this mean that the intersection of two DCFLs will always be context free but may not be deterministic? Or does it mean their intersection may not be context-free?
Answer: The statement itself doesn't imply that.  It just means that the intersection of two DCFLs might or might not be a DCFL; and thus presumably could be a DCFL; could be a CFL but not a DCFL; or could be not context-free.
However, we know more actually.

The intersection of two DCFLs could be, of course, a DCFL. For example, you can let both of them be the same DCFL. For another example, just take any two regular languages. Every regular language is a DCFL and the intersection of two regular language is still regular.

Here is an example of two DCFLs the intersection of which is not a CFL.  The intersection of $\{a^{n}b^{n}c^m \mid n\ge0, m\ge 0\}$ and $\{a^{n}b^{m}c^m \mid n\ge0, m\ge 0\}$ is the most classical non-CFL, $\{a^{n}b^{n}c^n \mid n\ge0\}$.

Exercise. Find two different non-regular DCFL the intersection of which is a DCFL.
Deeper fact. Given any natural number $n$, there is a language that is the intersection of some $n+1$ DCFLs, but it is not the intersection of any $n$ DCFLs.


Are EMV terminals required to support offline PIN as well as online PIN in US market?

Question: It is my understanding that in the US 100% of EMV transactions (contact and contactless) are expected to be performed online.  If so, why would a payment gateway be requiring a US terminal to support offline PIN (if online is offered) for CVM?
Answer: The short answer is international interoperability.
Not all countries joined the EMV band-wagon at the same time, and hence different countries support different types CVMs. Many markets still only support Offline PIN, or even Signature.
Hence, both cards and terminals support multiple CVMs, but do so in a prioritized order. The idea is that the card and terminal negotiate the highest common CVM that both support, in order to carry out a transaction.
If the American terminals only supported Online PIN, then travellers might fail to transact there, since they their cards might not support Online PIN. This could be a valid decision, but in some areas (like retail at airports) this is unacceptable.
Similarly if Americans went to overseas to countries where Online PIN is not supported, they'd expect their cards to support either Offline PIN or signature in order to facilitate payments there.
This gives most customers the best chance of at least transacting -- albeit with a 'lower' CVM.
Answer: From EMVCo, LLC
Chip Technology , A  Guide  to  EMV Version 2.0  Copyright  ©  2014  EMVCo,  LLC.    All  rights  reserved.
"The  second  feature is  a  new  CVM of  offline  PIN.  While  the  use  of  offline  PIN is entirely  optional, it  is  possible  to  use  an  EMV  chip  card  to  verify  a  PIN entered into  the  terminal PIN  pad  by  the  cardholder and  therefore provide  a  PIN based cardholder verification  method  available  for all  offline  and  online  transaction acceptance  environments,  including  below  the  floor limit and  offline  only."
Comment: this does not explain the regional requirement


With two EC2 Craft instances, the Control Panel session keeps expiring

Question: Things were fine (no session logout for admin from CP) when there was only one EC2 instance for our website.
I created a replica of the existing EC2 instance and now when I go to Control Panel, session keeps getting expired every 30 seconds.
Please help me out in order to resolve the issue.
Also, what are the things I should keep in mind when I'm using multiple EC2 instances for Craft website.
Answer: Easiest solution: if AWS supports "sticky sessions" at the load balancer level, then you should enable to to ensure that the user gets sent back to the same EC2 instance that their session was created on.
Next easiest: create an NFS share and use https://secure.php.net/manual/en/function.session-save-path.php on all EC2 shares so all EC2 instances read/write to the same place.  You'd also want to set the Craft appId and validationKey config settings to be consistent across all of the EC2 instances.
Comment: Thank you @Brad for the answer and also for editing the question, learnt quite a few things there. :)


Can someone please help me translate the writing on my dizi flute?

Question:
I've always been curious to know the translation of this sentence but I've never been able to translate it
Answer: So it's a very famous line from a very famous poem:
九月九日忆山东兄弟
【唐】王维
独在异乡为异客,每逢佳节倍思亲。
遥知兄弟登高处,遍插茱萸少一人。
It means:
独自远离家乡难免总有一点凄凉,[Leaving home alone is a little melancholic, so homesick]
每到重阳佳节倍加思念远方的亲人。[When it is ChongYang festival,(which is Sept.9th in the lunar calendar, a very "lucky festival"), I begin to miss my family that lives far away]
(These first two lines above are what is written on your flute)
远远想到兄弟们身佩茱萸登上高处,[From afar, I think about my brothers wearing cornel to higher grounds (I vaguely recall its a tradition in the Chongyang festival to 登高)]
也会因为少我一人而生遗憾之情。 [They will have regrets that I'm not there with them (I won't get into 插茱萸 because that's a long explanation of traditions)]
The poet wrote very poetically and this is not the word by word translation. Generally, the poet is lonely and is home-sick
Hope that helps
Comment: Good translation with great background intro!
Answer: Perhaps OP and others may appreciate the two lines better if the words and phrases are translated as verbatim as possible, with necessary prepositions for sentential flow. Pinyin is incorporated for ease of reading.
Here goes:-
Line #1 - 独在异乡为异客 (Dú zài yì xiāng wéi yì kè)
独在 = Alone in...
异乡 = a foreign town...
为   = as a...
异客 = foreigner.
Line #2 - 每逢佳节倍思亲 (Měi féng jiā jié bèi sī qīn)
每逢 = At every...
佳节 = festive season...
倍 = doubly...
思 = miss...
亲 = relatives / loved ones.
Comment: Good to have a word-by-word explanation. One thing about pronunciation: if I am not mistaken, 为 should pronounce wéi (2nd tone) here as opposed to wèi (4th tone).
Comment: I guess the reason the poem is placed on a Dizi is because traditionally people carry the handy Dizi around with them when traveling in times when distant journeys were rare, and so in such times when home sickness strikes on these long, lonely journeys, playing and listening to the soft, haunting sound of the Dizi does make one feels a nostalgic connection to one's home town in which the Dizi is manufactured. And so, if OP could play the Dizi when sojourning in a foreign town, country, he / she may get a more qualitative pleasure from the music produced when heard with the poem in mind.
Answer: In case too many characters may overwhelm the new contributor, those on the flute are:
独在异乡为异客 (the first line, i.e., the right vertical line, reading from top to bottom)
and
每逢佳节倍思亲(the second line, i.e., the left vertical line).
Also in case the OP is interested in, those characters are simplified Chinese, so the flute should be a modern product, although having these two lines of poem is very appropriate.