Can t-test be used to test for significant difference between two populations dependent on age

Question: I am comparing different traits within the plant populations and looking for sex differences across ages. A trivial example is outlined below. Male plants are in blue, female plants in red. x-axis has age in days and y-axis has height of the plants. If I want to test for significant height difference across age between the two sexes can I just use a t-test to do so? And will this still be valid if the height change with age is exponential and the ages in my dataset are not particularly normal? And is there a good way to do this with python?
Answer: YES AND NO
For the "no", the usual t-test would just test if mean height or mean age differs between the two groups. This is not what you want.
For the "yes"…
I would analyze this using a regression. The outcome ($y$) would be the height, and the features ($X$) would be age, the group corresponding to the colors, and the interaction between them. The interaction tells you the difference in slope between the two groups: that is, the difference in how age affects height, which sound like the exact information you want.
$$
y=\beta_0+\beta_1x_{age} +\beta_2x_{group}+\beta_3x_{age}x_{group}+\epsilon
$$
You would use categorical encoding for the $x_{group}$ variable, where you code one group as $0$ and the other group as $1$.
A common way to test this would be to fit a linear regression using ordinary least squares and test if the coefficient on the interaction feature is nonzero. This would be a t-test, with a more general definition of the t-test.
A good test of this in Python comes from the summary of a linear model in the statsmodels package, where you will get the p-value of each coefficient, including the interaction term of interest.
import numpy as np
import pandas as pd
import statsmodels.formula.api as smf
np.random.seed(2023)
N = 50
x_age = np.random.uniform(0, 100, N)
x_group = np.random.binomial(1, 0.5, N)
e = np.random.normal(0, 1, N) # epsilon error term
y = x_age + x_group + 0.2*x_age*x_group + e
d = pd.DataFrame()
d["age"] = x_age
d["group"] = x_group
d["height"] = y
smf.ols("height ~ age + group + age*group", data = d).fit().summary()

I get a tiny p-value on the interaction term, and a plot is consistent with the notion of different slopes for the two groups.
import matplotlib.pyplot as plt
plt.scatter(x_age[x_group == 1], y[x_group == 1])
plt.scatter(x_age[x_group != 1], y[x_group != 1])
plt.show()

Comment: This is an excellent explanation! Just to clarify one piece, the small p-value you reference is the Prob(F)? And because OLS is run on all the data, the low Prob(F) tells us that there is a small probability that all of the data follows the regression. Is that correct?
Comment: @TheNightman That is for a test for the whole regression, so if the age variable has a major effect on the height (makes sense to me), such a p-value could be quite low no matter how the interaction term influences the height. For testing just the interaction, you want the `P>|t|` value for the `age:group` interaction. Some `statsmodels` documentation somewhere should explain what everything in the `summary` means.


Should Admin and User records be stored in the same table for a website with separated frontend and backend?

Question: I have 2 separated section: frontend & backend with their login pages. Frontend is for user to register and do something with their stuffs. Backend is for administrator to manage resources. Someone told me that it is more convenient if we want to promote a normal user to admin role if I use 1 table. However, for example, I want to create a new admin, I have to sequentially fill in all the related details that a normal user is required to register. It is such a waste of time.
Do you think it is better to store both admin & user records in one table in general case and also in my case?
Answer: yes you can store both of them in same table and for admin user add one column like isAdmin of "Y" "N" to avoid filling all fields used for normal user.


Handling KML/CSV with geopandas - DriverError: unsupported driver: u'CSV'

Question: I'm trying to import a dataset of UK postcode districts UK postcode districts from Google Fusion tables into geopandas with the aim of splicing it to a dataset of house prices.
The problem is that geopandas doesn't seem to like either the CSV/KML version of the data.
If I use the command geopandas.from_file(path) then I receive the error:
DriverError: unsupported driver: u'CSV'

I have the same error when I try to import a KML version of the data (You can download the data below).
I'm sure it's trivial, but can anyone work out what I'm doing wrong?
UK postcode districts - KML
UK postcode districts - CSV
Answer: The KML driver isn't enabled by default as detailed in this github issue https://github.com/Toblerity/Fiona/issues/97. Basically, the KML driver doesn't seem to meet Fiona's quality requirements (as of 2014), not sure if it will be fixed in the future.
You could try to read a simple/standard-enough KML as follows:
import geopandas as gpd
fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable KML support which is disabled by default
fiona.drvsupport.supported_drivers['KML'] = 'rw' # enable KML support which is disabled by default

gpd.read_file("/path/to/your/test.kml")

I've tried to read a file here and it gave me the following output:

Credits to this gist:
https://gist.github.com/timtroendle/6f61dc38a0aad58c2261524d7d8594c3
Edit 20191021: With newer versions of fiona, you might need to use libkml instead of kml. I.e.:
fiona.drvsupport.supported_drivers['libkml'] = 'rw' # enable KML support which is disabled by default
fiona.drvsupport.supported_drivers['LIBKML'] = 'rw' # enable KML support which is disabled by default

Answer: in case of csv, it probably would be easier to read it with pandas and then convert it to geopandas Dataframe
import pandas as pd
import geopandas as gp
from shapely.geometry import Point

stations = pd.read_csv('../data/stations.csv')
stations['geometry'] = stations.apply(lambda z: Point(z.X, z.Y), axis=1)
stations = gp.GeoDataFrame(stations)

Answer: GeoPandas relies on the Fiona library (http://github.com/toblerity/Fiona) for the from_file() implementation. At this time Fiona, and therefore GeoPandas, does not support CSV or KML input. If you can convert them to GeoJSON or Shapefiles, then GeoPandas should be able to read without a problem.
Answer: The current version of GeoPandas (0.10.2) can be made to read KML via the following code_snippet:
import geopandas as gp
gp.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'

df = gp.read_file('sample_file.kml', driver='KML')

Answer: The current version of Fiona supports the CSV driver out of the box. You may have to specify the names of the latitude and longitude columns like this:
geopandas.read_file("file.csv", X_POSSIBLE_NAMES="X", Y_POSSIBLE_NAMES="Y")

More information about possible arguments for the csv driver can be found in the gdal driver documentation: https://gdal.org/drivers/vector/csv.html#open-options


Proof that the set of rationals is countable with finite preimages?

Question: I'm working through the proof that the set of Rational numbers is countable and the proof says in order to do this you just have to show every rational number can be mapped to the set of natural numbers using a function. The function they choose is |p| + |q| where p and q are p/q where q > 0, which is the definition of a rational number. Then it says the number of preimages are no more than (2n+1)^2, but doesn't explain why. I can intuitively see that |p| + |q| = n for some natural number n is finite, but I don't really know how to prove it. Also I don't know where they got (2n+1)^2
Comment: Assuming $|p|,|q| \le n$, $p$ is between $-n$ and $n$ inclusive which is $2n+1$ choices. Certainly there are even less choices for $q$, so an upper bound for the number of preimages is $(2n+1)^2$.
Answer: With $q>0$, and $|p|+|q|=n$ the number of preimages is actually less than $(2n+1)^2$. It is $n(2n-1)$, because
 $q$ can take at most $n$ values, namely $1,2,\dots, n$, and $p$ can take any value between $-n+1$ and $n-1$, altogether $2(n-1)+1=2n-1$ values. It follows that the number of pairs $(p,q)$ such that $p,q$ are integers, $q>0$ and $|p|+|q|=n$ is precisely $n(2n-1)$.
Answer: Fix a non-negative integer $n$. Really, all you need to prove is that  $S_n:=\{(p,q)\in \mathbb Q: |p|+|q|=n\}$ is either finite or countably infinite, because $\mathbb Q\subseteq \bigcup_n S_n.$  In fact, it is easy to show that $S_n$ is finite: the values of $p$ and $q$ cannot exceed $n$ in absolute value so $|S_n|$ is bounded by $(2n)^2+1.$
It might be easier just to note that $\mathbb Q^+=-\mathbb Q^-$ so $|\mathbb Q^+|=|\mathbb Q^-|$ and then inject $\mathbb Q^+$ into $\mathbb N$ via $(p,q)\mapsto 2^p\cdot 3^q.$


Extending Dual Monitors with VGA and HDMI to Single link DVI

Question: Here is my question. I have a workstation running windows 7 on a Dell Optiplex 390. He would like to use two extended monitors. The graphics card is an Intel Graphics HD 2000. It has a VGA out and HDMI out. I want to convert the HDMI to Single Link DVI then extend the screens using the VGA/DVI. Is this possible or am I wasting my time?
Comment: Might be cheaper to get a new graphics card.
Answer: It should work with an HDMI -> DVI-D (DIGITAL) adapter, but have a look at this from the Intel website:

What are the system requirements for Multiple Display support? Your
computer must have the following:
Physical video output connector(s)
Your computer must have a video
output connector or connectors to which one or more external displays
would be connected to. Some laptops may have additional video output
connectors on a docking station, port replicator, or via the laptop
manufacturer's special video cable. On desktop systems, some computer
manufacturers may offer at an extra cost an add-in card (referred to
as ADD2) which adds video output connector to the computer.
Two or more display devices are connected.
Display devices may include an
analog monitor, notebook's built-in display, external monitor or flat
panel display with analog, DVI-D, DVI-I, HDMI*, or DisplayPort*
connectors, or television with S-Video, Composite, Component, or D
connectors. Not all display device combinations may be supported by
your computer. Please check with your computer manufacturer for
information on the supported multiple display configurations for your
computer.
An Intel® graphics driver is installed.
The Intel graphics
driver's Properties control panel allows you to set a multiple display
configuration. Not all multiple display configurations may be
supported by your operating system or by your computer. Some examples
include: The Starter Editions of Windows Vista* & Windows 7* do not
support Extended Desktop mode; Many computer manufacturers disable the
Twin mode. Please check with your computer manufacturer for
information on available and supported multiple display configurations
for your computer.

http://www.intel.com/support/graphics/sb/cs-031040.htm
***UPDATE:
I might be wrong.  Look at this, and check all the comments.  It appears people have mixed results.  I've seen multiple outputs work on many Optiplex models so it might still be possible to do it if you have the right drivers:
http://en.community.dell.com/support-forums/desktop/f/3515/t/19410045.aspx

Before Connecting Mutiple Monitors or a Monitor and a Television to
Your Computer
To support dual monitors or a monitor and a television, you must have
an optional graphics card. If you are connecting more than one
monitor, ensure that the connectors on your monitors (whether VGA or
DVI) match the available connectors on your computer, or that you have
any necessary adapters. For example, if you have a VGA monitor that
needs to be connected to a DVI port on your graphics card, you must
have the optional DVI adapter.
Comment: I have read that second forum and deduced that I could try out the fixes they suggest, however it still doesn't clarify whether or not those fixes make it so the screens can be extended ( I know my version of 7 pro supports it.) so the only thing I am apprehensive about is that it will still only be a clone and not an extension. Also thanks a ton for your help.
Comment: `To support dual monitors` .. `you must have an optional graphics card.`. I read this as: If you add another card which supports this then you can do it. And since you already need an extra card you might as well connect all three screens (primary and two two extended displays) to it and use a single driver.
Comment: I understand what your saying however it is already shown you can run the dual monitors with the integrated hd 2000. However my issue is if the screens can be extended. I already know it will clone off of a HDMI to Single Link DVI with another VGA. I just want to extend two screens that's it. Thanks for your input though it is appreciated.
Answer: You would unfortunately be wasting your time. Although you would be trying to use an HDMI->DVI adapter out of the video card, the input is still recognized on your PC as being HDMI, so you still wouldn't be able to to so since you are still technically using two different forms of output.
You would be better off upgrading to a new card if you can.
Comment: I have used a HDMI to DVI and VGA dual monitor setup in the past.  You don't indicate why that combination is not possible.
Comment: Because it cannot span across two different outputs/output signals. If it was VGA/DVI yes. HDMI/DVI no.
Comment: I should have asked you this first, are you just extending your desktop, or trying to do this with something like eyefinity and span it?
Comment: I personally have used a HDMI to DVI cable along with a VGA cable to another monitor so your statment is not entirely accurate.  I doubt the author will answer your follow-up question he hasn't be around for a year.
Comment: Haha, I figured the same thing. didn't notice the date of the question until a while after posting. I have used the same also and have a similar setup now, extending the desktop is no problem. I assumed he was trying to span as you would for gaming. My mistake, thanks for the downvote, lulllllllllll
Comment: I don't find the answer vey helpful thus the downvote.  As for correctable specifics....The inaccurate information and simply saying to replace the graphics card ( the user isn't even using one based on his own description ) is a start.
Comment: Yes, on board, can see.


