時區日期處理及定時 (NSDate,NSCalendar,NSTimer,NSTimeZone)

NSDate存儲的是世界標準時(UTC),輸出時需要根據時區轉換為本地時間

Dates

? ? ? NSDate類提供了創建date,比較date以及計算兩個date之間間隔的功能。Date對象是不可改變的。

? ? ? 如果你要創建date對象并表示當前日期,你可以alloc一個NSDate對象并調用init初始化:

NSDate *now = [[NSDate alloc] init];  

? ? ? 或者使用NSDate的date類方法來創建一個日期對象。如果你需要與當前日期不同的日期,你可以使用NSDate的initWithTimeInterval...或dateWithTimeInterval...方法,你也可以使用更復雜的calendar或date components對象。

? ? ? 創建一定時間間隔的NSDate對象:

NSTimeInterval secondsPerDay = 24 * 60 * 60;    NSDate *tomorrow = [[NSDate alloc] initWithTimeIntervalSinceNow:secondsPerDay];    NSDate *yesterday = [[NSDate alloc] initWithTimeIntervalSinceNow:-secondsPerDay];    [tomorrow release];    
[yesterday release];    

? ? ? 使用增加時間間隔的方式來生成NSDate對象:

NSTimeInterval secondsPerDay = 24 * 60 * 60;    NSDate *today = [[NSDate alloc] init];    
NSDate *tomorrow, *yesterday;    tomorrow = [today dateByAddingTimeInterval: secondsPerDay];    
yesterday = [today dateByAddingTimeInterval: -secondsPerDay];    [today release];  

? ? ? 如果要對NSDate對象進行比較,可以使用isEqualToDate:, compare:, laterDate:和 earlierDate:方法。這些方法都進行精確比較,也就是說這些方法會一直精確比較到NSDate對象中秒一級。例如,你可能比較兩個日期,如果他們之間的間隔在一分鐘之內則認為這兩個日期是相等的。在這種情況下使用,timeIntervalSinceDate:方法來對兩個日期進行比較。下面的代碼進行了示例:

if (fabs([date2 timeIntervalSinceDate:date1]) < 60) ...   

NSCalendar & NSDateComponents

? ? ? 日歷對象封裝了對系統日期的計算,包括這一年開始,總天數以及劃分。你將使用日歷對象對絕對日期與date components(包括年,月,日,時,分,秒)進行轉換。

? ? ? NSCalendar定義了不同的日歷,包括佛教歷,格里高利歷等(這些都與系統提供的本地化設置相關)。NSCalendar與NSDateComponents對象緊密相關。

? ? ? 你可以通過NSCalendar對象的currentCalendar方法來獲得當前系統用戶設置的日歷。

  1. NSCalendar?*currentCalendar?=?[NSCalendar?currentCalendar];????
  2. NSCalendar?*japaneseCalendar?=?[[NSCalendar?alloc]?initWithCalendarIdentifier:NSJapaneseCalendar];????
  3. NSCalendar?*usersCalendar?=?[[NSLocale?currentLocale]?objectForKey:NSLocaleCalendar]; ? ?

? ? ? usersCalendar和currentCalendar對象是相等的,盡管他們是不同的對象。

? ? ? 你可以使用NSDateComponents對象來表示一個日期對象的組件——例如年,月,日和小時。如果要使一個NSDateComponents對象有意義,你必須將其與一個日歷對象相關聯。下面的代碼示例了如何創建一個NSDateComponents對象:

  1. NSDateComponents?*components?=?[[NSDateComponents?alloc]?init];????
  2. ????
  3. [components?setDay:6];????
  4. [components?setMonth:5];????
  5. [components?setYear:2004];????
  6. ????
  7. NSInteger?weekday?=?[components?weekday];?//?Undefined?(==?NSUndefinedDateComponent)????

