Fetch currency symbol from mysql database in php
UTF-8 all the way through
How to load JAR files dynamically at Runtime? Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load JAR files dynamically. I'm told there's a way of doing it by writing your own ClassLoader, but that's a lot of work for something that should (in my mind at least) be as easy as calling a method with a JAR file as its argument.  Any suggestions for simple code that does this? How to prove that for all natural numbers, $4^n > n^3$? This is a problem set I have, it's not a homework but it's very important practice...  Send me some hints please, I don't want an answer I need to get it by myself but I'm failing miserably...   The problem is:     Prove that for all natural numbers $n$,  $4^n &gt; n^3$ There are five boxes consisting of several identical coins. There are five boxes consisting of several identical coins. The first box contains 4 coins, the second box contains 9 coins, the third box contains 7 coins, the fourth box contains 10 coins, and the fifth box contains 3 coins. Some coins are taken from the boxes such that at least a coin taken from each box. In how many ways in taking the coins, such that the numbers of the coins taken are 12?  My attempt was solving it using repetition combination of which, there are only seven coins remaining considering that at least a coin taken from each box. By using the repetition combination, i.e. taking 7 from 9 (five boxes and four borders), resulting in 36 ways. However, there is no 36 ways in the choices. How do I rename all folders and files to lowercase on Linux? I have to rename a complete folder tree recursively so that no uppercase letter appears anywhere (it's C++ source code, but that shouldn't matter).  Bonus points for ignoring CVS and Subversion version control files/folders. The preferred way would be a shell script, since a shell should be available on any Linux box.  There were some valid arguments about details of the file renaming.   I think files with the same lowercase names should be overwritten; it's the user's problem. When checked out on a case-ignoring file system, it would overwrite the first one with the latter, too. I would consider A-Z characters and transform them to a-z, everything else is just calling for problems (at least with source code). The script would be needed to run a build on a Linux system, so I think changes to CVS or Subversion version control files should be omitted. After all, it's just a scratch checkout. Maybe an "export" is more appropriate. Google chrome is reading characters backwards Efficiently mix encryption and rsync on an external drive? Why doesn't this perpetual motion machine using the buoyant force work? I realize this isn't possible, but I can't see why not, especially if you change the model a little bit so that the balls simply travel through a tube of water on the way up, rather than exactly this model.  Please be clear and detailed.  I've heard explanations like "the balls wouldn't move" but that doesn't do it for me - I really do not see why the balls on the right would not be pulled/pushed up, and the rest of the chain wouldn't continue on. How to access the grub boot menu in order to generate bootchart? I am running Ubuntu Gnome 15.04, and I want to generate a bootchart to help me diagnose some system problems. However in  it says:    So how do I access the grub boot menu in order to append this text? And just to be clear, how should the line look once I have appended the necessary text? Also, is grub already installed for I don't appear to have either or these packages: grub or grub2?    OS Information:  No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 15.04 Release:    15.04 Codename:   vivid How to get class object's name as a string in Javascript? Is indefinite integration non-linear? Fill the area determined by two pgfplots graphs I need to fill the region determined by two (Gaussian) curves and the right red line (the region is brushed in green in the figure below). I also wonder what is the best way to draw vertical line which goes through the intersection of both graphs (the left red line on the figure).  Any pointers would be greatly appreciated.    My initial attemt is pasted below.  \documentclass{standalone} \usepackage{pgfplots}  \begin{document}  \pgfmathdeclarefunction{dnorm}{2}{%   \pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}% }  \begin{tikzpicture} \begin{axis}[domain=0:12, samples=100, height=5cm, width=10cm] % Fill aread under the curves \addplot [fill=red!20, draw=none, domain=0:6] {dnorm(6.5,1.5)} \closedcycle; \addplot [fill=blue!20, draw=none, domain=6:10] {dnorm(4,1)} \closedcycle; % Draw curves \addplot [thick] {dnorm(4,1)}; \addplot [thick] {dnorm(6.5,1.5)}; \end{axis} \end{tikzpicture}  \end{document}   My solution  A picture is worth a thousand words. Code is pasted below.   \documentclass{article} \usepackage{tkz-fct} \usetikzlibrary{intersections}  \begin{document}  \tikzset{    name plot/.style={every path/.style={name path global=#1}} }  % Extract coordinates for point X \makeatletter \newcommand{\gettikzxy}[3]{%   \tikz@scan@one@point\pgfutil@firstofone#1\relax   \edef#2{\the\pgf@x}%   \edef#3{\the\pgf@y}% } \makeatother  % Dimlines \def\Dimline[#1][#2][#3][#4]{ \begin{scope}[thin, &gt;=stealth'] % redefine as flechas \draw let \p1=#1, \p2=#2, \n0={veclen(\x2-\x1,\y2-\y1)} in [|&lt;-&gt;|, decoration={markings,mark=at position .5 with {\node[#3] at (0,0) {#4};}, }, postaction=decorate] #1 -- #2 ; \end{scope} }  \begin{tikzpicture}[scale=1,font=\small] \tkzInit[xmin=0,xmax=12,ymin=0,ymax=.3,ystep=.05] % Draw coordinates \draw[&gt;=stealth', &lt;-&gt;] (0,6) node[above] {$y$} -- (0,0) --  (12.5,0) node[right] {$x$}; % Draw functions and areas \tkzFct[name plot=A,thick,color=red,domain=0:12]{1/(1.5*sqrt(2*pi))*exp(-((x-4.5)**2)/(2*1.5**1))} \tkzDrawArea[opacity=.3,color=blue,domain = 7:12] \tkzFct[name plot=B,thick,color=blue,domain=0:12]{1/(2*sqrt(2*pi))*exp(-((x-7)**2)/(2*2**1))} \tkzDrawArea[opacity=.3,color=red,domain=0:7] \tkzDrawAreafg[between=b and a,opacity=.3,color=green,domain = 0:7] % Intersection between curves \path [name intersections={of=A and B,by=C}]; % Extract coordinates of C \gettikzxy{(C)}{\cx}{\cy} % Vertical lines \draw [thick,dashed, black] (\cx,0) -- (\cx,5.5) node [above] {$x_{0}$}; \draw [thick,dashed, black] (7,0) -- (7,5.5) node [above] {$\hat{x}$}; % Define regions \Dimline[($(0,0)+(0,-.6)$)][($(7,0)+(0,-.6)$)][above,black][$\mathcal{R}_{1}$]; \Dimline[($(7,0)+(0,-.6)$)][($(12,0)+(0,-.6)$)][above, black][$\mathcal{R}_{2}$]; \end{tikzpicture}  \end{document} Divisibility is transitive: $\ a\mid b\mid c\,\Rightarrow\ a\mid c$ As the title says, if a number is divisible by a number, is it always divisible by that number's factors?  An example being that $100$ is divisible by $20$, it is also divisible by $10, 5, 4, 2$ as well?  Does this always apply? Suppose I define a new theorem "Theorem" and declare that its counter should be reset whenever the subsection counter is incremented or reset:  \newtheorem{theorem}{Theorem}[subsection]   At some point in my (article) document I start a new \section (say, section 2) without starting a \subsection. I expect the first theorem in this section to be numbered with "2.0.1" (which may be considered bad style). However, the theorem is numbered "2.0.2".  Is this "by design" (technically, I didn't start a new \subsection) or a bug? Moreover, what would be a proper workaround? (Such a workaround should not involve manually resetting the theorem counter, and it should work for whatever theorem type I may define in addition to "Theorem".)  \documentclass{article}  \newtheorem{theorem}{Theorem}[subsection]  \begin{document}  \section{bla}  \subsection{blubb}  \begin{theorem} Some text. \end{theorem}  \subsection{foo}  \begin{theorem} Some text. \end{theorem}  \section{bar}  \begin{theorem} Some text. \end{theorem}  \end{document}   EDIT: In response to Seamus' comment: The unexpected counter value also occurs with amsthm and ntheorem. checking if a number is a prime I was reading Wikipedia, and it was given that "all primes are of the form 6k ± 1"  (other than 2 and 3), where k = 1,2,3,4,...  Is this statement correct? If yes, can we use this to test if a given number is a prime number? For instance, we can say that 41 is a prime number, since there exists an integer K (K >= 1), such that 6k - 1 = 41 ==> k = 7.  I am confused why this test cannot be used to test if a number is prime?  Thanks, Sekhar I want to output two different views (one as a string that will be sent as an email), and the other the page displayed to a user.  Is this possible in ASP.NET MVC beta?  I've tried multiple examples:  1.      If I use this example, I receive the "Cannot redirect after HTTP   headers have been sent.".   2.      If I use this, I seem to be unable to do a redirectToAction, as it   tries to render a view that may not exist. If I do return the view, it   is completely messed up and doesn't look right at all.   Does anyone have any ideas/solutions to these issues i have, or have any suggestions for better ones?  Many thanks!  Below is an example. What I'm trying to do is create the GetViewForEmail method:  public ActionResult OrderResult(string ref) {     //Get the order     Order order = OrderService.GetOrder(ref);      //The email helper would do the meat and veg by getting the view as a string     //Pass the control name (OrderResultEmail) and the model (order)     string emailView = GetViewForEmail("OrderResultEmail", order);      //Email the order out     EmailHelper(order, emailView);     return View("OrderResult", order); }   Accepted answer from Tim Scott (changed and formatted a little by me):  public virtual string RenderViewToString(     ControllerContext controllerContext,     string viewPath,     string masterPath,     ViewDataDictionary viewData,     TempDataDictionary tempData) {     Stream filter = null;     ViewPage viewPage = new ViewPage();      //Right, create our view     viewPage.ViewContext = new ViewContext(controllerContext, new WebFormView(viewPath, masterPath), viewData, tempData);      //Get the response context, flush it and get the response filter.     var response = viewPage.ViewContext.HttpContext.Response;     response.Flush();     var oldFilter = response.Filter;      try     {         //Put a new filter into the response         filter = new MemoryStream();         response.Filter = filter;          //Now render the view into the memorystream and flush the response         viewPage.ViewContext.View.Render(viewPage.ViewContext, viewPage.ViewContext.HttpContext.Response.Output);         response.Flush();          //Now read the rendered view.         filter.Position = 0;         var reader = new StreamReader(filter, response.ContentEncoding);         return reader.ReadToEnd();     }     finally     {         //Clean up.         if (filter != null)         {             filter.Dispose();         }          //Now replace the response filter         response.Filter = oldFilter;     } }   Example usage  Assuming a call from the controller to get the order confirmation email, passing the Site.Master location.  string myString = RenderViewToString(this.ControllerContext, "~/Views/Order/OrderResultEmail.aspx", "~/Views/Shared/Site.Master", this.ViewData, this.TempData); How can I calculate the age of a person in year, month, days? Long story short: since custom flag responses are messages to users like any other (answer, comment, suggested edit, chat message etc.), users should be notified about them!!    A problem I have with flagging, as it currently functions, is that flaggers are not notified about custom responses to flags, when they are given. I really don't care if I don't find out about every last flag of mine, whether it was marked "helpful" or not, but if a moderator went to the effort of typing out a custom response to my flag, explaining why it was or was not helpful, I'd like to see that response. The logical place for this response would be in the messages inbox (the red number thingy in the top left corner), where other responses to user actions (like answers, comments, edits, and chat messages) go.  This may also help to alleviate  of users not realizing that their flags go somewhere -- while I agree with her that "We shouldn't send notifications for [all] flag responses; that would be way too noisy for a lot of people," I think that in the event of a custom response, the flagger should be notified (because some mod thought that this information was relevant to the flagger), and it would not be too noisy because (in my experience1) most flags do not receive a custom response. This could provide one way that flaggers can be made aware of their flagging history.2    1 I don't know who can see this, but  on Mi Yodeya, to date, is 55 flags total (49 helpful), and only one custom response (....that I didn't see for a while, till I checked my flagging history for a different reason).  2 While I don't think that this will replace Monica's suggestion entirely, it would certainly help it a little.    To give credit where credit is due, while I came up with this idea myself, I did notice that someone else had posted about a similar idea earlier in a .  Edit: Just spotted  from the related questions along the side of the page; note that while that proposal is similar to this one, it was about sending all declined flags to the inbox, while I suggested that only the ones with custom responses should make it to the inbox. resolv.conf not working properly with Ethernet in Ubuntu I have a Lenovo X200 laptop on which I am running Ubuntu 9.10. Recently, (I assume after some updating, but I really don't know) my ethernet port stopped working under Linux. A more tech/linux-savvy friend of mine was able to temporarily fix the problem by manually editing the resolv.conf file with the DNS servers he found through his connection. However, after rebooting, the problem came back and now I am looking for a more permanent solution. Prove that the product of a non-zero rational and irrational number is irrational. Encouraging software publishers to use StackExchange as support mechanism Whenever I deal with an application publisher's custom support mechanism because I can't see any evidence of activity on StackExchange, I always wish they'd just migrate to StackExchange, particularly when I get a prompt response from them. What a waste, I think, that my question and answer weren't captured on SE.  In cases where there is some activity for the application on SE, I'll post my question there and, if I get no response, reference the SE question in my email follow-up. In the case of , that had a happy ending where the support person posted the answer to the SE site at the same time they emailed me.  My related meta questions are:   Are there any obvious downsides to publishers effectively "giving up" their custom support mechanisms, or at least their custom forum, in favor of the appropriate SE site? Are there any obvious downsides to SE for publishers making this transition? Is SE staff engaged in any systematic marketing efforts to get publishers to make this transition? Is there any SE documentation which lists the advantages of publishers making this transition?