why is python running at over 90 percent on cpu all the time in ubuntu 11.10?

Question: I just checked my processes over last 3 hours and python was running over 90 percent,sometimes 110.whats causing this ?it says something about a checkbox running when i hover over it.I uninstalled two apps-onboard keyboard and system testing and it seems that python is eased off and not even listed in processes.Is this a bug or can anyone tell me what python does exactly?whats a checkbox?I think the last thing I tried to do before this happened was run system testing and testing halted.When I closed it out then reopened it had a box open saying another checkbox was running
Answer: Python is an "interpreter", similar to Java for instance. It runs applications. Any application that's written in the Python programming language will be run by a python process. This means that saying "python is running 90%" doesn't really tell us much. It simply means "some application is running".
In this case, however, you provided a hint. Checkbox is the actual Python program that is running. It is a system to test different types of software. It is used for System Testing, which is used to test hardware support, among other things.
Uninstalling an application doesn't exit the application (otherwise, upgrading the system while it is running would be impossible), so even if you have uninstalled system testing, it will still be running. It is difficult to know exactly why it doesn't quit. There's too many unknowns. However, if you log out and back in, the problem will go away. Or if you had to enter your password when running the test (running it as the 'root' user), a reboot will exit that application if it doesn't stop.
Otherwise, you can open System Monitor and find the Python process running the "checkbox" instance. Then you can right-click and kill it.
Comment: I did perform a reboot and noticed python was still pegging over 90 percent when I logged back in.The only thing in this instance that put python to sleep was to uninstall system testing.After uninstalling everything was fine.When i started testing I noticed system testing froze so I closed it.Upon reopening it I saw the popup about checkbox running.I also noticed elsewhere that when I opened firefox and closed it the page I had been looking at was still in the titlebar until I clicked desktop then it would say desktop.When uninstalling system testing I feel i killed two birds here
Comment: I removed the lagging of titles staying in top bar and rested python.Now removing system testing-what problems can it cause as far as systemwise in the future?I seriously dont think I need it if it doesnt run as supposed to
Comment: Python is not an application. It's like Java. There are thousands of different applications that runs Python and they will all look similar if you only look at the command.You have to look at what is being run, not the interpreter.
Comment: thank you for your answers here jo-erlend.I understand what your saying now and it is very helpful info
Comment: Glad to hear that. :)


Create/Delete a connection from javascript

Question: Is it possible to create a Connection from javascript through the REST services (or another method)?
I can't find a great deal of support on this at all.
Anyone done something similar?
I'm using this as I want to add a Custom role to multiple selected contacts.
EDIT:
I currently launch a HTML web resource, iterate through the selected GUIDs and create association rules. At this stage I wanted to trigger a workflow to manage which welcome email should be sent out as well as other things. As I can't seem to trigger a workflow on the creation of an association I'm now looking at using connections so updating my JS to create / remove those instead of the associations. This way I can trigger a workflow. However don't know how to create a connection in JS.
Answer: Try using ajax/dwr for this purpose. Although it is very shady that you have to create a connection in javascript. could help more if a reason or use case is provided.


A one hour interuption in cooking chicken, will it be safe to eat?

Question: I half boiled chicken legs and thighs, put them in my Crock Pot with BBQ sauce, put the slow cooker on high, but forgot to plug it in. I discovered my mistake an hour later. So I quickly put them in the oven to finish cooking. They were still steamy hot when I took them out of the crock pot, but I didn't take their temperature. Will they be safe to eat?
Comment: Not an exact duplicate, but the information you need to know is in the suggested duplicate QA
Answer: Generally the USDA recommends that if food has been in the "danger zone" (between 41 and 140°F) for two hours, it is unsafe to eat. Here's the guide.  If the food is in the upper end of the "danger zone" the safe time shortens to an hour.
So, your chicken is right on the cusp of being considered unsafe to eat.  If the chicken was colder than 140° when you put it in the crock pot, I wouldn't want to risk it.  That said, if the surface was boiling hot when it was put in, it probably wouldn't have spent that full hour in the "danger zone" and still be ok.


Find the integer values of c