? ? ? ? 要將一個日期對象解析到相應的date components,你可以使用NSCalendar的components:fromDate:方法。此外日期本身,你需要指定NSDateComponents對象返回組件。

NSDate *today = [NSDate date];    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    NSDateComponents *weekdayComponents = [gregorian components:(NSDayCalendarUnit | NSWeekdayCalendarUnit) fromDate:today];    NSInteger day = [weekdayComponents day];    
NSInteger weekday = [weekdayComponents weekday];  

  同樣你也可以從NSDateComponents對象來創建NSDate對象: ?

NSDateComponents *components = [[NSDateComponents alloc] init];    [components setWeekday:2]; // Monday    
[components setWeekdayOrdinal:1]; // The first Monday in the month    
[components setMonth:5]; // May    
[components setYear:2008];    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    NSDate *date = [gregorian dateFromComponents:components];    

? ? ? 為了保證正確的行為,您必須確保使用的組件在日歷上是有意義的。指定“出界”日歷組件,如一個-6或2月30日在公歷中的日期值產生未定義的行為。

? ? ? 你也可以創建一個不帶年份的NSDate對象,這樣的操作系統會自動生成一個年份,但在后面的代碼中不會使用其自動生成的年份。

NSDateComponents *components = [[NSDateComponents alloc] init];    [components setMonth:11];    
[components setDay:7];    NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    NSDate *birthday = [gregorian dateFromComponents:components];   

下面的示例顯示了如何從一個日歷置換到另一個日歷:

 1 NSDateComponents *comps = [[NSDateComponents alloc] init];    
 2     
 3 [comps setDay:6];    
 4 [comps setMonth:5];    
 5 [comps setYear:2004];    
 6     
 7 NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    
 8     
 9 NSDate *date = [gregorian dateFromComponents:comps];    
10     
11 [comps release];    
12 [gregorian release];    
13     
14 NSCalendar *hebrew = [[NSCalendar alloc] initWithCalendarIdentifier:NSHebrewCalendar];    
15     
16 NSUInteger unitFlags = NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit;    
17     
18 NSDateComponents *components = [hebrew components:unitFlags fromDate:date];    
19     
20 NSInteger day = [components day]; // 15    
21 NSInteger month = [components month]; // 9    
22 NSInteger year = [components year]; // 5764  

歷法計算

? ? 在當前時間加上一個半小時:

 1 NSDate *today = [[NSDate alloc] init];    
 2     
 3 NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    
 4     
 5 NSDateComponents *offsetComponents = [[NSDateComponents alloc] init];    
 6     
 7 [offsetComponents setHour:1];    
 8 [offsetComponents setMinute:30];    
 9     
10 // Calculate when, according to Tom Lehrer, World War III will end    
11 NSDate *endOfWorldWar3 = [gregorian dateByAddingComponents:offsetComponents toDate:today options:0]; 

? ? 獲得當前星期中的星期天(使用格里高利歷):

 1 NSDate *today = [[NSDate alloc] init];    
 2     
 3 NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    
 4     
 5 // Get the weekday component of the current date    
 6 NSDateComponents *weekdayComponents = [gregorian components:NSWeekdayCalendarUnit fromDate:today];    
 7     
 8 /*   
 9 Create a date components to represent the number of days to subtract from the current date.   
10    
11 The weekday value for Sunday in the Gregorian calendar is 1, so subtract 1 from the number of days to subtract from the date in question.  (If today is Sunday, subtract 0 days.)   
12 */    
13     
14 NSDateComponents *componentsToSubtract = [[NSDateComponents alloc] init];    
15     
16 [componentsToSubtract setDay: 0 - ([weekdayComponents weekday] - 1)];    
17     
18 NSDate *beginningOfWeek = [gregorian dateByAddingComponents:componentsToSubtract toDate:today options:0];    
19     
20 /*   
21 Optional step:   
22 beginningOfWeek now has the same hour, minute, and second as the original date (today).   
23    
24 To normalize to midnight, extract the year, month, and day components and create a new date from those components.   
25 */    
26     
27 NSDateComponents *components = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) fromDate: beginningOfWeek];    
28     
29 beginningOfWeek = [gregorian dateFromComponents:components];    

