Tuesday, April 12, 2022

Learning Networking

Google's Engineer @ https://www.youtube.com/watch?v=QKfk7YFILws

Microsoft's folks @ https://www.youtube.com/watch?v=k9ZigsW9il0

NetworkChuk and Network Direction in Youtube are awesome resources.

Sunday, March 29, 2009

Building Boost 1.38, Apache log4cxx 0.10.0, and GMP 4.2.4 on Mac OS X





These are excellent projects/libraries for C++ and can be freely downloaded. Please refer their license details for your specific need or use. Boost can be downloaded from http://www.boost.org/, Apache's log4cxx can be downloaded from http://logging.apache.org/log4cxx/download.html, and GNU's GMP can be downloaded from http://gmplib.org/#DOWNLOAD.

I started compiling these and installed towards compiling xmlbeansxx on Mac. It was very straight forward and the standard "./bootstrap", "./configure", "./make" and "./make install" did the trick.

I've used "--enable-cxx" for GMP so as to enable C++ support. This is needed since the default is "no" i.e. without C++ support.

I want to try xmlbeansxx when I get time. Lets see.

Friday, March 13, 2009

Building Xerces-C++ 3.0.1 on Mac OS X


Building Xerces-C++ 3.0.1 on Mac OS X was/is a breeze. Given below are the steps that I've followed.

1) Downloaded xerces-c++ 3.0.1 source from http://xerces.apache.org/xerces-c/download.cgi
2) Extracted the zip-file into a convenient folder (obvious :-))
3) Spent few minutes reading http://xerces.apache.org/xerces-c/build-3.html
4) Ran "./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" --prefix=/Path/To/My/ConvenientFolder/xercesInstall" from  "extracted folder" of "xerces"
5) Tried the SAX2Count example from "bin" of  /Path/To/My/ConvenientFolder/xercesInstall

I'll try to write some more tiny articles on creating/processing XML documents using xerces-c.

Saturday, March 7, 2009

Using Ant to compile C programs on Mac

Ant is a powerful java based build tool that is an alternative for make, nmake and others. Here are the steps that I've followed to build C programs using "ant" on a Mac OS X system.

1. Downloaded "Ant 1.7" from http://ant.apache.org/ and extracted it into my home folder.
2. Downloaded "cpptasks" from http://ant-contrib.sourceforge.net/cpptasks/ and extracted it under my home folder.
3. Updated the PATH, and set ANT_HOME environment variables like below
     $bash
    $export ANT_HOME= {path to ant folder} 
    $export PATH=$PATH:{path to ant folder}/bin
4. Ran "ant" from within to build/create "cpptasks.jar"
5. Copied "cpptasks.jar" from {path to cpptasks folder}/target/lib into {path to ant folder}/lib. Updated the CLASSPATH with this jar-file-name like below
$export CLASSPATH=$CLASSPATH://lib/cpptasks.jar

6. Created a simple C program in a path like
./src/main/c/Hello.c
7. Created a simple build.xml as given in http://ant-contrib.sourceforge.net/cpptasks/
8. Ran "ant" and it created the executable under "./target" as specified in the build.xml.

Hope this helps someone.

Friday, March 6, 2009

vim 7.2 on Mac

Compiling vim7.2 on Mac OS X was a cool experience. Here are the steps that I've followed.

1. Downloaded the MacVim from http://code.google.com/p/macvim.
2.  Installed "Xcode Tools" from "Optional Installs" of Mac OS X install DVD.
Note:
This step is necessary if GCC is not available. By default developer tools will not be installed. 
3. Extracted the vim source.
4. Used "./configure --enable-gui=macvim --prefix=/my/path".
5. Ran "xcodebuild".
6. Ran "open build/Release/MacVim.app".
7. Got the beautiful "vim".
8. Tried "tabnew" in the "colon prompt" and opened couple of files.
 

Thursday, March 5, 2009

vim with tab

Like many of those who work with vim. I was also having so many vim windows or xterm windows with vi session in my workspace when I’ve to open handful of files. Well, not anymore after vim 7.0. Now I keep the files open in "tabs" :-).

After reading couple of articles on vim with tabs I tried compiling the 7.2 version of vim source and got some linking errors. It was some library path issue with GTK libraries. I decided to go for athena. So I tried "./configure --enable-gui=athena" and "make install" and it works like charm.


I really like that copy paste from one tab into another and so on. Well, I have no intensions of arguing whether some other editor(s) support these capabilities are not. I love to have these features in vim.

The following information from "/src/INSTALL" helped me. All credits to vim team.

These configure arguments can be used to select which GUI to use:
--enable-gui=gtk or: gtk2, motif, athena or auto
--disable-gtk-check
--disable-motif-check
--disable-athena-check

--enable-gui defaults to "auto", so it will automatically look for a GUI (in
the order of GTK, Motif, then Athena). If one is found, then is uses it and
does not proceed to check any of the remaining ones. Otherwise, it moves on
to the next one.

I've read (only) the vim tips from "http://www.linux.com/feature/59533". Happy vim’ing.

Sunday, February 22, 2009

Running Windows 7 Beta from Mac OS X using Sun Microsystems' xVM



In fact though the title of this tiny article tells (or yells?) Windows 7 Beta on Mac. The procedure is kind of generic and can be used for any other supported guest OS' as well.

There are brilliant articles on this including the step-by-step kind of ones with screen-captures for example http://weblogs.java.net/blog/aditya_dada/archive/2009/02/using_suns_virt_1.html.

Actually if one knows the basics its a very simple and straight forward procedure. Here I'll try to capture the steps involved.

1. Download Sun Microsystems' virtual machine for the respective OS. In this case I tried for Mac.
2. Install the Virtual Machine on the host operating system. i.e. the OS that hosts the "guest" or other operating system. In this case Mac OS X is the host and Windows 7 Beta is the guest.
3. Download the beta/release of your guest OS if you've not done that before or keep the CD/DVD ready if you already have a licensed one. I presume and advise that you are going to use only legal software. If you choose any Open Source software then you are encouraged to do so.
4. Start the "Virtual Machine" application and walk through the installation steps of the "Virtual Machine Wizard" and voila you'll have guest OS installed and is available in an application window.

Try it. You'll love it. Hope you liked the sample captures on top left of this article :)