<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sirivy&#039;s Weblog</title>
	<atom:link href="http://sirivy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sirivy.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 17 Jan 2012 14:38:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sirivy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sirivy&#039;s Weblog</title>
		<link>http://sirivy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sirivy.wordpress.com/osd.xml" title="Sirivy&#039;s Weblog" />
	<atom:link rel='hub' href='http://sirivy.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Just a note to solve: libavutil/common.h:154: error: ‘UINT64_C’ was not declared in this scope</title>
		<link>http://sirivy.wordpress.com/2010/10/14/just-a-note-to-solve-libavutilcommon-h154-error-%e2%80%98uint64_c%e2%80%99-was-not-declared-in-this-scope/</link>
		<comments>http://sirivy.wordpress.com/2010/10/14/just-a-note-to-solve-libavutilcommon-h154-error-%e2%80%98uint64_c%e2%80%99-was-not-declared-in-this-scope/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 09:18:19 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[common.h]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[libavutil]]></category>
		<category><![CDATA[libavutil/common.h]]></category>
		<category><![CDATA[UINT64_C]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=103</guid>
		<description><![CDATA[I tried to install ffmpeg manually using source code checked out from ffmpeg website but , after installation I tried to compile another code which uses this library, there is an error message &#8220;common.h:154: error: ‘UINT64_C’ was not declared in this scope&#8221;. So, I tried to re-install again by using CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure before make and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=103&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried to install ffmpeg manually using source code checked out from <a title="FFMPEG" href="http://ffmpeg.org/download.html" target="_blank">ffmpeg website</a> but , after installation I tried to compile another code which uses this library, there is an error message &#8220;common.h:154: error: ‘UINT64_C’ was not declared in this scope&#8221;. So, I tried to re-install again by using</p>
<p>CXXFLAGS=-D__STDC_CONSTANT_MACROS ./configure</p>
<p>before make and make install. Unfortunately, I found the same error message when I compiled my code.</p>
<p>I search in google for a while and I found this <a href="http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2010-May/088074.html" target="_blank">link</a>.  I followed Eric&#8217;s suggestion by adding</p>
<blockquote><p>#ifdef __cplusplus</p>
<p>#define __STDC_CONSTANT_MACROS</p>
<p>#ifdef _STDINT_H</p>
<p>#undef _STDINT_H</p>
<p>#endif</p>
<p># include &lt;stdint.h&gt;</p>
<p>#endif</p></blockquote>
<p>to my common.h file. Then I tried ./configure, make and make install. Once I compiled my code, there is no error message anymore.</p>
<p>Thanks you Eric : )</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=103&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2010/10/14/just-a-note-to-solve-libavutilcommon-h154-error-%e2%80%98uint64_c%e2%80%99-was-not-declared-in-this-scope/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Note: Setup library and include paths to compile C++ code in Eclipse Galileo</title>
		<link>http://sirivy.wordpress.com/2009/10/31/note-setup-library-path-to-compile-in-eclipse-galileo/</link>
		<comments>http://sirivy.wordpress.com/2009/10/31/note-setup-library-path-to-compile-in-eclipse-galileo/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 11:06:30 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=88</guid>
		<description><![CDATA[Credit : P&#8217;Phong  @ dsin blogger Example of my gcc in command line : gcc filename1.cpp filename2.cpp  -o test -I /home/jednipat/opencv/include/opencv/ -lhighgui -L /home/jednipat/opencv/lib/ -I/home/jednipat/levmar-2.4 -L/home/jednipat/levmar-2.4 -lm -llapack  -llevmar -I /home/jednipat/libsvm-2.89/ -L /home/jednipat/libsvm-2.89/ 1. Create C++ project in Eclipse Galileo 2. After you finished create C++ project, you have to right click at your project [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=88&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Credit : P&#8217;Phong  @ <a href="http://dsin.blogspot.com/2009/07/eclipse-c-cpp-how-to-build-compile-add.html" target="_blank">dsin blogger</a></p>
<p><strong>Example of my gcc in command line</strong> : gcc filename1.cpp filename2.cpp  -o test -I /home/jednipat/opencv/include/opencv/ -lhighgui -L /home/jednipat/opencv/lib/ -I/home/jednipat/levmar-2.4 -L/home/jednipat/levmar-2.4 -lm -llapack  -llevmar -I /home/jednipat/libsvm-2.89/ -L /home/jednipat/libsvm-2.89/</p>
<p>1. Create C++ project in Eclipse Galileo</p>
<p>2. After you finished create C++ project, you have to <strong>right click at your project name</strong>. Then, you have to <strong>select &#8220;Properties&#8221;</strong>.</p>
<p>3. In<strong> left panel</strong>, you have to <strong>choose &#8220;C/C++ Build&#8221;-&gt;Settings</strong>. Next, in <strong>right panel</strong>, you have to <strong>select tab &#8220;Tool Settings&#8221;</strong>.<br />
To setup <strong>Include path (-I)</strong>, select &#8220;<strong>GCC C++ Compiler</strong>&#8221; -&gt;<strong>Directories </strong> and then you have to add your include path as the following pic.</p>
<p><img class="alignnone size-full wp-image-89" title="Include paths(-I)" src="http://sirivy.files.wordpress.com/2009/10/screenshot-properties-for-3dreconstruction-1.png?w=500&#038;h=363" alt="Include paths(-I)" width="500" height="363" /></p>
<p>To setup <strong>Library paths (-L)</strong>, you have to <strong>select &#8220;GCC C++ Linker&#8221;-&gt;Libraries </strong> in same tab Tool Settings. Then <strong>add  libraries (-l) and library searc path (-L)</strong> as the following pic.</p>
<p><img class="alignnone size-full wp-image-93" title="Library paths (-L)" src="http://sirivy.files.wordpress.com/2009/10/screenshot-properties-for-3dreconstruction.png?w=500&#038;h=363" alt="Library paths (-L)" width="500" height="363" /></p>
<p><strong>Click &#8220;OK&#8221; to finish</strong> adding library and include paths.</p>
<p>4. In my case, I have to <strong>setup environment variable</strong> too. To set environment variables, you have to click at<strong> &#8220;Run&#8221;</strong> on menu toolbar a<strong>nd then select &#8220;Run Configurations&#8230;&#8221;</strong>. Add environment variable like pic below.</p>
<p><img class="alignnone size-full wp-image-94" title="Enviroment variable config" src="http://sirivy.files.wordpress.com/2009/10/screenshot-run-configurations.png?w=500&#038;h=386" alt="Enviroment variable config" width="500" height="386" /></p>
<p>Click <strong>&#8220;Apply&#8221;</strong> and <strong>&#8220;Run&#8221;</strong>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=88&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/10/31/note-setup-library-path-to-compile-in-eclipse-galileo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>

		<media:content url="http://sirivy.files.wordpress.com/2009/10/screenshot-properties-for-3dreconstruction-1.png" medium="image">
			<media:title type="html">Include paths(-I)</media:title>
		</media:content>

		<media:content url="http://sirivy.files.wordpress.com/2009/10/screenshot-properties-for-3dreconstruction.png" medium="image">
			<media:title type="html">Library paths (-L)</media:title>
		</media:content>

		<media:content url="http://sirivy.files.wordpress.com/2009/10/screenshot-run-configurations.png" medium="image">
			<media:title type="html">Enviroment variable config</media:title>
		</media:content>
	</item>
		<item>
		<title>NOte: Install OpenGL on Ubuntu 9.04</title>
		<link>http://sirivy.wordpress.com/2009/10/31/note-install-opengl-on-ubuntu-9-04/</link>
		<comments>http://sirivy.wordpress.com/2009/10/31/note-install-opengl-on-ubuntu-9-04/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 09:32:12 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[OpenGL]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=82</guid>
		<description><![CDATA[Just note for OpenGL installation on Ubuntu 9.04 You can use Synaptic Package Manager to install package name glutg3-dev .  The list of dependency packages , which are automatically installed, are the following packages:  freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev libxt-dev mesa-common-dev xlibmesa-gldev.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=82&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just note for OpenGL installation on Ubuntu 9.04</p>
<p>You can use Synaptic Package Manager to install package name glutg3-dev .  The list of dependency packages , which are automatically installed, are the following packages:  freeglut3-dev libgl1-mesa-dev libglu1-mesa-dev libxt-dev mesa-common-dev xlibmesa-gldev.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/82/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/82/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/82/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=82&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/10/31/note-install-opengl-on-ubuntu-9-04/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>compile Levmar-2.4 without LAPACK on windows</title>
		<link>http://sirivy.wordpress.com/2009/09/10/compile-levmar-2-4-without-lapack-on-windows/</link>
		<comments>http://sirivy.wordpress.com/2009/09/10/compile-levmar-2-4-without-lapack-on-windows/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:42:07 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[compile levmar on windows]]></category>
		<category><![CDATA[levmar-2.4 compilation]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=80</guid>
		<description><![CDATA[There are few steps to compile levmar-2.4 source code. 1. You can download source code from here. (look for &#8220;version 2.4&#8243; and then click to download) 2. Extract file to your desire directory. 3. Next, you have to modify three lines(line 22 , 23 and 32) in Makefile.vc Comment this line: (line 22) LAPACKLIBS_PATH=C:\src\lib # [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=80&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are few steps to compile levmar-2.4 source code.</p>
<p>1. You can download source code from <a title="Levmar-2.4" href="http://www.ics.forth.gr/~lourakis/levmar/" target="_blank">here</a>. (look for &#8220;version 2.4&#8243; and then click to download)</p>
<p>2. Extract file to your desire directory.</p>
<p>3. Next, you have to modify three lines(line 22 , 23 and 32) in Makefile.vc</p>
<ul>
<li> Comment this line: (line 22)<br />
<strong>LAPACKLIBS_PATH=C:\src\lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!<br />
</strong>Like this:<br />
<strong>#LAPACKLIBS_PATH=C:\src\lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!</strong></li>
<li>Modify this line a bit:(line 23)<br />
<strong>LDFLAGS=/link /subsystem:console /opt:ref /libpath:$(LAPACKLIBS_PATH) /libpath:.</strong><br />
to be like this:<br />
<strong>LDFLAGS=/link /subsystem:console /opt:ref  /libpath:.</strong></li>
<li>Comment out this line:(line 32)<br />
<strong>LAPACKLIBS=clapack.lib blas.lib libF77.lib libI77.lib</strong><br />
like this:<br />
<strong>#LAPACKLIBS=clapack.lib blas.lib libF77.lib libI77.lib</strong></li>
</ul>
<p>4. Next, you have to follow their readme file by comment out one line in file <strong>lm.h</strong></p>
<ul>
<li>Comment out this line<br />
<strong>#define HAVE_LAPACK /* use LAPACK */<br />
</strong>to be like this<br />
<strong>//#define HAVE_LAPACK /* use LAPACK */</strong></li>
</ul>
<p>5. Finally, you can try to compile in command prompt.</p>
<ul>
<li> Go to your levmar-2.4 directory then type<br />
<strong>nmake /f  Makefile.vc</strong></li>
</ul>
<p>Finish! now you can test with your  lmdemo.exe</p>
<p>Good Luck ^_^</p>
<p><!--Session data--></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=80&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/09/10/compile-levmar-2-4-without-lapack-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Installation OpenCV on Ubuntu 9.04</title>
		<link>http://sirivy.wordpress.com/2009/09/04/installing-opencv-on-ubuntu-9-04/</link>
		<comments>http://sirivy.wordpress.com/2009/09/04/installing-opencv-on-ubuntu-9-04/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 09:40:40 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=70</guid>
		<description><![CDATA[วันนี้ทำการลง openCV ใหม่หลังจากลงอุบุนตุใหม่ ประกอบกับจำไม่ได้ว่า ครั้งก่อนลงไปแล้วไม่ได้จดวิธีลงไว้ ลงอีกครั้งเลยขอจดไว้ก่อน เผื่อคราวหน้า ลงอุบุนตุใหม่จะได้ไม่มานั่งงมอีก อ้างอิงการลง openCV บน Ubuntu 9.04 จาก http://webeng.cs.ait.ac.th/cvwiki/opencv:tutorial:install:ubuntu (Thanks อ.แมท(Dr.Matthew@AIT)for very useful installation guide) ซึ่งมีขั้นตอนดังนี้ 1. ใช้ synaptic ติดตั้ง libgstreamer0.10-dev และ libdc1394-13-dev 2. ดาวน์โหลด opencv 1.1.0 ได้จาก openCV wiki 3. แตกไฟล์ opencv-1.1pre1.tar.gz โดยใช้คำสั่ง tar -xvfz opencv-1.1pre1.tar.gz 4. ในไดเรกทอรี่ของ opencv-1.1.0 พิมพ์คำสั่ง(ให้เหมือนอันนี้เลยนะ เครื่องหมาย=พิมพ์ให้ติดprefix) ./configure &#8211;prefix=${HOME}/opencv &#8211;without-xine &#8211;without-quicktime &#8211;with-gstreamer &#8211;with-1394libs &#8211;with-v4l [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=70&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>วันนี้ทำการลง openCV ใหม่หลังจากลงอุบุนตุใหม่ ประกอบกับจำไม่ได้ว่า ครั้งก่อนลงไปแล้วไม่ได้จดวิธีลงไว้ ลงอีกครั้งเลยขอจดไว้ก่อน เผื่อคราวหน้า ลงอุบุนตุใหม่จะได้ไม่มานั่งงมอีก</p>
<p>อ้างอิงการลง openCV บน Ubuntu 9.04 จาก</p>
<p>http://webeng.cs.ait.ac.th/cvwiki/opencv:tutorial:install:ubuntu</p>
<p>(Thanks อ.แมท<a href="http://www.cs.ait.ac.th/~mdailey">(Dr.Matthew@AIT)</a>for very useful installation guide)<br />
ซึ่งมีขั้นตอนดังนี้</p>
<p>1. ใช้ synaptic ติดตั้ง libgstreamer0.10-dev และ libdc1394-13-dev<br />
2. ดาวน์โหลด opencv 1.1.0 ได้จาก openCV wiki<br />
3. แตกไฟล์ opencv-1.1pre1.tar.gz โดยใช้คำสั่ง tar -xvfz opencv-1.1pre1.tar.gz<br />
4. ในไดเรกทอรี่ของ opencv-1.1.0 พิมพ์คำสั่ง(ให้เหมือนอันนี้เลยนะ เครื่องหมาย=พิมพ์ให้ติดprefix)<br />
./configure &#8211;prefix=${HOME}/opencv &#8211;without-xine &#8211;without-quicktime &#8211;with-gstreamer &#8211;with-1394libs &#8211;with-v4l<br />
5. ในไดเรกทอรี่ของ opencv-1.1.0 พิมพ์คำสั่ง<br />
make<br />
6. เมื่อ make เสร็จ ก็พิมพ์<br />
make install<br />
เพื่อติดตั้ง opencv ได้เลยโดย opencv จะไปติดตั้งอยู่ที่ /home/jednipat/opencv ตามไดเรคทอรี่ที่ระบุไว้ตอนรัน ./configure<br />
7. พิมพ์<br />
export LD_LIBRARY_PATH=/home/jednipat/opencv/lib</p>
<p>เมื่อ make install เสร็จ ก็ลองมารัน example ที่ opnecv ให้มาโดยคอมไพล์ดังนี้</p>
<p>g++ -o outputname yourfilename.c -I /home/jednipat/opencv/include/opencv/ -lhighgui -L /home/jednipat/opencv/lib/</p>
<p>กรณีของผมคอมไพล์ผ่านแต่พอรันแล้ว เจอ error ดังนี้ (เนื่องจากผมลืมทำข้อ 7)</p>
<p>error while loading shared libraries: libhighgui.so.2: cannot open<br />
shared object file: No such file or directory</p>
<p>เลยค้นวิธีแก้ได้มาจากบล็อกของ <a href="http://dsin.blogspot.com/2009/07/opencv-in-gedit.html">dsin (พี่พง)</a> สาเหตุเป็นเพราะว่ายังไม่ได้ export LD_LIBRARY_PATH ซึ่งก็ทำได้ดังนี้</p>
<p>export LD_LIBRARY_PATH=/home/jednipat/opencv/lib</p>
<p>จากนั้นทำการเปิดไฟล์ .bashrc ขึ้นมาแล้วเพิ่มบรรทัดนี้เข้าไปในไฟล์ .bashrc แล้วก็ทำการ save (พิมพ์ <strong>gedit .bashrc</strong> ใน home directory เพื่อทำการแก้ไขไฟล์ .bashrc เพราะจะได้ไม่ต้องมานั่งพิมพ์ export ทุกครั้งไปที่จะใช้งาน )</p>
<p>ที่นี้คิดว่าน่าจะรันได้ตามปกติ ลองคอมไพล์และรัน example ดูอีกที คอมไพล์ผ่าน<br />
แต่พอรันปุ๊ป เจอกับ</p>
<p>OpenCV ERROR: Unspecified error (The function is not implemented.<br />
Rebuild the library with Windows, GTK+ 2.x or Carbon support)<br />
in function cvNamedWindow, window.cpp(71)<br />
Terminating the application&#8230;<br />
Segmentation fault</p>
<p>อ๊ากก&#8230; ค้นไปค้นมาอีกก็ได้คำแนะนำจาก<a href="http://software.intel.com/en-us/forums/intel-integrated-performance-primitives/topic/53833/" target="_blank">เว็บนี้</a> &lt; &#8211; - คลิก</p>
<pre style="font-family:arial;">คอมเมนต์สุดท้ายบอกไว้ว่าสาเหตุมาจากตอนรัน ./configure และ make ไม่มี
gtk+ lib dev ไม่มีเขาแนะนำให้ remove openCV ออกก่อน แล้วไปลง
libgtk2.0-dev (เข้า synaptic package manager แล้ว search
คำว่า libgtk2.0-dev ละก็ mark for installation - &gt; apply )</pre>
<p>เมื่อลง libgtk2.0-dev เสร็จให้ uninstall openCV  ก่อนโดยพิมพ์ make uninstall<br />
ในไดเรคทอรี่ opencv-1.1.0 จากนั้นเพื่อความชัวร์ควรจะ restart เครื่องก่อน<br />
(ผมไม่รีสตาร์ทเครื่อง  make ใหม่ก็เจอปัญหาเดิม เลยลอง รีสตาร์ทเครื่อง แล้วทำใหม่)</p>
<p>แล้วทำการ ./configure , make , make install อีกที</p>
<p>1&gt;  ./configure blablabla..<br />
2&gt;  make<br />
3&gt;  make install<br />
4&gt;  export LD_LIBRARY_PATH=/home/jednipat/opencv/lib</p>
<p>จากนั้นไปยัง directory  /home/jednipat/opencv-1.1.0/samples/c<br />
แล้วลองคอมไพล์ไฟล์ใด ๆ ผมเลือกไฟล์ตัวอย่างการใช้งาน SURF descriptor<br />
ชื่อไฟล์ว่า find_obj.cpp คอมไพล์ด้วยคำสั่งดังนี้</p>
<p>g++ find_obj.cpp -o test -I /home/jednipat/opencv/include/opencv/ -lhighgui<br />
-L /home/jednipat/opencv/lib/</p>
<p>จากนั้นรัน ./test เพื่อดูผลลัพธ์ของโปรแกรม</p>
<p>เย้&#8230; สำเร็จ..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=70&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/09/04/installing-opencv-on-ubuntu-9-04/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>How to export object in maya to openGL?</title>
		<link>http://sirivy.wordpress.com/2009/04/09/how-to-export-object-in-maya-to-opengl/</link>
		<comments>http://sirivy.wordpress.com/2009/04/09/how-to-export-object-in-maya-to-opengl/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 20:38:02 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=58</guid>
		<description><![CDATA[1. Download maya script export/import from here 2. After you open maya file , you should make sure that your object in maya is polygons. (i.e. if your object is NURBS , you should convert to polygon) To convert NURBS to polygon, there are two steps. - Firstly , select your NURBS surface - Secondly, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=58&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>1. Download maya script export/import from <a title="maya script for export/import object" href="http://www.highend3d.com/maya/downloads/mel_scripts/modeling/poly_tools/4120.html" target="_blank">here</a></p>
<p>2. After you open maya file , you should make sure that your object in maya is polygons.</p>
<p>(i.e. if your object is NURBS , you should convert to polygon)</p>
<p>To convert NURBS to polygon, there are two steps.</p>
<p>- Firstly , select your NURBS surface</p>
<p>- Secondly, goto menu bar and click at &#8211;&gt; modify &#8211;&gt; convert &#8211;&gt; NURBS to polygons</p>
<p>3. Open maya script from script editor. After you already loaded maya script to script editor,</p>
<p>click at execute button in script editor and specify your path and file name.</p>
<p>( Note: if you can&#8217;t find script editor , you can click at Display&#8211;&gt; UI Elements &#8211;&gt; Command Line)</p>
<p>4. Check your .obj file and enjoy to import to openGL. ^_^</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/58/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/58/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/58/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=58&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/04/09/how-to-export-object-in-maya-to-opengl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Compile yacc &amp; lex file with option.</title>
		<link>http://sirivy.wordpress.com/2009/04/01/compile-yacc-lex-file-with-option/</link>
		<comments>http://sirivy.wordpress.com/2009/04/01/compile-yacc-lex-file-with-option/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 19:55:27 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Compiler & Lex & Yacc]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=53</guid>
		<description><![CDATA[1st&#62; yacc -d yaccfilename.y =&#62; This command will generate 2 following files &#8220;y.tab.h&#8221; and &#8220;y.tab.c&#8221;. If you meet error &#8221; ‘yylval’ undeclared (first use in this function)&#8221; , you should try to compile yacc file with option d. Becuase option d will also produce header file(y.tab.h) for you. 2nd&#62; lex lexfilename.l =&#62; This command will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=53&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1st&gt;</strong> yacc -d yaccfilename.y</p>
<p>=&gt; This command will generate 2 following files &#8220;y.tab.h&#8221; and &#8220;y.tab.c&#8221;.</p>
<p>If you meet error &#8221; <strong>‘yylval’ undeclared (first use in this function)</strong>&#8221; ,</p>
<p>you should try to compile yacc file with option d. Becuase option d will also produce header file(y.tab.h) for you.</p>
<p><strong>2nd&gt; </strong>lex lexfilename.l</p>
<p>=&gt; This command will generate lex.yy.c.</p>
<p><strong>3rd&gt;</strong> gcc y.tab.c lex.yy.c -ll -ly -o arbitraryoutputname</p>
<p><strong>4th&gt; </strong>./arbitraryoutputname</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/53/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/53/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/53/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=53&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/04/01/compile-yacc-lex-file-with-option/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Lex Simple Example</title>
		<link>http://sirivy.wordpress.com/2009/03/28/lex-simple-example/</link>
		<comments>http://sirivy.wordpress.com/2009/03/28/lex-simple-example/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 13:38:56 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=49</guid>
		<description><![CDATA[CODE: Reference from LEX &#38; YACC books ======================== %{ char* yytext; %} %% [\t]+ /*ignore whitespace*/; is &#124; am &#124; are &#124; were &#124; was &#124; go      { printf(&#8220;%s:is a verb\n&#8221;,yytext);} very &#124; simply &#124; gently &#124; quietly &#124; calmly &#124; angrily {printf(&#8220;%s: is and adverb\n&#8221;,yytext);} to &#124; from &#124; behind &#124; above &#124; between [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=49&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>CODE: Reference from LEX &amp; YACC books</strong></p>
<p>========================</p>
<p>%{<br />
char* yytext;<br />
%}<br />
%%<br />
[\t]+ /*ignore whitespace*/;</p>
<p>is |<br />
am |<br />
are |<br />
were |<br />
was |<br />
go      { printf(&#8220;%s:is a verb\n&#8221;,yytext);}</p>
<p>very |<br />
simply |<br />
gently |<br />
quietly |<br />
calmly |<br />
angrily {printf(&#8220;%s: is and adverb\n&#8221;,yytext);}</p>
<p>to |<br />
from |<br />
behind |<br />
above |<br />
between |<br />
below {printf(&#8220;%s: is a preposition\n&#8221;,yytext);}</p>
<p>if |<br />
then |<br />
and |<br />
but |<br />
or  { printf(&#8220;%s: is a conjunction\n&#8221;,yytext);}</p>
<p>their |<br />
my |<br />
your |<br />
his |<br />
her |<br />
its {printf(&#8220;%s: is an adjective\n&#8221;,yytext);}</p>
<p>I |<br />
you |<br />
he |<br />
she |<br />
we |<br />
they {printf(&#8220;%s: is a pronoun\n&#8221;,yytext);}</p>
<p>[a-zA-Z]+ {printf(&#8220;%s: is not a verb\n&#8221;,yytext);}</p>
<p>.|\n    {ECHO; /*normal default anyway*/}<br />
%%</p>
<p>main()<br />
{<br />
yylex();<br />
}</p>
<p>========================</p>
<p>This example code will scan input and if input match with pattern program will print type of each word.</p>
<p><strong>*NOTE: </strong>In specifying pattern , you must have space before &#8220;|&#8221; symbol<br />
(i.e.   is|   &#8212;&gt;it  didn&#8217;t work You will meet unrecognized rule   <strong>BUT</strong> is  |  &#8211;&gt;it works )</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=49&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/03/28/lex-simple-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Lex</title>
		<link>http://sirivy.wordpress.com/2009/03/27/lex/</link>
		<comments>http://sirivy.wordpress.com/2009/03/27/lex/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 22:33:00 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=45</guid>
		<description><![CDATA[STRUCTURE OF LEX FILES : &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; %{ /*DEFINITION SECTION*/ %} %% /*RULES SECTION is made of two parts: pattern and action*/ /*Action will be executed if pattern is recognized by Lexer*/ /*Pattern is written in form of Regular Expression*/ %% /*USER SUB-ROUTINE SECTION*/ /* include main program Here!*/ &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; INSTRUCTION FOR COMPILE LEX FILE: 1.  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=45&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>STRUCTURE OF LEX FILES :</strong></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>%{</p>
<p>/*DEFINITION SECTION*/</p>
<p>%}</p>
<p>%%</p>
<p>/*RULES SECTION is made of two parts: pattern and action*/</p>
<p>/*Action will be executed if pattern is recognized by Lexer*/</p>
<p>/*Pattern is written in form of Regular Expression*/</p>
<p>%%</p>
<p>/*USER SUB-ROUTINE SECTION*/</p>
<p>/* include main program Here!*/</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>INSTRUCTION FOR COMPILE LEX FILE:<br />
</strong></p>
<p>1.  lex lexfilename.l</p>
<p>Aflter your compilation succeeded , lex will generate file <strong>yy.lex.c</strong> for you. Next job is using gcc to compile this C file.</p>
<p>2.  gcc lex.yy.c -o arbitaryOutputName -ll</p>
<p>-ll to link to Lex library</p>
<p>3.  ./arbitaryOutputName</p>
<p>To test your program.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I feel sleepy. Let&#8217;s continue tomorrow. -_- zZZZ</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/45/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/45/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/45/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=45&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/03/27/lex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
		<item>
		<title>Grammar Beta Version</title>
		<link>http://sirivy.wordpress.com/2009/03/27/grammar-beta-version/</link>
		<comments>http://sirivy.wordpress.com/2009/03/27/grammar-beta-version/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 17:05:31 +0000</pubDate>
		<dc:creator>sirivy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sirivy.wordpress.com/?p=41</guid>
		<description><![CDATA[Program_list &#8211;&#62; Program_list Program Program_list &#8211;&#62; Program Program &#8211;&#62; Declare; &#124; Assign; &#124; Condition &#124; Loop Declare &#8211;&#62; Type variable &#124; Type variable = exp Variable &#8211;&#62; id &#124; Array Array &#8211;&#62; Array_size] Array_size &#8211;&#62; id [size Type &#8211;&#62; int &#124; float &#124; char &#124; string Assign &#8211;&#62; Statement Statement &#8211;&#62; id = expression Statement [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=41&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Program_list &#8211;&gt; Program_list Program<br />
Program_list &#8211;&gt; Program<br />
Program &#8211;&gt; Declare; | Assign; | Condition | Loop<br />
Declare &#8211;&gt; Type variable | Type variable = exp<br />
Variable &#8211;&gt; id | Array<br />
Array &#8211;&gt; Array_size]<br />
Array_size &#8211;&gt; id [size<br />
Type &#8211;&gt; int | float | char | string<br />
Assign &#8211;&gt; Statement<br />
Statement &#8211;&gt; id = expression<br />
Statement &#8211;&gt; expression<br />
expression &#8211;&gt; expression + term | expression &#8211; term | term<br />
term &#8211;&gt; term * fac | term / fac | factor<br />
factor &#8211;&gt; (expression)<br />
factor &#8211;&gt; -factor | id | number | char | string<br />
Control &#8211;&gt; If_cond; | If_else_cond;<br />
If_cond; &#8211;&gt; if(condition) command<br />
If_else_cond; &#8211;&gt; if(condition) command else command<br />
condition &#8211;&gt; sub_cond; m_op subcondition | p_op subcondtion | sub_condition<br />
m_op &#8211;&gt; and|or<br />
p_op &#8211;&gt; not<br />
sub_condi &#8211;&gt; (sub_condition) | DATA relop DATA<br />
sub_condi &#8211;&gt; true | false<br />
DATA &#8211;&gt; id | expression | number | char | string<br />
command &#8211;&gt; Program | { Program }</p>
<p>Loop &#8211;&gt; while_Loop | for_Loop<br />
while_Loop &#8211;&gt; while (condition) command<br />
For_Loop &#8211;&gt; For(Declare ; condition; Assign ) command</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sirivy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sirivy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sirivy.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sirivy.wordpress.com&amp;blog=5058817&amp;post=41&amp;subd=sirivy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sirivy.wordpress.com/2009/03/27/grammar-beta-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e53e5b075658332508e76f828137903d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sir_ivy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
