2012年11月28日

MongoDB 学习笔记 - 2、MongoDB 设置访问权限、设置用户。

摘要: 1、登录 Admin 数据库,输入命令:mongo admin2、添加超级管理员,输入命令:db.addUser('sa', '123456')3、登录超级管理员帐号,输入命令:db.auth('sa', '123456')4、创建新的测试数据库,输入命令:use TempDB5、显示测试数据库所有集合,输入命令:show collections6、测试数据库添加完全访问权限用户,输入命令:db.addUser('db_owner', '123456')7、测试数据库添加只读访问权限用户,输入命令: 阅读全文

posted @ 2012-11-28 17:15 Solitary 阅读(215) 评论(0) 推荐(0) 编辑

2012年11月26日

MongoDB 学习笔记 - 1、如何将MongoDB做一项Windows服务启动

摘要: 注间事项:1:log一定要指定一个xxx.log文件(文件不存在也要这么写,会自动创建,写成这样是不可以的--logpath d:\mongodb\logs)2:serviceName的N字母要大写安装、卸载、重启、停止批处理文件:安装.bat@echo off:startclsset /p input=确定安装 MongoDB 吗?[Y/N] if %input%==y goto installif %input%==Y goto install:installmongod --logpath D:\MongoDb\logs\MongoDB.log --logappend --dbpath 阅读全文

posted @ 2012-11-26 16:00 Solitary 阅读(165) 评论(0) 推荐(0) 编辑

SQL Server 处理上百万条的数据库如何提高处理查询速度

摘要: 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如:select id from t where num is null可以在num上设置默认值0,确保表中num列没有null值,然后这样查询:select id from t where num=03.应尽量避免在 where 子句中使用!=或<>操作符,否则将引擎放弃使用索引而进行全表扫描。4.应尽量避免在 where 子句中使用 or 来连接条件,否则将导致引擎 阅读全文

posted @ 2012-11-26 14:28 Solitary 阅读(492) 评论(0) 推荐(0) 编辑

2012年11月12日

iOS如何让主界面不显示NavigationBar

摘要: - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.navigationController setNavigationBarHidden:YES animated:animated];}- (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; [self.navigationController setNavigationBarHidden:NO animated:... 阅读全文

posted @ 2012-11-12 15:17 Solitary 阅读(185) 评论(0) 推荐(0) 编辑

2012年11月2日

MKReverseGeocoder 获取地址的详细信息

摘要: - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{NSLog(@"%@",placemark.locality);}//=======================================================Street = 科韵路 18号Thoroughfare = 科韵路SubThoroughfare = 18号City = 广州市SubLocality = 天河区State = 广东省SubAdminist 阅读全文

posted @ 2012-11-02 15:10 Solitary 阅读(322) 评论(0) 推荐(0) 编辑

2012年10月29日

获得iPhone的相关信息

摘要: 获取iphone的系统信息使用[UIDevicecurrentDevice],信息如下:[[UIDevice currentDevice] systemName]:系统名称,如iPhone OS[[UIDevice currentDevice] systemVersion]:系统版本,如4.2.1[[UIDevice currentDevice] model]:The model of the device,如iPhone或者iPod touch[[UIDevice currentDevice] uniqueIdentifier]:设备的惟一标识号,deviceID[[UIDevice cur 阅读全文

posted @ 2012-10-29 16:20 Solitary 阅读(188) 评论(0) 推荐(0) 编辑

xcode4 本地化多国语言

摘要: 1 xcode4.2,如果是简体中文,把国际化的文件放到zh-Hans.lproj中就显示正常了。如果放到zh.lproj中就不可以2 字符串1)在项目的“supporting files”目录中右键“new file”然后在弹出窗口左侧选择IOS的resource项,在右侧就可以看到“String File”的图标。创建这个文件,新建的文件名要写成“Localizable.strings” 必须是2)点击刚才创建的这个文件,选择的菜单中的“view”-》“utilities”-》“file inspect” 右侧会看到一些属性的信息3)找到Localization这项,现在应该是空的,点“+ 阅读全文

posted @ 2012-10-29 16:16 Solitary 阅读(186) 评论(0) 推荐(0) 编辑

Set the Zoom Level of an MKMapView

摘要: If you have ever built a web application using the Google Maps API, you are likely intimately familiar with this line of code:map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);The setCenter JavaScript method takes in the center coordinate and a zoom level. The zoom level, as you might ex 阅读全文

posted @ 2012-10-29 16:13 Solitary 阅读(472) 评论(0) 推荐(0) 编辑

iOS 地图与定位开发系列教程(四)

摘要: MKPlacemark、MKUserLocation和MKReverseGeocoder在地图上做标记是通过MKPlacemark类来完成的。这个类使用(符合)MKAnnotation协议。MKAnnotation包含了多个属性,如:位置(经纬度,CLLocationCoordinate2D类型)、文字标记信息(NSString类型)等。MKPlacemark保存了位置(经纬度)和地址(字典类)之间的映射。下面是它的初始化方法:-(void)initWithCoordinate:(CLLocationCoordinate2D *)coordinate addressDictionary:(NS 阅读全文

posted @ 2012-10-29 16:05 Solitary 阅读(376) 评论(0) 推荐(0) 编辑

iOS 地图与定位开发系列教程(三)

摘要: MapKit框架主要提供了四个功能:1、显示地图;2、CLLocation和地址之间的转换;3、支持在地图上做标记(比如标记北京天安门广场);4、 把一个位置解析成地址(比如我在水立方,想要知道确切的地址信息)。MKMapView类主要是完成下述功能:1、显示地图,比如:显示北京市的地图;2、提供多种显示方式,比如标准地图格式,卫星地图等;3、支持地图的放大缩小;4、支持在地图上做标记,比如标记天安门广场;5、在地图上显示手机所在的当前位置。MKMapView类的属性有:@property MKCoordinateRegin region; //地图所显示的区域@property CLLoca 阅读全文

posted @ 2012-10-29 16:03 Solitary 阅读(267) 评论(0) 推荐(0) 编辑

导航