1/ Sometime you write       ALTER DATABASE [MyDb] COLLATE SQL_Latin1_General_CP1_CI_AS   after a moment, if you try        ALTER DATABASE [MyDb] COLLATE FRENCH_CI_AS   it may not succeed. why this?  2/ if table1 is SQL_Latin1_General_CP1_CI_AS and if table2 is FRENCH_CI_AS one cannot write ...where table1.field1= table2.field2  What is the consequence of COLLATE in a database or table ?
I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect?  I'm asking for an explanation of the two and how to choose them.
mysql select from n last rows I have a table with index (autoincrement) and integer value. The table is millions of rows long.  How can I search if a certain number appear in the last n rows of the table most efficiently? Let $a,b$ be positive integers such that $a\mid b^2 , b^2\mid a^3 , a^3\mid b^4 \ldots$ so on , then $a=b$? Let $a,b$ be positive integers such that $a\mid b^2 , b^2\mid a^3 , a^3\mid b^4 \ldots$ that is $a^{2n-1}\mid b^{2n} ; b^{2n}\mid a^{2n+1} , \forall n \in \mathbb Z^+$ , then is it true that $a=b$ ? How to allocate aligned memory only using the standard library? I just finished a test as part of a job interview, and one question stumped me, even using Google for reference. I'd like to see what the StackOverflow crew can do with it:  The memset_16aligned function requires a 16-byte aligned pointer passed to it, or it will crash. a) How would you allocate 1024 bytes of memory, and align it to a 16 byte boundary? b) Free the memory after the memset_16aligned has executed.  {        void *mem;    void *ptr;     // answer a) here     memset_16aligned(ptr, 0, 1024);     // answer b) here     } Minimal $ab$ for Rational Number $a/b$ in an Interval Given rational numbers $L$ and $U$, $0&lt;L&lt;U&lt;1$, find rational number $M=a/b$ such that $L \le M&lt;U$ and $(a\times b)$ is as small as possible---$a$ and $b$ are integers. For example,    If $L=66/101$ and $U=19/29$ then $M=17/26$. If $L=66/101$ and $U=19/28$ then $M=2/3$.   Right now I'm using a naive search that is exponential in complexity. Is there a better method?  If it is of any help, it can be assumed the prime factorization of numerator and denominator of $U$ and $L$ are known. Prove that $\prod_{k=1}^{n-1}\sin\frac{k \pi}{n} = \frac{n}{2^{n-1}}$ Using $\text{n}^{\text{th}}$ root of unity  $$\large\left(e^{\frac{2ki\pi}{n}}\right)^{n} = 1$$  Prove that   $$\prod_{k=1}^{n-1}\sin\frac{k \pi}{n} = \frac{n}{2^{n-1}}$$ My actual question is to find the number of transversal given a collection of set ...  After a little bit of study it has come down to:  How can we count the number of matchings in a bipartite graph with parts of size $m$ and $n$ such that it covers all $m$ vertices of the first part, $m \le n$?  I already know that there is a way to count the number of perfect matchings in a bipartite graph with $m=n$ using the permanent of its (square) incidence matrix. Why don't you have to press CTRL+ALT+DEL to logon anymore in Windows 8? In previous versions of Windows, you had to press Ctrl + Alt + Delete to logon, or to unlock a locked workstation.  This was because this key sequence was recognized only by the OS and thus other software couldn't intercept it and display a spoofed logon screen to capture passwords.  Starting with Windows 8, you now just have to press Enter to get to the logon screen.  What is to stop someone from writing a fake logon screen?  Did Windows 8 add some sort of new security mechanism to mitigate this security issue? Levels or First Differences, VECM or VAR for Ultimate Impulse Response Functions? My final goal is to generate Impulse Response Functions in R.  I have variables that are non stationary when I set k = 5 in a Unit Root test, and they are cointegrated which to my understanding prompts the use of the VECM, from which the Vec2Var argument is used to then generate IRFs. However, my response functions from this methodology do not decay over time and mostly do not revert to the zero line.  Furthermore, I noticed that when I input first differenced variables into the VECM as opposed to level data above, response function do revert to the zero line. Therefore my first question is: 1) is it appropriate to use differenced variables in a VECM model?  Secondly, as an alternative I am considering restricting the number of lags used in the Unit Root tests so that the variables are not all non-stationary; in this case 2) would the use of VECM be void and the VAR with first differences be a more appropriate model? Again, using differenced data is giving me better response functions that revert to zero in the long run. However, 3) is it ok to use the VAR for stationary/non-stationary data in levels where these variables are still cointegrated?  Also, I am using growth rate variables, 4) should I still long transform all variables and use logs in all tests?  Thank you for the help! ImportError: No module named dbus I was trying to update my Python and messed up my whole system.   I am currently now able to start my Software Centre. I tried Googling multiple fixes but nothing helped. My Software Centre can't start.   When I try starting it up, this error shows:  astephen@localhost:/usr/bin$ ./software-centerGtk-Message: Failed to load module "gtk-vector-screenshot" Traceback (most recent call last): File "./software-center", line 36, in &lt;module&gt; from softwarecenter.utils import ( File "/usr/share/software-center/softwarecenter/utils.py", line 19, in &lt;module&gt; import dbus ImportError: No module named dbus   I tried reinstalling dbus using:  apt-get install --reinstall dbus   But it did not help.  astephen@localhost:/usr/bin$ sudo apt-get install --reinstall dbusReading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not      upgraded. Need to get 0 B/231 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 676272 files and directories currently installed.) Preparing to unpack .../dbus_1.6.18-0ubuntu4.3_amd64.deb ... Unpacking dbus (1.6.18-0ubuntu4.3) over (1.6.18-0ubuntu4.3) ... Processing triggers for ureadahead (0.100.0-16) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting up dbus (1.6.18-0ubuntu4.3) ... Parallelize Bash script with maximum number of processes Lets say I have a loop in Bash:  for foo in `some-command` do    do-something $foo done   do-something is cpu bound and I have a nice shiny 4 core processor. I'd like to be able to run up to 4 do-something's at once.  The naive approach seems to be:  for foo in `some-command` do    do-something $foo &amp; done   This will run all do-somethings at once, but there are a couple downsides, mainly that do-something may also have some significant I/O which performing all at once might slow down a bit. The other problem is that this code block returns immediately, so no way to do other work when all the do-somethings are finished.  How would you write this loop so there are always X do-somethings running at once? My site has 30,000 visits with 86,000 page views. If the bounce rate of 54%, then does it means only 15,000 users generated the 86,000 page views or 30,000 visits generated the 86,000 page views.  My website is www.cricandcric.com  Even though I have got 86,000 page views, my site's Alexa ranking is still getting worse day by day. How do I control that? Determinant of circulant matrix Find the determinant of the following matrix in the terms of $a_1,a_2,\cdots,a_n$ explicitly, $$ \begin{bmatrix} a_1 &amp; a_2 &amp; a_3 &amp; \cdots &amp; a_n\\ a_2 &amp; a_3 &amp; a_4 &amp; \cdots &amp; a_1\\ a_3 &amp; a_4 &amp; a_5 &amp; \cdots &amp; a_2\\ \vdots &amp; \vdots &amp; \vdots &amp; \ddots &amp; \vdots\\ a_n &amp; a_1 &amp; a_2 &amp; \cdots &amp; a_{n-1}\\ \end{bmatrix} $$ When the determinant is zero? Recursively delete empty directories in Windows Is $\int_a^b f(x) dx = \int_{f(a)}^{f(b)} f^{-1}(x) dx$? Storage order vs Result order This is a spin-off question from .   says this on the subject of storage order (clustered index) and the output order     A lot of people believe that a clustered index guarantees a sort order on output. But that's not what it does; it guarantees a storage order on disk.   See, for example, .   I've read the blog post by Hugo Kornelis and understands that an index doesn't guarantee that the sql server reads the records in a specific order. Yet I have a hard time accepting that I can't assume this for my scenario?  CREATE TABLE [dbo].[SensorValues](   [DeviceId] [int] NOT NULL,   [SensorId] [int] NOT NULL,   [SensorValue] [int] NOT NULL,   [Date] [int] NOT NULL, CONSTRAINT [PK_SensorValues] PRIMARY KEY CLUSTERED  (   [DeviceId] ASC,   [SensorId] ASC,   [Date] DESC ) WITH (     FILLFACTOR=75,     DATA_COMPRESSION = PAGE,     PAD_INDEX = OFF,     STATISTICS_NORECOMPUTE = OFF,     SORT_IN_TEMPDB = OFF,     IGNORE_DUP_KEY = OFF,     ONLINE = OFF,     ALLOW_ROW_LOCKS = ON,     ALLOW_PAGE_LOCKS = ON)   ON [MyPartitioningScheme]([Date])   My original query was this:  SELECT TOP 1 SensorValue   FROM SensorValues   WHERE SensorId = 53     AND DeviceId = 3819     AND Date &lt; 1339225010   ORDER BY Date DESC   But I suggest that I could as well use this one (read below for my explanation):  SELECT TOP 1 SensorValue   FROM SensorValues   WHERE SensorId = 53     AND DeviceId = 3819     AND Date &lt; 1339225010   As you can see, my table rows are small (16bytes) and I've got only one index, a clustered. In my scenario, the table consists of 100.000.000 records at this moment (and this will most likely increase tenfold).  When the database server queries this table it has two ways of finding my rows, either it seeks the primary key and thereby reading and returning my values in desc. order of Date, or it has to do a full table scan. My conclusion is that a full table scan on all those records will be way too slow and the database server will therefore always seek the table via its primary key and thereby returning the values sorted by Date DESC How do I remove objects after building them, for example a fence that I placed without taking into account its orientation? I have right clicked on it like you would a structure but nothing happened. I have also tried Shift+Alt+Click and nothing has happened. I couldn't think of any other solutions as this is my first game. Review Queues and Ignored Tags Steps to Recreate:   Have enough rep to use some of the review queues. Ignore a popular tag. Go to your profile-> prefs-> check 'hide ignored tags'. Open a review queue.   You will get questions from your ignored tag(s) in the review queue.  Personally, I ignored a tag on Movies.SE (and Scifi.SE) for a film that is out elsewhere in the world, but not locally.  It's a simple way to avoid being exposed to spoilers.  I then load up the First Posts review queue on Movies.SE, and I get an answer to a question about the end of the film.  Can the review queues be altered to skip posts on your ignored tags when you have the 'hide ignored tags' option enabled? What book would you recommend for scientists who are not statisticians?  Clear delivery is most appreciated. As well as the explanation of the appropriate techniques and methods for typical tasks: time series analysis, presentation and aggregation of large data sets. I've got two tables:  TableA ------ ID, Name  TableB ------ ID, SomeColumn, TableA_ID (FK for TableA)   The relationship is one row of TableA - many of TableB.  Now, I want to see a result like this:  ID     Name      SomeColumn  1.     ABC       X, Y, Z (these are three different rows) 2.     MNO       R, S   This won't work (multiple results in a subquery):  SELECT ID,        Name,         (SELECT SomeColumn FROM TableB WHERE F_ID=TableA.ID) FROM TableA   This is a trivial problem if I do the processing on the client side. But this will mean I will have to run X queries on every page, where X is the number of results of TableA.   Note that I can't simply do a GROUP BY or something similar, as it will return multiple results for rows of TableA.   I'm not sure if a UDF, utilizing COALESCE or something similar might work? Changing password? I would like to change my password.  I have followed the instructions in  but I cannot find the "my logins" hyperlink.