Get the index (counter) of an ‘ng-repeat’ item with AngularJS?

Angularjs documentation is full of examples, you just need to take some time and explore it. See this example here : ngRepeat example , it’s the same case. <ul> <li ng-repeat=”question in questions | filter: {questionTypesId: questionType, selected: true}”> <div> <span class=”name”> {{$index + 1}} {{ question.questionText }} </span> </div> <ul> <li ng-repeat=”answer in question.answers”> …

Read more

Do NoSQL databases use or need indexes?

CouchDB and MongoDB definitely yes. I mentioned that in my book: http://use-the-index-luke.com/sql/testing-scalability/response-time-throughput-scaling-horizontal Here are the respective docs: http://guide.couchdb.org/draft/btree.html http://www.mongodb.org/display/DOCS/Indexes NoSQL is, however, too fragmented to give a definite “yes, all NoSQL systems need indexes”, I believe. Most systems require and provide indexes but not at level most SQL databases do. Recently, the Cassandra people were …

Read more

Entity Framework 6.1 – Create index with INCLUDE statement

Strictly speaking it has been always possible in Code First Migrations because you can run sql in a migration: public partial class AddIndexes : DbMigration { private const string IndexName = “IX_LogSamples”; public override void Up() { Sql(String.Format(@”CREATE NONCLUSTERED INDEX [{0}] ON [dbo].[Logs] ([SampleId],[Date]) INCLUDE ([Value])”, IndexName)); } public override void Down() { DropIndex(“dbo.Logs”, IndexName); …

Read more

Select non-null rows from a specific column in a DataFrame and take a sub-selection of other columns

You can pass a boolean mask to your df based on notnull() of ‘Survive’ column and select the cols of interest: In [2]: # make some data df = pd.DataFrame(np.random.randn(5,7), columns= [‘Survive’, ‘Age’,’Fare’, ‘Group_Size’,’deck’, ‘Pclass’, ‘Title’ ]) df[‘Survive’].iloc[2] = np.NaN df Out[2]: Survive Age Fare Group_Size deck Pclass Title 0 1.174206 -0.056846 0.454437 0.496695 1.401509 …

Read more

In JDBC, why do parameter indexes for prepared statements begin at 1 instead of 0?

Historically, databases have used 1-based indexing for bound parameters. This probably reflects the origins of relational databases in set theory and mathematics, which index elements starting with one, and use zero to represent a null or empty set. In shell scripts and regular expressions, the zero index usually means something “special”. For example, in the …

Read more