Is it always possible to put a cell structure on a manifold? in other words is it possible to decompose a manifold as a CW complex? I know that by Morse theory we always have a handle decomposition of the manifold which shows that it is homotopy equivalent to a CW complex, but it does not show that it is homeomorphic or diffeomorphic to a CW complex.

What is the strongest known theorem (if any) that classify which manifolds can be built as CW complexes? Thank you guys. This is just  a question I thought of during class, obviously not homework...


The following sentence from The Great Gatsby strikes me as a mixed metaphor.     The exhilarating ripple of her voice was a wild tonic in the rain.   The author is thus calling her (Daisy's) voice both an "exhilarating ripple" and "a wild tonic." To me, those ideas clash.  A colleague insists that this is a beautiful description of Daisy's voice and not, in fact, a mixed metaphor.   The definition of mixed metaphor, from Merriam-Webster online:     a metaphor that combines different images or ideas in a way that is foolish or illogical   And from Google dictionary:     a combination of two or more incompatible metaphors, which produces a ridiculous effect   Clearly, the sentence in The Great Gatsby combines different images or ideas, so is it simply a matter of personal opinion whether this combination is "foolish" or produces a "ridiculous effect"?

M-W has the following definition for mixed metaphor:     a figure of speech combining inconsistent or incongruous metaphors   Hence a requirement is that a 'mixed metaphor' contains more than one metaphor.  :      "mixed metaphor" is more commonly used to describe the result of   accidentally combining two metaphors in a way that does not make sense   as a whole. "For me it was stormy in the great sea of life, but then I   came to a crossroads."   He does not claim that this is a necessary condition, and I'd agree.  I've just written in another thread:  ' "John is a real tiger" works, but "That lion is a real tiger" is best avoided.' Each of these two statements contains a single metaphor.   Does any definition of 'mixed metaphor' apply to the inappropriate (incongruous juxtaposing of tenor and obviously related vehicle) metaphor in the second sentence?


Consider three circles with every two of them tangent. Does there exist a circle between them which is tangent to all three?

Suppose you are given 3 circles A,B,C such that A is tangent to B and B is tangent to C. How could you construct a circle (not necessarily all of them) that is tangent to all 3? (If such a circle exists)  I have developed a method of constructing a circle tangent to two tangent circles (pick a point P on their radical axis, draw the tangents from that point to both circles, for each circle construct the line joining the circle center and the tangency point from P, intersect those lines, and draw the circle centered in this intersection and which contains one of the tangency points from P) but I can not figure out how to adapt this idea for 3 circles.


Say I have an array var arr = [1,2,3,4,5,6,7,8,9]. It's not hard to have a function for me to pick n items from it randomly like this: function pick_n_from_array(n, array) {   return array.slice(0, n).map(function() {     return this.splice(Math.floor(Math.random() * this.length), 1)[0];   }, array.slice()); } pick_n_from_array(3, arr); // [3,5,8]; pick_n_from_array(2, arr); // [2,8]; pick_n_from_array(3, arr); // [5,7,9];  However, I'm thinking about picking it with a seed, that once you give the same seed, you get the same pick: pick_n_from_array_by_seed(3, arr, 1); // [3,5,8]; pick_n_from_array_by_seed(3, arr, 1); // [3,5,8]; pick_n_from_array_by_seed(3, arr, 2); // [5,7,9];  I have found some related questions (for ) but not in JavaScript.

Is it possible to seed the random number generator () in JavaScript?


The Linked sidebar showing linked-to posts only shows links within the same site. Often, for example on Cross Validated there are links to posts on Math SE or MathOverflow (or other sites) but these are not shown in the Linked sidebar. Why? Such linking would increase the utility of that sidebar.  I am sure the same applies to many other closely related sites.

Maybe using a different font or a small site-icon.    Hijack edit: ~~~~ jco - Based on this discussion:   Example. In the  is a link to a Super User post. The current "linked questions" box doesn't show the SU link, but it could. In addition, that site should have a linked question to this question across the intra-site network. This opens a few new possibilities.  One example is when  links back to questions on Stack Overflow, with enough time we can start to see where the actually hottest "resource" questions are, not just from within SO proper, but from across the network. This adds some new insights on how the links are farmed across the network, and within the site itself.  Obviously this requires some specific data processing, such as "this thread has a link to another SE site" but those can be updated per-post-update, in the already present process queue. Chat has already shown that there's some API for grabbing the related site information, so that could be put to use here for fetching the right slug and favicon, and the process that requests can insert a slug-like link into an arbitrary non-site-specific DB that could be used for cross-network lookups on post update (aka: update on SO Q causes it to briefly check that table for the SO Q #, if found, spawn off updates for each record in that table to the other sites).  These are all just ideas on how to accomplish it, given what is known about the SE architecture.  Here's the benefits, as best I can figure them now:   promotion of related sites in a totally organic fashion determining how-referenced a question really is (think English Language and Usage vs English Language Learning or GameDev vs Arqade or SO vs Programmers) determining if one person is engaging in spammy behavior by constantly linking to their own questions (this can be a useful mod-tool at times, I expect) determining what meta questions get linked to from non-meta sites frequently (potential about-page changes or the like) potential traffic spike or other behavioral analysis in a longer term (possible example: most linked topics come within the first 24 hours or after more than 1 month?)   Note I would like to stress that this request is not about extra-network links, this is strictly for in-SE-network links, which we already have some auto-title-slug-recognition-generation for in posts and this would only extend the existing process a little bit.   Scouring other sites for useful information and including in the sidebar / analytics is beyond the scope of this request.


I've made a basic latex document and the different sections of my content page are framed by a red rectangle:  I have tried on different reader and it's still the same result.  Here is my code :  \documentclass[10pt]{article} \usepackage[left=2.5cm,right=2.5cm,top=2.5cm,bottom=2.5cm]{geometry} \usepackage[utf8]{inputenc} \usepackage{hyperref} \usepackage[utf8]{inputenc} % Required for including letters with accents \usepackage[T1]{fontenc} \begin{document} \begin{titlepage} asd \end{titlepage} \clearpage \tableofcontents \clearpage \section{Test} \section{section2} % (fold) \label{sec:section2} \end{document}   Thx for the help

I know that I can use  to make cross-references and hyperlinks clickable.  That makes the clickable areas outlined in fluorescent green, however.  How can I make the green boxes go away?


I came across this article which says that Microsoft is blocking SMTP from dynamically allocated public IP addresses.     I don't know any mechanism that will tell whether an IP address on the internet is dynamically assigned or not. Reverse IP lookups may be able to give a clue with the name assigned to it but it would not be very accurate. I'm just curious , let me know what this can be.

I run a large bulletin board and I get spammers every now and again. My moderation team does a good job filtering them out but every time I IP ban them they seem to come back (I'm pretty sure it's the same person on some occasions, as the post patterns are exactly the same as are the usernames) but I'm afraid to ban them by IP address every time.  If they are on a dynamic IP address, I could be banning innocent users later down the line when they try to get to my forum through SERPs, but if I ban only via static IPs I know that I'm only banning that one person.  So, is there a way to properly determine if an IP address is static or dynamic?  Thanks.


In the last few weeks I have flagged a number of questions as Off Topic and recommended migration to Super User. Most of these questions were closed, though, not migrated.  Can somebody help me understand that rationale? If a question is flagged, does it not attract moderator attention? If it doesn't, what is the use of flagging?  Does a migrate flag by a knowledgeable expert get superseded by a 5 x close vote of members who don't understand what the question is about?  Is the question better off being closed here at Stack Overflow rather than being migrated to Super User, where it might spark more expert attention in a setting with experts who actually understand what the question is about?  I find it rather short-sighted to close a question, just because it does not belong here, ESPECIALLY if the question has already been flagged for migration.   Why are questions that are flagged for migration not just migrated as per the recommendation of the experts who understand the topic? Why can members who clearly don't understand the topic overrule the migrate flag and have the question closed? If the folks who voted to close had any understanding of the topic they would have flagged for migration. If they don't understand the topic, then they should not vote.  I feel that a migration request flag should supersede a "me too" close flag, especially if the migration flag came first.

Just curious. Generally when I see a closed or migrated question, the reasoning seems sound. This one caught my eye, however, and made me wonder if I've been wrong in my assumptions.    What were the criteria here for closing the question as "Off-Topic", as opposed to migrating to SF? Seemed a valid question to me, yet it was closed just a day after it was asked. Is the lack of immediate answers the problem?  Not trying to challenge the decision - as I said, just curious :-)


Male pattern baldness is a common genetic trait. With a distinctive pattern/ density gradent (as apposed to general old age thinning as the body ages)  Hair has an advantage of protection from the sun/weather. So to lose it in a distinctive pattern (and lose that advantage) appears to have a reason*; and as it is a genetic trait, it seems like it would have been something that was selected for (or it would be more likely to be selected out). So why is it better to develop pattern baldness as someone gets older?  So what might be the biological/evolutionary advantage to developing baldness?  Traits get selected for good and bad reasons(in retrospect), however I am interested in the reason why this particular trait has been selected.  * Lets assume that there is a specific cause (causes) and it is not just a leftover evolutionary artifact.    The related question:  provides some interesting background, but doesn't specifically address the What causes in this question.

If a trait would be advantageous to an organism then why hasn't it evolved yet?  Conversely, if a trait is not advantageous or mildly disadvantageous, why does it exist?  In other words why does evolution not make the organism more "perfect"?    This is a general question that would be applicable for any kind of trait. Please keep the answers precise and scientific.   Read this meta post for more information:


I have a text file, the following shows a sample of file contents:     1234  A novel homeodomain-encoding gene is associated with a large CpG   island interrupted by the <category="Modifier">myotonic   dystrophy</category> unstable (CTG)n   repeat.   <category="SpecificDisease">Myotonic   dystrophy</category> (   <category="SpecificDisease">DM</category> ) is associated   with a ( CTG ) n trinucleotide repeat expansion in the 3-untranslated   region of a protein kinase-encoding gene , DMPK , which maps to   chromosome 19q13 . 3 . Characterisation of the expression of this gene   in patient tissues has thus far generated conflicting data on   alterations in the steady state levels of DMPK mRNA , and on the final   DMPK protein levels in the presence of the expansion . The   <category="Modifier">DM</category> region of chromosome 19   is gene rich , and it is possible that the repeat expansion may lead   to dysfunction of a number of transcription units in the vicinity ,   perhaps as a consequence of chromatin disruption . We have searched   for genes associated with a CpG island at the 3 end of DMPK .   Sequencing of this region shows that the island extends over 3 . 5 kb   and is interrupted by the ( CTG ) n repeat . Comparison of genomic   sequences downstream ( centromeric ) of the repeat in human and mouse   identified regions of significant homology . These correspond to exons   of a gene predicted to encode a homeodomain protein . RT-PCR analysis   shows that this gene , which we have called   <category="Modifier">DM</category> locus-associated   homeodomain protein ( DMAHP ) , is expressed in a number of human   tissues , including skeletal muscle , heart and brain .   I need to extract what in between tags: for example,  <category="SpecificDisease">Myotonic dystrophy</category>   I need to extract "Myotonic dystrophy" and write to a new text file.

I have a text file, i want to search for tags such as the following:  <category="SpecificDisease">Type II human complement C2 deficiency</category> <category="Modifier">Huntington disease</category> <category="CompositeMention">hereditary breast and ovarian cancer</category> <category="DiseaseClass">myopathy</category>   and produce the following  and write them to a new text file.  Type II human complement C2 deficiency Huntington disease hereditary breast and ovarian cancer myopathy


A  (OTP) sounds perfectly secure if we are to believe Wikipedia. But on the surface it also sounds ridiculously impractical - how does one securely distribute the OTP?  Idea: why not have someone distribute it for you in plain sight of everyone?  Presuming I can keep the details secret (as I would with an encryption key), if I wanted to communicate securely, why wouldn't I harvest the images from some source of abundant images (Facebook, news site, dating site, porn site, etc), and make use of the noise in their lower bits to create a one-time-pad?  Even assuming someone hacks my PC and can narrow down the image(s) I may have used, an image is not in itself an OTP - you need to extract the OTP bits from the image pixels. That can be done in an enormous number of ways. The secrets to doing it are more or less equivalent to conventional encryption keys.  E.g. I could shuffle the pixels in the chosen image before using them in one of N! possible shuffles for N pixels, which is enormous after even 50 pixels. I could also extract the OTP bits from the image pixels starting from any pixel and in a bunch of scanning directions/modes. And which bits do I use, and in which order? Plenty more permutations there to be guessed at by anyone wanting to crack my code.  Which raises a different possibility: why don't I distribute the algorithm for permuting the pixels and extracting the bits to create the OTP from a single image?  I'm suggesting this because I noticed a while ago that the original image posted on Wikipedia of the  happened to have prime numbers for its width and height. That sounds like a useful property to someone wanting to generate an OTP. You don't suppose someone is already using it for that, or some other cryptographic purpose, do you? After all, this image size is the only one that Wikipedia has repeated, which seems... improbable as a coincidence.  Yet all of this completely contravenes the advice of "don't roll your own". Does that advice still apply to an OTP that is truly only ever used once, even if its random bits are pseudo-randomly selected each time in one of extraordinarily many ways from a single source of truly random bits?

Instead of generating the random key for the one time pad cipher over and over again, is there a mathematical formula that allows you to switch the key to a new key? The new key must be as random and secure as the original key.


I'm new to blender and for some reason when I clicked on "edit user preferences" from the dropdown menu of the wrench in the top left nothing happened, so I dragged the corner near it which  created a new toolbar somehow. I tried to drag that to close it but it made even more toolbars. I kept trying to close them but I only got more and more! Then I was somehow able to get it open as a pane in the main window, and the same thing happened when I tried to slide that one closed! Why is the even possible? Why would anyone ever want more than one? Is this real life? Is this just fantasy?

I would like to close some view windows that I opened accidentally.  See the image below:    Edit: another note: I tried searching for the solution, but only found things like "Join Area", which don't seem to work in this situation.


I have a machine from the company I am working in. I don't have the permission to change anything on it. It's on Windows and it sucks. I am thinking of installing Ubuntu 20.04 LTS on a brand new external SDD. I want to be able to boot from this SSD if it's plugged in and from windows if not. What could go wrong? If the Windows OS is damaged, I may be fired ! An help? I would appreciate a link on how to do it the most safer way. There is tons of tutorials with different approaches. I am lost. PS: the machine is Dell 3351 and the OS is windows 10 PRO.

OS: Windows 7. I want install Linux Ubuntu on portable external Hard Drive USB 2.0. I read a variety of methods, but I'm confused by contradictory advices and methods. Actually, installing Ubuntu on anything other than clean PC looks much more complicated than installing Windows. I need to have Ubuntu package + Python 2.7 + C compiler installed. My external hard drive is partially filled, I need to keep all files.   Will Ubuntu run entirely on external hardrive, without writing anythinhg to Windows system folders and to registry?  Can anyone post detailed guide how install Ubuntu on external hard drive?


I am trying to find a way to add method name as an argument in command line. I am using argparse module in python 2.7.10.  def create_parser():     parser = argparse.ArgumentParser(description='add method name')     parser.add_argument('--method_name', help='pass method name to be used') return parser  def foo():     return "I am here."  def bar():     return "I am not here."  def where_are_you(method_name):     return method_name()  def main():     return where_are_you(args.method_name)  if __name__ == '__main__':     main()   I am trying to call one of the methods thru command line and getting this error:      "TypeError: 'str' object is not callable." Please guide me here I am new to python.

What is the best way to go about calling a function given a string with the function's name in a Python program.  For example, let's say that I have a module foo, and I have a string whose content is "bar". What is the best way to call foo.bar()?  I need to get the return value of the function, which is why I don't just use eval. I figured out how to do it by using eval to define a temp function that returns the result of that function call, but I'm hoping that there is a more elegant way to do this.


I have searched quite a bit on a reason to use extend thread instead of runnable and have found very little. Anyone have a good reason for someone who is just learning Java.

From what time I've spent with threads in Java, I've found these two ways to write threads:  With implements Runnable:  public class MyRunnable implements Runnable {     public void run() {         //Code     } } //Started with a "new Thread(new MyRunnable()).start()" call   Or, with extends Thread:  public class MyThread extends Thread {     public MyThread() {         super("MyThread");     }     public void run() {         //Code     } } //Started with a "new MyThread().start()" call   Is there any significant difference in these two blocks of code ?


I want a function to prevent SQL injection and xss atacks using php like   function name($inp){   return sql(xss($inp)); }   Thanks

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


General solution to the equation $\sin x+\cos x$=$1$ is found to be $x=2n\pi$ and $x=2n\pi+\pi/2$, Pls refer   My Approach: $$ \sin x+\cos x=1\implies \sin x\frac{1}{\sqrt{2}}+\cos x\frac{1}{\sqrt{2}}=\frac{1}{\sqrt{2}}\\\implies\sin x\cos(\pi/4)+\cos x\sin(\pi/4)=\sin(\pi/4)\implies \sin(x+\pi/4)=\sin(\pi/4)\implies x+\pi/4=n\pi+(-1)^n [\pi/4]\implies x=n\pi+(-1)^n\frac{\pi}{4}-\frac{\pi}{4} $$ How do I check both the results are the same, without inputting the values for $n$ ?

How does one solve this equation?     $$\cos {x}+\sin {x}-1=0$$   I have no idea how to start it.  Can anyone give me some hints? Is there an identity for $\cos{x}+\sin{x}$?  Thanks in advance!


I have the following task:  Be $G$ a group with $\forall g \in G: g^2=1_G$ Prove that $G$ is abelian.  I proved it this way: $\forall g \in G: g^2=1_G$ implies $\forall g \in G: g=g^{-1}$ Be $g,h \in G$. It is $gh \in G$ and $(gh)^{-1} = h^{-1}g^{-1}$ since $(g(hh^{-1})g^{-1})=1_G=(h^{-1}(g^{-1}g)h)$ Hence: $$gh = (gh)^{-1} = h^{-1}g^{-1} = hg \quad \square$$ This is the first proof with groups I've ever done in my life, hence I am a bit unsure if everything is correct. It would be nice when someone could tell me if my proof is complete.

Prove that if $g^2=e$ for all $g$ in $G$ then $G$ is Abelian.   This question is from group theory in Abstract Algebra and no matter how many times my lecturer teaches it for some reason I can't seem to crack it.   (Please note that $e$ in the question is the group's identity.)  Here's my attempt though...  First I understand Abelian means that if $g_1$ and $g_2$ are elements of a group $G$ then they are Abelian if $g_1g_2=g_2g_1$...  So, I begin by trying to play around with the elements of the group based on their definition...  $$(g_2g_1)^r=e$$  $$(g_2g_1g_2g_2^{-1})^r=e$$ $$(g_2g_1g_2g_2^{-1}g_2g_1g_2g_2^{-1}...g_2g_1g_2g_2^{-1})=e$$  I assume that the $g_2^{-1}$'s and the $g_2$'s cancel out so that we end up with something like,  $$g_2(g_1g_2)^rg_2^{-1}=e$$ $$g_2^{-1}g_2(g_1g_2)^r=g_2^{-1}g_2$$  Then ultimately...  $$g_1g_2=e$$  I figure this is the answer. But I'm not totally sure. I always feel like I do too much in the pursuit of an answer when there's a simpler way.  Reference: Fraleigh p. 49 Question 4.38 in A First Course in Abstract Algebra.


I have PC with AMD Opteron 180 cpu 3gb memory, asus a8n motherboard, GT 6600 graphic card.  I was not able to install Ubuntu 14  nor Xbuntu AMD64.  It does not boot. The same pen drive boots fine  on a Pentium Dual Core notebook.  Hope I can find a version that works on my Opteron 180 PC.  Martin

I have a device on which I would like to install Ubuntu. How do I find out if Ubuntu will work on it?


I'm trying to solve a question concerning about average value of function. A problem is  If $f$ is concave upward on $[a,b]$, then $\frac{1}{b-a}\int_a^bf(x)dx > f((a+b)/2)$  I understand why it is true using diagram but I can't prove it. I'm trying to use the fact f is concave upward so $f'$ is increasing but I couldn't go any further.  Thank you in advance!

I cannot prove that if $f(x)$ is convex on $[a,b]$ then  $f\Big(\frac{a+b}2\Big) \le \frac1{b-a}\int_a^b f(x)\,dx \le \frac{f(a)+f(b)}2 .$


I made  to a question which just improved formatting, and it was rejected by the "Community" user.  Right after me, the user RvdK made the same fixes, and then user Vinay  to the question, which got approved.  Why was my suggestion rejected?

Why does the Community user sometimes approve or reject edits? How does a machine know if my edit is valid? What does it mean if my edit was rejected by Community?     See also:


Hello I recently installed Ubuntu on my machine so that I could dual boot it alongside my existing windows 10 installation. However, there is not option to boot into Windows 10 from grub. I have checked to make sure that both operating systems are installed in UEFI mode. Additionally os-prober return nothing in terminal. Any suggestions for how I can get grub to recognize my Windows installation?

I installed Windows on my computer, followed by an installation of Ubuntu. However, now I'm unable to boot into my Windows install.  What can I do to fix this?


What’s the right version of these two?   Half of the students doesn’t bother to show up.  Half of the students don’t bother to show up.    Or are both right?  The related question  discusses some relevant concepts, but the answer is very general, and it's not clear how to apply it here since "half" is a singular noun, while "two" is a plural noun.   Barrie England's answer there says that in "2/3 of the pizza was eaten," singular agreement is appropriate because "the emphasis is likely to be on the amount of pizza eaten, and not on the number of individual thirds. In contrast, in [2/3 of the visitors were men] the emphasis is on the number of visitors who were men, so plural concord ... is required."  What does it mean to put "emphasis" on "the amount" vs. "the number"?  If "half of the students" is just an approximate or uncertain percentage (like "between 51% and 55%"), rather than an exact count, how do I know whether it's appropriate to emphasize the amount or the number of students?

Is 2/3 always, sometimes or never plural?  E.g.     1a) 2/3 of the pizza were eaten.     1b) 2/3 of the pizza was eaten.      2a) 2/3 of the visitors were men.     2b) 2/3 of the visitors was men.   I feel that example 1 could go either way but example 2b sounds very wrong.  Is there a rule for this?


