How to scale (in the range 0 to 1) and mathematically explain two mutually exclusive probabilities of a data point belonging to a normal distribution?

Question: I have two set of n-dimensional multivariate data, with the assumption that both set of data is normally distributed. When I get a new data point, my goal is to classify it into one of the two sets. The sum of probability of my new data point belonging to both the distribution therefore should be 1. I am using this to calculate the probability of the new data point belonging to each of the distribution. However, I am getting probability scores in the range 0 to 1 for both the cases resulting in the sum of probability being sometimes greater than 1 and sometimes less than 1. I don't know much statistics, is there any way to combine probability in the range 0 to 1, and explain it mathematically, or is there some other method to get classify new data into one of the two distributions, which satisfies the probability law of sum being equal to 1?
Thanks in advance.
Answer: Your link is not calculating the probability that an observation came form a particular distribution, but instead the probability that if another sample observation were drawn from that distribution you would see the original observation or something as extreme or more extreme than the original observation.
If your original observation is not extreme in either of the two distributions then it is possible to get the situation you describe, with the two calculations adding up to more than $1$.  If your original observation is extreme in both distributions you can get the two calculations adding up to less than $1$. There is not reason to expect the two calculations to add to $1$.
One approach could be to compare the likelihoods of your observation under the two distributions  (for continuous distributions proportional to the densities at that point, while your earlier calculations were related to the cumulative distribution functions) and then have  probabilities calculated as $$\frac{f_1(x)}{f_1(x)+f_2(x)} \text{ and }\frac{f_2(x)}{f_1(x)+f_2(x)}$$  which will then clearly meet the conditions you have set.  You would get the same result using Bayes' theorem if you had prior probabilities for the two original distributions of $\frac12$ each.
Comment: Thanks for correcting me. How do I calculate the likelihood of my sample belonging to a distribution as suggested, is there any way to do it in python? Sorry, I don't know much stats.
Comment: It would be difficult: I do not know your original distributions, and even if I did then I would use R rather than python
Comment: Thanks for the help! Would look if there's some way in R to do that.
Comment: The density for a multivatiate normal is $(2\pi)^{-\frac{k}{2}}\det(\boldsymbol\Sigma)^{-\frac{1}{2}} \, e^{ -\frac{1}{2}(\mathbf{x} - \boldsymbol\mu)^{{{\!\mathsf{T}}}} \boldsymbol\Sigma^{-1}(\mathbf{x} - \boldsymbol\mu) }$


Can many iPads have a "master" Apple ID and a second, "personal" Apple ID?

Question: Our school district has many iPads.  We are wondering if a "master" Apple ID can be set up for configuing purposes (creating a standard starting point with certain apps for all devices) and if the teacher to whom it is assigned can then set up their own Apple ID (a second, functioning ID for the same device) for personal app downloads, email, calendar, etc while leaving the initial information intact.  Basically, we don't want them to be able to change what the IT dept puts on the iPad.
Comment: Using separate Apple IDs will not prevent your staff (the teachers) from e.g. deleting the apps or do other changes. So what are you looking for: A way to prevent users from changing certain settings or the use of several AppleIDs on the same iOS device?
Answer: The Apple Configurator app was designed for deploying large numbers of iOS devices within institutions like schools. The Apple Configurator documentation explains the three different supported configuration modes (Prepare, Supervise, or Assign), and a video introduction is also available. Based on the wording of your question, the either the Prepare or Supervise method will likely be the best choice.
Answer: In addition to Apple Configurator, you may consider something for over the air management, such as Apple's Profile Manager, or Airwatch.
From there you can deploy apps, and restrict installation, in-app purchasing and set content settings.


How to make battery controller with arduino?

Question: I want to make simple UPS with means of arduino, to learn the processes from it, and be able to record and monitor at PC. For the start i want to implement buffered usage charge mode. Logic is simple - when voltage is less than defined(say it battery voltage is less than 13.6V) - then gate should open and connect battery to charger. If voltage is greater then gate should close, disconnecting charger and preventing battery and load from excessive voltages. So, it would do kind of clever PWM. I am asking for a help, i dont know how to connect gate to arduino. If i explained bad please look at illustration:
Comment: What did you find when searching on MOSFET control from Arduino?
Comment: @Ale..chenski I've found that it is used in motor control applicaitons, most often it is arranged in H-bridge and is embedded in packages like [L298](https://www.sparkfun.com/datasheets/Robotics/L298_H_Bridge.pdf) which is extremely easy to use - you just connect them directly to arduino pins with wire, and proceed to code.
Comment: Did you look on Arduino forums for P-FET control?
Comment: @Ale..chenski I dont know. What is "P-FET control"? I have a different task from motor control. I have some N-channel mosfets by hand and i want to open and close it, like a relay, thus connecting and disconnecting charger from battery and load to protect it from over voltage.
Comment: @Ale..chenski I think MOSFET is better switch than bipolar, because its channel resistance is low, and transistor would not heat much and waste energy. My typical charging currents are 7 to 15 amps. But they are not so easy to operate, and i am asking what should i place at that end of wire?
Comment: I will be difficult to do this with N-FETs. You need to use P-FET.
Comment: @Ale..chenski What model could you advise for my application?
Answer: After night of researching, i seems to figure out correct schematics for this by myself. Haven't tested this yet, but theoretically it should work. Only requires that N-mosfet gate open voltage is below +4 Vgs, and P-mosfet open is near -10 Vgs. Illustration is as following:
PS. For mosfet models seems i have to hunt powerful low-Rds models in TO220/247 cases, to diminish heat waste, because 0.2C charge current for 200Ah battery could be 40A. Something like IRF4905 P-FET should fit the task. Charging would require 550-600W charger and for P-FET with Rds=0.02Ohm, Vdrop would yield 0.8V and 30-35W would be dissipated as heat. And any cheap, even low power TO-92 N-FET, that opens somewhere at Vgs +2..+4V to control -10V P-FET's gate from +5V arduino PWM signal.


SuperGridControl in DotNetBar has something weird?

Question: I used GridControl in DevExpress and at first it puzzled me a little to find out how to use it, but now SuperGridControl in DotNetBar is another one which is even harder to use. This has a GridPanel (returned from PrimaryGrid property)which is like DataGridView. It has a DataSource property and I've tried assigning it with some data source, the rows and columns are populated OK, but next I've tried accessing one of its columns or rows, it threw an exception of IndexOutOfRangeException. The Columns and Rows properties have the Count being equal to 0, what? My sample data source after being filled into the PrimaryGrid has 2 columns and 3 rows but the PrimaryGrid.Columns and PrimaryGrid.Rows are empty???
It's so weird, I think Columns and Rows contain only what we add using code or designer, not for DataSource binding?
Any idea on this problem? Weird much more than GridControl in DevExpress. Thanks!
Answer: you try    superGridControl1.Refresh();  before try to access the cell


Geodesic curvature on hyperbolic manifold with boundary

Question: Let $\Sigma$ be a compact oriented surface of genus $1$ having a single boundary component (i.e. $T^2$ minus an open disk) and let $g$ be a Riemannian metric on $\Sigma$ with constant Gaussian curvature $K=-1$. Is it necessarily the case that $\int_{\partial \Sigma} k_gds \leq 0$? The Gauss-Bonnet theorem gives a lower bound $\int_{\partial \Sigma} k_gds  = \text{Vol}(\Sigma)-2\pi \geq -2\pi $ but I am wondering about an upper bound.
Comment: The boundary can even be strictly convex.
Comment: For examples, think about circles in the hyperbolic plane. (You can always build a compact hyperbolic surface by gluing the sides of an appropriate geodesic $4g$-gon in the hyperbolic plane.) Circles can have any geodesic curvature $>1$.
Answer: Given a topological surface $S$ which is the torus with closed disk removed, there is are two types of complete hyperbolic structures $h$ on $S$:

The ones of finite (hyperbolic area) area. In this case, the only "end" of $(S,h)$ is a "cusp."

The ones of infinite area, where the  the only "end" of $(S,h)$ is a funnel.

I will be using the 2nd type. The hyperbolic surface $(S,h)$ in this case has the following decomposition: There exists a unique simple closed geodesic $c$ on $(S,h)$ such that cutting $S$ open along $c$ results in a compact hyperbolic surface with geodesic boundary and an annulus $S$. Then annulus $S$ is foliated by simple loops $c_t$ equidistant from $c$ (the distance from each point of $c_t$ to $c$ equals $t>0$). These curves are convex in $(S,h)$ and have strictly positive curvature: If I cut $S$ open along $c_t$, the result is a compact surface $\Sigma_t$  with convex boundary and an annulus $A_t$.
Now, take one of the surfaces $\Sigma_t$ as your surface $\Sigma$.
To get a better idea about the nature of the curves $c_t$, lift the closed geodesic $c$ to a biinfinite geodesic $\tilde{c}$ in the hyperbolic plane (the universal cover of $(S,h)$). I will be using the upper half-plane model of the hyperbolic plane. Then one can arrange it so that $\tilde{c}$ is given by
$$
\{(x,y): x> 0, y=0\},
$$
the positive $y$-semiaxis. Then each $c_t$ lifts to a straight line $y=m_t x, x>0$; WLOG, $m_t>0$ for all $t$.


Deploying multiple web apps in same server

