Are nail plates required on the exterior wall side of the wall studs?

Question: My steel building has 2"x6" wall studs and 2"x4" exterior purlins. The steel siding is attached with screws to the purlins. I've run my wiring behind the studs and attached it to the top of the purlins. Thus the wiring lays on the purlins behind the 2"x 6" studs. The inspector stopped by and informed me that nail plates are required where less than 1 1/4" of wood is between the wall face and the wiring. Since there is actually 5 1/2" from the inside wall face to the wiring, he's now referring to the exterior wall. I thought the purpose of nail plates was for protection from nails or screws being inserted from the inside of the building. Why would anyone be needing protection from nails or screws being inserted from the outside wall? I didn't argue but I don't think he's correct. I guess I'm wondering if he NEC defines the wall face where nail plates are required? I'd be surprised if the face wall refers to the outside exterior side of the building wall. Thanks
Comment: Isn't the exterior siding attached before the wiring is put in place? How would one know where to put nail plates with no wiring installed? But isn't wiring usually placed in holes in the studs, not on the outside of the studs right next to the exterior siding?
Comment: I suspect not -- but I think it's a fine idea if you have access to that face.
Comment: It sounds like the NEC requirement of 1 1/4" of wood envisions a routing of the wires through holes in the centers of 3 1/2" wide  studs or maybe even 2 x 3 studs which are 2 1/2" wide.
Answer: The code does not differentiate which face of the stud. It simply says:

"300.4(A)(1)Bored Holes
In both exposed and concealed locations, where a cable- or raceway-type wiring method is installed through bored holes in joists, rafters, or wood members, holes shall be bored so that the edge of the hole is not less than 32 mm (1¼ in.) from the nearest edge of the wood member. Where this distance cannot be maintained, the cable or raceway shall be protected from penetration by screws or nails by a steel plate(s) or bushing(s), at least 1.6 mm (1/16 in.) thick, and of appropriate length and width installed to cover the area of the wiring."
Comment: It doesn't sound like the cables pass though bored holes in OP's case - he states they secured to the tops of the purlins. Would still be a good idea to maintain a good distance from the exterior face.
Comment: If the wire is anchored less than 1-1/4" from either surface plates are required. I have seen people drive a nail and hit a wire that was to close to the surface.
Answer: If you are in WA then in WAC 296-46B-010 General it states that:
(a) The exterior shear panel/sheathing nail inspection must be completed by the building code inspector and, where siding nails or fasteners which penetrate into the wall cavity are to be used, all siding must be installed; or
(b) All wiring and device boxes must be a minimum of 2 ½ inches from the exterior surface of the framing member; or
(c) All wiring and device boxes must be protected by a steel plate a minimum of 1/16 inch thick and of appropriate width and height installed to cover the area of the wiring or box.
Answer: If your cables don't go through drilled holes in the framing members (studs or purlins), 300.4(A)(1) would not apply in that case. It only applies to cables passing through a hole in the member.
It sounds like in your case, the cables are run on top of the purlins, so technically, you do not need nail plates there.
The thing is, the steel siding does not get attached with puny, short drywall screws, but rather long ones probably. So you may still want to consider changing your plan and running the cables either through drilled holes in the studs, or adding some kind of protection. If that siding ever gets replaced, an errand screw can quickly go through your cables.


Clam Antivirus auto scan on certain time on Linux?

