Is it possible to run the IIS web server on Linux?

Question: Is it possible to install IIS on Linux?
Answer: After introducing .Net Core, now Microsoft officially provide support to run .Net Core applications on Linux and you no longer need IIS server to serve .Net applications. You can use Kestrel web server to server .Net Core web applications. A complete guide to serve .Net Core web application with Nginx as reverse proxy is given here. If you want to use Apache instead of Nginx have a look here.
Comment: I understand it's not recommended for production use. And I understand I don't need IIS to run .net apps on Linux. However, for testing purposes I could do withe abiility to run IIS on my Ubuntu.
Comment: Are there open source applications running using this kind of environment? An example would be helpful.
Comment: You can find a lot of opensource projects on following link
https://github.com/thangchung/awesome-dotnet-core
Answer: IIS is Microsoft-proprietary web server software that can only run in the Windows operating systems for full support of it and all of its features.  It is not capable of being run in a non-Windows environment without sacrificing some functionality, and you will need Windows Server or Windows 7 with IIS installed on it in order to use IIS and all of its features.
Answer: It is not recommended to run IIS in a non-native environment (net exactly sure why you would want to) but it is possible to run .NET applications on Linux.
You should check out Mono: http://www.mono-project.com/Main_Page
So the answer is; Yes it is possible but 100% not recommended.
If you would like to run a web server using Linux you should use a native package like apache.
Comment: Damn that edit took most the question out then. Also, I just noticed that this is a very old question that you resurrected.
Comment: actually the edit took out the subject.  The subject and the actual content were vastly different, so with the approval of a couple of others, I revised the title to reflect the question in the content.  I can easily revert that and then add to their question, but this is an *old* question that ended up in the suggested edits queue.  (ANd I got a revival badge from it too :P)
Comment: This is what Microsoft uses for their Azure Linux Webapps. `/usr/lib/mono/4.5/mod-mono-server4.exe` is the command that's actually running on my webapp right now
Comment: Their message from earlier, before my edits, indicated they want it to run specific MVC software on a web server.  Linux can't run MVC + IIS very efficiently, but the issue here is not that they want to run MVC natively but that they want to run IIS + these MVC apps at the same time, and I'm pretty certain Mono might have issues with that.
Answer: As others said, IIS isn't supported on GNU/Linux however, as of (at least) late 2019, you can use the Kestrel web server which runs perfectly fine on Arch, so it shouldn't be a problem to run a .NET Core 3 web server on Ubuntu or any modern distros.
That being said, you should make sure you have the correct .NET Core SDK and runtime (which matches the version specified in your project's WebApi.csproj file).


Custom Lint Rule to Check All Views in Layouts

Question: In the app I'm working on, it is imperative that all views in all layout files have an id set on them. So I'm trying to build a custom lint rule to enforce this.
Normally, one would use the getApplicableElements() method from XmlScanner and include a list of strings for each element tag. However, I can't seem to find a way to make this look at all elements in an XML layout which subclass View.
I tried using XmlScannerConstants.ALL, however, that looks at every single element in every single XML file. Given that we have several other types of XML-based resources, that's not going to work.
My code for the inspector class is below. Does anyone know of a good way filter getApplicableElements() so it looks at every element that subclasses View, and nothing else?
class IdDetector : ResourceXmlDetector() {

    companion object {

        private const val ISSUE_ID = "MissingId"
        private const val ISSUE_DESCRIPTION = "Missing required attribute 'id'"
        private const val ISSUE_EXPLANATION = "Identifiers are required on all views."

        val ISSUE = Issue.create(
            id = ISSUE_ID,
            briefDescription = ISSUE_DESCRIPTION,
            explanation = ISSUE_EXPLANATION,
            category = Category.A11Y,
            priority = 10,
            severity = Severity.FATAL,
            androidSpecific = true,
            implementation = Implementation(IdDetector::class.java, Scope.RESOURCE_FILE_SCOPE)
        )
    }

    override fun getApplicableElements(): Collection<String>? = XmlScannerConstants.ALL

    override fun visitElement(context: XmlContext, element: Element) {
        if (!element.hasAttributeNS("http://schemas.android.com/apk/res/android", "id")) {
            context.report(ISSUE, element, context.getLocation(element), ISSUE_DESCRIPTION)
        }
    }
}

Answer: There's the appliesTo(@NonNull ResourceFolderType folderType) method that can help you achieve that. In your case, I believe you will be only interested in targeting the layout folder. You're new detector would look something like this:
class IdDetector : ResourceXmlDetector() {

    companion object {

        private const val ISSUE_ID = "MissingId"
        private const val ISSUE_DESCRIPTION = "Missing required attribute 'id'"
        private const val ISSUE_EXPLANATION = "Identifiers are required on all views."

        val ISSUE = Issue.create(
            id = ISSUE_ID,
            briefDescription = ISSUE_DESCRIPTION,
            explanation = ISSUE_EXPLANATION,
            category = Category.A11Y,
            priority = 10,
            severity = Severity.FATAL,
            androidSpecific = true,
            implementation = Implementation(IdDetector::class.java, Scope.RESOURCE_FILE_SCOPE)
        )
    }

    override fun appliesTo(folderType: ResourceFolderType): Boolean = ResourceFolderType.LAYOUT == folderType

    override fun getApplicableElements(): Collection<String>? = XmlScannerConstants.ALL

    override fun visitElement(context: XmlContext, element: Element) {
        if (!element.hasAttributeNS("http://schemas.android.com/apk/res/android", "id")) {
            context.report(ISSUE, element, context.getLocation(element), ISSUE_DESCRIPTION)
        }
    }
}


Calling microservices after scaling

Question: I am developing a microservice platform with Spring. So far I have a few microservices and a service discovery server where all microservices register themselves. I also have an Angular client application, which right now is calling the address and port of one of the services. However, what if the service gets replicated due to high load? How can I load balance the client calls between both instances? I know I could utilize an API gateway, but the same question arises when the API gateway scales itself.
Answer: You've got a couple of options to you:
Local Proxy
A local proxy like Zuul or Spring Gateway allow you to take advantage of a load balancing at the proxy server level.
If you are using Consul, there should be a module to generate NGINX configs and tell it to reload.
Client Lookup
As a Eureka client, for example, a very simple load balancing solution exists for your application.  Instead of resolving directly to your specific instance of a microservice, you use the service name in your URL.
Let's say you have an Auth Service that talks to a User Management Service.  Your User Management Service registers itself under the name "user-mgmt" (spring.application.name), and the Auth Service registers itself as "auth".
When you create the URL for the User Management Service, you simply use it's spring.application.name in your URL where the server name would be.  Example:
http://user-mgmt/profile

The plumbing in Spring knows how to intercept that URL and find the actual instance registered by that name.  The Eureka client bit periodically checks the listing of services registered to that name, and selects one of the values to substitute.  The substitution should take care of the host name, port, and protocol (http vs https).
As far se client libraries that leverage this functionality you have the options:

Feign - generates client bindings to call services from a Java interface (also works with Hystrix)
RestTemplate - core component of Spring Boot
Direct use of Eureka Client - it's pretty low level, but you have all the power of how you pick one instance over another.

Honestly, anything that uses RestTemplate will work as I described.

Calling microservices after scaling


Qemu emulator arm for tegra2

Question: I have Toradex Colibri t20 embedded board  Linux image (U boot,kernel,roofs). Colibri t20 is based on tegra2 arm-cortex-a9 processor. I want to run this Linux kernel in Qemu emulator.How can i boot with qemu?
Answer: qemu-system-arm can run u-boot and kernel SW, only when it has support for the board that those SW were configured/built for.
ARM's versatilepb and vexpress-a9 are supported. There are good tutorials out there for using those boards, Balau on kernel, also Kumar
Bare metal simulation is less ambitious. There, roughly speaking, QEMU only has to emulate the processor. Check out Balau on bare metal. Quick search shows maybe there is support in progress for Tegra2.
I'd suggest installing current packages on your host, see what machines and cpus are supported. Not sure of the following syntax detail, but something like
qemu-system-arm -M ?
is the way to get the list of supported machines.
Comment: Actual syntax for supported CPUs is `qemu-arm-static -cpu help` ;)
At least for *Qemu 1.5.0*.

Qemu emulator arm for tegra2


Is the integral of positive functions with respect to the normalized measure increasing?

Question: Let $B(r)$ designate the open ball of radius $r>0$, and a fixed center in $\mathbb{R}^{n}$. Let $\lambda$ be the Lebesgue measure of dimension $n$, and $f$ be a positive locally integrable function. My question is: is it true that
$$\frac{1}{\lambda(B(r))}\int_{B(r)}fd\lambda\leq \frac{1}{\lambda(B(R))}\int_{B(R)}fd\lambda,$$
if $0<r<R$? Why?
Answer: No: define $f(x)=1+1_{B(r)}(x)$. Then
$$ \frac{1}{\lambda(B(r))}\int_{B(r)}f(x)\;dx=2 $$
while
$$ \frac{1}{\lambda(B(R))}\int_{B(R)}f(x)\;dx=\frac{\lambda(B(r))}{\lambda(B(R))}+1=\Big(\frac{r}{R}\Big)^n+1<2 $$
Answer: Let $f$ be your favorite continuous, strictly positive, integrable function (e.g. Gaussian density); say $\int_{\mathbb{R}^n} f\,d\lambda = 1$.  Then for $R \gg 1$ the right side is approximately $\frac{1}{R^n} \approx 0$.  But for $r \ll 1$ the left side is approximately $f(0) > 0$ (where I'm taking $0$ to be the center of the ball).


xoj (Xournal) files handled as gzip despite presence of correct MIME type

Question: So I had to uninstall the ppa version of Xournal and build from source (with a modification).  And now .xoj files open automatically with KDE's archive manager Ark, and are identified as being of type "Gzip archive" when one selects Properties from the right-click menu in Dolphin:

(Before, .xoj files opened with Xournal and were correctly identified.) This state of affairs persists despite all of the following:
1) Copied these files that come with the source package:
 - xournal.xml into /usr/share/mime/packages/
 - xournal.desktop into /usr/share/applications/
 - x-xoj.desktop into /usr/share/mimelnk/application/
2) added the line
application/x-xoj=xournal.desktop;
   to ~/.local/share/applications/mimeapps.list
3) added the MIME type application/x-xoj in the File Associations System Setting
   (with appropriate content):

   (Note also that application/x-gzip specifies only the .gz extension:
.)
4) copied xournal.xml to /usr/share/mime/application
   as suggested here
5) sudo update-mime-database /usr/share/mime
6) restarted the computer
edited to add:
7) [right-click an .xoj file] --> Open With --> Other... --> [select 'Xournal'], tick 'Remember application association for this type of file' also has no effect.
end of edit
This is on Kubuntu 12.04.
So, what am I missing?
Edited to add
I have discovered that the file --mime-type [filename] and mimetype [filename] commands produce different results, as in this question:
archelon@ingelrayok:~/Documents/xournal$ file --mime-type 2014-02-22-Note-02-09.xoj
2014-02-22-Note-02-09.xoj: application/x-gzip
archelon@ingelrayok:~/Documents/xournal$ mimetype 2014-02-22-Note-02-09.xoj
2014-02-22-Note-02-09.xoj: application/x-xoj

