<?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>haojii &#187; 技巧</title>
	<atom:link href="http://www.haojii.com/tag/skills/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.haojii.com</link>
	<description>一个专注于技术的IT男</description>
	<lastBuildDate>Thu, 19 Apr 2012 07:58:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>技巧-用迅雷打开某些打不开的种子文件</title>
		<link>http://www.haojii.com/2011/08/tip-download-a-bitcomet-only-torrent-file-with-thunder/</link>
		<comments>http://www.haojii.com/2011/08/tip-download-a-bitcomet-only-torrent-file-with-thunder/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 14:13:54 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[杂项]]></category>
		<category><![CDATA[技巧]]></category>
		<category><![CDATA[高手必备]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=629</guid>
		<description><![CDATA[有些时候我们从网上找到一个极具诱惑力的资源的种子，但是不幸的发现最猛的吸血迅雷却打不开这个torrent文件，非常非常的痛苦，这个时候不得不退而求其次，装个相对差一点的BitComet，发现种子文件竟然可以打开了，心情豁然开朗，但是坑爹的是等了半天竟然没有速度，这时候大家的心情我懂的！ 这个问题的root cause应该是种子文件被修改，只能特定BT下载客户端才能识别了，八成是为了抵制吸血迅雷，这个时候大家一定都是想，要是能用吸血迅雷打开这个种子该多好啊！ 好吧！Hold住！免费传授大家这招，在BitComet的你正在下载的这个任务上，右键-&#62;复制磁链，然后到迅雷里新建任务-&#62;粘贴，是不是成功了？速度也有了！ 也许可以写个脚本生成Magnet URI？今天就不研究了。]]></description>
			<content:encoded><![CDATA[<p>有些时候我们从网上找到一个极具诱惑力的资源的种子，但是不幸的发现最猛的吸血迅雷却打不开这个torrent文件，非常非常的痛苦，这个时候不得不退而求其次，装个相对差一点的BitComet，发现种子文件竟然可以打开了，心情豁然开朗，但是坑爹的是等了半天竟然没有速度，这时候大家的心情我懂的！</p>
<p>这个问题的root cause应该是种子文件被修改，只能特定BT下载客户端才能识别了，八成是为了抵制吸血迅雷，这个时候大家一定都是想，要是能用吸血迅雷打开这个种子该多好啊！</p>
<p>好吧！Hold住！免费传授大家这招，在BitComet的你正在下载的这个任务上，右键-&gt;复制磁链，然后到迅雷里新建任务-&gt;粘贴，是不是成功了？速度也有了！</p>
<p>也许可以写个脚本生成Magnet URI？今天就不研究了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2011/08/tip-download-a-bitcomet-only-torrent-file-with-thunder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为iPhone优化网页的技巧</title>
		<link>http://www.haojii.com/2010/02/optimize-web-pages-for-iphone/</link>
		<comments>http://www.haojii.com/2010/02/optimize-web-pages-for-iphone/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 10:05:57 +0000</pubDate>
		<dc:creator>Jacky</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WebDev]]></category>
		<category><![CDATA[web开发]]></category>
		<category><![CDATA[技巧]]></category>

		<guid isPermaLink="false">http://www.haojii.com/?p=213</guid>
		<description><![CDATA[为iPhone优化网页的技巧,为了使得网页看上去更像native的程序，我们需要对网页进行一些优化

本文包含一些小的技巧：
1. 如何隐藏iPhone Safari的地址栏
2. 如何设置网页的桌面快捷方式图标
3. 如何为网页设置iPhone的样式
4. 如何在网页中检测屏幕的方向
5. 如何在网页中检测当前的位置
 <a href="http://www.haojii.com/2010/02/optimize-web-pages-for-iphone/">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>为了使得网页看上去更像native的程序，我们需要对网页进行一些优化</p>
<p><a href="http://www.haojii.com/webdev/iphone/">使用iPhone访问本文的测试页面</a></p>
<p>本文包含一些小的技巧：<br />
1. 如何隐藏iPhone Safari的地址栏<br />
2. 如何设置网页的桌面快捷方式图标<br />
3. 如何为网页设置iPhone的样式<br />
4. 如何在网页中检测屏幕的方向<br />
5. 如何在网页中检测当前的位置</p>
<p>为iPhone优化网页，最需要了解的应该是下面这个属性<br />
viewport: 可见窗口</p>
<p>可见窗口在iPhone Safari上和桌面Safari略有不同，iPhone上默认没有滚动条，默认的实际的可见大小在竖屏状态下，如下图是320*356，地址栏占据了60像素的高度，稍后我们有办法将其隐藏，得以使用这宝贵的60像素。</p>
<p>iPhone的Safari在显示传统的web网页时（未做优化的网页），viewport会被设置成显示网页宽度的980像素，即在320*356的大小内显示原网页980像素的内容，做了适当的缩放等调整。</p>
<p><a href="http://www.haojii.com/wp-content/uploads/iphone-viewport.png"><img class="aligncenter size-full wp-image-214" title="iphone-viewport" src="http://www.haojii.com/wp-content/uploads/iphone-viewport.png" alt="" width="780" height="600" /></a></p>
<p>所以我们做网页优化的时候，可以通过设置这个meta属性，更多细节可以参考： “Safari Web Content Guide.pdf”</p>
<pre class="brush: xml; title: ; notranslate">
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width,height=device-height, initial-scale=1.0, user-scalable=no&quot;/&gt;
</pre>
<p>width=device-width, //设备宽度</p>
<p>height=device-height, //设备高度</p>
<p>initial-scale=1.0, //初始的缩放比例</p>
<p>user-scalable=no //是否允许用户缩放</p>
<h3>小技巧</h3>
<h4>1. 如何隐藏iPhone Safari的地址栏</h4>
<p>设置这个属性(文档里面说有用，但是好像不太成功)</p>
<pre class="brush: xml; title: ; notranslate">&lt;meta name=&quot;apple-mobile-web-app-capable&quot; content=&quot;yes&quot; /&gt;</pre>
<p>还有一种办法，页面加载完成之后滚动窗口，这个确实有效，唯一要注意的是页面高度必须够长，我一般设成device-height就没问题了:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
addEventListener(&quot;load&quot;, function() { setTimeout(hideURLbar, 0); }, false);

function hideURLbar(){
window.scrollTo(0,1);
}
&lt;/script&gt;
</pre>
<h4>2. 如何设置网页的桌面快捷方式图标</h4>
<p>这个其实不算技巧，只是从Apple文档里找到这一项罢了</p>
<pre class="brush: xml; title: ; notranslate">
&lt;link rel=&quot;apple-touch-icon&quot; href=&quot;apple-touch-icon.png&quot;/&gt;
&lt;link rel=&quot;apple-touch-startup-image&quot; href=&quot;startup.png&quot;/&gt;
</pre>
<p>第一行就是设置桌面快捷方式图标的，图标必须是57*57像素的文件，不需要自己做圆角和高亮效果，系统会自动帮你搞定这个<br />
放在网页根目录会作用于下面的全部网页，当然也可以为每个页面设置单独的图标</p>
<p>第二行是设置启动画面（没看到成功效果）</p>
<h4>3. 如何为网页设置iPhone的样式</h4>
<p>这个是CSS media selector的一点小技巧</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if !IE]&gt;--&gt;
&lt;link media=&quot;only screen and (max-device-width: 480px)&quot;
  rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;iphone.css&quot;/&gt;
&lt;!--&lt;![endif]--&gt;
</pre>
<h4>4. 如何在网页中检测屏幕的方向</h4>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
function updateOrientation()
{
	var displayStr = &quot;Orientation : &quot;;
	switch(window.orientation)
	{
	case 0:
		displayStr += &quot;Portrait&quot;;
		break;
	case -90:
		displayStr += &quot;Landscape (right, screen turned clockwise)&quot;;
		break;
	case 90:
		displayStr += &quot;Landscape (left, screen turned counterclockwise)&quot;;
		break;
	case 180:
		displayStr += &quot;Portrait (upside-down portrait)&quot;;
		break;
	}
	document.getElementById(&quot;output&quot;).innerHTML = displayStr;
}
&lt;/script&gt;
&lt;body onorientationchange=&quot;updateOrientation();&quot;&gt;
</pre>
<h4>5. 如何在网页中检测当前的位置</h4>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
navigator.geolocation.getCurrentPosition(showMap);
function showMap(position) {
	latitude = position.coords.latitude;
	longitude = position.coords.longitude;
	document.getElementById(&quot;latitude&quot;).innerHTML = latitude;
	document.getElementById(&quot;longitude&quot;).innerHTML = longitude;
}

//Register for location changes
var watchId = navigator.geolocation.watchPosition(scrollMap,handleError);

function scrollMap(position) {
	latitude = position.coords.latitude;
	longitude = position.coords.longitude;
	document.getElementById(&quot;latitude&quot;).innerHTML = &quot;scrollMap-&gt;&quot;+latitude;
	document.getElementById(&quot;longitude&quot;).innerHTML = &quot;scrollMap-&gt;&quot;+longitude;
}
function handleError(error) {
	document.getElementById(&quot;error&quot;).innerHTML = error;
}

function buttonClickHandler() {
	// Unregister when the user clicks a button
	navigator.geolocation.clearWatch(watchId);
}

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;location&quot;&gt;
	latitude:&lt;p id=&quot;latitude&quot;&gt;null&lt;/p&gt;
	longitude:&lt;p id=&quot;longitude&quot;&gt;null&lt;/p&gt;
&lt;/div&gt;
&lt;div&gt;
	&lt;input type=&quot;button&quot; value=&quot;clearWatch&quot; onclick=&quot;buttonClickHandler();&quot;/&gt;
&lt;/div&gt;
&lt;div id=&quot;error&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.haojii.com/2010/02/optimize-web-pages-for-iphone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

