Group homomorphism from $SL_2 (\mathbb Z / 5 \mathbb Z)$ to $S_5$

Question: I need to find a group homomorphism from $SL_2 (\mathbb Z / 5 \mathbb Z)$ to $S_5$. There is obviously the trivial homomorphism but I am then asked to deduce that $SL_2 (\mathbb Z / 5 \mathbb Z)/\{I,-I\} \cong A_5$, so ideally I want a homomorphism with kernel $\{I,-I\}$, and image $A_5$ so I can use the isomorphism theorem. Any hints?
Comment: @PedroTamaroff Yes, there are three non-solvable groups of order $120$, $S_5$ with a $2$ at the top, ${\rm SL}(2,5)$ with a $2$ at the bottom, and $A_5 \times C_2$ with both.
Comment: You could show that ${\rm PSL}(2,5)$ is a simple group of order $60$, and use thus that $A_5$ is the unique simple group of order $60$.  You can show more generally that ${\rm PSL}(2,K)$ is simple provided $K$ has more than three elements.
Comment: As a general tactic, morphisms $G\to S_n$ arise whenever $G$ has a subgroup of index $n$, see [this](http://math.stackexchange.com/questions/1096128/elementary-applications-of-cayleys-theorem-in-group-theory/1096134#1096134). If you could show that ${\rm SL}(2,5)$ has a subgroup of index $5$ that contains the center of ${\rm SL}(2,5)$ you might be in good path.
Comment: (It is interesting to note that ${\rm SL}(2,5)$ is not isomorphic to $S_5$, however!)
Comment: This is related to http://math.stackexchange.com/questions/1096446
Answer: I couldn't claim that this is an easiest way; but I have explained once this solutionway in my classroom for undergraduates.
The group $A_5$ has presentation $\langle x,y\colon x^2=1, y^3=1, (xy)^5=1\rangle$.
We can obtain a homomorphism you expect by this presentation. We find a pair of elements $X,Y$ in $SL(2,5)$ such that $X$ has order $2$, $Y$ has order $3$ and $(XY)$ has order $5$.
Each element of $SL(2,5)$ gives a Mobius transformation $z\mapsto \frac{az+b}{cz+d}$ where $a,b,c,d$ are in the domain=codomain=$\{0,1,2,3, 4,\infty\}$ of the transformation (convention $1/0=\infty$ and $1/\infty=0$). So we may try to find two Mobius transformation, one of order $2$, one of order $3$ so that their product has order $5$.
One choice for Mobius map of order $2$ is $z\mapsto \frac{-1}{z}$. For order $3$ Mobius map, one possibility is to find a map $z\mapsto \frac{az+b}{cz+d}$, such that $0\mapsto 1\mapsto \infty\mapsto 0$ (so that its order will be $3$), and it is in fact $z\mapsto \frac{1}{1-z}$.
Now it is easy to check that their product turns out to be order $5$.
What are the corresponding element in $SL(2,5)$? Well. These are
$$X= \begin{bmatrix} 0 & 1\\ -1 & 0\end{bmatrix} \mbox{ and } Y= \begin{bmatrix} 1 & 0\\ -1 & 1 \end{bmatrix}$$
which can be written just by considering the coefficients involved in the Mobius transformations. Now, the map $X\mapsto x$ and $Y\mapsto y$ can be uniquely extended to a homomorphism $f\colon SL(2,5)$ to $A_5$ (or $S_5$) (from the definition of the free group; I will not make it too technical.) And, thats it.
.
Comment: You said that you were looking for $X$ and $Y$ in ${\rm SL}(2,5)$ such that $X$, $Y$, and $XY$ have orders $2,3,5$, but in your final choice of $X$ and $Y$, they have orders $4,5,3$. Note also that the only element of ${\rm SL}(2,5)$ of order $2$ is $-I_2$, which is in its centre.
Comment: Yaa! If we go modulo $\{\pm I\}$, then we get a homomorphism. So here $SL(2,5)\rightarrow PSL(2,5)\rightarrow A_5$ is the required homomorphism, where first one is quotient and second is obtained by $\bar{X}\mapsto x$,  $\bar{Y}\mapsto y$. Thanks for notification.
Answer: Just wanted to add some extra commentary.

Let $I$ be the rotational symmetry group of the (regular) icosahedron. By orbit-stabilizer, it has order $60$. It is a subgroup of $\mathrm{SO}(3)$, the full group of $3\times3$ rotation matrices. Every edge of the icosahedron uniquely determines a compound of three inscribed semiperpendicular golden rectangles:
$\hskip 0.5in$
There are $6$ icosahedron edges per compound, so there are $30/6=5$ compounds. Note $I$ acts on this set $\Omega$ of $5$ compounds, indeed we may identify $I$ with an index $2$ subgroup of $\mathrm{Sym}\,\Omega$, forcing it to be the alternating subgroup by uniqueness. Thus, $I\cong A_5$ by labelling the compounds $1$ thru $5$.
On the other hand, there is a double cover $2I$ of the icosahedral group (called the binary icosahedral group), which is the preimage of $I$ under the $2$-to-$1$ group homomorphism $S^3\to\mathrm{SO}(3)$, where $S^3$ is the group of versors (unit quaternions). (There are many resources discussing how the antipodal versors $\pm \exp(\theta\mathbf{u})$ represent the $3$D rotation around the $\mathbf{u}$-axis by $2\theta$, where $\mathbf{u}$ is a unit vector.) By considering quaternions as a $2$D complex vector space, we may identify quaternions with $2\times2$ complex matrices, in which case $S^3$ may be identified with $\mathrm{SU}(2)$. Then the elements of $2I$ may be reduced mod $5$ to get $\overline{2I}=\mathrm{SL}_2(\mathbb{F}_5)$. Since the kernel of $2I\to I$ corresponds to the kernel of $\mathrm{SL}_2(\mathbb{F}_5)\to\mathrm{PSL}_2(\mathbb{F}_5)$, we conclude $I\cong\mathrm{PSL}_2(\mathbb{F}_5)$.
Thus, $\mathrm{PSL}_2(\mathbb{F}_5)\cong A_5$. I explained this in my answer here.

Symmetric groups have trivial outer automorphism group, except for the exceptional case of $\mathrm{Out}\,S_6=\mathbb{Z}_2$. An outer automorphism of $S_6$ swaps cycle types $(\cdot\cdot)$ and $(\cdot\cdot)(\cdot\cdot)(\cdot\cdot)$ as well as $(\cdot\cdot\cdot)$ with $(\cdot\cdot\cdot)(\cdot\cdot\cdot)$. While the subgroup $A_5$ stabilizes a point, its image under an outer automorphism is an "exotic" copy of $A_5$ which is actually transitive. This matches (up to relabelling) the action of $\mathrm{PSL}_2(\mathbb{F}_5)$ on $\mathbb{F}_5\mathbb{P}^1$ and of $I$ on the set $\Phi$ of antipodal pairs of vertices of the icosahedron (note $|\mathbb{F}_5\mathbb{P}^1|=|\Phi|=6$ in contrast to $|\Omega|=5$).


CKEditor Inline Editing on jQuery UI

Question: I'm stuck on making CKEditor inline editing work on jQuery UI, especially on Tabs. Does anyone know how to make it work? Are there any plugins that will make CKEditor work on jQuery UI?
Answer: I had a similar issue and it turned out to be due to how the browsers were handling the "hidden" or "disabled" components which had yet to be rendered.
http://ckeditor.com/ticket/9814 gave a example of adding a listener to change the readOnly status when the instance becomes ready.
var ck = CKEDITOR.inline(element);
ck.on( 'instanceReady', function( ev ) {
   var editor = ev.editor;
   editor.setReadOnly( false );
});

Answer: I've been struggling with the same problem since this morning, but I found a fix.
var objCKeditor = new Object({
    config: base_url + "library/applications/ckeditor/config.simple.js"
});
var objTab = new Object({
    active: false
});
CKEDITOR.disableAutoInline = true;
// Activate your editors when the tabs themselves are activated.
$( ".navigation-tabs" ).on( "tabsactivate", function( event, ui ) {
    // Find which tab has been chosen by the user.
    objTab.chosen = $(this).tabs('option', 'active');
    // Only initialize the editors once...
    if ( (objTab.chosen == 3) && (objTab.active == false) ) {
        // Loop through the editors.
        $( 'div.link-bookmark-comment').each( function() {
            // Find the ID for the editor.
            objCKeditor.editor = $(this).attr('id');
                // ... which is facilitated by this boolean.
                objTab.active = true;
                CKEDITOR.inline( objCKeditor.editor, { customConfig: objCKeditor.config } );
        });
    }
} );

So, it would appear that CKEditor does not like to be placed within tabs, or any object which is initially hidden.

CKEditor Inline Editing on jQuery UI


L-selectin in white blood cells

Question: The white blood cells' function is mainly to fight off external antigens. However, another one of its traits is its ability to bind to vascular endothelial cells with the help of L-selectin. What is the purpose of this, and how does this help us?
Answer: Fighting of harmful microbes (and not antigens per se, although specific antigenic recognition is important), involves a lot of processes which require several lignad-binding molecules and ligands on the WBC surface. While the whole array of these proteins and their functions is very complex, we can take the case of a neutrophil trying to defend the body against microbes in a local wound, the so-called acute local inflammation response.
1. Adhesion to the endothelium
Here is where several selectins play a role. The simple broad idea is that in presence of microorganisms, as sensed by the local immune cells (tissue macrophages, blood cells in case of a vessel breach etc), there is an upregulation of chemokines in the local environment which causes the endothelium to increase the expression of certain adhesion molecules (ligands with receptors on WBC and vice versa) as well as other hemodynamic changes causing the neutrophil to come in close contact with these in the vicinity of the wound and bind to the endothelium. This is ften subdivided into three processes, margination, rolling and adhesion. L-selectin is one of these adhesion mediators, along with other selectins and integrins.
2. Migration through the endothelium into the tissues (diapedesis)
3. Chemotaxis towards microbes
4. Action on the microbes
Points 2,3 and 4 have their own mediators (see CD31, chemokines - AA, C5a, leukotrienes).
Reference:
Robbins and Cortran: Pathologic Basis of Disease, 9e
Other sources:
Wikipedia page

L-selectin in white blood cells


error burning in nero

Question: I was trying to burn some videos on the dvd. It took about 7 minutes to burn it. But I got this error when the burning was about 100%. Will it have any effect on the video or the dvd. Why did I get this error?
alt text http://dl.dropbox.com/u/6863746/pics/avatar.png
Comment: What filesystem are you burning with? Joliet? UDF?
Comment: the default used by nero
Answer: Depending on your file system, the names might be too long. Try using directories (eg h:\Avatar\Book1\Chapter 20 - The seige of the north 2 or simply h:\Book1\Chapter 20 - The seige of the north 2)
Answer: The filenames are too long to be burned. You should either make the filenames much shorter before you burn the files to disc or use UDF mode. A good program that is an alternative to nero is CDburnerXP. It will suggest solutions when you get problems like these, and switch settings around for you.

error burning in nero


Are there any benefits for a researcher or university in terms of number of grants submitted?

Question: I was talking with a faculty member and her strategy is to submit to as many grant proposals even if the quality is not high. And in fact, one of her grants was accepted. Are there any benefits for a researcher or university in terms of number of grants submitted even if the quality is low-medium and they were not awarded?
Answer: There are no direct benefits if the applications are not accepted. There might be some indirect benefits, if during the writing process the researcher gains feedback on their ideas and plans from colleagues or reviewers. Or, it might be useful to show evidence to your boss that, in the absence of grant income, you are indeed attempting to secure some.
But one important benefit is mentioned in your question already:

in fact, one of her grants was accepted

You've got to be in it to win it. There is definitely some unpredictability in the grant application process, in terms of who reviews it, who is on the panel, what mood the panel are in on that particular day, etc. So, (all else being equal) the more you submit, the more chance you have.
Importantly, there are also potential disadvantages of submitting large numbers of low quality grants. For example, NERC UK has instigated a "demand management" system for its standard grants, such that if an institution's success rate drops below 20% they will be limited in the number of applications they can submit the next year. The NSF (which is tagged in OP's question) places limits on the number of applications from an institution for a number of its grant schemes. For an individual researcher, this means that they probably need to get through an internal review before they can submit a grant application. In both internal and external reviews, it may not go down well with your colleagues/peers if you regularly submit low-standard grant applications, resulting in reputational damage.
Answer: The agencies I have applied to ask for reviews, and the applicant gets these reviews. Those can help to improve the grant proposal, to be submitted to another agency.
I would be hesitant to recommend such a "shotgun approach", as the reviews in the agencies I have applied for are not blind. They cannot be, because the reviewers are also asked to rate the applicant. With a shotgun approach I would very quickly get a bad reputation.
Answer: Some universities are not receiving many grants because they are not applying for very many.  In one case I saw "submit more grant applications" as a strategic goal.  In  this case submitting many mediocre applications may help a faculty member get promoted.
Some universities reward faculty whose external grant applications are unsuccessful with internal research funding.  There is some quality standard.
Answer: The more "random" the decision process is, the more benefit does this approach have. So, if rolling dice is a good approximation of how that particular funding body selects applications (or a program committee selects papers, by the way), this is a valid strategy.
Now, let's hope for the best that there are not very many funding bodies and IPCs like this.
Comment: The answer was obviously quite ironical, though I have heard enough _stories_...
Comment: This is not a helpful answer. Funding bodies do not randomly selected projects to fund, and poorly written proposals will nearly always get rejected, everywhere, unless the *content* of the proposal is a spectacularly good idea.
Answer: When going up for tenure, junior professors often must show evidence of attempts to secure funding. Particularly at R1 schools where having external funding is an important part of the tenure decision, having this documented evidence could mitigate a lack of successful awards. Also, as others noted, a shotgun approach does sometimes work, and the exercise in grant writing helps flesh out one's research program and may suggest alternative paths of inquiry.
Answer: There are a few reasons I have encountered for approaching things this way:
It's All Random
There is a perception among some people that, as long as you're writing a "good-ish" proposal (i.e. one that's not appallingly poor in its ideas or written style) that whether or not your grant is actually funded is something of a random process. Relatively low inter-reviewer agreement (see here: http://www.pnas.org/content/early/2018/02/27/1714379115) and scores that jump up and down between revisions helps cement this perception.
If one believes this - and one believes that their normal grant falls in this "good-ish" category, then it's logical to view funding as a function of how many grants you submit.
Similarly, if one believes this, the marginal benefit of polishing a grant vs. writing another is pretty heavily skewed toward writing another once you get it past that "good-ish" threshold.
I Need to Report Something
With tenure evaluations at many institutions still relying on funding and (arguably) not having caught up with the idea that junior faculty may be good researchers and not have secured a major grant by the time they come up for tenure, one may feel pressure to at least look like you're trying.
Note that this has plusses and minuses to it. I have seen people criticized for not going after the "good" money (NIH/NSF), but I've also seen people criticized for having an extremely low hit rate ("He submitted twelve grants last year and none of them got funded).
Grant Review as a Sounding Board
Occasionally, it's not clear what's fundable in a particular field - especially if some of the "Big Names" have certain territories staked out already. In those cases, someone pay use the shotgun approach to see if anything seems to catch reviewer's attention. In essence, you're hoping here not to get funded (though that would be nice) but to see if some of the applications get a decent score on the various scientific merit metrics, and if those have a coherent pattern to them.

As other folks have mentioned, there's definitely downsides to this, including that the applications aren't blinded, that the researcher or institute might develop a reputation, etc.


Can you pull the emails collected through a "form" and dump them into a Civi CRM group?

Question: If I create a form that will collect email addresses, can those email addresses be exported or added to a Civi CRM group for later mailings?  I am trying to find a way to collect emails on the front end of our website then add them tour interest group mailing list on the back end without having to manually create a new contact that will then be able to be added to the group.
Comment: It might help figure out which of below answers is helpful if you can clarify if everyone who is completing your form is being added to your mailing list, or only those who opt-in. For everyone, then Mick's answer is probably most helpful.
Answer: Welcome to SE!  There are several ways to add email addresses to a mailing list. See this section in the User Guide.
What CMS are you using?  On Drupal, you can use webforms.  On WordPress you can use Caldera Forms or Contact Form 7
The GDPR extension also provides a page for people to choose which groups they want to belong to.
Comment: Thank you, we have used Caldera forms in the past but we end up inputting by hand the information from that list.  We are thinking of using the profile option on Civi, thanks for you help!
Answer: You can do all this with a profile. It has options in the advanced section to create a contact from the form and also to add the contact to a specific group. If you are wanting sign to multiple groups you will need to explore one of the other answers.
Comment: Thank you I think the profiles will work great!
Answer: A couple of other ideas to add to Aidan's suggestions.
If you make your Group 'public' and then add the Group field to a profile, the Group will be listed for folk to tick. (it will list all 'public' groups, so if you only have one then you are sorted)
You can also just add a custom field eg 'newsletter sign up' = 'yes' and then build a Smart Group
Comment: Thank you for that idea, I will look into this as option as well!


Let $\{a_n\}$ and $\{b_n\}$ be convergent sequences. When is the sequence $a_1, b_1, a_2, b_2, \dots$ convergent and what is its limit?

Question: I'm currently trying to prove that the sequence $(c_n) = (a_1, b_1, a_2, b_2, \dots)$ converges only when $\lim a_n = \lim b_n$. I know that the sequence will not converge when $\lim a_n \ne \lim b_n$. So would I next have to show that $|c_n-C|<\epsilon$ and if so how would I choose my epsilon.
Comment: You don't choose the $\epsilon$. It is given. You want to find the $N$. What you want to do for this problem is to write what convergence in $a_n$ and $b_n$ give you and then notice that we can write the distance from $c_n$ and $C$ in terms of what we already got from $a_n$ and $b_n$.
Comment: sorry I meant N
Comment: I'm a little confused how can rewrite $c_n$ and $C$ in terms of $a_n$ and $b_n$ would it be something like |($a_n$+$b_n$)-($A$+$B$)|=|$c_n$-$C$|
Answer: You know that there exists a $N_1$ and a $N_2$ such that the respective distances to the limit are less than $\epsilon$. Then you can take $N:=\mathrm{max}(N_1,N_2)$ and have the result.
Comment: I understand that but, how does that help me prove that $c_n$ is convergent?
Comment: Then you have that $|c_n-C|<\epsilon$ for $n>2N$ where $C$ denotes the limit of both sequences.


Can BIOS virus/malware be used to steal data?

Question: Since a BIOS isn't connected to the internet, even if your BIOS is infected with a malware (say you used a  usb to flash it but with files that wasn't from the official motherboard manufacturer's site). Is the damage limited locally to the functionality of your system? In that your data can't really be transmitted through the internet to another party?
Answer:
Depends on the BIOS if it can connect to the internet. Most modern UEFI are able to do so, but usually don't for security reasons
Depends on the Malware. When the Malware is in the BIOS it could supply the necessary "driver" (code) to utilize your Network connection and might even implement DHCP so it get an IP and then I could probably connect to the internet and send data there.
That Malware needs to be able to understand the Filesystems (e.g. NTFS, FAT32, ext4, ...). Most BIOS are limited to only be able to read FAT32, but again your Malware might be able to expand the capabilites.

Overall it depends on the Malware, your BIOS and Mainboard. For the malware to actually do this, it would need either presupplied network code from the BIOS or would need to have the specific code for that mainboard model to utilize the network components.
Also a counter Question: Do you mean BIOS, EFI or UEFI? A malware for a UEFI would be simpler to implement than for a BIOS, because BIOS is not really standardized, while UEFI is ("Universal Extensible Firmware Interface", the universal and extensible are the issue here).
TLDR: Yes it can reach the internet, even though hard.
You can see it like this: Windows and Linux are also able to access the internet and essentially can't do more than a BIOS.
Also be aware of this: Can BIOS malware be installed from OS?
You need to install the malware first before being able to do anything.
Greetings.
PS: your malware would also need the usual IP-Networkingstack implemented. e.g. IPv4 Packets, Ethernet-Frames, maybe even DNS
Comment: Thank you for your explanation! Is it common to get UEFI virus nowadays? I have UEFI, and I live on the assumptions that should I get a virus, I'm probably fine as long as I clean install my OS on my harddrive. I am trying to develop a plan / procedure for when my computer becomes infected, since I can never know to which level it infected my computer, I try to clean install / reset whenever possible. After hearing what you said, I think my plan should include a bios flashing usb to flash the BIOS back to a trustable version in case it is infected?
Comment: It is not common to get a UEFI virus in the scope of the world, but if you were specifically targeted (for whatever reason, e.g. you are the CEO of microsoft) you have a higher risk.
It also no unheard of that someone got their UEFI infected.


Linking Android to Chromebook Gnucash

Question: I have GNU Cash on my Android phone which I purchased a few months ago. I have about 3 months worth of data in there. I have recently purchased a Chromebook and want to link the info in gnu cash (phone) to my Chromebook, so that I could use either device to enter transactions and they will both update as I enter new transactions. Is this possible?
Answer: I am not sure which android app you are using, maybe "Gnucash Mobile for Android"? This seems to be no longer maintained.
Having said that, I would like to point out that it is possible to use Gnucash across multiple devices by using the SQL backend. It would require you to run a sql server such as Postgresql and possibly quite some cumbersome setup of all involved devices. But it should avoid the syncing problem of the file based approach.
Answer: The GnuCash Android app is not intended to automatically sync with your desktop GnuCash app.  The developers explicitly state this on the GnuCash page on the Google Play Store:

NOTE: that the app does not offer full compatibility with GnuCash for
the desktop. You cannot synchronize between the desktop app and this
one. But you can import your accounts and transactions from GnuCash
XML files.

I have GnuCash installed on both Windows 10 and Ubuntu machines.  Those installations happily share (one at a time) a single data file stored on a mounted DropBox folder.  I also use the Android version of the app as a mobile data capture system to enter details of my purchases while I'm out and about - so I can record details of my coffee purchase while I'm waiting for the barista to do her thing.
Once per week (or daily, if you prefer) the GnuCash app on my phone exports the new transactions to a folder on DropBox from where I can easily import the transactions into my main GnuCash system (using either Windows or Linux).
As far as I know, the answer to your question is No, you can't use either your Chromebook or your mobile phone to update the same GnuCash database with full synchronisation.  But the mobile app is still a useful way to prepare your data as a file that can be easily imported into the main system.
Answer: Probably not. GNUcash is a software, not a cloud service.
At least the version of GNUcash I use (Linux) does not support anything except local file systems.
The closest to what you could have is to store the GNUcash file in Google Drive. At least the Android version supports that: https://play.google.com/store/apps/details?id=org.gnucash.android&hl=en
...but whether the Chromebook version supports that is anyone's guess. If you are running the mobile GNUcash (Android) application on Chromebook, perhaps then it could work. At least the information I found about GNUcash+Chromebook seems to be that it's the Linux version you use on Chromebook. Thus, it won't support remote file systems.
You could try something to mount Google Drive like a local file system. Not sure how well that works, though. In Linux it might work, but apparently not on Chromebook: https://www.reddit.com/r/chromeos/comments/6zi0d9/google_drive_mountpoint/
Answer: You may be able to do this with Syncthing. There is an Android application for it. You would run it on both devices. And then would setup Syncthing to synchronize a directory that contains your gnucashdata files, and thus be able to open your account data on either device.
However, doing this exposes you to a possible race-condition. My gnucash software on Linux does try to detect if the file is already open elsewhere with the use of a lock-file. However, I would not guarantee that it will prevent both your Chromebook and Android phone from writing to the data at the same time.
Comment: `syncthing` will create a local "conflict file" to prevent the race condition scenario
Comment: This still would be a very "wobbly" system with more potential for error. I would not want to need to decide which file to use (how to resolve conflicts). I think Greg Schmidt's answer is clear and straightforward. I use sqlite backend and even though I could update it via SQL, I do not want to - I would prefer GnuCash interface - either single entry or importing a batch of transactions.

Linking Android to Chromebook Gnucash


Contact form 7 - How to send mail to two different E-mail Address

Question: I am using Contact form 7 plugin for my WordPress website. When User submit the form E-mail is sent to Admin with subject and all the details like name, email, phone, city, zip-code etc..At the same time I also want to send another E-mail to another Admin with fewer details like different subject line and name, email and phone. How to achieve this ??
Answer:
 please see screenshot. go to Contact form > open your desire form > Click on Mail tab enter emails use comma "," to make them separated
Answer: For your second question (how to send separate email with different info): see the mail2 tab below the first mail entry on the Mail tab. Click the checkbox to get another Mail form where you can set up the second email.


Why does CMRR degrade in an instrumenation amplifier when the feedback resistor is increased?

Question: Why does CMRR degrade in an instrumenation amplifier when the feedback resistor is increased, keeping all other resistances constant at a fixed value? What mathematical relationship links the feedback resistor and CMRR?
Comment: It doesn't have to be an InAmp - do you understand why this happens in a differential input amplifer?
Comment: @Andyaka Not really. Also, I observed experimentally that CMRR goes down sharply with increase in R3
Comment: There are two R3's in your schematic but your text refers to a singular resistor. Are you increasing both or not?
Comment: Only one (feedback resistor)
Answer: This problem has at its heart the differential amplifier: -

So, if V1 is grounded, the amplification of V2 is calculated by first recognizing that V2 is attenuated by R2 and Rg and, for the sake of argument, make R2 = Rg hence the attenuation is 2:1. The signal at the +input is then amplified by the factor 1 + Rf/Rg and, if Rg = Rf then the amplification is two and the overall amplification of V2 is unity.
On the V1 side, we know the amplification is -Rf/R1 and if R1 = Rf then the amplification is -1.
This means that if R1 = R2 = Rf = Rg and both V1 and V2 have exactly the same voltage applied, no matter what that input voltage is (within the constraints of the power rails), Vout remains at ground level (0 volts).
It can be further shown that this situation is also true if the ratio of Rf to R1 equals the ratio of Rg to R2 (do some math!).

Why CMRR degrades in Instrumentation Amplifier when R3 (only the
  feedback resistor) is increased keeping all other resistances constant
  at a fixed value?

For the reasons I mentioned above. It's not limited to InAmps but all differential amplifiers.
Answer: I assume you mean, as both instances of R3 are increased. (If you only change one of them, this is not a differential amplifier at all, so CMR will be very poor, as Andy aka explains.) In the idealized circuit, there is no reason why this should degrade CMR. However, in the real system it gets harder and harder to keep the two instances of R3 exactly matched as impedance levels increase. In particular, they will have capacitive strays that are difficult to control.


Lithium power supply not working

Question: Re: Kuman Lithium Battery Pack Power Expansion Board with Switch + Micro USB Cable for Raspberry Pi 3 Model B, Pi 2 Model B & Pi 1 Model B+ A+ A KY68
I just bought this for use with Pi3 model B and camera.  Charged it on the Pi until the red light went out. Then turned off Pi, unplugged power supply and then plugged in the battery power pack. Nothing happens. No light, no output, nothing. Took out the camera and still nothing.  Suggestions?
Answer: Based on your picture, it looks like the power switch is flipped off. If you look at the board oriented with RPi PowerPack V1.2 at the top, you'll notice there's a switch at the very bottom of the board. Switch it to On.
I'm not sure if this matters, but in the images provided by your link, they all show the RPi being plugged into the top USB port. If they're ordered, it may make a difference.
Comment: Thanks! Never thought about a switch. No documents shipped with product and no info on website.  I'm up and running.

Lithium power supply not working


Are there chess apps that allow users to record moves and do not include a chess engine?

Question: I have seen chess apps that work as a chess clock. Are there chess apps  that allow users to record moves and do not include a chess engine? The idea is to use the app during a chess tournament as a experiment. There are no economic prizes, so we consider the chance of cheating very small. Also, we are trying to educate people more than create world chess champions.
Comment: There no app that will record your moves for you.  When you see that in a tournament, they are using a special chess board and pieces.
Comment: @TonyEnnis Brian Towers posted an answer. The app exists! However, it seems that is available only for Android. The name of the app is Clono chess System.
Comment: @TonyEnnis I found one for iPhones! https://apps.apple.com/us/app/chess-score-pad/id518018730
Answer: Yes, the Clono Chess System runs on a tablet and has been approved by FIDE as an electronic scoresheet that can also broadcast the moves in the way that we see on Chess24.
Comment: I found one for iPhones! https://apps.apple.com/us/app/chess-score-pad/id518018730
Comment: I found another for Android. Blieb Chess Recorder Pro.  https://play.google.com/store/apps/details?id=com.bliebapps.bliebchessrecorder.pro&hl=en
Answer: For Android - https://play.google.com/store/apps/details?id=com.chess.clock&hl=en_US&gl=US&pli=1
For Apple - https://apps.apple.com/us/app/chess-clock-by-chess-com/id858039162
One from chess.com - https://www.chess.com/news/view/chess-clock-app-update
Comment: Thank you for your answer. I do not know if I explain myself properly. My question is about a an app to record the moves, not about a chess clock. Of course, if there is an app that can do both, would be awesome.


Tomcat service running on EC2 Instance

Question: I have Tomcat hosting a web app on port 8080 within an EC2 micro instance. From my home network I can get to the web page no problem, but from any other network 3G cell, or my co-worker's home network the website "stops responding" and never connects. I've checked the security settings for the instance multiple times and have set port 8080 for access from 0.0.0.0/0. I consistently connect from my home network without issues. Is there an EC2 setting that only allows incoming traffic from one ip?  Any ideas on why I can only connect from my home ip?  Thanks
Answer:
Are you using the public DNS name for your EC2 instance?
Try accessing your IP/port from an external tool such as:
http://www.watchmouse.com/en/checkit.php
Run netstat -a or tcpdump to see if your request actually arrives on the server or if there is some application issue preventing a response
Answer: You might want to think about using Amazon Elastic Beanstalk Tomcat instead.  Each instance of Beanstalk is the same price as a node of Linux or Windows.  Also, you can compile and publish directly to the Beanstalk instance from Eclipse.  All of this takes a little bit of money of course, probably as much as 12 cents per hour, depending on how you deploy.

Tomcat service running on EC2 Instance


How to prove that $\int_{-\infty}^{\infty}f'(t)\exp(-t^2)\text{d}t$ is finite when $\lim_{|t|\to \infty}f(t)\exp(-t^2) = 0$?

Question: Given a function $f$ which is continuously differentiable over the real line, and given that $\displaystyle \lim_{|t|\to \infty}f(t)\exp(-t^2) = 0$ how does one prove that $\displaystyle \int_{-\infty}^{\infty}f'(t)\exp(-t^2)\text{d}t$ is finite?
Answer: I think you can't. Just looking at the positive side of your integral, consider
$$f:t\mapsto \frac{e^{t^2}}{\sqrt{t+1}}$$
You do have $\lim_{t\to+\infty} f(t)e^{-t^2}=0$, but
$$f'(t)e^{-t^2} = \frac{2t\sqrt{t+1}-\frac{1}{\sqrt{t+1}}}{t+1} \sim_{t\to+\infty} 2\sqrt t$$
which is not integrable on $[0,+\infty[$.
Answer: The result is wrong as stated
By integration by parts for $a >0$
$$\int_{- a}^a f^\prime(t) e^{-t^2} \ dt = \underbrace{\left[f(t)e^{-t^2}\right]_{-a}^a}_{A}+2\underbrace{\int_{- a}^a tf(t) e^{-t^2} \ dt}_B $$
$A$ converges to zero as $a \to \infty$ by hypothesis.
Now take a function $f$ that vanishes for $x\le 1$ and such that $\int_1^\infty tf(t) e^{-t^2} \ dt$ diverges. For example $$f : x \mapsto t^\alpha e^{t^2}$$ with $-2 <\alpha <0$. This will provide a counterexample as $B$ diverges for $a \to \infty$ while $f$ satisfies the hypothesis $\displaystyle \lim_{|t|\to \infty}f(t)\exp(-t^2) = 0$.
Comment: for $\alpha<0$ and real however this function is not continuously differentiable everywhere on the real axis. Not that it really matters, but just saying.
Answer: This cannot be true for all functions $f(t)$. Consider $f(t)=\frac{\sin t}{t}e^{t^2}$. This is continuously differentiable on the real line, and $f'(t)e^{-t^2}=2\sin t-\frac{\sin t}{t^2}+\frac{\cos t}{t}$. The $\sin t$ part makes the integral oscillate indefinitely and thus diverge.
More explicitly,
$\int^{\infty}_{-\infty}(2\sin t-\frac{\sin t}{t^2}+\frac{\cos t}{t})dt=2\int^{\infty}_{-\infty}dt\sin t+[\frac{\sin t}{t}]^{\infty}_{-\infty}=2\int^{\infty}_{-\infty}dt\sin t $ -(DNE)


How does AsicMiner pay the dividend?

Question: Can all stock holder get a login information or does dividend paid to private address? What?
Answer: The exchanges that ASICMiner trades their shares on require you to register with a Bitcoin address on which you want to receive your dividends.
See this answer on where ASICMiner shares can be traded.
When they pay out dividends, the total amount will be shared equally among all shares and payed of all shareholders by the address they gave the exchange to receive dividends on.
Answer: Private addresses.
They have a bitcoin address of each shareholder and each week they make a payment to this address, proportionally to the number of shares he owns.
This is one of the div-payment transactions (there are few of them each Wednesday): http://blockchain.info/tx/8e26e8fd5eada1dc5d5125b39db66129bb55645d654b4c6dfc4a0611f3de358d

How does AsicMiner pay the dividend?


Search 'refiner' on first letter of sitename

Question: In our SharePoint Online tenant, we use multiple site collections for teams and other collaborations. We want to make those site collections available via a search page on a site in the root site collection. Because we're talking about a few hundred sites, we want to make it possible to filter the sites by the first letter of the sitename. For now, we're using the following query:
Title:letter*
The problem with this query, is that it gives us the sites with a title where one of the words begins with the given letter (so not just the site where the first word of the sitename begins with the letter). Even better, in some cases it gives us sites that doesn't contain the given letter at all.
I've already been searching on the internet a bit for other solutions and I came across the following suggestion:
Search refiner on first letter of the title
I tried to apply method 2. I did manage to create a refinement filter that only showed the first letters of the filter options, but not in the way I wanted. For example, when we get the results Administration,  Accounting, Production and Sales, the refinement panel shows the following filter options:
Title
A
A
P
S
So the question is; in what way should the given method be implemented to work in the correct way?
Moreover, if somebody knows an other way to make it possible to filter on the first letter of the complete sitename, I appreciate it if you could share it with us.
Answer: The results make sense. You are using a colon in your query. The colon is a contains operator. I think what you want is Title=letter*
Comment: I already tried that, but when I use your suggestion I get no results at all.


Acacia shrubs in Ohio

Question: Is it possible to grow an Acacia variety in Ohio (zone 6)?  I'd prefer to not grow them in a greenhouse, I'm looking for something that will survive the winter (even if I cover it all winter).
Comment: Acacia is a huge genus and has many members many drought and cold hardy members.
Comment: @GradyPlayer Can you suggest some what will weather the cold Ohio winters?  From what I read, they (generally) need zone 8.  kevinsky suggested two that may work.  If you know of some, please make your reply a question so that I can upvote as needed.
Comment: Yeah not sure on species names, you will probably need species from north America, as Australian and African species are almost all subtropical
Comment: Looks like Acacia wrightii, Acacia gregii may be some of your better bets, I am trying to id one that is growing where I work in zone 6, but it may be a different but similar genus, it has a greatly expanded petiole, and diminished almost vestigial leaflets...
Answer: The hardiness of a plant is influenced by many factors some of which you can influence.

your local micro climate:
<code> - sheltered is good
 - warmer urban areas help
 - ideal soil conditions.
 - Acacias do not seem to withstand heavy snow loads so plant accordingly.
</code>
Although the hardiest acacias I could find were good to zone 7 ish the latest USDA zone map shows a creep of warmer winter temperatures northward.  I'm certainly seeing this where I live.

You could try these species:

Acacia obliquinervia good to at least -12 deg F 2 deg C
Acacia pravissima cultivated in Europe for many years

This web site is for gardening enthusiasts who like to push the definition of plant hardiness and may be of interest. Or this botanical garden in Texas has acacia seed for sale.
I would try growing plants from seed rather than buying established plants and plant as many as your garden will fit.
Comment: +1 thank you for the information.  Maybe if I grow some close to the house and in an area that's blocked off (inner part of an 'L') I'll have a chance.  I'll try the Pravissima seeds first.  I would think that I could eventually get enough seeds by natural selection to make a go at it.

Acacia shrubs in Ohio


Plotting CDF of a pandas series in python

Question: Is there a way to do this?  I cannot seem an easy way to interface pandas series with plotting a CDF.
Comment: There was a feature request for this, but it's outside pandas' domain. Use [seaborn](http://web.stanford.edu/~mwaskom/software/seaborn/tutorial/plotting_distributions.html#basic-visualization-with-histograms)'s `kdeplot` with `cumulative=True`
Comment: Could you define your problem? What's the input and output? scipy.stats have the cdf functions you might be interested in.
Comment: When I check out seaborn, I get this error "Cumulative distributions are currentlyonly implemented in statsmodels.Please install statsmodels.
"
Comment: Input is a series, output is a plot of a CDF function.
Answer: I believe the functionality you're looking for is in the hist method of a Series object which wraps the hist() function in matplotlib
Here's the relevant documentation
In [10]: import matplotlib.pyplot as plt

In [11]: plt.hist?
...
Plot a histogram.

Compute and draw the histogram of *x*. The return value is a
tuple (*n*, *bins*, *patches*) or ([*n0*, *n1*, ...], *bins*,
[*patches0*, *patches1*,...]) if the input contains multiple
data.
...
cumulative : boolean, optional, default : False
    If `True`, then a histogram is computed where each bin gives the
    counts in that bin plus all bins for smaller values. The last bin
    gives the total number of datapoints.  If `normed` is also `True`
    then the histogram is normalized such that the last bin equals 1.
    If `cumulative` evaluates to less than 0 (e.g., -1), the direction
    of accumulation is reversed.  In this case, if `normed` is also
    `True`, then the histogram is normalized such that the first bin
    equals 1.

...

For example
In [12]: import pandas as pd

In [13]: import numpy as np

In [14]: ser = pd.Series(np.random.normal(size=1000))

In [15]: ser.hist(cumulative=True, density=1, bins=100)
Out[15]: <matplotlib.axes.AxesSubplot at 0x11469a590>

In [16]: plt.show()

Comment: That'd be `histtype='step'` which is also in the `pyplot.hist` documentation truncated above
Comment: Is there a way to just get the step function and not have the bars filled in?
Answer: In case you are also interested in the values, not just the plot.
import pandas as pd

# If you are in jupyter
%matplotlib inline

This will always work (discrete and continuous distributions)
# Define your series
s = pd.Series([9, 5, 3, 5, 5, 4, 6, 5, 5, 8, 7], name = 'value')
df = pd.DataFrame(s)

# Get the frequency, PDF and CDF for each value in the series

# Frequency
stats_df = df \
.groupby('value') \
['value'] \
.agg('count') \
.pipe(pd.DataFrame) \
.rename(columns = {'value': 'frequency'})

# PDF
stats_df['pdf'] = stats_df['frequency'] / sum(stats_df['frequency'])

# CDF
stats_df['cdf'] = stats_df['pdf'].cumsum()
stats_df = stats_df.reset_index()
stats_df

# Plot the discrete Probability Mass Function and CDF.
# Technically, the 'pdf label in the legend and the table the should be 'pmf'
# (Probability Mass Function) since the distribution is discrete.

# If you don't have too many values / usually discrete case
stats_df.plot.bar(x = 'value', y = ['pdf', 'cdf'], grid = True)

Alternative example with a sample drawn from a continuous distribution or you have a lot of individual values:
# Define your series
s = pd.Series(np.random.normal(loc = 10, scale = 0.1, size = 1000), name = 'value')

# ... all the same calculation stuff to get the frequency, PDF, CDF

# Plot
stats_df.plot(x = 'value', y = ['pdf', 'cdf'], grid = True)

For continuous distributions only
Please note if it is very reasonable to make the assumption that there is only one occurence of each value in the sample (typically encountered in the case of continuous distributions) then the groupby() + agg('count') is not necessary (since the count is always 1).
In this case, a percent rank can be used to get to the cdf directly.
Use your best judgment when taking this kind of shortcut! :)
# Define your series
s = pd.Series(np.random.normal(loc = 10, scale = 0.1, size = 1000), name = 'value')
df = pd.DataFrame(s)

# Get to the CDF directly
df['cdf'] = df.rank(method = 'average', pct = True)

# Sort and plot
df.sort_values('value').plot(x = 'value', y = 'cdf', grid = True)

Comment: That's answer it's very detailed and helpful.
Comment: This is helpful indeed. Thank you!
Comment: There are no bins to be defined. No histogram here if that is what you are thinking.
Comment: How do I define the number of bins in this answer?
Answer: I came here looking for a plot like this with bars and a CDF line:

It can be achieved like this:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
series = pd.Series(np.random.normal(size=10000))
fig, ax = plt.subplots()
ax2 = ax.twinx()
n, bins, patches = ax.hist(series, bins=100, normed=False)
n, bins, patches = ax2.hist(
    series, cumulative=1, histtype='step', bins=100, color='tab:orange')
plt.savefig('test.png')

If you want to remove the vertical line, then it's explained how to accomplish that here. Or you could just do:
ax.set_xlim((ax.get_xlim()[0], series.max()))

I also saw an elegant solution here on how to do it with seaborn.
Comment: maybe the second axis should be in percentage (between 0 - 1)
Comment: @skibee That's a good suggestion. Feel free to edit the answer.
Answer: A CDF or cumulative distribution function plot is basically a graph with on the X-axis the sorted values and on the Y-axis the cumulative distribution. So, I would create a new series with the sorted values as index and the cumulative distribution as values.
First create an example series:
import pandas as pd
import numpy as np
ser = pd.Series(np.random.normal(size=100))

Sort the series:
ser = ser.sort_values()

Now, before proceeding, append again the last (and largest) value. This step is important especially for small sample sizes in order to get an unbiased CDF:
ser[len(ser)] = ser.iloc[-1]

Create a new series with the sorted values as index and the cumulative distribution as values:
cum_dist = np.linspace(0.,1.,len(ser))
ser_cdf = pd.Series(cum_dist, index=ser)

Finally, plot the function as steps:
ser_cdf.plot(drawstyle='steps')

Comment: Why is it necessary to append the last value?
Comment: `order` is deprecated. Use `ser.sort_values()`.
Comment: @kadee `ser[len(ser)] = ser.iloc[-1]` does not work on pandas 0.19
Answer: This is the easiest way.
import pandas as pd
df = pd.Series([i for i in range(100)])
df.hist( cumulative = True )

Image of cumulative histogram
Answer: I found another solution in "pure" Pandas, that does not require specifying the number of bins to use in a histogram:
import pandas as pd
import numpy as np # used only to create example data

series = pd.Series(np.random.normal(size=10000))

cdf = series.value_counts().sort_index().cumsum()
cdf.plot()

Comment: Nice answer! but cdf should be from 0 to 1; I'd change to `cdf=series.value_counts().sort_index().cumsum() / series.shape[0]`
Answer: Upgrading the answer of @wroscoe
df[your_column].plot(kind = 'hist', histtype = 'step', density = True, cumulative = True)

You can also provide a number of desired bins.
Answer: To me, this seemed like a simply way to do it:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

heights = pd.Series(np.random.normal(size=100))

# empirical CDF
def F(x,data):
    return float(len(data[data <= x]))/len(data)

vF = np.vectorize(F, excluded=['data'])

plt.plot(np.sort(heights),vF(x=np.sort(heights), data=heights))

Answer: If you're looking to plot a "true" empirical CDF, which jumps exactly at the values of your data set a, and with the jump at each value proportional to the frequency of the value, NumPy has builtin functions to do the work:
import matplotlib.pyplot as plt
import numpy as np

def ecdf(a):
    x, counts = np.unique(a, return_counts=True)
    y = np.cumsum(counts)
    x = np.insert(x, 0, x[0])
    y = np.insert(y/y[-1], 0, 0.)
    plt.plot(x, y, drawstyle='steps-post')
    plt.grid(True)
    plt.savefig('ecdf.png')

The call to unique() returns the data values in sorted order along with their corresponding frequencies. The option drawstyle='steps-post' in the plot() call ensures that the jumps occur where they should. To force a jump at the smallest data value, the code inserts an additional element in front of x and y.
Example usage:
xvec = np.array([7,1,2,2,7,4,4,4,5.5,7])
ecdf(xvec)

Another usage:
df = pd.DataFrame({'x':[7,1,2,2,7,4,4,4,5.5,7]})
ecdf(df['x'])

with output:
Answer: I really like the answer by Raphvanns. It is helpful because it not only produces the plot, but it also helps me understand what pdf, cdf, and ccdf is.
I have two things to add to Raphvanns's solution: (1) use collections.Counter wisely to make the process easier; (2) remember to sort (assending) value before calculating pdf, cdf, and ccdf.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter

Generate random numbers:
s = pd.Series(np.random.randint(1000, size=(1000)))

Build a dataframe as Raphvanns suggested:
dic = dict(Counter(s))
df = pd.DataFrame(s.items(), columns = ['value', 'frequency'])

Calculate PDF, CDF, and CCDF:
df['pdf'] = df.frequency/sum(df.frequency)
df['cdf'] = df['pdf'].cumsum()
df['ccdf'] = 1-df['cdf']

Plot:
df.plot(x = 'value', y = ['cdf', 'ccdf'], grid = True)

You may wonder why we have to sort the value before calculating PDF, CDF, and CCDF. Well, let's say what would the results be if we don't sort them (note that dict(Counter(s)) automatically sorted the items, we will make the order random in the following).
dic = dict(Counter(s))
df = pd.DataFrame(s.items(), columns = ['value', 'frequency'])

# randomize the order of `value`:
df = df.sample(n=1000)

df['pdf'] = df.frequency/sum(df.frequency)
df['cdf'] = df['pdf'].cumsum()
df['ccdf'] = 1-df['cdf']

df.plot(x = 'value', y = ['cdf'], grid = True)

This is the plot:

Why did it happen? Well, the essence of CDF is "The number of data points we have seen so far", citing YY's lecture slides of his Data Visualization class. Therefore, if the order of value is not sorted (either ascending or descending is fine), then when you plot, where x axis is in ascending order, the y value of course will be just a mess.
If you apply a descending order, you can imagine that the CDF and CCDF will just swap their places:

I will leave a question to the readers of this post: if I randomize the order of value like above, will sorting value after (rather than before) calculating PDF, CDF, and CCDF solve the problem?
dic = dict(Counter(s))
df = pd.DataFrame(s.items(), columns = ['value', 'frequency'])

# randomize the order of `value`:
df = df.sample(n=1000)

df['pdf'] = df.frequency/sum(df.frequency)
df['cdf'] = df['pdf'].cumsum()
df['ccdf'] = 1-df['cdf']

# Will this solve the problem?
df = df.sort_values(by='value')

df.plot(x = 'value', y = ['cdf'], grid = True)

Answer: It doesn't have to be complex. All it takes is:
import matplotlib.pyplot as plt
import numpy as np

x = series.dropna().sort_values()
y = np.linspace(0, 1, len(x))
plt.plot(x, y)


Creating a custom virtual machine from existing PC

Question: When converting an existing PC to a VM, whether using VMWare or VirtualBox, do either allow customization?  For example, convert an existing PC, but don't include certain data folders (music, video, etc.), so that the resulting VM is smaller in size?
Answer: As an answer was provided for windows+vmware, let's talk about linux+virtualbox.
I strongly advise working with partitions and not full disk when creating images.
First save the partition you want to virtualize using dd or partimage. For example, to save the first partition of the first sata disk execute this command in a writeable directory with enough free space (I consider the computer on which this is done as having more than 256 Mo of ram):
dd if=/dev/sda1 of=sda1_image.dd bs=128M

Once created you may mount sda1_image.dd in order to remove the files and directories you don't want in your VM (you need to be root to use mount and umount).
mkdir temporary_mount_point
mount -o loop -t auto sda1_image.dd ./temporary_mount_point/
rm -rf temporary_mount_point/path/to/a/directory/you/dont/want/in/your/VM
umount ./temporary_mount_point/

Then convert the dd image into a virtualbox disk image (vdi) using VBoxManage (a tool provided by VirtualBox):
VBoxManage convertfromraw -format VDI sda1_image.dd sda1_image.vdi

After this step you won't need sda1_image.dd anymore.
You can then use sda1_image.vdi to create a new VM within VirtualBox management interface. However it is always easier to explain how to do so from the command line (no necessary screenshot nor themed interface quirks, only copy-paste goodness):
VBoxManage createvm -name "VM_using_sda1_image" -register
VBoxManage openmedium disk /path/to/sda1_image.vdi
VBoxManage modifyvm "VM_using_sda1_image" -hda /path/to/sda1_image.vdi

You may want to adjust some more settings, but that would be dependent on the guest's OS nature.
Depending on the way the original OS was configured, you might need to reinstall a bootloader to the VM (or to restore the mbr) and/or manually flag the partition as bootable.
Comment: `dd` used that way will create an unpartitioned image, which will lead to an unbootable `vdi`. Also, `bs=128M` will cut performance in half as the machine will not be able to simultaneously read and write. Also if I recall correctly, up to 128M at the end will be skipped as that won't copy a partial record.
Comment: @avelldiroll: Cool answer. qst> If I remove some data from the mounted "dd-image" the size of image will not shrunk. So after, when will use the "VBoxManage createvm" will create expandable drive or fixed allocated space? So when my dd-image is from 300GB drive but i have only 30GB data on it i will get small (e.g. 30GB) **vdi** image or the big 300GB one?
Comment: For those that don't understand part 1 of @Potatoswatter's comment - Using /dev/sda**1** instead of just /dev/sda, will exclude the MBR from the image, the first and essential part of the boot process. Unfortunately I am not aware of why bs=128M will halve the performance. Perhaps something to do with the at least 256Mb of RAM available?
Answer: I believe that you can select volumes, but not folders.
See for example a very thorough walk-through for VMware with screenshots:
Step by Step instructions to do Physical to Virtual (P2V) Server Conversion Using Vmware Converter
Answer: Live View is a java-based VMWare forensic tool to create VMWare images from dd-style images or a physical disk.
Check it out at sourceforge.
LiveView


Can larger antennas damage an HT radio?

Question: Can adapting a larger antenna such as a Diamond X-50 or larger mag mount damage an HT radio? Would it overload the receiver?
Comment: What, please, makes you see that as a problem?
Answer: A larger antenna shouldn't damage a handheld radio. In a quiet area, it will make its receiver more sensitive, and it will radiate more power when transmitting.

Try to keep a receiving antenna away from a transmitter, to reduce the risk of damaging the receiver. I suspect we've all gotten away with it - my 50 W, 2 m mag mount was 30 cm from my car radio antenna and it wasn't damaged.
What you might find when adding an efficient, higher gain antenna to a handheld, is that it gets overloaded by strong signals near the amateur bands, making it more difficult to hear the station you want. (This isn't dangerous, the power levels are still very small).
Handheld radios are a compromise because of their small size and battery power, and often have a) less effective filtering and b) less robust receive amplifiers. Pre-amplifiers can be made more resistant to strong signals, by running them at a higher current. A handheld radio can't afford to waste 150 mW, so they use lower IP3, lower current amplifiers. c) finally the handheld expects to have a fairly poor antenna on it, which attenuates all the signals, so the receiver will be designed for that.
On a viewing platform on hilltop in the middle of a city, I've found that my handheld, with its short antenna, was nearly useless. All kinds of noises were breaking through and overlapping with the amateur signals.
Answer: A larger antenna can mechanically damage an HT if it is physically supported by the HT (it can stress the connector on some designs), but if it's on a feed line instead it shouldn't matter.
Besides just being awkward to use that way, I wouldn't want to connect RG-8 directly to my HT with a rigid adapter for the same reason.
Answer: No, it will likely improve reception because the HT antenna is severely compromised and done all the time in mobile applications to use an external antenna.

Can larger antennas damage an HT radio?


Has .Net IL changed at all since .Net 2.0?

Question: I've heard the claim before that .Net 3.5 made no changes to the IL that it compiles to. Upon thinking through all of the compiler features that I know were introduced, it does, in fact, seem that they could all be implemented in the same old IL, but I can't find an official source to corroborate this claim. Is it true?
Comment: Why do you ask why I ask?
Comment: Supplementary question: I know 4.0 definitely has a new CLR, but does it have any IL changes?
Answer: I think that there haven't been any IL changes as such, but there have been significant changes within the CLR implementation to make dynamic methods more efficient, allow for expression tree compilation etc. I seem to remember there have been changes around security of building dynamic methods, to make it feasible for lambda expressions generating expression trees to call private methods to work even in relatively low trust environments. The compiler knows that it's valid to call the private method because the point at which the source code is compiled has access to it. Proving that is tricky though :) See this note by Eric Lippert.
Comment: The IL hasn't changed but the compiler will have. We've noticed, for instance, that the internal tools in WCF create quite different C# for proxies and the like, which will in turn create different IL when compiled.

See also the discussion of "red bits" and "green bits" in Soma's log entry http://blogs.msdn.com/somasegar/archive/2006/05/18/601354.aspx.
Answer: The shipping CLR (Version 2.0.50727) has not changed since .NET 2.0, so your IL is identical. (See also this SO QA)
Comment: No, the CLR itself *has* changed - part of .NET 2.0 SP1 was a CLR change, I believe.
Comment: There have been several releases of the Version 2.0.50727 CLR since the original .NET framework 2.0 release. The original RTM release was e.g. Version 2.0.50727.42 . On my machine (Vista SP2) the full version is Version 2.0.50727.4016. However, AFAIK there have been no functional changes since the original release.
Answer: ..and as a result, if you wanted, you could use a lot of .NET 3.5 features in a .NET 2.0 project, as long as you use the latest compiler:

Automatic properties
Extension methods (requires a little dirty trick tho)
Object initializers
Type inference (var keyword)
Lambda expressions


Apple TV YouTube "Error occured loading this content"

Question: So my YouTube application for my Apple TV is not working. When I go to play a video, it shows "An error has occurred loading this content. Try again later." This first started happening yesterday out of the blue, and I double-checked to see if any of my other applications had the same problem but YouTube's the only one. I've unplugged and plugged back in the cords on the back of the box, and I've restarted Apple TV and still no luck. If anyone has any suggestions, please reply!
Answer:
Start the YouTube application on your Apple TV
scroll to the right to "settings" in your menu
click "settings" and go to "clear cookies"
choose "clear cookies" and start playing your videos again.
Answer: Had same issue. I cleared the cookies in the youtube app and it started working
Comment: Can you please elaborate on how you "cleared the cookies in the YouTube app"? As written, this answer is very vague and will likely attract down votes even if it does ultimately solve the problem. Thanks!


what is the best way to make a bunch of platforms appear randomly on a JFrame but close enough the player can reach them?

Question: Hi I'm trying to make a screen that will have a bunch of platforms that will place themselves randomly around a JFrame. I know how to do the stuff to make the character jump and to deal with the collisions just not a way to place the platforms on the screen randomly so they are close enough together that the character could reach. Any help is appreciated.
Answer: Think of the problem in reverse.  Instead of creating platforms that are randomly placed and then making sure they are withing jumping range of the player, instead create the platforms at the maximum jumping range of the player and then move them randomly.  So long as all your random movements are done towards the player you are guaranteed that they will be in range.
Answer: Well it's not very well defined what kind of physics etc you have in your game. If the placement of the platform should simply be a random angle and a random distance below maxDistance, something like this could work:
<code>    /**
     * Method that returns a 2D-coordinate, at a random angle and position relative to currentPosition.
     * The distance from the returned coordinate to the currentPosition is capped by maxDistance.
     *
     * @param currentPosition - A double[] array of length 2, with the first element containing the x-coordinate and the second element containing the y-coordinate.
     * @param maxDistance - Maximum distance from currentPosition to the returned coordinate.
     * @return - A double[] array containing the generated random coordinates, with the first element containing the x-coordinate and the second element containing the y-coordinate.
     */
    private double[] setRandomPoint(double[] currentPosition, double maxDistance){
        Random r = new Random();
        double distance = maxDistance * r.nextDouble(); // A random distance, capped at maxDistance.
        double angle = 2 * Math.PI * r.nextDouble(); // A random angle.
        double[] returnVector = new double[2];
        returnVector[0] = Math.cos(angle) * distance + currentPosition[0];
        returnVector[1] = Math.sin(angle) * distance + currentPosition[1];
        return returnVector;
    }
</code>
However, I would assume you want a more complicated allowed placement of the platform, given that you seem to have some gravity - lower platforms are likely allowed to be further away from the currentPosition. This would require knowledge of the physics that you have implemented.
You could possibly use the method above and simply set the maxDistance to the "minimum maximum distance" that you allow, maybe the maximum distance you have when the platform is straight up from the currentPosition?
Another way to solve it would be to make a bunch of allowed platform locations and pick one of those at random.


Is there a difference between heterogeneous expectations and heterogeneous cost of capital? How are assets priced in these situations?

Question:
How are asset prices set when investors face heterogeneous expectations? Does some form of "negotiation" take place so that the market price is set?

Can investors face heterogeneous costs of capital (even under homogeneous expectations)? Would this be an explanation for differences across portfolios? For example, investors might have different preferences regarding skewness or kurtosis, or when transaction costs are accounted for in asset pricing models, institutional investors potentially face lower ones as I see it, which should impact their cost of capital and the valuation they assign to risky assets.

Even in the most basic mean-variance framework, investors have homogeneous expectations but different preferences (and a different risk-aversion coefficient defined by A). Why is the risk-premium the average A x Var(Rm)? Is it because investors agree on this average to set the price for risky assets?
Answer:
Yes, there is a difference between "heterogeneous expectations" and "heterogeneous cost of capital" (of investors). Usually, while the first is about something in future, the second is about something in current situation. Although, some authors may use these terms interchangeably.
There are many papers, offering varying views on the process. Starting from L. Walras' idea of "tâtonnement" to modern general equilibrium models to agent based model to whatever one may imagine. Just to have a feeling of what I'm talking about:

https://link.springer.com/chapter/10.1007/978-3-030-66691-0_7
https://wxiong.mycpanel.princeton.edu/papers/bond.pdf

Yes they can. Generally speaking, expectations and cost of capital are unrelated concepts, and yes, this would inevitably produce differences in portfolios. Further, you mention heterogeneity in preferences, which, on my mind, is the third kind of heterogeneity. Some investors may face different regimes of taxation in different geographical regions (say, usually dividends, capital gains, and interest are taxed differently - and while some investors might have a preference for outright dividend, others would prefer wealth redistribution through buyout). In this case, heterogeneity in cost of capital (technically speaking investors face differences in that aspect) naturally leads to heterogeneity in preferences. But there is heterogeneity in preferences not connected with heterogeneity in CoC - for example, when we model investors with heterogeneity in parameters of wealth (or gain/loss) utility functions. Cost of capital is unaffected in this case, as well as expectations, which are usually about some economic conditions in future.
I'm not sure what particular paper you're talking about, but probably it's meant that we have some uniform distribution of A across investors which allows us deriving market risk premium by simply averaging A. The very basic mean-variance framework paper, Markowitz (1952), says nothing about market portfolio.
Answer: 1.
If we are navigating in the CAPM world deep enough, we can abandon whether the investors have homogenous expectations or not. It is irrelevant, even in the condition of homogenous investment horizons can be relaxed. Only thing that matters, is that the investors face quadratic utility function AND/OR the returns are normally distributed.
I try to find some online source to cite on the previous claims, but I am 99% certain that I am correct. For the heterogenous/homogenous expectations you can think like this: if some investors are more risk averse than others, then the correct price and the derived expected returns are an aggregate result of the market stance i.e. the equilibrium where the supply of the asset meets the demand for it. And in general, markets are just a place to negotiate the price for the asset.
On this question of preferences of expected returns and risk aversion, I heavily suggest you take a look on Tobin's two fund separation theorem.
This seems fairly reasonable:
https://www.academia.edu/30770950/Lecture_8_Relaxing_the_assumptions_Zero_Beta_CAPM_Taxation_and_Borrowing_Lending_constraints_AIM_OF_LECTURE_8
2.
One has to very careful when addressing such questions as there is so much going on. Yes, investors can face different costs of capitals, even in the CAPM world. If I am making bets with my own money or with my parents money, there is difference for the cost of capital between the sources of the funds. And of course, investors can and do have preferences that differ on multiple factors.
Regarding the institutional investors, I wish that you could provide a bit more specific question. For example, the creditors of the institutional investors demand a discount and coupon that is proportional to the solvency and riskiness of the institutional investor. The rate that the banks are charging is only a result of riskiness of the projects undertaken by the investor, which of course depends on many, many factors.
And pretty much the same goes for the equity side of an institutional investor: if they are able to show a superior track record of returns with very little deviations, and that the returns are not a result of taking systematic risk, then they will be able to charge a lot from their investors, i.e. have low cost of capital. For any active investor to be successful the first thing is to minimize the transaction costs, and without saying, the institutional investors do have efficient means to trade, but that does not yet grant the exceptional returns, it only an important ingredient. Concerning the active investing being successful, and I can promise that there is very little evidence going for it.
Despite the people, also me, of this forum trying to do it:)
The valuation of risky assets should not differ on where you got your funds: valuation of an asset is only a result of the returns (cash flows) and the risk (discount factor). The discount rate is determined by the opportunity cost: what if you were to invest into similar asset risk wise, and then you compare would you be better of investing to the asset you are valuing, to the other risky asset or not investing at all.
3.
Nope, investors can have different expectations in the mean-variance framework, it just enough to find the aggregate of the expectations through the markets. There is plenty of math to prove this convergence of expectations, and I will not dwell into it. And the risk premium is defined by: $r_m-r_f=Aσ_m^2$ as you stated. Once again, you can settle with the aggregate as the sample being large enough, all the noise is cancelled and we are left with the average A, average risk aversion.
Comment: "The valuation of risky assets should not differ on where you got your funds... " etc. - to me this only makes sense in a theoretical "perfect CAPM-world," which is an empty concept found in basic financial textbooks, interesting only as a starting point for studying deviations. In the real world, investors face barriers to international capital flows and markets are segmented. Investors live in a multi-CAPM world (like in Singer-Terhaar model), and since CAPM is at least a part of the discounting factor, the valuation of risky assets depends on the source of the investor's funds.
Comment: @AlexanderDidenko Think about "valuation": when valuing an asset it has some intrinsic (objective) value and some personal value to an investor. In valuation one should always assume that the investor is well diversified, i.e. able to pay a lot more than non-diversified investor since the to-be-added idiosyncratic risk is neglible to diversified portfolio, and thus being able to value the asset without risk premia. Also, the portfolio's cost of capital should not drastically change if a new asset is added due to the diversification. This is the only way to arrive at reasonable intrinsic value.


