From what I know, if you have a 50mm lens that projects a circle of light onto a rectangular 35mm film/sensor, the film/sensor would clip the the 50mm, but instead you multiple it by some multiplier. (eg. 25mm x 1.6 = 40mm)  Could someone certify the operation of the SLR Camera?

I'm reading that a 50mm lens is recommended as a first prime lens for DSLR owners as it's supposed to give a 'natural' perspective, but when used on (most) DSLRs, the view is cropped, as if you were zoomed in by 1.5-1.6x, so it's more of a telephoto lens when used on a DSLR. I've also read however that the 50mm lens gives the same perspective on a DSLR and a 35mm, and shouldn't really be considered to be 'equivalent' to an 80mm lens as the crop factor isn't really a magic focal length changer.  Can someone explain how the image is different from (for example) a 50mm lens on a DSLR and an 80mm lens (assuming 1.6x crop factor) on a 35mm camera?


This is the error message    This is my code

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I am trying to make an array of video games. I wanted to implement an array method that will add a new game to the array if there is an available index that is null. however when I try to implement such a method. It throws a NullPointerException. Here is the code in the main method: public static void main(String[] args) {         Game[] arr = new Game[3];         Game t1 = new Game("The Walking Dead", 2012, "Telltale games");         Game t2 = new Game("The Wolf Among Us", 2014, "Telltale games");         Game t3 = new Game("Half-Life 2", 2007, "Valve");                  try {             arr[2].addGame(t3);         } catch(NullPointerException e) {             System.out.println("Caught NullPointer");             arr[0] = t1;         }         System.out.println(arr[0]);     }  And here is the method I have implemented in the "Game" class:   public Game addGame(Game game) {         //TODO         for(int i = 0; i < arr.length; i++) {             try {                 if(arr[i] == null) {                     arr[i] = game;                 }             } catch(NullPointerException e) {                 System.out.println("Caught exception");                 arr[i] = game;                 return arr[i];             }         }         return game;     }    I am very lost and I don't understand how it is throwing the nullpointerexception when I am explicitly trying to check for null to try and insert a new "Game" into the empty index. Any help is much appreciated! Thanks!


I have these bash function:  on_ql_trap(){   echo "foobar" > "$HOME/.quicklock/debug.json" }  ql_trap(){   trap on_ql_trap EXIT;   trap on_ql_trap 0;   trap on_ql_trap SIGHUP;   trap on_ql_trap HUP; }   ql_trap is called by the user, but when the user closes the bash shell window that called the function, on_ql_trap never gets called, witness by the fact that 'foobar' is never written out.  the only thing I can think of, is that trap is not being registered for the right process or something. Does anyone know how I can guarantee that on_ql_trap will be called when process ends?

If I issue the trap builtin twice [for the same signal], what happens? Is the second command added to the first, or does it replace the first?  trap Foo SIGINT ... trap Bar SIGINT ...   When SIGINT happens, does Bash just run Bar, or does it run Foo as well? Or something else...?


Some of my old questions have rather low views and have been buried by newer posts. I think that these questions are not worth putting a bounty on them. The edit feature allows the question to reappear on the top of the questions list.   Is the practice to edit a question just to make it temporarily reappear on the top of the questions list acceptable? Or is it frowned upon by the community?

I asked a question almost as soon as I got my account. I got a few decent answers, but none of them helped solve my problem. The question has long since become buried by newer questions, and there's still no accepted answer. Unfortunately, because there are quite a few answers with votes, to a casual observer it probably looks like the question was answered and I just neglected to mark an answer as accepted, and the system does not consider it "unanswered".  Or, I asked a question that was a bit more difficult to answer. After waiting for some time, I received no answers, little or no comments, and only a few views. The question does show up in the "unanswered" list, but no one has answered my question.  In either case, what's the protocol for me to try to get this question answered?  I see several options:   Post the question a second time, possibly linking to the original, to get attention for the original question. This is encouraged on sites like Reddit.  However, it's probably not appropriate here, since we're encouraged to check for duplicates and not submit a question that's already been asked by someone else, so this probably falls under that heading. Wait for some kind of wiki-like talk page to be implemented, then post a plea on the talk page for input and hope that activity on the talk page bumps up the question. Edit the question, but do nothing further on the Stack Exchange site. If I edit my post to say that I haven't accepted any of the current answers but am looking for more, then the question might get answered eventually by people browsing through old questions to find something they can answer. Post the question on other sites, but link to my original question on Stack Exchange. People will either answer here, or they'll answer on the other site and I can post the accepted answer here myself.  This might be considered spamming, so it might be better to do this without the link.      For more information, see the "" page in the .


#!/bin/sh flag="False" ssh -n  $Domain_1@$IP "$( cat <<'EOT' $flag="True" cat << 'EOT' )"   flag is equal to false before connecting to the remote location.I just want to change the value of flag inside the ssh block after doing some operation in remote location and return the value of flag to my local variable flag. –

I wish to use shell to invoke a script on a remote server. I would like to capture the output of that script (its logging messages) and the exit code it returns.   If I do this:  ssh user@server /usr/local/scripts/test_ping.sh echo "$?"   I get the exit code but can't capture the remote logging messages .  If I do this:  local RESULTS=$(ssh user@server /usr/local/scripts/test_ping.sh) echo "$?"  LOG "${RESULTS}";   I get to log my output using my LOG function but can't seem to get a correct exit code, I assume the code I get is the code from the varianble assignment.   I would like to continue to use my LOG function to capture all output as it formats and sends things to a file, syslog, and the screen for me.   How can I capture results in a var AND get the correct exit code from the remote script?


Is the time complexity when it comes to maps AND sets the same for operations like insertion, removal, search ? I read somewhere that underlying structure is a hash table meaning that time would be constant o(1) ? is that always the case ?

I may be teaching a "Java crash-course" soon.  While it is probably safe to assume that the audience members will know Big-O notation, it is probably not safe to assume that they will know what the order of the various operations on various collection implementations is.  I could take time to generate a summary matrix myself, but if it's already out there in the public domain somewhere, I'd sure like to reuse it (with proper credit, of course.)  Anyone have any pointers?


So I had  closed within eight minutes of asking.  Is this a little fast? Not only do I object to the reason it was closed (not a real question, come on I'm asking for decent books!), but it was closed insanely fast. Should there be a grace period for questions (diamond mods exempt if so) before they can be voted on to be closed?

Possible Duplicate:          Given a question that is not clear at first, which satisfies the criterion for being "not a real question":      "It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot   be reasonably answered in its current form."   should that question be closed immediately, or should the OP get a chance to improve the quality of his question.  My modus operandi is this: When I encounter a question which is "not a real question", I respond via a comment - I might ask one or more counter-questions (about the issue), I might comment that I don't understand the question. So, I let the OP know that his question should be improved. I then give the OP say 15 minutes to respond (and in most cases the OP does respond). However, if the OP doesn't respond, then I consider voting for "not a real question".  Is this how SO should work?   I have witnessed in the past several questions for which I saw potential, being closed immediately, and I wonder if that is appropriate.   Edit: Of course, questions that are duplicates should be closed immediately, and off-topic questions should also be moved / closed immediately. In this question I am specifically referring to those questions which "have potential" (which could be corrected / improved)..


I have installed Ubuntu 18.04, but now I want to install Windows 10 (dual boot). At first, I have disabled CSM and then I made a partition using Ubuntu Live CD. Then I tried to install Windows but it showed an error saying the partition is not GPT format. So to make it GPT what should I do without loss of data in other partitions (i.e I have 4 partition- swap,ext4,efi and unallocated(ntfs))?   Thanks in advance.

I recently have upgraded my PC, my new Motherboard (ASUS M5A99X EVO) uses UEFi instead of the regular MBR option.  I have a Ubuntu 11.10 installation that I did when I had my previous hardware (MSI MS 7267) , Ubuntu alone boots fine, and so does Windows 7, however Windows 7 is using UEFI (GPT) boot whereas Ubuntu is using MBR.  I have my OSs in separate drives, so that GRUB2 wont' get replaced by the Windows Bootloader and viceversa, as I said both OSs boot fine on their own, but to do that I have to disconnect one drive in this case the Ubuntu drive as it prevents Windows from loading.  Now my question is, How can I change/convert Ubuntu's drive so that instead of using MBR it uses GPT and allow Windows to boot?.   Preferably without reinstalling the whole system or lose any data.  And if I were to wipe the drive, How can I install Ubuntu in GPT, UEFI, whatever it is mode?.  I have used gdisk to convert from MBR to GPT, but now Ubuntu can't boot seems like grub just doesn't start.  I have re installed the OS, and the drive is GPT now by default however grup-pc is still being used instead of grub-efi.  How can i make Ubuntu boot from EFI?.


From All of Statistics pg. 29:     EXPONENTIAL DISTRIBUTION. $X$ has an Exponential distribution with paramater $\beta$, denoted by $X \sim \text{Exp}(\beta)$, if      $$ f(x) = \frac{1}{\beta}e^{-x/\beta} \text{s.t. } x > 0 $$      where $\beta > 0$. The exponential distribution is used to model the lifetimes of electronic components and the waiting times between rare events.   But this must mean (in order for the probability density function to make sense) that  $$ 1/\beta \int_{0}^{\infty} e^{-x / \beta} = 1 $$  so that  $$ \int_{0}^{\infty} e^{-x / \beta} = \beta $$  But why is this?

Given:  Let $X$ be exponential with parameter $\lambda$, that is   $$ f_X(x) = \begin{cases} \lambda e^{-\lambda x} & \text{if }x> 0, \\ 0 &\text{for }x\leq 0. \end{cases} $$  where $\lambda>0$ is called the rate of the distribution.  Question:  Show that this is a valid probability density function (pdf).  Attempt:  Need to show that  $$ f(x) = \int^{\infty}_{-\infty} \lambda e^{-\lambda x}\,  dx=1\\\\ $$ Thus, \begin{eqnarray*} f(x)&=&\int^0_{-\infty} \lambda e^{-\lambda x} \, dx+\int^\infty_0 \lambda e^{-\lambda x} \,  dx\\[8pt] &=&0+\int^\infty_0 \lambda e^{-\lambda x} \, dx \\[8pt] &=&\lambda\int^\infty_0 e^{-\lambda x} \, dx \\[8pt] &=&1 \end{eqnarray*}  The problem is that my professor just told me that I skip a step right before I derive $1$. Any insight?  EDIT:  Given the great feedback, here is the answer:  \begin{eqnarray*} f(x)&=&\int^{\infty}_{-\infty} \lambda e^{-\lambda x} dx=1\\\\ f(x)&=&\int^{\infty}_{-\infty} f_X(x)dx\\ &=&\int^{0}_{-\infty} 0\,\,\, dx+\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &=&0+\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &=&\int^{\infty}_{0} \lambda e^{-\lambda x} dx\\ &=&\int^{\infty}_{0} e^{-\lambda x} \Big(\lambda \,\,\,dx\Big)\\ &=&\int^\infty_0e^{-u} du\\ &=&-e^{-u}\Big|^{\infty}_0\\ &=&1-\lim _{x \to \infty} e^{-u}\\ &=&1\\ \end{eqnarray*}


1.When should we come today?   2.At what time should we come today?     Which one is correct? I want to know the exact time.

When do I have to come to the office tomorrow?   or      At what time should I come to the office tomorrow?    Are both of them correct? If so, do both of them mean the same? Which one can be used in a formal conversation?


Original charger: Input: 100-240V , 50-60Hz , 1.6A Output: 19V , 3.42A  New Charger: Input: 100-240V , 50-60Hz , 1.5A Output: 19V, 3.42A

I have a Toshiba Satellite laptop. My charger has stopped working.  I have access to a Lenovo charger. Can I use this charger on my laptop?


I know this question has been asked many times, but when I attempted to use the accepted answer that I found , it does not work, so I assume I'm missing something.  I was attempting to match the Mrs. in the string Rothschild, Mrs. Martin (Elizabeth L. Barrett) using this regular express:  .*, (.*\.).*   But this does not work because of the L..  I then attempted to add the ? a number of different ways, but it still matches all the way to L..  Some things I tried:  .*, (.*\.?).* .*, (.*\.*?).* .*, (.*\.+?).* .*, (.*\.??).*   But none of these work.  Can anyone see what I am missing here?

I have this gigantic ugly string: J0000000: Transaction A0001401 started on 8/22/2008 9:49:29 AM J0000010: Project name: E:\foo.pf J0000011: Job name: MBiek Direct Mail Test J0000020: Document 1 - Completed successfully  I'm trying to extract pieces from it using regex. In this case, I want to grab everything after Project Name up to the part where it says J0000011: (the 11 is going to be a different number every time). Here's the regex I've been playing with: Project name:\s+(.*)\s+J[0-9]{7}:  The problem is that it doesn't stop until it hits the J0000020: at the end. How do I make the regex stop at the first occurrence of J[0-9]{7}?


Its rough right now, but I'm stuck because I can't find a way to access either digits (an array of integers (it has to be a private array, per the assignment rules)) or size. Is there a way to access constructor variables in methods within the same class?  I'm not sure what to try, as I'm still in the very basic stages (only a lesson or two in Java) and I don't know how to continue.  public class Zillion {     private int[] digits;     String strdigits;     public Zillion(int size) {         int[] digits = new int[size]; } public String toString() {     for(int x=0; x<digits.length; x++) {         strdigits += digits[x];         System.out.println(strdigits);     }     return(strdigits); }  public static void main(String[] args) {     Zillion z = new Zillion(2);        System.out.println(z);  //  00  2 points   }   }  Below are my errors; System.out.println(z) is supposed to output 00, but it seems the code gets trapped by a NullPointerException when I try to access digits.length in line 10.  Exception in thread "main" java.lang.NullPointerException     at lab4_carl6188.Zillion.toString(Zillion.java:10)     at java.base/java.lang.String.valueOf(String.java:3042)     at java.base/java.io.PrintStream.println(PrintStream.java:897)     at lab4_carl6188.Zillion.main(Zillion.java:19)

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I needed to uninstall LXLE (a Linux distro) on my laptop and use just Windows 7 instead. I read somewhere that going into the root terminal and typing sudo apt-cache show lxde and then deleting the files shown would uninstall LXLE, so I did that and rebooted. But now whenever I try to boot, I get the following error upon startup: file /boot/grub/i386-pc/normal.mod not found.  Now I need to know how I can get my computer to just launch Windows instead when I boot. Typing into the grub rescue> (whatever that is...) does nothing. Please use layman's terms, I have no experience with this kind of stuff and won't understand a bunch of technical jargon.

error: file '/grub/i386-pc/normal.mod' not found. grub rescue>   What can I do? I just sit and stare at it.   I found my old netbook (Dell Inspiron 1010) which I have not used for about four years. I replaced Windows XP with Ubuntu 12.10. I used my bootable USB drive. I installed and rebooted. I got the message that normal.mod is not found.   What should I do? Type exit, reboot, or quit? Should I re-install?


Prove that determinant of triangular matrix is the product of its diagonal entries. I want to use $\operatorname{'sgn'}$.I know that $\operatorname{det}(A)=\sum\limits_{\sigma}A(1,\sigma1)...A(n,\sigma n)$.Any help. Thanks in advance.

Prove that the determinant of an upper triangular matrix is the product of its diagonal entries.  What I have so far:  We will prove this by induction for an $n$ $\times$ $n$ matrix. For the case of a $2 \times 2$ matrix, let A=$ \left( \begin{array}{ccc} a_{11} & a_{12} \\ 0 & a_{22}  \end{array} \right)$. So det($A$)=$a_{11}a_{22}$ and the statement is true for the case of a $2 \times 2$ matrix. Now suppose that this statement is true for an $n$ $\times$ $n$ matrix. We will show that it also is true for an $(n + 1)$ $\times$ $(n + 1)$ matrix. Let A =$ \left( \begin{array}{ccc} a_{11} & a_{12} & \cdots & a_{1(n+1)}\\ 0 & a_{22} & \cdots & a_{2(n+1)} \\ \vdots & \cdots &  & \vdots\\ 0 & 0 & \cdots & a_{(n+1)(n+1)}\end{array} \right)$.  I don't know what to do after this.


Does the cartesian product have an associative property such that $M_1\times(M_2\times M_3) = (M_1\times M_2)\times M_3$, or does the different order result in different ordered pairs?

I have a basic doubt about the associativity of the cartesian product. Well, first wikipedia says that the cartesian product isn't associative, and there's a good argument for it: if $x\in E$, $y\in F$ and $z \in G$ the identity $((x,y), z)=(x,(y,z))$ would imply that $(x,y) =x$ and $(y,z) = z$ so that $((x,y),z)=(x,y,z)$ would mean nothing.  That's fine, I like this argument. However, in his book Calculus on Manifolds, Spivak says that the cartesian product is associative. He says: if $A \subset \mathbb{R}^m$, $B\subset \mathbb{R}^n$ and $C \subset \mathbb{R}^p$ then $(A\times B)\times C = A \times (B \times C)$, and both of these are denoted simply by $A \times B \times C$.  Well, this confuses me because Spivak is always very rigorous, so that he wouldn't state something that's not true in such way. Is Spivak or Wikipedia right ? Or Spivak's statement only works for subsets of euclidean spaces ?  Thanks in advance and sorry if this question is too basic.


Is there any convenience in name date-time related columns? created and delivered, … or createdTS, deliveredTS or createdAt, deliveredAt or…

When I am looking to create some timestamp fields (or other date/time style fields), what is the best way to name them? Should I just put record_timestamp?


Assume that the set $I \subseteq \mathbb{Z}$ satisfies the following properties:  (a) There exists $n \in I$ such that $n \not = 0$  (b) If $m, n \in I$, then $m + n \in I$  (c) If $m \in  I$ and $a \in \mathbb{Z}$, then $am \in I$  Prove that there exists $n_0 \in \mathbb{Z}$ such that $I = \{kn_0 | k \in \mathbb{Z}\}$  Not too sure if I am correct but I am thinking if $n_0$ is actually $gcd(m, n)$, then $I$ would be the set of all integer combinations of $m$ and $n$. So essentially this question is to relate the set of all integer linear combinations to the set of all integer multiples of the $gcd(m, n)$.

I have the following problem:  Let $a, b \in\mathbb{Z}$. Show that $\,\{ ax + by\ :\ x, y \in \mathbb{Z}\} = \{ n \gcd(a,b)\ :\ n\in \mathbb{Z} \}$   I understand that the Bezout's lemma says that $gcd(a,b) = ax +by$, so Im not really how you would go about proving the above, it doesn't really make sense to me. Any help is appreciated1


the following factory function has on = false. function Radio(mode) {   let on = false;    return {     mode: mode,     turnOn: function () {       on = true;     },     isOn: function () {       return on;     }   }; }  If I created an object using this factory function and used the function fmRadio.turnOn(); inside it to change the value of on to be true like in the following lines.. let fmRadio = Radio('fm');  fmRadio.turnOn();  The output of fmRadio.isOn(); will be on = true So, Where does on variable change? I mean it's not part of the fmRadio object created..if we tried to call it it will return undefined fmRadio.on; //undefined  Does it change the value of on in the original factory function?

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.


Gravitational waves arises when mass is rotating in another mass'orbital, in explosions and of course in case of colliding black holes. But are they also created when mass is moving and speeding because the space itself is expanding? And is there also a kind of 'red-shifting' of the waves because they are moving away?

It would seem that LIGO measures wibbles in the metric (not manifold) of spacetime:    It would seem that the expansion of the universe is an expansion of the metric of spacetime:    Imagine for a moment that LIGO is not an interferometer. (So, it just plain times speed changes, rather than using phase shift of orthogonal directions.)  If the ends of one of the arms was indeed receding away from each other, at a speed consistent with the expansion of the universe, is the sensitivity of real-world LIGO of the needed sensitivity of a machine which could measure that shift?  On other words: ideally I'd like to know these two meters:  (A) The left arm of LIGO is about 4km. It was stretched/shrunk (a few times) for roughly .01 seconds by the gravitational wave.  How many meters was it stretched/shrunk in .01 seconds?  (B) Assuming the same abstract LIGO arm was affectable and affected by the expansion of the Universe. How many meters is it stretch/shrunk every .01 seconds?    Note - of course, an interferometer is an ingenious device to measure extremely small changes in speed - assuming the changes are orthogonal. Of course, an interferometer, per se, can't at all measure the expansion of the universe since that is uniform in both directions. The sense of my question is, can something that measures distance changes > as accurately as < the LIGO does, measure the expansion of the universe?  How big or small is the ongoing expansion of the universe compared to the wibble from the black hole system in question?


\begin{equation} g(f,t) = \begin {cases} %\begin{align}        b^Nt^N^-^1e^2^\pi^b^t cos(2\pi ft), & t\geq 0;       \\       & 0 & otherwise;             %\end{align}     \end{cases}     \end{equation}

\begin{equation} g(f,t) = \begin{cases}          \bigl{b^Nt^N^-^1e^2^\pi^b^t cos(2\pi ft),  \text{t\geq 0;}\\          0 \text{ $ otherwise $}          \end{cases} \end{equation}


In preparing an input for SHA256 or RIPEMD-160 a single bit (1) is appended to the message before adding any necessary zero padding and before adding the bitlength (64 bits) to form 1 or more 512 bit blocks. What is the purpose of adding the single bit (1)?

Appending the length of the message when padding of a SHA-2 message is sufficient to satisfy the Merkle-Damgård construction.  However the padding in SHA-2 also pads with 10* between the end of the message and the message length data.  I know that 10* padding lets one turn non-block-aligned length messages into block-aligned length messages in a reversible way.  However, because the padding already encodes the bit length of the original message, this 10* padding is redundant.  Using the bit length data we can already determine where the original message ends and 0* padding would be sufficient.  In fact, in "One Way Hash Functions and DES. Advances in Cryptology" in Crypto’89, Merkle uses 0* padding followed by the length.  So my question, why does SHA-2 call for doing 10* padding in addition to appending the message length?


I can't upgrade from 16.04 LTS to 17.04 due to this error when i run sudo do-release-upgrade:  authenticate 'zesty.tar.gz' against 'zesty.tar.gz.gpg'  gpg exited 2 Debug information:   gpg: Signature made using RSA key ID C0B21F32 gpg: Can't check signature: public key not found  i already refreshed my repos before running the command

I want to upgrade my Ubuntu 13.04 to Ubuntu 13.10. I'm unable to do via GUI.   [ The reason why I'm unable to do so:  Via software updater, I proceed ahead and click upgrade (for upgrading my OS). I authenticate by providing my password. Then it proceeds and downloads upgrade tool. That time only (while downloading the tool) error message comes "system program problem detected". It then doesn't proceed ahead and I click to report the problem ]  So, I tried via command line but here also I couldn't succeed upgrading my OS.  For the same I ran   $ sudo apt-get update   Then I ran  $ sudo apt-get dist-upgrade   And then:  ravbholua@ravbholua-Aspire-5315:~$ sudo do-release-upgrade Checking for a new Ubuntu release Get:1 Upgrade tool signature [198 B]                                                                                Get:2 Upgrade tool [1,135 kB]                                                                                Fetched 1,135 kB in 6s (32.9 kB/s)                                                                                authenticate 'saucy.tar.gz' against 'saucy.tar.gz.gpg'  gpg exited 2 Debug information:    gpg: Signature made Friday 01 November 2013 10:34:27 AM IST using DSA key ID 437D05B5 gpg: Can't check signature: public key not found  Authentication failed Authenticating the upgrade failed. There may be a problem with the network or with the server.  ravbholua@ravbholua-Aspire-5315:~$    Please suggest how to go ahead and upgrade my OS.


Most of our traffic doesn't come to the root of our web site: .  But I would like to know just how much does? It seems like an easy thing to do, and an easy thing to search for, but so far I haven't been able to find the solution.

Most of our traffic doesn't come to the root of our web site.  But I would like to know just how much does? It seems like an easy thing to do, and an easy thing to search for, but so far I haven't been able to find the solution.


I know, it doesn't make much sense to flag a question or answer post once a question is historically locked, because in theory nothing should need to change in the question ever again.  Recently, the  tag was cleaned up.  However, there are two questions (, ) that still have the tag associated with it, which is preventing it from getting cleaned up in the nightly cleanup.  Since the questions are historically locked, I can't even flag them for moderator attention.  Two questions:   Can a moderator please remove the tag from these questions so that it can get cleaned up? Is there a more appropriate way to flag these questions for attention than bringing it up on Meta?  Or is this such an edge case that it's just easier to bring it up here instead of doing something silly like flagging some other question and then including your request in the "Other" notes?

My understanding is that a question is historically locked because the information in it is too valuable for the question to be deleted.   But if the "valuable information" becomes obsolete, what happens then?  We cannot modify the question content, or the answers for a historically locked question, right?


Why can't I do this?        services.AddSingleton<Type.GetType("ShoppingCartCache",true)>();   OR is there a better way of passing  from a string

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>()     {         //...     } }


string = "ABCDEFGH"   Can anyone explain why in string[start:end:stride]  the start always starts from 0 while end starts with 1.  For example string[0:3:1] outputs the result as "ABC". As you can see I said end = 3 so shouldn't the string[0:3:1] be "ABCD" because computer read 0 first?  And one more thing why: I don't get a result for  string[0:8:-1]. Shouldn't it be "HGFEDCBA"? I don't know if it is wrong syntax or not but I can print the result of string[::-1].

I need a good explanation (references are a plus) on Python's slice notation.   To me, this notation needs a bit of picking up.   It looks extremely powerful, but I haven't quite got my head around it.


With bash, I used to executed ls *.JPG to list all JPG files of a directory, but since macOS suggested me to move to zsh, this simple command doesn't work anymore and gives me the following error:  $ ls *.JPG       ls: illegal option --   usage: ls [-@ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1%] [file ...]   What the appropriate equivalent with zsh ?

If I have a file which name starting with single or several minus sign, for example --1 it can't be used as a parameter of many commands. Even if I run  cat --1   instead of file content I get unrecognised option error message:  cat: unrecognized option '--1'   Same effect appears when I type  cat "--1" cat '--1' cat \-\-1   nothing works. Files starting with '-' is not illegal in file system, but it is quite hard to work with them in cli and scripts. OK, in case of cat or grep I can use  cat <--1   and this will work, but  rm --1   won't work either and it is quite hard to substitute this command with something else. Very uncomfortable after all. Is there any universal workaround different from not using such file names?   BTW, if name file is single - and all most of commands will understand it as stdin, wouldn't they?   And it would be hard not to use such file names since I can't rename them all in script using mv command either.


I have an Asod 7 inch tablet. My daughter put in a password to lock the screen and can't remember what it is. How do I reset it so she can unlock and use her tablet?

I've read  which states that there is an option to disable the lock using my Google account information. However I did not noticed such an option when I entered my password five times wrong. (Although there was also a 20s or 30s delay to complicate brute force attacks.) I use Android 4.0.3 on a Asus Transformer Prime TF201.  Would factory reset work?


We have been struggling with a rogue DHCP server for quite some time now.   Users are meant to be on a network of 192.168.10.xx with .14 as the DNS, and .254 as the gateway, but this will set users on a subnet of 192.168.30.xx with both DNS and gateway as x.x.30.1.  Our site consists of a Windows Server 2012, with 2 virtual machines also running Server 2012 (an Exchange Server and a Terminal Server).  Our main Draytek router (x.x.10.254) connects to an ISP provided ethernet WAN switch and radio ethernet modem. It points users to the pre-configured .14 DNS/DHCP Windows server.  Then a Netgear R7000 is used as a wireless access point. DHCP is disabled, and points users to x.x.10.14. This provides extra WiFi coverage for the factory laptops.  Initially I suspected it was the R7000, but after putting it on custom firmware, the issue persists.  The issue can happen to both users on the ethernet hardwire, AND both WiFis.  Running some network scans, I can see x.x.30.1 has a MAC address of 00-ac-a8-72-ed-2e. But this doesn't seem to give me any help in finding it. As it doesn't belong to any known manufacturers.  Thanks in advance, and I hope this is enough information.    EDIT: I found the answer!  Turns out there was an old VPN (SoftEther) service that was enabled with a DHCP service for incoming connections. Not sure how, but it mustve got mixed up and was handling half the PC's in the network

Over the last 3-4 weeks I have been trying to find a rogue DHCP server on my network but have been stumped! It is offering IP Addresses that do not work with my network, so any device that needs a Dynamic Address is getting one from the Rogue DHCP and then that device stops working. I need help to find and destroy this thing! I think it might be a Trojan of some sort.  My Main Router is the only valid DHCP Server and is 192.168.0.1 which offers a range of 192.160.0.150-199, and I have this configured in my AD as Authorized. This ROGUE DHCP claims to be coming from 192.168.0.20 and offering an IP Address in the range of 10.255.255.* which is messing up EVERYTHING on my network unless I assign a static IP Address to it. 192.168.0.20 does not exist on my network.  My network is a single AD Server on Windows 2008R2, 3 other physical servers (1-2008R2 and 2 2012R2) about 4 Hypervisor VM's, 3 laptops and a Windows 7 box.  I can't ping the rogue 192.160.0.20 IP, and I can't see it in the ARP -A output, so I can't get its MAC address. I'm hoping that someone reading this post has come across this before.


Given 5 wires (possibly more), I want to press a Reset button, and have exactly one of those wires, randomly selected, become active - and remain that way (until the next button press). What is a simple way of doing that?

I have 5 buttons and only one of these can be correct, all others must be false. These 5 outputs will go into 2 outputs, in between there needs to be a circuit which changes which single button out of the 5 will go down the "correct" output of the final 2. The 4 remaining buttons must go to the second of the final 2 outputs. Both final outputs must give out a true signal for a brief period the same as a button on its own would produce. There should also be a way of activating the circuit. Not sure if that is explained well enough so I have made a basic diagram of what I need.  The diagram shows how I need the signal to be split. However in between the buttons and the final two wires there needs to be a circuit (marked by the grey box). This circuit changes the single button connected to the left wire. The right input should start the circuit and randomise the 5 buttons. There are no limits to size, amount of materials used or method used. This question is similar to the one asking about , but I am specifically working with Redstone circuitry - the commands solutions do not apply here


I need two Apple Developer accounts, one for one type of games and one for another. But I need both to be in my name, and I'd like to use same card for payment. Is it possible and allowed? I cannot find any info on this.

I've read multiple messages on the subject, but I wondered if anyone had first hand experience (or genuine knowledge one way or another), if it is possible to more than one Apple Developer account?   As far as I know, you can create one for each Apple ID that you have, but I have not been able to find anything that suggests this is not possible (or breaches any rules). Are Apple likely to be bothered as long as you pay the $99/year for each Developer Account?  There is a link  that seems to suggest that it is possible   Would appreciate any comments on the subject.  Thanks.


I need my text as following. It was raining (De Silva & Lee, 2018). There was a cat (Kahouli & Maktouf, 2015, p. 12). Baier, Yotov, and Zylkin (2019) said that the cat was running. First, the versions like \citep etc not working. Secondly I got the title of article to all lower case in the bibliography. Moreover, I would like to make the in text citations in blue font and hyperlinked. A lot of guidance available online on this topic but that is confusing or works only partially. Any help please! \documentclass[12pt]{article} \usepackage{comment} \usepackage[margin=1in]{geometry} \usepackage[none]{hyphenat} \usepackage {apacite} \usepackage{amsmath} \usepackage{graphicx} \usepackage[affil-it]{authblk} \usepackage[flushleft]{threeparttable} \usepackage{rotating} \usepackage[title]{appendix} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \renewcommand{\headrulewidth}{0pt}   \fancyfoot{} \fancyfoot[C]{\thepage} \setlength{\parskip}{1em} \renewcommand{\baselinestretch}{1.15}  \title {\textbf {This is an interesting title of the article}} \author[1]{Firstname Lastname} \affil[1]{ABC University, City, Country} \begin{document} \maketitle \bibliographystyle{apacite} \pagebreak  \section{Introduction} It was raining \cite{de2018does}. There was a cat \cite{kahouli2015trade}. \cite{baier2019widely} said that the cat was running.  \bibliography{References} \end{document}  The reference in the separate Reference.bib file I put here. @article{baier2019widely,   title={On the widely differing effects of free trade agreements: Lessons from twenty years of trade integration},   author={Baier, Scott L and Yotov, Yoto V and Zylkin, Thomas},   journal={Journal of International Economics},   volume={116},   pages={206--226},   year={2019},   publisher={Elsevier} }  @article{de2018does,   title={Does the role of observer countries in the regional trade agreement matter for intra-regional trade?},   author={De Silva, Dakshina G and Lee, Soon-Cheul},   journal={Applied Economics},   volume={50},   number={20},   pages={2219--2228},   year={2018},   publisher={Taylor \& Francis} }  @article{kahouli2015trade,   title={Trade creation and diversion effects in the Mediterranean area: Econometric analysis by gravity model},   author={Kahouli, Bassem and Maktouf, Samir},   journal={The Journal of International Trade \& Economic Development},   volume={24},   number={1},   pages={76--104},   year={2015},   publisher={Taylor \& Francis} }

I am really new to LaTeX and I need a comprehensive solution for my Thesis  I have this problem since two days and I couldn't find any solution in any other post.  I work with BibDesk on Mac  And I used Packages apacite and natbib  @article{Ha89, Author = {Peter M. Haas}, Date-Added = {2017-02-06 21:15:57 +0000}, Date-Modified = {2017-02-06 21:45:06 +0000}, Journal = {International Organization}, Lastchecked = {03/02/2010 12:54}, Number = {3}, Pages = {377-403}, Publisher = {Peter Haas}, Read = {0}, Title = {Do regimes matter? Epistemic communities and Mediterranean pollution control}, Urldate = { http://www.jstor.org/stable/2706652}, Volume = {43}, Year = {1989}}   this is a stripped version of my document:  \documentclass[11pt, oneside]{article}  \usepackage{lipsum} \usepackage[margin=1in, left=1.5in, includefoot]{geometry}   \usepackage{ragged2e} % REFERENCE PREAMBLE %\usepackage{url} \usepackage{apacite} \usepackage{natbib} %\usepackage{biblatex-apa}                                                   % Bullet preamble \renewcommand{\labelitemi}{$\bullet$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\circ$} % graphics preamble \usepackage{graphicx}   %Allows you to import images \usepackage{float}      %Allows for control of float positions %HEADER AND FOOTER STUFF \usepackage{fancyhdr}  \pagestyle{fancy} \usepackage{graphicx}        \usepackage{amssymb} %Zeilenabstand 1,5 wenn aktiviert  \usepackage{setspace}\makeatletter\newcommand{\MSonehalfspacing}{\setstretch{1.44}\ifcase \@ptsize \relax\setstretch {1.448}\or\setstretch {1.399}\or\setstretch {1.433}\fi}\newcommand{\MSdoublespacing}{\setstretch {1.92}\ifcase \@ptsize \relax\setstretch {1.936}\or\setstretch {1.866}\or\setstretch{1.902}\fi}\makeatother\MSonehalfspacing %Zeilenabstand Code fertig \usepackage[hidelinks]{hyperref}   %allows for clickable reference %                       BEGIN OF DOCUMENT \citeA{source} %                       REFERENCES  \renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} \fancyhf{} \rhead{\fancyplain{}{Identifying the Regime}} \lhead{\fancyplain{}{List of References}} \cfoot{\fancyplain{}{\thepage}}  \setlength\bibitemsep{1.9\itemsep} \bibliography{/User/Desktop/Thesis/references/mybib.bib}                   \bibliographystyle{apa} \addcontentsline{toc}{section {\numberline{}References}                                                       \end{document}   I would like to have the bibliography entry include a retrieved from    I tried to deactivate hyperref – as suggested in another post – but it didn't work. I also tried to activate and deactivate natbib and apacite as well.   I would really appreciate any help...


I want to build room in Kotlin using my function getDatabase(context) and I have this error :  W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getName()' on a null object reference W/System.err:     at android.arch.persistence.room.Room.getGeneratedImplementation(Room.java:77)   This is very strange because it's the first time I have this error (I use Room in other project and I don't have this bug). The app don't crash but the database is not working.  I try looking in internet but I don't see nothing about this bug (only this japanese guy :  but I don't understand japanese).  AppDatabase :  @Database(entities = [(Wallet::class), (Historique::class)], version = 1) abstract class AppDatabase : RoomDatabase() {     abstract fun walletDao(): WalletDao     abstract fun historiqueDao(): HistoriqueDao }  private var INSTANCE: AppDatabase? = null  fun getDatabase(context: Context?): AppDatabase {     if (INSTANCE == null)         INSTANCE = context?.let { Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME).build() }     return INSTANCE as AppDatabase }   This is my Gradle :  apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt'  android {     compileSdkVersion 27     defaultConfig {         applicationId "my.app"         minSdkVersion 19         targetSdkVersion 27         versionCode 1         versionName "1.0"         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"     }     buildTypes {         release {             minifyEnabled false             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'         }     } }  dependencies {     implementation fileTree(dir: 'libs', include: ['*.jar'])     implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"     implementation 'com.android.support:appcompat-v7:27.1.1'     implementation 'com.android.support.constraint:constraint-layout:1.1.0'     implementation 'com.android.support:support-v4:27.1.1'      implementation "android.arch.persistence.room:runtime:1.0.0"     annotationProcessor "android.arch.persistence.room:compiler:1.0.0"     kapt "android.arch.persistence.room:compiler:1.0.0"      implementation "org.jetbrains.anko:anko-commons:0.10.4"     implementation "org.jetbrains.anko:anko-design:0.10.4"     implementation "com.chibatching.kotpref:kotpref:2.5.0"     implementation "com.chibatching.kotpref:initializer:2.5.0"     testImplementation 'junit:junit:4.12'     androidTestImplementation 'com.android.support.test:runner:1.0.1'     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Is there a criterion for a sequence in $C[0,1]$ to converge weakly?  Let $\{f_n\}$ be a sequence in $C[0,1]$, $f\in C[0,1]$. Suppose $f_n\to f$ (weakly). Then for each $x\in [0,1]$ $ev_x(f_n)\to ev_x(f)$, i.e. $f_n(x)\to f(x)$. Thus, pointwise convergence is necessary. I guess it is not enough. Could you give any reference?

Is there some simple characterization of weak convergence of sequences in the space $\ell_\infty$? If yes, is there some similar claim for nets?   I was only able to come up with a characterization of sequential weak convergence using limit along ultrafilters, which I will describe below. I wonder whether there is some insight into this characterization. (E.g. whether there is some simple reformulations which does not use ultralimits.) Moreover, I do not know whether at least this characterization works for nets, too.  We have the following result describing weak convergence in $C(K)$, see e.g. Corollary 3.138,  in Banach Space Theory by Fabian, Habala et al. (It is a consequence of Rainwater theorem and characterization of extreme points of unit ball in $C(K)^*$.)     Let $K$ be a compact topological space. Let $\{f_n\}$ be a bounded sequence in $C(K)$ and $f\in C(K)$. Then, if $f_n\to f$ pointwise, we have $f_n\overset{w}\to f$.   Moreover we have isometric isomorphism between $\ell_\infty$ and $C(\beta\mathbb N)$, which is described e.g. in the Wikipedia article on  or in  of Carothers' book A short course on Banach space theory. This isomorphism assigns to each bounded sequence $(x_n)$ the continuous function $\overline x$ on $\beta\mathbb N$ defined by $$\overline x(\mathscr U) = \operatorname{\mathscr U-lim} x_n,$$ where $\operatorname{\mathscr U-lim} x_n$ denotes the  of $x_n$ w.r.t the ultrafilter $\mathscr U$.  Combining the above results we get the following characterization:      Let $f^{(n)},f\in\ell_\infty$. The sequence $f^{(n)}$ converges to $f$ weakly if and only if for every ultrafilter $\mathscr U$    $$\lim_{n\to\infty} \operatorname{\mathscr U-lim} f^{(n)}= \operatorname{\mathscr U-lim} f.$$   (The above claim for principal ultrafilters is just a pointwise convergence. But in the above claim the equality is required for free ultrafilters, too.)


I am trying to make a full Ubuntu install on my 16 GB flash drive. I currently have a persistent Edubuntu 12.04 LTS on it, but this is the install version, which has an annoying "Try Ubuntu" button, as well as a "Install Ubuntu 12.04 LTS" app in it. Is  this possible?

If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.   I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.  To do this, I need to install the nVidia drivers first (sigh).  To do this, I need changes to persist a reboot.  To do this, I need to really install Ubuntu on a USB key.  How do you do that?    What I tried   I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu:  sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso   ...but the installer didn't detect the disk properly.


Could someone please help me with this question: Let A be the n×n matrix whose elements are given by a_ij = ij. Find its eigenvalues and its eigenvectors. The only way I can think of is taking the determinant of A-labda*I, but this seems like very tedious work. Then I thought I should first apply Gauss-Jordan elimination, but I'm really stuck on how to do that here. Any help would be very much appreciated! Ps. Is there a name for this kind of matrix? If there is, that would be helpful for googling!

Let $A$ be a $n\times n$ matrix such that $a_{ij}=ij$.  I want to find the eigenvalues of the matrix $A$.   Efforts: $n=2$, I found that eigenvalues are equal to $0,5$.  For $n=3$, I found eigenvalues are equal to $0,0,14$. For $n=4$ I found eigenvalues are equal to $0,0,0,30$.  For $n=5$ I found eigenvalues are equal to $0,0,0,0,0,55$.  It looks like there is a pattern here. Eigenvalues of $n\times n$ matrix seems to be $\sum_{i=1}^n i^2, \underbrace{0,0,0,..0}_{n-1\text{ times}}$.  But how can I prove it? I mean whether there are some beautiful arguments that makes things easy, and ideas clear.   Thanks for reading and helping out.


For my study next year, my computer has to run Windows. It's a requirement. Right now, I want to get used to it a little more, so I plan on installing Windows preemptively.  I'm currently running Ubuntu 14.04, though originally my laptop came with Windows 8 installed. I believe this means that my activation code or whatever is stored within the BIOS(?). I do not own a CD with Windows 8(.1) on it. I have a 250GB external hard drive -- more than enough to store all my files.  Now, my question is, what is the easiest and safest way to switch to Windows 8(.1), while keeping all my files?  I've tried dual-booting in the past, but it didn't work out for me.  I thought of this plan:   First I'd copy my entire Home folder to my external hard drive. Meanwhile, I'd search the PirateBay or KickassTorrents for a copy of Windows 8(.1) (this is legal in my home country: I'm allowed to download anything I've technically paid for)  Then I'd burn that copy to a CD or DVD Then boot up from the disk and tell it to erase all data and install Windows Lastly, I'd reallocate all my files from my hard drive to my laptop   Is this a reasonable plan of action?  I'm extremely afraid I forgot an essential step or am planning to do something that simply is not possible.

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I am in need of drawing chemical complexes in space, with octahedral or tetrahedral or square or any other structure (for instance [Co(SO_4)(NH_3)_5]^+). Would anyone have any suggestion about which package to go to ? My inclination would be tikz but would there be some more specific package ? I don't think chemfig would be suited for that... ? Thanks and have a great day !

how can I add the charge and the counter ions to my complex? I'm using chemfig.  \schemestart \chemname{\chemleft[\chemfig{Ni (<:[1]OH_2) (-[2]OH_2) (<:[3]OH_2) (<[5]OH_2) (-[6]OH_2) (<[7]OH_2) }\chemright]}{\ce{[Ni(OH2)6]Cl2}} \schemestop     Thanks!


firstly apologies I'm a newbie at practical electronics!  I have a sensitive little thing which can measure 0-3.3v DC in steps of 0-1023. I'd like to use it to measure the voltage on a "12v" vehicle battery - which as I'm sure you know can go significantly higher when being charged through an alternator so really I need to figure out the following:  What circuit can I design to take a DC input of between... 10v and 15v... DC and bring it down to <3.3v in such a way that I can still measure the difference?  I have seen some similarish posts but all have been (a) relatively specific and  (b) not explained in laymans terms that I could understand.  thanks

I have an analog signal which ranges between 0V and 10V.  I want to linearly scale it down to 0 to 2.5V for my ADC.     I'm concerned that using a resistive voltage divider will affect signal quality.  Is this true?  If it's not true, what value resistor should I use for voltage divider?


I cannot hit this node application from the browser 52.138.7.79 refused to connect. but i can load up nginx on 80 fine. also i can hit it on the machine using curl. This is running on a Azure Vm and the port is open, the rhel firewall is disabled ... any help is appreciated.

This is a  about Connection Refused    We see a lot of questions to the effect      When I try to connect to a system I get a message      Connection refused      Why is this ?


This is not a homework question. It is one of my practices. Please help me understand where i did wrong. The original was static void changeArray, but i changed it to static int changeArray and inserted a return statement at the end, but it still won't update the main code.            public class testing{  /*  * Change the method to also update the key at the main  */  static int changeArray(int key, int array[]){      key = key + 7;      for (int i = 0; i < array.length; i++){         array[i] = array[i] + key;     }      System.out.println("*At changeArray *");     System.out.println("The key is: "+ key);     return key;   }  static void printArray(int array[]){      System.out.print("[ ");     for (int element:array){         System.out.print(element + " ");     }     System.out.println("]"); }  public static void main(String[] args){     int key = 5;     int[] array = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19};      System.out.println("*At the main *");     System.out.println("The key is: "+ key);      printArray(array);     changeArray(key, array);       System.out.println("*At the main *");     System.out.println("The key is: "+ key); <--- (this is supposed to be 12 after the method is called, but it keeps printing out 5)     printArray(array); }   }

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Yes speaking wise on seems much better. But if friday is adjective then preposition must be according to evening i.e. it should be in.

I have found the following usage of "on", "at" and "in" on the internet. Is there any other exception and/or rule for that?  Prepositions of Time Use in for  Months: in April / in September / in that month Seasons: in (the) summer / in (the) winter Years: in 1332 / in 1984 / in that year / in the next year Long Period(s) of Time: in former century / in 90's / in the Ice Age / in the past / in the future  Exceptions: in the morning / in the evening Use at for  Time: at 8 o'clock / at 9:30 / at bedtime / at sunset / at dinnertime / at 5:33:10 AM  Exceptions: at Christmas (= during the Christmas holidays but not necessarily on December 25th) / at Easter  / at noon / at night / at the weekend / at the present time / at the moment Use on for  Days: on Monday / on Friday / on Christmas Day (= on December 25th) / on Easter Sunday / on Independence Day Dates: on February 18th / on her birthday / on 21 March 2015 / on  Notice:  We have in the morning and on Monday but we say on Monday morning, not in Monday morning, and so on. When we say last, next, every, this we do not also use at, in, on: She runs next Tuesday. (not on next Tuesday) / He leaves us every Easter. (not at every Easter) / I See you this evening. (not in this evening) Look at these examples for the combination of times in a sentence: We will meet next week at six o’clock on Monday. / I heard a funny noise at about eleven o’clock last night. / It happened last week at seven o’clock on Monday night.   Look at  as well which says:  This all hints at a coherent metaphor: hours and other short periods of time are places; days are surfaces; months and longer time periods are containers.


Let $X$ be a universe. Let $\{A_i\}_{i\in \Lambda}$ be a family of sets in $X$, where $\Lambda$ is a set of index. Could you help me to prove?  $$X\setminus\bigcap_{i\in\Lambda}A_i=\bigcup_{i\in\Lambda}(X\setminus A_i)$$  where $X\,\backslash A_i$ denotes the complement of $A_i$

Let $X$ be a set and $\{Y_\alpha\}$ is infinite system of some subsets of $X$. Is it true that: $$\bigcup_\alpha(X\setminus Y_\alpha)=X\setminus\bigcap_\alpha Y_\alpha,$$ $$\bigcap_\alpha(X\setminus Y_\alpha)=X\setminus\bigcup_\alpha Y_\alpha.$$ (infinite DeMorgan laws)  Thanks a lot!


I'm a U.S. citizen, about to go from Boston to London.  I thought ESTA was for non-citizens entering USA.  But the airline shows me a web page saying I must have it to go to or from USA or UK.  And not a word to suggest that it doesn't apply to all nationalities.  The application form suggests that my first thought was correct and that I don't need it.  Since my first leg to BOS boards forty hours from now, this is a disturbing development.  Am I right (not needed) or are they right (I'm in trouble)?  UPDATE: Since I posted the question, they roamed the word "from" and it now says "Visa Waiver Program When travelling to the USA,United Kingdom, all passengers eligible to travel under the Visa Waiver Program must apply for an Electronic System Travel Authorisation (ESTA). Read more"  Clicking on "read more" says a lot about both USA and UK.

