I need to center an image in a middle of a div.  &lt;div class="main"&gt;     &lt;img...&gt; &lt;/div&gt;   In the example below the image is centered, but not in the middle.
I have a div 200 x 200 px. I want to place a 50 x 50 px image right in the middle of the div.   How can it be done?  I am able to get it centered horizontally by using text-align: center for the div. But vertical alignment is the issue..
How do I call a Scala Object method using reflection? If I know the GCD of 20 numbers, and know the 20 numbers, is there a formula such that I input the 20 numbers and input their GCD, and it outputs their LCM? I know that $$\frac{\left| a\cdot b\right|}{\gcd(a,b)} = \text{lcm}(a,b).$$ So is it$$\frac{\left| a\cdot b\cdot c\cdot d\cdot e\cdot f\right|}{\gcd(a,b,c,d,e,f)}?$$If not, what is it? Point reflection over a line I'm having trouble understanding the solution presented below (It's from a textbook). I tried to get something similar, but to no avail. Help me find the way he derived those a,b,x2 and y2 expressions.   Point p is a point which we want to reflect (It's a simple structure with two integers x and y representing coordinates on a 2d plane); (x0,y0) and (x1,y1) are coordinates of endpoints of a line.  Expected result is a new point with reflected coordinates.   Point mirror(Point p, int x0, int y0, int x1, int y1) {     double dx,dy,a,b;    long x2,y2;    Point p1; //reflected point to be returned      dx  = (double) (x1 - x0);    dy  = (double (y1 - y0);     a   = (dx * dx - dy * dy) / (dx * dx + dy*dy);    b   = 2 * dx * dy / (dx*dx + dy*dy);     x2  = Math.round(a * (p.x - x0) + b*(p.y - y0) + x0);     y2  = Math.round(b * (p.x - x0) - a*(p.y - y0) + y0);     p1 = Point((int)x2,(int)y2);      return p1;  } How can I better optimize my tables and a LEFT JOIN query to find items that don't yet exist in the right table? I have two tables that represent a list of urls and their related word indexes. Here are the table definitions for reference.  desc urllist; +-------+---------------------+------+-----+---------+----------------+ | Field | Type                | Null | Key | Default | Extra          | +-------+---------------------+------+-----+---------+----------------+ | id    | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment | | url   | text                | NO   |     | NULL    |                | +-------+---------------------+------+-----+---------+----------------+   and  desc wordlocation; +----------+---------------------+------+-----+---------+-------+ | Field    | Type                | Null | Key | Default | Extra | +----------+---------------------+------+-----+---------+-------+ | urlid    | bigint(20) unsigned | NO   |     | NULL    |       | | wordid   | bigint(20) unsigned | NO   |     | NULL    |       | | location | int(10) unsigned    | NO   |     | NULL    |       | +----------+---------------------+------+-----+---------+-------+   The software app is a web spider. It crawls a list of urls, extracts those urls, and inserts these into the urllist table. Then, an indexer checks to see what urls have not yet been indexed, and then proceeds to index said urls.  Here is the query I am using to find items in the left table (urllist) that have not yet been indexed in the right table (wordlocation). This query is as suggested on the :  select * from urllist ul  left join wordlocation wl on ul.id = wl.urlid  where wl.urlid IS NULL;   As of this writing my test database has only 600 indexed urls, and the wordlocation table has 1.3 million rows.  However, my CPU is at 100%, and the longest I've waited to see if the query would complete is a half hour (which, it never did by the way).  To be thorough, here is the explanation of the query:  explain select * from urllist ul left join wordlocation wl on ul.id = wl.urlid where wl.urlid IS NULL; +----+-------------+-------+------+---------------+------+---------+------+---------+-------------------------+ | id | select_type | table | type | possible_keys | key  | key_len | ref  | rows    | Extra                   | +----+-------------+-------+------+---------------+------+---------+------+---------+-------------------------+ |  1 | SIMPLE      | ul    | ALL  | NULL          | NULL | NULL    | NULL |   50364 |                         | |  1 | SIMPLE      | wl    | ALL  | NULL          | NULL | NULL    | NULL | 1351371 | Using where; Not exists | +----+-------------+-------+------+---------------+------+---------+------+---------+-------------------------+   I need this query to finish in seconds, not minutes. Also, I'm worried about scalability. I have 40,000 unique urls that are waiting to be added to the index, so how do I take that into consideration with my table and query design? 400,000 urls?  Just a couple notes about my decisions on the current table structure.  I have no intention of stopping at 400,000 urls, but perhaps bigint(20) is a bit overzealous?   Url as text is for more practical reasons. I index a lot of Asian and other foreign language domains which do not appear as their equivalent Kanji or other characters in the database and frequently take more than 255 characters.  I'm using MySQL. I'm definitely open to suggestions as to better table and query design. Please let me know if I can provide more information. Hypernym for “import” and “export”? What word could describe an operation of either importing or exporting?  X is to import and export as migration is to immigration and emigration.  Porting isn't the word I'm looking for, I don't think, but that's what I'm getting at. Cheers! Who took care of Naruto when he was young? In episode 350, we see that the Third Hokage took on to take care of Naruto. But towards the beginning of the anime Naruto is seen to be living alone.   Did Naruto live with the Third? If so, why did he leave there? Javascipt component not coming render as pdf How can I prove these statements? UIDatePicker show only month and day I'd like to have a UIDatePicker where the user can pick a month and a day but not the year. I'm aware that leap years have an extra day, so for simplicity, let's throw that day away.  Is there any way to remove the year column or have 2 reels with month/day that act like the UIDatePicker (grey out days that don't exist in the selected month)? P.d.f of the absolute value of a normally distributed variable I came across this question as an exercise, had a brief idea, but didn't know how to proceed.     Let $X \sim N(0, 1)$. What is the p.d.f of $|X|$ ?   I know the final p.d.f looks just like the right half of the original pdf, but extended vertically for a factor of 2.  Could someone please show mathematically what the p.d.f of variable |X| is going to be, and explain briefly? Thank you. Does creating an object using reflection rather than calling the class constructor result in any significant performance differences? Genes and Intelligence Assuming that intelligence has a genetic component,   • do we know which genes contribute to it?   and, if so,  • can we predict intelligence from genomic analysis? How do the Goodman-Kruskal gamma and the Kendall tau or Spearman rho correlations compare? In my work, we are comparing predicted rankings versus true rankings for some sets of data. Up until recently, we've been using Kendall-Tau alone. A group working on a similar project suggested we try to use the  instead, and that they preferred it. I was wondering what the differences between the different rank correlation algorithms were.  The best I've found was , which claims Spearman is used in place of usual linear correlations, and that Kendall-Tau is less direct and more closely resembles Goodman-Kruskal Gamma. The data I'm working with doesn't seem to have any obvious linear correlations, and the data is heavily skewed and non-normal.  Also, Spearman generally reports higher correlation than Kendall-Tau for our data, and I was wondering what that says about the data specifically. I'm not a statistician, so some of the papers I'm reading on these things just seem like jargon to me, sorry. I don't know about you, but to me happens a lot: if I'm reading a question with a LOT of answers, (specially in a really specific question) I just read the most voted up: that's the way the system was made to be, and it's really good. The most relevant voted by the community are the first ones.  Since we have TOO many users, and a lot of them are reading the same questions and answering them almost at the same time, do you think the "urge" to be the first to answer a question and so gain reputation points makes people sometimes write things too fast and not try to really elaborate a really helpful answer? We may think: "people aren't going to read all answers, so I need to be really concerned about how fast I'm to answer". Are we incentivating "objective answers", or "not so good but objective and good to be voted up"?  I'm not trying to be unfair with all answers people here provide, we have really good ones here. But supose what I wrote above is a reality: what you think it would happen if it was a "time delay" between an "up-vote or down-vote" and it's sum in the answer? Summarizing: what if the sum wasn't almost "real time"? I have a population of phone calls - 200,000.  There are different reasons for each call, but lets assume the number of reasons is known. i.e. 7 different call reasons: 1) Check on order 2) Cancel order 3) Billing information 4) Account information etc...  My question is, I want to get a statistically significant sample size so the number of calls I listen to in my sample are representative of the distribution of the reasons in the overall population of 200,000 calls.  What should the sample size be? Which methods to use to calculate the sample size? After lethal first strike damage to an indestructible creature, will it still do damage? If I were to attack with a 4/4 indestructible creature and it's blocked by a 4/2 creature with first strike, would my indestructible creature still attack during the second combat damage step, or would it just tap, not assigning any damage? I'm trying to include a link to some code on OneDrive; the link includes an underscore, which is causing a lot of trouble.  I tried adding the entry like this:  @misc{code,     title = {Code},     url = {https://1drv.ms/link_link} }   I use \usepackage{url} and \bibliographystyle{IEEEtran}. Everything compiles fine and the bibliography shows the correct entry. However, if you click the link, it opens a page at https://1drv.ms/link - so ignoring the underscore and everything after it, which leads to a wrong page. Even copy and paste from the PDF doesn't work since the underscore is copied as space, which again is a broken link.  How can I add the link such that it can be clicked and copied properly? I tried \_, \usepackage{underscore}, {{link}}, different bibtex entries but nothing worked. Also all the related questions/answers don't answer mine. Help, i tried installing kaltools and my Ubuntu is messed up! I tried installing Kali Linux tools.  I started installing some tools and there were several things I had to "agree" to and one message said add users... something in terminal, and when I came back I saw terminal reporting removing a bunch of core programs that I needed. I canceled the process but I don't know if I should reinstall Ubuntu or not.  How can I repair my system? newenvironment: error with \begin{align} and \end{align} In the example below, an error is caused by \begin{align} and \end{align} but I do not see why:  \documentclass{book} \usepackage{amsmath} \newenvironment{subalign}{\begin{subequations}\begin{align}}{\end{align}\end{subequations}} \begin{document} \begin{subalign}      a&amp;=b\\     &amp;=b \end{subalign} \end{document} Differences between "however", "although","albeit", etc