Confusion regarding manuscript status in IOP's article tracking system and ScholarOne Manuscript System

Question: I had submitted a manuscript in an IOP journal a month back. In the IOP's article tracking system, the status changed from "1st reviewer agreed to report" to "Editorial Assessment" instead of "All reviewer reports received". However, in the ScholarOne Manuscript System, the status changed from "Awaiting Referee Reports" to "Awaiting Decision". What should be the interpretation of the current status of the manuscript?
Comment: @FedericoPoloni The IOP's tracking system shows that it has gone back to the editorial office for a check whether the submission is complete and meets the scope and quality criteria of the journal. I am not sure if there is a bug in the tracking system. I would have expected "Revision: All reviewer reports received" since the previous status was "1st reviewer agreed to report".
Comment: Have you checked the answer to the question I have linked? Does it answer your question? Can you identify where your manuscript is on that flowchart?
Answer: "Awaiting decision" is not incompatible with "All reviewer report received" or "Editorial Assessment".  It means the editor, an associate editor or a handling editor will have a look and make a decision.
Remember that referees can only recommend a course of action: it is the journal through its editor or delegates that takes the decision to publish or not, usually based on the reports.
In particular if the review or reviews are inconclusive, the editor may decide to send to another reviewer.


Inverter switches off powering as soon its unplugged from mains