I have created a DataTable with three columns and i am adding rows to that DataTable using Data Rows. Then,I am adding the DataTable to a DataSet. Now, I just want to bind the DataSet to a TreeView.  DataTable dt = new DataTable(); dt.TableName = "Tree"; dt.Columns.Add("Name"); dt.Columns.Add("Project"); dt.Columns.Add("Experience");  List<Profile> list = new List<Profile> {     new Profile{  Name="Boopathi", Project="NPD",       Experience=1},     new Profile{  Name="Stephan",  Project="Luxstone",  Experience=1},     new Profile{  Name="Sri",      Project="DellAsap",  Experience=1} };  var query = from s in list.AsEnumerable()             where s.Experience == 1             select s;  DataSet ds=new DataSet(); DataRow dr = dt.NewRow(); foreach (var t in query) {                    dr["Name"] = t.Name;     dr["Project"] = t.Project;     dr["Experience"] = t.Experience; }  ds.Tables.Add(dt); return ds;

I'm looking at this control, and it seems to be lacking the standard .net "datasource" and "datamember" properties for databinding.  Is this control not bindable?  I can write some custom function that populates the treeview from a given data source, I suppose, and embed data objects as necessary, but is that the 'best practice'?  Or does everyone simply use a 3rd party treeview control?


This might be a silly question, but if I have a function defined at only one point. Is the function continuous at that point?