Question: I required to know from experts, how can we run Clam Antivirus (https://www.clamav.net/) and auto scan at a certain time on a Linux machine.
I don't know how this will be done, I need to create a crontab, or is there any configuration available with Clam Antivirus?
Answer: You could use a crontab. Personal preference is to write a custom script to be called by cron and execute it so as to write a log file also in the process.
#! /bin/bash
scantime=$(date -u +%H)
#writes hour of scan, assuming to be run every 6 hours
fileout="$HOME/clamav-$(date -u +'%Hh-%d-%Y').log"

path="/var $HOME/Downloads"

for i in $path; do
    echo "Starting hourly scan of $i
    clamscan -r --bell -i $i >> $fileout
    wait
done

and then add 0 0 0/6 1/1 * ? * /path/to/script to crontab -e. This will run the script every 6 hours.
Comment: What is `clamscan`? is it the real name of ClamAV process? I have not installed ClamAV, can you just give me quick shot on steps assisting to install on RHEL or Ubuntu.
Comment: Please read the [official documentation](https://www.clamav.net/documents/installing-clamav) for help with installation. `Clamscan` is a command line utility that performs a scan.
Comment: this script should be saved like `scanner.sh` or just `scanner`? Or it doesn't matter.
Comment: Does not matter


Key exchange from discrete logarithm only

Question: Diffie-Hellman key exchange is sometimes informally said to be hard under the discrete logarithm assumption in the chosen group. But if I am reading literature correctly, it actually uses a stronger assumption on the group and that's the assumption of Decisional Diffie-Hellman.
Is there a key exchange whose SK-security is based solely on the hardness of discrete logarithm problem? Are there any other security notions/caveats to look out for in such a different key exchange?
Comment: It's hard to imagine an (A)KE from Dlog only. In most construction, à Diffie Hellman like operation is  needed to obtain a fresh key/ or authente. Therefore, at least CDH is needed or any other Oracle DH assumption. In a group where Dlog would be (tightly) equivalent to CDH. I suppose, one can say the security is based on Dlog.
Answer: The difficulty ranking from hardest to easiest is discrete logarithm, computational Diffie-Hellman, decisional Diffie-Hellman. Consequently any security property that relies on the hardness of the decisional Diffie-Hellman problem can be solved if discrete logarithms can be efficiently calculated.
Different security properties of key exchanges can depend on different problems. For example in the classic El Gamal encryption scheme, private key recovery is as hard as the discrete logarithm problem, plaintext recovery is as hard as the computational Diffie-Hellman problem and distinguishing ciphertext is as hard as the decisional Diffie-Hellman problem.
Comment: I guess what I am thinking about is plaintext recovery given I am thinking of SK-security of the key exchange, so my question becomes, is there a key exchange where instead of computational Diffie-hellman, (partial) plaintext recovery becomes discrete log.
Answer: Looking around some more, according to these lecture notes, 9.10, this is an open problem.


How to send welcome email via API?

Question: I don't want to trigger welcome to salesforce email on user creations. I have achieved that by inserting users using workbench and by setting Trigger User Emails to false. Now I want to send the welcome email only after I'm done with some setup for each user. How can I achieve this? I'm aware of system methods like System.resetPassword(userId, sendUserEmail) & setPassword(userId, password) but using them resets and sets the password respectively. I want to send the Welcome email without going to each user record and check 'Generate new password and notify user immediately'.
Comment: Create a time based workflow with an email action
Comment: @BorisBachovski How can I put 'Verify Account' on an email template? Maybe my question is not clear, I want to send welcome emails later, the time gap could be hours, days etc. My requirement is to send the welcome email later.
Comment: Are these community users?
Comment: These users are standard salesforce users.
Comment: This is a good question.  The best I've been able to do is to use process builder and an invocable method to reset the user's password when i activate the user via process builder, but it doesnt send the 'welcome' email.  I get the feeling that isnt possible.
Answer: I'm using process builder and an 'activation date' custom field to trigger user activation.  Like you, I want to send the 'welcome' email to the user, with the nice formatting as below:

So far, I have not found any way to trigger this welcome email.
The only thing i've been able to do is trigger the password reset email, which is much less compelling.

I'm doing this using an invocable method, with the following code.  I initially thought I could do this just by activating user w/ EmailHeader.TriggerUserEmail = TRUE, but that did not do anything.  I had to use the System.resetPassword method (in a loop!) to make it work.
I dont think process builder would put multiple users in the same set of IDs but PB bulkification is unclear so thought best to be safer.
Here is the code I'm using.
public class ActivateUsersWithNotification
{
    @InvocableMethod
    public static void ActivateUsers(List<Id> UserIds)
    {
            Database.DMLOptions dmo = new Database.DMLOptions(); // this didnt make any difference
            dmo.EmailHeader.triggerUserEmail = true;
            list<User> Users= new List<User>([select id from user where user.id in :UserIds]);
            for (User u : Users) {
            u.setOptions(dmo);  // this didnt make any difference, could remove it
            u.IsActive = TRUE;
            }
            database.update(Users,dmo);
            for (User u : Users) {
            System.resetPassword(u.Id,True);
            }

   }
}

How to send welcome email via API?


Hot Water Being Used Last Within A Sink

Question: If the the hot water was used last but one needs to wash their hands on Shabbath, if they turn on the cold water but hot water comes out first, are they in violation of Shabbath?
Comment: If you are talking about standard home plumbing (in the USA at least) with either two handles- two lines-  or a single handle- cartridge that turns from one line to the other- either way, if you really turn only cold or the one handle all the way to cold, then any hot/warm water that comes out was sitting in the faucet already and will not cause the hot water heater to turn on, etc.
Comment: @Damila Some single-handle faucets can be damaged or poorly designed/installed, and use a bit of warm water even when they are turned as far towards 'cold' as possible. But this doesn't usually happen.
Comment: @Fred True, for that replace the cartridge. Regardless, that problem would be not rdependent to the question of hot water being used recently. So "May one use a single handled faucet with a damaged cartridge on Shabbat?" would be a different halachic question I guess.
Answer: The actual problem with using hot water from the tap is that more cold water will replace the water you used in the hot water heater, and the new cold water will become "cooked" on Shabbos. In the case of water that is already in the pipes, if you turn on the cold water, no hot water is leaving the hot water heater (since you only turned the cold water tap), so no cold water will enter the hot water heater to replace it, hence there is no issue with using the tap on Shabbos, even if there is still hot water in the pipes.
Comment: Aside from the problem you describe, one may wash one's hands with hot water on Shabbos (Shulchan Aruch [OC 326:1](https://www.sefaria.org/Shulchan_Arukh%2C_Orach_Chayim.326.1?lang=bi)) unless it was heated in violation of Shabbos. If a non-Jew heated up the water on Shabbos for themselves, R' Moshe ([*Igros Moshe* OC I, 126:2](https://www.hebrewbooks.org/pdfpager.aspx?req=916&st=&pgnum=210)) says it is permissible for a Jew to use it, though the *'Aruch HaShulchan* (OC 326:2, "אבל בחמין שהוחמו בשבת אפילו הוחם על ידי עכו"ם לצורך עצמו  אסור אפילו לטבול ידו בהן") says it is forbidden to use it.
Comment: So, depending on when, how, and by whom `the hot water was used last`, these factors might come into play as well.

Hot Water Being Used Last Within A Sink


Sample Gamma distribution in R

Question: I'm doing a programming assignment on sample gamma distributions in R. I used a loop to create histograms of a total of 49 different samples, each with different parameters. I was then asked to compare the theoretical mean and variance to the sample mean and variance for each of the 49 cases. I used a loop to create vectors of each of the sample means etc. However, I am getting answers such as (1.0e+00) where in this case, the answer should just be one. How do I solve this problem? I hope Ive given enough information and am making sense, if not I can clarify further, I have never done any probability programming so I'm relatively new to it.
Comment: Is this a formatting issue?  `1.0e+00` means $1 \times 10^0$ and that is $1$
Answer: Your programming efforts are probably correct, but you might not be familiar with E notation. It's quite widely used in programming contexts and one of the default output formats of R.
The part after the e is the exponent of 10, so $10^{0}$, and you need to multiply that by the part before the e. This yields $1 \times 1.0 = 1$, as you expected.
As described here on Stack Overflow (and in the other answer), you can disable it with options(scipen = 999) and it's possible to put that in your .Rprofile file so it becomes the default for you.
Answer: If this is a formatting issue, just run the following command which will suppress the scientific notation:
options(scipen = 9999)

Sample Gamma distribution in R


Is there any evidence that immunity or resistance is heritable?

Question: Is any means by which smallpox or any other disease be heritable?
I have heard that smallpox introduced by European colonialists affected (and reduced) a significant proportion of the native American population. How were the native Americans more susceptible to smallpox? Is disease susceptibility or immunity heritable?
Comment: @jamesqf but there is evidence of intention in the case of the British and native Americans, "could it not be contrived to send the small pox among the disaffected tribes of Indians" Jeff Amherst https://books.google.com/books?id=EB4bAAAAYAAJ&pg=PA39&dq=could+it+not+be+contrived+to+send+the+small+pox+among+the+disaffected+tribes+of+Indians&hl=en&sa=X&ved=0ahUKEwj_0MKS8MbcAhULmuAKHay7Bm4Q6AEIKzAA#v=onepage&q=could%20it%20not%20be%20contrived%20to%20send%20the%20small%20pox%20among%20the%20disaffected%20tribes%20of%20Indians&f=false
Comment: Susceptibility to infectious diseases is most certainly heritable. Variola is specific case. I'm off to the airport, but will be happy to give you a thorough answer tomorrow. Let me suggest, though, that you edit your question and rephrase it to remove the unnecessary political angle. I can't see how it adds anything to the otherwise useful scientific question.
Comment: So do you have an answer
Comment: A naturally-occuring disease would not lead to genocide.  Else it could equally well be claimed that the Black Death was genocide of Europeans by (probably) Chinese, or AIDS an attempt at genocide by Africans.
Comment: I'm voting to close this question as off-topic because it calls for speculation and is presented in a provocative manner. Its main concern appears to be American social history.
Answer: TL;DR: Pre-Columbian Native Americans would have been much more susceptible to smallpox than the Europeans who spread it, because of non-heritable factors such as immunity and traditional knowledge, and also because of heritable factors. It's therefore completely believable that smallpox (and other diseases introduced by Europeans, such as measles) could have caused massive deaths among the American populations post-contact.

The title of the question makes an incorrect assumption. Resistance to smallpox would not have to be heritable to have a highly susceptible population. European populations were continually exposed to smallpox and there would have been both maternal immunity and acquired immunity in most populations, leading to a herd immunity effect that would both reduce viral spread and increase resistance among some infected people. (It's commonly believed that herd immunity needs to be very high to lead to protection, but that's a misconception -- the lower the contagiousness of the disease, the lower herd immunity needs to be to lead to protection.)

Smallpox apparently circulated as a childhood disease in northern England and Sweden, even where population densities were low and settlement patterns dispersed.

--The geography of smallpox in England before vaccination: A conundrum resolved
Cultural factors would also be important. Europeans had thousands of years of experience with smallpox, and knew that isolating victims was important to reduce spread.

We concluded that transmission was controlled in southern England by local practices of avoidance and mass inoculation that arose in the seventeenth and eighteenth centuries. Avoidance measures included isolation of victims in pest houses and private homes, as well as cancellation of markets and other public gatherings, and pre-dated the widespread use of inoculation.

--The geography of smallpox in England before vaccination: A conundrum resolved
That said, there is also evidence that European populations did have some innate resistance to smallpox that was lacking in the pre-Columbian Native Americans, and this innate resistance may be even stronger in Africa, which is (possibly) where smallpox originated:

Pathogens that diminish reproductive potential, either through death or poor health, drive selection on genetic variants that affect resistance; selection is likely to be most evident for pathogens with a long-standing relationship with Homo sapiens, including those that cause malaria, smallpox, cholera, tuberculosis and leprosy ... We noted that, for 32 viral isolates with documented mortality, death rates are lower in Africa (0.4−12%) than elsewhere (4−38%), even though all isolates were from a single phylogenetic clade. This is consistent with selection for resistance in Africa, where the smallpox virus is predicted to have evolved from a rodent-borne ancestor tens of thousands of years ago and where outbreaks of other poxviruses continue nowadays.
With smallpox eradicated, vaccine response is used as a crude phenotypic proxy for studying host resistance. Two GWASs that included European, African American and Hispanic populations identified 37 SNPs associated with cytokine response to vaccination179, 180 (P < 1 × 10−8). Most of the significant associations (65%) were found in African Americans, even though their sample size was half of that of the European cohorts, which is consistent with a larger effect due to selection in Africa.

--Natural selection and infectious disease in human populations
Some resistance alleles have been tentatively mapped:

However, when examining the population post-contact and into contemporary times, variants of the HLA-DQA1 gene experience a marked frequency change.  ... Although we were unable to precisely identify the selection coefficient necessary to drive the allele frequency change (since the likelihood surface is relatively flat, Supplementary Fig. 8), it is likely that relatively strong negative selection occurred. Such strength would be expected under a time frame of less than seven generations and correlates with the high mortality rates associated with the regional smallpox epidemics of the 1800s, which reached upwards of 70%

--A time transect of exomes from a Native American population before and after European contact

The CCR5 Δ32 mutation is a good example of an advantageous allele with a well-characterized geographic distribution. ...  The mutation is found principally in Europe and western Asia, where average frequencies are approximately 10% ... Bubonic plague was initially proposed as the selective agent [2], but subsequent analysis suggested that a disease like smallpox is a more plausible candidate

--The Geographic Spread of the CCR5 Δ32 HIV-Resistance Allele
Comment: This is good, but I wonder why you would say that immunity to an illness that requires T-cell involvement (and thus antigen presentation on the MHC) is not heritable? (top of your post, in the tl;dr summary)
Comment: Adaptive immunity is not considered heritable, even though of course it has heritable components to it. If you know enough to comment on MHC, you must have noticed the link with HLA-DQA1, which is of course an MHC allele.
Comment: I've upvoted your post, but I'd encourage you to read [Casanova's excellent inaugural PNAS article](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4697415/). You may not consider adaptive immunity to be heritable, but as an infectious disease doctor, I can tell you it certainly is. MHC loci are among the most variable in the entire genome, this variability is heritable, and contributes a great deal to host susceptibility. There are plenty of other examples.
Comment: And yes, I noticed and appreciated the link. I was making a suggestion that you edit your statement in the tl;dr summary, where you classified immunity (in general) as non-heritable. That is a false classification. You could narrow it down to antibody response and be less wrong, but again, with class switching, it relies on T-cell involvement. It's a good post overall. I was just remarking on the one error.
Comment: @user45026 So basically yes. If you need further clarification, please spell out what's confusing you.
Comment: @user45026 Second sentence. Yes.
Comment: Well that's an assertion that you are right. The only relevant evidence you gave is that Europeans are more susceptible than africans
Answer: As usual, @iayork has a great answer. Let me add some additional context.
Host-pathogen interactions
Pathogens are not disease. The result of an interaction between, e.g., a virus and a host is variable. This is a fundamental and extremely important concept in understanding infectious disease. You can read more about it in Chapter 286 of Cecil Medicine and Chapter 119 of Harrison's Internal Medicine. The clinical outcome of a host-pathogen interaction is as much dependent on the host as it is the pathogen.

Host effects are variable and heritable
There is great interindividual and interpopulation variability in host factor side of this graph, the susceptibility/resistance to specific infectious diseases. Much of it is heritable. Sickle cell trait is an excellent example. We refer to it so often to illustrate genetic principles, that the key lesson about host-pathogen interactions is often forgotten. It was not unnoticed in the original paper. This genetic variation in susceptibility is not an exception, see Jean-Laurent Casanova's inaugural article in PNAS for an excellent discussion.
Comment on @iayork's answer
I did enjoy the discussion of the non-genetic (but certainly vertically transmitted) traditional knowledge in the susceptibility of a population to smallpox, as well as the references to single gene associations. Host susceptibility and resistance is certainly heritable, but as s/he points out, there are important non-heritable contributions to consider.


$X_1,…X_4$ independent, then $(X_1,X_2)$ and $(X_3,X_4)$ independent

Question: If $X_1,…,X_4$ are independent random variables how can I show that $(X_1,X_2)$ and $(X_3,X_4)$ are independent? Intuitively, I would say this is trivial but is there a formal proof?
Answer: This classical property is a sort of associativity property of independence. It follows from a corollary of the monotone convergence theorem saying that two probability measures coinciding on some collection $\mathcal{S}$ of sets which is closed under finite intersections coincide on $\sigma(\mathcal{S})$.
For example, the collection $\mathcal{S}_1 := \{A_1 \cap A_2 : A_1 \in \sigma(X_1), A_2 \in \sigma(X_2)\}$ is stable under intersection and generates $\sigma(X_1,X_2)$.
Proving that $\sigma(X_1,X_2)$ is independent of $\sigma(X_3,X_4)$ is equivalent to prove that for every event $B \in \sigma(X_3,X_4)$ with positive probability, the probability measures $P$ and $P[\cdot|B]$ coincide on $\sigma(X_1,X_2)$. Hence, we only need to check those probability measures coincide on $\mathcal{S}_1$.
Given $A_1 \in \sigma(X_1)$ and $A_2 \in \sigma(X_2)$, we have to prove that $$\forall B \in \sigma(X_3,X_4), \quad P[A_1 \cap A_2 \cap B] = P[A_1 \cap A_2] P[B].$$ If $P[A_1 \cap A_2]=0$, it is obvious. Otherwise, we are led to check that the probability measures $P$ and $P[\cdot|A_1 \cap A_2]$ coincide on $\sigma(X_3,X_4)$. In the same way as above, we only need to check the probability measures $P$ and $P[\cdot|A_1 \cap A_2]$ coincide on $\mathcal{S}_2 := \{A_3 \cap A_4 : A_3 \in \sigma(X_3), A_4 \in \sigma(X_4)\}$, which follows directly by the independence of $X_1,X_2,X_3,X_4$.


What metering mode should be used for an HDR shot?

Question: Maybe I'm over thinking this, but I think evaluative is the best being that it would give you the "best" balance of light across the scene.  Is it dependent on the scene/mood at the time like a shingle shot?  Should I not worry about it because of the multiple exposures?  So my main question is, what's the best metering method (evaluative, partial, center) for an HDR shot?
Answer: The metering mode is largely irrelevant when preparing a multi-exposure HDR as no single image will be correctly exposed, so you're only trying to get the centre image in the ballpark so that you don't waste exposures at either end. Unless you're really skilled at judging the dynamic range of a scene (remember the brain compresses dynamic range to fool you), you'll likely have to tweak the number of exposures or the gap between each exposure in to make sure you have the full range captured so you can dial in the correct exposure compensation at this point.
I find whenever I'm shooting a situation where I have the opportunity to review and adjust exposure you want a metering mode that is not sensitive to slight changes in composition, settings like spot metering are bad as if you move the spot slightly after setting exposure compensation the measured exposure could shift, undoing your correction.
Answer: I spot meter the brightest and darkest parts of the scene so I can

know exactly what the dynamic range of the scene is.  do I even need HDR?  if that middle shot looks good enough I may not merge the other images.
place the middle exposure roughly halfway between
make sure my other exposures cover the range and then some.
it also forces me to think about the bright and shadow areas of the image and if they're important to me.
Comment: +1, easy on HDR, do overuse this technique, it's often not needed and results in horrid pictures.
Comment: In my case more out of laziness (not carrying a tripod and not wanting to spend time on post processing) rather than avoiding horrid pictures. If I do HDR I usually try to make it subtle, mainly blending in otherwise washed out sky
Answer: Yes, evaluative will typically give the best results. You should aim to expose the darkest image for highlights - ie. nothing should be clamped.


why do we mourn the 24k students of Rabbi Akivah?

Question: until lag b'omer we mourn the 24k students of Rabbi Akiva who were wiped out in a plague (Yevamot 62b). Why do we mourn this and not many other tragic events in our history (ex.pinchas affair, korach, quail, the various tragic wars in tanach)? also why is this mourned longer than any other event?
Comment: "why is this mourned longer than any other event?" Because it happened to take place over the longest period of time? (It's not actually clear that this is the longest event. There are 26 days each year of mourning for the Temple, while Sefira restrictions only last 25 days in some customs. Also arguably the mourning period of the "second half" of the Omer for the Crusades is longer than the first half. Also a parent's death is mourned for a full year.)
Comment: @DoubleAA continuously its the longest
Comment: @ray A parent's death is still longer.
Comment: @DoubleAA What are the 26 days? 21 for Bein HaMetzarim plus Tzom Gedalia and Asara BeTeves only makes 23. Maybe 24 if you could 10 Av.
Comment: @DonielF It's not 21. Tisha Bav is day 22. It's "three weeks" with עד ועד בכלל
Comment: @DoubleAA Fair, but still not 26.
Comment: @DonielF I guess 25 then. Maybe I counted Taanit Esther by accident?
Answer: The Gemarah which you quoted above (Yevamos 62b) says after Rabbi Akiva's 24,000 disciples died, the world was desolate until Rabbi Akiva came & taught five new students. Rashi there says the reason for this was because of the Torah which was forgotten by their passing.  The Torah is the lifeblood of the Jewish people. It is also the reason the world is continuously in existence.
The Torah, at the end of creation (Bereishis Perek 1 Pasuk 31) says יום השישי . Rashi, apparently bothered by the extra "Hay" in the word Shishi brings a Gemarah Shabbos 88a which says the entire six days of creation was waiting for the 6th day of Sivan - the day when thousands of years later the Jews would accept the Torah. Without the Torah the world cannot survive.
It is quoted from the Chofetz Chaim (Died 1933), although I don't have a source for you to look it up, that one of the reasons why G-d made different time zones in the world was so that there can always be people studying Torah throughout the day & night. Otherwise the world would cease to exist.
This is the reason why we specifically mourn the students of Rabbi Akiva passing away, as a reminder for us how important our learning is for ourselves & the world at large.
The above is my own theory, I did not see this quoted somewhere else. I welcome comments on it.
Comment: Jews didn't exist in all timezones too 400 years ago, and were only in exactly one timezone till 2500 years ago
Comment: I believe the gemara there says they died between the days of Pesach & Shavuot. What days they actually died is a dispute among the commentators.
Comment: @DoubleAA While true, I don't think that really detracts from the answer, which works fine without that line.
Comment: @DoubleAA Those days there were people who were studying Torah at night (such as Dovid Hamelech)
Comment: any connection to the first 32 days of omer?


Which Scikit-learn application should I use in order to process my data? (Python)

Question: I am writing a program that will take a multitude of data, such as chlorophyll levels, water temperature, nitrogen/phosphorous levels, etc., in order to predict the growth of algae in a body of water. There are many factors that could affect the growth of algae. Because of this, I do not know which application I should use in the Scikit-learn library in order to accommodate all of the different columns. The algae level is one of the columns. To be more specific, there are 17 other columns that I want to account for (Half of which are identifiers for if the data is likely to be incorrect). What should I use in order to account for all of the columns?
Answer: Your problem is not well defined. I suppose you want to estimate/predict the growth based on some explanatory variables, so $y(X)$. First you need to define what $y$ actually is, an (absolute) amount or a growth rate?
You can for instance formulate a linear model like:
$$y = \beta_0 + \beta_1 + X + u$$
to measure the absolute amount of $y$ contingent on some $X$. Alternatively, you can also look at how $y$ changes, when $X$ changes by using a $log$ transformation on either $y$ or $X$. See this for more details. To apply such models, you would generally use linear regression.
However, if you are simply up to making a prediction (and you are not necessarily interested in interpreting regression coefficients in order to find average marginal effects of $X$ on $y$), you can use many different model types in sklearn.
It is standard to include several explanatory variables ($X$), so this is not an issue. See the various sklearn examples, such as this one.
If you are simply up to prediction, you may start with a random forest regression (since this is most robust and often works well). First, split your data into a train and test set. Second, run a random forest on the train set, Third, test your model based on the test set.


How would someone determine the speed of sound in water experimentally?

Question: I'm in highschool so I'm looking for a highschool-level lab idea.
Comment: Welcome on Physics SE :) While I do think your question is valid, giving a bit of input and ideas yourself would be nice to make more people motivated to actually answer you. Have you had any ideas about it so far?
Comment: http://iopscience.iop.org/article/10.1088/0031-9120/36/1/312/pdf or http://iopscience.iop.org/article/10.1088/0031-9120/50/6/727/pdf.  Ask your teacher to obtain access and get the details.
Answer: One other interesting way to do this would be to set up standing waves in water and measuring the total number and location of nodes to find which mode the waves are in.And since we are driving the waves we know the driving frequency,with this information we can find speed of sound.
Answer: In the oil business one would place a source at a known distance from a geophone -a receiver, fire the source and record the time, and record the time the wavelet arrived at the phone.  A source could be anything that would supply a short rap.  Many smart phones contain accelerometer sensors that can be used as a receiver  I'm thinking of putting smart phones on either outside ends of a container of water and sharply rapping an object as a source.  Water is around 5000 ft/second or 1500 m/sec so I'm worried about the time resolution on the phones, assuming they record time for an event.


Is it wrong to assume the op-amp has the same voltage at its both terminals when deriving its non-inverting closed-loop gain?

Question: I am referring to the approach taken in this video, at about 00:43. I know that the op-amp "tries" to balance the voltages at its both terminals but is it a completely correct approach to take V+ = V- when deriving the op-amp's closed-loop gain? As far as I know, in practice, V+ is never equal to V-. But from a theoretical point of view, would it always be correct to assume V+ = V- when calculating the op-amp's closed-loop gain?
Answer: Yes. V+ = V- in cases whenever an OP-AMP gives out stable output and negative feedback dominated cases. In the real world, they are not equal. But almost equal. The difference between V+ and V- is almost zero and the gain of the OP-AMP is huge. But for a theoretical purpose, we just take it as zero and assume the gain of the OP-AMP is infinity.
If you want a better answer, use the formula V0 = A.(V+ - V-). In the video, V+ = Vin and V- = R1.V0/(R1 + RF) and then derive V0.
Comment: My professor said that he had to take away some points from my score in an exam because I assumed V+ = V- when deriving the op-amp's closed-loop gain, even though I have correctly derived the expression. We both agree that in practice V+ is never equal to V- but from a scientific/theoretical point of view is it appropriate to assume V+ = V- in an exam to get full points?
Comment: If the question specifies \$A_{OL}\$ then you deserve to lose points by assuming V+ = V-.
Comment: I believe there was a mention of the open-loop gain within the question text, so now I see why I deserved to lose points. Thank you for your clarification.
Comment: It's always worth blasting through with infinite gain, if it's an exam make that assumption explicit, to do a rough cut. Then bring in the second order effects like finite gain to complicate and correct the first attempt. You can expect it to be close, if it isn't, then it's worth looking for a mistake. Check out the story about the Hubble mirror grinding, and the difference between the coarse corrector, and the 'precision' one.


How is pressure kept nearly constant in jet engine burner?

Question: How do engineers make sure the pressure doesn't rise, but velocity does. I have no idea how that can work, please help!
Answer: I have a feeling The term "Constant Pressure" for a gas turbine engine, And the Term "Burner" used in your question, is slightly confusing to be able to clearly understand your query. Can you please specify if You Mean to ask about the Combustion Chamber where fuel and air is mixed and ignited, or the engine exhaust nozzle where there is a provision for "After Burners" in older jet engines.
Know that the Jet Engine is termed as "Constant pressure" machine in comparison with the Piston Engine Combustion, where the pressure changes with every stroke, leading to a power stroke post combustion where the actual force is generated.
When compared with Jet engine, the pressure in the Combustion Section of Jet Engine is almost constant, But before reaching Combustion Section (Through Compressor Air delivery) the pressure is made to increase with every stage of the compressors and the reason for this is to obtain high energy post combustion to generate enough force to move the turbines and to enable the Jet velocity Leaving the engine to be as high possible to be able to generate enough thrust (Newton's Third Law), and this is achieved by constructing the Engine Exhaust duct in the Convergent-Divergent shape, The reason best explained by the following paragraph from notes taken from one of the best books i have ever read,
The following is as it is from the text book, all credits to the moderators.
"In the convergent exhaust duct, the shape of the duct accelerates the gas. In a turbo-jet, the
gas flows at sub-sonic speed at low thrust levels only, at almost all levels above idle power the
exhaust velocity reaches the speed of sound in relation to the exhaust gas temperature, at this
point the nozzle is said to be 'choked'. This means that no further increase in velocity can be
obtained unless the temperature is increased.
When the gas enters the convergent section of the convergent-divergent nozzle its velocity
increases with a corresponding fall in static pressure. The gas velocity at this point now reaches
the local speed of sound (Mach 1). As the gas flows into the divergent section it progressively
accelerates towards the open exit, the reaction to this increase in momentum is a pressure force
acting on the inside wall of the nozzle. A component of this force which acts parallel to the
longitudinal axis of the nozzle produces the further increase in thrust."
Pressure is kept Constant In the combustion chamber by not allowing the gases to escape from anywhere but to allow them to move forward only, remember there is a slight decrease in pressure during this but then the drop is considered to be negligible, and it is also made sure that the pressure at compressor delivery is high all the time thus facilitating the High to Low flow of pressure.
There are times when the air mass and pressure supposed to be in the combustion chamber returns to the compressor thus resulting into a probable surge and or a stall.
But this only happen when the compressor has problems with its blades or rotation or contamination.


Usage of tsclean() in time series data

Question: Consider the scenario, where I have many time series data. I have to make predictions for all.I made a ts object out the data. The data may contain outliers. I am not sure of it.
But I always pass the ts object to tsclean() function of forecast package before building ARIMA model out of it. Is this a right approach?
If not, Please provide any other alternative.
Answer: Outliers can occur in patches thus making them level shifts . Outliers can occur systematically ...say every june . Outliers an often be Inliers  1,9,1,9,1,9,1,9,5,9 where "5" is an inlier. To detect the 4 kinds of latent deterministic structure in either a univariate or a multivariate setting one has to be concerned with Pulses , Level/Step shifts , Seasonal Pulses ( e.g. a June effect starts at year 7 and local time trends .
The program https://cran.r-project.org/web/packages/tsoutliers/tsoutliers.pdf is quite good but it requires an arima model which of course can't be easily  identified if there are outliers present ( chicken and egg comes to mind ! ). This explains why you need a comprehensive/holistic approach to simultaneously identifying outliers ( all 4 kinds ) and the arima component. "Tsoutliers" does not handle the seasonal pulse issue at all and would then inadvertently flag multiple pulses which would not lead to a proper forecast of the seasonal dummy effect.
Given that I wanted to restrict myself to free software I would use "tsoutliers" and manulayy provide some alternative arima models and then compare the multiple sequential results to see which combo generates an error process free of arima structure and free of outliers that also has constant error variance.

Usage of tsclean() in time series data


Change Label of custom post type

Question: I have created a custom post type by the name of Teams. Listing page looks like this
How can I change this highlighted title label?
Is there any hook for this that you know of?
Answer: The list_table_primary_column hook might be the one to go with, i.e:
add_filter('list_table_primary_column', 'teams_table_primary_column', 10, 2);

function teams_table_primary_column($colname, $screen_id) {
    if($screen_id == 'teams' && $colname == 'Title') {
        return "New column name";
    }
}

Note: this is completely untested, let me know how it goes!
Reference
Comment: I tested it. It works.

Change Label of custom post type


Why did my rum cake turn black?

Question: A friend baked a rum cake for me.  She baked it in an aluminum pan.  The cake was soaking in rum.  Overnight the cake turned BLACK.  I suspect this is a chemical reaction, but cannot find information to back my theory. Surely, this may not be safe to eat.  Anybody?
My gifted cake....well....it's a bit scarier......
Comment: Never made Rum Cake before, but a quick google search came up with a few different variants of it. Including this one, where the cake is black(ish). https://www.alicaspepperpot.com/black-cake-caribbean-rum-soaked-fruit-cake/
Comment: I felt quite sad thinking that the cake might be ruined...
Comment: Can you check with the cook if she has had this happen before?
Comment: Maybe dark rum?
Answer: This is an interesting question. Personally I would throw it out, the discoloration and resulting taste are the result of a chemical reaction with the pan.
The brownish discoloration is a sign that the Aluminium (Al, the chemical symbol for the element from here on), is being attacked by a chemical reaction. This is most likely by an acid, though salts can also cause this to happen. In both cases what is happening is that the Al is being converted into the cation Al3+. Al3+ is bio-available and considered to be the main source of Al toxicity in humans. Acute Al toxicity results in non-specific symptoms, like confusion, muscle weakness, and bone pain, however normal exposure is not considered harmful. Not a lot of long-term data has been produced, but there are potential links to things like Alzheimer's disease, and breast cancer.
The European Food Safety Authority has a limit of 1 mg/kg of body weight/week for intake from foods. This paper suggests in passing that some people are often at or beyond the EFSA limit, but this might not result in any problems, also mentioned in that paper is that the WHO has a provisional limit of 2 mg/kg/week.
Now, as to how much of the Al has dissolved into your cake, and how much you are ingesting if you ate the whole cake is impossible to estimate without measuring the Al content of the cake and syrup. Generally you will be able to taste the metallic taste of Al and other metals when they dissolve to this sort of level, though in this case, the already strong taste of rum might well overpower the metallic taste.
Answer: Aluminum cookware is "reactive", as opposed to "non-reactive" cookware like glass or stainless steel.  When cooking acidic ingredients, a reaction occurs that can discolor food and sometimes leave a taste of tin.  It would appear that the rum cake in question was acidic enough to cause this reaction. While I have yet to come across anything that says this is dangerous, I have come across several discussions that say aluminum discolored food is "ruined."
Comment: @DavidRicherby The article sounds like there's been a lot more going on than just  aluminium though. I don't think your average cooking pan has copper & lead solderings, for instance.
Comment: The Camelford incident isn't really comparable, because it was a case of an aluminum compound causing the acidity leading to leaching of other metals into the water. In this case, the acidity is already present, not caused by the aluminum itself, and there are no other metals available.
Comment: "While I have yet to come across anything that says this is dangerous" [Camelford](https://en.wikipedia.org/wiki/Camelford_water_pollution_incident).
Comment: @DavidRicherby That was aluminum sulfate, which is an acid.
Answer: It is unlikely but possible that it is unsafe to eat. This study of aluminum leaching from pans during cooking of acidic liquids (https://www.ncbi.nlm.nih.gov/pubmed/1397396) showed a levels as high as about 50mg/kg. Let's assume your cake is about 1kg, so 50mg aluminum. The European Food Safety guideline for aluminum according to this paper (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5651828/) is 1mg/kg/week. So if you weigh only 50kg and you eat the whole cake in a week and it really leached about the most aluminum seen, you're up against that limit.
But probably not, since the average human weighs more than that, the rate of leaching should be much lower at room temperature, the limits are for chronic intake and anyway WHO thinks you can tolerate twice as much.
Also, from the second paper: "The acute toxicity of aluminum is low. No acute effects due to dietary exposure to aluminum have been observed in the general population."
Comment: We found the same paper... Nice answer BTW. I wonder how much of the lack of acute effects from food seen is due to lack of recognition and subsequent lack of testing, as well as a low prevalence.

Why did my rum cake turn black?


Is there a big difference between /this/is/a/path and /this/is/a/path/?

Question: I am a CentOS user for many years now, but I am still often not sure how the final slash matters in linux commands, e.g.

tar
rsync
mv
file handling in software/php

What is the actual difference between paths ending and not ending with a slash?
Comment: I just found out about this feature today! I accepted a few answers of older questions, it's still only 8% though?
Answer: The answer is "it depends".  Many commands don't care, though this changes if the filename given is a symlink to a directory.  With a trailing slash, most commands will use the directory the symlink points to, without a trailing slash the command will use the symlink itself.
Some commands like rsync behave completely differently when there's a trailing slash, for instance giving a trailing slash on the source side of rsync will copy the contents of the directory to the other server in the specified destination location.  Without it, the directory itself is created in the destination then the contents are copied over to that.  When in doubt, read the documentation (searching for "trailing" is a good start).
Comment: Using commands like `cp` and `mv`, use of the trailing slash in the destination acts as a bit of a safety net, since it forces the final path component to be interpreted as a directory.  Compare `mv myfile /some/path` to `mv myfile /some/path/` -- if `/some/path` does not exist, the first version will create a file, while the second version will fail with an error.  If `/some/path` exists but is a file, the first version will replace it, while the second version will again fail with an error.
Answer: the truth is that it generally depends on the command running
for example rsync with the slash specifically starts at the contents of that directory whereas without the slash it will start at that directory, then its contents. for all intents and purposes for most commands it wont matter but if your not sure you consult the manual for each command eg
man rsync

Answer: I'm not 100% sure, how the trailing slash affects cp, mv, rm, though it my experience it doesn't have any practical effect.
e.g.
running
cp -r dir1 dir2
will give you the same result as
cp -r dir1/ dir2
It definitely matters for rsync. In rsync the difference between including and omitting the trailing slash is the difference between syncing the contents of the directory or the directory itself and the contents.
e.g.
rsync -a dir1 dir2
will create a dir1 under dir2
while
rsync -a dir1/ dir2
will create copies of any files in dir1 directly in dir2
Answer: It really depends on the program.    For instance, find will follow the symlink on a path with a trailaing slash.

mkdir dir1
ln -s dir1 dir2
find dir2 -type d

will return nothing

find dir2/ -type d

will find  "dir2/" and continue to recurse through dir1.


True or false: The negation of $∃x : P(x)$ is $∃x, \neg P(x)$

Question: I am trying to understand the negation of propositional logic with regards to universal and existential quantifiers.  I want to know if the negation of $∃x, P(x)$ is $∃x, \neg P(x)$ is true or false.  I believe that this is true.  I know that the negation of a universal quantifier is usually an existential quantifier, and I believe the negation of an existential quantifier is still an existential quantifier.  Can anybody let me know if I am correct?
Comment: False. The negation is $\forall x, \lnot P(x)$.
Answer: The negation of "there is some $x$ such that $P(x)$" is "not $P(x)$ for any $x$."
In other words, "for all $x$, not $P(x)$."
Formally: $\forall x,\neg P(x)$.

Intuitively, the negation of an existential quantifier boils down to the use of a universal quantifier after all, but in quite a sneaky way: the non-existence of something is equivalent to all things not being that something.
For example, let $U(x)$ be the statement that "$x$ is a unicorn." Then, the statement $\neg[\exists x:U(x)]$ "unicorns don't exist" is equivalent to the statement that "$\textit{every}\text{thing}$ that does exist is not a unicorn," that is, $[\forall x:\neg U(x)]$. The latter worded statement is in blatant defiance of English semantics (though grammatically correct), but it nevertheless shows where the universal quantifier is hidden in the picture.
Answer: False: $\neg \left(\exists x : P(x) \right) \equiv \forall x, \, \neg P(x)$.
Think of this logically. The statement $\exists x : P(x)$ means that there exists (one or more) $x$ so that $P(x)$ is true. Your incorrect negation says that there exists one $x$ so that $P(x)$ is false.
For example, consider the statement: there exists a black horse.
The incorrect negation would be: there exists a horse that is not black.
The correct negation would be: for each horse, that horse is not black.
Comment: This makes sense.  Thank you for clarifying.  Would it be right to assume then that the negation of a universal quantifier is an existential quantifier, and the negation of an existential quantifier is a universal quantifier?
Comment: Yes. Precisely.
Answer: Not quite. The negation of an existential quantifier is a universal quantifier. To see this, take an example:
If I claimed that there exists a mad man in town X, then to prove me wrong, you will have to verify that every person in town X is not mad. Not that there exists a person in town X who is not mad, because basically that says nothing about whether or not my statement is true.
Answer: As others have mentioned, the answer to your question is no, but it may help to see an example of how to negate statements appropriately. The basic idea is to "push the negation through," changing all $\exists$ signs to $\forall$ and vice-versa and then negate the proposition $P$.
I actually asked a generalized question about negating quantifiers a good while back. You can see the basic idea as follows: suppose we have
$$
(\exists x\in\mathbb{R})(\forall y\in\mathbb{R})(y>x).\tag{1}
$$
What would be the negation of this? Using the idea of "pushing the negation through":
$$
(\forall x\in\mathbb{R})(\exists y\in\mathbb{R})(y\leq x).\tag{2}
$$
Can you see how $(2)$ is the negation of $(1)$? It may help further to consider a more linguistic problem that was asked a while back.
Answer: When you think about existence and universal, it helps to translate from colloquial English to math-y English to symbols.
The negation of exists is universal.
English: There is an apple in the basket.
Math-y English: there exists some apple (in the basket is true).
Symbols $\exists x P(x)$
When you negate you get the following:
English: There are no apples in the basket.
Mathy-y English: for all apples (in the basket is false)
Symbols: $\forall x ~P(x)$

The negation of universal is existence.
English: All apples are in the basket.
Math-y English: for all apples (in the basket is true)
Symbols: $\forall x P(x)$
When you negate you get the following:
English: There is an apple not in the basket.
Math-y English: there exists some apple (in the basket is false)
Symbols: $\exists x ~P(x)$

Think about this a little while, it will make sense.


How to insert iframe in our website the metamask registration?

Question: How to insert iframe in our website the metamask registration? We want to input a registration form of metamask in our website without redirecting in other page.
Comment: Metamask is an add on to the browser or a mobile app. There is no registration per say beside providing a seed phrase to generate the wallet. So what exactly are you trying to do?
Comment: What will be your suggestion for us to want a metamask registration in our website page?
Comment: Your technically asking me how you can override metamask registration to get the user private key?
Comment: No, we want to input the metamask registration FORM in our website for the users to register metamask account within our website page only.
Comment: You mean a connect button?? You want to connect the wallet with your app?
Comment: The pop-up that is asking you to connect the wallet?
Comment: Maybe, so how to do that has a metamask registration button and to redirect to pop-up?
Answer: You will not be able achieve this.
Metamask is providing your browser with a web3 module that you can use to connect your app to the blockchain.
The users will be able to connect to your app to sign transaction.
In order to connect your app to the blockchain, you will need web3 or ethersjs.
https://web3js.readthedocs.io/en/v1.5.2/getting-started.html
https://docs.ethers.io/v5/getting-started/
This is how we make decentralized app that are connected to the blockchain.
You should also look at infura for a provider.
https://infura.io/
The Providers are access point where Metamask is connected to and send transaction to.
When you want to connect to a Provider without Metamask. You have to use Infura directly. Metamask is convenient on the front end because it is the provider for the client. Otherwise you need to provide a Provider to connect to.
You can also create a wallet within your app. Generate a seed and use this seed in metamask or use it only for your app and use another Provider.
If you want the wallet to work only on your "site". It will have to be managed in a centralized manner and you will provide everything.
The wallet, The Provider and the back-end infrastructure.
Comment: Thank you sir for the answer and guide.


Can one convert text annotations to a layer in QGIS?

Question: I know text annotations can be turned on & off with Ctrl+T... but is there any way to export them as a layer?
Answer: Since there doesn't seem to be an answer, here's my effort:

Save your existing map, including existing text annotations.
Delete all the layers, leaving a white screen, and the text annotations. Save it as something else, e.g. "only_labels"
Close Qgis
Open "only_labels.gqs" with a text editor. Notice the html/xml style format and that the text annotations have their own entries: . Within that there's an  and within that mapPosX="" and mapPosY="", with the long/lats in the quotes.
Since I don't know how to use xml data, I copied all the AnnotationItems and pasted them into Excel (libreoffice) in one long column
Then added a counter column in front of that and trend filled from 1,2,3 to the end (I have a lot of labels). This allows me to reintegrate everything later.
Then sorted everything by column B (the data)
Then deleted all rows not beginning "TextAnnotationItem document=" or "AnnotationItem frameHeight=" (this removes all the junk. All we want are lat/longs & place names. I had to remove triangular brackets to post this).
(I added a row at the top for labels, hence B2 not B1. Do the same just so you can easily copy paste) In column C, right of the AnnotationItem frameHeight rows, insert this formula: "=RIGHT(LEFT(B2,(FIND(" canvasPosY",B2)-2)),(FIND(" canvasPosY",B2)-2)-(FIND("mapPosX=",B2)+8))"
In column D, this formula: "=RIGHT(LEFT(B2,(FIND(" frameColorAlpha",B2)-2)),(FIND(" frameColorAlpha",B2)-2)-(FIND("mapPosY=",B2)+8))"
That's your X & Ys. Copy those formulae down all the AnnotationItem frameHeight rows.
Right of the first TextAnnotationItem in Column F, paste this formula (which starts at row 103 for me, so change it to yours): "=LEFT((RIGHT(B103,LEN(B103)-(FIND(">",B103,FIND("pt;",B103,FIND("span style",B103)))))),(FIND("&lt",B103,FIND("pt;",B103,FIND("span style",B103)))-1)-(FIND(">",B103,FIND("pt;",B103,FIND("span style",B103)))))"
Copy that down to all TextAnnotationItem cells
Select all data, sort by counter (see item 6). It should now be alternating between TextAnnotationItem and AnnotationItem, starting with the former.
Make cell E3 equal cell F2 (i.e. hit equals then click cell F2), this puts the location name right of the X & Y, on the same row.
Copy that formula all the way down column E.
Just to be safe, copy the lot & paste as value to a new sheet.
Sort by the data (column B)
Delete all the TextAnotationItem rows at the bottom
Delete columns A & B, Move column C (place names) to the front, tidy any of the names up if required, save as a csv file, open in Qgis, have a beer and wish that this could be done automatically!
Comment: your question is really interesting, I'll try your answer. A little shortcut in the beginning is just using the base .qgs (no need to remove layers or copy the file) and extract directly the AnnotationItems
Comment: hey, yeah! good shortcut!
Comment: @dez93-2000  hi. Since QGIS 3.20 version it is possible to convert dynamic labels to static text, but only in the Print layout mode. See changelog  https://qgis.org/ru/site/forusers/visualchangelog320/index.html#feature-convert-to-static-text-option


Is it possible to view where you most recently gained reputation?

Question: Is there a feature somewhere that allows users to see where they gained their most recent reputation?
Answer: Click on the envelope next to your name at the top of the page. Once there, you can select different time periods to view.
Answer: In addition to your recent activity (found by clicking on the envelope icon near your user name at the top of each page) the reputation tab on your user profile will give you what you're looking for.
Yours is here.


Which reporting tool you prefer for a web-based application?

Question: For both PHP and ASP.NET, which reporting tool you prefer to create, preview and print reports? Not just printing the web-page directly, any professional third-party or an open-source tool.
Answer: We use ASP.Net here and for our reports we use Crystal Reports. The pro for that one is that you can do pretty much anything with it. The cons are many and trying to figure out how to do what you want can be a bit of a chore. The major issue being googling is annoying, as everything is behind a pay wall. Everyone wants to make money off of their Crystal knowledge.
I know some teams in my company also use SQL Reporting Services. The major issue we've found there is that the report viewer runs in an ActiveX control. Not all of our clients wish to install the add on to run the report.
At my last company, we used a third party library by DevExpress that had a very nice grid. We allowed full client editing of the grid so they could arrange and group columns how they wanted, then we provided an Excel export option. Once the use got the data the way they wanted it on the screen, they could just export the report and print it that way. We also provided an option to save their settings so they could pull it out for later.
I guess it all depends what you are looking for. There is more than likely an option out there for you, but you need to figure out what your needs are and what requirements you need to fulfill for your customers.
Comment: I still use Crystal Reports but with standalone apps. Is it possible to host Crystal Reports as well on the remote server to work with ASP.NET?
Comment: @RPK - yes it is. You can either use the Report Viewer that will populate the report in an embedded Crystal Reports control, or you can write the reports to a temp folder and then serve the PDF right to the user in your web page. The second option will require a clean up script to clean out the old reports.
Answer: HTML + CSS + (php or asp.net) is all you need, for multipage report, you should paginate the reports. i.e you can select 25 record per page.
search the web for php asp.net pagination
Comment: pagination code is very easy to put up. even if you have 1000 pages report, paginating it is note a problem. There are script online that can print all the pages at once, depending on the numbers of records per page.
Comment: here are some links http://art.sourceforge.net/, and msdn.microsoft.com/en-us/library/aa479018.aspx or search for `web based reporting html css (php|asp.net)`
Comment: If it is a 100 page report, do I need to keep paginating and give something like PrintScreen?
Comment: Pagination.. hm if you code behind generate the output a counter that prints before/after each page break (follow the page break with a increment). Most web briwser does their own pagination though.
Comment: Please name a few.
Answer: There are tools like Crystal, PDF and DevExpress. At this very moment i was tooked over a project that have a "free" installation of Crystal and ASPX-based functionality to create and print reports through the web browser.
What I often think of those third party based reports (Also as visitor), they are easy/clean enough to build up dynamically with pure CSS/HTML as output. Pros: The client doesn't have to understand controls and the server doesn't have to deal with (not seldom) heavy installations of reporting software. Such installations also make future migrations more complicated. Lastly: In the end, in some solutions, there are same amount of coding to create the output.
Yes you create even bars and (at least simple) graph with html and css. If complicated graph you have free (if importan) flash plugins that create nice outputs. Take a look at 'FusionCharts Free'.
A 500 pages report sounds  too complex for pure html printing though. Due to memory issues, reading in all content to browser.
Answer: Please take a look at Windward Reports (disclaimer - I'm the CTO there). We work very well with both PHP and ASP.NET (both C# and VB). With Windward you design the reports in Word, Excel, and/or PowerPoint so design is a breeze.
Answer: Html + Css -- the web is a reporting layer.
Comment: If it is a multi-page report, how you manage?
Comment: Getting properly paginated stuff with lots of variable-length rows can be tough. I absolutely hate dealing with Crystal, but haven't found an alternative that perfectly deals with large printed paginated reports.
Comment: We give everyone iPads, pages have no more meaning.


Modifying keyframes for a mask created in the UV editor

Question: I have created a mask in the UV editor and I've animated the movement of the edges of the mask with keyframes in the dope sheet. However if I switch to the graph editor I can't find my mask with the keyframe values of the position of the edges of the mask. How do I find these values?
Answer: I am not 100% sure, what you mean by "created a mask in the UV editor", because as far as I know the only way to make masks in Blender is in either the image or the movie clip editor.
But maybe I am missing something.
If you mean that you want to animate an edge of the unwrap of an object, then the short answer is that Blender cant do that.
A really quick google search unearthed this addon, though: https://www.blendernation.com/2011/11/12/animating-uv-textures/
If you are already using it and are wondering why these properties still dont show up in the graph editor, you should probably try to contact the developer directly.
Comment: Yes, I meant the UV/Image editor window.


On mac, how to copy a networked folder from a Windows machine?

Question: I can see the (XP) shared folder on my Mac (10.6.8). If I try and drag/drop the folder in finder, I get an alias to it. How do I copy the folder itself?
Answer: Hold the Option key as you drag the item to force the Finder to make a copy.
In more detail: what the Finder does when you drag-and-drop an item varies depending on what it is and where you're dragging it.  If it's a volume (local or network), it makes an alias (as you've seen).  If it's a file or folder and you're dragging it somewhere in the same volume it's in now, it moves it.  If you're dragging to a different volume, it copies.
You can override these defaults by holding modifier keys as you drag the item: Command to force it to move the item, Option to force it to copy, and Command-Option to force it to make an alias.  See Apple's keyboard shortcuts list (at the bottom of the "Finder keyboard shortcuts" section).
Comment: Strange, I think I tried this, but even when it showed a + (with Option), it created an alias. I'll try again and see.
Comment: Did you hold Option until after you released the mouse?  It acts on the modifier key(s) you have down when you release the mouse, not on key(s) you pressed (and released) while dragging.
Answer: Well, I partially figured it out. I can select the folder, then press Command+A, which selects everything in it - which I can then drag and drop. So that copies the contents. What about copying folder+contents?
Comment: "What copying folder+contents?" - Explain this poorly worded statement please.
Comment: Missed the word 'about'. Folder+contents is exactly what it sounds like. The folder. Plus its contents.


Best translation of 四风 (political term)

Question: What is a reasonable translation of 四风 in its political usage? "Four winds" does not seem to fit, neither does "four styles". I do know, however, that this expression refers to formalism, bureaucracy, hedonism, and extravagance.
Comment: Before I saw the words in brackets, I thought 四风 is a word for mahjong game... :(
Answer: KEY

PHR
"the Four (Evil) Trends" (current term introduced by President Xi Jinping in 2013, used by the PRC government to criticize the harmful practices of xíngshì zhǔyì 形式主義/形式主义 "formalism", guānliáo zhǔyì 官僚主義/官僚主义 "bureaucracy", xiǎnglè zhǔyì 享樂主義/享乐主义 "hedonism" and shēmí 奢靡 "extravagance")

Best translation of 四风 (political term)


Very peculiar network issue on Debian 9 - Realtek network cards

Question: My OS: OS in question, and my primary OS: Debian 9.1 (fresh install) with i3 window manager (no DE). Other OSes (dual booted): Ubuntu 14.04 and Windows 10.
Kernel: 4.9.0-3-amd64
Network cards info: Realtek 8101 ethernet controller which works out-of-the-box (verified many times in Debian 9, Ubuntu, ...) and a Realtek 8723be Wireless network adapter which needs additional tweaking (Installation of a driver patch - due to a fault in the default drivers - tried by myself, it worked fine.).
I installed network-manager-gnome to manage my networks (although ethernet is unmanaged by it since eno1 (my ethernet) appears in /etc/networks/interfaces)
Problem: Network (neither ethernet nor WiFi) doesn't work on fresh reboot. By this I mean that - if I directly boot into Debian and try accessing the internet, it doesn't work. But, if I first boot into say, my Ubuntu, login to the internet there (see Additional info 1 below) and come back to Debian, it works! I have tried this a lot of times and the pattern is always that.
Additional info 1: I am accessing internet from a university campus, so there's a network login page that I must first visit and login. I can't open this login page upon a fresh restart, but if I already login and come to Debian, I can! I find this very strange.
EDIT: There's no proxy server involved. Just a login page.
Additional info 2: There's a known kernel-panic bug associated with my particular Wireless network adapter, network-manager-gnome and Debian. I experienced it as follows: If I don't install that said driver patch for my Wireless adapter, I experience kernel-panic during bootup (sometimes multiple times) and if I do install it, there's no kernel-panic.
To confirm this is indeed the reason for kernel-panic, I checked the syslog at /var/log/syslog and observed something on the lines of wlo1... just prior to the kernel-panic entry.
And please note, with that driver patch I can use my Wireless adapter perfectly fine (provided I login to internet in my Ubuntu for a and come back!).
My question: Why does my network show such a strange pattern, how do I correct it? Any leads would be appreciated. Thanks a lot!
Comment: Guess: Both Realtek cards need either to download firmware, or need hardware initialization that the Ubuntu kernel + firmware packages provide, while the Debian kernel doesn't and/or has the wrong or no firmware images. Compare `dmesg` output after boot of both distros to verify this guess.
Comment: Thanks for the response @dirkt. I'll return back in a while.
Answer: At the bottom of:
https://wiki.debian.org/DualBoot/Windows
It says to add NETDOWN="no" to /etc/default/halt so that linux doesnt 'shutdown' with out the win drivers permission.
Comment: How will that fix the problem described?


Using Grunt and keeping theme comments

Question: I used Grunt to minify CSS then combine them together in my WordPress theme.   I combined all the CSS into 1 file called main.css .   However in order to register the theme I still need a style.css with theme comments.  The issue is Grunt gets rid of comments.  I would like to do achieve this in 1 http request vs 2.  I would like to have all my css in style.css right below the theme comments and get rid of main.css.  How can I accomplish this?
Answer: style.css may contain only comment with Theme Name: ... . It just tells to WordPress about your theme. You have no need to load style.css in theme through tag <link ... >.
So. Now you can leave your only one css file main.css with all styles in .
Comment: Thank you so much.  I just took out style.css from being loaded and my theme still works perfectly!  Such a simple solution.

Using Grunt and keeping theme comments


Google Calendar Integration (Jolnir 6.1)

Question: I cannot for the life of me successfully sync my Google Calendar with the elementary Calendar app. I use 2FA so understand I will need to use an App Password. But, there are so many URLs in the Google Calendar settings and I am unsure where to put one of these when setting up the account in elementary OS. I am a little overwhelmed. If anyone can shed any light on the matter it would be much appreciated.
Answer: I just did it now. I also have 2FA.

Generate an app password for the calendar in your google account.
Open Maya (elementary Calendar) and add new google calendar from the cog menu (top right).
Fill in your gmail in the "user account" field and confirm.
A dialog pops up asking for password. Insert the app password created in step 1.

Done. After this I could see my events showing up in the callendar.


Scipt User roles and permissions

Question: I am having issues with the user accounts in SQL Server v 11.0.6020. I need to run a script that will allow for the copy of the principal user account: 'TrainID1' and all of the user rights and permissions so that when I get the other users logged in, they can access the DB's and run the applications that connect to the SQL DB's.
So I have the user: 'TrainID1', and that user connects to the SQL DB: 'TrainID_01' DB, so I need to have TrainID2 to 42 user accounts allowed in SQL Security for all of the other Data Bases like: TrainID_02, TrainID_03 and so on...
Answer: I recommend you have a look at the procedure sp_dbpermissions by Kenneth Fisher.
I have been using it and it allows you to list all the permissions of a particular user in a database, and gives you all the scripts to copy all those permissions and apply them on a different database.
In case you want to apply them on a different server as well, that is fine too, but don't forget to create the server login first.
Answer: You can accomplish this via the dbatools powershell module.
There is an Export-SqlLogin cmdlet that will do nearly exactly what you describe. From the documentation, this cmdlet will:

Exports Windows and SQL Logins to a T-SQL file...with SIDs, passwords,
  defaultdb, server roles & securables, database permissions &
  securables, login attributes (enforce password policy, expiration,
  etc).

If you need to replicate the exported login N times, you could modify the exported T-SQL script. However, you likely need to consider that all N can't be created with the same SID, so you may wish to simply remove the SID when you rename/clone the login.

Scipt User roles and permissions


"It seems to be good" OR "It seems good"

Question:
The car seems to be quite old.
The car seems quite old.

Are the both fine? Explain.
Thank you.
Answer: They're both grammatically correct, but the first sentence is needlessly wordy.  Since it's not clear how something can "seem quite old" without "seeming to be quite old", both sentences mean exactly the same thing.  I would go with the second sentence.
Answer: Both sentences are fine and they mean the same thing. (There may be a very subtle difference in close analysis, but not enough to make any practical difference at all.)
Which you use is a matter of preference. Speaking just personally, I would use the first form because I find it's a slightly awkward transition in pronunciation between seems (-s) and quite (q-). But moving from *seems (-s) to to (t-) is an easier movement for the tongue.
Which is a long way of saying that the first sentence flows better for me, both in terms of hearing the syllables and consonants working together and also in the ease of speaking the phrase.

Also, the expression I've grown up hearing far more often is seems to be rather than just seems. So, purely from my own experience, leaving out to be sounds very slightly awkward. I have no idea if it's a regional thing or a matter of dialect. (I'm Canadian, so am influenced by both US and UK English.)

But they are both perfectly acceptable.
Answer: As it said they are both correct.
First one is more formal
used when you only expect something without knowing much.
Like when you read a book title, You say "it seems to be fine/bad/..."
But you say "it seems fine/bad/..." when you read a little like a couple of lines.


Magento 2.2.4 blank body tag except home page and on all other pages

Question: I've Magento 2.2.4. I already have files on bitbucket. I downloaded files of app/code modules and merged with fresh Magento 2.2.4 and imported the database which already exists. After running composer install, composer update, module upgrade, static content deployment, compilation, and cache refresh commands, the home page works fine but the all other pages like category page, cms pages are having a white screen and body tag with no content. When I try to navigate admin it shows too many redirects error.
I'm using wamp server on local.
Answer: Please clear generated folder:
You can do it by below command:

rm -rf generated/*

Please also clear cache and page-cache

rm -rf var/cache/*   and rm -rf var/page-cache/*

check after flushing cache it ill be work
Comment: Yes. Tried this commands also.
Comment: Still not working?
Comment: Have you reindex? @BhavinShah
Comment: Yes. I did everything as mentioned in my description. I'm using Windows  wamp


Can Arduino power and hookup to logic chips?

Question: I am making a device that has two external interactions i.e. a button and a infrared sensor. My only problem is that I am using a logic chip for this because it would save me time coding on the Arduino, but now I don't know if the Arduino can cooperate or power the OR CMOS. I am a beginner in the logic and 555 timers field so every time I see them I try to ignore it. I have it now. Tried to draw a schematic and it just clicked. Thank you for trying to help.
Comment: I am using a 74HC32 and I understand it now. Took me a while but I answered my question
Comment: I can't draw a schematic so no luck there. I will keep trying to figure the schematic out but that is hard to do when you don't know if the parts you are using are compatible.
Comment: Why don't you try to create a schematic showing how you think they should be wired, then we comment on it?
Comment: Check the datasheet on both the Arduino (i dont know off hand) for the maximum current draw on each pin. Also check your datasheets and calculate the amount of power you will be drawing. The arduino should be more then enough to power your external circuit.
Comment: What logic chip are you trying to use?
Answer: The "5V" pin provides 5V from the board. The "3.3V" pin provides 3.3V from the board. See the datasheet(s) as to which you can/should connect to Vdd. One of the "GND" pins (doesn't matter which) connects to Vss. Don't forget to tie unused inputs on the logic chip either high or low.
And don't connect a 5V output to a 3.3V input.
Answer:
I don't know if the arduino can cooperate or power the OR CMOS.

There are many models of Arduino and many clone or compatible Arduino-like devices. An exact answer depends on exactly which you have.
An Arduino typically has a 5V regulator and a 3.3V regulator and can be USB-powered (which may make a difference to the current it can supply). You can check the data sheets for the regulator used on your particular Arduino and make an allowance for the current used by the AVR microcontroller on the PCB. That gives you an idea how much remaining power can safely be drawn from the board for other devices.
In general, yes, you can power a small number of CMOS logic ICs from the power pins on an Arduino. I'd keep an eye on the actual voltage and on regulator temperature.
As Ignacio points out, you need to be aware of the difference betwen 3.3V and 5V signal levels and, if necessary provide for level conversion.


Why is the saturation pressure of the refrigerant desired to be slightly greater than atmospheric pressure in an evaporator?

Question: I read that it "is a positive pressure
against the environment". But I am not too sure what that means.
Answer: Saturation pressure is vapor pressure $p_{vap}$. The statement is saying to have vapor pressure greater than external (atmospheric) pressure $p_{vap} > p$. In a hypothetical system where a liquid is evaporating with no boundaries, we could evaporate with $p_{vap} = p$. In an actual evaporator with physical boundaries (i.e. a container), the evaporating liquid must "push out" existing vapor. To do so, the existing vapor must "flow out" of the container. Flow requires a pressure difference. Hence $p_{vap} > p$ for effective operation in real evaporators.
One point of confusion remains in the original statement. The phrase "atmospheric pressure" should be replaced by "applied pressure". Consider the applied pressure to first order as the pressure felt in the tank before evaporation starts.
Comment: I've replaced the words "external pressure" by "applied pressure" and clarified a bit further.
Answer: This isn't always true. Industrial low pressure ammonia vapor refrigeration was usually operated below external pressure so you didn't poison people or contaminate stuff in the event of a leak. It was relatively easy to remove atmospheric leakage into the systems, and it didn't pose any great threat to the system. With modern equipment, you don't want anything getting into the system. The systems are designed to be hermetically sealed and they don't suffer contamination well. Nobody wants to purge leaked atmosphere out of there refer system once a day like was common practice in the past. These old systems basically used to require an operator to run them, like old boilers and everything else back then. Old icemakers used to be a problem because many operated near atmospheric pressure on the low side, and if there was a high side leak, the low side would suck air and you lost your cool. This is why they all had little bubble windows in them.
See table 2.9 in the following FAO report on seawater ice making for fisheries.
http://www.fao.org/docrep/006/Y5013E/y5013e05.htm
And as a practical matter, detecting a leak is easier if the low side is below atmospheric, but locating the leak is easier with positive pressure, and except for residential comfort air, you won't often be shutting a system down to go on a leak hunt.
Comment: Even in this case, $p_{vap} > p_{applied}$ still applies for useful operation. It is now the case that $p_{applied} < p_{external}$, where $p_{external}$ is the pressure outside the container (presumably atmospheric pressure).


My profile picture is glitched!

Question: My profile picture seems white and light-blue instead of dark-green and white! Why?

Another picture showing the glitched profile icon:

So, what is happening?
Comment: http://meta.stackexchange.com/questions/283643/why-is-my-profile-image-different
Answer: status-declined, although that doesn't tell the whole picture. It's not that Stack Exchange won't fix this, it's that they can't.
According to the Meta SE post linked by @PrivatePansy above, Gravatar appear to have changed their underlying engine that renders the Gravatar image. The end result is that some people ended up with a Gravatar that was vastly different to the one they had previously.

Update: after three weeks, both my Area 51 gravatar and my main site gravatar have changed to the "new" one, at every pixel setting, on both my home and work network. I gave up and set my old avatar manually. The bug seems to be spreading steadily, so I'll reiterate my hypothesis I noted in a comment:

Considering that some people are entirely missing their old gravatars, and that for others the old gravatars are only available at specific sizes (those that were used someplace on SE), I have a new hypothesis. What if gravatar messed up/changed their identicon generating algorithm, and the only reason the old ones are around is due to caching? This would explain why only a few sizes are kept as old, and new (hitherto-unused) sizes are generated anew, changing in the process. As I use chat a lot, my avatar is cached there; others who don't, might have their avatar lost with higher probability.

If you're lucky, you might be able to recover your old Gravatar image using archive.org's Wayback Machine - put the link to your profile page into that and see if an archive exists before this change happened. If so, you should be able to save it, then upload it directly to your Stack Exchange profile from your Settings Page

My profile picture is glitched!


Mixdown introduces strange clicking in one channel

Question: Novice question:  My mixdown in Adobe Audition is rendered with a clicking out of the right channel.  I don't know where it's coming from or how to get rid of it.  I suspect it might be something like a computer process or wifi.  I've never seen this before and I'm not an audio pro.  Any insight will be very appreciated!
Answer: Start by eliminating tracks and/or plugins from your mix to see exactly which track is causing the problem. In fact, mute everything entirely and see if the clicking still occurs. You should be consistent with your mix parameters during this process and mix using full-speed offline mixing if that is possible with audition.
Also experiment with buffer size changes at the asio/core-audio level.
I strongly suspect a plugin is doing this, so identify the track containing the suspect plugin then start testing each of the plugins individually and then remove the offending one.
Comment: Thanks for your response.  I narrowed it down to the music files.  Then I put the music on a new track and deleted the track, and everything rendered clean.  I'm not sure why, but it seems like something on that track in Audition introduced these strange clicking noises.  I have no idea what did it but a new track solved the issue.  I'd like to know why though.
Comment: Hmmm adobe ... I am not sure either. Strange one that....


Does milk tea cause darkening of the skin?

Question: Will having milk tea more than three times in a day cause darkening of the skin.
Answer: This seems to be a common misconception and there are many non-peer-reviewed articles online debunking this myth; like this example.
In a review of literature, Tea and Health: Studies in Humans, Khan and Mukhtar report the evidence for various health effects of tea, and hyperpigmentation (darkening of the skin) is not among them.
I cannot find any evidence of tea or milk causing darkening of the skin.
In fact, extracts from some tea seem to have an effect on reducing melanin production in vitro. In this paper, Anti-melanogenic effects of black, green, and white tea extracts on immortalized melanocytes, Camellia sinensis water extracts reduced melanin production. It is important to note that this is a laboratory study and I could not find any evidence that drinking tea has any effect on skin pigmentation.


What is the counter for kanji characters?

Question: I want to count the number of kanji characters in a word. What is the counter for characters? I am thinking that the term mai would be used as they are written on paper.
Comment: I put "what is the counter for kanji characters" (your exact question) into Google and the top result was this site: https://www.koipun.com/blog/what-is-the-counter-word-for-kanji Did you see this? Why did this not answer your question? Why after reading this did you think the counter might be 'mai'?
Comment: @jarmanso7 The OP previously asked and deleted a very similar question, which you commented on but did not answer.  Users with enough reputation to see deleted questions can read it here: https://japanese.stackexchange.com/questions/72184
Comment: I suspect the down vote was because of lack of research. If you put your question word-for-word into Google the top result answers your question. This should have been your first step. If you still had questions after reading that you should have presented what you have learnt and explained why you still have problems. I don't want to sound rude or condescending but why should people take time to help you when you aren't taking the time to help yourself?
Comment: I think you already asked this in the past, didn't you? I recall writing an answer for that. However, can't find the question
Comment: No. Google **Translate** is inaccurate. I'm talking about using the search engine.
Comment: Please comment on downvotes, I want to learn from you!
Comment: Google is very inaccurate and prior to asking I search this site and others.
Comment: Thats where my search started!
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/99627/discussion-between-jack-and-user3856370).
Comment: Ah, that's it @Snailboat. Not an answer, but a comment. Thank you!
Answer: The counter for kanji characters is 字 or 文字. For example:

200字   - 200 characters
150文字 - 150 characters
四字熟語 - an idiomatic phrase with 4 characters
Comment: Note that for 〜文字, it is in the "counter group" (not sure if there's a name for that) where 1 and 2 are counted with 訓読み reading, and the rest are 音読み.  That is, 1 and 2 are [一文字]{ひと・も・じ} and [二文字]{ふた・も・じ} respectively.


Fantasy 1975 prior, professor uses an equation to travel to Midgard and helps Thor defeat the giants who try and trick him

Question: Read this in middle school, the hero uses a mathmatical equation to travel to other realms by speaking the equation, I remember the author used the Thor vs Midgard Serpent story, Loki actually helps the hero see the items as in disguise and helps Thor defeat the giants, hero then goes to other realms the fairies etc. finally returns home. Been searching 20 years
Comment: Yngvi is a louse!
Comment: Hello! What type of story was this? A novel? A short story?
Comment: David, I see what you did there.
Answer: Very possibly: The Incomplete Enchanter by L. Sprague de Camp and Fletcher Pratt. Published in paperback in the 60's. The first part is The Roaring Trumpet, where Harold Shea uses symbolic logic devised by his boss, psychologist Reed Chambers, to project himself into the world of Irish mythology, but instead lands in the world of Norse myth. Actually, Shea sees through the illusions of the Norse Giants and helps Loki and Thor get the weapons.
Comment: Using mathematics created by a psychologist to subvert the laws of physics? That makes sense to me.
Comment: From the description in the question, that is certainly the correct answer. There is an omnibus with all the stories called *The Mathematics of Magic* (https://en.wikipedia.org/wiki/The_Mathematics_of_Magic:_The_Enchanter_Stories_of_L._Sprague_de_Camp_and_Fletcher_Pratt).


array not going through php function in_array

Question: I inserted, using the file(), words from a .txt file into an array. According to var_dump() the values are strings, and print_r give me a normal one dimension array.
  $words = file('stopWords.txt');

  //var_dump($words);

When I try something like:
 if( in_array('able', $words) ) {
       echo "match found";
 }

Nothing happens, I've tried making a test array with and it works fine.
The array that $word outputs has 636 elements in it. Maybe that has something to do? Although I doubt it because I've tried it with a larger array and it still worked. I'm not sure what's causing this to happen, it seems to only have problems with this specific array. Can someone please help me out here, thanks.
Comment: `FILE_IGNORE_NEW_LINES`  - AKA Omit newline at the end of each array element. `able` != `able\n`  Or in other words `$words = file('stopWords.txt',FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);`
Comment: can you provide an example of `var_dump($words);` output?
Comment: the array is really big so var_dump outputs a lot, do you wants just a snippet?
Comment: @ArtisticPhoenix how and why did this work?! Thank you so much
Comment: It's magic.  It's because the return has line endings, and in array is not fuzzy.
Comment: I'll look more into this, but thanks again
Answer: Instead of just
 $words = file('stopWords.txt');

Use
$words = file('stopWords.txt',FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);

flags
The optional parameter flags can be one, or more, of the following constants:
FILE_USE_INCLUDE_PATH
  Search for the file in the include_path.
FILE_IGNORE_NEW_LINES
  Omit newline at the end of each array element
FILE_SKIP_EMPTY_LINES
  Skip empty lines

This is the most relevant one Omit newline at the end of each array element.
Basically this is what you are doing:
if( in_array('able', ["able\n"]) ) {
   echo "match found";
}

Which is false.  Or in other words its not exactly equivalent to doing explode("\n", $contents) as the line (array items) still contain the newline.  Which because in_array is not a fuzzy search (basically its ==) it won't match them 'able' != 'able\n'.

Note: Each line in the resulting array will include the line ending, unless FILE_IGNORE_NEW_LINES is used.

http://php.net/manual/en/function.file.php
You could also trim the items in the array like this $words=array_map('trim', $words); but why bother when there is a flag for it.
Cheers


Critical issues have been reported with the following SDK versions: com.google.android.gms:play-services-safetynet:17.0.0

Question: When I want to upload my flutter aab in Play Console, I got the below warning.

Critical issues have been reported with the following SDK versions:
com.google.android.gms:play-services-safetynet:17.0.0

What the SDK developer told us:

The SafetyNet Attestation API is being discontinued and replaced by the new Play Integrity API. Begin migration as soon as possible to avoid user disruption. The Play Integrity API includes all the integrity signals that SafetyNet Attestation offers and more, like Google Play licensing and better error messaging. Learn more and start migrating at https://developer.android.com/training/safetynet/deprecation-timeline

Kindly help me resolve that. The app is made in flutter.
Comment: will the app be published even if I get this warning. Review is taking too long.
Comment: What is your exact issue? Did you read the documentation?
Comment: @JamesZ What can I do so that the warning get resolved???
Comment: Well they are obviously telling you to use the new API. Again, are you not reading it, are you just leaving out important information or what? Still totally impossible to figure out what you're asking
Comment: I've been in the review for a closed test for about 3 days! really boring @kragekjaer
Answer: If you are not using safety net anywhere just do the below changes in your code.
implementation platform('com.google.firebase:firebase-bom:30.2.0')
    implementation('com.google.firebase:firebase-auth') {
        exclude module: "play-services-safetynet"
    }

Comment: this is not working, still same issue
Answer: This is what works for me, Playstore complains about SDK critical issue.
I was using firebase_auth on top of google sign in in my flutter application, and firebase_auth has com.google.android.gms:play-services-safetynet:17.0.0 as its dependency.
You can check what package is dependent on safetynet by running gradlew command. Navigate to android folder within your flutter project and run ./gradlew app:dependencies
So I removed firebase_auth and use only google sign in, now all good with Playstore. My application is flexible and does not require safety/verification nor firebase auth, hence I am ok to remove the firebase part for now. You can do similar troubleshooting and identify package dependent on safetynet and decide. Hope this helps your case too.
Answer: I have answered in a similar question here, you need to update com.google.gms:google-services because it contains safetyNet API.
Use ver 4.3.13 and the warning has gone.
Play Store Warning : play-services-safetynet (com.google.android.gms:play-services-safetynet) has reported critical issues with version 17.0.0


What are angular sizes of thin and thick disks in our Galaxy?

Question: What are diapasons of galactic coordinates for thin and thick disks of our Galaxy?
Comment: Can you clarify your question? What's a diapason?
Answer: The sun is usually taken as the center of the galactic coordinate systems. Our solar system is well within the thin disk of our galaxy (population I stars). So taking the headline question literally, we see the thin disk as well as the surrounding thick disk in almost every direction, meaning any galactic latitude and longitude.
The radius interval, where we find mostly stars of the thin or thick disk, varies with angles. Along the galactic plane the radius interval is across the galaxy (up to about 30 kilo parsecs, varying a bit with direction, because we are not in the center of the galaxy) for the thin disk, containing the sun as origin; perpendicular to the galactic plane it's about 1 kilo parsec to both directions for the thin disk, followed by a respective radius interval from 1 to 3 kilo parsecs for the thick disk, if I follow the Wikipedia articles referenced in the question.
The region dominated by the thick disk is the farther away from us the closer we look along the galactic plane.
There are certainly no sharp boundaries between the star populations. Actually the thick disk penetrates the thin disk, but it's much sparser populated.
The Gaia project may give a much more detailed answer about the distribution of stars within our galaxy in the next 5 to 10 years.
Comment: No, the thich disk is NOT farther away from us the closer we look along the galactic plan. The thick disk is not an outer layer of the disk but extends right through the galactic plane. Even at $z=0$ (where $z$ is the vertical distance from the galactic plane), there are thick disk stars. The thick disk is defined not by the distance from the plane but by the dynamics of the stars that belong to the thick disk.
Comment: I took the thick disk as the region mainly populated by intermediate population II stars, and the thin disk as the region mainly populated by population I stars, although not happy with those definitions at all, because I think it's too much an oversimplification of the actual distribution of the stars. The main purpose of the answer has been, that we live in midst of the thin disk, hence can see thin and thick disk regions in any direction, without relevant angular constraints.
Comment: I agree with your points. I just wanted to point out that we are also within the thick disk. Although, as you point out, most stars in our neighbourhood are part of the thin disk.
Comment: Thanks for pointing it out! I've modified the answer a bit a few hours ago with the hope, that this is indicated without making the answer too confusing.


What does ; ; mean?

Question: I exchanged messages recently with someone I met from Japan, and I noticed that he often uses ; ; during our conversation. I assumed it was some kind of emoji but I'm not sure what it is. I tried looking for answers in Google but didn't find anything. Can anyone tell me what it is?
Comment: Does this answer your question? [How do I "understand" kaomoji? (Japanese smilies)](https://japanese.stackexchange.com/questions/6119/how-do-i-understand-kaomoji-japanese-smilies)
Answer: This may be difficult to search, but this is a type of Japanese "smiley" (or 顔文字) for a face with tears. Imagine something like this:
Answer: The longer version is (;;) or (;_;) representing a face with two eyes and two teardrops with or without lips, or simply a crying face. The parentheses represent the outline of a face but can be omitted in especially casual text messages.
Similarly (^^) -- "face with smiling eyes" -- can be shortened ^^.
https://en.wikipedia.org/wiki/Kaomoji

The emphasis on the eyes in this style is reflected in the common usage of emoticons that use only the eyes, e.g. ^^

Semicolons in general are rarely used in Japanese. I think the most likely place you encounter them used as, well, semilocons, would be text translated from a European language into Japanese. Even then translators may choose to omit ot replace them rather than preserving them.

What does ; ; mean?