Is The Lowest Antenna Terminal Feedpoint SWR Always Optimal?

Question: Intuition might lead one to believe that the antenna configuration with the lowest SWR(50) across its input terminals would provide the best radiation efficiency for the antenna system.  But is that always a correct assumption?
Answer: Below is a table showing that this is not always the result, for every antenna configuration.  In this case, the configuration with the lowest system SWR(50) also has the lowest system radiation efficiency.
The system in this analysis using 0.5λ buried radials has higher SWR(50), with higher system gain and higher radiation efficiency than the system using 0.1λ radials.  But even though that SWR(50) is higher, a well-designed matching network could be added to its feedpoint terminals to produce nearly a perfect match to a 50 j0 Ω transmission line connected there, with a matching loss that would reduce system gain and radiation efficiency by only several tenths of a decibel.
The gain and system radiation efficiency of that Z-matched system using 0.5λ buried radials (and other rows of that table) could be greater than from the system using 0.1λ radials — even though the 0.1λ system has lower SWR(50) before any matching networks are added.
Answer: No, minimizing the SWR at load (antenna) interface is not sufficient for the minimization of the end-to-end loss at system level (Transducer Loss).
A Figure (screenshot) might be helpful for illustration. The case is for SWR=2.06 at load, implying a SWR=1.88 at the input of an example lossy transmission line (50Ω). The purple curve is the total system loss as function of normalized cable length, and with the thick black dot representing the nominal cable length of here 100 feet. If we increase the cable length to 135 feet, the SWR at load remains constant but the total system loss decreases from 1.39dB to about 1dB. If we shorten the cable from 100 to 90 feet, the total loss will increase to almost 1.5dB. This might appear very strange at first reading. However, as we change the cable length, we also change the input impedance of the transmission line at its interface with the source – and therefore the extent of match, or mismatch, w.r.t. the output impedance of the source at its operating point.

Now, if we deploy an impedance matching (next Figure) at load to enable SWR=1, then the input impedance of the line at the interface with the source equals the characteristic impedance of the line (50Ω). This impedance might still be mismatched with the given output impedance of the source (like in the considered example). Therefore, SWR=1 at load is not sufficient to reduce the total system loss of now 0.62dB further down to the matched line loss (0.54dB) as would be implied by solely the transmission line.

It makes a difference, if the impedance matching at the load aims at SWR=1, or at a complex conjugate matching which is considered in the third Figure. The total system loss is now further reduced to 0.56dB, but the SWR at load is SWR=1.28. So, we accept this SWR and tolerate reflections on the line for the benefit of increased delivered power. (This seems like the point S. Sessink makes in his posting.)

If we would deploy two matchings (assumed lossless in this discussion about principles) for both, SWR=1 at load and complex conjugate matching at source, the total system loss would eventually equal the matched line loss (0.54dB).
The applied tool allows to compare the case of no-matching with eight different matching approaches and the implied losses at system level. Such assessment does matter when answering how much of the maximum available power from a given source can be delivered to the load, commonly referred to as the system Transducer Loss. (Although not essential for the above discussion, the characteristic impedance becomes complex at relatively low RF frequencies and could be considered as such but would not compromise the above remarks.)
@ Phil:
I took your example and added a corresponding figure. – Indeed, when looking into the line, the source will see a transmission line input impedance that moves on a perfect circle as we change the cable length – on a perfect circle because the line is assumed now lossless. The power mismatch between source and line, or loss, is determined by the radius (ρ=|Γ|) of that circle (in a Smith-Chart). As the changing impedance stays on that circle, the source will always deliver the same power into the line, and eventually to the load at the other end, because the line is assumed lossless. Therefore, the system loss vs. cable length is in this case constant and a straight horizontal line (see figure).

@ Phil:
From your previous question with "the load impedance around a constant SWR circle (neglecting losses)" I thought a lossless line should be considered for the answer.
I go back to a lossy line, and the source has exactly 50 Ohm output impedance. To see waviness, we consider a line which is lossy and with characteristic impedance that is complex. The next figure shows the resulting waviness.

The waviness becomes more pronounced if additionally, complex conjugate matching is applied at the input of the line (see next Figure, because the significant reflection at the source enhances the waviness). For short cable lengths, the overall system loss of now (P2/Pmax)=(P2/P1) is lower than the matched line loss, which is a known phenomenon attributed to the nodes affected by the phase-shift between voltage and current waves due to the now complex line impedance.

The waviness becomes practically ignorable at higher RF frequencies. It disappears whenever the line characteristic impedance is, or is assumed to be, a real value.
As the big advantage, the used tool allows to incorporate the complex characteristic impedance of real-world transmission lines. This is very much in contrast to the popular ARRL equation that is included in the plots for comparison. Furthermore, the ARRL equation (like TLW) calculates only (P1/P2), and the ARRL equation allows this only for real-valued characteristic impedances;  matching at the source side cannot be addressed; therefore, the approach is not a transducer loss assessment at system level.
Good luck to those who wish to explore the waviness with the existing ARRL tool (or TLW).
For interesting comparison and perspective, the following diagram is published by the ARRL frequently and again in the QST Magazine, March 2021, p. 53. The Figure shows the "Additional Loss in dB Caused By Standing Waves" as function of "Line Loss in dB When Matched," with SWR at Load as parameter.

For example, a source with 50 Ohms output impedance is considered. The source is connected to a 50 Ohms line that is terminated by 200 Ohms; this implies SWR=4 at load. Further, we consider a Matched Line Loss of 1 dB, which together with the Additional Loss Caused by SWR (0.8dB from the diagram) implies 1dB + 0.8dB = 1.8dB. From the Figure, readers are inclined to conclude this 1.8dB would be the total system loss. However, SWR not only affects the line-related loss but also the mismatch between source and the connected transmission line. (See screenshot below.) This impedance mismatch loss on its own is 1.1dB for the considered example and indeed exceeds the "Additional Loss in dB Caused by Standing Waves" (of 0.8dB).

The true system loss of 2.9dB (49% power loss) significantly exceeds a total of 1.8dB (34% power loss) which one might erroneously conclude from the diagram in QST.
The QST diagram can represent a total system loss on the specific assumption of a lossless complex conjugate matching at the input of the transmission line and if the line has a real-valued characteristic impedance (which is not the case at lower RF frequencies). Regrettably, QST articles regularly fail to highlight these crucial conditions. So, the plot in QST can very much misinform because it is incomplete to assess the total end-to-end system loss (Transducer Loss) of a real-world transmatch.
Besides considering typical real-world transmatches, the applied tool considers the impact of mismatches on system loss, as well as the impact of intended impedance matching for zero-reflection or, alternatively, the impact of complex conjugate matching, or combinations thereof. Therefore, the tool allows to assess the merit of matching, or if the deployment of lossy match circuit/s might not be worth the effort or be even counterproductive in terms of overall system loss.
Comment: It is the impedance which you measure into the transmission line when looking from the source into the transmission line. It is the impedance which the source feels as load. This impedance equals the characteristic impedance of the cable (e.g., 50 Ohms), provided the line is terminated at the load side with the characteristic impedance (50 Ohms). Otherwise, the input impedance of the transmission line is different and varies with the cable length.
Comment: @Jens This site is largely moderated by the community, and I'm just another user (member?) who has been around a while.  [Official moderators](https://ham.meta.stackexchange.com/questions/310/please-welcome-your-new-moderators) have diamonds next to their user names.  The general consensus is that questions that evolve along with comment feedback aren't ideal, but you worked towards a conclusion that addresses the question, so no worries ;)  Please stick around and see how things work here; I'm glad that you signed up.
Comment: "However, as we change the cable length, we also change the input impedance of the transmission line at its interface with the source – and therefore the extent of match, or mismatch, w.r.t. the output impedance of the source at its operating point." I'm having a hard time getting my head around this part. What's the "input impedance of the transmission line"?
Comment: Hm OK, I see now you're simulating a source impedance of 65 ohms, into a transmission line of 50 ohms, so that would make sense. However, if the source impedance and the line's characteristic impedance are equal, changing the transmission line's length mostly just moves the load impedance around a constant SWR circle (neglecting losses) but I believe it's still the case that loss as a function of line length is not linear: it's "wavy". Can you explain that?
Comment: I wasn't assuming the line is lossless. I think if you have a real line, but you eliminate the mismatch between line impedance and source, you still get the waviness, especially when the line is less than a few wavelengths long. So it must be something other than the mismatch between source and line causing it -- like where high-voltage and high-current nodes happen to fall.
Comment: That's an interesting analysis!  Too bad the tool you used doesn't estimate losses in typical real-world transmatches.  I'll look forward to more input from you @Jens.
Answer: Radiation efficiency and radiated power from a system (transmitter, feedline and antenna) are different things. Lowest SWR minimizes losses in the transmission line.
Example for more power at mismatch: assume a TX with a low-impedance output, designed for termination with 50 Ohm but allowing some mismatch. With 40 Ohm load the SWR is 1.25 and the output power is higher.
Another important thing is the mis-use of tables with transmission line losses resulting from mismatch. These tables are only valid for systems with 50 Ohm source and 50 Ohm, or deviating from that 50 Ohm, load impedance. Common TX output is a voltage or a current source or something in-between. Most probably NOT 50 Ohm.
The correct system is a TX with transmission line (50 Ohm is common) and antenna matching unit or tuner directly connected to the antenna feedpoint. Common systems have the tuner in the shack. Works OK when the antenna is not that far deviating from 50 Ohm.


