Resizing an iframe based on content

Resizing an iframe based on content

I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes. How do I resize the iframes to fit the height of the iframes' content?I've tried to decipher the javascript Google uses

Use jQuery to hide a DIV when the user clicks outside of it

Use jQuery to hide a DIV when the user clicks outside of it

I am using this code:$('body').click(function() { $('.form_wrapper').hide();});$('.form_wrapper').click(function(event){ event.stopPropagation();});And this HTML:

What is the most effective way for float and double comparison?

What is the most effective way for float and double comparison?

What would be the most efficient way to compare two double or two float values?Simply doing this is not correct:bool CompareDoubles1 (double A, double B){ return A == B;}But something like:bool CompareDoubles2 (double A, double B) { dif

MVC5: Enum radio button with label as displayname

MVC5: Enum radio button with label as displayname

I have these enumspublic enum QuestionStart{ [Display(Name="Repeat till common match is found")] RepeatTillCommonIsFound, [Display(Name="Repeat once")] RepeatOnce, [Display(Name="No repeat")] NoRepeat}public enum Quest

fatal error LNK1104: cannot open file 'gdi32.lib'

fatal error LNK1104: cannot open file 'gdi32.lib'

Every time I try to run my code I get this ERROR I've tried everything, installing the SDK .. but still the same ERROR.1>------ Build started: Project: ConsoleApplication6, Configuration: Debug Win32 ------1>LINK : fatal error LNK1104: cann

Is there a concept of “pointers” or “unsafe code” in Java?

Is there a concept of “pointers” or “unsafe code” in Java?

Yesterday I was attending a talk by a CTO of a reputed European Company, and he told until recently he did not know that java has pointers. On confronting him he said he is absolutely sure about existence of pointers/unsafe code in java.

How to get first object out from List using Linq

How to get first object out from List using Linq

I have below code in c# 4.0.//Dictionary object with Key as string and Value as List of Component type objectDictionary> dic = new Dictionary>();//Here I am trying to do the loping for Listforeach (List lstComp in dic.Values.ToList()){ /

Tuning MySQL for speedy column/index creation during development

Tuning MySQL for speedy column/index creation during development

Assume a MySQL MyISAM table with one gigabyte of data and one gigabyte of indexes.Furthermore, assume that during development columns and indexes will be added and removed from/to the table quite frequently. Due to the size of the database

How to load language with gettext in PHP?

How to load language with gettext in PHP?

I have created a language file in poedit for the use of the PHP gettext function, now on the page I am trying to test it on, I cannot get it to find/load the .po or .mo file I created, does anyone see what I am doing wrong?$locale = "en_US"

Calculate initial velocity to move a set distance with inertia

Calculate initial velocity to move a set distance with inertia

I want to move something a set distance. However in my system there is inertia/drag/negative accelaration. I'm using a simple calculation like this for it:v = oldV + ((targetV - oldV) * inertia)Applying that over a number of frames makes th

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 the Gamma distribution in SciPy have three parameters?

Why does the Gamma distribution in SciPy have three parameters?

Usually, the Gamma distribution has two parameters: shape and scale (or alternatively shape and rate). However, it seems that in SciPy the Gamma distribution has three parameters: two shape parameters and a location parameter.Does anyone kn

Decode CDATA section in C#

Decode CDATA section in C#

I have a bit of XML as follows: I'm accessing it using curXmlNode.SelectSingleNode("description").InnerText but the value returns \r\n This is a "description"\r\n that I have formatted instead of This is a "description" tha

Symfony2 Use default locale in routing (one URL for one language)

Symfony2 Use default locale in routing (one URL for one language)

I am currently developing a website with Symfony2 and I need to translate it. With tools provided by Symfony2 it’s very easy. But I encounter a problem:I would like to have specific URL (with prefix) to a language (ie, one URL, a single lan

Workaround for calling table-valued function remotely in SQL Server has even more issues

Workaround for calling table-valued function remotely in SQL Server has even more issues

I had a query with a set of parameters that needed to be run multiple times with different parameters, so I wrapped it in a table-valued function.That table valued function needed called from a remote server. Unfortunately, the call fails

NetBeans 7.1 - unable change to UI language

NetBeans 7.1 - unable change to UI language

I installed NetBeans 7.1 and can't change UI language. I didn't find any option for it. Any suggestions? 1:--locale on some Windows platforms makes netbeans crash. Preffer to use "-J-Duser.language=en -J-Duser.region=US"Find netbeans et

Why do we need an 'arbiter' in MongoDB replication?

Why do we need an 'arbiter' in MongoDB replication?

Assume we setup a MongoDB replication without arbiter, If the primary is unavailable, the replica set will elect a secondary to be primary. So I think it's kind of implicit arbiter, since the replica will elect a primary automatically.So I

Is the Intel Xeon Phi usable without a costly Intel Compiler?

Is the Intel Xeon Phi usable without a costly Intel Compiler?

Does the Intel Xeon Phi coprocessor, to be usable as parallel platform, require a license of the Intel Composer XE compiler, or are there alternative compilers? 1:look at this link, Intel site claims few compilers works with them but I s

ashx files in asp.net

ashx files in asp.net

When do you use ashx files in asp.net web application ? Can some one explain in simple terminology with a pratical example ? I understood from the msdn that .ashx files implements ihttphandler but i could not get much explanation from here

Get Entity Framework 6 use NOLOCK in its underneath SELECT statements

Get Entity Framework 6 use NOLOCK in its underneath SELECT statements

I am using Entity Framework 6 in an MVC 5 project. As you're aware of, SELECT queries in SQL Server perform faster and more efficient if we use WITH (NOLOCK) in them. I checked out a few SQL SELECT statements generated by Entity Framework 6

TimeSpan to ISO8601 duration format string

TimeSpan to ISO8601 duration format string

Can anyone advise on how to convert a timespan or int to an ISO8601 duration string as explained in http://en.wikipedia.org/wiki/ISO_8601#Durations?"1 hour and 30 minutes" would result in "PT1H30M", for example:int duration = 90;string isoS

Sysinternals' Portmon: Error 2

Sysinternals' Portmon: Error 2

When I try to connect to local ports, Computer -> Connect local, using Portmon v. 3.02, I'm getting an error message, Error 2, in a small error dialog box:I run the tool as an administrator (if not, I get error 6).By the way this is a Windo

Showing Driving Directions in MapKit

Showing Driving Directions in MapKit

is there any way to show the driving directions in iphones MapKit?is there any way to get the coordinates and names of a route as an XML or in other formates from google MAPs API ? eg , http://maps.google.com/maps?f=d&hl=en&geocode=&saddr=

Is it possible to specify command line parameters to R-script in RStudio?

Is it possible to specify command line parameters to R-script in RStudio?

I want to use RStudio to edit an R-script having command line parameters, e.g.,my_rscript --dataset mydatasetand then to read the optiion value into an R variable, say, dataset, e.g., using optparse library.However, I could not find where a

How do I schedule a task with Celery that runs on 1st of every month?

How do I schedule a task with Celery that runs on 1st of every month?

How do I schedule a task with celery that runs on 1st of every month? 1:Since Celery 3.0 the crontab schedule now supports day_of_monthand month_of_year arguments: http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#cro