Iphone表視圖的簡單操作

1.創建一個Navigation—based—Application項目,這樣Interface Builder中會自動生成一個Table View,然后將Search Bar拖放到表示圖上,以我們要給表示圖添加搜索功能,不要忘記將Search Bar的delegate連接到File‘s Owner項,然后將Search Bar與searchBar變量連接。

2.在Resources文件夾下創建一個Movies.plist文件,然后為該文件添加一些數據,如下圖:


3.在.h頭文件添加如下內容:

[cpp] view plaincopyprint?
  1. #import?<UIKit/UIKit.h> ??
  2. ??
  3. ??
  4. @interface?MyTableView?:?UITableViewController?<UISearchBarDelegate>{??
  5. ????NSDictionary?*movieTitles;??
  6. ????NSArray?*years;??
  7. ??????
  8. ????IBOutlet?UISearchBar?*searchBar;??
  9. ??????
  10. ????BOOL?isSearchOn;??
  11. ????BOOL?canSelectRow;??
  12. ??????
  13. ????//下面兩個是搜索用到的兩個變量 ??
  14. ????NSMutableArray?*listOfMovies;??
  15. ????NSMutableArray?*searchResult;??
  16. }??
  17. @property(nonatomic,retain)?NSDictionary?*movieTitles;??
  18. @property(nonatomic,retain)NSArray?*years;??
  19. @property(nonatomic,retain)UISearchBar?*searchBar;??
  20. ??
  21. -(void)donSearching:(id)sender;??
  22. -(void)searchMoviesTableView;??
  23. @end??
#import <UIKit/UIKit.h>
@interface MyTableView : UITableViewController <UISearchBarDelegate>{
NSDictionary *movieTitles;
NSArray *years;
IBOutlet UISearchBar *searchBar;
BOOL isSearchOn;
BOOL canSelectRow;
//下面兩個是搜索用到的兩個變量
NSMutableArray *listOfMovies;
NSMutableArray *searchResult;
}
@property(nonatomic,retain) NSDictionary *movieTitles;
@property(nonatomic,retain)NSArray *years;
@property(nonatomic,retain)UISearchBar *searchBar;
-(void)donSearching:(id)sender;
-(void)searchMoviesTableView;
@end

4.當加載View窗口時,首先定位屬性列表并把這個列表加載到listOfMovies中,然后將所有的年份提取到years中,然后添加搜索條并初始化搜索條用到的數據:

[cpp] view plaincopyprint?
  1. //讀取Movies.plist文件的內容到變量里面 ??
  2. -?(void)viewDidLoad??
  3. {??
  4. ???NSString?*path?=?[[NSBundle?mainBundle]pathForResource:@"Movies"?ofType:@"plist"];??
  5. ????NSDictionary?*dic?=?[[NSDictionary?alloc]initWithContentsOfFile:path];??
  6. ????self.movieTitles?=?dic;??
  7. ????[dic?release];??
  8. ??????
  9. ????NSArray?*array?=?[[self.movieTitles?allKeys]sortedArrayUsingSelector:@selector(compare:)];??
  10. ????self.years?=?array;??
  11. ??????
  12. ????//下面兩句是添加搜索條 ??
  13. ????self.tableView.tableHeaderView?=?searchBar;??
  14. ????self.searchBar.autocorrectionType?=?UITextAutocorrectionTypeYes;??
  15. ??????
  16. ????//初始化listofmovies ??
  17. ????listOfMovies?=?[[NSMutableArray?alloc]init];??
  18. ????for?(NSString?*year?in?years)?{??
  19. ????????NSArray?*movies?=?[movieTitles?objectForKey:year];??
  20. ????????for(NSString?*title?in?movies){??
  21. ????????????[listOfMovies?addObject:title];??
  22. ????????}??
  23. ????}??
  24. ??
  25. ????searchResult?=?[[NSMutableArray?alloc]init];??
  26. ??????
  27. ????isSearchOn?=?NO;??
  28. ????canSelectRow?=?YES;??
  29. ????[super?viewDidLoad];??
  30. ??
  31. }??