Question: Find all possible positive integer values of c that $\frac {a^2+b^2+ab} {ab-1}$=c can take in $\mathbb N$.
I know that the solutions are c=7 and c=4 but I don't know how to prove this with Vieta Jumping method.
Comment: What is $a$ and $b$? Are they integers? Or natural numbers?
Comment: integers it's a classical problem but I don't know how to solveit by vieta's root jumping
Comment: edited answer to make the Vieta step more prominent.
Answer: THIS IS VIETA JUMPING. I RARELY LIE ABOUT MATHEMATICS.
$$ \frac{x^2 + xy + y^2}{xy-1} = c, $$
$$ x^2 + xy + y^2 = c xy - c,  $$
$$ x^2 + (1-c)xy + y^2 = -c.  $$
We want integers with $$ x^2 + (1-c)xy + y^2 = -c  $$ and $c \geq 3,$ because otherwise the quadratic form on the left is positive definite or semidefinite.
There are no solutions with $xy \leq 0$ in any case.  we take $x,y > 0.$
THIS IS THE PART WHERE VIETA ROOT JUMPING IS EXPLICIT!!!!!!!
We are going to look for solutions that minimize $x + y.$ We can replace $x$ by
$$ \color{blue}{x' = (c-1)y - x}. $$
We see that $x' < x$ so $x' + y < x+y,$ unless  $2 x \leq (c-1)y. $
We can replace $y$ by
$$  \color{blue}{y' = (c-1)x - y}. $$
We see that $y' < y$ so $x + y' < x+y,$ unless  $2 y \leq (c-1)x. $
SEE. VIETA ROOT JUMPING. RIGHT THERE ABOVE.
If there are any integer solutions for a particular $c,$ then there are solutions satisfying the  inequalities
$$ 2 x \leq (c-1)y,  $$
$$ 2 y \leq (c-1)x.  $$
I'll call these the Hurwitz inequalities and Hurwitz lines. Article in 1907 in German.
For $c=4$ we get $(2,2)$

For (c=7) we get $(2,1), (1,2)$

Let's see: for those who know calculus, the Hurwitz lines intersect this branch of the hyperbola in the minimum value of $x$ and the minimum value of $y.$ What happens when $c \geq 8?$

Well, as you can see in the picture, the branch passes through a point very near $(1,1)$ when $x=y,$ to be specific
$$ x = y = \sqrt {\left(1 + \frac{3}{c-3} \right)},  $$
 slightly larger then $1.$
However, as soon as $x=2,$ we find the $y$ value along the lower part smaller than $1,$
$$  y = (c-1) - \sqrt {c^2 - 3 c - 3} = \frac{c+4}{ (c-1) + \sqrt {c^2 - 3 c - 3}}  $$
This thing has limit $1/2$ as $c \rightarrow \infty.$ $c=8, 0.91723,$ $c=9, 0.85857$
Not a coincidence: $c=7, x=2 \rightarrow y= 1, $ $c=4, x=2 \rightarrow y= 2. $
So that is the proof, for $c \geq 8$ there are no integer lattice points on the arc of the hyperbola within
$$ 2 x \leq (c-1)y,  $$
$$ 2 y \leq (c-1)x.  $$
You can draw graphs for $c = 3,5,6,$ you will see that the arc of the hyperbola between the Hurwitz lines does not contain any lattice points.
I put lots of detail at  Is it true that $f(x,y)=\frac{x^2+y^2}{xy-t}$ has only finitely many distinct positive integer values with $x$, $y$ positive integers?
Comment: It's very interesting thanks, but I'd like a proof using Vieta's Root Jumping
Comment: @Weijie, it is Veita root jumping. Really really really. Edited to put in the word Vieta in a few places. By the way, root jumping is just one little part of any such argument, everything else is always inequalities, although usually easy ones.
Comment: Oh sorry I read it very fast I see it now thanks!
Comment: You said you rarely lie. It means you lie occasionally. xD. By the way, +1.
Comment: @JaideepKhare I think I recall how this went. Chen, in the first comment above, said he wanted a proof using Vieta Jumping. After that, I put in the first line about not lying. Meanwhile, here is the piece by Hurwitz, which really does help clarify what Vieta Jumping is doing. It is in German, but is about as easy to read as any German mathematics article I have seen. http://zakuski.utsa.edu/~jagy/Hurwitz_A_1907.pdf
Comment: @Will Got it

Find the integer values of c


Send reports in Email body through Apex in Lightning

Question: I have a requirement where in I created a Report in Salesforce to get all Orders group by Owner, Account Geo field & orders that are closed this quarter.` I have prepared the report but I need to send this report in Email body(like table having columns & rows with report data).
Is it possible to do in Apex. I don't want to send the reports as attachment it should be directly sent in Email Body.
I don't need attachment in excel format because client is worried of sending the attachment in Email due to Security reasons. Here is my report which I created.

What are the workarounds for this?

EDIT
I some how managed to get the table in Email body by using below query in apex.
Public static string tableEmailBody(){
        List<Period> periodLst = [Select EndDate,StartDate From Period Where type = 'Quarter' and StartDate = THIS_FISCAL_QUARTER];
        Date currentFQStartDate = periodLst[0].StartDate;
        Date currentFQEndDate = periodLst[0].EndDate;
        String htmlBody;
        htmlBody = '

Report for Orders Closed Current Quarter

Owner Name	Account Geo	New Recurring Amount	New One Time Amount	Record Count
';
        for(AggregateResult clsOrd : [SELECT SBQQ__Quote__r.Owner.Name ownerName,SBQQ__Quote__r.SBQQ__Account__r.Geo__c accountGeo ,SUM(SBQQ__Quote__r.New_Recurring_Amount_formula__c) recurringAmount,
                                      SUM(SBQQ__Quote__r.New_One_Time_Amount_rollup__c) oneTimeAmount,COUNT(OrderNumber) ordNo FROM Order where (Opportunity_Closed_Date__c >=:currentFQStartDate) AND (Opportunity_Closed_Date__c <=:currentFQEndDate)
                                      GROUP BY SBQQ__Quote__r.Owner.Name,SBQQ__Quote__r.SBQQ__Account__r.Geo__c]){

                                          htmlBody += '
' + clsOrd.get('ownerName') + '	' + clsOrd.get('accountGeo') + '
';
                                          htmlBody += '
' + clsOrd.get('recurringAmount') + '	' + clsOrd.get('oneTimeAmount') + '
';
                                          htmlBody += '
' + clsOrd.get('ordNo') + '	';
                                      }
        htmlBody += '
';
        return htmlBody;
    }

But since the query is grouped by Owner name & account geo I am getting table in below format in email. Column 3,4,5 values are getting populated in owner & account geo column, but they should be at 3,4,5 column respt.
What went wrong here.? Please help!!
Comment: Have you tried this? - https://www.forcetalks.com/salesforce-topic/how-to-send-reports-via-email-to-a-group-of-users-on-an-hourly-basis/
Comment: As I said I don't want to send it as attachment.
Comment: `ApexPages.PageReference report = new ApexPages.PageReference( '/' + reportId[i] + '?excel=1'); // or csv=1`

This is key part I was hoping you check. with this you can try to print the data in email.
Answer: My bad the
 tags were not properly formatted.
Here is the working code to get report data in Email body.
Public static string tableEmailBody(){
        List<Period> periodLst = [Select EndDate,StartDate From Period Where type = 'Quarter' and StartDate = THIS_FISCAL_QUARTER];
        Date currentFQStartDate = periodLst[0].StartDate;
        Date currentFQEndDate = periodLst[0].EndDate;
        String htmlBody;
        htmlBody = '

Report for Orders Closed Current Quarter

Owner Name	Account Geo	New Recurring Amount	New One Time Amount	Record Count
';
        for(AggregateResult clsOrd : [SELECT SBQQ__Quote__r.Owner.Name ownerName,SBQQ__Quote__r.SBQQ__Account__r.Geo__c accountGeo ,SUM(SBQQ__Quote__r.New_Recurring_Amount_formula__c) recurringAmount,
                                      SUM(SBQQ__Quote__r.New_One_Time_Amount_rollup__c) oneTimeAmount,COUNT(OrderNumber) ordNo FROM Order where (Opportunity_Closed_Date__c >=:currentFQStartDate) AND (Opportunity_Closed_Date__c <=:currentFQEndDate)
                                      GROUP BY SBQQ__Quote__r.Owner.Name,SBQQ__Quote__r.SBQQ__Account__r.Geo__c ORDER BY SBQQ__Quote__r.Owner.Name]){

                                          htmlBody += '
' + clsOrd.get('ownerName') + '	' + clsOrd.get('accountGeo') + '	';
                                          htmlBody += '' + clsOrd.get('recurringAmount') + '	' + clsOrd.get('oneTimeAmount') + '	';
                                          htmlBody += '' + clsOrd.get('ordNo') + '
';
                                      }
        htmlBody += '
';
        return htmlBody;
    }


Multiple "levels" of association in classical conditioning?

Question: Sorry if this appears a silly question - If I understand correctly, the objective of classical conditioning, is to pair a neutral stimulus with an unconditioned stimulus, so the neutral stimulus starts producing the same unconditioned response corresponding to unconditioned stimulus.
My question is - can there be multiple "levels" of stimuli that can end up producing the same unconditioned response ?
For example, referring to the famous dog salivating experiment, the dog learns to associate ringing bell stimulus with food because it was paired with food stimulus.
Now if we start pairing another stimulus say, "bang the door", with "ring door-bell", would the dog be able to eventually salivate on "bang the door" stimulus ? Would it learn that "bang the door" would then be followed with "ringing door bell" and eventually "food" stimuli and thus learn multiple "levels" of associations between the stimuli ? If yes, how many such "levels" can an animal like rat or dog form these associations for ?
Answer: Found answer to my own question. This is called "higher order conditioning":
https://www.alleydog.com/glossary/definition.php?term=Higher+Order+Conditioning#:~:text=Higher%20Order%20Conditioning%20(also%20known,produce%20salivating)%20to%20produce%20the


Scheduled Mass Delete of records

Question: Is there any app, tool or feature that would allow me to schedule Mass Delete of records without using any code. Any suggestion would be appreciated.
Comment: Have you looked in the App Exchange??
Comment: I found this app: https://appexchange.salesforce.com/listingDetail?listingId=a0N300000016YuDEAU  however there is no option to schedule the delete task.
Answer: You can use Dataloader for that, and use the Command Line Interface (CLI). This way, Dataloader can be invoked using the scheduler of your system OS - like Windows Scheduler - to call a batch file that will in turn call the Data Loader.
Through the Dataloader config file, you can automatically login.
To use the Dataloader CLI, you find details here:
http://wiki.developerforce.com/page/Using_Data_Loader_from_the_command_line
Answer: Storage Helper mass deletes data from any object in Salesforce and does not require code. You can install free from the AppExchange: https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5fvwEAB

Scheduled Mass Delete of records


Issue with SMB/CIFS on OpenMediaVault 3.0.59 with Windows 10 PC?

Question: I have installed OpenMediaVault 3.0.59 on my Rpi3. I'm trying to use it as a NAS for my other Windows 10 PC. But even after enabling the SMB/CIFS, it does not shows up in the network of the Windows 10 PC but shows up perfectly in another Win 7 PC and a android device?
Comment: @ITSolutions try that. still can't access it.
Comment: Does Windows 10 PC is able to see other share on your network? Try also to access NAS by IP (\\ip.ip.ip.ip\share) instead of name. Check  W10, may it pick "public" network profile that will prevent to browse local network
Answer: Windows 10 has disabled guest access to remote file shares for security reasons:

While the server may be fine not distinguishing among clients for files [...], this can actually put you at risk elsewhere. Without an account and password, the client doesn't end up with a secure connection to the server. A malicious server can put itself in the middle (also known as the Man-In-The-Middle attack), and trick the client into sending files or accepting malicious data.

The safe solution is to add an account to your NAS and use it to access the share.
The unsafe solution is to edit the registry. You need to create a DWORD parameter named
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\AllowInsecureGuestAuth

and set it to 1.


unable to display turboVNC

Question: I'm trying to use turboVNC for remote application. I have installed virtualGL package (virtualgl32_2.6_amd64.deb) and then turboVNC (turbovnc_2.1.90_amd64.deb).
I'm using
Ubuntu 16.04 LTS
Processor : Intel® Core™2 Duo CPU E7300 @ 2.66GHz × 2
Graphic : AMD RV610 (DRM 2.50.0 / 4.15.0-33-generic, LLVM 6.0.0)
OS Type : 64-bit

I do not receive any error when installing, but afterwards, I'm unable to launch turboVNC.
It appears in Application; when I click on it, something appears briefly in the launcher side bar menu and then nothing.
I tried to remove and re-install, I still have the same problem.
Running:
~$ vncserver

returns:
New 'user1-OptiPlex-760:8 (user)' desktop is user-OptiPlex-760:8

Starting applications specified in /home/User/.vnc/xstartup
Log file is /home/User/.vnc/user-OptiPlex-760:8.log

I'm able to run vncserver from TurboVNC but not open the graphical window. I get a new error message:

Could not find libjawt.so.
Answer: You have to install java in your system, do it with:
sudo apt install default-jre

unable to display turboVNC


Backup & Restore SP Site with External Content Type to Another Site - make error

Question: My site includes External Content Type (BCS) on Dev site, with List which of that type - and when
i restore it to Prod server, the connectivity of the list, stay as previous system..!
any way to backup and restore web application with lists of that kind, and still be able use them one another environment ?..
Answer: Either you update the BCS before backup in source system or after restore in target system.
Alternatively you might be able to use server aliases feature of windows server. You set up your BSC source as "BCSSource" and then in server aliases you set up different server per environment to use the "BCSSource".


PSU Stability Measurement

Question: The mathematics behind stability are crystal clear. I am very confused, however, as to how these measurements are taken in a real system. Specifically, say I have a power supply. How would one measure the power supply stability including gain margin and phase margin. I am interested in a controlled way, what kind of probes, etc.
Comment: What kind of stability?
Comment: @Mario I hope my edit clarifies a little.
Answer: There are ways to measure the transfer function of a given system. However, just to judge the stability a good way is to look at the step response. The overshoot (or the lack thereof) can be used to determine the phase margin of a system.
Often systems can be approximated by a second order transfer function and almost every (basic) book on control theory covers the theory of these systems and the relationship between step response and phase margin.
Comment: As the phase margin goes towards zero the overshoot can reach 100 percent. For 45 degrees its above 20 percent.
Comment: I've heard the step response idea thrown around, but I'm curious how accurate this really is. What changes in a real environment and what kind of accuracy would you expect?
Comment: The step response is every bit as reliable a measure of stability as phase margin. If you don't have some reason why you  actually need to know the phase margin, I would suggest that you not worry about it as such, and just observe the step response.
Comment: Well if this is truly the method everyone uses then I can accept that, but what accuracy equipment am I generally looking for?

PSU Stability Measurement


Stiff-necked themes

Question: Site health alerts that I should remove inactive themes, but every time I update WordPress, the default themes are automatically installed again. How do I get rid of automatic twentywhatever themes installation?
Answer: It is wise to have at least one standard theme installed, because it will always work. If your current theme, for whatever reason, no longer works with the current WordPress install, you will have a backup theme to get your site running again.
That said, you are not the first to complain about this and you can stop it by adding this to your config.php:
define('CORE_UPGRADE_SKIP_NEW_BUNDLED' , true);

Stiff-necked themes


Comparing RTF files and returning the difference in an RTF format

Question: I am looking for a STDIN/STDOUT supported program that can return the difference (preferably in RTF format) between two RTF files or strings, similar to how GitHub tracks changes between two text-files. I'd rather not have to build something like this from scratch.
Comment: RTF only supports fairly basic formatting information. It may be that the diff report is too complex to be saved as RTF.
Comment: @EricS RTF supports everything that MS Word supports, so definitely it can represent all web pages. It's just extremely space inefficient and almost impossible to read the source later
Answer: diff <(unoconv --stdout -f pdf file1.rtf | pdftotext -layout - -) \
     <(unoconv --stdout -f pdf file2.rtf | pdftotext -layout - -)

The unoconv utility converts the RTF files to PDF. The pdftotext utility extracts the text from the PDF streams. The diff command compares the two streams and outputs the results to standard output.
Comment: I disagree with the Community Bot that your answer is unclear! :)  Your answer is very clear to me.  The OP did prefer the output to be in RTF output, but they mentioned  that as a preference, and not as a hard requirement.  Your answer is missing links to `unoconv` and `pdf2text`, so I'll add them for you (if you have preferred links, feel free to edit).  As a new community member, welcome, and an upvote for your first useful answer!
Comment: As it's currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: You can use WinMerge.

WinMerge is a free software tool for data comparison and merging of text-like files. It is useful for determining what has changed between versions, and then merging changes between versions.

Encyclopedia information about WinMerge - Wikipedia
Command line - WinMerge 2.12 Manual Page at winmerge.org
Comment: This does not solve my problem. The application does not allow me to export the difference (the /o argument does not work), it doesn't show me the specific difference in RTF-format (only in plain text, which is unreadable for the average user) and even with the xdocdiff-plugin (which converts the RTF to plain text) it does not show me the specific changes when I e.g. change the font color.
Answer: If you want to get the result back as RTF then the comparison needs to understand RTF. One way would be simply to read the RTF into an application that understands RTF, such as Word or OpenOffice/LibreOffice then do the comparison in that application and export the result as RTF.


How to get rid of color band while clicking picture of an projected screen?

Question: I am trying to click a picture of an image projected by a projector with a Nikon DSLR camera. But whenever I click the picture there are weird colors all over the captured image? How can I stop that?
Thanks.
Answer: Use a shutter time longer than the length it takes the projector to do a full scan. For most cases, this would be at either 1/60 or 1/30 second. In order to use shutter times that long, you may need to stabilize the camera to prevent blurring from camera movement and close down the aperture and/or reduce the ISO to prevent overexposure.
Answer: While M. Clarke's answer is correct, it implies that the projector scans, i.e. it has a DLP and a color wheel, and it outputs field-sequential colors. You can easily verify this by moving your eyes rapidly and observing the color breakup (R,G,B colors) on bright edges. GIYF.
3-LCD projectors don't have this problem, but they are in a higher price class. 3-DLP digital cinema projectors also don't, but there you might capture the subfields, just like with plasma TV panels. In all those cases a long shutter time is recommended, i.e. n/60 (or n/50 or n/24) sec.
Similar problems may occur when shooting under fluorescent or LED light that flickers at 100 or 120 Hz, especially when you shoot movies at 30,60 or 25,50 fps respectively. Since the DSLR has a rolling shutter, you may see bands. Again, shutter slower or at a multiple of the flicker period: n/120 in 60 Hz countries, n/100 in 50 Hz countries. You want to capture integer flicker cycles. Now you know why cameras are available with both frame rates.
It's fun to shoot a high frame rate movie to observe the behavior of displays or lights, but otherwise it's often unusable.


Why is the process named geod in my iOS simulator trying to access irs.gov?

Question: I'm developing an app that has absolutely nothing to do with anything other than specific external audio-related hardware. While running my app in the iOS simulator, I got a message from my LittleSnitch (that's a firewall) that the process geod (iOS) is trying to access irs.gov. As if that wasn't enough, the next attempt was to azadiradio.org. I blocked both but I'm wondering: what is going on within my iOS simulator?
Comment: What simulator are you using? Is this in Xcode?
Comment: @NathanLucy yes, iPad simulator with iOS 7.1. There is no additional software installed other than my app and the default stuff. Could it be the Newsstand or something? But why IRS?
Comment: Are you sure that LittleSnitch is providing you with reverse dns properly?  I have heard of issues with reverse dns and Little Snitch.  It is likely that you are providing location information to less nefarious folks than the IRS.
Answer: This sounds like a classic case of bad reverse DNS. Note that both the IRS and azadiradio.org are at least partially hosted by Akamai's servers. This can lead to some confusion for people trying to do a reverse DNS. Your simulator might be trying to access some other server (could be Apple's, they also use Akamai) and Little Snitch tries to translate that IP address into a domain. When that IP is used by one of the world's largest hosting and content distribution networks, you run into problems.