However, there is no entry for application/x-gzip in /etc/mime.types (from which the file command supposedly gets its information); and, indeed, there shouldn't be, according to the comment at the beginning of that file, which reads in part:

Note: Compression schemes like "gzip", "bzip", and "compress" are not
   actually "mime-types".  They are "encodings" and hence must not have
   entries in this file to map their extensions.  The "mime-type" of an
   encoded file refers to the type of data that has been encoded, not the
   type of encoding.

That comment also says that

Users can add their own types if they wish by creating a ".mime.types"
   file in their home directory.  Definitions included there will take
   precedence over those listed here.

There is at present no such file.  There are some files in my home directory (which I didn't create) that are apparently related to the output of the mimetype command; these include
~/.local/share/mime/application/x-xoj.xml,
~/.local/share/mime/packages/application-x-xoj.xml, and
~/.local/share/mime/types which contains only the text application/x-xoj.
In fact the directory ~/.local/share/mime/ and everything in it have the same timestamp (22:19 last night), and were thus presumably generated by the same process.
After looking at the manpages for mimetype and file, I decided to check the environment variables $XDG_DATA_HOME and $XDG_DATA_DIRS, which apparently are used by the former but not the latter.  But I didn't know how to report the value of an environment variable, so I tried cat $XDG_DATA_HOME, which set the value (to nothing) instead of reporting it.  Edited to add:  Or so I thought at first; actually it was already unset, as we shall see. The correct command is echo $XDG_DATA_HOME, as I learned from reading about environment variables here.  So then I discovered that $XDG_DATA_DIRS was set to /usr/share/default:/usr/local/share/:/usr/share/; the first of these doesn't exist.  I don't think that matters, but anyway I ran the commands
XDG_DATA_HOME=$HOME/.local/share

and
XDG_DATA_DIRS=/usr/local/share/:/usr/share/

to accord with the standard.  I doubt that any of this will make any difference, but I'm going to try another restart now (although I think those environment variables will be automatically reset anyway). Next edit: Yes, they were; in fact the variable XDG_DATA_HOME is now null again.
Anyway the bottom line seems to be that KDE is using the functionality that file is using, rather than that which mimetype is using.  If I understand things correctly, this means that it is using magic instead of MIME types.  I now suspect that magic is responsible for this whole issue.
New edit
So the file manpage seems to be saying that these are the baseline magic files:

/usr/share/misc/magic.mgc  Default compiled list of magic.
  /usr/share/misc/magic      Directory containing default magic files.

(I have these; /usr/share/misc/magic is a link to the empty folder /usr/share/file/magic and /usr/share/misc/magic.mgc is a link to the file /usr/share/file/magic.mgc -- the latter is a 2.1 MB file full of gobbledygook) and the following text:

The information identifying these files

(i.e. "files [which] have a ``magic number'' stored in a particular place near the beginning of the file")

is read from /etc/magic and the compiled magic file
   /usr/share/misc/magic.mgc, or the files in the directory
   /usr/share/misc/magic if the compiled file does not exist.  In addition,
   if $HOME/.magic.mgc or $HOME/.magic exists, it will be used in preference
   to the system magic files.

(I have confirmed this with strace, as suggested here.)  Neither $HOME/.magic.mgc nor $HOME/.magic exists on my system; but, since presumably xoj files contain precisely that gobbledygook which causes a file to be magically identified as application/x-gzip, it would do no good to create them (please correct me if I am wrong).
The solution I'm looking for, then, would be a way to have the MIME-type specification override magic for a given file extension; I thought I had seen something that looked like it might provide a hint as to how that might be accomplished, but I can't find it now.  Yet surely such a method exists.
Comment: Have you tried opening a context menu on a `xoj` file in Dolphin and selecting "Open with..." then checking "Remember application association..."?
Comment: Yes.  It doesn't work.  (The 'updating system configuration' window appears and then the file opens with Xournal; but after I close it everything is the same: I click the file and it opens with Ark.)
Comment: I cannot help you, but I would suggest asking on [KDE forum](http://forum.kde.org/viewforum.php?f=17), as there are much more chances to find the answer
Answer: Not an answer, but just a comment:

tried cat $XDG_DATA_HOME, which set the value (to nothing) instead
  of reporting it

cat will certainly not set the value of the variable. cat would print the contents of the file of the name you provide it with, or in the absence of a file name it would print what it reads from standard input. Furthermore the variables are expanded by the shell you are running (usually /bin/bash) and thus cat doesn't even ever see the name of the variable.
Now in your specific situation, the variable seemingly wasn't set, thus expanded to nothing, thus cat had no parameter, thus cat printed from stdin and I presume you had to Ctrl-C-end it, or maybe Ctrl-D (end of file).
Comment: "So I had to uninstall the ppa version of Xournal and build from source (with a modification). And now .xoj files open automatically with KDE's archive manager Ark" Maybe you could try analysing what files the ppa version installs and how it makes it work correctly?
Comment: "I presume you had to Ctrl-C-end it": Yes. "try analysing what files the ppa version installs and how it makes it work correctly": I imagine I will end up trying to do just that.


Why did King Henry V have Cambridge and Grey's heads cut off?

Question: In Netflix movie The King (2019), what mistakes have Cambridge and Grey made to have King Henry V have their heads cut off? Wikipedia article on this movie didn't give me clear explanation on this.
Answer: From Wikipedia their crime was that, they lost their faith with the new king and tried to conspire against him.

The English nobles Cambridge and Grey are approached by French agents hoping to induce them to the French cause. Their trust in the new young king wavers, and they then approach Hal's Chief Justice, William Gascoigne, with their concerns.

Further, Henry V beheaded Cambridge and Grey to prove his power to show what he can do to those who goes against him.

Gascoigne advises the young king that a show of strength is necessary to unite England, so to prove his competency.....has Cambridge and Grey beheaded.

Why did King Henry V have Cambridge and Grey’s heads cut off?


What is the relation between analytical Fourier transform and DFT?

Question: First of all let me state that I searched for this topic before asking. My question is as follows we have the Analytical Fourier Transform represented with an integral and Discrete Fourier Transform represented with a summation usually computed by a numerical software. My question is that although the relationship is exact at the sampled data points assuming they are equally spaced(say they are equally spaced in time) how can we say about the accuracy of the transform that is if we transform into frequency-domain both with DFT and AFT how will the coefficients for a particular frequency be related? Are they going to be the similar or the same under some conditions?
Answer: I assume you refer the continuous-time Fourier transform (CTFT)
$$X(\omega)=\int_{-\infty}^{\infty}x(t)e^{-i\omega t}dt\tag{1}$$
and to the discrete Fourier transform (DFT)
$$X[k]=\sum_{n=0}^{N-1}x[n]e^{-i2\pi nk/N}\tag{2}$$
where $x[n]$ and $X[k]$ are sequences, whereas $x(t)$ and $X(\omega)$ are functions. The DFT can be computed efficiently by the Fast Fourier Transform (FFT).
The DFT can be used to approximate the CTFT, but there are always two possible error sources, and you can never avoid both of them at the same time:

truncation error: since the DFT uses a sequence of finite length, any signal $x(t)$ which does not have finite length (or is too long for computer memory) must be truncated.
aliasing error: the DFT uses sample values $x[n]$ which can be equidistant samples of the function $x(t)$. Sampling can introduce aliasing if the sampling rate is smaller than twice the maximum frequency contained in $x(t)$.

You always have at least one of the two above errors because for avoiding the truncation error you need a finite length signal $x(t)$, which cannot be band-limited (i.e. you'll get an aliasing error). The aliasing error can be avoided if you have an ideally band-limited signal and if you choose the sampling frequency sufficiently high, but such a signal cannot have finite duration, so you get a truncation error.
Taking these two errors into account, you can approximate the CTFT by the DFT. Assuming equidistant frequency points with a spacing of $\Delta f$, and a time-domain sampling interval of $T$ you have
$$X(2\pi k\Delta f)\approx T\sum_{n=0}^{N-1}x(nT)e^{-i2\pi kn/N} $$
with $N=1/(\Delta f\cdot T)$, assuming that the relevant part of $x(t)$ has been shifted to the range $[0,NT]$.
Comment: That was exactly what I was asking for in particular the relation ship between $X[k]$ and $X(w)$ with the assumption that n also represents time. So while sampling in time domain we got the exact representation(with infinitely precise instrument and a complete theory say) of the analytical time-domain function $x(t)$ sampled at particular times. I will study your answer in more detail.
Comment: Clean answer with pragmatic approach
Answer: I myself couldn't find a source that directly relates the discrete and continuous Fourier transforms, only approximations, limits, and graphical examples. I worked something out, and this post seems like as good as place as anything to share it.
First some definitions of the key functions.
continuous Fourier transform (if $t$ in seconds, then $f$ in Hz):
$FT\{x(t)\}(f) = \int_{-\infty}^{\infty} x(t) e^{i(-2\pi)ft} dt$
discrete Fourier transform:
$DFT\{y[n]\}[k] = \sum_{n=0}^{N-1} y[n] e^{i \frac{-2\pi}{N}kn}$
Rectangular window (atypical notation):
$U\{a, b\}(t) = \begin{cases}
 & 1 \text{ if } t\in [a,b) \\
 & 0 \text{ if } t\notin [a,b)
\end{cases}$
Sinc function:
$sinc(f) = \begin{cases}
 & 1 \text{ if } f = 0 \\
 & \frac{sin(\pi f)}{\pi f} \text{ if } f \neq 0
\end{cases}$
Discrete signal sampling a continuous signal:
$y[n] = \begin{cases}
 & x(n \Delta t) \text{ if } n\in \{0, 1, ..., M-2, M-1\} \\
 & 0             \text{ if } n\in \{M, M+1, ..., N-2, N-1\}
\end{cases}$
Note that $y[n]$ has $N$ points but only samples only $M$ points of $x(t)$ with constant time-step $\Delta t$. The other $N-M$ zeros take into account zero-padding.
Now for the relation. To put it in a sentence, the DFT of a finite sample of a continuous $x(t)$ is equal to a discrete sample of the FT of the Dirac-sampled and rectangular-windowed $x(t)$ (3rd line).
$
FT\{x(t)\}(f)*(sinc(M\Delta t\ f) e^{i(-\pi M\Delta t)f})*(\sum_{b=-\infty}^{\infty}\delta(f-\frac{b}{\Delta t})) \Biggr|_{f = \frac{k}{N\Delta t}} \\
= \frac{1}{M} FT\{x(t)\}(f)*(M\Delta t\ sinc(M\Delta t\ f) e^{i(-\pi M\Delta t)f})*(\frac{1}{\Delta t}\sum_{b=-\infty}^{\infty}\delta(f-\frac{b}{\Delta t})) \Biggr|_{f = \frac{k}{N\Delta t}} \\
= \frac{1}{M} FT\{x(t) U\{0, M\Delta t\}(t) \sum_{n=-\infty}^{\infty}\delta (t-n\Delta t)\}(\frac{k}{N\Delta t}) \\
= \frac{1}{M} \int_{-\infty}^{\infty} x(t) U\{0, M\Delta t\}(t) \sum_{n=-\infty}^{\infty}\delta (t-n\Delta t)\ e^{i(-2\pi) \frac{k}{N\Delta t} t} dt \\
= \frac{1}{M} \int_{0}^{M\Delta t} \sum_{n=0}^{M-1} x(n \Delta t) \delta (t-n\Delta t)\ e^{i(-2\pi) \frac{k}{N\Delta t} n \Delta t} dt \\
= \frac{1}{M} \sum_{n=0}^{M-1} \int_{0}^{M\Delta t} y[n] \delta (t-n\Delta t)\ e^{i \frac{-2\pi}{N} kn} dt \\
= \frac{1}{M} \sum_{n=0}^{M-1} y[n] e^{i \frac{-2\pi}{N} kn} \int_{0}^{M\Delta t} \delta (t-n\Delta t)\ dt \\
= \frac{1}{M} \sum_{n=0}^{M-1} y[n] e^{i \frac{-2\pi}{N} kn} 1 \\
= \frac{1}{M} \sum_{n=0}^{N-1} y[n] e^{i \frac{-2\pi}{N} kn} \\
= \frac{1}{M} DFT\{y[n]\}[k]
$
This relation explains many principles of using the DFT that are often repeated but rarely explained:

Zero-padding increases $N$ and decreases $\frac{k}{N\Delta t}$, which increases frequency resolution (you can define $\Delta f = \frac{1}{N\Delta t}$).

You'll notice that with finer resolution, you'll see $sinc$ shapes in the DFT because finite $M$ is equivalent to truncating $x(t)$ to $x(t) U\{0, M\Delta t\}(t)$. If you don't like the $sinc$ because of its many lobes causing overlap, you could choose a different window with length $M$, hence the principle of windowing before zero-padding.

You want to sample $x(t)$ as much as possible to maximize the sample length $M$; no amount of zero-padding will change that. A larger $M$ means a narrower and taller $sinc$, which asymptotically approaches a Dirac delta function. People often scale DFTs by $1/M$ to normalize the magnitude across different sample lengths (1st line).

The DFT is N-periodic, and the corresponding FT (the entire first line, not only of $x(t)$) is $\frac{1}{\Delta t}$-periodic due to the convolution by a Dirac comb. The frequencies in $x(t)$ larger than the Nyquist frequency $\frac{1}{2\Delta t}$ are not captured in the DFT and are instead added to the smaller frequencies; this frequency-pollution is called aliasing. This is caused by sampling, no way to completely avoid it. There are a couple ways to deal with this: a) attenuate frequencies above the Nyquist frequency with a low-pass a.k.a anti-aliasing filter before sampling, and b) sample with finer time resolution to capture higher frequencies.

Something convenient happens when you sample several full periods from a periodic signal perfectly aligned to its period. Let's say $x(t)$ has period $P\Delta t$ and you sample $L$ full periods. Without zero-padding, $N=M=LP$.
Because x(t) is periodic, its Fourier transform has the form:
$FT\{x(t)\}(f) = \sum_{a=-\infty}^{\infty} A[a] \delta (f - \frac{a}{P\Delta t}) $
So what does the DFT look like?
$
\frac{1}{M} DFT\{y[n]\}[k] \\
= \frac{1}{M} \sum_{a=-\infty}^{\infty} A[a] \delta (f - \frac{a}{P\Delta t})*(M\Delta t\ sinc(M\Delta t\ f) e^{i(-\pi M\Delta t)f})*(\frac{1}{\Delta t}\sum_{b=-\infty}^{\infty}\delta(f-\frac{b}{\Delta t})) \Biggr|_{f = \frac{k}{N\Delta t}} \\
= \sum_{b=-\infty}^{\infty} \sum_{a=-\infty}^{\infty} A[a] sinc(M\Delta t\ (f - \frac{b}{\Delta t} - \frac{a}{P\Delta t})) e^{i(-\pi M\Delta t)(f - \frac{b}{\Delta t} - \frac{a}{P\Delta t})} \Biggr|_{f = \frac{k}{N\Delta t}} \\
= \sum_{b=-\infty}^{\infty} \sum_{a=-\infty}^{\infty} A[a] sinc(M\Delta t\ (\frac{k}{N\Delta t} - \frac{b}{\Delta t} - \frac{a}{P\Delta t})) e^{i(-\pi M\Delta t)(\frac{k}{N\Delta t} - \frac{b}{\Delta t} - \frac{a}{P\Delta t})} \\
= \sum_{b=-\infty}^{\infty} \sum_{a=-\infty}^{\infty} A[a] sinc(k - Mb - La) e^{i(-\pi)(k - Mb - La)}
$
$k - Mb - La$ is a function of only integers, so it itself is an integer. $sinc(f)=0$ for all integer $f$ except $sinc(0)=1$, so the summation term is only possibly nonzero when $k - Mb - La = 0$, or $a = \frac{k - Mb}{L} = \frac{k}{L} - Pb$. $A[a]$ is nonzero only for integers $a$; $Pb$ is an integer, so that leaves $\frac{k}{L}$ needing to be an integer, or $k$ being a multiple of $L$.
$
= \sum_{b=-\infty}^{\infty} A[\frac{k}{L} - Pb] sinc(0) e^{i(-\pi)(0)} \\
= \sum_{b=-\infty}^{\infty} A[\frac{k}{L} - Pb] (: \frac{k}{L} \in \mathbb{Z})
$
In this special case, the $\frac{1}{M}$-scaled DFT reflects the FT (or rather the Fourier Series coefficients $A[a]$ ) much more directly; you don't need to zero-pad or deal with windowing effects. One sampled period ($L=1$) is fine; more periods ($L>1$) increases the frequency resolution $\frac{1}{N\Delta t}$, but that only adds points where $k$ is not a multiple of $L$ and the DFT is $0$. Aliasing still occurs because you're still sampling a continuous signal.
This special case isn't very practical when sampling a signal because you often don't know the period of a continuous signal to align your sampling. (Some people make the mistake of trying to repeat their discrete sample to represent the continuous signal; this introduces errors if sampling was not perfectly aligned.) However, if you're constructing a frequency spectrum to represent a periodic signal, the inverse DFT can be used to get full periods of the sampled signal in the time domain.
Comment: Hi, I just wanted to let you know that I found this answer helpful for my purposes, and your answer helped me to find a really nice resource by Trefethen which I'll drop here for anyone's future reference. (Goes into a lot of the same stuff as you did.)

https://people.maths.ox.ac.uk/trefethen/pdetext.html


UNIX password expiration time setting

Question: Where and how exactly I can set the expiration time of password of users i.e.the time after which the UNIX OS prompts user after giving some warnings that your password will expire with in n days and then expire the user's password?
Comment: What flavor of Unix?
Answer: Maybe you want to take a look at the chage command.
chage -l john

Last password change                                    : May 22, 2007
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

Comment: chage is not working on ksh
man chage
No manual entry for chage
Comment: Yes, sorry. I just know it from Debian.
Answer: It is not part of the Unix standard, and is completely different depending on what OS you are using, and if you are using some sort of directory service. If you want to know you need to specify what OS you are using, and if it is Linux you probably need to specify what distro.
Comment: Louis, I am using linux,and I need to configure such setting that the passwords for all users will expire after a definite time.
Comment: @Sachin, Louis asked that you state what distro you're using. From what I understand this feature is not a standard on UNIX/Linux systems but may be available on some Linux distro. So let us know which one you're using.
Comment: @Helen, I knew this is not a part of standard , but this is some what I need to conmfigure so as to achieve the automatic password expiration facility and thus to ensure the security.
Comment: can you please list your distro -- preferably the output of `cat /etc/issue`
Answer: But you need to use the passwd command with the maxdays and warndays set:
e.g. passwd --maxdays 10 --warndays 5 user

would set the maxdays between password changes as 10, and give 5 days warning.
EDIT: So if you have a list of usernames in a text file one per line then the following might work:
cat usernamelist | while read $a; do passwd --maxdays 10 --warndays 5 $a; done

Comment: This work well if I am the user, what if I need to do it for all users and I am not the uder but the admin.
Comment: No, this will *only* work if you are root.

UNIX password expiration time setting


Formulation of acceleration in general

Question: I know that in fluid dynamics, we use Lagrangian description of acceleration. That is, a material derivative $$\frac{dv}{dt}=\frac{\partial v}{\partial t}+(v\cdot\nabla )v  .$$ My question is can we use the same formulation for rigid body kinematics because it seems quite general and if we can, why don't we see it being used anywhere in classical mechanics?
Comment: See: https://en.wikipedia.org/wiki/Spatial_acceleration and links therein
Answer: In most classical mechanics problems, the velocity $v$ of a particle is usually a function of $t$ exclusively. If it were to be a function of both $t$ and its position vector $\vec{x}$, then $v=v(t,x,y)$. (In the 2D case, of course)
To find $\frac{dv}{dt}$, we can apply the chain rule, which results in:
$$\frac{dv}{dt}=\frac{\partial v}{\partial t}+\frac{dx}{dt}\frac{\partial v}{\partial x}+\frac{dy}{dt}\frac{\partial v}{\partial y}$$
This is the same as the expression you provide. The second and third terms are usually zero in problems that are commonly studied.
Answer: In rigid body dynamics there is the concept of spatial acceleration $ \vec{\psi} = \dot{\vec{v}}$ as well as material acceleration $\vec{a}$. This is the Lagrangian description. The two are related as $$ \vec{a} = \vec{\psi} + \vec{\omega} \times \vec{v} $$
Consider a moving rigid body, and at some instant a point A riding on the body has position $\vec{r}_A$, as well as the center of mass C with position $\vec{r}_C$.

Material acceleration of $\vec{a}_A$ is the acceleration of the particle of mass A as it moves about. Its transformation law to the center of mass is $$\vec{a}_C = \vec{a}_A + \vec{\alpha} \times (\vec{r}_C-\vec{r}_A)+\vec{\omega}\times (\vec{v}_C-\vec{v}_A) $$
Spatial acceleration of $\vec{\psi}_A$ is the acceleration of whatever mass particle happens to pass under the fixed location defined by $\vec{r}_A$ (where A is now). Its transformation law to the center of mass is $$\vec{\psi}_C = \vec{\psi}_A + \vec{\alpha} \times (\vec{r}_C-\vec{r}_A)$$
You can prove the above once you define the spatial accelerations from the material accelerations.
$$\matrix{\vec{\psi}_A = \vec{a}_A - \vec{\omega} \times \vec{v}_A \\ \vec{\psi}_C = \vec{a}_C - \vec{\omega} \times \vec{v}_C}$$
Spatial acceleration transforms similarly with velocities and torques. It is thus used in the equations of motion (in spatial form) to simplify the transformations from location to location. From now on don't think of particles of mass moving, but of fixed locations in space.

I am skipping the vector decorations from now on
Formulation
Consider the equations of motion at the center of mass
$$ \begin{bmatrix}F\\
M_{C}
\end{bmatrix}=\begin{bmatrix}m\\
 & I_{C}
\end{bmatrix}\begin{bmatrix}a_{C}\\
\alpha
\end{bmatrix}+\begin{bmatrix}0\\
\omega\times I_{C}\omega
\end{bmatrix} $$
We formulate the spatial equation of motion by using $$\begin{bmatrix}a_{C}\\
\alpha
\end{bmatrix}=\begin{bmatrix}\psi_{C}\\
\alpha
\end{bmatrix}+\begin{bmatrix}\omega\times v_{C}\\
0
\end{bmatrix}$$ to arrive at
The equation of motion of rigid body with spatial notation
$$\begin{bmatrix}F\\
M_{C}
\end{bmatrix}=\begin{bmatrix}m\\
 & I_{C}
\end{bmatrix}\begin{bmatrix}\psi_{C}\\
\alpha
\end{bmatrix}+\begin{bmatrix}\omega\times & \\ v_{C}\times
 & \omega\times
\end{bmatrix}\begin{bmatrix}m\\
 & I_{C}
\end{bmatrix}\begin{bmatrix}v_{C}\\
\omega
\end{bmatrix}  $$
 Note that $v_C \times m v_C =0$ and thus $F = m a_C + v_C \times (m v_C)$.
 Also $\omega\times$ and $v_C \times$ are the 3×3 skew symmetric matrix cross product operator (see note below also).
The above is easier to deal with because all terms transform from location to location using standard linear transformation rules. For example formulating the equations of motion at a point A away from the center of mass is complex in vector form. But in spatial form it is easier because we follow the simple rules below:
$$ \begin{bmatrix}v_{C}\\
\omega
\end{bmatrix}=\begin{bmatrix}1 & -[c\times]\\
 & 1
\end{bmatrix}\begin{bmatrix}v_{A}\\
\omega
\end{bmatrix}$$
$$\begin{bmatrix}\psi_{C}\\
\alpha
\end{bmatrix}=\begin{bmatrix}1 & -[c\times]\\
 & 1
\end{bmatrix}\begin{bmatrix}\psi_{A}\\
\alpha
\end{bmatrix}$$
$$\begin{bmatrix}F\\
M_{C}
\end{bmatrix}=\begin{bmatrix}1\\
-[c\times] & 1
\end{bmatrix}\begin{bmatrix}F\\
M_{A}
\end{bmatrix}$$
 Note: $[c\times]$ denotes the 3×3 skew symmetric cross product operator for the vector $c = r_C-r_A$.
The equations of motion at a point not at the center of mass are:
$$\begin{align} \begin{bmatrix}F\\
M_{A}
\end{bmatrix} & =\begin{bmatrix}m & -m[c\times]\\
m[c\times] & I_{C}-m[c\times][c\times]
\end{bmatrix}\begin{bmatrix}\psi_{A}\\
\alpha
\end{bmatrix} \\ & +\begin{bmatrix}\omega\times\\
v_{A}\times & \omega\times
\end{bmatrix}\begin{bmatrix}m & -m[c\times]\\
m[c\times] & I_{C}-m[c\times][c\times]
\end{bmatrix}\begin{bmatrix}v_{A}\\
\omega
\end{bmatrix} \end{align}$$
The above is often condensed into $$ \hat{f}_A = {\rm I}_A \dot{\hat{v}}_A + \hat{v}_A \times {\rm I}_A \hat{v}_A $$

$\hat{f}_A$ is the 6×1 spatial loading (called a force wrench).
$\hat{v}_A$ is the 6×1 spatial velocity (called a velocity twist).
$\dot{\hat{v}}_A$ is the 6×1 spatial acceleration (called an acceleration twist).
${\rm I}_A$ is the 6×6 spatial inertia matrix (with includes the parallel axis theorem in the lower right 3×3 block).
$\hat{v}_A\times$ is the spatial derivative operator (similar to the vector $\dot{\vec{A}} = \vec{\omega} \times \vec{A}$)

Spatial Form of Newton-Euler Laws of Motion
The equations of motion can be explained from the spatial momentum $\hat{\ell}_A = {\rm I}_A \hat{v}_A$ and the extension to Newton's law:
$$\hat{f}_A = \frac{{\rm d}}{{\rm d}t} \hat{\ell}_A = \frac{{\rm d}}{{\rm d}t}( {\rm I}_A \hat{v}_A )$$
The spatial derivative of momentum is
$$ \frac{{\rm d}}{{\rm d}t} \hat{\ell}_A = \frac{\partial}{\partial t} \hat{\ell}_A + \hat{v}_A\times \hat{\ell}_A$$
$$\hat{f}_A = {\rm I}_A \dot{\hat{v}}_A +  \hat{v}_A \times {\rm I}_A \hat{v}_A$$
References
 - Newton-Euler combined equations of motion
 - Spatial Acceleration
Comment: Look at a point on a rotating disk (with constant rotational speed). The velocity under the fixed location remains constant, even though each mass particle is under centripetal acceleration. The spatial acceleration is simply $\psi = \dot{\omega} \times r = 0$ whereas the material acceleration is $a = \dot{\omega} \times r + \omega \times \omega \times r \neq 0 $
Comment: thanks for your reply.I sought of understand your reply. Basically,material acceleration is the total derivative whereas spatial derivative is partial derivative with respect to space.In a normal circulation motion.you will get the spatial acceleration by removing the centripetal force. Am i coreect? Also,can you suggest some link,video or books for additional in depth knowledge?@ja72
Comment: Spatial acceleration is the partial with respect to time. If you held a magnifying glass over a fixed point in space, the spatial acceleration is the acceleration of whatever material happens to be visible in the lens. In fluids steady flow has zero spatial acceleration because at any point the velocity is fixed.

Formulation of acceleration in general


Are MacBook Pro's two GPUs used simultaneously?

Question: Apple's top end MacBook Pro comes with both Intel and Radeon. Are both used simultaneously?
Answer: No.

The weak one is used to preserve battery.
The stronger one is used for performance.

Use gfxCardStatus to control this behavior, or let OS X do it itself:
Answer: Depends on the situation: The Intel is used for Desktop purposes for energy purposes while the Radeon is used for Graphics and Games for performance purposes. They aren't used simultaneous like SLI...

When you need more performance for things like playing 3D games, editing HD video, or even running CAD software, the 15- and 17-inch MacBook Pro models automatically switch to discrete AMD Radeon graphics that let you see more frames per second and experience better responsiveness.
— Apple - MacBook Pro - Performance - Up to 3x quicker on the draw. And the render.

Dependent on your OS, you can switch the behavior.


Is there an equivalent of "drush dl pathauto --select" using "composer require module" name?

Question: Coming from drush 7. I used to install modules using "drush dl module_name --select" and I get a list of module versions I can select to download. Is there an equivalent for this for drupal 8/9 when using compose require to download modules? Currently I need to goto the module page name and copy the composure require line.
Answer: No.
But, you can use the "show" subcommand to show all available versions.
example:
<code>composer show drupal/module_name --available
</code>
Comment: Tried, im not getting the syntax correct: composer show pathauto/package --available -- tried a bunch of other combinations.
Comment: What is `pathauto/package`? I think you mean `drupal/pathauto`. What I wrote above was a fake example name for a package, the way you wrote module_name above. I will update the answer because of that confusion.


Does the ecliptic precess? Does the Sun's rotation precess?

Question: We know that the Earth, like a top, slowly precesses as it rotates. We know the Sun rotates, but does it precess as well? What about planetary orbits? Is the orientation of the ecliptic stable or will its inclination change over time? If so, would the orbital inclinations of the planets currently in the ecliptic change independently or in unison? We know the ecliptic is inclined with respect to the galactic plane. Would that have been a consequence of "residual" angular momentum when the solar system formed, or did it gradually take up its present orientation?
Comment: Related: https://astronomy.stackexchange.com/a/19594/16685
Answer: As you mentioned, the Earth's rotational axis undergoes a slow precession. This results from tidal torques caused largely by the Sun and the Moon. There would be no precession if the axial tilt with respect to the orbital angular momentum vectors was zero or if the Earth was spherical.
The Sun is almost spherical it's oblate to about $10^{-6}$, and is almost perfectly aligned with the ecliptic, it has a relatively slow rate of rotation, and all of the bodies that might cause a precession are far from the Sun, and because the gravitational gradient torque is an inverse cube relationship. All of these factors combined means the precession rate of the Sun is ridiculously small. So the short answer to your question is:
<code>Yes, the Sun precesses.
</code>
Planetary orbits are a little different, I'm not exactly sure how to state the process for their precession without waving my hands about the room, so I won't attempt it. However, I will say that, as all things in the universe, I am sure the ecliptic is a dynamic system unto itself.
About the ecliptic (dashed line) and the galactic plane (spotted strip) see the attached image.

If the ecliptic and the galactic plane were aligned, the two would line up on top of one another, as the Sun's and other planet's paths would be roughly the same path.
There is still residual angular momentum within the solar system, which is how we arrived at our current orientation amongst the stars.


Sum of independent random variables having exponential tails

Question: Suppose $X_1, X_2,\dots, X_n$ are iid random variable,$P(X_i=-\infty)$ is allowed,$P(X_i>v)< e^{-v}\forall v>0$, $X$ is distributed as $X_i$, if $c$ is  a finite real number such that $E(X)<c$, then show that there is $A>0, r<1$ such that $P(X_1+\dots+X_n>nc)< Ar^n\forall n$. Can apply Chernoff or Hoefding bound here, to apply do I need to know what distribution $X_i$ is following? I am a bit confused. what is the role of $X$ here? Thanks for helping.
Comment: you seem to really mean $P(X_i=-\infty)>0$ , then the prob you want is bounded by the probability that you haven't seen -infinity yet, which is of the right form.  . But then of course E(X) = $-\inf$.
Answer: By the Markov--Bernstein inequality (incorrectly referred to as Chernoff's)
\begin{equation}
 P(X_1+\dots+X_n\ge nc)\le e^{-tnc}Ee^{t(X_1+\dots+X_n)}
 =e^{-tnc}(Ee^{tX})^n=e^{ng(t)}
\end{equation}
for real $t\ge0$, where
\begin{equation}
 g(t):=-tc+\ln Ee^{tX}.
\end{equation}
The condition $P(X_i>v)< e^{-v}\ \forall v>0$ implies $Ee^{tX}<\infty$ and hence $\frac d{dt}\,Ee^{tX}=EXe^{tX}\in\mathbb R$ for real $t<1$. So, $g(0)=0$ and $g'(0)=-c+EX<0$, whence $g(s)<0$ for some real $s>0$. We conclude that
\begin{equation}
 P(X_1+\dots+X_n\ge nc)\le r^n,
\end{equation}
where $r:=e^{g(s)}\in(0,1)$, as was desired.


how do i access and interact with DOM objects from VB.net

Question: say i load a page via WebBrowser.document class, I want to literally "click" elements in the DOM using VB.net programmatically. I dont want to use the classic WebRequest class.
how can i do this ?
Answer: The HtmlDocument class in the System.Windows.Forms namespace doesn't help?
There might not be representations of every element type in the DOM in the System.Windows.Forms namespace, but each element has a DomElement property which is the reference to the unmanaged COM interface.
You can then cast those to the appropriate interfaces imported from MSHTML to work with the DOM in any way that you choose.


Installing Ubuntu and accessing NTFS drive

Question: I have two drives (C: , D:)  and both are formatted with NTFS.
I have installed Windows 8.1 on the C drive and stored important files on D:.
I want to install Ubuntu along side of Windows 8.1 by making a partition on C drive.
After making a partition and installing Ubuntu, will I be able to access the D drive in Ubuntu or will have have an issue with the fact that it is in NTFS format?
Comment: Yes you can access NTFS drives.
Answer: C: drive is a partition and you will have to install Ubuntu on a different partition.
and
Yes, Ubuntu is capable of accessing and modifying data in NTFS.
Answer: Your C: and D: might be two partitions on a single physical drive or two partitions on different drives. In order to install Ubuntu, you need to have a free partition. You can accomplish this in at least two ways:
(i) either you move your content from D: to C:
(ii) or you create a new partition by resizing one of your existing partitions (in C: or in D:).
You can do (ii) from Windows. In Win 8 right click on My Computer and choose "Manage". A window pops up: choose Disk Management in the nav. bar. Right click on the partition you want to shrink and choose "Shrink Volume". It only allows you to shrink the partition to the extent you don't damage any of the files in it. You get some unallocated space; you may define a new partition in there, if you don't Ubuntu will take care of that. Just don't format it from Windows: Ubuntu can read and write ntfs partitions, but it will format its own partition in ext3 (which in my opinion is far more efficient). Formatting your new partition as ntfs would be just a waste of time. At any rate, Ubuntu will automatically install in the free space or partition.
Three suggestions. First, backup your important files on D: before resizing D: or C:.
Second, check that the new partition will be at least some 50 GBytes.
Third, I'd prefer to shrink a data partition (most likely, D:) instead of the boot one, unless the latter is exceedingly large. If you are going to go on using Windows, you need to have a good amount of free space in it.
And you'll have no trouble at all to access your Windows ntfs partitions from Ubuntu, both from a file manager or from the command line. It takes a single click.
Good luck!
A.


Need some help in creating a query in SQL?

Question: ID|message| UpdateTime| TicketID| StaffID

10008;"Yes, it is!";"2012-04-15 16:15:00";1008;660
10013;"Thanks for swift reply!";"2012-04-15 17:15:00";1008;660

CAn u tell me when I write these 2 queries :
Select MAX(UpdateTime) from TicketUpdate where ticketUpdate.id = 10008;
Select MIN(UpdateTime) from TicketUpdate where ticketUpdate.id = 10008;

The output the same even in my database if have 2 different times.
Can u tell me what could be the problem here?
Comment: Possible dup of your earlier questions http://stackoverflow.com/questions/10192521/need-some-help-in-creating-a-query-in-sql and http://stackoverflow.com/questions/10207362/need-some-help-in-creating-a-query-in-sql
Answer: ID appears to be the unique identifier for this table.  Instead, it looks like you want to use TicketID to find the max and min values per ticket.
For example, to find them for TicketID = 1008:
SELECT MAX(UpdateTime) FROM TicketUpdate WHERE TicketUpdate.TicketID = 1008;
SELECT MIN(UpdateTime) FROM TicketUpdate WHERE TicketUpdate.TicketID = 1008;

Or in one query:
SELECT
  MAX(UpdateTime) AS newest,
  MIN(UpdateTime) AS oldest
FROM TicketUpdate
WHERE TicketID = 1008;

To get the most recent and oldest for every individual TicketID, use a GROUP BY and omit the WHERE clause.:
SELECT
  TicketID,
  MAX(UpdateTime) AS newest,
  MIN(UpdateTime) AS oldest,
FROM TicketUpdate
GROUP BY TicketID

If you query using ID, you will always get the same row since there appears to be only one value for each ID that uniquely identifies its row.


Are open ports dangerous?

Question: I have forwarded port 80 to WAMPServer and 25565 to the MineCraft-server running Bukkit.
Am I vulnerable to attacks. Can hackers attack me if WAMP-server is running or if it is not running, or will it be easier to hack me than if I hadn't opened the port at all? I have tried to learn about how people hack and how to protect myself from it. Do you know where I can read about it?
Comment: In addition to the answer below, you should assess what vulnerabilities exist specifically for WAMP and [Minecraft](http://sixgun.org/blog/2011/minecraft-vulnerability) and make sure you are running latest versions/patches.
Comment: So if the code in the MCServer is completely free of security-holes, then no one just running MineCraftServers on their computers, would be hacker safe? And if you find a vulnerability in the servers code, then you'd be able to hack ALL servers running Bukkit MineCraftServer?
Comment: What I'm saying is that to assess your risk, you must identify your vulnerabilities. These include not only the OS but all services that are directly or indirectly accessible. If there is a hole in MC software, then in all probability yes, those servers running the affected version would be vulnerable until the software is patched or a workaround put in place. There will always be 0-day exploits though which is why Jeff's comments on minimizing your attack surface are on the money.
Comment: Thanks! But I thought that only ONE process/service could listen at a port at one time? And are there more vurnerabilities than the ones potencially made by the softwares running on the server with open ports in to them?
Comment: You're correct, only one process handles a port at a given time. Not sure what I said made it seem otherwise. Trying not to start a discussion - bottom line is you should focus on the ports that are open (accessible via Internet), however a box on the internet should be hardened in part by removing any unnecessary software/services. Yes - If I gain access to your box via a bug in MC, I could potentially escalate my privileges by attacking another service that is not necessarily exposed through the firewall since I'm already on the box.
Comment: You didn't state otherwise, I just removed something before I posted, so it looked a bit odd. So, if you use a vurnability on the server, you could access other services/processes on the server and potencially download your own virus/trojan horse/other code and run it on the server?
Answer:
I have forwarded port 80 to WAMPServer and 25565 to the MineCraft-server running Bukkit. (http://www.bukkit.org/)

I assume that you're talking about forwarding those ports from a router / firewall / NAT box to your own machine rather than forwarding them to some off-site instance. Usually we call this "opening" a port.

Am I vulnerable to attacks. Can hackers attack me if WAMP-server is running or if it is not running, or will it be easier to hack me than if I hadn't opened the port at all?

Yes, you are more vulnerable by running a service than by not running a service. Adding more services increases attack surface. That doesn't mean by that you're vulnerable by definition, but an increased attack surface increases is one of the factors that increases your risk.

I have tried to learn about how people hack and how to protect myself from it. Do you know where I can read about it?

The more time I spend here, the greater resource I find this site to be. I've never found a really good comprehensive guide to how to be secure. There are books like the Hacking Exposed series that talk about a lot of technical aspects to security and some of the mindset. As much as the CISSP might be railed upon, trying to study up for that exposes one to most of the different knowledge domains that a professional should be aware of. I think that reading questions on this site is a great way to learn.
The challenge is that security is a mindset. The technology and even some of the fundamentals of it are an evolving realm. You learn by exposing yourself through trial and error. It is helpful to make as much of that exposure as possible vicarious -- learn from others' mistakes.
Security as an equation works like this:

Decide what you need to offer -- you have a need to provide something with a WAMP server and Minecraft game server.
Limit everything you don't need to offer and do it in depth.

When I say in depth, I mean that only offering those services is a start. Try to make sure that the programming code on your website is written securely. Then, pretend it has been compromised and consider what can happen from there. Is the Apache process prevented by the operating system controls from writing files anywhere? Do you have a method to detect compromise? Keep asking those questions and finding layers of answers so that if you are hacked, you mitigate your risk.
Comment: @RyanM: Most likely. It is possible for the OS to handle things poorly, though. The "Ping of Death" was an OS flaw. I don't know if it would work on closed ports -- a fragmented SYN may or may not have immediately triggered a FIN response. That also leaves ICMP stack vulnerabilities as a possible attack surface. Thus, even a machine with no services exposed can benefit from a firewall. That said, the cost / benefit on fire-walling that machine might not be worth much.
Comment: So the vurnability lies in the programs listening to the ports? I don't know about how you hack, but if someone send a request to the Wamp-server that do something it shouldn't, the hackers could for example run PHP-code on the server to hack me?

In other words: If you have a program listening on port 81, and all it does is output "Hello world!" whenever it get an input, then that would be completely hacker safe?

Thanks! :)
Comment: So is running a computer with NO Firewall and NO services more secure than a firewalled computer with an open port with a running service on that port? I ask because when I first got here I found an older freebsd server we had that had no firewall or packet filter and the answer I got from the sysadmin at the time was 'Well, if no services are running, what's the point?'
Comment: Yes and yes, with the caveat that "yes" means, "Extremely likely, but there's an infinitesimal chance of some edge case."
Comment: Yepp, so this last case with "Hello world!" is the highest security you could get? I mean, are there any holes to cover in the OS for example? Or are you safe if you make a 100 % safe application to handle the requests?
Comment: @50ndr33 See my first comment on this answer -- an OS flaw in handling the network stack can be an issue.
Comment: A few years late, but for what reasons is the CISSP railed upon?
Answer: The open port in itself is not dangerous however the services running on that port might be vulnerable creating a dangerous service security situation. There are a few things to consider:

Every open port opens a new service that could be attacked and abused for malicious reasons.
If the application bound to that port has a security vulnerability then the service (not the port itself) is then dangerous.
Are you performing regular security audits of your services? If not start every service must be 100% free of all security issues. If it is not secure it must not be accessible via the public internet.

If you would like to learn more you can start by reading various questions and answers on this site, you can learn how to perform various types of attacks and utilize various types of exploits, there are many books written on computer security. You have to find the method of learning that works the best for you and stick to it.

Are open ports dangerous?


Film or digital for a hundred hours of footage? Looking at cost and durability

Question: What method would be the most convenient for storing over a hundred hours of footage? Digital looks convenient, but I think backing up that much video can be expensive. My inspiration is Jonas Mekas, who recorded a lot of (mostly) home movies on film, and I'm wondering if film could hold any advantages for me. My biggest concerns are the cost and durability of storage.
Comment: Please describe your project in detail - esp. why 100 hours? Cinema? Home video? Science project? What fps? What resolution in case of digital? What research efforts have you made so far - esp, what are the costs of film rolls where you live? Develop them yourself? I'm 99% sure you have to shoot digital because you underestimate costs of using film and overestimate costs of digital. Also, what's the problem with durability? Just have multiple copies and replace disks after 5-10 years. Tape backups can endure for 30 years and if you upload the files to a datacenter you even have geo-redundancy.
Comment: @Matt You're right, I definitely overestimated the hassle and cost of using digital. 100 hours was a ballpark figure - I just want to film a lot of videos (none of them too long) over the course of a lifetime
Comment: Film has serious challenges around durability - which is why archival onto digital formats for old/valuable film is an ongoing project for many museums
Answer: My general advice is not to worry too much about storage when you are starting. I gathered from the comments that those 100-something hours of video will accumulate over life and this allows to upgrade storage solutions as you go.
Normally you record, edit, probably import other assets, record sound or music, etc. Then you export a video master file (for the archive and to create new delivery files from) and a number of delivery formats right away to publish the video.
The actual capacity you need will also depend on what you keep: all source material or just the end result, like a high-quality masters and maybe a few delivery formats. If you also want to keep all source video files, storage needs depend on what the camera can produce. Cameras targeted for professionals use storage-hungry RAW formats whereas consumer-oriented cameras usually use compressed formats with low storage needs. You will probably start with the latter and won't produce huge files for quite a while.
Since you said you make short videos, I think it's sufficient to buy a 8 TByte disk and it will be enough for a long time. After about 5 or max 10 years, the disk will reach its end of life and can be replaced by a larger one that surely will be cheaper than it is today. For fast editing you can use an SSD where your operating system and video software is installed and where you put the source material for the current video you're editing. So the SSD doesn't have to be that big.
Regarding backups, it's safer to keep at least 2 copies besides the original. For fast access it's best to have a local backup on an external harddisk. To protect yourself against catastrophies, put another copy at a different geographical place, like a friend's house or upload it to a datacenter designed for backups/archiving needs. For a service like Wasabi you'd pay 6 USD per month for 1 TByte. If you use external harddisks they too have to be replaced over time as they degrade. However, since they are used less often, you can replace them at longer intervals. It's good if your backup program can use checksums to check if files on the backup medium have changed (because of bit flips or block read errors). When this happens replace the disk and re-generate a fresh backup using the original or the other backup copy.
Tape backups are another option. If handled well, tapes should stay intact for about 30 years. Tapes are rather cheap, but tape drives not so much. I'd say tape storage makes not much sense in your case since your storage needs will grow slowly over time and you benefit from the cost degredation of harddisks. It has become harder to find a service for tape backups as the trend seems to go to cloud storage solutions.
It's probably worth to re-evaluate backup strategies every 5 to 10 years for cheaper or better solutions. For small projects/businesses it's often best to invest only in the capacity you need for the time being and the next few years and not plan for decades ahead.
That said, filming digitally with a good backup plan should fulfill your cost, durability and convenience requirements.
To give you a glimpse on analog filming: A 400 ft roll of 35mm cost about 300 USD, or 16mm costs 200 USD, Super-8 is sold in small quantities and is therefore even pricier. Those 400ft rolls only enable you to film for a few minutes. Then there are costs for development, and costs for scanning if you want to edit it digitally - and this means you produce digital files anyway and those aren't small either. Finally, you do master prints and have to store all of them in some controlled environment. If treated well the durability is much greater than anything digital. But the archive space costs you. All this is why you won't be able to save money when working with film and it's much less convenient. It's also getting harder to find services that develop and scan the film for you.
Still, it might be fun to make a short analog movie but it would be a costly choice when dealing with large amounts of material.


Need Salesforce sdk.jar file

Question: I am developing a native android mobile app interfacing with salesforce. Can any one point me to where salesforcesdk.jar file is. I see it in the documentation but cant find it.
    I am aware of the github site with the source code and code templates. However I need the jar file
Answer: The Android SDK is now an Android Library project, and as such can't be just included as a jar, it needs to be included as an actual source code project. You'll want to clone the repo and add the relevant projects to your workspace (assuming you're using eclipse)
Comment: Thanks Superfell. i have tried to clone the template project and compile it. I faced a lot of issues. I was finally able to get it to compile , but it gives an exception when i try to invoke. I will give that another try and figure it out.

Need Salesforce sdk.jar file


How to make ALT+TAB switcher icons smaller

Question: Is there any way to reduce the size of the default Ubuntu 13.04 window switcher icons, shown when pressing ALT+TAB? Changing Compiz settings (with a text editor, if not in the CCSM GUI) or installing a different window switcher, for example.
Thank you for your help, have a good day.
Answer: As far as I know...the size of the default "Switcher View (Alt+Tab)" is hardcoded in the Unity source. You can try to edit the source code to change the size according to your needs.

NOTE: I recommend you to do this in a Virtual Machine or in a Test Machine to see if you get the desired results.In this example I'm running Ubuntu 13.04 with unity 7.0.0 and I will change the "Switcher View" (icons, tiles, etc.) to the half-size.

1) Make sure you have enable the Source code repository.

Open the Ubuntu Software Center
In the Menu Bar choose Edit -> Software Sources. Click to enable "Source code repository".
Just in case I use the "Main Server" to Download.

Open a Terminal window Ctrl+Alt+T and type:

sudo apt-get update

2) In the Terminal type the following to install the necessary packages.

sudo apt-get install build-essential python-windowmocker quilt

3) Install build dependencies.

sudo apt-get build-dep unity

4) Create a folder to download the source code.