?? ? 如何可以計算出一周的第一天(根據系統的日歷設置):

NSDate *today = [[NSDate alloc] init];    NSDate *beginningOfWeek = nil;    BOOL ok = [gregorian rangeOfUnit:NSWeekCalendarUnit startDate:&beginningOfWeek interval:NULL forDate: today];

? ? 獲得兩個日期之間的間隔:

 1 NSDate *startDate = ...;    
 2 NSDate *endDate = ...;    
 3     
 4 NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];    
 5     
 6 NSUInteger unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit;    
 7     
 8 NSDateComponents *components = [gregorian components:unitFlags fromDate:startDate toDate:endDate options:0];    
 9     
10 NSInteger months = [components month];    
11 NSInteger days = [components day];  

??? 使用Category來計算同一時代(AD|BC)兩個日期午夜之間的天數:

 1 @implementation NSCalendar (MySpecialCalculations)    
 2     
 3 -(NSInteger)daysWithinEraFromDate:(NSDate *) startDate toDate:(NSDate *) endDate {    
 4      NSInteger startDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:startDate];    
 5     
 6      NSInteger endDay=[self ordinalityOfUnit:NSDayCalendarUnit inUnit: NSEraCalendarUnit forDate:endDate];    
 7     
 8      return endDay-startDay;    
 9 }    
10     
11 @end

? ? 使用Category來計算不同時代(AD|BC)兩個日期的天數:

 1 @implementation NSCalendar (MyOtherMethod)    
 2     
 3 -(NSInteger) daysFromDate:(NSDate *) startDate toDate:(NSDate *) endDate {    
 4     
 5      NSCalendarUnit units=NSEraCalendarUnit | NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;    
 6     
 7      NSDateComponents *comp1=[self components:units fromDate:startDate];    
 8      NSDateComponents *comp2=[self components:units fromDate endDate];    
 9     
10      [comp1 setHour:12];    
11      [comp2 setHour:12];    
12     
13      NSDate *date1=[self dateFromComponents: comp1];    
14      NSDate *date2=[self dateFromComponents: comp2];    
15     
16      return [[self components:NSDayCalendarUnit fromDate:date1 toDate:date2 options:0] day];    
17 }    
18     
19 @end

  判斷一個日期是否在當前一周內(使用格里高利歷):

 1 -(BOOL)isDateThisWeek:(NSDate *)date {    
 2     
 3      NSDate *start;    
 4      NSTimeInterval extends;    
 5     
 6      NSCalendar *cal=[NSCalendar autoupdatingCurrentCalendar];    
 7      NSDate *today=[NSDate date];    
 8     
 9      BOOL success= [cal rangeOfUnit:NSWeekCalendarUnit startDate:&start interval: &extends forDate:today];    
10     
11      if(!success)    
12         return NO;    
13     
14      NSTimeInterval dateInSecs = [date timeIntervalSinceReferenceDate];    
15      NSTimeInterval dayStartInSecs= [start timeIntervalSinceReferenceDate];    
16     
17      if(dateInSecs > dayStartInSecs && dateInSecs < (dayStartInSecs+extends)){    
18           return YES;    
19      }    
20      else {    
21           return NO;    
22      }    
23 }

1、獲取當前時間

  1. NSDateFormatter*formatter?=?[[NSDateFormatteralloc]?init];??
  2. [formatter?setDateFormat:@"yyyy-MM-dd?hh:mm:ss"];??
  3. NSString?*locationString=[formatter?stringFromDate:?[NSDate?date]]; ?

另外的方法:

1 -(NSString *)getDate  
2 {  
3   NSDateFormatter*formatter = [[NSDateFormatteralloc] init];  
4   [formatter setDateFormat:@"yyyy-MM-dd EEEE HH:mm:ss a"];  
5   NSString *locationString=[formatter stringFromDate: [NSDate date]];  
6   [formatter release];  
7   return locationString;  
8 }  

//大寫的H日期格式將默認為24小時制,小寫的h日期格式將默認為12小時

//不需要特別設置,只需要在dataFormat里設置類似"yyyy-MMM-dd"這樣的格式就可以了

?

日期格式如下:

y ?年 ?Year ?1996; 96 ?

M ?年中的月份 ?Month ?July; Jul; 07 ?

w ?年中的周數 ?Number ?27 ?

W ?月份中的周數 ?Number ?2 ?

D ?年中的天數 ?Number ?189 ?

d ?月份中的天數 ?Number ?10 ?

F ?月份中的星期 ?Number ?2 ?

E ?星期中的天數 ?Text ?Tuesday; Tue ?

a ?Am/pm 標記 ?Text ?PM ?

H ?一天中的小時數(0-23) ?Number ?0 ?

k ?一天中的小時數(1-24) ?Number ?24 ?

K ?am/pm 中的小時數(0-11) ?Number ?0 ?

h ?am/pm 中的小時數(1-12) ?Number ?12 ?

m ?小時中的分鐘數 ?Number ?30 ?

s ?分鐘中的秒數 ?Number ?55 ?

S ?毫秒數 ?Number ?978 ?

z ?時區 ?General time zone ?Pacific Standard Time; PST; GMT-08:00 ?

Z ?時區 ?RFC 822 time zone ?-0800

?

2、NSTimer定時器的基本操作方式

NSTimer是Cocoa中比較常用的定時器類,基本操作如下:

handleTimer方法可以自行定義。在需要的地方創建timer即可,handleTimer就可以每0.5秒執行一次。

1  - (void) handleTimer: (NSTimer *) timer  
2 {  
3    //在這里進行處理  
4 }   
5 NSTimer *timer;  
6 timer = [NSTimer scheduledTimerWithTimeInterval: 0.5 target: self selector: @selector(handleTimer:)userInfo: nil repeats: YES];  

?3、定時器

  設置定時器下面顯示的定時器將在一秒鐘后觸發,并一直重復直到定時器被禁用。定時器每次激活時,就會調用發送選擇器消息的目標來進行初始化。回調方法帶有一個參數,就是定時器本身.要禁用一個定時器,給它發送invalidate消息,這將釋放定時器對象并把它從當前運行循環中刪除。

1 NSTime *timer ;  
2 timer = [NSTimer scheduledTimerWithTimeInterval:1.0target:self selector:@selector(handlTimer:) userInfo:nilrepeats:YES];  
3   
4 - (void)handleTimer:(NSTimer *)timer{  
5 printf("timer count: %d", count++);  
6 if(count > 3)  
7 {  
8 [timer invalidate];  
9 }  

1. 使用 NSTimeZone 取得世界各地時間的方法

?下列程式碼將示范,如何利用 NSTimeZone 取得世界上已知的時區名稱,并且透過這些名稱來獲得當地時間,如果在系統時間的取得上有任何疑問,可以參考取得 iOS 系統日期與星期的方法一文,其程式碼如下。

 1 //取得目前已知的所有地里名稱  
 2 NSArray *timeZoneNames = [NSTimeZone knownTimeZoneNames];   
 3   
 4 //取得本地目前時間  
 5 NSDate *date = [NSDate date];   
 6   
 7 for(NSString *name in timeZoneNames) {   
 8 NSTimeZone *timezone = [[NSTimeZone alloc] initWithName:name];   
 9 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];   
10   
11 //設定時間格式  
12 [formatter setDateFormat:@"YYYY-MM-d HH:mm:ss"];   
13   
14 //設定時區  
15 [formatter setTimeZone:timezone];   
16   
17 //時間格式正規化并做時區校正  
18 NSString *correctDate = [formatter stringFromDate:date];  
19   
20 NSLog(@"地點:%@ 當地時間:%@",[timezone name], correctDate);   
21   
22 [formatter release];   
23 [timezone release];   
24 }  

