One method in my controller returns a view which has link like http://localhost:17000/Questionnaire/CompleteQuestionnaire?GuidToken=4815823D-3BFF-487D-AEB0-BB874AE9FBDE and other method returns just link like /Questionnaire/CompleteQuestionnaire?GuidToken=4815823D-3BFF-487D-AEB0-BB874AE9FBDE  [HttpGet]     public JsonResult ShowUrlQuestionnaire(int id)     {         var questionnaire = QuestionnaireRepository.GetById(id);         var questionnaireUrl = "/Questionnaire/CompleteQuestionnaire?GuidToken=" + questionnaire.QuestionnaireId.ToString();         return Json(questionnaireUrl, "text/html", System.Text.Encoding.UTF8,                     JsonRequestBehavior.AllowGet);     }   how can I add root part of link in var questionnaireUrl ?   I tried to add this method in controller   private string GetBaseUrl()     {         var request = HttpContext.Current.Request;         var appUrl = HttpRuntime.AppDomainAppVirtualPath;          if (!string.IsNullOrWhiteSpace(appUrl)) appUrl += "/";          var baseUrl = string.Format("{0}://{1}{2}", request.Url.Scheme, request.Url.Authority, appUrl);          return baseUrl;     }   but I got error Error  1   'System.Web.HttpContextBase' does not contain a definition for 'Current' and no extension method 'Current' accepting a first argument of type 'System.Web.HttpContextBase' could be found (are you missing a using directive or an assembly reference?) How to fix it?
Unfortunately, I need to do this.  I'm using ELMAH for my error log.  Before I route to my error.aspx view, I have to grab the default ELMAH error log so I can log the exception.  You used to be able to use   Elmah.ErrorLog.Default   However, this is now marked as obsolete.  The compiler directs me to use the method  Elmah.ErrorLog.GetDefault(HttpContext context)   MVC's context is of type HttpContextBase, which enables us to mock it (YAY!).  How can we deal with MVC-unaware libraries that require the old style HttpContext?
Inequality: $ab^2+bc^2+ca^2 \le 4$, when $a+b+c=3$. Let $a,b,c $ are non-negative real numbers, and $a+b+c=3$.  How to prove inequality $$ ab^2+bc^2+ca^2\le 4.\tag{*} $$    In other words, if $a,b,c$ are non-negative real numbers, then how to prove inequality $$ 27(ab^2+bc^2+ca^2)\le 4(a+b+c)^3.\tag {**} $$ $\color{gray}{\mbox{(Without using "universal" Lagrange multipliers method).}}$  Thanks! Show that $\left(1+\frac xk\right)^k$ is monotonically increasing Smallest dense subset of $\mathbb{R}$ I am not sure if what I am looking for even makes sense (or) exists. Anyway I would be happy if someone can clear my confusion.  The set of real numbers $\mathbb{R}$ is obtained as completion of $\mathbb{Q}$. However, $\mathbb{Q}$ is not the only set which is dense in $\mathbb{R}$. $\mathbb{Q} \backslash \mathbb{Z}$ is also a dense subset of $\mathbb{R}$. I am wondering if it makes sense to talk of the "smallest" dense subset of $\mathbb{R}$. To phrase what I am looking for precisely and what I mean by smallest, I am looking for a dense set $A$ of $\mathbb{R}$ such that if $B$ is a proper subset of $A$ then $B$ is not dense in $\mathbb{R}$. I am able to "see" that the set $A$, I am looking for doesn't exist since any open interval consists of infinite rationals. But I am unable to precisely argue out to myself and convince why $A$ doesn't exist. Could some one throw more light on this? I am given this problem: let $a\ge0$,$b\ge0$, and the sequences $a_n$ and $b_n$ are defined in this way: $a_0:=a$, $b_0:=b$ and $a_{n+1}:= \sqrt{a_nb_n}$ and $b_{n+1}:=\frac{1}{2}(a_n+b_n)$ for all $n\in\Bbb{N}$    To prove is that both sequences converge and that they have the same limit. I don't know how to show this. I have spent 2 hours on this, no sign of success Bernoulli numbers, taylor series expansion of tan x I found the following formula here: .  Taylor series of $\tan x$:  $$\tan x = \sum_{n\,=\,1}^\infty \frac {(-1)^{n-1}2^{2n} (2^{2n}-1) B_{2n}} {(2n)!} x^{2n - 1} $$.  I do not understand what the Bernoulli number means in this formula. My problems are the following ones:  I do not know anything about Bernoulli numbers. I do not know how to expand the Bernoulli number in the formula you see further up. What expansion will be the final result? How did you arrive there? Why did you arrive there? How did you know that you should use the specific Bernoulli-related terms that you used in your answer? What is the purpose of the Bernoulli number in this formula?  A great deal of thanks. Hubble's law says that the universe is expanding. How come the Milky Way and the Andromeda galaxies are on a collision course? How will they end up colliding with each other? I was studying a  problem where optical light with a wavelength of 500&nbsp;nm travels through a gas with refractive index $n$.  If we look at the equations for wave motion and index of refraction  $$c=\lambda_0\nu\quad\text{(in vacuum)}$$  $$v = \lambda\nu\quad\text{(in medium)}$$  $$n = c/v$$  we see that, if the frequency is constant, the wavelength decreases in the medium compared to vacuum. Is this a consistent property at all frequencies and for all mediums with refractive index real and greater than 1?  Are there dielectrics which change the frequency (still for n > 1), and is there an example of that? Add table row in jQuery Can't create new folder from anywhere in Windows 7 I have this problem on two of my new laptops and can't seem to find a decent workable solution elsewhere in forum land. The problem is that on my Windows 7 Professional machines the right mouse button doesn't show the New Folder option and elsewhere as well (via Explorer) I'm unable to create new folders.   I'll be happy to get this tiny problem resolved and declare that Windows 7 is almost perfect! Thanks to all of you in advance for your contribution!  PS: None of the Vista solutions seem to work here!      Tried NewFolderFix.reg, didn't work - "Not all data was succesfully written to the registry. Some keys are open by the system or other processes."  Converted FolderFix.reg to .inf file and that worked.  Don't recall the problem appearing after an update.  MS answer to the explore process hanging (KB 972685) was to install the latest Visual C++ Update (vcredist.exe).  Nope. That didn't help either.  I haven't touched Silverlight since installation when Windows 7 hit the shelves. I tortured the RC installation before that, and never had problems there either.    UPDATE-  Logged back into Administrator account, still missing from there. Spent a bit more time looking instead of just fixing. Just yto make sure, logged back into my user account - still OK there.  Turns out the entries in HKCR\CLSID were the culprit here. Reg file wouldn't take again (as above) but inf file fixed it. This key was unable to be entered from regfile, or altered or deleted in Regedit (Permissions).   Don't quite understand why a common key in HKCR needed to be entered separately for each user.   Here is the file I used to fix it. Just copy into notepad, save as newfolderfix.inf, rt-click and select Install  ================================================================  [Version]  Signature=$Windows NT$  [DefaultInstall]  AddReg     =REGEntries.AddReg  [REGEntries.AddReg]  HKCR,"%String0%",,0x0,"CLSID_ExecuteFolder"  HKCR,"%String0%\InProcServer32",,0x0,"ExplorerFrame.dll"  HKCR,"%String0%\InProcServer32","ThreadingModel",0x0,"Apartment"   [Strings]  String0 = "CLSID\{11dbb47c-a525-400b-9e80-a54615a090c0}"  =============================================================   Thanks to others who helped point me in the right direction. Ubuntu 20.04 interface font too small after restart, even with high scaling factor Integrate $\int \frac{dx}{\sqrt{-ax^2 + bx +c}} $ How can I shorten my command line (bash) prompt? Creation of a matrix What packages do you use and recommend for creating graphics in your LaTeX documents?     As this is a community wiki post, please add your package to the accepted answer (or add a comment, and someone with >100 rep will add it to the CW answer), and include a brief description of what differentiates it from others and how it can be used (GUI drawing tool which generates code, type in raw text, or generates image for inclusion in document).   We'll eventually sort these answers under headings. Is there a function to round a float in C or do I need to write my own?       float conver = 45.592346543;   I would like to round the actual value to one decimal place, conver = 45.6. "Your python3 install is corrupted" I want to upgrade from Ubuntu 16.04.5 LTS to 18.04, so ran sudo do-release-upgrade. After downloading and extracting bionic.tar.gz I get:  Can not upgrade   Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.   I saw  and so I did sudo ln -sf /usr/bin/python3.6 /usr/bin/python3 thinking that it would be a similar problem. But that didn't work (still same error message).  I have a few python versions:  $ ls /usr/lib | grep python python2.7 python3 python3.5 python3.6  $ update-alternatives --display python3 python3 - auto mode   link best version is /usr/bin/python3.6   link currently points to /usr/bin/python3.6   link python3 is /usr/bin/python3 /usr/bin/python3.5 - priority 1 /usr/bin/python3.6 - priority 2   How do I fix python3? How can we run a command stored in a variable? What is a field, really? There was a reason why I constantly failed physics at school and university, and that reason was, apart from the fact I was immensely lazy, that I mentally refused to &quot;believe&quot; more advanced stuff until I understand the fundamentals (which I, eventually, never did). As such, one of the most fundamental things in physics that I still don't understand (a year after dropping out from the university) is the concept of . No one cared to explain what a field actually is, they just used to throw in a bunch of formulas and everyone was content. The school textbook definition for a field (electromagnetic in this particular case, but they were similar), as I remember it, goes like:  An electromagnetic field is a special kind of substance by which charged moving particles or physical bodies with a magnetic moment interact.  A special kind of substance, are they for real? This sounds like the authors themselves didn't quite understand what a field is so they decided to throw in a bunch of buzzwords to make it sounds right. I'm fine with the second half but a special kind of substance really bugs me, so I'd like to focus on that. Is a field material? Apparently, it isn't. It doesn't consist of particles like my laptop or even the light. If it isn't material, is it real or is it just a concept that helps to explain our observations? While this is prone to speculations, I think we can agree that in scope of this discussion particles actually do exist and laws of physics don't (the latter are nothing but human ideas so I suspect Universe doesn't &quot;know&quot; a thing about them, at least if we're talking raw matter and don't take it on metalevel where human knowledge, being a part of the Universe, makes the Universe contain laws of physics). Any laws are only a product of human thinking while the stars are likely to exist without us homo sapiens messing around. Or am I wrong here too? I hope you already see why I hate physics. Is a field not material but still real? Can something &quot;not touchable&quot; by definition be considered part of our Universe by physicists? I used to imagine that a &quot;snapshot&quot; of our Universe in time would contain information about each particle and its position, and this would've been enough to &quot;de&quot; it but I guess my programmer metaphors are largely off the track. (Oh, and I know that the uncertainty principle makes such (de)serialization impossible — I only mean that I thought the Universe can be &quot;defined&quot; as the set of all material objects in it). Is such assumption false? At this point, if fields indeed are not material but are part of the Universe, I don't really see how they are different from  except for perhaps a more geeky flavor. When I talked about this with the teacher who helped me to prepare for the exams (which I did pass, by the way, it was before I dropped out), she said to me that, if I wanted hardcore definitions,  a field is a function that returns a value for a point in space.  Now this finally makes a hell lot of sense to me but I still don't understand how mathematical functions can be a part of the Universe and shape the reality. Is there any way of making a snow golem survive in hot biomes? Snow golems won't survive in the Nether (neither spawned in nor built ones). Is there a way to make a snow golem survive in the Nether and other hot biomes in vanilla Minecraft (i.e., without using mods)? , to correct a misspelled library enum in an answer. Since the edit was only one character, I also had to add a superfluous sentence to get over the character limit required to edit a post.  I've hit this problem before in other edits, always in code snippets. Since the edit limit exists to prevent trivial edits, and since there are many cases where one character code edits are not trivial (= to == etc), would it make sense to have a lower edit minimum inside code snippets?