mkdir ~/Downloads/src

cd ~/Downloads/src

5) Download the source code & Export variables.

apt-get source unity

export QUILT_PATCHES=debian/patches

export EDITOR=gedit

6) Create the patch and Edit the source code.

cd unity-7.0.0daily13.06.19~13.04/

quilt new 99-custon-switcher-size.patch

quilt edit launcher/SwitcherView.cpp

Edit the lines... 46 to 50.

I changed them from:
  , border_size(50)
  , flat_spacing(20)
  , icon_size(128)
  , minimum_spacing(10)
  , tile_size(150)

To:
  , border_size(25)
  , flat_spacing(10)
  , icon_size(64)
  , minimum_spacing(10)
  , tile_size(75)

7) Build the deb packages.

quilt refresh
fakeroot dpkg-buildpackage

8) Install the deb packages.

cd ..

sudo dpkg -i *deb

9) Finally you can Restart your machine to see the changes.
Before:

After:

Hope this helps.
Comment: @Andrew...Well I wrote and step by step so a user can follow it. you can give it a try.
Comment: It's been almost 3 years I've been using Ubuntu. Almost ever since, I wanted to look up how to use the src packages. 3 years I've been procrastinating. Now I have a starting point. **Thank you!**
Comment: Thank you Roman Raguet. Definitely not an operation for a common user. :-)
Comment: @Roman: What happens if I do it and then Ubuntu updates are available and I install them? I think I'll have to install the patch again, is it true? And in this case, do you know how much often that/those packages are updated? Thank you very much.
Comment: @RomanRaguet Please mention fakeroot dpkg-buildpackage will be run with sudo...
Comment: @Shashi if it should be run with `sudo`, why the `fakeroot` then? – So, no, it should not be run with `sudo`.