Question: I am thinking on deploying multiple (and different) web applications on the same server using the following schema:
www.mydomain.com/app1
www.mydomain.com/app2
Is this a good practice? Any recommendations?
Answer: I don't see any glaring reasons why you should not do it this way. After all, not every website is dedicated to just a single task or application. Another approach would be to use subdomains, like:
app1.mydomain.com
app2.mydomain.com
Yahoo and Google both use these, for example. The folder approach is a good way to get things up and running for testing though.
Answer: One reason is if you wanted to support SSL connections to your web server.
If you use the folder based approach then you don't have any issue with SSL certificates.
If you go for the subdomain method (app1.mydomain.com, app2.mydomain.com, etc.) you will probably need a wildcard SSL certificate which will be more expensive, or multiple certificates.
Not an issue if you don't need SSL or have few applications that require it.
Answer: Only downside to that approach is that you'll need to put some redirection or reverse proxying if any of the apps end up moving to a different server, whereas with a subdomain you would just need to change the A record for movedapp.domain.com.
So, to make it future proof, I'd create the subdomains.
Answer: If the applications are all related to the domain, I see no problem with doing things this way.
Answer: You don't mention any technology, but if you happen to be using Java for this, the web apps (by default) won't be sharing any session information. This can notably be an issue if you want a user to log in to one web app and also be logged in to the other web app.
Some containers (Tomcat, Glassfish) have single sign on available as a implementation specific feature.
Just an FYI of some of the ramifications of the decision.
Answer: My usual approach would be to treat a site as serving a single purpose. "Single" actually defines a broad goal and usage pattern here. If the multiple applications all fit in together and synergistically work towards the site's single purpose, then
mydomain.com/app1 and mydomain.com/app2 is pretty fine.
It means they exist and live to augment the main site.
If the applications have nothing much to do with each other and pretty much live in their "own world" then they probably ought to exist as their own sub-domains.
app1.mydomain.com and app2.mydomain.com
this allows you to setup your DNS strategy to different IP addresses (web servers/farms) instead of bunching them together in the same pool.


How can I get the current working directory?

