OAuth 1.0a, 2-legged: how do you securely store clients' credentials (keys/secrets)?

Question: Am I correct that OAuth 1.0a credentials need to be stored in plaintext (or in a way that can be retrieved as plaintext) on the server, at least when doing 2-legged authentication?  Isn't this much less secure than using a username and salted+hashed password, assuming you're using HTTPS or other TLS?  Is there a way to store those credentials in such a way that a security breach doesn't require every single one to be revoked?

In more detail: I'm implementing an API and want to secure it with OAuth 1.0a.  There will possibly be many different API clients in the future, but the only one so far has no need for sensitive user data, so I'm planning to use "2-legged" OAuth.
As I understand it, this means I generate a consumer key and a shared secret for each API client.  On every API request, the client provides both the consumer key, and a signature generated with the shared secret.  The secret itself is not sent over the wire, and I definitely understand why this is better than sending a username and password directly.
However, as I understand it, both the consumer and the provider must explicitly store both the consumer key and the shared secret (correct me if I'm wrong), and this seems like a major security risk.  If an attacker breached the provider's data store containing the consumer keys and shared secrets, every single API client would be compromised and the only way to re-secure the system would be to revoke every single key.  This is in contrast to passwords, which are (ideally) never stored in a reversible fashion on the server.  If you're salting and hashing your passwords, then an attacker would not be able to break into any accounts just by compromising your database.
All the research I've done seems to just gloss over this problem by saying "secure the credentials as you would with any sensitive data", but that seems ridiculous.  Breaches do occur, and while they may expose sensitive data they shouldn't allow the attacker to impersonate the user, right?
Answer: You are correct. oAuth allows you however to login on the behalf of a user, so the target server (the one you access data from) needs to trust the token you present.
Password hashes are good when you are the receiver of the secret as keyed-in by the user (which, by the way, is what effectively what happens when oAuth presents the login/acceptance window to the user to generate afterwards the token). This is where the "plaintext" part happens (the user inputs his password in plaintext).
You need to have an equivalent mechanism so that the server recognizes you; what oAuth offers is the capacity to present something else than a password - a limited authorization form the use to login on his behalf. If this leaks then you need to invalidate it.
You could store these secrets in more or less elaborated ways, at the end of the day you still need to present the "plaintext" version t the server (that server, however, may use a hash to store it for checking purposes, as it just needs to verify that what you present in plain text, when hashed, corresponds to the hash they store)


How to login when I can't enter my password because "e" key on keyboard doesn't work

Question: My "E" key on my keyboard stopped working. The tech says I need to change the keyboard, but for now I just want to use a bluetooth apple keyboard. The problem is I can't connect it without logging in and I can't log in as my password contains an "E"? What can I do to connect the bluetooth keyboard? Everything else works. Keys and mouse plus trackpad.
Answer: Try entering ⌘+option+F5 to bring up the "Accessibility Options" popup window. This window will appear similar to what is shown below.

Select "Enable Accessibility Keyboard", then click on the "Done" button. The on-screen keyboard should appear, as shown below.

Use the keyboard to enter the "E" key or the entire password.
Comment: When i try hitting down those keys it says something that sounds like "Voiceover user name on" and switches to a username/password view.
Answer: Apple's current Bluetooth keyboard is the Magic Keyboard, and this also allows the keyboard to be connected to your Mac via a supplied Lightning adapter cable.
I would suggest connecting this first in order to be able to pair the keyboard, and then you will be able to log in as usual using the external Bluetooth keyboard afterwards.
You only need any physical keyboard (PC, Mac, anything basically) to set up your Bluetooth and for emergency use if Bluetooth pairing fails in the future.


Why Katsuki Bakugo was so mean with Midoriya when he didnt have any quirk?

Question: When a child, Midoriya didnt have any quirk. And at some point he considered Bakugo his friend. Why then Katsuki Bakugo felt threatened by Midoriya? This makes sense when Midoriya already had the One for All quirk and could be an obstacle for Bakugo to become the greatest hero (which is Bakugo's goal), but I can't understand why Bakugo was so mean to Midoriya when he was quirkless. Is there any explanation about this?
Answer: Katsuki Bakugo throughout all of My Hero Academia has a superiority complex, this is made evident by his lavish demands of not only Midoriya but also his friend group at the start. It's quite simple to tell he has this characteristic, as he is portrayed as being egotistical, arrogant and narcissistic. This kind of behavior has two spectrum's too it in character development winning or losing at the start he's higher in the pecking order thus he strikes down anyone as to show his superiority and fuel his own narcissistic traits. He specifically picks on Midoriya as he wants the admiration of his peers as being the strongest, if he picked on someone else it would be almost like saying they were stronger and he wouldn't potentially gain there admiration. Another take would be that Midoriya being born quirkless is actually kind of rare as there is always the potential for him to suddenly activate a quirk at any time, this unknown factor is a reason for katsuki to be unsure of if he's at the top of the pyramid, thus he bully's him to make sure he also believes he will never be strong.
This question as a whole is interesting because I believe there is a strong psychological meaning behind all of this that adds a whole dynamic to there relationship throghout the story so far.
Answer: Update
In the episode Katsuki Bakugo: Rising, Bakugo answers this very question in his own words. Unsurprisingly, it corroborates what I previously said. In a flashback while talking with All Might, Bakugo, speaking of Midoriya, says (emphasis mine):

The thing is, [Midoriya] doesn't think about himself. He never has. Even now, with everything he can do, that still hasn't changed. It always freaked me out. That's why I pushed him away. But as a kid, I didn't recognize my own weakness. So I bullied him.

All Might further points out that Bakugo is so willing to train with Midoriya in order to make amends, though Midoriya likely believes Bakugo has nothing to make amends for, not seeing the situation in the same way. These points might help to combat my own complaints that I levied in my answer below.
Second Update
There is an even better quote from Bakugo in the episode Deku vs Class A, when he apologizes to Izuku:

Our whole lives, I've looked down on you. You were quirkless--obviously way behind me. But somehow, it felt like you were ahead of me too. I hated that. I hoped you'd disappear. I didn't want to accept you. So I bullied you. To make sure you'd stay away. I had to reject you. So that I could feel superior. I needed to win--to beat you. And we both got into UA, where not a single thing played out the way I wanted it to. Every day, I was forced to see how strong you were. And how weak I was. Saying this out loud doesn't change a thing. But that's how I feel... Izuku. I'm sorry for everything.

As can be seen, Bakugo's explanation here still matches up neatly with mine. He initially views Midoriya as inferior. Due to Midoriya challenging this belief when they were kids, Bakugo feels threatened. He goes into denial, gets angry, and bullies Midoriya--both as a means of pushing him away (because he represents something scary) and reaffirming his own assumptions of superiority. And it's only after Midoriya repeatedly proves Bakugo wrong that he is forced to accept that his worldview is incorrect; this is when he finally accepts Midoriya.
Old Answer
This is simple child politics. As someone without a quirk, Midoriya is an outlier (someone different, an outsider to the group) and Bakugo is a bully. This bullying is exacerbated by two causes: First, Bakugo is egotistical; he is vocally conceited and aggressive; he is confident that he's got the greatest quirk ever, and certainly better than all his classmates, and he lets them all know it. Picking on the quirkless Midoriya is a natural way to affirm his superiority and establish the pecking order, with him on top and Midoriya on the bottom. Secondly, Midoriya has the absolutely ridiculous notion that he wants to be a hero even though he doesn't even have a quirk. Even adults like All Might tell Midoriya it's not possible and he should just aim for being a police officer, and kids sure aren't going to be as nice about it. Of course they're going to bully him, and Bakugo, as the top of the hierarchy, is going to lead the pack. In his mind, Bakugo has to beat Midoriya down to let him know his place. Midoriya's dream is actually a threat to Bakugo's world view, so it makes a lot of sense.
And because it's human nature, any deviation from Bakugo's expectations is just going to make him angrier and make him bully Midoriya even harder. For example, we see this during the times Midoriya tried to help Bakugo out as a kid. Bakugo gets angry, because why would he need help from a "loser" who is so far beneath him? Accepting that kind of help would establish Midoriya as having worth and would also diminish Bakugo's self-worth. And it is in these moments when Bakugo's resentment and hatred of Midoriya sprouts and grows, festering until it culminates in the explosions of anger we see during the series when Midoriya proves he actually can be a hero, and thus has worth. At this point, Midoriya becomes a serious threat to his world view, and the natural human response is to lash out in anger and keep on denying reality.
On a side note, I think this question warrants mentioning another thing about Bakugo. He's literally mean to everyone. Is there any point during the series where he isn't verbally abusive? While his classmates often don't seem to mind, he never tones it down, and he's so bad that the teacher's have to warn him that he shouldn't be talking to people he's saving like that.
A better question is why on earth Midoriya considers Bakugo to be his friend in spite of all of this. Midoriya could have some genuine admiration since Bakugo shows leadership qualities and has a cool quirk, but honestly, this isn't a great explanation. I think this break from reality and suspension of disbelief is better explained by this just being typical Shonen genre tropes, in always equating rivalry with friendship. (For example, see also Sasuke and Naruto, who the story suddenly declares to be "best friends" after being antagonistic towards each other for the entire original Naruto series. And more relevantly, Goku and Krillain in Dragon Ball, where Goku is basically too dumb to realize Krillain is bullying him and somewhere along the way they become friends.) The main themes of the Shonen genre are friendship, hard work, and victory, and things tend to be seen through these lenses. And the rival character is a staple of this. Even when they're an outright bully like Bakugo, they somehow get designated as a friend. See Bully Turned Buddy and Rival on TV Tropes, which both use Bakugo as an example.


UK visa overstay

Question: I have to overstay my 6-month UK tourist visa by three or four days. Should I expect a problem when I fly out with a short overstay?
Comment: "I have to overstay my 6-month UK tourist visa by three or four days." You almost certainly don't have to do this. And it's probably better for all concerned if you choose not to.
Comment: Saying you have to overstay your visa is almost like saying you have to break the law - very rarely true. You probably won't get into any immediate trouble, but it will go on record, and if you don't explain it on your next visa applications (for at least the next 10 years) you run a big risk of getting those applications refused.
Comment: It might be a problem the next time you apply especially since they now have automated exit controls. A friend overstayed his UK visa by 10 days a few years ago before automated exit checks. However, that day, they had immigration officers reviewing exiting passengers. She got off with a warning and hasn't had a problem in her next few applications.
Answer: A valid reason to overstay would be something like being hospitalized with a life-threatening condition, or the same happening to a relative you're traveling with. In that case, try to get an extension before the original visa runs out.
We can't tell you exactly how if we do not know how you came to the UK, and why you have to stay. Any valid reason would be so deeply personal that you should not post it on a message board. Find an UK lawyer specialized in immigration cases.

Regarding the question, perhaps there will not be much of a problem when you leave the UK, but there will be a big problem when you try to enter the UK anytime in the future. They will know that you have broken the rules once, and they will think you might do it again.
Comment: Difficulties may be compounded if the original visa application stated that the planned stay in the UK was substantially less than 6 months (regardless of visa validity) and if the supporting documents (financial etc) were commensurate only with a visit much shorter than 6 months.
Comment: The OP doesn't mention that he stayed for 6 months. He may have arrived in the UK only a few days before the visa's expiry. UKVI can't refuse a visa solely on the basis on a short overstay. Only overstays over 28 days are grounds for mandatory refusal. His application should be decided for what is it--an overstay will obviously hurt his credibility and he should decide if it's worth the risk.
Comment: @greatone technically, they can refuse it on that alone - the difference is that they don't *automatically*.
Comment: Frankly, if I broke my leg a few days before leaving the UK, I would not regard that as "deeply personal" in the least.
Comment: @phoog Breaking a leg is unlikely to be a valid reason, unless it happened on the way to the airport.
Comment: @Tim they have to show on a balance of probabilities that the OP doesn't meet the rules. An overstay may hurt his credibility but if the rest of his application is strong including his reason for visiting, he will be okay.
Comment: @Rob I suppose whether that is true depends on [the severity of the injury](https://en.wikipedia.org/wiki/Ilizarov_apparatus).
Answer: You may be able to extend your visa as long as the total time you spend in the UK is less than 6 months.
Have you entered the UK at the first day of the visa?
In any case apply before your current visa expires.
Cost: between £1,000 and £1,500. If you go to a premium service centre in person, they'll decide on the same day.
More details: https://www.gov.uk/government/publications/visit-guidance
Answer: No problem leaving the country, the UK will want you to depart and will do what they can to push you along.  The real problem will arise when you try to later re-enter the UK, or enter a country with which the UK shares data.   This overstay will be a big mark against you, because immigration is mainly interested in refusing people likely to overstay or seek employment.
How bad is the mark? I couldn't earthly guess, because it will depend an awful lot on the other factors they evaluate about you, your circumstances, and your country of origin.
Is it worth spending $1000+ to fix it?  Due to the above, your future travel plans and your personal situation, I can't guess.  But if the answer is yes, it's far better heading it off before the fact than trying to fix it after an overstay.  I would start by talking to the UK immigration forces or a lawyer immediately, while you're still legal, and while the most time exists for corrective efforts to run their course.  Don't put it off.

UK visa overstay


WCF Chunking / Streaming

Question: I'm using WCF and want to upload a large file from the client to the server. I have investigated and decided to follow the chunking approach outlined at http://msdn.microsoft.com/en-us/library/aa717050.aspx
However, this approach (just like streaming) restricts the contract to limited method signitures:
<code>[OperationContract(IsOneWay=true)]
[ChunkingBehavior(ChunkingAppliesTo.InMessage)]
void UploadStream(Stream stream);
</code>
The sample uses the rather convenient example of uploading a file from a fixed path and saving it to a fixed path on the server. Therefore, my question is how do I pass additional parameters to specify things like filename, filepath etc.
eg. I would like something like:
<code>[OperationContract(IsOneWay=true)]
[ChunkingBehavior(ChunkingAppliesTo.InMessage)]
void UploadStream(Stream stream, String filePath);
</code>
Thanks in advance,
Mark.
Answer: This article explains how to use the MessageHeader attribute to force things to be passed in the header, and therefore not count as a parameter. So, instead of passing a stream and other meta data, create a class that has the attribute MessageContract and mark all of the meta data as a MessageHeader.  Then, mark the stream as a MessageBodyMember (which the article incorrect calls "MessageBody"). Have your UploadStream method take a single parameter whose type is that of the MessageContract class you've just created. I've done this successfully, but I haven't done it in tandem with chunking.  Good luck.
Answer: You could make your service session-ful and have an initialization method in the contract with the IsInitiating property set to true. Something like:
<code>[OperationContract(IsInitiating = true)]
void InitializeUploadService(string filename);

[OperationContract(IsOneWay = true, IsInitiating = false)]
[ChunkingBehavior(ChunkingAppliesTo.InMessage)]
void UploadStream(Stream stream);
</code>
I have never tried it with streaming services but it should basically make WCF enforce that InitializeUploadService is always called before UploadStream.
More documentation can be found here:
http://msdn.microsoft.com/en-us/library/system.servicemodel.description.operationdescription.isinitiating.aspx
Answer: I would look at MessageContracts and add those values as message headers to your object.  This should allow you to pass the stream and any values related to the stream as message headers.
Answer: Setting up the maxItemsInObjectGraph in the Client side and Server side worked for me.
(Dont forget the client side.) http://social.msdn.microsoft.com/Forums/en/wcf/thread/0af69654-2d89-44f3-857a-583b57844ca5

WCF Chunking / Streaming


Is this question really off topic?

Question: I am asking a reason from the scope of Hinduism for this question. Why did my question got closed?
why are eggs not consumed in hinduism
Comment: There has been a discussion about questions related to food: [Too Many "Is X Vegetarian" Questions](http://meta.hinduism.stackexchange.com/questions/263/too-many-is-x-vegetarian-questions). Personally, I don't think the question was repetitive though similar questions exist. Others don't seem to think so..
Answer: Edit: Now I've closed your question as a duplicate to a canonical question which is related to yours so that we don't have the same question with different food item names.

Your question was closed by me and one other user. The reason is defined already which says

"This question does not appear to be about Hindu religion, within the
  scope defined in the help center."

Initially your question was :

why is eating egg considered as non-vegetarian habit in hinduism

So attaching word Hinduism behind the question won't make it really about Hinduism, no doubt other users altered the title (7 revisions already) but still, your question doesn't add anything to the site, as @Bharat pointed out, its just another question about a food item which is already asked many times.
Hence you shouldn't feel discouraged with this, we are still in the beta stage. Many of the rules are yet to be decided, that what will be on topic, off topic, i.e scope for the site which will help us to keep the site neat and on topic with rich content which can be referred by future visitors. We don't want to scare them off with tons of similar food questions.
For now you can refer a community post over this, feel free to edit the answer or post a new answer if you want to.
What are Tamasic, Rajasic and Sattvic foods? [Intended to be community wiki]
Comment: now i have edited my question can i get it opened now
Comment: @agharehanabbas I'll decide soon.. mostly it wont but dont worry, you are not losing anything.. the question will stay as is...

Is this question really off topic?


How do I use a custom song?

Question: I just downloaded Geometry Dash off Google Play and I'm very happy with it; it's worth the money just from how fun it is playing the levels. But I'm also interested in making my own level using the Level Editor, though the problem is that I want my level to use a custom song instead of the songs in the game. Is there any possible way to upload and use my own custom song?
Comment: I think I may have already answered this one: http://gaming.stackexchange.com/a/236399/134751
Answer: Go to www.newgrounds.com, find a song, copy the last part of the URL at the top. That is the ID for the song. Next, go into the level editor and tap on the cog in the top right. Then, tap the custom button, and hit "New". Finally, type in the ID you copied into the text area that says "Enter song ID".

How do I use a custom song?


Change window size when opening pdf from archive manager

Question: On Ubuntu 20.04, when I open a pdf file directly from the archive manager when it is part of a zip file, the document viewer always displays that pdf file in a small window. I would like it to open by default in a maximized window. The document viewer is whatever is delivered by default in Ubuntu 20.04 fresh install.
If I open the pdf from the Files manager (Nautilus) using the document viewer—NOT from the archive manager—then document viewer opens by default in a maximized window.
Changing the window size of document viewer has no impact on the small, default window size when opening from archive manager.
I though perhaps there would be a .desktop file that controls the behavior, but I cannot determine if this is so. Nor can I find any place where preferences for either of the two applications are set.
Bottom line: how can I change the default window size to maximize when opening a pdf file using document viewer from within archive manager?
Answer: Evince appears to "remember" window sizes on a per file base. It is all very obscure and there is, frustratingly, little control on the window size.
Caveat The following options will act on all new Evince windows, not only those opened from an archive as asked.
Maximize using Devilspie
I use Devilspie2 to ensure that each Evince window (whether the PDF is in an archive or not) is maximized on opening. This is a little (and unfortunately old, unmaintained and poorly documented) daemon program. It watches when a new window is created. If the window matches a criterion  (e.g. it is an Evince window), then it will apply the rule you defined for these types of windows (i.e., the window is maximized).
• You can install Devilspie2 with the command sudo apt install devilspie2.
• You need to create a configuration file ~/.config/devilspie2/devilspie2.lua to define the rules.
This is my rule for Evince windows:
--Evince Document Viewer

if (not string.match(get_window_property("_NET_WM_STATE"),"_NET_WM_STATE_SKIP_PAGER") and get_application_name() == "Document Viewer" and get_window_name() ~= "Open Document" and get_window_name() ~= "Print" and get_window_name() ~= "Save As…" and get_window_name() ~= "Properties") then
   maximize();
end

The match criterion is rather complicated. It ensures that open and save dialogs, and PDF annotations, are not matched: for example, you do not want a maximized yellow note when you open one.
The action is very simple: maximize the window.
• For this to be enabled when you login, add devilspie to your autostart program. I found I need some delay for it to work, so my autostart command reads:
sh -c "sleep 8 && devilspie2 &"

Full screen via Evince command line option
Unfortunately, Evince has no command line option to start it maximized. However, there is a command line option to start it full screen. If that would be acceptable, you could launch Evince with the -f option. To achieve that, edit the .desktop launcher for Evince.
Comment: I ended up adding the -f parameter to the .desktop file.
Next, I opened a pdf file in that way pressed ESC and then resized the window. Then I removed the -f parameter.
The next time I opened a pdf from an archive, it opened in that new size of window - something that was NOT happening previously.
Answer: The workaround I found helpful is, when the document opens unmaximized, press Super+Up Arrow Key on your keyboard. This key combination maximizes the window.
Answer: The following two commands, executed in the terminal, work for me on Ubuntu 20.04 with Evince 3.36.10:
gsettings set org.gnome.Evince.Default window-ratio '(1920, 1080)'
gsettings set org.gnome.Evince.Default sizing-mode 'fit-page'

In the place of 1920, 1080, put in your screen size. After the first launch of Evince after that, it rewrites that ratio to something else (that still works).
Comment: Looks like a great trick.  Unfortunately it doesn't work (for me) on 22.04 (Wayland).  This is a deployment that was upgraded from 21.10, which didn't suffer from this issue...
Comment: @sxc731 This is a bug in 22.04.  The fix has been tested and should be released soon.  See https://bugs.launchpad.net/ubuntu/+source/evince/+bug/1969896
Comment: worked for me, 22.04 Wayland
Comment: It doesn't work on Ubuntu 20.04


How do I unhide the desktop folder in my home folder?

Question: I've tried How to unhide files on Mac?, and chflags nohidden not unhiding hidden files to no avail. I want to unhide ~/desktop while I have iCloud desktop turned on.
Answer: While you can unhide folders, you cannot unhide the Desktop or Documents folder when using Desktop iCloud. Both it and the Documents folder are hidden by having the com.apple.iCloud.desktop extended attribute applied, remove that attribute and you are no longer using iCloud Desktop/Documents folders.
You could do something like ln -s "$HOME/Desktop" "$HOME/Desktop " (note the space) if you want to see a folder in your home folder.
Comment: @unbeatable101, I have fixed the _shell command_ in lbutlr's answer so it would actually create a _symbolic link_. As it was originally written it would not work that way as quotes placed around `~` keeps it from expanding properly. `$HOME` is the better way in this use case.
Comment: When I type that in it just says dquote, what do I put there?
Comment: thanks, forgot that ~ don't expand in double quotes. ~/Desktop and ~/"Desktop " should also work.
Answer: Press ⇧ Shift + ⌘ Command + . . This key combination will display any hidden folders in your Mac's hard drive. Any hidden folders or files will appear as grayed-out. This keyboard shortcut can be done from any Finder window.
Comment: Yes that works, but is not what I wanted, that will make all folders hidden, I just wanted `~/desktop` unhidden.
Comment: Welcome to Ask Different! The OP stated "I've tried [How to unhide files on Mac?](https://apple.stackexchange.com/questions/309450/how-to-unhide-files-on-mac)," which happens to have that _keyboard shortcut_, so repeating it as an answer makes no sense! Please take the time to read and understand the question being asked before posting your answer.


US student participating in science research in the UK. What visa do I need?

Question: I am a US student planning to spend 8 weeks working in a university research lab in London during May and June 2017.  I am not traveling through any study-abroad program.  The primary investigator just agreed to let me spend 8 weeks gaining research experience.  It is unpaid.  I am confused as to whether I need a Tier 5 visa because I will be doing "unpaid work" or whether I do not because the gov.uk website says that people participating in academic research do not need a visa??  I don't think I qualify for a student visa because I am not enrolling in the university .
Comment: UK considers unpaid work as work. What you are doing is essentially work and many people have gotten into serious trouble including deportation and entry refusal for similar situations. Your situation is ad hoc since you're not part of a program. I don't think you even qualify for Tier 5
Comment: Is there any way you can operate remotely, and stay in the US? You could shift your hours so that you are awake on UK time, and do a lot of Skype, e-mail etc.
Comment: The research I will be doing isn't part of my degree.  So if it is then considered "work", I'll need a Tier 5 visa?
Comment: I am an undergraduate student, so I won't be on sabbatical leave, just summer break.
Answer: You want to spend some time (8 weeks) in a UK research lab, but not as part of any formal programme, to gain some research experience. You will not be paid.

What visa do I need?

You will need either a Tier 5 or Tier 2 visa.  The activity you described is not covered in the permitted activities for the Standard Visitor Visa.  The fact that you will not be paid is irrelevant and may even get the research lab in trouble for offering unpaid employment to an individual who is not an EU national.  It's a hefty fine for them to take you on without having permission from the government to do so. So be careful not to let them get caught!
Having said all of that, our sister site, Expats, will be able to answer further questions about specifically what kind of T2 or T5 you need.

The primary investigator just agreed to let me spend 8 weeks gaining
  research experience

Print out this answer and show it to the PI :)
Comment: Yes he NEEDS a Tier 2 or 5 however under the scenario described, does he even qualify? From the little I glean, the professor is looking to do things informally not through the school and it would not appear he is a Licensed sponsor nor does the OP have the qualifications for a T2 visa.


Preimage of open pathwise connected set is pathwise connected

Question: Is it a fact that under a continuous function, the preimage of an open, pathwise connected set is pathwise connected itself?
I'm trying to prove that $GL_n(\mathbb{C})$ is pathwise connected, without explicitly constructing paths.
Comment: In general, no. Consider a projection $\pi \colon \mathbb{Z}\times X \to X$.
Comment: Alright, thanks. Can you think of additional requirements that would turn it around?
Comment: Path-connected fibres. But that would just reduce the problem to show that $SL_n(\mathbb{C})$ is path connected.
Comment: Depending on what theory you can throw at it, you may be able to use the fact that the determinant is a nonconstant polynomial (hence holomorphic function), and the zero sets of those are too thin to separate the space. So if you have several complex variables or algebraic geometry to throw at it, you're done. Otherwise, rotate to make the first column a multiple of $e_1$, use the induction hypothesis to conclude.
Comment: Complex analysis is a possibility, but what is "too thin" supposed to mean? I believe I would have to prove, that for any $M \in \mathbb{C}$ with $|M| < \mathbb{R}$, the space $\mathbb{C} \setminus M$ is pathwise connected. I can't think of a way to do that right now..
Comment: Let's call a set $E$ "thin" when it is locally contained in the zero set of a nonconstant holomorphic function. If $D$ is an open connected subset of $\mathbb{C}^n$, then so is $D\setminus E$ for every thin set $E$. Should be in more or less every book on SCV; for example Range, chapter I, corollary 3.6.
Answer: No, the preimage of a (pathwise) connected set under a continuous map has no reason to be connected. For examples, consider the projection $\pi \colon X\times Y \to X$ where $Y$ is a discrete space (with more than one point), or maps with discrete domain (these are automatically continuous).

I'm trying to prove that $GL_n(ℂ)$ is pathwise connected, without explicitly constructing paths.

Depending on what counts as explicit, we can prove it more or less easily.
First way, almost explicit paths:
Let $A \in GL_n(\mathbb{C})$. Consider $\varphi \colon \mathbb{C} \to M_n(\mathbb{C});\; \varphi(z) = (1-z)\cdot A + z\cdot I$. Then $p = \det \circ \varphi$ is a polynomial (of degree $\leqslant n^2$) with $p(0) \neq 0 \neq p(1)$, hence has only finitely many zeros. Choose a path $\gamma$ in $\mathbb{C}$ from $0$ to $1$ that avoids the zeros of $p$.
Then $\varphi \circ \gamma$ is a path in $GL_n(\mathbb{C})$ connecting $A$ and $I$.
That was easy.
Second way, no paths, but heavy machinery:
Definition: Let $D \subset \mathbb{C}^n$ open. A subset $E \subset D$ is thin in $D$ if it is locally contained in the zero set of a non-constant holomorphic function, i.e.
$$\bigl(\forall x\in D\bigr) \bigl(\exists U \in \mathcal{V}(x)\bigr) \bigl(\exists f \in \mathcal{O}(U)\setminus\{0\}\bigr)\bigl(E\cap U \subset Z(f)\bigr).$$
Proposition: Let $D \subset \mathbb{C}^n$ open and connected. Let $E \subset D$ thin in $D$. Then $D \setminus E$ is connected.
The proposition is proved in most (hopefully) books on several complex variables, for example, it's corollary 3.6 in chapter I of Range's "Holomorphic Functions and Integral Representations in Several Complex Variables".
Armed with that heavy machinery, we now observe that $E = M_n(\mathbb{C}) \setminus GL_n(\mathbb{C})$ is the zero set of a non-constant holomorphic function (the determinant), hence thin. Therefore $GL_n(\mathbb{C}) = M_n(\mathbb{C}) \setminus E$ is connected, since the vector space $M_n(\mathbb{C})$ is connected. $GL_n(\mathbb{C})$ is also open, hence it is pathwise connected.


How do I upgrade to Mathematica 10.1?

Question: Is there a separate repository I need to add?
Has the 10.1 update been released for the raspberry pi platfrom?
Answer: 10.1 has not yet been release for Raspberry Pi. If you've recently done a sudo apt-get update, you can check the most recent release version with:
apt-cache policy wolfram-engine

This currently returns:
wolfram-engine:
  Installed: 10.0.2+2015020304
  Candidate: 10.0.2+2015020304
  Version table:
 *** 10.0.2+2015020304 0
        500 http://archive.raspberrypi.org/debian/ wheezy/main armhf Packages
        100 /var/lib/dpkg/status

which confirms:

10.0.2 is current release; and
it's in the standard archive.raspberrypi.org repo.
Answer: There is not a separate repository (there used to be but I think it was deprecated some time in late 2014).
If and when Mathematica is updated you may upgrade a Raspbian system with
sudo apt-get update && sudo apt-get install wolfram-engine

How do I upgrade to Mathematica 10.1?


How do I move the close and maximise buttons in gnome shell?

Question: I would like my window buttons to be elementary like with the close button on the left and maximise on the right with no minimise button. Gnome Tweak Tool seems to only allow me to move all buttons, not individual buttons. How can I achieve this? Thanks
Answer: In case you don't have gconf-editor: install it by this command
sudo apt-get install gconf-editor

After installing:

Press ALT + F2 to bring Dash command window
Type  gconf-editor in that window
After opening gconf-editor, Go to appps --> metacity --> general
Change the button_layout option to this value menu,close:maximize
Close the gconf-editor.
Answer: To achieve a close button on left and a maximize button on right of the title bar, Do this:

Open a terminal by using CTRL + ALT + T
Then write this command below and hit Enter
gsettings set org.gnome.shell.overrides button-layout 'close:maximize'

You're done. Here is a screenshot of the Opera browser window:


How to prove geometrically that the equilateral triangle inscribed inside a circle has the longest perimeter

Question: Please, help me! How do I prove geometrically that the equilateral triangle inscribed inside a circle has the longest perimeter? I'm really needing it and I'm lost
Comment: *Hint*: the triangle with the longest perimeter is isosceles on any base
Comment: Have a look at the related questions listed on the right
Comment: Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort.
Answer: you can express the area of the triangle by the radius of the circle and the angle between the radius,like $$A=\frac{1}{2}R^2\sin(\alpha)+\frac{1}{2}R^2\sin(\beta)+\frac{1}{2}R^2\sin(\gamma)=\frac{1}{2}R^2(\sin(\alpha)+\sin(\beta)+\sin(\gamma))$$ with the condition $$\alpha+\beta+\gamma=360^{\circ}$$
Answer: Let triangle $ABC$ be isosceles on base $BC$. Choose $D$ on circle $ABC$ such that $DC>AC=AB$. Join $DB, DC$, and let $DC$ cut $AB$ at $G$. Let the circle with center $B$ and radius $BD$ cut $BA$ at $F$, and circle with center $C$ and radius $CA$ cut $CD$ at $E$.
Then since triangles $BGD$ and $CGA$ are similar,$$\frac{BG}{CG}=\frac{BD}{CA}=\frac{BF}{CE}=\frac{BF-BG}{CE-CG}=\frac{GF}{GE}$$But$$\frac{BG}{CG}=\frac{GD}{GA}$$Therefore$$\frac{GF}{GE}=\frac{GD}{GA}$$

And since $DC>AB$ and $$\frac{GC}{GA}=\frac{GB}{GD}$$then $GA>GD$ [see Euclid V, 25]. And if from $GA>GD$ we take $GF<GE$, respectively, then remainder $AF>DE$.
Therefore $$(AB-DB)>(DC-AC)$$so that $$AB+AC>DB+DC$$and the isosceles triangle has the greatest perimeter of all triangles inscribed on a given chord in a given circle.
Next we must show that, of all isosceles triangles inscribed in a circle, the equilateral triangle has the greatest perimeter.
Given equilateral triangle $ABC$, let triangle $ADE$ be isosceles, with $AD>AB$ cutting $BC$ at $K$. Join $CE$, $BD$, and $CD$ cutting $AE$ at $M$. Let the circle with center $A$ and radius $AB$ cut $AD$ and $AE$ at $F$ and $H$, let circle with center $C$ and radius $CD$ cut $BC$ at $G$, and let circle with center $D$ and radius $DE$ cut $DC$ at $L$.
Then since triangles $KAB$ and $KCD$ are similar$$\frac{AB}{CD}=\frac{KB}{KD}=\frac{AF}{CG}=\frac{AK}{CK}=\frac{AF-AK}{CG-CK}=\frac{KF}{KG}$$
And since$$\frac{AK}{CK}=\frac{BK}{DK}$$and $AD>AB=BC$, then $KB>KD$ [see Euclid V, 25].

Therefore, $KF>KG$, and subtracting $KG<KF$ from $KB>KD$, respectively, then remainder$$BG>DF$$Hence$$(BC-DC)>(AD-AB)$$ making$$AB+BC>AD+DC$$And since in triangle $CDE$, $\angle DEC$ is obtuse (arc $DEC$ is less than a semicircle), then$$DC>DE$$making$$AB+BC>AD+DE$$ Finally, the same argument that proved $BG>DF$ proves $LC>EH$, making $$(DC-DE)>(AE-AC)$$ But$$AB+BC>AD+DC$$Therefore$$AB+BC+AC>AD+DE+AE$$
and the equilateral triangle has the greatest perimeter of all isosceles triangles, and consequently of all triangles, inscribed in a given circle.


Will transit time render Mars disease free?

Question: It's going to take us a few months to travel to mars in our spaceships.  Will the relatively small size of the ship combined with a few months of "isolation" result in Mars being disease free until either we build bigger ships or faster propulsion?
Comment: You may get sick from bacteria living normally on the surface or inside your body. For instance a bladder infection from escheria coli living in your lower intestine.
Comment: Lots of things (e.g. anthrax) can survive in spore form forever.  It only takes one teensy not-sterile thing, like a person's skin, to carry some bad stuff along.
Answer: Not completely, for a number of reasons, but in theory there should be less disease than on Earth.
Some diseases last for a very long time, like AIDS. Things like the flu will have a really hard time making it to Mars. Some diseases have few symptoms, which makes them easier to hide. Lastly, things in space just tend to end up really germy.
As a whole, with a bit of work, Mars could remain mostly disease free, however, proper precautions still must be taken.
For some comparison, the voyage time from Europe to North America was about 3 months early on. Disease still managed to cross that gap. No doubt the same thing would happen going to Mars, although I still suspect there would be less colds/ flu/ etc on Mars than on Earth.
Comment: For one example, varicella-zoster virus will have no trouble making it to Mars. Most people who've had chickenpox will carry it in latent form for the rest of their lives, and can transmit it if it ever reactivates as shingles.
Comment: @eckes: Some expeditions to Mir and the ISS have lasted longer than a Mars trip would.  Yet both stations had a thriving community of microbial flora, including various *Staph* and *Strep* species that act as opportunistic infections (normally living on hard surfaces and human skin, but dangerous when growing in the wrong parts of the body).
Comment: Not to mention that there are a myriad of species in the human microbiome https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4848870/  Any one of these could mutate to cause a disease.  Indeed, some dying off or becoming imbalanced WRT others can cause diseases.  Consider E. coli, for one notable instance: https://www.cdc.gov/ecoli/general/index.html
Comment: No sources and 4 upvotes?
Comment: What is supporting your conclusion? Also, what would be the pre-launch quarantine time for mars settlers as part of the "bit of work".
Comment: Those are some interesting additional bits. Many diseases could be cured by the distance, but as you mentioned, certainly not all of them.


New Electric range trips GFCI when plugged in - 4 wire, bonding strap removed

Question: I had an electrician install a 220v 40 amp circuit for a new electric range (Avanti DER20P3S) in the basement. The circuit is for a 4 wire (grounded) plug. I have wired the 4 wire plug to the range and removed the bonding strap from neutral to ground. The problem is, the breaker trips immediately when the range is plugged in, due to a ground fault. I have measured continuity with an Ohm Meter from neutral (white) to chassis ground on the range, and there is continuity measuring zero ohms AND the ground strap from Neutral to Chassis has been removed. Is this normal? Is the range incompatible with the GFCI? Keep in mind, the range works normally with a 3 wire connection with the bonding strap installed, as the GFCI can't detect the ground-fault to neutral. Is this an acceptable solution? Note the electrician said a GFCI is code for a basement 220v breaker. Thanks!!
Comment: The 2020 NEC has the requirement for 125-250v receptacles but not all states have adopted the 2020 code. For example in my state the 2020 code was just adopted but they did not adopt the new requirement for 240v receptacles to be GFCI protected. If your state is on the 2017 code the NEC only required 125v 15-20 amp receptacles to provide protected so unless your jurisdiction requires it or one of the 11 states that have adopted it it may not be required. (I ran into this in my state where they are NOT required but the electrician said it was). Other than that I would consult the mfg and report
Comment: The Avanti "DERP 20" range. It seems "[DERP](https://knowyourmeme.com/memes/derp)" doesn't have the same connotation in your country as it does in the USA. Of course, if it turns out that there's a wiring issue in the oven (as indicated by an answer), maybe it does... :)
Comment: BTW: are you OK with me reporting this issue to the US CPSC?
Comment: ...did I lose you?
Comment: @ThreePhaseEel Please do! Sorry for the delay. Happy to provide additional details as needed. If you need personal contact information, please message me at styopr1  (at sign) gmail  (dot) com  and  happy to provide
Comment: @Styopr -- don't need any contact info, but photos of the range's nameplate including serial # and/or datecode would be appreciated
Answer: TL;DR Neutral Not Used, but you may have an actual GROUND FAULT
Most cooktops/ovens/ranges made for use in the USA are combination 120V/240V devices. They typically use 240V for heating (more power!) and 120V for lights/controls/clock. However, there really is no need for 120V - it is a convenience and small (these days, very small) cost savings for the manufacturer, since they can use lights/controls/clocks designed for 120V. Modern lighting (especially LED) can run just as well using 240V supply as 120V. Modern controls are miniature computers, and just like most consumer computers can now handle a range from 100V to 250V, so can the electronics for ovens.
The catch, which seems to have confused Avanti, is that in the USA neutral and ground are almost the same. They are bonded in the main panel and have the same voltage (nominal 120V) relative to each hot wire. Plus, for historical reasons, there are receptacles/wiring methods that combine neutral and ground, even though that is not allowed any more on new circuits (new construction or new/changed installations in existing buildings).
They didn't know what to do about this. They needed to provide a ground - that is a key safety requirement. They thought they needed to use neutral, since every receptacle they connect to in the USA will have a neutral connection. And in some, grandfathered, cases, that neutral and ground will be one and the same.
However, in a new installation, ground and neutral are separate. More importantly, the newest installations now have a GFCI, which will detect an imbalance between the hots & neutral. With a GFCI, if any power comes in on a hot wire and goes out somewhere other than the other hot wire or neutral, the GFCI will trip. The place (except if the power is going through you, which is the real purpose of the GFCI) for that power to go is, naturally, ground.
The first step is to disconnect neutral. The diagram makes it clear that the only place neutral goes is to ground. Which means that if you leave neutral connected to the circuit, neutral and ground are bonded. That is not supposed to be the case. Since neutral is not actually used, the solution to that is to not use neutral - do not connect the neutral wire to the plug. That should have no effect on operation of the range, if everything else is done properly - i.e., the lights/controls/clock will still work since they are powered by 240V and not 120V.
Once that is done, if the GFCI still trips then there is indeed power leaking from one (or both) of the hot wires to ground. Otherwise known as a ground fault. Which is dangerous. Which is a manufacturing defect/warranty repair situation.
Now here is the complicating problem: The instructions clearly state that neutral is to be connected. So not connecting neutral would be OK for testing but not for actual permanent usage, as it violates the manufacturer's instructions, unless you can get the manufacturer to certify that it is OK (e.g., a letter from the engineering department). Which only leaves one other thing to consider, if you have not done so already: the "ground strap". The instructions state not just to unscrew it (which is typical) but to cut the ground strap:

Remove the ground strap from the frame of range and terminal by removing its screw and cutting is as shown.

If you have not done this, doing so may solve the problem. If you have already done so, then it sounds like there truly is a ground fault.
Note that the wiring diagram seems to indicate "Neutral to ground" as part of the normal installation and not as a removable ground strap. But it could be that the diagram is wrong.
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/123665/discussion-on-answer-by-manassehkatz-moving-2-codidact-new-electric-range-trips).


Can i connect Bluetooth headphones to PC with logitech (non unifying) reciever?

Question: so i have Windows 8.1 and don't have bluetooth on PC... I have Logitech reciever (it doesn't have bluetooth nor unifying logo) connected to PC.. is there way to connect them ? (It's from Logitech M185 mouse..)
Comment: If it doesn't have the bluetooth logo then it is a random proprietary device that only work with the device it was made for.
Answer: While booth Bluetooth devices and and Logitech's receiver operate in the 2,4 GHz band they are not interconnectable. Logitech is using its own proprietary protocol how Mokubai suggested in his comment.
The easiest solution would probably be to buy a simple usb bluetooth dongle. They are available relatively cheap nowadays.


How do I get ideas for licks assuming I already have a chord progression

Question: I have no idea what to play over a chord progression. I know my scales but I don't want to play scales up and down. How do I get licks ideas?
Comment: So many ways ! You could play the repeated chord progression and try to sing something over it. When you're happy with the singing, check what chord note you hit or not in order to learn the relationship between what you sang and the chord to gain some harmonic knowledge in the go.
Comment: Could you indicate what genre you have in mind. Different genre use different expressive techniques and that will determine the resources you can put into your licks
Comment: Maybe you'll get some inspiration while trying to solo on top of that chord progression.
Answer: Playing scales over chords that match is one method of generating ideas and one that is taught in some jazz improv methods.  It is not very "musical" but theoretically correct and for some it helps tune the ear to hear chord tones and passing tones relative to the progression.  It is not a bad idea to warm up this way.
A "lick" is a musical idea or motif.  While it may be true that licks can be found in scales one rarely thinks about the scales they are in when they play a lick.  The lick becomes the kernel of a musical idea, rather that the notes that make it.  I think that this is an important idea that is overlooked.  If you analyze the solos of some musicians you will no doubt discover that they fit on scales that match chords (with occasional chromatic passing tones...) etc.  But if you listen to those solos, and really listen, you start to hear multiple occurrences of the same melody line that might be 4 measure long.  Now you've discovered the motif used by that soloist, their own musical language.
Quite frankly sometimes these motifs are "forced" over the changes even when they are out (don't quite fit).  Jerry Coker has a book called Improvising Jazz that discusses the many ways that we approach this and recommends the "Lick based" or "motif based" approach.  He recommends keeping a diary of licks that you created or figured out by listening to other players.  You uses these as the foundation of solo ideas, experimenting with them over different chords and progressions.  This is very freeing.  Even though his book focuses on Jazz the idea works for any genre of music.
To my last sentence of the previous paragraph I will add that what makes Jazz sound Jazzy and Metal sound Metallic, etc, is "culture".  You need to immerse yourself in the cultural history of the music you like to get ideas that are consistent with that style.  This is the best way to learn music and to get ideas.  If you like Jazz then try and figure out a Wes Montgomery or Pat Martino solo (or someone more recent).  If it's Blues then listen to Buddy Guy, B B King, Robert Cray, etc.  And transcribe something, anything.  They are all playing the same set of motifs (at least as a starting point).
Answer: At the risk of sounding glib: why do you need to play a lick?
What's the point?
If can give some kind of answer to that question, you should have the starting point for figuring out what to do.
If you have a chord progression, you already have pitches and some relative pitch changes (voice leading.) That gives you a kind of prototype melodic material to work with. From this perspective a lot of your pitch material is set... so look to other musical elements or devices.
You can embellish the basic melodic skeleton. Of course that will introduce a bunch of new, subordinate pitch material, but I think more importantly it will necessitate something else: adding rhythm...

...I don't want to play scales up and down...

That is probably a very good impulse. Licks are not just going up and down the scale.
Think rhythmically, think articulation. Play with small groups of notes. Try contrasting groupings like 3 pitches in a rhythm of 4, or 2 pitches in a rhythm of 3 (sort like polyrhythms.) Try rhythmic variation before moving to new pitches. Explore articulations like playing a note straight and then bending up into it. Don't be afraid to repeat notes. You don't need to fly all over the fretboard to make a tasty lick.
That's a sort of musical fundamentals approach to think about licks. But also consider questions like what's the difference (if any) between a melody and a riff? How are phrases designed? Does the lick related to some other aspect of the song?
Answer: A 'lick' is just scale notes in a 'random' order. By random I mean not merely going up and down through a scale. It could actually be completely random - using scale notes, of course, and sometimes - serendipity - something good comes out!
A solid start note is 1 in whatever scale. Say you're in key A, and on a bar of E. That E note on the 1st beat always sounds good - one on one.Other good notes are other chord tones. On that E bar again, a 3 and a 5 will match exactly to that chord. So G♯ and B. Other notes in between can be (and often are) used. I call them 'stepping stones', and their best places are the non accented parts of bars, like anything not on beats 1 and 3.
That's a very basic start point. Another is to listen and copy what others have done. And realise that often, a 'motif' is repeated, to fit with another couple of bars on other chords, either note-wise or rhythm-wise.
Comment: Nothing "random" about it.  We're not random number generators, we're human!  It's a choice.
Comment: @ggcg - I think you're correct with reference to more experienced payers, but beginners, who maybe know the notes from a scale, could well play randomly. And to a degree, that's what makes their solos sound as they do - no particular form, just a lot of notes that maybe say not much, but still probably aren't 'out of tune'.
Comment: I think it's better to approach music from "lick" based learning then see how those fit into scales later.
Comment: @G - which is most likely what the vast majority of guitarists in particular do. But those who learn scales as such then need to put them to good use. Hence the sort of question we're on.
Answer:
Transcribe what other musicians have done over the same chord changes. When they play something you like, learn it, and practice playing it over that chord progression (transposed to all 12 keys).

To begin developing your own licks, play one (held) note per chord, but make a point of moving smoothly (stepwise) from one chord to the next. This will help you develop a sense of melody moving across chords. As you grow more proficient, move to two notes per chord, and so forth.

Take a familiar melody and modify/recompose it to play over the chord progression you're practicing.
Answer: Here are some ideas for you to play with:

As mentioned by ggcg in his excellent answer, target the chord tones, especially on the strong beats. This will give your "licks" a sense of purpose (they are played at the right time, not just at random). In particular, target the 3rd tone (and the 7th if you're playing tetrads). They tend to define the chord in a very unique way.

Having said that, don't just play chord tones. Add some passing notes. Otherwise your lick will not add anything over the harmony and it will feel hollow and soulless (I'm sure there's a better, technical word for what I'm trying to say).

Related to the above: often, chords in the same key will share notes. When you change chords, play a lick that includes some common notes and highlight the difference. Let's take a change from C - Am. Those 2 chords share the notes E and C. You could play a phrase that goes: E - B - C - G (over C major) x2 and move to E - B - C - A (when you change to A minor). You've just highlighted the chord change. (make sure B has a short duration because it's not a chord tone of either).

Once you have a target note in mind, play a phrase around it. For instance, if you're in G and targeting C, don't just play G - A - B - C. That's a scale. Think going "around" your target note like G - B - D - C. This may sound analytical, but it's up to you to experiment with.

Think expressivity. Depending on the genre, using resources like bends, hammer-ons and pull offs is essential to creating an expressive licks. A very classic rock riff involves bending the 4th tone up to the 5th tone, and then playing the 5th on the next string. It's a very simple lick but works wonders because of the expressivity of the bend. Other expressive techniques involve muting and playing with dynamics (volume).

Try double stops. Add 2 notes played at once sometime in your lick, for greater emphasis

Mixing both above: try unison bends. For instance, play a high E on the 12th fret, 1st string and a D on the 15th fret, 2nd string simultaneously, then bend the D up 1 tone to make it an E. That's a nice resource that you might have heard in some songs.

Highlight the chord change by playing double stops. For instance, play G and C over C major, moving to A and C over Am.

To "break free" from scales, try string skipping. In practical terms, this generally means using interval of 6ths, 7ths or 8ths. For instance, if you're playing an A on the 3rd string, jump to a G on the 1st string

Try "call and response": create a phrase, wait for some dramatic effect, and answer yourself with another lick

If you're playing major blues only: mix major and minor phrases. For instance, make a "call" in a major scale and a "response" in a minor scale. (Again, this applies mostly to blues and blues-influenced music. Not sure this will work in jazz or country, for instance).

If you're a pentatonic player: add some colour notes for extra flavour. This will move you out of the pentatonic and into one of the diatonic modes. For instance, if you're playing pentatonic minor, add a 6th. If you add a minor 6th, you'll get an Aeolian feel, but if you add a major 6th you get a Dorian feel (happier). Which one will you choose? Same thing with the 2nd: a minor 2nd will sound Phrygian (flamenco-like). You can solo using just the pentatonic to great effect (listen to SRV's "Tin Pan Alley" for that), but adding colour notes and breaking free of the pentatonic will add richness to your lick

As mentioned in other answers, listen to the players you like, transcribe their solos, or perhaps get some transcriptions. It's OK to read transcriptions, as long as you don't just do it mechanically but think about what resources the musician is using. Enjoy!
Answer: I'm just going to describe my own experience with learning to improvise and solo over chords. First I learned my scales, that's basic, and somewhat limited. Then I discovered a term called melodic patterns in a guitar book for jazz players. These were exercises that I practiced until I had them well established in my brain. At that point I noticed I could listen to a piece of music and I could hear places that those melodic patterns would fit. I also studied chord progressions and learned how to use common tones and leading tones that exist between one chord and another and I use this knowledge to move smoothly from harmonizing my improvized lead part to the chord progression I'm working with. Incidently, I don't play jazz, but I found this treasure trove of melodic patterns very valuable.
Answer: Use greek modes
If possible, remove the 3rd from the chord progression so you can play greek modes more freely
Consider making each chord duration as long as you can, so you have enough time to play different scales at the same chord before it changes
Add chromatic notes here and there once in a while
Comment: I'm sorry but this doesn't make much sense to me. Let's assume that the OP has a chord progression over C major. Are you telling him to play C mixolydian or C dorian or C phrygian licks over that progression? That can potentially sound dissonant over that chord progression. Removing the 3rd chord from the progression won't fix it. For instance, the V chord in the major (ionian) mode is major, whereas the V chord in the mixolydian mode is minor. The mode you play in determines the harmonic progressions you can get when sticking to diatonicity.
Comment: @ggcg agreed, dissonance can be good if you went for it deliberate. A "wrong note" is dissonant and sounds really bad. We might be saying the same thing in different ways to be honest...
Comment: Major scale is a Greek mode.  Not a great answer as it doesn't really address the question
Comment: This is true if you only use Ionian Mode. Lets use an example of chord progression: C, G, Am, F. This is a C Major scale harmonic field. By using Greek Modes, you can use other scales while playing melody. On chord C you can solo melodies with the following scales: A# major (dorian), C# major (phrygian), F major (lydian), G major (mixolydian), Am minor (Eolian). Check another example, Liquid Times by Kiko Loureiro. He uses many greek modes on athe same E chord. On My Turn (by Hoobastank), the guitar riff is in D Aeolian (F major scale), while the vocal's melody is on D mixolydian (G major).
Comment: These modes are no different, or are related to the Major scale.  Granted if you play them off their typical location within a key they will sound exotic.  But the blanket statement to use greek modes is not really helpful.  You get the same result playing the standard modes either in or off key.
Comment: "these modes are related to the major scale": that's exactly the concept of Greek Modes. All modes are related to a major scale.

"You get the same result playing the standard modes either in or off key": to understand Greek Modes you need to play a harmony along with the melody. Playing the 7 notes of a major scale alone without any sound in the background is not greek modes, it's just (as you said) playing a major scale, that's why you are feeling the sensation that Greek Modes sound the same.
Comment: Then what's the point of mentioning it?  The OP is already playing scales so what new information have you offered?
Comment: @mkorman, with all due respect dissonance can be good.
Comment: @ggcg
Let's hear OP Eliz Ho answer. He/she didn't say "i know all scales on all modes". I often hear students come to me saying "I know all scales" when actually they just mastered Ionian and the Harmonic Field from the main tone.
Comment: I never said that the op said that they know all the scales.   But they clearly said they don't just want to play scsles.  Adding more scales doesn't address the concern


Can we negate 'heaven forbid' in a conditional sentence like this: "If heaven didn't forbid it, I'd sleep with her"?

Question:
If heaven didn't forbid it, I'd sleep with her.

Based on what I read, heaven forbid is more common. But can you use its negative form?
Answer: Interesting question

Heaven forbid

is an idiomatic appeal for divine intervention to not allow something to happen

Heaven forbid that happen!

it should not be confused with (ending s )

Heaven forbids

which is a phrase which introduces an action that heaven has does not allow

Heaven forbids that to happen

Using your example sentence

Heaven forbid I sleep with that girl!
I hope I never sleep with that girl
Heaven forbids I sleep with that girl.
  I am not allowed by heaven to sleep with that girl

Opposites of Heaven forbid are

God willing
God willing they will be on time
Heaven help
Heaven help the little children

An official form or pledge of God willing is So help me God
Heaven help should not be confused with Heaven help us
An opposite of Heaven forbids is

Heaven allows
Heaven allows the sun to shine

In your sentence, if

If heaven didn't forbid it, I'd sleep with her.

is the negation, then

Heaven forbids (does not allow)

is the original sentence.
Comment: Another form of opposite is "God willing", although "God willing, I'll sleep with her" doesn't mean exactly the same as the questioner's sentence! I think you've hit the key point, though, which is that the questioner's proposed phrase in fact isn't a negation of "heaven forbid".
Comment: +1. The verb is marked to reflect that it's an appeal, as you have said. What is the negation of an appeal? To appeal for the opposite, or not to appeal?
Comment: Also it might be worth pointing out that Heaven is a substitute for God in these idioms. Some religions have more literal interpretations of "[taking the Lord's name in vain](https://en.m.wikipedia.org/wiki/Thou_shalt_not_take_the_name_of_the_Lord_thy_God_in_vain)" so the substitution is more pious.
Comment: That's a decent enough answer, but I think that @SteveJessop has the real answer with "God Willing". "Heaver forbid I sleep with that girl" is the opposite of "God willing, I sleep with that girl". In the first, they really don't want to and hope it doesn't happen, in the second it's the opposite.
Comment: I don't think I've ever heard *heaven help* in that context. "Heaven help the small children," to me, sounds literally like a prayer rather than an idiomatic expression that may or may not be a prayer. Meanwhile, *heaven help **me*** is an idiomatic expression—which means means either that you're going to do something you shouldn't (seeking assistance in resisting temptation), or else that you're doing something extremely difficult (seeking assistance in succeeding, which may take a miracle). *Heaven help me, I'm going to sleep with that girl* implies something **very** different!
Comment: *God willing*, as @SteveJessop suggests, is much more analogous.
Comment: @SteveJessop +1 Have added your suggestion
Comment: @KRyan: That particular usage does sound more like a prayer, but the general form is something I've heard as an idiom before.  Say you're talking about a dangerous condition somewhere.  You might add "And Heaven help anyone that stumbles into this without knowing [something]".  In that usage, it's just another way of saying "people who fit this description will have a Bad Time".
Answer: Heaven forbid is an idiomatic expression.
Heaven don't/didn't forbid is not an idiom  but you can certainly use it in the type of construction you have written.
Whether it sounds awkward or stilted is largely an opinion-based question. As a native speaker I don't consider it awkward, although I don't consider it to be common either.
Comment: It's grammatically correct but as a different native speaker I find it very awkward because it sounds like someone entirely failing to use the idiom correctly.  However, it would sound fine to me using the similar idiom, 'God forbid'.
Comment: @ssav As I said, *opinion-based*...
Comment: I wouldn't call it an idiom, so much as a use of the near-obsolete subjunctive mood. Its meaning can be taken fairly literally.
Comment: +1 but instead of "don't/didn't", I would say "doesn't".  Heaven is a singular place, a singular noun.  "Heaven forbid" is sort of a shortcut, for "May haven forbid!"  So, past tense isn't appropriate.  Should be "If Heaven doesn't/wouldn't forbid, then I will..."
Answer: Note that Heaven would only forbid very bad things, and that we don't have any good examples of things we know Heaven does actually forbid. It appears to reserve its forbidding powers for truly horrible things.

If heaven didn't forbid it, I'd sleep with her.

So this is saying that you think sleeping with her would be so terrible that Heaven actually forbids it, and that you would do it anyway otherwise.
I don't think that is what you want to say.
Answer: "heaven didn't forbid" is fine because it's a negative form of "heaven forbid", so people can figure out what it means from what the positive form means.
Comment: The distinction is not literal/figurative. "Heaven forbid" is not a *declarative* sentence.
Comment: I'm with @ssav - it isn't "wrong", but it's a very nonstandard usage.  I don't know about anyone else, but when I hear "Heaven forbid that ____", I don't literally think it means that *Heaven has forbidden ____*.
Comment: Hmm. I see where you're coming from as far as an idiomatic view, I was thinking from a colocation view. But colocations don't determine meaning, so I'm still off.


Why are anti aromatic compounds unstable?

Question: Just like aromatic compounds, anti aromatic compounds have several resonance structures and some of them are also conjugated ( 1,3-cyclobutene).
Why is it that just having 4n electrons makes them unstable?
Comment: The intricacies of aromacity are still being researched. From what I recall, it still not clear as to what exactly aromaticity is. There are  recurring features along aromatic compounds: electron delocalization, stability, and unreactivity. However, these are not completely understood. This is largely due to the fact that electron delocalization and localization is hard to measure directly (some even say that it is not measurable at all).
Comment: http://chemistry.stackexchange.com/questions/30927/what-is-the-justification-for-h%c3%bcckels-rule
Answer: In conjugated-pi ring systems of N atoms, you typically have a single low energy orbital and then paired (degenerate) energy levels until you have N orbitals total. This has to do with the number of nodes in the conjugated pi system, and the number of ways you can lay them out with N atoms.
Now, when you add in electrons you add two electrons per orbital, so your 4n+2 electrons fill 2n+1 orbitals -- the single low energy orbital and then n complete sets of degenerate pairs.
If you only have 4n electrons, you can fill the single low energy orbital, then 2(n-1) complete sets of degenerate pairs ... but with two "extra" electrons which aren't paired up. This allows those two electrons to "spread" out between the pair of equal-energy orbitals. Those unfilled/partially filled orbitals mean that the anti-aromatic compound is quite reactive.
The other issue is that "stability" is not an absolute property. Stability is always in reference to some other state. The typical anti-aromatic systems you'll encounter tend to have those frontier orbitals as non-bonding or anti-bonding orbitals, meaning the electrons in the orbitals aren't really contributing to the molecular stability. Generally, if you build the energy level diagrams for alternate systems (e.g. a bent ring where you don't get localization) you'll find that - while the lowest energy orbital isn't as low energy as in the ring-conjugated system - the sum of the energies across all orbitals is indeed lower. And it's the total energy of the system which is optimized. (For example, in cyclobutadiene the ring-conjugated form would have two electrons in a low-energy bonding orbital and two in non-bonding orbitals. In contrast, linear butadiene bonding orbitals are not as low energy as for the ring-conjugated cyclo form, but there's two of them. And the sum of the energies from two linear bonding orbitals is lower than what you get from a single cyclo bonding orbital.)
(Final note: this is all high-level generalization. There's more sophisticated levels of quantum mechanical theory where things get more complex.)


How do we view someone else's repo discussion on GitHub?

Question: I have navigated from one closed issue that has migrated to "Sluggish scrolling in notebook windows [monaco editor restore] #117644" because I am experiencing the same sluggish issues on a MBP. At the end of the thread there seems to be a work around, but no official answer.
I know there are discussions that can be enabled and may not be the best way to approach this particular problem, but I don't remember how to view someone else's discussion if it were enabled for a repo or a group of them.
Does anyone have a suggestion on the best way to handle finding an official answer or reaching out to someone that has made efforts to resolve an issue like one from a Microsoft repo?
Answer: For VSCode navigate back to main Microsoft repo, click on vscode, and scroll to the bottom to find the link


Orthonormal basis in every Hilbert space?

Question: Is it true that in every Hilbert space (not separable) there exists an orthonormal basis (complete and countable orthogonal system)? So equivalently asked can we have a Hilbert space in which it is not sufficient a countable set for which the closure of it's span to be the entirely Hilbert space?
Comment: It is true that every Hilbert space has an orthonormal basis (assuming the axiom of choice), but it is not true that every Hilbert space has a *countable* orthonormal basis.
Comment: A Hilbert space has a **countable** orthonormal basis if and only if it is separable.
Answer: If $H$ is the space of all functions from $[0,1] \to \mathbb R$ such that $\sum_{0\leq t \leq 1} |f(t)|^{2} <\infty$ with the inner product $\langle f, g \rangle =\sum_{0\leq t \leq 1} f(t)g(t)$ the  there is no countable orthonormal basis. A Hilbert space has a countable orthonormal basis iff it is separable. [In my example $\sum_{0\leq t \leq 1} |f(t)|^{2}$ is defined as the supremum of all finite sums. When this supremum is finite all but countable number of values $\{f(t),0\leq t \leq 1\}$ are zero which makes the definition of inner product meaningful. What I have done is to give explicit construction of a non -separable Hilbert space.
Answer: Let $H$ be a Hilbert space (and $H \ne \{0\}$).
Let $u \in H$ with $||u||=1$ and put $S_0 = \{u\}$. Then $S_0$ is an orthonormal systen in $H$.
Let $M$ be the set of all orthonormal systems $S$ with $S_0 \subseteq S$. On $M$ we can define an order relation by inclusion. By Zorn's Lemma, $M$ contains a maximal element, which is an orthonormal basis of $H$.
Comment: I think you relied on the title instead of reading the question fully. OP is asking for a countable ONB.
Comment: To clarify matters I did not downvote you. I am just trying to guess why you were downvoted. I still think you have not interpreted the question correctly. TH eOP does not know that countability of an ONB is tied to separability and he is asking if non-separable spaces also have countable ONB's. I am sorry if my interpretation is wrong. If I find a mistake in an answer I make a comment. I don't downvote.
Comment: Why the downvote ???????????????????????????
Comment: @Kavi: Hi, Sheriff. The OP asked: "Is it true that in every Hilbert space (not separable) there exists an orthonormal basis". In my answer I said: yes it is true (and I gave a short proof). So why you are beefing about my answer ????
Answer: Let $\mathcal{H}$ consist of all functions $x : S\rightarrow\mathbb{C}$ such that $x(s)=0$ except for at most countably many values of $x$, and such that $\|x\|^2=\sum_{s\in S}|x(s)|^2 < \infty$. Then $\mathcal{H}$ is a Hilbert space under $\langle x,y\rangle = \sum_{s\in S}x(s)\overline{y(s)}$. Let $e_s$ be the function that is $0$ except at $s$, where it is $1$. Then $\{ e_s \}_{s\in S}$ is an orthonormal basis of $\mathcal{H}$ with the same cardinality as $S$. $\mathcal{H}$ is separable iff $S$ is countable or finite.


Retrieve or reset the password for PostgreSQL on Linux

Question: I have installed Postgres on my Linux system. I forgot the admin password I want to reset the password. How can I do that?
Answer:
If you want to reset your password you need to go to the pg_hba.conf file. You can do this by giving in the following command into Linux.

sudo subl /etc/postgresql/12/main/pg_hba.conf

After gaining access to the file you must change all local locations from Method md5 to trust so you can enter Postgresql without permission or without being asked for a password.
Then place the following command into Linux:

sudo /etc/init.d/postgresql restart

Subsequently, run the succeeding command to get into PostgreSQL:

sudo -u postgres psql

And last but not least run the common SQL Command to reset the password for User:

ALTER USER postgres with PASSWORD 'anewremembrablepassword';

Of course, you could also use another user than postgres if you considerably created one. Make sure you go back to the pg_hba.conf file to change the methods back to md5 so you always give in a password as for better security or leave it and never give in a password.
I hope I could be helpful in solving this matter.
Thanks!
Comment: You should be more generic in your answer. For one, few distributions use System V init scripts these days.
Comment: For step 1, I found my pg_hba.conf in `/var/lib/pgsql/data/pg_hba.conf`

For step 2, `sudo systemctl restart postgresql.service`


How to send notifications to an Android device from a PC via USB?

Question: I have seen Pushbullet, but it works over the internet
Comment: Actually, I expect you could do this with Tasker. Use `adb` to send a "run task" event to Tasker, and make a "Notify" task in Tasker, reading the notification task out of the intent.
Comment: Should be possible utilizing `adb` and the `am` command – but I've never tried it, so I'm not sure what intent to call for that.
Comment: @Izzy You'd need to make an app to receive the intent and create the notification (or find an existing one).
Answer: You can use adb shell and Notify4Scripts
source: https://forum.xda-developers.com/showpost.php?p=69859668&postcount=18
date: 30th November 2016, 02:32 PM
Two years ago I was in need of a simple notification tool that could have been run by a command line in a script. So far the best I found was this thread and the tiny app made by corruptor64. That wasn't exactly what I was looking for so I finally decided to try to make the tool by myself. Starting from scratch (I am not an Android developer) in a few days of studying and developing I ended up with a working small app, that I named Notify4Scripts and I made it public only this past June, here on GitHub https://github.com/halnovemila/Notify4Scripts
Note that since the app is basically a service that has to be launched by the Android's shell "am" (activity manager) command, the Android system needs to be rooted first in order to be able to use such am command and have notify4scripts executed.
Answer: Try AirDroid3 ,I know you have specified this via USB but just in case you need to work with wireless setup.
Well with this you don't need USB cable to connect to your pc or mac. Airdroid3 on web as well as desktop client.
Notification Mirror is a feature introduced in AirDroid v2.0.9. It allows you to view all the app and system notifications on your computer. WhatsApp, WeChat, Line, Facebook, Twitter... all user and system app notifications are supported:
How to enable Notification mirror??

Go to Settings in AirDroid App>Notification Mirror>Notification Mirror Service:

Check the box next to AirDroid Notification mirror service and tap OK:

3.Setting is done now. You can go back to AirDroid Settings and create a test notification to see if it works:

A notification will pop up at the bottom right corner (you need to sign in to web.airdroid.com first):
You'll also receive a pop-up on your computer if you've signed in to AirDroid Windows/Mac:
If the service is working perfectly, you will get a notification on your Android as well as on your desktop (if you have AirDroid open in one of your browser windows.) saying "Awesome. AirDroid notification mirror service is working". The third option is "Allowed Apps".You can choose the apps whose notifications you want to receive on your desktop. For example, you might not want to get email notifications on your desktop if you already have an email client running on your computer, or you might not want notifications from gaming applications.
Note: To receive desktop notifications when you are not focusing on web.airdroid.com, you need to enable desktop notifications(and even choose the language in which you wish to be notified) on web.airdroid.com > Account > General:
Well it not only gives text notification but also you can send and receive notification for phone call and you can reply back with text message if u cannot pick up call when you are busy working or your phone is not around .You can see this in the links provided..
For more information check following links:
Android3 brings android device mirroring, desktop clients and more...
Airdroid3-how to control android device..
Offical Site oF AirDroid
Other Apps you can give try :

IF you don't need to go for browser based services You can try DeskNotifier with this currently your phone and PC need to be connected to the same WiFi network or via USB cable.
AndroidNotifier works with WiFi and Bluetooth only,

Hope This Helps!!!
Comment: @Izzy I have edited my answer .Hope this clears your doubt . I know OP explicitly wanted to work via USB but just in case OP is looking for better options..other than USB cable...I have suggested other apps also which are not browser based..Thanks for your suggestion for improvement..
Comment: Yupp, MUCH better. May I suggest a second check, to better meet the requirements? Wasn't there an option to use Airdroid via USB (or at least restrict it to the local WiFi)? I vaguely [remember something like that](http://help.airdroid.com/customer/portal/articles/1296187). Currently, it explicitly contradicts the requirements: OP definitely doesn't want to use Internet fpr that, but your recommendation of Airdroid requires to configure things via "web.airdroid.com"?
Answer: You can use adb + Termux + Termux:API like this:
<code>adb shell "export PREFIX='/data/data/com.termux/files/usr' ; export HOME='/data/data/com.termux/files/home' ; export LD_LIBRARY_PATH='/data/data/com.termux/files/usr/lib' ; export PATH="/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets" ; SHELL='/data/data/com.termux/files/usr/bin/bash'; cd $HOME ; /data/data/com.termux/files/usr/bin/bash termux-notification --sound --vibrate 500 -c 'test notification'"
</code>
source
TIP: I've wrapped the part of the command before "/usr/bin/bash" in a script, so i can easily launch similar Termux:API commands.


Is it plagiarism to use an item from another story in my own story?

Question: What if I use an item from another story in my story? For example, in my story there is a metal called adamantium which obviously came from the story of Wolverine.
Can it be considered plagiarism?
Comment: Diamantium, Edamamium, Defiantium, Grudgiulitum, Dreadfultium, Unillenium, Unknovrium... The possibilities are infinite. Don't get stuck with the trend.
Comment: ad·a·mant
(noun, ARCHAIC)
`a legendary rock or mineral to which many, often contradictory, properties were attributed, formerly associated with diamond or lodestone.` It's historical. If you said "unobtanium", that's plagiarism, but using a common legendary source that other stories have used is not plagiarism unless you specifically refer to it as that stuff Wolverine's claws are made of....
Answer: I would say your pretty safe using the word Adamantium. Specially since you have Adamantine (real) and Adamantite (fictional) as metals all derived from the word Adamant. All 3 words could be switched around without too much effect.
The word Adamantium also appears in Warhammer and Maplestory which are pretty large games.
Answer: Yes it could be considered plagiarism, but not under copyright infringement like your tags suggest. This would be an infringement on trademark. Copyright infringement would come from if you used the same story behind the metal, then that would be copyright infringement.
The trick here, if you want to avoid any risk of it being claimed as an infringement, is to just not use the same name if the base concept is common enough. For example, adamantium is just a REALLY durable metal. This concept has been around for hundreds if not thousands of years. Now, a pen that becomes a sword when uncapped however, that would be plagiarism even with a name change because there are enough layers to that which makes it specific and unique. A sword of energy that can cut through anything in front of it? Could be a lightsaber... or it could be the "flaming sword" wielded by the angel outside the gates of the Garden of Eden. I think you can piece together from here how to figure out what is and isn't potentially safe... but either way:
I am not a lawyer, so don't think of what I am saying to be legal advice please. Thank you!


Why do wavefronts curve in diffraction?

Question: I've already seen some answers here: Why are diffracted wave fronts drawn with curved edges in textbook diagrams, when according to Huygen's principle they should be straight lines?
and from what I've understood, with Huygens' original principle, you would have had just a straight wavefront propagating after the slit, as shown by the images in the post.
Instead, with the Huygens-Fresnel principle, we have a curved wavefront near the edges of the obstacle. Why exactly do Fresnel's changes to Huygens' principle allow for this curved wavefront? Why doesn't a plane wave have that curve at its edges too?
Comment: _"Why doesn't a plane wave have that curve at its edges too?"_ — plane wave doesn't have edges: it's extended to infinity
Comment: if it's extended to infinity then why isn't the wave itself infinitely large?
Comment: It is, why do you think it isn't? Plane wave is an ideal object, you'll never get one in real life. Or are you talking about the amplitude instead of spatial extent?
Comment: nono i was thinking about spatial extent. So to sumarize, the wavefront is the envelope of the secondary spherical wavelets produced by the wavefront. Since this envelope is curved in the case of diffracted waves, the wavefront gets curved at the edges, whereas in a plane wave, since you have an infinitely far away source (and thus extends to infinity), the envelope must be straight?
Answer: Look at the introduction in Wikipedia:

The Huygens–Fresnel principle (named after Dutch physicist Christiaan Huygens and French physicist Augustin-Jean Fresnel) is a method of analysis applied to problems of wave propagation both in the far-field limit and in near-field diffraction and also reflection. It states that every point on a wavefront is itself the source of spherical wavelets, and the secondary wavelets emanating from different points mutually interfere. The sum of these spherical wavelets forms the wavefront.

(bold mine)
The difference is that in the original Huygens principle

He assumed that the secondary waves traveled only in the "forward" direction and it is not explained in the theory why this is the case

The mathematical form of the secondary wavelets was  used correctly by the addition of Fresnel, so the phases were kept and thus diffraction can happen.
Comment: But why does fresnel's new principle make the curves at the edges of the wavefront?

Why do wavefronts curve in diffraction?


Closing many gnuplot -persist windows

Question: I just opened more than a hundred persistent graphing windows using gnuplot -persist with x11 on a RHEL desktop. Is there any easy way to close them all? I don't really want to logout/in or click through them manually.
Answer: To kill all Gnuplot processes:
pkill -x gnuplot

If you want to kill just the Gnuplot processes that were invoked with the -persist option:
pkill -fx 'gnuplot -persist.*'

If you want to close the windows without closing the Gnuplot processes (I think that's useless here because closing the windows causes the Gnuplot processes to exit), you can use wmctrl: wmctrl -c gnuplot closes all Gnuplot windows (more precisely, it sends a WM_DELETE_WINDOW message to all windows whose title contains gnuplot, which is the same as clicking the "close" button on all these windows). If you want to close only some of the Gnuplot windows, you can parse the output of wmctrl -l to find the window IDs that you want and close the windows with wmctrl -c or xkill -id.

Closing many gnuplot -persist windows


Can Safari copy both the URL and page title during a drag-and-drop?

Question: I frequently want to paste a URL and page title into a document or email message. When I drag and drop a URL from Safari and other browsers (by dragging the URL icon) I see the page title being dragged with the cursor. However, when I drop it in Terminal or in a Gmail message in plain text, I get the URL only and when I drop it in Textedit or in a Gmail message with rich text, I see the title only (with the link). Can I get both?
Answer: Byword seems to do that by default:

It's not really drag and drop, but you could also assign a shortcut to a script like this:
<code>tell application "Safari" to tell document 1
    set the clipboard to "[" & name & "](" & URL & ")"
end tell
</code>
Comment: +1 for the AppleScript solution, which is actually better than drag and drop. Thanks.
Answer: If you paste into an OS X app that accepts rich text input (i.e. not a web app like gmail), you'll get the title as text with the URL as the link to that text—try it in TextEdit. If you need the title and URL as plaintext, you could use an AppleScript like this one that will copy the URL and title of the active Safari tab to the clipboard (you may want to change the formatting to your liking).


Can I return to America if I used my Philippine passport although I am an American citizen?

Question: I used my Philippine passport to book an airline ticket, but I'm also an American citizen. Will this create problems with immigration?
Comment: You will likely need to show the USA passport to board your flight to America, otherwise the airline (and Philippine border control) will expect you to have a visa to go with your Philippines passport.
Answer: You should use your US passport on your flight registration, and to check in.  This will ensure that US Customs and Border Protection realizes that you are a US citizen and, of course, that no special authorization is required for your admission.
Other posters will state that as a US citizen, you have a right of entry, and of course, this is true, but if there is any doubt about your citizenship when you present yourself, you may endure delays while your citizenship is established.  Also, the airline may refuse to carry you if it has any doubt of your US citizenship, so you may not have the opportunity to plead your case in the United States.  A US passport categorically proves your US citizenship.  (Note that a birth certificate by itself does not; some US citizens do give up their citizenship voluntarily, for example, to avoid having to continue making US tax filings after becoming expatriates.)
Get a US passport, if you don't already have one.  If time precludes you from getting one, and you have a recently expired one, bring that as your evidence.  But I strongly encourage you to use a current US passport to enter the US each and every time you do so.  (A few other current valid methods can be used when crossing the land border, but they aren't relevant to this question.)
Comment: This is a great point that I overlooked in my answer.  For any flight to the US, you should check in with your US passport, even if you gave the other passport details when you bought the ticket, made the reservation, or checked in for an earlier flight on the same ticket or reservation.  In addition to the birth certificate not being definitive proof of US citizenship, it does not satisfy the statutory requirement that US citizens who enter and leave the US must "bear" a valid US passport.  There are exceptions, but a birth certificate is not among them.
Answer:
Can I return to America if I used my Philippine passport although I am an American citizen?

Yes.

Will this create problems with immigration?

Probably not.
The US Supreme Court had decided in 1967 that US citizens cannot be deprived of their US citizenship against their will.  The case is Afroyim v. Rusk:

... the [14th] Amendment can most reasonably be read as defining a citizenship which a citizen keeps unless he voluntarily relinquishes it. Once acquired, this Fourteenth Amendment citizenship was not to be shifted, canceled, or diluted at the will of the Federal Government, the States, or any other governmental unit.

In addition, a central right of US citizenship is a right to return to the United States.  If you are a US citizen, immigration officers cannot refuse entry.
However, I answered "probably not" because I have heard a few stories of people being challenged by US immigration officers on the basis of their dual citizenship.  My sister, for example, was once told by a US immigration officer that it is "unconstitutional" for her to have a passport of another country.
I have also read online of people being told at the land border with Canada that they need to renounce their US citizenship if they hold another passport.  Such officers are not acting according to government policy.  If any officer of the US government says anything like this to you, you should refuse to comply.
Edit:
Jim MacKenzie makes an excellent practical point in his answer regarding the practical aspects of traveling with two passports.  For more information, see these questions on this site:

I have two passports/nationalities. How do I use them when I travel?
What is the penalty for US citizens entering/leaving the US on a foreign passport?
Comment: @SebastiaanvandenBroek hmm, good point.  No, I actually meant *no,* but I meant to respond to the question at the end of the body, not the one in the title.  I will edit to clarify.
Comment: So you actually mean... yes?


Car Insurance cover for travelling to work

Question: Does anyone know if travelling to work used to be included in Social Domestic and Pleasure car insurance please.
Comment: Insurance question are country and maybe even state/province specific. Please specify your location.
Comment: The particular phrase is used in UK car insurance, but I agree we need asker to clarify.
Comment: Yeah. I have i.e. never heard of Social Dmoestic or Pleasure - and going to work is "normal social use" where I live, i.e. you are so to say taking your own car to work and back home. Also this may be insurance specific - so instead of asking US - ask either the insurance, or read the insurance documentation (which, I agree, is often quite a read).
Comment: By traveling to work, are you going to fixed place AKA an office or will you be going to different locations like a salesperson or an at-home nurse?
Answer: In the UK, Social Domestic and Pleasure does not cover any form of driving for work.
If you want commuting to a fixed place of work, then make sure you add that to the policy.  Driving to several different sites is business travel, and so a different thing again.


How is the CSV file in table rate shipping parsed

Question: In Magento 2, I want to know how the CSV file that we upload to table rate shipping parsed in code. For example, is it directly opened as a text stream and searched using PHP, or is it loaded to a temporary table and filtered via SQL. Also, what is the advantage of preferring one method over the other?
Answer: You can download sample csv in magento through admin section.
please switch to website from scope. so, you can find option to download sample csv.
in global scope this option not visible
see link - https://prnt.sc/1u1fskq
<code>Country Region/State    Zip/Postal Code Weight (and above)  Shipping Price

US         *               3000                                 10
</code>


Best way to get the IP address of client is req.ip or req.connection.remoteAddress?

Question: I'm wondering what the best way to get the IP Address of a client from my express application is, as SOF and docs show req.ip & req.connection.remoteAddress. Not sure what the difference is and which is the one I should use.
Answer: req.ip will try to resolve the actual client IP-address by also taking into account headers that are set by proxy servers indicating the origin (client) of the request (although this will only be done if the trust proxy setting is explicitly enabled).
req.connection.remoteAddress will contain the IP-address of the client making the request, which in case of a proxy server will be the proxy's IP-address and not the one from the client on whose behalf the proxy is forwarding the request.
If you're using a reverse proxy that is forwarding requests to your Express server, req.ip and enabling trust proxy is the best solution. Otherwise, just plain req.ip will still do.
Answer: best way to get users IP is req.headers['x-forwarded-for'] || req.connection.remoteAddress;
like this var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
because may be you will use middleware (or most common used proxy) servers (like Cloudflare) for security reasons and if you use req.connection.remoteAddress it will send your middleware servers IP address everytime, but you can use x-forwarded-for header and req.connection.remoteAddress or req.ip together.
for more information read about x-forwarded-for http header
EDIT
as mentioned in comments below best practice to use req.ip || req.connection.remoteAddress; because even if you use app without proxy, in future you can use it with proxy, and with method above you can use your application without changing it.
Comment: I'm not using a proxy, so if not using a proxy which should I use, and also if I am using a proxy in the future which should I use? (if you can edit your answer to fit what I just asked it will help future people that run into the same problem.)
Comment: Be careful though, as I understand it the `x-forwaded-for` header may contain more than one ip (if your express app is behind a proxy for example). So I guess sticking to `req.ip` is the way to go
Comment: @lascort, thanks for comment, I learned too and updated my answer for other users.