I wanna redirect to another page when I clicked a button. I am using node.js express. I want the routers to render the file to the client. The client code is :  var socket = io.connect('/'); $(document).ready(function() {   socket.emit('createNewUser');   $('#signup-btn').click(function() {     var user_info = {       name: $('#inputUserName').val(),       email: $('#inputEmail').val(),       password: $('#inputPassword').val()     }      socket.emit('createNewUser', user_info);      //redirect to '/personal' here   }); });   The routes->index.js code is   var express = require('express'); var socket = require('socket.io'); var router = express.Router();   // router.get('/', function(req, res) { //    res.sendFile(path.join(__dirname) + '/views/homepage.ejs'); // }); // router.get('/', function(req, res, next) { //   res.render('homepage', { title: 'Express' }); // }); // router.get('/signup', function(req, res, next) { //   res.render('signup', { title: 'Express' }); // }); router.get('/personal', function(req, res, next) {   res.render('personal', { title: 'Express' }); }); // router.get('/myFile', function(req, res, next) { //   res.render('myFile', { title: 'Express' }); // }); // router.get('/updateData', function(req, res, next) { //   res.render('updateData', { title: 'Express' }); // }); module.exports = router;   I have tried several method. window.location.href=""; does not work. I used $.get(/personal), it seems that the router can get the request but did not render anything.
How can I redirect the user from one page to another using jQuery or pure JavaScript?
"FTL" Communication with Quantum Entanglement? Can quantum entanglement make sending a message, whether audio, video, or even Morse code, instantaneous between two points (faster than it could travel normally at the speed of light)?  Let me first be clear, my question is not whether a message can travel faster than light. I simply mean whether a message can be generated here and then a copy of that message heard over there sooner than the message would normally be received.  Say a large number of entangled pairs are generated. One half the particles are given to Jack and the opposite ones to Sally. Jack then hops on a ship and travels 8 months to Mars. Sally then manipulates her particles in the form of a message. Do the corresponding opposite particles get manipulated simultaneously so that Jack receives the message instantly instead of the 16 light-minutes for a classically transmitted message? Is there a difference between installing an application via Ubuntu Software Center or a terminal? I would like to ask a very basic question but I have never thought about it before. Well, when someone installs an application from terminal, he has to add the repository first, right? On the other side, when someone installs an application from the Ubuntu Software Center, is the repository then added automatically?  I am asking those questions to figure out this: When I run update and then upgrade, will this application be upgraded or not? Is the result same in two options? I have recently begun self-studying Number Theory, and am working on proving:     Show that every integer $n&gt;0$ can be uniquely written as $$n = \sum_{i=0}^mc_i3^i$$ where $c_i \in \{ -1,0,1\}$ and $c_m \neq 0$.   I believe I have already shown the existence portion of this proof correctly, and now I am looking for some hints on the uniqueness part. So far what I have tried is:     Suppose for the sake of contradiction that there is an alternate representation of $n$ besides $n = \sum_{i=0}^mc_i3^i$, say $n = \sum_{i=0}^pb_i3^i$ where we still have $b_p \neq 0$ and $b_i \in \{-1,0,1\}$.    At this point I felt that I first need to establish that $m=p$, and second show $c_i=b_i$ for each $i \in \{1,2,\dots,  m\}$. To show the former, I left off in my proof by contradiction with      Without loss of generality suppose $p&gt;m$. We know there is an integer $q$ such that $m+q=p$. We have two ways of writing $n$, which means $$ \sum_{i=0}^pb_i3^i-\sum_{i=0}^mc_i3^i=0 \\ \implies \left(\sum_{i=0}^mb_i3^i+\sum_{i=m+1}^{m+q}b_i3^i\right)-\sum_{i=0}^mc_i3^i=0 \\ \implies \sum_{i=0}^m(b_i-c_i)3^i+\sum_{i=m+1}^{m+q}b_i3^i=0 \\ \implies \sum_{i=m+1}^{m+q}b_i3^i=\sum_{i=0}^m(c_i-b_i)3^i$$   At this point I am stuck. If anyone has any hints to help me find the contradiction or feel that there is a better way to establish uniqueness, please let me know! I am seeking suggestions on what may be going in with an iMac I am currently troubleshooting, as it’s displaying behaviour I do not recall seeing before.  Short story  This iMac refuses to boot up. It gets the Apple logo, gets past the progress bar, and then gets stuck on the grey screen for about two minutes before rebooting itself. However, what makes this odd is that I can:   Start the iMac in Target Disk Mode and use it to successfully boot up other Macs. In doing so everything seems to work perfectly fine. Successfully boot the iMac from an external drive and everything seems to work perfectly fine.   Long story  I was presented this iMac about 2 weeks ago as it refused to bootup. That is, it would commence booting up and cycle through the Apple logo and progress bar, but after the progress bar completed it would remain on the grey screen for a couple of minutes before rebooting itself and doing the same thing all over again.   To address this I undertook the following troubleshooting steps:   Resetting SMC - failed Resetting NVRAM - failed Starting up in Safe Mode - failed Starting up in OS X Recovery Mode – failed Starting up in OS X Recovery Mode via the internet – failed Undertook an extensive hardware test using Apple Hardware Test (AHT 3A213) - passed Started iMac in Target Disk Mode and retested hard drive using Scannerz on another iMac - passed Started iMac in Target Disk Mode and reformatted the hard drive and did a clean install of Mac OS X El Capitan 10.11.6 - successful Migrated data from a Time Machine backup - successful   After these steps I tested the iMac for four days with no issues in terms of booting up and using the computer. On the fifth day I needed to manually import seven Apple Mail mailboxes. I did these one by one and six of them imported within minutes.  The last mailbox was showing as being 270 GB in size. I knew this was inaccurate, but I decided to import the mailbox so I could do a mailbox rebuild to correct whatever corruption had taken place. This import took over 12hrs to do but seemed to work fine and Mail was displaying the emails.  I then tested the iMac on and off for another day to ensure it had no problems booting up. This was successful.  I then decided to initiate the mailbox rebuild, but as soon as I did the screen went black and stayed that way regardless of any keyboard shortcuts I tried using. I waited an hour, forced a reboot, and ever since the iMac has returned to its original behaviour of not booting up – it would get past the progress bar and stay on the grey screen for a while before rebooting itself and starting the whole vicious cycle again.  I have again retested the hard drive, processor, RAM and Video Ram by starting the iMac from an external hard drive and using a combination of the following packages:   Apple Hardware Test (AHT 3A213) Scannerz TechTool Pro Memtester (under the Homebrew subsystem)   And now I have a situation where I can boot the iMac from external hard drives, and also use it in target disk mode to boot up other Macs, but cannot use it to boot from its own internal drive.  At present I have isolated the internal hard drive and am running a scan to check for any malware.   In the meantime, I am wondering:   Has anyone come across a similar scenario and, if so, what was the cause? Assuming I find no malware, do I go through the reformat/clean install/migration process again, but this time not import the last mailbox and see whether the iMac works fine? Any other suggestions?   iMac specs are as follows:   iMac (27”, mid 2011) 3.1 GHz Intel Core i5 8 GB RAM AMD Radeon HD 6970M 1024 MB 1 TB 3.5” SATA HD Mac OS X El Capitan 10.11.6 How can I check the integrity of a downloaded Ubuntu CD? I've just downloaded a CD image of Ubuntu. I know the installer has a check CD option, but how can I check that the image is good before burning it to CD? I am having a hard time with the following real analysis qual problem.  Any help would be awesome.  Suppose that $f \in L^p(\mathbb{R})$, where $1\leq p&lt; + \infty$. Let $T_r(f)(t)=f(t−r)$. Show that $\lim_{r \to 0} \|T_rf−f\|_{L_p} =0$, that is $$ \lim_{r\to 0} \left( \int_{\mathbb R} |f(t-r) - f(t)|^p \mathrm d t\right)^{1/p} =0.$$ How can I get suffix matching in a search in SharePoint 2013? I'm new to SharePoint 2013 and I'm quite puzzled, that it seems to be impossible to search for the middle part of a string.  Simple example:  I've added a lot of documents (PDFs, ...) from our Windows Server to the SharePoint Library and I want to add metadata. I try to filter the view of the document library, to only get those documents which I currently want to edit.  The names of the documents are very systematic, composed of naming conventions with abbreviations like:  Superthing2000-b_Suppl_REF_13580_note_1108_04en which means e. g.: Document about Product "Superthing2000", variant "b", Supplement to the manual, ID "13580", from 08/2011 in english language.  Now, I'd like for example to filter out all documents containing ID 13580 or "en" for english, but no chance, as suffix matching is not possible, even if I explicitly search for e. g. *en*.  Is there a way to define a search with kind of a "contains" operator which also finds files when the search string is only a part in the middle of the file name? Even the Windows Explorer search feature is able to do that!! How to remove Firefox's "inspect element" button? This is driving me crazy! When FF 12 came out, Firefox's own 'Inspect Element' button on the right-click menu took the place of there the Firebug 'Inspect Element' button used to be.  As I've been doing web development in Firefox forever, my muscle memory still clicks there when I want to use Firebug.    Is there any way to remove the Firefox internal 'Inspect Element' and replace the button on the menu with Firebug's, returning it to its original position (marked NO in the screenshot)? Dynamic date range query I'm trying to create two cells that will update my query: A >= date"A1" and A &lt;= date "B1".  My goal is to create a search page for the data, where the end user could insert a date or the =today() function and it would update the query. I am currently getting a formula parse error from:  =QUERY(Data!6:1397,"SELECT A,B,C,D,E,F,G,H,I,J,K,L WHERE A &gt;= date"A1"and  A &lt;= date"B1"") Install Win7 theme on Ubuntu 16.04 I'm totally new to Ubuntu. I've installed version 16.04 and I'm having trouble finding my way around. I've tried just about all possible ways to make Ubuntu look like windows 7. Every way I tried was missing something, Is there a way to make version 16.04 be like win7? Does SE have a social life/relationships questions site Homomorphism between compact Hausdorff spaces. Can somebody help me calculate the following integral:  $$\int\limits_{1/3}^{3}\frac{\arctan(x)}{x^2-x+1}\;\mathrm{d}x$$  I have tried integration by parts, but I got stuck in it. Wolfram also didn't help me.  I would be happy to get some hints. How to evaluate potential advisers on grounds other than their research/publications? Some images shown outside of preview rectange Some images shown outside of preview rectange before uploading, eg: Content Type field on NewForm.aspx I have a custom list and I am using content types to add items to the list. I am using OOTB forms for new and edit items. One field that I see on the EditForm.aspx is the one that I hope I get on the NewForm.aspx also and it is the Content Type field. It is shown in the following screenshot. Do you know how to add that field on the NewForm.aspx page also?    Thanks. Prove that $\lfloor\lfloor x/2 \rfloor / 2 \rfloor = \lfloor x/4 \rfloor$ I lost my .keystore file? Generate a random variable with a defined correlation to an existing variable(s) For a simulation study I have to generate random variables that show a predefined (population) correlation to an existing variable $Y$.  I looked into the R packages copula and CDVine which can produce random multivariate distributions with a given dependency structure. It is, however, not possible to fix one of the resulting variables to an existing variable.  Any ideas and links to existing functions are appreciated!  &nbsp;  Conclusion: Two valid answers came up, with different solutions:   An R  by caracal, which calculates a random variable with an exact (sample) correlation to a predefined variable An R  I found myself, which calculates a random variable with a defined population correlation to a predefined variable     [@ttnphns' addition: I took the liberty to expand the question title from single fixed variable case to arbitrary number of fixed variables; i.e. how to generate a variable having predefined corretation(s) with some fixed, existing variable(s)] Proof that a sum of Bernoulli rvs has Binomial distribution