幸福,來自於簡單。
好好的吃一頓,享受簡單的幸福。
跟心愛的人說幾句貼心的話,傳遞簡單的幸福。
愛情經常讓我們覺得幸福,但是也給我們帶來困擾。
那是因為我們把它弄複雜了。愛情,要越簡單越好。
所謂愛情,就是沒有原則,沒有矜持,想愛就愛。
沒有三山五嶽,沒有披星戴月,沒有日出日落,沒有春夏秋冬。
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
ALTER TABLE [dbo].[TABLE] ADD CONSTRAINT
UNIQUE_Table UNIQUE CLUSTERED
(
col1,
col2
)
參考文件
@interface PlaceView () <MapViewDelegate> {
id placeSelegate;
}
@end
@implementation PlaceView
- (id)init
{
self = [super initWithSearch];
if (self) {
super.delegate = self;
}
return self;
}
# pragma mark public PlaceView
- (void)setDelegate:(id)delegate
{
placeSelegate = delegate;
}
- (void)done
{
if ([placeDelegate respondsToSelector:@selector(placeSelected:)])
{
[placeDelegate placeSelected:[map placeInfo]];
}
}
session_start();
$context = stream_context_create(array(
'http' => array(
'method' => 'POST',
'header' => "Content-Type: application/json\r\n".
'Cookie: '.session_name().'='.session_id()."\r\n"
)));
session_write_close();
- (NSData *)send:(NSHTTPURLResponse**)urlResponse
{
NSError *errorState = nil;
NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:urlResponse error:&errorState];
// process cookie
NSArray *allCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:[*urlResponse allHeaderFields] forURL:[*urlResponse URL]];
if ([allCookies count]) {
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:allCookies forURL:[*urlResponse URL] mainDocumentURL:nil];
}
return result;
}
+ (UIColor*)colorWithColorCode:(NSString*)hex
{
NSString *cString = [[hex stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
// String should be 6 or 8 or 10 characters
if ([cString length] < 6) return [UIColor grayColor];
// strip 0X if it appears
if ([cString hasPrefix:@"0X"]) cString = [cString substringFromIndex:2];
if ([cString length] != 6 && [cString length] != 8) return [UIColor grayColor];
// Separate into r, g, b substrings
NSRange range;
range.location = 0;
range.length = 2;
NSString *rString = [cString substringWithRange:range];
range.location = 2;
NSString *gString = [cString substringWithRange:range];
range.location = 4;
NSString *bString = [cString substringWithRange:range];
NSString *aString = @"FF";
range.location = 6;
if ([cString length] == 8)
aString = [cString substringWithRange:range];
// Scan values
unsigned int r, g, b, a;
[[NSScanner scannerWithString:rString] scanHexInt:&r];
[[NSScanner scannerWithString:gString] scanHexInt:&g];
[[NSScanner scannerWithString:bString] scanHexInt:&b];
[[NSScanner scannerWithString:aString] scanHexInt:&a];
return [UIColor colorWithRed:((float) r / 255.0f)
green:((float) g / 255.0f)
blue:((float) b / 255.0f)
alpha:((float) a / 255.0f)];
}
參考
mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new, and more secure, hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file