Question: I want to have a script that takes the current working directory to a variable. The section that needs the directory is like this dir = pwd. It just prints pwd how do I get the current working directory into a variable?
Comment: @terdon As a resource available, and intended, for the entire population of Unix & Linux users, this is a valuable question, even if the original asker really just needed an answer already covered elsewhere. If anything, I think this question should be edited to more closely match its title and it should be re-opened, not to allow further activity, but to *not* imply that this question is 'bad'.
Comment: Related: [Getting the source directory of a Bash script from within](https://stackoverflow.com/q/59895/55075)
Comment: This is not a duplicate of the question for which it is currently marked as one. The two questions should be compared, at least, based on their titles (as well as their answers). That the *answer* to this question is already covered by another is, or should be, irrelevant.
Comment: @KennyEvitt closing as a duplicate in no way implies that the question is bad! This question will remain here, answered, for ever. If you really want to know how to get the current working directory, you will find your answer here. If you just want to know how to save the output of a command in a variable, you will also find the answer here by following the link to the dupe. In any case, this isn't really something I should do alone, if you feel strongly that it should be reopened, please open a discussion on [meta] where such things should be resolved.
Comment: @KennyEvitt actually, one of the main reasons we close is precisely because an answer has been given elsewhere. And, in fact, the main question here is actually how to assign the output of a command to a variable, which is covered by the dupe. I have also given the answer to this specific case, so all bases are covered.  There would be no benefit in opening this again.
Answer: There's no need to do that, it's already in a variable:
$ echo "$PWD"
/home/terdon

The PWD variable is defined by POSIX and will work on all POSIX-compliant shells:

PWD

Set by the shell and by the cd utility. In the shell the value
shall be initialized from the environment as follows. If a value for
PWD is passed to the shell in the environment when it is executed, the
value is an absolute pathname of the current working directory that is
no longer than {PATH_MAX} bytes including the terminating null byte,
and the value does not contain any components that are dot or dot-dot,
then the shell shall set PWD to the value from the environment.
Otherwise, if a value for PWD is passed to the shell in the
environment when it is executed, the value is an absolute pathname of
the current working directory, and the value does not contain any
components that are dot or dot-dot, then it is unspecified whether the
shell sets PWD to the value from the environment or sets PWD to the
pathname that would be output by pwd -P. Otherwise, the sh utility
sets PWD to the pathname that would be output by pwd -P. In cases
where PWD is set to the value from the environment, the value can
contain components that refer to files of type symbolic link. In cases
where PWD is set to the pathname that would be output by pwd -P, if
there is insufficient permission on the current working directory, or
on any parent of that directory, to determine what that pathname would
be, the value of PWD is unspecified. Assignments to this variable may
be ignored. If an application sets or unsets the value of PWD, the
behaviors of the cd and pwd utilities are unspecified.

For the more general answer, the way to save the output of a command in a variable is to enclose the command in $() or ` ` (backticks):
var=$(command)

or
var=`command`

Of the two, the $() is preferred since it is easier to build complex commands like:
command0 "$(command1 "$(command2 "$(command3)")")"

Whose backtick equivalent would look like:
command0 "`command1 \"\`command2 \\\"\\\`command3\\\`\\\"\`\"`"

Answer: dir=$(pwd)
This is more portable and preferred over the backticks method.
Using $() allow you to nest the commands
eg : mech_pwd=$(pwd; echo in  $(hostname))
Comment: Actually, if anything, the backtics are more portable since they predate the `$()` format. There might conceivably still be some machines running shells that don't support the newer `$()` notation. While both are defined by POSIX, the `$()` is preferred today because it is a cleaner syntax and can be nested (`$(command1 $(command2))`) in a far simpler way than the backticks.
Answer: You can either use the environment variable $PWD, or write something like:
dir=`pwd`

Answer: You need to use command substitution to save output of pwd command to a variable. Command substitution can use backticks or dollar characters. Like this:
$ mkdir "/tmp/new dir"
$ cd "/tmp/new dir"
$ CWD="$(pwd)"
$ echo $CWD
/tmp/new dir
$ cd ~
$ echo $CWD
/tmp/new dir
$ pwd
/home/ja

Answer: The value of the current working directory can be different. If you used symbolic links to get the the current directory, pwd will give different results than /usr/bin/pwd.
Since you are using bash, I would use:
dir=$(/usr/bin/pwd)

or as per comment:
dir=$(pwd -P)

as I don't like back quotes since they can't nest.
Comment: dir=$(pwd -P) also works.


How valuable is a conference paper in Avionics and Aerospace Engineering?

Question: I am a student doing my undergrad in Electronics and Communication engineering and wish to pursue a career in Avionics. My paper was selected for presentation at 54th AIAA Aerospace Sciences Meeting, AIAA Science and Technology Forum and Exposition 2016 (SciTech 2016). I have another paper which was selected for presentation at IEEE Aerospace Conference 2016. According to my understanding, these are reputed conferences. I was wondering how valuable these papers are for my admission at a grad school and my professional career. I have to spend a lot of money to attend these conferences. Is it worth it?
Comment: I recommend to modify your title to say something like "... conference paper in ?" (where your field is aerospace engineering or something like that?). The value of conference publications varies significantly between fields, and the question seems a lot more generic (and thereby less answerable) with its current title than what you probably want it to be.
Comment: @O.R.Mapper - Acknowledged!
Comment: I'm not in aerospace, but a quick glance at the sponsors/presenters at both of these conferences left a *very* good impression.  SciTech had speakers from some major industrial players (Lockheed, Boeing), big research universities (Harvard, UT Austin), and key government positions (DARPA, GAO).  The IEEE Aerospace Conference had JPL and NASA engineers everywhere, not to mention Ivy League researchers and more.  Again - I'd defer to those who are actually in the field, but these both look like highly reputable (not sure about selective) conferences.
Comment: In the closely related fields of electrical and optical engineering, this would make you a good candidate for grad school, even for a second tier conference, especially if the paper(s) were good.
Comment: @daaxix - How good are SciTech and IEEE Aeroconf?
Answer: There is 2 parts to this question:
(1) How valuable are conference papers to grad school admission?
The answer to that is field-dependent. In some fields, the value of conferences as means of publishing scientific content is perceived small. In others, primarily Computer Science, conferences are of major importance, hence papers in good conferences are perceived as very valuable for admission.
However, arguably, even in fields were conference papers count less, having published in and attending good conferences may make you stand out of the crowd in grad school admissions. Primarily, in these fields (e.g., physics), undergrads that have good journal papers to their name are very rare, so having been to a conference as an undergrad is already pretty good, even if it does not count for all that much in the grand scheme of things in the research field.
(2) Is it worth it given that conferences are very expensive?
I am of course generalising here, but as a rule of thumb, you should not have to pay for your own conference travels, as long as you have an accepted paper as an enrolled student. Most universities have stipends and travel grants that you can apply for, you can act as a student volunteer, or, most importantly, your university department covers your travel expenses.
Assuming that it is indeed not feasible for you to have your costs covered, you will need to take the decision yourself. Whether it's "worth it" depends not only on the value of a conference to the admission process, but also on how much >1000 USD are to you, personally. Clearly, the story is different if you are a foreign student living of a small stipend than if you come from an upper middle-class family in the US.
Comment: @SriHarshaPavuluri  unless someone is from those fields, they can't answer that. The best person to answer that might be your supervisor. A quick litmus test for whether a conference is good or useful is to look at the lists of attendees and invited speakers. If a number of well-respected academics are attending, it's probably a good conference. If it's full of no-names, then maybe not...
Comment: Thank you for the answer! The field is Avionics and Aerospace engineering! How important are conference papers? And how good are AIAA SciTech and IEEE Aeroconf?
Answer: In most cases, universities do admire students who publish in important conferences, as students need to put their institute down. It actually helps the universities in their research rankings.
So, I would suggest contact the secretary of your department, and explain the situation. Most likely, they have some money laying around to fund you to go to these conferences.
Comment: How good are AIAA SciTech and IEEE Aeroconf?
Comment: @SriHarshaPavuluri It depends on many factors, such as number of influential contributes in the domain of research, how many citations their published papers get over the years and so on. All these factors should be take into considerations by you (the author).


How to incorporate containers into a standardized dev environment?

Question: I'm currently working at a small company where we've had a lot of issues being on the same page with entity framework migrations and local databases. I want to start incorporating containers in hopes of standardizing everyone's development environment. Ideally, I'd like a disposable database that can be modeled using Entity Framework code first, seed data into it, then disposed of once the testing is done. What resources are there to help get me started and what other things should I know about standardizing the development environment.
Comment: What type of environment are you developing within? i.e. which Operating Systems do developers use? what is the database software in use - MSSQL, MySQL, PostgreSQL?
Comment: The dev environment is a windows 2016 server vm because the application requires sharepoint 2016. We're using MSSQL for the database with Visual Studio 2019 as the IDE. The developers working on this are all using Windows 10.
Comment: Are you wanting to run SharePoint in the Docker-ised Dev environment?
Comment: I'm more focused on the database being containerized for now, but if there was a way to also run sharepoint in the docker-ised environment as well that would be cool. I'm not sure how I would get started with that yet though.
Comment: I assume by that it means your not developing WebParts?
Comment: Sorry, what are WebParts? I don't believe so. We're migrating our sharepoint application to utilize sql server to handle data instead of using sharepoint lists.
Comment: SharePoint components, given everything you have told me it looks like @Wesley Rolnick's answer would get you started.
Answer: Docker is an awesome tool for creating a database, seeding data into it, and disposing of it.
For an example check out Microsoft's SQL Server with Docker.  The following would pull and run a sql server 2017 instance: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD="
   -p 1433:1433 --name sql1
   -d mcr.microsoft.com/mssql/server:2017-latestAfter running this you now have a developer ready SQL instance that you can then connect to SQL Management Studio (or any other GUI management tool), or you can even connect via the command line.
If you are not using SQL you can run a container for the desired database type (check out the options on Dockerhub).
Once you have your database up and running, run the scripts to set it up, seed the data, and test without worrying about messing up your production database.
Comment: Thank you! Would it be possible to set up our own container image remotely that is the most up to date version that all the developers could then pull from and test against?
Comment: Yes.  You can create an image for the team and have everyone pull that from a repository you push it into.


How to copy text string from nfc tag

Question: I'm trying to copy a string of text from a nfc tag, but the only option I've been able to find is displaying the text with no ability to copy it (its a complex string with letters and numbers). Best case scenario would be to insert the string where the cursor is at the moment the tag is pressed, but I'm okay with somehow getting the string to the clipboard to paste.
If this isn't the right place to ask this question, if you could tell me where I could find the answer, I'd be very grateful.
Comment: Are you trying to develop an app that does this? If that's the case, you would probably have better luck on our sister site, http://stackoverflow.com. Questions about development are off-topic here.
Answer: NXP's NFC TagInfo app can copy the text from a text record on a scanned NFC tag to the clipboard. There are other apps with similar functionality. Copying text from text records on NFC tags is not something that's built into Android without installing and running an app.
Comment: Thanks, I just tried it out and I can in fact copy it to the clipboard. This is a step in the right direction! Is there any way for a phone that does not have this app installed to copy the string to its clipboard / paste to the location of the cursor? Again, thank you so much!
Comment: @Kevin Only by installing another app that does that.

How to copy text string from nfc tag


Why does FFT size equals the numbers of samples in the time domain?

Question: My question is simple. I think I kind of understand FFT and DFT. what I dont understand is why, in Python or matlab, do we use FFT size as the number of samples? why does every sample taken in the time domain corresponds to a frequency bin in the frequency domain.
Comment: If you look at the equation for the DFT carefully, you'll see that it calculates the same number of values as there are samples in the input. So, the answer is, because of the the way the DFT is defined.
Answer: The DFT is an orthogonal transform. This means it preserves the input with zero redundancy. If length is:

longer than input: redundancy
shorter than input: loss of information

It's also equivalent to solving a system of $N=\text{len(x)}$ equations for $N$ variables (less variables = can't solve, more = infinite solutions). Further reading.
Comment: Thank you so much.
Answer: You can do DFT in a different way, but the most interesting scenario is when the DFT is unique and invertible.
DFT is a linear transformation, it can be defined as a matrix multiplication $X = W\, x$ where $x$ is a vector with time-domain samples and $X$ is the vector of coefficients. If you want an invertible $W$ you need to have the same number of rows and columns, thus $X$ has the same number of elements as $x$.
Comment: Thank you so much.
Answer: I got this answer from @dmuir on SO before my post was closed for being irrelevant.
Mathematically a key property of the fourier transform is that it is linear and invertible. The latter means that if two signals have the same fourier transform they are equal, and that for any spectrum there is a signal with that spectrum.
For implementations with a finite collection of samples of a signal the first property means that the fourier tramsform can be represented by a N x M matrix where N is the number of time samples and M the number of frequency samples. The second property means that the matrix must be invertible, and so square, ie we must have M == N.
You say that time bins and frequency correspond, and that is true in the sense that there are the same number of them. However the value in each frequency bin will depend on all time values.
Comment: And this answer is roughly equivalent to the two answers here. Just to complement, you can compute the DFT with a different number of coefficients than the length of the input by specifying $n$ to [scipy.fftpack.fft](https://docs.scipy.org/doc/scipy/reference/generated/scipy.fftpack.fft.html#scipy-fftpack-fft). And you can even compute for non-equidistant points using nfft, but you will have [difficulties with reconstruction](https://stackoverflow.com/a/67391745/12750353)


What happened to chiphacker.com?

Question: Is chiphacker.com down for good or just for the time being?
Comment: this belongs on meta meta stackoverflow, or whatever that's called.
Comment: @Yar, MSO is fine, since this is a SE2.0-related question.
Comment: It's down again, and now redirecting to electronics.stackexchange.com, which redirects to the Area51 electronics proposal.  Let it begin!
Comment: http://meta.stackexchange.com
Answer: It'll be back soon.  We just transferred the domain from the original owner to Stack Overflow in preparation for moving it to SE 2.0 this week (probably tomorrow).  We apparently missed something in the DNS transfer, so GoDaddy decided to advertise itself for a few hours...
edit: this is now live as a public beta -- http://electronics.stackexchange.com
Answer: I lost my original rep points from the site, as well as my questions. How can I get those back?
UPDATE: when I got redirected to my site, I saw my username existed on the site (onaclov2000) and when I tried to login it said I didn't have an account, so I clicked create, and now I don't see my previous questions. (Not as much worried about the points as I am finding my old questions linked to my account).
Comment: You were in the unfortunate position of having a Google OpenID and no email registered.  Google OpenIDs are per-domain, so when we changed the domain you couldn't log in, and because you had no email registered, you couldn't recover your account.  I've manually merged the two accounts so you should be good to go now.
Comment: Anyone else who experiences this problem should email firstname.lastname@example.com
Answer: It suddenly shut me out, and now I'm redirected to area51. Not being able to get in to the site I had contributed at, and being given bogus instructions, is very annoying. (Joining area 51 and "commiting" produced no invitation.)
Comment: Try it again now
Comment: It's back up, now tagged as beta and redirecting to electronics.stackexchange.com. My web browser has now learned that Chiphacker.com is called "Down for Maintenance". The shutout appeared as I was trying to post a comment and I saw no notice the site wasn't ready before that.

What happened to chiphacker.com?


Mac Keeps Messages Deleted From iPhone

Question: When I delete messages from my iPhone, my Macbook Air keeps copies of the messages, is there a way to enable sync so that when I delete the messages from iPhone they delete on Mac and vice-versa?
Answer: No. Messages are not synced in this manner. The only sync is whether or not a particular message has been read. Once a message is delivered to a device/computer, it stays on that device/computer until it is deleted specifically from that machine.

Mac Keeps Messages Deleted From iPhone


Why is it so hard to explain that the Brownian Ratchet doesn't work?

Question: The Brownian Ratchet stood up to a lot of scrutiny before it was finally shown why it would not work as a perpetual motion machine, but it seems weird to me that all of that was necessary. If the particles hitting the paddle caused it to move they would lose energy and slow down. Because of this there is a finite amount of work that the system can do which would make it not a perpetual motion machine. Why is it necessary to show that the pawl undergoes Brownian motion to prove that it won't work?
Comment: Related: http://physics.stackexchange.com/q/203974/ I *think* the confusion lies in the fact that any entropy-decreaser can be used to make perpetual motion, so we often use the latter term to describe the former.
Comment: @rtpax perpetual motions of the second kind do not generate energy, they transform more heat into work than otherwise possible, and the heat transformed only becomes infinite if you have an infinite thermal reservoir. https://en.wikipedia.org/wiki/Perpetual_motion#Classification
Comment: That clears it up a little bit for me, but how does entropy-decreasing lead to perpetual motion? It still wouldn't be able to provide an infinite amount of useful work as far as I understand.
Comment: To me, it's obvious that a Brownian Ratchet should work, just like it's obvious that [cold fusion](https://en.wikipedia.org/wiki/Cold_fusion) should work. It's a shame that such nice ideas conflict with reality.
Answer: Most proposed perpetual-motion machines are perpetual motion machines of the first kind (that is, they violate the First Law of Thermodynamics, conservation of energy).  It's easy to understand why these shouldn't work, and the missing energy source (or the fact that the machine isn't really perpetual) can usually be found quickly.
The Brownian Ratchet is an example of the less-common perpetual motion machine of the second kind.  It apparently violates the Second Law of Thermodynamics (entropy in an isolated system cannot decrease), in this case, by generating motion directly from a heat source.  Entropy is a much harder concept to understand than energy (it can be thought of as a measure of the "sameness" of the universe), and working out why the Brownian Ratchet doesn't work requires complicated statistical-mechanics calculations.
The key thing to remember when analyzing the Brownian Ratchet is that the Second Law applies to isolated systems as a whole.  The paddles aren't isolated from the pawl; a correct analysis needs to take into account the whole paddle/pawl/working fluid system.  If you do this, you'll find that, over time, the entropy decrease from molecules hitting the paddles is exactly offset by the entropy increase from molecules hitting the pawl or the pawl's own thermal motion, letting the paddles slip backwards.
Answer: Here is another reason why a ratchet should not work: it would define a directional arrow of time even in thermal equilibrium.
To see this look at the modified ratchet in the graph (the triangular piece is attached to a spring). the brownian particle would move easier to the right as it can push the triangular piece down, but if it is at the right and tries to move to the left it will be stopped by the vertical surface (no way to push it down). Our intuition tells us that the particle then will circulate clockwise, even in thermal equilibrium. This defines an arrow of time: you can tell if a movie is shown in reverse. Which cannot be true.
Comment: Are we talking QM here? If so, T is not always symmetric (kaons violate CP, which is the same as T violation). If we're talking classical, then T is certainly not symmetric, or I'll turn my omelette back into an egg. The only real symmetry is CPT.
Comment: I am not talking quantum, and your omelette making process is is well away from thermal equilibrium. I believe you agree that, classically, fluctuations in the arrow of time could be in any direction in thermal equilibrium, but  a ratchet would violate that.
Comment: Thermal equilibrium - I forgot about that! +1 :-)


How to check resume function for Embulk plugin

Question: Currently I'm developing embulk. I implemented resume function for my plugin but I can't confirm operation by test for resume function. How to test resume function ? How to implement a transaction fail during run embulk to check resume function?
Answer: Did you ask the same question on the Github Issue?
Please see: How to check resume function for plugin


Why are there multiple suicide calls from one address to a contract in the same block?

Question: There are several contracts whose internal Tx have only suicide calls from the same contract/user address over and over again. What is the need of having multiple calls?
Comment: For some reason I've also not had contract suicide when I called them.  I've not yet looked into it deeper but something seems a bit of a miss.
Answer: SUICIDE opcode uses negative gas because the operation frees up space on the blockchain by clearing all of the contract's data.
This negative gas deducts from the total gas cost of the transaction, so if you're doing some clean-up operations first, SUICIDE can reduce your gas costs.
Probably all contracts must have been cleared the same user, hence you could see such transactions
Comment: From your answer I think you are referring to one user calling multiple contracts, is that right? Just to clarify my question the one user is calling the suicide function of a single contract in a single block many times (365 times to be exact) .


ZigFu Image Viewer in Unity

Question: I am working on a student project with the Kinect. Everything is working fine so far with the ZDK. Now we want to get the RGB Image from the Kinect camera.
There is a Script called ZigImageViewer, but it doesn't work for me. I also looked at the ZigDepthViewer which works for me. I set the "UpdateImage" setting in the Zig script to true. Is there any other setting I have to change?
I am using the Kinect for XBox, not the Kinect for Windows. My OS is Mac OSX 10.8. "Near Mode" is disabled before started and while running…
I got two exceptions:
MissingComponentException: There is no 'Renderer' attached to the "ZigFu" game object, but a script is trying to access it.

You probably need to add a Renderer to the game object "ZigFu". Or your script needs to check if the component is attached before using it.

ZigImageViewer.Start () (at Assets/ZigFu/Scripts/Viewers/ZigImageViewer.cs:20)

and
NullReferenceException: Object reference not set to an instance of an object

ZigImageViewer.UpdateTexture (.ZigImage image) (at Assets/ZigFu/Scripts/Viewers/ZigImageViewer.cs:35)

ZigImageViewer.Zig_Update (.ZigInput input) (at Assets/ZigFu/Scripts/Viewers/ZigImageViewer.cs:44)

UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)

ZigInput:notifyListeners(String, Object)

ZigInput:HandleReaderNewUsersFrame(Object, NewUsersFrameEventArgs)

ZigInputOpenNI:OnNewUsersFrame(List`1)

ZigInputOpenNI:ProcessNewDepthFrame()

ZigInputOpenNI:Update()

ZigInput:Update()

I think the second exception is resulting out of the first exception. Here it says that there is no renderer, but the DepthViewer has no renderer attached, too.
Thanks for your help!
Answer: Open scene "SimpleViewer" from Assets/ZigFu/SampleScenes directry.
There is Gameobject with name "Image". Use it as sample.

ZigFu Image Viewer in Unity


is it OK to lay an engineered wood floor that is 27' long without putting a T-joint in the middle to avoid buckling?

Question: I am installing an engineered wood floor (bamboo).  My LR/DR is 27' long.  The installer said I ned to put in a T-joint transition between the LR and DR, at the 18' mark, to avoid buckling.  I am concerned about a bump in the middle of the floor, and my wife says no way.  Do I need to do this? I am installing the floor parallel to the long side of the room.
Comment: are you sure the installer is going off of manufacturer recommendations and not his own experience? check with the floor manufacturer, they should be able to give you the actual numbers. my laminate floors' installation instructions asked for a joint at 13meters or 40feet. 18feet subjectively looks way too tiny a distance, and many open concept homes nowadays are much longer than that.
Comment: alt told you everything you need to know....manufacturer should give you recommendation. You should know that they always make "reserve" for themselves meaning that distance they tell you are most likely a bit smaller than it really should be, but if possible follow their instruction. @ alt why don't you post this as an answer?
Comment: Is this floating, glue, or stapled?
Comment: If your decor allows, you could cheat yourself a large gap at the walls by removing (undercutting) drywall, applying normal baseboard, and then putting a largish quarter round shoe molding on that. This would give you at least an inch.
Answer: In my own personal experience of this, the floor is capable of enormous movement,
even if you undercut at the skirtings. Avoid long, expanses without expansion joints if possible. My floor used to rise, like a small hill, then open into canyons, dependent on the change in the weather and humidity. Remember too, being on edge, it's strong enough to push a wall down!


Is it possible to download Ubuntu 15.04 directly from the main site to my laptop as a clean install to rid issues with Ubuntu 15.04 running now?

Question: Is it possible to download Ubuntu 15.04 directly from the main site to my laptop as a clean install to rid issues "PCC Probe failed" with Ubuntu 15.04 running now?  I'd like to know why it is so difficult to install or overwrite and clean install Ubuntu 15.04 from the Ubuntu website?  Why must "we" go the roundabout method of getting a USB stick formatted, then the OS downloaded to the stick beforehand?  Why the hassle over Open Source?  Having "hurtles" is not going to convince a skeptical public full of Windows and Apple users to consider Linux if installation more like "skinning the cat."  Why not offer preformatted USB sticks that will overwrite if necessary and perform "Clean Installs?
Comment: possible duplicate of [Boot Error - ACPI PCC Probe Failed](http://askubuntu.com/questions/584248/boot-error-acpi-pcc-probe-failed)
Answer: First of all, that message is a warning and not an error. The failed probe message is of absolutely no consequence (you can ignore it). See here: https://askubuntu.com/a/584875/167115
If you want to buy a preinstalled Ubuntu disk, you can do so from the Ubuntu store:
http://shop.canonical.com/index.php?cPath=17
Also, windows and OSX both have the system limitation of not being able to install over a running OS. In fact, both Windows and OSX require you acquire installation media, from microsoft or the istore or whatever. Both Windows and Apple offer the option (of convenience) to download the OS installation media in the form of an ISO or DMG respectively. Granted, you can boot the dmg on a running OSX to start the install, I believe the system boots you out of the regular session to do so.
OR
If you would rather do all the downloading during installation, you can use the netboot or mini.iso version available here:
https://help.ubuntu.com/community/Installation/MinimalCD
Don't like or even care about opensource? Maybe the opesource community is not for you.


"Requested conversion is not supported" using a linked server and ODBC

Question: Our web application stores UTF-8 encoded data in VARCHAR fields.  Recently, we have provided our customers access to this data via ODBC using DataDirect's OpenAccess ODBC driver.  This is achieved using DataDirect's OpenAccess SDK, writing a C# .Net class to interface with the service.  We only allow customers to perform SELECT queries.  We also limit results to 100K rows at this time.
This solution really works great, except querying fields with some of this encoded data appeared as gibberish to the users, understandably.  In the next release of our service, I would like to offer users the ability to query using unencoded strings, and subsequently see the unencoded results.
I have solved this by UTF-8 encoding the incoming query, then returning the unencoded results by flagging VARCHAR fields was WVARCHAR.  This is actually working really well.  It does mean, though, that every VARCHAR column comes back as a WVARCHAR despite the presence (or lack of) Unicode characters.
Many of our customers at this time have adopted the method of creating a linked server in SSMS on their own SQL Server instance, and it is my preferred method of connecting.  Since our service limits results to 100K rows, I encourage everyone to use OPENQUERY to perform queries.  It seems, though, that there is something I'm missing in the configuration of my Linked Server in SSMS.  When string functions (LEFT, RIGHT, SUBSTRING for example) are performed against these WVARCHAR columns, SSMS returns the following error:

OLE DB provider "MSDASQL" for linked server "LOCAL" returned message
  "Requested conversion is not supported.". Msg 7341, Level 16, State 2,
  Line 1 Cannot get the current row value of column "[MSDASQL].ColName"
  from OLE DB provider "MSDASQL" for linked server "LOCAL".

This would be returned for a query such as this:
SELECT *
FROM OPENQUERY([LOCAL], '
  SELECT LEFT(FirstName, 2) AS ColName
  FROM dbo.User
')

If I were to remove the LEFT function from this query, the FirstName column would be returned, properly decoded, without error.
This problem does not affect queries in, say, MS Excel for example.  And on the surface the strings seem to be properly affected by their respective functions as I debug my way through the .Net class which interfaces to the DataDirect product.  I've attempted to change all the Server Options on the Linked Server properties, but I've not had any luck finding the right combination.  I'm just looking for the right tree to bark up here.  Is it my treatment of the results, changing them to WVARCHAR?  Or is it some attribute of my SSMS linked server that I need to change that I'm missing?
Answer: On linked server properties, on COLLATION COMPATIBLE set to TRUE, the problem is resolved.


I play piano melody on the guitar. This means one string. How can I add another note so that I can at least play two or three strings

Question: I want to play guitar but I am 67 years old, have cancer and is partially deaf. CAN NOT hear chords so I taught myself to play the right hand of the piano but this means only one note, one string. I have to see notes and look on the guitar to play this. How can I add another note so I can play two notes two strings. Please help. There must be a way but I can't find it
Answer: It sounds to me like you might be describing what are commonly called Double-stops on guitar. They are technically referred to as Diads by purists, and a quick search on google should yield lots of results, or a visit to your local library might also be fruitful. In order to actually understand how it all works, you might do some reading up on your basic music theory, but that's your decision to make. There are probably some good descriptions and advice on this site, but you'll need to be pretty specific if you choose to ask about Double-stops or Diads.
Comment: Thank you very much. It is the first time that I have a direction to research.
Answer: Sorry to hear of your challenges, and wish you well handling them.  A similar thing happened to my father, and music helped him cope, as I pray it will help you as well.
Two things: The tangent first: If your guitar is acoustic, try hugging the body.  I sometimes do this to get closer to, and more intimate with the music.  So laying your head (as in your left ear if you're right-handed) on the guitar body is something I highly suggest you try.  This not only helps get the vibrations directly into your body, but also the music into your soul!  (Everyone who hasn't tried this btw, should!)
Now as for your question, the best answer is to view the music of a piano (or other) score... as a series of meandering, interweaving lines.  The melody (and/or vocal) is just one.  You're just trying to add another.  And they don't have to be exact!  So if you don't love one, or if it's too hard to reach... then just choose another, or better yet, skip it and/or allow a previous one to sustain (and sort of syncopate) through.  For when doing this sort of thing, more often than not, less is better.  An easy way to accomplish this is just to choose the top/highest and the bottom/lowest/bass notes (especially if you are familiar with reading from the bass clef.  If not, just pick the lowest line you can read, and that should suffice).  Again if one(s) stick out that you don't like, just replace it with any you feel sounds better.
But it sounds like you want just a hard-fast trick to enable you to add good notes, while avoiding terribly-wrong ones!  For in the example you provided, the reason an E automatically sounds good when added to a C note, is because E is the 3rd of the C major scale.  It's called 'doubling a line'.  And many (like the Beatles) have easily made millions doing it (ex: their song 'Blackbird').  This also works well with 5ths and octaves.
So I believe you're asking for a simple trick to do this... like playing safely in C major (or A minor) by simply avoiding the black keys.  Well, the guitar (being so much more versatile than a piano) isn't going to be quite as helpful in that way.  The closest 'trick' I can think of, is learning how to use patterns on a (most-likely standard tuned) guitar.  (Or make your millions {like Jimmy Page via Rain Song, Joni Mitchel via Clouds, Keith Richards via Brown Sugar, etc} by learning how to tune a guitar in alternate ways to make this process easier.  But I say start standard 1st.  Because there isn't just one pattern, there's just 3 or so you gotta get to know.  Then they'll help you everywhere no matter what tuning you choose, even on the piano!)
I'm new here as well, and may get in trouble by saying too much.
But you mentioned "if I play middle C, is there a corresponding note on another string that I can play simultaneously with C. On the piano it is E. These are close enough to play together on the guitar, but E and G is impossible."
Not true!!!  Unlike a piano, a guitar has all the notes EVERYWHERE!  And you can always reach 'em.  (They may not be exactly the ones you want, but they are all represented and {mostly} all within reach at all times.  But here's the catch:  One has to know a neck, to know where they are!  (Or at least the shortcut of knowing a few {like a half-dozen or so} patterns.  Don't worry, I'll not list them.  But they'll be in any good books that mentions CAGED).
So in your case, it sounds like you're {wisely btw} trying to go from using only one, to two, or 3 strings.  I just think you're starting with the wrong one... backing yourself up against a wall, where you have nowhere {or strings} to move.
The strings {high to low aka near the floor, towards the ceiling} are 1-6.  6=Low E, 5=A, 4=D, 3=G, 2=B & 1= high E.  The patterns get a little funny up on the high end (the 2 aka B string just shifts it higher by a fret), so it's easier at first to start on the bass part, ie strings 6,5,4.  But it sounds like you started with #6.  So if you're at the C on that string, you're way up at the 8th fret!  Wondering where a G is!?!  How are you supposed to know there's one right there on the open 3rd string?  (Or 2 frets higher on #5 string, 10th fret.)  I don't expect you to know that yet.  But things are easier if you give yourself some room.  So start on the 5th string (A).  That way, your C is at the 3rd fret, and your G is right there of above {as in closer to the ceiling} it on the 6th string.  And you have your E by playing #6 open.  And another higher-pitched one on the 4th string, 2nd fret.
So my suggestion to you is to first get familiar with this part of the neck, and how these three bass strings relate to each other.  But start by centering on the C on the 5th string.  That way, you have ample room to move around before running out of instrument (unless you buy a 7 or 8 string, which I'd approve of!).
This way you can smoothly transition from your familiar white piano keys, to becoming familiar with C major on the guitar, and beginning to learn/know/FEEL where all the 'letter-notes' are... at a good logical place on the neck, before learning where else they are.
I don't want to throw too much at you, and I hope this all makes sense.  But I also don't want to leave you without enough to start with... that importantly includes the ability to make some music while learning, rather than getting too bored with the mechanics.
So I'd love to start you off with the doubled/corresponding third diads (since they're more interesting, and are the example you gave).  Their patterns are not at all difficult.  But I've thrown a lot at you.  So let's start with the insanely-easy (if you begin on the 5th string that is!) 5ths instead.  They are the easiest to start with.  Why?  Because THEY ALL (except for one), are on the same fret below  the 5th string, on the 6th.  The one exception is the 7th (or the B).  In this case, it's one fret lower.
So if you start on the C (5th str 3rd fr), the corresponding 5th is at the 6th string, 3rd fret.  But if you go down the neck, a half step lower (to the 7th aka B) then the corresponding 5th on the 6th string will be the F at the 1st fret.  That's the only difference.  (The 5th of the open A btw, is the E on the open 6th str). But as you walk up the neck, all the corresponding 5ths will be at the same fret as their roots[note1] you play on the 5th string... all the way up to the 5th string, 14th fret/6th string 13th.  (Keep in mind that everything repeats/starts over at the 12th fret.)  Try it and you'll hear the correct harmonious correspondence.  These are the basis of what some call power chords... or 5 chords.  They aren't really chords, rather naked triads.  Missing their thirds, they are neither major or minor (although that different 7th one is diminished!).  So they're vaguely ambiguous... meaning they'll sound good enough (most of the time) to get by (and enable garage bands to get paid for their 1st gigs!).
Please let me know if this is the kind of info you're looking for, and if you'd like me to give you the patterns for the 3rds and octaves.  I'm sure if it's too much... someone'll tell me that too. :)
In any case good luck and keep enjoying making music!
Note1:
What this is actually doing, is called "Harmonizing The (C Major) Scale".  In other words, each note played on the 5th string, along with the corresponding one on the 6th, are parts of chords which all perfectly fit (aka all have the same notes in common with) the scale.  In this case of C major (when the appropriate 3rds & 7ths are added) they will be CM7, Dm7, Em7, FM7, G7, Am7, & B half-diminished.  But the point is that ALL of these chords, (and therefore any fragments of them) will all sound harmonious together... because they are all exclusively-made-up of the white keys of a keyboard.  But some black keys will be necessary, to complete the chord harmony of any key other than C.  But wonderfully on a guitar, the resultant patterns will basically be the same {relative to the root}... just located a bit differently on the neck.  So learn one... and you've pretty-much have learned them all.
Answer: I hope you are doing well. That's great that you are learning to play an instrument! Learning to play an instrument is one of the best things you can learn. But anyway, to your question. The backbone to finding another note to accompany the melody is knowing the chords. I recommend you start with a popular melody and looking up the chords that accompany the melody. Learn how to play those chords and really internalize how it sounds. Then, you will start to develop an ear that will help you add chords to any melody. I hope that helps! Let me know if you have any questions.
Comment: Thank you for your answer. Really appreciate it. The problem is I cannot hear the difference between chords. I play piano notes on the guitar from piano sheet music. I can hear a melody faintly with the help of the amplifier. What I am really asking is: Is there corresponding notes on the guitar for the piano notes. The piano experts can't help me so I am turning to the guitar experts. Eg. On the piano you can play Middle C and E at the same time, on the guitar also but G and E is impossible or notes are on the same string. Is there another note that you can play with G and so on.
Comment: Yes, you can play that second note an octave down. On every string, there is always going to be every note. But not always in the same octave. I am not an expert at guitar but I am sure with trial and error you will be able to find each note and play it on that string. Or you can check this image out for reference: https://www.simplifyingtheory.com/wp-content/uploads/2014/07/guitar-note.png
Comment: Actually the image you provided is the one I am using to play. Eg. I have a dream, starts with GEDF. The ideal would be to have that same note map showing all the notes linked to it. Then I play G with another note on a different string. The E with maybe 2 notes at the same time and so on. If I can't find a "note map" with linked notes it would mean that I have to try and link notes myself to build it. This takes time that I don't have however willing because my wife has to link it on the piano and I draw a line from note to note on the note map. This is confusing but am memorizing it slowly
Answer: Approaching this from a really simple point of view. A lot of the more uncomplicated songs have three chords supporting them. Let's be in key A. Those chords are A D and E. Not that you're going to be playing chords, as you state.
Instead, just play the notes, on the low open strings, which correspond to A D and E. Find which one is appropriate for each bar you play in the tune, and use your thumb to play the open string at the beginning of each bar, along with the tune note on a different string.
For example, Edelweiss. 1st bar A, 2nd E, 3rd A, 4th D.
EDIT: having re-read comments, etc, I think you're trying to play a harmony to the melody notes you already play. If that's so, then -
It's easier to play an upper harmony, which needs the existing melody to be on a lower string. Let's take key C The harmony which is most common is  made using the notes  third above the original note. That third will vary between major and minor, thus:
C + E.  D + F. E + G. F + A. G + B. A + C. B + D.
If you were, for simplification, to play the melody all on the second string, there would be the opportunity to play the harmony note on top string.
Note C (2nd string, 1st fret) would mean harmony is top string open. Note D (2nd st. 3rd fret) goes with 1st st. 1st fret. Note E (2nd st. 5th fret) goes with 1st st. 3rd fret. That last one is your 'impossible' E and G! I'm not going to continue, but as you go up that 2nd string, the harmony on top string is either 1 or 2 frets lower on top string. Have fun working them out. It is a pattern.
All that sounds more complex than it is, and I hope it's more compatible with what you need. And it's really only a starter for harmony on guitar.
Comment: I really appreciate you taking the time to answer. But your answer is also my biggest problem. What you have told me is Greek to me. Remember, I do not have the lifetime to study guitar. I know all the piano notes on the guitar. All I am really asking is if I play middle C, is there a corresponding note on another string that I can play simultaneously with C. On the piano it is E. These are close enough to play together on the guitar, but E and G is impossible. What other note can I play with G and so on. Again thank you
Answer: It looks like what you're trying to do is to harmonize a melody. On one of your comments you say:

I play middle C, is there a corresponding note on another string that I can play simultaneously with C. On the piano it is E.

This is very context dependent (in this case it works because you're playing the first 2 notes of a C major chord). To understand the whole reason why, we need to get into music theory and harmony, which you don't want to do.
Trying to skip over music theory, I can try to give you a rule of thumb that can work in 85% of the cases.
You want to play a minor 3rd, major 3rd or 4th above the note you are playing. Those notes are usually found in the string higher from the one you're playing, either 1 fret higher, the same fret, 1 fret lower or 2 frets lower (depend on the string you're jumping from).
I the C and E example: there is a nice C on the 5th string, 3rd fret, and a nice E on the 4th string 2nd fret. That is a major 3rd.
In the case of F, you might try an A. This is 4th string 3rd fret and 3rd string, 2nd fret. Again, a major 3rd.
If you're playing a high D, you might try an F. This is a minor 3rd. They can be found on the 2nd string, 3rd fret and 1st string 1st fret.
This technique does not work well with open strings, so you need to find for a fingering that avoids them. For instance, try playing the B on the 4th fret of the 3rd string as opposed to the open 2nd string.
I think that the list below might be a good starter:

C -> Eb, E or F
D -> F, F#, G
E -> F#, G, G#
F -> G#, A, A#
G -> A#, B, C
A -> C, C#, D
B -> D, D#, E

You might want to try different ones to see which one is the best note in each context.
Good luck!
Comment: This looks like the kind of thing I am looking for. Will try it.
Answer: From comments...

All I am really asking is if I play middle C, is there a corresponding note on another string that I can play simultaneously with C. On the piano it is E. These are close enough to play together on the guitar, but E and G is impossible.

...that's a clearer question.
The octave for middle C is 4 so you can write that C4.
The tones you gave are CE E4 G4
You can play C4 E4 as 2nd string, 1st fret and 1st string open.
You can play E4 G4 as 2nd string, 5th fret and 1st string 3rd fret.
You can write those two like xxxx10 and xxxx53 where the six character across are the strings EADGBE and x means don't play the string, 0 means open string, and other numbers give the fret to use for the string.
Another way to write out guitar notes is tablature. It lists the strings left to right and gives the fret numbers in sequence across...

E--0-1-3-5-7---7-5-3-1-0--
B--1-3-5-6-8---8-6-5-3-1--
G-------------------------
D-------------------------
A-------------------------
E-------------------------

...that's the fingering for the first five steps of the C major scale harmonized in thirds. I think this may be the basic harmony idea you are looking for. And it can be a lot of fun to just improvise using that simple pattern. You move up and down and skip around those tones with different rhythms and start sounding like a Spanish waltz!
Another way you can try adding another note to the melody is with a bass. It's harder than just playing the harmonized scale, but you can give it a try and take it gradually.
D or G are convenient keys to use.
The 1st and 2nd strings can be used for the main melody. The bass part can come from using the open 3rd, 4th, and 5th strings for D, G, and A. If C is needed, you can get with on the 5th string, 3rd fret. Those four bass tones will support many simple melodies in D or G major. Try keeping the bass simple. Just let the note ring for 2 or 4 beats. You could adapt the bass from piano music or song books. It depends on the source where you go the 'piano melody.'
It sounds like you are wanting to play purely for your own satisfaction and enjoyment. You aren't trying to impress anyone. So, keep the music simple, take it slow, and enjoy the moment.


How do I get access to uPort from a mobile Browser

Question: I've developed a simple DApp that uses uPort and it works fine on Desktop - where I can login through uPort with the QR Code. On a mobile browser (Anrdoid Chrome) I'm auto directed to uPort where it asks me to "continue", then I'm redirected back to my app on mobile where the URL now has a hash of /access_token="{token-here}" But now uport.requestCredentials() doesn't return the uPort Profile. Am I supposed to manually grab the access token in the url and do something with it?
Answer: This problem occurs because mobile browsers often open a new browser tab instead of returning to the original. Until the issue is fixed in uport-connect, here is a workaround.
Install uport-js (normally this is just a server-side library, but we need a function from here):
npm install uport

In the front-end app we create a Credentials object to allow us to handle the access_token on behalf of our uPort app:
import { Credentials } from 'uport';`
const appCredentials = new Credentials({
  address: YOUR_APP_UPORT_ADDRESS
});

And then we grab the access token from the URL and convert it to the uPort user credentials object that should have been returned by uport-connect:
var accessToken = window.location.href.split('access_token=')[1];
var uportUserCredentials = await appCredentials.receive(accessToken);

uportCredentials will now contain your credentials.


What are the main changes between ISO 31-11 and ISO 80000-2? (math notation standards)

Question: The international standard that defines mathematical signs and symbols, ISO 31-11, was superseded in 2009 by ISO 80000-2. What are the main changes?
Comment: @nayrb Yeah that's pretty convenient. Unfortunately the ISO 80000-2 is behind paywall, which is a very nice way to spread a standard...
Comment: I didn't know there was such a thing!
Comment: I won't pay 140 CHF to help decide when to write $\phi$ and when $\varphi$. And I'll keep writing $\pi$ in italics anyway cause I don't know how to avoid it
Comment: Personally I looked for international standards for math notation when I moved from France to the US. As some notations changed, e.g. an open interval is commonly written ]a, b[ in France vs. (a, b) in the US, I started getting interested in standard notations for at least the most common concepts.
Comment: I can't imagine why the very idea puts my back up. Yet, it does. Perhaps it's just too 1984-ish.
Comment: I don't even know how to get $\pi$ to be upright, no matter what I do— `\rm\pi` $\rm\pi$, `π` $π$, `\rm π` $\rm π$
Answer: So I've got the document (160 USD for 40 pages!). Here is what it says in page iv:

The first edition cancels and replaces ISO 31-11:1992, which has been
  technically revised. The major technical changes from the previous
  standard are the following:

Four clauses have been added, i.e. "Standard number sets and intervals", "Elementary geometry", "Combinatorics" and "Transforms".

Interestingly, it goes on saying that the standard's title "Quantities and units — Part 2: Mathematical signs and symbols to be used in the natural sciences and technology" should be renamed into "Quantities and units — Part 2: Mathematics".
Given the amount of copyright notices and other efforts to keep the standard from being diffused, I hope I don't get sued for quoting one sentence...
Comment: Thanks, I just need to find a way to turn upvotes into USD and my investment will finally pay back :-)
Comment: I am upvoting this just because you paid that much money for the document.
Comment: What a complete waste of money, Frank!
Comment: I don't understand how something can become standard if it's hoarded at such an exorbitant price.


Regarding Ubuntu installation on end user machines

Question: If someone is working in computer maintenance industry and working on customer call bases then can he install Ubuntu on end use machine?
As most of the end users are using pirated Windows software, can we provide them with a legal copy of Ubuntu at no cost, and charge end user for technical support.
Please consider legal issues also when answering this question.
Answer: Ubuntu has always been and always will be free. That's the sort of philosophy that most of the linux based distros have, and is one that Ubuntu has pioneered. If you wish to install Ubuntu on a large number of machines there is no need to purchase a bulk license  something that would be needed with an operating system like Windows. There is definitely no legal issues with installing Ubuntu, the .iso files are there on this page for free downloads.
Answer: Ubuntu follows the policy of free to everyone. It is an open source operating system that comes absolutely free of cost you can install it in as many systems as you like. It comes under GPL i.e. General Public Licaense which states it's purpose. You can get most of the softwares as well using the Ubuntu's official repository that too absolutely free of charge without wandering here or there.
That's the power of open-source use it, distribute it modify it whatever you like either for your personal use or for commercial use its FREE!!!


Repeating nodes on a search tree? (AI)

Question: I am doing the following question:

Consider the 3-puzzle problem, where the board is a 2X2 matrix. There are three tiles numbered 1,2, and 3, and there is one blank tile. There are four operators that move the blank up, down, left, or right. The start and goal states are given in the following figure. With the help of search trees, show how a path to the goal can be found using:

a.  depth first search   (3 marks)
b.  breadth first search     (3 marks)
c.  A* search with the heuristic being the sum of the number of moves and the number of misplaced tiles. (3 marks)
If a search method does not find a solution, explain why it does not.
(2 marks)
START state
2 3
1 _
GOAL state
1 2
3 _
Obviously as you move to one state from another, you can move from that state to a new one or to the state that you have just moved from (due to the nature of the operators), in the search tree do we re-state the nodes that we have already branched from? In other words, if you are at stage 4 would you re-state a node at stage 3?
Answer: You should keep a table of visited states to know not to go there again.

Repeating nodes on a search tree? (AI)


Why does the paintbrush keep freezing while texture painting?

Question: I'm new to blender, and I'm working on a project where I'm making a character. I already UV mapped it and added texture, etc. But, once I tried texture painting, the paintbrush kept freezing, and the cursor wouldn't unfreeze. I'm currently in Blender Render mode, and I have a Mac. I have version 2.77. Please let me know what I'm doing wrong, and how I can fix this.
Thanks!
Comment: Hi Rittika welcome to Blender SE. What's the resolution of your image?  Also, have you tried switching the viewport display from Render to Texture?
Comment: it still persists at 3.2.x
Answer: For painting, you need to be aware of how big your image resolution is and how big your brush is in the view. Close up, your brush is dealing with fewer pixels and will have better response  - further away, it is covering a larger number of pixels to update and will 'freeze' til it calculates each pixel per face.
Freezing can also be due to too much going on to calculate the GLSL feedback , so sometimes it is best to switch to Multitexture in the N panel to focus on just one image texture at a time, clicking the texture Slot that you want active in the Slots tab.


Knowledge of 12 tribes

Question: Please Let me restate my questions, does anyone know what Old Testament tribe they have descended from today?  I had asked before but I was to gauge about the real question?
Comment: Please don't post additional copies of the same question. You can edit your original question by clicking on the "edit" link under it.  Thanks, and welcome to Mi Yodeya.
Answer: My family's tradition traces us to Judah, but only through my father's mother's father. Since I don't know the lineage of my father's father's line, I really can't be sure. Some people can trace themselves (like the families' of my father's mother's brothers) to a particular tribe.
Answer: I believe that they have done genetic testing on Kohanim. (I have to locate that article, but I recall reading about this about a year ago.)
At any rate, Koahnim and Levi'im are certainly from the tribe of Levi. If someone claims to be either of these, we believe his word. Do we have exact proof, other than above-mentioned DNA testing? No, we don't. But we have a general assumption that if numerous generations within the family have made this claim, it is reliable, though, of course, there have been cases where someone in the family erred. (I know someone who thought he was a Kohen, and eventually discovered that he wasn't.)
As for the rest, I don't believe there is definitive knowledge of which tribe people came from, though most people who are not in the above group claim to be from the tribe of Judah.

Knowledge of 12 tribes


1 switch-bank, 1 rotary, 5 inputs, 3 devices, no idea how

Question: I have 3 separate LCD's which have 5 push buttons to control the LCD settings and power.  All push buttons on the LCD share a common ground.  What I would like to do is use 1 switch bank and a 3-position rotary switch to select which LCD to adjust the settings on, however I'm unable to find an elegant solution via google. due to space limitations, I am unwilling to use a giant multi-pole rotary.  Is there an IC that will handle this?
Comment: @Janka The even more obvious choice is to just use a microcontroller for 8 inputs and 15 outputs. Either that or a couple of standard logic gate packages
Comment: Do your GND lines need to be connected? The obvious choice would be switching the GND lines.
Comment: When I can just switch the GND lines, I don't need a µC or such. Only 15 diodes and a three-way switch and that was it.
Comment: Are the LCD control lines digital or analog?  A multiplexer for digital, and I think you can do the same with analog switch bank.  I don't have any part numbers on hand.
Comment: All of the control lines are analog as far as I can tell.  I was just drawing out the 15-diode-common-ground idea before I came back to check for an answer.  I think I might go with that and see if it works.  Thanks everyone.
Answer: first of all, you have to make sure that you can work with ONE lcd, ONE rotary switch, ONE set of buttons, ....
Structuring your code in a modular way helps greatly here. for example, your lcd code would look like this:
<code>  lcd_init(LCD1); //initialize lcd1
  if (rotary_read() = ROTARY_2) lcd_puts(LCD3, vBuffer); //display vBuffer on LCD3 if rotary 2 is selected
  btn_state=lcd_readbtn(LCD2); //read the button states on LCD2
</code>
Comment: Theses are 800x600 LCD driver boards acting as monitors, so I'm not running them through a micro controller.  I'm using the inputs included on the driver boards.  Thank you, though.


How to connect mvc application using entityframework or ado.net?

Question: I am an ASP.NET developer. I want to learn ASP.NET MVC. In fact I am learning it. But Now I am confused at a point. How can I connect my database to my application. Using entity framework or linq or ado.net. I have good knowledge about ado.net. But about entity framework I cant say anything. Now my problem is this whichever ebook or website I see every entity framework is used. So is it essential for me to learn first entity framework before ASP.NET MVC or not?
Answer: You will have to use LINQ and EF together if you want to do anything more complicated than CRUD with EF. That said, EF makes CRUD dirt simple. Build your models or database, push the changes the other way (update the database or your models respectively), add controllers and views to taste.
If you start getting into more complicated objects than can be stored in a related set of tables (parent, child, grandchild, etc.), you will have to switch over to LINQ. But fear not gentle traveler, LINQ can use the EF objects directly, making a lot of things trivial (e.g., complicated nested, barely related data in structures that would make JSON blush). LINQ also gives you the advantage of being able to use SQL statements directly. AFAIK, you will only be able to use the EF connection while using SQL. I haven't had any need to even use that so far.
EF is getting better and more capable all the time. I don't see it catching up with LINQ, but it might be more than enough for most data access soon.
I would hazard a guess that you can learn EF and MVC at the same time.
I should also mention that you can combine any or all of the technologies you mentioned.
Comment: Can you explain how LINQ is ahead of EF, and in what sense?
Comment: I am no LINQ or EF expert, but with LINQ, you can query databases, object collections, and XML. That's just with what is already built into LINQ. You can extend LINQ easily by adding lambdas (anonymous functions), standard functions that return a single value, or collection/list/queryable object. You can perform complex evaluations using some of the library objects. As a part of a LINQ query, [you can create a collection/list/queryable object of any class you have the ability to instantiate](http://justsomevbcode.blogspot.com/2011/07/linq-with-multiple-child-objects.html).
Answer: You have to see these elements as layers of a cake.

ASP .Net WebForms or ASP .Net MVC is the top layer of the cake,
namely the user interface layer.  This, ideally, should handle the
user's browsing and pass anything more complicated than that off to
the business logic.
The next layer down, the middle of the cake, is the 'business logic',
where you'd set rules of your application, or the 'how it all works'
coding.  Anything more complicated than this, namely reading/writing
to the database is passed down again.
The bottom layer of the cake, is the data layer; this layer reads and
writes data to/from the database, irrespective of whether you're
using SQL Server, Access, Oracle, MySQL, whatever.

Learn to cut your code up like this and you'll be in a better position for your career, going forward. (For Dependency Injection, Inversion of Control, Unit Testing, etc etc etc.)
In the case you've mentioned, Entity Framework is known as an Object Relational Mapper, or ORM for short.  NHibernate is another example of an ORM.  The job of an ORM is to remember that a particular table in your database is 'mapped' to a class object in your code.  There are lots of examples on StackOverFlow.com for Entity Framework, but to be honest, I'd buy a book that not directly focused on EF as it sounds like you need an MVC grounding first.  Try something like this: ASP .Net 4.
LINQ, however, is something that you can use with coding in general but primarily, you'd use LINQ to query a database, or other collection of objects, as in:
<code>    // The Three Parts of a LINQ Query:
    //  1. Data source.
    int[] numbers = new int[7] { 0, 1, 2, 3, 4, 5, 6 };

    // 2. Query creation.
    // numQuery is an IEnumerable<int>
    var numQuery =
        from num in numbers
        where (num % 2) == 0
        select num;

    // 3. Query execution.
    foreach (int num in numQuery)
    {
        Console.Write("{0,1} ", num);
    }
</code>
Have a look here as this might be a good place to start.


Why does the value of gravity decrease as we dig into the Earth, but also decrease as we enter the upper atmosphere?

Question: I know the answer (hence, the title). But, why, i do not understand?
Comment: Possibly because when you go towards the center, the mass above you exerts its own gravity, which tends to cancel out the gravitational force towards the center. When you dig deeper, the mass above you increases and so does the upper component of gravity. If you assume the Earth composed of infinite spherical shells, you can proove the linear relationship between gravity and distance r<R, (R being the radius of the earth). Above the surface, it follows the inverse square law, because the same number of gravitational lines of force has to pass through decreasing surface area (as you go down).
Comment: Possible duplicates: http://physics.stackexchange.com/q/18446/2451 , http://physics.stackexchange.com/q/2481/2451 , http://physics.stackexchange.com/q/119067/2451 and links therein.
Comment: Gravity does not decrease as you dig into Earth (initially) because it is not uniform as the question implicitly assumes.
Answer: This is due Newtons shell theorem which says that for the particle $m$ all the mass outside the blue shell of radius $r_1$ cancels out:

while the mass inside a shell of radius=0 equals also 0 so there is no gravitational acceleration in the gravitational center of the earth (or any planet).
Answer: Because as you go down, the mass above you has a gravitational pull on you that resists the pull of the mass below you. This continues until you reach the center and the pulls all cancel out, making you weightless.
When you go up, the force of gravity on you decrease because of the equation
$$F = G\frac{m_1m_2}{r^2}.$$
As the distance increases, its square does even more so, making the force of gravity weaker as you leave Earth i.e. go up.
Answer: Just as there is a Gauss's Law for the Electric Field, there is similarly a law for the Gravitational Field. It states the following:
    $$
    -4\pi GM_{enclosed}  = \oint \! g \cdot(dA)
    $$
When you go deeper into the earth, since the mass enclosed by a sphere of a certain radius is directly proportional to the volume enclosed (assuming constant density), the enclosed mass decreases faster than the surface area of the enclosed region decreases, causing a smaller gravitational field.
When you go into the atmosphere and further, since you've already exceeded the radius of the earth, the enclosed mass stays the same while the surface area of the gaussian sphere increases, causing a smaller gravitational field.


Good Conferences for Environment Designers

Question: I'm a graphic designer working in events, pop-ups, retail and brand activations. My work has encouraged me to seek out conferences and learning opportunities and I'm having difficulty finding conferences that are applicable to environment and event design. I'm looking to learn skills relating to designing temporary structures, retail environments, and branded spaces. Does anyone know of good events or conferences related to this field?
Comment: Europe, US, other regions?
Comment: US for me, although other regions could be useful for other users!
Answer: Note that I've not attended any of these but they're ones I've come across and have looked into:
SEGD is Society of Experiential Graphic Designers. It encompasses wayfinding, signage, and environmental design. They host a bunch of events; I believe their largest is SEGD Conference Experience. For your purpose this is probably the best organization.
Expo! Expo! is a conference about conferences hosted by the International Association of Exhibitions and Events.
ExhibitorLive is by Exhibitor magazine. They have some interesting articles though a lot is behind paywalls. I've considered telling my boss I want a subscription but we really aren't large enough to do fancy booths and usually just have a table with a popup display type of deal. Actually it looks like since the last time I looked they may have gone to a free subscription model, not positive. Says its free to signup now, not sure the exact terms and if thats a trial period.
Answer: Art and Environmental Justice. From the event's page:

The day's agenda will place the arts at the center of these conversations, investigating how creative practices contribute to community and global struggles for environmental justice.
A free interdisciplinary symposium to promote dialog on the interplay of environmentalism, social justice, education, design, and the arts. Students, scholars, activists, educators, designers, and artists working on environmental justice issues will explore the politics surrounding systemic biases and the ways that environmental degradation and climate change intersect with race, gender, and class to create disproportionate outcomes on both a local and global scale.
Comment: Always quote the source if you copy the text 1:1, I edited for you.


Are self-lending loans legitimate?

Question: In the credit building/repair industry, there are some companies offering self lending. That is, you take a loan in the form of deposit in a savings account. Then you pay it in monthly installments over a year. At the end of the year you take out the deposit plus a small APY, but minus a large APR. The company claims to report it to credit bureaus as an installment loan, hence it is a way to build credit. My question is: does this really work? If so, how does it compare to secured credit cards in terms of credit building?
Answer: Is it worth spending extra money to use a scheme that will establish or repair your credit? That depends on how badly you need credit. For someone ready to purchase a home, it could be very beneficial to establish better credit before signing a mortgage. Whether the cost is worth paying can only be determined in specific scenarios.
How does this compare to secured credit cards? By definition those are revolving credit, where this scheme appears to be a loan with a 1-year term. I would expect that having regular payments on an account that will stay open longer will have the bigger benefit, but there are a few people that might benefit from having other loans in the mix.
Comment: FICO formulas can be updated as needed. This scheme does demonstrate the ability to make regular payments. It may not be as abusive as you think. Certainly no worse that secured credit cards. Risk to the lender isn't the legal test of whether it is a loan or not.
Comment: I guess it also depends on how bad a credit one starts with. Since such a scheme does not seem to impose any risk to the lender, it doesn't require a minimum credit to apply. Which leads to another question: will credit reporting agencies begin to think of this as a sort of system gaming and start to crack down on it?
Comment: @user53560 Why does this have no risk to the lender? I'm presuming the savings account will be in the borrower's/credit-repairer's name, so they could potentially run away with it, as with any loan. If it were _not_ (legally) in their name, then I would expect (though am not in the US) that FICO would disregard such payments (or move to do so if the practice became widespread).

Are self-lending loans legitimate?


What causes the US media obsession with tariffs; The EU and others have charged tariffs on US stuff forever?

Question: The EU has about a 50% tariff on US beef and higher tariffs on US liquor (typical EU bureaucracy has many categories and quotas, so a single number is impossible). So why is a relatively low US tariff on 2 materials, (the EU has tariffs on about 100 materials from the US) make so much news time?
Comment: This may be better on Politics.SE or Economics.SE.  There isn't a skeptical claim here.
Comment: Essentially because the United States has previously bound itself to charge no more than (for example) 2.6% tariffs on ordinary aluminium from other WTO members and in fact often charges less, such as 0% on the imports from its largest supplier Canada due to NAFTA.  EU tariffs on imports from the US and elsewhere are similarly bound by previous WTO deals. The reason given of "national security" for a 10% tariff on aluminium is seen as implausible by most commentators, and instead it looks more like Trump wanting to start a trade war by ripping up previous rules.
Comment: I suspect, though, that if you look around you can find all sorts of specific people making specific claims around the idea that tariffs will destroy the US economy, and must be avoided at all costs.  Some of those will likely be made by notable people or groups.  If you wanted to bring one of those here to challenge, that *would* be an appropriate question for the format.
Comment: @Henry Post answers as answers so they can be voted on!
Answer: Nations frequently have tariffs between each other. However, the trend since WW2 has been fewer tariffs and other trade barriers. For example, even recently the EU has significantly reduced tariffs.
Likewise, the US has also both practiced and preached free trade, reducing tariff rates.
Economists have strong consensus that tariffs are bad. This isn't dependent on political leanings, it has wide agreement. "The economics profession continues to show a consensus in favor of unfettered international trade, as 83 percent agree and only 10 percent disagree that the United States should eliminate remaining tariffs and other barriers."
The reason the new tariffs are reported by the US media are because they are a new policy change which oppose the existing trends and expert opinion, although they do have public suport
Answer: Steel and aluminum are used to make tanks and jets. The US already has the largest military in history.
Because this will make other countries justifiably paranoid, it could start an arms race and a) waste a lot of everyone's money everywhere and b) possibly be a step toward some war of aggression. Both of these factors could force realignments among other countries that they might prefer not to have to make, in order to ensure that things cannot get too crazy.
Even if it's just Mr. Tough Guy being an idiot, other people have to plan for that. Due to the theoretical possibility that it's planning for some war of aggression, presumably those who disagree with wars of aggression will prefer to purchase media outputs from companies who provide sufficient information and perspective toward prevention of such things coming to pass.
Comment: This seems very unlikely. These tariffs will, if anything, increase the costs of producing military equipment, which would counterproductive if the aim was to facilitate an arms race.
Comment: I don't think this is it.
Comment: I agree with Cubic that it would increase the cost per unit, but it would increase the overall capacity in those sectors. This is a typical criticism of, say, the Soviet economy, which under Stalin achieve enormous growth in heavy industry related to arms production, while ultimately proving so inefficient that the Soviet model collapsed.


