Which is the first integer that an IEEE 754 float is incapable of representing exactly?

For clarity, if I’m using a language that implements IEE 754 floats and I declare: float f0 = 0.f; float f1 = 1.f; …and then print them back out, I’ll get 0.0000 and 1.0000 – exactly. But IEEE 754 isn’t capable of representing all the numbers along the real line. Close to zero, the ‘gaps’ … Read more

Is there a good reason I see VARCHAR(255) used so often (as opposed to another length)?

In multiple courses, books, and jobs, I have seen text fields defined as VARCHAR(255) as kind of the default for “shortish” text. Is there any good reason that a length of 255 is chosen so often, other than being a nice round number? Is it a holdout from some time in the past when there … Read more

String was not recognized as a valid DateTime ” format dd/MM/yyyy”

I am trying to convert my string formatted value to date type with format dd/MM/yyyy. this.Text=”22/11/2009″; DateTime date = DateTime.Parse(this.Text); What is the problem ? It has a second override which asks for IFormatProvider. What is this? Do I need to pass this also? If Yes how to use it for this case? Edit What … Read more

Can pandas automatically read dates from a CSV file?

Today I was positively surprised by the fact that while reading data from a data file (for example) pandas is able to recognize types of values: df = pandas.read_csv(‘test.dat’, delimiter=r”\s+”, names=[‘col1′,’col2′,’col3’]) For example it can be checked in this way: for i, r in df.iterrows(): print type(r[‘col1’]), type(r[‘col2’]), type(r[‘col3’]) In particular integer, floats and strings … Read more