Question: I have a Su-Kam shiny 850 model inverter which powers my home appliances when there's a power outage or if I switch off the mains that supplies power to the inverter. However whenever I unplug the cord of the inverter from the mains, the inverter still shows are "Backup" mode while no appliance  work which basically means it stops working. Is it necessary to keep the plug attached to the mains even if there is no power through it?
Answer: Current flows in loops.  That is basic "electrical 101".  All current 'comes out' the hot wire, and 'flows back' via the neutral wire.
A switch only interrupts the hot wire.  That is enough to break the loop and make the load shut off.
A plug interrupts hot and neutral and safety earthing, because, obviously, it's a plug.
So if you think about it, unplugging interrupts neutral.  Switching does not.  It's all about the neutral.
And more specifically, it's all about illegal and dangerous mess that was made when this was hooked up initially.

On the inverter, only the hot wire was connected through back to the panel.  The neutral was never connected or switched, and so neutral is forced to go backwards through the system via the plug.  This is bad: the hot and neutral wires need to stay together for a variety of reasons.
My guess is this was done so the panel could be "back-fed" so the whole house could be powered (on 650VA inverter that can barely provide 3 amps, lol).  I will guess that this wasn't done with a proper interlock.

I suspect this was done because 1-pole switches (which do not switch neutral) are cheaper than 2-pole switches (which do).
Comment: That makes a lot of sense since only one wire as phase goes into the inverter backup plug.
Thanks for the clarification.