How to find keywords in HTML code?

Question: I want to check if on a web page I can find defined words. For example I want to check if a web page contains word 'abc'.
I know that some pages contains meta tag with name = keywords and name=description.
But now every page contains this tag. So I'm also searching in
 tags. But where else I should search for a matching words to determine the topic of the page?
Comment: Are these sites you control? Are you wanting to do this yourself - programmatically? Or use a third party tool? "where else I should search" - all page _content_. (?)
Comment: @w3d I use python to open the url and read the content. I was thinking about all page content, but maaybe I should focuse on special tags and then I don't need to search throw all page conent?
Comment: If you just need to determine the "topic" of the page then you might be able to get enough information from the `title`, `h1`, `h2`, etc. elements - providing the document is "well formed"? However, if you want to "check if a web page contains word" (as you state in the first part of your question) then I can see how you would do that without searching _everything_?
Comment: I think your question is not precise enough. It's hard to give an answer to this as it stands now.
Comment: Can I ask if this is part of your keyword research or just a general question? There is a difference.
Comment: @closetnoc I want to check if a webpage corresponds to the set theme, like for example: 'dogs'
Answer: There are several things you can do. You can view page source code and look for the following:

title tag
description meta-tag
h1, h2, h3... tags
first 1 or 2 paragraphs

You will want to discount any stop words of common words of course. While the description meta-tag has little or no value for SEO, it does offer great clues to keywords and page topic. You can always create a spread-sheet to keep track of pages and keywords of course.
Another option, and one that I prefer, is to use a keyword density analyzer. Keyword density for SEO is largely a myth, however, these tools offer great clues to the hidden potential of any page and clearly pin-points the topic keywords that any page will perform well for. This may be the best option for you.
My favorite now requires an account: http://www.ranks.nl/ This may be a good idea if you are going to use a tool often. Today, I recommend: http://tools.seobook.com/general/keyword-density/ This is a free tool and not quite as detailed as ranks.nl but may be good enough for your purposes. I use both from time to time to check that I am on track when I write a new page.
Another option is to use an SEO analysis tool. I like best for this: SEO PowerSuite from http://www.link-assistant.com/ This is an expensive option and I only recommend this if you need to use the tool a lot for competitive analysis or checking your own work on a larger site.
If this is too much for you, then perhaps Screaming Frog can help: http://www.screamingfrog.co.uk/seo-spider/ It can be free up to a limit (500 pages), then you have to purchase a license. People seem to like this tool and I have tried it. It requires the option to spider your site directly. I suspect you can target single pages too. Please note, there are more features than listed on this initial page so dig deeper if this looks like a good option for you. I can recommend this tool from my experience.
Answer: If you are looking for keywords which are used on someone else's site, I suggest looking at ALT tags and possible TITLES on images. Also a good idea to look at  tags.
Answer: You should be able to determine the content title by just looking at the browser window's tab title or you can use a third party tool like Seositecheckup to determine the content of that particular page automatically.

How to find keywords in HTML code?


GFCI breaker trips after 5 or 6 minutes with nothing plugged in

Question: The problem circuit has 4 bathroom sockets, a front porch socket, and a back porch socket. Nothing is plugged into any of the sockets. A month ago, when I first became aware of the problem, the GFCI breaker would trip after 60 to 90 minutes. I looked into all of the sockets and replaced the front porch socket which was cracked. Lately, the circuit is tripping after 5 or 6 minutes, again with nothing plugged into any of the sockets. This problem has appeared suddenly after 21 years in the house. There has been no construction done, no humidity issues, no issues with weather or rain, or water leakage, and no new appliances. I am stumped.  Any suggestions appreciated.
Comment: If a circuit serves bathroom receptacles, it can only serve other loads in that same bathroom, or receptacles in other bathrooms.   So now is a good time to sever the outdoor receptacles from that circuit.  I bet your problem goes away!
Comment: Thank you for your response. When I discovered that the front porch and back porch receptacles were on the circuit, I was suspicious of them instantly. When I looked inside the boxes, I expected to see excessive dust, moisture, or a dead rodent. I did see a cracked receptacle, but replacing it did not solve the problem. I will replace the GFCI breaker first.  If that does not work, I'll focus again on the two outdoor receptacles. Thanks again!
Answer: Change the GFCI breaker. These do have a lifetime.
EDIT
The other possibility is that a receptacle  (less likely a switch) on the circuit has gotten wet and is leaking to ground. Recently I had a roof leak into an exterior wall leak onto an external receptacle and trip the GFCI. Going off half cocked I replaced the GFCI breaker with another I had on hand. No effect. Only then did I remember that there was one never-used exterior receptacle on the circuit. I went out to examine it I saw water running down the wall from a leak around a plumbing vent.
I needed the circuit in operation immediately so I removed the receptacle and wired nutted the hots and neutrals and put a cover plate on the box. This stopped the tripping. I repaired the roof leak later.
If you think you have this problem, remove the cover plate on a suspected receptacle and direct a hair dryer into the box to see if the tripping stops.
Comment: Thank you for your response. I have seen no evidence of a roof leak inside or outside the house. And no evidence of moisture in the vicinity of any of the receptacles. I considered the possibility of an additional yet-to-be-discovered receptacle somewhere on the circuit, but I don't think one exists. I will have the GFCI breaker replaced and go from there. Thanks again!


Does chromatic aberration affect BW images?

Question: In theory having different wavelengths converge at different locations should affect the luminosity and blur high-contrast edges or create ghost-like images of them, in practice however it seems that the color fringing is always to the darker side of the high-contrast edge and BW conversion shows no artifacts near the CA affected areas.
Answer: A camera lens, uncorrected, displays each color coming to a focus at different distances from the lens. This was not a big problem for early films, they were sensitive only to violet and blue. These films have a chemical focus that differs from the visual focus. Easy to solve, the sheet film holders positioned the film to compensate.
Early corrective lens forced red and green to focus at the same distance. Because each color comes to a focus at different distances from the lens, each image is slightly different as to size (magnification). Thus a panchromatic film images only one color tack sharp, the other colors are slightly out of focus.


Is it OK to include a stylized reproduction of a copyrighted painting in a design?

Question: I'm working on an icon of a framed painting. I would like the painting to be immediately recognizable to the intended audience, and so am considering doing a stylized reproduction of a particular painting from scratch to include in the icon. The original painting is copyrighted. Is there any legal problem with doing this?
Comment: Just to check: are you sure the original painting itself is in copyright, rather than a particular photographic reproduction?
Comment: Yes, the painting itself was created some time in the last few decades and is copyright the artist.
Answer: Stylized or not, reproduction of copyrighted work is derivative and subject to the legal issues that brings. So short answer... No, it is NOT okay.
You would be better off using a painting already in the Public Domain.
Comment: While I agree, "It's not OK" is perhaps a bit too broad. It certainly may be OK, but it does open you up to the potential for legal problems.
Answer: A similar topic has been covered here:
Is vectorizing an image copyright theft if the image is not CC/Public domain?
Short version: Likely to not be OK.


Brief and effective way to present usability study results

Question: I am looking for a great template to create usability study results document without putting anyone to sleep. I have created plenty of them before but would like to see if there is something better that could also work for wide audiences. I have found a few templates in Google but nothing amazing yet. I am looking for something that you find works very well and excites the audience to pursue design recommendations.
Comment: Usually I include the following: who the participants are and how many, tested tasks and scenarios, overall perceptions of the system by the participants (actual user comments), a table with usability issues, recommendations, and some user comments, Appendix that includes notes for each session. Currently it's 46 pages which is way too long. I am working on creating something much shorter highlighting the most important things.
Comment: Would it be possible to share what you have used?
Comment: Do you want a template, as in a set of layouts for a certain application, or do you want a structure. My suggestion is to ensure there is a summary at the end and a table that provides and overview - this requiring some kind of scoring system appropriate to what you are doing.
Answer: I would make a distinction between presenting the usability study and the usability study results.
Generally the results of a usability study are for managers or other non UX people who are only interested in what you found and what they can do with it.  Their interest usually has nothing to do with you methodology or details about who you asked etc.
By all means, you should have a document (even if only for yourself) detailing the study thoroughly, but that is not what you should present to most people.  Now try to think like a manager that just wants results, and who has no time or inclination to read a long document.  No disrespect meant to managers out there, but you should try to explain it as if you were explaining to a 5 year old.  The same goes for any time you are explaining a specialist topic to non-specialists.
Example:

We interviewed 15 people, and found that 63% of them had problems understanding XYZ (include pictures).  We also tested these alternative interfaces (more pictures) and found that option B was clear to 94% of the participants.
We believe that by using option B we will have a 49% increase in our conversion rate.
A comprehensive report on the UX study is also available that goes into detail on the methodology and results.

Know your audience. For most people that is all they will be interested in, but if you know they (not you) will be interested in some other aspects, include those as well.  If anyone really wants to know more, they will ask for the full study.
The same goes for presenting your results. Keep to what your audience is interested in. The goal is to show the information that they will find useful, and not to show how much work you have done.
Answer: Rough format for the sections.