Why is dark energy called dark?

Question: I know that dark matter is called dark because it interacts very weakly/doesn't interact electromagnetically.
Is the same for dark energy, or the name is due to something else?
In particular, can dark energy interact electromagnetically?
Comment: both are named "dark" because we don't know what it is.
Comment: I understand that if Dark Energy would interact (also?) electromagnetically then at least charged particles would have some other distribution, maybe more smooth.... Because we know charged particles in the universe are not smoothly distributed then dark energy doesn't interact electromagnetically. Is it correct?
Comment: The dark energy is thought to be uniform across the universe and very weak so it is unknown  whether it interacts at all with anything. It is simply proposed as a solution to the accelerated expansion of the universe.
Comment: Ok, practically, with our technology, it doesn't interact....
Comment: Some advice on English: 1) Avoid starting sentences with "or", "but" or "and", 2) Capitalize the first word of each sentence, proper nouns, and the word "I". Do not capitalize other random nouns.
Answer: There are two main reasons why dark energy is called dark. The first one has to do with the fact that all detections of its effects are indirect. For example, we use the spectra of Type Ia supernovae as standard candles to verify the hypothesis that further galaxies are receding from us at increasing speeds.
This accounts for the observational side.
Theoretically, dark energy is taken to emerge from the cosmological constant $\Lambda$ (This is why the standard model of cosmology is called $\Lambda$CDM). In this cosmology review, we see how dark energy comes from the Friedman metric.
$$
ds^2 = -dt^2 + a(t)[dr^2 +r^2d\Omega^2]
$$
The cosmological field equations are
$$
\Big(\frac{\dot{a}}{a}\Big)^2 = \frac{8\pi G}{3}\rho - \frac{k}{a^2}
$$
and
$$
\frac{\ddot{a}}{a} = -\frac{4\pi G}{3}(\rho + 3p)
$$
which from conservation of the energy-momentum tensor give a third equation in a system
$$
\dot{\rho} + 3H(\rho + p) = 0
$$
Because we have three equations with three unknowns ($a$, $\rho$, and $ p$), we basically have to take a guess. The usual move is supposing that $p/\rho = w$ where $w = \{1/3, 0, 1, -1\}$ The first three values of $w$ account for different epochs of cosmological evolution: radiation-dominated, dust dominated, and stiff fluid. The last value accounts for the density of dark energy.
Setting $w=-1$ not only gives an expanding universe but results in an equation of state with a negative pressure. Because this does not occur in other areas of physics, it is conceptually unclear what that means, but it is ultimately taken to be an effect of dark energy. Do note, however, that if this value is neither radiation-dominated, dust dominated or a stiff fluid it cannot emit light. It's dark.