Suppose $c$ is an isolated point in the domain $D$ of a function $f$. In the delta neighbourhood of $c$, does the function $f$ have the value $f(c)$?


Warlock Hexblade (3), Paladin (x)  Boon: Pact of the Blade  Eldritch Invocations: Curse Bringer. Need minimum 5 lvls   Turn 1.1 Hexblade curse (bonus action)  Turn 2.1 (bonus action) Wrathful Smite  Turn 2.2 (normal action) Greenflame Blade  If melee hit spend 1 spell slot for Curse Bringer (no action) and 1 for Divine Smite (no action)

The specific example I'm looking at here is: you are a Paladin 2/Warlock 5 and snagged Eldritch Smite from XGTE as your 5th level Warlock Invocation. This gives you access to both...  Divine Smite Starting at 2nd level, when you hit a creature with a melee weapon attack, you can expend one spell slot to deal radiant damage to the target, in addition to the weapon’s damage. The extra damage is 2d8 for a 1st-level spell slot, plus 1d8 for each spell level higher than 1st, to a maximum of 5d8. The damage increases by 1d8 if the target is an undead or a fiend.  and  Eldritch Smite Prerequisite: 5th level, Pact of the Blade feature Once per turn when you hit a creature with your pact weapon, you can expend a warlock spell slot to deal an extra 1d8 force damage to the target, plus another 1d8 per level of the spell slot, and you can knock the target prone if it is Huge or smaller.  When I hit a target with an attack, can I set them both off at the same time, letting me burn two spell slots to use both features to boost my damage? As was specified , Divine Smite is not treated as a spellcasting, so it doesn't count towards the 'One Spell Per Round' rule. Presumably, neither would Eldritch Smite. As far as I can tell, this appears to be a legal way to burn a ton of resources at once to generate a massive burst of damage. Am I correct? Can these two like-features be used simultaneously?


I'm facing a (for me) strange behaviour of the // operator in python.  When I compute, e.g., 5.//0.25 I become the right result, i.e.   >>> 5.//0.25 20.0   But   >>> 5.//0.2 24.0   Instead of  >>> math.floor(5./0.2) 25   Can anyone explain me this results? Why is the result of the // 24.0?   EDIT: The given link  does not really answer the question exhaustively. In fact, with this answer one can not understand why the floor of the normal division give the right result. The real answer should explain how does // work, as was done by polku in the comments  And perhaps I had to write this from the beginning: why is this happening?  >>> print('%.17f' % (5./0.20000000298023224)) 24.99999962747097726 >>> print('%.17f' % (5./0.2)) 25.00000000000000000   EDIT2: This question should really be reopened, since it's answers isn't given in the suggested duplicate question, but rather in @polku's comment.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


Is there a well known methodology to design a IC circuitry to measure sub-nano ampere or even pico ampere currents within a very short delay of nano seconds? The SNR could be assumed to be fairly good above 20dB.

I need to sense the current of a target  through various periods of its on/sleep/off state and then need to send this data back to another interface MCU to read out the value. They will be both on the same board, powered by 5 V USB.  However these are the requirements I have:   5 V USB PSU Must be able to sense currents in the range of nA to mA with high    accuracy/precision. (I figure 1 nA to 500 mA) Only measure the current of the target MCU and not the interface. Must output maximum 3.3 V interface MCU   I have looked at available options and current sense amplifiers by Texas Instruments can't sense nA due to higher bias currents. So therefore I feel I would need a precision amplifier.  However I am stuck on how to proceed with this because, I need to somehow have a automatic dynamic current range and I am fairly new to current sensing and am not really sure on all the specifics.


I am looking for a tool that runs via command line.  sort of like  xprop xdotool   it simply needs to allow me to draw a rectangle on the screen.  and tell me the measurements of it.  I have tested out: "import" module by "imagemagick"..   but perhaps there is something much lighter out there ?  ( or perhaps even something that I can compile myself )

a tool like:  xprop wmctrl xdotool   but it needs to permit me to draw a shape on the screen.  then it should tell me the dimensions + the x-y coordinates   is there such tool ?


If I want to search a file in the system I use the following command:  sudo find `pwd` -name filename.ext   I want to make an alias for an easier word like search, so I used the command:  alias search "find `pwd` -name "   The problem is that the command translates the pwd part to the actual path i'm in now. When i type simply alias to see the list of aliases I see:  search   find /path/to/my/homedir -name   How can I avoid this?