?  由于能取得的地點相當多,下圖只是部份的執行結果。

?

2. 取得 iOS 系統日期與星期的方法

?

  在之前的文章中已經說明如何取得 Device 里的 iOS 系統時間,在此將在示范如何使用 NSDate 取得系統的日期與星期,請看以下程式碼

1 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];  
2 NSDate *date = [NSDate date];   
3   
4 //正規化的格式設定  
5 [formatter setDateFormat:@"YYYY-MM-dd' 'EEEE"];  
6   
7 //正規化取得的系統時間并顯示  
8 dateLabel.text = [formatter stringFromDate:date]; 

  當然 NSFormatter 能正規化的格式不只這些,想知道其他的參數可以參考關于 NSDateFormatter 的二三事一文。

3. 取得 iOS 系統時間的方法

  如何取得 Device 里的 iOS 系統時間,可以參考以下程式碼。

 1 NSDateFormatter *formatter = [[NSDateFormatter alloc] init];  
 2 NSDate *date = [NSDate date];  
 3   
 4 //正規化的格式設定  
 5 [formatter setTimeStyle:NSDateFormatterFullStyle];  
 6   
 7 //正規化取得的系統時間并顯示  
 8 timeLabel.text = [formatter stringFromDate:date];  
 9   
10 [formatter release];

?在時間格式正規化的部份也有多種樣式可供選擇,其樣式如下。

  1. [formatter?setTimeStyle:NSDateFormatterFullStyle];??
  2. [formatter?setTimeStyle:NSDateFormatterLongStyle];??
  3. [formatter?setTimeStyle:NSDateFormatterMediumStyle];??
  4. [formatter?setTimeStyle:NSDateFormatterShortStyle]; ?

最后,如果要讓時間與現實時間同步可以考慮實做計時器 Timer 來解決此問題,詳細的設定方式可參閱 Timer / 計時器的基本使用方法。

4. Timer / 計時器的基本使用方法

?這里介紹 Timer 的基本使用方法,首先設定 Timer 的相關的參數,程式碼如下。(View-based Template)

 1 //自行定義的函式,用來設定使用Timer/計時器的相關參數  
 2 -(void)initializeTimer {  
 3   
 4 //設定Timer觸發的頻率,每秒30次  
 5 float theInterval = 1.0/30.0;  
 6 fpsLabel.text = [NSString stringWithFormat:@"%0.3f", theInterval];  
 7   
 8 //正式啟用Timer,selector是設定Timer觸發時所要呼叫的函式  
 9 [NSTimer scheduledTimerWithTimeInterval:theInterval   
10 target:self  
11 selector:@selector(countTotalFrames:)   
12 userInfo:nil  
13 repeats:YES];  
14 }  

???上述程式碼,已經完成 Timer 的基本設定,而下列程式碼則是 Timer 觸發時所呼叫的函式寫法。

1 -(void)countTotalFrames:(NSTimer *)theTimer {  
2 frameCount ++;  
3 framesLabel.text = [NSString stringWithFormat:@"%d", frameCount];  
4 } 

?最后,別忘記在程式進入點這邊要呼叫自行定義的 initializeTimer 函式,才能讓 Timer 運作。

轉載于:https://www.cnblogs.com/tryingx/articles/3720606.html

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

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

相關文章

Android ListView分頁,動態添加數據

1.ListView分頁的實現&#xff0c;重點在于實現OnScrollListener接口&#xff0c;判斷滑動到最后一項時&#xff0c;是否還有數據可以加載&#xff0c; 我們可以利用listView.addFootView(View v)方法進行提示 自定義一個ListView&#xff08;這里本來想進行一些自定已修改的。…

