< Browse > Home

How to set the Color Scheme in vim

February 9th, 2010 | No Comments | Posted in Linux, Tips & Tricks by Diego | - [Full Entry]

I’ve been using vim (or better yet, gvim) for the better part of my undergraduate programming career and for quite some time I struggled on figuring out how to set the default color scheme for gvim under Ubuntu. Well, now that I figured it out, I wanted to share it with you.

Setting the default Color Scheme in vim (gvim)


To set your colorscheme in gvim to a theme of your choice, simply edit the file named .gvimrc. It can be opened using the following in your terminal. If it doesn’t exist, simply create it.

gvim ~/.gvimrc

Then after opening the file, add the following lines of code to the file if they don’t exist yet.

 
syntax on
colorscheme slate
 

Slate (left) and Evening(right)

But why Slate you must ask? Its the one mentioned on all the other tutorials. Yes, I know, but it simply rocks. Just check it out and you’ll understand. If not you can choose from any of these other themes.
Read more »

VirtualBox – Virtualize on Windows, Mac, and Linux

February 8th, 2010 | No Comments | Posted in Software by Diego | - [Full Entry]


Create a virtual machine using VirtualBox

Virtual Box is a powerful open source x86 virtualization that runs on Windows, Linux, Mac and OpenSolaris. It supports a large number of guest operating systems such as Windows XP, Windows 7 RC, Ubuntu, Debian, SUSE, Fedora, and Red Hat. VirtualBox is free as well as many linux distributions. So if you haven’t tried any, I’d recommend you doing so.

In simpler terms, Virtual Box allows you to run another OS on top of your currently existing one. If you wanted to try installing an OS without the hassle of dual-booting, or even wanted to install another OS to do some programming since maybe Windows isn’t the best for you, then virtualiziation is one way to go. There is also no way you can harm your computer so its risk-free. If you corrupt a guest OS, simply delete it and try again.

VirtualBox Features

  • Guest Additions for Windows, Linux, and Solaris – Allows you to install software inside the OS that improves performance. Just recently the guest additions allowed users running Ubuntu to run the Visual Effects, which is nice.
  • Shared folders – Access folders from the host in the guest machines
  • Virtual USB Controllers – Connect a USB device and your virtual machine will recognize it, including USB Flash Drives.

For more features visit Virtual Box Features.

VirtualBox running Ubuntu under Windows

How to start

If you want to start, simply download Virtual Box and an OS. I’d recommend Ubuntu since thats probably the most user friendly (or so I think). If you want something else, hit up DistroWatch. Once you have that, setting up Virtual Box with the OS is pretty straightforward. I’ll add a tutorial later on for those who still need help.
Read more »

C++ Recursion – Power

February 7th, 2010 | 1 Comment | Posted in C++ by Diego | - [Full Entry]

Creating a power function using Recursion


Below is an example of how to calculate the x to the power of n. This tutorial expects you to understand the following:

  1. C++ Recursion
  2. C++ Recursion – Summation
  3. C++ Recursion – Factorial

Example:

pow(2,3);
pow(5,4);

Result:

8
125

Iterative version of a function that calculates the power function


To understand how to calculate the power function using recursion, let’s write a simple algorithm that will do it for us using iteration.

int power(int base, int exp) {

     if ( exp == 0 ) {
          return 1;
     }

     //Initial value for the result is the base
     int result = base;
     
     //Multiplies the base by itself exp number of times
     for ( int i = 1; i < exp; i++ ) {
          result = result * base;
     }

     return result;
}

Read more »

Split Browser add-on for Firefox

February 2nd, 2010 | No Comments | Posted in Software by Diego | - [Full Entry]

Split your Browser Window like in emacs, or vim

Recently, I was looking at source code over the internet and had trouble looking at the entire code in one window without having to create another just to see the entire content of that page.

Hoping there was a “split window” add-on for Firefox out there similar to emacs or vim, I began my search and found Split Browser. Split Browser allows you to split your browser window however you like. You can split your browser in order to see more of the current page without the need of having to open a new window which I thought was great. A preview of it in action is below.


Read more »

C++ Recursion – Factorial

January 26th, 2010 | No Comments | Posted in C++ by Diego | - [Full Entry]

Creating a factorial function


Below is an example of how to calculate the factorial of n. This tutorial expects you to understand the following:

  1. C++ Recursion
  2. C++ Recursion – Summation
  3. Example:

    factorial(5);

    Result:

    120

    Iterative version of a function that calculates the factorial


    To understand how to calculate the factorial using recursion, let’s write a simple algorithm that will do it for us using iteration.

    int factorial(int n) {

         //Initial value for the final value is 1
         int factorial = 1;
         
         for ( int i = 2; i < = n; i++ ) {
              factorial = factorial * n;
         }

         return factorial;
    }

    Read more »

Google Chrome OS revealed

November 19th, 2009 | 5 Comments | Posted in Tech News by Diego | - [Full Entry]

Google Chrome OS was finally revealed this morning. So what is it? Google Chrome OS is focused on making your OS revolve around an internet browser since we spend 90% of our time on the internet anyway. With that, all your files, music, applications, and whatnot will be accessed using the internet, thus eliminating the need to store anything on your PC. So where is everything going to be? In the cloud.

Impressions on Google Chrome OS

I don’t know about this, but I certainly don’t have access to a reliable internet connection 24/7 with my mobile laptop. Does that mean I wouldn’t have any access to any of my files when I’m on the road? Then, this would be useless for me in that situation.

Also, so far it only seems like its going to support a very small number of applications since its geared towards people who only use a computer for accessing the internet. What about developers? I use a lot of tools to program in various languages and platforms. Will this be suitable for me? So far, it looks like it won’t.

Either way, it looks quite interesting naturally being a Google product, but doesn’t necessarily look like something I’d switch over to yet. Maybe once it matures and comes closer to beta, I’ll probably be interested, but until they stick with having everything in the cloud and having a very specific functionality, I just don’t know.

Download Google Chrome OS Virtual Machine

Update: Believe it or not, you can actually download a build of the disk image. Check out Download the Google Chrome OS Virtual Machine from Geeklad.


Read more »

Google Wave Invitation Winners

November 16th, 2009 | 2 Comments | Posted in Blog by Diego | - [Full Entry]

gwaveRemember the Google Wave Invitations post? Well, people asked, and 7 lucky winners will get an invitation! (I randomly picked 7 people using a random number generator).

Congratulations!!!