I am an American citizen, looking to fly to the EU. I am feeling I do not need an ESTA because the wording implies the necessity of the document belongs to non-US citizens. May be an obvious question, but I would like to be sure. I wouldn't want to ruin plans due to a misstep.


#!/bin/bash x=1 while [ "$x" -lt 20 ] do     echo "$x"     x=("$x" * 5); done   Getting error as syntax error near unexpected token `done' and getting output as 11111111111....

Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.


I am interested in transforming a defeated boss into a series armor based objects that grants the racial traits of the transformed for other individuals in game, could someone describe any spells or classes, or curses that a player character could use to accomplish this? I am interested in it working similar to the Fusion Spell for Psions, and would like to avoid wise spell if possible. I do not have access to every book available and wanted to gather some of ideas. Weird Idea but I wanna see if it could be done.

Could someone describe to me a method for changing a corporeal creature with Supernatural and Extraordinary racial abilities into a set of armor that would grant those same racial abilities to the wearer?  Neither the setting, nor the magic, nor crafting matter so long as it is not built from an inherited template, as I am trying to achieve something unique to happen in game.  I am imagining that it would work similarly to Fusion Spell for Psionics.  I am the DM for one scenario and would be a player for another.    DM PoV  I need to create a villain whose in game & story abilities can be defeated by destroying different sections of the armor, which can cost any amount but not be made of a material that is so unbreakable that it could not be destroyed. The details would be tailored to whatever they are wearing.  I'm designing an NPCs as if he were originally a Player Character. In terms of Su & Ex abilities, armor that grants the wearer Mountain Walk or Awesome Beauty, or something more random is what my concept needs.  This isn't about focusing on the numbers or what the story would look like, I don't have strong preferences: it is about having fun.  In creating the NPC, I hope to be able to create multiple other NPCs that use different methods as part of a group the party must face.  Examples:   The villain sends some would-be adventurer to gather his materials for him or A hero decides to join forces with a dying whachamacallit.   Notes:   Rough Cost Estimate: equivalent to the party's current collective fortune of 900,000 gp. Armor quality would be masterwork. The current party is equivalent to a level 20 party.   Player Character POV  Meanwhile from a player character's PoV, this character benefits others by creating that  sort of armor during the main campaign.


The error:  sudo apt-get install python-pip E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I get this error when trying to use apt-get:  E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?     How can I fix this?


Trying to work out the following question, but I'm stuck.. Can someone direct me please.   Using a change of variables  $$     \text{Let}\ m = \lg\ n \\      S (m) = T (2m)\\     T (2^{m}) = T (2^{m/2}) + 2 \\     S( m) = S (m/2) + 2 $$ Using Master Theorem   $$ n\ log_b a = n\ log_2 1 = n^{0} = 1\text{ and }f (n) = 2 $$  Since $ 1 < θ(2)$, case 1 applies and $S (m) = θ(\lg\ m^2), \quad\therefore T (n) \in \theta(\lg\lg{n^2}) $  or   I was also thinking about the problem like this: $$\begin{align} T(n)  &= T(\sqrt n ) + 2          = T(n^{1/2}) + 2          = T(n^{1/4}) + 4          = \cdots \\          &= T(n^{1/2^i}) + 2i          = \cdots          = T(n^{1/2^k}) + 2k\\ \end{align}$$ $$ n^{1/2^k} <=2 \\ \text{so } \log n = 1/(2^k) \\        k = \log (\frac{1}{\log n}) $$ $$ ∴ T (n) ∈ θ(\lg \lg n)\ or\ T(n)\ \in θ(\log (\frac{1}{\log n})) $$

This looks like a question asked , but it isn't.  $$T(n)=\begin{cases} T (\sqrt{n}) + 1 \quad & \text{ if } n>1 \\  1 & \text{ if }n=1\end{cases}$$  My professor gave this to me in class yesterday. This is where I'm stuck:   $$T(n) =  T(n^{1/2})+1 =  T(n^{1/4})+2 = T(n^{1/8})+3 = \dots =   T(n^{1/ 2 ^k})+k$$  Now this will continue till  $$n^{1/ 2 ^k}=1$$  How do I proceed ahead? If I take log on both sides, then RHS becomes zero. How do I solve the relation?  I don't want to use the Master theorem, I want to know where and why am I stuck.


I was playing an offline server then my pc ran out of battery then when I opened minecraft again the server was deleted. Can I get the server back? My pc isn't that good so that might be the problem.

I was playing on my main world when my laptop ran out of power.  I found a charger and woke it up, but Minecraft had crashed.  Now, it doesn't appear in the world selection screen!  I have verified that it still exists in the Minecraft folder, and the directory contents look to be in order.  Does Minecraft save an internal flag somewhere when it crashes hard?  If so, how do I reset it?


I can show that |Z|^2=|Z^2| or |Z|^3=|Z^3| where Z is a complex (a+ib) number. But is there any way of showing that for all n where n is a natural number?

A simple stupid question that I should already know the answer to:  Is this true: $\left|z^5\right| = \left|z\right|^5$ where z is a complex number with a non-zero imaginary component.  Thanks in advance.


I'm trying to understand  $$e^{it}=\cos(t)+i\sin(t)$$ This comes from the definitions  $$\cos(t)=\frac12(e^{it}+e^{-it}) \quad\text{and}\quad \sin(t)=\frac1{2i}(e^{it}-e^{-it})$$  and those are consistent with the power series definitions of $\cos$ and $\sin$, which are their Taylor series  $$\sum_{k=0}^{\infty}{\frac{(-1)^k z^{2k}}{(2k)!}} \quad\text{and}\quad \sum_{k=0}^{\infty}{\frac {(-1)^k z^{2k+1}} {(2k+1)!}}$$  respectively.     I see all those things. They make sense and are consistent with each other, but I can't believe that $e$ and cosine and sine are so related coincidentally.

Could you provide a proof of Euler's formula: $e^{i\varphi}=\cos(\varphi) +i\sin(\varphi)$?


I am new to salesforce and I have written test classes for only one class before which worked just fine. But how do I write one for a simple scheduled apex class. Here is the code below: global class Add_U_Grade_To_Program_Enrollment implements Schedulable {     global void execute(SchedulableContext ctx) {         List<hed__Course_Enrollment__c> courseConnection_U_Grade = [SELECT          hed__Program_Enrollment__r.Id  FROM hed__Course_Enrollment__c WHERE Letter_Grade__c =          'U'];                  Map<String, Integer> grade_U_Map = new Map<String, Integer>();         String key;         for(hed__Course_Enrollment__c u_id: courseConnection_U_Grade ){             system.debug(u_id.hed__Program_Enrollment__r.Id);                          key = u_id.hed__Program_Enrollment__r.Id;             if(!grade_U_Map.containsKey(key)) {                 grade_U_Map.put(key,0 );             }             grade_U_Map.put(key,grade_U_Map.get(key) + 1 );         }                  for(String key1: grade_U_Map.keySet() ) {             System.debug(key1);             System.debug(grade_U_Map.get(key1));         }                  Set<String> programEnrollmentId = new Set<String>();         for(String key2: grade_U_Map.keySet() ) {             programEnrollmentId.add(key2);         }                  List<hed__Program_Enrollment__c> listOfProgramEnrollmentWithGrade_U = [SELECT Name,Id, Total_Unsatisfactory_Grades__c  FROM hed__Program_Enrollment__c WHERE Id =:programEnrollmentId];         system.debug('listOFPEWithGradeU: '+ listOfProgramEnrollmentWithGrade_U );         List<hed__Program_Enrollment__c> listOfProgramEnrollmentToUpdate = new List<hed__Program_Enrollment__c>();                  for(hed__Program_Enrollment__c pe_u: listOfProgramEnrollmentWithGrade_U){             for(String key3: grade_U_Map.keySet()){                 if(key3 == pe_u.Id){                     hed__Program_Enrollment__c updatePE = pe_u;                     updatePE.Total_Unsatisfactory_Grades__c = grade_U_Map.get(key3);                     listOfProgramEnrollmentToUpdate.add(updatePE);                 }             }         }                  update listOfProgramEnrollmentToUpdate;              }          }

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  I'm testing asynchronous code - like Batch Apex, Queueable Apex, @future methods, or Scheduled Apex - and I'm getting unexpected results. It seems like portions of my code aren't running, or I'm getting confusing errors about batch invocations. How do I effectively test this kind of code?


Including by changing save game?  I am playing normal and I am happy. Rather than replay again, I'd rather play around with my save game. First time I play I don't even know what satelite is for.

I am playing XCOM - Enemy Unknown on Classic difficulty. In the first month, Australia quit the XCOM program. Due to the lack of money and fitting missions, I could not do too much to decrease the panic level there.   Is there any way to get this country back into the X-COM program, or is it gone for good?


I want to delete record from custom object where name = new. I wrote simple apex trigger to delete this records however I am getting below error when execute.      System.SObjectException: DML statement cannot operate on trigger.new or trigger.old:   Apex Trigger   trigger DuplicateTemp on Temp__c(before update) {     List<Temp__c> tempToDelete = new List<Temp__c>();      for(Temp__c temp: Trigger.New){         If (temp.Name == 'New'){              tempToDelete.add(temp);         }     }          Database.delete(tempToDelete);  }

I have an afterInsert trigger on Events. When the Script is finished, I would like to delete the event. I keep getting this error message.     DML statement cannot operate on Trigger.new or Trigger.old   If I cannot do this within Trigger.new, what is the best way to do this? If SOQL is involved, what field am I looking for? event.ID?


My Question goes like this: If a mosquito inside the bus wants to move from back to front, will there be any difference if the bus is stationary or moving (ie extra effort in the latter case?)? Consider it as a closed bus & mosquito at a fixed point in bus, ie the air column will be constant throughout the process, & the mosquito will always be in that air column & never touch any part of the bus.  Here's another question which has the similar answer as above question :  Suppose the bus is at rest, & mosquito is also at rest (wrt to both ground & bus) and is in the air column, & not touching any part of bus. If bus starts moving, will the mosquito stay at rest wrt ground, ie go to back, or will it stay at rest wrt bus?  For both questions, consider that when bus starts,it instaneously starts moving in constant velocity.(no acceleration)  Thanks in advance to everyone who tries to answer it.

A fly is flying around in a car, the fly never touches any surface in the car only fly’s around in the air inside the car. The car accelerates. does the fly slam in to the rear window. or does the fly continue to fly uninterrupted?


Would appreciate your help. Suddenly, my viewport shading does not render any lights, material, textures, etc... only grey objects. Here are the screenshots. I have no idea of what this might be. I am also very new to the software so maybe I have done something stupid.

I don't know why but now, when i go in material preview or rendered (in solid mode it works fine), my object is entirely gray, or invisible idk, because it has the same color of the background. I've been working for days on this project without having this issue, it suddenly showed up. I tried opening other old projects and suddenly they all do the same so i guess it is some blender program setting that applies for all the projects, but idk how it happened cuz i didn't change anything :/, anyone got any tips?


I pasted a long text in the word and the source was gone so I can't copy it again. And in a rush while closing word I forgot to hit save and wrongly clicked on don't save option. Now I have no idea if I can recover it in anyway? I copied something else in meanwhile so I can't paste it again. I tried to look for clipboard history but nothing. I am using windows 7 pro. Any help?

I'm using Microsoft Word 2010 and I worked in a word-2003 compatible document (.doc). After hours of working, I selected a half of text and did Ctrl+X to copy it into another document. Surprising, after closing the current document and opening a new one and pressing Ctrl+V, nothing happened. After closing original document, ms word asked me if I want to save the clipboard buffer and I pressed No, as I didn't knew that MS Word has it's own clipboard.  Is there a way to recover that text that was "cutten" from original document and never "pasted" to the new one? The PC was not rebooted so i guess all my temp files are here.


I’ve been making a role play map for me and my friends, the theme is pirates... so I want Rum. But I can’t figure out how to do it. I’ve googled and googled but all I’ve gotten are thing from Java edition that don’t work on PE (I’ve tried). Please help.   give @p potion 1 8201 {CustomPotionEffects:[{Id:9,Amplifier:5,Duration:1000}],display:{Name:Rum}}  (Just of Nausea effect)  I’ve tried not adding the name part and just rename it with an anvil but it still doesn’t give me the potion

This question was recently split into different questions for each workaround. See   meta posts for more information.   Can you use NBT tags in commands? I’ve tried commands that normally work in Java Edition like: give @s minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}} give @s stone_pickaxe{Unbreakable:1b} give @s item_frame{EntityTag:{Invisible:1b}} summon villager ~ ~ ~ {Offers:{Recipes:[{buy:{id:"emerald",Count:5b},sell:{id:"diamond_sword"}}]}} summon tnt ~ ~ ~ {Fuse:20s}