faster rcnn的測試

當訓練結束后&#xff0c;faster rcnn的模型保存在在py-faster-rcnn/output目錄下&#xff0c;這時就可以用已有的模型對新的數據進行測試。 下面簡要說一下測試流程。 測試的主要代碼是./tools/test_net.py&#xff0c;并且使用到了fast_rcnn中test.py。 主要流程就是&…

python重點知識 鉆石_python——子類對象如何訪問父類的同名方法

1. 為什么只說方法不說屬性關于“子類對象如何訪問父類的同名屬性“是沒有意義的。因為父類的屬性子類都有&#xff0c;子類還有父類沒有的屬性&#xff0c;在初始化時&#xff0c;給子類對象具體化所有的給定屬性&#xff0c;完全沒必要訪問父類的屬性&#xff0c;因為是一樣的…

Android-Universal-Image-Loader 的使用說明

這個圖片異步載入并緩存的類已經被非常多開發人員所使用&#xff0c;是最經常使用的幾個開源庫之中的一個&#xff0c;主流的應用&#xff0c;隨便反編譯幾個火的項目&#xff0c;都能夠見到它的身影。但是有的人并不知道怎樣去使用這庫怎樣進行配置&#xff0c;網上查到的信息…

faster rcnn end2end 訓練與測試

除了前面講過的rpn與fast rcnn交替訓練外&#xff0c;faster rcnn還提供了一種近乎聯合的訓練&#xff0c;姑且稱為end2end訓練。 根據論文所講&#xff0c;end2end的訓練一氣呵成&#xff0c;對于前向傳播&#xff0c;rpn可以作為預設的網絡提供proposal.而在后向傳播中&…

jquery ui動態切換主題的一種實現方式

這兩天看coreservlets上的jQuery教程&#xff0c;雖然比較老了&#xff0c;不過講得還是不錯。最后一部分講jQuery ui 主題切換&#xff0c;用他介紹的方法實現不了。于是自己修改了下&#xff0c;可以了。代碼如下&#xff1a;html部分&#xff1a;<fieldset class"ui…

[學習總結]7、Android AsyncTask完全解析,帶你從源碼的角度徹底理解

我們都知道&#xff0c;Android UI是線程不安全的&#xff0c;如果想要在子線程里進行UI操作&#xff0c;就需要借助Android的異步消息處理機制。之前我也寫過了一篇文章從源碼層面分析了Android的異步消息處理機制&#xff0c;感興趣的朋友可以參考 Android Handler、Message完…

python字頻統計軟件_python結巴分詞以及詞頻統計實例

python結巴分詞以及詞頻統計實例發布時間&#xff1a;2018-03-20 14:52,瀏覽次數&#xff1a;773, 標簽&#xff1a;python# codingutf-8Created on 2018年3月19日author: chenkai結巴分詞支持三種分詞模式&#xff1a;精確模式: 試圖將句子最精確地切開&#xff0c;適合文…

html從入門到賣電腦(三)

CSS3中和動畫有關的屬性有三個 transform、 transition 和 animation。下面來一一說明: transform 從字面來看transform的釋義為改變&#xff0c;使…變形&#xff1b;轉換 。這里我們就可以理解為變形。那都能怎么變呢&#xff1f; none 表示不進行變換&#xff1b; rotat…

visual studio 2015安裝 無法啟動程序,因為計算機丟失D3DCOMPILER_47.dll 的解決方法

對于題目中的解決方法&#xff0c;我查到了微軟提供的一個方案&#xff1a;https://support.microsoft.com/en-us/help/4019990/update-for-the-d3dcompiler-47-dll-component-on-windows 進入如下頁面&#xff1a;http://www.catalog.update.microsoft.com/Search.aspx?qKB4…

UI1_UIView層操作