//讀取Movies.plist文件的內容到變量里面
- (void)viewDidLoad
{
NSString *path = [[NSBundle mainBundle]pathForResource:@"Movies" ofType:@"plist"];
NSDictionary *dic = [[NSDictionary alloc]initWithContentsOfFile:path];
self.movieTitles = dic;
[dic release];
NSArray *array = [[self.movieTitles allKeys]sortedArrayUsingSelector:@selector(compare:)];
self.years = array;
//下面兩句是添加搜索條
self.tableView.tableHeaderView = searchBar;
self.searchBar.autocorrectionType = UITextAutocorrectionTypeYes;
//初始化listofmovies
listOfMovies = [[NSMutableArray alloc]init];
for (NSString *year in years) {
NSArray *movies = [movieTitles objectForKey:year];
for(NSString *title in movies){
[listOfMovies addObject:title];
}
}
searchResult = [[NSMutableArray alloc]init];
isSearchOn = NO;
canSelectRow = YES;
[super viewDidLoad];
}

5.在自動生成的方法numberOfSectionsInTableView中添加如下代碼,表示告訴表示圖一共分多少節:

[cpp] view plaincopyprint?
  1. -?(NSInteger)numberOfSectionsInTableView:(UITableView?*)tableView??
  2. {??
  3. ????if?(isSearchOn)?{??
  4. ????????return?1;//如果正在搜索就只有一個section ??
  5. ????}??
  6. ??else??
  7. ????return?[self.years?count];??
  8. }??
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if (isSearchOn) {
return 1;//如果正在搜索就只有一個section
}
else
return [self.years count];
}

6.在自動生成的方法tableView:numberOfRowsInSection:中添加如下代碼,表示告訴表視圖每一節顯示多少行:

[cpp] view plaincopyprint?
  1. -?(NSInteger)tableView:(UITableView?*)tableView?numberOfRowsInSection:(NSInteger)section??
  2. {??
  3. ??
  4. ????if?(isSearchOn)?{??
  5. ????????return?[searchResult?count];??
  6. ????}else{??
  7. ????//?Return?the?number?of?rows?in?the?section. ??
  8. ????NSString?*year?=?[self.years?objectAtIndex:section];??
  9. ????NSArray?*movieSection?=?[self.movieTitles?objectForKey:year];??
  10. ????return?[movieSection?count];??
  11. ????}??
  12. }??
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (isSearchOn) {
return [searchResult count];
}else{
// Return the number of rows in the section.
NSString *year = [self.years objectAtIndex:section];
NSArray *movieSection = [self.movieTitles objectForKey:year];
return [movieSection count];
}
}

7.在自動生成的方法tableView:cellForRowAtIndexPath:中添加如下代碼,為每一行設值:

[cpp] view plaincopyprint?
  1. -?(UITableViewCell?*)tableView:(UITableView?*)tableView?cellForRowAtIndexPath:(NSIndexPath?*)indexPath??
  2. {??
  3. ????static?NSString?*CellIdentifier?=?@"Cell";??
  4. ??????
  5. ????UITableViewCell?*cell?=?[tableView?dequeueReusableCellWithIdentifier:CellIdentifier];??
  6. ????if?(cell?==?nil)?{??
  7. ????????cell?=?[[[UITableViewCell?alloc]?initWithStyle:UITableViewCellStyleDefault?reuseIdentifier:CellIdentifier]?autorelease];??
  8. ????}??
  9. ??????
  10. ????if?(isSearchOn)?{??
  11. ????????NSString?*cellValue?=?[searchResult?objectAtIndex:indexPath.row];??
  12. ????????cell.textLabel.text?=?cellValue;??
  13. ????}else{??
  14. ????NSString?*year?=?[self.years?objectAtIndex:[indexPath?section]];//得到當前行所在的section ??
  15. ????NSArray?*movieSection?=?[self.movieTitles?objectForKey:year];??
  16. ????cell.textLabel.text?=?[movieSection?objectAtIndex:[indexPath?row]];??
  17. ??????????
  18. ????????cell.accessoryType?=?UITableViewCellAccessoryDetailDisclosureButton;??
  19. ????}??
  20. ??????
  21. ????//為每一行添加圖片 ??
  22. ????UIImage?*image?=?[UIImage?imageNamed:@"apple.jpeg"];??
  23. ????cell.imageView.image?=?image;??
  24. ??????
  25. ????return?cell;??
  26. }??
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
if (isSearchOn) {
NSString *cellValue = [searchResult objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
}else{
NSString *year = [self.years objectAtIndex:[indexPath section]];//得到當前行所在的section
NSArray *movieSection = [self.movieTitles objectForKey:year];
cell.textLabel.text = [movieSection objectAtIndex:[indexPath row]];
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
//為每一行添加圖片
UIImage *image = [UIImage imageNamed:@"apple.jpeg"];
cell.imageView.image = image;
return cell;
}

8.實現tableView:titleForHeaderInSection:方法,將得到的年份作為每一節的Header:

[cpp] view plaincopyprint?
  1. //設置每個section的標題 ??
  2. -(NSString?*)tableView:(UITableView?*)tableView?titleForHeaderInSection:(NSInteger)section{??
  3. ????NSString?*year?=?[self.years?objectAtIndex:section];??
  4. ????if?(isSearchOn)?{??
  5. ????????return?nil;??
  6. ????}??
  7. ????else{??
  8. ????return?year;??
  9. ????}??
  10. ????}??
//設置每個section的標題
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
NSString *year = [self.years objectAtIndex:section];
if (isSearchOn) {
return nil;
}
else{
return year;
}
}

9.為表格添加索引,只需要實現sectionIndexTitlesForTableView:方法,該方法返回每一節的Header數組:

[cpp] view plaincopyprint?
  1. //添加索引 ??
  2. -(NSArray?*)sectionIndexTitlesForTableView:(UITableView?*)tableView{??
  3. ????if?(isSearchOn)???
  4. ????????return?nil;??
  5. ????else??
  6. ????return?years;??
  7. }??
//添加索引
-(NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
if (isSearchOn) 
return nil;
else
return years;
}

10.當用戶點擊搜索欄會促發searchBarTextDidBeginEditing:事件(UISearchBarDelegate協議中定義的一個方法,我們在.h頭文件中實現了這個協議),在該方法中,向屏幕右上角添加一個Done按鈕,當用戶點擊Done按鈕時會調用doneSearching方法:

[cpp] view plaincopyprint?
  1. //搜索筐得到焦點后 ??
  2. -(void)searchBarTextDidBeginEditing:(UISearchBar?*)searchBar{??
  3. ????isSearchOn?=?YES;??
  4. ????canSelectRow?=?NO;??
  5. ????self.tableView.scrollEnabled?=?NO;??
  6. ????//添加down按鈕及其點擊方法 ??
  7. ????self.navigationItem.rightBarButtonItem?=?[[[UIBarButtonItem?alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone?target:self?action:@selector(donSearching:)]autorelease];??
  8. }??
//搜索筐得到焦點后
-(void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar{
isSearchOn = YES;
canSelectRow = NO;
self.tableView.scrollEnabled = NO;
//添加down按鈕及其點擊方法
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donSearching:)]autorelease];
}
11.doneSearching方法使得搜索欄移除了First Responder狀態,因而會隱藏鍵盤,同時,通過調用表視圖的reloadData方法重新加載表視圖:

[cpp] view plaincopyprint?
  1. //點擊down按鈕后 ??
  2. -(void)donSearching:(id)sender{??
  3. ????isSearchOn?=?NO;??
  4. ????canSelectRow?=?YES;??
  5. ????self.tableView.scrollEnabled?=?YES;??
  6. ????self.navigationItem.rightBarButtonItem?=?nil;??
  7. ??????
  8. ????[searchBar?resignFirstResponder];??
  9. ??????
  10. ????[self.tableView?reloadData];??
  11. }??