Why is dark energy called dark?


Do dependent types give you everything subtyping does?

Question: Types and Programming Languages focuses quite a bit on subtyping, but as far as I can tell, subtyping doesn't seem especially fundamental. Does subtyping give you anything more than dependent types do? Working with dependent types is bound to be more work, so I can understand why subtypes might be useful in practice. However, I am more interested in type theory as a foundation for mathematics than as a basis for programming languages, should I pay much attention to subtyping?
Answer: Subtyping and dependent types are orthogonal concepts.
Subtyping is typically equipped with a notion of subsumption, whereby an expression of one type can appear in place where a supertype is expected.
Subtyping is more likely to be decidable and is more simply to manage in implementation.
Dependent typing is vastly more expressive. But if you ever want to consider a group to also be a monoid, then you need a notion of subsumption to forget the extra structure. Often, such as when using Coq, a trivial proof obligation is generated to deal with this kind of coercion, so in practice subtyping may not add anything. What's more important is having ways of packaging together various theories to make them reusable, such as reusing the theory of monoids when talking about groups. Type classes in Coq are a recent innovation for doing such things. Modules are an older approach.
If you do a quick google of "subtyping dependent types" you find a bunch of work adding subtyping to dependent types, mostly from around the year 2000. I imagine that the meta-theory is really challenging, so no subtyping of dependent types appears in proof assistants.
Comment: Thank you, this is exactly what I was looking for. I have asked a couple of noob questions now that seem to have been somewhat well received even though cstheory.SE isn't the Right Place for such questions. On a scale of -5 to +5 would you encourage or discourage similar questions in the future?