Participants (N) and the reason for choosing these participants (expertise)
Session duration, session times, list stakeholders and one line description of their role/responsibility within the study
Tasks and Scenarios
Task - Instruction(s) provided - Description of task (or step) - Purpose of the step
Results same as 3, but instead of Description and Purpose, include Usability Issues noted along with the frequency, Proposed resolution of the issue (okay to leave it blank)
Next steps based on results in step-4
Answer: When I get the chance (and resources), I like to actually document the entire tasks and scenarios in a series of storyboards, captioned with the description.
I generally like to describe the participants in more details (if the information is available or can be disclosed), and put these somewhere near the results to allow people to think about things that might cause some biases or influence the results.
I've yet to come across a well documented and detailed usability study, not to mention that most of them don't seem to draw good conclusions, or extrapolate too much.
46 pages is a lot to read, but if you provide a summary that is concise and informative, then people who are interested will be glad that you have detailed information recorded and can judge the data for themselves.


Is authenticated encryption unnecessary if the message is digitally signed?

Question: Normally, it is necessary to use authenticated encryption if the message may be tampered with.  Can the authentecation be omitted if the message has been otherwise authenticated?
Comment: Do you still want confidentiality?
Comment: @RickyDemer bad wording; edited
Comment: See my comment to Richie's answer.
Answer: Yes, message authentication can be omitted when using an appropriate digital signature on the ciphertext.
A digital signature hashes the message, then encrypts the hash with a nonce and asymmetric key, which makes the security similar to HMAC.
The reason authenticated encryption is preferred is that it is generally less computationally expensive than a digital signature, and easier to build a MAC construct that is side channel resistant.
Comment: Message "authentication can be omitted ... appropriate digital signature" _on the ciphertext_.  When it's on the plaintext, the result can be malleable for certain encryption schemes.  Also, digital signatures [are not encryptions](http://security.stackexchange.com/a/68836/49075); see [this question](http://crypto.stackexchange.com/q/14875/991).
Comment: @kasperd :    No.  If there are IND-CPA encryption schemes, then there are are IND-CPA encryption schemes for which the E(S(m)||m) approach will be malleable, for the reason I described in my previous comment.
Comment: @RickyDemer In what way would they be malleable?
Comment: @RickyDemer I made the assumption it was on ciphertext, as he was asking about authenticated encryption with authentication omitted, I will edit to make that crystal clear
Comment: @kasperd :    For plaintext-ciphertext pairs  [p0,c0],[p1,c1],...,[pn,cn] ,  the adversary can compose a ciphertext c such that which of p0,p1,...,pn,$\bot$ c decrypts to depends detectably on more of what the plaintexts were than just their lengths.
Comment: @RickyDemer Are you assuming that the adversary is giving access to an unencrypted signature on the plaintext? Sending $S(m)||E(m)$ is clearly flawed. But I would expect $S(E(m))||E(m)$ and $E(S(m)||m)$ to both be equally secure.
Answer: If you follow the advice to sign-then-encrypt rather than encrypt-then-sign, you should probably use authenticated encryption. Otherwise you are going to be decrypting unauthenticated ciphertext, which with certain ciphers can be dangerous.
For example, with CBC-mode encryption, decrypting unauthenticated ciphertext can allow a padding-oracle attack. If you have a stream cipher, or other malleable cipher, an attacker could be able to change it to some earlier (signed) message, which may violate protocol assumptions like that different nonces mean different messages.
If you are going to sign the ciphertext, then that will indeed take care of authentication as Richie Frame states.


Overstayed visa as minor, can I get an F1 to go study?

Question: I was taken to the US when I was 11, in 1999 with a parent. We stayed illegally until u decided to move back to my home country voluntarily in 2005 when I was 17, I was becoming an adult and realizing my illegal status and all the problems I had started to face due to that. After ten years of living in my home country, I decided I wanted to visit the US and in 2015 I applied for a tourist visa. I had a good job for about 7 years at that point and was honest about my overstayed time on my application. I was able to receive my visa without issue and is valid for ten years. Since 2015, I have made annual trips to vacation in the US and have never overstayed my time. I now want to apply for an F1 visa because I want to attend school in the US. Will I have any issue getting this? I'm assuming they won't be very hard on me since I currently have a tourist visa which I have not abused, plus I was a minor at the time I overstayed and it wasn't my choice to do so, I also left voluntarily before I turned 18.
Answer: Grounds of inadmissibility related to previous immigration violations are established generally, at 8 USC 1182, so they apply equally to tourist visas and student visas.  The fact that the Department of State issued you a tourist visa after you were "honest about my overstayed time" implies that they have determined that this time does not trigger the relevant grounds of inadmissibility.
Therefore, it is very unlikely that they would refuse a student visa for the same reason, unless some independent factor arises that causes them to reconsider the earlier determination of that question.  Furthermore, your subsequent compliance with immigration law should certainly work in your favor.
Of course, nobody other than the visa officer examining your application can say for certain whether it will be granted, but in general you should not fear that your history would be viewed more negatively for a student visa than for a tourist visa.
Comment: But you don't have to have a "ground of inadmissibility related to previous violations" to be denied most types of nonimmigrant visas, including visitor or student visas. The most common reason to be denied is the "failure to overcome the presumption of immigrant intent".
Comment: @user102008 sure.  The visa can be denied for any of several reasons.  I meant to cover that by saying "nobody other than the visa officer examining your application can say for certain whether it will be granted."  But it would not make sense for the visa to be denied because of the previous immigration violation when other visas have been granted subsequent to that violation.


Why do certain sites prevent spaces in passwords?

Question: It seems less common with newer websites, but many websites I need an account on (like for paying bills, etc.) prevent me from creating a password with spaces in it.  This only makes things more difficult to remember, and I am aware of no database or programming restrictions on spaces in passwords, encrypted or (heaven forbid) otherwise.  Why, then, is the spacebar so commonly discriminated against when it comes to signing up for a site?
Comment: What really scares me, is when sites specifically disallow the single quote. What possible reason could you have, other than to enable `"insert into USERS (..., password) values (..., '" + $POST['password'] + "');"`  :-S
Comment: May be some sites use Single Sign On, assuming that SSO requires non-blank passwords (not sure though)!
Comment: Should have went to security, not programmers. This probably already exists there though.
Answer: There are a huge amount of stupidities when it comes to passwords in websites.

