<?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>how to</title>
	<atom:link href="http://www.neteyaz.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.neteyaz.com</link>
	<description>linux and open source tips</description>
	<lastBuildDate>Sun, 16 May 2010 08:47:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>lock resolv.conf in ubuntu or another linux</title>
		<link>http://www.neteyaz.com/lock-resolv-conf-in-ubuntu-or-another-linux</link>
		<comments>http://www.neteyaz.com/lock-resolv-conf-in-ubuntu-or-another-linux#comments</comments>
		<pubDate>Sun, 16 May 2010 08:46:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[resolv.conf]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=173</guid>
		<description><![CDATA[to lock your resolv.conf

Bug Description
Binary package hint: network-manager
This bug causes name resolution to be painfully slow. If I manually remove the routers ip from resolv.conf it works normally, but next time the machine is booted the address gets added to the list again. I found the only way around this was to lock the file. [...]]]></description>
			<content:encoded><![CDATA[<h2>to lock your resolv.conf</h2>
<p><strong><br />
Bug Description</strong></p>
<p>Binary package hint: network-manager</p>
<p>This bug causes name resolution to be painfully slow. If I manually remove the routers ip from resolv.conf it works normally, but next time the machine is booted the address gets added to the list again.<span id="more-173"></span> I found the only way around this was to lock the file. &#8220;sudo chattr +i /etc/resolv.conf&#8221; so that network manager would not re-edit the file upon boot. I have seen this problem many times on the forums, and believe it should be made a priority to fix this. This &#8220;slow internet&#8221; gives people a horrible first impression of Ubuntu, and seems it would be easy enough to to fix. Thank you for our time.</p>
<p>ProblemType: Bug<br />
DistroRelease: Ubuntu 10.04<br />
Package: network-manager 0.8-0ubuntu2<br />
ProcVersionSignature: hostname 2.6.32-18.27-generic 2.6.32.10+drm33.1<br />
Uname: Linux 2.6.32-18-generic x86_64<br />
NonfreeKernelModules: nvidia<br />
Architecture: amd64<br />
CRDA: Error: [Errno 2] No such file or directory<br />
Date: Tue Apr 6 00:42:02 2010<br />
Gconf:</p>
<p>IfupdownConfig:<br />
 auto lo<br />
 iface lo inet loopback<br />
InstallationMedia: Ubuntu 10.04 &#8220;Lucid Lynx&#8221; &#8211; Beta amd64 (20100318)<br />
IpRoute:<br />
 192.168.2.0/24 dev eth0 proto kernel scope link src 192.168.2.5 metric 1<br />
 169.254.0.0/16 dev eth0 scope link metric 1000<br />
 default via 192.168.2.1 dev eth0 proto static<br />
Keyfiles: Error: [Errno 2] No such file or directory<br />
ProcEnviron:<br />
 LANG=en_US.utf8<br />
 SHELL=/bin/bash<br />
RfKill:</p>
<p>SourcePackage: network-manager</p>
<blockquote><p>sudo chattr +i /etc/resolv.conf</p></blockquote>
<p>after this command your resolv.conf file will be locked and the file will not change on boot, or after create new connection</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/lock-resolv-conf-in-ubuntu-or-another-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ubuntu Apache, PHP, mysql, and phpyadmin</title>
		<link>http://www.neteyaz.com/ubuntu-apache-php-mysql-and-phpyadmin</link>
		<comments>http://www.neteyaz.com/ubuntu-apache-php-mysql-and-phpyadmin#comments</comments>
		<pubDate>Fri, 07 May 2010 10:52:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=171</guid>
		<description><![CDATA[Note: In this post I&#8217;ll be showing how  to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 8.10  using Terminal. If you want to install them all at the same time with  minimal fuss, I recommend you to read my post on installing LAMP.]

Installing Apache
1. Open Terminal (Application -&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Note: In this post I&#8217;ll be showing how  to install Apache, php, MySQL and phpMyAdmin (one by one) on Ubuntu 8.10  using Terminal. If you want to install them all at the same time with  minimal fuss, I recommend you to read my post on <strong>installing LAMP</strong>.]</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><strong><span style="text-decoration: underline;">Installing Apache</span></strong></p>
<p style="text-align: justify;">1. Open Terminal (Application -&gt;  Accessories -&gt; Terminal) and execute the following command:</p>
<blockquote>
<p style="text-align: left;"><em>sudo apt-get install apache2</em></p>
</blockquote>
<p style="text-align: justify;">2. When the setup is complete you can  check if the Apache is working properly by pointing your browser to http://localhost. If you  see the text “It works!”, it means Apache is working just fine.</p>
<p style="text-align: justify;">3. Towards the end of the installation  if you see a message like this inside Terminal, “<em>Could not reliably  determine the server’s fully qualified domain name, using 127.0.1.1 for  ServerName</em>“, you can fix this by executing the following command.  It will open Gedit (text editor).</p>
<blockquote>
<p style="text-align: left;"><em>gksu gedit /etc/apache2/conf.d/fqdn</em></p>
</blockquote>
<p style="text-align: justify;">4. When Gedit opens, type “ServerName  localhost” inside the file and click Save. Then close the file.</p>
<p style="text-align: justify;"><span id="more-151"> </span></p>
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Installing php5</strong></span></p>
<p style="text-align: justify;">1. Inside Terminal, execute the  following command:</p>
<blockquote>
<p style="text-align: left;"><em>sudo apt-get install php5  libapache2-mod-php5</em></p>
</blockquote>
<p style="text-align: justify;">2. When setup is complete, you have to  restart Apache so that php5 will work on Apache. Execute the following  command in Terminal:</p>
<blockquote>
<p style="text-align: left;"><em>sudo /etc/init.d/apache2 restart<span id="more-171"></span></em></p>
</blockquote>
<p style="text-align: justify;">3. You can now test to see if php5 works  with Apache. To do this you can create a new php file inside your  /var/www/ folder. (The text in red is the filename. You can put any  name.)</p>
<blockquote>
<p style="text-align: left;"><em>sudo gedit /var/www/<span style="color: #ff0000;">nass</span>.php</em></p>
</blockquote>
<p style="text-align: justify;">4. The command above will open Gedit.  Just type in the following php code, save and close the file:</p>
<blockquote>
<p style="text-align: left;"><em>&lt;? phpInfo(); ?&gt;</em></p>
</blockquote>
<p style="text-align: justify;">5. Now point your browser to  “http://localhost/<span style="color: #ff0000;">nass</span>.php”  and see if you can see the text “yoo hooo!” and a lot of information  about your php5 installation. If you see that, it means your have  successfully installed php5.</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Installing MySQL</strong></span></p>
<p style="text-align: justify;">1. Inside Terminal, execute the  following command:</p>
<blockquote>
<p style="text-align: left;"><em>sudo apt-get install mysql-server  libapache2-mod-auth-mysql php5-mysql</em></p>
</blockquote>
<p style="text-align: justify;">2. Towards the end of the installation  you will be prompted to set your root or admin password (see pic below)</p>
<p style="text-align: center;"><img title="set root password" src="http://ubuntuexperiment.files.wordpress.com/2008/11/mysql11.png?w=480&amp;h=335" alt="set root password" width="480" height="335" /></p>
<p style="text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong>Installing phpMyAdmin</strong></span></p>
<p style="text-align: justify;">1. Inside Terminal, execute the  following command:</p>
<blockquote>
<p style="text-align: left;"><em>sudo apt-get install phpmyadmin</em></p>
</blockquote>
<p style="text-align: justify;">2 During the installation you will be  asked to select the webserver that would be used to run phpMyAdmin.  Select Apache2 (see pic below).</p>
<p style="text-align: justify;"><img title="choosing webserver" src="http://ubuntuexperiment.files.wordpress.com/2008/11/phpmyadmin.png?w=480&amp;h=335" alt="choosing webserver" width="480" height="335" /></p>
<p style="text-align: justify;">3. After the installation is over  execute the following command to copy the phpmyadmin folder into the  /var/www/ directory. (By default it is installed in  /usr/share/phpmyadmin/ directory.)</p>
<blockquote>
<p style="text-align: left;"><em>sudo ln -s /usr/share/phpmyadmin/  /var/www/phpmyadmin</em></p>
</blockquote>
<p style="text-align: justify;">4. Now you can go to the phpMyAdmin  login page by pointing your browser to: http://localhost/phpmyadmin/index.php</p>
<p style="text-align: justify;">The username for MySQL and phpMyAdmin is  “root”. The password will be what you set in step 2 (under installing  MySQL).</p>
<p style="text-align: justify;">That’s it! Now you’ve successfully  installed Apache 2 webserver, php5, MySQL and phpMyAdmin on Ubuntu.</p>
<p style="text-align: justify;">
<p style="text-align: justify;"><span style="text-decoration: underline;"><strong><span style="color: #ff0000;">UPDATE</span> (28-Jan-09)</strong></span></p>
<p style="text-align: justify;"><span style="color: #888888;"><span style="text-decoration: underline;"><br />
</span></span></p>
<p>(how can you install apache and php ubuntu apt-get install apache)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/ubuntu-apache-php-mysql-and-phpyadmin/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yakuake Autostart (KDE)</title>
		<link>http://www.neteyaz.com/yakuake-autostart-kde</link>
		<comments>http://www.neteyaz.com/yakuake-autostart-kde#comments</comments>
		<pubDate>Tue, 04 May 2010 18:18:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[autorstart]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yakuake]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=169</guid>
		<description><![CDATA[Make Yakuake autostart:
Open up your home folder; make sure you can see your hidden files.
Navigate to the .kde/Autostart folder and create a new text file:  yakuake.
Paste this in the file:
#!/bin/bash
/usr/bin/yakuake
Start up your new Yakuake  Terminal and press F12.
~/.kde/Autostart/
chmod +x yakuake
Next time you start Ubuntu Yakuake will be running. You just need to  [...]]]></description>
			<content:encoded><![CDATA[<h2>Make Yakuake autostart:</h2>
<p>Open up your home folder; make sure you can see your hidden files.<br />
Navigate to the .kde/Autostart folder and create a new text file:  yakuake.<br />
Paste this in the file:</p>
<blockquote style="margin-bottom: 0pt; margin-top: 0pt;"><p>#!/bin/bash<br />
/usr/bin/yakuake</p></blockquote>
<p>Start up your new Yakuake  Terminal and press F12.</p>
<blockquote style="margin-bottom: 0pt; margin-top: 0pt;"><p>~/.kde/Autostart/<br />
chmod +x yakuake</p></blockquote>
<p>Next time you start Ubuntu Yakuake will be running. You just need to  press F12 to access it.<br />
To configure it you can right click on the  Yakuake screen and use the menu.<br />
The size of the window and other  settings can be accessed by clicking the small down arrow at the bottom  right of the screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/yakuake-autostart-kde/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fatal error: Allowed memory size wp-settings.php on line 307</title>
		<link>http://www.neteyaz.com/fatal-error-allowed-memory-size-wp-settings-php-on-line-307</link>
		<comments>http://www.neteyaz.com/fatal-error-allowed-memory-size-wp-settings-php-on-line-307#comments</comments>
		<pubDate>Tue, 23 Feb 2010 23:01:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-settings]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=166</guid>
		<description><![CDATA[if you get an error like this: Fatal error: Allowed memory size wp-settings.php on line 307

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 235726 bytes) in /home/uno1093/public_html/wp-includes/class-simplepie.php on line 13070
or
Fatal error: Allowed memory size wp-settings.php on line 307
add this line to your wp-config.php
define('WP_MEMORY_LIMIT', '64M');
]]></description>
			<content:encoded><![CDATA[<p>if you get an error like this: Fatal error: Allowed memory size wp-settings.php on line 307</p>
<p><span id="more-166"></span></p>
<p>Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 235726 bytes) in /home/uno1093/public_html/wp-includes/class-simplepie.php on line 13070</p>
<p>or</p>
<p>Fatal error: Allowed memory size wp-settings.php on line 307</p>
<p><strong>add</strong> this line to your <code>wp-config.php</code><br />
<code>define('WP_MEMORY_LIMIT', '64M');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/fatal-error-allowed-memory-size-wp-settings-php-on-line-307/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do not start MySQL on startup</title>
		<link>http://www.neteyaz.com/do-not-start-mysql-on-startup</link>
		<comments>http://www.neteyaz.com/do-not-start-mysql-on-startup#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:34:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqld]]></category>
		<category><![CDATA[stop]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=162</guid>
		<description><![CDATA[Stopping to autostart mysql service
(firstly u must be sure to there is a&#60;strong&#62; /etc/init.d/mysql or mysqld&#60;/strong&#62; )

# chkconfig --list &#124; grep mysqld
mysqld          0:off   1:off   2:off   3:on   4:on   5:on   6:off
# chkconfig --level 345 mysql off
error reading information on service mysql: No such file or directory
# chkconfig --level 345 mysqld off
# reboot

]]></description>
			<content:encoded><![CDATA[<p>Stopping to autostart mysql service</p>
<p>(firstly u must be sure to there is a&lt;strong&gt; /etc/init.d/mysql or mysqld&lt;/strong&gt; )</p>
<pre class="pretyprint">
# chkconfig --list | grep mysqld
mysqld          0:off   1:off   2:off   3:on   4:on   5:on   6:off
# chkconfig --level 345 mysql off
error reading information on service mysql: No such file or directory
# chkconfig --level 345 mysqld off
# reboot
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/do-not-start-mysql-on-startup/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to autostart MYSQL (init.d and chkconfig)</title>
		<link>http://www.neteyaz.com/how-to-autostart-mysql-init-d-and-chkconfig</link>
		<comments>http://www.neteyaz.com/how-to-autostart-mysql-init-d-and-chkconfig#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:30:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[autostart]]></category>
		<category><![CDATA[chkconfig]]></category>
		<category><![CDATA[init.d]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=158</guid>
		<description><![CDATA[chkconfig
The chkconfig command can also be used to activate and deactivate services. If you use the chkconfig &#8211;list command, you will see a list of system services and whether they are started (on) or stopped (off) in runlevels 0-6 (at the end of the list, you will see a section for the services managed by [...]]]></description>
			<content:encoded><![CDATA[<p><strong>chkconfig</strong></p>
<p>The chkconfig command can also be used to activate and deactivate services. If you use the chkconfig &#8211;list command, you will see a list of system services and whether they are started (on) or stopped (off) in runlevels 0-6 (at the end of the list, you will see a section for the services managed by xinetd.<br />
<span id="more-158"></span><br />
If you use chkconfig &#8211;list to query a service managed by xinetd, you will see whether the xinetd service is enabled (on) or disabled (off). For example, the following command shows that finger is enabled as an xinetd service: </p>
<p><strong>$ chkconfig &#8211;list finger<br />
finger          on</strong></p>
<p>As shown above, if xinetd is running, finger is enabled.</p>
<p>If you use chkconfig &#8211;list to query a service in /etc/rc.d, you will see the service&#8217;s settings for each runlevel, like the following:</p>
<p><strong>$ chkconfig &#8211;list anacron<br />
anacron         0:off   1:off   2:on    3:on    4:on    5:on    6:off</strong></p>
<p>More importantly, chkconfig can be used to set a service to be started (or not) in a specific runlevel. For example, to turn nscd off in runlevels 3, 4, and 5, use the command:</p>
<p><strong>chkconfig &#8211;level 345 nscd off</strong></p>
<p>See the chkconfig man page for more information on how to use it.<br />
<strong><br />
Warning</strong></p>
<p>Services managed by xinetd are immediately affected by chkconfig. For example, if xinetd is running, finger is disabled, and the command chkconfig finger on is executed, finger is immediately enabled without having to restart xinetd manually. Changes for other services do not take effect immediately after using chkconfig. You must stop or start the individual service with the command service daemon stop. In the previous example, replace daemon with the name of the service you want to stop; for example, httpd. Replace stop with start or restart to start or restart the service. </p>
<p>To autostart you mysql service : (firstly u must be sure to there is a<strong> /etc/init.d/mysql or mysqld</strong> )</p>
<pre class="pretyprint">
# chkconfig --list | grep mysqld
mysqld          0:off   1:off   2:off   3:off   4:off   5:off   6:off
# chkconfig --level 345 mysql on
error reading information on service mysql: No such file or directory
# chkconfig --level 345 mysqld on
# reboot
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/how-to-autostart-mysql-init-d-and-chkconfig/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Drawing Line With DDA Algorithm using OpenGL in C++</title>
		<link>http://www.neteyaz.com/drawing-line-with-dda-algorithm-using-opengl-in-c</link>
		<comments>http://www.neteyaz.com/drawing-line-with-dda-algorithm-using-opengl-in-c#comments</comments>
		<pubDate>Sun, 06 Dec 2009 19:38:01 +0000</pubDate>
		<dc:creator>TaZ</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[DDA]]></category>
		<category><![CDATA[glutMouseFunc]]></category>
		<category><![CDATA[Line Drawing]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=152</guid>
		<description><![CDATA[The code is based on the popularly used dda line drawing algorithm.It picks up two point from the window and change the color of pixels which are closest to vectorial line between them.



#include &#60;GL/glut.h&#62;
#include &#60;math.h&#62;
#include &#60;time.h&#62;
#define W 512
#define H 512
int points[2][2];
int point_count=0;
void initialize(){
	glClearColor( 0.0, 0.0, 0.0, 0.0);//set background color to black
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(0, W,0,H);
}

void setPixel(int x, int [...]]]></description>
			<content:encoded><![CDATA[<p>The code is based on the popularly used dda line drawing algorithm.It picks up two point from the window and change the color of pixels which are closest to vectorial line between them.<br />
<span id="more-152"></span><br />
<img src="http://www.neteyaz.com/files/2009/12/adsız-300x163.jpg" alt="changing color of closest pixels to vectorial line " title="changing color of closest pixels to vectorial line " width="300" height="163" class="alignnone size-medium wp-image-154" /></p>
<pre>
#include &lt;GL/glut.h&gt;
#include &lt;math.h&gt;
#include &lt;time.h&gt;
#define W 512
#define H 512
int points[2][2];
int point_count=0;
void initialize(){
	glClearColor( 0.0, 0.0, 0.0, 0.0);//set background color to black
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluOrtho2D(0, W,0,H);
}

void setPixel(int x, int y){	//change color of a pixel
	glColor3f(1, 1, 1);
	y=H-y;
	glBegin(GL_POINTS);
	glVertex2f(x,y);
	glEnd();
}

void LineWithDDA(int x0, int y0, int x1, int y1) {//DDa line algorithm
    int dy = y1 - y0;
    int dx = x1 - x0;
    int steps,i;
    float xinc,yinc,x=x0,y=y0;
    if( fabs(dx) &gt; fabs(dy)){
        steps=fabs(dx);
    }else{
          steps=fabs(dy);
    }
    xinc=(float) dx/ (float) steps;
    yinc=(float) dy/ (float) steps;
    setPixel(round(x), round(y));
    for(i=0;i&lt;steps;i++){
         x+=xinc;
         y+=yinc;
         setPixel(round(x), round(y));
    }
    glutSwapBuffers();
}
void lineSegment(){
    glClear(GL_COLOR_BUFFER_BIT);
    glutSwapBuffers();
    LineWithDDA(W/2,0,W/2,H);
    LineWithDDA(0,H/2,W,H/2);
}
void Control(int button, int state, int x, int y){

  // Respond to mouse button presses.
  // If button1 pressed, mark this state so we know in motion function.

  if (button == GLUT_LEFT_BUTTON &amp;&amp; state == GLUT_DOWN)
    {
  			setPixel(x,y);
  			if(point_count&lt;1){
					points[0][0]=x;
					points[0][1]=y;
					point_count++;
			}else{
					points[1][0]=x;
	 			    points[1][1]=y;
			        use_dda(points[0][0],points[0][1],points[1][0],points[1][1]);
			        point_count=0;
			}
	      glutSwapBuffers();
    }
}
int main(int argc, char** argv) {
	glutInit(&amp;argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);
	glutInitWindowPosition(0,0);
	glutInitWindowSize(W,H);
	glutCreateWindow("OpenGL Mouse Function");
	initialize();
	glutMouseFunc(Control);
	glutDisplayFunc(lineSegment);
	glutMainLoop();
	return 0;
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/drawing-line-with-dda-algorithm-using-opengl-in-c/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xml to text with php</title>
		<link>http://www.neteyaz.com/xml-to-text-with-php</link>
		<comments>http://www.neteyaz.com/xml-to-text-with-php#comments</comments>
		<pubDate>Wed, 02 Dec 2009 18:57:38 +0000</pubDate>
		<dc:creator>banias</dc:creator>
				<category><![CDATA[Php]]></category>
		<category><![CDATA[reader]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=137</guid>
		<description><![CDATA[There is lots of xml reading methods and classes. Some of them is too compicated. if you want to read xml with real php and simpliest way, u can use this code

php simple xml reader script
Gets only one element which you want from xml data.


1 &#8211; $file = &#8220;xml.xml&#8221;; //original xml file
2 &#8211; $handle = [...]]]></description>
			<content:encoded><![CDATA[<p>There is lots of xml reading methods and classes. Some of them is too compicated. if you want to read xml with real php and simpliest way, u can use this code</p>
<p><span id="more-137"></span></p>
<h2>php simple xml reader script</h2>
<p>Gets only one element which you want from xml data.<br />
<code><br />
</code><br />
1 &#8211; $file = &#8220;xml.xml&#8221;; //original xml file<br />
2 &#8211; $handle = @fopen($file, &#8220;r&#8221;);<br />
3 &#8211; $write = @fopen(&#8221;results.txt&#8221;, &#8220;w&#8221;); //output file<br />
4 &#8211; $i = 0;<br />
5 &#8211; if ($handle) {<br />
6 &#8211; while (!feof($handle)) {<br />
7 &#8211; $buffer = fgets($handle, 4096);<br />
8 &#8211; $satir = $buffer;<br />
9 &#8211; $satir = str_replace(&#8221;<br />
10 &#8211;
<phrase>&#8220;,&#8221;",$satir); //your starting pattern<br />
11 &#8211; $satir = str_replace(&#8221;</phrase>&#8220;,&#8221;",$satir); // your ending pattern<br />
12 &#8211; if($satir != $buffer){<br />
13 &#8211; $i++;<br />
14 &#8211; $satir = str_replace(&#8221;\n&#8221;,&#8221;",$satir);<br />
15 &#8211; $satir = trim($satir);<br />
16 &#8211; $satir = $i.&#8221; &#8211; &#8220;.$satir;<br />
17 &#8211; $satir = $satir.&#8221;\n&#8221;;<br />
18 &#8211; fputs($write,$satir);<br />
19 &#8211; }<br />
20 &#8211; }<br />
21 &#8211; fclose($handle);<br />
22 &#8211; }<br />
23 &#8211; ?></pre>
<p>u can use this with compicated xml files too. this code will get only one type of element like phrases between<strong> &lt;phrase&gt; &lt;/phrase&gt;</strong> tags.<br />
example xml data.</p>
<pre>&lt;element&gt;
&lt;url&gt;neteyaz.com&lt;/url&gt;
&lt;phrase&gt;banias - php coder&lt;/url&gt;
&lt;title&gt;linux and coding blog&lt;/title&gt;
&lt;/element&gt;
&lt;element&gt;
&lt;url&gt;idealkilohesaplama.com&lt;/url&gt;
&lt;phrase&gt;calculate your ideal weight&lt;/url&gt;
&lt;title&gt;turkish web site&lt;/title&gt;
&lt;/element&gt;</pre>
<p>output will be like this:</p>
<pre>1 - banias - php coder
2 - calculate your ideal weight</pre>
<p>enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/xml-to-text-with-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Use Template Class or Function in C++ (Stack Implemantation)</title>
		<link>http://www.neteyaz.com/how-to-use-template-class-or-function-in-c-stack-implemantation</link>
		<comments>http://www.neteyaz.com/how-to-use-template-class-or-function-in-c-stack-implemantation#comments</comments>
		<pubDate>Mon, 30 Nov 2009 10:44:58 +0000</pubDate>
		<dc:creator>banias</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[C++ Template]]></category>
		<category><![CDATA[overloading vs template]]></category>
		<category><![CDATA[Stack Template]]></category>
		<category><![CDATA[using templates]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=128</guid>
		<description><![CDATA[How to Use Template Class or Function in C++ (Stack Implemantation)
1-How to use a function with different data types in c++. i mean, i have a function
that name is abs() and i want to use it just like this:
int x;foo(x);   or
float x;foo(x); or
char x;foo(x)&#8230;

The solution is simple for this problem:Overloadding isn&#8217;t it?
2-Alright, if [...]]]></description>
			<content:encoded><![CDATA[<h2>How to Use Template Class or Function in C++ (Stack Implemantation)</h2>
<p><strong>1-How to use a function with different data types in c++. i mean, i have a function<br />
that name is abs() and i want to use it just like this:</strong><br />
int x;foo(x);   or<br />
float x;foo(x); or<br />
char x;foo(x)&#8230;<br />
<span id="more-128"></span><br />
The solution is simple for this problem:Overloadding isn&#8217;t it?<br />
2-Alright, if i want to store my datas in a stack and when i chosee my data type(int,char,float), compiler could create a stack that can work data type which i have choosed. Is it possible? Of course:)</p>
<p>So firstly, i want to solve my first problem using templates:</p>
<pre>template &lt;class type_name&gt;
void foo(type_name x){
   cout&lt;&lt;x&lt;&lt;endl;
}</pre>
<p>You can call this function with different data types.For example:<br />
foo(3);foo(“a”);foo(3.14);</p>
<p>What is the difference between overloading and template class?When we overload a function compiler choose a correct version of the function in  runtime and we have to write the function for each data types that we have.</p>
<p>On the other hand,if we use templates compiler creates a placeholder for our arguments.And in runtime compiler changes it with our data type.So that we dont have to write the same codes for different data types.</p>
<p>I dont mean overloading is unnecessary.I just want to show the differences between overloading a function and creating a function using template class.</p>
<p>Next topic is “How to implement a stack data type with using template class?”.</p>
<pre>
#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
template &lt;class node_element&gt;
class Node{
      public:
             node_element data;
             Node * next;
};
template &lt;class stack_type&gt;
class Stack{
      public:
             Stack();
             void add(stack_type);
             stack_type pop();
             stack_type top();
             bool isempty();
		 void print();
             int get_count(){return count;}
      private:
             Node&lt;stack_type&gt; ptr;
             int count;
};
template &lt;class stack_type&gt;
Stack&lt;stack_type&gt;::Stack(){
     count=0;
     ptr.next=NULL;

}
template &lt;class stack_type&gt;
bool Stack&lt;stack_type&gt;::isempty(){
     return (get_count()==0)?1:0;
}
template &lt;class stack_type&gt;
void Stack&lt;stack_type&gt;::add(stack_type c){
     Node&lt;stack_type&gt;*newNode=new Node&lt;stack_type&gt;;
     newNode-&gt;data = c;
     if(isempty()){
          ptr.next= newNode;
          newNode-&gt;next = NULL;
     }else{
           newNode-&gt;next = ptr.next;
           ptr.next = newNode;
     }
     count++;
}
template &lt;class stack_type&gt;
stack_type Stack&lt;stack_type&gt;::pop(){
     if(get_count()==0){
         cout&lt;&lt;"Stack is empty!"&lt;&lt;endl;
     }else{
           Node&lt;stack_type&gt; * temp = ptr.next;
           ptr.next = temp-&gt;next;
           stack_type data= temp-&gt;data;
           delete temp;
           count--;
           return data;
     }
}

template &lt;class stack_type&gt;
stack_type Stack&lt;stack_type&gt;::top(){
     return ptr.next-&gt;data;
}
template &lt;class stack_type&gt;
void Stack&lt;stack_type&gt;::print(){
     Node&lt;stack_type&gt; * explorer=ptr.next;
     while(ptr.next!=0){
          cout&lt;&lt;ptr.next-&gt;data&lt;&lt;endl;
          ptr.next=ptr.next-&gt;next;

     }

     ptr.next=explorer;
}

int main(){
	Stack&lt;int&gt; intStack;
	intStack.add(3);
	intStack.add(4);
	intStack.add(5);
	intStack.pop();
	intStack.print();
	Stack&lt;char&gt; charStack;
	charStack.add('a');
	charStack.add('b');
	charStack.add('c');
	charStack.print();
	charStack.pop();
	charStack.print();
}
</pre>
<p><strong>Page about: How to Use Template Class or Function in C++ (Stack Implemantation), C++ Template,Stack Template,overloading vs template,using templates</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/how-to-use-template-class-or-function-in-c-stack-implemantation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Decoding Morse and Encoding Morse with Python</title>
		<link>http://www.neteyaz.com/how-to-decoding-morse-and-encoding-morse-with-python</link>
		<comments>http://www.neteyaz.com/how-to-decoding-morse-and-encoding-morse-with-python#comments</comments>
		<pubDate>Mon, 30 Nov 2009 10:35:38 +0000</pubDate>
		<dc:creator>banias</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Decode Morse]]></category>
		<category><![CDATA[Encode to Morse]]></category>
		<category><![CDATA[Morse Encoding]]></category>
		<category><![CDATA[raw_input]]></category>

		<guid isPermaLink="false">http://www.neteyaz.com/?p=125</guid>
		<description><![CDATA[Python Morse Converter
Maybe one day you can meet an asume alien girl however she don&#8217;t know any language except morse alphabet (she communicates only this way:-)). So, what will you do? Dont be sad cause i wrote a python code to decode what she says and encode yours.


1 - MORSE=[".-","-...","-.-.","-..",".","..-.",
2 -     [...]]]></description>
			<content:encoded><![CDATA[<h2>Python Morse Converter</h2>
<p>Maybe one day you can meet an asume alien girl however she don&#8217;t know any language except morse alphabet (she communicates only this way:-)). So, what will you do? Dont be sad cause i wrote a python code to decode what she says and encode yours.<br />
<span id="more-125"></span></p>
<pre class="prettyprint">
1 - MORSE=[".-","-...","-.-.","-..",".","..-.",
2 -       "--.","....","..",".---","-.-",
3 -       ".-..","--","-.","---",".--.",
4 -       "--.-",".-.","...","-","..-",
5 -       "...-",".--","-..-","-.--","--.."]
6 - SP=["a","b","c","d","e",
7 -    "f","g","h","i","j",
8 -    "k","l","m","n","o",
9 -    "p","q","r","s","t",
10 -    "u","v","w","x","y","z"]
11 - def encode(normal):
12 -     encoding=""
13 -     for i in range(len(normal)):
14 -         encoding+=MORSE[SP.index(normal[i])]
15 -         encoding+=" "
16 -     print encoding
17 - def decode(morse):
18 -     normal=""
19 -     morse=morse.split(" ")
20 -     for i in range(len(morse)):
21 -         normal+=SP[MORSE.index(morse[i])]
22 -     print normal
23 -
24 - choice=int(raw_input("Choose the operation\n1-Normal To Morse\n2-Morse To Normal\nChoice:"))
25 - if(choice==1):
26 -     expression=raw_input("Type your words without spaces:")
27 -     encode(expression)
28 - elif(choice==2):
29 -     expression=raw_input("Type your morse expresion:")
30 -     decode(expression)
31 - </pre>
<p>This Code is About: How to Decoding Morse and Encoding Morse with Python, Decode Morse,Encode to Morse,Morse Encoding,raw_input,Python</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neteyaz.com/how-to-decoding-morse-and-encoding-morse-with-python/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