One thing that I frequently do is edit the most recently modified files, so instead of typing "ls -lr" and then "vim lastfile", I thought I would make some shortcuts in my ~/.bash_profile file:  alias via="vim `ls -rt | tail -1`" alias vib="vim `ls -rt | tail -2 | head -1`" alias vic="vim `ls -rt | tail -3 | head -1`" alias vid="vim `ls -rt | tail -4 | head -1`" alias vie="vim `ls -rt | tail -5 | head -1`"   The problem is that, weirdly enough, these commands don't work.  They open some file that isn't one of the last, or even a file was deleted from the current directory (I wonder if there's some kind of file cache updating issue in the directory.  This occurs on both my local machine and the cluster I work on).  However, if I type vim `ls -rt | tail -1` directly, without using the alias, it works every time.


I tried to md5sum a image but the path is long and contains spaces, and there is no option in the file manager to open that path in gnome-terminal. Like right-click-> open current directory in terminal like it used to be in other or previous Ubuntu.   How can I open a directory in terminal which has long path contains spaces and in Ubuntu?

Is there any stable open terminal plugin for nautilus?


One can read everywhere that linear regression is a convex optimization problem and thus gradient descent will find the global optimum.  But can someone explain how to proof that it is a convex problem? Is it because of the linear regression function or is it because of the RSS cost function?

Is it possible for more than one "linear regression" line to fit a given set of points? (i.e.... "least squares" is minimised equally in both cases)  I'm assuming a simple one-variable regression in which we have a single "dependent" variable for a given x-value. It may be that regression is forced "through the origin" for the purpose of the Q (if that matters), so, I know it wouldn't be a great fit.  Or is there something intrinsic about a regression line that means it is unique? I am interested in a 'proof' (could be just an intuitive proof) if it exists, that a regression line must be unique.


I recall a science fiction short story where computers are so integrated that people have forgotten how to do basic math, until someone "rediscovers" it. The government then makes plans to put humans inside bombs to guide them, because "you can always replace a person, but you can't replace a computer" (probably paraphrased).   Anyone know it's title?

Many years ago I remember reading a short story about an advanced civilization at war that rediscovers how to do math mentally. The reason I remember it is the guy tells it to government officials who are delighted because it means they can put people inside bombs or missiles instead of computers, which were thought to be more valuable.  I believe this is one of those stories I read in a science fiction anthology my father brought home on one of his business trips in the sixties or seventies.


For the titanic dataset, I have done some feature engineering (one-hot encoded the features) and now I have developed a heatmap to view the correlation between different features.    I'm not able to understand what to do with them. Lets say two features are highly correlated, eg, in the image, Name_title_mr and sex_0 (ie. male) are having correlation factor of 0.84. So, does that mean I should drop Name_title_mr, since sex_0 is a very important feature. (This we know with experience, that sex in titanic is very important but is there any way we could view this as well by just observing the heatmap?). One more doubt I have is: How would I know that I can just add two features, like sibsp and parch ? I have seen many kernels where they just create one feature with no_of_family_members by just adding sibsp and parch.   Will that adding of two features helpful? and should I drop the individual features sibsp and parch in that case?   sibsp_1 and sibsp_0 (sibsp_1 is when sibsp=2 and sibsp_0 is when sibsp=1) seems to be highly negatively correlated. Should I consider some action on this as well?

I am working on the Titanic dataset. So far my submission has 0.78 score using soft majority voting with logistic regression and random forest. As for the features, I used Pclass, Age, SibSp, Parch, Fare, Sex, Embarked.  My question is how to further boost the score for this classification problem?   One thing I tried is to add more classifiers for the majority voting, but it does not help, it even worthens the result. How do I understand this worthening effect?  Thanks for your insight.


I was asked to determine the value(s) of the ratio $x:y$ if $2x^2-xy-3y^2 = 0$. I didn't know what this meant, so I just solved the equation to get $x = -y$ or $x = \frac{3}{2}y$. What does the question mean?

In algebra, all quadratic problems can be solved by using the quadratic formula. I read a couple of books, and they told me only HOW and WHEN to use this formula, but they don't tell me WHY I can use it. I have tried to figure it out by proving these two equations are equal, but I can't.  Why can I use $x = \dfrac{-b\pm \sqrt{b^{2} - 4 ac}}{2a}$ to solve all quadratic equations?


I need an event handler which fires when the value of an input field changes. No matter if the value is changed by the "user" or by "code". This listeners do work, if value changed by user, but not if it is changed by code.  $('#myInput').on('change paste input', function() {  })   My specific problem is that an javascript calendar plugin changes the value of my input field. The "input" event is than not fired because the change is made by code.  Thanks for help.

If i do jQuery(expr).change( function), then I can get an event function to fire when the user makes a change to the value.  Is it possible to get this to fire if it's changed programatically, ie if I call jQuery(expr).val("moo").  or if some Plain old JavaScript changes it's value?  Thanks for any help.


Regardless of the actual functionality of , one thing that really bugs me is that if I do chat on mobile, somehow the supernoticollider thinks that I need to have every single message I have received while using mobile chat as a notification, as if I'd been away.  Please stop doing this.  Okay so apparently I should click the 'mention' button. This is terrible.

I've been chatting from mobile today (with my Galaxy SIII), seems like when people ping me, it doesn't matter whether I send messages, or even specifically ping them back, the notification doesn't get cleared, and it eventually reaches my inbox with a flurry of 14 inbox notifications.    I've read other threads close to the subject, but it doesn't seem like anything addressed this specifically, so I'm opening this  report here.


I recently found this quote by Einstein (in On the Generalized Theory of Gravitation, 1950), and it seems to me like he is saying that matter is a part of the field of space-time, and is nothing more than an area of the field with very high energy. Is this correct?     According to general relativity, the concept of space detached from any physical content does not exist. The physical reality of space is represented by a field whose components are continuous functions of four independent variables-the coordinates of space and time. It is just this particular kind of dependence that expresses the spatial character of physical reality. Since the theory of general relativity implies the representation of physical reality by a continuous field, the concept of particles or material points cannot play a fundamental part, nor can the concept of motion. The particle can only appear as a limited region in space in which the field strength or the energy density are particularly high.

Someone claiming to have studied physics is telling me that spacetime is all that exists and that this fact is the basis of modern physics. When I said matter/energy also exists in its various forms, he said that energy is merely spacetime "waving/vibrating/acting", else what did I think was doing the waving: magical fairy dust? and has presented the following Einstein quote to support his claim:  "When forced to summarize the general theory of relativity in one sentence: Time and space and gravitation have no separate existence from matter."  Does Einstein's quote support what he's saying, that space-time is all that exists, and that matter/energy is spacetime waving?


The external hard disks attached to my Raspberry Pi spin up seemingly randomly and I don't know why. They form a RAID 1 managed by mdadm whose only partition is formatted with ext4.  Today, I set up a screen running  $ while true; do inotifywait -r /media/raid/; sleep 300; done   and refrained from using my RAID. It didn't monitor a single event the entire time, so no process seems to just randomly access the file system on my RAID.  On a different screen, I ran  # while true; do inotifywait /dev/sd{a,b}* /dev/md1; fuser /dev/sd{a,b}* /dev/md1; sleep 300; done   which recorded many events throughout the day but only a few PIDs. These where from /usr/sbin/smartd -n and /usr/lib/udisks2/udisksd --no-debug which I'm not even sure make the HDDs spin up. The culprits have likely gone unnoticed as they kept the files open only for such a short period of time that it took too long for fuser to be called and produce their PIDs.  How do I find out about the cause of those spin-ups?    In case the suspicion that this is a duplicate is correct, I posted a  about actually solving the problem.

I am using Debian Jessie on a HP Proliant Microserver Gen8 with two Western Digital Red 3TB. No RAID or anything else. I wanted the HDDs to automatically spin down after two hours.  Triggering it manually works fine with both commands  sudo hdparm -Y /dev/sda  sudo hdparm -y /dev/sda   so the output then is  user@NAS:~$ sudo hdparm -C /dev/sda  /dev/sda:  drive state is:  standby   But when I use:  sudo hdparm -S 244 /dev/sda   the HDD won't go into any kind of standby mode. Note that sda is not the system drive. I mounted both HDDs via fstab like this:  UUID=xxx       /mnt/Stuff                                ext4    defaults,noatime,nodiratime        0       0   Any idea why this won't work? I also tried 10 seconds and 1 minute. Is there a way to determine if there is any process accessing the partitions on the HDDs? I do use a DLNA Server and Samba, but no access has been made by me during the test, of course.


My textbook says:     All static magnetic fields are produced by moving electric charge.   Is this true? What about the magnetic field produced by a bar magnet?

Say I wrapped a piece of wire around an iron bar in a closed circuit connected to a DC power supply, the electrons starts flowing and moving charge produce magnetic field. Yet a bar magnet can produce a magnetic field without any charged particles moving around, are the magnetic fields produced by the two objects different types?


Why do we have two sets of teeth? Why do earlier shed and new teeth replace them? In humans, kids do not have any need for replacement of the teeth. Why don't the milk teeth grow themselves? Or why don't we have a set of small permanent teeth as our first teeth?

A similar question but about teeth healing themselves is .    So I understand that teeth have the capacity to heal themselves to a certain degree. It appears to be that part of the reason they can't heal all of themselves is that they are not surrounded by cells. In that case why can't we grow teeth back?  If a tooth is grown in the gum, or somewhere else, it would be surrounded by cells and so should be able to grow back right?  It appears that      New teeth are continually grown in a groove in the shark’s mouth and the skin acts as a “conveyor belt” to move the teeth forward into new positions.   Why can't we do this?


The following code works fine:  Class.h:  #ifndef ClassLoaded #define ClassLoaded  #include <iostream>  template <class T> class Class{     public:         template <class T> friend std::ostream& operator<<(std::ostream& Stream, const Class<T>& Op); };  #endif   Class.cpp:  #include "Class.h"  template class Class<int>;  template std::ostream& operator<<(std::ostream& Stream, const Class<int>& Op);  template <class T> std::ostream& operator<<(std::ostream& Stream, const Class<T>& Op){     return(Stream); }   Main.cpp:  #include "Class.h" #include <iostream>  using namespace std;  int main(){     Class<int> Test;      cout << Test << endl;      return(0); }   but the following extended version gives a linker error (unresolved external symbol) and I do more or less understand why. But how to fix it?  Class.h:  #ifndef ClassLoaded #define ClassLoaded  #include <iostream>  template <class T> class Class{     public:         class SubClass{             public:                 friend std::ostream& operator<<(std::ostream& Stream, const SubClass& Op);         };          template <class T> friend std::ostream& operator<<(std::ostream& Stream, const Class<T>& Op);      private:         SubClass Member; };  #endif   Class.cpp:  #include "Class.h"  template class Class<int>;  template std::ostream& operator<<(std::ostream& Stream, const Class<int>& Op);  template <class T> std::ostream& operator<<(std::ostream& Stream, const typename Class<T>::SubClass& Op){     return(Stream); }  template <class T> std::ostream& operator<<(std::ostream& Stream, const Class<T>& Op){     Stream << Op.Member;     return(Stream); }   Main.cpp:  #include "Class.h" #include <iostream>  using namespace std;  int main(){     Class<int> Test;      cout << Test << endl;      return(0); }   I guess I need an analogue of the lines  template class Class<int>;  template std::ostream& operator<<(std::ostream& Stream, const Class<int>& Op);   for SubClass and also some sort of template version of  friend std::ostream& operator<<(std::ostream& Stream, const SubClass& Op);   but how to do it?  Edit: As this was claimed to be a duplicated of another question: My question here is very specific (see comments below) and is not answered by the quoted questions or even mentioned there.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


public class myclass {  public static void main(String[] args){      Scanner scan = new Scanner(System.in);      int array1[] = new int[4];      System.out.println("Enter some integers");      for(int i = 0; i <array1.length; i++){          array1[i] = scan.nextInt();  }  Arrays.sort(array1);     HashMap<String, Integer> map = new HashMap<>();     map.put("IdOne", array1[0]);     map.put("IdOne", array1[1]);     map.put("IdOne", array1[2]);     } }         I want to be able to print the values that I entered into the array along with a key from the Hashmap. Example output:  Enter some integers  3  5  2  IdOne 2  IdOne 3  IdOne 5

If I have an object implementing the Map interface in Java and I wish to iterate over every pair contained within it,  what is the most efficient way of going through the map?  Will the ordering of elements depend on the specific map implementation that I have for the interface?


Let $U,W$ two subspaces in $V$. Assuming that $U\cup W = V$, show that: $U=V$ or $W=V$.     So, by definition of union: $$U \cup W = \left\{ {u + w|u \in U,w \in W} \right\}$$   How to proceed?  And a technical issue: Is $U \cup W$ equivalent to $U + W$?   EDIT:    Consider the following scenario (Following @Learner approach): $U = V \backslash \{x\}$ and $W = V \backslash \{y\}$.    $U\cup W = V$, but none of the subspaces is equal to $V$.  Where is the error?

Let $L,M$ two subspaces of the vector space, $V$ such that both $L,M \ne V$.   Prove: $L\cup M \ne V$.     I think this is a case of a proof by contradiction. Lets assume $L \cup M = V$.   Hence, $$\dim(V) = \dim(L) + \dim(M) - \dim(L\cap M)$$  How to proceed?


In Hoffman's Linear Algebra, in last part of section 1.5, it says that if an equation system $AX=Y$, where the entries of $A$ and the entries of $Y$ are in the field $F_1$, has a solution with $x_1,\ldots,x_n$ in $F$ and $F_1 \leq F$, then it has a solution $x_1,\ldots, x_n$ in $F_1$. He gives an argument, but I really don't follow. Can someone explain in other terms, why this happens?  Thanks in advance.

I saw this question     Let $A ∈ M_{m\times n}(\mathbb{Q})$ and $b ∈ \mathbb{Q}^m$. Suppose   that the system of linear equations $Ax = b$ has a solution in   $\mathbb{R}^n$. Does it necessarily have a solution in $\mathbb{Q}^n$?   and I thought I'd give an interesting, possibly wrong, approach to solving it. I'm not sure if such things can be done, if not maybe you can help me refine.    I considered the form of the equality as  $$ A^{(1)}x_1+\cdots+A^{(n)}x_n=b, $$  where $A^{(i)}$ is a column vector of $A$. I then noticed that for $x_i\in\mathbb{R\setminus Q}=\mathbb{T}$ then, and this is where I think I'm doing something forbidden, each $x$ has the represenation  $$ x_1  =  k_{11}\tau_1+\cdots+k_{1p}\tau_p \\  x_2= k_{21}\tau_1+\cdots+k_{2p}\tau_p \\ \vdots \hspace{4cm} \vdots \\ x_n=k_{n1}\tau_1+\cdots+k_{np}\tau_p,$$  where $\tau_i$ is a distinct irrational number, $k_{ij}\in\mathbb{R}$, and $p$ is the number of such distinct irrational numbers. I wound this out, but there may be a discrepancy with $p$ and $m$. I feel this method can lead me to the answer, but I'm not sure where to go from here.  EDIT$^1$:  I end up getting something like this, I believe, after substitution:  $$ A(k^{(1)}\tau_1+\cdots+k^{(p)}\tau_p)=b$$  Here, $k^{(i)}$ is the vector  $$\begin{pmatrix} k_{1i} \\ \vdots \\ k_{ni} \end{pmatrix}.$$  EDIT$^2$:  I think there is no discrepancy with $p$ and $m$ because $A\in M_{m\times n}(\mathbb{Q})$, $K\in M_{n\times p}(\mathbb{R})$, and $\tau\in M_{p\times 1}(\mathbb{T})$, so  $$ (m\times n)\cdot (n\times p)\cdot (p\times 1) = m\times 1. $$


I had a subdomain setup in cpanel before (sub.domain.com to redirect to domain.com/sub/) and suddenly today I noticed that it was rewriting the URL in the browser to www.domain.com/sub/ instead of just just leaving it as sub.domain.com. I wasn't sure what the problem was, but decided to delete my sub domain and recreate it in cpanel. Now I can only access it by going to www.sub.domain.com (sub.domain.com yields a server not found error).  EDIT: The problem seems to lie with the .htaccess file.  After deleting it, things went back to normal.  However now my new problem is how to configure the .htaccess file properly.  I had tweaked it originally to try and accomplish the following:  I have three folders, live, staging, and dev:  1) Requests for domain.com or www.domain.com are directed to domain.com/live (and the url the user sees is always rewritten as www.domain.com).  2) Requests for staging.domain.com and dev.domain.com or directed to domain.com/staging and domain.com/dev, respectively, and the user sees staging.domain.com or dev.domain.com in the browser.  3) Any subdomains in general are not rewritten by the browser when I add it in cpanel.  My current .htaccess file accomplishes number 1 just fine, but rewrites staging.domain.com to www.domain.com/staging and so forth.  RewriteCond %{HTTP_HOST} !^www\.domain\.com$ RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L] RewriteRule ^$ /index.html  RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\..+$ RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://www.domain.com/$1/ [R=301,L]  RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/live/ RewriteRule ^(.*)$ /live/$1

This is a  about Apache's mod_rewrite.   Changing a request URL or redirecting users to a different URL than the one they originally requested is done using mod_rewrite. This includes such things as:   Changing HTTP to HTTPS (or the other way around) Changing a request to a page which no longer exist to a new replacement. Modifying a URL format (such as ?id=3433 to /id/3433 ) Presenting a different page based on the browser, based on the referrer, based on anything possible under the moon and sun. Anything you want to mess around with URL   Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask!  How can I become an expert at writing mod_rewrite rules?   What is the fundamental format and structure of mod_rewrite rules? What form/flavor of regular expressions do I need to have a solid grasp of? What are the most common mistakes/pitfalls when writing rewrite rules? What is a good method for testing and verifying mod_rewrite rules? Are there SEO or performance implications of mod_rewrite rules I should be aware of? Are there common situations where mod_rewrite might seem like the right tool for the job but isn't? What are some common examples?   A place to test your rules  The  web site is a great place to play around with your rules and test them. It even shows the debug output so you can see what matched and what did not.


Today I was riding a XC mountain bike down a semi-steep mountain with some big bumps and tight turns. I had me seat all the way down, was standing with knees bent, and correct stance like it should be. It worked for a little bit until I came to a turn and I felt I was leaning way too far back so I pulled myself forward to fix my stance but for some reason I went flying somewhat sideways off the bike. I was also braking a little throughout the ride but I'm pretty sure I use them correctly. What was I doing wrong? How can I prevent this. This has happened before and it's really hard to recover from while riding.

I've ridden road and mountain bikes for years, and this is my first year riding as a part of a team (and actually doing races).  I've been stuck at nearly the same level of skill when descending and would like to improve.  Sure, there are some  I can read, but some are dated, and who has time to read a whole book?  (said only partially tongue in cheek)  Vague tips like, "ride with faster riders" are not needed - I ride with fast riders, and on the descents they're immediately gapping me at the first switchback.


Is there a way to get this application as a ".exe" file. For example let's say I have a login application designed. Can I have it as a "Login.exe" file so that when I have it on my computer and double click on it, it would open up? I have the login.ui file and the login.py file. What would I need to create a .exe file of this application?  Thanks in advance

Python works on multiple platforms and can be used for desktop and web applications, thus I conclude that there is some way to compile it into an executable for Mac, Windows and Linux.  The problem being I have no idea where to start or how to write a GUI with it, can anybody shed some light on this and point me in the right direction please?


Show that if $a$ and $b$ are positive integers with $(a,b)=1$ then $(a^n, b^n) = 1$ for all positive integers n  Hi everyone, for the proof to the above question,  Can I assume that since $(a, b) = 1$, then in the prime-power factorization of a and b, they have no prime factor in common, when they are taken to the $nth$ power, they will still have no prime factors in common, and so $(a^n, b^n) = 1$ for all positive integers n.  I think I'm jumping to conclusions here again, if so, leave some tips on how to do the proof properly, thanks :)  And also, I do not know how to approach the reverse problem where if $(a^n, b^n) = 1 then (a, b) = 1$, any guidance will be much appreciated!

The problem is to prove the following   If $\gcd(a,b) = c$, then $\gcd(a^m, b^m) = c^m$    I know that this can be solved easily by proving that $c\mid a \implies c^m \mid a^m$ and $c\mid b \implies c^m \mid b^m$. So the greatest common divisor of $a^m$ and $b^m$ is $c^m$. But the problem is that I want to use Bézout's Lemma (Identity) to prove this.  I first introduce the following notation:  $$a = ca' \quad \quad b = cb', \quad \quad \text{where $(a',b') = 1$.}$$  Now from Bézout's Lemma, becaus $a'$ and $b'$ are coprime integers then we have integer solutions for the following equation:  $$a'x + b'y = 1$$  It's obvious that also the following equation has an integer solution:  $$a'^mx_1 + b'^my_1 = 1$$  Although I'm not able to prove this using Bézout's Lemma.  Now multiply both sides by $c^m$ we get:  $$(a'c)^mx + (b'c)^my = c^m$$ $$a^mx + b^my = c^m$$  But Bézout's Lemma states that for given $c^m$ is the greatest common multiplier of $a^m$ and $b^m$ or it is a multiplier of it.  But how to prove that it's not a multiplier of the greatest common multiper, and in fact is the greatest common multiplier. Is it possible to solve this problem with Bézout's Lemma?


I am 13 and I have an assessment on G.I.S soon and I don't have a clue what it is.

Well, since it was one of the highest rated , hasn't been asked yet, and I would love to know the answer, I thought I'd ask it.  How do I explain what GIS is for the 11 year old kid?


I have this string in my preamble:  \def\bala#1\eala{\begin{align*}#1\end{align*}}   and I tried to rewrite it as:  \def\bala{\begin{align*}} \def\eala{\end{align*}}   or as:  \newcommand{\bala}{\begin{align*}} \newcommand{\eala}{\end{align*}}   but I noticed that it doesn't work for the align ambient (starred or not). It works for others math ambients like eqnarray, equation etc.  This is a Minimal NOT working Example:  \documentclass[11pt]{article} \usepackage{amsmath}  \newcommand{\bala}{\begin{align}}  \newcommand{\eala}{\end{align}}  \begin{document} My aligned equations \bala 1+1&=2\\ 2+2&=4 \eala  \end{document}   But the next one works:  \documentclass[11pt]{article} \usepackage{amsmath}  \newcommand{\bala}{\begin{eqnarray}}  \newcommand{\eala}{\end{eqnarray}}  \begin{document} My aligned equations \bala 1+1&=&2\\ 2+2&=&4 \eala  \end{document}

I want to make the code shorter. I defined the following pair of macros:  \def\b*{\begin{align*}} \def\e*{\end{align*}}   My point is that I saw this in a document, with  \def\b*{\begin{eqnarray*}} \def\e*{\end{eqnarray*}}   instead. The first pair of macros do not compile (on sharelatex.com), and the second one does. Why?


I wonder why in the references some words written in Capital letters are shown in the pdf file as regular letters?  For example:  In references:  @INPROCEEDINGS{7806038,  author={J. Lin and G. Weiss},  booktitle={2016 IEEE International Conference on the Science of Electrical Engineering (ICSEE)},  title={The virtual infinite capacitor-based active submodule for **MMC**},  year={2016},  pages={1-5},  keywords={Capacitors;Electrical engineering;Legged locomotion;Switches;Switching frequency;Topology;Voltage control},  doi={10.1109/ICSEE.2016.7806038},  month={Nov},}   The title that is shown in the pdf file is:     The virtual infinite capacitor-based active submodule for mmc   whereas in the pdf file it should be MMC instead of mmc  Does someone know how to solve it ?

Titles of articles I'm about to cite contain upper case letters and when using BibTeX it converts them to lower case ones. This happens only in the title and only the first letter conserves its case. For example, when I cite an article about HF, the reader won't know if it is about Hafnium (Hf) or fluorine acid (HF).  I know that I can fix it manually in the .bbl file but I would like to avoid it, or fix it automatically.


Hi there I am new to java, studying in my bs course from a couple of weeks. So please don't mind if I ask something stupid. btw coming to the point. Assignment was that you have to write a program in which I have to break the email address into parts using StringBuffer e.g: if the given email is hassanaqve@gmail.com so I have to break it like username: hassanaqve domain name : gmail extension : .com  I tried myself but it is not working there are no errors but also not giving output      import java.lang.*; public class Lab5 {     public static void main(String[] args) {         StringBuffer email = new StringBuffer ("Hassanaqve@gmail.com");          for ( int i=0; i<= email.length(); i++){              if ( email.substring (i).equals ("@")){                  System.out.println( "Username : " + email.substring(0,i));                  int j=i;                  for ( int p=0; j<= email.length(); p++ ){                    if ( email.substring (p) == (".")){                        System.out.println( "doamin : " + email.substring(j,p));                        System.out.println( "extention : " + email.substring(p+1,p+4));                    }                    }               }          }     }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


How can I write the rectangular norm symbol in math-mode where the text in between is centered, as seen hereinafter?

What is the "best LaTeX practices" for writing absolute value symbols?  Are there any packages which provide good methods?  Some options include |x| and \mid x \mid, but I'm not sure which is best...


I would like a suggestion on the best way on how to calculate a weighted median in R.  I have this kind of dataframe:  id         2       5        10 1       5408.55    0.00     0.00 10      1158.51    0.00     1006.37 100     18263.69   4205.64  0.00 20      27483.89   7601.01  833.90    id is the sample unit  2, 5, 10 are categories, but also the value from which I want to compute the median (equal for each sample unit).   At the coloumn-row intersections there are the weighs I want to use for the weighted median.  Any suggestion on which is the best package/functions doing this operation?  Thank you

I need to calculate weighted median return for a portfolio (using MATLAB).  There is information available online:  and   How would you calculate weighted median for following portfolios with given weights and returns?  Much of online help is about returns with frequencies.  I think the Matlab code in the solution above does not account for ties correctly.  Eg. A portfolio has 6 investments with the following returns:              A       B     C     D     E     F weights:    0.1     0.1   0.1   0.2   0.1   0.4 returns:    10%     20%   30%   1%    2%    1%  weighted mean = *easy!* weighted median = 1%??              A      B     C      D      E      F     G     H weights:    0.15   0.1   0.15   0.09   0.01   0.01  0.14  0.35 returns:    0.05%  1%    1%     1%     1%     2%    2%    5%  weighted mean = *easy!* weighted median = 1.5%?? <or should it be (1+1+1+1+2+2)/6??>


I am using LyX 2.1. However, I cannot preview the output in PDF. This happens after I updated from Acrobat Reader 11 to Acrobat Reader DC (if I am not mistaken, it is version 15). What should I do?

I just installed Lyx 2.1 on my computer for the first time. I wanted to create my first trial pdf but switching to viewing mode is for some reason not working with the Acrobat Reader DC. I tried many options found on the web but I am afraid my little knowledge is not sufficing to make it work.  I would really appreciate a detailed answer :)   Thanks.