What Lokas did Arjuna attain after death?

Question: In Svargārohaṇa parva, I heard that Yudhiṣṭhira sees Arjuna with Kṛṣṇa but later, the end of the Mahābhārata characters is explained. Karṇa merges into Sūrya, Kṛṣṇa merges in to Viṣṇu and Yudhiṣṭhira into Yama. My question is, what happened to Arjuna?
Answer: He attained Viṣṇu Loka and was with Kṛṣṇa.

He beheld Govinda endued with his Brahma-form. It resembled that form of his which had been seen before and which, therefore, helped the recognition. Blazing forth in that form of his, he was adorned with celestial weapons, such as the terrible discus and others in their respective embodied forms. He was being adored by the heroic Phālguṇa, who also was endued with a blazing effulgence. The son of Kunti beheld the slayer of Madhu also in his own form. Those two foremost of Beings, adored by all the gods, beholding Yudhiṣṭhira, received him with proper honours.

From Section 4 Svargārohaṇika Parva.
Comment: During suspension period you should not create a new account. If you do so Mods will easily find that out and the ban on your original account will be extended. Just wait for the ban period to end and then you can resume posting with your original account (Fun Life).
Comment: Fun life if you creatre a false account create it ina different name.


How to approach the following problem

Question: Let $f:[0,1]\to\mathbb{R}$ be a continuous function then the maximum value of $\int_0^1 f(x)x^2 \,\text{d}x -\int_0^1x(f(x))^2\,\text{d}x$ for all such function(s) is?
I first thought differentiating it but the limits are not variable so no use then I spent a lot of time thinking over it but literally have no idea how to begin.
Please help.
Answer: Hint:
$$f(x)x^2 -xf(x)^2 = xf(x) ( x-f(x)) $$
Think of $f(x-f)$ as a quadratic in $f$. Complete the square to get $$\frac{x^2}{4} - \left(f-\frac x2\right)^2 $$
So, your integral is $$\int_0^1 \frac{x^3}{4} - x\left(f(x) -\frac x2\right)^2 dx $$
What function $f$ maximizes this?
Comment: @ Tavish thanks a lot for your support.:-)
Comment: @sameedhussain Of course.
Answer: Seems like functioncal calculus to me:
We want to optmize:
$$ g[f] =  \int_0^1  \left[ f(x)x^2 - x f^2 (x) \right]dx$$
Add a peturbation to $g$:
$$g[f+ \epsilon] = \int_0^1 \left[ (f + \epsilon)x^2 - x (f+\epsilon)^2 \right] dx$$
It is easy to find that terms of order $\epsilon$ are:
$$ \epsilon \int_0^1 \left[x^2 - 2 xf \right] dx$$
So, for the minimum condition, this term in bracket must be zero, which makes our function as:
$$  f(x) = \frac{x}{2}$$
Now you can integrate easily
All of this is based on this article that I read

