I have a problem, I am uploading employee code and Account Number from excel(.csv) file, and I will check the employee code and update or insert the Account Number for the corresponding Employee Code. But If the employee code is start with "0" csv file will not consider the 0's and just send the remaining character, so when I check it in sql will not match with table data (Employee Code).  I have a plan to match them, but I don't know how to do.  I have Tried Below Query  declare @EmployeeCodeNET varchar(max)='MJ300';  declare @EmployeeCodeDB varchar(max)='00MJ300';   select LTRIM(REPLACE(@EmployeeCodeDB, '0', ''))--It should return 'MJ300'
I am working on a SQL query that reads from a SQLServer database to produce an extract file. One of the  requirements to remove the leading zeroes from a particular field, which is a simple VARCHAR(10) field. So, for example, if the field contains '00001A', the SELECT statement needs to return the data as '1A'.  Is there a way in SQL to easily remove the leading zeroes in this way? I know there is an RTRIM function, but this seems only to remove spaces.
multiple Open Drain UART over long distance I have 9 microcontrollers  and I have connected the RX and TX lines of 8 of them in parallel. My configuration is in master-slave. The master microcontroller send data to one of the 8 RX lines but only one of them can respond at a time. The cable length is about 3 to 5 metres between each node.  I have two questions. My test was done with 2 slaves instead of 8. UART at 9600bps.  If I setup the TX lines of the slaves as Open Drain it works fine, but the signal doesn't have steep ramps. I thought this happens due to Pull-up resistors. And I also think that is going to be better with 8 slaves on the bus, right?  Why doesn't that topology work if the TX lines of the slaves are not Open Drain?  I managed to make it work by disabling the transmit of the UART in all of them except one, and it worked fine. I had two slaves, so I disabled the one and left the other. Also I noticed that the edges of the signal was sharper. Why are they sharper in that case?  Regarding resistors: The value of the resistors for both RX and TX lines are 2.7KΩ. However the Open Drain topology would parallel the internal pull-up resistors. According to the datasheet that resistor is about 20KΩ at minimum. So, using a 2.7KΩ in the output would give us a total resistance of 2.52KΩ (20+2.7)/9. And the Open Drain would make a voltage divider 2.52KΩ + 2.7KΩ (Schematic 2). Which means with 8 slaves and Open Drain topology the signal will not go lower than 1V which is the threshold of the low level. Is that correct?  Wouldn't it be better to disable all the internal pull up resistors and place two (let's say: 4.7KΩ) only at the master side?  Distance: What is the maximum baud rate for such distance? I'm a little worried about the signal integrity. The test was done with 9600bps but I didn't notice any significant difference in 4800bps. The distortion of the signal didn't have a difference.  Voltage values are 3.3V for the UART bus.  Schematic 1. (all resistors are 2.7KΩ)        &ndash; Schematic created using   Schematic 2. (U4, U5, U6, U7, and U8 are omitted for simplicity).          EDIT: Thank you all very much about your answers so far. I wanted to point out that this is a question about UART only. I am not looking for alternative solutions. I'm just trying to find some answers about the above implementation.  EDIT2: Thank you very much for your answers! I ended up modifying a little my schematic. I disabled the internal pullup resistors of the microcontrollers and I placed external ones at the master's board. Their value would be around 1 KOhm to 3 KOhm. I have to do some tests more to decide the final value. I also replaced all series resistors with 130 Ohm.   I tested 5 slaves over 20 metre cable (with pullup 3 KOhm and 130 Ohm series resistors) and it worked fine.   Would it be better to add open drain/open collector line drivers on every TX lines? What is a Windows Handle? Simulating Key Press C# How would you explain covariance to someone who understands only the mean? ...assuming that I'm able to augment their knowledge about variance in an intuitive fashion (  ) or by saying: It's the average distance of the data values from the 'mean' - and since variance is in square units, we take the square root to keep the units same and that is called standard deviation.  Let's assume this much is articulated and (hopefully) understood by the 'receiver'. Now what is covariance and how would one explain it in simple English without the use of any mathematical terms/formulae? (I.e., intuitive explanation. ;)  Please note: I do know the formulae and the math behind the concept. I want to be able to 'explain' the same in an easy to understand fashion, without including the math; i.e., what does 'covariance' even mean? Evaluating the double limit $\lim_{m \to \infty} \lim_{n \to \infty} \cos^{2m}(n! \pi x)$ I have to find out the following limit $$\lim_{m\to\infty}\lim_{n\to\infty}[\cos(n!πx)^{2m}]$$ for $x$ rational and irrational. for $x$ rational $x$ can be written as $\frac{p}{q}$ and as $n!$ will have $q$ as its factor the limit should be equal to 1. the second part of irrational is giving me problems. I first thought that limit should be zero as absolute value of cosine term is less than 1 and power it to infinity you should get $0$. But then I realised that it was wrong. I brought the limit down to this form. $$e^{-\sin^2(n!πx)m}$$ after this I find the question quite ambiguous as they have just said $x$ is irrational. If I take $x$ as $\frac{1}{n!π\sqrt{m}}$ I get the limit as $\frac{1}{e}$ but if I take  $x$ as $\frac{2}{n!π\sqrt{m}}$ I get the limit as $\frac{1}{e^4}$. please help me and tell me where have I gone wrong? Oversized \underbrace's label causes unwanted spacing Consider this:  \left( x-1 \right) \underbrace{ \left( ? \right) }_{ \text{what is this?} }   The label is longer than the braced portion, which causes unwanted space between the parentheses.  Is there a way around that, so that the parentheses "touch" as they would normally?  Please note that I just started on LaTeX, and I'm using TexMaths inside LibreOffice Writer. Where did the world go? I was playing on my main world when my laptop ran out of power.  I found a charger and woke it up, but Minecraft had crashed.  Now, it doesn't appear in the world selection screen!  I have verified that it still exists in the Minecraft folder, and the directory contents look to be in order.  Does Minecraft save an internal flag somewhere when it crashes hard?  If so, how do I reset it? Where will my bus be at the Port Authority Bus Terminal in New York? There is no smallest rational number greater than 2 I have a problem that I am seriously stuck on. I'm not sure what to do I've seen similar proofs online with the least positive rational number but this is apparently different and I'm not sure why.     Prove the statement “There is no smallest rational number greater than 2” by contradiction. Automatically resize uploaded images Possible Duplicate:             Could large images of more then 640 pixels wide automatically be resized to reduce loading time and band width use? Not that I have a prehistoric internet connection here, but sometimes pages seem to need unnecessary time to load fully.  I just resized the image  from 179 kb down to 32 kb using a 15% compression rate. I think that is already worth it, although there have been much bigger downsizes in the past.  This feature then propably should/could be combined with , and uploading an image then would result in the following post addition:  [![enter image description here][2]][1]  [1]: http://i.stack.imgur.com/ZSBxw.gif "View &lt;image title&gt; full sized" [2]: http://i.stack.imgur.com/VXmBA.jpg "&lt;Image title&gt;"   Update:  I now understand from  that images áre resized already, but that post authors have to do some changes themselves. Could it then be automated to add the already resized image (that with the l suffix):  [![enter image description here][2]][1]  [1]: http://i.stack.imgur.com/ZSBxw.gif "View &lt;image title&gt; full sized" [2]: http://i.stack.imgur.com/ZSBxwl.jpg "&lt;Image title&gt;" The most efficient way to implement an integer based power function pow(int, int) Cyclic vector implies commuting linear operator is a polynomial Let $T$ be a linear operator on the finite dimensional vector space $V$. Suppose $T$ has a cyclic vector. Prove that if $U$ is any linear operator which commutes with $T$, then $U$ is a polynomial in $T$. Could I use a 1/2TB USB 2/3 external HDD with an XBox 360? I'm considering getting an XBox 360 (plus Kinect). I need storage for other devices as well (movies, PC games, whatever an Ouya might need), so I'm considering getting a big external HDD. Can I store downloaded games (e.g. Fez) on such a device? File has different name in terminal and Finder I've just downloaded the driver for my preferred trackball from Logitech. In the Finder, the Installer's filename is Logitech Control Center Installer.app. In the Terminal, ls shows LCC Installer.app. How did this happen? How do I disable the alt-right click keyboard binding? $\lim\limits_{n \to{+}\infty}{\sqrt[n]{n!}}$ is infinite How do I prove that $ \displaystyle\lim_{n \to{+}\infty}{\sqrt[n]{n!}}$ is infinite? Could "them" mean "those"? On main and in the old mobile site (iirc) the username of the OP is highlighted in the comments.  This is no longer the case after the new design/theme was rolled out yesterday.  Can we get this back? I have county data in which the &quot;FIP&quot;s (actually State &quot;FIP&quot;s and County &quot;FIP&quot;s combined). I have data imported as CSV with the sames &quot;FIP&quot;s data titled 'STCounty'. However, the shapefile &quot;FIP&quot;s is listed as a Real and the CSV came in as an Integer and the Join function does not seem to work.  The drop boxes are greyed out/empty. So the bigger questions is how do you change the attribute type in a table? I tried to create a new column in the shapefile (county data) and set it to an integer and then multiply the &quot;FIP&quot;s*1, but got a column full of NULL. I am new to QGIS and have a lot of experience in MapInfo, so the join concept is not new to me, just the syntax in QGIS. Can I switch the alt and ctrl keys on my keyboard?