If I have a range $x \to y$ and I want to map it to $x' \to y'$, what is the logic behind the mapping process? I found the formula online as:  $$R = (y' - x') / (y - x)$$  $$\text{output} = (\text{input} - x) * R + x'$$  I understand that $R$ is the ratio of both ranges, but I don't understand the second part where we subtract $x$ from the input? Why do we do this, I can't seem to wrap my head around this.
I'm stuck in a problem of mapping numbers from one range to another. I want to calculate popularity of a web page based on the number of page hits on a scale of 10. The problem is total number of web pages are around 41,00,000 and the web pages for which page visit is given are only 1,70,000. Also, the page visit for a web page is between 20,000 and 1.  Now, I'll try to rephrase the above problem in more mathematical problem, I have 41,00,000 objects for which I need to calculate some factor "po". Out of these 41,00,000 objects, 1,70,000 objects contain some number 20,000 &lt;=y &lt;= 1. Now how can I calculate "po" for each object on scale of 10.  The data mostly looks like,  O1: 20,000 O2: 17,000 O3: 16,000 . . . . . . . O19: 334 O20: 300 . . . . . . . On: 1 and so on......   Mostly, objects have page visits = 1.  I tried calculating page visit for each object/maximum page visit for an object but that gives me very small values(like 1/20,000 is a very small number). I want my resulatant po values to be at some distance from one another so that I can differentiate between them.  Can anyone please suggest me some solution ?  Thanks
Combine and Minify Multiple CSS / JS Files How soon can I re-apply for a UK visa after getting a refusal? Task manager for Ubuntu I have what seems to me a very simple proof that $A_{n}$ is the only subgroup of $S_{n}$ of index 2.  Since I've seen other people prove it with what feel like really complicated methods (), I'm wondering if I've overlooked something.  Proof: Let $H$ be any subgroup of index 2 in $S_{n}$.  Then $H\cap A_{n}$ is a normal subgroup of $A_{n}$ and since $A_{n}$ is simple, $H$ is either the trivial or the improper subgroup of $A_{n}$.  If it's the trivial subgroup it doesn't have index 2 in $S_{n}$, and otherwise the theorem is proved. What are the limitations on the Shape Water cantrip? I have been having a discussion regarding the Shape Water cantrip from the Elemental Evil Player's Companion. A friend and I are trying to come to an accurate view of how this spell actually functions.   Some example questions:   Must the targeted water be within a 5 foot cube area, or does it need to be of a volume not exceeding 125 cubic feet? If you shape water that is within a 5 foot cube, can the final shape you animate it to extend outside the cube? Can you cause the shaping to affect ice and snow, or only liquid water? Would you be able to carry a globe of water alongside you over distances?   Really, there are two parts:    What can be targeted by the spell? What are the limitations on the 'shape and animate' portion of the spell?   The answer I am looking for, if possible, would use the language of the spell, possibly with precedent from other game text, to clearly define the limitations of this cantrip. Changing trains in Lille - what's the transfer with luggage between Lille Europe and Lille Flanders stations like? Lille has two main train stations, Lille Europe and Lille Flanders. (Gare de Marchandises Saint-Saveur is no longer a station, and instead hosts art exhibitions and the like). Lille Europe is the new station on the high speed lines between London / Paris / Brussels, while Lille Flanders is the original station now used for a mixture of local and high speed trains.  For some rail journeys, changing trains in Lille is the best option (avoiding having to cross Paris to change trains), and for others it's the only option. Sometimes you get lucky and both trains use the same station in Lille, but not all.  For the cases when you find yourself needing to change between Lille Flanders and Lille Europe stations, what's the connection like? Does it take long? Is it outside / inside? Is it a faff with luggage, or is there a step-free route for most of it? Are you best to walk, or take public transport? And a lower concern, is there anything interesting to see of the town during the transfer? What does ` (backquote/backtick) mean in commands? I came across the following command:  sudo chown `id -u` /somedir   and I wonder: what is the meaning of the ` symbol. I noticed for instance that while the command above works well, the one below does not:  sudo chown 'id -u' /somedir How to change an application icon programmatically in Android? How do I  prevent .xsession-errors from eating disk space? Is there any way to completely disable the .xsession-errors file?  I have it as a symlink to /tmp so that my laptop hard disk can (hopefully) go to sleep for once, but at least 95% of the stuff in the file (it fills up at about 500k an hour) is...  (nautilus:1618): GLib-GObject-CRITICAL **: g_value_get_object: assertion `G_VALUE_HOLDS_OBJECT (value)' failed  which is total garbage to me.  I have tried doing a symlink to /dev/null but that does not work (the resulting link is overwritten), and I also do not want the activity so that hopefully my laptop can go to sleep for once.  I am using Ubuntu 11.04, with no special add-ons to Nautilus. Sufficient condition(s) for $f'$ to be Riemann integrable Find a recurrence relation for the number of ternary strings of length n that do not contain two consecutive 0s or two consecutive 1s. Prior to the spell cast on Mjolnir, did Thor control lightning on his own? In the film Thor, Odin casts a spell on Mjolnir and strips Thor of his power.  He then banishes Thor to Midgard (Earth).  On Earth, Thor is seemingly just a strong and durable human.  Later in the film, he becomes worthy, and regains control of Mjolnir.  This then grants him his full power set and control over Mjolnir.  My question is, prior to this, could Thor control lightning all on his own?  Or is this purely an ability of Mjolnir? Arrangements of a,a,a,b,b,b,c,c,c in which no three consecutive letters are the same Q: How many arrangements of a,a,a,b,b,b,c,c,c are there such that  $\hspace{5mm}$ (i). no three consecutive letters are the same?  $\hspace{5mm}$ (ii). no two consecutive letters are the same?  A:(i). 1314. ${\hspace{5mm}}$ (ii). 174.  I thought of using the General Principle of Inclusion and Exclusion along with letting $p_i$ denote a property that.. , and doing so, I will evaluate $E(0)$, which gives us the number of arrangements without any of the properties.   How do I go about doing that? I am trying to use the method stated above in solving this question, but I am unable to generalize the properties $p_i$. My computer no longer boots Windows or the installed operating system. Instead, I may get this error:  PXE-E61: Media test failure, check cable -or- Check cable connection!  PXE-M0F: Exiting PXE ROM.   and/or one of the following messages or similar:  Operating System not found  No boot device available- No bootable devices--strike F1 to retry boot, F2 for setup utility  No bootable device -- insert boot disk and press any key  No Boot Device Found. Press any key to reboot the machine  Default Boot Device Missing or Boot Failed  Reboot and Select proper Boot device or Insert Boot Media in selected Boot device   What does this mean and what can I do?     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details. Find angle UFO in the picture attached I sent this problem to Presh Talwalkar who suggested me to send it to this site. I tried many things but was not able to find the correct solution.   I made various segments trying to get an equilateral triangle similar to the Russian triangle problem, but no success.  I also tried to flip the triangle UFO over side NO but again no success.   I tried to find like triangles, but not enough.  Could you please give me a hint?   Thanks, R. de Souza Greek pdf bookmarks I am puzzled with sections titled with Greek characters. They do appear in the pdf's Content list, though not correctly.  For example, in my thesis--written in English with LyX, based on the KOMA-script--I choose to include a translation of the summary in Greek (=Περίληψη). The "raw" code for the (unnumbered) chapter title reads: \addchap{\textgreek{Per\char208lhyh}}. In the final .pdf file (using pdflatex) the respective entry appears as Per208lhyh. Using the unicode option for the hyperref package does not fix the problem.  Update detail: the document (should) not only contain Chapter or Section titles in Greek, but normal text as well.  I have found some relevant references within tex.stackexchange and elsewhere (e.g., , the manual of the textgreek package, , ). However, I cannot extract a concrete answer.  How can Greek characters appear correctly as bookmarks in the .pdf's Content list?  Note, the information of this Q&amp;A applies to/under LyX as well. What do "." and ".." mean when in a folder? when I used ls -a to view hidden files in folder there were 2 hidden files created by default what is the significance of this two files . and ..?  ls -a   Produces  .  .. Area enclosed between the curves $y=x^2$ and $y=60-7x$ Find the area enclosed between the curves $y=x^2$ and $y=60-7x$.  I am completely new at this but I have tried and I believe that it should be between the numbers $0$ and $60$ is this right? The following MWE compiles (for me)  \documentclass{article}  \usepackage{pgfplots} \pgfplotsset{compat=newest} \usetikzlibrary{external} \tikzexternalize[prefix=figures/externalized/]   \begin{document} \begin{figure}     \centering     \begin{tikzpicture}          \begin{axis}  %           \addplot3[surf,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};              \addplot3[contour gnuplot,mesh/rows=129,mesh/cols=129,mesh/ordering=y varies] table[x=X,y=Y,z=psi] {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.dat};          \end{axis}      \end{tikzpicture}     \caption{ciao} \end{figure} \end{document}   where the data file is . If I de-comment the first \addplot3 and comment the second one, then I get an error. The final part of the log file (the interesting one, I think) is  ===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o n-error -interaction=batchmode -jobname "figures/externalized/prova-figure0" "\ def\tikzexternalrealjob{prova}\input{prova}"' ======== \openout3 = `prova.auxlock'.  runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname  "figures/externalized/prova-figure0" "\def\tikzexternalrealjob{prova}\input{pr ova}")...executed.  \openout3 = `prova.auxlock'.   ./prova.tex:22: Package tikz Error: Sorry, the system call 'pdflatex -shell-esc ape -halt-on-error -interaction=batchmode -jobname "figures/externalized/prova- figure0" "\def\tikzexternalrealjob{prova}\input{prova}"' did NOT result in a us able output file 'figures/externalized/prova-figure0' (expected one of .pdf:.jp g:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex,  this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 18' or som ething like that. Or maybe the command simply failed? Error messages can be fou nd in 'figures/externalized/prova-figure0.log'. If you continue now, I'll try t o typeset the picture.  See the tikz package documentation for explanation. Type  H &lt;return&gt;  for immediate help.  ...                                                l.22    \end{tikzpicture}  ?  PGFPlots: reading {figures/data/LidDrivenCavity/Lid_SPIKE_128x128_Re1000_psi.da t} Runaway argument? {\pgfkeyssetvalue {/pgfplots/execute at begin plot visualization}{}\pgfkeyssetv alue \ETC. ./prova.tex:22: TeX capacity exceeded, sorry [main memory size=5000000]. &lt;argument&gt; ...5e-1],2Y7.753628e-3]}{2Y8.20894\ETC.  l.22    \end{tikzpicture}  If you really absolutely need more capacity, you can ask a wizard to enlarge me.   Here is how much of TeX's memory you used:  20761 strings out of 493054  547383 string characters out of 6134761  5000001 words of memory out of 5000000  23958 multiletter control sequences out of 15000+600000  3640 words of font info for 14 fonts, out of 8000000 for 9000  1141 hyphenation exceptions out of 8191  62i,4n,84p,728b,1519s stack positions out of 5000i,500n,10000p,200000b,80000s ./prova.tex:22:  ==&gt; Fatal error occurred, no output PDF file produced!   similar (or the same) error appears if externalization is not enabled/used.  My TeX distribution is TeX Live on Mac OS X 10.9.5 and I use TeXShop as editor.  Once I (partially) solved a  on Windows+MikTeX+TeXniccenter by modifying/adding options to the command executed when compile button is pressed. I say partially since I actually solved the problem for some data file. Then I experienced the same problem with larger datafile and/or different plots (I don't remember anymore) and didn't find a way out, no matter how much I extended the memory.  What should I do now? Harmonic Motion