Here is a strange situation. Following code works perfectly if I run it as is, but if I comment the first CHARINDEX line, it throws an error.  Msg 536, Level 16, State 4, Line 1 Invalid length parameter passed to the RIGHT function.  SELECT  DT.DataID ,RIGHT(K.IniValue, LEN( K.IniValue ) - 15) --error if you comment the next line  ,CHARINDEX('}',SUBSTRING(K.IniValue,CHARINDEX('ExtShared',K.IniValue) + 12,LEN(K.IniValue))) AS LastPosition   ,REPLACE( CONCAT( REPLACE( RIGHT(K.IniValue, LEN( K.IniValue ) - 15), '''}', '' ), SUBSTRING( P.providerData, CHARINDEX( '''providerInfo''=''', P.providerData ) + 16, CHARINDEX( ''',''storage', P.providerData ) - ( CHARINDEX( '''providerInfo''=''', P.providerData ) + 16 ))), '\\', '\' )  FROM llprod.DTreeCore AS DT INNER JOIN llprod.DVersData AS DV ON DV.DocID = DT.DataID AND DT.VersionNum = DV.Version INNER JOIN llprod.ProviderData AS P ON DV.ProviderId = P.providerID INNER JOIN llprod.KIni AS K ON K.IniKeyword = P.providerType --WHERE ( k.IniValue LIKE '%{%' and K.IniValue LIKE '%}%' AND k.IniValue LIKE '%ExtShared%') WHERE DT.DataiD = 123456 OPTION (RECOMPILE)
Something very odd is happening here.   I have a query that looks like this.  SELECT CAST(FT.DOP AS SMALLINT) FROM TRACKING_DATA WHERE date &gt; @mydate and identifier = 0000000000   When run as a raw query it returns data just fine.  When i place it in a stored procedure that alters the where clause it throws this error.  Msg 244, Level 16, State 2, Procedure myprocedure, Line 107 [Batch Start Line 2] The conversion of the varchar value '58629' overflowed an INT2 column. Use a larger integer column.   So here is the oddity. I go through all the possible data for that where clause with a query like this.  SELECT DISTINCT DOP FROM TRACKING_DATA where identifier = 000000000000   and  SELECT DISTINCT CAST(DOP AS smallint) FROM TRACKING_DATA where identifier = 000000000000   And this is what i get back.  17 12 9 19 8 14 6 16 11 13 7 10 0 18 5 15 4   Nowhere does it have anything remotely too large for a SMALLINT. So i thought, ok maybe its a non-printable ASCII character. But i can't find any.  I'm a little perplexed at the moment. It runs find as a raw query, explodes as a procedure and all possible data based on the where is valid. My only suspicion is that the query plan is doing something odd with filtering or maybe runs with different validation when run as a procedure.
Changing trains in Lille - what's the transfer with luggage between Lille Europe and Lille Flanders stations like? Lille has two main train stations, Lille Europe and Lille Flanders. (Gare de Marchandises Saint-Saveur is no longer a station, and instead hosts art exhibitions and the like). Lille Europe is the new station on the high speed lines between London / Paris / Brussels, while Lille Flanders is the original station now used for a mixture of local and high speed trains.  For some rail journeys, changing trains in Lille is the best option (avoiding having to cross Paris to change trains), and for others it's the only option. Sometimes you get lucky and both trains use the same station in Lille, but not all.  For the cases when you find yourself needing to change between Lille Flanders and Lille Europe stations, what's the connection like? Does it take long? Is it outside / inside? Is it a faff with luggage, or is there a step-free route for most of it? Are you best to walk, or take public transport? And a lower concern, is there anything interesting to see of the town during the transfer? Ubuntu does not offers me "install alongside Windows" Any of the partitions makes in Windows was not recognised by Ubuntu, or Zorin OS, or LinuxMint. It's like a blank hard disc, 250 gb free. I'm a new Linux user, but what confuses me is that I was able to install Ubuntu alongside Windows on my laptop with no problems, but on PC... no way! I need to view the saved WiFi passwords on my non-rooted Android phone I have an LG Optimus 7 (not-rooted), and all my WiFi passwords are there. I want to view the saved WiFi passwords to transfer thm to my new Samsung Galaxy S3, but I don't know how.  I tried to search on the Internet and Google play for an application that would allow me to view this information, but I can't find one. Is there any way for me to accomplish this? Is my way of solving and my answer correct?  Let $f(x)=x+\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{4}+\frac{x^5}{5}$   And $g(x)=f^{-1}(x)$  Find $g'''(0)$  My attempt:  We know that $g'(x)=\frac{1}{f'(g(x))}$  $f'(x)=1+x+x^2+x^3+x^4=\frac{x^5-1}{x-1}$  $f'(g(x))=\frac{(g(x))^5-1}{(g(x))-1}$  $\Rightarrow g'(x)=\frac{(g(x))-1}{(g(x))^5-1}$  $\Rightarrow g'(x)[(g(x))^5-1]=g(x)-1$  Similarly differentiating again,  $\Rightarrow g'(x)[5(g(x))^4]+[(g(x))^5-1]g''(x)=g'(x)$  Similarly differentiating again,  $\Rightarrow g'(x)[20(g(x))^3g'(x)]+[5(g(x))^4]g''(x)+[(g(x))^5-1]g'''(x)+g''(x)[5(g(x))^4]=g''(x)$  Putting $x=0$,  $g(0)=f^{-1}(0)=0$  $g'(0)=\frac{1}{f'(g(0))}=\frac{1}{f'(0)}=1$  similarly,$g''(0)=-1$  $\Rightarrow g'''(0)=1$ How can I reset my Ability Points? I'm also curious about being able to reset my points, should I wish to change my ability configuration later.  So far (10h-ish) I've only seen one way, which is a potion sold by Kiera Metz for 1000g. However she's no longer available as a store, due to a story choice, so I'm not sure where else I could buy this potion.  Where might I buy this potion, and is it the only way to reset your ability points? UV coordinates on a deformed plane Use #ifdefs and #define to optionally turn a function call into a comment Is it possible to do something like this  #ifdef SOMETHING #define foo // #else #define foo MyFunction #endif   The idea is that if SOMETHING is defined, then calls to foo(...) become comments (or something that doesn't get evaluated or compiled), otherwise it becomes a call to MyFunction.  I've seen __noop used, but I don't believe I can use that.  EDIT(s):  I don't think I can really use a macro here, because MyFunction takes a variable number of arguments.  Also, I'd like to make it so the arguments are NOT evaluated!  (So doing something like commenting out the body of MyFunction doesn't really give me what I need, as the arguments will still be evaluated) What computer components are currently vulnerable to magnets? When I first started using computers, law of the land in computer class was never bring magnets near anything computer related, lest you lose all your data or screw up your monitor.  Now I am pretty sure magnets will still royally mess up a standard hard drive, and I know for a fact they screw up a CRT monitor.  Though I am also pretty sure they do not screw up a LCD monitor?  Now I have my phone which uses magnets to determine if it's docked, and it made me wonder.  Is it the power of the magnet preventing data loss or the sheer fact that whatever memory type in the phone is immune to it?  What about ear buds, as I know those have tiny magnets in them. Are those capable of damaging any electronic device currently in use?  I'm wondering if I'm being paranoid, but I really am not sure what magnets will damage and what they won't!  Is there a list, or rule of thumb for determining what will be hurt by magnets and what won't be? I've always been taught to put myself last when referring to myself in the same sentence as others but the usage of "me and..." seems to be everywhere these days. The misuse of the word "me" instead of "I" aside, is there some new rule I haven't heard of? Shouldn't we put ourselves last regardless of the "me"/"I" usage?  Examples of "correct" usage:      My friends and I went for some ice   cream. Did you see my friends and me   at the ice cream stand?   Examples of "incorrect" usage:     Me and my friends went for some ice   cream. Did you see me and my friends   at the ice cream stand?   Note: I was also taught that the only person who could put themselves first was the queen. I want to be able to  write the following in LaTeX      We make the further assumption that \begin{equation} \label{eqn:assumption} There is a bounded linear operator     $B:X\to X^*$ such that $B^*=B$ and the operator $JB$ is an extension of $T'(0)$\end{equation}   and get a nice output, in such a way that this whole chunk of text along with the math can be referenced later. Of course I can write text inside the equation environment using \text{}, but when I tried this the spacing was all wrong. Can anyone suggest a solution to this? Non-Metrizable Topological Spaces How do rich people guarantee the safety of their money, when savings exceed the FDIC limit? I am curious how a millionaire would guarantee the safety of his money, given that the FDIC only insures up to $250K of an individual's deposits at a bank.  If someone had $3 million that they wanted to put into the bank, would they have to open up 12 different bank accounts and deposit $250K into each one, so that all of his money is insured by the FDIC?  Or is there an easier way to guarantee the safety of all his money? How to highlight source code in HTML? I want to highlight C/C++/Java/C# etc source codes in my website.  How can I do this?  Is it a CPU intensive job to highlight the source code? Inserting newlines in Rectangle Text elements via ArcPy causes overlap? I ran across an issue the other day when I tried to use ArcPy's mapping module to edit rectangle text elements with newlines (\n) in an ArcMap document.  Here's what the output looked like:    Here's the code I used to generate that output.  The first column are rectangle text elements Text1, Text2, Text3 going down; the second column are "plain" text elements Text4, Text5, and Text6 going down.  import os import arcpy  HomeDir = r"C:\Desktop" arcpy.env.workspace = HomeDir  CurrentMXD = arcpy.mapping.MapDocument(r"C:\Desktop\TextTest.mxd") OutputFilename = r"C:\Desktop\TextTest.pdf" if os.path.exists(OutputFilename):     os.remove(OutputFilename)  for TextElement in arcpy.mapping.ListLayoutElements(CurrentMXD, "TEXT_ELEMENT"):     TextElementName = TextElement.name      String1 = "The quick brown fox jumped over the lazy dog.\nShe sells sea shells by the sea shore."     String2 = "The quick brown fox \njumped over the lazy dog.\nShe sells sea shells by the sea shore."     String3 = "The quick brown fox jumped \nover the lazy dog.\nShe sells sea shells by the sea shore."      if TextElementName == "Text1":         TextElement.text = String1     if TextElementName == "Text2":         TextElement.text = String2      if TextElementName == "Text3":         TextElement.text = String3     if TextElementName == "Text4":         TextElement.text = String1     if TextElementName == "Text5":         TextElement.text = String2     if TextElementName == "Text6":         TextElement.text = String3  arcpy.mapping.ExportToPDF(CurrentMXD, OutputFilename)   So far, it looks like the presence of the messed up text depends on whether the line is longer enough to wrap, and whether the line before the newline is longer than the line after the newline.  Any ideas about what could be going wrong?  Is there a workaround?  I could use plain text elements and worry about wrapping lines using Python, but I'm hoping I can figure something out. Why can't I move a window to the top left corner with wmctrl in Unity? I've been playing around with wmctrl to take more control of my windows. I've encountered a weird behaviour where Unity reserves double the space. See this screen shot:    I opened the terminal and moved the window using the top command. It should be at the top left corner (X=0 Y=0). But for some reason there is some margin between the terminal and the Unity bars.  If I understand the man pages correctly it might have something to do with the WA: 65,24.  Can anybody help me to fix this? Methods to work around the problem of missing data in machine learning Virtually any database we want to make predictions using machine learning algorithms will find missing values ​​for some of the characteristics.  There are several approaches to address this problem, to exclude lines that have missing values ​​until they fill with the mean values ​​of the characteristics.  I would like to use for a somewhat more robust approach, which would basically run a regression (or another method) where the dependent variable (Y) would be each of the columns that have missing values ​​but only with the rows of the table that contain all the data , and predict the missing values ​​with this method, complete the table by the table and move to the next 'column' with missing values ​​and repeat the method until everything is filled.  But that gives me some doubts.  Why any column start? I believe that the one with the smallest missing values ​​until the one with the most  Is there any threshold of missing values ​​that is not worth trying to complete it? (for example, if this characteristic only has 10% of the values ​​filled would not it be more interesting to exclude it)  Is there any kind of implementation in traditional packages or other methods that are robust to missings? How to sanity check a date in Java Is there an efficient method of converting an integer into the written numbers, for example:  string Written = IntegerToWritten(21);   would return "Twenty One".  Is there any way of doing this that doesn't involve a massive look-up table? What's the terminal command for finding out a process's id I want to exit a process using the command line, but I can't recall the command to look up the process's ID.  Does anyone know it? Who is / was the "Lord of the Rings"? Who is the Lord, as referred to in the title? Frodo? Sauron? Someone else? Or is it more of an abstract title, not referring to a single person, like "He who wields the One Ring"?