Some have purely technical reasons (valid or not, that's another question, but nearly all of them are not):

Your password must be four characters length and have only digits.

(By limiting a password to 0001 .. 9999 range, you can simply store them as a number, plaintext, in the database)

Other are explained by some erroneous thoughts that they will make passwords more secure:

Your password must start with a capital letter and end with a digit.

(By doing this the developer, or the manager, assumed that this will actually force the users to choose a safe password, while the rule as "Your password must contain min. 6 characters and contain at least one capital letter, lowercase letter and a digit" will magically fail to do it)

Other, finally, are explained by the fact that passwords are stored plaintext, and there are some ambiguities about how they are stored, processed or retrieved, and there are no time to unit test them.

Your password contains an invalid character é.

or,

Your password y$₯46¥*A'xD<7&฿=ᴙcN&sF5_Ở!d contains some invalid characters. Use characters from Latin alphabet and digits only.

or,

Your password cannot contain whitespace characters.

In all three cases, the developer was just insure that passwords like this will be stored correctly.

In the first case, what if é will be transformed into %C3%A9 when sent? Or what if the database will store é incorrectly?
In the second case, what if PHP (why PHP?) cannot deal with unicode, and does something terrible when receiving a password like this? What if < character causes trouble? What if & character is interpreted as a separator in an URL (assuming that for some reason, the password is being sent through GET instead of POST)? What if ' is interpreted by the database, because, guess what, we have no idea what SQL Injection is and how to avoid it? Or what if ' is transformed into \'?
In the third case, what if PHP (again?) trims whitespace in some cases and not in others? What if the administrators (who have surprisingly the access to users passwords in plaintext) are lost because they see only one whitespace, while the user have set three consecutive whitespaces?

In all three cases, those ambiguities are easily solved through testing, especially unit testing. But in a huge amount of projects, there is no testing at all, and no time to test (but still plenty of time to debug later).
This means that whether the developer tries to think about the possible consequences of allowing spaces, or unicode characters, or just any character outside ASCII 48..57 ∪ 65..90 ∪ 97..122 (digits, lowercase letters, uppercase letters), the easiest way, when testing is not possible, is to just forbid them.
In my opinion, this is the sole reason to forbid spaces. Yannis Rizos gave another reason related to UX. While being a plausible reason in theory, it doesn't work at all in practice: websites made by people who actually care about UX don't fix stupid password rules. Instead, websites where whitespace is actually forbidden are in most part done by people who never heard about UX. This is especially true since forbidding any character is really annoying from UX point of view, as any password-related restriction, including the useful ones, as the minimum number of characters.
Comment: I do agree with most of what I read hear, but I have a real hard time to digest the statement "the easiest way, when testing is not possible...". Testing not possible??? Anyone who agrees to a project where that occurs: stupidity efficiently maximized...Yes I know it happens :-|
Comment: Not to mention that when you eliminate spaces, you're eliminating a bunch of easy to remember long passwords (and length has been proven more effective than complexity against cracking) and encouraging users to adopt gibberish passwords which are far less memorable than a long series of spaces.
Comment: @Thomas: this is the difference between theory and knowledge in general and practice with its general ignorance and time constraints, where lots of people don't want to waste time testing, ignoring that they will spent at least twice later debugging.
Comment: It may be reasonable to require that users define *a* passcode which consists only of digits if the same passcode may be needed for things like automated telephone access, but such a passcode shouldn't be the main authentication credential for computer-based access.
Answer: The answer is History
We seem to forget that the basis of a lot this comes from a time when storage was not effectively free (on disk or in memory) when our ability to manage all these things was somewhat less than it is now and equally the ability of automated systems to attempt to crack same was also somewhat less.
There are lots of rants about passwords based on what we know now and what we can do now but the simple fact is that we're often dealing with a combination of legacy thinking and legacy systems.
Should there be restrictions in new systems now? I would hope not - far less reason now
Comment: I'm suggesting that technological limits and less complex external constraints (and possibly use of "trim") meant that people thought differently about what would be appropriate and allowable. You might place limits on passwords to ensure that they are liable to be memorable because resetting them is harder. You might not encrypt them because simply getting to a place where you can read them is (at the time) relatively very difficult (and in any case the systems are not accessible from the outside world). Different times, entirely different thought processes that have left a legacy
Comment: Are you saying there *were* technological restrictions with spaces in passwords that weren't there before?  What part did storage exactly play in that?
Answer: IMHO, It is outright foolish of any site/app that uses modern hashing and/or salting to store passwords to not allow for spaces in passwords. But, some legacy systems(read about this somewhere) still pass around passwords in plaintext - so not allowing spaces there may make sense. Also, some apps may "strip" all string inputs they receive. So, a password starting or ending with a space is not going to be good(of course, that was over contrived, but you can imagine what not can happen with almost anybody coming up with his own site). There is nothing "bad" in allowing spaces in passwords - as you point out, the DBs won't disallow the hashes or the plaintext versions.
Actually most of my Windows friends don't know that they can use spaces in their passwords - So, maybe, as per Tim Medora's answer, site owners don't want to take chances with lamahs(pardon that) or maybe some of them have misconceptions and/or are ignorant of the advantages spaces can provide.
Comment: I prefer stripping leading/trailing spaces from passwords because they tend to cause problems but that's no reason to disallow them--they'll just get stripped both on setting and testing, no problem.
Comment: And what exactly are the "problems"? I have been emphasizing in the answer that spaces SHOULD BE allowed. "They'll get stripped both on setting and testing" - What's the point then? then " 1 4m 1337" and "   1 4am 1337   " both hash to the same value(actually, there are infinite number of possibilities in theory).
Comment: `What's the point then?` Minor point is that the password is of less entropy as user intended. And some systems trim GET/POST vars by default, an (unlikely) change to that behaviour will lead into more serious problems.
Comment: @Yati sagade:  I'm *NOT* talking about stripping internal spaces.  I'm talking about leading and trailing spaces--people don't realize the space is there and it causes login failures.  Likewise, if you see a password that's all caps flip it to lowercase, it's probably someone who didn't realize caps lock was on.
Answer: It's done for the same reason that many sites don't allow hyphens, apostrophes, or non-ASCII letters in names, even though these are very common practices even just within the U.S. and it requires more work to disallow these characters than to simply allow them.
It's also done for the same reason many sites' word filters won't let you use words like "cocky", "retardant" or even "accumulate" (though many common racial slurs are perfectly alright).
It's because a lot of developers are apparently completely lacking in common sense, or at least have a very limited imagination when considering possible user inputs and scenarios. A small percentage of them may be working off of false information (that excluding non-alphanumeric characters is somehow a standard practice, or that the hashing algorithm or storage method can't handle spaces or special characters). Others may simply be lazy—they're worried about charset issues, so they simply restrict inputs to a minimal character space. And then there may be those who are exercising overzealous input validation/sanitation because of paranoia due to a lack of understanding of real threats.
Comment: What reason would you have to employ a whitelist beyond enforcing a particular character encoding? The fact that restricting arbitrary characters confers no benefits while weakening the passwords users choose is what I base this opinion on. All of the examples I gave are symptoms of developers not thinking through design choices carefully enough.


How to change the download save directory in ktorrent from a remote host

Question: So I have ktorrent running on a server and I don't have the ability to see the X11 display for the client, and I need to change my download directory since I like to keep everything very organized. So I need a way to change the download directory for the program as a whole, not like decide where to put each and every torrent that I download. This can't be done through the webui preferences so I'm guessing that I'll have to do it through ssh somehow but from what I've read there really isn't a command to use. Also the way that I have the application run is on startup my server runs the command ktorrent, so it will already be running when I want to change the download location so I assume that I will have to restart the program as well. If anyone knows how to do this it would be much appreciated, and I can't think that I'm the only person to want this feature.
Answer: The config is saved in /home/user/.kde/share/conig/ktorrentrc.  Try killing the ktorrent process remotely and editinig the file.  Then restart the app so it will take effect.


Can one with a poor diet gain muscle if they work out?

Question: My diet is healthy, but I am wondering just for the heck of it if a person with an unhealthy diet that lifts weights can still make gains in muscle mass or not. That is my question. Thank you.
Comment: Yes, they will gain muscles because they're lifting weight. If they're eating protein food, they'll gain muscles also. However, because of the unclean diet, they'll probably gain much fat, which will prevent the muscles from being very visible.
Answer: Healthy is a fuzzy term. It probably doesn't matter much if you eat trans fats, big macs and protein bars or salads, quinoa and turkey, assuming that the macro nutrient amounts are equal.
What does matter is the amount of protein. Also, eating healthy, if it really is healthy, will make you live better and longer.
Answer: It is possible to get some muscle with a poor diet, but it will probably be slow, with high fat precent and not the full capacity of the body. Eating good is a vital thing to fully develop your body.
Answer: You most certainly CAN build muscle on a sub-optimal diet. One way to think about this : there are two men , with virtually identical physiques. One decides to eat a very high protein diet , but does no training. The other sticks to his "average" diet , makes no changes at all to his eating patterns , but does an intense full-body weights workout , 2-3 times a week. After a year , who will have the better developed physique ? Bet the house on the second man.


Ability to change the type of flag? Or have an unflag option?

Question: I come across questions, when sometimes I find the need for flagging it. But, sometimes in confusion / or due to error I flag it wrongly.
And when I again try to flag, it says, you've already flagged this post for moderator attention.
Shouldn't the users be allowed to change the type of flag? Or should there be an option to unflag the already flagged question? If no, then is there any specific reason behind this?
Comment: The network-level discussion of this issue is here: http://meta.stackexchange.com/questions/87660/flag-removal-is-it-possible-to-remove-your-flag-or-otherwise-indicate-it-should
Answer: I second this.  Yesterday, I posted comments asking somebody with a (IMHO) very confused question to improve specific points.  This morning, the user had added some comments that did not improve things (they made the question even more confusing - again IMHO).  So I flagged it as "low quality".
Then, I few hours later, the OP had cleaned up the question. There is now no longer a valid reason to have it flagged as "low quality", but there seem to be no way for me to remove the flag.
Answer: It's now possible to retract a raised flag. Once flagged a post, clicking on flag will show a dialog box similar to the following one.

Instead of the Flag Answer or Flag Question button, there is the Retract Flag button that allows to retract the raised flag, and eventually flag the post for another reason.
Comment: It makes sense to force users to think well before flagging. But, I am not sure what happens when more number of flags get declined? Is the user banned for some days from flagging? Similar to banning from editing if more number of edits get declined? And I think the spam flags also gets marked as useful if the post gets deleted after sufficient number of flags.
Comment: In the case the user's flag weight would become 0, the flags would be automatically ignored. It is difficult it happens, though; you should keep flagging many posts that didn't need any attention.


merging TIGER Line shp files for better labeling in ArcGIS

Question: When working with TIGER line shp data at county level scale the labeling of roads, rivers, railroads, etc. is cumbersome due to all of the tiny line segments. Merging the dozens of segments that comprise a particular road or river will result in much cleaner labeling. The only problem is the amount of tedious work this requires. Anyone know of a Python script that will automate this process? It needs to find all records with the same name and merge them into one record. I thought ET Geowizards had a tool for this but can't seem to locate it.
screen shot for better explanation
Comment: If it's all about labeling, you can remove duplicate labels in the *Placement Properties* dialog of the Labels menu.
Comment: You could use the [Dissolve Tool](http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000005n000000) based on the FULLNAME field. I'm not certain if the calculate geometry would give you the combined length of segments or not -- worth a shot depending on what you're using the files for.
Comment: the "remove duplicate labels" setting has never worked very well... only maplex which we don't have as ever made some difference... i'm trying the Dissolve right now, it usually displays a percentage of how much is done, not this time... hopefully it doesn't crash working these 178k records... would be very nice if Dissolve accomplishes the task, just seems too easy for some reason.
Comment: just found another thread that has similar topic: http://forums.arcgis.com/threads/59372-python-and-merge-in-editor-toolbar?highlight=merge+multiple
Comment: Dissolve is still chugging along after 45 minutes... the reason for having longer cleaner polylines is to have County Map-friendly labeling.... i'm going leave Dissolve running and check back on it later, might not be until Monday before i look at the results... thank you for your suggestions.
Answer: If the Dissolve tool suggested in my comment doesn't work this shouldn't be too big a hassle to script.

