Construct an Injection between the set of rationals $\mathbb{Q}$ and the set of all integers $ \mathbb{Z}$ Construct an Injection between the set of rationals $\mathbb{Q}$ and the set of all integers $\mathbb{Z}$ .  Answer:  Define $ f: \mathbb{Q} \to \mathbb{N} \ $ by $ \ f\left(\frac{p}{q}\right)=|p-q|+1 \ $ , where $ \gcd(p,q)=1$  Clearly $f$ is an injection.  Next, define $ g: \mathbb{N} \to \mathbb{Z}$ by $  g(n)=n  $  Then $ g $ is also an injection.
How to prove that $\mathbb{Q}$ ( the rationals) is a countable set I want to prove that $\mathbb{Q}$ is countable. So basically, I could find a bijection from $\mathbb{Q}$ to $\mathbb{N}$. But I have also recently proved that $\mathbb{Z}$ is countable, so is it equivalent to find a bijection from $\mathbb{Q}$ to $\mathbb{Z}$?
UnboundLocalError: local variable 'url_request' referenced before assignment Get the newest file from directory structure year/month/date/time I store backups of databases in a directory structure  year/month/day/time/backup_name  an example would be   basics_mini/2012/11/05/012232/RATIONAL.0.db2inst1.NODE0000.20110505004037.001 basics_mini/2012/11/06/012251/RATIONAL.0.db2inst1.NODE0000.20110505003930.001  note that timestamp from the backup file cannot be used. Before the automation testing starts the server time is set to 5.5.2011  So the question is how I can get the latest file if I pass the "base directory" (basics_mini) to some function that I am going to code.  I need to restore the newest database. I do that in php but I wonder if there is a simple shell scripting solution. Angle notation for complex numbers in polar form When is it better to use String.Format vs string concatenation? Remove all attributes from html tags What does this depiction of a black hole in the movie Interstellar mean? In Iron Man 3,      When the real villain kidnapped the President of the United States,   it is never explained why none of the other Avengers came to help, or why Tony didn't call them. The only explanation so far is: "it was an Iron Man movie...", but an in universe answer would be good. Display data from geoserver on click map with openlayers I tried to display data with popup from Geoserver or Postgres to my map, but it dosen't work at all. Can anyone please help me? I used this code:      function Info(e)          {                 if (e.features &amp;&amp; e.features.length)                  {                      //console.log(e.features[0].attributes);                     var popupId = e.xy.x + "," + e.xy.y;                     var popup = popups[popupId];                     if (!popup || !popup.map) {                     popup = new OpenLayers.Popup.FramedCloud(                     popupId,                      map.getLonLatFromPixel(e.xy),                     null,                     " ",                     null,                     true,                     function(e) {                         delete popups[this.id];                         this.hide();                         OpenLayers.Event.stop(e);                     }                 );                 popups[popupId] = popup;                 map.addPopup(popup, true);                 }                popup.setContentHTML(popup.contentHTML + "nom_user:" +e.features[0].attributes.nomservice +" region_user :"+ e.features[0].attributes.region);             popup.show();                                    }       selectcltr = {         click: new OpenLayers.Control.WMSGetFeatureInfo({             url: 'http://localhost/geoserver/wms',              title: 'Identify features by clicking',             layers: [ser],             queryVisible: true         }),         hover: new OpenLayers.Control.WMSGetFeatureInfo({             url: 'http://localhost/geoserver/wms',              title: 'Identify features by clicking',             layers: [ser],             hover: true,             // defining a custom format options here             formatOptions: {                 typeName: 'projet',                  featureNS: 'http://www.openplans.org/topp'             },             queryVisible: true         })     } iptables drop all incoming ICMP requests except from one IP Currently, I have something like:  iptables -A INPUT -p ICMP --icmp-type 8 -j DROP iptables -A INPUT -s x.x.x.x -p ICMP --icmp-type 8 -j ACCEPT   However, when I run the second command, it looks as if iptables just stops.  I have to break out of it to get back to terminal.  Perhaps I am doing it all wrong, but some insight would be helpful. How to test with Math.random in JavaScript? How do I put a stencil-like texture across a sectioned object? What is average distance from center of square to some point? I have been denied a visa several times in a row. How does one deal with such serial refusals? On  the delete notice is above, instead of below the close notice. Why is this happening? I understand this was made on purpose, but would like to know the reasoning. Accessing localhost (xampp) from another computer over LAN network - how to? I have just set up a wi-fi network at home. I have all my files on my desktop computer (192.168.1.56) and want to access localhost over there from another computer (192.168.1.2).  On my desktop I can access localhost through the normal . Apache is running on port 80 as usual.  Exactly what do I have to do to achieve this? There is documentation on the net but they either don't work or are too fragment and confusing to understand.  I think I have to make changes to my apache's httpd.conf file and the hosts file. Any ideas as to what changes to make? What's the difference between dot syntax and square bracket syntax? This question led to a new package:      I wish to typeset some relatively long URLs in a piece of text, and when I use \url{..}, the resulting text does not respect the margin boundaries that govern the main text body, instead going all the way to the edge of the paper before wrapping around.   For reference, my preamble looks like this:  \documentclass[12pt]{article} \usepackage{mathptmx} \usepackage{fullpage} \usepackage[pdftex]{hyperref}   and example of the url I'm including is:  \begin{itemize} \item Some text  \url{very-long-url} ... \end{itemize}   I'm compiling using pdflatex, although I doubt this makes a difference. Identify the plane defined by $|z-2i| = 2|z+3|$ I tried:  $$|z-2i| = 2|z+3| \Leftrightarrow \\ |x+yi-2i|=2|x+yi+2|\Leftrightarrow \\ \sqrt{x^2+(y-2)^2}=\sqrt{4((x+2)^2+y^2)} \Leftrightarrow \\ \sqrt{x^2+y^2-4y+4} = \sqrt{4x^2+24x+36+4y^2} \Leftrightarrow \\ x^2+y^2-4y+4 = 4x^2+24x+36+4y^2 \Leftrightarrow \\ y^2-4y-4y^2=4x^2+24x+36+x^2 \Leftrightarrow \\ -3y^2-4y=5x^2+24x+26 \Leftrightarrow \\ ???$$  What do I do next? In  they've somehow created "wireless" networks, meaning networks that connect two components but don't have an actual wire in the schematics.  What are these called, and how can I create them in Eagle Cad 6.5? I tried many ways to make a bigger screen in VirtualBox because I do not like the small size of the guest window? Is there is a way to make it big?