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

Escaping HTML strings with jQuery

Escaping HTML strings with jQuery

Does anyone know of an easy way to escape HTML from strings in jQuery? I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks). I'm sure it's po

Passing data between controllers in Angular JS?

Passing data between controllers in Angular JS?

I have a basic controller that displays my products,App.controller('ProductCtrl',function($scope,$productFactory){ $productFactory.get().success(function(data){ $scope.products = data; });});In my view I'm displaying this

How to send an object from one Android Activity to another using Intents?

How to send an object from one Android Activity to another using Intents?

How can I pass an object of a custom type from one Activity to another using the putExtra() method of the class Intent? 1:If you're just passing objects around then Parcelable was designed for this. It requires a little more effort to us

What is array decaying?

What is array decaying?

What is decaying of an array? Is there any relation to array pointers? 1:It's said that arrays "decay" into pointers. A C++ array declared as int numbers [5] cannot be re-pointed, i.e. you can't say numbers = 0x5a5aff23. More importantl

CSS classes in email [duplicate]

CSS classes in email [duplicate]

This question already has an answer here: What tools to automatically inline CSS style to create email HTML code? [closed] 12 answers As far as I know,

Replace the expand ( ▶) icon of HTML5 details tag

Replace the expand ( ▶) icon of HTML5 details tag

I use the tag in my website and I want to change the design of the expand/collapse arrows.Is it possible to set a picture instead of the existing characters?Is it possible to change the position of the arrows? I want it to be on the right

Freebase query for full topic summary

Freebase query for full topic summary

I'm trying to retrieve the full topic description/summary for some Freebase articles. I have been using the Freebase topic API, which returns this type of results: http://www.freebase.com/experimental/topic/standard?id=/en/jimi_hendrixBut I

Why do I need two SQL Server Service Broker queues for a simple task?

Why do I need two SQL Server Service Broker queues for a simple task?

All examples I find on the web for using SQL Server Service Broker queues seem to have two queues. I don't understand why and every example seems to assume that this is so obvious as to be unnecessary to explain.Several things will write to

Unity3D, round the edges of a box, cube?

Unity3D, round the edges of a box, cube?

What's the usual way to round the edges on a cube, a rectangular object as in the examples? The ideal result would look pretty much exactly like these images.(Naturally, you could literally use a mesh that has carefully rounded edges and co

Passing/Accessing props in stateless child component

Passing/Accessing props in stateless child component

I know you can pass all a react components props to it's child component like this:const ParentComponent = () => ( Parent Component )But how do you then retrieve those props if the child component is stateless? I know if it is

Xcode building and resources folders

Xcode building and resources folders

I have several resources in my iPhone app and when they get compiled they all get added to the root of the resources folder in the app regardless of the Xcode grouping structure. This is fine for most things, however there is a set of files

Inject App Settings using Windsor

Inject App Settings using Windsor

How can I inject the value of an appSettings entry (from app.config or web.config) into a service using the Windsor container? If I wanted to inject the value of a Windsor property into a service, I would do something like this: 666

System.Text.Encoding.GetEncoding(“iso-8859-1”) throws PlatformNotSupportedException?

System.Text.Encoding.GetEncoding(“iso-8859-1”) throws PlatformNotSupportedException?

See subject, note that this question only applies to the .NET compact framework. This happens on the emulators that ship with Windows Mobile 6 Professional SDK as well as on my English HTC Touch Pro (all .NET CF 3.5). iso-8859-1 stands for

How to obtain a list of titles of all Wikipedia articles

How to obtain a list of titles of all Wikipedia articles

I'd like to obtain a list of all the titles of all Wikipedia articles. I know there are two possible ways to get content from a Wikimedia powered wiki. One would be the API and the other one would be a database dump.I'd prefer not to downlo

Where can I safely store data files for a ClickOnce deployment?

Where can I safely store data files for a ClickOnce deployment?

I have been using ApplicationDeployment.CurrentDeployment.DataDirectory to store content downloaded by the client at runtime which is expected to be there every time the app launches, however now I've found this changes seemingly randomly i

Multiple WCF services referencing the same data contracts

Multiple WCF services referencing the same data contracts

I am building a set of WCF services that share common data contracts (or entities if you prefer). These are simple data transfer objects that are decorated with DataContract and DataMember attributes. I am explicitly specifying the name and

Maximum length for url in chrome browser

Maximum length for url in chrome browser

I have seen this popular question:What is the maximum length of a URL in different browsers?But since I couldn't find a reference to Google Chrome directly (and since most answers were given a few years ago) I was wondering what is the curr

Are the Font Awesome 3.2 docs still accessible? [closed]

Are the Font Awesome 3.2 docs still accessible? [closed]

I am using Font Awesome 3.2. Font Awesome just released version 4.0. Prior to the 4.0 release I would view Font Awesome's documentation at http://fortawesome.github.io/Font-Awesome/icons/. The new version has differing icon names and makes

window.performance.now() equivalent in nodejs?

window.performance.now() equivalent in nodejs?

I think the question is straight forward.I'm looking for something that's similar to window.performance.now() in nodejs V8 engine.Right now I'm just using:-var now = Date.now();//do some processing..console.log("time elapsed:", Date.now() -

Radius/nearest results - Google Maps API

Radius/nearest results - Google Maps API

First of all I'm using Google Maps API v3. I have one big map that shows all the results pulled from a database, now I like to implement a feature that shows a radius of nearest results within X kilometres from the current location (served

Passing std::shared_ptr to Constructors

Passing std::shared_ptr to Constructors

Is the following a reasonable and efficient approach with regard to creating Stuff and giving Foo ownership of it?class Foo{ explicit Foo(const std::shared_ptr& myStuff) : m_myStuff(myStuff) { } ...private: const std::

Use a System.Drawing.Printing.PrintDocument to generate a PDF in memory

Use a System.Drawing.Printing.PrintDocument to generate a PDF in memory

Does anyone know if the following is possible and if so what the best way of doing it is for free?I am generating a PrintDocument in a project I am currently working on and displaying a print dialog box so a user can choose which printer th

Connecting domain to google app engine without google apps

Connecting domain to google app engine without google apps

Actualy, It's a couple of questions:Is it possible to somehow avoid registering google apps if I just want to connect google app engine applications to non-naked domain (www.example.com for example:)If described above is impossible, than do

Ruby model output id as object oid

Ruby model output id as object oid

My ruby model, like so:class User include Mongoid::Document field :first_name, type: String field :birthdate, type: Date validates :first_name, :birthdate, :presence => trueendoutputs an object like so:{_id: {$oid: "522884c6c4b4ae5c7600