How am I to interpret $\text{Tr}(\text{ad}_X\text{ad}_Y)$?

Question: I'm trying to show that the $(2,0)$ Killing tensor is invariant under the $\text{Ad}$ homomorphism: $K(\text{Ad}_A(X),\text{Ad}_A(Y))=K(X,Y),$ with $X,Y\in \mathfrak{g},\hspace{1mm}A\in G,$ and $K(X,Y)\equiv-\text{Tr}(\text{ad}_X\text{ad}_Y)$. My question isn't about how to do this; rather, it is about how to interpret this trace (once that's accomplished, I'm confident I can carry out the proof). Trying to peer into it, I'd write $\text{Tr}(\text{ad}_X\text{ad}_Y) = \text{Tr}([X,[Y,\cdot]]),$ but that just heightens my feeling of this expression needing an argument to make any sense. So, are the $2$ inputs of this $(2,0)$ tensor to be interpreted as $X$ and $Y$, and I'm to manipulate this expression as it currently stands? Or am I to gain insight of this Killing form by feeding in two elements of $\mathfrak{g}$, and thereby go about this proof? Already I must weigh myself against the latter, as I can't see it making sense for me to feed two inputs into $\text{Tr}(\text{ad}_X\text{ad}_Y)$. Boiling it down, my question is how do I interpret this trace?
Comment: Hint: perhaps you should test-drive all this on su(2), where it is virtually impossible to get lost?
Answer: The trace is over the Lie algebra $\mathfrak{g}$ itself. Note that $${\rm ad}_X\in{\rm End}(\mathfrak{g})~\equiv~{\cal L}(\mathfrak{g},\mathfrak{g})$$ is a linear map from $\mathfrak{g}$ to $\mathfrak{g}$. If we chose a basis $(t_j)_{j=1,\ldots,n}$ for the Lie algebra $\mathfrak{g}$, then we can represent the linear map ${\rm ad}_X~\equiv~[X,\cdot]$ by its corresponding matrix $({\rm ad}_X)^j{}_k$, cf. my Phys.SE answer here. The trace is then
$$K(X,Y)~:=~{\rm Tr}_{\mathfrak{g}}({\rm ad}_X \circ{\rm ad}_Y)
~=~\sum_{j,k=1}^n({\rm ad}_X)^j{}_k({\rm ad}_Y)^k{}_j.$$
It is of course independent of the choice of basis.
Comment: Excellent, thank you!
Answer: A Lie algebra $\frak g$ is, among other things, a vector space. For each $X \in \frak g$, one can define a linear map $\mathrm{ad}_X : \frak g \to \frak g$. Then $\mathrm{ad}_X \mathrm{ad}_Y$ is the composition of two linear maps, and therefore a linear map itself. Then the trace of a linear map is just the usual trace!
If you imagine elements of $\frak g$ as column vectors then for each $X$, $\mathrm{ad}_X$ is a matrix and the trace is the sum of its diagonal elements. Based on this intuition and considering a basis for the Lie algebra, it shouldn't be too hard to find an explicit expression for the Killing form.
Answer: Perhaps writing out the individual homomorphism will help?
\begin{align}
\mathrm{ad}_X: \mathfrak{g} &\to \mathfrak{g}
\\ Z &\mapsto [X, Z]
\end{align}
Because the bracket is linear in it's second argument, this is a linear map.
Consequently, so is
\begin{align}
\mathrm{ad}_X\circ\mathrm{ad}_Y: \mathfrak{g} &\to \mathfrak{g}
\\ Z &\mapsto [X, [Y, Z]]
\end{align}
The Killing form is invariant under any automorphism $\varphi$, not just $\mathrm{Ad}_A$. To show this, you could start with
$$
\mathrm{ad}_{\varphi(X)}\circ\mathrm{ad}_{\varphi(Y)} = \varphi\circ\varphi^ {-1}\circ\mathrm{ad}_{\varphi(X)}\circ\mathrm{ad}_{\varphi(Y)} = \dots
$$
The last step will be using the cyclic property of the trace.


