<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7979090406441748249</id><updated>2012-01-22T00:11:34.998+11:00</updated><category term='xcodebuild'/><category term='make'/><category term='pygments'/><category term='markdown'/><category term='python'/><category term='bimap'/><category term='boost'/><category term='regular expressions'/><category term='vim'/><category term='trim'/><category term='parser'/><category term='csv'/><category term='fizzbuzz'/><category term='syntax'/><category term='bash'/><category term='c++'/><category term='tokenizer'/><title type='text'>My Byte of Code</title><subtitle type='html'>Tips and observations on creating software with Objective-C, C/C++, Python, Cocoa and Boost on Mac.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-5528620442221482883</id><published>2011-01-02T16:48:00.002+11:00</published><updated>2011-01-04T22:04:06.768+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='xcodebuild'/><category scheme='http://www.blogger.com/atom/ns#' term='make'/><title type='text'>Build Xcode project from within Vim</title><summary type='text'>To be able to compile Xcode project from Vim with :mak I set makeprg option to use xcodebuild instead of Makefile.I set makeprg for objective-c files in local ftplugin for objective-c ~/.vim/ftplugin/objc.vim:
set makeprg=xcodebuild\ -activetarget\ -activeconfiguration


Now when I compile from Vim with :mak, the current active build and configuration gets compiled and you can iterate in Vim over</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/5528620442221482883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2011/01/build-xcode-project-from-within-vim.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/5528620442221482883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/5528620442221482883'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2011/01/build-xcode-project-from-within-vim.html' title='Build Xcode project from within Vim'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-4821736602659026362</id><published>2010-11-20T04:43:00.010+11:00</published><updated>2010-11-21T16:36:16.174+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='csv'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='parser'/><category scheme='http://www.blogger.com/atom/ns#' term='boost'/><category scheme='http://www.blogger.com/atom/ns#' term='tokenizer'/><title type='text'>Parse CSV File with Embedded New Lines Using Boost Tokenizer and C++</title><summary type='text'>In my previous post, Parse CSV File With Boost Tokenizer in C++, I have shown how to use Boost Tokenizer to parse CSV files.
The algorithm expected that the file contains one record per line.
However, CSV syntax allows for quoted fields to contain embedded line breaks (quoting wikipedia - should be enough to demonstrate this example).
The example code from my previous post could not handle those </summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/4821736602659026362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/11/parse-csv-file-with-embedded-new-lines.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4821736602659026362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4821736602659026362'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/11/parse-csv-file-with-embedded-new-lines.html' title='Parse CSV File with Embedded New Lines Using Boost Tokenizer and &lt;code&gt;C++&lt;/code&gt;'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-6757784961594271830</id><published>2010-02-24T00:40:00.009+11:00</published><updated>2010-11-20T01:46:27.803+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='csv'/><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='bimap'/><category scheme='http://www.blogger.com/atom/ns#' term='parser'/><category scheme='http://www.blogger.com/atom/ns#' term='trim'/><category scheme='http://www.blogger.com/atom/ns#' term='boost'/><category scheme='http://www.blogger.com/atom/ns#' term='tokenizer'/><title type='text'>Parse CSV File With Boost Tokenizer In C++</title><summary type='text'>Often data required by application are available in CSV formatted files.
In c++ it is easy to read file line by line. All that is left is to extract fields from each line and insert them into datastructure stored in memory.
Boost Tokenizer is a package that provides a way to easilly break a string or sequence of characters into sequence of tokens, and provides standard iterator interface to </summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/6757784961594271830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/parse-csv-file-with-boost-tokenizer-in.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/6757784961594271830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/6757784961594271830'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/parse-csv-file-with-boost-tokenizer-in.html' title='Parse CSV File With Boost Tokenizer In C++'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-3602924161633650834</id><published>2010-02-23T22:14:00.017+11:00</published><updated>2010-02-26T21:22:17.869+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='fizzbuzz'/><title type='text'>My FizzBuzz Solution In  C++</title><summary type='text'>If you are not sure if I can write simple code here is my FizzBuzz c++ solution:

#include &lt;iostream&gt;
using namespace std;

