How is the set of rational numbers countably infinite?
Produce an explicit bijection between rationals and naturals?
Graphical glitches using Ubuntu 18.04 on Dell XPS 13 2019 laptop My laptop keeps on having weird screen glitches, sometimes for a second, and that goes away just by moving the cursor, sometimes, making me restart the whole thing.  I could still use the play/pause key and it still played/paused the video that was running even though the screen was completely teared.  Also, printscreens actually print a normal screen and do not show the problem.  Some pictures of the screen when it happens :     Do you guys know what I could do to solve the issue ? Spacing issue for newenvironment wrapper of equation environment If I create a custom environment based on the equation environment, I get a spacing issue: the next line of text after my environment closes doesn't start on the left margin.  Example code:  \documentclass{article} \begin{document} \newenvironment{myenv}{\begin{equation}}{\end{equation}} \noindent $| \leftarrow$ this is the left margin. \begin{myenv} e ^{i \pi} + 1 = 0 \end{myenv} $| \leftarrow$ this isn't the left margin. \end{document}   Output:    Removing the newline after \end{myenv} solves the spacing problem, but the resulting code is not readable.  Of course, in this example I could just use the equation environment itself. My real issue involves a more complex custom environment that suffers from the same problem, and which also includes an equation environment within it. Adding Layer using esriRequest Response in ArcGIS API for JavaScript? For various reasons I need to add layers to a map object using a response returned by an esriRequest to an ArcGIS Server. One reason being the data will change constantly and hard coding FeatureLayer URLs would prove inefficient.  I have successfully been able to return a JSON object containing attribution that appears to be the same data one would see on the layers REST node.     maps = [];  require([     "esri/map", "esri/layers/FeatureLayer",      "esri/dijit/Print", "esri/tasks/PrintTemplate", "esri/request",      "esri/config","esri/dijit/BasemapToggle",      "dojo/_base/array", "dojo/dom", "dojo/parser",  "dojo/domReady!"  ], function (Map, FeatureLayer,Print, PrintTemplate, esriRequest,      esriConfig,BasemapToggle,arrayUtils, dom, parser){  parser.parse();  console.log("Map Start");  esriConfig.defaults.io.proxyUrl = "http://........./proxy.ashx";  maps.addRespLyrs = function addRespLyrs (layer) {     if (layer.type == "Feature layer") {         console.log(layer.name);         maps.map.addLayer(layer);     } };   maps.handleMapInfo = function handleMapInfo (resp) {     console.log("handleMapInfo called");     maps.layers = resp.layers;     console.log(maps.layers);     for (i in maps.layers) {         var layer = maps.layers[i];         maps.addRespLyrs(layer);     } };  maps.layerRequest = function layerRequest () {     var mapInfo = esriRequest({         "url": "https://........./Application Name/MapServer/layers",         "content" : {"f":"json"},         "handleAs" : "json",         "callbackParamName" : "callback"     });     mapInfo.then(maps.handleMapInfo); };  maps.map = new Map("cpCentCent", {     basemap:"topo",     center: [-98.5795, 39.8282],     zoom: 5 });   console.log("Map End");   When attempting to add the data using the addLayer() method I recieve an error thrown from deep with in esri's API.      init.js:199 TypeError: a.id.match is not a function(…) "TypeError: a.id.match is not a function   Any thoughts as to what could be going wrong here or how to create a layer from my JSON? I am little confused with the applicability of reinterpret_cast vs static_cast. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hence the word static. This is the cast the C++ compiler uses internally for implicit casts also.  reinterpret_casts are applicable in two scenarios:   convert integer types to pointer types and vice versa  convert one pointer type to another. The general idea I get is this is unportable and should be avoided.     Where I am a little confused is one usage which I need, I am calling C++ from C and the C code needs to hold on to the C++ object so basically it holds a void*. What cast should be used to convert between the void * and the Class type?  I have seen usage of both static_cast and reinterpret_cast? Though from what I have been reading it appears static is better as the cast can happen at compile time? Though it says to use reinterpret_cast to convert from one pointer type to another? get current user info using jquery ,REST and csom My goal is to get the login name and picture for the current user. I am using SharePoint 2013 Foundation. I tried three method and non of then worked correctly:   This is with jQuery SPServices:   function getCurrentUserInfo() {     var thisUsersValues = $().SPServices.SPGetCurrentUser({         fieldNames: ["ID", "Name", "Picture"],         debug: false     });      var name = thisUsersValues["Name"];      var ID = thisUsersValues["ID"];      var SIPAddress = thisUsersValues["Picture"];  }    But I am getting this error:     SCRIPT438: Object doesn't support property or method 'replace'      File: jquery.SPServices-2014.01.js, Line: 2414, Column: 17    REST API method:   function getinfo(loginName) {     var theData = {         "propertiesForUser": {             "__metadata": { "type": "SP.UserProfiles.UserProfilePropertiesForUser" },             "accountName": loginName,             "propertyNames": ["PreferredName", "PictureURL"]         }     };      var requestHeaders = {         "Accept": "application/json;odata=verbose",         "X-RequestDigest": jQuery("#__REQUESTDIGEST").val()     };      jQuery.ajax({         url: _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertiesFor",         type: "POST",         data: JSON.stringify(theData),         contentType: "application/json;odata=verbose",         headers: requestHeaders,         success: function (data) {             document.getElementById("profilelink").href = userProfileProperties[1];;             document.getElementById("username").innerHTML = userProfileProperties[0];             if (userProfileProperties[1] !== null) {                 document.getElementById("Userprofileimage").src = userProfileProperties[1];             }         },         error: function (jqxr, errorCode, errorThrown) {             console.log(jqxr.responseText);         }     }); }    Error:     "{\"error\":{\"code\":\"-1,        Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"The method         GetUserProfilePropertiesFor cannot be invoked as its parameter propertiesForUser is not supported.\"},\"innererror\":        {\"message\":\"The method GetUserProfilePropertiesFor cannot be invoked as its parameter propertiesForUser is not supported.\"        ,\"type\":\"Microsoft.SharePoint.Client.InvalidClientQueryException\",\"stacktrace\":\"     With CSOM:  //SP.SOD.executeOrDelayUntilScriptLoaded(getUserProperties, 'SP.UserProfiles.js'); function getUserProperties(targetUser) {      // get the target users domain name and account name.     var tUser = targetUser.substring(7);     // Get the current client context.     var clientContext = new SP.ClientContext.get_current();     //Get PeopleManager Instance     var peopleManager = new SP.UserProfiles.PeopleManager(clientContext);     // Get the properties to retrieve     var profilePropertyNames = ["PreferredName", "PictureURL"];     var userProfilePropertiesForUser = new SP.UserProfiles.UserProfilePropertiesForUser(         clientContext,         tUser,         profilePropertyNames);     // Get user profile properties for the target user     userProfileProperties = peopleManager.getUserProfilePropertiesFor(userProfilePropertiesForUser);     // Load the UserProfilePropertiesForUser object.     clientContext.load(userProfilePropertiesForUser);     //Execute the Query     clientContext.executeQueryAsync(onRequestSuccess, onRequestFail); }    I really don't understand where the issue is. Does anyone have an idea? Output from ls has newlines but displays on a single line. Why? I think I may be overlooking a relatively fundamental point regarding shell. Output from the ls command by default separates output with newlines, but the shell displays the output on a single line.  Can anyone explain this to me? I had always presumed that the output was simply separated by spaces, but now that I see the output separated by newlines, I would expect the output to be displaying on separate lines.  Example:  cpoweradm@debian:~/lpi103-4$ ls text* text1  text2  text3   od shows that the output is separated by newlines:  cpoweradm@debian:~/lpi103-4$ ls text* | od -c 0000000   t   e   x   t   1  \n   t   e   x   t   2  \n   t   e   x   t 0000020   3  \n 0000022   If newlines are present, then why doesn't the output display as:  text1  text2 text3 Cleaning my Macbook Pro Retina leaves greasy 'streaks' across the screen Argue by contradiction to show that there is no surjection... from $A$ to $\{0,1\}^A$. When $A$ is any (possibly infinite) set  How does one go about this? Export multiple objects to .obj It is possible to export all object from a scene into different obj files (each object in a obj file separately)? In Clash of Clans there was an update on 9/16 adding a Tie-breaker into the wars, can anybody explain in detail how this mechanism works? How do you parse and process HTML/XML in PHP? download file on form submission I have created a form which has only a submit button. In the submit function I am generating csv file and saving it to the files folder using fputcsv function.  But Now I need extra functionality of submit. After saving the file it should download the file also.  How to do this? Any one have some idea about this? Children's fantasy series with a symbol consisting of a circle divided into quarters I read this book series as a kid back in the late 1970s, so it's an old series - and my memories are similarly old, and vague.   I know it's a fantasy series. I think there are 4 books in the series. Or perhaps 7.  There's a central boy character who has to get a collection of magical objects (every fantasy needs a quest!), each of which represents a different magical 'element': wood, stone, fire, etc. I definitely remember there was a wooden object. He lives in our normal world. The whole series takes place "here &amp; now". I have a feeling he's a "chosen" person of some kind... But, the strongest memory I have is of a symbol: a circle which is divided into quarters (a vertical bar and a horizontal bar).  I know it's vague, but does anyone recognise this? How can I improve Ubuntu overall system performance? What are your tips for improving overall system performance on ubuntu? Inspired by this  I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster.  This is not meant to be application specific (e.g. make firefox load pages faster), but system wide.  Preferably 1 tip per answer, with enough detail for people to implement it.  A couple of mine would be:   Install  (via Software Center or sudo apt-get install preload); Change  value - "which controls the degree to which the kernel prefers to swap when it tries to free memory";   What are yours?  PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box. In "Settings" > "SD card &amp; phone storage settings" under "Internal Phone Storage" it lists "Available Space" as 13.78MB.  I'm trying to install an app that is 2.38MB.  Why do I get the "Insufficient storage available" error message?  I clearly have enough space.  If it's relevant, my phone is an LG Optimus V. I have an object x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted properties. This isn't a problem, since I'm copying one of my own literal-constructed objects.  How do I correctly clone a JavaScript object? Getting JavaScript object key list A basic grammar rule is to use an instead of a before a vowel sound. Given that historic is not pronounced with a silent h, I use “a historic”. Is this correct? What about heroic? Should be “It was a heroic act” or “It was an heroic act”?  I remember reading somewhere that the h is sometimes silent, in which case it’s an, and when the h is pronounced, it’s a. But then I also remember reading that it depends on which syllable is stressed. And I also think I read somewhere that it might differ between British and American English.  Personally, I pronounce the h, and believe that a is correct. I find that it sounds incorrect to use an and pronounce heroic without the h.  So how do I know when to use a and when to use an with a word beginning with the letter h? Are both acceptable or is there one that is correct? Reset the password in Ubuntu / Linux Bash in Windows I have installed Linux Bash on Windows 10 (available from Microsoft), but I've forgotten my password.  I've searched for a solution but I only find suggestions that involve doing something before the system boots, like accessing recovery mode, but that will not work in this case as this Ubuntu is just an application within a Windows system and doesn't have its own boot process.  How can I reset my password? How would I go about finding $\prod_{n=1}^\infty (1+\frac{1}{n^2})$ ? Setting $a_k = \prod_{n=1}^k (1+\frac{1}{n^2})$, the first few partial products are $a_1 = 2$, $a_1 = 2.5$, $a_3 \approx 2.78$, $a_4 \approx 2.591$, $a_{20} \approx 3.50$, and they eventually appear to converge at around $3.639$. (These values were found with a quick python program. So much for my initial conjecture that the product converged to $e$.)   I tried writing $1+\frac{1}{n^2}$ as $\frac{n^2 + 1}{n^2}$, but it wasn't immediately obvious how to prove convergence / find the limit because the product doesn't really factor or telescope. Is there a way to calculate the limit?