//點擊down按鈕后
-(void)donSearching:(id)sender{
isSearchOn = NO;
canSelectRow = YES;
self.tableView.scrollEnabled = YES;
self.navigationItem.rightBarButtonItem = nil;
[searchBar resignFirstResponder];
[self.tableView reloadData];
}

12.當用戶在搜索欄中輸入時,輸入的每個字符都會觸發searchBar:textDidChange:事件,只要搜索欄中有一個字符,就會調用searchMoviesTableView方法:

[cpp] view plaincopyprint?
  1. //搜索筐里面的文字改變后 ??
  2. -(void)?searchBar:(UISearchBar?*)searchBar?textDidChange:(NSString?*)searchText{??
  3. ????if?([searchText?length]>0)?{??
  4. ????????isSearchOn?=?YES;??
  5. ????????canSelectRow?=?YES;??
  6. ????????self.tableView.scrollEnabled?=?YES;??
  7. ????????[self?searchMoviesTableView];//調用搜索方法 ??
  8. ????}??
  9. ????else{??
  10. ????????isSearchOn?=?NO;??
  11. ????????canSelectRow?=?NO;??
  12. ????????self.tableView.scrollEnabled?=?NO;??
  13. ????}??
  14. ????[self.tableView?reloadData];??
  15. }??
//搜索筐里面的文字改變后
-(void) searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText{
if ([searchText length]>0) {
isSearchOn = YES;
canSelectRow = YES;
self.tableView.scrollEnabled = YES;
[self searchMoviesTableView];//調用搜索方法
}
else{
isSearchOn = NO;
canSelectRow = NO;
self.tableView.scrollEnabled = NO;
}
[self.tableView reloadData];
}

13.searchMoviesTableView方法會搜索listOfMovies數組,通過NSString類的rangeOfString:options:方法,使用特定的字符串對每個名稱進行搜索,返回的結果是一個nsRange對象,如果長度大于0就表示有一個匹配結果,將它添加到searchResult書組中:

[cpp] view plaincopyprint?
  1. //自定義的搜索方法,得到搜索結果 ??
  2. -(void)searchMoviesTableView{??
  3. ????[searchResult?removeAllObjects];??
  4. ????for?(NSString?*str?in?listOfMovies)?{??
  5. ????????NSRange?titleResultsRange?=?[str?rangeOfString:searchBar.text?options:NSCaseInsensitiveSearch];??
  6. ????????if?(titleResultsRange.length?>?0)?{??
  7. ????????????[searchResult?addObject:str];??
  8. ????????}??
  9. ????}??
  10. }??
//自定義的搜索方法,得到搜索結果
-(void)searchMoviesTableView{
[searchResult removeAllObjects];
for (NSString *str in listOfMovies) {
NSRange titleResultsRange = [str rangeOfString:searchBar.text options:NSCaseInsensitiveSearch];
if (titleResultsRange.length > 0) {
[searchResult addObject:str];
}
}
}

14.當用戶點擊鍵盤上的Search按鈕時,就會調用如下方法:

[cpp] view plaincopyprint?
  1. -(void)?searchBarSearchButtonClicked:(UISearchBar?*)searchBar{??
  2. ????[self?searchMoviesTableView];??
  3. }??
-(void) searchBarSearchButtonClicked:(UISearchBar *)searchBar{
[self searchMoviesTableView];
}

15.新建一個新的文件,該文件在后面定義,點擊表格的某一行后就會調轉到該頁面去并將點擊的那一樣的名稱傳過去,要想做到這一點必須實現如下方法:

[cpp] view plaincopyprint?
  1. //點擊table某一行跳轉頁面 ??
  2. -?(void)tableView:(UITableView?*)tableView?didSelectRowAtIndexPath:(NSIndexPath?*)indexPath??
  3. {??
  4. ????MyTableViewOneMessage?*mytm?=?[[MyTableViewOneMessage?alloc]initWithNibName:@"MyTableViewOneMessage"?bundle:nil];??
  5. ??????
  6. ????NSString?*year?=?[self.years?objectAtIndex:[indexPath?section]];??
  7. ????NSArray?*movieSection?=?[self.movieTitles?objectForKey:year];??
  8. ????NSString?*movieTitle?=?[movieSection?objectAtIndex:[indexPath?row]];??
  9. ????NSString?*message?=?[[NSString?alloc]initWithFormat:@"%@",movieTitle];??
  10. ????mytm.message?=?message;??
  11. ????[self.navigationController?pushViewController:mytm?animated:YES];??
  12. ????[mytm?release];??
  13. }??
