How to print a horizontal line the size of the terminal with a word in the middle?
How can I print a variable with padded center alignment?
Integrating MySQL with Python in Windows How do I build a TRRS headphone jack with a jack that is detectable by an iPhone I have a circuit and I am trying to integrate it with an iPhone via a TRRS headphone jack's microphone input. I have a generic TRRS cord and am trying to send a signal through it. However, the iPhone does not detect that a mic is even plugged in. However, if I plug it into my Mac via line-in and record, I can record the signal I am sending perfectly.   I have read online that it needs to detect resistance between the ground and mic, which I have. Are there any other things I need to do? It seems like this is an issue that stems from Apple's proprietary technology, as the earbuds are from a Windows Phone before they were spliced.    Thanks so much! Has there been any progress made on granting a developer account for SF and HubExchange Devs? It feels conceptually wrong to me a SF product doesn't allow developers to perfect and develop a wider solution offering without paying +10K license fee per year. Even without CRM the HubExchange market could be a richer portal for consumers and developers if we were allowed a means to test our concept.  I think we'd all be perfectly happy with an account that was blackholed or limited in such a way where we could only send a finite qty of emails to an email address associated to the user.  If there's a forum or avenue where we can assist in raising the value proposition please let us know as I know there are many people looking. Insert list of figures in the table of contents Is it possible to create a list of all the figures at the end of a document (this I can do) and make it appear in the table of contents?  So in the the table of content there will be a line saying List of figures ... 19 for example? Space between 2 paths in Illustrator How can I align 2 paths perfectly? No matter what I do I get a little space (gap between the 2 paths I create, and they are straight lines not as I saw in other questions with pixel problems)  An example:    Between every triangle is a little space, like in the example. It isn't obvious and it doesn't bother, but if I use the image (as an SVG or something) it is really obvious. How to decide which glm family to use? I have fish density data that I am trying to compare between several different collection techniques, the data has lots of zeros, and the histogram looks vaugley appropriate for a poisson distribution except that, as densities, it is not integer data. I am relatively new to GLMs and have spent the last several days looking online for how to tell which distribution to use but have failed utterly in finding any resources that help make this decision. A sample histogram of the data looks like the following:   I have no idea how to go about deciding on the appropriate family to use for the GLM. If anyone has any advice or could give me a resource I should check out, that would be fantastic. Why didn't Escobar's hippos introduced in a single event die out due to inbreeding Today I read a  about how Pablo Escobar had once imported 4 hippos (1 male, 3 female) into his estate in Colombia for his private zoo. After his downfall, while other species were shipped out, hippos were considered too big to move and expected to not survive. However, to the surprise of all the hippos are thriving and are so numerous that there have been calls to cull them. From the report:  Numbers are projected to only get bigger. [Colombian biologist Nataly] Castelblanco and her peers say the population will reach over 1,400 specimens as early as 2034 without a cull - all of them descended from the original group of a male and three females. In the study, they envisaged an ideal scenario in which 30 animals need to be culled or castrated every year to stop that happening.  My understanding is that since there was only 1 male, the gene pool would be limited and lead to lot of inbreeding in the descendants. This would cause population to not explode because some individuals would be unfit to survive. Why has this not happened in case of hippos? Is it because there are 3 females (probably unrelated to each other) which keeps gene pool large enough? Or can mutations explain this phenomenon? Would results have been different if originally 2 females had been moved and only 1 retained? EDIT - I have just found that  is maybe less than 100 individuals which though big is not massive. EDIT2 - I have edited the question title to keep focus on the hippos although a general answer would be welcome. How to lead a moving target from a moving shooter I saw this question: .  My situation is a little different though.   My target moves, and the shooter moves.  Also, the shooter's velocity is added to the bullets' velocities, i.e. bullets fired while sliding to the right will have a greater velocity toward the right.   What I'm trying to do is to get the enemy to be able to determine where they need to shoot in order to hit the player.  Using the linked SO solution, unless the player and enemy are stationary, the velocity difference will cause a miss.  How can I prevent that?      Here is the solution presented from the stack overflow answer.  It boils down to solving a quadratic equation of the form:  a * sqr(x) + b * x + c == 0   Note that by sqr I mean square, as opposed to square root. Use the following values:  a := sqr(target.velocityX) + sqr(target.velocityY) - sqr(projectile_speed) b := 2 * (target.velocityX * (target.startX - cannon.X)       + target.velocityY * (target.startY - cannon.Y)) c := sqr(target.startX - cannon.X) + sqr(target.startY - cannon.Y)   Now we can look at the discriminant to determine if we have a possible solution.  disc := sqr(b) - 4 * a * c   If the discriminant is less than 0, forget about hitting your target -- your projectile can never get there in time. Otherwise, look at two candidate solutions:  t1 := (-b + sqrt(disc)) / (2 * a) t2 := (-b - sqrt(disc)) / (2 * a)   Note that if disc == 0 then t1 and t2 are equal. I'm creating a color object using the following code.  curView.backgroundColor = [[UIColor alloc] initWithHue:229 saturation:40 brightness:75 alpha:1];   How can I retrieve RGB values from the created color object? Repeating the consonant in many words in a sentence or phrase In the movie 'V for Vendetta' you have for example (bold part):     Evey: Who are you?        V. : Who? Who is but the form following the function of what and what I am is a man in a mask.      Evey: Well I can see that.        V. : Of course you can, I’m not questioning your powers of observation, I’m merely remarking upon the paradox of asking a masked man who he is.      Evey: Oh, right.      V. : But on this most auspicious of nights, permit me then, in lieu of the more commonplace soubriquet, to suggest the character of this dramatis persona.      V. : Voila!   In view humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of fate. This visage, no mere veneer of vanity, is a vestige of   the “vox populi” now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin, van guarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta, held as a votive not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily this vichyssoise of verbiage veers most verbose, so let me simply add that it’s my very good   honour to meet you and you may call me V.       Evey: Are you like a crazy person?      V. : I’m quite sure they will say so.   What do you call sentences like these? And do you know some other ones? How can I create launcher icon for PhpStorm? Markdown source:  `http://google.com`  - `http://google.com`     - `http://google.com`   Rendered result:  http://google.com   http://google.com   http://google.com    Note that the third code span is a link. Adding a newline before the list item makes the link disappear. Free way to clone HDD to SSD? Is there a free way to clone a full Windows 7 installation from HDD to SSD? (The free part is important, I know I can pay for Acronis True Image.)      SSDs are usually much smaller than HDDs which complicates matters. For instance, I have about 50GB data, my new SSD is 80GB but I still can't use Windows clone/restore system if my HDD is something like 300GB.  Therefore, I'm looking for a third party tool that will be able to:   Create a clone of my C: partition Store it onto an external USB drive Boot from some rescue / restore CD Load the image onto the new SSD   Acronis True Image seems like a tool that should support this but it's a paid-for software and the trial version cannot create clones. Acronis Migrate Easy is a fully functional tria for 15 days but need both the HDD and SSD connected at the same time which is a bit of a problem for me as a laptop user.  P.S. I almost got there combining Windows image backup combined with Acronis True Image restore CD (which can load .vhd's) but was not able to boot as some boot information were probably lost and could not be repaired using the Win7 installation DVD. Derivative of a factorial What is ${\partial\over \partial x_i}(x_i !)$ where $x_i$ is a discrete variable?  Do you consider $(x_i!)=(x_i)(x_i-1)...1$ and do product rule on each term, or something else? Thanks. Install Java JDK and JRE on Debian 8 What is a substitute for red or white wine in a recipe? I am working on the following problem from group theory:     If $G$ is a group of order $2n$, show that the number of elements of $G$ of order $2$ is odd.   That is, for some integer $k$, there are $2k+1$ elements $a$ such that $a \in G,\;\; a*a = e$, where $e$ is the identity element of $G$. This question is pretty simple: I'd like to have the possibility to get the exact size of a picture in LaTeX with, for example, the macro \the.  In fact, I've founded the way \settoheight{} and so on, but it didn't work at all. What I've got doesn't match with what I can see in the image properties (I suppose that's the name in English). The result: 8pt versus 1300 pixels. It's may be a mis-use...  Edit: In the end, my aim was to find a way to fit the picture in LaTeX. If width and height were both less than the dimensions of the body, then it should just be centred. It look like this :     Require:   \usepackage{graphicx} \usepackage{xifthen} \usepackage{calc}   Code (pretty ugly, I agree):   % Centrering+fitting for image, with captation and label (not auto) \newlength\imageheight \newlength\imagewidth \newcommand{\pic}[3]{% \settoheight\imageheight{\includegraphics{pictures/#1.png}}% \settowidth\imagewidth{\includegraphics{pictures/#1.png}}% \ifthenelse{\lengthtest{\imagewidth &gt; \textwidth}}{\ifthenelse{\lengthtest{\imageheight &gt; \imagewidth}}{\par\vspace{0.95em}% \begin{figure}     \centering\includegraphics[height=0.85\textheight]{pictures/#1.png}     \caption{#2}     \label{#3} \end{figure}% \par\vspace{0.95em}}{\par\vspace{0.95em}% \begin{figure}     \centering\includegraphics[width=0.95\textwidth]{pictures/#1.png}     \caption{#2}     \label{#3} \end{figure}% \par\vspace{0.95em}}}{\ifthenelse{\lengthtest{\imageheight &gt; \textheight}}{\par\vspace{0.95em}% \begin{figure}     \centering\includegraphics[height=0.85\textheight]{pictures/#1.png}     \caption{#2}     \label{#3} \end{figure}% \par\vspace{0.95em}}{\par\vspace{0.95em}% \begin{figure}     \centering\includegraphics{pictures/#1.png}     \caption{#2}     \label{#3} \end{figure}% \par\vspace{0.95em}}}} %   To use it : put your png files in a "pictures" directory, then, just simply call the picture like this : \pic{name_whitout_extension}{Captation_if_needed}{Label_if_needed}.    Edit 2 :   Thanks to Martin Scharrer's easyfig package, I've got a more or less 1,6 times faster solution to put my pictures, centred, with the perfect size.  CTAN:   VC:   Version v1.2 – 2012/05/15    This could be useful for some others, I hope. Why is the potential energy equal to the negative integral of a force? I'm trying to figure out how to use "not only... but also" properly. Basically, my goal is to combine two clauses by using "not only".  For negations, I've figured out two styles that both sound correct:   He knew that if he fractures his finger, not only would he not be able to compete in the water polo tournament, he would not be able to take the SAT on Monday, either. He knew that if he fractures his finger, neither would he be able to compete in the water polo tournament, nor would he be able to take the SAT on Monday.   However, I don't know how to form a sentence that does not include a negation while using "not only". Here are a few possibilities that I've considered:   Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, but he was also given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, but he was given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, he was given a full scholarship. Thanks to his remarkable performance on the SAT, not only was he accepted into Harvard, he was also given a full scholarship.   In those four possibilities, I'm varying the usage of "but" and "also" in the last clause.  What is the proper usage of "not only"?