Meta commentary:
This is completely analogous to how if we are a maxima point in single variable calculus , then first order variation is zero. I.e:
$$ f(x+h) = f(x) + h f'(x) + \text{junk}$$
Now, if you are at maxima then $f'(x)=0$ and hence if you increase $h$ by some teeny amount, the function doesn't change much. Similar notion here though more abstract.
Another notion is that, similar to how we neglect term of $dx^2$, we neglect terms of $\epsilon^2$ saying they are tinnier than tiny petrubations.
Comment: Thanks  a lot for another approach to solve the problem.

How to approach the following problem


Taylor Series Clarification

Question: For $\sin(x)$, $e^x$, $\cos(x)$... When we are building the $n$-th taylor polynomial, why is it that we always evaluate the functions first $k$ derivatives at $x=0$? In my textbook when they were deriving the formula for each of those 3 functions, they would always evaluate all the derivatives at $x=0$ but why not at some other value of $x$ that is more general?
Comment: Because one is Maclaurin ($x=0$) and the other is Taylor (general) but the later contains the former.
Comment: You can find it at a different point, for instance $e^{x}$ has the Taylor series at $x=a$ $$e^x = e^a \sum_{k=0}^{\infty}\frac{(x-a)^k}{k!} .$$
Comment: For a lot of series (like $e^{x}$) the $a=0$ choice is convenient because you actually know what that value is.  For example, in science's comment above, if you pick a value other than $a=0$ how do you evaluate the $e^{a}$ term?
Answer: There are at least three answers to this question:

For the functions you list, you don't gain a lot by expanding about another point, because you have identities like
$$ e^x = e^{a+(x-a)} = e^a e^{x-a}, $$
so the Taylor series of $e^x$ about the point $x=a$ is
$$ e^x = \sum_{k=0}^{\infty} e^a \frac{(x-a)^k}{k!}, $$
which has much the same properties as the Taylor series of $e^x$. You can do the same thing with $\sin{x}$ and $\cos{x}$ using the addition formulae like
$$ \sin{(a+(x-a))} = \sin{a}\cos{(x-a)} + \cos{a} \sin{(x-a)}, $$
and you know how to expand those about $x=a$ from your results at $0$.
More generally, it is often useful to expand about a point other than $x=0$. A classic example is the logarithm: $\log{x}$ is not differentiable at $x=0$, but at $x=1$ we do have an expansion, which you may not have noticed because we often write it a different way:
$$ \log{(1+x)} = x-\frac{x^2}{2}+\frac{x^3}{3}+\dotsb $$
The most general answer is that the Maclaurin series of the function is the Taylor series of the translate of a function ($f(x-a)$, basically). Often, when looking at a finite number of terms, it's just easier to deal with a polynomial in $x$

And sometimes, expansions about different points can look quite different. Consider the following series:
$$ 1-x^2+x^4-\dotsb = \frac{1}{1+x^2} \quad (|x|<1) \tag{1} $$
Now consider this series:
$$ \tfrac{1}{2}-\tfrac{1}{2}x+\tfrac{1}{4}x^2-\tfrac{1}{8}x^4+\tfrac{1}{8}x^5-\dotsb. \tag{2} $$
What you don't know about this series is that it's actually the Taylor series of
$$ \frac{1}{1+(1+x)^2}, $$
about $x=0$, so it's also the Taylor series of $(1+x^2)^{-1}$ about $x=1$. (2) looks a lot worse than (1) (you and I would struggle to guess what (2)'s $n$th term is, for one thing), but (using techniques you learn in Analysis courses at university), you can show that (2) actually converges for $|x-1|<\sqrt{2}$, so in a sense it's more useful, because it covers a larger range of possible $x$ values.
Therefore I'd say the normal reason people would give when asked is that there are just some points for which the series is easier to calculate, and this series works for the values of $x$ we're interested in, which is good enough. (In the case of the exponential and sine and cosine, all values of $x$, in fact.)