Enervating Mist vs Silent Wobby, which one is active?

Question: I recently asked myself a random question, what would happen if Enervating Mist (handsize down to 5) and Silent Wobby (limit handsize to 3) were active at the same time. Would it just be last or first one (based on activation order)?
Comment: Enervating mist seems to decrease hand size also (opponent hand size to 5), Infinite Cards is, as far as I know, the only card that gives unlimited hand size
Answer: From the ruling on Enervating Mist I see the following, emphasis mine:

If "Enervating Mist" and "Infinite Cards" are both active, whichever effect resolved last is dominant.

So yes, it will depend on the order of activation (and thus, order of resolution) which effect takes place.
A related fact is the "negative precedence over positive" rule (as in MTG IIRC). This means that if an effect says that someone can do X, and another effect says that someone cannot do X (they contradict each other), the cannot takes precedence over the can.
This is not the case for the specific cards you mentioned, but is worth mentioning nonetheless.


Substitute for Calvados, reduced cider?

Question: I am interested in making America's Test Kitchen's French Apple Cake. The recipe calls for a tablespoon of Calvados. Oh for heaven's sake, that's the worst case of 1/4 cup of squab stock syndrome I've seen lately. I've called around to see if I could find applejack or generic apple brandy for a reasonable price, but no, even those products are out of my price range for something I don't think I'd particularly enjoy finishing off. I can't find extract either. It does seem though that the recipe begs for a bit of extra flavor. How about reducing some hard or soft cider? Any other great ideas to boost the apple flavor?
Other ingredients of the cake are:
<code>1 1/2 pounds Granny Smith apples
1 teaspoon lemon juice
1 cup (5 ounces) plus 2 tablespoons all-purpose flour
1 cup (7 ounces) plus 1 tablespoon granulated sugar
2 teaspoons baking powder
1/2 teaspoon salt
1 large egg plus 2 large yolks
1 cup vegetable oil
1 cup whole milk
1 teaspoon vanilla extract
Confectioners' sugar
</code>
Comment: I don't know that the Calvados would give you any *apple* flavor that isn't in the cake already. Maybe you could substitute some regular brandy? (I haven't ever tried Calvados, FWIW.)
Comment: It shouldn't be so hard to finish off: spirits keep well, and you could also use it in apple sorbets (or poured on an apple sorbet - I've had that in Normandy) and sauces.
Comment: @user5561 I haven't tried it either, but I have been told that the apple flavor does come across pretty loud and clear in baked goods, even if it's not so apparent just drinking it.
Comment: Another thought that kind of sounds good is spiced rum. Hmm, it wouldn't add apple flavor obviously, but it might compliment the apples nicely.
Comment: Sounds like I'll have to try it sometime, then. If only it weren't so expensive...
Comment: Interesting:  http://qandasys.info/substitute-for-calvados-reduced-cider/#comments   Word for word the same.
Comment: @ChrisCudmore Hmmm, I don't know whether to feel honored, or used!
Comment: You won't be the last person to end up on a s.e. Site scrape.
Answer: One tablespoon of apple brandy in a recipe of that volume is an accent; it may be nice to have, but it is not going to dramatically transform the outcome.
The obvious choice is to simply omit it.
Otherwise, some reasonable substitutions include:

Vodka.  While it doesn't bring a specific flavor, it will provide alcohol to help dissolve those flavor components that otherwise would not be as apparent, perhaps intensifying the flavor of the cake.
Bourbon.  Compliments the vanilla, and provides a counterpoint to the apples.
Brandy, either grape or another fruit like pear.  Another, similar flavor accent.

There is little point in reducing soft cider because it will not contain alcohol, and the quantity is not enough to matter, unless (and then only maybe) you make a syrup--in that case, however, you would be more substantially transforming the recipe.
Hard cider has some alcohol, so might work (after all, Calvados or apple brandy is distilled hard cider), but you don't want to reduce it, which would drive a significant percentage of the alcohol and volatile flavor compounds.   Freeze-concentrating it (as applejack was once made) would work but is probably excessive in terms of effort and reward.
Comment: I would go with the bourbon or even rum with a molasses note would work well.
Answer: The text of the recipe says you may substitute apple brandy or white rum.  I used white rum and the cake was delicious.
Answer: A common practise in some French islands is to macerate fruits, spices and sugar in rum for some time, and then to filter them, in order to make a flavoured, strong, very tasty drink called "Rhum arrangé".
This process might be too long for you, but you could consider it for making a Calvados substitute to use in a few months (usually 2 or 3 at least for fruit, for spices a few days to a month can be enough). I've had nice results cooking with fruit-infused rums (you can make extraordinary rum babas that way, I also like to use vanilla-infused rum in most recipes asking for rum).
P.S : I must mention this is done in lots of other places, with different kinds of alcohol. I drank similar beverages in Hungary a few years ago, but they were usually not as strong, closer to a 20 or 25% alcohol content (in my own very limited experience). Those were called ágyas (bedded) pálinka (local fruit brandy).
Answer: There is a caramel apple liqueur by Hiram walker that could work.  It has a great apple flavor.
Comment: It is however *way* too sweet for a direct substitution.  You'd probably want to drop at least a teaspoon of granulated sugar from the other ingredients to compensate.
Answer: I was able to find a 50ml bottle at Bevmo for $6.99. That will give you 6 portions.  Very affordable.  I have also seen Calvados at one Trader Joes (in northern CA), but not all stores carry it.  I think it was around $20 for a tall bottle probably 375 ml.  Hope you get this.  Good luck!
Comment: I agree that most of the post was irrelevant to the substitution. But the info that there are 50 ml bottles can be a good solution for somebody in the same situation as the OP, so I'm leaving it here instead of deleting.
Comment: Hello Gail, and welcome to Seasoned Advice! Your apple cake sounds absolutely delicious, but Jolene's question was what to use as a substitute for Calvados. Otherwise, your experience really should be posted as a comment, rather than an answer. — Best Wishes from Massachusetts!
Answer: 1 tbsp rum extract
Found this substitute in a French Apple Cake recipe on Yummly that specifically stated it was used instead of the Calvados.
Answer: How about Cinamon Whiskey for a Cinamon apple taste. I was looking for the same substitute for the same recipe and will use this

