I just wanna display the name of who gain max salary at the department select first_name from(select max(e.salary),e.department_id from employees e group by e.department_id)

Table:   UserId, Value, Date.   I want to get the UserId, Value for the max(Date) for each UserId. That is, the Value for each UserId that has the latest date. Is there a way to do this simply in SQL? (Preferably Oracle)  Update: Apologies for any ambiguity: I need to get ALL the UserIds. But for each UserId, only that row where that user has the latest date.


The entire comment thread to  was deleted. Can anyone with admin rights see the old thread? [Edit And explain why it was deleted?]  Edit 2 Moving up comments from below: For context, the discussion had stopped, and all of it was clarifying questions about my answer. Plus, isn't there a way for mods to close comments without deleting them? (Someone below suggested moving the comment thread to chat?)  Edit 3 I should be clear about why I care. Given the environment around here recently, and how the culture of the meta community has been portrayed by SE staff, when I see an inexplicable deletion like this, I wonder if an SE employee is intentionally trolling. I've seen this happen in other online communities when management changes happen, and the community is devalued.  Edit 4 A few people have been pointing out reasons why comments, and entire comment threads, sometimes get deleted. It's useful information. That said, the question remains, why weren't the other comment threads on that page touched? Shouldn't there be some consistency about when deletion happens? Inconsistent application of discretionary actions could provide cover to bad-actors, no?   Edit 5 This question got flagged as a possible duplicate of  This is not a question about how comments in general are handled. This is a question about why this particular comment thread was handled in an irregular way. In particular:   The How do comments work? FAQ suggests that "obsolete or chatty comments" are generally the comments that are deleted. The comments in this comment thread were not chatty, and were still pertinent to the answer being commented on. A couple people have pointed out that the nature of meta.stackexchange.com lends itself to longer comment threads. Anyone that browses active questions on this site will see considerable value in the comments of those questions and corresponding answers. So, on this site in particular, does the community feel comments are really just "post-it notes" that should be considered temporary? One of the participants in the comment thread chimed in below, and mentioned that one of the later comments in that thread was flagged. It seems the entire comment thread was nuked out of expediency, because the moderator didn't have the time or patience to review that thread, and didn't seem to just want to delete the flagged comment by itself. Is this something the community thinks makes sense? Worthwhile discussions could easily be destroyed by a handful of trolls in this way.

Across the Stack Exchange network you may leave comments on a question or answer.  How do comments work? What are comments for, and when shouldn't I comment? Who can post comments? Who can edit comments? How can I format and link in comments? My comment doesn't contain some of the text I typed in it; why? My comment appears to be long enough, but I can't post it because it's too short; why? Who can delete comments? When should comments be deleted? Why can't I comment on specific posts even if I have enough reputation to comment? When can comments be undeleted? What are automatic comments? How can I link to comments? Anything else I should know about comments?  Also see the FAQ articles on  and .


I have a list of many 2-tuples.  I would like to split the list into two lists, one list consisting of the first elements of all the tuples in the list, and the other list consisting of the second elements of all the tuples. I wonder how to do that efficiently? Thanks!  For example, I have a list y:  >>> y = [('ab',1), ('cd', 2), ('ef', 3) ] >>> type(y) <type 'list'>   I hope to get two lists ['ab', 'cd', 'ef'] and [1, 2, 3].

I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item.  For example:  original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4])   Is there a builtin function that does that?


So for instance, the sentence 'I myself am called James' is not different to 'I am called James', information wise.  As a comparative measure, take the sentences, which make use of reflexive pronouns 'I cooked eggs for myself' vs 'I cooked eggs for her'. Here, different information is conveyed, because whilst the object is the same, the subject is different.  But the sentence 'I herself am called James', 'I her am called James', or 'her myself am called Alice', does not make sense, because the object can't be two different things at once.  Note: I've just thought that 'he himself cooked eggs' could imply that only he (whoever he is) cooked eggs, and only him alone. However, I don't think it necessarily means so, where 'he alone cooked eggs', would. Any thoughts on this would be much appreciated.

I'm confused by why people use the following:     It's up to yourself.   Rather than:     It's up to you.   Another example of this would be:     Please feel free to contact ourselves if you have any problems.   Rather than:     Please feel free to contact us if you have any problems.   Are both of these correct?  Is there any reason for using the former?


Let $$L=\lim_{n\to\infty} \frac{1^n+2^n+\cdots+n^n}{n^n}.$$ If we write: $$L=\lim_{n\to\infty}\left[\left(\frac1n\right)^n+\left(\frac2n\right)^n+\cdots+\left(\frac nn\right)^n\right].$$ Then this doesn't help due to the fact that as $n\to\infty,$ each of the individual terms $\left(\frac1n\right)^n, \left(\frac2n\right)^n,\ldots$ is of the form $0^{\infty}$ or equivalently $0×\infty$ excet for the last term $\left(\frac nn\right)^n=1^n=1.$ But later I realized that if we write: \begin{align} L&=\lim_{n\to\infty} \frac{n^n+(n-1)^n+(n-2)^n+\cdots+1^n}{n^n}\\\\ &=\lim_{n\to\infty} \left[1+\left(1-\frac1n\right)^n+\left(1-\frac2n\right)^n+\cdots+\left(\frac1n\right)^n\right]\\\\ &=1+e^{-1}+e^{-2}+\cdots,\text{ as }n\to\infty\text{ so number of terms is surely infinite}\\\\ &=\frac1{1-e^{-1}}\\\\ &\color{red}{=\frac{e}{e-1}.} \end{align} I don't know the exact answer. Tried Wolfram Alpha but it says that the input is wrong. I'm confused now. Is my approach correct? If yes, is there any other way to show the same.. Please help! Thanks in advance.

I can show that the following limit exists but I am having difficulties to find it. It is $$\lim_{n\to \infty} \sum_{k=1}^n \frac{k^n}{n^n}$$ Can someone please help me?


From the  subsection of the Wikipedia article on :     The phase displacement between the two AC supplies is usually 30° and is realised by using converter transformers with two different secondary windings (or valve windings). Usually one of the valve windings is star (wye)-connected and the other is delta-connected. With twelve valves connecting each of the two sets of three phases to the two DC rails, there is a phase change every 30°, and harmonics are considerably reduced. For this reason the twelve-pulse system has become standard on almost all line-commutated converter HVDC systems, although HVDC systems built with mercury arc valves usually allowed for temporary operation with one of the two six-pulse groups bypassed.   I've looked at  and  answer, but I'm not familliar with the terminology or notation of phasor diagrams and their use in transformer winding connections.  Is there a simple way to explain how a star (wye)-connected and delta-connected set of windings can provide a phase change every 30°? How does this produce twelve equally-spaced pulses per cycle?  Image: "12 pulse bridge with thyristor valves" from .

I'v heard that a delta/delta or Wye/Wye transformers do not make any phase shift. In delta/wye or wye/delta transformers, There is a 30 degrees phase shift between the primary and secondary coils. So, Why is  there a phase shift ? and Why is it 30 degrees ?.. Why not 60 or 120 ?  I googled and I found calculations with phasor diagrams that proves the 30 degrees phase but I'm confused because of too many calculations and diagrams, I didn't get it.  Would you give me a simple answer, please ? and I prefer the physical meanings and concepts rather than equations and mathematics.  Thank you very much,


