<?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>xiaoma de blog &#187; 软件[Code]</title>
	<atom:link href="http://www.floatingvectors.com/blog/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.floatingvectors.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 22 Jan 2012 11:51:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tricks</title>
		<link>http://www.floatingvectors.com/blog/398/</link>
		<comments>http://www.floatingvectors.com/blog/398/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 10:02:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=398</guid>
		<description><![CDATA[[Ubuntu]
ISSUE: Nvidia display driver problem on a two graphics card PC.
[EE] No devices detected. No screen found.
SOLUTION:
lspci -v
Get PCI bus number for graphics cards, 1:0:0 and 6:0:0 for instance.
sudo vi /etc/X11/xorg.conf
Under section &#8220;Device&#8221;, add
BusID &#8220;PCI:1:0:0&#8243;
Restart X and everything works like a charm.
http://wiki.linuxquestions.org/wiki/Using_multiple_monitors
[CUDA]
ISSUE: &#8220;error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such [...]]]></description>
			<content:encoded><![CDATA[<p>[Ubuntu]</p>
<p>ISSUE: Nvidia display driver problem on a two graphics card PC.</p>
<p>[EE] No devices detected. No screen found.</p>
<p>SOLUTION:</p>
<p>lspci -v</p>
<p>Get PCI bus number for graphics cards, 1:0:0 and 6:0:0 for instance.</p>
<p>sudo vi /etc/X11/xorg.conf</p>
<p>Under section &#8220;Device&#8221;, add</p>
<p>BusID &#8220;PCI:1:0:0&#8243;</p>
<p>Restart X and everything works like a charm.</p>
<p>http://wiki.linuxquestions.org/wiki/Using_multiple_monitors</p>
<p>[CUDA]</p>
<p>ISSUE: &#8220;error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such file or directory&#8221;</p>
<p>SOLUTION:</p>
<p>sudo vim /etc/ld.so.conf</p>
<p>Add &#8220;/usr/local/cuda/lib&#8221;</p>
<p>Save and quit.</p>
<p>ld config -v | grep cuda</p>
<p>山寨的联通3G网卡，无型号，隆信通，在Ubuntu 11.10下使用：</p>
<p>lsusb信息如下：</p>
<p>Bus 003 Device 003: ID 05c6:6000 Qualcomm, Inc. Mass Storage Device.</p>
<p>使用如下命令切换到modem模式：</p>
<p>usb_modeswitch -v 05c6 -p 1000 -M 5553424312345678000000000000061b000000020000000000000000000000 -R 1<br />
切换成功后可ls /dev/tty*看到ttyUSBx的设备。</p>
<p>打开网络配置用户名和密码都为any，pin码为1234，网络为3gnet，其余默认。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/398/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile PTAM&amp;PTAMM on Snow Leopard</title>
		<link>http://www.floatingvectors.com/blog/367/</link>
		<comments>http://www.floatingvectors.com/blog/367/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 14:15:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[AR]]></category>
		<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[PTAM]]></category>
		<category><![CDATA[PTAMM]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=367</guid>
		<description><![CDATA[1. Compile PTAM
1). Install TooN lib.
Download Toon.
-&#62;  cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/toon co TooN
Make and install.
-&#62; ./configure
-&#62; make
-&#62; make install
2). Install libcvd(32bit).
a) Download libcvd.
-&#62; cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co libcvd
b) Edit cvd/gl_helpers.h. Use OpenGL/gl.h and OpenGL/glu.h.
c) Edit progs/calibrate.cxx. Replace GL_TEXTURE_RECTANGLE_NV with GL_TEXTURE_RECTANGLE_ARB.
d) Edit cvd_src/OSX/qtbuffer.cpp. Add #include &#60;vector&#62;
e) Create a new configure script configure_mac.sh:
#!/bin/bash

SDK="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
SDKLIB="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.5"

ARCH="-arch i386"

export CFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I [...]]]></description>
			<content:encoded><![CDATA[<h1>1. Compile PTAM</h1>
<h2>1). Install TooN lib.</h2>
<p>Download Toon.</p>
<p>-&gt;  cvs -z3 -d:pserver:<a href="mailto:anoncvs@cvs.savannah.nongnu.org">anoncvs@cvs.savannah.nongnu.org</a>:/cvsroot/toon co <a href="http://mi.eng.cam.ac.uk/~twd20/TooNhtml/namespaceTooN.html">TooN</a></p>
<p>Make and install.</p>
<p><a href="http://mi.eng.cam.ac.uk/~twd20/TooNhtml/namespaceTooN.html"></a>-&gt; ./configure</p>
<p>-&gt; make</p>
<p>-&gt; make install</p>
<h2>2). Install libcvd(32bit).</h2>
<p>a) Download libcvd.</p>
<p>-&gt; <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co libcvd</span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">b) Edit cvd/gl_helpers.h. Use OpenGL/gl.h and OpenGL/glu.h.</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">c) Edit progs/calibrate.cxx. Replace GL_TEXTURE_RECTANGLE_NV with GL_TEXTURE_RECTANGLE_ARB.</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">d) Edit cvd_src/OSX/qtbuffer.cpp. Add #include &lt;vector&gt;</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">e) Create a new configure script configure_mac.sh:</span></span></p>
<pre><code>#!/bin/bash