Taylor Series Clarification


Suggested unsupervised feature selection / extraction method for 2 class classification?

Question: I've got a set of F features e.g. Lab color space, entropy. By concatenating all features together, I obtain a feature vector of dimension d (between 12 and 50, depending on which features selected.
I usually get between 1000 and 5000 new samples, denoted x. A Gaussian Mixture Model is then trained with the vectors, but I don't know which class the features are from. What I know though, is that there are only 2 classes. Based on the GMM prediction I get a probability of that feature vector belonging to class 1 or 2.
My question now is: How do I obtain the best subset of features, for instance only entropy and normalized rgb, that will give me the best classification accuracy? I guess this is achieved, if the class separability is increased, due to the feature subset selection.
Maybe I can utilize Fisher's linear discriminant analysis? Since I already have the mean and covariance matrices obtained from the GMM. But wouldn't I have to calculate the score for each combination of features then?
Would be nice to get some help if this is a unrewarding approach and I'm on the wrong track and/or any other suggestions?
Answer: One way of finding "informative" features is to use the features that will maximise the log likelihood. You could do this with cross validation.
https://www.cs.cmu.edu/~kdeng/thesis/feature.pdf
Another idea might be to use another unsupervised algorithm that automatically selects features such as an clustering forest
http://research.microsoft.com/pubs/155552/decisionForests_MSR_TR_2011_114.pdf
In that case the clustering algorithm will automatically split the data based on information gain.
Fisher LDA will not select features but project your original data into a lower dimensional subspace. If you are looking into the subspace method
another interesting approach might be spectral clustering, which also happens
in a subspace or unsupervised neural networks such as auto encoder.


Can the energy generated through meditation neutralize the covid 19 corona virus?