Substitute for Calvados, reduced cider?


epithet vs teknonymy... which one is correct?

Question: What is difference between 'epithet' and 'Teknonymy'? Are they same? Which one of the two relates to ancestors? The name with which one is known but that name is of one of his children, what do we call this in English? e.g. Arabic name: Abu Abdullah. Abdullah is the name of the son of the man who is known as Abu Abdullah.
Answer: Epithet is a much more general word than teknonym.
In reference to names, the term epithet is usually used for something like "the Terrible" in "Ivan the Terrible"; in Arabic names, "bin Musa" would usually be called a patronym and not an epithet. The problem is that we don't have a common term in English to describe "abu Abdullah"; epithet is slightly misleading, although technically accurate, and teknonym is a more specific term that hardly anybody will know the meaning of.
To be specific, an epithet is derived from some characteristic, a patronym is derived from your father's name, a matronym is derived from your mother's name, and a teknonym is derived from the name of one of your children.
Answer: "Abu Abdullah" is an example of a teknonym. But teknonyms are not generally used in English. The word teknonym is exceedingly rare and limited to scientific studies of naming practices around the world.
"Epithet" is rather more common, and can apply to an individual (She's Mary-who-makes-the-tea)  "who makes the tea" is her epithet. It can also apply to groups
Answer: An epithet is a title that is added to a name and is so associated with it that it becomes part of the name. An example from Arabic history is Harun al-Rashid.
Teknonymy is the practice (or habit or tradition) of calling people by reference to a child's name.
Teknonym is a name based on teknonymy such as Abu Abdullah (but not all Kunyas; Abu Bakr is not a teknonym). See Teknonym on Wiktionary.


Build NSIS script as a MSI package

Question: Is there any way to compile the Nullsoft Installer Script (NSI) setup as a MSI package instead of an EXE?
Answer: Unfortunately, No.
NSIS lets you create scriptable, procedural installation packages. It's simple, easy to use and has a number of features not present in Windows Installer.
Windows Installer (MSI) creates database driven, transactional installation packages. When written properly a Windows Installer package is very robust, a file gets corrupted/deleted and it will be automatically reinstalled. Windows Installer is aware of UAC and only elevates when required, basically if you're creating software for the corporate market, you will need to provide an MSI.
Check out The Definitive Guide to Windows Installer for a good introduction to understanding MSI.
Comment: @BrainSlugs83 see the UAC in MSI series. There are no limitations if you write it properly :)  http://blogs.msdn.com/b/rflaming/archive/2006/10/01/uac-in-msi-notes-how-to-build-packages-that-work-for-both-standard-user-and-per-machine.aspx
Comment: Further: there are a lot of issues with MSI -- you need to create separate installers for x86 versus x64 for one example (among many -- another example: MSI can either always elevate or never elevate -- it can't do both.) -- I imagine that these limitations do not exist with NSIS.
Comment: Another bonus is making use of wrapping your MSI inside of NSIS. This is great for when IT departments set the Windows Installer Service to disabled (or manual). You can have your NSIS installer check for this, enable the service & then extract and execute your MSI.
None the less it is a good writeup, @saschabeaumont
Answer: NSIS installers can be wrapped in MSI files using the MSI Wrapper. It is a small tool that I made for wrapping NSIS and Inno Setup installers. It uses WiX to compile the MSI but there is a GUI to help you instead of an XML file.
It was made because I needed a tool for creating MSI files based on traditional EXE installers. I needed support for uninstall and upgrades and only wanted the wrapped installers to show up once in the Add/Remove programs in the control panel.
I also wanted to be able to pass command line parameters to the wrapped installer when the MSI  is installed.
If you want to use it or help me improve it, you can find it at http://www.exemsi.com.
I share the opinion that wrapping an executable installer in an MSI package is not the ideal solution. However, when you already have the exe it can make a lot of sense :-)
Comment: Holy crap is a good description of that pattern.  It doens't make sense at all... sorry.
Comment: No, that does make sense - some corporate deployment methods mandate the use of MSIs, hence needing to wrap as an MSI.
Comment: Holy crap!  This should be built-in to NSIS!  Giving it a try now.
Answer: No (And there are no plans to support .MSI output), try WIX
Comment: Nice to put `WiX` in there as an alternative :)

Build NSIS script as a MSI package


"Defining a smooth structure on a topological manifold with boundary"

Question:
This is a proposition for topological manifolds. However, I am wondering if this prop holds when $M$ is a topological manifold "with boundary." Thus, can the expression like "a smooth atlas on a topological manifold with boundary defines(determines) a smooth structure on it" be used based on (a) of this proposition? I have a suspicion that my guess is true. However I am not perfectly sure. Am I correct?
Comment: What do you mean by a smooth atlas on a manifold with boundary?
Comment: Atlas whose elements are homeomorphisms from open sets of M onto open sets of $R^n$ or $H^n$ and are smoothly compatible with each other
Comment: What does it mean for a function from the halfspace to itself to be smooth?
Comment: There is the definition in John Lee's book p.645.. Each point has a neighborhood where there is a smooth function and the smooth function agrees with the original function in the instersection of  the domain of the original function and the neighborhood
Comment: That is still not an answer to my question. I'll be more explicit: consider a function $f : [0, 1] \to [0, 1]$. What does it mean for such a function to be smooth? More specifically, what does it mean for such a function to be smooth at the endpoints?
Answer: The proof of the cited proposition should go something like this. Notice that it's very general. The argument I give here, due to the generality I use for smoothness of a map should apply word for word to manifolds as well as manifolds with boundary, and generalize naturally to other similar situations where a structure is defined by atlases of compatible charts.
We say two smooth atlases $A$ and $B$ are compatible if their union is a smooth atlas.
Note that this relation is trivially symmetric and reflexive, since union is symmetric and idempotent. Also note that if $A\subseteq B$, then $A\cup B = B$, so $A$ and $B$ are compatible. Hence all atlases containing $A$ are compatible with $A$. We'll use $A\sim B$ to mean that $A$ and $B$ are compatible.
To prove (a), we need that if $\{B_i\}$, $i\in I$ is a family of smooth atlases compatible with $A$, then $\bigcup_{i\in I} B_i$ is also a smooth atlas. Then the union of all atlases compatible to a given atlas $A$ is maximal among atlases compatible to $A$ (which includes all atlases containing $A$), and is in fact the unique maximal compatible atlas, since it contains all other compatible atlases. Let $M_A$ denote the smooth structure of $A$.
Then to prove (b), one just needs to check that compatibility is transitive. Then if $A$ and $B$ are compatible, $M_A\sim A\sim B \sim M_B$, so $M_A\sim B$, which implies $M_A\subseteq M_B$ and $M_B\sim A$, which implies $M_B\subseteq M_A$. Hence $M_B=M_A$. Conversely, if $M_A=M_B$, then $A\sim M_A=M_B\sim B$, so $A\sim B$.
I've broken the argument up like this, because the same general argument can be applied in any case where one defines a structure on an object by a family of compatible charts that cover the object to argue that there is a unique maximal chart for that structure.
Now we've reduced the argument to verifying two properties of atlases:

If $A\sim B_i$ for all $i\in I$, then $A\sim \bigcup_{i\in I} B_i$, and
if $A\sim B$ and $B\sim C$, then $A\sim C$.

Now $A$ and $B$ are compatible if and only if $A\cup B$ is a smooth atlas if and only if for all pairs of charts $\phi\in A$, $\psi\in B$, $\phi$ and $\psi$ are compatible charts, i.e. $\phi\circ\psi^{-1}$ and $\psi\circ\phi^{-1}$ are smooth maps. Property 1 follows immediately from the elementwise criterion for compatibility, since $A$ is compatible with $\bigcup_{i\in I} B_i$ if and only if every chart in $A$ is compatible with every chart in every $B_i$ if and only if $A$ is compatible with every $B_i$.
Thus property 1 holds in the case of manifolds or manifolds with boundary, or in more general situations where other kinds of atlases are defined as families of compatible charts. In particular (a) always holds in such situations.
Thus one only needs to verify (b) by verifying property 2. This is the only part of the proof that depends on the definition of compatibility of charts. One needs to show if every chart of $A$ is compatible with every chart of $B$, and if every chart of $B$ is compatible with every chart of $C$, then every chart of $A$ is compatible with every chart of $C$. The proof goes as follows.
First recall that if $X\subseteq\mathbb{R}^n$ is an arbitrary subset, then a map $\phi:X\to \mathbb{R}^m$ is smooth if for each point $x\in X$, there exists an open neighborhood $U$ of $x$ in $\mathbb{R}^n$ and a smooth map (in the usual sense) $\psi : U\to \mathbb{R}^m$ such that $\phi|_{U\cap X}=\psi|_{U\cap X}$. Then clearly restrictions of smooth maps are still smooth. Moreover, compositions of smooth functions are smooth, because if $\phi: X\to Y$, and $\psi : Y\to Z$, then if $x\in X$, there is an nhood $V$ of $\phi(x)$ on which $\psi$ can be extended to a smooth function, $\psi'$, and since $\phi$ is smooth, an nhood $U$ of $x$ such that $\phi(U)\subseteq V$, and on which $\phi$ can be extended to a smooth function, $\phi'$. Restricting $U$ further if necessary, so that $\phi'(U)\subseteq V$, we then have that $\psi'\circ\phi'$ is a smooth extension of $\psi\circ \phi$ to an nhood of $x$. Also since smoothness is a local condition, the gluing of smooth maps is smooth.
Let $(U,\phi)\in A$, $(V,\psi)\in B$, $(W,\tau)\in C$ where $U$, $V$, and $W$ are the open subsets of $M$ that are the domains of $\phi$, $\psi$, and $\tau$ respectively.
Then $\phi\circ \psi^{-1} : \psi(U\cap V) \to \phi(U\cap V)$ is smooth, and $\psi\circ\tau^{-1} : \tau(W\cap V) \to \psi(W\cap V)$ is smooth, so
$\phi\circ\psi^{-1}\circ\psi\circ\tau^{-1}=\phi\circ\tau^{-1}|_{\tau(W\cap V\cap U)} : \tau(W\cap V\cap U) \to \phi(W\cap V\cap U)$ is smooth, since compositions of smooth maps are smooth. Then as $\psi$ varies over all possible charts in $B$, since the corresponding domains $V$ cover $M$, $W\cap V\cap U$ covers $W\cap U$, and $\tau(W\cap V\cap U)$ covers $\tau(W\cap U)$. Since the map $\phi\circ\tau^{-1}$ is locally smooth on each $\tau(W\cap V\cap U)$, it's therefore smooth on all of $W\cap U$. By symmetry, $\tau\circ\phi^{-1}$ is also smooth. Hence $\phi$ and $\tau$ are compatible. Since $\phi$ and $\tau$ were arbitrary, $A\sim C$.