I'm trying to install this theme so that it looks like the screenshot:   The theme has a launcher at the bottom and custom icons to go with it.  When I install the themes I get different looking dialogs, but not the custom launcher nor the icons.  Any idea how to get these?  Also the folder color in the theme is blue, but for me they are still yellow ...

I just installed ubuntu gnome 17.04.  I'm trying to install this theme:    It says just extract the theme into the .themes folder and use the tweak tool to select the gtk and shell themes.  So here's what I have:  ole@mkIV:~$ pwd /home/ole ole@mkIV:~$ ls .themes Gnome-OSX-2.6   I then reboot and attempt to find the new themes.  However they do not show up even though I have User Themes turned on under extensions.  Any ideas on how to fix this?


I downloaded the .deb version of  YUMI (multiboot usb creator) from the  and I wanted to make a bootable usb for Windows 98 to run on Virtualbox, but anyway the software asked for my sudo password inside the software itself and I felt it was a fishing scam, so I wanted to remove it.   But when I go to the Ubuntu Software Center it says "reinstall", there is no remove option. And I wasn't able to remove it from the terminal using apt-get --purge remove yumi_0.0.1-1_all.deb  I am running Xubuntu 14.04.  Any idea?

Suppose I download a .deb package from a website and install it. (I assume that when I double click the .deb file, the package is installed through a GUI that interfaces with dpkg right?)  How can I uninstall it?


I just know this trick.  In C++:  #include <iostream> using namespace std;  int main() {     int i[3]={5,7,11};     cout << 2[i];     return 0; }   In C:  #include <stdio.h> int main(void)  {       int i[3]={5,7,11};     printf("%d", 2[i]);     return 0;  }   yes, these are allowed, both output are 11.  why i[2] can be expressed as 2[i]?

As Joel points out in , in  (aka: K & R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?


It seems like a lot of people don't know this essential skill of Linux--so it's time to learn:)

I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file?


Models not showing up when rendering on blender 2.90 using Cycles or EEVEE. I have restarted my pc, it did not work. result:

A scene I made is not rendering, at all. This grey screen stays the same and nothing changes.  Here are my settings:  [


I am trying to create a program where you can change a fans speed, color, radius, and whether you can turn the fan on or off, I have the fan class working fine, except for the toString() method, for some reason when I set some values in the test program, it just defaults to the regular values, any help is accepted.  Thank you.  public class Fan { final int SLOW = 1; final int MEDIUM = 2; final int FAST = 3;  public int speed = SLOW; public boolean on = false; public double radius = 5; public String color = new String("blue"); //fan on boolean fanOn() {    on = true;    return on; } //fan off boolean fanOff() {    on = false;    return on; } //sets fan speed String setSpeed(String speed) { if (speed == "SLOW"){    speed = String.valueOf(SLOW); } else if (speed == "MEDIUM") {    speed = String.valueOf(MEDIUM); } else if (speed == "FAST") {    speed = String.valueOf(FAST); } else {    speed = "Please enter 'SLOW', 'MEDIUM' or 'FAST' to change the speed of the fan."; }    return speed; } //sets custom radius double setRadius(double rad) {    rad = radius;    return rad; } //sets custom color String setColor(String colorType) {    return colorType; } //toString() method public String toString() {    return ("Speed: " + speed + "\nRadius: " + radius + "\nColor: " + "\nOn: " + on);  } }  //test program   public class TestFan {  public static void main(String[] args) {    Fan fan1 = new Fan();    fan1.setColor("green");    fan1.setSpeed("FAST");    fan1.setRadius(3.5);    fan1.fanOff();    System.out.println(fan1.toString());   } }   This just outputs:  Speed: 1 Radius: 5.0 Color:  On: false

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?


When the recent 4.1.1 was released, I thought it must be an important security update, as it's going out to all sites automatically. Reading through the , I found it actually doesn't mention security fixes. If this is the case, IIRC this is the first auto-update over all sites to a new version without security reason.  Considering that a js change in 4.1.1 actually was breaking use of my modifications for the editor, I was wondering will non-security-updates continue to be released automatically? If so is there a wp-config option to only allow security auto-updates?  (and yes, I do know I should be testing on WP Beta Testing plugin but in this case I didn't happen to notice the incompatibility before the update was out to users.)

WordPress 3.7 added automatic updates. How does this work, and how can I configure this feature?


In a journal article I have read that two rasters, representing X and Y coordinates respectively (see attached figure), have been entered as predictors in a GIS-based Logistic Regression for a given reason (namely, in order to reduce possible auto-correlation issues).  I was wondering how such rasters can be produced in ArcGIS (10.1). The reference is:     Hu, Z., & Lo, C. P. (2007). Modeling urban growth in Atlanta using   logistic regression. Computers, Environment and Urban Systems, 31,   667–688.    @Luke pointed out an earlier thread. I read it, and I see that different approaches have been suggested, mainly outside arcGIS. I would rather prefer to stick with the latter. I saw something that could fit my need, but I do not understand one thing: in the suggested workaround: xmap = (FlowAccumulation(1) + 0.5)*cellsize + xmin, what that (1) stands for? The same applies to the (64) in the suggestion for the ymap (namely, ymap = (FlowAccumulation(64) + 0.5)*cellsize + xmin)

Could anyone provide with a way to calculate latitude and longitude from DEM, for each raster cell?   In previous posts about this, I have seen that some suggest calculating lat and long in certain sample point locations. This doesn't work for me, as I need complete rasters.   Also, I use ArcGIS 10.2 version so $$XMAP, $$YMAP does not work for me.   Is there any other way inside ArcGIS to get lat and long?


Hye. I used to do programming in windows but now I am switched to Linux. I tried to get the IDE of c/c++ from Ubuntu software center but it is also not providing me any IDE for c/c++. I want to Install c/c++ IDE just like turbo c or Dev c++ in Ubuntu...

Is there an IDE which can run on Ubuntu that supports C, C++ and Java? I installed , but it only supported Java. I installed the C/C++ package manually, but that package gives an error if I include iostream.   Is there any other IDE which can satisfy my needs? Or can I get NetBeans with all packages pre-installed in it?


Let's say a character casts  in the ring shape, choosing the inside of the wall as the side that does damage. A creature is inside the ring.  When the spell is first cast, the creature must make a Dex save or take 5d8 damage. Then, on the creature's turn, it wants to move out of the ring, and it will need make another Dex save as it moves through the wall. Effectively, a single casting will require a creature inside the ring to make a minimum of 2 saves in a normal movement situation. Correct?  Note: I realize by the time characters are level 7+, there are many ways to avoid the second Dex save, including flying over the wall, burrowing under the wall, teleporting out, casting a barrier spell within the ring, being immune to fire, etc. I'm just asking about normal movement situations without other tricks, to ensure I've understood the spell. Thanks!

When casting WoF, you can cast it as a ring, and designate the inside of the ring to be the damage side (thus, everyone inside must save or take 5d8 at the time of casting). The spell then says      "A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there."    So, by making a ring-shaped wall, are the creatures inside forced to save again on their turn (because they either ended within 2 squares of the damaging side, or they entered the wall's space)?


Did make a new partition 350G and formatted it in Ext4. The LIVE USB with Ubuntu 14.04.3LTS is running, however, installing is not possible!! Who can me explain in simple staps what to do please?? Thanks in advance.

I would like to see a full how-to guide on how to install Ubuntu.


Suppose that I have 50 million record of user. And the business requirement is to allow the admin to select any pageNumber and any pageSize to retrieve the user record  Of course, it will not be a problem if admin key in page 1 with pageSize of 10. But let say admin key in page 1 million with pageSize of 10, the querying time is a problem.  Is there any solution to this as a simple offset and limit solution with indexing alone wouldn't solve the problem??? I am thinking that how could this be addressed without changing the business requirement.  Simplify:  - I need a stored proc that accept pageSize and pageNumber to get user record  - I have 50 million user record  - The user id in my database is guid (not incremental based on created date)  - Query result should be order by User Created datetime  - Expectation: Querying time of pageNumber 1 and pageNumber 1 million should not be much different, or at the very least it should be acceptable time to return result (eg: less than 5 seconds)  CREATE PROCEDURE [dbo].[usp_AdminGetUserList] (      @PageSize int = 10,      @PageNumber int = 1 ) AS BEGIN      SET NOCOUNT ON;      SELECT         *     FROM [dbo].[User]     ORDER BY [JoinDT]     OFFSET @PageSize * (@PageNumber - 1) ROWS     FETCH NEXT @PageSize ROWS ONLY OPTION (RECOMPILE);  END   Note:  I know that there is solution which use the last primary key (incremental userid) in this case instead of using offset, but such solution would not fit the business requirement as business requirement allow user to key in pageNumber(offset). In other word, solution like this will not work for my case.  SELECT user_id, name FROM users WHERE user_id > 51 234 123 ORDER BY user_id ASC LIMIT 10 000;

Currently, I have table base_voter with data around 100M of dummy data. I have stored procedure as follows:  CREATE Procedure [dbo].[spTestingBaseVoter]        @SortColumn    NVARCHAR(128) = N'name_voter',        @SortDirection VARCHAR(4)    = 'asc',        @offset INT,          @limit INT     As     Begin       SET NOCOUNT ON;        -- reject any invalid sort directions:       IF LOWER(@SortDirection) NOT IN ('asc','desc')       BEGIN         RAISERROR('Invalid parameter for @SortDirection: %s', 11, 1, @SortDirection);         RETURN -1;       END         -- reject any unexpected column names:       IF LOWER(@SortColumn) NOT IN (N'name_voter', N'home_street_address_1', N'home_address_city')       BEGIN         RAISERROR('Invalid parameter for @SortColumn: %s', 11, 1, @SortColumn);         RETURN -1;       END         --SET @SortColumn = QUOTENAME(@SortColumn);        DECLARE @sql NVARCHAR(MAX);        SET @sql = N'SELECT id, name_voter, home_street_address_1, home_address_city                  FROM dbo.base_voter         WITH(NOLOCK)         WHERE deleted_at IS NULL'        SET @sql = @sql + N' ORDER BY ' + @SortColumn + ' ' + @SortDirection +         ' OFFSET @OF ROWS          FETCH NEXT @LIM ROWS ONLY ';          EXEC sp_executesql @sql,          N'@OF int,@LIM int',            @OF=@offset, @LIM=@limit      End   To make query faster, I have also created index as :  CREATE NONCLUSTERED INDEX FIBaseVoterWithDeletedAt   ON dbo.base_voter (name_voter asc,home_street_address_1, home_address_city)   WHERE deleted_at IS NULL ;   By creating this non-clustered index I have reduced the query time drastically. However, it does not applied same for the query with higher offset.  For example with:  Execute spTestingBaseVoter name_voter,asc,9999950,50   Is there something I am doing wrong, which is causing this performance issue? Or, it is more compulsory to create another index in descending order.  Let, me know if there is any better way to tackle this situation, which might decrease query time drastically.  Update:  Estimated Execution Plan


I am new in how to start a program inside another java program! and i don't know how to call it. The 1st question is that i must do it inside a new thread? the second question is how to call the new program. The program i want to call is "wondershaper". I use ubuntu 12.04 for running this programm and in command line i write. "sudo wondershaper eth0 10000 1000".  How i can write it inside a general program?  I have a server that i want to handle the rate of it! thats why i use it. So i have a multithread server and the code is   class Client extends Thread {     private Socket connectionSocket;       public Client(Socket c) throws IOException {         connectionSocket = c;     }      public void run() {          String path = "C:/pao/new2/";          File folder = new File(path);         File[] listOfFiles = folder.listFiles();           try {              String fileToSendStr = readFile();             File fileToSend = null;             for (File f : listOfFiles)              {                                if (f.getName().equals(fileToSendStr)) {                     fileToSend = f;                     break;                 }             }             //System.out.println("Connescting to Client to recieve the part " +fileToSendStr);             if (fileToSend == null) {              }             System.out.println("Sending the chunk to Client " + fileToSendStr + "to the client: " +connectionSocket.getRemoteSocketAddress().toString());             java.util.Date date= new java.util.Date();              System.out.println(new Timestamp(date.getTime()));             long length = fileToSend.length();             byte [] longBytes = new byte[8];             ByteBuffer bbuffer = ByteBuffer.wrap(longBytes);             bbuffer.putLong(length);             connectionSocket.getOutputStream().write(longBytes);              BufferedOutputStream bout = new BufferedOutputStream(connectionSocket.getOutputStream());             BufferedInputStream bain = new BufferedInputStream(new FileInputStream(fileToSend));              byte buffer [] = new byte [1024];             int i = 0;             while((i = bain.read(buffer, 0, 1024)) >= 0){                  bout.write(buffer, 0, i);               }                System.out.println("chunk sended");             java.util.Date date1= new java.util.Date();              System.out.println(new Timestamp(date1.getTime()));             bout.close();             bain.close();           } catch (IOException e) {             e.printStackTrace();         }      }      private String readFile() throws IOException {          BufferedReader r = new BufferedReader(new InputStreamReader(                 connectionSocket.getInputStream()));         return r.readLine();      } }   so when i read the readFile what client send to me. After if it is the rate string to start the "wondershaper" and put the rate inside the "sudo wondershaper eth0 10000 rate" and start the program

How can I write a program in Java that will execute another program? Also, the input of that program should be given from our program and the output of that program should be written into a file.  This is my small set of code to get its output:  Process p = Runtime.getRuntime().exec("C:\\j2sdk1.4.0\bin\\helloworld.java"); BufferedReader input =         new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null)    System.out.println(line);  input.close();   This was my set of code but this throws an IOException.


My iMac (27-inch, mid-2010) crashed and refused to reboot. I was able to reboot it from an external drive and attempted to erase and resurrect the internal drive; after several attempts, the drive ceased to be visible to Disk Utility and am afraid it may be physically defective. Is there a way of mounting the disk and confirming its status?

I am seeking suggestions on what may be going in with an iMac I am currently troubleshooting, as it’s displaying behaviour I do not recall seeing before.  Short story  This iMac refuses to boot up. It gets the Apple logo, gets past the progress bar, and then gets stuck on the grey screen for about two minutes before rebooting itself. However, what makes this odd is that I can:   Start the iMac in Target Disk Mode and use it to successfully boot up other Macs. In doing so everything seems to work perfectly fine. Successfully boot the iMac from an external drive and everything seems to work perfectly fine.   Long story  I was presented this iMac about 2 weeks ago as it refused to bootup. That is, it would commence booting up and cycle through the Apple logo and progress bar, but after the progress bar completed it would remain on the grey screen for a couple of minutes before rebooting itself and doing the same thing all over again.   To address this I undertook the following troubleshooting steps:   Resetting SMC - failed Resetting NVRAM - failed Starting up in Safe Mode - failed Starting up in OS X Recovery Mode – failed Starting up in OS X Recovery Mode via the internet – failed Undertook an extensive hardware test using Apple Hardware Test (AHT 3A213) - passed Started iMac in Target Disk Mode and retested hard drive using Scannerz on another iMac - passed Started iMac in Target Disk Mode and reformatted the hard drive and did a clean install of Mac OS X El Capitan 10.11.6 - successful Migrated data from a Time Machine backup - successful   After these steps I tested the iMac for four days with no issues in terms of booting up and using the computer. On the fifth day I needed to manually import seven Apple Mail mailboxes. I did these one by one and six of them imported within minutes.  The last mailbox was showing as being 270 GB in size. I knew this was inaccurate, but I decided to import the mailbox so I could do a mailbox rebuild to correct whatever corruption had taken place. This import took over 12hrs to do but seemed to work fine and Mail was displaying the emails.  I then tested the iMac on and off for another day to ensure it had no problems booting up. This was successful.  I then decided to initiate the mailbox rebuild, but as soon as I did the screen went black and stayed that way regardless of any keyboard shortcuts I tried using. I waited an hour, forced a reboot, and ever since the iMac has returned to its original behaviour of not booting up – it would get past the progress bar and stay on the grey screen for a while before rebooting itself and starting the whole vicious cycle again.  I have again retested the hard drive, processor, RAM and Video Ram by starting the iMac from an external hard drive and using a combination of the following packages:   Apple Hardware Test (AHT 3A213) Scannerz TechTool Pro Memtester (under the Homebrew subsystem)   And now I have a situation where I can boot the iMac from external hard drives, and also use it in target disk mode to boot up other Macs, but cannot use it to boot from its own internal drive.  At present I have isolated the internal hard drive and am running a scan to check for any malware.   In the meantime, I am wondering:   Has anyone come across a similar scenario and, if so, what was the cause? Assuming I find no malware, do I go through the reformat/clean install/migration process again, but this time not import the last mailbox and see whether the iMac works fine? Any other suggestions?   iMac specs are as follows:   iMac (27”, mid 2011) 3.1 GHz Intel Core i5 8 GB RAM AMD Radeon HD 6970M 1024 MB 1 TB 3.5” SATA HD Mac OS X El Capitan 10.11.6


In my C:\dev folder used for storing programming projects I see a desktop.ini file, which is visible in command prompt only and it is undeletable. What is this and how do deal with it?

Ok, so when I try to delete this from my desktop, I get this error:    When I click "See what's locking this" in lock hunter, I get this:    Now, I have a drive, called G:. I only have one physical drive, and it's D:. Also, I have NO virtual drive software installed, so I have NO clue how it got there. Right-clicking on G:\ and chosing eject doesn't do anything but change the logo, it still says the file size and whatnot. Here's the picture of the "What's locking this?" of the contained file:    But when I try to delete it...    Both of these files don't let me delete them. I had put win8install.iso as a virtual drive a while back, but I uninstalled that software (but can reinstall it if needed)  Starting this in safe mode doesn't work.


$$\sum^{n}_{k=2}k(k-1)\binom{n}{k} =n(n-1)2^{n-2}$$ $$n \geq 2$$ I'm recently new learning combinatorics and having trouble understand the intuition behind this. I don't either know what's combinatorial argument with committees.

$$2^{n-2} n (n -1) = \sum\limits_{k=2}^n k (k - 1) \binom{n}{k}.$$  I'm completely stumped. I just have no idea how to do this. What I've tried so far has been simplifying the right hand side slightly to $\sum\limits_{k=2}^n \binom{n}{k - 2}$, and then proving that this somehow is equal to some manipulation of the left hand side. I can't seem to find any breakthroughs that way though.  If anyone could help out or point me in the right direction that would be great.  EDIT: I've actually just realized my simplification of the right hand side is wrong. Now I'm even more stuck.


My teacher asked me a question to tell what the origin of gravitation or gravitational force was. In other words, what causes gravitational forces?   I considered some theories that it may be due to the mass of bodies. I also considered the gravitational waves interaction between two bodies which could be a cause of this force. I also considered the theory that suggests that all bodies are continuously emmiting gravitons. But I couldn't find the actual answer.     And why gravitational force always attractive?

For years I have been very fascinated by the "mystery" aspect of gravity. Functionally, we understand it for our applications, but in my (limited to my 3 quarters of undergrad general physics) understanding, we don't know why it exists or how the "pull" works.   To provide an example of what I mean: there has to be some "measurable material" of gravity between, say, the earth and the moon -- some kind of 'graviton' (not that it needs to be a particle or anything, I have zero claims as to the nature of how gravity does what it does). The [butchered] saying of "pluck a flower and move the furthest moon" originates because gravity in theory, has an infinite range (right?) and moving a flower on earth could maybe move an atom on Jupiter ever so slightly.  Anyway, similar to how we had "very good" hypotheses about the existence of Higgs boson that the LHC 99%+ confirmed, do we have any "very good" hypotheses in regards to the fundamental way how gravity does what we have long-known it to do?


I'm making a web-site for learning-purpose and in this site I'm planning to add some pictures.  My (maybe stupid) question is, when should you use a database for pictures? Like, is there at a specific amount of pictures that calls for a db, or are db's only for storing other types of information? Maybe db's should be used as soon as you don't want to store everything on your computer?  I was linked another page for a similar post below (my post would be a duplicate). That post is from 2008 and is mostly about SQL. Are there any new thoughts on the subject today, and is there any preferred database for storing different types of data?  Thank you

So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.  What do you think are the pros/cons?


Today, the size of the close-votes queue is 55k questions and growing. Is that a problem?   Which action could be taken to clean it up? It seems to be growing faster than Stack Overflow members are capable to handle it.