Question: Many yogis have extraordinary experiences in terms of generating physical and mental energy through meditation. These experiences could be on a broad spectrum, ranging at one end, from a few hours or a few days of being turbo charged with energy and on the other end, as mentioned in our scriptures, to incredible feats of energy performed by saints and enlightened beings. For instance, the Gospel of Thomas verse 106 refers to energy that can move a mountain. The moment of the Buddha's Enlightenment is said to have rocked the universe. At a time when the entire planet is being 'rocked' by a virus, with no vaccine in the foreseeable future, would it be worth our while to collectively shift our focus to build a degree of resistance to the virus through extended hours of meditation whilst in lockdown at home and also to encourage others to do so?
Comment: This is too close to a medical question for my comfort and as such is off topic.
Comment: Well it can make you happily accept the virus :)
Answer: There needs to be a stricter formal policy against magical-thinking types of questions; they tend to get voted down into oblivion, on a know-one-when-I-see-one basis, but that doesn't really explain to people why their questions were banned.
All the health-wealth-sex-love-fame-and-success questions seem to be designed to attract only crank answers; and would have only crank answers, if they weren't promptly closed. Questions about where-can-I-find-a-truly-enlightened-guru-who-can-fix-everything seem to fall into the same category (and seem to attract unfortunate answers from messianic claimants) as well as the questions about how-can-I-physically-levitate-and-read-minds.
Questions of this sort (and the answers they receive) seem to harm the credibility of a site designed for serious academic study of historical Buddhist thought.  And more significantly have the potential to mislead vulnerable people.  People who are inclined to earnestly ask questions like that on a site like this are obviously vulnerable.  Ideally there'd be a bot that would automatically reply to mystical truth-seekers that the Buddhist Sangha doesn't and didn't exist for these purposes, citing scriptural justification from authentic suttas.
While somebody might believe that meditation "should" prevent COVID-19 infection, might feel that one karmically "deserves" to be uninfected, and might attempt to construe certain suttas to support that view... it remains that there is not one known case of meditation preventing COVID-19 infection.  It would be irresponsible in the extreme to suggest that meditation can prevent COVID-19 infection.
Comment: Right, well that's a fair opinion. I find it difficult to generalise though -- i.e. to formulate as a general rule and then follow/implement that rule --  e.g. the site has allowed topics about suicide and all sorts; the site's [Moderation policies for Questions](https://buddhism.meta.stackexchange.com/a/1572/254) is (by its community's request) unusually permissive. So-called "bad" (or confused) questions are ideally an opportunity for good answers. Still, it's quite unusual for there to be two votes-to-close a question (as there are currently), perhaps I should take the hint and close it.
Comment: I hope that this site has been, for whatever reason, mostly free of the kind of question you identify in the second paragraph. But I do think that the site tries to serve two purposes -- "serious academic study of historical Buddhist thought", but also "practical" questions i.e. related to personal practice/understanding/life. Also maybe we should be stricter about answers than about questions -- tolerate "crank" question but less so crank answers. What do you think of the existing answer to this question -- do you see a way to improve that, or a need to delete it?
Comment: Please see this new meta-topic: [Should there be an explicit policy against "Magical thinking" questions?](https://buddhism.meta.stackexchange.com/q/2427/254)
Comment: "The Path of Purification" - Visuddhimagga XXII.46     ( English translation by Bhikkhu Nanamoli - Osbert Moore), refers to the Coupling of Tranquility Power and Insight Power at the Noble Path Moment. This is a Power that leads from a Mundane to a Supramundane Consciousness.  Yogis who practice this meditation generate vast amounts of energy. At a time the planet is in pain due to the corona virus, it is opportune to share our knowledge/experience for the benefit of others. Uni of California (UCLA) has in 2015  reported the mitigating effect of mindfulness meditation on the HIV Aids virus.
Answer:
...to build a degree of resistance to the virus through extended hours of meditation whilst in lockdown at home and also to encourage others to do so?

Actually scientific research on meditation does prove that it reduces stress level and the Cortisol stress hormone, hence giving a boost to one's own immune system. But with that said, during lockdown, one shouldn't just solely do sitting meditation. Don't forget to do some real physical exercises also. That'd make a win-win combo. Stay safe everyone!
Comment: No, and this is very dangerous thinking. It **MAY** increase the robustness of your immune system but you will not be invincible because you sat and focused on your breath for 10 minutes.
Comment: What research are you referring to?
Comment: Lots of them: https://scholar.google.com/scholar?q=meditation+reduces+stress+research+says&hl=en&as_sdt=0&as_vis=1&oi=scholart
Comment: @MB, I never said that meditation absolutely helps one's immune system. But it can't hurt to try and even scientists suggested that: https://www.psychologytoday.com/us/blog/women-autism-spectrum-disorder/202003/3-reasons-meditate-in-the-battle-against-coronavirus
 . Also, that's why I emphasized the need for real physical exercises in my post.
Answer: Metta meditation in times like this might help if I am to speculate, as it generates much positive karma. But there is not definitive that the positive collective karma generated might specifically help with Coronavirus situation as karmic consequences are only truly understood by a Buddha. Nevertheless, if many people can do Metta meditation there will be some positive outcome.
Thought meditation is definitely a worth and good use of one's time spent in lockdown possibly also having a positive impact it is also absolutely necessary to take all needed medical precautions and not doing so would seriously out weight the positive benefits reaped from meditation.
Comment: Besides Metta, Mindfulness Meditation has been scientifically established as a means of mitigating the effect of the HIV Aids virus by the University of California (UCLA). The Chief Abbot of the New York Centre of the Ramakrishna Mission quotes the Buddha, whilst unfolding a fourfold path to mitigate the effects of the virus, in this inspiring discourse, a few days ago, from the current epicenter of the pandemic. https://www.youtube.com/watch?v=vzFtOOVQPmA&t=31s
Answer: It's funny that everyone is so upset by this virus. Did you know that atmospheric pollution kills 9 millions people each year, and harms the quality of life or billions of beings?
Yet nobody lifted a finger. Not to mention that our beautiful planet, and all its ressources, was going down the drain at fast pace.
So to come back to the question, i will give a very personnal opinion. I don't think meditation only can prevent a virus infection. However, from a very long and personnal interest in the relationship between health, mind, emotions, energy, i would say that paying close attention to maintaining a positive mindset, healthy habits, avoiding sources of stress and bad karmas as much as possible will be hugely beneficial toward health and virus resistance.


If you add a 9th to a subdominant IV chord does it make it a dominant chord?

Question: For example, if you have a progression in D major that ends on G, would adding an A to the G chord and losing the 3rd make the chord dominant? You would have the notes G A and D. It certainly sounds like it is functioning like a dominant chord but note sure how or why.
Answer: Chords are not defined simply by the notes in them; rather, they are defined by their musical role. So adding a 9th to a subdominant chord ... it's still a subdominant chord – subdominant is a role.
However, ignoring the original name of the chord, a chord (in the key of D) containing G, A, and D could easily sound like a Dsus (tonic) or an A7sus4 (dominant) depending on the context and harmonic role it plays.
Comment: thanks, your posts are always helpful since I don't always express myself as well as I could and you seem to have a genuine ability to interprete my questions. If I wanted the progression to go from G > A > D (IV V I cadence) but the A doesn't work well with my melody and G does how can I fix this? Well the pull from G to D is not good enough so I kind of see the G with the A note as a hybrid in a sense since you essentially get that root movement which is familiar in the IV V I. This is what I am trying to do and I like this G chord as it harmonizes better with my melody
Comment: So in a sense I am trying to harmonize a melody and make a subdominant chord sound more dominant. THe C# in the A chord is the one that is a problem specifically because my melody used the D note which clashes with the C# of the A chord... I want a chord that will sound dominant that will avoid this m2 dissonance and even though the C# is the leading tone, I still think that the notes G > A to D is kind of familiar  and creates a more satisfying cadence than just IV I.
Answer: Basically, you are hinting at a A7sus4 chord, but the method you describe to get there is the issue.
I think this description...

...add a 9th to a subdominant IV chord...

and this one

...in D major...adding an A to the G chord and losing the 3rd...You would have the notes G A and D.

...are presenting some contradictory ideas that are part of the confusion.
When we start with a IV the fundamental idea is a triad, it's a symbol to represent something in tertian harmony.
But, when thirds of chords are omitted and when then have stuff like G A D as chords we drift into a vague quartal harmony.
G A D could sound like a voicing of A7sus4.
G A D could sound like a voicing of Dsus4.
G A D could sound like a voicing of Gsus2.
Another way to look at it is in D major all three tonal degrees (the tonic, subdominant, and dominant) are G A D. Each of the three tonal chords is represented by two tones from the set of three: D A are root and fifth of I, G D are root and fifth of IV, and A G are root and seventh of V. Notice how all three have their third omitted. You cannot answer the question of which tone is the root through the perspective of a tertian stack of thirds. That is the essential reason for the sort of vague sound of quartal chords.
If you want to have tonal identities like I, IV, V, you will want to treat G A D as containing some kind of non-chord tone, like A7sus4, and look to the voice leading and bass movement for sensible root progressions. The sus4 doesn't necessarily need to resolve, but somewhere in the music should be chords with thirds and voice leading to reinforce the triadic foundation. The point here is that A7sus4 isn't really the bona fide chord. A7 is and the D is a suspension, a displacement of C#.
If the music is filled with quartal stacks, if the voice leading avoids treating certain tones as resolution of dissonance, it might make sense to not use analysis symbols like I, IV, V. For example, in D major, the G stepping down to F# is a strong tonal voice leading move. A7sus4 with the G moving down to F# make a kind of V to I progression which will reinforce a sense of tertian harmony. Avoid such things deliberately to create a quartal sound. If you do something like alternate A D G (a supposed A7sus4) with G D A (a supposed G9 with omitted third), move the bass around while avoiding F# and C#, and you will get a vague quartal/pentatonic sound. At that point tertian chords like I, IV, V don't really make sense. You might just identify a D tonic.
Comment: Hi Michael. Aren't the 3 tonal degrees the 1, 3 and 5 tones? In other words the "stable" tones?
Comment: @armani, using `^` to show scale degrees: `^1 ^3 ^5` are the tonic chord tones, `^1 ^4 ^5` are the tonal degrees, `^3 ^6` and sort of `^7` are the modal degrees. I say "sort of ^7" because it really gets the special name "leading tone" when a half step below tonic or "subtonic" when a full step below tonic. It really different categorically.
Comment: In terms of stability I think the thing to consider is _tonality_ is about the stability/instability of the tonic & dominant chords, so "tonal" and "stable" are not synonymous. Also, `^3` of course determines whether the scale/key is major or minor, which is a _modal_ consideration, so `^3` is _the_ definitive modal degree.
Answer: Adding a 9th does nothing but add a new note to an existing chord and that does not make it dominant.  You have more than one alteration to your chord not indicated in your title.  Namely dropping the 3rd.
You can add the 9th to the IV chord and have a G add 9 = (G B D A).  If you drop the 3rd you have a suspended 2 chord (G A D).  This would most likely occur when resolving to G minor and using a suspended resolution.  The fact is that G is the b7 of A so you may have also created a very slim version of an A11 chord and you could be hearing that along with a tendency to resolve to D.
Answer: No, changing the chord quality via suspending the second of the chord is not going to make it dominant. But with that said, placing that A in the bass would make a strong case for reinterpreting the chord as a different type of dominant chord: [A G D] is nearly [A G B D], which would be G/A or A9sus, a suspended dominant chord. Gsus2 is a fairly ambiguous chord itself, so it could be used in a dominant context in many cases.
This is a specific result that only works because the resulting chord happens to have another interpretation, normally modifying the quality of a chord with extensions, additions, or suspensions does not have an effect on the function of the chord. Usually, those types of modifications can be understood as extra colourful variations on the basic chord quality rather than defining the harmony and its function.
Comment: But even having the notes G > A > D in the inner voice leading are kind of indicating a cadence arent they? Yes the bass is strongest but if you hear this root motion in one of the voices then doesn't the ear hear a cadence IV > V > I albeit more subtle?
Comment: @armani kind of, yes... but I don't follow where you're going with that. Are you stating that the addition of a 9th or other note could carry that "slight indication" of a cadence and thus affect the function?
Comment: I just noticed your comment mentions root motion. But adding/replacing notes in a chord wouldn't have any effect on the root, no? I'm a bit confused on what you're saying here...
Answer:
would adding an A to the G chord and losing the 3rd make the chord dominant? You would have the notes G A and D.

Not really. The main issue is the note D, which clashes with the leading tone, C#. Presence of notes A and D in the same chord suggests the root isn't A.
Some other people suggested it might be interpreted as A7sus4 – yes, maybe, but this doesn't produce a strong dominant feeling.
However, if you picked ii chord Em: E-G-B, which is typically interpreted as a subdominant, and add note A, so that we have Emadd4 (E-G-B-A), in some contexts it could function as a dominant, especially if it resolves to tonic and you resolve G downwards to F#.
It could also work with a chord comprising of G, B and A notes.
Of course lack of note C# makes it weaker dominant than a regular A chord.
Comment: Good points, thank you... unfortunately, the C# is precisely the note I want to avoid in this "dominant" chord. My melody features very prominant use of the D note as I am using a pentatonic scale so this C# is clashing and it needs to go. I know it is the leading tone but essentially I was looking for a chord that could sound dominant via other methods. I know a cadence is strongest when using the leading tone but there are other voice leading techniques that make a cadence sound like a cadence right?
Comment: @armani Yes, relations between the chords are defined by the context, So yes, A7sus4 is a possibility. You can emphasize motion between A7sus4 and D (assuming you want to resolve the dominant) by resolving the 7th (G) downwards to 3rd of tonic (F#). Also it may help to move root of A (A) to root of D (D) – it's tempting to leave it as a common tone, but it would produce less motion.
Comment: @armani Another possibility is subdominant. It still produces some tension with respect to tonic. G, Em7 maybe Bm7 (very weak). You can add dissonance to make the tension stronger, e.g. G9 (containing 7th, F), borrow chords like Bb7, Ebmaj7... Do7?
Answer: A dominant chord is generally made from the root of the dominant note in a key. In key D, the dominant note is 5 - A. Just adding A to a chord can't make that chord dominant. The dominant chord there is A C♯ E, with G added to make it a dominant seventh.There are also secondary dominants, but this is unlikely to be one here. And dominant chords do not have to be followed by the tonic.
The G chord (no 3) with an added A note gives the three notes G A and D. It will either be called Gsus2 (or properly Gret2), or Dsus4. With A as its root (possible), it could be perceived as A7sus, and that's probably where you get the 'dominant' feeling from.
Comment: Yes I think so that the sus7 chord might be what makes it sound like that... what about if you have a G/A... would that sound like some kind of altered dominant A chord?


Android Studio add flutter sdk path in preferences

Question: I just started app programming and I wanted to do so using flutter. But when I want to create a new flutter project, it takes eternal and doesn't finish. Tried all fixed, updating flutter and AS, running AS in Admin Mode (btw I'm using Win 10), creating the project offline, not doing so, reinstalling AS in a folder with a dart-compliant name, but one option I can't try: in the settings for new projects I can't set the standard path of the flutter and dart sdk. If anyone knows how to fix this, or, even better, how to create a flutter project, please describe it step by step, since I'm a complete beginner to app programming
Comment: did you install flutter sdk ?
Comment: Yup, "flutter doctor" reported no issues both from the main and the flutter directory
Answer: Try out this step manually in android studio :
Comment: The options "Flutter" and "Dart" above "Kotlin" are missing in my settings for new projects, as I said
Comment: @VincentGuttmann Okay try Invalidate Cashes/Restart your android studio
Comment: I restarted AS and my PC but nothing changed
Comment: @VincentGuttmann can you please attach some screenshots of which plugin you are installed and also settings of your android studio?
Comment: Which settings specifically? There are a ton of them, so I want to pick the important ones
Answer: Did you follow the guidelines correctly when creating a new Flutter project?
Please follow this link step by step https://flutter.dev/docs/development/tools/android-studio
Comment: I did so until the "Creating Flutter Project" Text showed up. Now I'm once again stuck here. Before I also tried to create a project not from the "Welcome"-Screen but from the editor itself. Same result.
Answer: One solution was just running the flutter create command. Although it kind of worked offline, I finally decided to create the flutter project online. Afterwards I opened it in AS without a problem or missing/corrupted files (so the issue should be with AS and flutter together). And even if it's kind of a workaround, it worked for me.
This is what I typed in the console:
flutter create --pub --no-offline --with-driver-test --template=app --description="Your description here." --org="yourdomainhere" --project-name="your_project_name_here" C:\src\flutter\flutter_projects\your_flutter_project

Answer: For those viewing this question in 2021 and onwards, you need to do the following to get Flutter (version 2) to work in Android Studio (version 4<) on Windows.

Download and extract the Flutter SDK. See https://flutter.dev/docs/get-started/install/windows
Include path/to/flutter-sdk/bin in your path (System Properties -> Environment Variables)
Install the flutter plugin in Android Studio
Create a project and provide the SDK path (without /bin at the end)


How do I delete duplicate contacts on device with Google Contacts (Android)?

Question: I am using Google Contacts app on my Android phone. I have hundreds of contacts stored on device, which I do not want to store in my Google account. After importing some contacts, I now have many duplicate contacts. How do I remove the duplicates, using Google Contacts?
Answer: Sadly, the Google Contacts app does not offer a way to easily remove duplicates from the contacts stored only on the device. There are apps available on the Google Play store that promise to do this, but none of them are reputable, so if you don't want to share your contacts online, you may not want to use these apps.
If you want to remove duplicates from contacts that are stored online in your Google accounts, you can follow these instructions:

On your Android phone or tablet, open the Contacts app .
At the top left, tap Menu and then "Merge and fix".
Tap "Merge duplicates". If you don't get this option, you don't have any contacts that can be merged.

You can move the contacts stored on your device to your Google account, if you want. When I tried this, Google Contacts only found a couple of the duplicate contacts at first, it did not find the majority of them. But a day later, the Google Contacts app found all of them.