Get a python list of all unique values in FULLNAME (potentially through use of SearchCursor)
Loop through your FULLNAME to create a whereClause
Use the whereClause in the Select Tool to create a temporary layer for each unique FULLNAME
Merge all of the layers together (they'll already have the same schema)

If there is a computational bottleneck you might run into the same problem as with the Dissolve tool.  You can always break your data into chunks to make it more managable.
<code># Location for temporary files
output = r'...'
tigerFile = r'...'
finalProduct = r'...'

# Limiting the cursor to only the field you need increases efficiency
fullNameValues = arcpy.SearchCursor(tigerFile, '', '', 'FULLNAME')
for name in fullNameValues:
    # Check if name is already in the list
    if name.FULLNAME in fullNameList:
        continue
    else:
        fullNameList.append(name.FULLNAME)

del name, fullNameValues

# Loop through list of unique values
for i in range(0, len(fullNameList)):
    whereClause = '"FULLNAME" = ' + "'" + fullNameList[i] + "'"
    arcpy.Select_management(inFile, output + fullNameList[i], whereClause)

# Merge all of the temporary files
tempFileList = []

#Set workspace for listFiles method
arcpy.env.workspace = output

for file in arcpy.ListFiles('*.shp'):
    tempFileList.append(output + "\\" + file)
arcpy.Merge_management (tempFileList, finalProduct)
</code>


Flashing exclamation triangle on green onion

Question: I have seen an answers for this suggesting a security update, but no matter how many times I download the latest bundle, save, then run, I still get the flashing warning. Why?
Answer: You don't explain exactly what you do to upgrade to new version, so it's difficult to be certain, but I suspect that what you are observing is a symptom of the way the upgrade check is currently implemented:
The Torbutton extension in Tor Browser periodically downloads a list of "recommended versions" from https://check.torproject.org/RecommendedTBBVersions in the background and compares its current version with that list. If it finds that the version you are running is no longer recommended, it sets an internal Firefox preference (a configuration value) to indicate that an update is required, and displays the update notification in the browser user interface (the flashing yellow triangle).
If you simply extract the new version of the Tor Browser Bundle over the old Tor Browser directory when you upgrade to a new version, then the previous value of the "update required" preference will be retained, and the new version will also display the update notification based on the value of this preference.
This is harmless; next time it downloads the list of "recommended versions" it will notice that you now have an updated version and that the update is no longer required. Thus the warning notification should disappear by itself after some time.
The recommended way to upgrade is to delete the old Tor Browser Bundle (after exporting any bookmarks etc. you want to retain), and then extract the new version; see "How can I switch from one Tor Browser Bundle version to another?". If you do this, then you will avoid the bogus notification.
Answer:
In Firefox type about:config in the location/(search) bar.
Check the yes I'll be careful warning.
In the Config Search bar type torbutton.update and change both options that appear to false. You can do this by double clicking on each option.

This will automatically change the settings. Voila no more blinking Tor Button.
Comment: Note that this only removes the warning. You may (likely) still be using an out-of-date version and may be tempted to not upgrade.


How to leave Ranorex' command prompt open after test suite has finished?

Question: By default, the command prompt closed. I cannot find an option to leave it open once the test suite finished.
Answer: You can provide a workaround.

Go to your xxxx.rxtst foler
Add a user code module as the last step to your test
In this newly added code module, add a line, Console.Read(), which will force this command window to stay open indefinitely. Please remember it is a workaround and please take this out of your production code.
Comment: Thanks very much. Since it is not designed for production, my ideal solution would be to have a Ranorex Studio specific setting, which also does not get commited into the version control system and, hence, does not make it into production.


Form factor for Proton

Question: To find the charge distribution of proton , we study electron proton scattering and compute the form factor to find the cross section. The form factor comes out to be Fourier transform of charge distribution. It is then multiplied by the cross section calculated under assumption that proton is point particle. What I don't understand is why the form factor has to be Fourier transform of charge distribution. I don't want the derivation but some intuition.
Answer: You have surely seen slit experiments, where waves which pass through the slit and scatter to produce a pattern on a screen placed behind the slits. In the far-field approximation (also known as Fraunhofer diffraction) this pattern is precisely the Fourier transform of the slits. Perhaps you even remember that waves passing by lines produce the same pattern as waves passing through slits, given that the line and the slit have the same dimensions.
We can also play this game with holes and points or any kind of shape, really. The proton charge distribution is such a shape and the electron is a quantum mechanical wave passing along it. Like every other wave passing along an object, the wave will scatter and it is described by the Fourier transform of the object. The far field approximation always holds in a realistic experiment, because the the charge distribution is far smaller than the travel distance of the electrons.
Comment: Thank you for the answer. Can you explain why exactly we should expect that interference pattern should be fourier transform of slit in far-field approximation?
Comment: Essentially in the far-field you just need to sum up a wave originating from each point in the slit. If you describe each wave as an exponential $e^{-ikx}$ then you can add up these waves by integrating the $e^{-ikx}$ multiplied by the slit. This is exactly the Fourier transform of the slit, ignoring constants etc.
Comment: Chris is right. Electrons form waves with spherical wave fronts as they are released from the source. In the far-field approximation we assume that the wave fronts that hit the target are planar, not spherical (equivalently, we assume the "electron rays" are parallel). This is approximately true when the source and the target are separated by a large distance, compared to size of the target. Because the waves are planar we can simply add them up, as was mentioned by Chris.

Form factor for Proton


Module configuration translation

Question: I cannot find any good examples on how to make a module configuration translatable. Could someone give me a starter example to build off with?
Comment: You should definitely read this tutorial: http://hojtsy.hu/blog/2014-may-26/drupal-8-multilingual-tidbits-16-configuration-translation-development . It's part of a series of tutorials for multilingual Drupal 8 development by the same author. Highly recommended.
Answer: In config there are only few field types that are translatable by default text, label and i think date_format(you can check the schema types to see which field types exactly are translatable by default). You can also make any value translatable by adding the translatable: true flag to the field. Now, copy your config/install directory into config/install/language/LANGCODE and edit each one of those config files and keep only the translatable fields..and translate those :)
If you want to provide translations for you module so t() function will pick them up, that is a bit strange in D8 compared to D7 but to put it simply you have to edit your module's info file and put in the following lines:
'interface translation project': yourprojectname
'interface translation server pattern': relativepathtotranslationsdirectory/%project-%version.%language.po

Comment: Shouldn't the translation folder be `config/install/language/LANGCODE` instead?
Comment: You are correct, I have updated my answer.

Module configuration translation


Need clarification on switching CiviCRM hosting from a host/consultant

Question: We are currently hosting with a company that also assists us with are CIVI Crm. We are interested in moving our site to a new host and would like to know if the CIVI will move with it? Without having in-depth knowledge of the "back-end" of Joomla/CIVI... I would like to speak with a representative to get a clear understanding of how we can continue to use CiVI and yet obtain a new hosting company. Please, could somebody call me and help us through this transition? Thank you, Tacey Martinek-978-772-2787
Answer: Yes, you can move your Civi installation to new hosting (though it is recommended to use a knowledgeable/experienced provider to do so; and you sound like you are on board with that idea). A good place to start is with one of the providers listed here: https://civicrm.org/partners-contributors
Here is some background on those providers listed and some tips on selecting a new provider: https://civicrm.org/about-service-providers
Answer: CiviCRM is a crowd-sourced open source software, which means that there is no company with representatives to call you back and talk through these things unless you hire someone to do so. I recommend removing your phone number from this public post, just as a matter of privacy protection. There are software-as-service companies that do this, www.civisites.com comes to mind.
Who set up your current site? They are probably the best person to talk you through this. If not them, then who is your current host? Your current hosting company should be able to help you move your data to a new hosting company, sometimes for a small fee. Your new hosting company may be able to help you move your civi information and installation as well.
If you have specific troubles in moving your installation, you can post your question on this forum and friendly community members will work to help you out, if they can.


Edit recurring calendar item instance from workflow

Question: I've created a workflow that edit the title of a calendar item. When applying the workflow on a recurring item all items are changed ... How to make only the current calendar item instance changing?
Comment: Does the rename take place on item creation or is it manually fired?
Answer: It is not possible to change the title for an individual instance. This is because the SharePoint run time is expanding the recurrence information on the first instance to create in memory calendar items when a view is loaded.
SharePoint does not support customisation of individual instances of recurring items


What is the impedance of a multi-tap impedance matching transformer when all taps are used at the same time?