//點擊table某一行跳轉頁面
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MyTableViewOneMessage *mytm = [[MyTableViewOneMessage alloc]initWithNibName:@"MyTableViewOneMessage" bundle:nil];
NSString *year = [self.years objectAtIndex:[indexPath section]];
NSArray *movieSection = [self.movieTitles objectForKey:year];
NSString *movieTitle = [movieSection objectAtIndex:[indexPath row]];
NSString *message = [[NSString alloc]initWithFormat:@"%@",movieTitle];
mytm.message = message;
[self.navigationController pushViewController:mytm animated:YES];
[mytm release];
}

16.新添加的頁面很簡單,主要用來測試表格的點擊事件,導航然后顯示傳過來的字符串:

Interface Builder中添加兩個lable,具體的就不詳細了,很簡單的,下面是這個界面的.h和.m文件:

[cpp] view plaincopyprint?
  1. #import?<UIKit/UIKit.h> ??
  2. ??
  3. ??
  4. @interface?MyTableViewOneMessage?:?UIViewController?{??
  5. ????IBOutlet?UILabel?*mylable;??
  6. ????NSString?*message;??
  7. }??
  8. ??
  9. @property(nonatomic,retain)UILabel?*mylable;??
  10. @property(nonatomic,retain)NSString?*message;??
  11. ??
  12. @end??
#import <UIKit/UIKit.h>
@interface MyTableViewOneMessage : UIViewController {
IBOutlet UILabel *mylable;
NSString *message;
}
@property(nonatomic,retain)UILabel *mylable;
@property(nonatomic,retain)NSString *message;
@end