Drupal Module to sync with external database

Question: I have been trying to synchronize Drupal 7 user account with external DB. Can anyone suggest me best module to do so?
Answer: What are you using the external data for? You would most likely be writing your own module if you're trying to get custom DB output. The best way to deal with data from an external DB is to set it up in your settings.php file. Once you've done so you can actively switch to query the second database in any of your modules. Check this out for information - http://drupal.org/node/18429


Threshold tuning with one-vs-rest for multi classification python

Question: I'm currently using a One vs Rest Random forest algorithm for multi class classification problem using Python, and I want to find the optimal threshold for each class, How can I do this with OVR (One-Vs-Rest) approach?
Answer: In general it's not possible to tune any threshold in multiclass classification:

In binary classification, modifying the threshold means predicting more or less instances as positive, because the two classes are complement of each other (any instance which is not positive is negative and conversely).
This doesn't work in the multiclass setting: for instance, an instance is predicted 55% class A. If the threshold is say 60%, what should be predicted instead? Class B predicted at 30%, or class C predicted at 15%?

The only way to reintroduce thresholds in a meaningful way would be to switch to multi-label classification, i.e. predicting every class as 'yes' or 'no' independently of the other classes (i.e. N independent binary problems). But this is a very different way to design the problem, since it means that an instance can have zero or multiple classes.