Question: So if I have an impedance matching transformer with two taps, one 8ohm and the other 4ohm, and both taps have a winding relationship so that the other side "sees" a 4kohm load, what is the impedance if I use both taps at the same time assuming both loads are correct to their respective taps? what about the power if a signal is applied on the 4kohm side? will it split through each one of the other two loads? with what proportion?
Comment: This has the feel of a "homework question", although I suspect it might not be. But in any case, what have you worked out so far? Suppose you connect a fixed AC voltage source to the primary. How much current flows in it when you connect one load at a time? How much current flows when you connect both loads? What does this tell you about the effective impedance of the primary when both loads are connected? (Keep in mind that the turns ratio is the square root of the impedance ratio.)
Comment: I have solved it :), I ran a simulation on proteus and the current through the 4k resistor doubled when both loads were connected which means the resistance halved. The power remained the same across each load. However, for the second case I'm getting some strange readings for the current through the primary, it is much higher than it should be, but it's probably some glitch in the program since it stays like that with loads connected or not.
Comment: The power readings of each load are the same as for the multi-tap transformer, power stays the same on the secondaries, so power must double across the primary and resistance should be half.
Comment: Yes. Keep in mind that the primary current includes the out-of-phase "magentizing current", which is determined only by the inductance that you selected for the primary and the frequency at which you're driving it.
Answer: To produce the same power in a 4 ohm load as an 8 ohm load requires that the 8 ohm load receives an RMS voltage (or DC voltage for resistors) that is \$\sqrt2\$ as high as the 4 ohm load.
For instance with 4 volts on the 4 ohm load, a power of 4 watts is produced and, to produce 4 watts in an 8 ohm load requires 5.657 volts.
This relationship dictates the relative turn ratios for the load windings i.e. if the 4 ohm load connects to a 10 turn winding then the 8 ohm load connects to a 14 turn winding. It's approximately 1.4142 x higher but near enough.
So given this relationship, it can be expected that using an ideal transformer, both loads will produce identical power outputs.
If the 8 ohm load produces an impedance of 4 kohm at the primary then so does the 4 ohm load on its winding and, if both are connected simultaneously then the load at the primary would be 2 kohm.
Answer: When each load is connected, since the voltage at the tap is the same and the load values have not changed, the currents for each load will be the same as when connected individually, so the current on the whole secondary will increase (twice for two simultaneous loads), which will in turn increase the current through the primary, and since the voltage there has not changed either, twice the current means half the resistance. So, the resistance seen by the primary when both loads are connected drops to 2k, different to the 4k seen when only one load is connected.


How to buffer data for send() and select()?

Question: While a send() succeeds with all data being sent most of the time, it is not always the case. Thus people are advised to use the write-fdset for select() and poll() to check when the socket is writeable.
How do usual mechanisms look like to actually buffer the data to send while still maintaining a well comprehensible sourcecode?
Comment: Isn't this more of a POSIX/UNIX C library related question, than a C++ question?  You might want to retag it.
Answer: I'm not deeply familiar with the *nix side of socket programming, but I encountered the same problem on Win32 side. Buffering is not so much of a problem (you queue the requests and peek on write completion to submit next from queue), the real problem is that the need to buffer signals that you're actually handling flow control and you cannot resolve flow-control with buffering alone: there can always be a consumer slower than the producer and the buffer will basically grow out of control. You have to propagate the flow control up the stream to whatever module is producing the data, and this makes really complex interfaces. All 'write' requests must support return codes indicating flow control status (ie. 'stop writing, there is no more space!') and callbacks to invite the caller to resume write operations.
Answer: As we're in C++ land, you could store the data in a std::vector
New data gets appended to the end of the vector. When you get notification that the socket is writable, try to send the complete vector. send() will return how much was really sent. Then simply erase that number of bytes from the beginning of the vector:
<code>std::vector<char> buffer;
...
if( ! buffer.empty() )
{
    int bytesRead = send( socket, &buffer[ 0 ], buffer.size(), flags );
    if( bytesRead > 0 )
        buffer.erase( 0, bytesRead );
    else
       // some error...
}
</code>
So there's probably more error checking to do, but you get the idea?
Rather queueing each individual send request, the advantage here is that you get to potentially combine multiple higher level sends into one socket send, assuming you're using TCP?
But as Remus quite rightly mentions, your flow control and API is the tricky bit - i.e. how do you stop the buffer becoming too big?
Comment: That's a fine example, though my first nitpick is that you needlessly copy the tail of the vector when you erase the head - I'd use some sort of a circular buffer here, the second nitpick is that vector does not release the memory when its size changes, you have to do it manually.
Answer: When writing OO that needs to center around a select()/poll() loop, you need a good abstraction. I have always found the Adaptive Communications Environment (ACE) Reactor class very good for this. There are a couple of books "C++ Network Programming" by Doug Schmidt that cover this environment also various other stuff on the web including The Design and Use of the ACE Reactor


Starting one task after finishing another

Question: In a .vbs i have something like
   Dim sh
   Set sh = WScript.CreateObject("WScript.Shell")
   'run conf
   sh.run "cmd /K php -c php.ini -f some_path\runer\run.php & pause",0,false
   'Navigate to the nginx folder to run server
    sh.run "cmd /K start nginx & exit", 0, false
    Set sh = Nothing

this code is working fine.
But i want to execute sh.run "cmd /K start nginx & exit", 0, false this after completely finishing execution of sh.run "cmd /K php -c php.ini -f some_path\runer\run.php & pause",0,false this command, that means, after finishing the task of run.php i want to run nginx. please answer me if it is possible. Thanks
Answer: use this,
Dim sh
Set sh = WScript.CreateObject("WScript.Shell")
'run conf
sh.run "cmd /K php -c php.ini -f some_path\runer\run.php & exit",1,true
'Navigate to the nginx folder to run server
sh.run "cmd /K start nginx & exit", 0, false
Set sh = Nothing

Answer: Here's the documentation for your method. You are telling it not to wait. Some reason it didn't occur to you to read the documentation?
Runs a program in a new process.
object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])

Arguments
object
WshShell object.
strCommand
String value indicating the command line you want to run. You must include any parameters you want to pass to the executable file.
intWindowStyle
Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.
bWaitOnReturn
Optional. Boolean value indicating whether the script should wait for the program to finish executing before continuing to the next statement in your script. If set to true, script execution halts until the program finishes, and Run returns any error code returned by the program. If set to false (the default), the Run method returns immediately after starting the program, automatically returning 0 (not to be interpreted as an error code).
Remarks
The Run method returns an integer. The Run method starts a program running in a new Windows process. You can have your script wait for the program to finish execution before continuing. This allows you to run scripts and programs synchronously. Environment variables within the argument strCommand are automatically expanded. If a file type has been properly registered to a particular program, calling run on a file of that type executes the program. For example, if Word is installed on your computer system, calling Run on a *.doc file starts Word and loads the document. The following table lists the available settings for intWindowStyle.
intWindowStyle  Description
0
 Hides the window and activates another window.

1
 Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

2
 Activates the window and displays it as a minimized window.

3
 Activates the window and displays it as a maximized window.

4
 Displays a window in its most recent size and position. The active window remains active.

5
 Activates the window and displays it in its current size and position.

6
 Minimizes the specified window and activates the next top-level window in the Z order.

7
 Displays the window as a minimized window. The active window remains active.

8
 Displays the window in its current state. The active window remains active.

9
 Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag when restoring a minimized window.

10
 Sets the show-state based on the state of the program that started the application.

Example 1
The following VBScript code opens a copy of the currently running script with Notepad.
Copy Code
Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "%windir%\notepad " & WScript.ScriptFullName

The following VBScript code does the same thing, except it specifies the window type, waits for Notepad to be shut down by the user, and saves the error code returned from Notepad when it is shut down.
Copy Code
Set WshShell = WScript.CreateObject("WScript.Shell")

Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, true)

Example 2
The following VBScript code opens a command window, changes to the path to C:\ , and executes the DIR command.
Copy Code
Dim oShell

Set oShell = WScript.CreateObject ("WSCript.shell")

oShell.run "cmd /K CD C:\ & Dir"

Set oShell = Nothing

Applies To:
Answer: Try this
  sh.run "cmd /K php -c php.ini -f some_path\runer\run.php & exit",1,true

Answer: For any query you can use:
Dim sh
Set sh = WScript.CreateObject("WScript.Shell")
sh.run "cmd /K a.exe & exit",1,true
Set sh = Nothing

I think this will help you.


Hand duplication in music notation

Question: I'm writing a montuno two piano ensemble and primo has its melody in the right hand completely duplicated by the left, an octave lower. How could this be abbreviated in the score? I can't find any piano examples and I'm not very familiar with orchestral sheet music, but I guess it's something like basso continuo?
Comment: You wrote in your post "I can't find any piano examples". The reason you can not find examples is that when the hands are playing in octaves it is written out in both hands. Please do the same. @Aaron is right that it is the far best for the performer. Good examples: Chopin sonata 2, the last movement, the entire movement is written in octaves in the two hands except the last bar, Schubert the "Trout" quintet in the piano part, there are lots of octaves in the two hands. In both cases they are always written out in both hands.
Comment: There is no standard notation for this, but @Jomiddnz idea is your best option. However, is there some reason to abbreviate? For a. performer, it will actually make things harder to read.
Comment: You could start it off to clarify what you want, then write under it Con 8vb under the right hand part.
Comment: @Aaron I thought that this kind of abbreviation would make things easier, because the melody is the exact same, just an octave lower. In my mind, it would be easier to sight-read, as for the fingering - if I'm specifying it, then it could be above/below the note to indicate which hand it's for.
Comment: @Jomiddnz The solution is simple and straightforward. I'm going with it.
Comment: Note that _8vb,_ although used widely, is incorrect.  It should be _8va bassa,_ but as it is always written below the notes when the transposition is downward it may be written as _8va_ or simply _8._  The reason one should write _8va_ even when the transposition is downward is that _8va_ means _ottava,_ which means _octave_ (not _octave higher)._  In other words, the belief that the _a_ in _8va_ means _alta_ is entirely mistaken.
Answer: The convention is just to write out the notes in both clefs.  Con 8vb might sound attractive, but it is used for doubled bass notes in the bass clef when the ledger lines get confusing-- it really isn't meant for this purpose.
Answer: I come across this in practice/teaching material, where for example the Primo (student) is the same melody in both hands while the Secondo (teacher) is providing the harmony.
There (although aimed at students, not performers) the convention seems to be to write both hands in full and note the octave shift with 8va alta/bassa, in some modern engravings on the clef itself.
See for example Diabelli Op. 149 ("Melodische Übungsstücke"): https://imslp.org/wiki/28_Melodische_%C3%9Cbungsst%C3%BCcke%2C_Op.149_(Diabelli%2C_Anton)