Story:  While doing some reviews on Close-Votes on SO I've been presented a question to review that got a      This question was closed by xxx, yyy, zzz   footer. I was surprised, but still I've reread the question and decided to agree, pressed "Close" and it turned out to be an audit. Passed of course.  Bug/suggestion:  I think that the footer should not show up. Obviously, Close-Vote reviews would probably not show threads that are already closed, so that makes the audit instances quite obvious in this review category. Those footers are still perfectly valid in audits in Reopen category!

The other day, I got an obviously good question in a Close Vote Review.  Even if I didn't read the question,  is a bit of a giveaway.  Today I got one where   Also, on sites other than SO (where I understand the queues are huge), the number of reviews needed is often low enough (single digits) that you usually notice when you get an extra one.  I don't mind - I'm quite happy to get easy-to-pass audits - but maybe they could be a little harder...


Is there a way to block, let's say some_script.js from domain.com, but not all of them?

I want to disable a specific JS script from a specific website without disabling the javascript completely. Is there a way to do that ?


Compute closed form for: $$f(x)  = \sum_{k = 1}^{\infty} \frac{k}{3^{k}}$$  EDIT: There appears to have been solutions linked to this question as it is seen a s duplicate. One of them is a bit advanced and doesn't really explain the intermediate steps that some of the less mathematically mature may have difficulties piecing together. I feel this one may benefit beginners in Real Analysis more.  This question is in a chapter on power series and uniform convergence.  My Ideas:  When I look at this what comes to mind is that in order to find a closed form solution I'm going to have to attempt to manipulate this expression into a power series from that tools are available to use to compute it.  That being the case I would like to get this into something like: $$\sum_{k = 1}^{\infty}a_{k}x^{k}$$.  I see if I take the integral of both sides I would arrive at something of the form:  $$\int_{0}^{x}f(t) dt  = \int_{0}^{x} \sum_{k = 1}^{\infty} \frac{k}{3^{k}}dt \\ \Rightarrow \ = \sum_{k = 1}^{\infty} \frac{k}{3^{k}}x$$  If I take this integral $k$ times I would be able to get a $x^k$ term eventually. But I don't see anything fruitful coming from that, maybe I would have to play around with it more.  Another thought was examining the $\frac{k}{3^k}$ term I ask myself if there is a time that this ratio would ever be greater than $1$, because if not then I may have my geometric series right in front of me. Attempting to figure when $\frac{k}{3^{k}} > 1$, the only thing I arrived at was: $$\frac{\ln{k}}{k} > \ln{3}$$.  Which isn't very conclusive. So assuming that it is always true that  $\frac{k}{3^{k}} > 1$, the closed from of the solution would be:  $$\frac{3^k}{3^k - k}$$  Feedback on the thought process? Am I heading in the right direction with either idea? or perhaps something else should be tried?

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