Kabbalah/chasidus explanations of theodicy

Question: Are there any kabbalistic or hasidic explanations given to the question of theodicy? Beyond "rational"/philosophical explanations, are there any mystical reasons given to why bad things happen? If so, what are they, and where could I find them?
Comment: Kabbala and Chassidus generally ascribe to the doctrine of gilgul (reincarnation). Once that is a possibility, can't most of the question be avoided by saying the payment is due to actions in previous lives?
Comment: From a kabbalistic perspective, evil is a shortcut to achieving the *tikkun ha'shalem*.
Comment: "where could I find them" - may I recommend starting with the shiur linked in the footnotes of my below answer. It is actually a JLI course that you may be able to sign up for - check out your local Chabad
Comment: Theodicy means "Defense and explanation of G-d's goodness and omnipotence in view of the existence of evil." This is a duplicate question and  has been asked and answered in regard to kabbalistic and Chassidic teaching here: https://judaism.stackexchange.com/a/130262/7303
Answer: According to Kabbalah the root of all evil is the שבירת הכלים. This the source of the "Husks/Shells" which are called cruel oppressors.
You will see this referenced at the beginning of most Lurianic books (take for example שער הכללים) However you wont find an explicit answer to your question there because these ideas were meant to be contemplated and the real truth is a סוד.
Beyond that you will certainly find many sources that talk about things like Sexual Immorality causing suffering but the ultimate source is what I mentioned above.
Answer: One of the big chiddushim* of Kabbalah in theodicy is that both good and evil serve Hashem. When discussing the Yeitzer Hara, Rabbi Shimon tells the Chaveirim something that "they had never heard before": that it was necessary1.
Kabbalah teaches us that nothing exists that is not some form of Hashem's self-expression, so therefore evil must be a non-existence2, and simply the absense of light.

A mashal is given that a man is walking in a building and hears a
woman screaming in agony. He is convinced she is being assaulted so
runs to her rescue. When he bursts into the room, he realises that he
made a big mistake. The room is actually a birth center, and the woman
is screaming because she is in labour.

From the above example, we can see that the supposed evil was proven to be goodness, and it happened in a split second of clarity, or light.
However, Kabbalah also teaches us about a type of evil that is indeed a creation3, and this is the result of the שבירת הכלים. When this happened, many positive traits and attributes fell into the wrong places. Now it is possible for people to get actual enjoyment in evil activities.
Chassidus teaches us that our job is to rescue these "sparks", in two ways: through avoiding temptation and doing teshuva, as well as observing the world through the lens of Torah in order to learn from it to improve our character and reach higher levels. I'll give some examples4.
In terms of the former, when we avoid a temptation, we weaken that temptation for everyone on the planet. We keep on doing that until there is no temptation left. If we succumb to the temptation, we are able to even more powerfully rescue the spark, by doing teshuva, because we experienced the energy that is locked away in the sin, and are able to more directly apply it to goodness. Here's an example:

A husband and wife love eachother to the maximum capacity of love. One
day they have a bitter argument, and there is a lot of anger.
Eventually they "do teshuva" and make up. They find they actually love
eachother even more than before, and more passionately than before.
This extra love capacity, and quality of love came from the passion of
the anger (the passion of which is neutral), which has now been
"rescued" from said anger, and now belongs to the love.

For the latter, an example given sometimes is Hitler y'sh. Hitler had a lot of energy and insanity for evil. The only bad word in that sentence is "evil", and if the "energy" and "insanity" could be rescued for good, that would be wonderful. If we could have someone arise and lead the world towards "insane" goodness and Hashem, with the same energy as his opposite, then we truly will have rescued some powerful sparks for goodness, before evil is banished forever.
Chassidus teaches an idea of "descent for the sake of ascent"5. It teaches that Hashem's goal in creation is to have a home in even the lowest world; the world of sin and death. By the sin of Adam Harishon, we integrated this שבירת הכלים into our souls, and are thus now able to partner with Hashem in our own "fixing" of the world. Hashem wants us to earn our good and gain true reward6, which brings us back to our Zohar: the Yeitzer Hara is necessary, and our working on that, performing mitzvot and learning Torah is necessary in order that we should fix life itself, for Him, so that we can build Him an eternal home in this lowest world - His deepest desire.
As zunior rightly said, we don't know why great evil takes place in specifics (although we do know it is from Hashem and only Hashem - what other source is there for anything?), and we don't want to know. We don't want to hear anything that justifies it, because we accept it is not justified. The only thing that Hashem asks is that we protest it, we fight it, and we put a stop to it once and for all ourselves, and maintain that Hashem is good and there is ultimately only good. One day we will be raised to the level of awareness of Hashem and our tears will be wiped away, but don't we dare get complacent in eradicating evil from this world with every fibre of our being, and bringing in as much Godly light of goodness that we can.

* this term is used loosely. There are of course older sources that root these ideas, but they were developed and made more prominent by the rise of the Zohar etc.
1 - Zohar Bereshit 16
2 - See e.g. Emunot V'deiot 1:3, Tanya 12 etc.
3 - Based on Yishayahu 45:5-7
4 - See this shiur for an in-depth treatment of this subject by a prominent educator of chassidus.
5 - See מאמר באתי לגני תשל"א for a full discussion of this topic.
6 - See Derech Hashem 1:2, and the above (footnote 1) quoted Zohar passage
Comment: You may find this answer of interest. https://judaism.stackexchange.com/a/130262/7303
Comment: @YaacovDeane already has my upvote, thanks


Difference between RFC-5869 (HKDF) and SP800-108 (Nist's HMAC-based KDF spec)?

Question: I'm trying to find the difference between the two aforementioned algorithms. It seems that one is either a subset of the other. Could someone explain the similarities/differences?
Answer: RFC-5869 is about the "HMAC-based Extract-and-Expand Key Derivation Function (HKDF)", while NIST SP-800-108 gives "Recommendation for Key Derivation
Using Pseudorandom Functions". The main difference between Extract-and-Expand KDFs and KDFs based on PRFs are the requirements on the input keying material.
A PRF requires a uniform random key, which implies that the key must have a high entropy. So, in case of the NIST SP-800-108 versions of HMAC based KDFs it is assumed that you provide a random key at the beginning.
The HKDF scheme from RFC-5869 (and also NIST SP-800-56c) was originally proposed by Hugo Krawczyk in [1] as extract-then-expand KDF. As the name suggests, the function works in two steps. First, a key for key-derivation is extracted from the input keying material and a salt. The next step is essentially what SP-800-108 defines: use an HMAC (i.e. PRF based) KDF to derive further keys. The difference between SP-800-108 and RFC-5869 is the randomness extraction. With an extract-then-expand KDF you can use for example a shared secret to derive cryptographic keys and you must not provide a random key as input.
[1]. Hugo Krawczyk, "Cryptographic Extraction and Key Derivation:
The HKDF Scheme", 2010, https://eprint.iacr.org/2010/264
Answer: I think it worth adding here RFC5869 allows to skip the "extract" phase of the algorithm. if the input key material may already be present as a cryptographically strong key  has a good entropy and length of the hash output at least, the extract phase can be skipped.
Comment: FWIW, I found this helpful. I was trying to implement RFC5869 and while testing we were using Expand-Only. We have a pseudo-random input to start with, but, the only "online calc" (https://asecuritysite.com/encryption/hkdf) we could find uses the RFC examples and Exp+Extr so we couldn't confirm. I wasn't able to find any example output or resources for Expand-Only so while we didn't need it, it was easier to do the math.


checking credit report for disabled adult child

Question: I am the legal guardian of my disabled 26 year old son. I want to check his credit report to make sure noone is using his identity. how can I do this?
Comment: Where in the world are you? The approach may vary depending on which country/countries you are concerned about.
Comment: In addition to pulling reports as dwizum detailed, you can place a freeze on his account at each bureau to help prevent anyone from opening a credit line in the future. That would prevent him as well so you would need to temporarily remove the freeze if he needed a loan or credit card for something.
Answer: In the US, individuals are entitled by law to a copy of their report from each of the major bureaus via annualcreditreport.com. You can get a copy from each bureau once every twelve months. If you use this service and stagger each bureau, that's effectively a check every few months, which should be plenty.
The FTC maintains info about this program on their website.
There are also free services that allow more frequent access, such as creditkarma.com. The formula used for calculating the scores will be different for these sites versus that which is used for lending, but that's not typically an issue if you are more concerned about fraud than lending.
Comment: @MartinBonner if the OP is the legal guardian then she is, to all legal effects, able to "impersonate" her son.
Comment: But the OP doesn't want a copy of their *own* credit report; they want a copy of someone else's credit report.  Normally, that's not supposed to be possible; the OP is in an unusual situation where it is. The question is: how?
Answer: In Germany, send a request for a copy of all personal information they have about your ward to the SCHUFA. They are required by §15 DSGVO to give you one free credit report per year that way. You can find the form here. If you still need a regular report for some reason, they can be ordered here for a fee of 29,99 €.
When you are requesting the credit report not for yourself but for your ward, you are theoretically required to also send them a scan of your certificate of guardianship ("Betreuerausweis") which you received from the "Amtsgericht" when you agreed to take on the guardianship of an adult. This proves that you are the legal representative of your ward. However, I am pretty sure that if you simply fill out the form on the SCHUFA website with the personal information of your ward and scan their personal ID ("Personalausweis"), they are going to send it to him because they likely have no way to know that your adult son is disabled and has a legal guardian.


What strategies exist to accomplish transactions over an OData service layer?

Question: Consider the following example:
An OData service layer exposes Order and OrderLine resources. A consumer retrieves an Order and its related OrderLines. The consumer edits the Order, edits 1 OrderLine, deletes 1 OrderLine and creates 1 OrderLine. How can the consumer save all of these changes ensuring that the changes are all or nothing?
From what I understand of OData, this will be sent as several service calls:

PUT /api/Order/9999
  PUT /api/OrderLine/1001
  DELETE /api/OrderLine/1002
  POST /api/OrderLine/1002

Each call would be stateless and independent and the server would not be able to determine when to begin and end a transaction.

I've considered various solutions but I'm not sure any of them work:
Solution 1) Have the Order resource contain the OrderLine information. With this solution a single service call would be made with "PUT /api/Order/9999" which would contain all of the OrderLine changes. This strategy seems good because it abstracts the consumer from the transaction details on the server. However, I can't find a way to include the OrderLine collection into the Order entity when PUTting with both Breeze and WCF Data Services Client. Also, I'm not sure how deleting an OrderLine would be communicated in the Order. Is there anything in the OData specification to accomplish this? I found that it's possible to POST related entities in section 10.3.2.2 of the spec. I have not found anything similar for creating/updating/deleting related entities when PUTting an entity.
Solution 2) Using OData's $batch operation would send the 4 service calls as one. I'm not sure if the intention of the $batch feature was for performance or for grouping related service calls into a transaction. Using $batch for transactions, it would be the responsibility of the consumer to determine which service calls to send in the same batch. Is that a proper separation of concerns? On the server side, the batch handler might get complicated. If there was any validation that needed to occur between the Order and OrderLine the batch handler would need to recompose these objects and validate them before attempting the database transactions.
Solution 3) Expose Begin and End transaction service calls. Again, this would be exposing implementation details to the consumer. I think the implications are pretty similar to Solution 2.
The solution must work on .NET 4.0 and the service calls must work from both .NET and javascript clients. Scalability is not a concern. I am using "Web API OData" which will never support the $batch feature in .NET 4.0 but changing over to "WCF Data Services" is a possibility. I chose OData for it's retrieve features but if transactions for CUD operations work better without OData I'm open to suggestions. One possibility is to continue using OData for my application's advanced search screens but to use regular REST services for CUD.
Comment: I'm also wondering how to implement transactional batches via WebAPI ODATA, and I'm not in love with the solutions I've come up with, either.  Did you ever come up with a good solution?
Answer: A batch will work for you as the 4 four operations are send together if you are using WCF Data Services. The EF built-in implementation for WCF Data Services will make the changes in the EF operation context together before invoking the SaveChanges, which will be all or nothing if the SaveChanges call fails, emulating the behavior of a transaction.


