<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Netseye</title>
	<atom:link href="http://www.xffox.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xffox.com/blog</link>
	<description>objective-c,php,javascript,actionscript,mysql,linux,mac os,snow leopard</description>
	<lastBuildDate>Tue, 23 Aug 2011 09:26:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>关于 ios开发 oauth 安全性问题</title>
		<link>http://www.xffox.com/blog/archives/334</link>
		<comments>http://www.xffox.com/blog/archives/334#comments</comments>
		<pubDate>Tue, 23 Aug 2011 09:13:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=334</guid>
		<description><![CDATA[关于oauth得详解在这里就不多说了.关于ios开发中得oauth认证过程为了方便用户使用一半会考虑用uiwebview来实现这个授权过程.然而在这个过程中..可以通过webview得委托方法抓到用户得帐号密码.简单分析以下post信息也包含在httpbody里,通过相应的委托方法 可以获得到当前页面的httpbody然后分析出post信息. - (BOOL) webView: (UIWebView *) webView shouldStartLoadWithRequest: (NSURLRequest *) request navigationType: (UIWebViewNavigationType) navigationType { NSData *data = [request HTTPBody]; NSLog(@&#8221;===%@&#8221;,[[[NSString alloc] initWithData:data encoding: NSUTF8StringEncoding] autorelease]); return YES; } 2011-08-23 17:00:41.154 weiQo[16073:b303] ===action=submit&#038;regCallback=http%253A%252F%252Fapi.t.sina.com.cn%252Foauth%252Fmobilehtml5%253Foauth_token%253Dbaf7b00e4390d85ae38df5f57c185960%2526oauth_callback%253Doauth%253A%252F%252Fweiqo.com%2526from%253D&#038;oauth_token=baf7b00e4390d85ae38df5f57c185960&#038;display=null&#038;oauth_callback=oauth%3A%2F%2Fweiqo.com&#038;from=&#038;userId=Netseye%40gmail.com&#038;passwd=********(密码省略); 不过我认为这个问题会有很多有人心人在意]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/334/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FPS 游戏主循环&#8212;-转载</title>
		<link>http://www.xffox.com/blog/archives/331</link>
		<comments>http://www.xffox.com/blog/archives/331#comments</comments>
		<pubDate>Mon, 15 Aug 2011 08:25:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Game]]></category>
		<category><![CDATA[FPS]]></category>
		<category><![CDATA[主循环]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=331</guid>
		<description><![CDATA[原文地址 http://dewitters.koonsolo.com/gameloop.html 游戏主循环 引言 游戏主循环是每个游戏的心跳，输送着整个游戏需要的养分。不幸的是没有任何一篇好的文章来指导一个菜鸟游戏程序员如何为自己的程序供养。不过不用担心，因为你刚好不小心看到了这篇，也是唯一一篇给予这个话题足够重视的文章。 由于我身为游戏程序员，我见过许许多多的手机小游戏的代码。这些代码给我展示了五彩缤纷的游戏主循环实现方法。你可能要问：“这么简单的一个小玩意还能做到千奇百怪？” 事实就是这样，我就会在此文中讨论一些主流实现的优缺点，并且给你介绍在我看来最好的输送养分的解决方案。 游戏主循环 每一个游戏都是由获得用户输入，更新游戏状态，处理AI，播放音乐和音效，还有画面显示这些行为组成。游戏主循环就是用来处理这个行为序列。如我在引言中所说，游戏主循环是每一个游戏的心跳。在此文中我不会深入讲解上面提到的任何一个行为，而只详细介绍游戏主循环。所以我把这些行为简化为了两个函数： update_game(); //更新游戏状态 （后文可能翻译为逻辑帧） display_game(); //更新显示 （显示帧） 下面是最简单的游戏主循环： bool game_is_running = true; while( game_is_running ) { update_game(); display_game(); } 这个简单循环的主要问题是它忽略了时间，游戏会尽情的飞奔。在小霸王机器上运行会使玩家有极强的挫败感，在牛逼的机器上运行则会要求玩家有超人的判断力和APM（原意为慢的机器上运行慢，快的机器上运行快%26#8230;%26#8230;）。在远古时代，硬件的速度已知的情况下，这不算什么，但是目前有如此多的硬件平台使得我们不得不去处理时间这个重要因素。对于时间的处理有很多的方法，接下来我会一一奉上。 首先我会解释两个贯穿全文的术语： 每秒帧数（后简称FPS） FPS是Frames Per Second的缩写。在此文的上下文中它意味着display_game()每秒被调用的次数。 游戏速度 游戏速度是每秒更新游戏状态的速度，换言之，即update_game()每秒被调用的次数。 FPS依赖于恒定的游戏速度 实现 一个让游戏每秒稳定运行在25帧的解决方案如下： const int FRAMES_PER_SECOND = 25; const int SKIP_TICKS = 1000 / FRAMES_PER_SECOND; DWORD next_game_tick = GetTickCount(); // [...]]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/331/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>计算NSString字节长度，中文如何按2字节计算</title>
		<link>http://www.xffox.com/blog/archives/327</link>
		<comments>http://www.xffox.com/blog/archives/327#comments</comments>
		<pubDate>Thu, 28 Jul 2011 07:29:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=327</guid>
		<description><![CDATA[这个问题得回归倒基础上面。字符串的长度跟编码有关系。utf8是变长，gbk是双字节 所以看如下代码 NSString *test = [NSString stringWithString:@"这是一个中文test1"]; NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); NSLog(@&#8221;%@ length is: %d&#8221;,test,[test lengthOfBytesUsingEncoding:enc]);]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/327/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>自动登陆ssh脚本</title>
		<link>http://www.xffox.com/blog/archives/321</link>
		<comments>http://www.xffox.com/blog/archives/321#comments</comments>
		<pubDate>Mon, 09 May 2011 09:09:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=321</guid>
		<description><![CDATA[由于每天都要向服务器更新文件.每次都要来回的ssh输入用户名,输入密码,输入目录.为了省去这个繁琐的工作写了一个自动登陆脚本. ?Download download.txt1 2 3 4 5 6 7 8 9 10 11 12 13 #!/usr/bin/expect set timeout 1 spawn /usr/bin/ssh -oStrictHostKeyChecking=no netseye@192.168.1.2 expect &#34;*password:&#34; send &#34;123456\r&#34; expect &#34;*]$&#34; send &#34;ssh root@server9\r&#34; expect &#34;*]#&#34; send &#34;cd /www/ftp/netseye.com/web/svn\r&#34; expect &#34;*]#&#34; send &#34;su www\r&#34; interact #expect eof]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/321/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为了调试方便写了一个简单的脚本</title>
		<link>http://www.xffox.com/blog/archives/319</link>
		<comments>http://www.xffox.com/blog/archives/319#comments</comments>
		<pubDate>Thu, 28 Apr 2011 06:12:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=319</guid>
		<description><![CDATA[?Download download.txt1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #!/bin/bash echo &#34;___________________________________&#34; path=`ps aux&#124;awk '/fpm/{print $14}'&#124;head -n 1`; echo &#34;文件路径:&#34;$path; echo &#34;开始替换.......&#34; if grep -l &#34;&#60;value name=\&#34;display_errors\&#34;&#62;0&#60;/value&#62;&#34; $path; then sed -i &#34;s/&#60;value name=\&#34;display_errors\&#34;&#62;0&#60;\/value&#62;/&#60;value name=\&#34;display_errors\&#34;&#62;1&#60;\/value&#62;/&#34; $path; echo &#34;已经开启调试&#34;; else echo &#34;已经关闭调试&#34; ; sed -i &#34;s/&#60;value name=\&#34;display_errors\&#34;&#62;1&#60;\/value&#62;/&#60;value name=\&#34;display_errors\&#34;&#62;0&#60;\/value&#62;/&#34; $path; [...]]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/319/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cocoa urlencode</title>
		<link>http://www.xffox.com/blog/archives/315</link>
		<comments>http://www.xffox.com/blog/archives/315#comments</comments>
		<pubDate>Fri, 10 Dec 2010 16:13:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=315</guid>
		<description><![CDATA[由于制作脑内的iphone app初期是用采集来做的..这个里面url部分为中文这个其实转成utf8编码的就应该可以通过nsurl获取的 不过还是找到了一个cocoa的urlencode的方法 做个笔记以后用.]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/315/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac/iPhone Category &amp; Protocol</title>
		<link>http://www.xffox.com/blog/archives/307</link>
		<comments>http://www.xffox.com/blog/archives/307#comments</comments>
		<pubDate>Sun, 15 Aug 2010 14:56:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Protocol]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=307</guid>
		<description><![CDATA[http://blog.codingmylife.com/?p=41 Categories #import &#8220;ClassName.h&#8221; @interface ClassName ( CategoryName ) // method declarations @end #import &#8220;ClassName+CategoryName.h&#8221; @implementation ClassName ( CategoryName ) // method definitions @end For example @interface MyObject : NSObject{ NSNumber *number; } - (NSNumber *)number; @end @interface MyObject (Setter) - (void)setNumber:(NSNumber *)newNumber; @end @implementation MyObject - (NSNumber *)number{ return number; } - (void)setNumber(NSNumber *)newNumber{ [...]]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/307/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iphone多线程汇总</title>
		<link>http://www.xffox.com/blog/archives/300</link>
		<comments>http://www.xffox.com/blog/archives/300#comments</comments>
		<pubDate>Thu, 12 Aug 2010 15:32:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[gcd]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[nsoperation]]></category>
		<category><![CDATA[nstread]]></category>
		<category><![CDATA[多线程]]></category>
		<category><![CDATA[异步代理]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=300</guid>
		<description><![CDATA[1,NSThread - (void)updateImageForCellAtIndexPath:(NSIndexPath *)indexPath { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; UIImage *image = [self getImageForCellAtIndexPath:indexPath]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; [cell.imageView performSelectorOnMainThread:@selector(setImage:) withObject:image waitUntilDone:NO]; [pool release]; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { [NSThread detachNewThreadSelector:@selector(updateImageForCellAtIndexPath:) toTarget:self withObject:indexPath]; } 2NSOperation 首先是建立NSOperationQueue和NSOperations。NSOperationQueue会建立一个线程，每个加入到线程operation会有序的执行。 NSOperationQueue *queue = [NSOperationQueue new]; NSInvocationOperation *operation = [[NSInvocationOperation alloc]; initWithTarget:self selector:@selector(doWork:) [...]]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/300/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPhone View层次结构说明</title>
		<link>http://www.xffox.com/blog/archives/283</link>
		<comments>http://www.xffox.com/blog/archives/283#comments</comments>
		<pubDate>Sat, 31 Jul 2010 13:14:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=283</guid>
		<description><![CDATA[View层次结构说明： 1.容器类，加强其他视图的功能，或提供额外的显示效果。 如：UIScrollView是用来显示那些内容太多，不能在一屏里显示的视图的； UITableView是UIScrollView的子类，用来展现列表形式的内容的，因为表中的行是可选的， UITableView也被用于层次结构的导航。 UIToolBar是用来显示一个或多个与按钮相似的子项，通常UIToolBar显示在屏幕底部，用来 显示一组经常使用的命令按钮。UIToolBar可以一直显示着，也可以在需要的时候才显示。 2.控件类，控件是用来创建应用程序的典型UI.控件都继承于UIControl，控件通常用来显示一个特定的值， 并处理与修改这个值相关的用户交互。控件使用标准的系统设计模式，如Target-Action和Delegation， 当用户发生交互时，通知应用程序。 包括：按钮UIButton，文本字段UITextField，滑块UISlider，和开关UISwitch。 3.显示类，只是用来显示，不提供交互。 包括：UIImageView，UILabel，UIProgressView，UIActivityIndicatorView 4.文本和网页类，用来显示多行文本。 如：UITextView支持多行的滚动显示与编辑。 UIWebView可以用来显示Html，这样就极大的丰富了展示效果，可以按照自定义方式显示文本。 5.警告UIAlertView和行动表UIActionSheet，警告和行动表用来迅速获取用户的注意力，给用户提示一些信息， 并附带一些选项，用户可以通过这些选项来相应信息。 功能上来说，这两个View是相似的，但是从外观和行为上来说就不一样了 UIAlertView是在屏幕中弹出蓝色背景的警告框 UIActionSheet是在屏幕底部滑出的。 6.导航类，标签栏UITabBar和导航栏UINavigationBar结合视图控制器让用户从一个视图转到另一个视图。 通常你并不需要创建他们的items，而是通过controller或者是Inerface Builder来配置他们。 7.窗口，窗口是其他View的根视图。典型的情况下是一个应用只有一个窗口。]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/283/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>dedecms又让我纠结一次</title>
		<link>http://www.xffox.com/blog/archives/267</link>
		<comments>http://www.xffox.com/blog/archives/267#comments</comments>
		<pubDate>Wed, 30 Jun 2010 07:49:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.xffox.com/blog/?p=267</guid>
		<description><![CDATA[由于工作需要,修改了下dedecms的showMsg()方法支持了外调模板. 却怎么也不能同步了.重新设置ucenter也无计于是.由于对ucenter不是很熟悉.所以只能调试. 经过半天的折腾才发现我漏掉了一个变量$ucsynlogin, uc_user_synlogin()的返回值.原来这 个返回的js是需要加载一下的. 原showMsg()里是这么写的isset($GLOBALS['ucsynlogin']) ? $GLOBALS['ucsynlogin'] : &#8221;很 隐蔽的藏在一个字串里&#8230;&#8230;真很纠结&#8230;]]></description>
		<wfw:commentRss>http://www.xffox.com/blog/archives/267/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

