In all representations of electromagnetic radiation that I've seen they represent the electric field and the magnetic field as two perpendicular waves, but they always have them both as sine waves: they peak and cross the origin at the same time. My understanding of electromagnetic radiation, photons for example, was that they were able to travel through space without a medium because their energy cycled from electric to magnetic, and back again: the electric field creating a magnetic field, which created an electric field, etc. In my mind this feels like it ought to be a sine and a cosine wave: when one peaks the other crosses the origin, representing the transfer and conservation of energy. Do the fields grow and collapse at the same rate? or is my understanding of electromagnetic waves askew?

As I have read that "time varying electric field is source of changing magnetic field and time varying magnetic field is source of changing electric field "  Hence, I have the following doubt : If time varying nature of one field originates other changing field. Then, why are they in phase?  One is changing and producing the second thing hence second must depend upon first's derivative, I. e. If one is sine then second will be cosine Hence a phase difference of pi/2 and not in phase. Where am I wrong?


This is the error message I get:  An unresolvable problem occurred while initializing the package information. Please report this bug against the 'update-manager' package and include the following error message: E:Encountered a section with no Package: header,  E:Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_precise_main_i18n_Translation-en, E:The package lists or status file could not be parsed or opened.   How do I force the upgrade to latest package?  I am at 12.04 LTS and want to go to 14.04.1 LTS.  The error message only allows me to close & when doing so closes all of the updater.  from my past recollection there is a file I need to delete.  I can not recall which one.  This machine being used to allow guest to access the internet so there is no risk of data loss.

The computer gave me this output in a window:  E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_natty_main_binary-i386_Packages E: The package lists or status file could not be parsed or opened.   How can I fix this?


could I ask you please about Sommerfeld radiation condition (for example link:  )? What does mean derivative with respect to Euclidean norm? For example if I had function $A(\bf X)$ where $\bf X$ is vector of dimension. So the expression with derivative with respect to Euclidean norm will be: $\frac{\partial A(\bf X)}{\partial|\bf X|}$. What does it mean derivative with respect to Euclidean norm? And how I can it derivative? Thank you for your time and answears!

Given $f = f(u(t), t)$, is it possible to find the following derivative? ($f$,$u \in \mathbb{R}^n$, $t \in \mathbb{R}$)  $$ \frac{\partial f}{\partial||u||^2_2} $$  I am aware of the following derivatives:  $$ \frac{\partial||x||^2_2}{\partial x} = \frac{\partial ||x^Tx||_2}{\partial x} = 2x $$  So I can invert it to give me (elementwise division in the RHS)  $$ \frac{\partial x}{\partial||x||^2_2} = \frac{1}{2x} $$  This step does feel like abuse of notation I find it hard to convince myself of its validity.  If it's right though, I could just apply the chain rule to find  $$ \frac{\partial f}{\partial u} \frac{\partial u}{\partial||u||^2_2} $$  However, knowing that both $f$ and $u$ are a function of $t$, I am somehow doubting my own reasoning. Or does that just mean that the derivative will still be a function of $t$ and I have nothing to worry about? Can anyone shed some light?  UPDATE: I'm now doubting the existence of  $$ \frac{\partial u}{\partial ||u||^2_2} $$  because $u = u(||u||_2^2)$ is not injective. Is the inversion step I did above legitimate? Is there another possible approach?


I used a static_cast to polymorphism. I read that I should use dynamic_cast, but I can't get why. Code works in both way (with static and dynamic cast).  Could anybody show me an example with necessary dynamic_cast operator?   class Base {     public:     virtual void foo() = 0; };  class D1 : public Base {     public:     void foo()     {         std::cout << "D1()";        } };  class D2 : public Base {     public:     void foo()     {         std::cout << "D2()";        } };   int main() {     srand( time( NULL ) );     int r = std::rand()%2;      Base* b_ptr;      if(r == 0)     {         b_ptr = static_cast<Base*>(new D1);         }     else     {           b_ptr = static_cast<Base*>(new D2);        }      b_ptr->foo(); }

What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases?


Is there any way to change MAC address via Terminal ?And  of course any command for this job ?

My router can do port-forwarding based on MAC addresses. That is, a specific MAC will get a specific IP, for which I can configure a set of ports to be forwarded. In order to easily change that set of ports, I'd like to have different connections in the Network manager.  How do I change the MAC address for a network connection?


The  has two answers already, yet it's still unanswered.

I do not know whether it's a bug or a feature.  In the feed under unanswered header there are questions with answers. I can even see how many answers each question got.    I've checked again and the very first question listed under unanswered tag has an upvoted and accepted answer.  So by  this question is clearly answered. App itself shows green bubble for this question, so apparently it can detect that this question has been answered.


Find the sum $\sum_{j=0}^{n}j$  for all $n=0,1,2,3,\dots$.  How do I find/evaluate this sum?

Apparently $1+2+3+4+\ldots+n = \dfrac{n\times(n+1)}2$.  How? What's the proof? Or maybe it is self apparent just looking at the above?   PS: This problem is known as "The sum of the first $n$ positive integers".


I need to sanitize my input html string against any javascript traces (including events) to prevent the xss injection. Is there any .NET library or decent regex exist to solve this issue quickly? I just need to detect if javascript present in the html and throw an exception.

Is there a library or acceptable method for sanitizing the input to an html page?  In this case I have a form with just a name, phone number, and email address.    Code must be C#.  For example:  "<script src='bobs.js'>John Doe</script>" should become "John Doe"


All things being equal, i.e. same code base, same LAMP setup (identical versions too), what server side settings affect charset encoding? I have a problem where the euro sign is displaying correctly locally (€) and incorrectly (as â�¬) on a remote server. I've checked the response headers both locally and remotely and they both return 'Content-Type text/html; charset=UTF-8' and as they are both using the exact same code base they also both have the relevant 'content="text/html; charset=UTF-8"' meta and php header() calls. I'm presuming it's possible an httpd or php.ini setting somewhere but I'm struggling to see it?  Thanks in advance.

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I don't know why this code is throwing a runtime error     static class TreeNode<E> {     E data;     TreeNode<E> right, left;          TreeNode(E data)     {         this.data=data;         right=left=null;     } }  inpte: To store inorder in a manually implemented LinkedList. preptr: To store preorder in a manually implemented LinkedList. num: To store the total number of nodes in the tree. TreeNode<E> construct(Node<E> inptr, Node<E> preptr, int num) {     TreeNode<E> tmp;     Node<E> q;     int i,j;          if(num==0)     {         System.out.println("No node to create the tree");         return null;     }                tmp=new TreeNode<E>(preptr.data); //error line     if(num==1)         return tmp;          q=inptr;     for(i=0;q.data!=preptr.data;i++)         q=q.next;          tmp.left=construct(inptr, preptr.next, i);          for(j=1;j<=i+1;j++)         preptr=preptr.next;          tmp.right=construct( q.next, preptr, num-i-1);                   return tmp; }  error thrown:  Exception in thread "main" java.lang.NullPointerException     at practiceCodes.PreAndIn.construct(PreAndIn.java:32)     at practiceCodes.PreAndIn.main(PreAndIn.java:104)

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 bought a new Lenovo B50-80 laptop with 4GB RAM, 500 GB HDD preinstalled with Windows 7 Professional. I would like to install Ubuntu alongside the existing Windows 7. For that when I tried to create a new partition using the Disk Management, it is not allowing me to do it. I'm getting an error message that I cannot create more than 4 partitions. I was able to shrink the C: volume and create unallocated space. But the unallocated space is showing as unusable in Ubuntu installation.  I tried to do the following:   Copy / take back up of the Lenovo D: which has the Lenovo applications and Drivers. And delete the D:   Now, we have a new One unused partition of 25 gb unallocated space for installing the Ubuntu.     I tried to install Ubuntu in the unallocated space of 25gb. Since it is a single partition, Ubuntu is asking me to create another partition allocating 4gb for the swap area. When I try to do that, the remaining 21gb space is becoming unusable (Since, the Windows partition does not allow more than 4 partitions).  My question is can we install Ubuntu in the unallocated space of 25gb in a single partition? Is Swap area partition necessary? Can we install Ubuntu without a Swap area? Can Swap area be allocated as file space instead of a separate partition? What will happen if I install without a swap area?

I have read , but it was asked in the context of servers not desktops or notebooks.  If a good amount of RAM is installed on a notebook, say 8 GB, do we still need a swap space?


If $x\leq y + z$, then how can I show that $x/(1+x) \leq 1/(1+y) +1/(1+z)$? I am trying to do this algebraically by dividing through the initial expression by $1+x$. But, I am not get anywhere with it.

With $x+y\ge z$ $(x,y,z\ge0)$, prove that: $$\frac{x}{1+x}+\frac{y}{1+y}\ge\frac{z}{1+z}$$  I'm aware that using analytic view this is easy since $f(x)=\frac{x}{1+x}$ is concave in $[0,\infty)$. However I want to prove it using merely algebraic techniques. Is that possible?


I hope this puzzle here finds you well. I hear tell this question has been asked and answered. If you are aware of that, please point me to a link that demonstrates as such. I can't find anything close. So here goes again:  I have three lines that need to intersect into a single vertex, but each line has a position on a circle that must also move without distorting the shape of the circumference. The picture shows a planar shape. There is no volume. I intend to extrude that later on.   Going backwards with boolean operations has proven unreliable because later artifacts interfere with the next steps in the design. There has to be a tool method or math function that will let me do this. I have tried loop cuts, knife tool, etc and then reduced down to planar space, but I still get a slight goof in the circle or straightness of the lines no matter how I approach this.  Has anyone encountered this kind of sub-d surface modification before? In AutoCad there is a trim utility where you can select a line segment as a knife edge (so to speak) and then the target segment gets split where they cross...  But I can't figure this one out and I bet it is something simple.

I need to put a point at the intersection of two edges. Below is a picture with red circles around where I need points to be placed.


If you want to see question related to PHP you just need to type [PHP] in search box, and if you want to see any question which are tag by PHP and MySQL then I can search with [PHP][mysql].  But what if I want to see questions tagged either PHP or MySQL?

Is there a way to search questions that are tagged with either tag1 or tag2?  Actually, I would like the general filter,      ([tag1] AND [tag2], ...) OR ([tag3]   AND [tag4], ...) OR ...   And even     [tag1] AND ([tag2] OR [tag3])   I need that because I'm looking for interesting questions and I have to search for each tag separately.