[cpp] view plaincopyprint?
  1. #import?"MyTableViewOneMessage.h" ??
  2. ??
  3. ??
  4. @implementation?MyTableViewOneMessage??
  5. ??
  6. @synthesize?mylable;??
  7. @synthesize?message;??
  8. ??
  9. -?(id)initWithNibName:(NSString?*)nibNameOrNil?bundle:(NSBundle?*)nibBundleOrNil??
  10. {??
  11. ????self?=?[super?initWithNibName:nibNameOrNil?bundle:nibBundleOrNil];??
  12. ????if?(self)?{??
  13. ????????//?Custom?initialization ??
  14. ????}??
  15. ????return?self;??
  16. }??
  17. ??
  18. -(void)viewDidAppear:(BOOL)animated{??
  19. ????self.mylable.text?=?message;??
  20. }??
  21. ??
  22. -?(void)dealloc??
  23. {??
  24. ????[mylable?release];??
  25. ????[message?release];??
  26. ????[super?dealloc];??
  27. }??
  28. ??
  29. -?(void)didReceiveMemoryWarning??
  30. {??
  31. ????//?Releases?the?view?if?it?doesn't?have?a?superview. ??
  32. ????[super?didReceiveMemoryWarning];??
  33. ??????
  34. ????//?Release?any?cached?data,?images,?etc?that?aren't?in?use. ??
  35. }??
  36. ??
  37. #pragma?mark?-?View?lifecycle ??
  38. ??
  39. -?(void)viewDidLoad??
  40. {??
  41. ????self.navigationItem.title?=?@"Tableview傳過來的值";??
  42. ????[super?viewDidLoad];??
  43. ????//?Do?any?additional?setup?after?loading?the?view?from?its?nib. ??
  44. }??
  45. ??
  46. -?(void)viewDidUnload??
  47. {??
  48. ????[super?viewDidUnload];??
  49. ????//?Release?any?retained?subviews?of?the?main?view. ??
  50. ????//?e.g.?self.myOutlet?=?nil; ??
  51. }??
  52. ??
  53. -?(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation??
  54. {??
  55. ????//?Return?YES?for?supported?orientations ??
  56. ????return?(interfaceOrientation?==?UIInterfaceOrientationPortrait);??
  57. }??
  58. ??
  59. @end??
#import "MyTableViewOneMessage.h"
@implementation MyTableViewOneMessage
@synthesize mylable;
@synthesize message;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
-(void)viewDidAppear:(BOOL)animated{
self.mylable.text = message;
}
- (void)dealloc
{
[mylable release];
[message release];
[super dealloc];
}
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
#pragma mark - View lifecycle
- (void)viewDidLoad
{
self.navigationItem.title = @"Tableview傳過來的值";
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end



本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/388345.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388345.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388345.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

PhantomJS的使用

PhantomJS安裝下載地址 配置環境變量 成功&#xff01; 轉載于:https://www.cnblogs.com/hankleo/p/9736323.html

aws emr 大數據分析_DataOps —使用AWS Lambda和Amazon EMR的全自動,低成本數據管道

aws emr 大數據分析Progression is continuous. Taking a flashback journey through my 25 years career in information technology, I have experienced several phases of progression and adaptation.進步是連續的。 在我25年的信息技術職業生涯中經歷了一次閃回之旅&…

21eval 函數

eval() 函數十分強大 ---- 將字符串 當成 有效的表達式 來求職 并 返回計算結果 1 # 基本的數學計算2 print(eval("1 1")) # 23 4 # 字符串重復5 print(eval("* * 5")) # *****6 7 # 將字符串轉換成列表8 print(eval("[1, 2, 3, 4]")) # [1,…

聯想r630服務器開啟虛擬化,整合虛擬化 聯想萬全R630服務器上市

虛擬化技術的突飛猛進&#xff0c;對運行虛擬化應用的服務器平臺的運算性能提出了更高的要求。近日&#xff0c;聯想萬全R630G7正式對外發布。這款計算性能強勁&#xff0c;IO吞吐能力強大的四路四核服務器&#xff0c;主要面向高端企業級應用而開發。不僅能夠完美承載大規模數…

Iphone屏幕旋轉

該示例是想在手機屏幕方向發生改變時重新定位視圖&#xff08;這里是一個button&#xff09; 1.創建一個View—based Application項目,并在View窗口中添加一個Round Rect Button視圖&#xff0c;通過尺寸檢查器設置其位置&#xff0c;然后單擊View窗口右上角的箭頭圖標來旋轉窗…

先進的NumPy數據科學

We will be covering some of the advanced concepts of NumPy specifically functions and methods required to work on a realtime dataset. Concepts covered here are more than enough to start your journey with data.我們將介紹NumPy的一些高級概念&#xff0c;特別是…

lsof命令詳解

基礎命令學習目錄首頁 原文鏈接&#xff1a;https://www.cnblogs.com/ggjucheng/archive/2012/01/08/2316599.html 簡介 lsof(list open files)是一個列出當前系統打開文件的工具。在linux環境下&#xff0c;任何事物都以文件的形式存在&#xff0c;通過文件不僅僅可以訪問常規…

Xcode中捕獲iphone/ipad/ipod手機攝像頭的實時視頻數據

目的&#xff1a;打開、關閉前置攝像頭&#xff0c;繪制圖像&#xff0c;并獲取攝像頭的二進制數據。 需要的庫 AVFoundation.framework 、CoreVideo.framework 、CoreMedia.framework 、QuartzCore.framework 該攝像頭捕抓必須編譯真機的版本&#xff0c;模擬器下編譯不了。 函…

統計和冰淇淋

Photo by Irene Kredenets on UnsplashIrene Kredenets在Unsplash上拍攝的照片 摘要 (Summary) In this article, you will learn a little bit about probability calculations in R Studio. As it is a Statistical language, R comes with many tests already built in it, …

信息流服務器哪種好,選購存儲服務器需要注意六大關鍵因素,你知道幾個?

原標題&#xff1a;選購存儲服務器需要注意六大關鍵因素&#xff0c;你知道幾個&#xff1f;信息技術的飛速發展帶動了整個信息產業的發展。越來越多的電子商務平臺和虛擬化環境出現在企業的日常應用中。存儲服務器作為企業建設環境的核心設備&#xff0c;在整個信息流中承擔著…

t3 深入Tornado

3.1 Application settings 前面的學習中&#xff0c;在創建tornado.web.Application的對象時&#xff0c;傳入了第一個參數——路由映射列表。實際上Application類的構造函數還接收很多關于tornado web應用的配置參數。 參數&#xff1a; debug&#xff0c;設置tornado是否工作…

vml編輯器

<HTML xmlns:v> <HEAD> <META http-equiv"Content-Type" content"text/html; Charsetgb2312"> <META name"GENERATOR" content"網絡程序員伴侶(Lshdic)2004"> <META name"GENERATORDOWNLOADADDRESS&q…

對數據倉庫進行數據建模_確定是否可以對您的數據進行建模

對數據倉庫進行數據建模Some data sets are just not meant to have the geospatial representation that can be clustered. There is great variance in your features, and theoretically great features as well. But, it doesn’t mean is statistically separable.某些數…

15 并發編程-(IO模型)

一、IO模型介紹 1、阻塞與非阻塞指的是程序的兩種運行狀態 阻塞&#xff1a;遇到IO就發生阻塞&#xff0c;程序一旦遇到阻塞操作就會停在原地&#xff0c;并且立刻釋放CPU資源 非阻塞&#xff08;就緒態或運行態&#xff09;&#xff1a;沒有遇到IO操作&#xff0c;或者通過某種…

arduino消息服務器,在C(Arduino IDE)中將API鏈接消息解析為服務器(示例代碼)

我正在使用Arduino IDE來編程我的微控制器&#xff0c;它有一個內置的Wi-Fi芯片(ESP8266 NodeMCU)&#xff0c;它連接到我的互聯網路由器&#xff0c;然后有一個特定的IP(就像192.168.1.5)。所以我想通過添加到鏈接的消息發送命令(和數據)&#xff0c;然后鏈接變為&#xff1a;…

不提拔你,就是因為你只想把工作做好

2019獨角獸企業重金招聘Python工程師標準>>> 我有個朋友&#xff0c;他30出頭&#xff0c;在500強公司做技術經理。他戴無邊眼鏡&#xff0c;穿一身土黃色的夾克&#xff0c;下面是一條常年不洗的牛仔褲加休閑皮鞋&#xff0c;典型技術高手范。 三 年前&#xff0c;…

python內置函數多少個_每個數據科學家都應該知道的10個Python內置函數

python內置函數多少個Python is the number one choice of programming language for many data scientists and analysts. One of the reasons of this choice is that python is relatively easier to learn and use. More importantly, there is a wide variety of third pa…

C#使用TCP/IP與ModBus進行通訊

C#使用TCP/IP與ModBus進行通訊1. ModBus的 Client/Server模型 2. 數據包格式及MBAP header (MODBUS Application Protocol header) 3. 大小端轉換 4. 事務標識和緩沖清理 5. 示例代碼 0. MODBUS MESSAGING ON TCP/IP IMPLEMENTATION GUIDE 下載地址&#xff1a;http://www.modb…

Hadoop HDFS常用命令

1、查看hdfs文件目錄 hadoop fs -ls / 2、上傳文件 hadoop fs -put 文件路徑 目標路徑 在瀏覽器查看:namenodeIP:50070 3、下載文件 hadoop fs -get 文件路徑 保存路徑 4、設置副本數量 -setrep 轉載于:https://www.cnblogs.com/chaofan-/p/9742633.html

SAP UI 搜索分頁技術

搜索分頁技術往往和另一個術語Lazy Loading&#xff08;懶加載&#xff09;聯系起來。今天由Jerry首先介紹S/4HANA&#xff0c;CRM Fiori和S4CRM應用里的UI搜索分頁的實現原理。后半部分由SAP成都研究院菜園子小哥王聰向您介紹Twitter的懶加載實現。 關于王聰的背景介紹&#x…