Or from some student material I own (don't do this in any non-practice piece, it's considered non-standard notation):
Comment: Your student material looks like it was written in Musescore - the faded forte marking is a dead giveaway, and the use of the 8va treble clef in what I assume to be piano music definitely helps. (I don't recall any of my piano books ever using that clef, and none of my music teachers ever taught it - you have been warned.)
Comment: @Dekkadeci , the faded forte marking is no give away. It could also be Finale or Sibelius. The same can be said of the 8va treble clef. It is one of the standard possibilities within the subject of clefs. It is rarely applied in piano music though, But in a case where the whole piece has an upper staf that is constantly an octave above the lower staff as in the example shown it actually makes sense.
Comment: @Lars Peter Schultz all the notation guides I've seen advise against it.  It's too easy to miss the 8 at the top of the clef, especially since it's nonstandard.  It's far clearer to use the standard _8_ and dotted line above.
Comment: @Dekkadeci I didn't say that it was good material :) It is actually MuseScore but I don't see that as a problem as long as it's basically just a warmup exercise. And (albeit I'm just a student myself), I tend to agree with Lars Peter Schultz here: if the whole piece is written with an octave shift, then this notation does not hurt. I definitely see the counterarguments for "real" pieces though, especially if there are clef changes. I'll edit my answer accordingly.
Comment: @phoog, you are right that it is too easy to miss the 8 at the top, but you can't miss that the notes in the right hand are exactly the same as in the left hand, so you can't play them as written. Anyway, in the music school where I work I have made many arrangements with a whole group of piano players where they play in different registers. It is my experience that students have a tendency to even miss 8 signs with a dotted line, so it is best to write music in the right octave. But if it is a beginner who has only learned to read the notes around middle C you do need the octave signs.

Hand duplication in music notation


Spellcheck in Ubuntu

Question: In MacOS X it is possible to have spellcheck OS wide for all applications where you have an input. Is something similar possible with Ubuntu? So that I have spellcheck for e.g. skype?
Answer: I don't think there is anything approaching this functionality yet available on Ubuntu. It's been proposed time and again on ubuntu brainstorm, and these suggestions have been collected under this idea: Idea #364: More comprehensive dictionary program. (Check the duplicates assigned to this idea).
Check this post to see a rigged up implementation with the same goal in mind.
Answer: Looks like I am unable to just add a comment and this'll go in here as a new post to the thread. :-(
I tried to use nagul's link, to see Idea #364, but that site brainstorm.ubuntu.com is apparently shut-down. I found this answer, regarding the issue:
Ubuntu Brainstorm site down/dead?
P.S.
So far, I've gotten to here and I'm not sure whether there is something better && so, still looking.

Spellcheck in Ubuntu


What is the best way to sanitize your hands when working with mushrooms?

Question: I've been bleaching my hands before working with mushrooms, and am getting white spots on my cloths. What is the best way to sanitize your hands before I reach my hands into the moisture chamber to work with the kit?
Comment: How about using gloves? The disposable ones would need no special treatment and the thick ones can be sanitized without destroying your skin.
Comment: sanitizing my hands in some way safe to the mushrooms is better in my opinion
Comment: If you are using full strength bleach, that's likely your problem. For most purposes a 10:1 water:bleach ratio is more than enough for disinfection.
Answer: I think best might be subjective here.
Personally when working with mushrooms / mycellium I wash my arms & hands with soap and water & then put on disposable gloves. I then spray the gloves with a 50/50 water isopropyl alcohol mixture & let the gloves dry before proceeding with my work.
You can use this mixture on your skin too, although it will start to dry out your skin after a while. I do sometimes do this.
A mix of 50% to 70% isopropyl alcohol is a much better choice than bleach. It is less toxic & won't stain your clothes.


Aquamacs Preview doesn't work

Question: I've been using aquamacs 2.4 on my osx 10.7.5. After it crashed with my font change operation, the preview menu bar disappeared and doen't appear again after rerunning the program. Although I reinstalled the aquamacs package, the problem was not fixed. Could anybody help me on this problem?
Comment: Is AUCTeX still loaded on your emacs?  (I believe both are pre-packaged with Aquamacs nowadays, but I can't be sure since I'm a GNU Guy.  AUCTeX and `preview` are closely intertwined.)  Also, could you elaborate on this 'font change operation'?  Which fonts were you changing?
Comment: Try renaming the "Aquamacs Emacs" folder in `~/Library/Preferences/` so as to start in a fresh state.
Answer: The problem was the .emacs file in my home directory. I put below contents, which I copy and pasted, to enable spell checking function. Once I remove the contents, the preview function turn on. But I'm still not aware of why following made the problem. Thank you for all in this thread.
(setq ispell-program-name "aspell") ; could be ispell as well, depending on your preferences

(setq ispell-dictionary "english") ; this can obviously be set to any language your spell-checking program supports

(add-hook 'LaTeX-mode-hook 'flyspell-mode)

(add-hook 'LaTeX-mode-hook 'flyspell-buffer)

Aquamacs Preview doesn't work


Near Geoprocessing service

Question: I created a simple model that includes a near geoprocessing tool with a point feature layer as an input and a line feature layer as a near feature and it works perfectly in desktop. Now I would like to publish it to my server as a geoprocessing service to be able to consume it using javascript API and use feature layers as parameters. I know that the geoprocessing services in this case only accepts featuresets rather than feature layers as inputs but in my case I need to use the feature layers that are published in my server. How can I modify my model to successfully publish the service? and how should I set my inputs?
Answer: Haven't tested this, but you can use the Copy Features tool to make a feature class from a feature layer.

Near Geoprocessing service


How do you customize the the profile photo in 8.2 or newer?

Question: From the desktop I've only been able to change the background to one of the predefined images; same goes for the profile. Not finding any articles that relate specifically to those images.
Answer: Turns out that you have a few options.
The first option is to open up the *Portraits.config** and modify the list of pipe-delimited icons.
The second option I discovered is you can simply paste in a new url in the user manager. As seen below, I pasted in a public image url and it showed up upon refresh of the screen.

If using Sitecore PowerShell Extensions, you can update the profile portrait and desktop with the following script. Adapt to C# if you want to perform this in your own module. Looks like the wallpaper requires a local path.
<code>$user = Get-User -Current
$user.Profile.Portrait = "https://pbs.twimg.com/profile_images/562466745340817408/_nIu8KHX.jpeg"
$user.Profile.SetCustomProperty("Wallpaper", "/sitecore/shell/themes/backgrounds/Field.jpg")
$user.Profile.Save()
</code>
The third option may be as Owen described.
Answer: The backgrounds are taken from:
\Website\sitecore\shell\Themes\Backgrounds
You can drop an image in there and then you'll be able to select it in the Sitecore desktop. I don't know if there's a better way to get the image in to that folder be I coudn't see one.
Looking at the profile images now - will edit if I find anything :)
EDIT: It looks like this is coming from the Office.zip icons but I can't find how they're selected. I'll have another look later.


Where along the strings to pick?

Question: How does picking position affect a guitar's sound? I can make some general observations – the strings are brighter near the bridge, and they can be more percussive near the neck – but I'm not sure how that translates to technique and performance. Do certain styles or techniques favor picking in different locations along the strings? Are there any significant differences I should be aware of for guitar versus bass, or electric versus acoustic? For example, does it matter if I pick directly above an electric pickup?
Comment: We can tell you "brighter near the bridge", "boomier near the neck". But the way to decide which is better for you for a given piece, is to try it, listen, and do what sounds best **to you**.
Comment: Don't limit yourself, sometimes Kieth Richards picks out over the neck itself.
Comment: You have asked three questions in quick succession which all have the same basic answer: if you're trying to get a particular player's sound, you need to find out what they do; and if you're trying to find your own, experiment! There's not much "right" or "wrong" with these things, do whatever sounds good to you.
Comment: The answers have been much more specific and helpful than that, with solid information on the physics and mechanics of strings, and good specific advice for bassists (my primary instrument).
Answer: I think this mostly depends on what you like.
Here's what I do on my bass that has two pickups(neck and bridge):

When I want a brighter sound, I pick (or play with my fingers) on top of the bridge pickup (and lower the volume of the neck pickup, so that my bridge pickup is louder)
If I want a more bassy sound, I play on top of the neck pickup (and lower the volume of the bridge pickup, so that my neck pickup is louder)
If I want a combination of those two, I play in between of the two pickups
If I want to mimic the sound of the double bass, I play higher than the neck pickup; I play right at the end of the fretboard (this sounds better if I play with my fingers and not a pick)

