<?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>just for fun and not only</title>
	<atom:link href="https://hacktoallen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://hacktoallen.wordpress.com</link>
	<description>Just another WordPress.com site</description>
	<lastBuildDate>Fri, 21 Jan 2011 10:27:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='hacktoallen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/buttonw-com.png</url>
		<title>just for fun and not only</title>
		<link>https://hacktoallen.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://hacktoallen.wordpress.com/osd.xml" title="just for fun and not only" />
	<atom:link rel='hub' href='https://hacktoallen.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Erlang and posix error</title>
		<link>https://hacktoallen.wordpress.com/2011/01/21/erlang-and-posix-error/</link>
					<comments>https://hacktoallen.wordpress.com/2011/01/21/erlang-and-posix-error/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Fri, 21 Jan 2011 10:27:57 +0000</pubDate>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[posix]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=99</guid>

					<description><![CDATA[Second day testing of pop3 server written in erlang: {{case_clause,{error,enotconn}}… Today i find all posix errors in http://erldocs.com/R14B/kernel/inet.html?i=11&#38;search=inet I think it&#8217;ll be usefull.]]></description>
										<content:encoded><![CDATA[<p>Second day testing of pop3 server written in erlang:</p>
<p><strong>{{case_clause,{error,enotconn}}…</strong></p>
<p><strong><span style="font-weight:normal;">Today i find all posix errors in <a title="posix error" href="http://erldocs.com/R14B/kernel/inet.html?i=11&amp;search=inet">http://erldocs.com/R14B/kernel/inet.html?i=11&amp;search=inet</a></span></strong></p>
<p>I think it&#8217;ll be usefull.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2011/01/21/erlang-and-posix-error/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang] Using privileged ports</title>
		<link>https://hacktoallen.wordpress.com/2011/01/16/erlang-using-privileged-ports/</link>
					<comments>https://hacktoallen.wordpress.com/2011/01/16/erlang-using-privileged-ports/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Sun, 16 Jan 2011 06:59:00 +0000</pubDate>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[setcap]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=97</guid>

					<description><![CDATA[On UNIX systems, ports starting with 0 and 1023 are privileged. To work successfully with these ports of Erlang in a terminal just type: setcap &#8216;cap_net_bind_service = + ep&#8217; / usr/lib/erlang/erts-5.6.5/bin/beam setcap &#8216;cap_net_bind_service = + ep&#8217; / usr/lib/erlang/erts-5.6.5/bin/beam.smp Naturally with your version of erts.]]></description>
										<content:encoded><![CDATA[<p>On UNIX systems, ports starting with 0 and 1023 are privileged. To work successfully with these ports of Erlang in a terminal just type:</p>
<p>setcap &#8216;cap_net_bind_service = + ep&#8217; / usr/lib/erlang/erts-5.6.5/bin/beam<br />
setcap &#8216;cap_net_bind_service = + ep&#8217; / usr/lib/erlang/erts-5.6.5/bin/beam.smp</p>
<p>Naturally with your version of erts.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2011/01/16/erlang-using-privileged-ports/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>[bash] Script for application runing</title>
		<link>https://hacktoallen.wordpress.com/2011/01/13/bash-script-for-application-runing/</link>
					<comments>https://hacktoallen.wordpress.com/2011/01/13/bash-script-for-application-runing/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Thu, 13 Jan 2011 12:36:40 +0000</pubDate>
				<category><![CDATA[bash]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=95</guid>

					<description><![CDATA[Hello, I found bash script for runing something application from terminal and uncoupling this application from terminal: More interesting scripts in bash-snippets &#160;]]></description>
										<content:encoded><![CDATA[<p>Hello,</p>
<p>I found bash script for runing something application from terminal and uncoupling this application from terminal:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
if [ -z &quot;$TEMP&quot; ]; then
   TEMP='/tmp';
fi;
$@ &gt; &quot;$TEMP/$$.stdout.log&quot; 2&gt; &quot;$TEMP/$$.stderr.log&quot; &amp;
echo &quot;fork: \&quot;$@\&quot; : $$&quot;
</pre>
<div id="LC9">More interesting scripts in <a href="https://github.com/onlyshk/bash-snippets">bash-snippets</a></div>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2011/01/13/bash-script-for-application-runing/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>[bash] Script for chekcing mail in gmail.com</title>
		<link>https://hacktoallen.wordpress.com/2010/11/18/bash/</link>
					<comments>https://hacktoallen.wordpress.com/2010/11/18/bash/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Thu, 18 Nov 2010 14:03:49 +0000</pubDate>
				<category><![CDATA[bash]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=88</guid>

					<description><![CDATA[I want to share a simple script written in bash, which checks the mail at gmail.com I hope it is useful to you. p.s. The remaining useful scripts can be found at &#8211; https: / / github.com / onlyshk / bash-snippets]]></description>
										<content:encoded><![CDATA[<p>I want to share a simple script written in bash, which checks the mail at gmail.com</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

read -p &quot;Input your name in gmail: &quot; username;
read -p &quot;Input your password in gmail: &quot; password;

echo -e &quot;Checking for new messages... \c&quot;

atomlines=`wget -T 3 -t 1 -q --secure-protocol=TLSv1 \
 --no-check-certificate \
 --user=$username --password= $password \
 https://mail.google.com/mail/feed/atom -O - \
 | wc -l`

echo -e &quot;\r\c&quot;

[ $atomlines -gt &quot;8&quot; ] \
 &amp;&amp; echo -e &quot; You have new gmail.&quot; \
 || echo -e &quot; No new gmail.&quot;
</pre>
<p>I hope it is useful to you. p.s. The remaining useful scripts can be found at &#8211; https: / / github.com / onlyshk / bash-snippets</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/11/18/bash/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>A set of useful bash scripts</title>
		<link>https://hacktoallen.wordpress.com/2010/11/06/a-set-of-useful-bash-scripts/</link>
					<comments>https://hacktoallen.wordpress.com/2010/11/06/a-set-of-useful-bash-scripts/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Sat, 06 Nov 2010 14:30:18 +0000</pubDate>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[github]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=86</guid>

					<description><![CDATA[As is well known *nix users have a huge advantage over Windows users due to lack of the latter such a powerful tool like bash. I myself often use bash scripts. So I decided to share with the community of my bash scripts. On github, created a repository bash-snippets where and I will add a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>As is well known *nix users have a huge advantage over Windows users due to lack of the latter such a powerful tool like bash. I myself often use bash scripts. So I decided to share with the community of my bash scripts.</p>
<p>On github, created a repository bash-snippets where and I will add a script written in bash, which I hope were helpful would be useful to you.</p>
<p>Git &#8211; <a href="https://github.com/onlyshk/bash-snippets">https://github.com/onlyshk/bash-snippets</a><br />
License &#8211; GNU/GPL v3</p>
<p>Participation in the project are welcome. Who has accumulated useful scripts and I think everyone inveterate * nix user any fork this project in github and add your own scripts. Then are connected into a single repository. However, we collect useful communities in the collection of scripts.</p>
<p>I hope it&#8217;ll be helpful.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/11/06/a-set-of-useful-bash-scripts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>Presentation of Lev Valkin &#8211; Something about Erlang</title>
		<link>https://hacktoallen.wordpress.com/2010/11/02/presentation-of-lev-valkin-something-about-erlang/</link>
					<comments>https://hacktoallen.wordpress.com/2010/11/02/presentation-of-lev-valkin-something-about-erlang/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Tue, 02 Nov 2010 14:32:18 +0000</pubDate>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[presentations]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=83</guid>

					<description><![CDATA[Today has found in internet very interesting prizentatsiyu of Erlang:]]></description>
										<content:encoded><![CDATA[<p>Today has found in internet very interesting prizentatsiyu of Erlang:</p>
<iframe src='https://www.slideshare.net/slideshow/embed_code/4625844' width='497' height='407' allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/11/02/presentation-of-lev-valkin-something-about-erlang/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple makefile for gtk+ application compiling</title>
		<link>https://hacktoallen.wordpress.com/2010/10/28/simple-makefile-for-gtk-application-compiling/</link>
					<comments>https://hacktoallen.wordpress.com/2010/10/28/simple-makefile-for-gtk-application-compiling/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Thu, 28 Oct 2010 14:26:23 +0000</pubDate>
				<category><![CDATA[Без рубрики]]></category>
		<category><![CDATA[makefile]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=77</guid>

					<description><![CDATA[Autotools generate giant makefiles for projects. Here i put simple makefile for gtk+ application compiling:]]></description>
										<content:encoded><![CDATA[<p>Autotools generate giant makefiles for projects. Here i put simple makefile for gtk+ application compiling:</p>
<pre class="brush: bash; title: ; notranslate">CC=gcc
LDLIBS='gtk-config --libs'
CFLAGS=-Wall -g 'gtk-config --cflags'
gtktest: gtktest.o
    $(CC) $(LDLIBS) gtktest.o -o gtktest
gtktest.o: gtktest.c
    $(CC) $(CFLAGS) -c gtktest.c
clean:
rm -f gtktest
rm -f *.o</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/10/28/simple-makefile-for-gtk-application-compiling/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>Mini review Lubuntu 10.10</title>
		<link>https://hacktoallen.wordpress.com/2010/10/23/mini-review-lubuntu-10-10/</link>
					<comments>https://hacktoallen.wordpress.com/2010/10/23/mini-review-lubuntu-10-10/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Sat, 23 Oct 2010 14:17:38 +0000</pubDate>
				<category><![CDATA[Lubuntu]]></category>
		<category><![CDATA[lxde]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=71</guid>

					<description><![CDATA[Today is installed on a laptop &#8211; Lubuntu 10.10 &#8211; official website &#8211; lubuntu.net. Lubuntu represents a very light-weight distribution is based on Ubuntu, but as a desktop environment &#8211; LXDE. About the performance of the system developers have not cheated, the system is really very quick and easy. Tests on hand I have not, [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today is installed on a laptop &#8211; Lubuntu 10.10 &#8211; official website &#8211; <a href="lubuntu.net">lubuntu.net</a>. Lubuntu represents a very light-weight distribution is based on Ubuntu, but as a desktop environment &#8211; LXDE.</p>
<p><span id="more-71"></span></p>
<p>About the performance of the system developers have not cheated, the system is really very quick and easy. Tests on hand I have not, quote from the wiki says:</p>
<blockquote><p>Initial testing by Linux Magazine reviewer Christopher Smart has shown that Lubuntu&#8217;s RAM usage is about half of Xubuntu&#8217;s and Ubuntu&#8217;s on a normal installation and desktop use, and one third less on live CD use</p></blockquote>
<p>Lubuntu includes a suite of project LXDE, as well as several programs are not part of LXDE:</p>
<ul>
<li>Abiword</li>
<li>Gnumeric</li>
<li>pidgin</li>
<li>xchat</li>
<li>Chromium</li>
<li>Cheese</li>
<li>Gnome MPlayer</li>
<li>Transmission</li>
</ul>
<p>Lxde screenshot:</p>
<p><a href="http://hacktoall.files.wordpress.com/2010/10/2010-10-23-195108_1680x1050_scrot.png?w=300&amp;h=187"><img class="aligncenter" title="Lubuntu 10.10" src="https://hacktoall.files.wordpress.com/2010/10/2010-10-23-195108_1680x1050_scrot.png?w=300&#038;h=187" alt="Lubuntu 10.10" width="300" height="187" /></a></p>
<p>If you need a fast and lightweight system with the necessary software in the set, I advise you to pay attention to Lubuntu.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/10/23/mini-review-lubuntu-10-10/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>

		<media:content url="http://hacktoall.files.wordpress.com/2010/10/2010-10-23-195108_1680x1050_scrot.png?w=300&#038;h=187" medium="image">
			<media:title type="html">Lubuntu 10.10</media:title>
		</media:content>
	</item>
		<item>
		<title>[pure C] Convert int -&#062; char* without anything libraries</title>
		<link>https://hacktoallen.wordpress.com/2010/10/21/pure-c-convert-int-char-without-anything-libraries/</link>
					<comments>https://hacktoallen.wordpress.com/2010/10/21/pure-c-convert-int-char-without-anything-libraries/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Thu, 21 Oct 2010 15:29:55 +0000</pubDate>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[С]]></category>
		<category><![CDATA[C]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=64</guid>

					<description><![CDATA[Today, at stackoverflow.com was an interesting question: I recently read a sample job interview question: Write a function to convert an integer to a string. Assume you do not have access to library functions i.e., itoa(), etc… How would you go about this? How do we all still convert int to char * without the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Today, at stackoverflow.com was an interesting question:</p>
<blockquote><p>I recently read a sample job interview question:</p>
<p>Write a function to convert an integer to a string. Assume you do not have access to library functions i.e., itoa(), etc…</p>
<p>How would you go about this?</p></blockquote>
<p>How do we all still convert int to char * without the use third-party libraries or including the stdlib?</p>
<p>Here I show you my version, as well as options that are offered to distinguished site visitors stackoverflow.com</p>
<p>To start my variant. Before his show a few words about the code: Yes it is longish and generally sotstoit of 3 options:<br />
&#8211; Get string length<br />
&#8211; Reverse the line<br />
&#8211; Convert from int -&gt; char *</p>
<p>Indeed davolno long and is not a trivial move, but I think it will be useful for beginners in C. The code is as follows:</p>
<div class="highlight" style="text-align:left;">
<pre><span style="color:#008000;font-weight:bold;">static</span> <span style="color:#b00040;">char</span><span style="color:#666666;">*</span>
itoa(<span style="color:#b00040;">int</span> n, <span style="color:#b00040;">char</span> s[])
{
    <span style="color:#b00040;">int</span> i, sign;
    <span style="color:#008000;font-weight:bold;">if</span> ((sign <span style="color:#666666;">=</span> n) <span style="color:#666666;">&lt;</span> <span style="color:#666666;">0</span>)
        n <span style="color:#666666;">=</span> <span style="color:#666666;">-</span>n;
    i <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>;
<span style="color:#008000;font-weight:bold;">    </span><span style="color:#008000;font-weight:bold;">do</span>
    {
      s[i<span style="color:#666666;">++</span>] <span style="color:#666666;">=</span> n <span style="color:#666666;">%</span> <span style="color:#666666;">10</span> <span style="color:#666666;">+</span> <span style="color:#ba2121;">'0'</span>;
    } <span style="color:#008000;font-weight:bold;">while</span> ((n <span style="color:#666666;">/=</span> <span style="color:#666666;">10</span>) <span style="color:#666666;">&gt;</span> <span style="color:#666666;">0</span>);   

    <span style="color:#008000;font-weight:bold;">if</span> (sign <span style="color:#666666;">&lt;</span> <span style="color:#666666;">0</span>)
        s[i<span style="color:#666666;">++</span>] <span style="color:#666666;">=</span> <span style="color:#ba2121;">'-'</span>;

    s[i] <span style="color:#666666;">=</span> '\0';
    reverse(s);

    <span style="color:#008000;font-weight:bold;">return</span> s;
}</pre>
<p>Further, as I said two fuktsnii: reverse string and get the string length:</p>
</div>
<div class="highlight">
<pre><span style="color:#b00040;">int</span> strlen(<span style="color:#008000;font-weight:bold;">const</span> <span style="color:#b00040;">char</span><span style="color:#666666;">*</span> str)
{
   <span style="color:#b00040;">int</span> i <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>;
   <span style="color:#008000;font-weight:bold;">while</span> (str <span style="color:#666666;">!=</span> <span style="color:#ba2121;">''</span>)
   {
       i<span style="color:#666666;">++</span>;
       str<span style="color:#666666;">++</span>;
   }

   <span style="color:#008000;font-weight:bold;">return</span> i;
}

<span style="color:#008000;font-weight:bold;">static</span> <span style="color:#b00040;">void</span>
reverse(<span style="color:#b00040;">char</span> s[])
{
    <span style="color:#b00040;">int</span> i, j;
    <span style="color:#b00040;">char</span> c;

    <span style="color:#008000;font-weight:bold;">for</span> (i <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>, j <span style="color:#666666;">=</span> strlen(s)<span style="color:#666666;">-1</span>; i<span style="color:#666666;">&lt;</span>j; i<span style="color:#666666;">++</span>, j<span style="color:#666666;">--</span>) {
        c <span style="color:#666666;">=</span> s[i];
        s[i] <span style="color:#666666;">=</span> s[j];
        s[j] <span style="color:#666666;">=</span> c;
    }
}</pre>
<p>This is my solution of this problem. Granted not the most beautiful, but has the right to life.</p>
<p>Visitors stackoverflow.com solved this same problem in the following ways:</p>
</div>
<div class="highlight">
<pre><span style="color:#b00040;">char</span><span style="color:#666666;">*</span> itoa(<span style="color:#b00040;">int</span> val, <span style="color:#b00040;">int</span> base){

    <span style="color:#008000;font-weight:bold;">static</span> <span style="color:#b00040;">char</span> buf[<span style="color:#666666;">32</span>] <span style="color:#666666;">=</span> {<span style="color:#666666;">0</span>};

    <span style="color:#b00040;">int</span> i <span style="color:#666666;">=</span> <span style="color:#666666;">30</span>;

    <span style="color:#008000;font-weight:bold;">for</span>(; val <span style="color:#666666;">&amp;&amp;</span> i ; <span style="color:#666666;">--</span>i, val <span style="color:#666666;">/=</span> base)

        buf[i] <span style="color:#666666;">=</span> <span style="color:#ba2121;">"0123456789abcdef"</span>[val <span style="color:#666666;">%</span> base];

    <span style="color:#008000;font-weight:bold;">return</span> <span style="color:#666666;">&amp;</span>buf[i<span style="color:#666666;">+1</span>];

}</pre>
</div>
<p style="font-size:.8em;color:#666;margin:2em 0 1em;padding:0;"><span style="background-color:#f5f5f5;padding:0 1em;"> Colored with <a style="color:#333;" href="http://dumpz.org">dumpz.org</a></span></p>
<p>Next variant:</p>
<div class="highlight">
<pre><span style="color:#b00040;">int</span> num <span style="color:#666666;">=</span> ...;
   <span style="color:#b00040;">char</span> res[MaxDigitCount];
   <span style="color:#b00040;">int</span> len <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>;
   <span style="color:#008000;font-weight:bold;">for</span>(; num <span style="color:#666666;">&gt;</span> <span style="color:#666666;">0</span>; <span style="color:#666666;">++</span>len)
   {
      res[len] <span style="color:#666666;">=</span> num<span style="color:#666666;">%10+</span><span style="color:#ba2121;">'0'</span>;
      num<span style="color:#666666;">/=10</span>;
   }
   res[len] <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>; <span style="color:#408080;font-style:italic;">//null-terminating</span>

   <span style="color:#408080;font-style:italic;">//now we need to reverse res</span>
   <span style="color:#008000;font-weight:bold;">for</span>(<span style="color:#b00040;">int</span> i <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>; i <span style="color:#666666;">&lt;</span> len<span style="color:#666666;">/2</span>; <span style="color:#666666;">++</span>i)
   {
       <span style="color:#b00040;">char</span> c <span style="color:#666666;">=</span> res[i]; res[i] <span style="color:#666666;">=</span> res[len<span style="color:#666666;">-</span>i<span style="color:#666666;">-1</span>]; res[len<span style="color:#666666;">-</span>i<span style="color:#666666;">-1</span>] <span style="color:#666666;">=</span> c;
   }</pre>
</div>
<p style="font-size:.8em;color:#666;margin:2em 0 1em;padding:0;"><span style="background-color:#f5f5f5;padding:0 1em;"> Colored with <a style="color:#333;" href="http://dumpz.org">dumpz.org</a></span></p>
<p>And last variant:</p>
<div class="highlight">
<pre><span style="color:#b00040;">int</span> n <span style="color:#666666;">=</span> INT_MIN;
<span style="color:#b00040;">char</span> buffer[<span style="color:#666666;">50</span>];
<span style="color:#b00040;">int</span> i <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>;

<span style="color:#b00040;">bool</span> isNeg <span style="color:#666666;">=</span> n<span style="color:#666666;">&lt;0</span>;

<span style="color:#b00040;">unsigned</span> <span style="color:#b00040;">int</span> n1 <span style="color:#666666;">=</span> isNeg <span style="color:#666666;">?</span> <span style="color:#666666;">-</span>n <span style="color:#666666;">:</span> n;

<span style="color:#008000;font-weight:bold;">while</span>(n1<span style="color:#666666;">!=0</span>)
{
    buffer[i<span style="color:#666666;">++</span>] <span style="color:#666666;">=</span> n1<span style="color:#666666;">%10+</span><span style="color:#ba2121;">'0'</span>;
    n1<span style="color:#666666;">=</span>n1<span style="color:#666666;">/10</span>;
}

<span style="color:#008000;font-weight:bold;">if</span>(isNeg)
    buffer[i<span style="color:#666666;">++</span>] <span style="color:#666666;">=</span> <span style="color:#ba2121;">'-'</span>;

buffer[i] <span style="color:#666666;">=</span> <span style="color:#ba2121;">''</span>;

<span style="color:#008000;font-weight:bold;">for</span>(<span style="color:#b00040;">int</span> t <span style="color:#666666;">=</span> <span style="color:#666666;">0</span>; t <span style="color:#666666;">&lt;</span> i<span style="color:#666666;">/2</span>; t<span style="color:#666666;">++</span>)
{
    buffer[t] <span style="color:#666666;">^=</span> buffer[i<span style="color:#666666;">-</span>t<span style="color:#666666;">-1</span>];
    buffer[i<span style="color:#666666;">-</span>t<span style="color:#666666;">-1</span>] <span style="color:#666666;">^=</span> buffer[t];
    buffer[t] <span style="color:#666666;">^=</span> buffer[i<span style="color:#666666;">-</span>t<span style="color:#666666;">-1</span>];
}

printf(buffer);</pre>
</div>
<p style="font-size:.8em;color:#666;margin:2em 0 1em;padding:0;"><span style="background-color:#f5f5f5;padding:0 1em;"> Colored with <a style="color:#333;" href="http://dumpz.org">dumpz.org</a></span></p>
<p>And how would you solved this problem?</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/10/21/pure-c-convert-int-char-without-anything-libraries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
		<item>
		<title>Erlang programming in GNU/Emacs</title>
		<link>https://hacktoallen.wordpress.com/2010/09/05/erlang-programming-in-gnuemacs/</link>
					<comments>https://hacktoallen.wordpress.com/2010/09/05/erlang-programming-in-gnuemacs/#respond</comments>
		
		<dc:creator><![CDATA[shk]]></dc:creator>
		<pubDate>Sun, 05 Sep 2010 14:06:18 +0000</pubDate>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[erlang]]></category>
		<guid isPermaLink="false">http://hacktoallen.wordpress.com/?p=60</guid>

					<description><![CDATA[If you want to coding in Erlang programming language in GNU/Emacs, you must add next strings in you .emacs file: (setq load-path (cons  &#8220;/usr/lib/erlang/lib/tools-2.6.5.1/emacs&#8221; load-path)) (setq load-path (cons &#8220;/usr/local/Cellar/erlang/R13B04/lib/erlang/lib/tools-2.6.5.1/emacs/erlang-skels.el&#8221; load-path)) (require &#8216;erlang-start) (add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.erl?$&#8221; . erlang-mode)) (add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.hrl?$&#8221; . erlang-mode)) (setq erlang-root-dir &#8220;/usr/lib/erlang&#8221;) (add-to-list &#8216;exec-path &#8220;/usr/lib/erlang/bin&#8221;) (setq erlang-man-root-dir &#8220;/usr/lib/erlang/man&#8221;) After that you can [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you want to coding in Erlang programming language in GNU/Emacs, you must add next strings in you .emacs file:</p>
<div id="_mcePaste"><strong><span style="color:#008000;">(setq load-path (cons  &#8220;/usr/lib/erlang/lib/tools-2.6.5.1/emacs&#8221;</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">load-path))</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(setq load-path (cons &#8220;/usr/local/Cellar/erlang/R13B04/lib/erlang/lib/tools-2.6.5.1/emacs/erlang-skels.el&#8221;</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">load-path))</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(require &#8216;erlang-start)</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.erl?$&#8221; . erlang-mode))</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(add-to-list &#8216;auto-mode-alist &#8216;(&#8220;\\.hrl?$&#8221; . erlang-mode))</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(setq erlang-root-dir &#8220;/usr/lib/erlang&#8221;)</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(add-to-list &#8216;exec-path &#8220;/usr/lib/erlang/bin&#8221;)</span></strong></div>
<div id="_mcePaste"><strong><span style="color:#008000;">(setq erlang-man-root-dir &#8220;/usr/lib/erlang/man&#8221;)</span></strong></div>
<p>After that you can save your .emacs file and then open emacs and now you can start to coding in Erlang.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://hacktoallen.wordpress.com/2010/09/05/erlang-programming-in-gnuemacs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		
		<media:content url="https://0.gravatar.com/avatar/fcdcaf99b5c0a6fff852f3f670f57b9c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">onlyshk</media:title>
		</media:content>
	</item>
	</channel>
</rss>
