<?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>Coding &#8211; Alexander Shyrokov&#039;s blog</title>
	<atom:link href="http://sjcomp.com/blog/?feed=rss2&#038;cat=43" rel="self" type="application/rss+xml" />
	<link>http://sjcomp.com/blog</link>
	<description>This&#039;s only my opinion, so keep it that way</description>
	<lastBuildDate>Mon, 21 Oct 2019 13:42:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.16</generator>
	<item>
		<title>Picking a GoogleVoice phone number</title>
		<link>http://sjcomp.com/blog/?p=611</link>
		<pubDate>Mon, 13 Dec 2010 19:48:08 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Shyrokov]]></dc:creator>
				<category><![CDATA[Automation]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://sjcomp.com/blog/?p=611</guid>
		<description><![CDATA[I decided to use Google Voice service. The first problem I had was to select the phone number I wanted to use. This screen shot shows how one can pick a phone. There is a rudimentary search, but if one wants to have a phone that spells a word or a phrase, then this search [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><img src="http://sjcomp.com/blog/wp-content/uploads/2010/10/GoogleVoicePick-150x150.jpg" alt="screenshot" title="Picking a phone number on google voice." width="150" height="150" class="alignright size-thumbnail wp-image-614" />I decided to use Google Voice service. The first problem I had was to select the phone number I wanted to use. This screen shot shows how one can pick a phone.</p>
<p>There is a rudimentary search, but if one wants to have a phone that spells a word or a phrase, then this search dialog is not really helpful. You are also given only five phone numbers at a time and you can not filter these numbers. For example, I would like to ask for phone numbers that does not contain 0 or 1 (which do not have letters associated with them).</p>
<p>The brute force approach was to look at the current five phones, select ones that do not have 0s or 1s and paste them into a website that tries to match a phone number with words (I used <a href="http://www.dialabc.com/words/search/index.html">dialabc.com</a>). After repeating the process a few times I realized that it was way to slow&#8230;</p>
<p><img src="http://sjcomp.com/blog/wp-content/uploads/2010/10/GoogleVoiceSikuli1-245x300.jpg" alt="screenshot" title="Sikuli script to get the phones from Google Voice." width="245" height="300" class="alignright size-medium wp-image-627" srcset="http://sjcomp.com/blog/wp-content/uploads/2010/10/GoogleVoiceSikuli1-245x300.jpg 245w, http://sjcomp.com/blog/wp-content/uploads/2010/10/GoogleVoiceSikuli1.jpg 356w" sizes="(max-width: 245px) 100vw, 245px" />Some time ago I cam across <a href="http://sikuli.org/">Sikuli</a> and it seems that this was a job for this software. I quickly wrote a script (using their IDE) that found all radio buttons, selected phones next to them, copied them into Notepad, clicked &#8220;Next 5 &gt;&#8221; button and repeated the procedure. Strangely enough, I did not see a direct way to copy/paste text in Sikuli, and that&#8217;s why I had to use keyboard shortcuts.</p>
<p>Once I got the phone numbers in the text file I wrote a trivial perl script to filter out ones that I wanted and create links to <a href="http://www.dialabc.com/words/search/index.html">dialabc.com</a> that would show what the numbers can spell. The list of links was opened in Firefox using <a href="https://addons.mozilla.org/en-US/firefox/addon/7192/?src=api">Url lister plugin</a>.</p>
<p>At this point all I had to do was to look at a web page with proposed words and if I did not like them I simply closed the tab, which presented me with the next opened tab. This way I was able to review many numbers quickly and pick the one that I liked.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Code commenting style</title>
		<link>http://sjcomp.com/blog/?p=523</link>
		<pubDate>Sun, 04 Apr 2010 20:28:42 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Shyrokov]]></dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://sjcomp.com/blog/?p=523</guid>
		<description><![CDATA[After programming for more than ten years I gradually refined my commenting style to a level that I am satisfied with, at least for now. Long story short, this is an example for C++: // This is a comment. Simple and precise. Let me explain why. The general format follows this pattern: 1. Comment character(s), [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>After programming for more than ten years I gradually refined my commenting style to a level that I am satisfied with, at least for now. Long story short, this is an example for C++:</p>
<pre lang="c">
// This is a comment.
</pre>
<p>Simple and precise. Let me explain why. The general format follows this pattern:</p>
<blockquote><p>
1. Comment character(s), such as /*, //, #, %.<br />
2. Space.<br />
3. Comment string, that starts with a capital letter (with rare exceptions).<br />
4. Period.<br />
5. Comment closing character, such as */, &#8211;>
</p></blockquote>
<p>1, 3, and possibly 5 must be present in any comment. Let&#8217;s focus on the parts that can be present or omitted. I include Space before the comment string to differentiate between a comment line and a commented out code:</p>
<pre lang="c">
// Use it as follows:
// exec(true);
//exec(yFlag);
</pre>
<p>In the example above, the first two lines are comments, because there is a single space before the comment string. The last line is a commented out line of code.</p>
<p>I use capital letter to start a comment and a period after a comment sentence for multiple reasons. First, it forces to make comments from well formed sentences, which can be easier to understand as compared to incomplete sentences. Second, it tells me where a comment sentence starts and ends. For example, if I see a comment line that does not end with a period, then I can assume the next comment line must continue the same sentence. For example:</p>
<pre lang="c">
// This is one
// comment sentence.
</pre>
<p>To recap. A space before helps separate at a glance comments from commented out code. Following a formal sentence structure (start with a capital letter and finish with a dot) helps to understand the comments better and provides information about where the comments start and end.</p>
]]></content:encoded>
			</item>
		<item>
		<title>C++ logger class</title>
		<link>http://sjcomp.com/blog/?p=430</link>
		<pubDate>Tue, 09 Feb 2010 02:52:19 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Shyrokov]]></dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://sjcomp.com/blog/?p=430</guid>
		<description><![CDATA[I was looking for a logger implementation for one of my projects. I needed a few features: simultaneous output to a console and a log file, efficiency, and ease of use. Quick google search revealed a few candidates: Apache log4cxx, and Pantheios. Do it yourself articles (example) about home made logging I ignored, because I [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I was looking for a logger implementation for one of my projects. I needed a few features: simultaneous output to a console and a log file, efficiency, and ease of use. Quick google search revealed a few candidates: <a href="http://logging.apache.org/log4cxx/index.html">Apache log4cxx</a>, and <a href="http://www.pantheios.org/">Pantheios</a>. Do it yourself articles (<a href="http://www.drdobbs.com/cpp/201804215">example</a>) about home made logging I ignored, because I have done enough of those (<a href="http://torjo.com/log2/">Boost Logging Library v2</a> is in the same category for me). Given that my primary platform is Windows, log4cxx was dropped, as windows was not <a href="http://www.dreamcubes.com/b2/software-development/28/log4cxx-for-win32-with-vs2005/" class="broken_link">directly supported</a>.</p>
<p>Compiling a few examples for pantheios was not difficult, but getting it to do exactly what I planned, which is to have output to a console and a file at the same time, was a little more challenging. The solution was not obvious from the documentation, and sample name mx.1 did not stand out to me as meaning Mixing different back ends. But after searching in <a href="https://sourceforge.net/projects/pantheios/forums">pantheios forums</a> I have found the <a href="https://sourceforge.net/projects/pantheios/forums/forum/475314/topic/2186546">answer to my question</a>.</p>
<p>At the end of the day <a href="http://www.pantheios.org/">Pantheios</a> was my choice. We will see how happy I will be with it after I play with it for a while.</p>
]]></content:encoded>
			</item>
		<item>
		<title>Find duplicate files using OpenOffice.Calc</title>
		<link>http://sjcomp.com/blog/?p=334</link>
		<pubDate>Wed, 14 Oct 2009 02:35:18 +0000</pubDate>
		<dc:creator><![CDATA[Alexander Shyrokov]]></dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[duplicates]]></category>
		<category><![CDATA[file managment]]></category>

		<guid isPermaLink="false">http://sjcomp.com/blog/?p=334</guid>
		<description><![CDATA[I had a problem of having a set of directories with some files duplicated in some of the directories. The search for a software to remove duplicate files did not reveal any free utilities to accomplish this task. So I decided to use OpenOffice.Calc to do the job. First I got the list of all [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I had a problem of having a set of directories with some files duplicated in some of the directories. The search for a software to remove duplicate files did not reveal any free utilities to accomplish this task. So I decided to use <a href="http://www.openoffice.org/product/calc.html">OpenOffice.Calc</a> to do the job. </p>
<ul>
<li>First I got the list of all the files:
<pre code>
dir /b/s >list.csv
</pre>
</li>
<li>Then, I opened list.csv in <a href="http://www.openoffice.org/product/calc.html">OpenOffice.Calc</a> and used this formula to extract only the file name:
<pre code>
=RIGHT(A1;LEN(A1)-SEARCH("\\[^\\]*$";A1;1))
</pre>
</li>
<li>After that, I sorted the sheet by the file names and added a formula that detected duplicate file names:
<pre code>
=IF(B2=B1;"DUP";"")
</pre>
</li>
<li>Search for the string DUP (in values) quickly showed me where the duplicates are.</li>
</ul>
<p>I know it was not as easy as running a specific program, but it was easier for me to do that than to find a free software.</p>
]]></content:encoded>
			</item>
	</channel>
</rss>