How do I use the cat command to show the contents of a text file with numbered paragraphs?

Question: I want to print a text file in terminal with numbered paragraphs using the cat command.
Comment: Who is this person that keeps assigning this idiotic assignment to their students? You must be the 20th unfortunate user who has tried to deal with this. it is not possible without editing the source of `cat`. Please tell your teacher to come and ask here so we can set them straight.
Comment: cat -n ? man cat ?
Comment: cat -n numbers every line, i only want each paragraph to be numbered e.g 1.(text)
Comment: @terdon:  That should be an answer, IMO.
Answer: While some cat implementations have a -n option to number lines or -b to number non-blank lines, I'm not aware of any that has an option to number paragraphs. You'd need another tool like awk to do that:
number_paragraphs() {
  awk '!/[^[:blank:]]/ {print; flag=0; next}
       !flag++ {n++}
       {printf "%4d %s\n", n, $0}'
}

to get an output like:
$ lorem -p2 | fmt -w70 | number_paragraphs
   1 Aspernatur dicta in commodi suscipit officia. Est at voluptas aut
   1 eveniet. Voluptatem placeat recusandae sed consequatur et ullam
   1 expedita vitae. Quis velit modi soluta ea eos eaque cum inventore.

   2 Tenetur ipsam non commodi. At aut aut quaerat. Delectus ipsam
   2 dicta corrupti consequuntur. Suscipit et quibusdam nihil suscipit
   2 consequuntur. Quis eum numquam qui.