Does brewing a larger pot of coffee change the taste, even if you keep the ratios the same?

Question: I always use the same ratio of coffee to water when brewing, but it seems that there is a difference in taste between a single cup pour-over, a 12 cup pot, and a 96 oz urn. And the smaller the batch, the better it tastes. What could be the reason for this?
Answer: The extraction time will be longer for the larger pot, changing the taste, not necessarily for the better.
Answer: i'm not sure it's extraction time here as per Jean-Philippe Allard's reply.
Why would extraction time be longer or shorter if the grind size is the same, and we assume the same temperature of water and the same ratios.
That said - what perhasp Jean-Philippe Allard may be getting at is that there extraction time as a variable can change. IT may take three minutes for your pour over and longer or shorter for your urn
and extraction method does affect flavour.
also the actual drinking temp may be different - coffee really changes taste as it cools.
Also another factor is temperature - it may be easier to control water temp in one scenario over the other.  SO your 12 oz may be a pour over but what is the urn? shower over a basket? big press?
A different kind of comparison may be: same grind and different size of pour over - like a v60 01 vs a v60 02 using your grind/ratio - and of course your pour technique.
Hope that helps.
m.c.


How can I map a character to a key combination?

Question: I'm a bit of a fan of the interrobang (‽), but it obviously is not on my keyboard. How can I map that character to a key combination?
Answer: Another, low-level option to try, especially if you can't get xkb to work is to use xmodmap directly.
The first thing to do would be to get a sense of your current keyboard layout. Open a terminal and type:
xmodmap -pke
This will give you a list of numbered positions on your keyboard and what they are mapped to. E.g., you might see an entry like:
keycode 14 = 5 percent 5 percent
This means that a certain key is mapped to 5 when pressed normally, the percent sign % when pressed with a shift. (And the next two values are for when Mode_shift is active; but let's not get into that right now.
If I wanted to change this key I could type in:
xmodmap -e "keycode 14 = 5 U203D 5 UD203D"
Now, instead of getting a percent sign % when I type shift-5, I get ‽.
That's just an example; probably you don't want to remap % to ‽. But maybe there's some other key you don't use a lot. For example, one nice option might be to remap the shift-Menu instead. So I see from xmodmap -pke that I have:
xmodmap -e "keycode 135 = Menu Menu Menu Menu"
I might make it instead:
xmodmap -e "keycode 135 = Menu U203D Menu U203D"
If I want to make that permanent, just throw it inside some init script that runs automatically, like .profile, .bashrc or .xinitrc, or create your own that Lubuntu loads automatically.
However, it's very important to run xmodmap -pke first to see what your initial set up looks like. Your keycode numbers may well be different from mine. And it's also the best way to see what else is available.
Anyway, that's a very low-level option. If you want a high-level option, look at something like autokey  or xdotool  instead.
Comment: It's helpfully. Thanks!
Answer: Another option is to make use of the 'compose' key. Using Ubuntu, choose one in the Keyboard → Layouts → Option configuration (I choose Right Alt). For Kubuntu, go to System Settings → Input Devices → Keyboard → Advanced, check "Configure keyboard options", and then select your chosen key under "Compose key position".
To use the compose key, type Compose + ? + !.
There are lots of useful looking characters you can generate in this way: http://www.hermit.org/Linux/ComposeKeys.html
Comment: Since I'm using Lubuntu, I don't have the same Keyboard configuration software as in GNOME. Any idea how I could do this in Lubuntu?
Comment: I haven't tested this, but I suppose editing `/etc/default/console-setup` so that the line with `XKBOPTIONS=""` becomes `XKBOPTIONS="compose:rwin"` (or whatever key you want to become the "compose key" or "multi key") should work.  Also see the guide that *Source Lab* refers to, as well as the pages it links to at the bottom for more info about XKB options & key names and such.
Comment: For recent versions of *console-setup*, those options are in `/etc/default/keyboard` now.
Answer: Here's something that works okay:

Install xdotool  (brilliant piece of software by the way)
go to System → Preferences →
Keyboard Shortcuts
Add a new shortcut, as the command
choose xdotool key ctrl+shift+u
type "203d "

This is based on Matt's answer, but it will type the keys for you every time you hit the keyboard shortcut (albeit a bit slowly, about 150ms).
To add any other character, go to the gnome character map and search for it; In the status bar you should see the hexadecimal index of the glyph - i.e. "U+203d".
I now have the interrobang mapped to Ctrl+?, see‽ :-)
Comment: Hey, Stefano, thanks for the answer! Since I'm using Lubuntu, I can't find the Keyboard Shortcuts utility. Can you find out what the command for that menu item is?
Comment: Phew i've never used LXDE, so no idea, but this link could help: http://en.gentoo-wiki.com/wiki/Openbox#Create_custom_keyboard_shortcuts
Answer: In GNOME you can enter unicode characters by typing: Ctrl+Shift+u+unicode point, followed Space or Enter.
So, to type an interrobang, you'd enter:
Ctrl+Shift+u+203d+Space.
How cool is that‽ Actually, I think it's a bit clumsy, but it does the job.
Comment: You should add that you need to hit Enter or Space to accept.


Meditating to feel calm

Question: I have often read that you shouldn't meditate to try and have a pleasant experience because meditation is about "letting go" and cultivating equanimity etc and not about trying to feel something else.  But then what is samatha?  It's tranquility ie a calm pleasant experience so therefore if you do that kind of meditation then aren't you trying to have an experience?
Answer: Undertaking the practice of Samatha meditation, should be done for the sake of the practice itself - not for seeking out pleasant experiences. The minute one is thinking about achieving and gaining pleasant experiences, one has fallen into the hindrances. As a result of that, one has moved away from the primary object of meditation and thus are not cultivating concentration any longer.
It comes down to ones intentions for doing the practice.
Its a good idea to regularly clarify and affirm ones intentions for practicing - especially with Samatha meditation, that is very important. Its easy to become attached to the pleasant sensations this type of meditation practice can result in.
One should ask oneself why one takes on this practice. A wholesome intention is essential. Wholesome intentions for engaging in Samatha meditation could be:

