Why doesn't the height of a container element increase if it contains floated elements?

Why doesn't the height of a container element increase if it contains floated elements?

I would like to ask how height and float work. I have an outer div and an inner div that has content in it. Its height may vary depending on the content of the inner div but it seems that my inner div will overflow its outside div. What wou

Simplest code for array intersection in javascript

Simplest code for array intersection in javascript

What's the simplest, library-free code for implementing array intersections in javascript? I want to writeintersection([1,2,3], [2,3,4,5])and get[2, 3] 1:Use a combination of Array.prototype.filter and Array.prototype.indexOf.array1.filt

Syntax error due to using a reserved word as a table or column name in MySQL

Syntax error due to using a reserved word as a table or column name in MySQL

I'm trying to execute a simple MySQL query as below:INSERT INTO user_details (username, location, key)VALUES ('Tim', 'Florida', 42)But I'm getting the following error: You have an error in your SQL syntax; check the manual that corresponds

Log-log lmplot with seaborn

Log-log lmplot with seaborn

Can the function lmplot from Seaborn plot on a log-log scale?This is lmplot on a normal scaleimport numpy as npimport pandas as pdimport seaborn as snsx = 10**arange(1, 10)y = 10** arange(1,10)*2df1 = pd.DataFrame( data=y, index=x )df2 = p

Splitting filenames using system file separator symbol

Splitting filenames using system file separator symbol

I have a complete file path and I want to get the file name.I am using the following instruction:String[] splittedFileName = fileName.split(System.getProperty("file.separator"));String simpleFileName = splittedFileName[splittedFileName.leng

How to get attribute value from node using xpath?

How to get attribute value from node using xpath?

Totally new to xpath.I have xml: To get value by index, i can use: string(/*/Value[1]/@CustomAtr)Is it possible to get value by key?Hot to get CustomAtr value where Value="b" ?Thank you 1:this should do the trick:string(//Value[@

Multiple Authorization attributes on method

Multiple Authorization attributes on method

I'm having trouble specifying two separate Authorization attributes on a class method: the user is to be allowed access if either of the two attributes are true.The Athorization class looks like this:[AttributeUsage(AttributeTargets.All, Al

How to provide mock files to change event of  for unit testing

How to provide mock files to change event of for unit testing

I'm having difficulties with a unit test in which I want to verify the processing of a file, which would usually be selected in the view via .In the controller part of my AngularJS app the file is processed inside the input's change event l

Ways to manage DB migrations with SQLAlchemy? [closed]

Ways to manage DB migrations with SQLAlchemy? [closed]

I've looked at sqlalchemy-migrate, but it just seems like a lot of work and I haven't been able to find any useful examples.Anyone care to share how they handle this? 1:Check out new project Alembic: http://readthedocs.org/docs/alembic/

How to return html page from WebApi action?

How to return html page from WebApi action?

I'm looking for a WebApi example where the default route will return a given html page to the caller. I've got the route and action set up as follows. I just want to send him the index.html page, not redirect, because he's in the right pl

Adding a tooltip to an input box

Adding a tooltip to an input box

I am using the CSS.Tooltips library to try an get a tooltip to show up on an input tag. I can get it to work on a p tag but not an input tag. Any ideas?Here is link to the fiddle: http://jsfiddle.net/cwlanca/BumU5/1/htmlThis is a paragrap

How do you remove the column name row from a pandas DataFrame?

How do you remove the column name row from a pandas DataFrame?

Say I import the following excel spreadsheet into a dfVal1 Val2 Val31 2 3 5 6 7 9 1 2How do I delete the column name row (in this case Val1, Val2, Val3) so that I can export a csv with no column names, just the data?I h

data.table - does setkey(…) create an index or physically reorder the rows in a data table?

data.table - does setkey(…) create an index or physically reorder the rows in a data table?

This (very basic) question is the result of an exchange here. The documentation for setkey() states: setkey() sorts a data.table and marks it as sorted. The sorted columns are the key. The key can be any columns in any order. The columns

SELECT TOP is slow, regardless of ORDER BY

SELECT TOP is slow, regardless of ORDER BY

I have a fairly complex query in SQL Server running against a view, in the form:SELECT * FROM myview, foo, bar WHERE shared=1 AND [joins and other stuff] ORDER BY sortcode;The query plan as shown above shows a Sort operation just bef

is it possible to add a comment to a diff file (unified)?

is it possible to add a comment to a diff file (unified)?

I wonder if it's possible to add a certain amount of unparsed content to a diff file (unified) that is ignored as a comment.One good use of this would be having git diffs augmented with important information such as from which branch is th

Why is there a scan on my clustered index?

Why is there a scan on my clustered index?

SQL 2000The NED table has a foreign key to the SIGN table NED.RowID to SIGN.RowIDThe SIGN table has a foreign key to the NED table SIGN.SignID to NED.SignIDThe RowID and SignID are clustered primary keys that are GUIDs (not my choice)The WH

Why is the Matlab function “feval” needed?

Why is the Matlab function “feval” needed?

A function handle can be used to call a function, e.g.f = @sin;val = f(1.0);so why is "feval" ever needed?val = feval(f, 1.0);When is it useful? 1:For feval, the first argument can be a quoted string, giving you more flexibility than a f

TSQL foreign keys on views?

TSQL foreign keys on views?

I have a SQL-Server 2008 database and a schema which uses foreign key constraints to enforce referential integrity. Works as intended. Now the user creates views on the original tables to work on subsets of the data only. My problem is that

Angular, limitTo and track by $index

Angular, limitTo and track by $index

I am trying to limit an object coming in by filtering (because there will be an option to show all eventually), however I am running into issues when trying to limitTo and track by index. Here is the code : In the controller: $scope.filte

Latest builds from Angular2 complain with: NgModule DynamicModule uses HomeComponent via “entryCompo

Latest builds from Angular2 complain with: NgModule DynamicModule uses HomeComponent via “entryCompo

Since switching to the latest builds of Angular 2 (i.e. on github, master), I get warnings as follows about all my components: NgModule DynamicModule uses HomeComponent via "entryComponents" but it was neither declared nor imported! This

How do I get a model from a Backbone.js collection by its id?

How do I get a model from a Backbone.js collection by its id?

In my app, everything I do with data is based on the primary key as the data is stored in the database. I would like to grab a model from a collection based on this key.Using Collection.at() requires the array index, Collection.getByCid() r

Generate CREATE scripts for a list of indexes

Generate CREATE scripts for a list of indexes

As part of a collation changing exercise, I have a list of indexes (122) that needs to be dropped and then re-created. How can I re-create these indexes without having to go through the GUI and scripting it to a query window each time?My li

Loop with asynchronous callbacks in mongoose/mongodb/node

Loop with asynchronous callbacks in mongoose/mongodb/node

I am new to nodejs/mongo/mongoose and i am trying to do a very simple thing. I have the following schemas:var authorSchema = mongoose.Schema({ name: String, });Author = mongoose.model('Author', authorSchema);var bookSchema = mongo

Get the level of a hierarchy

Get the level of a hierarchy

I have an array of objects, Where each object has an id and a ParentId property (so they can be arranged in trees). They are in no particular order.Please note that the id's and parentId's will not be integers, they will be strings (just wa

How to load content to JavaFX tabs dynamically?

How to load content to JavaFX tabs dynamically?

I have a GUI, made using JavaFX with FXML.This GUI has a lot of components and not all of them are needed at one moment of time.For example, imagine a GUI that receives from its server part a list of cities.Each city is described on its own