Or:
number_paragraphs() {
  awk '!/[^[:blank:]]/ {print; flag=0; next}
       !flag++ {n++; printf "%4d %s\n", n, $0; next}
       {print "    ", $0}'
}

to get an output like:
$ lorem -p2 | fmt -w70 | number_paragraphs
   1 Officia a adipisci accusantium dolores velit. Et fugiat
     exercitationem quibusdam. Neque nihil explicabo molestiae sapiente
     voluptate.

   2 Ipsa error ad nobis reprehenderit. Eius adipisci similique nemo
     culpa qui quos voluptatem. Ut sint consectetur unde voluptatibus
     mollitia. Recusandae natus et quasi et perferendis. Accusantium
     non qui et iste fugiat sit unde dolores.

Answer: Simple, you don't.
cat(1) only concatenates the files given as arguments, so there is no way to make cat(1) automatically write out numbers right in the middle of a file.
Comment: Create a script that reads from stdin and writes to stdout and does what you want it to do. And abuse cat(1) to read the file and pipe it to your script.  That way you will be (ab)using cat(1).
Comment: Sorry, I tried to add a newline to the comment, so I had to edit.


Is this question about advertising On-Topic?

Question: This question about actor endorsments doesn't seem like a good fit but seeing as we have a question asked about product placement's first occurence  I wanted to get the community's feel for whether or not this question is valid for us.
Answer: Well, I feel that there's a disconnect between the two questions mentioned.  The Product Placement question is about what the first product placement in a movie was.  The new question seems to be more about commersials and celebrity endorsements of a product rather than a movie or tv series.  I don't think it's ever been brought up before, but I personally consider commercials off-topic, and this question along with them.
Comment: Agree! Commercials should be off-topic. Not just because of their superficial nature, but they are too local in time and space, and questions could easily be abused for sneaky advertising.
Answer: As an individual i think this should be On-Topic here. Even we doesn't have any other SE Site where it belongs. And i think product placement's is directly connected to TV . And our title say Movies and TV. But it should be decided by community and i thought to express my opinion of favor.
Comment: But in my thinking as compare to other SE Sites , we are the best suited for it.
Comment: To be honest, as a movie goer and tv consumer, questions about commercials just don't interest me. Besides mostly trivial questions, such as "who was in this commercial", what deep, analytical questions can you ask about a commercial? Also, to reiterate tyler, it's not our job to find a home for every question, just to make sure we keep good, interesting, on-topic questions here.
Comment: But the reason of "There is no other SE" is a flawed one at best.  Just because we don't have an SE for the colour green, does that mean we should post all questions about green on UE.SE?
Comment: It's a question dealing with actors and commercials, which would fall under the umbrella of Television
Comment: I second the "what deep, analytical questions can you ask about a commercial?"


CruiseControl.net ndk-build on Windows 64bit without Cygwin

Question: Latest Android NDK (version 8) allows to call ndk-build without additional cygwin installed.
My question is: can I plug this into CruiseControl.Net for periodical native build?
I assume that most likely I would need to use Ant as a build method and then add it to ccnet server config.
So the questions are:

How to call ndk-build.cmd from an Ant command
How to configure build.xml file?
I tried several approaches, but all of those failed. Could you give me some clues if it is possible at all?
Answer: I ran into the same problem (the CreateProcess failures, etc) when trying to invoke "ndk-build.cmd" directly from build.xml, using CC.net on Windows.  I figured out how to get this to work, and so I felt compelled to share my solution.
First, create a 1-line Windows command file as follows (I named it "ndkwrapper.cmd"):
sh ndkwrap.sh %1 %2 %3

Next, create a simple bash shell script as follows (named "ndkwrap.sh"):
#!/usr/bin/sh
# Wrapper around ndk-build script for Windows
#

NDK_PROJECT_PATH=/cygdrive/c/workspace/agnc_android
export NDK_PROJECT_PATH
/cygdrive/c/Android/android-ndk-r8b/ndk-build $1 $2 $3

Of course, your exact paths (for your workspace and NDK directories) may be different, but note, in particular, that "/cygdrive/c" refers to "C:".
One very important step here, after you create the script above, is to convert the line endings from Windows to UNIX. You can do this with a utility called "dos2unix.exe" which is freely available. I don't remember where I got it, but it was part of some open source package of GNU/Linux tools ported to Windows. (Google on "UNIX file utilities for Windows".)  If you don't convert the line endings, then sh or bash will have trouble reading the script, and you'll get all kinds of erros about "\r" ...
So, to invoke the equivalent of "ndk-build.cmd clean", for example, you'd type "ndkwrapper.cmd clean" to delete your intermediate and output NDK-related build files, in preparation for a full NDK build.
In your build.xml file for CC.net on Windows, you can invoke the NDK makefile as follows:
<tasks>
  <exec>
    <executable>cmd.exe</executable>
    <baseDirectory>C:\Android</baseDirectory>
    <buildArgs>/C ndkwrapper.cmd clean</buildArgs>
  </exec>