Alright, I fear this may be claimed as a duplicate, but I have yet to find a straight answer after lots of googling. So here it is. I got this secundary hdd in my computer. I want it to mount at startup. The "User session defaults" setting don't. So I need to change it. Except, I have no idea how to set the fstab settings. And I see no help or preset settings to aid. The User Session default does sets everything I want except "mount at system startup", yet, other than the mount point, I have no idea how to set settings for it. And the settings that are there now, seem to give the drive a root-only restriction. So.. I'm at a loss. Can anyone help?   *Edited title to specify I wish for a solution using gnome disks. *edit2: confused fdisk and fstab. corrected to fstab.

How do you make HDDs and partitions mount at startup on Ubuntu?  I always keep my media and data files on separate partitions - one 2tb HDD and a 400 odd gig partition.  I have been trying to swap the default folder location for the home directory to my other drives.  It works when I change the /home/user_name/.config/user-dirs.dirs file to the directories I want, but only until I reboot the system. I am only assuming that the drives not mounting is the problem with it, but it would be helpful either way.  If any one knows another reason for why the directories change back to default each time that would be good also.


The  of the 3 elvish rings,     Their existence was hidden from Sauron, so they were untouched by his evil.   ,     After the destruction of the One Ring and the defeat of Sauron, [Nenya's] power faded along with the other Rings of Power.   The first quote states that they are not connected. The second states that they are connected. If the 3 rings were distinct and untainted by Sauron and his ring, why would their power fade after the destruction of the One Ring?

It is my understanding that Celebrimbor forged the Three Rings of Power, and that Sauron had no part in the creation of those rings. So why is it he was able to control them. I thought that all the other rings were bound to his will because he instructed their craft. So how is it that the rings which Celebrimbor made, presumably due to his own craft, could be made thralls for Sauron?


Suppose I have a blackbox function that solves simple linear regression. Can I use this function to solve "multiple" linear regression?  The blackbox computes the slope and intercept in a simple linear regression model.

Not sure if normalize is the correct word to use here, but I will try my best to illustrate what I am trying to ask. The estimator used here is least squares.  Suppose you have $y=\beta_0+\beta_1x_1$, you can center it around the mean by $y=\beta_0'+\beta_1x_1'$ where $\beta_0'=\beta_0+\beta_1\bar x_1$ and $x_1'=x-\bar x$, so that $\beta_0'$ no longer has any influence on estimating $\beta_1$.  By this I mean $\hat\beta_1$ in $y=\beta_1x_1'$ is equivalent to $\hat\beta_1$ in $y=\beta_0+\beta_1x_1$. We have reduced equation for easier least square calculation.  How do you apply this method in general? Now I have the model $y=\beta_1e^{x_1t}+\beta_2e^{x_2t}$, I am trying to reduce it to $y=\beta_1x'$.


Here, I'm taking $A$ to be a linear operator on $\mathbb R^n$ for $n>1$. Can you please tell me how to solve such a problem?

Let $A,B\in M_{n\times n}(\mathbb{R})$, prove that $$(\frac{d}{dt}\det(A+tB))_{t=0} = Tr(cof(A)^{T}\cdot B), $$ where $cof(A)$ is the cofactor matrix of $A$. I tried expanding it using row expansion, but it gets messed up. Any help?


I want to make changes to the kernel files /linux/net/ipv4/ip_output.c in my case. I want to add a script to be run that changes the payload of the data whenever a packet passes through the IP_LOCAL_OUTPUT hook. Now when I add that script, how do I recompile the kernel that make the changes operable.

I'm interested in compiling a new kernel under Ubuntu 12.04 x86 64 bit.  I found  which is basically a mirror for  and there are a lot of steps (git, etc.) that appear useless to me.  With earlier releases/distros, I used to create a .config file and modify a Makefile if I needed to, then just run make and it's done.  Is there is a simple way to do this under Ubuntu?


Let $A$ be a normed space where every absolutely convergent series converges in $A$.     How do I prove that $A$ is Banach?   Let $\sum_{n=1}^\infty x_n$ be an absolutely convergent series in $A$, then we know that $\sum_{n=1}^\infty ||x_n||$ is convergent in $\mathbb{R}$ and that $\sum_{n=1}^\infty x_n$ is convergent in $A$. Now using this, we want to show that all Cauchy sequences $\{x_n\}$ in $A$ converge. How would I do this?

Show that      A Normed Linear Space $X$ is a Banach Space iff every absolutely convergent series is convergent.   My try:  Let $X$ is a Banach Space .Let $\sum x_n$ be an absolutely convergent series .Consider $s_n=\sum_{i=1}^nx_i$. Now $\sum \|x_n\|<\infty \implies \exists N$ such that $\sum_{i=N}^ \infty \|x_i\|<\epsilon$ for any $\epsilon>0$  Then $\|s_n-s_m\|\le \sum _{i=m+1}^n \|x_i\|<\epsilon \forall n,m>N$  So $s_n$ is Cauchy in $X$ and hence converges $s_n\to s$ (say).  Thus $\sum x_i$ converges.  Conversely, let $x_n$ be a Cauchy Sequence in $X$. Here I can't proceed how to use the given fact.  Any help will be great.


I have Canon EOS 450d camera that I bought about 7 years ago and till now I have shot for about 15k photos. Lately appeared problems taking shots and when I pushed the button, nothing happened. I thought that camera is damaged but then I understood that the lens has some problems and after testing it by switching MF mode to AF, it worked so the lens doesn't work in MF mode. So, I need to repair it but I think that at this time I will search for a new lens, but I would love to get a better one compared to the basic lens.  How do I decide on a specific lens to fit my needs and budget? Mostly I shoot landscapes, family (outdoor/indoor), activities. Budget - around about 100 euros.

This is somewhat a follow-up to my . I have browsed through quite a lot of sites including this one for user opinions & reviews of different Canon lenses, but haven't found a comprehensive answer to the possible upgrade paths from the kit lens, particularly since I don't have a specific usage scenario in mind. Here are a few that I have found that answer the question partially:   (Quite old)   (for Pentax though)     (more about the cameras)        For this reason, I thought it would be useful to have a list of sub-$1000 upgrade lenses for the kit lens for APS-C format DSLRs (like the 550D, 60D, 7D etc), as a lot of people are upgrading to DSLRs nowadays. The key points that I seek are:   Pros\cons compared to the kit lens Price Scenarios the lens is suitable for   Keep in mind that it is primarily for APS-C cameras, so, EF lenses meant primarily for the full frame cameras would end up with the magnification factor of 1.6x. Also, this is focused towards hobbyists & amateurs for which reason I've added the sub-$1000 bit.  P.S. This question might be more suited for a wiki like article (albeit with user opinions included)


I set up my device quite some time ago and created a Google account. Since then, I haven't had to use my password even once because my device is linked to the account.  The problem is, now I would like to sign into my Google account online and I can't because I have absolutely no clue what my password is.   Is there any way I can recover or even change my password from my phone?  I understand the need for privacy but I really have no need for that kind of protection.

I have looked around and found no information on how Android manages to store passwords on the device. Especially Gmail passwords. I'm looking to learn how Android encrypts and stores passwords ? What key does it use and where is this key stored, and what encryption algorithm it uses.


A while ago this random thought crossed my mind: I am not even sure if the question is valid or makes sense, but I can sort of imagine a powder (consisting of of granules with a diameter way less than a nanometer across) behaving like a fluid (at least they would have a similar "macroscopic" behaviour). Of course I do not expect this powder to have similar chemical properties, but maybe that's the case. Is there any information on "simulating fluids with many tiny solid objects"?

Questions:   To what extent is it possible to treat (dry) sand in presence of gravity as a fluid? How does sand differ from other more standard fluids like liquid substances?   Since the definition of "fluid" is very broad, here I list some less vague points that may help anyone answering:   the propagation of waves in sand is different from liquids: if something hits sand I would say that a single wavefront can propagate and it is rapidly damped as it moves away from the impact point. But maybe a strong enough impact can exhibit more ripples? is viscosity present in sand? how does sand behaves at the interfaces with other fluids? Can we define some kind of surface tension when gravity is present?   I would say that having an external gravitational field should be important for sand to manifest these features but I am not completely sure: maybe it is not crucial for the single wavefront after an impact.   Anyway writing this I was not thinking about self gravitation effects and, with exception for the last point, I would assume no interaction with air or other fluids.    Slightly off topic:  It is interesting that we can substitute sand with any ensemble of solid, rigid objects of a fixed size with no interaction except being impenetrable, like sofas. Maybe if said objects can intertwine and bound (like chairs that get stuck together) tha fluid could approximate liquids even more, mimicking covalent or molecular bounds.


We are currently using SQL Server 2016 Standard Edition with ALWAYS-ON High Availability. We have two different clusters of SQL servers. We need to update it to the latest version of SQL (As per my research Cumulative Update package 13 (CU13) for SQL Server 2016 SP)  Cluster 1 - Currently on Microsoft SQL Server 2016 (SP2-CU4) (KB4464106) - 13.0.5233.0 (X64)   Cluster 2 - Currently on Microsoft SQL Server 2016 (SP1-CU12) (KB4464343) - 13.0.4541.0 (X64)  Query 1 - Can we update SP1-CU12 to directly SP2-CU13  Query 2 - Can we update SP2-CU4 to directly SP2-CU13  Query 3 - What steps should be taken before and after upgrading  Query 4 - What should be the roll-back plan, incase of failure  Any other word of advice or caution for someone doing for the first time will be appreciated.

If Always-On is configured, while applying Service Pack, should I:   Directly move SQL Server Instance (Secondary Replica) to make it passive and apply Service Pack  Or First move Availability Group and then move SQL Server Instance (Secondary Replica) and finally apply patch and restart the Server.   Can you please let me know?


I have a problem figuring out how to calculate the elapsed time between two timestamps (hours, minutes, seconds). This is the result:   String starttime = beginElement.getTimestamp(); String endtime = element.getTimestamp();   I/Start time: 1496258892612  I/End time: 1496258928999  long diffTime = Long.parseLong(endtime) - Long.parseLong(starttime);   I/Diff time: 36387  String elapsedtime = new SimpleDateFormat("hh:mm:ss").format(Long.parseLong(String.valueOf(diffTime)));   I/Elapsed time: 01:00:36  In fact, the elapsed time is just 36 seconds. It's always one hour less than the result.  How do I fix this strange issue?

I'd like to format a duration in seconds using a pattern like H:MM:SS. The current utilities in java are designed to format a time but not a duration.


I have  that allows you to open your "My Computer" ("This PC" in Windows 10), Mail Client, Web Homepage or Calculator with a press of a button.    I also have TI-NSpire CAS Software on my computer, which is useful for calculating more complex things like integrals (areas underneath a curve above the x-axis).  I know that it's possible to change your default mail and web client in the settings under . However, my question is:  Is it possible to rebind the calculator app that Windows opens upon pressing the Calculator button?  The default calculator doesn't really cut it for calculating integrals and summations in their algebraic or equation format

I've a Logitech Media Keyboard 600 which features a separate button to launch the calculator. I need that quite often, but the Windows shipped calculator is useless; there are more advanced out there.  So I've installed another calculator application and want this special key start this other app instead of the default one.  Is that possible?  I'm not searching for a solution to pin the app to the taskbar and use another shortcut key to launch it.


I click join area and then the Area Options dialog disappears and nothing happens.

I can't find a way to close a view panel, in particular the horizontal at the bottom, is pretty useless to me at this moment.


After parsing a csv file, i got a list like this: ['name', 'AGATC', 'AATG', 'TATC\n']  Is there any way that I can delete the newline (\n) character from the last element of the list so that the length of the element won't include the newline? I have tried the built-in replace() function but it did not work.

What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?


I have an uncompressed GeoTIFF file (figure 1) with the following band information:  Image Structure Metadata:    INTERLEAVE=PIXEL Band 1 Block=5000x1 Type=Byte, ColorInterp=Red Band 2 Block=5000x1 Type=Byte, ColorInterp=Green Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue Band 4 Block=5000x1 Type=Byte, ColorInterp=Undefined    Figure 1  I have compressed the file using the following set of parameters:  gdal_translate -of gtiff -co compress=jpeg -co jpeg_quality=85 -co tiled=yes -co photometric=rgb uncompressed.tif compressed.tif   This gives me a file with the following information:  Image Structure Metadata:   COMPRESSION=JPEG   INTERLEAVE=PIXEL Band 1 Block=256x256 Type=Byte, ColorInterp=Red Band 2 Block=256x256 Type=Byte, ColorInterp=Green Band 3 Block=256x256 Type=Byte, ColorInterp=Blue Band 4 Block=256x256 Type=Byte, ColorInterp=Undefined   Problem: When I serve my compressed image through GeoServer 2.1.4 I get image in figure 2 instead of the image in figure 1, which is what I would like. My goal is to have GeoServer just display the first three bands as RGB and ignore the 4th band.   Figure 2  I have tried to style the raster layer in GeoServer using SLD by adding the following channel configuration, but it didn't help.  <ChannelSelection>     <RedChannel>         <SourceChannelName>1</SourceChannelName>     </RedChannel>     <GreenChannel>         <SourceChannelName>2</SourceChannelName>     </GreenChannel>     <BlueChannel>         <SourceChannelName>3</SourceChannelName>     </BlueChannel> </ChannelSelection>   Why is my image server through GeoServer 2.1.4 looking the way it is and how do I configure GeoServer to display the image 'correctly'?


is definitely one of the most amazing phenomenon that I have heard in a while.  Some examples:   The pressure from the  can perturb the motion of artificial satellites as the momentum is exchanged creating a perturbing force. The  in Australia intend to use high powered lasers to perturb the orbit of space debris, sending space junk in to our atmosphere with the intention that it will burn up!   Question  It has most certainly happened to everyone in the community where you've gone to bed only to realise that you've forgot to close the door. On a much smaller scale, yet equally as annoying as space debris.    What would be the magnitude of photon pressure required to cause a force big enough to close a bedroom door?

Photons have no mass but they can push things, as evidenced by .   Can photons push the source which is emitting them? If yes, will a more intense flashlight accelerate me more? Does the wavelength of the light matter? Is this practical for space propulsion? Doesn't it defy the law of momentum conservation?  Note: As John Rennie mentioned, all in all the wavelength doesn't matter, but for a more accurate answer regarding that, see the comments in  .  Related Wikipedia articles: ,


I'm working with a 3D model of the earth (WGS84).   The input to my problem is a geocentric lat-long. Is there an efficient way to convert this to a geodetic lat-long?  My initial attempt to solve this seems to work correctly: First, convert the geocentric lat-long back to it's corresponding point in 3D space. Then, feed that XYZ into a library function that returns the geodetic latitude.   It's straightforward, but the conversion from XYZ to geodetic lat-long is not cheap because it uses some fixed number of iterations to come up with a reasonably accurate result... I am looking for something that runs faster.  Given the geocentric latitude, is there a more efficient route I can take to get the corresponding geodetic latitude?

(I see there is an  that does exactly what I am asking but there is no references. I have no way of confirming the validity of this equation!)  I already understand the difference between Geocentric Latitude vs Geodetic Latitude.  Assuming known semi major, a, and semi minor, b, radiuses are given. How do you compute the radius at a given geodetic latitude?  I need some sort of expert confirmation (derivation, link to derivation, confirmation from expert, explanation, etc).


So tail recursive means a recursive function that uses one recursive call in the body. Moreover it is outermost, meaning that the recursive call is not inside a statement but rather the recursion is done on the parameter of the recursive call. For example(Here I'm using OCaml),  recursive:  let rec fact n = if n=0 then 1 else n* fact (n-1);;   Tail Recursive:  let fact n = let rec helper (n,m)=     if n=0 then m     else helper(n-1,n*m) in  helper(n,1);;   I don't see why would tail recursive be better than the other one?   Also some questions about OCamel: Do we have have to worry about indentations? Because it seem that we don't when i tried it in tryOCamel.     Also, Can we make a new tag for OCaml questions?  Please help

Whilst starting to learn lisp, I've come across the term tail-recursive. What does it mean exactly?


According to :  Internalization When you place an order to buy or sell a stock, your broker has choices on where to execute your order. Instead of routing your order to a market or market-makers for execution, your broker may fill the order from the firm's own inventory. This is called "internalization." In this way, your broker's firm may make money on the "spread" – which is the difference between the purchase price and the sale price.  So from this definition, I've understood that if a broker has a particular stock, it can fill it "in-house" instead of directing it to the open market. But can a broker hold the BUY order from the customer(one with a big possible spread), until the brokerage purchases needed stock from either its customers or open market and then fill the BUY order to gain the spread profit? I assume that the operation itself will be very fast(to buy the stock at market price) and, probably, not noticeable by a customer. Example: stock costs $100, some customer places an order to buy the stock for $400. A brokerage firm doesn't have the stock in inventory at the current time. Is it legal? Is it a common practice?

In the United States, whenever a customer places an order, will the broker always execute that trade on the market?  Do brokers just maintain a "reservoir" of popular stock, and hand them out to customers at market price instead of going to the exchange?  In other words, do people ever just buy/sell assets from their broker, instead of through their broker?


I issue  $ pacman -Su :: Starting full system upgrade... error: duplicated database entry 'python2-cairo'  there is nothing to do   So I have a look at /var/lib/pacman/local  $ ls /var/lib/pacman/local/ | grep cairo cairo-1.15.12-1 cairomm-1.12.2-2 python2-cairo-1.17.0-1 python2-cairo-1.17.0-2 python-cairo-1.17.0-2   How can I:   See why python2-cairo-1.17.0-1 and python2-cairo-1.17.0-1 are both installed (what packages depend on them) Get rid of python2-cairo-1.17.0-1 Fix the duplicated database entry error...

On Arch Linux, I've backed up my system with rsync and restored it again, but it seems that my way of doing it (which I did get from the Arch Wiki but must be wrong?) has kept old files deleted by Pacman.  This results in the error duplicated database entry when I try to upgrade my system with pacman -Syu.  What should I do?


PC1   PC2   PC3   Electricity -0.48  0.12 -0.77  Fertility    0.49 -0.04  0.11  Life_exp    -0.50 -0.01  0.51  Pop_dens    -0.12 -0.99 -0.07  Child_mort   0.51 -0.08 -0.35    Questions: Do you need to use absolute value for PC1?  I am kind of confused. Electricity and Life exp are roughly equal weight, Child_mort and Fertility are roughly equal weight as well. (If I get it right) If you use absolute value for PC1, does that mean you have four features I just mentioned are roughly equal weight?  How do you interpret PC2?

When you construct a biplot for a PCA analysis, you have principal component PC1 scores on the x-axis and PC2 scores on the y-axis. But what are the other two axes to the right and the top of the screen?


I'm working on project in android. my situation i stored list value in firebase Realtime database and then the List value and my given value is equal the checkbox will be checked.      For example: the List holding 36,40, 44.then my given value is equals   to that List value then the equivalent checkbox will be checked.      My code is  checkcheck=FirebaseDatabase.getInstance().getReference().child("Products").child(newprokey);                  checkcheck.child("size").addValueEventListener(new ValueEventListener() {                     @Override                     public void onDataChange(DataSnapshot dataSnapshot) {                          final List<String> areas = new ArrayList<String>();                          for (DataSnapshot areaSnapshot : dataSnapshot.getChildren()) {                             String areaName = areaSnapshot.child("Value").getValue(String.class);                             areas.add(areaName);                         }                          String[] check = areas.toArray(new String[areas.size()]);                          for (int i= 0;i<check.length;i++)                         {                             if (check[i] == "36")                             {                                 jS36.setChecked(true);                             }                             if (check[i] == "38")                             {                                 jM38.setChecked(true);                             }                             if (check[i] == "40")                             {                                 jL40.setChecked(true);                             }                              if (check[i] == "42")                             {                                 jXl42.setChecked(true);                             }                              if (check[i] == "44")                             {                                 jXxl44.setChecked(true);                             }                             if (check[i] == "46")                             {                                 jXXXl46.setChecked(true);                             }                         }                      }                       @Override                     public void onCancelled(DatabaseError databaseError) {                      }                 });   i try this code. it's not working, give me solution.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


This works:  //a.js export let x = false;  export function toggle_x() {   if (x) {     x = false;   } else {     x = true;   } }  //b.js  import {x, toggle_x} from {'/a.js'} toggle_x() console.log(x) //outputs true, great!   This does not work:  //a.js export let x = false;  export function toggle(v) {   if (v) {     v = false;   } else {     v = true;   } }  //b.js  import {x, toggle} from {'/a.js'} toggle(x) console.log(x) //outputs undefined   Why? I want to create a function to toggle between true/false the entered variable.  Thanks!

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


How does mathematical induction actually work?   After surfing on the internet for a while, I found the following analogy. Consider rectangular tiles (dominoes) stacked on beside the other. When we force the first tile to fall, the others begin to fall. To actually know if all the tiles have fallen, we need to know the following-   If the first tile has fallen or not. (If not, non of them have fallen) If the first tile has fallen, then we can pick some random tile from the stack to check if that has fallen. If this tile has fallen, then the previous tile must have also fallen.  From this, we can conclude that all the tiles have fallen.   But I don't understand how this idea of induction works with numbers?

I've never really understood why math induction is supposed to work.  You have these 3 steps:   Prove true for base case (n=0 or 1 or whatever) Assume true for n=k.  Call this the induction hypothesis. Prove true for n=k+1, somewhere using the induction hypothesis in your proof.   In my experience the proof is usually algebraic, and you just manipulate the problem until you get the induction hypothesis to appear.  If you can do that and it works out, then you say the proof holds.  Here's one I just worked out,  Show $\displaystyle\lim_{x\to\infty} \frac{(\ln x)^n}{x} = 0$  So you go:   Use L'Hospital's rule. $\displaystyle\lim_{x\to\infty} \frac{\ln x}{x} = 0$. Since that's $\displaystyle\lim_{x\to\infty} \frac{1}{x} = 0$. Assume true for $n=k$. $\displaystyle\lim_{x\to\infty} \frac{(\ln x)^k}{x} = 0$. Prove true for $n=k+1$.  You get $\displaystyle\lim_{x\to\infty} \frac{(\ln x)^{k+1}}{x} = 0.$   Use L'Hospital again: $\displaystyle\lim_{x\to\infty} \frac{(k+1)(\ln x)^{k}}{x} = 0$.  Then you see the induction hypothesis appear, and you can say this is equal to $0$.  What I'm not comfortable with is this idea that you can just assume something to be true ($n=k$), then based on that assumption, form a proof for $n=k+1$ case.  I don't see how you can use something you've assumed to be true to prove something else to be true.


I can't prove this theorem. Could you help me? Thanks for your helps. $A$ and $B$ are subsets of an $n$-dimensional Euclidean space. Prove that, if $A$ is compact and $B$ is closed, there exist $u$ in $A$ and $v$ in $B$ such that $\|u-v\|=\inf\{\|a-b\| \mid a \in A\text{ and }b \in B\}$.

I would like to prove the following statement.  Let A and B be nonempty disjoint subsets of $\mathbb{R}$ where A is closed and B is compact. Then there exists $a \in A$ and $b \in B$ such that $inf${$|a-b|$:$a \in A, b \in B$}=$|a-b|$    I read a similar question above where the concept of "limit point" and others were used, but my class (Introduction to Analysis) has not gone that far; most of all, I would like to prove the statement from the knowledge that the class covered.  So far, I have learned definition of limit of a sequence, Bolzano-Weierstrass Theorem. Also, I just learned (and proved) that there exists a sequence ${a_n}$ in E such that $\lim{a_n} = \inf{E}$ if E is a nonempty subset of $\mathbb{R}$ (whether E is bounded below or not due to the extended real numbers).   From the things that I learned, first, I constructed a set $E$={$|a-b|$:$a\in{A}, b\in{B}$} and I know that there exists a sequence ${x_{n}}$ in E such that $\lim{x_{n}}=infE$. Since ${x_{n}} \in{E}, x_{n}=a_{n}-b_{n}$ where $a_{n} \in A, b_{n} \in B$. Let $infE = \beta$. Then, this leads to $\lim{(a_{n}-b_{n})}=\beta$. Then, for any $\epsilon$>0, there exists $N \in$ $\mathbb{N}$ such that $|a_{n}-b_{n}-\beta|<\epsilon$ for all n $\ge$ N.   Then, I could not proceed. I should use conditions that A and B are disjoint, A is closed, and B is compact. Could anyone help me proceed? I had a feeling that using contradiction might work from the link above, but it is quite tough. Since I am a novice (just started taking Introduction to Analysis), I would very much appreciate it if you could help me prove this at the beginner level.


What would be the correct sentence:  Designed to specifically work with Designed specifically to work with Designed to work specifically with

What would be the right position of "substantially" in the following:     1). Before verb: These optimal values substantially contribute to the success of the methodology.      2). After verb: These optimal values contribute substantially to the success of the methodology.   Here is my issue:  Fact1: When I use Google Ngram, I get , 0 occurrence of option 1.  Fact2: I found an excellent Grammar book that discusses Adverbs, their types and prefered positions. The author defines some rules that I'll summarize as follows:   Connecting adverbs, eg: however, then,..., Position: Beginning of clause. Indefinite frequency, eg: always, usually,..., Position: Mid position (after auxilary verb, before other verbs) sometimes beginning of clause. Focusing adverbs, eg: mainly, only,..., Position: Mid position. Adverb of certainty, eg: clearly, obviously, Position: Mid position. Adverb of completeness, eg: almost, nearly,..., Position: Mid position. Adverb of manner, eg: fast, slowly, nicely,..., Position: End clause, mid and beginning. Adverb of place, eg: upstairs, around, Position: End clause, sometimes beginning. Adverb of time, eg: daily, weekly, ... Position: Mostly end clause, sometimes beginning and mid position.   I think that "substantially" is an adverb of completeness. Therefore, the right position is before the verb "contribute" (option 1). However, Google Ngam indicates that option 1 is not widely used.  What do you think? Any suggestions?


I have an input file of size 1040 bytes. I need to copy the first 512 bytes, skip next 8 bytes and copy the next 512 bytes, skip 8 bytes. I am able to copy the first 512 using dd command, but not sure how to put this in shell script to skip 8 bytes and copy the next 512 bytes. Any help please

I have an input file which is always a multiple of 520 bytes . i,e Input file 1- 1040 bytes Input file 2- 5200 bytes   I need to copy every 512 bytes from input file and skip the next 8 bytes from input files to output file i.e Output file data = Copy first 512 bytes of input file - Skip 8 bytes - Copy second 512 bytes of input file- Skip 8 bytes --.. Therefore, my output file should always be multiple of 512 bytes Input file 1- 1040 bytes        Output file 1 - 1024 bytes Input file 2- 5200 bytes        Output file 2 - 5120 bytes  I need to do this in shell script, any help here please.