I was originally going to release my .vimrc on the blog, but I’m in the process of repairing it up right now–so it might just confuse people. I will release it at a later time when it is stable(I cleaned it up to get rid of a problem I was having after creaing the ShowMeDo videos, in which i inadvertently destroyed the folding setup). Meanwhile, most of my file is derived from Amir Salihafendic’s vimrc file, available here.
A couple of things I changed from his suggestions:
- (Mac OS X only) I put the helper directory contents directly in the Vim.app package contents
- (possibly Mac OS X only)I turned off lazy redraw
Meanwhile, I was able to recover most of my folding stuff with the following commands. here is how folding should work(put this in your .vimrc–without the numbers of course):
That last line depends on your shiftwidth, which you can set by
set shiftwidth=2, for example. For a shiftwidth of 2, set foldlevel=1 seems to work fine. Also, for some reason, even though I enabled folding with the first command above, I still have to type in
zC in command mode to see the folding.
Hope this helps.
“If I have seen further it is by standing upon the shoulders of giants.”
Well, it is that time of year again–university summer classes. I won’t update this blog as frequently as before, but I will try to post from time to time, depending on how much time I can free up.
I made two small Cocoa projects on Google Code which leverage existing code and tools(hence the quote above)
I have uploaded the code and binaries from a different machine instead of my Mac, so let me know if something is broken.
- Andreas Mayer for AMShellWrapper
- Greg Miller for gcalc
Very nice update and a new wiki based site for RubyCocoa. Check out the new version. The documentation seems to be better, etc. I’ll be updating my little Regular Expression utility so that potential users don’t have to download RubyCocoa to actually run it. I’ll keep you posted.
It looks like other RubyCocoa programmers can register and contribute to the community through the Wiki on the website.
In other news, BridgeSupport offers a framework for helping create new bridges between language “X” and Cocoa. A nod from Apple to the bridge developers.
(news from Daring Fireball and MacResearch)
CVS comes preinstalled in Mac OS X.
Here is what I did to setup and use a local cvs repository:
- Make a directory called
cvsroot on Desktop
- Edit ~./bash_login and add the command
- Run the command
cvsinit in the Terminal
cd to the project directory you want to place under version control
- Suppose your project directory is called
project, type in
cvs import -m "Program" project sample start
- You should get bunch of output followed by the message
No conflicts created by this import
- Let us say you want to checkout the code you have just placed. Simply navigate to a directory where you want to store the checked-out project and type in
cvs checkout project
- If you made changes and want to commit your changes to the repository–say you added a variable called
int x; C file called foo.c, simply type in
cvs commit -m "Added a variable" foo.c after navigating to the directory where your modified file is
There is much more to CVS, here is an Apple tutorial on the subject.
this seems to be a good, if somewhat dated, tutorial.
It is straightforward installing GraphViz for Mac OS X. The easiest way might be using the Mac port of the same name, GraphViz. However, I think this has not been updated in a couple of years.
You can install the commandline version of the latest GraphViz tools, dot, neato, etc by using MacPorts. Assuming you have MacPorts properly installed and configured, I think the following command is used(I have to check to be 100% sure):
sudo port install graphviz
Once the installation is done, do a simple sanity check by typing in
neato in the Terminal.
Boost smart pointers fix many of the things wrong with auto_ptr. The smart pointer library consists of
The table is courtesy of the link here.
I will just go through a simple example here. For a slightly more detailed look, you can take a look at this article.
Installing Boost on Mac OS X
Compiling and installing Boost is straightforward even if it takes some time and is processor intensive–it kept both cores of my Intel Core Duo pretty busy. What you really should do is follow the more authoritative guide from the Boost folks here. Here is my summary. Disclaimer: This is not a comprehensive guide. I am not liable for any failures you might have. See the link above for a more detailed guide.
- Install bjam (it is a tool like make, but supposedly better). Put bjam in your PATH
- Invoke bjam. Step 3 shows what an invocation might look like(you can customize this to your preferences): The following command works if you have the boost_1_34_0 directory in ~/ and bjam built and set up correctly.
$ cd ~/boost_1_34_0
$ bjam --build-dir=/tmp/build-boost --toolset=darwin stage
- After a while, type in
to make sure everything proceeded correctly.
- Try the example given on the Boost page(see here).
A smart pointer example.
I’ll be using the IT++ library for this example. Of course, you can make your own examples without the library. The concepts are what matter.
typedef boost::scoped_ptr<PAM> pam;
pam p(new PAM(2));
bvec input = “0100100001100101011011000110110001101111001000000101011101101111011
//The following line of code simulates the transmitter end.
//The following simulates the receiver end.
if(demodded_out == input)
This is basically my previous code, with some smart pointer stuff added in. Notice that I didn’t deallocate any memory(I didn’t have to).
If you use wikipedia as one of your favourite sources of information then you should definitely take a look at Pathway. It will allow you to navigate wikipedia in a graphical way, creating a pathway as you move from page to page. Its creator, Dennis Lorson, is an electrical engineering/CS student at the Catholic University of Leuven, Belgium. If this is his first program he made, I can only look forward to what we can expect from him in the future!
Innovative little apps like this one are one of the reasons I like Mac OS X. Here is a sample screenshot. Click on the thumbnail to get the full view.