Hope this helps!
Ben
Answer: i observed problems with running ndk-build as an CCNET task as well.
It took me a while, but at the end i noticed, that you have to provide HOST_OS and HOST_ARCH as ndk-build parameters to let it run.
<exec>
  <executable>cmd</executable>
  <buildArgs>/C ndk-build HOST_OS=windows HOST_ARCH=x86 -B NDK_PROJECT_PATH=[PROJECT] APP_BUILD_SCRIPT=[ANDROIDMKFILE] NDK_APPLICATION_MK=[APPLICATIONMKFILE] NDK_LOG=1</buildArgs>
  <buildTimeoutSeconds>120</buildTimeoutSeconds>
</exec>

hope it helps anyone to save time.
Answer: Ok I got some progress,  I am able to build the jni code via ant or nant but in both cases plugging it to the cc.net server config gives me strane error:
but now CC.net gives me strange errors:
    <builderror>
      <type>NAnt.Core.BuildException</type>
      <message><![CDATA[External Program Failed: G:\\android-ndk-r8b\\ndk-build.cmd (return code was 2)]]></message>
      <location>
        <filename>G:/MYPath/project.build</filename>
        <linenumber>7</linenumber>
        <columnnumber>4</columnnumber>
      </location>
      <stacktrace><![CDATA[   at NAnt.Core.Tasks.ExternalProgramBase.ExecuteTask()
   at NAnt.Core.Tasks.ExecTask.ExecuteTask()
   at NAnt.Core.Task.Execute()
   at NAnt.Core.Target.Execute()
   at NAnt.Core.Project.Execute(String targetName, Boolean forceDependencies)
   at NAnt.Core.Project.Execute()
   at NAnt.Core.Project.Run()]]></stacktrace>
    </builderror>
  </failure>
  <duration>296.40000000000003</duration>
</buildresults>Buildfile: file:///G:/MYPath/project.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: build

clean:
 [echo] Starting Android ndk CLEAN ...
 [exec] Android NDK: Unable to determine HOST_OS from uname -s:
 [exec] Android NDK: Please define HOST_OS in your environment.
 [exec] process_begin: CreateProcess(NULL, uname -s, ...) failed.
 [exec] G:/android-ndk-r8b/build/core/init.mk:131: *** Android NDK: Aborting.    .  Stop.

BUILD FAILED - 0 non-fatal error(s), 2 warning(s)
My project in cc.net config:
<project>
    <name>MY_PROJECT_NAME</name>
    <workingDirectory>PATH_TO_MY_PROJECT</workingDirectory>
    <tasks>
        <nant>
            <executable>G:\nant-0.92\bin\Nant.exe</executable>
            <baseDirectory>PATH_TO_MY_PROJECT</baseDirectory>
            <buildFile>MYPROJECTNAME.build</buildFile>
            <buildArgs>build</buildArgs>
            <buildTimeoutSeconds>1200</buildTimeoutSeconds>
        </nant>
    </tasks>
</project>

And my NAnt build file:
<project name="my name" default="build" basedir=".">
    <description>My project Build Files.</description>
    <target name="clean" description="remove all generated files">
        <echo message="Starting Android ndk CLEAN ..."/>
        <exec program="G:\\android-ndk-r8b\\ndk-build.cmd" failonerror="true"
            basedir="MY PROJECT PATH">
            <arg value="clean" />
        </exec>
        <echo message="Android ndk CLEAN done."/>
    </target>
    <target name="build" description="remove all generated files"  depends="clean">
        <echo message="Starting Android ndk BUILD ..."/>
        <exec program="G:/android-ndk-r8b/ndk-build.cmd" failonerror="true" />
        <echo message="Android ndk BUILD done."/>
    </target>
</project>

As I said I can run a Nant.exe for my project and it cleans and build correctly.
It looks like the cc.net tries to run the other ndk-build commend which is used for linux and is missing some commands as uname.
Do you have any idea what cI could be doing wrong ?
Answer: The original question is asking about ant builds. This answer is related to a problem in CC.NET and ant and gradle builds are going to be affected in the same way.
We are using gradle and with some custom gradle tasks it is possible to compile the native code of your project as well by calling ndk-build.cmd (from a path that has no spaces in it).
After the gradle file is prepared properly shell initiated gradle builds will work but cc.net initiated builds will fail.
Our CC.NET task is defined as follows:
<exec executable=".\gradlew.bat">
    <baseDirectory>$(projSrcDir)</baseDirectory>
    <buildArgs>clean assemblePlayRelease assembleProRelease</buildArgs>
    <buildTimeoutSeconds>900</buildTimeoutSeconds>
</exec>

The problem is related to a CC.NET bug that causes the shell variable names to be in lower case. Windows shell scripts do not care about the case of shell variable names but because the NDK fires up make variable case becomes an issue. The init.mk make file that is part of the build process relies on shell variable names to identify the host OS type. In particular the shell variable OS. Normally the OS value is defined like this:
OS=Windows_NT

But when the variable is passed to gradle from CC.NET it gets transformed into this:
os=Windows_NT

This causes the detection mechanism in init.mk to fail and tries to execute the unix detection sequence and looks for the Unix uname utility that is not present on Windows resulting in:
Android NDK: Unable to determine HOST_OS from uname -s:
Android NDK: Please define HOST_OS in your environment.
make.exe: Entering directory `D:/CC.NET/svncheckout/pes/src/project/src/main/jni'
make.exe: Leaving directory `D:/CC.NET/svncheckout/pes/src/project/src/main/jni'

And ultimately:
process_begin: CreateProcess(NULL, uname -s, ...) failed.
c:/ndk/build/core/init.mk:160: *** Android NDK: Aborting.    .  Stop.
FAILURE: Build failed with an exception.

The workaround is less then ideal but it gets the job done. The idea is to edit the ndk-build.cmd and change the case of the passed variables only when we are building from CC.NET.
Simply insert this code after the @echo off line in ndk-build.cmd:
IF DEFINED ccnetproject (
  ECHO Applying Environment variable hack for CC.NET.
  SET OS2=%os%
  SET OS=
  REM SET PATH=%path%
  SET TEMP2=%temp%
  SET TEMP=
)

IF DEFINED ccnetproject (
  SET OS=%OS2%
  SET OS2=
  SET TEMP=%TEMP2%
  SET TEMP2=
)

This script first makes temporary copies of values in the lower case OS and TEMP variables. Next it undefines them by clearing their values. An finally the reverse is done.
Two steps are needed because just saying
SET OS=%os%

doesn't do much since scripts are case insensitive. It first locates the OS variable, finds a lower case version and assigns its own value back to itself.
This was tested on CC.NET v1.6.7981.1, gradle v1.1.0 and Android NDK v10 (64bit).


Whats the important specifications for a GPU

Question: Which specifications are important for a GPU to get a high Hashrate.

Frequency
GPU Clock Speed
Graphics Ram Type
Memory Bus Width
Memory Speed?

or another important thing?
Answer: The number of processors on the board:
Example a AMD R9-290x has 8192 Stream Processors on the board.
Comment: are you sure that the AMD R9-290x has 8192 Stream Processors? See https://hothardware.com/reviews/amd-radeon-r9-290x-review-welcome-to-hawaii they have only 2816 Stream Processors?
Answer: First I just want to verify with you, the 290X has 2816 stream processors and a 512 bit memory bus.
I'm quite new to this mining but found some information you may find quite useful. It's from another thread about GPU specs affecting mining performance:
https://forum.ethereum.org/discussion/3924/gpu-key-specs-for-high-hasrate
It all seems to depend on which hashing algorithm we're talking about. I basically got that memory bandwidth has a huge affect on the hashrate of the GPU, and that in some cases you can even under-clock the core clock to achieve higher efficiency while mining. One guy in the thread made a spread sheet with some benchmarks he ran on several cards which claims that GCN 1.0 cards performed the best with modern cards falling short. So Radeon HD 78XX , HD 79XX, R9 2XX cards do quite well.
As for how the specs affect the hashrate? Really all I've found is higher memory bandwidth is key. Also, before you go buy like 4 Fury X's with HBM memory, keep in mind that memory is clocked much lower than GDDR5 memory, so the effective memory bandwidth is not as crazy high as one might hope for. I've got a MSI Lightning R9 290X and am considering getting into ether mining so I'm curious as to what others here have to say. Check out the link I pasted, as it's pretty much got this exact discussion going.
Answer: Ok so I'm still trying to figure out what makes one card outperform another and its mind boggling I know this thread is super old but whatever ok so the 290x only get about 25 mh/s on eth it's got 2816 steeam processors now I know more about nvidia but that should be about equivalent to coda cores on nvidia as I know these are somewhat important  the new 3080 has 8704 of these and gets up to100 mh/s most rate it closer to 85 the 3070 has 5888 and is rated about 56 the 3060ti has 4864 and some how get about 50 that where this starts making a little less sense but someone said you were incorrect and it's only 2816 then it would make sense cause the 3090 only get like 120 hash at most not that much over 3080 has 10496 cuda cores but 24 gb gddr6 and only boosted up to 384 bit interface width now the 3080 has 10gb ddr6 while the other 2 only have 8 does the 2gb really make that difference or is the the 320 bit memory interface width vs the other 2 having only 256 bit but yet the 290x has 512 bit and mines so much less I wont have a more clear conclusion till I get the hash rate of the new 3060 standard cause it has 12 gb so more gddr6 but only 192bit and only 3584 cuda cores if vram is one of the more important factor the new 3060 is gonna be the ultimate buy for mining but we shall see I kinda doubt it I think all factors go into play but amount of cores seems to be the most important factor so far making out of new cards the 3080 the best buy for the coat if you can get your hands on it for the 700 it's supposed to be cause the 1500 for the 3090 doesnt do enough extra other than for actual gaming and you would have to be playing some of the most intense games when it comes to need for graphics cause the 3080 does more than enough for most games
Comment: Just realized I said the corrected number the first time
Comment: Downvoting the answer, because it is unreadable (the author does not use English sentence structure and finish sentences with period)


SharePoint 2010 HTML Editor to use P not Div

Question: Does anyone know of a way to make the default SharePoint 2010 HTML editor output a P tag when you hit enter, as opposed to a Div?
Answer: On the first line after typing but before hitting enter, select the text and on the ribbon goto Markup Styles > Paragraph.  After that is will create a new paragraph for each line break.
Comment: There is no way to change the default behavior other than that.
Comment: Thanks for this, I'll give it a go. It's a shame you can't configure it as this approach is not intuitive at all. There's little chance of end-user editors remembering to do this.
Comment: A lot of my end users just hit enter twice to make their line breaks. Not the cleanest HTML code generated but they don't know the difference.