This also depends on the instrument you are using. For instance, when I play with my (mexican :( ) Fender Jazz Bass (2 single coil pickups), I prefer to play on the bridge pickup mostly, but when I use my Warwick one (2 humbucker pickups), I prefer to play in between them, or on the neck one.
Answer: Picking directly above a pickup does mean that the harmonics that would be highest amplitude at that point are likely to be boosted (similarly, you can pick positions on the string that will reduce harmonics at pickup positions)
For a lot of my music I play positions from directly over the neck pickup to nearly at my bridge pickup (on a 2 pickup guitar) - this gives me a wide range of tones, and when I use heavy distortion, the effect on the harmonics is incredible, letting me choose anything from a 'chug' to a 'growl' to a 'squeal' etc. and that is before I even use pinch to further attenuate the low harmonics.
Answer: Yes, picking different distances from the bridge yields different degrees of acoustic response. The closer to the bridge, the "tinnier" the sound because the pick is not putting energy into the lower harmonics.
Then there are so-called "pinch harmonics" which are [typically, for me at least] created by holding the pick close to the tip and allowing the thumb to touch the string as well. As you move along the string, different harmonics will be emphasized.
And then there are true harmonics, which follow the same pattern as the opens strings, except that the "nut" is now where you've fretted the string. So count your typical 5, 7, 12, or more frets up from there. You can pick through a chord that way for a shimmering effect. Steve Morse does this frequently. There are different techniques for finger-picking and flat-picking in order to "touch" the harmonic as you pick the string.
What I've described above applies to both acoustic and electric guitar. As for picking directly over a pickup, I tend to avoid this simply for the fact that, depending upon the depth of your picking stroke and the height of your pickups, you may hit the pickup (or its cover) and interfere with your picking motion. For basic ergonomic reasons, I tend to pick between the neck and the middle pickups, unless I am intentionally seeking an alternative sound.
Comment: @KirkA - for 'true' harmonic - substitute 'false' or 'artificial'.
Comment: Thanks! Are there any common reasons that you would choose to pick somewhere different (e.g., palm muting)?
Comment: You said it yourself already, regarding your own observations. You use those effects to impart tension or relaxation to your playing. You may want to simply add a flourish, or you may want to integrate it into your style.

Where along the strings to pick?


Do all cheeses change their taste during their shelf life, like Brie or Camembert?

Question: Brie and Camembert go through 3 stages of ripening and changes in taste. Does it happen to blue, or any other type of cheese?
Comment: Of course, I'm not really sure if there are any real cheeses where it doesn't happen. Perhaps those American single slice thingies?
Comment: hmmm I haven't noticed really with hard or semi hard cheeses. At least the taste doesn't change that radically
Comment: I disagree. Some hard cheeses can ripen for months or even years and change their taste quite a lot.
Answer: All traditionally made cheeses (not "cheese food" or pasteurized processed cheeses like American slices or American cheddar that you find in the grocery store) contain enzymes and bacteria that impact the texture and flavor over time. Cheese makers call this "ripening".  The amount of impact that you notice depends on a number of variables...type of cheese, age, storage conditions (temperature, humidity...), and packaging, to name a few. It's more obvious, and a quicker process in softer cheeses, but it also happens in hard cheeses. Storing cheese in a typical refrigerator drastically slows the ripening process, as it is typically too cold, and much too dry to promote ripening. However, with a few modifications, you can fairly easily create the correct conditions at home if you want to build a ripening "cellar".  Most cheese makers will have a perfect ripeness in mind for a given cheese, but most are edible well before and well after this ideal state.  Aromas of ammonia, or a rotting rind are signs that a cheese is well past its prime.


Can I possibly be forgiven for doing this?

Question: Guys im really worried so a while ago I talked to an anonymous person on the internet and they may have committed shirk because of something I said but I only really thought about it now. I heard that in this situation I would carry the sin too but I don't know who the person was because it was completely anonymous. If I repent and don't do that again, is it possible that I could still be forgiven even if the person continues their sin? I really dont wanna be in hell forever because of this I don't know what to do im really scared right now.
Answer: Allah forgives all your sins so long as you are remorseful and regret what you have done.
The only way you'll be held accountable would be if you continued your connection with this person. As long as you cut your ties from this person, repent sincerely and never do anything like this again, Allah will forgive you.
It wouldn't make sense for Allah to continue punishing you for what you did, because if that was the case, you would indefinitely be lead to hell. Thankfully, Allah is the most forgiving and as long as you repent sincerely, all that haram that you were previously joined with will be cut off and you will not be dragged into hell for what you have done. You're human, Allah knows that which is why he's the most merciful.
Had you died in the state of shirk, yes Allah wouldn't have forgave you.
Comment: Thank you, so does that mean that I can be forgiven even if the person continues committing shirk because of me? I truly regret it now
Comment: @dlsj Yes you will be forgiven. It wouldn't make sense for Allah to continue to keep punishing you for something you did either on accident or even intentionally. But after turning back to Allah and changing your ways, all the haram ties you were associated with before have been cut off. If that wasn't the case, what would be the point of repentance? You would still be dragged to hell despite repenting if that was the case. Inshallah, now that you have reflected and admitted that you've done wrong, Allah is the most forgiving and loving and won't penalize you.
Comment: @dlsj you must warn them about shirk and its severity. But be careful. If they don't listen, leave them. Don't waste your time with them.
Comment: Ok thanks for answering but like im still a bit worried because of one thing: some of these people gave me their social media usernames but I never actually followed them or talked to them. Do I still need to tell them about this since I have their usernames and I could possibly dm them? Or can I just repent for myself without saying anything to them? I don't really have contact to them so it would be a bit weird to suddenly talk to them, now im a little confused
Comment: Then leave them.
Comment: So I just shouldn't say anything to them at all?
Comment: Well, if your ties have been cut, I don't see how they'll a part of your life anymore.
Comment: Okay, I was just worried because maybe I thought I should tell them so that they don't commit a sin because of me but yeah I think I'll just repent sincerely and not say anything
Comment: wait I just saw your comment with 'you must warn them about shirk' so do I have to reach out to them now? I'm sorry that I keep asking but I'm really scared
Answer: No matter what you have done, if you really regret your sin ask Allah swt for firgiveness...ALLAH had promised us that he will forgive us but if we really regret that....it cant be like this....ya allah forgive me and then another day you will do the same sin that forgiveness will not be accepted by allah..but we know that Allah swt is so great and merciful inshallah he will forgive us


Mist error: "Could not compile source code"

Question: Image contains the error and code i have written. I have use inheritance in my code.
Answer: You should have owner = msg.sender. Otherwise I get the following error:
Error: Expression has to be an lvalue.
    msg.sender = owner;
    ^--------^

After I get that I get no errors. It makes sense since you want to assign the creator of the contract (i.e. the message sender) to be the owner of the contract.
Where did you use inheritance because I dont see it. Inheritance is something like contract User is mortal{...}
Answer: I don't have an answer for your question, but try to compile this code in the solidity browser compiler. If it compiles, then there's something wrong with Mist. Here's link to the compiler
Just noticed on line 7 there should be owner = msg.sender
As I understand it you can only deploy one contract per address. It means that you can deploy only User or Mortal contracts. However, you can compile them together(what you're trying to do) and connect them internally.
For example, if you do inside your User contract:
 address mortal = new mortal()

Compiler/EVM will deploy new contract mortal and return it's address which will be available at mortal variable.
Then inside your User contract code you can do things like:
 mortal.kill()

Comment: When i have run in compiler.I am getting an error of expected primary expressions { at 16:3 ".But still i am not getting how to resolve the same.Help me if you can.


Help me figure out what this cute little plant is Please :)

Question: I just bought this as a gift for my friend and no one can figure out what it is, I've googled all I can but I'm not familiar with plants so I have no idea what family its even in. Please help :)
Answer: It is called a ZZ plant, or more scientific Zamioculcas zamiifolia. It is a popular house plant, and quite easy to maintain. Not too much water, and good drainage. You can find a lot of info on internet about how to care for it.
Comment: Thank you! I told her and she looked it up :)


Reason for removal of a post

Question: My posting of  "Frequency and elements of the Lord's Supper" was removed. Is it possible for me to find out why? Is there a way for me to see the posting? If so, how? Would the reason for its removal be there, assuming I can get there?
Answer: It wasn't your answer per se, in this case the question was removed. It had been closed for some time, was not getting edited to be openable and the OP requested that it be removed.
Even if they tau not requested it, that is what would have happened anyway sooner or later. You can basically expect anything that is closed (exempt duplicates) and not worked on to find the dust bin eventually.

Don't waste time answering questions that have obvious  problems. If you recognize they are likely to run afoul of our guidelines, fix them first then dig in to answering.
If you run across something that gets closed and you think you know a way to fix it, do so. Not everything is worth salvaging or even possible to save but don't assume even good content will just hang around is limbo under a classed question.

Normally you would be able to see your own posts if they are deleted along with any comments that were left on them. Since it was not your post that was removed that does not apply but let me drop a copy on pastebin in case you want to archive or reuse your own work.
Edit: Apparently this isn't the one I had in mind from yesterday that the OP requested deletion on, but it was off topic and the OP had commented with a question about whether it should be deleted.
Comment: OK. Gotcha. Thanks for the information. Don

Reason for removal of a post


Ps3 controller issue

Question: My PS3 controller is dead and the cable to charge it broke.  I bought a new cable and it charges a wireless headset, but when I plug it into the controller nothing happens.  It won't even turn on.  Does this mean my controller is no longer useable?
Comment: You should be able to use a usb cable to plug your controller directly into your PS3. Once plugged in, see if it works, else it is no longer useable.
Answer: Most likely, yes. There is a chance that the pins are just not making good contact, if the cord is new and it's not charging, the only way to fix that would be replacing the hardware in the charge port on the controller itself.

Ps3 controller issue