PIXNET Logo登入

阿勇的blog

跳到主文

歡迎光臨阿勇在痞客邦的小天地

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 08 週二 201411:18
  • Xcode tip


// TODO:
// FIXME:
// ???
// !!!:
 
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:xcode
▲top
  • 6月 24 週二 201411:07
  • 在file_get_contents中,保留session

設定完cookie即可 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();
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(63)

  • 個人分類:php
▲top
  • 6月 24 週二 201411:04
  • 在iOS連線中,保留session

只需要將cookie存在cookieStorage裡即可 - (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;
}
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(4)

  • 個人分類:Objective-C
▲top
  • 5月 15 週四 201411:24
  • 下列字體亦可依照 app 需求安裝(Apps can download the following fonts if necessary)?

在設計iOS app時,常需要用到一些字型
這時候就可以參考一下font list
但是讓我疑惑的是,下列字體亦可依照 app 需求安裝是要如何安裝。
後來在apple上,發現這個
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:iOS
▲top
  • 5月 09 週五 201416:20
  • convert color code to UIColor

+ (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)];
}
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(4)

  • 個人分類:Objective-C
▲top
  • 5月 06 週二 201417:23
  • white line on iOS7

今天突然發現我的元件上有一條白線,
不管是用path或讀圖畫出來的都後。
而且iOS6,還沒事。
google後,才發現是antialias搞。
CGContextSetShouldAntialias(context, NO); 參考
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(0)

  • 個人分類:Objective-C
▲top
  • 3月 18 週二 201410:09
  • Threading in Python

有thread和threading二種方式
參考
threadthreading
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(1)

  • 個人分類:python
▲top
  • 3月 10 週一 201413:00
  • 關於mysqlnd cannot connect to MySQL 4.1+

一直遇到php連不上MySQL的問題
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
後來才發現原來是MySQL換密碼加密的方式,所以只要SET PASSWORD = PASSWORD('your_existing_password')
後來又發現要將SET SESSION old_passwords = 0;才行
詳細內容
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(19)

  • 個人分類:SQL
▲top
  • 3月 08 週六 201410:33
  • 更改MySql的DATETIME column

UPDATE `tablename` SET `time`=DATE_SUB(`time`, INTERVAL 3 HOUR) WHERE 1
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(2)

  • 個人分類:SQL
▲top
  • 2月 11 週二 201414:48
  • Objective-C 也可以像json一樣宣告NSArray和NSDictionary

NSArray *words = @[@"list", @"of", @"words", @123, @3.14];
NSDictionary *d = @{ @"key": @"value" };
參考資料
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(25)

  • 個人分類:Objective-C
▲top
«123...13»

個人資訊

阿勇
暱稱:
阿勇
分類:
不設分類
好友:
累積中
地區:

熱門文章

  • (0)Cordova速記
  • (0)Cordova run simulation
  • (5)swift速記
  • (1)cordova發布到andriod
  • (4)迷香
  • (11)notification results in “unrecognized selector sent to instance…”
  • (0)分開設定xcode的configureration
  • (10)關於doesNotRecognizeSelector引起的exception crash
  • (1)在SQL中,當二個鍵同時相等時,唯一鍵成立。
  • (56)防止繼承的delegate跟原本的衝突(how to extend a protocol for a delegate in objective C)

文章分類

  • 替代役的日子 (5)
  • 黑色鈣片 (4)
  • java (3)
  • picasa (1)
  • lua (1)
  • mingw (1)
  • nsis (1)
  • squirrel (1)
  • freetype (1)
  • bitmap font (7)
  • windows (5)
  • c (1)
  • NetBeans (2)
  • uml (1)
  • html5 (1)
  • Wheel Light (4)
  • Qt (26)
  • opengl (6)
  • chrome (2)
  • hg (2)
  • mac (4)
  • apns (1)
  • python (4)
  • php (2)
  • SQL (4)
  • iOS (3)
  • xcode (4)
  • Objective-C (8)
  • phonegap (1)
  • swift (1)
  • cordova (2)
  • 未分類文章 (1)

最新文章

  • Cordova速記
  • Cordova run simulation
  • swift速記
  • cordova發布到andriod
  • 迷香
  • notification results in “unrecognized selector sent to instance…”
  • 分開設定xcode的configureration
  • 關於doesNotRecognizeSelector引起的exception crash
  • 在SQL中,當二個鍵同時相等時,唯一鍵成立。
  • 防止繼承的delegate跟原本的衝突(how to extend a protocol for a delegate in objective C)

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: