Comparing pre and post test raw scores with one subject

Question: I am currently in the process of trying to analyze data from research carried out. I am analyzing whether a music intervention showed improvements in rate, accuracy, fluency, and comprehension on a single subject. I have used the Gray Oral Reading Test, which yields raw scores for rate, accuracy, fluency and comprehension. I want to compare those raw scores from the pretest in those four categories to the raw scores from the posttest in those four categories to see if there was a significant difference. I am not sure since I used only one subject if data analysis could be performed. If not what is appropriate to use in this case to compare the two sets of raw scores from each category?
Comment: Data analyses performed on single subjects are called "case studies" by those who do them and "anecdotes" by those who read about them.  They rarely benefit from formal statistical testing.
Comment: It sounds like you are seeking a test of significance for pre-post performance on the GORT. However, I don't understand this phrase, "I am not sure since I used only one subject if data analysis could be performed." Would you clarify what you mean by this statement?
Comment: Thank you for responding to my question. That is exactly what I meant by the one subject is that I only had one participant hence my research is really a case study.
Answer: I think whuber's comment about case studies rarely benefiting from formal testing is spot on. Still, as a thought exercise, I describe below some potential methods for formal testing one could consider.
Approach 1: There is a method to construct a confidence interval based on a single observation, which is described here: What can we say about population mean from a sample size of 1?
The method could in principle be used for hypothesis testing: If a 95% confidence interval excludes a particular value, $\theta$, then this is equivalent to rejecting the corresponding null hypothesis (that the true value is $\theta$) at $\alpha = .05$.
How could this be used in your case? Let $x$ be the amount of change on one of those 4 outcomes. Now you can use the method to construct a confidence interval for the true amount of change with $x \pm 9.68 |x|$ that has (at least) 95% coverage. If 0 is not included in that interval, then you could in principle reject the null hypothesis that the intervention has no effect.
However, that method will never allow you to reject that null hypothesis, since $x \pm 9.68 |x|$ will always include 0.
Approach 2: Here is another approach to consider. If the intervention has no effect, there is a 50/50 chance whether a score will go up or down by chance alone (for simplicity, let me exclude the possibility of exactly no change). But now suppose the scores improve on all four outcomes. If all four outcomes were independent, then we can easily calculate the chances of this happening under the null hypothesis (that the true chances of an increase are 50%) based on the binomial distribution: Namely $.5^4 = 0.0625$. That would be the one-sided p-value based on a sign test. That is not below $\alpha = .05$, so even in this most extreme case you would not be able to reject the null hypothesis at this conventionally used level. Moreover, this test assumes that the four outcomes are independent, which most surely is not the case.
Approach 3: Apparently, for rate, accuracy, fluency, and comprehension, the Gray Oral Reading Test provides "scaled scores having a mean of 10 and a standard deviation of 3." So let $x_B$ and $x_A$ denote the before and after scores on one of those outcomes. So, if the intervention has no effect, we could use $$z = \frac{x_A - x_B}{3 \sqrt{2(1-\rho)}}$$ as a test statistic to test if the true change is zero. Here, $\rho$ is the true correlation between before- and after-intervention scores on that particular outcome.
The denominator is the SD of the changes score, which is easy to derive from the fact that $Var(x_A - x_B) = Var(x_A) + Var(x_B) - 2Cov(x_A,x_B)$ and the covariance is $Cov(x_A,x_B) = \rho SD(x_A) SD(x_B)$. Here, we know that $Var(x_A) = Var(x_B) = 9$. The rest is simple algebra.
But you don't know $\rho$. Most surely, it will be positive, but you don't know how large it would be if you were to apply your intervention to a large sample of subjects. You can consider some 'what-if' scenarios, so, for example, if $\rho = .5$, then $z = (x_A - x_B) / 3$. For a one-sided z-test to be significant at $\alpha = .05$, $z$ must be equal to or larger than $1.645$. That would only be the case if $x_A - x_B \ge 3 \times 1.645 = 4.935$.
Assuming that we exclude the possibility that $\rho$ could be negative, the most conservative test is obtained when we assume that $\rho=0$. If you obtain $z \ge 1.645$ even then, you could argue that the null hypothesis of no improvement due to the intervention can be rejected. But this would require that the improvement is larger than $3 \times \sqrt{2} \times 1.645 = 6.979$, which would require a dramatic improvement due to the intervention.
Conclusion: But I would say that the there really isn't much you can do in terms of testing. And I don't think with a single subject, that should be the goal. I would just present the raw data (maybe in terms of a before vs. after graph) and just discuss what you see.
Comment: Excellent points. Would there be a fourth approach? For instance, in chap 13 of Gelman and Hill, they address this issue from a Bayesian framework, arguing that with an appropriate prior and an *n=1*, testing is possible on the posterior distribution.
Comment: @DJohnson Sure, if one brings in additional external information (e.g., via priors), one could do other things. But in the end, I would still suggest to just plot the data and leave it at that.


Building up worn steel via plating or other method?