so my code is as follows:    promotion = [[""], ["promotion applied"],[""]]   how do I make it go from there to this state:    promotion = ["", "promotion applied", ""]

Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  >>> reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  >>> [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  >>> from itertools import chain >>> list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  >>> chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) >>> print(list(chain)) >>> [1, 2, 3, 5, 89, 6]


I have a method to find the day after but I don't know how to return all 3 values day,month,year.Please help me. Any help is appreciated.Thanks in advance.  public int dayInMonth(int day,int month,int year){     //....     return day; }  public int theDayAfter(int day, int month, int year) {     day++;     int max=dayInMonth(day,month,year);     if(day>max)     {         month++;         if(month>12)         {             year++;             month=1;             day=1;         }     }     return ; }

I want to return two objects from a Java method and was wondering what could be a good way of doing so?  The possible ways I can think of are: return a HashMap (since the two Objects are related) or return an ArrayList of Object objects.  To be more precise, the two objects I want to return are (a) List of objects and (b) comma separated names of the same.  I want to return these two Objects from one method because I dont want to iterate through the list of objects to get the comma separated names (which I can do in the same loop in this method).  Somehow, returning a HashMap does not look a very elegant way of doing so.


I'm stuck on this question for hours. I think I need a little help and a different point of view to complete it.   Let $H$ be a subgroup of a group $G$ and suppose that $H$ has index two in $G$, i.e., that there are precisely two elements in $G/H$. Show that $H$ is a normal subgroup of $G$.  Thanks in advance.

Please excuse the selfishness of the following question:     Let $G$ be a group and $H \le G$ such that $|G:H|=2$. Show that $H$ is normal.   Proof:  Because $|G:H|=2$, $G = H \cup aH$ for some $a \in G \setminus H$.   Let $x\in G$. Then $x \in H$ or $x \in aH$.  Suppose $x \in H$. Then $xhx^{-1} \in H$ because $H$ is a group.  Suppose $x \in aH$. Then $ahH(ah)^{-1} = ahHh^{-1}a^{-1} = a(hHh^{-1})a^{-1}$ ***1  ***1: Can I say now that $x \in H$, based on the that $hHh^{-1} \in H$ and that $aa^{-1} = e$ ?  Thank you for the time you spent reading my doubts.


I've the following circuit which gives an output of 1 with a phase angle of 3π/4. When we measure the circuit all we get is the state 1 (On actual QC, it's 90% of the time 1). Is the information about the phase angle lost by measuring the state? Could the phase angle also be part of the output?  OPENQASM 2.0; include "qelib1.inc";  qreg q[1]; creg c[1];  u(pi/2,pi/2,0) q[0]; h q[0]; u(pi/2,pi/2,pi/2) q[0]; measure q[0] -> c[0];

I know that $re^{i\theta} = x + iy$ for any complex number $x + iy$ by Euler's formula. How do you calculate relative and global phase?


My friend is an Indian citizen and will be travelling to London for a business trip. The visa is valid till the date of his return flight. His return flight has a stop over in Paris for more than 12 hours. His flight from London stops at ORY (Orly) and leaves to India from CDG (Charles de Gaulle).  Does my friend need a visa for France?

I am an Indian citizen travelling from New York to Delhi with a layover in Paris where I need to transfer between Paris Orly Airport (ORY) and Paris Charles de Gaulle Airport (CDG).  Do I need to have a visa to make this transfer?  I didn't notice that while booking the ticket.


This year I installed the Windows 10 upgrade for Windows 8.1 on my computer and now I have a little doubt. Supposing I want to format and reinstall this Windows 10, would I need to first install Windows 8.1 and only then upgrade to Windows 10?  My point here is: first of all, it would be much nicer to just install Windows 10 directly, without having the work of installing Windows 8.1, all the patches needed before the upgrade and only then upgrading. Second, I know the free Windows 10 upgrade is available for limited time. In that case, if I were to do it all over again, I believe this approach would not be valid after some time, since when I did the upgrade I didn't get a Windows 10 product key.  In that case, I'm really in doubt with this. If I want to format and reinstall Windows 10 that I acquired through the upgrade process will I need to first install Windows 8.1 and upgrade again, or is there a shorter path in which I can install Windows 10 directly? In the later the real problem is obviously not in installing Windows 10, but how would I activate Windows if I don't have one Windows 10 product key.

I have not found any information from MS - only speculations from people like me, so I hope someone here has had better findings.  When I upgrade a qualified version of Windows to Windows 10 and then want to do a clean install, I've heard that the installer won't ask for a key. But what if my HDD is formatted before I attempt the clean install? How does Windows 10 try to detect the valid "upgraded" status? It seems that it doesn't in such a case, at least as far as I've tested.  So my question is: In that (or a similar) scenario: How do you clean install Windows 10?  In my case it's actually even more complicated. I'm from Germany so I can re-use OEM-licenses due to law. I have two qualified Windows OEM licenses which I both installed in a VM on my Linux installation and upgraded both to Windows 10.  Now I want to install one of them onto my bare physical machine - how would that be possible? Is there an official way of doing this or do I need to wait for those unofficial "backup license"-tools being updated to work with Windows 10?


I have a client who wants to create a real state web but with only 1 page and everything should be done dynamically, preferably using websockets. Technically speaking it's possible, but my question is: Is it possible to do it and still have a good page rank? Is there any example os a similar page?

I'm considering re-designing my personal website to promote my web services in my local area.  My issue is whether to do a one page website with a scroll-to navigation system. What effect does this have on SEO. As i understand it, you set stuff like h1's and meta description on specific page content. How does this work when all of your different content is on one page?


I have a series of photos captures with care to make up into a panorama photo. Can anyone suggest a good software which can stitch them in sequence without much manual intervention and providing good results.  Thanks.

Can anyone recommend some good tools for creating panoramas from multiple photos.  (Free and commercial)  Personally I use either Windows and Ubuntu, but I'm not fussy, suggestions for other platforms will help others.


I am trying to apply a material/texture to an entire object (UVSphere), but when I render, it acts as if it is applying to each individual face rather than the whole object.    I am trying to do something more like what is depicted here:    I haven't posted to this forum before. Please let me know if there is more I ought to say/include.  I am trying to imitate procedure described here:   The procedure is not UV mapping or using images. It uses a transparent material with a blend type texture to achieve the hole through the sphere and the shift from red to white.

I am creating a model of a glass and I would like to put a drawing on it (a png picture).  I know how to do it using Blender Render, but not with Cycles Render. Help :)


In calculating with the residue theorem I find $$\int_{-\infty}^\infty \frac{e^{-z^2}}{1+z^2} \, dx = \pi e$$ Online, a video calculating this integrand by means of "Feynman's trick"  produces another term, $-\pi \cdot e\cdot \mathrm{erf}(1)$. I find only one term from the Residue at $(0,i)$ in the upper half-plane.  The limit of the integral on the semicircular arc, I find goes $0$ as the radius goes to infinity.  Have I neglected something?

Find the value of $\int_{-\infty}^{\infty} \frac{e^{-x^2}}{1+x^2} dx$     My attempt  First, I know the existence of this integral since $$ \mid \int_{-a}^{a} \frac{e^{-x^2}}{1+x^2} dx \mid \;\; \leq\;\;  \mid \int_{-a}^{a} \frac{1}{1+x^2} dx \mid$$  Next, let $R >0 $ be an arbitrary and $\gamma_1(t) = -R(1-t) + Rt , \;\; 0 \leq t \leq1$ and $\gamma_2(t)= Re^{i\pi (t-1)}, \;\; 1 \leq t \leq 2 $.  So, take $f(z) = \frac{e^{-z^2}}{1+z^2}$.   I tried to find the value or upper bound of norm of $$\int_{\gamma_2} \frac{e^{-z^2}}{1+z^2} dz$$.  However, $$ \lvert\int_{\gamma_2} \frac{e^{-z^2}}{1+z^2} dz\rvert \leq  \frac{\text{max}\lvert e^{-z^2}\rvert}{R^2-1}\pi R = \frac{e^{R^2}}{R^2-1}\pi R $$ So, I can't proceed this.  May I ask you how to solve this?