Collecting the scattered mind (e.g. to be used later for Vipassana meditation)
Deepening serenity
Purification of the mind stream
Cultivating a high level of concentration (e.g. to be used later for Vipassana meditation)
Answer: Meditation based in "letting go" & equanimity leads to calm (samatha).
Answer:
The Sutta states that when we are morally virtuous, the other spiritual
  states arise naturally, without even the need for cultivating them volitionally (cetanā'karaṇīya), thus:
(1) For the morally virtuous (sīla,vata), there arises freedom from guilt, appaṭisāra.
(2) For the guilt-free, there arises joy, pamudita.
(3) For the joyful, there arises a zestful mind, pīta,mana.
(4) For the zestful minded, there arises a calm body, passaddha,kāya.
(5) For the calm-bodied, there arises happiness, sukha.
(6) For the happy, there arises concentration, samādhi.
(7) For the concentrated, there arises the vision of true reality, yathā,bhūta,ñāṇa.
(8) For one who sees true reality, there arises revulsion, nibbidā.
(9) For the revulsed, there is letting go [dispassiom], virāga,
(10) For the dispassionare, there is
(10) the knowledge, and
  vision of freedom. vimutti,ñāṇa.dassana.
This passage, in other words, elaborates on the 3 trainings (ti,sikkhā) into their various progressive
  stages, centred around meditation, that is, based on moral virtue (sīla) (1-2), we have good mental concentration
  (samādhi) (3-7), which in turn bring us liberating wisdom (paññā) (8-9)

Introduction to (Ekādasaka) Cetanā'karaṇīya Sutta by Piya Tan and similarly in (Dasaka) Cetanā'karaṇīya Sutta
As you progress in the path you get pleasant feelings. Also this process is without intention. This includes that you should not try to get any of it or progress. You should not try but let it unfold.

The term cetanā'karaṇīya (= cetanā akaraṇiya) refers to our meditative
  progress beginning with the cultivation of moral virtue, stressing its importance. If we are well
  grounded in moral virtue, then our meditation will naturally progress. This is because moral virtue is
  about the cultivation of the body and speech.
  It is not about wishing, belief, prayer, vows, rituals, or even
  religion: it is that moral virtue is the basis for mental cultivation and inner peace.
The Sutta commentary says that the phrase cetanā,karaṇīya means "to be done without having
  thought, considered, mentated" (na cetetvā kappetvā pakappetvā kātabbaṁ, AA 5:1). Proper meditation,
  in other words, is a thought-free process, in the sense that distractions have to do with thoughts, and our
  efforts should be to let go of all thoughts in due course. At least, all our thoughts, in a positive sense,
  should be directed to our meditation object.
In other words, we need to suspend all deliberating, which is, after all, thinking. Letting go of all
  thinking, our mind begins to settle ever more fully and deeply so that it can directly feel or experience true
  reality. Initially, we simply give our full attention to a suitable mental object, such the breath. As we
  watch the breath, it becomes calmer and still, so does our mind.
This means that if we are morally virtuous, our efforts in meditation would work out naturally by way
  of conditionality (one wholesome state leading to another), without any need for thinking. Indeed, in meditation,
  any kind of thinking would prevent us from attaining samadhi, although its proper use (ie, by directing
  the mind) is necessary in the cultivation of wisdom (paññā) and spiritual powers (abhiññā).

Introduction to (Dasaka) Cetanā'karaṇīya Sutta by Piay Tan
Answer: The pleasant experience is there to let you know that what you are doing is efficient. In contrast to an unpleasant experience, like mental suffering, which indicates that what you are doing is inefficient. In what respect is it efficient or inefficient? With respect to creating or sustaining life that builds on , and works with, reality, rather than destroying constructs and working against it. Much like a fractal algorithm (youtube video). With the right formula, the pattern becomes more and more detailed and never runs into a dead end. When you don't apply the same working formula over and over, it runs into a dead end and it no longer becomes more and more detailed. The same with life, apply the correct formula and it keeps growing. That is what your senses reflect. That what you define as pleasant while meditating is a sense that indicates that your mental activity is adding to life, instead of the opposite.
That said, just as the other answers already mentioned. If you are seeking out the pleasant experience, you 'forget' the function of experience. Then it is just like taking drugs to feel happy. What would it add to life if you would only feel pleasant and it wouldn't reflect that what you are doing is good or bad with respect to life? That experience wouldn't have more purpose than only make you feel pleasant. With respect to the greater good, it is useless. Real happiness comes from adding to the greater good. I've created a 5 min video that explains what spiritual enlightenment is. It might help to understand the purpose of experience.
You certainly should pay attention and enjoy pleasant experiences, and investigate at the same time, if you don't already know, what it is that you are doing, so you can cultivate that doing.
So in that respect it is perfectly valid to seek out this pleasant experience. As long it is not your end goal. Your end goal should include adding to the greater good and not being isolated to your mind only, in my opinion.
This is all based on my own experience, though I might stated somethings as fact, of course this is all just my perspective.

Meditating to feel calm


Homology of mapping cylinder

Question: Hatcher's ALgebraic Topology contains the following corollary.
A map $f: X \to Y$ between simply-connected $CW$ complexes is a homotopy equivalence if $f_* : H_n(X) \to H_n(Y)$ is an isomorphism for each $n$>
Proof: After replacing $Y$ with the mapping cylinder $M_f$ we take $f$ to be a inclusion $f: X \hookrightarrow Y$. Since $X$ and $Y$ are simply-connected we have that $\pi_1(X,Y)=0$. This relative Hurewicz theorem then says that the first non-trivial homotopy group is isomorphic to the first non-trivial homology group.
He then goes on to claim that $H_n(Y,X)$ is trivial for all $n$. Why is this true??
Answer: The map $H_n(X) \to H_n(Y)$ in the relative long exact sequence is an isomorphism. So by exactness $H_n(Y,X)$ must vanish.

Homology of mapping cylinder


What are the top reason to reconsider Joomla?

Question: Joomla has changed significantly in recent years. What are those recent changes which can help in making one reconsider Joomla for his projects?
Answer:
Joomla is Responsive

One click installation via App Store : Joomla call it 'Install from Web'

Joomla is more secure

2 Factor authentication

Better encryption using Bcrypt : Why Bcrypt is the best choice available

Multilingual right from the start of installation

Quick and Easy language overriding
Video to learn how to do overriding
Content Versioning

Adoption of jQuery: "Write Less, Do More"

Joomla Framework : Joomla has its own framework allowing the advanced users to create there own system independent of the protocols of the CMS. Using the framework enables you to define the structure and the logic of the applications.
Comment: You are answering your own 'question'? It's not even clear from either pseudo-question or your answers whether you consider the listed attributes pros or cons. Please consider revising both. In future, please also consider not writing 'questions' merely for the purpose of providing your own 'answer'. This isn't LinkedIn, it's supposed to be useful.
Comment: Its a wiki. I shared my answer, I can expect better answer from others too. This is recommended to build knowledge-base.
Answer: It really depends on what framework you are planning on using with your Joomla site, as they differ so much.
I have used so many and have finally decided on the T3 responsive framework by Joomlart. It's great and free, lots of help from the community and well worth a look.
Their free (and commercial) templates are very cross compatible and T3 is very customisable.
2.8% of the World's Websites Use Joomla and aswell Joomla Has More Than 6000 Extensions.
Joomla's latest 3.0 release delivers out-of-the-box support for mobile users. While most open-source CMSs support MySQL, Joomla recently added support for PostgreSQL, as well as commercial offerings such as Microsoft SQL Server, Azure cloud services and Oracle. It also supports 68 different languages and offers a choice of 10,000 different extensions -- less than either Drupal or WordPress, but impressive nonetheless.
Joomla 3 introduced a full front end for end users, a new back end for website developers and administrators, and mobile support via an integrated Bootstrap framework.
Joomla is now available both as the Joomla CMS and as a general Web development platform called the Joomla Platform. The latter is a PHP framework that lets developers create standalone applications that can run on desktops, tablets, smartphones or in the cloud. While the Joomla Platform and Joomla CMS are separate projects, the Joomla CMS is an application that runs on top of the Joomla Platform.


Casting Buttons, TextViews, editText,etc

Question: For example,
Button b = (Button) findViewById (R.id...)
TextView t = (TextView) findViewById (R.id..)

Why do we do this? When do we have to do this?
Answer: We need to do explicit casting whenever we cast object of some class to its subclass.
findViewById returns object of View class, and to get an object of Button, EditText, etc, from this object we need to do explicit cast.
We need to do explicit casting when we need to access methods and fields defined into subclasses, like setText().
We dont need to explicit cast View, when we need to access only View class's methods, like:
setOnClickListener().
Answer: It is used when you want to use component defined in the xml.
When you define textview or any component in xml one Integer hash code is defined for it in r.java.
So when you want to use it as a text view you have to cast it in textview.
Hope it help!!


What's the meaning of "wavefunction must be finite"?

Question: In quantum mechanics it's important that the wavefunction has to be finite everywhere, including infinity. It's a criteria for acceptable wavefunction. What exactly does this statement mean? And how it's associated with square integrability?
Comment: A function _can indeed_ approach $\infty$ and still be square integrable, but the s orbital isn't an example of that!
Comment: And the square integrability is related to the fact the probability of electron being somewhere is certainty. Integral of the $|\phi|^2$  over all the space is equal to 1.
Comment: The probability has to be 1 over all space i.e. $\int \psi^*\psi dv=1$  which means that the 'particle' has to exist somewhere, but if the wavefunction was infinite at any point this integral would  not be possible and so the wavefunction would not make physical sense.
Answer: A broader point regarding functions that are finite:
A function is finite if it never asigns infinity to any element in its domain. Note that this is different than bounded as $f(x):\mathbb R \to \mathbb R \cup\{\infty\}: f(x)=x^2$ is not bounded since $\lim_{x \to \infty}=\infty$. However, $f$ is finite since it does not assign $\infty$ to any real number.
This is a generalisation of the comments written above, not specifically quantum related, but a more general point on mathematical functions.
Answer: Your question is "Why does wave function must be finite"? Actually, that is not exactly true. Wave function can be infinite, as long as its follows this
$$\int_{-\infty} ^\infty \psi^*(x)\psi(x) dx=1$$
What's the example? Dirac delta function is one of them.
For most cases, it is true that wave function of a bounded system must be finite for the simple reason that a wave function has to be normalizable  ($\int_{-\infty} ^\infty \psi^*(x)\psi(x) dx=1$).
If it was infinite in some places (for example $\psi(x)=\frac{N}{x}$), we can try to integrate them over all space, and will get infinity
$$\int_{-\infty} ^\infty \frac{N^2}{x^2} dx=\infty$$
And, that is not just make no sense, it is also not physical.
Comment: (1) A distribution with $|\psi^2|=\delta(x)$ gives you an exact coordinate and a completely unknown momentum, so no violation of Heisenberg here. (2) A $\psi$ function with local singularity does not have to be like delta function. (3) There is no requirement for $\psi$ to be differentiable everywhere; indeed, $s$ orbital at $0$ is not.
Comment: Indeed @Tensor . Commonly seen as a boundary condition when solving scattering problems. I didn't say the wavefunction had to disappear at very large r. I just said that it is a common boundary condition, being the appropriate one for when solving for bound states of the molecule. Other problems have different boundary conditions.
Comment: Aside the requirement for the normalization, is not a wavefunction having a local singularity potentially violating the Heisenberg uncertainty principle?
Comment: I am not sure, but that do make sense. But the Fourier transform of Dirac delta function is just complex exponential. So, basically, the "uncertainty" in the momentum wave function is infinite, making the $\Delta x \Delta p$ become an indeterminate form.
Comment: And, eventually, are not there other mathematical requirements for wavefunction properties, like being differentiable in its domain? I guess that in context of being solution of differential equation, it looks like a mandatory requirement. Note that I am not skilled enough in math to decide myself.
Comment: I mean, come on. Take any square-integrable function with infinite singularity at some point. Plug it into $\hat H\psi=E\psi$. Now _choose your $V(x)$ so as to make this true_. It is as simple as that.
Comment: Nitpick: V(x) and boundary conditions
Comment: @IanBush Provided that we decide to have some, yes.
Comment: No boundary conditions, no particular solution - a general solution maybe, but you can't just neglect the boundary conditions if you want a specific square integrable function as a solution.
Comment: But I can have a specific particular solution square integrable on $\mathbb R^n$ with no boundaries.
Comment: You still have a boundary condition as how that function behaves as it approaches infinity, typically that it tends to zero - this is the usual boundary condition when solving the molecular Schrodinger equation. I also do solid state stuff where periodic boundary conditions may be more appropriate - and they will give you very different solutions.
Comment: Free particle with wave function of $e^{ix}$ is a valid solution for $V(x)=0$, and this function does not vanished at infinity.


Delete Office365 users from Provider-Hosted App

Question: Could we remotely Delete Office365 users from Provider-Hosted App programatically with C# ?  Any suggestions please.
Answer: This is actually a question about AD. Although I do not know the exact API, what you are looking for is how to do user maintenance in WAAD. MSoft just released a bunch of new O365 Apis and I am sure WAAD apis were included.
Once you find and test that Api, you should be able to call it from a SP Provider-Hosted app (assuming a credential with appropriate rights.
Comment: This does not really answer the question. You need to provide more detailed answers