How one might analyze on the practice of excessive pursuit of perfectionism in morality?

Question: Human has self-reflecting abilities. I know excessive pursuit for morality can turn out to be a bad thing. How might we analyze this excessive pursuit of perfectionism?
Comment: What you should do and how you should balance your morality and self-interest is up to your personal judgment. Sorry, this site is not for personal life advice, and it is best received, if at all, not from strangers on the Internet. Ethics can provide schemes for rationalizing your judgments, but there are many of them going every which way, so they will not help you choose, only validate choices you already made. If you describe them we may be able to help you find a suitable scheme, but that would not be a "how should I" question.
Comment: If you want to try a forum that welcomes serious discussion try http://fallibleideas.com/discussion-info
Answer: The most famous speech given by Jesus is the "sermon on the mount", which is recorded in the Gospel of Matthew chapters 5-7.  In order to provide the best authoritative insight into what perfect behavior is, Jesus analyzes boundary conditions for well-known commandments, such as "do not murder."  He demonstrates that the intent to commit murder, or even a person harboring ill will toward somebody else, is contrary to the commandment.
Jesus finishes Matthew 5 by commanding, "Be perfect, as you Father in Heaven is perfect."  This is an impossible standard.  Because Christians have an impossible standard, they must depend on something other than their own perfection in order to be accepted.
The Apostle Paul analyzes this tension in his letter "to the Romans", chapter 7:

"But if I do the very thing I do not want to do, I agree with the Law, confessing that the Law is good."  (Romans 7:16)
Comment: Not an impossible standard but a subtle issue. Many would say we are perfect already and need only realise it.
Comment: Jesus is perfect, not us.  The good news is that instead of lording the difference over us, Jesus wants his perfection to help us somehow.
Answer: You may find it useful to consider the "excessive pursuit of perfectionism" to be a form of repetition compulsion.  This originates from the most basic life drive: tenacious problem solving with the aim of mastery of one's environment.  (All forms of life have to manage their environments to survive.)  This Life Drive (Derrida, To Speculate - On Freud) or Will to Power (Nietzsche) is very basic and unconscious, hence it can run away from conscious control.  In a positive light it makes for hard-working tenacity and, for example, enjoyment of crossword puzzles.  In a negative light it can get out-of-control manifesting in obsessive compulsion.  The main thing to note is that the behaviour is driven by a powerful, unconscious, instinctive drive, and this is what conscious rationalization has to curb and bring under control to a reasonable level.  An unconscious drive is ordinarily invisible, but by being aware of its presence and origin it can be consciously brought under control.
Comment: See also [*wabi-sabi*](https://en.m.wikipedia.org/wiki/Wabi-sabi).
Answer: It would be impossible to be perfect by deciding to keep to some set of rules. As you say, you wouldn't know which rules to keep and which to break. Perfection could only come with a knowledge of what perfection means.
The reason why actions such as eating meat or killing insects matter is that they matter to the person who is acting. Whether an action is perfect or imperfect would not depend on the action but on the motives and level of knowledge of the actor.
After all, it would be impractical and unreasonable to ask people to be perfect and not inform them what this means. The practical approach would be not to attempt to be perfect by guessing what this requires, which would be hopeless, but to acquire the knowledge that brings perfection with it.
The relevant statement might be 'I and my Father are One'. It would be knowledge of this kind that allows perfection to be understood and achieved.
Meanwhile we must do the best we can given what we know and what we don't. and if we are doing this we cannot go far wrong. My view would be that the admonition to be perfect is best read as advice to be a diligent student and acquire the knowledge required to achieve this. Otherwise we'd have no clue what perfection means.
All 'in my opinion' of course.


How do I determine k when using k-means clustering?

Question: I've been studying about k-means clustering, and one thing that's not clear is how you choose the value of k.  Is it just a matter of trial and error, or is there more to it?
Comment: Ah ah...  That's really _the_ question (about k-mean).
Comment: I've answered a similar Q with half a dozen methods (using `R`) over here: stackoverflow.com/a/15376462/1036500
Comment: a link to Wikipedia article on the subject: http://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set
Comment: can you share the code for the function L (log likelihood)?

Given a center at X,Y and points at (x(i=1,2,3,4,...,n),y(i=1,2,3,4,..,n)), how do I get L?
Answer: You can maximize the Bayesian Information Criterion (BIC):
BIC(C | X) = L(X | C) - (p / 2) * log n

where L(X | C) is the log-likelihood of the dataset X according to model C, p is the number of parameters in the model C, and n is the number of points in the dataset.
See "X-means: extending K-means with efficient estimation of the number of clusters" by Dan Pelleg and Andrew Moore in ICML 2000.
Another approach is to start with a large value for k and keep removing centroids (reducing k) until it no longer reduces the description length.  See "MDL principle for robust vector quantisation" by Horst Bischof, Ales Leonardis, and Alexander Selb in Pattern Analysis and Applications vol. 2, p. 59-72, 1999.
Finally, you can start with one cluster, then keep splitting clusters until the points assigned to each cluster have a Gaussian distribution.  In "Learning the k in k-means" (NIPS 2003), Greg Hamerly and Charles Elkan show some evidence that this works better than BIC, and that BIC does not penalize the model's complexity strongly enough.
Comment: @Budric, these should probably be separate questions, and maybe on stats.stackexchange.com.
Comment: Great answer!  For X-Means, do you know if overall BIC score n := k*2 (k clusters, each cluster modeled by Gaussian with mean/variance parameters).  Also if you determine the "parent" BIC > "2 children" BIC would you ever split that cluster again in the next iteration?
Answer: Basically, you want to find a balance between two variables: the number of clusters (k) and the average variance of the clusters. You want to minimize the former while also minimizing the latter. Of course, as the number of clusters increases, the average variance decreases (up to the trivial case of k=n and variance=0).
As always in data analysis, there is no one true approach that works better than all others in all cases. In the end, you have to use your own best judgement. For that, it helps to plot the number of clusters against the average variance (which assumes that you have already run the algorithm for several values of k). Then you can use the number of clusters at the knee of the curve.
Answer: Yes, you can find the best number of clusters using Elbow method, but I found it troublesome to find the value of clusters from elbow graph using script. You can observe the elbow graph and find the elbow point yourself, but it was lot of work finding it from script.
So another option is to use Silhouette Method to find it. The result from Silhouette completely comply with result from Elbow method in R.
Here`s what I did.
#Dataset for Clustering
n = 150
g = 6
set.seed(g)
d <- data.frame(x = unlist(lapply(1:g, function(i) rnorm(n/g, runif(1)*i^2))),
                y = unlist(lapply(1:g, function(i) rnorm(n/g, runif(1)*i^2))))
mydata<-d
#Plot 3X2 plots
attach(mtcars)
par(mfrow=c(3,2))

#Plot the original dataset
plot(mydata$x,mydata$y,main="Original Dataset")

#Scree plot to deterine the number of clusters
wss <- (nrow(mydata)-1)*sum(apply(mydata,2,var))
  for (i in 2:15) {
    wss[i] <- sum(kmeans(mydata,centers=i)$withinss)
}
plot(1:15, wss, type="b", xlab="Number of Clusters",ylab="Within groups sum of squares")

# Ward Hierarchical Clustering
d <- dist(mydata, method = "euclidean") # distance matrix
fit <- hclust(d, method="ward")
plot(fit) # display dendogram
groups <- cutree(fit, k=5) # cut tree into 5 clusters
# draw dendogram with red borders around the 5 clusters
rect.hclust(fit, k=5, border="red")

#Silhouette analysis for determining the number of clusters
library(fpc)
asw <- numeric(20)
for (k in 2:20)
  asw[[k]] <- pam(mydata, k) $ silinfo $ avg.width
k.best <- which.max(asw)

cat("silhouette-optimal number of clusters:", k.best, "\n")
plot(pam(d, k.best))

# K-Means Cluster Analysis
fit <- kmeans(mydata,k.best)
mydata
# get cluster means
aggregate(mydata,by=list(fit$cluster),FUN=mean)
# append cluster assignment
mydata <- data.frame(mydata, clusterid=fit$cluster)
plot(mydata$x,mydata$y, col = fit$cluster, main="K-means Clustering results")

Hope it helps!!
Comment: Just adding a link to the Silhouette Analysis tutorial for python users
http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html#sphx-glr-auto-examples-cluster-plot-kmeans-silhouette-analysis-py
Comment: Also, for plotting see yellow brick https://www.scikit-yb.org/en/latest/api/cluster/silhouette.html they also have the elbow method
Answer: May be someone beginner like me looking for code example. information for silhouette_score
is available here.
from sklearn.cluster import KMeans
from sklearn.metrics import silhouette_score

range_n_clusters = [2, 3, 4]            # clusters range you want to select
dataToFit = [[12,23],[112,46],[45,23]]  # sample data
best_clusters = 0                       # best cluster number which you will get
previous_silh_avg = 0.0

for n_clusters in range_n_clusters:
    clusterer = KMeans(n_clusters=n_clusters)
    cluster_labels = clusterer.fit_predict(dataToFit)
    silhouette_avg = silhouette_score(dataToFit, cluster_labels)
    if silhouette_avg > previous_silh_avg:
        previous_silh_avg = silhouette_avg
        best_clusters = n_clusters

# Final Kmeans for best_clusters
kmeans = KMeans(n_clusters=best_clusters, random_state=0).fit(dataToFit)

Comment: Sample doesn't work on scikit-learn version: 0.24.2. Error on silhouette_score (dataToFit, cluster_labels).
"Exception has occurred: ValueError
Number of labels is 3. Valid values are 2 to n_samples - 1 (inclusive)"
Comment: You should probably look at this:
https://stackoverflow.com/questions/51382250/valueerror-number-of-labels-is-1-valid-values-are-2-to-n-samples-1-inclusiv
Answer: Look at this paper, "Learning the k in k-means" by Greg Hamerly, Charles Elkan. It uses a Gaussian test to determine the right number of clusters. Also, the authors claim that this method is better than BIC which is mentioned in the accepted answer.
Answer: There is something called Rule of Thumb. It says that the number of clusters can be calculated by
k = (n/2)^0.5
where n is the total number of elements from your sample.
You can check the veracity of this information on the following paper:
http://www.ijarcsms.com/docs/paper/volume1/issue6/V1I6-0015.pdf
There is also another method called G-means, where your distribution follows a Gaussian Distribution or Normal Distribution.
It consists of increasing k until all your k groups follow a Gaussian Distribution.
It requires a lot of statistics but can be done.
Here is the source:
http://papers.nips.cc/paper/2526-learning-the-k-in-k-means.pdf
I hope this helps!
Answer: If you don't know the numbers of the clusters k to provide as parameter to k-means so there are four ways to find it automaticaly:

G-means algortithm:  it discovers the number of clusters automatically using a statistical test to decide whether to split a k-means center into two. This algorithm takes a hierarchical approach to detect the number of clusters, based on a statistical test for the hypothesis that a subset of data follows a Gaussian distribution (continuous function which approximates the exact binomial distribution of events), and if not it splits the cluster. It starts with a small number of centers, say one cluster only (k=1), then the algorithm splits it into two centers (k=2) and splits each of these two centers again (k=4), having four centers in total. If G-means does not accept these four centers then the answer is the previous step: two centers in this case (k=2). This is the number of clusters your dataset will be divided into. G-means is very useful when you do not have an estimation of the number of clusters you will get after grouping your instances. Notice that an inconvenient choice for the "k" parameter might give you wrong results. The parallel version of g-means is called p-means. G-means sources:
source 1
source 2
source 3
x-means: a new algorithm that efficiently, searches the space of cluster locations and number of clusters to optimize the Bayesian Information Criterion (BIC) or the Akaike Information Criterion (AIC) measure. This version of k-means finds the number k and also accelerates k-means.
Online k-means or Streaming k-means: it permits to execute k-means by scanning the whole data once and it finds automaticaly the optimal number of k.  Spark implements it.
MeanShift algorithm: it is a nonparametric clustering technique which does not require prior knowledge of the number of clusters, and does not constrain the shape of the clusters. Mean shift clustering aims to discover "blobs" in a smooth density of samples. It is a centroid-based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to eliminate near-duplicates to form the final set of centroids. Sources: source1, source2, source3
Answer: First build a minimum spanning tree of your data.
Removing the K-1 most expensive edges splits the tree into K clusters,
so you can build the MST once, look at cluster spacings / metrics for various K,
and take the knee of the curve.
This works only for Single-linkage_clustering,
but for that it's fast and easy. Plus, MSTs make good visuals.
See for example the MST plot under
stats.stackexchange visualization software for clustering.
Answer: I'm surprised nobody has mentioned this excellent article:
http://www.ee.columbia.edu/~dpwe/papers/PhamDN05-kmeans.pdf
After following several other suggestions I finally came across this article while reading this blog:
https://datasciencelab.wordpress.com/2014/01/21/selection-of-k-in-k-means-clustering-reloaded/
After that I implemented it in Scala, an implementation which for my use cases provide really good results. Here's code:
import breeze.linalg.DenseVector
import Kmeans.{Features, _}
import nak.cluster.{Kmeans => NakKmeans}

import scala.collection.immutable.IndexedSeq
import scala.collection.mutable.ListBuffer

/*
https://datasciencelab.wordpress.com/2014/01/21/selection-of-k-in-k-means-clustering-reloaded/
 */
class Kmeans(features: Features) {
  def fkAlphaDispersionCentroids(k: Int, dispersionOfKMinus1: Double = 0d, alphaOfKMinus1: Double = 1d): (Double, Double, Double, Features) = {
    if (1 == k || 0d == dispersionOfKMinus1) (1d, 1d, 1d, Vector.empty)
    else {
      val featureDimensions = features.headOption.map(_.size).getOrElse(1)
      val (dispersion, centroids: Features) = new NakKmeans[DenseVector[Double]](features).run(k)
      val alpha =
        if (2 == k) 1d - 3d / (4d * featureDimensions)
        else alphaOfKMinus1 + (1d - alphaOfKMinus1) / 6d
      val fk = dispersion / (alpha * dispersionOfKMinus1)
      (fk, alpha, dispersion, centroids)
    }
  }

  def fks(maxK: Int = maxK): List[(Double, Double, Double, Features)] = {
    val fadcs = ListBuffer[(Double, Double, Double, Features)](fkAlphaDispersionCentroids(1))
    var k = 2
    while (k <= maxK) {
      val (fk, alpha, dispersion, features) = fadcs(k - 2)
      fadcs += fkAlphaDispersionCentroids(k, dispersion, alpha)
      k += 1
    }
    fadcs.toList
  }

  def detK: (Double, Features) = {
    val vals = fks().minBy(_._1)
    (vals._3, vals._4)
  }
}

object Kmeans {
  val maxK = 10
  type Features = IndexedSeq[DenseVector[Double]]
}

Comment: Implmented in scala 2.11.7 with breeze 0.12 and nak 1.3
Comment: Hi @eirirlar I am trying to implement the same code with Python - but I couldn't follow the code in the website. See my post: http://stackoverflow.com/questions/36729826/python-k-means-clustering
Comment: @ImranRashid Sorry I only tested with 2 dimensions, and I'm not a Python expert.
Answer: If you use MATLAB, any version since 2013b that is, you can make use of the function evalclusters to find out what should the optimal k be for a given dataset.
This function lets you choose from among 3 clustering algorithms - kmeans, linkage and gmdistribution.
It also lets you choose from among 4 clustering evaluation criteria - CalinskiHarabasz, DaviesBouldin, gap and silhouette.
Answer:
I used the solution I found here : http://efavdb.com/mean-shift/ and it worked very well for me :
import numpy as np
from sklearn.cluster import MeanShift, estimate_bandwidth
from sklearn.datasets.samples_generator import make_blobs
import matplotlib.pyplot as plt
from itertools import cycle
from PIL import Image

#%% Generate sample data
centers = [[1, 1], [-.75, -1], [1, -1], [-3, 2]]
X, _ = make_blobs(n_samples=10000, centers=centers, cluster_std=0.6)

#%% Compute clustering with MeanShift

# The bandwidth can be automatically estimated
bandwidth = estimate_bandwidth(X, quantile=.1,
                               n_samples=500)
ms = MeanShift(bandwidth=bandwidth, bin_seeding=True)
ms.fit(X)
labels = ms.labels_
cluster_centers = ms.cluster_centers_

n_clusters_ = labels.max()+1

#%% Plot result
plt.figure(1)
plt.clf()

colors = cycle('bgrcmykbgrcmykbgrcmykbgrcmyk')
for k, col in zip(range(n_clusters_), colors):
    my_members = labels == k
    cluster_center = cluster_centers[k]
    plt.plot(X[my_members, 0], X[my_members, 1], col + '.')
    plt.plot(cluster_center[0], cluster_center[1],
             'o', markerfacecolor=col,
             markeredgecolor='k', markersize=14)
plt.title('Estimated number of clusters: %d' % n_clusters_)
plt.show()

Answer: My idea is to use Silhouette Coefficient to find the optimal cluster number(K). Details explanation is here.
Answer: Assuming you have a matrix of data called DATA, you can perform partitioning around medoids with estimation of number of clusters (by silhouette analysis) like this:
library(fpc)
maxk <- 20  # arbitrary here, you can set this to whatever you like
estimatedK <- pamk(dist(DATA), krange=1:maxk)$nc

Answer: One possible answer is to use Meta Heuristic Algorithm like Genetic Algorithm to find k.
That's simple. you can use random K(in some range) and evaluate the fit function of Genetic Algorithm with some measurment like Silhouette
And Find best K base on fit function.
https://en.wikipedia.org/wiki/Silhouette_(clustering)
Answer: km=[]
for i in range(num_data.shape[1]):
    kmeans = KMeans(n_clusters=ncluster[i])#we take number of cluster bandwidth theory
    ndata=num_data[[i]].dropna()
    ndata['labels']=kmeans.fit_predict(ndata.values)
    cluster=ndata
    co=cluster.groupby(['labels'])[cluster.columns[0]].count()#count for frequency
    me=cluster.groupby(['labels'])[cluster.columns[0]].median()#median
    ma=cluster.groupby(['labels'])[cluster.columns[0]].max()#Maximum
    mi=cluster.groupby(['labels'])[cluster.columns[0]].min()#Minimum
    stat=pd.concat([mi,ma,me,co],axis=1)#Add all column
    stat['variable']=stat.columns[1]#Column name change
    stat.columns=['Minimum','Maximum','Median','count','variable']
    l=[]
    for j in range(ncluster[i]):
        n=[mi.loc[j],ma.loc[j]]
        l.append(n)

    stat['Class']=l
    stat=stat.sort(['Minimum'])
    stat=stat[['variable','Class','Minimum','Maximum','Median','count']]
    if missing_num.iloc[i]>0:
        stat.loc[ncluster[i]]=0
        if stat.iloc[ncluster[i],5]==0:
            stat.iloc[ncluster[i],5]=missing_num.iloc[i]
            stat.iloc[ncluster[i],0]=stat.iloc[0,0]
    stat['Percentage']=(stat[[5]])*100/count_row#Freq PERCENTAGE
    stat['Cumulative Percentage']=stat['Percentage'].cumsum()
    km.append(stat)
cluster=pd.concat(km,axis=0)## see documentation for more info
cluster=cluster.round({'Minimum': 2, 'Maximum': 2,'Median':2,'Percentage':2,'Cumulative Percentage':2})

Comment: you select data and library add  and you copy km=[] to Percentage':2}) last and run your python and see
Comment: Welcome to Stack Overflow! Although this code may help to solve the problem, it doesn't explain _why_ and/or _how_ it answers the question. Providing this additional context  would significantly improve its long-term educational value. Please [edit] your answer to add explanation, including what limitations and assumptions apply.
Answer: Another approach is using Self Organizing Maps (SOP) to find optimal number of clusters. The SOM (Self-Organizing Map) is an unsupervised neural
network methodology, which needs only the input is used to
clustering for problem solving. This approach used in a paper about customer segmentation.
The reference of the paper is
Abdellah Amine et al., Customer Segmentation Model in E-commerce Using
Clustering Techniques and LRFM Model: The Case
of Online Stores in Morocco, World Academy of Science, Engineering and Technology
International Journal of Computer and Information Engineering
Vol:9, No:8, 2015, 1999 - 2010
Answer: Hi I'll make it simple and straight to explain, I like to determine clusters using 'NbClust' library.
Now, how to use the 'NbClust' function to determine the right number of clusters: You can check the actual project in Github with actual data and clusters - Extention to this 'kmeans' algorithm also performed using the right number of 'centers'.
Github Project Link: https://github.com/RutvijBhutaiya/Thailand-Customer-Engagement-Facebook
Comment: Instead of adding the github link, can you add a couple of key lines of code that can help others even if your code is not reachable?
Answer: You can choose the number of clusters by visually inspecting your data points, but you will soon realize that there is a lot of ambiguity in this process for all except the simplest data sets. This is not always bad, because you are doing unsupervised learning and there's some inherent subjectivity in the labeling process. Here, having previous experience with that particular problem or something similar will help you choose the right value.
If you want some hint about the number of clusters that you should use, you can apply the Elbow method:
First of all, compute the sum of squared error (SSE) for some values of k (for example 2, 4, 6, 8, etc.). The SSE is defined as the sum of the squared distance between each member of the cluster and its centroid. Mathematically:
SSE=∑Ki=1∑x∈cidist(x,ci)2
If you plot k against the SSE, you will see that the error decreases as k gets larger; this is because when the number of clusters increases, they should be smaller, so distortion is also smaller. The idea of the elbow method is to choose the k at which the SSE decreases abruptly. This produces an "elbow effect" in the graph, as you can see in the following picture:

In this case, k=6 is the value that the Elbow method has selected. Take into account that the Elbow method is an heuristic and, as such, it may or may not work well in your particular case. Sometimes, there are more than one elbow, or no elbow at all. In those situations you usually end up calculating the best k by evaluating how well k-means performs in the context of the particular clustering problem you are trying to solve.
Answer: I worked on a Python package kneed (Kneedle algorithm). It finds cluster numbers dynamically as the point where the curve starts to flatten. Given a set of x and y values, kneed will return the knee point of the function. The knee joint is the point of maximum curvature. Here is the sample code.
y = [7342.1301373073857, 6881.7109460930769, 6531.1657905495022,
6356.2255554679778, 6209.8382535595829, 6094.9052166741121,
5980.0191582610196, 5880.1869867848218, 5779.8957906367368,
5691.1879324562778, 5617.5153566271356, 5532.2613232619951,
5467.352265375117, 5395.4493783888756, 5345.3459908298091,
5290.6769823693812, 5243.5271656371888, 5207.2501206569532,
5164.9617535255456]

x = range(1, len(y)+1)

from kneed import KneeLocator
kn = KneeLocator(x, y, curve='convex', direction='decreasing')

print(kn.knee)

Comment: Please add some explanation to your answer such that others can learn from it
Answer: Leave here a pretty cool gif from Codecademy course:

The K-Means algorithm:

Place k random centroids for the initial clusters.
Assign data samples to the nearest centroid.
Update centroids based on the above-assigned data samples.

Btw, its not a explanation of full algorithm, its just helpful vizualization


Help needed in understanding the lab observation regarding a diode

Question: I was trying to understand the connections in a power supply board.
It was found that anode of below diode is connected to GND and -ve terminal of bulk capacitor.
Cathode of diode is connected to +ve terminal of bulk capacitor.

simulate this circuit – Schematic created using CircuitLab
One strange measurement result was found when I measured the resistance wrt GND for the 2 cases shown above. The diode orientation is not reflecting correctly while measuring the resistance wrt GND.
Has it got anything with the way the multimeter  measures resistance ( by injecting a voltage thereby charging the bulk caps?)
I could find some voltage of 0.2V across diode after the above resistance measurement.
Comment: What results did you get?
Answer: Many analog multimeters actually present a positive voltage out of the black/negative lead and vise versa.
Most digital multimeters operate the obvious way with a positive voltage from the red lead.
That would explain the results you get.
Do you have the manual of the meter? What meter is it?


Can a diode prevent backwards current flow from a constant current source?

Question: I'm trying to make a AA battery replacement battery for a vintage computer because its actual battery has gone bad. Its of the NiMH type and I'm pretty sure those are charged with a constant current. I want to make sure that my alkaline batteries don't get accidentally charged if the AC adapter were to be plugged in. Would a diode prevent the constant current charger from charging my AA batteries?
Answer: It would (for all intents and purposes - there is always some leakage). However, a more significant issue is the fact that it will also drop almost half of you AA battery voltage - and thus waste half of the energy inside the battery. There are two options to mitigate this:
Battery protection circuits with some form of switch, such as a mosfet: These exist and use a circuit that will open a mosfet when power is applied from the output.
Alternatively, you could just use a NiMH battery and allow the system to charge it.
Answer: The voltage must be the same  ( within 20% est.) and the current is likely to be less than a few mA which will not create significant damage.
I recently repaired an old le Croy DSO that someone had replaced a 2.4V 2S NiCd pack with a Lithium 3.6V primary CR2 cell.  It failed to work due to a faulty plated thru hole. I fixed that then the RTC worked, but then it started to fail booting until I examined the schematics to see it was used in areas with 3.3V logic and 3.6V could be latchup problem.  SO I inserted an LED to measure current by intensity. It was barely visible (<1mA) and the 1.6V drop to 2V was too much for the RTC to function, but it booted.  So then I replaced the series LED with a Si diode in series with the 3.6V battery to get 3V and then it worked for RTC and booted successfully.
Moral of the story.
Don't change backup battery voltage and chemistry unless you know the implications.


Random initialization/order in neural network — bias or variance?

Question: I'm puzzled about how to describe differences occurring between neural networks trained on the same data and with the same configuration. They differ only in the initial weights (different seeds used for random initialization) and in the random order in which they process the training data.
Are these two examples of bias or variance? I tend towards bias, as both effects have no connection to the data, yet only to the initial state of my model.
Thanks!
Answer: In using a neural network model, you're solving a non-convex optimization problem by following the gradient down to a local minimum from a (random) starting point in the parameter space. Some solution might be different depending on the initial value of the weight matrices. But you don't know which local minimum would an initial value lead you to. So depending on the topology of the objective function, bias could result from these two sources of randomness.
Comment: I originally upvoted but, after thinking about it some more, I'm not so sure that randomizing contributes to bias. Although randomization is independent of the data, it doesn't seem like it would lead to *systematic* error in a particular direction. Is there a more detailed argument to be made? It's an interesting question, would be glad to hear your thoughts.
Comment: @user20160 Thanks for making me rethink the question. Let's address the variance part first. Suppose you increase hidden units/hidden layers to infinity. Take a sample data and train an NN, i think you'd agree that the model you get would fit the data very well, ie. overfit. Overfit occurs regardless of where you init your weights. So variance is a function of the hidden units/layers. Now, fix hidden units/layers, draw a sample from the true distribution, pick a random start, train a model, and repeat. Does the expectation of this procedure convert to the true distrib? I think it depends.
Comment: @user20160 This' a question of the topology of the objective function. Although the weights are randomly picked, some may lead to much better local optimum than others. There is no guarantee that the expectation with respect to the random starts would come close to the true function.
Comment: I agree w/ all of that. If I understand correctly, variance isn't synonymous w/ overfitting, but variability across training sets drawn from the same distribution, which overfitting contributes to. Seems randomization would contribute too. If randomization contributes to bias,  I think this would mean that randomization causes the learned function to differ from the true function in a way that's preserved across training sets drawn from the same distribution. Not seeing why that would be true
Answer: Imagine we want to fit a function by minimizing the squared error. The bias-variance decomposition (also see here) lets us write the total error as the sum of a squared bias term, a variance term, and an irreducible error term (the noise). Say we repeatedly sample training data from the true underlying distribution and fit a model using each training set. The bias measures the extent to which the learned function is systematically 'off' from the true function. It's given by the expected value (over possible training sets) of the difference between the learned function and the true function. The variance measures the extent to which the learned function varies across training sets. It's given by the expected value (over possible training sets) of the squared difference between the learned function and the true function.
Neural nets typically have nonconvex loss functions and are trained using local optimization routines. Parameters will therefore converge to different local minima, depending on how they were initialized. When using online learning methods like minibatch training or stochastic gradient descent, the order of the training data will also influence the local minimum that is ultimately obtained.
The question is whether random initialization and data order contribute to the bias or to the variance. Imagine the situation above, where we draw many training sets from the true underlying distribution. Randomizing the initial parameters or data order won't cause the learned function to be systematically different from the true function--if this were true, randomization would always cause the function to be 'off' in a similar direction, by a similar amount. Therefore, randomization doesn't contribute to bias. But, the learned function will certainly vary from run to run. Part of this variability will be due to fitting run-to-run fluctuations in the training data. But, another part will caused by the randomization. Therefore, randomization contributes to the variance.
These slides mention random weight initialization in neural nets as a source of variance. They mention that bias would be caused by things like using too few hidden units.
Answer: This is an interesting question.  I find it fascinating that there are already two answers that come to opposite conclusions that both are seemingly consistent.  Let me try to explain how that could be so.
When discussing these topics it's very important that we identify what is considered random and what is considered fixed in our situation.  Hastie, Tibshirani and Friedman put this very explicitly in their "Elements of Statistical Learning":

Discussions of error rate estimation can be confiusing, because we have to make clear what quantities are fixed and what are random (Indeed, in the first edition of this book, this section wasn't sufficiently clear).

For example, in the usual discussion of this sort we assume that the data $X$ are fixed (or at least conditioned upon), and the response given the predictors is random.  This assumption leads to the famous bias and variance decomposition of the least squared error, known to every serious student of statistical learning.
What about in your question?  I won't guess at your intenet, so there are two options:

We consider the initial point to be random, that is, drawn from some distribution.
We consider the initial point to be fixed, with the randomness coming only from the data we use to train.

Random Case: We are drawing our initial point at random from some distribution.  This distribution has some expectation, the expected initialization point.  We incur randomness in our process from the specific initialization point we choose, which varies around the model trained from the expected initialization point.  From this perspective, the choice of initialization point is model variance.
Fixed Case: We start the algorithm at the same point each time, and the randomness in our results is due to the data we use to train.   Each time, the ascent algorithm terminates at a local optima, which is more than likely not the global optima.  As we perturb the training data the local optima that is found varies continuously with the training data, so in this sense, for small perturbations of the training data, we end up at the same local optima every time(*).  This local optima is most likely not global, so we have consistently ended up at a sub optimal place, this is bias.
So, you see, it depends on your point of view.  It's very important we precisely set up our model of the situation if we would like to communicate these concepts clearly.
(*) This is the kind of thing you can prove with the inverse function or implicit function theorems from calculus.  There are assumptions involved, most likely that the second derivative of the loss function does not vanish at the local optima.  I spend a lot of time proving these things in my qualifying exams, but it has been a long time!
Comment: The fixed case doesn't really make sense to me. Why would changing the validation set be a local change, especially one local enough to apply the theorems you mention? In k-fold validation, for instance, it's a completely disjoint validation set. Perhaps we need to assume that the data distribution is smooth enough and k is small enough that indeed with high probability the change can be considered "local enough", but we'd need more machinery than just calculus.


When do I need to use CBC and HMAC?

Question: As I know CBC does not provide integrity for the message, thus HMAC is used to provide integrity for CBC message. Also, I hear about CBC-MAC which can provide integrity and confidentiality. Which one is better CBC-MAC or CBC with HMAC?
And when do I need to use CBC and HMAC?
Answer:
Also, there is CBC-MAC for providing integrity and confidentiality. Which one is better CBC-MAC or CBC with HMAC?

Generally, asking which one is better results in opinionated answers.
However, since CBC-MAC cannot be used for dynamically sized messages and may lead to compromise when the same key is used, HMAC definitely is less prone to abuse. Differently worded: CBC-MAC is more brittle than HMAC: it may break when abused.
That CBC-MAC it can still be used correctly is shown by the CCM authenticated mode of operation, which uses AES-CTR for confidentiality and AES-CBC-MAC for message integrity & authenticity. It is unwise to replace CTR mode with CBC in CCM mode because CBC with CBC-MAC is likely to introduce security vulnerabilities.
[EDIT]: I completely read over the fact that this says "integrity and confidentiality". CBC-MAC is a MAC algorithm that has been derived from the CBC mode of operation, hence the name. It does not provide confidentiality itself, it provides just message integrity and message authentication. See Luis' answer for more details. This is also why it is unwise to pair CBC and CBC-MAC (see previous section).

And when do I need to use CBC and HMAC?

You could use it when message integrity and/or message authenticity is required on top of the confidentiality that CBC mode offers. That is: if you are afraid that the ciphertext can be altered by an adversary. Generally transport protocols require message integrity / authenticity.
However, generally we use a modern authenticated mode of operation for that. AEAD ciphers such as AES-GCM and EAX are more robust than putting CBC and HMAC together. For instance, it would be easy to forget to include the IV into the calculation of the authentication tag. If that's forgotten than the adversary can still alter the first block of ciphertext. Likewise, CBC requires an IV that is indistinguishable from random to the adversary, while most AEAD ciphers require a nonce (which could be random, but it could also be a counter).
EAX uses CMAC (or OMAC) as MAC internally. CMAC has been build on top of CBC-MAC to make it secure for dynamically sized messages. The earlier mentioned CCM mode that does use CBC-MAC is also secure, but as a packet mode cipher it can be hard to use (let alone implement, as I found out).
There is an RFC draft called Authenticated Encryption with AES-CBC and HMAC-SHA which tried to standardize CBC and HMAC as an AEAD cipher. That didn't succeed (most other modes are more efficient) but if you want to use CBC with HMAC then it shows a few best practices.
Comment: "Replacing CBC-MAC with CBC instead of CTR..." -- I'm not sure if it's me, but that part lost me completely.
Comment: @ilkkachu That's certainly a fair criticism, I've replaced that part with "Note that it is unwise to replace CTR mode with CBC in CCM mode because CBC with CBC-MAC is likely to introduce security vulnerabilities.". If you have additional comments, please let me know!
Answer: It sounds like you have one big misconception in your question:

Also, I hear about CBC-MAC which can provide integrity and confidentiality.  Which one is better CBC-MAC or CBC with HMAC?

The first sentence reads like you misunderstand CBC-MAC to be an algorithm that provides two properties, integrity and confidentiality.  But in reality, CBC-MAC can only provide integrity.
The second sentence rests precariously on this misunderstanding, because you're comparing these two alternatives that are not comparable:

CBC-MAC
CBC with HMAC

...when the correct comparison would be:

CBC with CBC-MAC
CBC with HMAC.

The name CBC-MAC is confusing; CBC-MAC is a MAC-only algorithm that is built off the same basic idea as the CBC encryption-only algorithm.  CBC-MAC is a very tricky algorithm to use correctly, so I'd advice you against using it (and against rolling your own cryptography in general).  HMAC, in contrast, is reasonably straightforward (for a crypto algorithm that is).
Answer: CBC provides message confidentiality, using a block cipher as the primitive.
CBC-MAC provides message integrity, using a block cipher as the primitive, provided one of the following applies:

the message is of fixed size;
the key is not reused;
an appropriate padding mode is used (such as inserting the message size as the first block of the message; a unique counter also works).

HMAC also  provides message integrity, using a Merkle–Damgård hash as the primitive.
When one wants message confidentiality and integrity using the above, one wants CBC and one of CBC-MAC or HMAC. That should be with encrypt-then-append-MAC (preferably), or append-MAC-then-encrypt (but with the later unverified data is handled longer, making it more prone to e.g. padding decryption oracle attacks), with in both cases the second-applied layer applied on the full result of the previous layer (exception: with single-use integrity key, the a CBC-MAC or HMAC can be applied on the plaintext and sent non-encrypted).
There is an additional catch when combining CBC and CBC-MAC: the same key must not be used for both confidentiality and integrity; using the same key opens to attacks.

The choice between CBC-MAC and HMAC depends on context. Using HMAC is the least tricky, but CBC-MAC can make sense if speed (especially for short messages) or memory size matters, and all the following applies:

there is a fast and secure implementation of a block cipher at hand (e.g. AES-NI is available on the target CPU);
the requirement of different keys for CBC and CBC-MAC can be met;
the size of the message or a unique value can be inserted in the message's first block, or the CBC-MAC key is never reused (e.g. it is a session key).

Modern practice is block cipher operating modes that give both confidentiality and integrity, e.g. AES-GCM and friends, which (when correctly implemented and used) avoid the possible pitfalls with the CBC and CBC-MAC combination.
Comment: append-MAC-then-encrypt is dangerous - the Bleichenbecker attack leverages this.  As Matthew Green says (roughly) in one of his blog postings "if the first cryptographic operation you do on a received message is *not* 'check the integrity', you are doing it wrong"
Comment: @Martin Bonner: which Bleichenbecker attack are you refering to? The ones I know are on public-key signature or encryption, not MACs.
Comment: I don't know what I was thinking of when I said that.  The bit between the hyphen and the full stop is nonsense.  (But the rest isn't - 'MAC then encrypt' is *bad*).
Comment: @Martin Bonner: Indeed MAC-then-encrypt indeed has more failure modes than encrypt-then-MAC. However both are secure when done correctly.
Comment: Moxie Marlinspike coined this 'The Cryptographic Doom Principle'.  See https://moxie.org/2011/12/13/the-cryptographic-doom-principle.html, where he states, 'if you have to perform any cryptographic operation before verifying the MAC on a message you've received, it will somehow inevitably lead to doom.'

When do I need to use CBC and HMAC?


Can multiple Helium-4 nuclei occupy the same place because the nuclei are bosonic?

Question: A quarter of all matter in the observable universe is Helium-4 while all Helium-4 atoms have a nucleus with a zero spin integer which is characterized by Bose–Einstein statistics. Does this mean that Helium-4 nuclei are not subject to the Pauli exclusion principle and likewise multiple Helium-4 nuclei can occupy the same location?
Comment: Are you only interested  in the astrophysical context, where the atoms are bunched together by gravity (without external trap)?
Comment: I am writing a section in a philosophy of physics paper about laboratory experiments that generated Bose–Einstein condensate that sometimes gives us a macroscopic pure quantum system. Here, I want to make sure that I understand the basic nature of bosonic atoms, which I now clearly see are typical atoms.
Comment: @JamesGoetz If you want to ask specifically about BECs you should add the bose-einstein condensate tag, then I can edit my answer to specifically address that. I was assuming you were talking about space stuff.
Comment: I might do that separately, but here I focused on naturally occurring bosonic atom.
Answer: Short answer: no.
There are still electrons and quarks inside atoms, which are fermions, and they obey the Pauli exclusion principle. Quantum degeneracy pressure is indeed what stops the gravitational collapse of most stars (most = apart form those which become black holes).
Longer story:
First of all, the mainstream concept of adding each atomic sub-component's angular momentum quantum number to get a total spin number, and then using that to classify the atom as 'integer' or 'half-integer' and thus obeying Bose-Einstein or Fermi-Dirac (respectively) statistics is a simplification. Which usually works, sure, but still a simplification.
Take two $^4$He atoms, call them $a$ and $b$. Write the total wavefunction of the combined ($2$ atom) system $\Psi(\mathbf{r}_{a_1}, \mathbf{r}_{a_2}, \dots \mathbf{r}_{a_N}, \mathbf{r}_{b_1}, \mathbf{r}_{b_2}, \dots \mathbf{r}_{b_N})$, where $N$ is the number of constituents of each atom (quarks, electrons, etc.).  The spin-statistics theorem actually does not talk about Bose-Einstein or Fermi-Dirac (which are just "simple" results for non-interacting systems), but it just says that these two atoms are bosons if, upon exchanging the label of each constituent $a_i \leftrightarrow b_j \,\,\forall i, j$, you get the same wavefunction $\Psi$ as you started with, down to the same sign (would be an overall $-1$ for fermions).
Now, to carry out that permutation operation, you would need to take into account the situation where one quark of $a$ is swapped with one quark of $b$, one electron of $a$ swapped with one electron of $b$ and so forth. However, quarks' tunnelling from one nucleus to the other costs a lot of energy and is therefore not energetically allowed in usual day-to-day energy régimes. Same thing with stripping individual electrons (unless they are already shared in a molecular bond, in which case you'd be taking about gerade and ungerade symmetrical oribtals). So in the end you only consider swapping all the electrons and all the quarks of $a$ with all the electrons and all the quarks of $b$. Which is nothing other than exchanging the position of the two atoms. So, because you have energetically ruled out any sub-atomic permutation operation, you can just treat each atom as independent, and then proceed with "the sum of all the internal spin quantum numbers".
The moral of the story from above is that while you almost always can sum the internal spin quantum numbers to get the atom's total spin, in some cases that may not be useful (e.g. when an electron is shared in a molecular bond, or when you have access to energy scales comparable to nuclear binding energies). In these cases, you would have to revert to the original definition of the spin-statistics theorem, which is just an (anti-)symmetrisation of the wavefunction upon permutation of indices.
On the other hand, a Helium atom is a composite object. Made of fermions, which will indeed experience Pauli repulsion. As long as your energy is lower than what would be needed to probe the internal structure of the atom, then you can consider the actual atom as the foundational building block. This is the same as saying that the spatial extent of the wavefunction of the atom (de Broglie wavelength $\lambda_{\mathrm{dB}} \propto 1/E \propto 1/\sqrt{T}$) is larger than the physical extent of the atom $\sim 1Å$ (or of the nucleus if you want to know about nuclei $\sim 1$ fm). Where $E$ is the energy and $T$ the temperature.
Comment: Yes but BEC usually happens in the régime where $\lambda_{\mathrm{dB}} \gg$ atom/nuclear size, so that you don't have to take into account the fermionic constituents.
Comment: The question just asks about helium *nuclei*.
Comment: In the comments the OP repeatedly mentions bosonic atoms in general.
Answer: I recommend that you read Ketterle's "Making, probing and understanding Bose-Einstein condensates". In the intro the paper states:

In a simplified picture, atoms in a gas may be regarded as quantum-mechanical wavepackets which have an extent on the order of a thermal de Broglie wavelength $λ_{dB}$ [...]. $λ_{dB}$ can be regarded as the position uncertainty associated with the thermal momentum distribution. The lower the temperature, the longer $λ_{dB}$. When atoms are cooled to the point where $λ_{dB}$ is comparable to the interatomic separation, the atomic wavepackets "overlap" and the indistinguishability of particles becomes important

In the image we observe that at $T_c$ the particles start to overlap and that below $T_c$ we obtain a single mesoscopic wave function. Since the wave function defines the position of the particle, it is fair to say that the particles occupy the same space.


Is There a Bluetooth File Transfer Application

Question: Does Ubuntu have an application that can transfer files over Bluetooth?
I can pair my desktop with my MacBook, and the Mac has an application it calls BT FileTransfer but when I run this, the Mac reports that my desktop does not accept that sort of connection.
I did install the obexfs and obexftp packages but I am uncertain how to use them.
pgmer6809
Answer: Install Blueman. Once installed, right click on the Blueman icon in the notification area and select Local Services . . . , click on Transfer. Select your Incoming Folder (where you want transferred files to arrive). Make sure Accept files from trusted devices is checked.

Here is a complete manual on how to use Blueman: archlinux manual on Blueman
Comment: Thanks for the help. I don't see a Local Services item on my Blueman, but using Blueman I am able to send a file from the MacBook to my Linux box. When I try it the other way, the progress bar goes to completion then I get a box with, "Error Occurred. Could not find service record." There is no indication on the MacBook that anything is trying to contact it. This might be a MacBook problem, I am not sure. Anyway half way there thanks. I will try Linux to Linux next.
Answer:
Open the Activities overview and start typing Bluetooth.
Click on Bluetooth to open the panel.
In the Devices list, select the device to which to send the files.
Click Send Files… and the file chooser will appear.

Source: https://help.ubuntu.com/stable/ubuntu-help/bluetooth-send-file.html.en


What's the term for becoming used to something so you don't even notice it anymore?

Question: Is there a term for this? I had my SIL's birthday present on my desk for weeks, and then the day I went to visit her, I forgot to bring it with me because it had sort of become part of the furniture and I didn't notice it there.
Or when you walk into a room and notice the smell, but then you get used to it after a while so you don't notice it anymore.
Or you walk past a shop so often that you don't notice it, and when you want to buy something that the shop sells, you forget about the shop's existence because you don't notice it anymore.
Comment: This happens to me with items in my refrigerator or kitchen cabinet.  They just start to blend in and I don't really see them anymore.
Comment: The official term for "getting used to something" is "getting used to something". You even keep using it yourself to express exactly what you want to express — but you are so used to it you aren't even noticing.
Comment: Answered at [Word for repeatedly doing something you are scared of in order to overcome that thing](https://english.stackexchange.com/questions/551775/word-for-repeatedly-doing-something-you-are-scared-of-in-order-to-overcome-th)
Answer: Inured is a good choice, especially if the stimulus is a negative one.
http://www.thefreedictionary.com/inured

inured
tr.v. in·ured, in·ur·ing, in·ures also en·ured or en·ur·ing or en·ures
To habituate to something undesirable, especially by prolonged subjection; >accustom: "Though the food became no more palatable, he soon became >sufficiently inured to it" (John Barth).
Answer: You give three different situations that I feel require different expressions.
The gift can:

blend into your surroundings.
melt into the background.

You can become oblivious of/ to your surroundings.
You can also become accustom to something.

I worked in the room so often I became accustomed to the smell of cigarette smoke.

The gift sat on my desk for so long, it just blended into my surroundings.

I walked past the shop so often I became oblivious to its existence.

It is also possible to become numb to something however this seems to be used more when talking about sensations or experiences.

My boss yelled at me so much, I became numb to it after a while.

"it" refers to the experience of your boss yelling at you.
Note, though that "I didn't even notice it," implies that it is truly invisible to you, whereas "accustomed to" implies that you had to adapt to something so there was a conscious effort.  So, my first example (depending on your intentions) might better be phrased "I worked in the room often, so I had to accustom myself to the smell of cigarette smoke."  I mention this last example because Paul Ryan recently took over John Boehner's office, and will have to sterilize the room because he cannot take the smell.  "I don't think I can accustom myself to the smell.  I'm sure John was oblivious to it."

EDIT:
JEL suggested "acclimate."  I feel this is an excellent addition.  From my point of view, acclimate can also be applied to the situation described above about John Boehner's previous office.  We also use the word acclimate for weather situations.  I offer this word because I think it will help you better describe a situation in the future.  Each of the words suggested have different uses.  I don't think "acclimate" would fit the "gift on my desk situation." but it could fit another you have in mind.
Comment: Thorough. You might work 'acclimate' in there with reference to the smell.
Comment: @JEL may I include this comment into my answer?
Comment: Yes, I suggested it because I saw the on-hover recommended comments as a way of suggesting improvements.
Answer: Consider, obliviate.

: to forget; to wipe from existence.
late 14c., "state or fact of forgetting," from Old French oblivion
  (13c.) and directly from Latin oblivionem (nominative oblivio)
  "forgetfulness; a being forgotten," from oblivisci (past participle
  oblitus) "forget," originally "even out, smooth over, efface," from ob
  "over" (see ob-) + root of levis "smooth," from PIE *lei-w-, from root
  *(s)lei- "slime, slimy, sticky" (see slime (n.)). Meaning "state of being forgotten" is early 15c. Wiktionary
Answer: I think the word you're looking for is oblivious.
Example sentence: He became oblivious to my presence - his eyes stuck on the waitress - what a horrible date!
Answer: Desensitized or desensitised depending on where you are from, as per the free dictionary.com:

desensitize
  verb
past tense: desensitised; past participle: desensitised

make less sensitive.
  "creams to desensitize the skin at the site of the injection"
make (someone) less likely to feel shock or distress at scenes of cruelty or suffering by overexposure to such images.

"people who view such movies become desensitized to violence"

free (someone) from a phobia or neurosis by gradually exposing them to the thing that is feared.
Answer: A straightforward word would be Accustomed, or as a phrase, taken for granted.
Example (comic) usage: So many coders have taken the StackOverflow community for granted that if it goes down, their programming career is effectively over. :P


Scapy capturing Dot11 headers windows

Question: Is it at all possible to capture Dot11 headers under Scapy in Windows? I'm thinking Winpcap, but I'm not sure how I'm supposed to do that. Any clues?
Answer: WinPcap does not have this ability, but its successor Npcap can capture raw 802.11 frames. When installing, select "Support raw 802.11 traffic (and monitor mode) for wireless adapters." There are more directions in the Npcap User's Guide, but they may not apply to Scapy.
When the network adapter is put into NetMon (monitor) mode, captured packets will have a Radiotap pseudo-header with any available information such as channel, timestamp, signal strength, etc. Not all wireless adapters support this mode; a preliminary list of adapters and their level of support is available on SecWiki.org.

Scapy capturing Dot11 headers windows


HDMI for Android

Question: I would like to connect my GS4 to my plasma television. I have an HDMI adapter, but will the sound come from the television or my device? And what do I use other than the HDMI adapter?
Comment: Why not just try it?
Comment: I want to test it before doing anything.
Comment: It won't harm your device -- the most that could happen is that you find out whether or not it's compatible with your television.
Answer: What you need to connect a Galaxy S4 to a TV is an MHL-to-HDMI adapter, like this one that I use.

You connect the micro-USB bit to the phone, the big USB end to a charger (the adapter needs power.  This will also allow your phone to charge while you're using it like this), and the HDMI to the TV.
Audio will come out of the TV, or whatever it sends the audio to normally.
If you select a different MHL adapter and it isn't specifically advertised as being for a Galaxy S3 or S4, you'll need an 11-to-5 pin adapter, like this one, to use it with your phone, as Samsung uses a different connector for MHL than most other devices do.
Comment: That is actually very good advice, @user50798. If it's not a specified wire, the likelihood of it fitting most "any" Android device is high.
Answer: You can connect your Android device to your plasma television with an HDMI cable. (Though I wouldn't suggest buying it from eBay.)1 Sound should come from your television, I'll bet. Make sure the Android HDMI adapter is compatible with your device first.

HDMI for Android


Configuration of ILO port on HP servers

Question: I have a HP server that has ILO port. How can i configure it to use from remote location? server os is debian-squeez.
Comment: Are you configuring ILO remotely, or configuring ILO locally and trying to get it to work remotely? Also, which HP server model?
Comment: I want to configure it remotely to work it remotely :)
Comment: Sounds like a catch-22 situation. You need to configure ILO to work remotely, but you need to get on ILO to do that, but you can't because ILO isn't configured to work remotely, *ad infinitum*. You might want to try calling up your provider.
Comment: i have remote access by ssh to server.
Answer: You can configure the ILO from the running operating system using the HP Online Configuration (hponcfg) utility.
Download the HP packages for your OS as detailed here. You may as well use this as an opportunity to install all of the agents for your server.
However, the main package you need is the hponcfg utility.
apt-get install hponcfg

Here's a description of the command usage.
# hponcfg -h

Firmware Revision = 1.94 Device type = iLO Driver name = hpilo
HPONCFG RILOE II/iLO setup and configuration utility
Version 3.1.0 (c) Hewlett-Packard Company, 2010

-h,  --help           Display this message
-?                    Display this message
-r,  --reset          Reset the RILOE II/iLO to factory default
-f,  --file           Get/Set RILOE II/iLO configuration from "filename"
-i,  --input          Get/Set RILOE II/iLO configuration from the XML input
                      received through the standard input stream.
-w,  --writeconfig    Write the RILOE II/iLO configuration to "filename"
-a,  --all            Capture complete iLO configuration to the file.
                      This should be used along with '-w' option
-l,  --log            Log replies to "filename"
-v,  --xmlverbose     Display all the responses from RILOE II/iLO
-s,  --substitute     Substitute variables present in input config file
                      with values specified in "namevaluepairs"
-g,  --get_hostinfo   Get the Host information
-m,  --minfwlevel     Minimum firmware level

Using this tool, you will be able to supply an XML file as input containing some basic parameters for the ILO, like username, password, IP configuration, etc.
What may be easier in this case would be obtaining the ILO's current config using hponcfg -w ILO.xml, modifying the file to contain the IP and configuration you wish, then reconfiguring the ILO with the altered file with hponcfg -f ILO.xml.

Of course, if you have remote hands or someone with physical access to the server, this manual process works as well.
Answer:
Note the administrator password from the service tag.
Press F8 on server boot

You then get the iLO setup screen where you can set the IP/NM/DG and add a new user/password (do this, don't change the administrator password, not just yet anyway).
They you can just cable up the port and browse to the web interface - it's as simple as that.
Comment: Sorry, read it as he wanted to configure it to BE USED remotely - not that he wanted to configure it from a remote location - I'm a brit, forgive me for reading things too literally, it's a failing.
Comment: @Chopper3 - I must admit, now I've read it again, I can see what you mean! He did clarify in the comments, though.
Comment: @Dan, I also read it as he wants to use it remotely (why else would you want iLO), not that he needs to configure it remotely.
Comment: @Chopper3 Hey - don't use being a Brit as an excuse (Check my profile)
Comment: the OP states that this needs to be done remotely! Of course, he may be able to instruct someone to do this.
Answer: If you have installed using HP SmartStart then you may have the "HP Lights-Out Online Configuration Utility" installed to the following location:
[Program Files]\HP\hponcfg\hponcfg_gui.exe
If not, then you may be able to download it from here:
http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareIndex.jsp?lang=en&cc=us&prodNameId=1135772&prodTypeId=18964&prodSeriesId=1146658&swLang=8&taskId=135&swEnvOID=1005
Comment: I edited my question to mention the OS type. thank you anyway.
Comment: Sorry but installed what? I just know the server has ILO port,i haven't done anything about ILO on the server,i just installed OS on it and configure some of its services.And also the OS is Debian not Windows
Comment: Ah, you didn't say that :) Sorry then, I don't do Linux. SmartStart is a HP Util for quickly installing Operating Systems with the correct HP drivers and tools etc - but I suspect it's Windows only.
Comment: DON'T follow Dan's link, the domain is now owned by a squatter and shows no useful content.
Answer: Found a link, thought of sharing.
How to Configure iLO on your HP Proliant Server
May be it helps all.
Comment: Really not helpful as this covers configuring iLO from the BIOS. The BIOS is not available on a remote server as stated in the Question.
Comment: Also the link is now dead, which is why only posting a link is discouraged. In future please add the revelant text to your answer, by all means link to the original page to give credit.
Answer: If the server is running WIndows OS, then we can use HP Lights-Out Online Configuration Utility (HPONCFG.exe utility) for Windows. This is a simple GUI and we can easily reset the password. This utility does not ask for any password when you launch it. Moreover, when you reset the iLO password, HPONCFG will not ask for the previous password.
If we use this method, then we do not have to turn OFF the server and use the System Maintenance switch (iLO Security Override Switch) available on the Server system board.
For more information, may be the link provided below will be worth to look,
How to reset iLO Administrator password of HP Server
http://www.tricksguide.com/reset-ilo-forgot-administrator-password-of-hp-proliant-server.html
Cheers
Answer: The manual process that ewwhite linked to in his post can be found (salvaged) here http://hp-ilo.blogspot.com/#!

Configuration of ILO port on HP servers


how to reset a view pane in cinema 4d

Question: I am new to cinema 4d and I built a model which is easily viewable in my right, top, and front viewports, but in perspective view I can't see anything, and I can't figure out how to reset or recenter the view. Anybody know how to do this?
Answer: This might be useful too:
You can press "o" to center the selected Object in the current viewport
Answer: Besides the undo command, there is also "Frame Default" command in the edit menu of the view panel.
Answer: Well, I didn't quite figure out a "reset" button, but what I did realize is that cinema4d has two styles of undo - one for actions undertaken within the program, and one for the views themselves, so I was able to successfully undo using the viewpane undo mode.

how to reset a view pane in cinema 4d


Why can't I create a new account?

Question: Screen Shot 1
These are the screen shots of the issue I am having.  Google please fix this issue.
Answer: As the image reads "That username is taken". So, you have to try using a different username.
It happens when someone has already registered an account with that username. But in your case, it is not allowed as Google has some policy on certain usernames. Best would be to try another combination.
Also see: https://support.google.com/accounts/thread/3185985?hl=en

Why can't I create a new account?


Is there such a thing as an unvoiced vowel?

Question: I can't think of any and google has not been helpful.
Comment: Ask at linguistics.SE. There aren't any unvoiced vowels in English or most languages but there are some languages that have them.
Comment: See: http://linguistics.stackexchange.com/questions/4834/why-is-h-called-voiceless-vowel-phonetically-and-h-consonant-phonologically
Comment: For me: https://en.wikipedia.org/wiki/Voiceless_glottal_fricative  (like h in hat, it's a breath sound, not a vocal sound.)
Answer: Voiceless vowels are quite possible, and occur in one way or another in many languages.
After all, all vowels and all consonants that are whispered are ipso facto voiceless.
Whisper [a] and you have pronounced a voiceless vowel.
However, the overwhelming majority of vowel sounds in speech are voiced, since vowel formants are modifications of a voiced airstream from the larynx. Exceptions to this rule fall into a number of categories.

in some languages, like Japanese, some vowels become voiceless in some environments
(in Japanese, high vowels /i/ and /u/ are devoiced between voiceless consonants)
in some languages, like English, voiceless vowels are allophones of a consonant phoneme
(English /h/ is a voiceless vocal onset, a voiceless version of whatever vowel it precedes)
in some languages (Acehnese, for instance) some vowel phonemes are contrastively voiceless
(this is quite rare, however -- most voiceless vowels are conditioned rather than contrastive.)
Answer: Yes, it's technically possible, but I think you'd only consider it as an allophone, otherwise, the better transcription might be /h/.  Wikipedia lists one example in English as potato, where the first o is not vocalized, but otherwise the mouth is in the same position and there is air flowing. (IPA transcriptions use a ring for devoicing).
Japanese seems to the more common language for it with their u vowel, but thinking about, European Portuguese might well do it where traditionally transcriptions will normally list them as elided.
For an academic citation, here's an article on devoiced vowels in English and German: "Vowel devoicing/deletion in English
and German", by Jonathan E. J. Rodgers.
Comment: @Andrew Leach: That was my first thought too. But if you start by saying **'tatoe** obviously you don't engage your larynx until after you've delivered that first /t/. Listen carefully to yourself if you just add an initial /p/ before that, and you'll probably realise it's perfectly possible to get both /p/ ***and*** /t/ out before you start "vocalising".
Comment: Which version of English doesn't voice the first syllable of *potato*? I can't say it unvoiced.
Comment: @AndrewLeach I'm SAE, and in rapid speech, I either elide or devoice (it's tough for me to tell the difference, personally, because English initial *p* is aspirated, and effectively, that's all a devoiced vowel is), going directly from the voiceless /p/ to the voiceless /t/ without vocalizing.  In moderate-speed to careful speech, I always voice it.  Another example would be *identity*, where the *tit* has a high chance of being pronounced similar to /th̩t/, rather than /tɪt/
Answer: To add to John Lawler's answer (since I can't comment): Shuar (a Jivaroan, or Chicham, language of Ecuador) has (or did have a few decades ago) voiceless vowels in certain positions.  I'll quote from Glen Turner's 1957 IU dissertation: "In a contour [= phrase] final open syllable, a single, unstressed, oral vowel following a consonant cluster of nasal plus homorganic stop or affricate or following any single consonant other than /w/ or /y/ may be unvoiced if it is also preceded by 2 or more vowels in the same word...  When followed by a morpheme or another word (i.e. contour medial), voiceless vowels may be come voiced, lost, or remain present but unvoiced..."  This word-final position was post-consonantal, so it would be odd to consider it to be an /h/.
FWIW, in English I usually pronounce 'Mississippi' with a voiceless vowel in the second syllable.  Again, given the position, it would be odd to consider this to be an /h/.  Otoh, it is more or less indistinguishable from lengthening the 's' (that is, merging the first 'ss' with the second).
Answer: I couldn't make sense of any voiceless vowel because vowels give the consonants the sounds they represent, so if vowels are said to be voiceless, it can only be whispers or the glottal sound 'h'.
Comment: Welcome to ELU. This answer appears to duplicate [Prof Lawler's answer](https://english.stackexchange.com/a/189579/18696). Please do take the site [tour] and read the [help pages](https://english.stackexchange.com/help/how-to-answer). Stack Exchange is not a discussion forum.


Symfony2 structure setup

Question: Im almost new to Symfony2, I understand the Bundle, entity etc.
But my problem is with the structure.
I created a local virtualservers for development and i can't start until i dont know what im doing and how will it work.
So my current DocumentRoot is: http://mysite.localhost/ -> /var/www/mysite
I installed Symfony like this
/var/www/mysite
 - app
 - bin
 - src
 - vendor
 - web
May I need to generate a bundle for "index page" or i need the use the app.php/ ?
I mean i would my page starts with http://mysite.localhost/
What i need to do?
Where i need to generate Bundles?
Im confused.
Thank you so much
Best Regards,
Krisztian

For first, thanks the replies!
Now I modified like you adviced guys. Now when i write to browser http://mysite.localhost/ it will be http://mysite.localhost/app.php/ with 404 error. It doesn't matter that my DirectoryIndex is app.php or app_dev.php it is always pointing to app.php.
Is it normal? If it is, then how can I link a Bundle for main page or something like that?
Here is my sites-available/mysite file
<VirtualHost *:80>
ServerName mysite.localhost
ServerAlias mysite
ServerAdmin email@example.com
DocumentRoot /var/www/mysite/web/
DirectoryIndex app_dev.php
AddDefaultCharset UTF-8
AddCharset ISO-8859-2  .iso8859-2  .latin2 .cen
ErrorLog /var/www/mysite/mysite.error_log
CustomLog /var/www/mysite/mysite.access_log combined

HostnameLookups Off
UseCanonicalName Off

ScriptAlias /cgi-bin/ "/var/www/mysite/cgi-bin/"
<Directory "/var/www/mysite/cgi-bin">
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all
</Directory>
<Directory "/var/www/mysite/web">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

Answer: Just change your web server settings. Apache example:

DocumentRoot should point to /var/www/mysite/web
app.dev should be one of DirectoryIndex values
Comment: ty i did it, i put my sites-availble/mysite code in answer above now it is app.php and 404 error
Comment: try change "AllowOverride None" to "AllowOverride All"

Symfony2 structure setup


Who owns the rights to plastic spoons now? (US D234017 S)

Question: In reference to the patent: USD234017
Who owns the rights to plastic spoons now? Their patent was only to last 14 years
Answer: 'Ask Patents' user has already answered a similar question Expiry date of patent no 6676109 but in your specific case you'll need to apply that answer as follows:
US MPEP 2701    Patent Term [R-11.2013] states that..

Design patents have a term of fourteen years from the date of patent
  grant, except for any design patent issued from applications filed on
  or after the date of entry into force of the Hague Treaty as to the
  United States, has a term of fifteen years from the date of patent
  grant (see Pub. L. No. 112-211). See 35 U.S.C. 173 and MPEP § 1505.

above goes with duly payment of maintenance fee and subject to any invalidation or re-examination proceeding. if all above are full filled then a design patent to last 14 years after the expiry of said term patent will be in public domain.


Are older versions of iWorks available?

Question: Can I download a version of iWorks from Apple that will work with 10.6.8 before I upgrade to 10.7 or above.  I have a lot of Appleworks files I want to convert before I upgrade the system.
Answer: As is not available on Apple websites, I found this that seems to work.

Visit this Softpedia link to download a free trial of iWork '09.
Click Download, and then click External Mirror 1.
Double-click on the downloaded file. This will open up a window with a couple of files inside.
Double-click Install iWork '09 Trial and follow the installation instructions.
After installation, close out the install windows and wait a few minutes for your Mac to recognize the newly-installed apps.
Next, open up the App Store app and click on the Updates tab at the top. You should see updates for Pages, Numbers and Keynote.
If you don't see updates for these apps yet, close out of the App Store and wait a few minutes before opening it back up.

Are older versions of iWorks available?


Hamster refuses to climb back up pipe

Question: My Hamster that I got yesterday went down a curvy tube into another part of her cage (a separate container) and acted like she wanted out, but when she climbed back up the tube she got to a point and just stopped. Then she came back down and resumed trying to get out. Any idea why she stopped?
Comment: Has he been able to get out of the area on his own yet?
Comment: @RebeccaRVT What do you mean? Escaped? I only got her a few days ago
Comment: As in has he crawled through the pipe to get to the other side?
Comment: @RebeccaRVT Yes. Just she won't come back up the pipe. Or she wouldn't - for some reason now she's doing it perfectly
Comment: She may have just changed her mind or it took her some time to figure out how it works. They aren't the smartest little animals lol, they make up for it in cuteness though.
Answer:
Give your hamster a few days to settle in. Hamsters can behave oddly on their first few days in a new place, it is new and scary for them.
Make sure your cage is large enough for your hamster. They simply are not happy in small cages. It's area should be at least 360 inch2 (around 2300 cm2) but more if possible. In a tiny cage, they will spend a lot of time simply trying to escape and pacing their cage in frustration. Also make sure it has a big enough wheel to run on because they have lots of energy

It sounds mostly like typical hamster behavior. It is probably exploring the cage and learning how everything works/how to get around in the tubes
Answer: It could be she just changed her mind, or is stressed and is not sure how to get out since you said you only got her a few days ago.
Maybe let her out a little, waste her energy and when she's tired, put her back in. Just make sure the place has some covered hideouts if she'd like to hide, but set these hideouts in a way that you could get her right back when it's time to go back to cage. And, of course, she might want to climb something too.
It's all on you to make sure she doesn't get lost. And I'd suggest to get a hamster ball, that way she doesn't get lost and she could roam freely in your room. Hamster tubes with treats at the end of them can be very helpful too, as she could feel safe to be in a hideout and get treats when she comes out of it.
But hamster tubes should only be provided when the hamster feels safe around you, or else she might stay in the tube forever. To make the hamster feel less stressed and more safe, put her something in her cage so she could hide under. It's the first few days remember.
But also show her that you know where she is and still you won't hurt her. Touching her, petting her or giving her treats with your hand can make that happen.
Comment: Actually, hamsters - especially Syrians - _cannot_ live together. Syrians will fight each other and draw blood, and it quite possible for one Syrian to kill another one.
Comment: No hamster balls... PLEASE! They are pure stress for hamsters!
Comment: Hamster balls are not always bad - as long as its big enough, monitored closely, and the hamster goes in of their own decision. Some hamsters don't like it but for some its a safe way to explore outside their cage
Comment: Ok then let her have fun with something else
Comment: Ok no hamster balls, Emil. For the sake of @Layna.
Comment: I agree. It's just,as long as your hamster hates it or is afraid of it don't use it.

Hamster refuses to climb back up pipe


Index of summation - integer?

Question: Can the index of summation of a sum be anything other than an integer? What is the reasoning behind the answer?
Comment: Sure, you can sum over any set you like. It turns out that if you sum over something uncountable, the sum will diverge unless all but countably many of the terms are zero, but you can still sum over them.
Answer: Sums over non-integer indices are actually quite common.  Of course the notation must make it clear what indices are being used.  But you sometimes see expressions such as
$$ \sum_{\alpha \in A} f(\alpha) $$
where $A$ is some set (not necessarily of integers).
It should be noted that if $A$ is infinite, conditionally convergent sums will depend on the order in which the terms are taken, and that would have to be specified.  For an absolutely convergent sum there is no problem.  If $A$ is uncountable, the sum can't be well-defined and finite unless all but countably many $f(\alpha)$ are $0$.
Answer: Normally yes, although it can be generalized to members of enumerable sets, for example, instead of writing
$$\sum_{i=0}^N f(x_i)$$
you can simply write
$$\sum_{x\in A} f(x)$$
where $A$ is the set over which summation is done. This is very common simplification of notation.
What you are probably asking is, can they be noninteger real numbers... the answer is: those are not sums in the same sense, but people have generalized summation to noninteger indices. You can look up summability calculus, it's a beautiful theory, although I do not know what your mathematical background is.
Answer: The "index" of summation, the way I'm interpreting your question, corresponds to an enumeration of the elements of the set over which you are summing. For example, if you want to add the numbers $x_{1},...,x_{n}$, then you would write
$$\sum_{k=1}^{n}x_{k}$$
You can also think of this as
$$\sum_{x\in S}x$$
where $S=\{x_{1},...,x_{n}\}$.
However, there are sets which are not countable - this means the elements of the set are not in one-to-one correspondence with the set of integers. For example, you can take the sum of every real number in $[0,1]$, which you could write as
$$\sum_{x\in [0,1]}x$$
The problem is that because this set is uncountable, so there's no natural ordering for which to add these numbers. And in this case the sum is infinite. However if you know that a sum
$$\sum_{x\in S}x<\infty$$
then, even if $S$ is uncountable, this can be rewritten as a sum over a countable set.
Answer: You will have obvious issues if you are attempting an uncountable sum of non-zero values, but otherwise there is no greater difficulty than sums over an integer index
Here is an example:
$$\sum_{\frac{a}{b} \in \mathbb{Q} \cap (0,1]} \left(\frac{1}{b}\right)^k = \frac{\zeta(k-1)}{\zeta(k)}$$  where $\frac a b$ is a rational expressed in lowest terms and real $k \gt 2$
Comment: @martycohen  Have you included four cases of $(1/4)^k$ in your sum? There should only be two for $\frac14$ and $\frac34$, as $\frac24=\frac12$ and $\frac44=\frac11$ and so have already been included as $(1/2)^k$ and $(1/1)^k$
Comment: I get $\zeta(k-1)$
for the sum.
Where is my mistake?

$\begin{array}\\
\sum_{\frac{a}{b} \in \mathbb{Q} \cap (0,1]} \left(\frac{1}{b}\right)^k
&=\sum_{n=1}^{\infty} \sum_{j=1}^n (1/n)^k\\
&=\sum_{n=1}^{\infty} (1/n)^k\sum_{j=1}^n 1\\
&=\sum_{n=1}^{\infty} (1/n)^k\ n\\
&=\sum_{n=1}^{\infty} (1/n)^{k-1}\\
&=\zeta(k-1)\\
\end{array}
$
Comment: Aha! I included all fractions, not just lowest terms. So that $n$ in the third line should be $\phi(n)$. Thanks.
Comment: _"there is no greater difficulty"_ Well, defining the sum as a limit of the partial sums doesn't work if the set of the indices is not ordered, and the order of a traditional infinite sum does matter if there are both positive and negative terms.
Answer: Absolutely! See https://en.wikipedia.org/wiki/Summation#Capital-sigma_notation.
Really, the main purpose of using integers to index is because it's fairly intuitive but really any way of distinguishing different elements of a list will work (especially since addition will (generally) be commutative over the set of numbers so even the ordering of the elements is irrelevant).
An index set (while describing ways to index sets in a union rather than elements to be summed) provides a nice analogy
(see https://planetmath.org/indexingset)
Also, it's really often inconvenient to limit ourselves to plain old integer indexing.
More abstract notation is generally more useful.
Say you wanted the sum of all primes under 4000. You could do a lot of work to first figure out how many primes there are under 4000 and use that to index them all but it'd be far easier to just say something like
$\sum_{p:p=prime,p<4000} p$
Comment: For anyone who's wondering, there are 550 primes under 4000.
Answer: As a more practical answer,
if you want the
index of summation
to increment by a constant
non-integer value,
you could write
$\sum_{x=0\ by\ .01}^1 f(x)
$.
However,
both symbolically and numerically
I would write this as
$\sum_{n=0}^{100} f(n/100)
$.
The numerical reason is that
if the increment is not
representable exactly
($0.01$ is not in binary floating point),
the loop may execute
an extra or one less time
than expected.

Index of summation - integer?


Integrating out high momentum modes in $\phi^4$ theory

Question: I'm trying to follow section 12.1 of Peskin & Schroeder, which describes how integrating out the high momentum modes of the field in $\phi^4$ theory transforms the Lagrangian both by changing the values of $m$ and $\lambda$ and by introducing new interaction terms such as $\phi^6$, $\phi^8$ etc. I get the idea, but I'm a bit fuzzy on some of the math. In equation 12.5 Peskin separates the field into low momentum modes $\phi$ and high momentum modes $\hat{\phi}$. Rewriting the Lagrangian in terms of these fields gives terms like $\hat{\phi}^2\phi^2$ and $\hat{\phi}\phi^3$, which generate the new interactions, but also terms which depend only on the high momentum field - $m\hat{\phi}^2$ and $\lambda\hat{\phi}^4$. What do these terms do when integrated? Do they just add constants to the new Lagrangian?
Answer: Yes, terms like $\lambda \hat \phi^4$ only depend on the high-energy modes, so they're constant functions as functions of the low-energy modes. From the low-energy modes' viewpoint, i.e. when it comes to the dynamics of the low-energy effective theory, they just combine to a constant term $C$ in the Lagrangian,  a vacuum energy density that has no impact (unless one considers gravity or compares two situations with different $C$).
Comment: I've thought about it some more, and I'm no longer sure this is right. Shouldn't the $\lambda\hat{\phi}^4$ term have an affect on the low momentum modes due to intermediate states? For example, the following diagram represents a correction to the low momentum mass: http://img441.imageshack.us/img441/2263/blah1s.png

(Single lines are low momentum, double lines are high momentum)

Shouldn't there also be diagrams like http://img32.imageshack.us/img32/5949/blah12.png which further modify the low momentum mass and wouldn't exist if it weren't for the $\lambda\hat{\phi}^4$ term?


Fusion- or antimatter-powered propulsion: Which one will we likely develop first?

Question: In terms of scientific and engineering challenges, which one is closer to fruition? Specifically I am looking for the feasibility of using one of these systems for space-only travel between the orbits of planets and bodies throughout our solar system. Bonus points if the propulsion system can maintain constant acceleration, like the ships in The Expanse, and provide crew members with some fraction of Earth gravity.
Comment: As an offhand guess, I'd go with fusion... besides containment, the trouble with antimatter is it's just a good way to *store* energy. AFAIK, the only (presently known) way to *obtain* antimatter is to expend the energy that you will get back when allowing it to annihilate. With fusion, it's more plausible to get back more energy than we directly put in. (Also, do you count an Orion drive as "fusion"?)
Answer: Antimatter is a battery.  Fusion is a generator.  They're good for different things.
Unless we find a way to mine antimatter from some source we don't yet know, it will only ever be stored energy, made with planetary particle accelerators (or some future alternative), and every gram made will require input of its mass equivalent in energy.
Fusion, on the other hand, has at least the potential for portable power systems and engines, likely even capable of refueling "in the field", either from dense nebulae, or from planetary atmospheres and oceans.
Antimatter has a far higher energy density and release rate -- fusion has a much longer duration of action.  It's like the difference between gunpowder and gasoline, only far more so.  For some things, you need lots of energy, all at once -- that's a potential application for antimatter.  For other things, you need your energy to be delivered over time -- that's a better place for fusion.
Comment: ...which is why Star Trek had dilithium. Dilithium doesn't *power* warp drives, it modulates the reaction between matter and antimatter, allowing it to act less like gunpowder and more like gasoline, in order to provide the advantages of both. So... unless you (OP) invent something similar, note well what Zeiss Ikon said.
Comment: Corner case: antimatter as a catalyst for fusion - doesn't fall in either "battery" or "generator" case. But, in the bigger picture, this is just minor quibbling for the sake of pedantry.
Answer: Fusion power. In fact, we (probably) have done all of the basic science that's needed to build fusion power plants, the only thing that remains is a very expensive development process.
The process of fusion is pretty well understood: you cram a bunch of very hot hydrogen together, it fuses into helium, and releases a bunch more energy. You use that energy to boil steam, and after that a fusion power plant looks just like a regular coal, gas, or nuclear power plant.
The problems are technical, not conceptual:

How do you reliably start a "cold" fusion reactor by cramming enough hydrogen together and getting it hot?
Once the fusion reaction is started, it generates so much heat that any fusion reaction naturally wants to blow itself apart. So how do we keep that fusion reaction stable enough that we can keep feeding it new hydrogen and keep the reaction going?

These are really questions of the geometry of the reactor, of the mechanisms that need to be built, of how many and how strong of magnets do we need to confine the reaction, etc. We will have to do a lot of very expensive modeling and simulation, then build prototypes, then go back to the design stage and improve those prototypes, then build more prototypes. Eventually we get to the point where all of the apparent kinks are ironed out and we will build the world's first pilot fusion plant. That will be another big learning experience, and probably 5-10 years after that you will see the first generation of Mark 1 fusion reactors starting to be installed around the world.
The only problem is that all of this is terribly expensive. Unless there is a clear and convincing reason to spend billions to trillions of dollars developing this technology, it's much cheaper not to. From a technical standpoint nuclear power is just as clean as fusion power would be, and in the modern era there's much more of a focus on making renewables incrementally cheaper and more efficient rather than building a whole new technology. (Note that the problem of nuclear waste and nuclear contamination are more political problems than technical problems.)
This is what caused one of the early fusion pioneers, Lev Artsimovich, to say, "Fusion will be ready when society needs it."
The science is done, but the very expensive development has never been funded. Fusion has been "20-30 years away" since the 1950's because we got to the point where we can't go further without massive investment, and that investment just hasn't happened.
Comment: you act as if there weren't any fusion reactors running *right now*. there are, they just aren't net producers currently. and that's a state we're alread in for decades and likely will be.
Comment: "the very expensive development has never been funded." The correct form of expression is "not funded enough to get results sooner" - otherwise [ITER](https://en.wikipedia.org/wiki/ITER), or [Skunkworks' Compact Fusion Reactor](https://en.wikipedia.org/wiki/Lockheed_Martin_Compact_Fusion_Reactor) (as of now, no longer that compact)
Comment: Great answer.  And, as you already hint at, the "convincing reason" to increase research investment will likely be political, if anything.
Answer: Fusion, but probably with an antimatter boost.
Simply put, we have been working on it for decades and are already on our way to having it.
It has already been noted in other answer's and in comments that one of the biggest differences is that fusion is much better for sustained energy release, while antimatter releases more energy immediately. A purely antimatter drive would probably be more akin to early designs of exploding nukes behind a rocket, except it would be detonating antimatter (in layman's terms). Likewise, our current ability to produce antimatter is heavily limited by energy production and confinement (described as a magnetic bathtub in a documentary I saw once), which will likely be supplemented by the completion of fusion reactor designs.
I would like to note that fusion reactors and fusion rockets are two different things, but it stands to reason that once you have reactors, rockets aren't too far behind. Personally, I am much more convinced that something between spiked fusion rockets and antimatter-catalyzed nuclear pulse propulsion are much more likely to become the standard.
Feel free to correct me if I'm misunderstanding literal rocket science.
Basically, fusion and/or fission rockets are the primary propulsion method, however antimatter is used to essentially supercharge the entire reaction. This works differently for fusion vs fission, but in either case the end result is much greater impulse and fuel economy from the drive than you would get with either method on it's own.
For inertial confinement fusion it would save the initial energy investment necessary to start the reaction. Some design variants speculate much higher plasma gain and/or impulse.
For a fission rocket using the nuclear pulse propulsion design (back to firing nukes behind the rocket) it would essentially give you more bang for your buck. The comparison as I understand it is essentially turning your gen-1 A-bomb into a thermonuclear H-bomb (grossly over simplified).
Comment: I was going to use antimatter catalysed nukes as my answer, but you got there first. +1 for that, anyway. Antimatter doesn't supercharge a fission explosion, but it allows you to make a subcritical mass go _boom_ and release a useful amount of energy, which you can then use to drive a fusion reaction. Using many small booms is preferable to the _force majeur_ approach used by Orion, but regular nukes simply don't scale down.
Comment: (your early comments about fusion and antimatter drives aren't quite right, by the way, but fully correcting them is a bit out of scope for a comment thread. if you cared, you could set up a chat room and invite me and I'll ramble on for a bit, but I won't inflict it on you otherwise ;-) )
Comment: Reading your answer, because of the high energies involved it sounds like fusion is a prerequisite technology to produce any significant amounts of antimatter.
Comment: @JanDorniak I would say yeah pretty much. I guess not technically, but it's the only currently feasible method that would be economically viable. Producing antimatter comes at ridiculous energy cost, and fusion power has kind of been the holy grail of energy production since we discovered the concept. That's mainly because it is pretty much the literal power of the sun...
Comment: By the way, what about fusion-powered ion or plasma engines? Would that work? Since we are talking space travel only.
Comment: @StarfishPrime Would love to hear more. Does SE have a way to start a chat?
Comment: @JanDorniak Ion and Plasma engines have both already been developed, although still very early designs. Fusion power is likely the only feasible way to get a plasma engine to work on a large craft because of the amount of energy needed to create plasma in the first place. At that point though, and actual fusion rocket would be more effective. Ion drives don't need as much energy, but wouldn't scale upward as well. So both plasma and ion propulsion are better suited for much smaller/lighter craft that favor efficiency over power.
Comment: @TitaniumTurtle thank you for satisfying my curiosity. Last question though: what about the plasma coming out of the fusion reactor? Is that what you meant by "fusion rocket"?
Comment: @JanDorniak No, a plasma engine works by actually exhausting plasma out the back of the thruster, which only requires the production of plasma through electricity. A fusion rocket requires fuel like an actual rocket, which varies depending on design (usually Hydrogen isotopes, Lithium, and/or Helium 3). The resulting energy expulsion of the reaction is directed out the rear of the rocket. Plasma is generated during fusion reactions, but that also depends on design.
Comment: @TitaniumTurtle the chat features aren't entire obvious, bvut they do exist under the "community" button at the top right (of my screen at least). I eventually end up at a page like this: https://chat.stackexchange.com/?tab=mine&sort=active&host=worldbuilding.stackexchange.com and I've created a room [here](https://chat.stackexchange.com/rooms/info/105189/nuclear-rockets-voosh-wheeeee?tab=general) which you should be able to join.
Answer: Rockets which use antimatter as their primary source of energy are perhaps easier to conceive of and make than most fusion rocket designs (because you just throw some antiparticles at your reaction mass, and blow the resulting kaboom out of the back of your ship via a rocket nozzle, probably a magentic one, job done) but the sheer unimaginable cost of producing and storing the damn stuff in bulk will stop any such plans dead.
By "bulk" I mean "milligrams" here, by the way. Getting lkarge amounts is going to require vast infrastructure built in space, which will be the end product of a mature spacefaring civilsation, and such a civilisation will have need of decent rockets. Something will have to come first.
The easiest solution is of course the good old Orion Drive, which offers good efficiency and high thrust-to-weigh, and might well be possible with modern day technology. Most of the boom of modern nuclear weapons is provided by fusion reactions, after all. Job done!
This isn't an entirely smooth thrust, of course, but non-pulsed nuclear engines are likely to be exceedingly hard to make... witness our inability to make net-positive-output, non-pulsed nuclear reactions on Earth, and getting anything of that sort of work will be much easier than harnessing it as a powerful rocket of the sort that will shove you around the solar system. No; your best bet will be some kind of pulsed nuclear propulsion... designs like the Magneto-Inertial Fusion or Magnetized Target Fusion seem relatively plausible, and both are pulsed, for example.

Bonus points if the propulsion system can maintain constant acceleration, like the ships in The Expanse, and provide crew members with some fraction of Earth gravity.

As a footnote, be aware that brachistochrone transits may be fast, but they require very, very high performance engines. Centrifugal gravity combined with much more modest boost-coast-brake transits will be vastly easier, and allow for clever external beamed propulsion systems to maximise efficiency and leave the heaviest and most inconvenient parts of your rocket at home.