Question: I've asked several people and gotten mixed answers, so I've decided to post the question here. Can steel be electroplated onto steel to build up worn surface areas (I'm talking about less than a millimeter). For example, could a worn knife edge be electroplated back on? I know for large worn areas, hardfacing is used. What, if any, technique can be used to rebuild small, worn steel surfaces?
Comment: What kind of object is this? Are we talking about an actual knife edge? Or a wear surface? Made of any old steel? Or made of carefully selected, forged, and heat-treated steel? The type of wear and hardness that matters for a knife is not the same as that for a bearing surface.
Answer: For specifically a knife edge - no. A steel blade is iron but with specific amounts of carbon ,manganese, chrome , and possible other alloy elements. They either do not , or do not predictably transfer in electroplate. Then it would need to be heat treated. Steel build-up is done with welding processes. I once built up lawnmower blades edge with steel hardfacing. The weld left a smooth rounded surface which was nearly impossible to grind to a cutting edge. So welding is not useful either.
Comment: Thank you. What is the smallest object that could be hardfaced?
Comment: @Justify obviously larger than a lawnmower blade.
Comment: Hard chrome and flame spray ( eg. D-Gun) can be put on thin steel. The devil is in the details.
Answer: building up worn parts like the bearing surfaces of a crankshaft is commonly done by electroplating- after plating, the part is then finish-ground to the exact size required. But note that there is a risk of ruining the fatigue resistance of the built-up part if the electroplating process happened to generate hydrogen on the plated part. This will diffuse into any microcracks in the part's surface and significantly embrittle it.
BTW hard-faced lawnmower blades are almost impossible to grind on purpose, because they are supposed to be abrasion-resistant. You have to use diamond grinding wheels to sharpen hardened parts like that.
BTW^2 a clever trick on a mower blade is to hard-surface only one side of the blade. the hard-surfaced side is more resistant to abrasion than the other side, which takes most of the wear, and leaves behind a sharp edge consisting of the hard-surfacing. This can also be done by sputtering a metal like tungsten onto one side of the blade- yielding a so-called "self-sharpening* blade!
Comment: Thanks for your reply. (Maybe dumb) question: If surfaces can be built up and replated, can that be done multiple times? I.e., can historic engines be kept running for centuries using these techniques?
Comment: Plating up a worn out crank or camshaft can double the useful lifetime of the part, but after the second teardown there might not be enough thickness left in the cylinder walls to support another reboring unless the engine was designed for truck use. This usually means the end of the engine unless it is exceptionally rare or valuable, so the replatability of the crank is not the deciding factor.
Comment: I could have sworn I saw antique cars with engine repair sleeves.
Comment: @justify, some engines can be *re-sleeved* in this manner, or their cylinder pulled completely off and replaced with new (old air-cooled VW's), others cannot.


Is there a way to set Google Voice as default tel protocol handler?

Question: I would like to be able to click tel links in my web browser (Firefox 70.0.1) and have it launch voice.google.com, with the phone number populated in the dialer so that I can then dial the number via my phone (which also has Google Voice). Is this currently possible?
Answer: As of 23 Feb 2022, Google provides instructions to Use one-click dialing on Google Voice
.
Prior to that, in Chrome, I was able to register Google Voice to handle tel: links by running the following code via Developer Tools > Console.
window.navigator.registerProtocolHandler("tel", "https://voice.google.com/u/0/calls?a=nc,%s","phone");

Comment: Wow, for Brave (based on Chrome), I could not find how to do this anywhere. Even brave://settings/handlers?search=protocol+handlers didn't give an option. What worked was: open a tab to https://voice.google.com/u/0/messages . Then open the dev tools and run this in the console: `window.navigator.registerProtocolHandler("tel", "https://voice.google.com/u/0/calls?a=nc,%s","phone");` I accepted the prompt, and now brave://settings/handlers?search=protocol+handlers shows that `tel:` is handled by voice.google.com. Thanks!
Comment: Here I am again, and I was excited that this SuperUser answer appeared in my search results, and then I found myself saying "This commenter wrote a really helpful comment" and was pleasantly surprised to see it was my past self. Note-taking for the win.
Answer: NOTE I'm on a Mac but should work for Windows as well with some verbiage changes.
I've found a way to do this in Firefox without any extensions.

Type "about:support" in the search bar.
You'll have troubleshooting information displayed along with a grid titled "Application Basics"
Find the one labeled "Profile Folder" and click the "Show in Finder" button
In the window that opens, find the handler.json file and edit it using your preferred editor.
In the "schemes" section, add the following code (I placed mine after the "mailto" portion ensuring all the tabs lined up).

  "tel":
    {
        "handlers":
        [
            {
                "name": "Google Voice",
                "uriTemplate": "https://voice.google.com/u/0/calls?a=nc,%s"
            }
        ],
    },

Save your changes, quit and reload your browser.

You may or may not be prompted to pick the application (mine gave me the option of Facetime or Google Voice), I picked Google Voice and "Remember this choice". It immediately opened a tab and proceeded to complete the call. When I reviewed the file again, there was an "action": 2 added. My guess would be due to my picking the 2nd option and "remember".
Screenshot included for your reference.
Comment: I think this is the exact answer that user ETL is looking for!
Answer: I was not able to do that without adding a browser extension. Since I use Chromium, I used https://chrome.google.com/webstore/detail/google-voice-by-google/kcnhkahnjcbndmmehfkdnkjomaanaooo?hl=en
Firefox extensions for Google are listed here but I did not find one offering click-to-dial into gVoice after searching through 31 screens of extensions.
Comment: @ETL, if you found this answer useful please click on the up Arrow Head to the left of the beginning of the answer. When all is said and done give any answer provides information that solves your problem then please click the check mark at left
Comment: Thanks for doing that research! I'll check out if that extension can be ported to Firefox via Chrome-Store-Foxified.


Making Gmail the default mail app made sharing via Email disappear from Photos app?

Question: I would like use the "Share" menu in Photos to share photos via email. This was by default bringing up the Mail app, but I don't use that and would prefer to have things simply open in Gmail in my browser (Chrome).
I was able to configure GMail as my default mail reader by letting GMail set itself up as the default mail handler in Chrome, and then going to Apple Mail and configuring the "Default email reader" to "Google Chrome", like this:

Great! I thought I was all set.  Unfortunately, when I try to use the "Share..." menu in Apple Photos, "Email" is no longer an option. It has simply disappeared:

Is there any way to get the "Email..." share option to show up when using Gmail (via Chrome) as my default mail reader?
Answer: Correct.
Extensions in the Share menu are provided by the application.  You set something other than Mail.app as the email client, so the Share target disappeared.
I doubt the web browser is providing a Share extension.


Learning Linux beginning from novice

Question: This may sound a very stupid question, but I have been using Linux for over an year and I am still using it just like Windows. I have absolutely no idea on how to learn more about bash or other Linux internals. Can anyone help me with it? Guide me with how to proceed with learning more about Linux and experiencing its full strength as they call it.
Comment: In more than a year you never thought to Google for some of the millions of Linux tutorials, or buy a book or two? If you won't help yourself you really can't expect us to do it for you.
Comment: Is there something wrong with using it 'just like windows'? After all, a great deal of effort went into making the UI enough like Windows that it seems familiar. *If you really wanted* to learn some of the things that Linux does differently, you have had ample time to find out. Maybe you don't have any reason to learn "its full strength"
Comment: The question may be a bit generic, but someone needs to start somewhere, which will sometimes be serverfault.
Comment: And when they start at serverfault, they will be told that this is not the place to start, as they would have known had they read the text on what to ask/not to ask here.
Answer: You need some quick and high return projects to work on.
If you'd like to learn about the behind the scenes aspects let me suggest that you install a server version of *nix.  Ubuntu 9.10 Server edition is a solid choice.  Then choose projects to work on that aren't overly complicated and will provide you with a high yield of experience in a short period of time.
Here are the projects that I typically suggest when I hire new staff members who have little or no experience with Linux (in order of complication):

install and configure ssh with a banner and limited user access
install and configure vsftpd, verify it works for local users
install a Lamp environment and set up two virtual hosts
create a user that has sudo privileges to restart apache and mysql
create a bash script that will backup and gzip you database files.
study your log files (install and config Logwatch for help)

As for bash specifics there are oddles of books and sources on the topic.  Try the following projects:

find the first 100 prime numbers
organize a flat file with dates - remove slashes and split into columns
create a bash script and echo the results to an email address using a cron.

Final point, be creative with your projects.  You'll learn more if you pick what seems fun rather than hard.  Eventually the hard projects will be fun because the learning curve will be low from all of your previous experience.
Comment: I think the approach of practical projects as exercises is a great way to avoid feeling overwhelmed. Trying to learn everything about Linux is quite daunting. This also helps you learn which commands do I need learn every little bit about, and which do I need to just know they exist.
Comment: I'd propose (maybe for later) setting up a mail and jabber server, a simple blog, dynamic DNS and such. For home - dlna, transmission + web interface, samba/nfs.
Answer: You need to generate ideas about what do you want to do from the command line.
Think about the applications (like building a media server/mail server ) or something that would expose you to the finer details of the linux system.
Secondly you can hang around in linux forums (like ubuntu forums ) and try to solve the problems posted there, thereby learning and helping the cause at the same time.I am not saying you'll be able to understand/do everything that is posted in these forums, but you'll learn in the process - our primary motive.
Answer: You could start here for example. Honestly, if you just type "Linux command line" in Google, you'll get tons of interesting things to look at. Also, I think this question would be better asked on superuser.
Answer: There are already some good answers on Server Fault on this topic. Here are two post that give you resources to learn from:

"Learning" Linux
Resources for beginning Linux administrators

And here is a post which expresses some difficulties when changing from Windows to Linux:
As a Windows administrator, what were the issues you encountered with trying to learn a linux distro?
This might give you some hints about where to start learning.
Answer: I'd recommend magazines to get a feel for what happens in linux land, though I don't know where you live. LWN is available everywhere.
For administration specifically, I recommend following some of the tutorials on debian administration.

Learning Linux beginning from novice


Dielectric breakdown voltage of air vs electric field during a thunderstorm

Question: The dielectric strength of air (ie. the maximum electric field that the material can withstand under ideal conditions without undergoing electrical breakdown and becoming electrically conductive) is 3 MV/m (according to wikipedia). I have read many articles where, to protect some facilities from lightning as in the Kennedy Space Center, the electric field's magnitude is measured by instruments called electric field mills, and where lightning is considered to be possible from a certain threshold. This threshold is generally taken between 1kV/m and 3kV/m (see page 4 of this article), which is not even close to the 3 MV/m needed to make air electrically conductive. Is there any reason for this apparent contradiction?
Thanks.
Comment: Although, really, it is hard to get much above 300 to 400kV in air, regardless of standoff distance. You might not get a lightning bolt, but you will get enough leakage to be a problem sustaining the voltage.
Answer: I would like to start with the fact that your question is directly related to the main unsolved problem of atmospheric electricity, i.e., lightning initiation. Specifically, as you mentioned, while electric breakdown of air requires a huge electric field, decades of balloon measurements of the electric field in thunderclouds, e.g., Dwyer & Uman, The physics of lightning, Physics Reports, 534, 147–241, 2014, p. 167 have failed to find electric field strengths large enough to make the electric discharge we routinely observe inside the thunderclouds in the form of lightning. The range of electric fields measured is generally 1-2 orders of magnitude less than the breakdown field. The important distinction to make here is the fact that by the time the thundercloud electric field is close to the breakdown field, the (lightning) discharge has most probably already started. Lightning occurs in various steps, one of them being the streamer to leader transition. Streamers are very small nonthermal gas discharges that are present ahead of the lightning leader (the huge branches of the lightning flash that we observe exiting the clouds or traveling through the clouds). Its been already demonstrated that streamers can propagate in electric fields below the breakdown electric field and therefore, may contribute to generation of lightning.
Another way to understand the lightning initiation process is very similar to the amplification of the background electric field on the surface of a conductor. We know from electromagnetic theory that the electric field on the conductor may be $\sim 3$ times the background field. One of the ideas for solving the lightning initiation problem considers hydrometeors, i.e., liquid or ice particles in clouds. The idea is that the presence of hydrometeors locally enhances the field near their surfaces, both due to charges residing on them and due to their polarization. The local increase of field then can lead to electrical breakdown (e.g., Jansky and Pasko, 2020).
I hope this provides the answer to your question. Please let me know if anything is unclear or you have other questions.


Dell DA200 Adapter not working on Ubuntu

Question: I have Dell XPS15, dual booting with Windows 10 and Ubuntu 16.04 LTS (novice to Linux), which came with a Type-C USB. I just bought a Dell DA200 adapter for the USB which works on Windows but doesn't on Ubuntu 16.04 LTS. I checked by running 'lsusb' with and without the adapter and confirmed the problem. Could someone please suggest a solution? Thank you.
Answer: contrary to what the other answers to this question suggest, the da200 adapter is not a displaylink device (unlike its predecessor, i believe). it's a "docking station" adapter that connects to the usb-c port, and provides hdmi, vga, ethernet, and usb ports.
currently there seems to be a problem with the graphics on this device. the laptop does see an external screen, but it will remain black. only when a low resolution is chosen (usually much lower than the preferred resolution of the monitor or tv that is attached) the display "works".
more information and details about this issue is available from these bug reports:

https://bugs.freedesktop.org/show_bug.cgi?id=93578
https://bugs.freedesktop.org/show_bug.cgi?id=94567
Comment: I also experience the graphics issue with a XPS 13 9360 and DA200. Lot's of research did not lead to a solution. Trying with a colleague's Apple "USB-C Digital AV Multiport Adapter" solves the issue for me. I will return the DA200 and buy one of these (and will find a different solution for the missing Ethernet).
Comment: https://detail.tmall.com/item.htm?id=542958273588&spm=a1z09.2.0.0.tlQuua&_u=3bmvb4a7f This adapter was proved to work with XPS 13 and Ubuntu 16.04.
Comment: Just a follow up. I tested the Dell DA200 on a XPS 13 9350 in yakkety with kernel 4.8.0-37-generic. There's still a black screen when you connect by HDMI port in any resolution besides the lowest. All the other ports work fine. – clvx 24 mins ago
Comment: You can patch the linux kernel to get higher framerates on the DA200, see the following patch: https://patchwork.freedesktop.org/patch/145853/
Answer: This is apparently fixed in the 4.5 linux kernel
https://bugs.freedesktop.org/show_bug.cgi?id=92932
http://ubuntuhandbook.org/index.php/2016/03/upgrade-linux-kernel-4-5-ubuntu/
Comment: Just tested on new Ubuntu 16.10 live USB (Yakkety Yak) with my Dell XPS 13 9350 laptop using the DA200 adapter, but unfortunately it still only displays HDMI at lowest resolution (800x600). Kernel version is 22.214.171.124-generic.
Answer: Try using the latest compatible kernel (i'm using 4.7.0-rc7 and it's working). You could also try to leave the plug inside the computer and reboot (still plugged).
In my case, VGA is not working (Linux nor Windows) but the other plugs are working fine.
Comment: I recommend [edit]ing this answer to expand it with specific details about how to do this. (See also [How do I write a good answer?](/help/how-to-answer) for general advice about what sorts of answers are considered most valuable on Ask Ubuntu.)
Comment: Ok but there is the question "Could someone please suggest a solution?" and i suggest 2 solutions : try to update the kernel & try to reboot with the adapter plugged ... can you guide me updating the answer correctly ?
Answer: As per the following bug it seeems to have been fixed.
If it still doesn't work for you check the kernel version uname -a.
In my case I was checking for any updates on the issue thinking it wasn't solved however when I tried it it simply worked.
According to this post on Dell commpunity someone got it to work with a patch for kernel 4.13 which I happen to have. I did not patch though.
If it's not urgent I suggest you wait for the next kernel image update.


How to check whether a user can be assigned the owner of an object?

Question: I would like to change the ownership of multiple records using apex. Before changing the ownership I want to check whether the said user has read/edit access on this object type. This needs to be done for multiple users so I'm looking for an efficient way to query this information. I'm running as a system user. Can this be achieved?
Comment: Hi @Brian,  did you try querying the `UserRecordAccess` as mentioned in this answer http://salesforce.stackexchange.com/a/191/18297
Answer: Yes you can achieve this by using below approach : -

For every object salesforce storing the access in the related share object.for example if you are talking about standard object like Account then the share object name will be AccountShare and if it is custom object like customobject__c then the share object name should be customobject__c_Share.

for each and every object the access level was defined in that share object for respective user.

before changing the owner you need to query share object for that custom object like below : -
SELECT AccessLevel,Id,UserOrGroupId FROM customobject__c

AccessLevel options are "Read" and "Edit" and UserOrGroupId options are either user or any group.
after query will be done you can check the access level of that user on the object then you can change the owner of the record.
i think this will solve you purpose.
Comment: is there any problem in the answer.??
Comment: How is this object created? I queried this object in my org and do not have any associated data.
Comment: This object is created automatically by saleforce, you just need to query on that object. The object name should be "Your object" +"share"
Comment: then no user has access on that record, there should be one record for owner also.


Difference between propagating and evanescent waves

Question: Currently I am reading about super lens and came across these two waves, propagating and evanescent. If a negative index material is used as a lens then both propagating and evanescent can be passed comparing to a conventional lens in which only propagating can be passed. What is the difference between these two waves on image formation?
Comment: I'm skeptical of claims "both propagating and evanescent can be passed". Of course it is in theory true, but then again this is always true in theory, even for conventional materials. The practical limit is that the further axially you move away axially from the source, the evanescent wave grows exponentially weaker and therefore the signal to noise ratio becomes crap. This will equally limit negative and positive refractive index propagation. There are some superlenses that use the evanescent wave to allow smaller than wavelength features to be projected short distances through ...
Comment: ...curved mediums such that they are no longer smaller than wavelength scale variations (analogously to a quantum tunneling effect), whence they can be successfully resolved by conventional optics. These I believe will work if we can find the right materials and building methods for them.
Answer: The difference between propagating and evanescent is most obvious when looking at the intensity functions of the wave. You are probably familiar with a propagating wave, as its intensity is oscillating like a sine or cosine wave; this oscillation is what causes them to propagate or travel. An evanescent wave has an exponential wave function, typically an exponentially decaying curve if referring to intensity of light. This causes the wave to not really be able to travel through space and through a conventional lens.
I'm not really familiar with the super lenses you speak of, but I believe that the lenses are able to make evanescent waves visible due to the complex component of a evanescent wave function.
This comes into effect with reflection and refraction of light, particularly total internal reflection. If you were to have a block of glass and shine light into it which undergoes total internal reflection, no light would be visible where the light would have come out of the material if it would have went straight through; however, if another block of glass were put at this location with an extremely small distance between the two blocks (on the order of picometers, I believe), the light would come out of the second block of glass where a complex wave was created from the original electromagnetic wave in the space between the blocks, then was able to be changed back to a real wave in the second block of glass.
Answer: Well, there might be a bit of confusion of terms going on here; between "waves" and "fields".
When you have ordinary TIR going on at the boundary between a higher refractive index medium, and a lower index medium; with the beam incident from the high index side of the boundary, classical EM theory says there is no energy propagation in the low index medium; but there is an EM "field" in the low index medium, that drops exponentially with distance from the interface, in a space of the order of the wavelength.  There isn't supposed to be any propagating wave, as a result of this evanescent field.
But, if a third medium is brought up to within the range of this evanescent field, and the refractive index is such that the TIRed beam would not be TIRed if media 1 and 3 were in optical contact, rather than media 1 and 2, then there will be an attenuated beam transmitted into the third medium.   This process is known as "frustrated total internal reflection."   The amplitude of the transmitted beam, in medium 3 is a sensitive function of the 1 - 3 spacing.
Beam splitter cubes can be obtained, with prescribed split ratios, that are set by controlled FTIR.   Naturally, the split is wavelength dependent, so such splitter cubes, are typically used only in laser applications, here the wavelength is fixed.   They aren't broad spectrum devices.


Interpreting two-way continuous x continuous negative interaction (OLS)

Question: Context: I'm testing a hypothesis for a paper I have to write. I suspect that higher trait authoritarianism (sca) will positively predict greater support for US Supreme Court Justice Roberts (data gathered post affordable care act ruling) on its own, but will increase the negative effects of conspiratorial ideation (CI) in an sca x CI interaction. I tested the interaction in the model below and it was significantly negative. I'm not sure though whether the results suggest that sca buffers/offsets the negative effects of CI or intensifies them. Can someone take a look and explain to me how to interpret it?
Comment: It means that the higher CI is, the relationship between sca and the outcome is getting more negative. Or formulated differently: the relationship between CI and the outcome is getting more negative the higher sca is. Specifically, the slope of CI is positive for values of sca $< -3.01$ and negative for sca $> -3.01$. Similarly, the slope of sca is positive for CI $< 1.90$ and negative for CI $> 1.90$.
Comment: [Here](https://www.stata.com/stata-news/news32-1/spotlight/) is a good tutorial on how to visualize the interaction in Stata.
Comment: As my old stats teacher always told us: when in doubt calculate the derivative
Answer: At the moment, you cannot tell by examining the interaction.  All that you currently know is that SCA positively predicts support for Roberts with C.I and the interaction in the model, and that C.Ideation negatively predicts support for Roberts with SCA and the interaction in the model.  These to effects are, however, qualified, by the higher order SCA x CI interaction (-.6398, t = -4.15,p < .001).  So, you know that they interact, but you do not know what that interaction looks like.  You would need to decompose this interaction into its two simple slopes to examine if either is significant.  Use Aiken & West, 1991 as a conceptual guide, and then use some of the online excel calculators (e.g., Jeremy Dawson has an easy one) to plot the simple slopes.


what is a pneumatic signal exactly?

Question: I'm starting to learn about automatic process control, and there are types of signals transmitted in a control system. Among that is pneumatic signal that is a pressure signal. But I still don't know what a pressure signal means? How does it work? If you could give me a simple reference to learn more about signals(not a book to read, I'm already reading a book about control..)
Answer: For a pneumatic system, information is carried by the pressure of a gas (or air) in a pipe, instead of electrical current. In antique Greece,  pneuma was used in medicine to describe  air circulating for the  functioning of living systems.
I am not sure the term is very common, although there are several related concepts such as pneumatic actuator, pneumatic controller, pneumatic signal transmitter or amplifier, (fundamentals of) air logic, etc.
By a form of metonymy, I'd consider a pressure signal as the measure, as a given location  over time, in certain units (psi, psig for pound/square inch [gauge]).
Apparently, due to pressure/temperature conservation laws in constant volume, pneumatic controllers can also work on temperature.
In addition to the above link, the short document Pneumatic Systems describes in Chapter Different kinds of basic circuits: Flow amplification, Signal inversion,  Memory Function,  Delay function.
Answer: They are small pipes with pressurized air. They typically are on or off and typically control actuators but not just control, they supply the required force for the actuators. You see them a lot in manufacturing production lines.   A jig will hold a part for some machining step and the jig will open or close under pneumatic control. They are used where electric wires aren't suitable such as creating a fire risk and don't require speed
Comment: Slow compared to an electrical signal.  A pneumatic Signal is mechanical.  The gas is typically expelled by the actuator, It's a cycle,
Comment: Thank you. If we kept sending a pneumatic signal , one after another, just like in an electric signal , electron after electron be transmitted, can the pneumatic signal then be not functioning as " on and off" ? And why is it considered not fast (don't require speed)?

what is a pneumatic signal exactly?


Species counterpoint vs jazz

Question: I have many books on theory and I'm wondering if these two certain books can coincide or if they are just not able to work together. All my textbooks with counterpoint only allow intervals 1 3 5 6 on accented parts (consonances) while my jazz book is teaching me 7ths 9ths and 11ths and even 13ths. Are these just 2 separate styles that I should recognize separately or can voice leading somehow work with chord extensions from jazz. Does jazz not care about parallel 5ths/8ths?
Answer: Of course they are different styles. And as there is a development in classical music from early Renaissance to Baroque, Classic and Romantic eras there is also a development in  Jazz styles. So there are not only different styles between the two groups but also different styles within the two groups concerning chordbuilding and voice leading. The difference is as large as the difference between middle age church latin language and afro-american slang!
If you want to write Jazz music you can forget the rules of classical counterpoint, the only thing you have to know is the concept of counterpoint that concerns the idea of independent voices like imitation or countermelody (polyphony opposite to homophony) and you can work absolutely free in the realm of Jazz harmony.
And of course parallels of perfect fifths are not forbidden. :)

In Jazz and modern music you are free to create all kind of chords 1,3,5,7,9,11,13 ... and all kind of intervals and alterations. So don't study any longer  those old counterpoint rules (except you have to ... or if you are interested in early music and history  as I am in ancient music, renaissance music and in latin language, this is a wonderful world!)
Just start to play and write Jazz and you are free to create your own style.
I've found for you this interesting dissertation I'd like to share (it's much too broad to make a resume, but even the abstract, the table of contents and the list of tables shows the large treasure of information:
https://getd.libs.uga.edu/pdfs/sterrs_tamika_s_201305_phd.pdf
(I did download it and hope to find the leisure to read it in short time.)
Answer:
...only allow intervals 1 3 5 6 on accented parts ...parallel 5ths/8ths

Those are two separate issues. The fact that species counterpoint wants you to use consonances doesn't prohibit parallel fifths and octaves. The parallel concern is about relative motion and how you get to those consonances.
Does jazz care about parallel fifths?
There certainly is not a jazz prohibition like there is in species counterpoint.

...can voice leading somehow work with chord extensions from jazz.

One of the key factors of voice leading is moving voices the smallest distance to the tones of the next chord. By that measure I think jazz does use voice leading. Standard progressions like thse use voice leading...
Comment: perhaps we should add that the classical counterpoint rules for  2,3 and 4 voices and they had been respected even in a composition of 30 voices and more, while Jazz uses a bass line (often ostinativ bass licks or walking bass, middle voices for a harmonic line like you show in your chord examples, and a soloistic (improvised) melody (followed close by the chord accompaniment. Polyphony is found in responsorial (call and response) patterns of different instrumental sections.
Answer: Some of the two-part voice leading is useful in pop as well as jazz. Between the melody and the bass is most important as these two stand out. Parallel fifths or octaves may cause it to sound like either the bass or melody dropped out.

Species counterpoint vs jazz


Does AirPlaying content from VPN protected laptop expose content beyond local network?

Question: If I AirPlay something from my laptop, which connects to the internet via VPN, to my Apple TV which connects to my wifi router which is NOT VPN protected, is the content I'm AirPlaying exposed beyond my local network?
Answer: No, the airplayed content won't leave your local network.
Your VPN only protects traffic that goes through your internet gateway which is usually your modem/router. (In the less common case that it is a split tunneling VPN, even only the traffic to the remote LAN is affected by the VPN.) However, Airplay connects your laptop with your AppleTV within the local network, so it is neither affected by the VPN, nor does it leave your local network.


Tag sets - intersection

Question: How do tag sets work? I created one tag set containing "java" and "caching" and was expecting to get only question related to both of them. But it seems to return question related to any of them which is really useless given the number of matches. Is it possible to get the intersection somehow?
Comment: Two years later and something has changed. While I still can't see any use for the disjunctive tag sets, I have no idea how to create any tag set anymore. :D
Answer: Short answer: tag sets do not currently support intersects (i.e. "java AND caching"), so vote this question up if you want that feature
Longer answer:
Tag sets are the union, not the intersect, of the tags you specify.  This is consistent with "interesting" and "ignored" tags on the Q&A sites themselves.  The idea is that you have a list of tags that you're interested in and want to follow.
I can see a use case for specifying intersects, but it would make the queries more expensive, and the UI more complicated (so I can enter <code>(java AND caching) OR c# OR asp.net</code>).  If enough people want it, we'll figure out how to add it.
Comment: I don't know how many Java question come each day, but surely way more then I could read. If I added anything to it, it could get only worse. Other may feel different, but I do not need neither union not complicated expressions, for me intersection is the only useful thing, at least for now. Instead of union, I can use multiple tag sets. Maybe a simple switch "match all of them"/"match any of them" in the UI could do. The queries would probably need to join more tables, but with users getting closer to what they want, they'd scroll less and so you'd get less queries.
Comment: I know this is an old answer, but I would love to have this feature.  I'm currently following the [interop] tag, but the majority of these questions deal with office interop, and I am only interested in the managed/unmanaged interop.  The intersection of [interop] with another tag like [c#] would be ideal.

Might as well add full set operations while you're at it! /partial-jest

Tag sets - intersection


How many hours does it take to backup the PS3 internal drive if it is 1.0 TB

Question: How long or how much time does it take for a PS3 to backup a 1 TB internal drive to a USB external drive using the official Backup Utility?
Answer: If the PS3 internal drive was filled with about 40% game saves & game data, and about 55% Video data (Torne for Japan, DVR recordings), or in other words, 948GB possible and 20GB available, then the estimation given by the Backup Utility was 28 hours. The actual time was fill in the blank.

My PS3 was a "Slim model" CECH-3000A (2011/11) with 4.55 (2014/02) system firmware.
My internal hard drive was fill in the blank
My external hard drive was a Western Digital Caviar Green 2.0 TB (not Advanced Format) in an off the shelf hard disk enclosure kit.
The latter was connected via a daisy-chain of two USB 2.0 hubs.


Modifying game files hard drive

Question: I have a PC with the game War Thunder. The game files are in C:\ of my computer: is it possible to move this folder to another hard drive?
Comment: Have you tried?
Comment: Instead of moving it, reinstall it on the other hard drive.
Comment: depends on the software itself. many games are completely self-contained, but others are not nearly so flexible.
Answer:
is it possible to move this folder to another hard drive?

Yes, this is possible. Though I expect your question is "Can I move it in such a way that it will keep working" :)
For that you have at least two generic options:

(cleanest way). Deinstall the game. Reinstall it and specify another installation path (e.g. to D:\games\WarThunder).
Move the folder to D: (not copy, move, preserving rights) and create a symbolic link. This way the software still tries to access the files on the C: volme but it will get redirected.
Answer: Like what frank Thomas and Root have said generally game aren't that easy to move, Especially war thunder as that's a primary online game which is always contact a server. I know its a ridiculous sized file to reinstall but its probably safer to reinstall it.
Check the settings of the launcher as well it may have a change directory function which should move the game files across to another location.
Answer: Not sure if you have War Thunder Installed on Steam but if you do use this nice little app that I have come across in my years of gaming. It is used to move games (Steam Games) from one drive to another with ease.
http://www.traynier.com/software/steammover
And if you do not have the game installed on Steam it should be safe to move the folder, from my understanding and past experience moving games (the main root folder) to another drive and launching him has no impact or changes to the game.
Ex. Moving League of Legends, GTAV, FFXIV, Master of Orion, and my other games.
(Did a game migration from an HDD to an SSD)

Modifying game files hard drive


HTML5 canvas: Toggle between color/grayscale image

Question: I've got an HTML5 canvas element in which a user can dynamically move, resize, and rotate a color photo.
I'd like the user to be able to toggle between grayscale and color.
I can think of two approaches, but neither is ideal:
1) Re-render the color image as grayscale (using a pixel-by-pixel loop) on every resize and rotate event (which could be several times a second)
2) Create a grayscale version server-side, and apply any canvas transformations to both images, but show only one of them at a time, depending on the toggle selection.
Can anyone think of a better solution than these two -- or, if no better solution exists, take a guess about which of the two would be the better choice?
Update: I implemented the method suggested below by Phrogz.
Comment: Nice writeup; I particularly liked the link to the heuristic greyscale conversion. However, note that you do not need to use `toDataURL` to turn your greyscale canvas into an image. `drawImage()` can be called with an HTML Canvas passed in as the first argument instead of an HTML Image element.
Answer: Create a second canvas (you don't even have to append it to the document) and use drawImage() to copy the color image onto it, and then (once) use getImageData()/putImageData() to make it greyscale.
Use this canvas as the source for future calls to drawImage() when you need the greyscale version, otherwise use the original image.
You are transforming the context, e.g. context.translate() / context.rotate() / context.scale(), to draw the image easily, right? There is no reason to keep rotating or resizing the source image as the user is transforming it.
Answer: You can also draw both images to two canvases (or a big one). That canvas probably doesn't even have to be added to the page, it can just be the element.
Then you draw the proper image from that canvas to the main canvas using the build-in methods. This will both be fast and not require server-side code.
You could even do the conversion to grayscale in a webworker, but that depends on if your clients do support it.


How do I restore the recovery partition in windows 8.1

Question: For some reason, the recovery partition on my computer is gone which means I can't do a restore or a full reinstall of Windows. Here are some screenshots as proof.
Here's one of the "This PC" window:

If the recovery partition were still functional, we'd see it as a separate hard drive with a capacity of approximately 8 GB
Here's a screenshot of me attempting the reinstall

So does anybody have any idea on how to fix this?
I am asking because I was told in my previous question VirtualBox won't open. Error code 0x80040154 that I would have to reinstall Windows if I don't have a restore point, which it appears I don't.
Comment: Did it come from your PC manufacturer, if so what is the manufacturer?
Answer: If your recovery environment is missing, for what ever reason, you will need to either contact your system vendor/manufacturer (such as Dell, HP, Toshiba, etc.) to acquire a copy of restoration media which is the preferred method, this may or may not reinstall your recovery environment but it will definitely allow you to re-install Windows that was originally shipped with your PC. An alternative would be to use Microsoft's Media Creation Tool although at the time of this answer attempting to download it is resulting in a 404 - Not found error, and it appears Microsoft has removed it in favor of Windows 10. Another alternative would be download and burn the full Microsoft ISO file to disk for Windows 8.1, which is available on the Microsoft Downloads site.


Why is the mass dimension of anticommutingcoordinates $[Mass]−1/2$

Question: I am reading a review about supersymmetry and in page 29 I have read that the mass dimension of the Grassmann anticommuting coordinates is $-1/2$. Why this? why don't they have the same mass dimensions as the bosonic coordinates?
Answer: Suppose $\partial_\alpha$ is a derivative w.r.t. Grassmannian coordinate $\theta^\alpha$. We often define a super-derivative
$$
{\cal D}_\alpha = \partial_\alpha + \cdots
$$
where the $\cdots$ is chosen such that
$$
 \{ {\cal D}_\alpha  , {\cal D}_\beta \} \sim \gamma^\mu_{\alpha\beta} \partial_\mu
$$
Now, let's do some dimensional analysis, since $[x^\mu]=-1$, $[\partial_\mu]=+1$. Further, since the metric is dimensionless $[\gamma^\mu] = 0$ (from $\{ \gamma^\mu , \gamma^\nu \} = 2 g^{\mu\nu}$. Thus, $[{\cal D}_\alpha] = [\partial_\alpha] = +1/2$ and therefore $[\theta^\alpha]=-1/2$.


Requesting not to have a Retirement Dinner

Question: How do I nicely tell co-workers that I would not like to have a retirement dinner?  This is something that everyone before me had & people look forward to this.  I am not against the dinner, but feel that my supervisors set things up in a way to prevent me from earning a higher wage, and don't want to see them at a dinner - they would be expected to attend.  I might say something that I shouldn't if I see them there.
Comment:  I only found out about the wages recently.  That is one of the reasons I decided to retire, now.  I know my salary won't improve.
Thank you for your answers.  I am on good terms with my co-workers.
Comment: retirement, or resignation?
Comment: why wouldn't the direct route work? "Hey guys...I'd rather not have a party thrown. It's no big deal and I'm ready to just move on and get about w/ retirement. Thanks"
Comment: Related, though the situations are quite different: [Is it okay to turn down an invitation to my own retirement party?](https://workplace.stackexchange.com/questions/110024/is-it-okay-to-turn-down-an-invitation-to-my-own-retirement-party)
Comment: VTC as duplicate but I don't agree with the accepted answer. Instead I would point you to [Joe Stazzare's answer](https://workplace.stackexchange.com/a/32143/9549) which might work for you. A private chat with your boss, as proposed in [another answer](https://workplace.stackexchange.com/a/32578/9549) in that other question, might also work for you.
Answer: As you said, people look forward to the dinner, so this dinner isn't just for you even if it is in your name. If you're retiring then you don't really have to keep a good report with your coworkers anymore if you don't want to but if you wish to stay on good terms with them then I'd recommend sucking it up and going. If you do go, why won't you be able to keep your mouth shut when seeing your supervisors? I assume you've been successful at doing it for quite a while if you are retiring from the company, why not one more evening? Again you don't need to keep your mouth shut as, you know, retirement.
In the end you could just not show up. I'd assume they'd still have the dinner without you since they're already there but again it might leave a sour taste in their mouth.
Comment: Agreeing to the dinner and not showing up is almost certainly worse than not agreeing to it.
Comment: Pretend to be very excited. Struggle to agree a date, then once one is agreed, wait and then forge a new excuse to reschedule. There is a good chance it just falls by the wayside if enough time has passed and you have already left the office.
Comment: Not saying its better, just an option. Probably the worst unless OP is gunna say something really bad to the supervisors.
Comment: `I assume you've been successful at doing it for quite a while if you are retiring from the company, why not one more evening?` OP has edited to indicate he only found out recently
Answer: I really suggest you reconsider your attendance. My father retired recently, he is a reserved person and I don't think he wanted to attend his lunch it was at first. I think regardless of the circumstances of your retirement it would be a mistake to associate the event with grievances of your supervisors. It should be a celebration of your entire career, the contributions you have made to the industry and the part you played, however big or small, in progressing it which the next generation (such as myself) benefited from. If you are worried about the event that your supervisors will speak on your behalf or other concerns which you have that will overshadow the event for you, I suggest you communicate that you would prefer if they can alter the format slightly that they don't have long speeches that you just want to celebrate with your colleagues and only a very small toast.


Folding on Shabbat

Question: If one must fix their clothing, i.e. fold their collar, are they allowed to do so on Shabbath? Does it break any melachot?
Answer: According to an article on AskTheRav, folding garments, whether it is a collar or not, improves the piece of clothing and hence it is forbidden on Shabbos. However:

One may fold old garments, not on the original fold line. Some are
stringent with this too.

The Mishnah in Shabbos says (see also the linked Gemara):

One may fold the garments after removing them even four or five times, and one may make the beds from Shabbat evening in preparation for Shabbat day, but not from Shabbat in preparation for the conclusion of Shabbat, since one may not perform an action on Shabbat that is preparation for a weekday.

The Bartenura on this Mishnah explains it as follows:

מקפלין את הכלים – clothes that are spread out, one folds them even four and five times in order to return to wear them on that same day and they did not teach other than for one person.

A collar that is not in place anymore, can be viewed as "spread out". As I see from this Bartenura and the Mishnah, it is allowed to fold the collar into place.
Similary, the Shulchan Aruch in Orach Chayim 302:3 builds on this Mishnah and says:

It is permitted to fold clothes on Shabbos that are to be worn that Shabbos. This is when (one) person folds them, they are new clothes that have not yet been laundered, are white, and he does not have other clothes to wear. If one of these conditions is omitted, it is forbidden (to fold). There is an opinion that holds that if folded against its creases it is permitted unconditionally, and his opinion seem to be correct.

The Rambam, however, seems to disagree, and says (Mishneh Torah; Hilchos Shabbos 22:22):

It is forbidden to fix the sleeves of garments, adjusting them to form layers of cuffs

See also: Folding Garments on Shabbat, Folding garments, Inserting Collar Stays on Shabbos. See also the Aruch HaShulchan in Orach Chayim 302:12.
Folding clothes can form an issue on Shabbos, especially if the folding act makes improvements on the clothing:

Folding them prevents any potential wrinkling and enhances the appearance of the garment, which makes it resemble makeh bepatish

However, to me, it seems that you do not fold your collar in order to prevent it from wrinkling and to enhance the appearance of the garment. The last might be true, but if you fold it a slightly different than normal, that would be no problem.

Folding on Shabbat


Can I prepare metamagicked spells in my domain slots?

Question: Albeit this question was for Pathfinder, it made me wonder.
Can a cleric prepare a lower level domain spell with some metamagic applied in the appropriate level slot, like an extended circle of protection from evil in the 4th level domain spell slot if he has the Good domain?
Answer: Extended magic circle against evil is a Good domain spell of 4th level or lower.  It can be prepared in a 4th level or higher domain slot by a cleric with access to the Good domain.
The domain slots only follow special rules regarding which spells can be prepared in them as a whole.  They don't follow special rules about what levels those spells can be.  You can prepare any domain spell you have access to in your domain slots as long as the slot is "big enough" to hold the spell.  That includes bumping a spell up levels by adding metamagic.  It's still the same spell - and so it can still be prepared in any of your domain slots.
Some argue that metamagic versions of spells should be considered entirely different spells, and so they're not the domain list and can't be prepared in those slots.  I feel the rules clearly indicate otherwise;  metamagic versions of spells appear in no spell lists.  This interpretation, applied equally and fairly, would mean that no one could cast, say, maximized magic missile because no class gets it on their spell list.  The Good domain spell list works exactly like the wizard/sorcerer spell list or the paladin spell list - the spells that appear on the list can have metamagic applied to them and stay on the list.  (Bards and their inability to cast Silent spells may now fly into a frothing rage that everyone else gets something they don't.  The first bard player to ask me why he can't cast a silent soundburst or silent earthquake gets the bulkiest instrument I can find crammed directly in his spellslot.)
Comment: A wizard need not write *maximized magic missile* into his spellbook in order to prepare and cast it, as long as *magic missile* is in there.  A sorcerer need not learn *heightened bestow curse* to cast it, only *bestow curse*.  While the rules might not specifically spell out that a spell is still that spell when metamagic has been applied, it provides plenty of very strong examples.  Please note that no maximized or quickened spells appear in *any* class list.  If *maximized X* isn't the same spell as *X* for who can cast it (besides spell level), then maximized spells cannot be cast at all.
Comment: @KRyan Wait, are you suggesting that no one can activate [heightened wands](http://www.d20srd.org/srd/magicItems/wands.htm) and that even though ["using metamagic feats, a caster can place spells in items at a higher level than normal"](http://www.d20srd.org/srd/magicItems/creatingMagicItems.htm) such a caster couldn't subsequently activate those items?
Comment: "*Extended magic circle against evil* is a Good domain spell of 4th level or lower," [Citation Needed]. I see that spell nowhere on the list, only *magic circle against evil*. You have to demonstrate that they are the same thing. I think they are, but I also don't think the rules ever actually state such a thing, and the opposite is equally possible. Which means you should avoid making a declarative statement as if it was an established fact.
Comment: @KRyan whoops, forgot to tag you.  Also, inb4 "bards can't cast silent spells", that's the exception that proves the rule.
Comment: @gatherer818 Very good argumentation. I think they should be included in your answer.
Comment: @HeyICanChan Even stronger argumentation; I did not realize that line existed. That would have settled some acrimonious debates I've been a part of. Gatherer, I recommend including that bit, as well.
Comment: @KRyan Although the debaters may not care, there's also this [Sage Advice answer](http://archive.wizards.com/default.asp?x=dnd/ask/20070306a).
Answer: "With access to two domain spells at a given spell level, a cleric prepares one or the other each day in his domain spell slot."
http://www.d20srd.org/srd/classes/cleric.htm
I interpret this as a clear "no".
Example: At level 1 a cleric with air and animal domain has access to Obscuring Mist and Calm Animals. Those are the one or other. At level 2 the same cleric has Wind Wall and Hold Animal. Those are the one or the other. An enlarged Obscuring Mist (example) is not one or the other spells listed for level 2.
Comment: Well this is exactly what I was thinking at when I tought about the question, now let's see if someone can bring some evidence against this or supporting the other options.
Comment: I think it would be useful to incorporate that into the answer. Zachiel, by way of counterargument, in the spells section of that same link it says: "When a cleric prepares a spell in a domain spell slot, it must come from one of his two domains." Further, the strict interpretation joedragon puts forth *mandates* a cleric prepare spells every day ("a cleric prepares one of the other each day"), which, clearly, sometimes a cleric *can't.* I don't know what to do with that.
Comment: Can this be expanded upon? That is, why is a spell modified by a metamagic feat unable to occupy a domain slot? I don't follow how the linked text leads to an absolute *No.*
Comment: I do not see how my quote and Hey's quote cannot act together.  Access to two spells, preparing 1 or the other, coming from one of 2 domains.  To Hey's second point, before my quote (same SRD link) is "A cleric *may* prepare and cast any spell on the cleric spell list, provided that he can cast spells of that level, but he must choose which spells to prepare during his daily meditation."  I believe this speaks to if you are reading preparing domain spells, you are preparing spells, otherwise why are you reading preparing domain spells?


Can an exploit in my browser read login passwords without logging in again?

Question: When I log into my email account through a browser and open an email which exploits some vulnerability in my browser would it be possible for the attacker to take over my account? Passwords for full disk encryption are saved somewhere in the memory. I guess the same applies for browsers and passwords too but I'm not sure if user level access is enough to extract the password. Of course it would be possible to install a backdoor which logs the password on the next login, but suppose the attacker has only one shot to gather the password.
Answer: Yes, it is possible for an attacker to access your account.
Assuming your computer has been compromised, the attacker could easily gain access to your different accounts.
Different ways exist, such as retrieving the session cookies. Although they won't get your password, they could get directly logged in your account. (If you were already logged in.)
Other techniques includes grabbing the credentials stored in your browser, running a keylogger (as you mentioned), etc.


Can other fundamental forces bend spacetime?

Question: I was wondering what makes gravity so special that it bends spacetime? and if it is part of the four-fundamental forces, why or why cant the other forces bend the time space continuum?
Comment: Related: http://physics.stackexchange.com/q/18670/2451 , http://physics.stackexchange.com/q/57228/2451 and links therein.
Answer: According to General Relativity the gravitational field is equivalent to the geometric properties of spacetime. This geometric properties are given by the curvature tensor which is determined by the Einstein's field equations (EFE)$$R_{\mu\nu} - {\textstyle 1 \over 2}R\,g_{\mu\nu} = {8 \pi G \over c^4} T_{\mu\nu}\,$$
where the left side can be interpreted as the geometric or gravitational part (as it contains the metric and the Ricci curvature tensor) and the right hand side the matter part (which is just the energy momentum tensor of the matter fields presents).
As you can see the "bending" is done by anything that contains energy or momentum which make the right hand side non-trivial.
What is surprising is that even in the absence of matter there might be some bending by the self interaction of the gravitational field. This is due to the fact that the EFE determine only certain part of the curvature tensor but not all of it.
Answer: A bending of space-time can be observed through the study of the metric describing it, specifically through the Riemann curvature tensor. Based on the current knowledge, space-time is assumed to be a 4-dimensional manifold which is locally modelled on flat Minkowski space-time. General relativity relates the geometry of space-time, that is the metric $g$, with the energy/matter density. It turns out that matter effectively curves space-time, but other forces, despite contributing to the stress-energy tensor, lead to some traceless contribution to the theory. That's how current theories are formulated these days and as far as I know there is a good agreement with observations.


Find the bound of the function

Question: Let $f : \mathbb{N} \rightarrow \mathbb{N}$ be a function satisfying $y < f(x+1) \rightarrow y < f(x)$ for every $x, y \in \mathbb{N}$. Show that this function is bounded and determine the bound.
Comment: Is this an original puzzle?
Comment: @bobble Yes. This was a sub-problem of a proof I was recently doing.
Answer: Similar to Jaap's answer, but without the risk of a $-1 \notin \mathbb{N}$ appearing:

 Always choose $y = f(x)$. Then the condition becomes $\forall x \in \mathbb{N}. f(x) < f(x+1) \rightarrow f(x) < f(x)$. The conclusion of that is always false, which means that its premise must always be false too, so we know $\forall x \in \mathbb{N}. f(x) \ge f(x+1)$. A trivial induction then shows that $ \forall x \in \mathbb{N}. f(0) \ge f(x) $, so $f(0)$ is our upper bound.
Answer: By elementary logic

 the given statement $f(x+1)>y \Rightarrow f(x)>y \forall x,y\in\mathbb N$ is equivalent to $f(x+1) \le y \Leftarrow f(x) \le y \forall x,y\in\mathbb N$. It is now obvious and easily verified by induction that $f(0)$ is a (sharp) upper bound.
Answer: Here is a simple proof:

 Applying the given statement to $y=f(x+1)-1$ we deduce that $f(x+1) < f(x)+1$ for all $x$. Since $f$ is an integer-valued function we get $f(x+1) \le f(x)$ for all x.
$f$ is therefore a decreasing function, which is obviously bounded above by the value at its left-most point, $f(0)$.
Comment: @RobPratt Good point. If the function has some point where $f(x+1)>0$ my argument works for all smaller x. It does not work on the tail of $f$ where it is 0, but that part of $f$ is still below the established bound.
Comment: What if $f(x+1)=0$ and so $f(x+1)-1=-1\notin \mathbb{N}$?

Find the bound of the function


startinfo.arguments question?

Question: I have three paths that I want to be 3 separate arguments passed into an executable. I do startinfo.arguments, but how do I separate these so the executable knows they are three different arguments?
Answer: You can simply pass these to the argument property with spaces separating them as you would at the command prompt, enclosing any containing spaces in double quotes.
Update:-
As an example of enclosing spaces in arguments, to copy 'foo bar baz.txt' to 'this is a test.txt':-
using (var process = new Process
       {
           StartInfo = new ProcessStartInfo
           {
               FileName = "cmd.exe",
               Arguments = "/c copy \"foo bar baz.txt\" \"this is a test.txt\""
           }
       })
{
    process.Start();
    process.WaitForExit();
}

The syntax is clumsy, but has the advantage of being consistent with how you would do it at the command line, as pointed out by @Ed S.
Comment: Can you expand on the concept of enclosing containing spaces in double quotes? (Example possibly?) Thank you!\
Answer: The argument string that you pass in should be no different than what you would pass in if you were typing into the command line.
Answer: Lets say your program was called Test.exe and you wanted to pass it 3 command line arguments "argument1" "argument two" and "argument3"
If you were to run this from the command line you would do:
Text.exe argument1 "argument two" argument3

So your startInfo.Arguments would be set to:
startInfo.Arguments = "argument1 \"argument two\" argument3";

startinfo.arguments question?


Disable Attachment Pages Completely

Question: I would like to disable all attachment pages completely. I Googled it, but there's just information on how to redirect to parent post or homepage. That's not what I would call an elegant solution. Why introduce unnecessary permalinks that redirect to the homepage? Couldn't it be disabled completely?
Comment: It just seems pointless to me that every file I upload gets its own page with a permalink. I can't think of many use scenarios for them. Most people just want to upload files to link to them, not creating a separate page to display them.
Comment: What do you mean by "disabled completely"? When adding media attachment URLs are created automatically. I don't know if you could disable this action without harming Wordpress core.

Why isn't redirecting an elegant solution? What is the problem with the attachment URLs? I'm not judging, just trying to understand so I can offer a solution.
Comment: @Fencer04 it can be done without harming WP core, see my reply. In many cases it makes sense. Redirects are bad and technically it's not the proper use case for them - instead of redirecting existing URL you better don't have that URL in the first place if you don't use it. Also, on every request WP scans all rewrite rules array until finds the first match, it evaluates them using regular expressions, which is slow. Smaller array or rules means better performance. For this reason, I often remove dates, author archives, embeds, feeds etc - basically all features that aren't used on the project.
Answer: You can filter default rewrite rules and remove those for attachments:
function cleanup_default_rewrite_rules( $rules ) {
    foreach ( $rules as $regex => $query ) {
        if ( strpos( $regex, 'attachment' ) || strpos( $query, 'attachment' ) ) {
            unset( $rules[ $regex ] );
        }
    }

    return $rules;
}
add_filter( 'rewrite_rules_array', 'cleanup_default_rewrite_rules' );

Don't forget to re-save your permalinks once. WordPress will generate new rules without anything related to attachments.
Now, the attachment page URL gives 404. You can also add that redirect to prevent the 404 page, it's useless in this case. But I'm not sure how to catch the redirect - is_attachment() will not work if the rewrite rules are removed.
Update:
WordPress will still offer the attachment page pretty URLs in media library and media insertion dialog. You can filter this as well:
function cleanup_attachment_link( $link ) {
    return;
}
add_filter( 'attachment_link', 'cleanup_attachment_link' );

In this case, even when you insert your attachment into post ans select "Link to attachment page", the image will be inserted without the link.
Comment: @Mario62RUS 1. Not everyone uses Yoast SEO. Some people do hate the bloat it brings. It's like cancer for your admin UI. 2. Yes, things have changed since 5.0 and Gutenberg. This code should be revised.
Comment: Would it be possible to set the rewrite to be the media's File URL (linked to `wp-content/uploads`)  instead of an auto-generated page?
Comment: Yes, I would like to have the possibility to redirect all attachment pages to the file url as well :)
Comment: The Yoast SEO plugin handles this perfectly.
Comment: By the way, this code does not work completely. If the attachment is loaded for a post or page, then everything works fine. If you just upload a attachment to the media library, its page still opens.
Comment: note that in WP 6.4 there's a toggle to switch off attachments, this answer doesn't prevent it appearing int he WP core sitemap, it doesn't stop attachment REST API endpoints containing the URL, it doesn't disable ugly attachment page permalinks, or hide the option in the gallery/image/media library UI's, etc
Answer: If you want to disable media pages completely, you should use a 404 response code instead of redirection. This can be done with the following code:
function wpse237762_set_404() {
    if (is_attachment()) {
        global $wp_query;
        $wp_query->set_404();
        status_header(404);
    }
}

// This will show 404 on the attachment page
add_filter('template_redirect', 'wpse237762_set_404');

// This will show 404 instead of redirecting to attachment page when dealing with a trailing slash
add_filter('redirect_canonical', 'wpse237762_set_404', 0);

To keep links to attachment pages working and redirect them straight to the file, you can use the following code:
function wpse237762_change_attachment_link($url, $id) {
    $attachment_url = wp_get_attachment_url($id);
    if ($attachment_url) {
        return $attachment_url;
    }
    return $url;
}

add_filter('attachment_link', 'wpse237762_change_attachment_link', 10, 2);

To prevent attachment pages from reserving slugs from normal pages, you can use this code to set all new attachment slugs to random ones (UUIDv4 in this case)
function wpse237762_unique_slug($slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug) {
    if ($post_type === 'attachment') {
        return str_replace('-', '', wp_generate_uuid4());
    }
    return $slug;
}

add_filter('wp_unique_post_slug', 'wpse237762_unique_slug', 10, 6);

This will prevent an image named products.jpeg reserving the URL https://example.com/products. That would result in a page named Products being given the URL https://example.com/products-2 which obviously wouldn't be that great.
I have put this code together in the Disable Attachment Pages plugin, which also includes a tool to scramble existing attachment slugs so they won't cause any problems in the future.
Comment: Warning. This line add_filter('redirect_canonical', 'wpse237762_set_404', 0); also disables redirections of wordpress shortlinks like yourdomain.com/?p=2570
Answer: For those who might not use plugins or prefer light-weighted method. This might be of help.
This method redirect attachment to the exact file instead of the attachment page and it is the method that some plugins are using.
To test, by putting the following code in functions.php of the theme.
add_action( 'template_redirect', 'test_attachment_redirect', 10 );
function test_attachment_redirect() {
    if( is_attachment() ) {
        $url = wp_get_attachment_url( get_queried_object_id() );
        wp_redirect( $url, 301 );
    }
    return;
}

Reference:
is_attachment
wp_redirect
Answer: This is now the default in WP 6.4 and can be set using the wp_attachment_pages_enabled option. Changes are possible

via CLI: wp option set wp_attachment_pages_enabled 0|1
by visiting /wp-admin/options.php
through a small plugin

When this option is set to 0:

attachment pages no longer appear in the GUI as an option when using images/galleries
attachment page URLs redirect to their original files for logged in users
sitemaps/REST API endpoints etc use the original uploads URL

More details at https://make.wordpress.org/core/2023/10/16/changes-to-attachment-pages/

Disable Attachment Pages Completely


I can't see or interact any vertices or faces on an imported FBX Model

Question: I'm trying to learn Blender in order to create character models for a game I really like. I have access to the game's models as .FBX files and their textures as standard sprite sheets. However, each time I import the model into blender I can't seem to interact with any of the model's faces or vertices. I can interact with the model's bones (or skeleton or whatever its called) but I can't interact with the model itself.  I'm still in the process of learning how to use blender to its fullest so pardon if its a silly question.
Comment: After looking into how to import textures onto the model, I also find that I'm unable to create any nodes in the Shading workspace. The option to add new nodes is just greyed out. I'm assuming these issues are interlinked with one another but if they aren't then I'd like some help for this too (but if I have to make a second post then I will make a second post)
Comment: I do not know if it is a silly question, it would really help if you showed some screenshots because so I can only return silly questions like: if you can interact with the bones/armature but not the faces or vertices: did you try this while the armature is selected or the mesh object? Did you try to go into _Edit Mode_ or was it _Object Mode_? Did you try to add nodes without having a material in the _Shader Editor_? Did you try to add nodes or a material while the armature was selected? And many more possible questions since we cannot know how much you already learned about these things.
Comment: So it turns out that a silly answer was just what I needed. When I was going into edit mode, I had the bones/armature selected as well as the mesh. I wasn't aware that I couldn't edit the mesh if I had all of it connected. The moment I just selected the mesh and switched over to Edit Mode, I could see the faces just fine. I noticed that sometimes I was able to edit the mesh while having the bones connected but I don't think that should be much of an issue. Thanks for the help! https://i.imgur.com/mc8s6Pv.png
Comment: Sometimes when multiple objects are selected it can also be a matter of which object is the active one, i.e. the one with the brighter outline.
Answer: When I was going into edit mode, I had the bones/armature selected as well as the mesh. I wasn't aware that I couldn't edit the mesh if I had all of it connected. The moment I just selected the mesh and switched over to Edit Mode, I could see the faces just fine.
(With thanks to Gordon Brinkmann)


Feigenbaum attractor is not an attractor?

Question: I am reading about Feigenbaum attractor (FA) and am getting very confused with something that is described in some books. It is written that FA is not an attractor because in its neighbourhood however small there are points of unstable periodic orbits (UPOs). But I used to think that, apart from other criteria of invariance and irreducibility, an "attractor" has an open set of points constituting basin of attraction which has non-zero measure. Now, I think FA satisfies this property as well because any open set about it is attracted to it except for a set of points (UPOs) which anyway are countable and hence of zero-measure. Am I missing something?
Answer: I do not know about the exact nature of the UPOs in question, but if they are dense, the basin of attraction cannot be an open set: In every ε-ball around a point from the basin of attraction, there is an UPO, which is hence not in the basin of attraction. This is analogous to $ℝ\backslashℚ$ not being an open set.
However, I would disagree that openness of the basin of attraction is a good criterion for an attractor.
Comment: Thanks. UPOs are, in fact, dense in this case.


Accidentally writing self in beneficiary signature

Question: My father-in-law who recently died accidentally wrote himself as the beneficiary for some investments many years ago. Now the company will not give his wife the money even though The Will says she is the beneficiary of everything. It was essentially a clerical error where he signed his own name by accident, is the firm partially responsible for not checking signatures, etc. A lawyer is charging between 6-9K to fix in probate. Is firm responsible/partially responsible since they are ultimately in charge.
Comment: "Now the company will not give his wife the money even though The Will says she is the beneficiary of everything." A Will is just a napkin with pretty writing on it until it is probated. A Will has nothing to do with non-probate transfers like a beneficiary designation.
Answer: It is quite normal for a person to name themselves the beneficiary of an investment- even a life insurance policy. If such a person were to die, the funds would be payable to the estate, which means the executor for distribution to the beneficiaries of the will.
It is normal for organisations to hold such investments to await probate which is when the executor legally becomes the executor. The executor's costs, including legal fees (as well as payment for their time - good wills provide a capped fee for this), are payable by the estate.
The fee you have been quoted does seem high for an uncontested probate - shop around.


Can I have different ssh defaults based on port used?

Question: I multiple SSH servers on the same hostname and I want to use a default username for the ssh server running on one port and another one for the second ssh server. Is this possible?
Answer: From man sshd:

-f config_file
               Specifies the name of the configuration file.  The default is /etc/ssh/sshd_config.  sshd refuses to
               start if there is no configuration file.

So, invoke the sshd server instances with separate configuration files.
Answer: There is no pretty solution, but it is possible using a Match exec section in ssh_config.
From man ssh_config:

The exec keyword executes the specified command under the user's shell.  If the command returns a zero exit status then the condition is considered true.  Commands containing whitespace characters must be quoted.  The following character sequences in the command will be expanded prior to execution: '%L' will be substituted by the first component of the local host name, '%l' will be substituted by the local host name (including any domain name), '%h' will be substituted by the target host name, '%n' will be substituted by the original target host name specified on the command-line, '%p' the destination port, '%r' by the remote login username, and '%u' by the username of the user running ssh(1).

This means that we can let ssh execute /usr/bin/test to match the port (here 2222):
Match host "your_host" exec "test 2222 -eq %p"
    User another_user

Alternatively you can define a nickname/alias for your SSH server on the other port:
Host server_with_other_port
    Port 2222
    User another_user

Then you are able to connect to the second SSH server using ssh server_with_other_port and the different default port and default user name will be applied.
The caveat of the alias solution is that the default user name is only applied if you use the alias, not if you use the real server name or the IP address.


Can application pages be attached to a specific list

Question: I have a scenario where I need to create an application page that is installed to the ECB menu of a specific list only. Is this possible? or is the only way to do it associating the elements file with a list type e.g. task list?
Answer: Yes it is possible to do that: create ECB items menu only for a list....and even better decide at runtime how many items to put in the ECB menu. For this you need javascript skills.
SharePoint give us some hooks to add custom ECB items using javascript. This hook is the js function: Custom_AddListMenuItems(m, ctx). But the problem is how to add dynamic items in the ECB right ? The solution I've used was to implement a synchronous Ajax call to a custom aspx which returns a xml with items and their actions. Here is the code:
<code><script language="javascript">

function Custom_AddDocLibMenuItems(m, ctx)
{
  //debugger;

  var request;
  var url = ctx.HttpRoot +
      "/_layouts/GetCommands.aspx?ListID=" + ctx.listName +
      "&ItemID=" + currentItemID +
      "&UserId=" + ctx.CurrentUserId +
      "&DateTime=" + Date();

   if ( window.XMLHttpRequest )
   {
      request = new XMLHttpRequest();
      request.open("GET", url, false);
      request.send(null);
   }
   else if ( window.ActiveXObject )
   {
      request = new ActiveXObject("Microsoft.XMLHTTP");
      if ( request )
      {
         request.open("GET", url, false);
         request.send();
      }
   }

   if ( request )
   {
      var commands = request.responseXML.getElementsByTagName("Command");
      // for each command found in the returned XML, extract the name,
      // image Url and script, and a new menu item with these properties
      for ( var i = 0; i < commands.length; i++ )
      {
         var cmdName = commands[i].getElementsByTagName(
            "Name")[0].firstChild.nodeValue;
         var imageUrl = commands[i].getElementsByTagName(
            "ImageUrl")[0].firstChild.nodeValue;
         var js = commands[i].getElementsByTagName(
            "Script")[0].firstChild.nodeValue;
         var addSep = commands[i].getElementsByTagName(
            "AddSep")[0].firstChild.nodeValue;

         CAMOpt(m, cmdName, js, imageUrl);

         if (addSep == "True")
            CAMSep(m);
      }

      // if at least one command was actually added, add a separator
      if ( commands.length > 0 )
         CAMSep(m);
   }

   // returning false makes SharePoint render the rest of the standard menu
   return false;
}

function Custom_AddListMenuItems(m, ctx)
{
    Custom_AddDocLibMenuItems(m, ctx);
}
</script>
</code>
This script must be placed in a webpart next to the list webpart (in a Content Editor Web Part for ex.)
The idea is not mine, here is the original article. Hope this will help.
Comment: You're right, using JavaScript it's possible.
Comment: Please take into account this article on jQuery: the SharePoint band aid. This kind of stuff won't upgrade to SP2010 as the UI is completely different.
http://wss.made4the.net/archive/2009/02/23/jquery-the-sharepoint-band-aid.aspx
Comment: How do you know that ? And I'm not agree with that article at all. Using javascript/jquery it is and will be a great way to improve/customize SharePoint controls. Some sp controls simply can't be changed. So "this kind of stuff" was available since SP2003, it is for SP2007 and I'm sure will be too for SP2010. Adding js is not a danger, don't be afraid we are living in a web world.
Answer: It must be attached to a list template (if you are using the server side features), that has a specific id. I recommend that you create a feature with a hidden list template and list instance and then attaches your ECB to that list template.


Are bombs able to blast open the Lihzahrd Temple's door?

Question: In Terraria, I blew up the temple door with a simple Bomb. But after a few weeks, the method did not work anymore. Why was that happening? Is the bombs meant to blow up the temple door?
Comment: By "Temple" do you mean the Lihzahrd Temple in the Jungle?
Answer: In update 1.2.8798 of Terraria, they made it to where you can't explode the Lihzahrd Temple door anymore with explosives. The explosives arn't meant to open the door anyway, though. What you are supposed to use is a key obtained from defeating Plantera. It has a 100% chance of dropping, so its normally pretty easy to get your hands on, assuming you have the means to deafeat Plantera. You can find updates to Terraria and the changes they made here.


What can I do to reduce standing water in my indoor large pots?

Question: I have the plants in pots with drainage holes inside plastic decorative pots w/o drainage holes (so that my carpet doesn't get wet) and even with a small amount of watering, over time water builds up in the plastic pot.
Answer: Pull those pots with the drain holes up and put 1/4" pieces of tile beneath the pot with holes.  When you water allow to drain and then DUMP the water out of the bottom pot acting as a saucer.
Did you use potting soil in your pots?  How often do you water?
Don't allow your potted plant base to sit in water for any time at all.
Answer: Stormy has the right idea; although, I like to get a gap of at least a half inch myself. I have some slabs of rock core samples (from oil well drilling) that are cut just the right thickness, though I don't think you can go out and buy those. But anything that won't rot (plastic, rock, tile) that you can put under the pot with holes to keep it elevated will work. And, if your items are flat and wide enough to be stable, you can stack a few of them, but don't get carried away. Be careful not to cover the holes with whatever you use for elevation.
Be sure to not over-water, otherwise, any amount of elevation will eventually be not enough.
If most of your water is just running straight through, you might want to re-pot in better potting soil.
My dad always waters his plants that are small enough in the sink and leaves them there for a couple of hours so that anything that runs through immediately will not be a problem. I don't like dirt in my sink though, but he has his own sink in his plant room and one in the utility room, so it works for him (he puts a paper towel over the hole so that he doesn't get dirt down the drain).
My dad has another trick that helps with watering. When he pots his plants, he puts pieces of already broken clay pots in the bottom of the pot, being careful not to cover the holes. The pieces absorb water when the soil is very wet and release it back again if the soil gets very dry.
Answer: There are rules to sensible watering of most houseplants;the usual advice of watering when the top of the soil feels just about dry to the touch, then watering well, allowing the pot to drain down freely, and then, after 30 minutes, going back and emptying out any excess water in the outer pot or tray. It sounds like the last step in the procedure is the one you're omitting to do...


Yosemite upgrade causing Mail to crash

Question: I upgraded to Yosemite on my 2011-12 iMac, from system 10.6.8.
It worked to a point, but with major problems with the mail - crashing and not working, basically.My Mac tech said it "should work"...but we tried reinstalling 3 times to the same result.
Given Mavericks is no longer available, does anybody have a suggestion other than a clean install of Yosemite? Or is that the only option?
Comment: Could you please clarify what exactly happens surrounding the crashes? Does mail.app crash when it opens, halfway through you using it, when a particular email is viewed, etc? Also, when the app does crash, it may help to post a copy of the problem report (in the window that shows after an app crashes) so we may help identify the root cause.
Answer: Yosemite mail is horrible, if you have a large inbox it just kills an older machine.  I have a 3ghz mini with 16gb of ram and it STILL crawls.  I am on day 3 of it saying "incoming messages" and slowly the count grows larger and larger. Two apps is all I ask for, Safari and Mail, really people FIX IT.
On my 2009 27" imac I had to restore from time machine back to mavericks.  If you start a restore it will show you what os version was backed up.  Just know it erases your drive so save all of your newer files elsewhere.

Yosemite upgrade causing Mail to crash


Why do big financial groups use fx swaps to manage cash?

Question: Can someone help me with the logic that big companies' treasury department uses fx swap to manage their cash? An example would be much appreciated!
Comment: If you trade an FX swap and spot FX you can simulate a forward FX transaction which is a good way to hedge cash flows in a currency that occur in the future,without having to 'warehouse' a currency for a period of time until the offsetting cashflow occurs
Comment: If a multinational has USD cash that they don't need for the next month while they face a deficit of EUR they can do an FX Swap to correct the situation. (Instead of depositing USD in a US bank and borrowing EUR for a month from a european bank)
Answer: I can give you one example from EM banking sector where FX swap played a critical role in day to day operations.
This EM country's Central Bank used follow fixed rate currency regime and used to keep the USD FX rate within certain bands. In the first half of the 2010's, major political events and drastic changes in commodities prices, specifically in oil prices, affected people's and bankers' perception that the country's CB will not be able to withstand this economic disaster. Subsequently, businesses started experiencing defaults in both local and USD currency denominated loans. Whatever banks could collect (e.g. from performing loans) used to get converted to USD cash; depositors started to convert local currency savings to USD deposits -- people were expecting currency devaluation.  This lasted for about 6-8 months.
Given the situation, banks still had to maintain daily operations (plus some new loan underwriting) in local currency. To facilitate this, they used FX Swaps extensively -- they lent out USD and got back whatever amount they needed in local currency using one day FX Swaps (obviously, they kept rolling these one day FX Swap contract every day). As almost all market participants got rid off the local currency, only the Central Bank and some banks who had local currency liquidity acted as counterparty to those who needed the local currency. Not surprisingly, the rate on one day FX Swap rate jumped from regular 4-5% to 25-30% average during the next 6-8 months. The maximum was about 80% or 90% or something.
Eventually, said CB capitulated and devalued the currency multiple times. Apparently, now they switched from fixed rate currency regime to inflation targeting.
Answer: A Treasury department could use the FX Swap to put cash balances to work to earn a  return on idle cash.
The FX Swap is utilized to implement the FX Carry trade.  Investors will Buy a currency at the Spot rate and Sell the same currency forward.  The difference in their cost to buy the currency and the proceeds they will receive from the forward transaction will be the FX carry amount they will earn.  In addition, they will incur costs/benefits from depositing the currency they bought.  The reason I say costs is that there are currencies now that have negative interest rates and therefore it will cost the owner of said currencies.  The net proceeds of the FX carry and the deposit rates is what the investor will earn.


Python optimize.curve_fit (regarding existing answer)

Question: I wanted to ask a question about a user's reply to other question, but for some reason the comment box isn't showing up. Sorry if I'm doing something wrong.
In any case, regarding this reply:
https://stackoverflow.com/a/11507723/1950164
I have the following question: how can I use this code to fit different data to different functions? I have a similar problem as the one he solved, expect I want to fit the cumulative distribution. So I started trying to generalize the code. I did three modifications:
a) After the line where the histogram is calculated, I added
hist = numpy.cumsum(hist)

This transforms our distribution into a cumulative distribution
b) Instead of the gaussian function in the example, I defined a new function
def myerf(x, *p):
    A, mu, sigma = p
    return A/2. * (1+math.erf((x-mu)/(math.sqrt(2)*sigma)))

This is what the cumulative distribution of a gaussian should be.
c) Lastly, of course, I changed the curve_fit line to call my function:
coeff, var_matrix = curve_fit(myerf, bin_centres, hist, p0=p0)

This should be a trivial exercise, except it doesn't work. The program now returns the following error message:
bash-3.2$ python fitting.py
Traceback (most recent call last):
  File "fitting.py", line 27, in <module>
    coeff, var_matrix = curve_fit(myerf, bin_centres, hist, p0=p0)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 506, in curve_fit
    res = leastsq(func, p0, args=args, full_output=1, **kw)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 348, in leastsq
    m = _check_func('leastsq', 'func', func, x0, args, n)[0]
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 14, in _check_func
    res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 418, in _general_function
    return function(xdata, *params) - ydata
  File "fitting.py", line 22, in myerf
    return A/2. * (1+math.erf((x-mu)/(math.sqrt(2)*sigma)))
TypeError: only length-1 arrays can be converted to Python scalars

So what am I doing wrong?
Bonus: give me a reference which explains what that *p is in the argument of the function.
Thanks!
EDIT: I tried running the program with cumulative distribution data, but still calling the gaussian function. That works, you just get a bad fit. So the mistake should be somewhere in myerf function.
EDIT2: If I try substituting the myerf function's return with something simpler, like
return A + mu*x + sigma*x**2

then it works. So there must be something in that return that isn't doing what it's supposed to.
EDIT3: So, I tried using the error function from scipy instead of that from math, and it works now. I have no idea why it wasn't working before, but it's working now. So the code is:
import matplotlib
matplotlib.use('Agg')
import numpy, math
import pylab as pl
from scipy.optimize import curve_fit
from scipy.special import erf

# Define some test data which is close to Gaussian
data = numpy.random.normal(size=10000)

hist, bin_edges = numpy.histogram(data, density=True)
bin_centres = (bin_edges[:-1] + bin_edges[1:])/2
hist = numpy.cumsum(hist)

def myerf(x, *p):
    A, mu, sigma = p
    return A/2. * (  1+erf(((x-mu)/(math.sqrt(2)*sigma)))  )

# p0 is the initial guess for the fitting coefficients (A, mu and sigma above)
p0 = [1., 0., 1.]

coeff, var_matrix = curve_fit(myerf, bin_centres, hist, p0=p0)

# Get the fitted curve
hist_fit = myerf(bin_centres, *coeff)

pl.plot(bin_centres, hist, label='Test data')
pl.plot(bin_centres, hist_fit, label='Fitted data')

# Finally, lets get the fitting parameters, i.e. the mean and standard deviation:
print 'Fitted mean = ', coeff[1]
print 'Fitted standard deviation = ', coeff[2]

pl.savefig('fitting.png')
pl.show()

Answer: Unlike the math functions, the numpy functions do accept vector input:
>>> import numpy, math
>>> numpy.exp([4,5])
array([  54.59815003,  148.4131591 ])
>>> math.exp([4,5])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a float is required