I'm trying to write a unit test for a function that checks a URL string input and increments some stats using a third party package depending on what that URL string is. Since this function only increments stats and returns, how can this be unit tested?  Right now, I just have a test that basically makes sure the function returns and doesn't segfault. The function returns increments different stats and returns no matter what, so my test will pass for all string inputs.   func handleStats(url string) {     if url == "" {         stats.Increment(metricForEmptyStringURL)         return     }     stats.Increment(metricForNonEmptyURL)     if strings.Contains(url, "${") {         stats.Increment(metricCorrectlyEncodedURL)     } }   This is what I currently have (which is not useful since it'll always pass):  func Test_handleStats(t *testing.T) {     tests := []struct {         name string         url  string     }{         {name: "Blank", url: ""},         {name: "No encoding", url: "http://testurl.com/"},         {name: "With encoding", url: "http://testurl.com/${ENCODING}"},     }     for _, tt := range tests {         t.Run(tt.name, func(t *testing.T) {             handleStats(tt.url)         })     } }   What is the best way to test something like this?

What is the best way to unit test a method that calls into multiple methods, for example:  modify(string value) {     if(value.Length > 5)  replaceit(value);      else changeit(value); }   This pseudo code has a modify method that (currently) calls either replaceit() or changeit(). I have already wrote tests for replaceit and changeit, so writing a new test for modify will be 99% the same set of code.  I need to test it thought because it may change in the future.    So do I copy paste the existing test code?  Move the test code to a common function?  Any other ideas?  I'm not sure of the best practice here.


This is a very high level question. I was just thinking about the idea than in quantum physics, the act of observing has a "strange" effect on some properties (e.g. double slit).  If I'm staring at a light bulb, are my eyes having an effect similar to the sensor that plays the role of an observer in the quantum interference experiment?

My question is not about (pseudo) philosophical debate; it concerns mathematical operations and experimental facts.  What is an observer? What are the conditions required to be qualified of observer, both mathematically and experimentally?


Why is this:  $ df -h / Filesystem     Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s5  234Gi   10Gi   15Gi    41%  482117 2448643243    0%   /   Very different from this:  $ df -h . Filesystem     Size   Used  Avail Capacity iused      ifree %iused  Mounted on /dev/disk1s1  234Gi  205Gi   15Gi    94% 1911870 2447213490    0%   /System/Volumes/Data   Is there an explanation with this new "data" filesystem? How is it different?

New mac user here (Linux background). I'm running macOS Catalina (Beta5). I've noticed there are 5 volumes in my main disk container. One is mounted at /, that I understand, it's the system, another is /System/Volumes/Data, which I tough it would be the Linux /home, but it's not, so what it it?  Also what are the other two unmounted volumes? One might be the recovery one, but the other? Thanks!


I just posted  - but at the (seemingly) exact moment I posted it, the site crashed and then came back on (or at least the StackExchange blog crashed, I didn't test other pages before it came back online).  Normally when I ask a question, it appears in the 'questions' list. This time it did not. It doesn't show up (at least not for me) in any of the lists associated with the tags I tagged the question with.  Now I'm not sure if I should delete the question and repost it (which is against many sites' rules, often called 'shadow bumping'), or what else to do.  It's only been viewed twice - both by me, afaik. If it's not listed anywhere, how can anyone see and answer it? =(...

is invisible in the  section, but visible in the  section. What gives?


I am using quicksort, which is NLog(N), and have 20 items to sort.   Worst case is there for 26.02.... seconds? Really, seconds? I find that hard to believe, so what is the length measured in?

I'd prefer as little formal definition as possible and simple mathematics.


for example "Everybody [is] joking about him" what does [is] stands for ?

I sometimes see square brackets used while quoting.  My assumption is that they are replacing a pronoun with what the object of the pronoun, but I never know for sure because I don't usually get to see what the original quote looks like before the modification.  What are these called and what are the rules of use?


$\{a_n\}$ a sequence such that for all $n$:   $a_{n+1}-a_{n}\ge\frac{1}{n}$  Prove:    $\lim\limits_{n \to \infty} a_n= \infty$  I have figured already that $a_{n+1}-a_{1}\ge\sum_{k=1}^n \frac{1}{k}$. Am I on the right track?

Let $a_n$ be a sequence such that: $ a_{n+1}-a_n  \ge \frac{1}{n}$. prove that $\lim_\limits{n \to \infty} a_n = \infty$.  SOLUTION: I want to prove this by disproving Cauchy's test. which means, I want to prove that:  There is an $\epsilon>0$ , such that for each $N$, there is $n>N$ and $p \in$  $\mathbb N$ such that:$|a_{n+p}-a_n| \ge \epsilon$.  but for some reason I couldn't find that $\epsilon$. the "$\frac{1}{n}$" made my job harder.   To conclude: I want to disprove that $a_n$ converges by disproving that its Cauchy's and from $ a_{n+1}-a_n  \ge \frac{1}{n}$ we get that the sequence is monotonic increasing, thus, this will prove that: $\lim_\limits{n \to \infty} a_n = \infty$.  Am I on the right track? are all the conclusions that I've reached are right? How do I really complete this? any kind of help would be appreciated.


I am teaching programming to first year students in university. This year we will transition from Java to Python, and I am looking for a suitable text editor to deploy on our in-house server. Preferably the text editor should not offer any autocomplete functionality out of the box. I know this is a controversial topic, but my institute has concluded that autocomplete should be kept out, at least for the first semester, to help students get used to typing the standard print, open, etc. sentences.  The text editor should preferably be open source and support Linux, OSX and Windows. I have good experience with Atom, but this editor autocompletes out-of-the-box, and disabling this feature server-wide has proven difficult. If anyone knows how to do this with init/config scripts, any help would be very welcome. Otherwise, suggestions of other text editors would also be great.  Thanks in advance.

What IDEs ("GUIs/editors") do others use for Python coding?


Hey guys I'm new here and a programming noob so bear with me here. This is for my C++ class which sadly my teacher is terrible at teaching so many things confuse me so I need some help here. We have a lab that is called 'Reverse Sentence' and this is what it wants In this lab. Write the function "ReverseSentence" that takes a string parameter and changes it, by reversing it. For example:  INPUT: the first test OUTPUT: tset tsrif eht  The function must not use an extra string, but must reverse the elements of the input string. #include <iostream> #include <string> using namespace std;  void ReverseSentence( string& inputSentence){     /* Body of Function Here */  }  int main(){    string inputSentence;    cout << "Input your sentence: ";    getline(cin, inputSentence);    cout << endl;     ReverseSentence(inputSentence);    cout << "Reversed Sentence:" << endl;    cout << inputSentence << endl;     return 0; }  Can someone please help me what function is because I'm having trouble with it.

How do you reverse a string in C or C++ without requiring a separate buffer to hold the reversed string?


I recently built a new PC for use as daily driver running Ubuntu. I threw it together a few weeks before 20.04 was released, so I figured it was probably close enough to ready (at least to try) and went ahead and installed from a 2020-Mar-24 nightly build. I have had zero unexpected issues, have run updates regularly, etc. Do I have to perform a do-release-upgrade, dist-upgrade or anything to be on the official LTS branch? I come from mostly Debian experience and have done numerous in place upgrades between versions there. Am I all set since Focal is current now, or do I have to do something so I am not running on potentially unstable packages?  TIA

I installed an Ubuntu alpha or beta and have been keeping it up to date.   So, Should I presume that my system has automatically updated to the next alpha or beta, and will be running the official release when it's finished?


I have made a keyup event listener on classes called userInput, but after appending multiple input boxes with the same class, this event listener will not fire from the new input boxes.  HTML
     <input type="text" class="userInput">     <button type="button" id="add_input">Add</button>
   Javascript  $(document).ready(function(){     $(".userInput").on("keyup", function(){         alert("Key has been released");     });         var target = $("#wrapper"),         innerHTML = "
<input type=\"text\" class=\"userInput\">

";     $("#add_input").on("click", function(){         target.append(innerHTML);     }); });   The event listener fires for the original input box, but doesn't for any of the new appended input boxes which have the same class.

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


I installed a "All-in-one USB Card Reader" to read SD cards and other media.  It has caused six new drives to appear in Disk Management with six new drive letter assignments.  These drives and letters are always present, even when there are no cards in the reader. When unused, they are labeled "No Media".  Why does this multifunction reader cause these phantom Disks to appear and consume drive letters? Every USB port can (and does) allow removable media to be mounted and assigned a drive letter, and the drive letter assignment "disappears" when the USB drive is removed.  Why are these card reader's drives and letters staying allocated permanently?  Is there anything that can be done to make the slots work like a typical USB drive?  (The reader is in fact connected to USB).

I've recently had some "Removable Disk" listings mysteriously appear along with my other drives. Clicking on one of them results in a dialog box:     Please insert a disk into Removable Disk (G:). "Properties" has no usable data.   How do I delete these "Removable Disk" listings?  Computer Local Disk (C:) Data2 (D:) DVR (E:) BD-ROM Drive (F:) DVD Removable Disk (G:) Removable Disk (H:) Removable Disk (I:) Removable Disk (J:) Maxtor .5GB Set 2 LR Sec (K:) LR3 Set3 Pri Seagate2TB (L:) Grn Mxtr .5GB Bkup of Mxtr .5GB (M:) Maxtor .5GB Set 2 LR Primary (N:) Removable Disk (O:)


I have took many HTML/CSS/JS Classes, but none have explained to me about anything I'm asking now. In the most basic terms I want to know how to make Specific Letters/Symbols Overwrite letters/Symbols in the input and output the leftover string, basically trying to make my own "Custom Base64 Encoder" but I don't exactly know where to start. I have my custom Strings to replace all the letters numbers and basic symbols, (Im using my own Custom ASCII Strings.) but like I said, whats a simple way I can make 1-5 length strings replace numbers/letters/symbols and then do the reverse to also Decode them? Its for a personal project.  Ive tried using a Manual Base64 encoder/decoder and editing the code, but most simply use atob or similar functions.  Also I haven't started with the Code, I'm truly not sure where to start.  I Haven't had any successful results at making a simple custom encoder/decoder.  EDIT: This is the Encoder File (View as .txt file or it may look wierd): Place it in URL Bar  data:text/plain;base64,YSBTUEFDRSBzZXBlcmF0ZXMgZWFjaCBFbmNvZGVkIENoYXJhY3Rlcg0KRmlyc3QgbGluZSBPcmlnaW5hbA0KU2Vjb25kIGlzIEVuY29kZWQNCg0KU3BhY2UgaXMgZW5jb2RlZCBhcyAjDQoNCkEgQiBDIEQgRSBGIEcgSCBJIEogSyBMIE0gTiBPIFAgUSBSIFMgVCBVIFYgVyBYIFkgWiANClAgTyBJIFUgWSBUIFIgRSBXIFEgQSBTIEQgRiBHIEggSiBLIEwgWiBOIEIgViBDIFggTQ0KDQphIGIgYyBkIGUgZiBnIGggaSBqIGsgbCBtIG4gbyBwIHEgciBzIHQgdSB2IHcgeCB5IHogMSAyIDMgNCA1IDYgNyA4IDkgMA0KcCBvIGkgdSB5IHQgciBlIHcgcSBhIHMgZCBmIGcgaCBqIGsgbCB6IG4gYiB2IGMgeCBtIDkgMyAxIDggNCA3IDIgMCA1IDYNCg0KIC0gID0gIFsgICAgXSAgIFwgICA7ICAgICAnICAgICwgICAgLiAgIC8gICBgICAgfiAgICEgICBAICAjICAgJCAgJSAgIF4gICAmICAqICAgKCAgICAgKSAgXyAgICsgICAgeyAgICB9ICAgIHwgICAgOiAgICAiICAgIDwgICAgPiAgICA/DQoxMiAxNSAxNyAxOSAyMSAyNSAyOCAzMiAzNSAzNiAzOCA0MSA0MyA0NyA1MCA1MyA1NCA1NyA1OSA2MSA2NSA2OCA3MyA3NiA4MiA4NCA4OSA5NiA5NyAxMDIgMTA0IDEwOQ0KDQoNCg0KDQoNCg==

I have a PHP script that can encode a PNG image to a Base64 string.  I'd like to do the same thing using JavaScript. I know how to open files, but I'm not sure how to do the encoding. I'm not used to working with binary data.


Can someone explain why the hint is useful? If $\mathcal{N}_{0}$ is the Skolem hull of $M$ and a countably infinite set of indiscernibles $\mathcal{I}$, my idea is to remove one element of $\mathcal{I}$ each time to create a new Skolem hull $\mathcal{N}_{i+1}$ generated by one less indiscernible element. The problem is that there may be a non-indiscernible element in every $\mathcal{N}_{i}$ that doesn't exist in $\mathcal{M}$ so the equality doesn't hold.  A hint or solution would be appreciated.

Let $M$ an infinite structure such that $\mid M \mid \ge \mid L(M) \mid $. Show that exists a proper elementary extension $N$ and a chain $\langle N_{i} \mid i < \omega \rangle $ such that $$N=N_{0},    \  \ N_{i} \succ N_{i+1} $$ for all $i< \omega $ and $M=\bigcap_{i< \omega} N_{i}$   That this exercise comes as an application of sequence of indiscernible, the procedure would be to find a sequence of indiscernible and with this sequence and with $M$  build the first model $N_{0}$ of the chain of elementary extensions of $M$. I'm not sure if that is the correct. Thanks for any hint.


We have the following two URLs:    https://example.com/%D1%82%D0%B5%D1%81%D1%82  https://example.com/%d1%82%d0%b5%d1%81%d1%82   Both are identical except the the case (upper vs lower).  Will Google consider them to be duplicate URLs or it does not matter?

An SEO expert was testing my site, and noticed that my URLs contained the special character :. He said that would create duplicate content, because google would interpret any url containing : as two separate URLs: one with : and one with %3A. Is he right?


Imagine a system of 3 point charges and some kind of circular "rail".  All charges have the same magnitude - 2 are positive and one negative.  One positive charge is placed at some distance from the center of the circular rail.  The two other, are "glued" together so they must move together, and they are placed on the rail which   force them to move only on the rail path.  Now imagine i give them a slight push.  Calling the glued charges the "system", We can say that the force between the system and the positive charge outside the rail is both attractive and repulsive (depending on what part of the rail the system is) but we can identify that the Parallel component of the force (with respect to the velocity vector) will always be in the direction of motion.  Thinking it through, i think you will agree that the charges on the rail will accelerate every 1 period -   therefore "generating" energy !  Can you spot what's "wrong" here ?     In this figure i used rectangular charges just to make it more clear, The "Paradox" is of course about point charges.

This problem is from Griffith's Introduction to Electrodynamics (4th Ed.), Problem 4.31.  A point charge $Q$ is "nailed down" on a table. Around it, at radius $R$, is a frictionless circular track on which a dipole $\mathbf{p}$ rides, constrained always to point tangent to the circle. Use $\mathbf{F} = (\mathbf{p}\cdot\nabla)\mathbf{E}$ and show that the electric force on the dipole is $$\mathbf{F} = \frac{Q}{4\pi\epsilon_0} \frac{\mathbf{p}}{R^3}$$ Notice that this force is always in the "forward" direction (you can easily confirm this by drawing a diagram showing the forces on the two ends of the dipole). Why isn't this a perpetual motion machine?$^{21}$ $^{21}$ This charming paradox was suggested by K. Brownstein.  I have done the first part and shown that the force on the dipole indeed is equal to what is given in the question. But can anyone help me with the perpetual motion bit? And for the circular motion, where is the centripetal force coming from? Is it due to the constraint?


When is $n^{2015}+n+1$ prime, $n \in \mathbb{N}$?   I think this seems true only for $1$.  I tried to show that $4n-1,2n+1,2^{n+1}-1$ divides the given expression but didn't succeed. I have only thought about this through the way of modular arithmetic. Someone suggested to me to use the complex roots of this equation, but didn't specify how.  Are there any other results I can use for this problem(I may not know them)?  Please provide only hints if you do solve it. Thank you.

Prove that $n^{2003}+n+1$  is composite for every $n\in \mathbb{N} \backslash\{1\}$.  I tried with expanding $n^{2003}+1$, but I got nothing pretty not useful. I also couldn't get any improvement, let alone contradiction for assuming $n^{2003}+n+1=pq$ where $p,q\not= 1$. How should I do this and are there general tips on how to approach these problems, what to think about?


In the Linux FHS, it says all third party packages should use /opt. However, I didn't see anybody is using /opt. Also, /opt is not in $PATH in anyway, so I think the OS is not intended to let us use /opt. So why bother to create /opt there since nobody is going to use it anyway.  You guys might think this is a duplicate, but clearly it's not. I know about the difference and the thread, but I just don't know why nobody is using it.

According to the , /opt is for "the installation of add-on application software packages".  /usr/local is "for use by the system administrator when installing software locally".  These use cases seem pretty similar.  Software not included with distributions usually is configured by default to install in either /usr/local or /opt with no particular rhyme or reason as to which they chose.  Is there some difference I'm missing, or do both do the same thing, but exist for historical reasons?


We all know the "Inertia" of a particle is actually related to its "Mass". But when we talk about "Moment of inertia" of a body, we actually are talking about its "Mass distribution" about some point/axis. So depending on how the mass is distributed in the body (what shape a body has), its moment of inertia could be determined.  So my question is can we do it vice-versa? I mean if we had the moment of inertia of a body about some axis, can we construct its shape?

Let's say we have a solid with uniform mass distribution, but we don't know its shape. However, we know the moment of inertia of the solid with respect to as many axes of your choosing as you want (e.g. you know $I_{Ox}$, $I_{Oy}$ and $I_{Oz}$). Is it possible to deduce the shape of the solid based on the moment of inertia $I_{Ox}$, $I_{Oy}....$? And if so, what would be the minimum number of axes required to do it ?  Do note that the mass is supposed to be evenly distributed, otherwise we could have a cube with the bulk of the mass concentrated in a sphere within, for example, and thus the different moments of inertia would not take into  account the "lightweight corners" of the cube.  Then, there is the parallel axis theorem, which reduces the scope of the problem, as we could therefore only choose axes going through the center of mass, for  example. Other than that, I'm completely stumped.


I am getting a the error in the onClick method when the EditText object is referenced.      public class messageActivity extends AppCompatActivity {    EditText editText;   Button button;   Logic logic;    @Override   protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_message);      editText = (EditText) findViewById(R.id.editText);     button = (Button) findViewById(R.id.button6);      button.setOnClickListener(new View.OnClickListener() {          @Override         public void onClick(View v) {             logic.message(editText.getText().toString());         }     });   } }     Here is the XML for the EditText widget in my activity:  <EditText       android:layout_width="wrap_content"       android:layout_height="wrap_content"       android:id="@+id/editText"       android:layout_below="@+id/textView3"       android:layout_centerHorizontal="true"       android:layout_marginTop="83dp"       android:inputType="textShortMessage"       android:editable="false" />

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 read that electric field lines don't intersect. The explanation I was given goes as follows: if it happens then we would have two directions of field.  My question: since field lines are vector, then why couldn't I say that we would have direction according to vector sum? If I am right then what is the correct explanation?

The the title is self explanatory, I guess.  Why can two (or more) electric  never cross?


When setting up a window I set 6 variables in my render class  int windowWidth;    // the width of the window int windowHeight;   //the height of the window int dimL;           // the coordinate of the left side of the display int dimR;           // the coordinate of the right side of the display int dimB;           // the coordinate of the top side of the display int dimT;           //the coordinate of the bottom side of the display   In my initiation routine, i set the displayMode like this:  Display.setDisplayMode(new DisplayMode(windowWidth, windowHeight));  I set glOrtho like this:  GL11.glOrtho(dimL, dimR, dimB, dimT, 1, -1);   now my question is:  Using these variables how can i configure glViewport to have the area defined by the dimX variables fill the display?  thanks!

suppose that I have an image that I want to apply as a texture on a geometry (at time we don't consider texture mapping but this image has a certain width and height here it is a 512x512 image) I want the image be drawn at the center of the window so I have set the window coordinates as follows:    glOrtho(-oglWindowWidth/2, oglWindowWidth/2, oglWindowHeight/2,-oglWindowHeight/2, -1, 1);     and then drew the geometry:    float x0 = -ImageWidth/2; // top left corner of image float y0 = -ImageHeight/2; float x1 = x0 + ImageWidth; // bottom right corner of image float y1 = y0 + ImageHeight;  glBegin(GL_TRIANGLE_STRIP); {     glVertex2f(x0, y1);     glVertex2f(x0, y0);     glVertex2f(x1, y1);     glVertex2f(x1, y0); } glEnd();     It's true and what I reach as the result is:     Meaning that the coordinates of the center of both the image and window is (0,0) and the image will be drawn at the center of the window But since I need the viewport, I used this code after drawing the geometry:    GLint iViewport[4]; glGetIntegerv(GL_VIEWPORT, iViewport);     and reached the result: (0,0,573,543) now I think that the line of code: glOrtho(-oglWindowWidth/2, oglWindowWidth/2, oglWindowHeight/2,-oglWindowHeight/2, -1, 1); says that: left of window : -573/2 = -286.5 right of window : 286.5 top of window : -543/2 = -271.5 bottom of window : 271.5 But the Viewport tells: left of window : 0 right of window : 573 bottom of window : 0 top of window : 543 Note that if I set the Viewport by something like the following code:    glViewport(-oglWindowWidth/2, oglWindowHeight/2, oglWindowWidth, oglWindowHeight);     I won't get the true result. I mean the geometry will not be drawn at the center of window as shown in the photo? How can I solve the paradox having two different coordinate values for the bottom left of the image by two different codes?


If I cancel my apple music membership will I lose all my music that i downloaded from the app? Is there any way I could keep the music ? I only need to switch my App Store country since I am moving to Boston from Indonesia..

I am now using the 3-month free trial of Apple Music. Yesterday, I downloaded a few albums into my iPhone. If I do not join the subscription after the free trial period, will the songs still be in my iPhone?


I have inserted a pdf document using \includepdf. The document has several figures to a page that I want added to a List of Figures. Is there any way to do addtolist={} several times for the same instance of \includepdf? Any other solutions?

These may be separate questions, but the following MWE:    \usepackage{pdfpages} ...   \addcontentsline{lot}{subsection}{\ref{tab:UserRoles} \textbf{User Roles}}   \includepdf[pages={-}, pagecommand={\label{tab:UserRoles}}, offset=0in -1in, addtolist={9, table, {The User Roles table}, tab:UserRoles}]{UserRolesTable}   ...   has several unexpected behaviors.   I get the following warning:  Package pdfpages Warning: There's something wrong with the entries of `addtolist'. Not all entries were processed. Check `addtolist' [in the MWE]."    Probably due to the \label not being bound to the inserted pdf (in a table environment), my inserted PDF is numbered using the section, and not the expected "Table X" value.   The manually-inserted LoT line (which also uses the section number rather than the incremented table number) is not formatted like the other lines in the LoT - the number lines up, but the table caption itself is not aligned with the others in the list.   The source PDF has no errors and displays correctly in the output PDF.  PDFLaTeX -> BibTex    MWE:  \documentclass[11pt,letterpaper,twoside,final]{article} \usepackage{pdfpages} \begin{document} \listoftables \begin{center} \textbf{Table \ref{tab:UserRoles} - The User Roles Table} \addcontentsline{lot}{subsection}{\ref{tab:UserRoles}  \textbf{User Roles}} % manual entry in ToC  \includepdf[pages={-}, pagecommand={\label{tab:UserRoles}}, offset=0in -1in, addtolist={9, table, {The User Roles table}, tab:UserRoles, lot}]{UserRolesTable} \end{center} \end{document}


Suppose such a minimal task to select elements in B but not in A  file_list1=(a.sh b.sh c.sh) file_list2=(b.sh c.sh d.sh)  for i in files_list1; do     for k in files_list2; do         if [[ $k in $(echo $i) ]]; then         echo          else         echo $k         fi     done done   it report errors:  $ bash compare.sh  compare.sh: line 5: conditional binary operator expected compare.sh: line 5: syntax error near `in' compare.sh: line 5: `        if [[ $k in $(echo $i) ]]; then'   if not apply in, how could get the code working?

I have two arrays like this:  A=(vol-175a3b54 vol-382c477b vol-8c027acf vol-93d6fed0 vol-71600106 vol-79f7970e vol-e3d6a894 vol-d9d6a8ae vol-8dbbc2fa vol-98c2bbef vol-ae7ed9e3 vol-5540e618 vol-9e3bbed3 vol-993bbed4 vol-a83bbee5 vol-ff52deb2) B=(vol-175a3b54 vol-e38d0c94 vol-2a19386a vol-b846c5cf vol-98c2bbef vol-7320102b vol-8f6226cc vol-27991850 vol-71600106 vol-615e1222)   The arrays are not sorted and might possibly even contain duplicated elements.   I would like to make the intersection of these two arrays and store the elements in another array. How would I do that? Also, how would I get the list of elements that appear in B and are not available in A?


I am fixing a Dell 3521 laptop for a friend.    The old hard drive was broken. Put in a Western Digital-blue 320 GB disk.    Using a freeware bootable CD formatted the hard drive and it found zero bad blocks.  It currently has Fat32.  Want to use whatever Ubuntu likes best.  There will be no other OS.  Just Ubuntu on a Dell 3521 Laptop.   What version of Ubuntu should I use? Then make how a bootable Ubuntu install CD.   Thanks.

For a given hardware configuration, how do I find out if Ubuntu will run on it? What considerations should I take into account when choosing an Ubuntu version and  such as:    with a lighter desktop than the usual Gnome and Unity  with the even lighter LXDE desktop   Obviously Ubuntu does not run on some processor architectures. So how do I go about choosing the right version and derivate. How can I find out the minmal system requirements?


Whenever I do something like this...  var obj;  while (obj = doSomething()) {   // something with obj }   JSHint tells me warning  84| Expected a conditional expression and instead saw an assignment.. However, doing obj = doSomething() returns the value that doSomething() returns during assignment, so it makes sense to write a while loop in this fashion.  Is there a specific reason that JSHint warns me, and more importantly, are there reasons to not do this? Or can I tell JSHint to ignore those lines for that specific warning?

In many languages assignments are legal in conditions. I never understood the reason behind this. Why would you write:  if (var1 = var2) {   ... }   instead of:  var1 = var2; if (var1) {   ... }


I wanna show that if $n^x$ are rational for all positive integers n, then we may conclude $x$ is an integer. First of all, WLOG, we may assume $x$ is a real number between 0,1. I think it suffices to show that for R={$log_p q$, where p,q are coprime positive integers bigger than 1}, then the elements of R+R contained in R must be two pairs with same p. But I stuck at proving my conjectural statement...

Supposing that a real number $c$ is given, is the following true?  "If $n^c$ is a natural number for every natural number $n$, then $c$ is a non-negative integer."  Though this seems true, I can't prove that. Can anyone help?


I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is:    RewriteEngine on   RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$   RewriteCond %{HTTP_HOST} ^.*site1.com [NC]   RewriteRule ^(.*)$ http://www.site2.com/$1 [R=301,L]   What I want is to redirect all requests for site1 to site2 except for requests from IP address 1.2.3.4. But currently requests from that IP are also being redirected to site2.   Is there something I've missed in settings?  ( note: both domains are on the same shared hosting account )  EDIT: I'v also tried:  RewriteEngine on   RewriteCond %{REMOTE_ADDR} !^my_ip$ [OR]   RewriteCond %{REMOTE_ADDR} !^server_ip$   RewriteCond %{HTTP_HOST} ^.*site1 [NC]   RewriteRule ^(.*)$ http://site2/$1 [R=301,L]  RewriteEngine on   RewriteCond %{REMOTE_ADDR} !=my_ip [OR]   RewriteCond %{REMOTE_ADDR} !=server_ip   RewriteCond %{HTTP_HOST} ^.*site1 [NC]   RewriteRule ^(.*)$ http://site2/$1 [R=301,L]  RewriteEngine on   RewriteCond %{REMOTE_ADDR} ^my_ip$ [OR]   RewriteCond %{REMOTE_ADDR} ^server_ip$   RewriteRule ^(.*)$ http://site1/$1 [L]    RewriteCond %{HTTP_HOST} ^.*site1 [NC]   RewriteRule ^(.*)$ http://site2/$1 [R=301,L]

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


So when I search for best flights from Vancouver to Tehran, I get prices around 1150 CAD for a round trip via Lufthansa which has a stop in either Frankfurt or Munich. Now if I search for the flights from Vancouver to Frankfurt or Munich, the prices don't really change.    That is also true about other Airliners like AirFrance. Surprisingly enough, the cost of a connected flight from Vancouver to Tehran via Air Canada plus Air France which stops in Calgary and then Paris is equal to a single flight from Calgary to Paris!    These are based on my searches on different times of the year, so they're not limited to a specific season.  Why does it happen? Am I missing something?

Usually I find a flight I like that uses one or more connections with the same or different companies. In these cases, if the distance between the first and the second connection is not too large, I prefer to go by bus or train and then take the flight. The problem is that sometimes it is more expensive to take the flight in the second airport than to take the flight from the first one. I mean, I'm wondering why sometimes it is more expensive to take only a flight than to take the same flight and another one.  A practical example (and real, you can check with SkyScanner). Imagine I am in Madrid (Spain) and would like to go to Rio de Janeiro (Brazil) on April 1st. The cheapest flight I have found is this:     TAM airlines: MAD -> GRU -> GIG : 507 €   Fantastic! GRU is one of São Paulo's airports. That's perfect for me! I'll go on to Rio traveling overland. But then, I look for this flight (MAD -> GRU, non-stop):     TAM airlines: MAD -> GRU : 597 €   It's the same flight, 90 € more expensive! I've found this kind of behavior a lot of times and I'm intrigued to know why it happens.


I don't understand how can the CPU utilization of my Linux system be 101 for a process on Linux system. What does the %CPU actually indicate if it is not percentage utilization? USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME  COMMAND ubuntu    2504  101 89.3 70072464 56086520 pts/1 Rl+ 18:40 277:26 python xyz.py

Here is the top output which I gathered:    I noticed that top is showing vlc's cpu usage is > 100%.  Can anybody please justify me why it is showing like this, whether this is a bug in top application or something else.


I need to process listed content passed to a \foreach loop inside a tikz environment. But \savebox seems not to behave the same as outside tikz.  In particular, the following code:  \documentclass{report}  \usepackage{tikz}  \newsavebox{\aBox}  \newcommand{\withoutTikz}[1]{%     \foreach \content [count=\i] in {#1} {%         \savebox{\aBox}{\content}% store content in the box..         \i : \usebox{\aBox}% use the box      }% }  \newcommand{\withinTikz}[1]{% \tikz{% within tikz..     \foreach \content [count=\i] in {#1} {%         \savebox{\aBox}{\content}% store content in the box the same way..         \node at (0, -.5*\i) {\i : \usebox{\aBox}}; % .. but now it seems empty!     }% } }  \begin{document}  \withoutTikz{a,b,c}  \withinTikz{a,b,c}  \end{document}   produces:    Why? Am I missing anything? How do I get this aBox content updated on each iteration within the tikz environment?    [EDIT:] Problem duplicated . Based on  there, here is how I have solved it :)  \newcommand{\tikzSaveBox}[2]{      \begin{pgfinterruptpicture}%      \begin{lrbox}{0\null\global\setbox\csname#1\endcsname}%      #2      \end{lrbox}%      \end{pgfinterruptpicture} }  \newcommand{\withinTikz}[1]{%  \tikz{% within tikz..      \foreach \content [count=\i] in {#1} {%      \tikzSaveBox{aBox}{\content} % special case within tikz      \node at (0, -.5*\i) {\i : \usebox{\aBox}}; % .. now it works fine :)      }% } }

I have a series of complicated content I'm trying to present using TikZ.  The code is highly regular, so I wanted to write  a simple command to handle everything.  In the following code, \aelabelA and \aelabelC are not working properly at all and I don't understand why.  However, \aelabelB does work.  Could someone explain why the content of the boxes for scenario A and C is not visible?  \documentclass{standalone} \usepackage{xparse} \usepackage{tikz}  \ExplSyntaxOn \newsavebox\aebox \NewDocumentCommand\aelabelA{ mu{~located~at~(}u{);} }   {     \begin{lrbox}{\aebox}       \begin{minipage}{1in}         \Large\ttfamily\bfseries         \centering\makebox[0pt]{#1}       \end{minipage}     \end{lrbox}     \node[draw] ~ at~  (#3)  ~ {\usebox{\aebox}};   }  \NewDocumentCommand\aelabelB{ m }   {     \begin{lrbox}{\aebox}       \begin{minipage}{1in}         \Large\ttfamily\bfseries         \centering\makebox[0pt]{#1}       \end{minipage}     \end{lrbox}     \usebox{\aebox}   }  \ExplSyntaxOff  \def\aelabelC#1 located at (#2);{%%     \begin{lrbox}{\aebox}       \begin{minipage}{1in}         \Large\ttfamily\bfseries         \centering\makebox[0pt]{#1}       \end{minipage}     \end{lrbox}%%     \node[draw] at (#2) {\usebox{\aebox}};   }  \begin{document}  \begin{tikzpicture}    \coordinate (AA) at (0,0);   \coordinate (BB) at (2,2);   \coordinate (CC) at (4,4);    \aelabelA {Keys} located at (AA);    \node[draw] at (BB) {\aelabelB{Keys}};    \aelabelC{Keys} located at (CC);  \end{tikzpicture}  \end{document}


I am trying to parse a string (returned by a web server), which contains non-standard (as far as I can tell) unicode Id's such as "\Ud83c" or "\U293c", as well as plain text.  I need to display this string, emojis in tact, to the user in a datagrid view. btw, I am blind so please excuse any formatting errors :(  full example of what my code is parsing: "Castle: \Ud83d\Udc40Jerusal\U00e9m.Miles" the code I wrote which is failing miserably:   Public Function ParseUnicodeId(LNKText As String) As String     Dim workingarray() As String     Dim CurString As String     Dim finalString As String     finalString = ""     ' split at \ char     workingarray = Split(LNKText, chr(92))     For Each CurString In workingarray         If CurString <> "" Then             ' remove leading U so number can be converted to hex             CurString = Right(CurString, Len(CurString) - 1)             ' attempt to cut off right most chars until number can be converted to text as there is nothign separating end of Unicode chars and start of plain text             Do While IsNumeric(CurString) = False                 If CurString = "" Then                     Exit Do                 End If                 CurString = Left(CurString, Len(CurString) - 1)             Loop             If CurString.StartsWith("U", StringComparison.InvariantCultureIgnoreCase) Then                 CurString = CurString.Substring(1)             End If             ' convert result from above to hex             Dim numeric = Int32.Parse(CurString, NumberStyles.HexNumber)             ' convert to bytes             Dim bytes = BitConverter.GetBytes(numeric)             ' convert resulting bytes to a real char for display             finalString = finalString & Encoding.Unicode.GetString(bytes)         End If     Next     ParseUnicodeId = finalString End Function   I tried to do this all kinds of ways; but can't seem to get it right.  My code currently returns empty strings, although my guess is that is because of some of the more recent changes I have made to cut off the leading U or to try and chop off one char at a time.  If I take those bits out and just pass it something like "Ud83c", it works perfectly; its only when plain text is mixed in that it fails, but I can't seem to come up with a way to separate the two and re-combine at the end.

Say you've loaded a text file into a string, and you'd like to convert all Unicode escapes into actual Unicode characters inside of the string.   Example:     "The following is the top half of an integral character in Unicode '\u2320', and this is the lower half '\U2321'."


My question is purely general. Why does Java force you to write complicated handlers that need to be attached to objects for a simple thing like a click?   So, why do I need to write:  public class ClickMe implements OnClickListener {      void someMethod() {         Button button = (Button) findViewById(R.id.button1);         button.setOnClickListener(this);     }      @Override     public void onClick(View v) {         ....     } }   instead of something like  class myButton extends Button { @override void onClick() { // do something special }   and then use that button on my layout?   I'm sure there are good reasons for this design, I just can't think of them!

Why prefer composition over inheritance?  What trade-offs are there for each approach?  When should you choose inheritance over composition?


I have created my linked list and I wish for the user to enter a Station and then the output is the number stored for that station.      LinkedList myList = new LinkedList();                myList.addFirst("London", 5);                   myList.addNode("Manchester ", 10);        myList.addNode("Liverpool", 20);       myList .addNode("Birmingham", 50);   This is the input for the user to enter.            String name;                             name = JOptionPane.showInputDialog("Enter Station: ");      StringNode  temp;         temp = mylist.head;         if (temp.Station == (name)) {              System.out.println("Yes");          }   The rest of the methods are just adding a new data and printing.  Thanks

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?


Here is how I understand it:  DNA replication is not 100% perfect and error can happen, this error can be good(evolution) or bad(cancer properties). But its not the only source of cancer cells - DNA can be damaged by environment, and in rare cases it can receive cancer properties.  Am I correct?

For example, mutation in MHS2, which encodes a protein involved in the repair of mismatches that occur during DNA replication, dramatically increases the risk of developing colon cancer. (There are many other examples, like the RB gene which encodes a tumor supressor protein and is correlated to retinoblastoma, thus its name)  My question is: how a gene like MHS2 which participates in a general mechanism of DNA repair increases the risk of a specific type of cancer? Why doesn't it increase the risk of developing cancer in other tissues as well?


I'm trying to get a two tiered pricing structure into my store. Essentially I need every product to have two prices. There's the main price but there's also a secondary price that get's triggered if the customer has more than 14 products in their cart. I can't do an across the board discount, it has to be specific prices per product.  Say product one has a main price of $20 but a hidden secondary price of $15 and product two has a main price of $50 but a hidden secondary price of $30. This will be defined on the product itself. It's all arbitrary pricing set for every product.  I figured out how to set a rule where 14 products will trigger it but I can't work out how to add a secondary price to a product then activate that price.

I have a shop created with drupal commerece modules,I enabled 2 currency in my shop , but only show one of them, I want to show price in 2 currency       something like this price :  10$  / 20 IRR I use multi currency module to achieve this job, but  I my problem is in payment  phase, I use multi currency module to achieve this job,in multicurrency  module's setting I don't want  use  synchronize method, if you want have two field in my product , one form $ and another for IRR, I did this job by this method     first enable IRR currency in  admin/commerce/config/currency  then in  admin/commerce/config/currency/handling under Enable dedicated price fields for Product check Iranian Rial  by doing this  another field added you my product ( ** Price for IRR** ), this is good , after this I enable  *currency selector * block ,in checking out process by switching the currency I don't see any change in current currency of billing and cart. :( why changing currency not changing cart currency?


I am having trouble with passing tests for my IllegalArgumentException. When no object is passed into my method, the IllegalArgumentException will not happen. public double distanceTo(Point otherPoint) {     int x = (otherPoint.x - this.x);     int y = (otherPoint.y - this.y);     double xDbl = Math.pow(x, 2);     double yDbl = Math.pow(y, 2);     if (otherPoint!=null) {         return Math.hypot(xDbl,yDbl);     } else {         throw new IllegalArgumentException("No value for otherPoint object");     } }

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?


In Python 3 when I had to merge two dicts I usually did something like this -  payload = {'key':'value'}  another_payload = {'another_key':'another_val'} final_payload = {**payload, **another_payload}   However, now when I do the same in Python 2.7 it throws a Syntax Error. Does Python2 not support it? If it supports how to do the above?

I have two Python dictionaries, and I want to write a single expression that returns these two dictionaries, merged (i.e. taking the union).  The update() method would be what I need, if it returned its result instead of modifying a dictionary in-place. >>> x = {'a': 1, 'b': 2} >>> y = {'b': 10, 'c': 11} >>> z = x.update(y) >>> print(z) None >>> x {'a': 1, 'b': 10, 'c': 11}  How can I get that final merged dictionary in z, not x? (To be extra-clear, the last-one-wins conflict-handling of dict.update() is what I'm looking for as well.)


My site does not display the Russian and Chinese language even if I add the header in my php page Header ('Content-Type: text / html; charset = utf-8');

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


I am trying to set Image from FIrebase to Imageview using Glide but it is showing Error  Task<Uri> riversRef = storageReference.child(user.getUid() + "/profile.jpg").getDownloadUrl()                     .addOnSuccessListener(new OnSuccessListener<Uri>() {                         @Override                         public void onSuccess(Uri uri) {                             if (uri == null) {                                 Toast.makeText(getApplicationContext(), "URI IS NULL", Toast.LENGTH_LONG).show();                             }                             Glide.with(getContext()).load(uri).centerCrop().into(imageView);                         }                     });   And the error is:     Process: com.root.firebase, PID: 3875                                                                    java.lang.NullPointerException: Attempt to invoke virtual method   'boolean android.app.Activity.isDestroyed()' on a null object   reference                                                                        at   com.bumptech.glide.manager.RequestManagerRetriever.assertNotDestroyed(RequestManagerRetriever.java:133)                                                                        at   com.bumptech.glide.manager.RequestManagerRetriever.get(RequestManagerRetriever.java:125)                                                                        at com.bumptech.glide.Glide.with(Glide.java:641)                                                                        at   com.root.firebase.UploadActivity$2.onSuccess(UploadActivity.java:72)                                                                        at   com.root.firebase.UploadActivity$2.onSuccess(UploadActivity.java:65)                                                                        at com.google.android.gms.tasks.zzj.run(Unknown Source)                                                                        at android.os.Handler.handleCallback(Handler.java:751)                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)                                                                        at android.os.Looper.loop(Looper.java:154)                                                                        at android.app.ActivityThread.main(ActivityThread.java:6077)                                                                        at java.lang.reflect.Method.invoke(Native Method)                                                                        at   com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)


I'm writing a program that will take a text file and determine how many times each word is used in the text file, forming a condensed list. The parameters require me to use two separate classes, as so...  My problem is that nothing is ever added to my Frequency ArrayList, and I can't figure out why exactly. Any help would be much appreciated.  import java.io.File; import java.util.Scanner; import java.util.ArrayList; import java.io.FileNotFoundException;  class FrequencyCounter {    ArrayList<String> unique;   ArrayList<Frequency> frequencies;    public FrequencyCounter(String file) {     unique = new ArrayList<String>();     frequencies = new ArrayList<Frequency>();      try {       Scanner input = new Scanner(new File(file));       while (input.hasNextLine()) {         String[] words = input.nextLine().split(" ");         for (String word : words) {         // For every word in the line...           for (Frequency f : frequencies) { // Check every frequency for that word...             if (f.getWord() == word) {      // If the Frequency already exists...               f.increment();                // Increment the specific Frequency's counter by one...             }else{               frequencies.add(new Frequency (word)); // If no Frequency has this word, make a new one...             }           } // End of Frequency for loop         } // End of String (word) for loop       } // End of .hasNextLine() while loop     }catch (FileNotFoundException e){       e.printStackTrace();     }   }    public static void main(String[] args) {     FrequencyCounter counter = new FrequencyCounter("sample.txt");   } }  class Frequency {    private String word;   private int counter;    public Frequency(String word) {     this.word = word;     counter = 1;   }    public void increment()  { counter++; };   public int getCounter() { return this.counter; }   public String getWord() { return this.word; } }


Let $n$ be a natural number such that $n \ge 2$ and given complex number $z_1, z_2, \ldots, z_n$ that is contained in an open unit disk centered at origin. Prove that there exists $\epsilon_l = \pm 1$ with $l = 1, 2, \ldots, n$ such that  \begin{align*} \left|\sum_{l=1}^n \epsilon_l z_l\right|\le\sqrt{3} \end{align*}

Let $z_1,z_2,\ldots,z_n$ be complex number such that $|z_i|<1$ for all $i=1,2,\ldots,n$. Show that we can choose $a_i \in\{-1,1\}$, $i=1,2,\ldots,n$ such that $$\left|\sum_{i=1}^n a_iz_i\right|<\sqrt3.$$


I am having quite a strange problem with the way my model renders. After modeling one of the objects of my scene, I created a quick light/camera setup to check the result of some hard surface modelling. When I set the 3D window to Render View, I get the object with what appears to be a scratches texture    the problem is that the object doesn't have any material applied; I have literally only done the modeling; when I apply some material to the surfaces, the material gets applied but underneath I can clearly see the "scratches".     I have tried to append the geometry into a brand new file, and the problem appears to be bound to the geometry itself; the geometry is not perfect (it is mostly quads) but I don't think the problem is related to topology, for it happens with any object in the scene (including a satellite dish model with perfect topology). An interesting clue is that the actual render appears to be totally clean of any artifact.   I know this problem is not a deal breaker (specially since it doesn't seem to show in the final render), but I really would like to know what the solution to this quaint problem is.  Blend file available on request.  Can anybody help?  Thanks in advance.  Sept

I was following  on creating a watch and noticed that when I rendered the watch, some pieces were messed up.  I'm new to 3D modeling and I've just learned Blender, I can't explain it well, so here's a picture:    Other examples:     I don't know if it's a problem with my World texture, the object, or the object's texture/material, so I can't even guess how to fix it. What causes this? Is it possible to fix it?


I just want to retrieve any web page's source code from Java. I found lots of solutions so far, but I couldn't find any code that works for all the links below:          The main problem for me is that some codes retrieve web page source code, but with missing ones. For example the code below does not work for the first link.  InputStream is = fURL.openStream(); //fURL can be one of the links above BufferedReader buffer = null; buffer = new BufferedReader(new InputStreamReader(is, "iso-8859-9"));  int byteRead; while ((byteRead = buffer.read()) != -1) {     builder.append((char) byteRead); } buffer.close(); System.out.println(builder.toString());

I would like to be able to fetch a web page's html and save it to a String, so I can do some processing on it.  Also, how could I handle various types of compression.  How would I go about doing that using Java?


I was just going through RSA encryption scheme and was trying to figure out how to do all maths. I was suddenly struck by the question that (e,n) is public to the people. How easy it becomes to attack one's system if you find out that you are using same n as someone else?

I know that there exist some attack when using same modulus.      But with a little modification, $m$ is the plain-text $N$ is the RSA modulus $r_1, r_2$ is the random padding $e, s$ is the public exponent $C_e, C_s$ is the cipher-text  encrypt as follow $$С_e = (m + r_1)^e   \bmod N$$ $$С_s = (m + r_2)^s   \bmod N$$  If attacker only knows $C_e, C_s, r_1, r_2, e, s, N$. Is it possible to know $m$?  It seems the  does not work?


I have to derive  by using . I've tried but I come to a unsolvable equation (well I can't solve it) anywhere I look online it comes to the same conclusion, you need to solve an equation involving transcendentals which I have no idea what they are nor any of the math classes required for this physics course teach it. Once that equation is solved, the next steps are quite simple, by using the solution.  Maybe my professor just wants us to google the solution to the equation and used it to keep solving the problem?  anyway, what really bothers me is this:  My book shows Planck's law in terms of frequency  $$B_\nu (T) = \frac{2h\nu^3}{c^2}\frac{1}{e^{h\nu/(k_B T)} - 1}$$  but to do the problem I need it in terms of wavelength  $$B_\lambda (T) = \frac{2hc^2}{\lambda^5}\frac{1}{e^{hc/(\lambda k_B T)} - 1}$$  And $v = c/\lambda$, so by that then it can be said that the exponent of $\lambda$ would be 3 when it is expressed in terms of lambda (plus $c$ would have an exponent of 1). But Wikipedia says it is 5 and not 3. It multiplies by the derivative of $\nu$, but I don't get why. I'm just substituting, not differentiating, no need to use the chain rule.

I am drawing a blank when it comes to equation transformation. Wikipedia  for the spectral radiance of black body:   First as a function of frequency $\nu$: $$I(\nu, T) = \frac{2 h \nu^3}{c^2}\cdot\frac{1}{e^\frac{h \nu}{k T} - 1}$$ Then as a function of wavelength $\lambda$ : $$I'(\lambda, T) = \frac{2hc^2}{\lambda^5}\cdot\frac{1}{e^\frac{h c}{\lambda k T}-1}$$   And I don't see how they get $\lambda^5$ term. I'm assuming that the transformation is just $\nu \rightarrow c/\lambda$, but that gives $$ \frac{2 h \nu^3}{c^2} \Rightarrow \frac{2 hc}{\lambda^3} \neq \frac{2hc^2}{\lambda^5} $$  Similar transformation happens at other parts in the article also. I'm obviously missing something, likely completely trivial.


Ubuntu 14.04 does not show wifi connection after new installation.  Device is:HP p011tx Broadcomm 43142 802.11 adapter

I have installed the new Ubuntu 14.10 on my Dell Inspiron 3521.  I was able to use my wifi in the Boot Live Stage and during the Installation phase by enabling the BroadCom BCM 43142 proprietary drivers.  But after installation I can't enable the proprietary drivers.  I can see the drivers listed there and when I select the option to use them and click Apply, the progress bar starts going ahead but stops in process and the 'Do not use them' option gets reselected.  I have searched some questions here according to which I must connect my laptop with an ethernet cable to get my wifi drivers working.  But I don't have any ethernet cable at present with me. I can only use the wifi on my second laptop.  Is there any other way to get the drivers working or Is there any offline installer like a .deb file for the drivers?  If anyone knows, please help!  I've reinstalled ubuntu thrice but the problem remains same.


I would like to reset all my progress, achievements and objects from Fruit Ninja. I've tried deleting it and then reinstalling it again, but I still have all my stuff.   So, how could I reset the game so that it's like I've never played before?

I have one particular game that saves data through the game center. Somehow the saved game data got messed up which causes the game not to work properly when I a connected to the internet (I.e. When the game center is accessible).   Is there some way to delete all the data belonging to that game only?


Please add the ability to ignore sites on the HNQ.  There are some things I just don't want to see. Currently, there is a Q&A by one of the member sites  about masturbation on the HNQ, where one of the answers suggests self-harm as solution. I don't want that, I don't need that, and its not stuff I want to read, not when working, not in my free time.  I find the HNQ a great resource in my free time, but I would really like to have the ability to curate it so that I can exclude sites I find inappropriate or uninteresting.

I was going to make a filter for the "" by excluding some sites from it.  I noticed  which talks about "negative filtering" but does not explain how one can do it or if it is possible.  There does not seem to be a way to do this, though.  On the filter page, my only options are:  So how can I do "All sites except [list]"? It would also be nice if this could include similar functionality with the meta checkbox.  Something like "All main & meta sites except..."


I have a pretty basic c++ question (coming from a Python background).   I'm working through an example from the 'tour basics' book by Bjarne Stroustrup. Its basically this:   #include <iostream>  using namespace std;  struct Vector {     int sz;         // number of elements in vector     double* elem;   // pointer to elements in vector };  void vector_init(Vector& v, int s) {     v.elem = new double[s];     // allocate an array of s doubles     v.sz = s; }  int main() {      Vector v;     vector_init(v, 10);     return 0; };    What is causing me confusion is that the function vector_init takes a memory address of a vector for its first argument, but when its being used in the main, we are passing the vector v itself, not its memory address (which I assume would be &v rather than v).   This is working code and it compiles, but why do you not need to give the memory address as an argument here?

I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?


I have a  out which gives me shroud. My opponent has an enchantment that says that each player must sacrifice whenever he sacrifices a card. Does the enchantment target me, thus allowing me to avoid the effect, or does the enchantment still have its effect despite me having shroud?

Note: this is intended to be a canonical question about whether or not a spell or ability targets so there are multiple sub-questions.   Can Hexproof or Shroud save my creature from ? What about a  that was cast for it's Overload cost? Does shroud prevent me from using the Monstrosity ability of a creature, or from giving it more counters with Proliferate? Can I cast an Aura Enchantment on one of my creatures with Shroud, or an opponent's creature with Hexproof? Or can I use the Equip ability to attach an equipment to one of my creatures with Shroud? Will 's ability trigger when my opponent plays ? And will I have to sacrifice my  if my opponent casts ? Will Shroud or Hexproof prevent an opponent from choosing me with 's ability? Will Hexproof keep one of my creatures from being affected by ? If an Aura or Equipment is attached to a creature with Hexproof, does the Hexproof protect the attached permanent?


How can Mad-eEye Moody perceive Harry Potter through the Cloak of Invisibility when Xenophilius Lovegood says      "endures eternally, giving constant and impenetrable concealment, no matter what spells are cast at it."?

In the film and book series, Year 4 (Goblet of Fire), how is it Mad-Eye Moody/Barty Crouch could see Harry through his Magical Eye even when he was under the Invisibility Cloak?  As the cloak is a True Invisibility cloak, immune to charms and spells, and according to legend invisible to even Death, how did Mad-Eye detect Harry Potter under the cloak? How Nagini and Mrs. Norris were able to sense Harry were through other senses, such as smell and warmth, but not visually.  I'm referring to the scene/chapter where Snape follows Harry at night. Harry hides under the Invisibility Cloak but his foot is stuck at the broken staircase. Eventually Mad-Eye arrives, sees Harry through his Magical Eye, and talks Snape away.


I forgot my stack overflow account, so i create new account just to ask how i can recover or merge my old account..   I have tried this:  but there are no response from the admins..  My old account is:  which i forgot which openid or email did i have used to logged in  My new account is:  which I have associate all my gmail account to it  any suggestion? on how i can merge or recover my old account?  so.. can stackoverflow create a better account recovery by not make user inputting their e-mail, but using a button on users page that sends an e-mail to it's associated account instead?

I accidentally posted a question without being logged in. Is there a way to associate that question with my account?   For more information, visit "" in the .   a.k.a. How can you link a registered account to a cookie-based account? a.k.a. How do I merge an unregistered account with a registered account a.k.a. Merging users a.k.a. How do I associate anonymous questions I’ve asked with my registered account? a.k.a. Is there a way to claim an unregistered user? (in case anyone searches with those terms)


I have a button:      	   and jQuery code:  $(function(){   $(".separa_conto").click(function() {     var conto = $(this).data('conto');     var nuovoConto = conto + 1;     alert(conto);     $('#showAddeb_conto_'+ conto).removeClass('hidden').show('slow');     $('#showAddeb_conto_'+ conto).append('
	Sogg	1000
');     $('.rigaconto').append('');      var table = $('

').attr('id','showAddeb_conto_'+ nuovoConto).addClass('table table-hover table-bordered hidden');     var row = $('
	Further account
');     table.append(row);      $('#tabelle_conti').append(table);    }); });   but if I click twice class "NewAccount" doesn't appear second table. What is my mistake?

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


$x,y \in\Bbb Z$. Prove that if $x$ and $y$ are both odd, then $8\mid (x^2 - y^2)$.  My Proof Starts:  Assume $x$ and $y$ are both odd. So, $x = 2k + 1$ and $y = 2l +1$ for some integers $k$ and $l$. Thus, \begin{align} x^2 - y^2 &= (2k + 1)^2 - (2l + 1)^2 \\ &= 4k^2 + 4k + 1 - (4l^2 + 4l + 1) \\ &= 4k^2 + 4k - 4l^2 - 4l \end{align}    My two concerns:  1) Is this correct so far?  2) How would I deal with the “$8\;\mid$” part?

If $a,b \in \mathbb{Z}$ and odd, show $8 \mid (a^2-b^2)$.   Let $a=2k+1$ and $b=2j+1$. I tried to get $8\mid (a^2-b^2)$ in to some equivalent form involving congruences and I started with $$a^2\equiv b^2 \mod{8} \Rightarrow 4k^2+4k \equiv 4j^2+4j \mod{8}$$ $$\Rightarrow k^2+k-j^2-j=2m$$ for some $m \in \mathbb{Z}$ but I am not sure this is heading anywhere that I can tell.  Second attempt: Use Euler's Theorem and as $\gcd(a,8)=\gcd(b,8)=1$ and $\phi(8)=4$, $a^4 \equiv b^4 \equiv 1 \mod 8$ so $a^4-b^4\equiv 0 \mod{8}$.  I haven't gotten too much further are there any hints?


When using enumitem, I want to change the label names as follows:  \documentclass[11pt]{article}  \usepackage[utf8]{inputenc}  \usepackage{enumitem} \begin{document} \section{First section}  \begin{enumerate}[leftmargin=*,labelindent=\parindent,=itemsep=0pt,label=Part \arabic*.]   \item\label{part:1} append this;   \item\label{part:2} advance that;   \item\label{part:3} advance theother. \end{enumerate}  Look at  \ref{part:1} where we get the extra period. It's particularly bad if I refer to \ref{part:2}.  This gives me ".." at the end of the sentence. \end{document}   \ref{part:1} gives me Part 1. where I would like Part 1. How can I get rid of the period when I refer to it but keep it when it displayed in the list?

I am using enumitem to handle my enumerate and itemize lists. I have a list like  \begin{enumerate}[label=Step \arabic{enumi}.] \item step the first \label{en:step-1} \item el secundo \label{en:step-2} \item item the third \label{en:step-3} \end{enumerate}   When I cross-reference one of these items, the punctuation shows up in the document. For example,   Let us reference \ref{en:step-1}.   gives me  Let us reference Step1..   The regular enumerate or itemize environments don't have this problem; punctuation does not show up when cross-referencing.   In the enumitem documentation there is an option afterlabel but that is only for inline lists.  Is there an option in enumitem, or a way of using enumitem that adds the correct punctuation to the list, but lets me cross-reference the label without the punctuation?


Someone who isn't me ran dd if=/dev/zero of=* iflag=fullblock,count_bytes count=200G, so now there's a 200gb file taking up space on my filesystem. Is there a way to delete it without running rm * ?

I have a folder in which I have around 4k files. Some of these files start with a a ? or ! character. I need to delete them but can't find an expression that would do so:   rm -f ./?*   just deletes everything. I can possibly use grep on ls and pipe it through xargs and move files to another folder but I was hoping there was a proper way of doing this. Need help on both the ? and ! files.


My friend has a PE world and she wants to put it on my Windows 10. Would there be anyway to do this

I have a really cool Minecraft PE world, and I would like to also have it on my Computer. Is there a way to move a Minecraft PE world onto the PC Edition?  My tablet is Android and my Computer is Windows 7. Thanks!


Here is my code to combine the three lists. one=['nlo_90', 'nhi_76', 'nhi_88'] two=['12', '44', '84'] three=[['a','a','b','c'], ['g','a','g','g'], ['b','g','g','b']] new_three=[list(dict.fromkeys(q)) for q in three]  z=zip(one,two,new_three) for a,b,c in z:     print(f'a:{a},\tb:{b},\tc:{c}')   Below is the output: a:nlo_90,   b:12,   c:['a', 'b', 'c'] a:nhi_76,   b:44,   c:['g', 'a'] a:nhi_88,   b:84,   c:['b', 'g']  My desired output is: a:nlo_90,   b:12,   c:a, b, c a:nhi_76,   b:44,   c:g, a a:nhi_88,   b:84,   c:b, g

This has always confused me. It seems like this would be nicer:  my_list = ["Hello", "world"] print(my_list.join("-")) # Produce: "Hello-world"   Than this:  my_list = ["Hello", "world"] print("-".join(my_list)) # Produce: "Hello-world"   Is there a specific reason it is like this?


I am quite sure something like this must have been asked before but I couldn't word it properly to get to those questions. Here is my issue. Let's say I have a function called square, which returns square value of a given number. def square(number):     return number*number  I store square function in main.py file. So in the python shell, I import and run the function like this: >>> from main import square >>> square(5)  Output is obviously 25 in this case. However, when I make changes in the function, for the sake an example, let's say: def square(number):     return number*number*2  and import and run in previously opened python shell again. The result remains the same (i.e. 25). However, it should be 50. The changes take effect if the close and reopen the python shell. Is there a way to overcome this without opening a new python shell everytime for testing. I have tested this in python 2.7.14 and 3.8.3.

I have a long-running Python server and would like to be able to upgrade a service without restarting the server. What's the best way do do this?  if foo.py has changed:     unimport foo  <-- How do I do this?     import foo     myfoo = foo.Foo()


I've been trying to use this beamer theme: . When I try to compile the sample .tex file included it gives me an error that reads:   ! Fatal fontspec error: "cannot-use-pdftex" ! ! The fontspec package requires either XeTeX or LuaTeX to function. ! ! You must change your typesetting engine to, e.g., "xelatex" or "lualatex" ! instead of plain "latex" or "pdflatex". ! ! See the fontspec documentation for further information. ! ! For immediate help type H <return>. !............................................... l.38 } |''''''''''''''''''''''''''''''''''''''''''''''' | This is a fatal error: LaTeX will abort |............................................... ) ) ) ) (\end occurred when \ifx on line 20 was incomplete) (\end occurred when \ifx on line 20 was incomplete) (\end occurred when \ifx on line 6 was incomplete) (\end occurred when \ifx on line 6 was incomplete) Here is how much of TeX's memory you used: 22086 strings out of 493921 418411 string characters out of 3147276 482941 words of memory out of 3000000 24934 multiletter control sequences out of 15000+200000 5018 words of font info for 17 fonts, out of 3000000 for 9000 841 hyphenation exceptions out of 8191 61i,1n,70p,412b,277s stack positions out of 5000i,500n,10000p,200000b,50000s No pages of output. PDF statistics: 9 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 31 words of extra memory for PDF output out of 10000 (max. 10000000)   How can I solve this problem? I'm still fairly new to LaTeX. I have tried switching the typesetting engine to XeTeX and LuaLaTeX on TeXMaker 4.3

I am running this CV/Resume example from :   Here is a relevant fraction of the code:  \documentclass[10pt]{article} %!TEX encoding =  UTF-16 % See geometry.pdf to learn the layout options. There are lots. \usepackage[hmargin=1.25cm, vmargin=1.5cm]{geometry} %symbols - the ones you see on the left of the email and of the phone \usepackage{bbding} \usepackage{amssymb} \usepackage{eurosym} %Colors/Graphics \usepackage{color,graphicx} \usepackage[usenames,dvipsnames]{xcolor}  %Fonts and Tweaks for XeLaTeX \usepackage{fontspec,xltxtra,xunicode} \defaultfontfeatures{Mapping=tex-text} \setromanfont[Mapping=tex-text]{Hoefler Text} ...   So... when compiling with LuaLaTeX (part of MiKTeX on Windwos XP x64), I am getting the following error:  ... luaotfload | Font names database loaded: C:/Documents and Settings/Ampleforth/L ocal Settings/Application Data/MiKTeX/2.9/luatex-cache/generic/names/otfl-names .lua luaotfload | Updating the font names database: luaotfload | Scanning TEXMF and OS fonts... luaotfload | Font names database saved: %s  : C:/Documents and Settings/Ampleforth/Local Settings/Application Data/MiKTeX/2 .9/luatex-cache/generic/names/otfl-names.lua  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !  ! fontspec error: "font-not-found" !  ! The font "HoeflerText" cannot be found. !  ! See the fontspec documentation for further information. ! For immediate help type H <return>. !...............................................    l.28 \setromanfont[Mapping=tex-text]{Hoefler Text}   What is wrong? How can I install this font so LuaLaTeX is picking it up? Where to download? Any other thoughts about this?


The problem:  Consider the smooth quadric $Q=V(X_{0}X_{1}+X_{2}X_{3}+X_{4}^{2})\subset\mathbb{P}^{4}$ and the line $L=V(X_{0},X_{2},X_{3})$ contained in it. Prove that there exists a vector bundle $F$ on $Q$ with a section vanishing exactly at $L$.

The problem:  Consider the smooth quadric $Q=V(X_{0}X_{1}+X_{2}X_{3}+X_{4}^{2})\subset\mathbb{P}^{4}$ and the line $L=V(X_{0},X_{2},X_{4})$ contained in it. Prove that there exists a vector bundle $F$ on $Q$ with a section vanishing exactly at $L$.  The hardest thing is to get the transition matrices. Any help is appreciated.