int main()
{
   for (int i = 1; i &lt; 101; ++i)
   {
       if      (i % 3 == 0 &amp;&amp; i % 5 == 0) cout &lt;&lt; "FizzBuzz";
       else if (i % 3 == 0)               cout &lt;&lt; "Fizz";
       else if (i % 5 == 0)               cout &lt;&lt; "Buzz";
       else                               cout</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/3602924161633650834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/my-fizzbuzz-solution-in-c.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/3602924161633650834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/3602924161633650834'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/my-fizzbuzz-solution-in-c.html' title='My FizzBuzz Solution In  &lt;code&gt;C++&lt;/code&gt;'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-4422562653026866387</id><published>2010-02-08T23:14:00.011+11:00</published><updated>2010-11-20T03:42:02.699+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='bimap'/><category scheme='http://www.blogger.com/atom/ns#' term='boost'/><title type='text'>Representing bidirectional relationship with boost::bimap</title><summary type='text'>In C++, std maps and hash-maps are perfect choice for storing key-value pairs of elements. We use key to lookup related value(s).
Quite often I manipulate key-value relationships where both keys and values are unique and usually there is a one-to-one relationships between keys and values. Example of this is a translation tables between two sets of symbols (strings).
I ended up coding my own class</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/4422562653026866387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/representing-bidirectional-relationship.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4422562653026866387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4422562653026866387'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/representing-bidirectional-relationship.html' title='Representing bidirectional relationship with boost::bimap'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-4306968340802338824</id><published>2010-02-05T22:11:00.010+11:00</published><updated>2010-02-25T00:28:18.564+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim'/><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><category scheme='http://www.blogger.com/atom/ns#' term='regular expressions'/><title type='text'>Use vim to generate and execute bash commands</title><summary type='text'>I have been using vim almost exclusively for file editing on any operating system that I use, whether Mac OS X, Linux or Windows.
Here is an example how to use vim to build and execute bash commands using vim's regular expressions.



Often I manipulate log and data files. I need to copy a group of files. Each file in the group have date stamp and I need to make copies with different date stamps.</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/4306968340802338824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/use-vim-to-generate-and-execute-bash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4306968340802338824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/4306968340802338824'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/02/use-vim-to-generate-and-execute-bash.html' title='Use vim to generate and execute bash commands'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-591469931815261294</id><published>2010-01-16T02:38:00.025+11:00</published><updated>2010-02-25T00:29:21.797+11:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='pygments'/><category scheme='http://www.blogger.com/atom/ns#' term='markdown'/><category scheme='http://www.blogger.com/atom/ns#' term='syntax'/><title type='text'>Markdown and Pygments to syntax highlight code in Blogger</title><summary type='text'>I wanted to use Markdown for posting on Blogger. As I am planning to post source code examples I wanted to be able to do syntax highlighting of the code.
I've found python-markdown which is Markdown implementation in Python.
Furthermore, some searching returned Pygments as an option to generate html syntax highlighting from plain source code snippets and I was considering to use Beautiful Soup to</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/591469931815261294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/01/use-markdown-and-pygments-with-blogger.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/591469931815261294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/591469931815261294'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/01/use-markdown-and-pygments-with-blogger.html' title='Markdown and Pygments to syntax highlight code in Blogger'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7979090406441748249.post-2360811571863881968</id><published>2010-01-07T10:20:00.003+11:00</published><updated>2010-01-18T14:10:41.176+11:00</updated><title type='text'>About My Byte of Code Blog</title><summary type='text'>Blog about developing beautiful, cool and functional software.
Posts will mostly deal with Objective-C, Cocoa, C/C++, possibly some Python and other languages, frameworks and technologies that one may come across.
I will try to document my Mac OS and iPhone development experience but may occasionally mention useful stuff I came across developing Linux and Windows network applications or any tools</summary><link rel='replies' type='application/atom+xml' href='http://mybyteofcode.blogspot.com/feeds/2360811571863881968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://mybyteofcode.blogspot.com/2010/01/coming-soon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/2360811571863881968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7979090406441748249/posts/default/2360811571863881968'/><link rel='alternate' type='text/html' href='http://mybyteofcode.blogspot.com/2010/01/coming-soon.html' title='About My Byte of Code Blog'/><author><name>SBHacker</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