I have set up a new Ubuntu 20.04 VM in Virtual Box. When using apt-get update or apt-get upgrade I always end up getting hash sum mismatches for some of the packages. I tried all of the solutions suggested for similar questions such as apt-get clean rm -rf /var/lib/apt/lists/*  I also tried to compute the hashes for the respective files myself. However, I always received the correct hashsum that apt says it would expect. (What I did is compute hashsums via sha256sum for the files stored in /var/cache/apt/archives/partial. Apt seems to store the corrupted files here, all with a file name extension .FAILED) I don't understand why I receive the correct hash sum manually while apt seems to compute a wrong one. I hope someone can suggest a solution for this problem. Thank you for your help.

When running apt full-upgrade or apt update I'm getting several logs that are more or less the same as this one, where there is an identical filesize, SHA1 and MD5 but different SHA256:   E: Failed to fetch store:/var/lib/apt/lists/partial/jp.archive.ubuntu.com_ubuntu_dists_focal_main_binary-amd64_Packages.xz  Hash Sum mismatch    Hashes of expected file:     - Filesize:5826751 [weak]     - SHA256:af226b4496cbb524bd4814d102047ae77769836203274dffc91cb543d5da13cc     - SHA1:aef5c36ce45bd5c3154a1bb03c62b6cfb33e2bc6 [weak]     - MD5Sum:7ef83228ec207df10acac48fbdd81112 [weak]    Hashes of received file:     - SHA256:e2c7fc5a2d86f75f03612fec614dcf84d3d502976558fbe40928c1dd120bb05e     - SHA1:aef5c36ce45bd5c3154a1bb03c62b6cfb33e2bc6 [weak]     - MD5Sum:7ef83228ec207df10acac48fbdd81112 [weak]     - Filesize:5826751 [weak]    Last modification reported: Thu, 23 Apr 2020 16:40:26 +0000    Release file created at: Thu, 23 Apr 2020 17:33:17 +0000   Whereas others have the same MD5, but different SHA1 and SHA256:   E: Failed to fetch http://jp.archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-headers-5.4.0-29_5.4.0-29.33_all.deb  Hash Sum mismatch    Hashes of expected file:     - SHA256:edde13dcd52c51e2404d37731948d491e6e215b22f599239326809754f8d5633     - SHA1:3e46354d6aaa92f82d5392a80f6b72c3fcc78a91 [weak]     - MD5Sum:4ccf38c666c836f29fc3602314de47b9 [weak]     - Filesize:10936232 [weak]    Hashes of received file:     - SHA256:9af606f85850ba3010ac8743f62dca91bbef3e5e60da5a7df62dac53eb5a4fb7     - SHA1:61c842d896676ac9af0fef9f9f48bc4a3c39cce6 [weak]     - MD5Sum:4ccf38c666c836f29fc3602314de47b9 [weak]     - Filesize:10936232 [weak]    Last modification reported: Thu, 30 Apr 2020 08:23:38 +0000    This problem is similar to what is asked , and indeed I tried several of the solutions offered there (and elsewhere) but they did not help. However I am wondering specifically about why the SHA-1 and MD5Sum are identical, and only SHA256 is different. Does this mean that there is a security problem somewhere along the line? Or is my system reading SHA256 incorrectly? Something else?  Thanks


Long story short, I installed ubuntu while I was watching netflix and feeling very lazy, and may have lost all my windows 7 files.  Quick summary:    -Windows 7 was installed on Legacy bios and I installed ubuntu on UEFI bios -ubuntu installer didn't detect any other OS on my computer and wanted to write over the disk, so I had to manually edit the partition    -Despite repeated warnings about partitioning windows in the ubuntu installer, I did this anyway, assigning 140 gigs to ubuntu and 500 to windows Now, my computer won't boot into anything but Ubuntu  -in Gparted, it still shows that I have two partitions, and windows 7 boot loader -However, I can't boot into the non-linux partition, and boot loader says I need a recovery disk.  My question is does anyone know if what I've done is fixable? I'm hoping that I can fix it using the way outlined in this thread:   Thanks for the help everyone!  Note: gparted shows:    Foudn linux image: /boot/vmlinuz - 3.13.0.30 - generic   Found linitrd image: /boot/initrd.img - 3.13.0 - 30 - generic   Found linux image: /boot/vmlinuz - 3.13.0 - 24 generic   Found  initrd image: /boot/initrd.img - 3.13.0 - 24- generic   memtest   memtest   Found windows 7 (loader) on /dev/sda1

I installed Ubuntu yesterday alongside Windows 7 and whenever I start my computer I don't have the option to boot Windows. When the computer starts it goes straight to Ubuntu without giving me an OS selection menu. When it goes to Ubuntu it gives me Ubuntu repair options and Ubuntu normal start option. I still have all of the Windows 7 files on my hard drive, but Windows 7 has no way to boot.


EDIT: following the instructions on , I attempted to remove my old/unused kernels but could not. It looks like there's not enough space for the operation, what do I do?  Output of ls /boot/:  abi-4.2.0-42-generic         initrd.img-4.4.0-57-generic abi-4.4.0-45-generic         lost+found abi-4.4.0-47-generic         memtest86+.bin abi-4.4.0-51-generic         memtest86+.elf config-4.2.0-42-generic      memtest86+_multiboot.bin config-4.4.0-45-generic      System.map-4.2.0-42-generic config-4.4.0-47-generic      System.map-4.4.0-45-generic config-4.4.0-51-generic      System.map-4.4.0-47-generic grub                         System.map-4.4.0-51-generic initrd.img-4.2.0-42-generic  vmlinuz-4.2.0-42-generic initrd.img-4.4.0-42-generic  vmlinuz-4.4.0-45-generic initrd.img-4.4.0-45-generic  vmlinuz-4.4.0-47-generic initrd.img-4.4.0-47-generic  vmlinuz-4.4.0-51-generic initrd.img-4.4.0-51-generic   Output of dpkg -l linux-image-\* | grep ^ii  ii  linux-image-4.2.0-42-generic       4.2.0-42.49  amd64        Linux kernel image for version 4.2.0 on 64 bit x86 SMP  ii  linux-image-4.4.0-45-generic       4.4.0-45.66  amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP  ii  linux-image-4.4.0-47-generic       4.4.0-47.68  amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP  ii  linux-image-4.4.0-51-generic       4.4.0-51.72  amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP  ii  linux-image-extra-4.2.0-42-generic 4.2.0-42.49  amd64        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP  ii  linux-image-extra-4.4.0-45-generic 4.4.0-45.66  amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP   However, when I run sudo apt-get purge linux-image-4.2.0-42 linux-image-4.4.0-45, I get the following messages:   gzip: stdout: No space left on device E: mkinitramfs failure cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-4.4.0-47-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 dpkg: error processing package linux-image-extra-4.4.0-47-generic (--remove):  subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing:  linux-image-extra-4.4.0-47-generic E: Sub-process /usr/bin/dpkg returned an error code (1)   Am I doing something wrong?  ORIGINAL:  I've been getting space errors whenever I try to upgrade, and on the dist-upgrade I tried just now I got the following errors:  gzip: stdout: No space left on device E: mkinitramfs failure find 141 cpio 141 gzip 1 update-initramfs: failed for /boot/initrd.img-4.4.0-51-generic with 1. run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1 dpkg: error processing package linux-image-extra-4.4.0-51-generic (--configure):  subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing:  linux-image-extra-4.4.0-47-generic  linux-image-extra-4.4.0-51-generic E: Sub-process /usr/bin/dpkg returned an error code (1)   The output of df is:  Filesystem                   1K-blocks     Used Available Use% Mounted on udev                           1787060        0   1787060   0% /dev tmpfs                           361572    10496    351076   3% /run /dev/mapper/xubuntu--vg-root 236014344 38503396 185499020  18% / tmpfs                          1807848      172   1807676   1% /dev/shm tmpfs                             5120        4      5116   1% /run/lock tmpfs                          1807848        0   1807848   0% /sys/fs/cgroup /dev/sda1                       240972   227218      1313 100% /boot tmpfs                           361572       36    361536   1% /run/user/1000   and the output of uname -r:  4.4.0-51-generic   I've tried several things based on solutions offered to some of these errors individually, but I haven't had any luck yet.  Thank you sincerely for any help!

My /boot partition is nearly full and I get a warning every time I reboot my system. I already deleted old kernel packages (linux-headers...), actually I did that to install a newer kernel version that came with the automatic updates.  After installing that new version, the partition is nearly full again. So what else can I delete? Are there some other files associated to the old kernel images?  Here is a list of files that are on my /boot partition:  :~$ ls /boot/ abi-2.6.31-21-generic         lost+found abi-2.6.32-25-generic         memtest86+.bin abi-2.6.38-10-generic         memtest86+_multiboot.bin abi-2.6.38-11-generic         System.map-2.6.31-21-generic abi-2.6.38-12-generic         System.map-2.6.32-25-generic abi-2.6.38-8-generic          System.map-2.6.38-10-generic abi-3.0.0-12-generic          System.map-2.6.38-11-generic abi-3.0.0-13-generic          System.map-2.6.38-12-generic abi-3.0.0-14-generic          System.map-2.6.38-8-generic boot                          System.map-3.0.0-12-generic config-2.6.31-21-generic      System.map-3.0.0-13-generic config-2.6.32-25-generic      System.map-3.0.0-14-generic config-2.6.38-10-generic      vmcoreinfo-2.6.31-21-generic config-2.6.38-11-generic      vmcoreinfo-2.6.32-25-generic config-2.6.38-12-generic      vmcoreinfo-2.6.38-10-generic config-2.6.38-8-generic       vmcoreinfo-2.6.38-11-generic config-3.0.0-12-generic       vmcoreinfo-2.6.38-12-generic config-3.0.0-13-generic       vmcoreinfo-2.6.38-8-generic config-3.0.0-14-generic       vmcoreinfo-3.0.0-12-generic extlinux                      vmcoreinfo-3.0.0-13-generic grub                          vmcoreinfo-3.0.0-14-generic initrd.img-2.6.31-21-generic  vmlinuz-2.6.31-21-generic initrd.img-2.6.32-25-generic  vmlinuz-2.6.32-25-generic initrd.img-2.6.38-10-generic  vmlinuz-2.6.38-10-generic initrd.img-2.6.38-11-generic  vmlinuz-2.6.38-11-generic initrd.img-2.6.38-12-generic  vmlinuz-2.6.38-12-generic initrd.img-2.6.38-8-generic   vmlinuz-2.6.38-8-generic initrd.img-3.0.0-12-generic   vmlinuz-3.0.0-12-generic initrd.img-3.0.0-13-generic   vmlinuz-3.0.0-13-generic initrd.img-3.0.0-14-generic   vmlinuz-3.0.0-14-generic   Currently, I'm using the 3.0.0-14-generic kernel.


in a program that takes a character and prints the equivalent ASCII value.  ASCII value for the space bar is: '32'.  but if i press the space bar then the enter key, program still waits for an input, and doesn't get the space bar character recognized.  #include <iostream>  using namespace std;  int main() {     char ch;       cout << "Enter the character: ";     cin >> ch;      cout << "ASCII code is: " <<(int)ch << endl;       return 0;   }

I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter).  Also ideally it wouldn't echo the input character to the screen. I just want to capture keystrokes with out effecting the console screen.


I am trying to determine if that the set, $T$, of all eventually constant sequences of natural numbers is countable.   My intuition: The set $T$ is countable. . Let $T_j$ denote the set of sequences of natural numbers so that $t_i=t_j$ for all $i>j$. If we can show that $\mathbb{N}^k$ for all $k\in\mathbb{Z}^+$ is countable, then the union $$T=\bigcup_{j\in\mathbb{N}}T_j$$ is countable as a countable union of countable sets is also countable.  Is my intuition correct?

another question here to see if I'm on the right track. Here is the problem that I have been proposed.   Determine if the set $H$ of all functions $f:Z_+\rightarrow Z_+$ that are eventually constant is countable.   Here is my solution.   I claim the set $H$ is countable. By definition, we say that $f$ is eventually constant if there is a positive integer $N$ such that $f(n)=c,\textrm{c a constant,}\ \forall\ n\ge N.$ Let $F$ be a set containing some $f:Z_+\rightarrow Z_+.$ Let $$H=\bigcup_{n\in\mathbb{Z_+}}F_n=\{f:Z_+ \rightarrow Z_+ |f\in F_n\ \textrm{for at least one}\ n\in Z_+\}.$$ Since $H$ is an arbitary union of sets, we can define a function $g:Z_+\rightarrow H$, where $g$ is an indexing function of $H$ and $Z_+$ is the index set given. Since $g$ is an indexing function, this implies that $g$ is surjective. By  Theorem 7.1, which states if $H$ is a nonempty set and there is a surjective function $f:Z_+ \rightarrow H$ then $H$ is countable, we have that $H$ is countable as claimed.


Let $A$ be a complex $3 \times 3$ matrix with $A^3 = -I$. Which of the following statements are correct?   $A$ has three distinct eigenvalues. $A$ is diagonalizable over $\mathbb{C}$. $A$ ls triangularizable over $\mathbb{C}$. $A$ is non-singular.   If we take $A = -I$, then $A^3 = -I$ and has eigenvalues as $-1, -1, -1$. so option $1$ is incorrect. Since $A$ is not equal to $0$, $A$ is non-singular and also option $2$ and $3$ are correct. Hence option $2, 3$, and should be options. Is it correct?

Let $A$ be a complex $3\times 3$ matrix such that $A^3=-I$, then we need to find out which of the following statements are correct?   $A$ has three distinct eigenvalues; $A$ is diagonalizable over $\mathbb{C}$; $A$ is triangulizable over $\mathbb{C}$; $A$ is non singular.   Wll, from minimal polynomial approach I have deduced that all are correct as minpoly has to be $x^3+1$ am I right?


I have a very basic question about passing a value type by reference in c#. why c# doesn't allow us to pass a variable by reference if its not initialized? what will be the issue if we do it? lets take for example below code public static void main() {    int i;    SomeMethod(ref i); }  public static void SomeMethod(ref int i) {    i = 10; }  why cant i execute this method? why compiler is stopping me from doing this? what issue will be faced if we pass a unassigned variable as reference?

I'm creating a function where I need to pass an object so that it can be modified by the function. What is the difference between:  public void myFunction(ref MyClass someClass)   and  public void myFunction(out MyClass someClass)   Which should I use and why?


For example I have a variable config in config.py. I want to use the variable config in main.py. And the config.py must be pass to main.py through command line. like follows:  python ./main.py ./config.py   I know in lua I can use dofile function. How can I do this in Python  Fixed by

I'm writing a Python application that takes as a command as an argument, for example:  $ python myapp.py command1   I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like:  myapp/     __init__.py     commands/         __init__.py         command1.py         command2.py     foo.py     bar.py   So I want the application to find the available command modules at runtime and execute the appropriate one.  Python defines an __import__ function, which takes a string for a module name:     __import__(name, globals=None, locals=None, fromlist=(), level=0)      The function imports the module name, potentially using the given globals and locals to determine how to interpret the name in a package context. The fromlist gives the names of objects or submodules that should be imported from the module given by name.       Source:    So currently I have something like:  command = sys.argv[1] try:     command_module = __import__("myapp.commands.%s" % command, fromlist=["myapp.commands"]) except ImportError:     # Display error message  command_module.run()   This works just fine, I'm just wondering if there is possibly a more idiomatic way to accomplish what we are doing with this code.  Note that I specifically don't want to get in to using eggs or extension points. This is not an open-source project and I don't expect there to be "plugins". The point is to simplify the main application code and remove the need to modify it each time a new command module is added.


I have working NFS (Networking File Sharing). It's server path will be mounted, but attempts to use umount are not working. It is getting some error.  $ sudo umount /nfs_server/     /nfs_server was not found in /proc/mounts     /nfs_server was not found in /proc/mounts   How can I solve this?

When mounting an NFS share manually using mount and a path of the form <domain/ip>:<path>/<path> or <domain/ip>:/<path>/<path>, umount fails to find the path in /proc/mounts, despite the fact that the path is in fact listed in /proc/mounts.  This is the same problem as in this question:   Steps to reproduce:  # mount --version mount from util-linux 2.24.1 (libmount 2.24.0: debug, assert) # mkdir mountpath # mount 192.168.2.101:/devices mountpath # umount mountpath /home/.../mountpath was not found in /proc/mounts # grep mountpath /proc/mounts 192.168.2.101://devices /home/.../mountpath nfs4 rw,[snip],addr=192.168.2.101 0 0   How can I unmount this mount?


Trying to install origin thin setup on a fresh windows 10 install. I got theses errors: The code execution cannot proceed because MSVCP140.dll was not found. Reinstalling the program may fix this problem.  The code execution cannot proceed because VCRUNTIME140.dll was not found. Reinstalling the program may fix this problem.

I don't know how that happened. I was installing Battlefield 1 and now I can't even start Origin. I am getting "MSVCP120.dll is missing from your computer" (same for MSVCR120.dll).   I have installed  for x86 and x64 but I'm still getting this message.   What am I missing?


Is it possible to move the legend of the pie-chart under the figure instead of having it on the side? Moreover, how can I label and add a caption for each piechart?  I want to piechart one next to each other as the one show below:  \documentclass{article} \usepackage[margin=0.5in]{geometry} \usepackage[utf8]{inputenc} \usepackage{textcomp} \usepackage{eurosym} \usepackage{pgfplots} \pgfplotsset{width=10cm,compat=1.9} %\usepgfplotslibrary{external} %\tikzexternalize \usepackage{verbatim} \usepackage{pgf-pie} \usepackage{tikz} \usepackage{subfigure}  \begin{document} \begin{tikzpicture}   \pie [rotate = 180]     {62/\TeX\ Live and Mac\TeX,      32/MiK\TeX\ and Pro\TeX t, 6/Other \TeX}       \pie [rotate = 180]     {60/\TeX\ Live and Mac\TeX,      34/MiK\TeX\ and Pro\TeX t, 6/Other \TeX} \end{tikzpicture}   \begin{tikzpicture} \tikzset{lines/.style={draw=white},} \pie[color={purple, red, yellow, blue, green},sum=auto, after number=,text=legend,every only number node/.style={text=black},style={lines}]{10/A,20/B,30/C,10/D} \pie[pos={8,0},color={purple, red, yellow, blue, green},sum=auto, after number=,every only number node/.style={text=black},style={lines}]{10/,20/,30/,10/}  \end{tikzpicture}    \end{document}

I'm new to LaTeX and need some help with my figures. I would like to to put small numbers outside the pie slices without making a mess. Having found this thread , I tried it out, but didn't get all the way through with it. Right now, my pie looks like this:    I used the following code:  \usepackage{tikz,stackengine} \makeatletter  \tikzstyle{chart}= [legend label/.style={font={\scriptsize},anchor=west,align=left}, legend box/.style={rectangle, draw, minimum size=5pt}, axis/.style={black,thin,->}, axis label/.style={anchor=east,font={\tiny}}]  \tikzstyle{bar chart}=[ chart, bar width/.code={     \pgfmathparse{##1/2}     \global\let\bar@w\pgfmathresult}, bar/.style={thin, draw=black}, bar label/.style={font={\bf\small},anchor=north}, bar value/.style={font={\footnotesize}}, bar width=.75,]  \tikzstyle{pie chart}= [chart, slice/.style={line cap=round, line join=round, thin, draw=black}, pie title/.style={font={}}, slice type/.style 2 args={     ##1/.style={fill=##2},     values of ##1/.style={}}]  \pgfdeclarelayer{background} \pgfdeclarelayer{foreground} \pgfsetlayers{background,main,foreground}  \newcommand{\pye}[3][]{     \begin{scope}[#1]         \pgfmathsetmacro{\curA}{90}         \pgfmathsetmacro{\r}{1}         \def\c{(0,0)}         \node[pie title] at (270:1.3) {#2};         \foreach \v/\s in{#3}{             \pgfmathsetmacro{\deltaA}{\v/100*360}             \pgfmathsetmacro{\nextA}{\curA + \deltaA}             \pgfmathsetmacro{\midA}{(\curA+\nextA)/2}             \path[slice,\s] \c             -- +(\curA:\r)             arc (\curA:\nextA:\r)             -- cycle;             \pgfmathsetmacro{\d}{max((\deltaA * -(.5/50) + 1) , .5)} %%%              %\pgfmathprintnumberto{#3}{\fnum}  %\ifthenelse{\lengthtest{#3 pt < 10pt}} %{\path (O) -- ++ (\midangle:\radius) %node[inner sep=0,align=left,anchor=west,rotate=\midangle](nums#3)    {~~\fnum};} %{\path (O) -- ++(\midangle:\innerpos)  %node {\scalefont{#3}\beforenumber\fnum\afternumber};}           %%%                         \begin{pgfonlayer}{foreground}                 \path \c -- node[pos=\d,pie values,values of \s]{$\v\%$} +    (\midA:\r);             \end{pgfonlayer}             \global\let\curA\nextA}     \end{scope}}  \newcommand{\legend}[2][]{     \begin{scope}[#1]         \path         \foreach \n/\s in {#2}         {++(0,-5pt) node[\s,legend box] {} +(2pt,0) node[legend label]     {\n}};     \end{scope}}      \begin{document}         \begin{center}      \begin{figure}[H]     \centering \begin{tikzpicture} [pie chart, slice type={A}{black!0}, slice type={B}{black!10}, slice type={C}{black!20}, slice type={D}{black!30}, slice type={E}{black!40}, slice type={F}{black!50}, slice type={G}{black!60}, slice type={H}{black!70}, pie values/.style={font={\small}}, scale=2]  \pye{1994}{6.1/A, 2.9/B, 0.2/C, 54.3/D, 25.2/E, 1.4/F, 6.7/G, 3.2/H} \pye[xshift=2.2cm,values of coltello/.style={pos=1.1}]% {2005}{6.8/A, 3.0/B, 0.5/C, 52.3/D, 25.6/E, 1.8/F, 7.1/G, 2.8/H} \pye[xshift=4.4cm,values of caffe/.style={pos=1.1}]% {2015}{7.2/A, 3.1/B, 0.6/C, 50.6/D, 26.5/E, 2.3/F, 7.5/G, 2.2/H}  \legend[shift={(0cm,-1.5cm)}]{{A}/A, {B}/B}  \legend[shift={(1.4cm,-1.5cm)}]{{C}/C, {D}/D}  \legend[shift={(2.8cm,-1.5cm)}]{{E}/E, {F}/F} \legend[shift={(4.2cm,-1.5cm)}]{{G}/G, {H}/H} \end{tikzpicture} \end{figure}  \end{document}   This looks quite the way I want it to, only the small numbers should be placed outside the pies.  Thanks in advance :)


I would like to be able to pass the type into a generic method where I only know the name of the type.  I want to do something like the following, but I am getting an error.  var type = typeof(name); var result = MyGenericMethod<type>();   Is this possible?  Currently I am doing a switch statement, but this is less than ideal as I need to update each time I need to add a new class.  switch (name) {     case "TypeName1":         result = MyGenericMethod<TypeName1>();         break;     case "TypeName2":         result = MyGenericMethod<TypeName2>();         break;     ... }

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


how do i center the limits for multiple sum like what we usually  do for integral ,,, in other way, is there command like \idotsint for sum?  for example:  \sum\cdots\sum\limits_{n_1^2+n_2^2+...+n_N^2<\lambda}

I have a question on how to have the following in an equation.   Here is some working code to start with:  \documentclass[12pt]{article}  \begin{document}  \begin{equation} P(X)=\sum_{X\in A}\cdots \sum \end{equation}  \end{document}


I want to sort a dictionary by value in reverse order. For example: [Red: 2, Blue: 45, Green: 100] to print Green 100, Blue 45, Red 2  Thanks

I have a dictionary of values read from two fields in a database: a string field and a numeric field. The string field is unique, so that is the key of the dictionary.  I can sort on the keys, but how can I sort based on the values?  Note: I have read Stack Overflow question here  and probably could change my code to have a list of dictionaries, but since I do not really need a list of dictionaries I wanted to know if there is a simpler solution to sort either in ascending or descending order.


I came across this interesting question,it is as follows: a complex number $z$ satisfies the equation $|z^2-9| + |z^2| = 41$ and we are required to find the locus of $z$ and maximum value of |z| my approach: one of the easiest but very lengthy method is $z= x +iy$ putting this into the equation, squaring both sides and equating real and imaginary parts = 0, I finally obtained $|z+3| + |z-3| = 10$ and it is easy to see that $\max (|z|) = 5$. however we wanted to know if there is an easier and more convenient method to solve this question .kindly help us out.

If the complex number Z satisfies $ |Z^2 - 9| + |Z^2| = 41 $ then the true statements among the following are ? $A)$ $|Z+3| + |Z-3| = 10$ $B)$ $|Z+3| + |Z-3| = 8$ $C)$ Maximum value of $|Z|$ is $5$ $D)$ Maximum value of $|Z|$ is 6  (More than one option may be correct)  The inital equation in the question indicates the fact that the locus of $Z^2$ is an ellipse with foci at $0$ and $9$. But this doesn't help much. If we put $Z = x + iy$ and simplify. We get an ellipse in $Z$. I get $99y^2 + 63x^2 = 1600$ (but I may be incorrect). How do I proceed from here to validate any of those options? There seems to exist a much simpler way to solve this question. All help will be appreciated.


I've been desperately searching for a book I loved on every level that I read when I was at school (20 odd years ago).  I've asked the local librarians, Google, you name it I've looked (even thought of calling my old schools to see if they would have my library record).   The few bits of memory I have of this book are that it was set on an Earth where the stars were blocked out by some other interstellar race with a veil or bubble of some kind.  The main character feels that this veil/bubble may have been put in place due to their fear of what the human race was capable of and often makes references to personal nano-tech upgrades and quotes the dollar price. I think it was about a detective or a guy who was trying to look for someone/something and used these devices on a nano scale to find them.

I am trying to remember title (and author) of best sci-fi book i have ever read (at least thats what my fading memory tells me).  Plot revolves around multiple-universe theories - set on earth, 'hero' is given a brain implant that allows him to decide which future he wants to exist in (eg: coin toss produces 2 universes - one where it is heads, one tails) - he can 'choose' which of the 2 possible futures to take. The unchosen future is destroyed or disappears somehow(?).  Hero is tasked with finding a young girl who has same ability but can do it without implant. Plan is to find and kill her because the effect of her decisions (and now his) are affecting whole universe and aliens have wrapped solar system in some kind of event horizon to cut us off from universe until we sort out the problem.  Cant remember any real specifics; - lots of action (tech, guns etc), bladerunner-ish. Read it around 1990-5.  Googling hasnt got me anywhere but title potentially something like "sphere of influence. 2150"  If i can find this book, i will be eternally grateful.


Let's say I have 3 sample means: $\bar{x}$, $\bar{y}$, $\bar{z}$ with sample sizes $n_1 = n_2 = n_3$ and standard deviation $s_1$, $s_2$, $s_3$. I know how to find the distribution of the difference in sample means: $E(\mu_{\bar{x}} - \mu_{\bar{y}}) = \mu_x - \mu_y$ with standard error $\sqrt{\frac{s_1^2}{n_1} + \frac{s_2^2}{n_2}}$. Would the distribution of the sum in sample means have the same distribution, except that $E(\mu_{\bar{x}} + \mu_{\bar{y}}) = \mu_x + \mu_y$? Also, I'm interested in obtaining the distribution of the sum of three sample means. I assume the mean would be $E(\mu_{\bar{x}} + \mu_{\bar{y}} + \mu_{\bar{z}}) = \mu_x + \mu_y + \mu_z$, but what about the standard error? Sorry if this doesn't make sense. I'm trying to apply some stats to my work and not sure how to go about. Thank you!

I have a monthly average for a value and a standard deviation corresponding to that average. I am now computing the annual average as the sum of monthly averages, how can I represent the standard deviation for the summed average ?  For example considering output from a wind farm:  Month        MWh     StdDev January      927     333  February     1234    250 March        1032    301 April        876     204 May          865     165 June         750     263 July         780     280 August       690     98 September    730     76 October      821     240 November     803     178 December     850     250   We can say that in the average year the wind farm produces 10,358 MWh, but what is the standard deviation corresponding to this figure ?


I am using bootstrap to show modal box. When the user chooses the select option value I just call the jQuery to show the specific modal box.   Like below:  $(document).on('change','#apply',function () {    if($(this).val() == 1 ) {       $('#update').modal("show");    } else if ( $(this).val() == 2 ) {       $('#delete_ticket_booking').modal("show");    } });   The HTML code of select looks like this:  <select name="apply" class="form-control full-width" id="apply"> <option value="">--Action--</option> <option value="1">Confirm</option> <option value="2">Delete</option> </select>   Now, for example: when the user chooses the confirm option it's showing the confirm modal box.   Again If the user chooses the confirm option then it's showing nothing.   I need to show that modal box again when user click on the confirm option!  How can I do this?

I have an input form that lets me select from multiple options, and do something when the user changes the selection. Eg,  <select onChange="javascript:doSomething();">   <option>A</option>   <option>B</option>   <option>C</option> </select>   Now, doSomething() only gets triggered when the selection changes.  I want to trigger doSomething() when the user selects any option, possibly the same one again.  I have tried using an "onClick" handler, but that gets triggered before the user starts the selection process.  So, is there a way to trigger a function on every select by the user?  Update:  The answer suggested by Darryl seemed to work, but it doesn't work consistently. Sometimes the event gets triggered as soon as user clicks the drop-down menu, even before the user has finished the selection process!


I am implementing a web listener class and want to listen to POST requests. @RestResource(urlMapping='/MyListener/*') global with sharing class ListnerClassTest {     @HttpPost     global static String makeAction (String ID, String Value) {         return 'Got it!';     } }  When I make POST requests to this class, I am getting 401 unauthorized error. Can someone help me how to expose my class for apps to make post request without oauth or authentication.Thanks for the help.

I found a different question asking, "" which led to a  explaining how to setup a public site to expose a REST API:   Create your REST API in Apex as normal Create a public site Configure the public user to have access to the Apex class and any other sObjects   I followed the directions and have a publicly available site, but when I do a GET to the URL the site returns a HTTP 503 error page. My understanding is that shouldn't even be routed through the VF handler.  Webservice code:  @RestResource(urlMapping='/helloWorld/*') global class RestWebservice {    @HttpGet   global static String helloWorld(){     return 'HelloWorld';   }  }   URL being queried: https://chale1-developer-edition.na14.force.com/services/apexrest/helloWorld  I have tried:   Turning on debug logs for the public site user, but that didn't help as no logs recorded the error.  Verified no redirects are configured With and without a header for Accept: application/json Tried on two different dev orgs, on different instances   Answers to questions:   I have not built any apps in this org, nor are there any installed packages, so there are no namespaces Trying /services/apexrest/helloWord/blah returned the same response Most of the raw response is just HTML. The headers have content-type of text/html, X-Powered-By: Salesforce.com ApexPages, P3P: CP="CUR OTR STA", cache-control, and nothing else of note   Eventually I would like to have a webhook use this API which is why it needs to be public. What else could cause the service to return a 503?


While reviweing one suggested edit, I found out this:    The popup says that I've edited 492 edits and still needs 8 edits to get copy editor badge. This information is not correct since I already have earned this badge. Is this a known issue?

When hovering over the badge progress in the review queue, one is able to see his progress towards the badges of a particular review type, as well as Civil Duty, Electorate and Copy Editor. Now, I have the Copy Editor badge on my SO account, however it's progress in the review queue looks like this:   which is wrong since it shows the wrong number.


Is there a master list anywhere of all the RSS feeds provided by Stack Exchange across their network?  Is there a master RSS feed that will show the most recent questions and answers across the entire network instead of just for one site?

I know about finding the RSS feed icon at the bottom of any "Top Questions" page, giving access to , , ,  &  questions feeds. I also know that you can get RSS feeds from tags such as  and even construct searches with . Also, I have  that you can get  and by inference a full , and even , but I don't know what other user related feeds are available. As far as I can tell, Stack Exchange only supports the  and the  just returns the same as the hot questions feed. Also, Stack Exchange doesn't appear to support user feeds, which is a shame as that . So, to summarise what feeds I can identify so far:  http://stack exchange site/feeds ( ) http://stack exchange site/feeds/featured ( ) http://stack exchange site/feeds/hot ( ) http://stack exchange site/feeds/week ( ) http://stack exchange site/feeds/month ( ) http://stack exchange site/feeds/tag/tag ( ) http://stack exchange site/feeds/tag/tag1+tag2 ( ) http://stack exchange site/feeds/tag/tag1+or+tag2 ( ) http://stack exchange site/feeds/tag/tag1+-tag2 ( ) http://stack exchange site/feeds/tag?tagnames=tag&sort=newest ( ) http://stack exchange site/feeds/tag?tagnames=tag&sort=featured ( ) http://stack exchange site/feeds/tag?tagnames=tag&sort=hot ( ) http://stack exchange site/feeds/tag?tagnames=tag&sort=votes ( ) http://stack exchange site/feeds/tag?tagnames=tag1+tag2 (+an optional &sort= term) ( ) http://stack exchange site/feeds/tag?tagnames=tag1+or+tag2 (+an optional &sort= term) ( ) http://stack exchange site/feeds/tag?tagnames=tag1+-tag2 (+an optional &sort= term) ( ) http://stack exchange site/feeds/user/user id ( ) http://stack exchange site/feeds/user/user id/responses ( ) http://stack exchange site/feeds/question/question id ( ) https://stackexchange.com/feeds/questions ( ) https://stackexchange.com/feeds ( )  While the following inferred possible RSS feeds don't work:  http://stack exchange site/feeds/votes ( ) https://stackexchange.com/feeds/user/user id ( )  So, what other RSS feeds are available? So far I have been unable to find any canonical list of what is available, just the occasional meta post containing partial information. So far there have been no responses to  while the  references a question which is no longer appears relevant (as far as I can see).


With the following code, I try to plot 12 different histograms in one picture using Matplotlib.   for graph in range(1,13):     name = all_results[graph-1]     plt.subplot(4,3,graph,                  title = name)     plt.tight_layout()     current_model = name     plt.hist(all_val_accuracies[current_model],              #range = (0.49, 0.58),              bins = 50)     plt.xlabel('Accuracy')     plt.ylabel('Frequency')     plt.axis([0.48, 0.58, 0, 50])   With this code, all histograms are plotted in one image as how I indicated it.     What can I do so that these 12 histograms are plotted in one image and that each histogram can be seen clearly?

How do you change the size of figure drawn with Matplotlib?


looking to install a mail server on a ubuntu server. I already have a web server running on it (apache/php/wordpress) But I am looking to also have a mail server. As I understand it I need to add MX records set up postfix for SMTP and dovecot for POP3 and IMAP.    My main question is, is it possible to install an email server on top of that?  Do I have to run the mail server with a second instance of apache or nginx?  Any tips for accomplishing this if at all possible?  Thank you

My VPS is running Ubuntu, and I'd like to be able to receive email to my domain.  How do I easily set up a mail server to do this?


I have a search bar and a table below it which has a select all option. The Select All function works fine but when I search something in the search bar and then Click on the Select All button, nothing happens. I am not able to figure out why is it so?  Here is my code for Select All function      function selectUnselectchkAllProcessedOrders() {     debugger     $("#chkAllProcessedOrders").click(function () {         var checked_status = this.checked;         $("input[name='fulfillmentOrderId']").each(function () {             this.checked = checked_status;              if (checked_status)                 $(this).parent().parent().addClass('greanBackGround');             else                 $(this).parent().parent().removeClass('greanBackGround');         });      }); }   when i click the Select All checkbox after clicking the search button, i can see using debugger that when the selectUnselectchkAllProcessedOrders() function is called, this.checked is undefined.  Here is the cshtml

                                      Order Number	                                      <input type="text" id="TextBoxFullFillmentOrderNumber"  />	                                      <input type="submit" name="ButtonSearch" value="Search"  />                     <input type="hidden" name="posearchorderno"  id="posearchorderno" />                     <input type="hidden" name="search" value="some" />

     }

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


There are two imaginable plurals of number one:   numbers one  number ones   The resources I found on internet say that number ones is the correct plural.   Why is it so? Is there a more general rule from which this is deductible? I would understand it if the first noun (number) would have a function of an adjective, such as in race car. However here the first noun sounds to me as the main noun, with one as a kind of an adjective. Hence I would feel more logical to pluralize number rather than one.  As @CarlWitthoft noted in his answer, what confuses me is that as the software programmer I feel very natural to use sentences like "the table contains three numbers one", "the string contains three characters/digits one".  For me as a mathematician and software programmer one is clearly a kind of a type of a number, not the opposite. So I don't think this question is primarily about "pluralizing noun phrases", but rather about what is the head of the noun phrase number one.

Question regarding plurals: Let's say I own a restaurant, and each day I feature two new soups. Are these soups called soups of the day? or soup of the days?  Then, let us say my restaurant only features one soup of the day, and I need two bowls of it... do I also call "please get me two soups of the day"?  Would I then get a snarky remark from some college bound cook that we only feature one soup of the day?  Please help clarify, and note that I am most familiar with the Chicago Manual of Style


I'm new to Blender, and wanted to try out making a quick Shader. The tutorial I'm following calls for a Diffuse BSDF node, however: When I create a new material, both the BSDF and the default Material output nodes are missing. Does anyone know why this might be happening?

I have been following  tutorial until I started adding nodes. The problem is that he has completely different nodes than I have. Even nodes that are created at start are different (I have Material and Output and he has Render Layers and Composite). Have I missed something or should I use different nodes than he?


I have a list of module names in an array. I would like to import all these modules from an already imported class.  It seems like I can't use from TestModule __import__(name)  How can I do that? Here is what I have:  import MainModule arr = \     ['Module1', 'Module2', 'Module3', 'Module4', 'Module5'] for string in arr:      # Use FROM  to import the sub classes somehow      from MainModule __import__(string)   Of course Python won't allow me to do that.

I'm writing a Python application that takes as a command as an argument, for example:  $ python myapp.py command1   I want the application to be extensible, that is, to be able to add new modules that implement new commands without having to change the main application source. The tree looks something like:  myapp/     __init__.py     commands/         __init__.py         command1.py         command2.py     foo.py     bar.py   So I want the application to find the available command modules at runtime and execute the appropriate one.  Python defines an __import__ function, which takes a string for a module name:     __import__(name, globals=None, locals=None, fromlist=(), level=0)      The function imports the module name, potentially using the given globals and locals to determine how to interpret the name in a package context. The fromlist gives the names of objects or submodules that should be imported from the module given by name.       Source:    So currently I have something like:  command = sys.argv[1] try:     command_module = __import__("myapp.commands.%s" % command, fromlist=["myapp.commands"]) except ImportError:     # Display error message  command_module.run()   This works just fine, I'm just wondering if there is possibly a more idiomatic way to accomplish what we are doing with this code.  Note that I specifically don't want to get in to using eggs or extension points. This is not an open-source project and I don't expect there to be "plugins". The point is to simplify the main application code and remove the need to modify it each time a new command module is added.


How about we have a Windows application for Stack Overflow? I'm talking about a Desktop/Laptop/Notebook etc. application and not a Windows Phone application.   It could offer faster browsing, easy access, and a better UI. What do you say?  And if there shouldn't be a website and we can all pack our android phones and use web browsers, why is there an android application?

I'm now going on vacation, and I won't be having Internet connection there. I was thinking it would be a good time to browse through the Stack Overflow data dump. However, it's all in XML and I'd have to write a client to make it readable. Is there any existing client?


I am making an archive for my family. There are no syntax errors, however whenever I type in "Maaz", it evaluates realName == "Maaz" to false and goes to the else statement.   import java.util.Scanner;  public class MainFamily {     public static void main (String [] args) {          System.out.println("Enter you're name here");         Scanner name = new Scanner(System.in);//Scanner variable = name          String realName;         realName = name.nextLine();//String variable = user input         System.out.println("Name: "+ realName);          if (realName == "Maaz") {              System.out.println("Name: Maaz");          } else {             System.out.println("This person is not in the database");         }     } }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Combinatorial proof that $(n-r){n+r-1 \choose r}{n \choose r} = n{n+r-1 \choose 2r}{2r \choose r}$.  Typically to combinatorially prove something we need to show that the LHS indeed counts the same thing as the RHS. I am having trouble doing so. One thing I noticed is that on the LHS, we are choosing from a total of $(n-r)+(n+r-1)+(n) = 3n-1$, but on the right we chose from $2n+3r-1$. This is likely no problem at all, but it is still roadblock for me.  Any tips or hints on how to approach this problem are appreciated

Show that $(n-r) \binom{n+r-1}{r} \binom{n}{r} = n \binom{n+r-1}{2r} \binom{2r}{r}$.   In the LHS $\binom{n+r-1}{r}$ counts the number of ways of selecting $r$ objects from a set of size $n$ where order is not significant and repetitions are allowed. So you have $n$ people you form $r$ teams and select $r$ captains and select $(n-r)$ players.  The RHS divides up a team into 2 sets?


$V$ is a finite dimensional vector space, $U$ and $W$ are subspaces and $U^0,W^0, (U+W)^0$ are the relevant annihilators. I would please appreciate help proving:          $U^0\cap W^0=(U+W)^0$      I would think that anything that annihilates $(U+W)$  would annihilate $U$ and annihilate $W$. But I am even confused about that in general, given that $\dim V=\dim U+\dim U^0$, the larger the dimension of $U$, the smaller the dimension of $U^0$.   But in that $\dim (U+W)\ge \dim U$, and similarly $\ge \dim W$, I am not even sure of that.  I would appreciate help in proving the highlighted equality as an inclusion of sets in both directions, and also, if possible, using dimensions.  Thanks

I have a problem as follows: $W_1$ and $W_2$ are subspaces of a finite-dimensional vector space $V$. $W^0$ is the annihilator of $W$.  (a) Prove $(W_1 + W_2)^0 = W_1^0 \cap W_2^0$.  (b) Prove $(W_1 \cap W_2)^0 = W_1^0 + W_2^0$.  Thoughts so far:  By definition of Annihilator,  $W^0$ is the set of linear functionals that vanish on $W$. I feel that I also should use dual, but not sure how to put things together.


How to calculate $n\bmod p$ when $p$ is prime, and $n$ is an integer of form $a9999...$ where $a$ is digit $1$ to $9$. The number of digits $9$ that follow $a$ is huge (i.e. big enough to not fit memory of my PC).

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


pls how can i appeal to this decision- your intention to leave the territory of the member of states before the expiry of the visa could not be ascertained

Schengen refusal formulae can be difficult to understand sometimes.  Sometimes an applicant receives a refusal with:       Justification for the purpose and conditions of the intended stay was not reliable.     often accompanied by:       Your intention to leave the territory of the Member States before the expiry of the visa applied for could not be ascertained.   What is meant by this refusal reason?  What are they trying to say?


This question arises from  of mine and refers to a remark from Liu's "Algebraic Geometry"  at page 90:    In remark 3.2.11 is stated if $X$ is an algebraic variety over field $k$ and it's base change $X_{\overline{k}}= X_{Spec(k)}Spec(\bar{k})$ wrt algebraic closure $k \subset \overline{k}$ verifies one of the properties reduced, connected, or irreducible, then Lemma 2.6 says that then $X_K$ verifies the same property for any algebraic extension $K/k$.  Here the lemma 2.6:    My QUESTION is how the author concretely deduces remark 3.1.12 with help of 2.6?    I know that there are some ways to deduce the remark 3.2.11 without using explicitely Lemma 2.6 (see for example the comments of @user45878 in the linked thread).   But the main point of this question that makes me curious is concretely which role does lemma 2.6 in the proof? It seems quite redundant to me to consider a intermediate field $K'$ between algebraic extension $K/k$ having properties as stated.  Indeed:  Firstly, the "reduced" property is local so assume $X=Spec(A)$ and assume $A \otimes_k \bar{k}$ reduced. Assume, $K/k$ is an arbitrary algebraic extension of $k$. Then, since $A$ is a flat $k$-module we have the  inclusion $A \otimes_k K \subset A \otimes_k \bar{k}$. So $A \otimes_k K$ reduced. So no usage of Lemma 2.6.   In case of irreducibility assume that $X_{\overline{k}}$ is irreducible but $X_K$ not. Wlog $X_K= X^1 \cup X^2$. Base change by $\bar{k}/K$ gives at least two irreducible components $X_{\bar{k}}= X^1 _{\bar{k}} \cup X^2 _{\bar{k}}$ (since $X^i _{\bar{k}}$ could after base change become also reducible). But nevertheless we obtain a contradiction to irreducibility of $X_{\overline{k}}$. For "connectness" the argument is similar.  And now the question agian, where do we here really need 2.6?  What do I oversee?  Or does anybody see what Liu had by usage of 2.6 in mind?

This is from Qing Liu's Algebraic Geometry and Arithmetic Curves (page 89). When he proves (c), he first prove the result when $K/k$ is finite, and then says that the general case immediately follows from the finite case and lemma 2.6 (posted below). I have no clue of how the lemma can be use to reduce the general case to the finite case.   Moreover, there is a remark pictured below that also uses the lemma 2.6 and once again I'm confused about how to use it. How can I complete these details?


What exactly is data.stackexchange.com? I cannot understand, regardless of how much I read about it. It would be helpful if someone explained.

This is the announcement post of the Stack Exchange Data Explorer. Its answers were meant to iron out the initial glitches 6 to 8 years ago.  If you have found a bug or need support  today with any of SEDEs features, please ask a new question and tag it with   What does it do? Allows you to run arbitrary SQL queries on the data dumps, and share those queries with your friends. Technical details It is hosted on the Stack Exchange infrastructure , the database is hosted on the same SQL Server version all other sites are hosted on. You can use most of the TSQL commands, even create temporary objects (but not User Defined Functions). The controls used are jQuery based, the grid is  . All query results are cached, so sharing a link to a query will not result in the server going in to a tailspin. The query edit control is a slightly modified  control, I also am considering bespin cause the inter iframe communication is nasty complicated. It gives up nice syntax highlighting for queries. Parameters There is support for parameterized queries, to get it to work name your params like ##this##. For example have a . Query name and description A query can have a name and description, to name it lead with a comment, to describe it continue commenting, for example: -- This is my query name  -- This is my description -- I can span multiple lines  SELECT 1  Anonymous users can initially name a query, but can not change the names of any existing queries. Tutorial There's a  which helps you getting started in writing your own SQL queries. Logging in You can use your openid provider to log in, at the moment once logged in we will track the list of queries you execute (giving you basic history support) Also if there are any params named UserId they will be populated automatically if your EmailHash matches the one on the site being queried. Magic columns If you alias an id column with as [Post Link] it will automatically create a link in the result set to the parent site. Similarly if you alias an id column with as [User Link] it will display a link to the user page. select top 10 * from Posts will show you how tags are done. (Magic columns for images is planned) example (most controversial posts:  ) So what are you waiting for, check it out at  Any feedback would be greatly appreciated. I hope to have the login section working fairly soon and allow voting on the best queries and commenting. Featured Queries At the moment, admins have permission to feature interesting queries on this page , I am looking for better ways to manage the huge query list that is building up.


the titles of several of the related questions   and  are blank - the all end with ?rq1 unlike this question, which  up   I can replicate this on firefox 55.0.3 on windows 10 version 1703, and vivaldi 1.10.867.38 (Not supported, I know, but second data point)

On two three of the four newest Meta questions, there are posts in the "related" section without a title:    I was curious to see what that was, and the link was a link to an answer. Clicking the link took me to the answer, and the score in the link was the score of the answer, not of the question (in the example above, the answer had score 8 and the question had score 3).  What's also strange is that although it was a link to an answer, it had a question URL (in the example above ).  I saw this happen just recently on several questions on both Meta Stack Exchange and Super User, and I have never seen this happen before. I'm quite sure this is a bug.


How is it possible that this coat-hanger lifts Thor's hammer, when it is not worthy of it? I mean in Avengers: Age Of Ultron, Captain America says that an elevator can't lift the hammer because it's not worthy of it.

If Thor left his hammer on the floor of an elevator and then he stepped off the elevator, would I then be able to send the elevator to different floors?  Thereby moving the hammer in a vertical direction?


Does it help their tenure case to write an expository textbook? I'd be surprised if it does, seeing as writing a textbook on, say, quantum mechanics, is not original scholarly work.   So why would a professor, say an aspiring full professor, write a textbook? Money?

As noted in , academics should write research articles. In many fields, these are way more important than books. It's original research that counts for getting a PhD position, a post-doc, a tenure-track position, grants, etcetera. Writing a good textbook about an advanced subject is very difficult and very time-consuming. Its advanced nature means it won't sell many copies, so the money can't be much. Then why is anybody writing advanced scientific textbooks at all? What are the incentives?


Evaluate $$\lim _{x \to 0} \left[{\frac{x^2}{\sin x \tan x}} \right]$$ where $[\cdot]$ denotes the greatest integer function.  Can anyone give me a hint to proceed?  I know that $$\frac {\sin x}{x} < 1$$ for all $x \in (-\pi/2 ,\pi/2) \setminus \{0\}$ and $$\frac {\tan x}{x} > 1$$ for all $x \in (-\pi/2 ,\pi/2) \setminus \{0\}$. But will these two inequalities be helpful here?

Find $$\lim_{x\to0}  \left\lfloor\frac{x^2}{\sin x \tan x}\right\rfloor$$ where $\lfloor\cdot\rfloor$ is greatest integer function   I am a high school teacher. One of my students came up to ask this limit.  For $\lfloor\frac{\sin x}{x}\rfloor$, I have used $\sin x > x$ using increasing decreasing functions.  I tried to prove $x^2 > \sin x \tan x$ using increasing /decreasing  function but I am not getting it.


I am having a slight problem with the .setAttribute command. I am creating an element called view:  var view = document.createElement('p') view.innerHTML = "VIEW" view.style.color = "#e60f0f" view.style.fontFamily = "Montserrat" view.style.fontWeight = "600" view.style.fontSize = "13px" view.style.right = "5px" view.style.position = "absolute" view.style.top = "0px" view.style.marginTop = "5px" view.style.backgroundColor = "transparent" view.style.padding = "10px" view.style.borderRadius = "7px" view.setAttribute('onclick', 'view(name, date, type)') document.getElementById(newId).appendChild(view)   When I run this, everything renders except the .setAttribute() function. I don't have the sligthest idea why. Does anyone know? Thank you SO much!  Here's the view() function in case you need it:  function view(name, date, type) {   window.location = '/flightStatus?name=' + name + '&date=' + date + '&type=' + type }   Just as another note: I am sending this to Node.js... I don't think that matters, the code above is client-side :)

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I recently was recording audio (an interview) by using the native Voice app on my Samsung Galaxy S6. I paused the recording without having the time to save it. My phone turned off automatically and then restarted (it happens sometimes). When I tried to go back into the app, the file was missing. I searched in the audio files folder, to no avail. I'm under the impression that the file must be somewhere even though it was not saved, because I see that there is a difference between the remaining space on my hdd before and after the recording (which corresponds to approximately 150Mb). I downloaded several recovery apps off of the Google Store, but I wasn't lucky. Has anyone experienced something similar and if yes, did you find a solution? Thanks!

I factory reset my rooted Android M phone but now I realize that there was a file in the /data directory which I need.  Is it possible to create an image (.img or something similar) of the /data partition so that I could run some recovery software for ext4 on that image? I have a little knowledge about ADB.


Using SP 2010 and SPD 2010, I've found the problem: when I try to open page in Designer (using Site Actions -> Edit in Sharepoint Designer), it doesn't open, but there is popup window with invite to load Sharepoint Designer. But SPD is installed. How to fix it?

For example, if I click Edit page -> Edit in SharePoint Designer from within my SharePoint site, I'm always presented with a dialog prompting me to download Designer.  I already have Designer installed.  Seems like it should a.) launch it for me, or b.) at least stop prompting me to  download it.  UPDATE: Turns out this stemmed back to the 64-bit IE compatibility issue that was causing me grief here:


I'm currently doing an introductory course to quantum mechanics, and came across an assumption that Planck used in solving the UV catastrophe. From what I understand, he essentially stated that that the change in energy cannot be smaller than $hf$. So generally $\Delta{E}$ = $n*hf$ where $n$ is a real number. This makes sense, but I never understood how energy is truly then quantised, as can't light take an infinite number of possible frequencies? (not at the same time but just generally). Maybe I'm just misunderstanding the statement or making it overcomplicated - in any case please do shed some light.

Planck quantised the energy of light in order to solve the black body radiation problem. However, I am confused as to exactly what he quantised. On one hand, I have seen that he quantised the energy of oscillators in the black body (source below).     However, the second version of the story I've heard is that it is simply that light energy is given off in discrete chunks (where every photon itself can have any value of energy it likes depending on frequency and is not quantised).   To me, the first idea doesn't make sense because $E=hf$ and as $f$ can be any real number that means the energy of each photon can be any real number. I would believe the second version, however I don't understand how this version of quantisation leads to reducing the number of high frequency waves emitted and thus solving the UV catastrophe. Could you please explain exactly how releasing energy in chunks (of arbitrary size themselves) means less will be released in the higher frequencies?


I want to install Linux alongside Windows and my Device is UEFI and I have GPT disk , I want to install it manually to create swap and home partition and I already have EFI partition by Windows so should I mount it to /boot/efi or install Linux without editing it? and if I should edit it , after that if I decided to uninstall Linux? Should I cancel the mount of the EFI partition or Leave it as it was? Because some people mount it and some people install it without doing this step. Another thing what should I choose in device for bootloader installation?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


every time I start my terminal, it always says "-bash:  .: command not found" twice.  Does anyone know how I can get rid of that?

I'm really new to Mac OSX and UNIX based systems. I wanted to run a few Windows games on my Mac Mini so I started installing Wine and MacPorts. I think the installs are correct, but when I type sudo port install wine I see a not found error in my terminal. I tried other basic commands like say and clear and all of them return the same not found error. My research shows that my PATH might be incorrectly set, but it lacks steps I can implement. Specifically, I ran this command: echo $PATH and it returned:  /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin  I'm a complete newbie to mac and have no idea where .bash_profile or any of those files are. My skills let me install Xcode and the Command Line tools for Xcode and I sense I need to level up on path management. At this point I need help managing my dot files and changing my path to fix these specific errors on Mountain Lion. What are my next steps?


I noticed that a framebuffer doesn't always exist on some systems. In these cases, how does bash print to the screen (assuming it ever uses fb devices at all)? Since there's no framebuffer device, does this mean that bash knows how every graphics card out there works and can directly write to their registers, or does it use some other API?

Suppose I press the A key in a text editor and this inserts the character a in the document and displays it on the screen. I know the editor application isn't directly communicating with the hardware (there's a kernel and stuff in between), so what is going on inside my computer?


How do i find out what my username is when I am locked out of my computer? I forgot what my username is and it won't let me pass the user login page.

My initial problem was that my computer wouldn't let me login to my account. It seems to shut down after I enter my password. I can login as a guest.  I found fixes but I can't remember / figure out my login for access after I hit Ctrl+Alt+F1 and most of the fixes for finding your login username depend on you having access to your account.  I thought the login was the name which appears on the screen when I start the computer normally, but this has not worked, is there another way to find out my username while being effectively locked out of my root-user profile?  I am also assuming that the password is the same one I always use.  Conversely, if the name which appears on the screen at startup and my normal password should have worked, is there another explanation for why I am not able to login on the black command screen.


There is any good program to download YouTube videos? I am using Ubuntu 14.04 32-bit.

What are instructions on how to download videos from YouTube?    Notice: Terms of Service Violation  Please be aware that by following any of the answers below, you will be violating YouTube's . In particular, from Section 5.B.:     Content is provided to you AS IS. You may access Content for your information and personal use solely as intended through the provided functionality of the Service and as permitted under these Terms of Service. You shall not download any Content unless you see a “download” or similar link displayed by YouTube on the Service for that Content. You shall not copy, reproduce, distribute, transmit, broadcast, display, sell, license, or otherwise exploit any Content for any other purposes without the prior written consent of YouTube or the respective licensors of the Content. YouTube and its licensors reserve all rights not expressly granted in and to the Service and the Content.


Is there an easy CLI method to do that?  If I use pdftk, I get a new pdf without the bookmarks of the original one. The bookmarks were created on another system with Adobe Acrobat Pro, and an example is available .  My system is Kubuntu 17.

I am using pdftk to rearrange pages of a pdf file with bookmarks/outlines, but after that, the output file lost the bookmarks of the original.   My command is pdftk in.pdf cat 1-22 43 23-42 44-end output out.pdf.  I was wondering how I could keep the bookmarks while rearranging pages?


If $a_1=1$ and for n>1$$a_n=a_{n-1}+ {1 \over {a_{n-1}}} $$ $a_{75}$ lies between (a) (12,15) (b) (11,12) (c) (15,18)  Now , in this question, I rewrote, $a_n-a_{n-1} = {1 \over {a_{n-1}}}$, to make a telescopic type and summed the terms to get $$a_n-a_{1}= {1 \over {a_{n-1}}}+ {1 \over {a_{n-2}}}...{1 \over {a_{1}}}$$ And as ${1 \over {a_{r}}} <1$ for all r , I got $a_{75} <76$ , but it's of no help as , the upper bound is much higher. I got no further ideas , on how to solve it, please help.


I'm trying to get a star in the right upper corner of a product symbol:  \documentclass{article}     \usepackage{amsmath}     \begin{document} First variant in equation is bad: \begin{equation}\nonumber \prod_{i\in I}^\star \end{equation} Second variant in equation is good: \begin{equation}\nonumber {\prod_{i\in I}}^\star \quad\text{but not completely:\quad} {\prod_{\text{long text under the symbol}}}^\star \end{equation} First variant inline is good: $\prod_{i\in I}^\star$ and the second is bas: ${\prod_{i\in I}}^\star$. \end{document}   Here a picture:       How can I put this logic in a new command? And of course also solve the problem with the long text in equation.

I want to have a primed product symbol, i.e. something like  $\prod^\prime$   but it puts the prime on top of the product symbol instead of next to it (as a superscript, as it usually works). Does anyone know how to do this?


Does subversion support word, excel and powerpoint documents? "support" here means having history available and I can get old version out from the subversion. It will be nice if I can diff different versions.  thanks,

We have concurrent edits happening on Word documents and I want to make sure that Subversion can handle merging .doc files. Do you know if Subversion handles merges of Word documents well?


ETA: I'm new to the Blender Stack Exchange, so I'm not sure where/how to upload my .blend files.  ETA2: Here is the file -   I'm trying to trim one object around the edges. So I have 2 objects:  Object to trim:   Trimmer object:   My boolean settings. I've tried the Carve solver with the same results:   Result. Note that the object-to-be-trimmed is completely unchanged.   I'm completely confused by this behavior. I've looked at other similar topics, but no one is experiencing quite the same issue. Please help!

I'm trying to model an , but it's not going so well when it comes to the magazine of the weapon.   Next to the magazine is a mesh. I want to cut holes in the mag with that mesh. But the magazine just goes invisible or connects with the mesh when trying to execute the Boolean Modifier. I have tested to invert the normals and some other stuff, but it isn't working.


Let $(e_k)_{k=1}^{\infty}$ denote an orthonormal set in a Hilbert space $H$. If $(c_k)_{k=1}^{\infty}$ is a sequence of positive real numbers such that $\sum c_k^2<\infty$, then the set   $A=\left\{ \sum_{k=1}^{\infty} a_ke_k: |a_k|\leq  c_k\right\}$ is compact in $H$.  Some hint? Thanks in advance.

Let $(a_n)_{n}\in\ell^2:=\ell^2(\mathbb{R})$ be a fixed sequence. Consider the subspace $$C=\{(x_n)_{n}\in\ell^2 : |x_n|\le a_n\text{ for all }n\in\mathbb{N}\}.$$  According to the book [Dunford and Schwartz, Linear operators part I, page 453] $C$ is compact in the $\ell^2$-norm, but there is no proof. How can I show that $C$ is indeed compact in $\ell^2$ ?


today I installed Ubuntu in a new partition. I can boot Ubuntu, but not Windows. Here's a video showing the problem:   Is there a solution or all my Windows-related data is gone?  Greetings!  EDIT: Boot-Info pastebin link:

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


I recently install ubuntu 18.4 and i tried to install Gnome Shell Extension in Firefox, the extension has been install, but show this 'Although GNOME Shell integration extension is running, native host connector is not detected. Refer documentation for instructions about installing connector.'. I try to install same extension in chrome and show the same error, and in Chromium the same error  i install Ubuntu in 2 PCs and the error to persist

How do I install GNOME Shell extensions?  Is it possible to update, remove and manage the extensions?


Let $A,B,C$ be three pairwise coprime positive integers and let $a,b,c$ be three multiples of $A,B,C$ respectively. I am asking if the following system of congruence $b-c$=$0$ mod $A$ $a-c$=$0$ mod $B$ $a+b$=$0$ mod $C$ has a solution.

Let a system of three linear congruence equations in integers be given;      \begin{cases}x\equiv b_1\mod c_1\\ x\equiv b_2\mod c_2\\ x\equiv b_3\mod c_3\\ \end{cases}   with $c_1,c_2,c_3\in\mathbb Z_{+}$. Show that, if every pair of congruence equations admits solutions, then the entire system admits solutions.    Now, if every pairs admits solutions, then for example $b_1\equiv b_2\equiv a\mod \gcd(c_1,c_2)$ for some $a$ then;   $x-a\equiv b_1-a\mod c_1$  $x-a\equiv b_2-a\mod c_2$  replacing $x$ by $x':=\frac{x-y}{\gcd(c_1,c_2)}$, we obtain:  $x'\equiv b_1'\mod c_1'$  $x'\equiv b_2'\mod c_2'$  and since $\gcd(c_1,c_2)=1$ by Chinese Remainder Theorem we have a unique solution $\mod{c_1'c_2'}$, so $x\equiv (\gcd(c_1,c_2)x'+a)\mod{\operatorname{lcm(c_1',c_2')}}\quad(1)$  We can do it with another pair (take $2$nd and $3$rd, since we know that such a pair admits solutions;  $x\equiv(\gcd(c_2,c_3)x''+a')\mod{\operatorname{lcm(c_2',c_3')}}\quad(2)$  Now how can I show that for the pair $(1)$ and $(2)$ also solutions exist ?


is a white instance for {XWW} with this wording:  Choose one —  Destroy X target artifacts and/or enchantments. Target player gains twice X life.   How should this be interpreted? It's the and/or that confuses me. Can I destroy up to X artifacts and up to X enchantments, for a total of 2*X permanents? Or can I only destroy up to X permanents, all of which have to be artifacts or enchantments? If the last interpration is correct, targeting is easy. If X is 4 I can target for example 1 artifact and 3 enchantments. If the first interpretion is correct, how does targeting work? I have to declare targets when casting the spell, so for each {1} in X, I have to have a legal target. If I wish to destroy 3 artifacts and 2 enchantments, can X be 3?

How should the "and/or" text of a card be interpreted? For example on a card like  the text reads:     Nahiri's Wrath deals damage equal to the total converted mana cost of the discarded cards to each of up to X target creatures and/or planeswalkers.   For the remainder of this question, let's fix X at 2 to keep things simple.  Should the "and/or" be interpreted such that the effect is applied to a combination of targets the player chooses. That is to say for Nahiri's Wrath the player could perform one of the following options:   Nahiri's Wrath deals damage to each of two target creatures. Nahiri's Wrath deals damage to each of two target planeswalkers. Nahiri's Wrath deals damage to each of one target creature and one target planeswalker.   Or should the card's effect be expanded and applied to both sides of the "and/or". With this interpretation the player would have to the following two options when playing Nahiri's Wrath:   Nahiri's Wrath deals damage to each of X target creatures and Nahiri's Wrath deals damage to each of X target planeswalkers Nahiri's Wrath deals damage to each of X target creatures or Nahiri's Wrath deals damage to each of X target planeswalkers   The confusion stems from  (which was formerly formerly worded using the same phrasing) where some commenters have said things like:     So this lets you do a total of 12 damage? 3 each to 2 target creatures AND 3 each to 2 target players, one of which could be a planeswalker? That's how the "and/or" works, right? You can choose. Otherwise it would just be "or"...


Recently I've  the question on SOF and, as I didn't got an answer, I've decided to repeat my search in google, and I've found a several sites which duplicate the question of mine: , . Does anyone know is it a robot or human who just cheating for own SOF reputation? And is it legal for SOF community?

of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under . For my fellow non-lawyers, that license basically means:   Anyone can use any Stack Exchange posts at any time without having to ask for permission Making money off of the copied content is permitted You don't even have to copy stuff from here verbatim; you can just use it as a starting point and make whatever edits you want There are just two rules you have to follow:   You have to provide . Simple links to the original post and author info are just fine. You have to  and allow other people to use your content, as long as they follow these very same rules. How meta!    (If you ever forget any of that, and want to refresh your memory, the license info is linked to in the footer of every page.)  There are, in fact, a lot of people who republish varying amounts of our content for assorted reasons. Unfortunately, there are some Stack Content Republishers Attributing Poorly and/or Excelling at Ranking (SCRAPERs, for short).  In this context, "attributing poorly" means any use that doesn't follow our attribution rules or make any other reasonable attempt at give credit. This can get pretty egregious; I've seen SCRAPERs that not only don't link back to SE originals, but also use fake author info and post dates to make it harder to find originals. By "excelling at ranking," I'm referring to copycat sites that end up higher in Google results than the original SE sites do for the same content. That's not necessarily wrong, but in some cases, it indicates inappropriate SEO hackery.  So, the question is: what can you do if you spot a SCRAPER?


I am investigating a link between a random walk with drift (call it Brownian process or difusion with drift) and the CUSUM statistic. The CUSUM procedure accumulates deviations from the process mean over time, thus, if a change in the mean occurs for some reason, then the CUSUM will steadely increase over time, eventually crossing some pre-determined control limit when an alarm is raised.   Can anybody enlighten me as to whether this is in any way similar to calculating the first passage time for the CUSUM, that is the time it takes to cross a given barrier. Is the CUSUM ARL the inverse of the probability of crossing this barrier? How do I go about calculating this probability?   ...so many questions!! Any thoughts are appreciated!!

Suppose in an Xbar chart, k successive points plotted outside a control limit indicates an out of control situation. If p is the probability of plotting a point outside a control limit, how is ARL = $(1-p^k)/(p^k (1-p))$?


Let $V$ be a vector space of dimension $n$ over $F_q$. Prove that no of the subspace of dimension $k(\leq n)$ is equal to no of the subspace of dimension $n-k$ in $V$.

I am asked to find how many there are $k$-dimensional subspaces in vector space $V$ over $\mathbb F_p$, $\dim V = n$.  My attempt: 1) Let's find a total number of elements in $V$: assume that $\{v_1, v_2, \cdots, v_n\}$ is a basis in $V$. Then, for every $v \in V$ we can write down $$ v = a_1 v_1 + a_2 v_2 + \cdots + a_n v_n $$ and since the coordinates ($a_1, \cdots, a_n$) are from $\mathbb F_p$ there are $p^n$ vectors in $V$;  $p-1$ without the zero vector.  2) Let's look at a situation where $k=1$. Let's call this 1-dimensional space $V'$. $$\forall v' \in V'. v' = a_1 v_1$$ where $v_1$ is a basis in $V'$. We know that if there are two non-zero vectors $u \in V'_1$ and $v \in V'_2$,  they are not linear dependant. So, every 1-dimensional subspace has $(p-1)$ basises. Therefore, there are $\frac{p^n - 1}{p-1}$ possible 1-dimensional subspaces in $V$  3) k-dimensional subspace is defined by the set of it's basises. Since basis can not contain zero vectors we can write down the formula for selecting $k$ linear independent vectors: $C^k_m (p-1)^k$, where $m = \frac{p^n - 1}{p-1}$. Here we first choose $k$ 1-dimentioanl subspaces and then we choose one of $(p-1)$ non-zero vectors from each of the subspaces.  4) .. unfortunately, this is where I am stuck. My intuition says that the answer may be  $\frac{p^n - 1}{(p-1)^k}$, but this might be completely wrong and I don't know how to go about finishing the problem.  Thanks in advance.


I have this,    and I don't understand how to do the change of variable.  Please help me   Thank you.

why: $$\int_0^1\int_{u(t)}^{u(t)+w(t)} f(t,v(t)) dv dt = \int_0^1 f(t,u(t)+\theta w(t))w(t) dt; ~~\theta\in[0,1] $$  how to get this ?  Please help me   Thank you.


Is it possible to import all subpackages at once in Java?  As I learned it seems possible in C#:

Is there a way in C# to import everything inside a namespace like there is in Java with the wildcard character?  import java.awt.*;


I'm looking for a word that describes a person who has to fight against a powerful opponent on a regular basis. This does not involve a competition, like some kind of sport.  Example :   Lawyers willing to take on powerful companies are hard to find, however James from the law firm  Crane & Schmidt, regularly lock horns against major companies.  So in the above example what would someone like James be called, who has to regularly fight against companies/entities that are much more powerful than him?

In a betting sport such as horse racing or boxing, the competitor for whom the odds are lowest is known as the favourite.  Can the other competitors be termed something in contrast?


Can I say      Let we do it   Instead of     Let's do it   One more question. Because let's is a contraction of let us, so can 'us' be a subject? Isn't 'us' only used as object?

Many times I heard these words interchangeably. I want to know if "Let's" and "Let us" are used for the same meaning.  I think (for me):   "Let us" is word used for requesting. Like Let us do something means requesting to allow us do something. "Let's" is words used for proposing. Like Let's play means proposing people to play.


I'm building a logistic regression model to predict if a patient has cancer based on 9 features. Having built learning curves and increasing my regularization parameter to reduce over fitting, which caused my accuracy to increase from 82% to 86%, I'm stuck on options of how to improve it further.  I'm using a training set of 69 samples, a validation set of 24 samples and a test set of 24 samples. (60%,20%,20% split) (I'm doing this on octave)  When I drew my initial learning curve, I saw that the validation error is actually lower than the training error. Then according to  , as the issue lies in overfitting, I increased the regularization parameter (lambda), which caused the learning curve to show characteristics of high bias, and the accuracy on the Test Set increased to 86%.   Learning curve code which causes validation error to be less than training error;  %costlogreg is a function to calculate logistic regression cost %linearRegcost is a function to calculate the training cost and validation cost %sigmoid2 is just a simple logistic function %listJ is a matrix of zeros  listJ = zeros(69,3);  for i = 1:69  initial_theta = zeros(size(Xadjust,2) + 1,1); %Xtrain, Ytrain is the training set Xtrain = Xadjust([1:i],:); Ytrain = Y([1:i],:);  %function handle for costlogreg costfunction = @(t)costlogreg(t,Xtrain,Ytrain,lambda);  %obtains theta depending on training set options = optimset('Gradobj','on','MaxIter',50); [theta] = fmincg(costfunction, initial_theta,options);  %calculates the cost on the training set and adds it to a list [Jtrain,~] = linearRegCost(theta,Xtrain,Ytrain); listJ(i,1) = i; listJ(i,2) = Jtrain;  %obtains Jcv using earlier found theta [Jval,~] = linearRegCost(theta,Xval,Yval); listJ(i,3) = Jval;  end   Code to choose the best lambda value which gives higher accuracy on test set  %lambda set is a set of regularization parameters to test %listlambda is a matrix of zeros to collect the accuracy on test set for each lambda used listlambda = zeros(size(lambdaset,2),4);  for i = 1:size(lambdaset,2)  initial_theta = zeros(size(Xadjust,2) + 1,1); costfunction = @(t)costlogreg(t,Xtrain,Ytrain,lambdaset(1,i)); options = optimset('Gradobj','on','MaxIter',50); [theta] = fmincg(costfunction, initial_theta,options); [Jtrain,~] = linearRegCost(theta,Xtrain,Ytrain); listlambda(i,1) = lambdaset(1,i); listlambda(i,2) = Jtrain; [Jval,~] = linearRegCost(theta,Xval,Yval); listlambda(i,3) = Jval; [h] = sigmoid2(Xtest,theta); list = zeros(size(h,1),1); idx = find(h >= 0.5); list(idx) = 1; accuracy = mean(double(list == Ytest)); listlambda(i,4) = accuracy; endfor  %figures the row with the highest accuracy on the test set [~,maxidx] = (max(listlambda(:,4))); bestlambda = listlambda(maxidx,1);

Imagine a standard machine-learning scenario:     You are confronted with a large multivariate dataset and you have a   pretty blurry understanding of it. What you need to do is to make   predictions about some variable based on what you have. As usual, you   clean the data, look at descriptive statistics, run some models,   cross-validate them etc., but after several attempts, going back and   forth and trying multiple models nothing seems to work and your   results are miserable. You can spend hours, days, or weeks on such a   problem...   The question is: when to stop? How do you know that your data actually is hopeless and all the fancy models wouldn't do you any more good than predicting the average outcome for all cases or some other trivial solution?  Of course, this is a forecastability issue, but as far as I know, it is hard to assess forecastability for multivariate data before trying something on it. Or am I wrong?   Disclaimer: this question was inspired by this one  that did not attract much attention. It would be nice to have detailed answer to such question for reference.


Today morning I had thought of a wonderful way to calculate the general sum of $$ \sum_{i=0}^{i=n} i^n$$ Using just things taught in elementary high school calculus. So, my method is as follows, First consider the geometric series: $$ S = \sum_{i=0}^{i=n} x^i$$ from the formula for geometric series, $$ \frac{x^{n+1} - 1}{x-1} = \sum_{i=0}^{i=n} x^i$$ Rewriting this into the form in which leibniz product rule is more applicable, $$ \sum_{i=0}^{i=n} x^i = (x^{n+1} - 1) (x-1)^{-1}$$ take a derivative on both sides, $$ \sum_{i=0}^{i=n} i x^{i-1} = \frac{d}{dx} [ (x^{n+1} - 1) (x-1)^{-1}]$$ If I take limit as x goes to one on both sides I get formula for sum of first n integers, now suppose I multiply both sides by x and take derivative, $$  \sum_{i=0}^{i=n} i^2 x^{i-1} = \frac{d}{dx} [x\frac{d}{dx} [ (x^{n+1} - 1) (x-1)^{-1}]]$$ Taking limit as $ x \to 1$ gives me formula for first n squares, now do same procedure again, $$  \sum_{i=0}^{i=n} i^3 x^{i-1} = \frac{d}{dx} \left[x\frac{d}{dx} \left[x\frac{d}{dx} [ (x^{n+1} - 1) (x-1)^{-1}]\right]\right]$$ To generalize, let, $$ P = x \frac{d}{dx}$$ And, $$ P \cdot P =P^2 = x \frac{d}{dx} [ x \frac{d}{dx} ]$$ Then, $$  \sum_{i=0}^{i=n} i^k  = \lim_{x \to 1} P^k [ (x^{n+1} - 1) (x-1)^{-1}]$$ Is there a way to generally evaluate the limit? Thank you.

As far as every question I've seen concerning "what is $\sum_{k=1}^nk^p$" is always answered with "Faulhaber's formula" and that is just about the only answer.  In an attempt to make more interesting answers, I ask that this question concern the problem of "Methods to compute $\sum_{k=1}^nk^p$ without Faulhaber's formula for fixed $p\in\mathbb N$".  I've even checked this  without finding what I want.  Rule #1: Any method to compute the sum in question for arbitrary $p$ is good, either recursively or in some manner that is not in itself a closed form solution.  Even algorithms will suffice.  Rule #2: I don't want answers confined to "only some values of $p$".  (A good challenge I have on the side is a generalized geometric proof, as that I have not yet seen)  Exception: If your answer does not generalize to arbitrary $p$, but it still generalizes to an infinite amount of special $p$'s, that is acceptable.  Preferably, the method is to be easily applied, unique, and interesting.  To start us off, I have given my answer below and I hope you all enjoy.


So this was an interview question.  You are provided with a function rand5() which generates a random integer in the range [0-5] i.e. {0,1,2,3,4,5}  a) Can you use that function to generate a random integer in the range [0-7]?  b) Can you use that function to generate a random integer in the range [0-7] with each number having equal probability?  You may use the function multiple times.  One of the solution for part a, ((rand5() +rand5())*7)//10 where // represents integer division would give you the range [0-7] however the probabilities are not equal.  Would love to see your answers and thought process on this.

Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.   What is a simple solution? What is an effective solution to reduce memory usage or run on a slower CPU?


I've got a PDF of a scanned document that's around 20MB and I need to drastically reduce the filesize to be able to email it.  I've tried  gs -sDevice=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf   but output.pdf isn't created.  Instead, I get an X Viewer for Ghostscript briefly.  Where am I going wrong?

I have a 72.9MB PDF file that I need to shrink into under 500KB.  The file was a JPEG image that I had scanned, and then converted to pdf.


Given Windows 7 I want to tunnel all its network traffic through SSH, without manually tunnelling each port.  It's easy on Linux, but I couldn't find any hint on how to do this on Windows ): So, any hint on how this can be done on Windows 7?

Whenever I'm using the internet from an insecure location (such as public wifi) I like to use an ssh tunnel (ssh -D port host) to ensure my traffic can't be sniffed. Unfortunately, there seem to be many applications which do not provide a way to specify a proxy (Flash is one major example).  It feels like there should be some way to use a tunnel for all network traffic from my computer, but I'm complete ignorant of how to do this. Any help would be greatly appreciated.


One technique to protect against DDoS attacks is to monitor the number or requests per seconds coming from a given IP address. Of course, IP addresses can be fakes, but let's assume this is not an issue here.  A web application installed on Tomcat (for example) can be configured to use secured http connections only (i.e., https). I am not a sysadmin expert, but I believe that in case of a DDoS attack, the high number of https connections attempts could create 100% CPU spikes.  My questions are:   Do DDoS attacks on https create long 100% CPU spikes? Is it possible to implement a software filter to monitor requests-per-seconds before the SSL negotiation is started in order to avoid long 100% CPU spikes? If answer to 2. is yes, can this be integrated in Tomcat? If yes how? Or it there a better solution out there?   Thanks.  EDIT  If answer to 2. is yes (but not in Tomcat), what solutions are available out there?

This is a  about DoS and DDoS mitigation.   I found a massive traffic spike on a website that I host today; I am getting thousands of connections a second and I see I'm using all 100Mbps of my available bandwidth.  Nobody can access my site because all the requests time out, and I can't even log into the server because SSH times out too!  This has happened a couple times before, and each time it's lasted a couple hours and gone away on its own.  Occasionally, my website has another distinct but related problem: my server's load average (which is usually around .25) rockets up to 20 or more and nobody can access my site just the same as the other case.  It also goes away after a few hours.  Restarting my server doesn't help; what can I do to make my site accessible again, and what is happening?  Relatedly, I found once that for a day or two, every time I started my service, it got a connection from a particular IP address and then crashed.  As soon as I started it up again, this happened again and it crashed again.  How is that similar, and what can I do about it?