SDK="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
SDKLIB="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.5"

ARCH="-arch i386"

export CFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CXXFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CPPFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export LDFLAGS="$ARCH $SDKLIB -mmacosx-version-min=10.5 -I /usr/local/include"

CC="/usr/bin/gcc-4.2"
CXX="/usr/bin/g++-4.2"
OBJC="/usr/bin/gcc-4.2"

./configure $1 $2 $3 $4 $5 $6 $7 $8 $9
</code></pre>
<pre><span style="font-family: monospace, Monaco, 'Courier New', Courier, monospace;">f) Configure.</span></pre>
<pre><span style="font-family: monospace, Monaco, 'Courier New', Courier, monospace;">-&gt; ./configure_mac.sh --without-ffmpeg --x-libraries=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/ --x-includes=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include</span></pre>
<p>g)  Edit makefile.</p>
<p>Move all -L/opt/local/lib to the end of the argument list, giving priority to OSX10.5.sdk version of X11</p>
<p>h) Make and Install</p>
<p>-&gt; make</p>
<p>-&gt; install</p>
<h2>3). Install gvars3</h2>
<p>a) Download gvars3</p>
<p>-&gt; <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co gvars3</span></p>
<pre>b) Copy the previous configure_mac.sh.</pre>
<pre>-&gt; sh configure_mac.sh --disable-widgets</pre>
<pre>-&gt; make</pre>
<pre>-&gt; make install</pre>
<h2>4). Compile PTAM</h2>
<pre>a) Copy /Build/OSX/Makefile and VideoSource_OSX.cc to source root directory.</pre>
<pre>b) Edit makefile. Compile 32bit.</pre>
<pre>-&gt; CC = g++ -g -O3 -arch i386</pre>
<pre>-&gt; make</pre>
<pre>-&gt; make install</pre>
<h1>2. Compile PTAMM</h1>
<p>a. Install lib3ds. Download the source. Copy configure_mac.sh. Do the same as above.</p>
<p>b. Copy PTAM/V<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">ideoSource_OSX.cc to PTAMM. </span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">c. Copy PTAMM/Build/Linux/Makefile to PTAMM.</span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">d. Edit VideoSource_OSX.cc. Add &#8220;namespace PTAMM{&#8221; after the includes and &#8220;}&#8221; at the end.</span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">e. Edit makefile. </span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">Change &#8220;LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd $(3DSLIB)&#8221; =&gt; &#8220;LINKFLAGS = -framework OpenGL -framework VecLib -lGVars3 -lcvd $(3DSLIB)&#8221;.</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">Change &#8220;VIDEOSOURCE = VideoSource_Linux_DV.o&#8221; =&gt; &#8220;VIDEOSOURCE = VideoSource_OSX.o&#8221;</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">f. make and install.</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;">Have fun:)</span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: small;"><span style="line-height: 18px; white-space: pre;"><a href="http://www.floatingvectors.com/blog/wp-content/uploads/2010/09/PTAMM.png"><img class="aligncenter size-full wp-image-376" title="PTAMM" src="http://www.floatingvectors.com/blog/wp-content/uploads/2010/09/PTAMM.png" alt="" width="580" height="452" /></a></p>
<p></span></span></p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/367/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPF path animation as opacity mask</title>
		<link>http://www.floatingvectors.com/blog/357/</link>
		<comments>http://www.floatingvectors.com/blog/357/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 15:45:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=357</guid>
		<description><![CDATA[CODE
&#60;Window x:Class=&#8221;WpfApplication1.MainWindow&#8221;
       xmlns=&#8221;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#8221;
       xmlns:x=&#8221;http://schemas.microsoft.com/winfx/2006/xaml&#8221;
       x:Name=&#8221;Window&#8221;
       Title=&#8221;Path Opacity Mask Animation Demo&#8221;
       Width=&#8221;640&#8243; Height=&#8221;480&#8243; xmlns:System=&#8221;clr-namespace:System;assembly=mscorlib&#8221;&#62;
       &#60;Window.Resources&#62;
              &#60;Storyboard x:Key=&#8221;Timeline1&#8243;&#62;
                     &#60;DoubleAnimationUsingKeyFrames BeginTime=&#8221;00:00:00&#8243; Storyboard.TargetName=&#8221;path1&#8243;      Storyboard.TargetProperty=&#8221;(Shape.StrokeDashOffset)&#8221;&#62;
                           &#60;SplineDoubleKeyFrame KeyTime=&#8221;00:00:01&#8243; Value=&#8221;25&#8243;/&#62;
                           &#60;SplineDoubleKeyFrame KeyTime=&#8221;00:00:02&#8243; Value=&#8221;0&#8243;/&#62;
                     &#60;/DoubleAnimationUsingKeyFrames&#62;
                     &#60;DoubleAnimationUsingKeyFrames BeginTime=&#8221;00:00:00&#8243; Storyboard.TargetName=&#8221;path2&#8243;  Storyboard.TargetProperty=&#8221;(Shape.StrokeDashOffset)&#8221;&#62;
                           &#60;SplineDoubleKeyFrame KeyTime=&#8221;00:00:03&#8243; Value=&#8221;25&#8243;/&#62;
                           &#60;SplineDoubleKeyFrame KeyTime=&#8221;00:00:04&#8243; Value=&#8221;0&#8243;/&#62;
                     &#60;/DoubleAnimationUsingKeyFrames&#62;
    &#60;/Storyboard&#62;
       &#60;/Window.Resources&#62;
       &#60;Window.Triggers&#62;
              &#60;EventTrigger RoutedEvent=&#8221;FrameworkElement.Loaded&#8221;&#62;
                     &#60;BeginStoryboard Storyboard=&#8221;{StaticResource Timeline1}&#8221;/&#62;
              &#60;/EventTrigger&#62;
       &#60;/Window.Triggers&#62;
       &#60;Grid x:Name=&#8221;LayoutRoot&#8221;&#62;
              &#60;Image Source=&#8221;Hydrangeas.jpg&#8221; Stretch=&#8221;Fill&#8221;&#62;
      &#60;Image.OpacityMask&#62;
    &#60;VisualBrush&#62;
             &#60;VisualBrush.Visual&#62;
               &#60;Path [...]]]></description>
			<content:encoded><![CDATA[<p>CODE</p>
<p>&lt;Window x:Class=&#8221;WpfApplication1.MainWindow&#8221;<br />
       xmlns=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a>&#8221;<br />
       xmlns:x=&#8221;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&#8221;<br />
       x:Name=&#8221;Window&#8221;<br />
       Title=&#8221;Path Opacity Mask Animation Demo&#8221;<br />
       Width=&#8221;640&#8243; Height=&#8221;480&#8243; xmlns:System=&#8221;clr-namespace:System;assembly=mscorlib&#8221;&gt;</p>
<p>       &lt;Window.Resources&gt;<br />
              &lt;Storyboard x:Key=&#8221;Timeline1&#8243;&gt;<br />
                     &lt;DoubleAnimationUsingKeyFrames BeginTime=&#8221;00:00:00&#8243; Storyboard.TargetName=&#8221;path1&#8243;      Storyboard.TargetProperty=&#8221;(Shape.StrokeDashOffset)&#8221;&gt;<br />
                           &lt;SplineDoubleKeyFrame KeyTime=&#8221;00:00:01&#8243; Value=&#8221;25&#8243;/&gt;<br />
                           &lt;SplineDoubleKeyFrame KeyTime=&#8221;00:00:02&#8243; Value=&#8221;0&#8243;/&gt;<br />
                     &lt;/DoubleAnimationUsingKeyFrames&gt;<br />
                     &lt;DoubleAnimationUsingKeyFrames BeginTime=&#8221;00:00:00&#8243; Storyboard.TargetName=&#8221;path2&#8243;  Storyboard.TargetProperty=&#8221;(Shape.StrokeDashOffset)&#8221;&gt;<br />
                           &lt;SplineDoubleKeyFrame KeyTime=&#8221;00:00:03&#8243; Value=&#8221;25&#8243;/&gt;<br />
                           &lt;SplineDoubleKeyFrame KeyTime=&#8221;00:00:04&#8243; Value=&#8221;0&#8243;/&gt;<br />
                     &lt;/DoubleAnimationUsingKeyFrames&gt;<br />
    &lt;/Storyboard&gt;<br />
       &lt;/Window.Resources&gt;<br />
       &lt;Window.Triggers&gt;<br />
              &lt;EventTrigger RoutedEvent=&#8221;FrameworkElement.Loaded&#8221;&gt;<br />
                     &lt;BeginStoryboard Storyboard=&#8221;{StaticResource Timeline1}&#8221;/&gt;<br />
              &lt;/EventTrigger&gt;<br />
       &lt;/Window.Triggers&gt;</p>
<p>       &lt;Grid x:Name=&#8221;LayoutRoot&#8221;&gt;<br />
              &lt;Image Source=&#8221;Hydrangeas.jpg&#8221; Stretch=&#8221;Fill&#8221;&gt;<br />
      &lt;Image.OpacityMask&gt;<br />
    &lt;VisualBrush&gt;<br />
             &lt;VisualBrush.Visual&gt;<br />
               &lt;Path x:Name=&#8221;path1&#8243; Stretch=&#8221;Fill&#8221; Stroke=&#8221;#FF000000&#8243; StrokeDashOffset=&#8221;1000&#8243; StrokeEndLineCap=&#8221;Round&#8221; StrokeStartLineCap=&#8221;Round&#8221; StrokeThickness=&#8221;20&#8243; HorizontalAlignment=&#8221;Left&#8221; Margin=&#8221;228,145.336,0,188.972&#8243; Width=&#8221;71&#8243; Data=&#8221;M294,171 C289,162 283,147 268,151 253,155 244,164.99992 244,177.00008 244,189.00024 284,196.00033 287,207.00047 290,218.00062 286,249.00103 259,250.00104 232,251.00105 235,225.00071 233,219.00063&#8243; StrokeDashArray=&#8221;25 1000&#8243;/&gt;<br />
             &lt;/VisualBrush.Visual&gt;<br />
           &lt;/VisualBrush&gt;<br />
    &lt;/Image.OpacityMask&gt;<br />
     &lt;/Image&gt;<br />
    <br />
    &lt;Path x:Name=&#8221;path2&#8243; Stretch=&#8221;Fill&#8221; Stroke=&#8221;#FF000000&#8243; StrokeDashOffset=&#8221;1000&#8243; StrokeEndLineCap=&#8221;Round&#8221; StrokeStartLineCap=&#8221;Round&#8221; StrokeThickness=&#8221;20&#8243; HorizontalAlignment=&#8221;Left&#8221; Margin=&#8221;228,145.336,0,188.972&#8243; Width=&#8221;71&#8243; Data=&#8221;M294,171 C289,162 283,147 268,151 253,155 244,164.99992 244,177.00008 244,189.00024 284,196.00033 287,207.00047 290,218.00062 286,249.00103 259,250.00104 232,251.00105 235,225.00071 233,219.00063&#8243; StrokeDashArray=&#8221;25 1000&#8243;/&gt;<br />
          <br />
  &lt;/Grid&gt;<br />
&lt;/Window&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/357/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unity3D with Windows 7 Multitouch</title>
		<link>http://www.floatingvectors.com/blog/331/</link>
		<comments>http://www.floatingvectors.com/blog/331/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 07:08:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[Multitouch]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=331</guid>
		<description><![CDATA[[There is a video that cannot be displayed in this feed. Visit the blog entry to see the video.]
Here it goes. Build Unity 3D multitouch application on Windows 7 machines.
This video demonstrates an application built with Unity 3D with Windowns 7 multitouch input.
Thanks to Unity explosion framework Detonator. Nice work!
]]></description>
			<content:encoded><![CDATA[<p>[There is a video that cannot be displayed in this feed. <a href="http://www.floatingvectors.com/blog/331/">Visit the blog entry to see the video.]</a></p>
<p>Here it goes. Build Unity 3D multitouch application on Windows 7 machines.</p>
<p>This video demonstrates an application built with Unity 3D with Windowns 7 multitouch input.</p>
<p>Thanks to Unity explosion framework <a href="http://unity3d.com/support/resources/unity-extensions/explosion-framework.html">Detonator</a>. Nice work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/331/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://www.floatingvectors.com/blog/wp-content/uploads/2010/02/UnityWindows7Multitouch.mov" length="3904385" type="video/quicktime" />
		</item>
		<item>
		<title>Unity 3D First Try</title>
		<link>http://www.floatingvectors.com/blog/316/</link>
		<comments>http://www.floatingvectors.com/blog/316/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 02:51:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=316</guid>
		<description><![CDATA[Please view the full post to see the Unity content.
This is part of a tutorial in  the book &#8220;Unity Game Development Essentials&#8221;
Use mouse and keyboard to control walk through.
Up/W: Forward
Down/S: Backward
Left/A: Left
Right/D: Right
Mouse: Look around and turn the player
]]></description>
			<content:encoded><![CDATA[<p><em>Please view the full post to see the Unity content.</em></p>
<p>This is part of a tutorial in  the book &#8220;Unity Game Development Essentials&#8221;</p>
<p>Use mouse and keyboard to control walk through.</p>
<p>Up/W: Forward</p>
<p>Down/S: Backward</p>
<p>Left/A: Left</p>
<p>Right/D: Right</p>
<p>Mouse: Look around and turn the player</p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/316/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Passing Parameters</title>
		<link>http://www.floatingvectors.com/blog/276/</link>
		<comments>http://www.floatingvectors.com/blog/276/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 12:01:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=276</guid>
		<description><![CDATA[C# Passing Parameters

Passing Value-Type Parameters
A value-type variable contains its data directly as opposed to a reference-type variable, which contains a reference to its data. Therefore, passing a value-type variable to a method means passing a copy of the variable to the method. Any changes to the parameter that take place inside the method have no [...]]]></description>
			<content:encoded><![CDATA[<h1>C# Passing Parameters</h1>
<p><strong></strong></p>
<p><strong>Passing Value-Type Parameters</strong></p>
<p>A value-type variable contains its data directly as opposed to a reference-type variable, which contains a reference to its data. Therefore, passing a value-type variable to a method means passing a copy of the variable to the method. Any changes to the parameter that take place inside the method have no affect on the original data stored in the variable. If you want the called method to change the value of the parameter, you have to pass it by reference, using the ref or out keyword.</p>
<p>The following example demonstrates passing value-type parameters by value. The variable n is passed by value to the method SquareIt. Any changes that take place inside the method have no affect on the original value of the variable.</p>
<pre class="brush: c#">

class PassingValByVal
{
    static void SquareIt(int x)
    // The parameter x is passed by value.
    // Changes to x will not affect the original value of x.
    {
        x *= x;
        System.Console.WriteLine(&quot;The value inside the method: {0}&quot;, x);
    }
    static void Main()
    {
        int n = 5;
        System.Console.WriteLine(&quot;The value before calling the method: {0}&quot;, n);

        SquareIt(n);  // Passing the variable by value.
        System.Console.WriteLine(&quot;The value after calling the method: {0}&quot;, n);

        // Keep the console window open in debug mode.
        System.Console.WriteLine(&quot;Press any key to exit.&quot;);
        System.Console.ReadKey();
    }
}
/* Output:
    The value before calling the method: 5
    The value inside the method: 25
    The value after calling the method: 5
*/
</pre>
<p>The variable n, being a value type, contains its data, the value 5. When SquareIt is invoked, the contents of n are copied into the parameter x, which is squared inside the method. In Main, however, the value of n is the same, before and after calling the SquareIt method. In fact, the change that takes place inside the method only affects the local variable x.</p>
<p>The following example is the same as the previous example, except for passing the parameter using the <strong>ref</strong> keyword. The value of the parameter is changed after calling the method.</p>
<pre class="brush: c#">

class PassingValByRef
{
    static void SquareIt(ref int x)
    // The parameter x is passed by reference.
    // Changes to x will affect the original value of x.
    {
        x *= x;
        System.Console.WriteLine(&quot;The value inside the method: {0}&quot;, x);
    }
    static void Main()
    {
        int n = 5;
        System.Console.WriteLine(&quot;The value before calling the method: {0}&quot;, n);

        SquareIt(ref n);  // Passing the variable by reference.
        System.Console.WriteLine(&quot;The value after calling the method: {0}&quot;, n);

        // Keep the console window open in debug mode.
        System.Console.WriteLine(&quot;Press any key to exit.&quot;);
        System.Console.ReadKey();
    }
}
/* Output:
    The value before calling the method: 5
    The value inside the method: 25
    The value after calling the method: 25
*/
</pre>
<p><strong>Passing Reference-Type Parameters</strong></p>
<p>A variable of a reference type does not contain its data directly; it contains a reference to its data. When you pass a reference-type parameter by value, it is possible to change the data pointed to by the reference, such as the value of a class member. However, you cannot change the value of the reference itself; that is, you cannot use the same reference to allocate memory for a new class and have it persist outside the block. To do that, pass the parameter using the ref or out keyword.</p>
<p>The following example demonstrates passing a reference-type parameter, arr, by value, to a method, Change. Because the parameter is a reference to arr, it is possible to change the values of the array elements. However, the attempt to reassign the parameter to a different memory location only works inside the method and does not affect the original variable, arr.</p>
<pre class="brush: c#">

class PassingRefByVal
{
    static void Change(int[] pArray)
    {
        pArray[0] = 888;  // This change affects the original element.
        pArray = new int[5] {-3, -1, -2, -3, -4};   // This change is local.
        System.Console.WriteLine(&quot;Inside the method, the first element is: {0}&quot;, pArray[0]);
    }

    static void Main()
    {
        int[] arr = {1, 4, 5};
        System.Console.WriteLine(&quot;Inside Main, before calling the method, the first element is: {0}&quot;, arr [0]);

        Change(arr);
        System.Console.WriteLine(&quot;Inside Main, after calling the method, the first element is: {0}&quot;, arr [0]);
    }
}
/* Output:
    Inside Main, before calling the method, the first element is: 1
    Inside the method, the first element is: -3
    Inside Main, after calling the method, the first element is: 888
*/
</pre>
<p>In the preceding example, the array, arr, which is a reference type, is passed to the method without the <em>ref</em> parameter. In such a case, a copy of the reference, which points to arr, is passed to the method. The output shows that it is possible for the method to change the contents of an array element, in this case from 1 to 888. However, allocating a new portion of memory by using the new operator inside the Change method makes the variable pArray reference a new array. Thus, any changes after that will not affect the original array, arr, which is created inside Main. In fact, two arrays are created in this example, one inside Main and one inside the Change method.</p>
<p>This example is the same as the previous example, except for using the <strong>ref</strong> keyword in the method header and call. Any changes that take place in the method will affect the original variables in the calling program.</p>
<pre class="brush: c#">

class PassingRefByRef
{
    static void Change(ref int[] pArray)
    {
        // Both of the following changes will affect the original variables:
        pArray[0] = 888;
        pArray = new int[5] {-3, -1, -2, -3, -4};
        System.Console.WriteLine(&quot;Inside the method, the first element is: {0}&quot;, pArray[0]);
    }

    static void Main()
    {
        int[] arr = {1, 4, 5};
        System.Console.WriteLine(&quot;Inside Main, before calling the method, the first element is: {0}&quot;, arr[0]);

        Change(ref arr);
        System.Console.WriteLine(&quot;Inside Main, after calling the method, the first element is: {0}&quot;, arr[0]);
    }
}
/* Output:
    Inside Main, before calling the method, the first element is: 1
    Inside the method, the first element is: -3
    Inside Main, after calling the method, the first element is: -3
*/
</pre>
<p>All of the changes that take place inside the method affect the original array in Main. In fact, the original array is reallocated using the <strong>new</strong> operator. Thus, after calling the Change method, any reference to arr points to the five-element array, which is created in the Change method.</p>
<p>Swapping strings is a good example of passing reference-type parameters by reference. In the example, two strings, str1 and str2, are initialized in Main and passed to the SwapStrings method as parameters modified by the <strong>ref</strong> keyword. The two strings are swapped inside the method and inside Main as well.</p>
<pre class="brush: c#">

class SwappingStrings
 {
     static void SwapStrings(ref string s1, ref string s2)
     // The string parameter is passed by reference.
     // Any changes on parameters will affect the original variables.
     {
         string temp = s1;
         s1 = s2;
         s2 = temp;
         System.Console.WriteLine(&quot;Inside the method: {0} {1}&quot;, s1, s2);
     }

     static void Main()
     {
         string str1 = &quot;John&quot;;
         string str2 = &quot;Smith&quot;;
         System.Console.WriteLine(&quot;Inside Main, before swapping: {0} {1}&quot;, str1, str2);

         SwapStrings(ref str1, ref str2);   // Passing strings by reference
         System.Console.WriteLine(&quot;Inside Main, after swapping: {0} {1}&quot;, str1, str2);
     }
 }
 /* Output:
     Inside Main, before swapping: John Smith
     Inside the method: Smith John
     Inside Main, after swapping: Smith John
*/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/276/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Boxing and Unboxing</title>
		<link>http://www.floatingvectors.com/blog/256/</link>
		<comments>http://www.floatingvectors.com/blog/256/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 10:33:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=256</guid>
		<description><![CDATA[C# Boxing and Unboxing
 
Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap. Unboxing extracts the value type from the object.
In [...]]]></description>
			<content:encoded><![CDATA[<h1>C# Boxing and Unboxing</h1>
<p> </p>
<p>Boxing is the process of converting a value type to the type <strong>object</strong> or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap. Unboxing extracts the value type from the object.</p>
<p>In relation to simple assignments, boxing and unboxing are computationally expensive processes. When a value type is boxed, a new object must be allocated and constructed. To a lesser degree, the cast required for unboxing is also expensive computationally.</p>
<h2>Boxing</h2>
<p>Boxing is used to store value types in the garbage-collected heap. Boxing is an implicit conversion of a value type to the type <strong>object</strong> or to any interface type implemented by this value type. Boxing a value type allocates an object instance on the heap and copies the value into the new object.</p>
<p>Consider the following declaration of a value-type variable:</p>
<pre class="brush: c#">

int i=123;
</pre>
<p>The following statement implicitly applies the boxing operation on the variable i:</p>
<pre class="brush: c#">

object o=i;      //Implicit boxing
</pre>
<p>The result of this statement is creating an object reference o, on the stack, that references a value of the type <strong>int</strong>, on the heap. This value is a copy of the value-type value assigned to the variable i. The difference between the two variables, i and o, is illustrated in the following figure.</p>
<p><a href="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/boxing.png"><img class="aligncenter size-full wp-image-272" title="boxing" src="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/boxing.png" alt="" width="250" height="170" /></a></p>
<h2>Unboxing</h2>
<p>Unboxing is an explicit conversion from the type <strong>object</strong> to a value type or from an interface type to a value type that implements the interface. An unboxing operation consists of:</p>
<p>Checking the object instance to make sure that it is a boxed value of the given value type.</p>
<p>Copying the value from the instance into the value-type variable.</p>
<p>The following statements demonstrate both boxing and unboxing operations:</p>
<pre class="brush: c#">

int  i = 123;

object o = i;  //boxing

int j = (int) o;   //unboxing
</pre>
<p>The following figure demonstrates the result of the previous statements.</p>
<p><a href="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/unboxing.png"><img class="aligncenter size-full wp-image-273" title="unboxing" src="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/unboxing.png" alt="" width="250" height="219" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/256/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Common Type System</title>
		<link>http://www.floatingvectors.com/blog/249/</link>
		<comments>http://www.floatingvectors.com/blog/249/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 08:26:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=249</guid>
		<description><![CDATA[C# Common Type System
 
The C# typing system contains the following categories:
Value types
Reference types
Pointer types
Variables that are value types store data, and those that are reference types store references to the actual data. Reference types are also referred to as objects. Pointer types can be used only in unsafe mode.
It is possible to convert a value [...]]]></description>
			<content:encoded><![CDATA[<h1>C# Common Type System</h1>
<p> </p>
<p>The C# typing system contains the following categories:</p>
<p>Value types</p>
<p>Reference types</p>
<p>Pointer types</p>
<p>Variables that are value types store data, and those that are reference types store references to the actual data. Reference types are also referred to as objects. Pointer types can be used only in unsafe mode.</p>
<p>It is possible to convert a value type to a reference type, and back again to a value type, by using boxing and unboxing. With the exception of a boxed value type, you cannot convert a reference type to a value type.</p>
<p>Types can derive from other types, called <em>base types</em>. The derived type inherits (with some restrictions) the methods, properties, and other members of the base type. The base type can in turn derive from some other type, in which case the derived type inherits the members of both base types in its inheritance hierarchy. All types, including built-in numeric types such as System.Int32 (C# keyword: int), derive ultimately from a single base type, which is System.Object (C# keyword: object). This unified type hierarchy is called the Common Type System (CTS).</p>
<p>Each type in the CTS is defined as either a <em>value type</em> or a <em>reference type</em>. This includes all custom types in the .NET Framework class library and also your own user-defined types. Types that you define by using the struct keyword are value types; all the built-in numeric types are <strong>structs</strong>. Types that you define by using the class keyword are reference types. Reference types and value types have different compile-time rules, and different run-time behavior.</p>
<p>The following illustration shows the relationship between value types and reference types in the CTS.</p>
<p><a href="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/csharpCTS.png"></a></p>
<p><strong><a href="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/csharpCTS.png"><img class="aligncenter size-full wp-image-250" title="csharpCTS" src="http://www.floatingvectors.com/blog/wp-content/uploads/2010/01/csharpCTS.png" alt="" width="514" height="410" /></a></strong></p>
<p><strong>Value Types</strong></p>
<p>Value types derive from System.ValueType, which derives from System.Object. Types that derive from System.ValueType have special behavior in the CLR. Value type variables directly contain their values, which means that the memory is allocated inline in whatever context the variable is declared. There is no separate heap allocation or garbage collection overhead for value-type variables.</p>
<p>There are two categories of value types: struct and enum.</p>
<p>Value types are <em>sealed</em>, which means, for example, that you cannot derive a type from System..::.Int32, and you cannot define a struct to inherit from any user-defined class or struct because a struct can only inherit from System.ValueType. However, a struct can implement one or more interfaces. You can cast a struct type to an interface type; this causes a <em>boxing</em> operation to wrap the struct inside a reference type object on the managed heap. Boxing operations occur when you pass a value type to a method that takes a System.Object as an input parameter.</p>
<p><strong>Reference Types</strong></p>
<p>A type that is defined as a class, delegate, array, or interface is a <em>reference type</em>. At run time, when you declare a variable of a reference type, the variable contains the value null until you explicitly create an instance of the object by using the new operator, or assign it an object that has been created elsewhere by using <strong>new.</strong></p>
<p>When the object is created, the memory is allocated on the managed heap, and the variable holds only a reference to the location of the object. Types on the managed heap require overhead both when they are allocated and when they are reclaimed by the automatic memory management functionality of the CLR, which is known as <em>garbage collection</em>. However, garbage collection is also highly optimized, and in most scenarios it does not create a performance issue.<span id="_marker"> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/249/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone开发真机运行（无iDP授权，省99美元）</title>
		<link>http://www.floatingvectors.com/blog/171/</link>
		<comments>http://www.floatingvectors.com/blog/171/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 17:03:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=171</guid>
		<description><![CDATA[iPhone开发真机运行（无iDP授权，省99美元）
如果不需要考虑将软件放到AppStore上出售，自己开发自娱自乐，如下方式可省去iDP授权在真机上运行.
环境：Mac OS X Snow Leopard 10.6.1 + Xcode 3.1 + iPhone SDK 3.0
1. 安装Xcode与iPhone SDK；
2. 修改/Developer/Platforms/iPhoneOS.platform/info.plist, 在DefautProperties一栏下添加: PROVISIONING_PROFILE_ALLOWED = NO, PROVISIONING_PROFILE_REQUIRED = NO;
3. 修改/Developer/Platforms/iPhoneOS.platfomr/Developer/SDKs/iPhoneOS3.0sdk/SDKSettings.plist(可能需要到终端下用root权限), 修改CODE_SIGNING_REQUIRED = NO;
4. 在Xcode中，修改当前工程Device &#8211; 3.0 &#124; Release下的plist， 修改Build下Code Signing Identity = Don&#8217;t Code Sign;
5. 编译生成app文件，连接iPhone，打开Xcode中的Organizer， 在Applications中选择添加编译生成的app文件。由于该app文件未经过签名，所以需要iPhone上事先安装能使用破解软件的工具，即在Cydia下添加source: http://cydia.hackulo.us， 安装AppSync for OS3.0。下载成功即可运行自己开发的软件了。
补充 ：在Xcode 3.2中需要 手动修改xx.xcodeproj文件。右键-&#62;Show Package Contents-&#62;用textmate打开project.pbxproj文件，修改所有的CODE_SIGN_IDENTITY为Don&#8217;t Code Sign， 保存退出。
]]></description>
			<content:encoded><![CDATA[<h1>iPhone开发真机运行（无iDP授权，省99美元）</h1>
<p>如果不需要考虑将软件放到AppStore上出售，自己开发自娱自乐，如下方式可省去iDP授权在真机上运行.</p>
<p>环境：Mac OS X Snow Leopard 10.6.1 + Xcode 3.1 + iPhone SDK 3.0</p>
<p>1. 安装Xcode与iPhone SDK；</p>
<p>2. 修改/Developer/Platforms/iPhoneOS.platform/info.plist, 在DefautProperties一栏下添加: PROVISIONING_PROFILE_ALLOWED = NO, PROVISIONING_PROFILE_REQUIRED = NO;</p>
<p>3. 修改/Developer/Platforms/iPhoneOS.platfomr/Developer/SDKs/iPhoneOS3.0sdk/SDKSettings.plist(可能需要到终端下用root权限), 修改CODE_SIGNING_REQUIRED = NO;</p>
<p>4. 在Xcode中，修改当前工程Device &#8211; 3.0 | Release下的plist， 修改Build下Code Signing Identity = Don&#8217;t Code Sign;</p>
<p>5. 编译生成app文件，连接iPhone，打开Xcode中的Organizer， 在Applications中选择添加编译生成的app文件。由于该app文件未经过签名，所以需要iPhone上事先安装能使用破解软件的工具，即在Cydia下添加source: http://cydia.hackulo.us， 安装AppSync for OS3.0。下载成功即可运行自己开发的软件了。</p>
<p>补充 ：在Xcode 3.2中需要 手动修改xx.xcodeproj文件。右键-&gt;Show Package Contents-&gt;用textmate打开project.pbxproj文件，修改所有的CODE_SIGN_IDENTITY为Don&#8217;t Code Sign， 保存退出。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/171/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ARM linux开发点滴记录</title>
		<link>http://www.floatingvectors.com/blog/164/</link>
		<comments>http://www.floatingvectors.com/blog/164/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 03:55:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[软件[Code]]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[minicom]]></category>

		<guid isPermaLink="false">http://www.floatingvectors.com/blog/?p=164</guid>
		<description><![CDATA[ARM linux开发点滴记录

1. USB转串口准备
下载Mac下USB转串口驱动, 推荐Z-tek, 性价比不错. 驱动下载www.z-tek.com.cn. 对大多数采用FTDI的USB转串口可以到www.ftdichip.com上下载驱动.安装驱动后重启.
cd /dev
ls -l
crw-rw-rw-  1 root   wheel       2,   0  9 26 11:41 tty
crw-rw-rw-  1 root   wheel      10,   2  9 26 11:41 tty.Bluetooth-Modem
crw-rw-rw-  1 root   wheel      10,   4  9 26 11:41 tty.Bluetooth-PDA-Sync
crw-rw-rw-  1 root   wheel     [...]]]></description>
			<content:encoded><![CDATA[<h1>ARM linux开发点滴记录</h1>
<p><strong></strong></p>
<p><strong>1. USB转串口准备</strong></p>
<p>下载Mac下USB转串口驱动, 推荐Z-tek, 性价比不错. 驱动下载<a href="http://www.z-tek.com.cn">www.z-tek.com.cn</a>. 对大多数采用FTDI的USB转串口可以到<a href="http://www.ftdichip.com">www.ftdichip.com</a>上下载驱动.安装驱动后重启.</p>
<p>cd /dev</p>
<p>ls -l</p>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel       2,   0  9 26 11:41 tty</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel      10,   2  9 26 11:41 tty.Bluetooth-Modem</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel      10,   4  9 26 11:41 tty.Bluetooth-PDA-Sync</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel      10,   0  9 26 11:41 tty.usbserial-ftCWUM24</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel       4,   0  9 26 11:41 ttyp0</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel       4,   1  9 26 11:41 ttyp1</div>
<div id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 76px; left: -10000px;">crw-rw-rw-  1 root   wheel       4,   2  9 26 11:41 ttyp2</div>
<p>crw-rw-rw- 1 root wheel 10, 0 9 26 11:41 tty.usbserial-ftCWUM24</p>
<div><strong>2. Mac OS下安装minicom</strong></div>
<div>Mac下安装minicom需要先安装darwinports.</div>
<div>先到<a href="http://darwinports.com">darwinports.com</a>下载并安装 darwingports.</div>
<div>然后开始安装minicom</div>
<div>cd /opt/loca/bin</div>
<div>sudo ./port install minicom</div>
<div>安装完毕之后运行minicom</div>
<div>./minicom</div>
<div>配置波特率,数据位等, 需要注意的是如果minicom只能读不能写,检查Hard flow control是设置为NO.</div>
<div>配置好之后连接开发板, minicom终端登录即可.</div>
<div>
<div>&#8230;&#8230;</div>
<div>TCP cubic registered</div>
<div>RPC: Registered udp transport module.</div>
<div>RPC: Registered tcp transport module.</div>
<div>lib80211: common routines for IEEE802.11 drivers</div>
<div>s3c2410-rtc s3c2410-rtc: setting system clock to 2165-10-23 15:36:12 UTC (18842)</div>
<div>yaffs: dev is 32505858 name is &#8220;mtdblock2&#8243;</div>
<div>yaffs: passed flags &#8220;&#8221;</div>
<div>yaffs: Attempting MTD mount on 31.2, &#8220;mtdblock2&#8243;</div>
<div>yaffs_read_super: isCheckpointed 0</div>
<div>VFS: Mounted root (yaffs filesystem) on device 31:2.</div>
<div>Freeing init memory: 128K</div>
<div>hwclock: settimeofday() failed: Invalid argument</div>
<div>[16/Sep/2029:09:08:03 +0000] boa: server version Boa/0.94.13</div>
<div>[16/Sep/2029:09:08:03 +0000] boa: server built Mar 26 2009 at 15:28:42.</div>
<div>[16/Sep/2029:09:08:03 +0000] boa: starting server pid=501, port 80</div>
<div>Try to bring eth0 interface up&#8230;&#8230;eth0: link down</div>
<div>Done</div>
<div>Please press Enter to activate this console.</div>
<div>[root@FriendlyARM /]#</div>
<div><strong>3. Linux下安装Qt</strong></div>
<div>编译范例出错，没有安装G++。</div>
<div>sudo apt-get install g++</div>
<div>再次build出错</div>
<div>p, li { white-space: pre-wrap; }</div>
<p style="margin: 0px; text-indent: 0px;"><!--StartFragment--><span style="color: #ff0000;">/usr/bin/ld: cannot find -lfreetype</span><!--EndFragment--></p>
<p>安装QtCreator的dependencies</p>
<p>sudo apt-get install libfreetype6 libfreetype6-dev libglib2.0-dev libSM-dev libxrender-dev libfontconfig1-dev libxext-dev</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.floatingvectors.com/blog/164/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

