Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?

Why do I see a double variable initialized to some value like 21.4 as 21.399999618530273?

double r = 11.631;double theta = 21.4;In the debugger, these are shown as 11.631000000000000 and 21.399999618530273.How can I avoid this? 1:These accuracy problems are due to the internal representation of floating point numbers and ther

Send and receive messages through NSNotificationCenter in Objective-C? [closed]

Send and receive messages through NSNotificationCenter in Objective-C? [closed]

I am attempting to send and receive messages through NSNotificationCenter in Objective-C. However, I haven't been able to find any examples on how to do this. How do you send and receive messages through NSNotificationCenter? 1:@implemen

Get escaped URL parameter

Get escaped URL parameter

I'm looking for a jQuery plugin that can get URL parameters, and support this search string without outputting the JavaScript error: "malformed URI sequence". If there isn't a jQuery plugin that supports this, I need to know how to modify i

Select rows from a DataFrame based on values in a column in pandas

Select rows from a DataFrame based on values in a column in pandas

How to select rows from a DataFrame based on values in some column in pandas?In SQL I would use: select * from table where colume_name = some_value. I tried to look at pandas documentation but did not immediately find the answer. 1:To se

Why does an overridden function in the derived class hide other overloads of the base class?

Why does an overridden function in the derived class hide other overloads of the base class?

Consider the code : #include class Base {public: virtual void gogo(int a){ printf(" Base :: gogo (int) \n"); }; virtual void gogo(int* a){ printf(" Base :: gogo (int*) \n"); };};class Derived : public Bas

C++: Which is the best method of checking for file existence on windows platform [duplicate]

C++: Which is the best method of checking for file existence on windows platform [duplicate]

Possible Duplicate: How can we check if a file Exists or not using Win32 program? Which is the best method for checking for file existence:Option1:GetFileAttributes("C:\\MyFile.txt"); // from winbase.hif(0xffffffff == GetFileAttributes("C

A more elegant way of escaping dynamic SQL?

A more elegant way of escaping dynamic SQL?

OK, so I've got this line of code in a search stored procedure:SET @where = 'job_code = ''' + REPLACE(@job_code, '''', '''''') + ''''and there are basically two operations I'd like to streamline -the first being surrounding the concate

objective C underscore property vs self

objective C underscore property vs self

I'm was playing around with the standard sample split view that gets created when you select a split view application in Xcode, and after adding a few fields i needed to add a few fields to display them in the detail view.and something inte

What is the default buffer size for StreamWriter

What is the default buffer size for StreamWriter

For the public StreamWriter(Stream stream) constructor, MSDN says Initializes a new instance of the StreamWriter class for the specified stream by using UTF-8 encoding and the default buffer size.I want to use one of the other constructo

Change PDF title in browser window

Change PDF title in browser window

I have a pdf file that I am putting on a website for a client. It is located here...http://www.optiphysicaltherapy.com/dev/wp-content/uploads/2014/02/OPTI_NewPatientForms.pdfThe title should be OPTI New Patient Forms but if you look at the

When to use addressof(x) instead of &x?

When to use addressof(x) instead of &x?

How do I decide whether I need addressof(x) instead of &x when taking the address of an object?Seems like the question was confusing, so a clarification is in order: addressof obviously bypasses the overloaded address-of operator. I'm alre

Rotated image coordinates after scipy.ndimage.interpolation.rotate?

Rotated image coordinates after scipy.ndimage.interpolation.rotate?

I have a numpy array for an image that I read in from a FITS file. I rotated it by N degrees using scipy.ndimage.interpolation.rotate. Then I want to figure out where some point (x,y) in the original non-rotated frame ends up in the rotated

Retrieve data from JSON file and display images in a gallery

Retrieve data from JSON file and display images in a gallery

I'm new to JQuery and any help would be much appreciated. "Using $.getJSON function, retrieve the data in the items.json file provided and display the images in a gallery below. The gallery should display each image at roughly thumbnail siz

Tomcat server absolute file access in war webapp

Tomcat server absolute file access in war webapp

I have a Spring webapp whose .war file has been uploaded to a Tomcat server. Most of the basic functions are working as intended - page views and form submission. My problem now is that my webapp needs to read and write files and I am cluel

Gitosis not updating server configuration after push of configuration changes

Gitosis not updating server configuration after push of configuration changes

I've set up gitosis using the tutorial privided at:http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-wayI found that I was unable to push and create a new repository after adding the appropriate permissions in the g

iOS Animated Bezier/Sine Curve

iOS Animated Bezier/Sine Curve

I am looking to animate a single-line bezier curve on a loop in iOS. The idea I have in my head resembles the Voice Control screen on the iPhone 4 before Siri. The curve does not need to react to anything ie. Audio, mic etc. It just needs t

D3 Tree Layout - Custom Vertical Layout when children exceed more than a certain number

D3 Tree Layout - Custom Vertical Layout when children exceed more than a certain number

I'm trying to use the D3 Tree Layout to create a family tree of sorts and one of the things I noticed is that when I have many children nodes, it would stretch out horizontally across the screen. Ideally I would like a more vertical layout

Android app resets on orientation change, best way to handle?

Android app resets on orientation change, best way to handle?

So I am making a basic chess app to play around with some various elements of android programming and so far I am learning a lot, but this time I am lost.When the orientation of the emulator changes the activity gets reset. Based on my rese

Converting Int to Float/Float to Int using Bitwise

Converting Int to Float/Float to Int using Bitwise

I was wondering if you could help explain the process on converting an integer to float, or a float to an integer. For my class, we are to do this using only bitwise operators, but I think a firm understanding on the casting from type to ty

Why does string extraction from a stream set the eof bit?

Why does string extraction from a stream set the eof bit?

Let's say we have a stream containing simply:helloNote that there's no extra \n at the end like there often is in a text file. Now, the following simple code shows that the eof bit is set on the stream after extracting a single std::string.

Performance overhead of using attributes in .NET

Performance overhead of using attributes in .NET

1.. Is there any performance overhead caused by the usage of attributes? Think for a class like: public class MyClass { int Count {get;set;} }where it has 10 attibutes (attributes being classes, where the attribute classes th

Markdown and XSS

Markdown and XSS

Ok, so I have been reading about markdown here on SO and elsewhere and the steps between user-input and the db are usually given as convert markdown to htmlsanitize html (w/whitelist)insert into databasebut to me it makes more sense to do t

Mixing nested type parameters and wildcards in Java

Mixing nested type parameters and wildcards in Java

Why does trying to compilepublic class GenericsFail { public static void main(String[] args) { accept(new HashMap>()); } public static void accept(Map> multiMap) {}}give the errorGenericsFail.java:7: error: method accept in

How to delete/truncate tables from Hadoop-Hive?

How to delete/truncate tables from Hadoop-Hive?

Please tell me how to delete table from hive and also tell from where i can get more information about hive queries. 1:You can use drop command to delete meta data and actual data from HDFS.And just to delete data and keep the table stru

Recommend a good javascript statistics library? [closed]

Recommend a good javascript statistics library? [closed]

Can anyone recommend a good javascript statistics library?Perhaps one recommendation per question, and let the votes push the best to the top. note: Searching for javascript statistics seems lead one towards attempts at gathering statistic