As a side note, as I understand it (from reading Robert Harper), type classes are a subcategory of modules, is that right?
Comment: This question is on the just right side of the border of what is suitable for cstheory.SE. Type classes are not really a subcategory of modules. It's more like type classes are modules+type inference+free_plumbing.
Comment: I'd imagine that you can always model/simulate subtying with dependent types fairly easily. In Haskell, HList (which is just built on decidable type equality) gives you subtyping, for example (c.f. "Haskell's Overlooked Object System"). The only hard part about subtying is type inference, and once you're working with dependent types you've tossed 90% of that out anyway.
Comment: (changed from a comment to an answer)
Comment: The subset theory of Martin-Loef's type theory is basically what you need to model structure forgetting, and that dates back to the 1980s.  I think this is sort of what @Neel is getting at in his answer.
Answer:
However, I am more interested in type theory as a foundation for mathematics than as a basis for programming languages, should I pay much attention to subtyping?

One extra thing subtyping gives you is that subsumption implies that lots of coherence properties hold. A dependent type theory also needs a notion of proof irrelevance to model everything you can do with subtypes. For example, in dependent type theory you can approximate forming a subset with a dependent record:
$$
\{x \in S \;|; P(x)\} \mbox{ vs. } \Sigma x:S.\;P(x)
$$
However, note that the cardinality of the subset will be smaller than $S$, whereas the dependent record can have a bigger cardinality (since there can be many possible proofs of $P(x)$ for each $x:$).
To faithfully represent subtyping (which says that if $X <: Y$, and $x:X$ then $x:Y$), you need $P(x)$ to be proof-irrelevant -- that is, for there to be at most one inhabitant of the type $P(x)$.
Once you have that, you can systematically elaborate subtyping into dependent type theory. See William Lovas's thesis for an example of adding subtyping to a dependent type theory (in this case, Twelf).