我正在使用MongoDB复制集开发一个PHP Web应用程序来存储我的数据.我偶尔会收到以下错误:
致命错误:未捕获异常'MongoConnectionException',并显示消息'未找到候选服务器'
我有一个3成员Mongo副本集与1仲裁
rs0:PRIMARY> rs.status()
{
"set" : "rs0",
"date" : ISODate("2013-01-30T01:04:04Z"),
"myState" : 1,
"members" : [
{
"_id" : 0,
"name" : "JenEricsMacPro.local:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 844478,
"optime" : Timestamp(1359507378000, 1),
"optimeDate" : ISODate("2013-01-30T00:56:18Z"),
"self" : true
},
{
"_id" : 1,
"name" : "ericsmacbookpro.local:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 10720,
"optime" : Timestamp(1359507378000, 1),
"optimeDate" : ISODate("2013-01-30T00:56:18Z"),
"lastHeartbeat" : ISODate("2013-01-30T01:04:04Z"),
"pingMs" : …Run Code Online (Sandbox Code Playgroud) 我一直在研究与UITableView和cellForRowAtIndexPath相关的问题.
我想让用户能够拥有非常多的行,就像iPhone上的大量电子邮件一样.当我开始创建一个类,可以根据需要从数据库中排队和出列记录组以节省内存时,我发现了这个问题.我发现当我的UITableViewController加载时,它会调用cellForRowAtIndexPath作为典型的前10个索引(0到9).当我在模拟器的黑色外表面区域上单击鼠标或者尝试使用向上手势向下滚动UITableView时,问题就出现了.此时,将为所有剩余索引调用cellForRowAtIndexPath.即使有1000多个细胞,也会发生这种情况.我试图只用100个索引重新创建一个非常简单的项目(没什么特别的).它完全一样......滚动时,
这是UITableView的正常行为吗?有没有人有任何想法为什么它无效地调用所有行?
我会说,一旦这个初始传递发生,它似乎开始正常工作.我真的对此感到困惑,因为它几乎不可能根据需要创建一个排队和排队记录的类.
这是我更简单的示例项目的代码:
// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 100;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
printf("RootViewController, -tableView:cellForRowAtIndexPath; // indexPath.row = %d\n", indexPath.row);
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell …Run Code Online (Sandbox Code Playgroud) 有没有办法从SQL 2005数据库中获取唯一的数据库标识符(如GUID)?
我发现这篇文章:http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.database.databaseguid%28v=sql.90%29.aspx
但是,我需要能够从T-SQL而不是VB获取DatabaseGuid.
编辑:我试图唯一确定我连接的数据库.通过代码我在SQL Compact和SQL Server之间手动同步记录.现在我的用户处于测试环境中,并且当他们将来指向生产SQL时,我将需要重新同步整个表而不是依赖于rowversion.生产服务器上的rowversions将有所不同,如果我能够检测到数据库GUID更改,我可以重新同步整个表.
提前致谢.
database ×1
guid ×1
ios ×1
mongodb ×1
mongodb-php ×1
php ×1
sdk ×1
sql-server ×1
t-sql ×1
uitableview ×1