// // ViewController.m // UI1_UIView層操作 // // Created by zhangxueming on 15/7/1. // Copyright (c) 2015年 zhangxueming. All rights reserved. //#import "ViewController.h"interface ViewController ()endimplementation ViewController- (void)view…

JavaScript Patterns 1 Introduction

1.1 Pattern "theme of recurring events or objects… it can be a template or model which can be used to generate things" (http://en.wikipedia.org/wiki/Pattern). ? Design patterns - Elements of Reusable Object-Oriented Software. ? Coding patte…

基于像素聚類的分割方法基于slic的方法_博士論文摘要 | 張榮春:數碼影像與TLS點云數據融合提取地質結構面方法研究...

《測繪學報》構建與學術的橋梁 拉近與權威的距離數碼影像與TLS點云數據融合提取地質結構面方法研究張榮春1,21.南京郵電大學地理與生物信息學院, 江蘇 南京 210023;2.河海大學地球科學與工程學院, 江蘇 南京 211100收稿日期&#xff1a;2019-03-27基金項目&#xff1a;國家自然…

制作IOS 后臺極光推送時,遇到的小問題

推送廣義上分為兩種&#xff0c; 一種是 程序在前臺的時候&#xff0c;不想在任務欄里面顯示通知&#xff0c;直接在app中進行某種操作。這個叫做自定義消息。這個是在前臺時&#xff0c;app與極光后臺建立了一個長鏈接。 另一種是 程序處于前、后臺 或者殺死狀態的時候&…

Visual Studio 2008 環境變量的配置(參考設置VS2010)

本文轉載自&#xff1a;http://blog.csdn.net/tracyliang223/article/details/21539361COPY FROM&#xff1a;http://www.cnblogs.com/waterlin/archive/2011/10/31/2230341.html 在調試 Visual Studio 2008 程序時&#xff0c;經常有一些動態鏈接庫&#xff08;即 dll 文件&am…

Linq 中 Any與All

昨天突然看到之前寫的一個積累文檔&#xff0c;其中文檔中有一個Linq Any和All的注意事項&#xff1a;注意Any 和 All var list new List<int>(); var aa list.All(n > n > 1); var bb list.Any(n > n > 1); // aa: true bb: false其中List是一個元…

jaxb轉xml空值雙標簽_單品運營思維:標簽-詞路-聚焦-直搜-超直

非標品標簽思維&#xff1a;針對非標品 主要是2.0為主的打法根據搜索入池的關鍵詞&#xff0c;有什么詞做什么詞。有個細節&#xff1a;不一定進什么詞做什么詞&#xff0c;這個維度當中加入3.0的思維3.0入手 轉2.0再切3.0(檢測詞路健康度&#xff0c;非嚴格意義估算單量)舉例&…

如何在PFSense中設置故障轉移和負載平衡

故障轉移是一種備份操作模式&#xff0c;僅在主系統由于系統故障或任何計劃停機時間而變得不可用時&#xff0c;系統組件&#xff08;如網絡&#xff09;的操作才由輔助系統承擔。在本教程中&#xff0c;我們將看到如何設置故障轉移和負載平衡&#xff0c;以使pfSense能夠將流量…

圖像金字塔總結

本文轉載自&#xff1a; http://blog.csdn.net/dcrmg/article/details/52561656 一、 圖像金字塔 圖像金字塔是一種以多分辨率來解釋圖像的結構&#xff0c;通過對原始圖像進行多尺度像素采樣的方式&#xff0c;生成N個不同分辨率的圖像。把具有最高級別分辨率的圖像放在底部…

表單的get和post使用情景

GET和POST兩種方法都是將數據送到服務器&#xff0c;但你該用哪一種呢&#xff1f;HTTP標準包含這兩種方法是為了達到不同的目的。POST用于創建資源&#xff0c;資源的內容會被編入HTTP請示的內容中。例如&#xff0c;處理訂貨表單、在數據庫中加入新數據行等。 當請求無副作用…