I have an edit partial view to load in a dialog, which works the first time it's called, the edit then saves the data, great.   However if you don't refresh the page, which I don't want to have to do, and click 'edit' again, you are redirected to the partial page I am trying to load.  It looks like the AJAX is being ignored and the Action method in the controller is being called instead.  I have unobtrusive added through the bundles in my layout page, which the main view uses, the partial doesn't, but I don't believe it needs to.  I have also tried using preventDefault and different approached of return false; with no success, like the below:  editBtn.click(function (e) {             editDialogPlaceholder.load(this.href, function () {                 e.preventDefault(); //tried                 $(this).dialog('open');                 return false; //tried             })         return false;     });   How can I stop this?  AJAX/JS  $(function () {         var editBtn = $('.editLink');         var editDialogPlaceholder = $('#editDialogUI');          editBtn.button();         // build the dialog form         editDialogPlaceholder.dialog({             autoOpen: false,             modal: true,             resizable: false,             open: function (event, ui) {                 $(this).load('@Url.Action("Edit","Announcements")');             },             buttons: {                 "Save": function () {                     saveAnnouncement();                     fetchList();                     $(this).dialog("close");                 },                 "Close": function () {                     $(this).dialog("close");                 }             }         });         // on click load the dialog form, return false to stop redirect         editBtn.click(function () {             editDialogPlaceholder.load(this.href, function () {                 $(this).dialog('open');             })             return false;         });     });     //post data back to the controller to save to the db     function saveAnnouncement() {         $.ajax({             url: '@Url.Action("Edit","Announcements")',                 type: 'POST',                 data: $('form').serialize()             })         }          function fetchList() {             var aList = $('#announcementList');             aList.load('@Url.Action("Fetch")');         }   Edit action method  [HttpGet]         public ActionResult Edit(int id)         {                 var announcementModel = (from a in db.DbAnnouncement                            where a.Id == id                            select a).SingleOrDefault();                 return PartialView("Edit", announcementModel);         }   Html.ActionLinks being used to open the dialog - second time of clicking it redirects to the partial specified in the controller.  &lt;div class="announcementTableCell"&gt;                     @Html.ActionLink("Edit", "Edit", new { id = Model[i].Id }, new { @class = "editLink" })                      @Html.ActionLink("Delete", "Delete", new { Model[i].Id }, new { @class = "dltLink" })                 &lt;/div&gt;
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.
How do I take a screenshot on my Mac? What's the easiest way to take a screenshot of my Mac?  I've used Grab.app, but it's a bit annoying just to get a quick screenshot. Is there a faster way? Bibliography with Metadata: I am constructing a bibliography of as much of the prior research in a field I am working in. I would like to use BibTeX to print the citation in the pdf, and then I would like to add the details of the paper after the citation. Only then would I like to print the next citation. For example:  [1] Jahan M. Dawlaty and Yunquing Chen. Measurement of the optical absorption of graphene in the terahertz. Applied Physics Letters, 2008. Research Group: Cornell Pump Wavelength: 500 nm. Probe Wavelenth: 7 microns. Relaxation Time: 50 fs. [2] Paul George and Dmitry Vekslar, Measurement of Ultrafast Carrier Dynamics in Graphene. Applied Physics Letters, 2009.  . . . and so on. Does anyone know how this could be done? I have seen many folks doing this  concluding that shadow from point A on the Moon can travel to point B on the Moon faster than light.  What I fail to understand here (and I am sure I am wrong), is nothing can travel faster than light. I also read about Relativity where Einstein stated that every event happening for you depends on how fast the light gets from where the event is happening to you.  This is my particular problem with this Moon shadow experiment. You cannot make a shadow travel faster than light, because in order for the "disappearance" of light to get to the Moon, it has to travel at light speed.  Here is one way to understand my point. Consider we shine a flashlight on Moon, like the guy in the linked video did, we move the finger across the face of the flashlight, before we moved the finger it was casting the shadow at Point A on Moon, after we finish moving our finger, the shadow is at Point B on the Moon.  When the finger reaches the end of it's moving length, the light waves that have left the flashlight before the finger reached there will have to hit Point B and it will take them a second and a half to get there, and another second and half for us to see that shadow on point B, which makes it 3 seconds + finger moving time for us to actually see the shadow at point B. That means shadow traveled (say) across the diameter of the Moon in 3 seconds.   So. about 3000 Km in ~3 seconds make it 1000 Km per seconds which is very tiny compared to the speed of light. How can these experiments conclude that Shadow could be made to travel faster than light? What is the obvious clue that I am missing here? Gay rights – does Star Trek ever address this issue? I am aware of the picture of the man wearing the 'dress' from TNG, which promotes gender equality, but are gay rights ever addressed in Star Trek at all? (All seasons accepted.) Suppose $\{f_n\} \subset L^+$ , $f_n \rightarrow f$ pointwise, and $\int f = \lim \int f_n &lt; \infty$. Then $\int_{E} f = \lim \int_{E} f_n$ for all $E \in \mathcal{M}$. However, this needn't be true if $\int f = \lim \int f_n = \infty$.   This is the exercise 13 on page 52, Real Analysis, by Gerald B. Folland. $L^+$ is the space of all measurable functions from $(X,\mathcal{M}, \mu)$ to $[0, \infty]$.  I can find a counterexample satisfying $\int f = \lim \int f_n = \infty$. Let $X = \Bbb N$, $\mathcal{M} = \mathcal{P}(\Bbb N)$ and $\mu$ be the counting measure. $f_n = \chi_{\{2i+1:i \leq n\} \cup \{2j:n \leq j \leq 2n \}}$. Then $\int f = \lim \int f_n = \infty$. But when $E = \{2k: k \in \Bbb N\}$,  Then $\int_{E} f =  0$ and $\lim \int_{E} f_n = \infty$.  But how to show the part "$f_n \rightarrow f$ pointwise, and $\int f = \lim \int f_n &lt; \infty$. Then $\int_{E} f = \lim \int_{E} f_n$ for all $E \in \mathcal{M}$"? Show that every uncountable set of real numbers has a point of accumulation. How to "find and replace" in a PDF on OS X? What are the technical differences between using a DSLR viewfinder and live view? The earlier question  asks for practical advantages of optical viewfinders. But what's the technical difference, and why does a camera behave differently in each mode?  For example, on my Nikon D5100:   Slower auto-focus — I saw this explained in the related issue, but just partially: "The other major drawback of live view is that because it requires the mirror to be locked up, it means that the auto focusing mechanism is unavailable."  option not available. No . The manual says that it's dangerous to shoot direct light, when it's on live-view. There's no range finder available.   Why are all these things different?  Live view also has some advantages, like:   automatic scene selection grid lines on the screen other smaller things, like possibly easier operation on a tripod where the viewfinder might be inconvenient to look through   Some of these things, like the tripod operation, are natural. But are there technical reasons the others can't be done with an optical finder? Are there other advantages enabled by live view for technical reasons? $_SERVER["REMOTE_ADDR"] gives server IP rather than visitor IP Rendering low and res/high res images Is it possible to render in Blender with reduced low res files and then ask Blender to render the final render with 4k high res files? Low and high res files would be numbered identically but would be located in different folders.  Many thanks What is the possessive of "you guys"? Story about space explorers who communicate but then decide they must destroy each other I'm looking for a sci-fi story or novel from many years ago where a deep space explorer encounters an alien explorer. The explorers learn to communicate; but on parting, each decides to destroy the other in order to protect his own world. biblatex and autonum don't work together biblatex and autonum don't seem to work together in the newest version. Consider the following MWE:  \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[backend=biber]{biblatex} \usepackage{autonum}  \begin{document}  \end{document}   I get the following error messages:  0 File ended while scanning use of \ettl@for@do1 0 pdflatex: \pdfmatch: repetition-operator operand invalid pdfTeX warning: pdflatex: \pdfmatch: repetition-operator operand invalid)Runaway argument?{{\blx@bibdata@i {\blx@tempb }}\blx@bibfiles \eappto \blx@tempa {\blx@xml@comme   After commenting out either biblatex or autonum, the errors disappear. Duplicity Backup Browse How do you add more than one material to a mesh?   I have tried adding two materials to the object, and then assigning one of the materials to a vertex-group, but I could not find a place to assign it.  I am making a striped bouncy ball that I want to deform, so adding a different material by separating the mesh into different objects would not be ideal. My code:  a = '2.3'   I wanted to display a as a floating point value.  Since a is a string, I tried:  float(a)   The result I got was :  2.2999999999999998   I want a solution for this problem. Please, kindly help me.  I was following . What happened to /etc/apt/apt.conf? I was browsing through the apt folder to try my proxy settings and I was unable to find the apt.conf file in Ubuntu 11.04. Is there any alternative file for it?  Adding proxy settings to 99-synaptic in apt.conf.d does not help as it gets overwritten everytime I restart the system. Can anyone help me with this problem?     Let $f:[0,\infty)\longrightarrow \mathbb R$ be a continuous function such that for each $x&gt;0$, we have $\lim_{n\to \infty}f(nx)=0$. Then prove that $\lim_{x\to \infty}f(x)=0$.   Our teacher told first to prove Baire's theorem, and then show that this is a consequence of that theorem. I proved Baire's theorem, and I spend a few hours thinking on how Baire's theorem is related to this problem, but I couldn't find anything. I'd really appreciate your help. I want to view the fonts that are installed on my system. Specifically, I want the client-side (fontconfig) fonts, not the old-style X11 bitmap fonts on the server (for which xfontsel does an adequate job). I guess what I'm looking for would be called a font viewer or font gallery. I want to see a bit of sample text for each font, ideally configurable sample text.  Being able to filter by font name, available character sets and other characteristics would be a plus.  A search of packages in Debian wheezy found gnome-font-viewer and kfontview, but they can only display a single font. I'd rather avoid depending on software that isn't widely available, including on the current Debian stable and Ubuntu LTS. I have two systems installed previously Windows 7 and Ubuntu. I was trying to reinstall Ubuntu and format the Ubuntu OS partition using a tool in Windows 7.   When I have Ubuntu ready on a USB stick and restart my laptop, it prompts me with the GRUB rescue screen. If I boot from USB to install Ubuntu, it just hangs.   Anyway, I messed up everything. So my question is how can I boot Windows 7 now?