Thursday, July 2, 2015

Installing CentOS in Oracle VirtualBox Part 1: Create a New Virtual Machine For CentOS















If you want to know your way around Red Hat Enterprise Linux distribution, but the you don't have the financial ability to obtain a license.  CentOS is your best bet get to the the Red Hat Enterprise Linux official experience.  Because CentOS is a binary capatible version of Red Hat Enterprise Linux.  Meaning all the things that matters are the same, only the branding and logos are different.  CentOS is open sourced and can be downloaded for free.  Although it might be a couple of versions behind Red Hat Enterprise Linux.  But, you should be able to perform everything you can with CentOS that you can with Red Hat Enterprise.  Below is a step by step instruction on how to install CentOS in Oracle VirtualBox.

Step-By-Step Instructions:

1.  Type http://centos.org in your browser
2.  Click on the "Get CentOS Now" button

3.  Click on "DVD ISO"


4.  Select the mirror site that is closest to you, or whatever fancies you, then save it to a folder that you will remember later on.



4.  Now we are ready to create a new machine in Oracle VirtualBox to prep for the installation of CentOS

2. Launch VirtualBox and click on the "New" button

VirtualBox New Virtual Machine
3. The "Create Virtual Machine" dialog box will be displayed, input the following information



4. It's important that you select 64-bit system, from the drop down if you want to install a 64-bit version of Red Hat

5. Give your virtual machine 2 GB of memory to start off with, you can increase this value later, if needed.  Two GB should be enough for most tasks.  You don't want to allocate too much memory to your VM machines because it might slow down your host machine.



6.  Click "Next"

7.  Select "Create a virtual hard drive now" option


8.  Click "Create"

9. On this screen you will see the flexibility of VirtualBox you can actually create Microsoft Virtual Machines with VirtualBox, it's the best of both worlds.  Select "VDI (VirtualBox Disk Image)" to create a VirtualBox Disk Image.  Then click "Next"


10.  Select "Dynamically allocated" option, this will grow your disk as needed. Then click "Next"


11. The next screen is the "File location and size" screen. The initial disk space is 8 GB,  I gave my VM 64 GB, but you can give the amount of disk space that you are comfortable with.  After you've allocated the disk space, click the "Create" button.



12. Now you have a new virtual machine ready for a CentOS in VirtualBox


























Wednesday, July 1, 2015

AngularJS SPA Pt 1 : Setting Up Angular-Seed

angular-seed is an AngularJS application skeleton template.  An application skeleton let's gives you a boiler plate template so that you don't have to start the application from scratch.  You can get the source code from https://github.com/angular/angular-seed.  Below are the steps to use angular-seed ass your application template for AngularJS.

Step-By-Step Instructions:

1.  Go the page https://github.com/angular/angular-seed

2. Open Git GUI.  if you don't have Git install you can follow this blog.

3.  In the Github angular-seed page copy the "HTTPS clone URL"

4.  In Git GUI click on the link "Clone Existing Repository"


5.  In "Source Location" paste the angular-seed clone URL that you've just copied, then on the "Target Directory" field type in or browse to the folder that you want to store the repository in on your local machine.  Then click "Clone"


6.  Click on "Expore Working Copy" to see the repository on your local machine


7.  As you can see the repository has been cloned in your local PC


8.  Now we want to add npm NodeJs to the node package manager to run, debug, and package the AngularJS, follow this blog to setup NodeJs

9.  In the command line navigate to the angular-seed git in your local machine, then type "npm install" without the double quotes.  This process might take awhile, so don't cancel the process especially if it's the first time you run the command.

10. Now open up the bower.json file then add the bootstrap library to the list of dependencies, by typing in "bootstrap": "~3.3.6" the final markup should look like the following

{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "~1.5.7",
"angular-route": "~1.5.7",
"angular-loader": "~1.5.7",
"angular-mocks": "~1.5.7",
"html5-boilerplate": "^5.3.0",
"bootstrap": "~3.3.6"
}
}


11.  Open the .bowerrc file and change the directory to "app/js/lib", the final markup should look like the following

{
"directory": "app/js/lib"
}

Note: If you need more information on bower you can visit this blog that I wrote about it

12.  After "npm install" command finish executing type in "npm start" in the command line to have nodejs start a local web server



12. Open up the index.html file in the app folder and replace all the instances of bower_components/ path with js/lib/



13.  In the browser type in the http://localhost:8000, you will see that angular-seed is hosted on the web server






    Tuesday, June 30, 2015

    Create .gitignore for Visual Studio














    One of the first thing you have to do when you are creating a git repository is to create a .gitignore file that tells git to ignore the files specified in the .gitignore file.  Since Visual Studio produces all kinds of files it could take a while if you tried to create a .gitignore file from scratch.  Well there's a website that will generate a .gitignore file for you.  It's called gitignore.io  all you have to do is type in the IDE in this case it's VisualStudio without any spaces and the website will generate a .gitignore file for you automatically.

    Step-By-Step Instructions:


    1. Type in the URL https://www.gitignore.io 










    2. In the text box, type in "VisualStudio" without the double quotes


    3.  Then click on the "Generate" button


    4.  That's it, a .gitignore file is generated for you, save the file and put it at the root of your Visual Studio repository and you will ensure that the only thing that will get committed are the source codes


    Note:  You can remove or add files exclusions from the generated file.  The comments are there as guide for you on what is being ignored.



    Friday, June 26, 2015

    Hadoop Part 1: Install Hortonworks HDP Sandbox

    In this blog I am going to show you how to install the Hortonworks  Hadoop virtual machine on your local machine using Oracle's VirtualBox.  It is free so it's the best way to learn Hadoop if you are just starting out.

    Step-by-Step Instructions:

    1.  Type in the url http://hortonworks.com/products/sandbox-instructions , you will be taken to the Hortonworks sandbox download page.

    2.  What you want to do is download the latest stable release.  Choose the virtual machine version that is for VirtualBox at the time of this writing the file should say VirtualBox(HDP 2.2.4 - 5.4 GB).  It's going to take a while.

    3.  Now we are ready to prepare our Oracle VirtualBox for the sandbox, first open the Oracle VirtualBox application, then select "File" → "Preferences"


    4. Select "Network", then select the "Host-only Networks" tab, then click the "+" icon to add a new host network adapter.  We are going to create a host-only network adapter.



    5.  Status dialog box will appear to let you know that VirtualBox is creating a new host-only network adapter.



    6.  Accept the "User Account Control" permission to proceed.

    7.  A new VirtualBox Host-Only Ethernet Adapter will appear, double click on it, in the screenshot below the adapter is called "VirtualBox Host-Only Ethernet Adapter #2"



    8.  Click on the "DHCP Server" tab, then make sure that the "Enable Server" checkbox is unchecked if it is checked, click "OK"



    9.  Click "OK" again to close the "Virtual Box Settings" dialog box.

    10.  Now you are ready to import your Hadoop sandbox into VirtualBox

    11.  Click on "File" → "Import Appliance"


    12.  Click on the folder icon to browse to the Hortonworks sandbox that you've just downloaded.


    13.  Select the Sandbox_HDP_2.2.4.2_VirtualBox.ova file, then click on the "Open" button.


    14.  Click on the "Next" button


    15.  Accept the default, then click on the "Import" button.


    16.  The import will take a while to finish


    17.  The Hortonworks HDP Virtual Machine is now hosted on VirtualBox.





    18.  Right click on the Sandbox virtual machine on the left hand side, then select "Settings"


    19.  Select "Network" then the "Adapter 1" tab, select "Host-only Adapter" on the "Attach to" dropdown list


    20.  Make sure the host-only adapter that we've created in the previous step is selected



    21.  Now click on "Adapter 2", then select "NAT" on the "Attach to" dropdown list.  Then click "OK" and your sandbox should be all setup, and ready to be started.



    22. To start the Hortonworks VM, right-click "Hortonworks Sandbox" and then click on "Start"


    13.  The applications will start up automatically, this will take awhile


    14.  After you are finished you will get the message below that tells you to type a URL into your browser



    In the next few tutorials I will go over how to install a GUI Desktop on the Hortonworks Sandbox as well as making the Virtual Machine a fullscreen display so that it will be easier for you to work with the sandbox.

    Monday, June 8, 2015

    ASP.NET MVC 5 From Scratch : Using Conditional Comments to Support Older Versions Of IE

    Older versions of IE have problems supporting the newer JavaScript libraries and HTML5 tags.  In the previous blog we've created responsive layout in ASP.NET MVC.  In this blog we are going to use conditional comments to support older versions of Internet Explorer (IE).  Since IE 9 seems to be the cutoff point we will use it in our conditional comment base condition to decide whether we want to do something different to support IE.  We will be working with the MvcApp project.

    Step-By-Step Instructions:

    1.  Open the MvcApp application
    2.  Open the _Layout.cshtml
    3.  Inside the <head> tag

        <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <![endif]-->

    The code above says to include the html5shiv.min.js and response.min.js from maxcdn.com if the browser's version is less than IE 9 with the line <!--[if lt IE 9]>. The html5shiv library supports HTML5 elements in IE and the response library supports media queries in IE. Inside the "if" condition it also tells the layout to use JQuery 1.xxx versions for IE.

    The complete code should look like the following in the _Layout.cshtml
    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@Page.Title</title>
    @RenderSection("head", required: false)
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/css")
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <![endif]-->

    </head>
    <body>
    <header>
    <nav class="navbar navbar-default navbar-fixed-top">
    <div class="row">
    <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#"></a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
    <li><a href="#">Beverages</a></li>
    <li><a href="#">Condiments</a></li>
    <li><a href="#">Confections</a></li>
    <li><a href="#">Dairy Products</a></li>
    <li><a href="#">Grains/Cereals</a></li>
    <li><a href="#">Meat/Poultry</a></li>
    <li><a href="#">Produce</a></li>
    <li><a href="#">Seafood</a></li>
    </ul>
    </li>
    </ul>
    </div><!--/.nav-collapse -->
    </div>

    </div>
    </nav>
    <div class="jumbotron" id="header-jumbotron">
    <h2>Northwind Store</h2>
    </div>
    </header>
    @RenderBody()
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    </body>
    </html>

    ← Previous  
    Create A Responsive Layout With Bootstrap

    Thursday, June 4, 2015

    ASP.NET MVC 5 From Scratch : Create A Responsive Layout With Bootstrap

    In our previous blog we created a simple _Layout.cshtml file that does not have any markup just to make things simple.  In this blog we will use Bootstrap to make the layout look more professional and responsive, so that it can be viewed in any screen size.  The previous layout looks like screenshot below.
















    The Bootstrap version will look like the screenshot below.















    Step-By-Step Instructions:

    1.  Open the MvcApp project
    2. Open the BundleConfig.cs file in the App_Start folder and type in the following code

    using System.Web;
    using System.Web.Optimization;

    namespace MvcApp
    {
    public class BundleConfig
    {
    public static void RegisterBundles(BundleCollection bundles)
    {
    bundles.Add(new ScriptBundle("~/bundles/jquery", "https://ajax.googleapis.com/ajax/libs/jquery/
    2.1.4/jquery.min.js").Include("~/Scripts/jquery-{version}.js"));
                bundles.Add(new ScriptBundle("~/bundles/bootstrap","https://maxcdn.bootstrapcdn.com/bootstrap/
    3.3.4/js/bootstrap.min.js").Include("~/Scripts/bootstrap.js","~/Scripts/respond.js"));

    bundles.Add(new StyleBundle("~/Content/bootstrap", "https://maxcdn.bootstrapcdn.com/bootstrap/
    3.3.4/css/bootstrap.min.css").Include("~/Content/bootstrap.css"));

    bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/Styles.css"));

    BundleTable.EnableOptimizations = true;
    bundles.UseCdn = true;
    }
    }
    }

    The code above creates a new StyleBundle with the virtual path ~/Content/bootstrap, which is created specifically for the bootstrap css files. Then we change the StyleBundle("~/Content/css") bundle to contain stylesheets that are site specific. We will add the Styles.css file later

     3.  Now we are ready to add the header navigation to the _Layout.cshtml file, which is the layout specified as the default layout in the _ViewStart.cshtml file.

    4.  Open the _Layout.cshtml file, then type in the following code

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@Page.Title</title>
    @RenderSection("head", required: false)
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/css")
    </head>

    The code above defines the viewpoint as the device-width, a viewport is the width of the screen used to determine how bootstrap will display the elements on the screen. The device-width viewport means that the elements will be render to the screen's device width. The rest of the code just renders all the style bundles that we've defined in the BundleConfig.cs file.

    5.  Once we have the head section defined we can define the header section of the layout.

        <body>
    <header>
    <nav class="navbar navbar-default navbar-fixed-top">
    <div class="row">
    <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#"></a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
    <li><a href="#">Beverages</a></li>
    <li><a href="#">Condiments</a></li>
    <li><a href="#">Confections</a></li>
    <li><a href="#">Dairy Products</a></li>
    <li><a href="#">Grains/Cereals</a></li>
    <li><a href="#">Meat/Poultry</a></li>
    <li><a href="#">Produce</a></li>
    <li><a href="#">Seafood</a></li>
    </ul>
    </li>
    </ul>
    </div><!--/.nav-collapse -->
    </div>

    </div>
    </nav>
    <div class="jumbotron" id="header-jumbotron">
    <h2>Northwind Store</h2>
    </div>
    </header>

    The code above looks complicated, but it's not that complicated. First we use the bootstrap class "navbar navbar-default navbar-fixed-top" to tell the browser that we want the navbar that fixes on the top of the screen even when the user scrolls. All we have to do is define the class and bootstrap does the rest for us.  The navbar class defines the top navigation of the layout like the screenshot below





    6.  The following section defines the menu when the screen gets really small and the elements have to be stacked because it does not have the width to display everything horizontally.

                                <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
    <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#"></a>
    </div>

    The menu looks like the following when the screen gets really small































    7.  Now we want to define the actual navigation bar, type in the following code to define the "Home", "About","Contact" tabs, and the "Products" drop down.


                                <div id="navbar" class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
    <li><a href="#">Beverages</a></li>
    <li><a href="#">Condiments</a></li>
    <li><a href="#">Confections</a></li>
    <li><a href="#">Dairy Products</a></li>
    <li><a href="#">Grains/Cereals</a></li>
    <li><a href="#">Meat/Poultry</a></li>
    <li><a href="#">Produce</a></li>
    <li><a href="#">Seafood</a></li>
    </ul>
    </li>
    </ul>
    </div><!--/.nav-collapse -->

    Like everything else in bootstrap we just have to call class "navbar-collapse collapse" and nest the div with the <ul> element with class "nav navbar-nav" and bootstrap picks it up applies the stylesheets and functionalities automatically. That's the great thing about bootstrap. It makes things easy, but the bad thing is a lot of the sites nowadays have the same bootstrapy look and feel to them. But it's great if you want to throw something together quickly and make it look decent.

    So the code below defines the "Home", "About", and "Contact" tab

        <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a

    And the following code defines the "Products" dropdown menu.
                                        <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
    <li><a href="#">Beverages</a></li>
    <li><a href="#">Condiments</a></li>
    <li><a href="#">Confections</a></li>
    <li><a href="#">Dairy Products</a></li>
    <li><a href="#">Grains/Cereals</a></li>
    <li><a href="#">Meat/Poultry</a></li>
    <li><a href="#">Produce</a></li>
    <li><a href="#">Seafood</a></li>
    </ul>
    </li>


    8. Now we want to add a jumbotron to make the navigation stand out a little bit.

               <div class="jumbotron" id="header-jumbotron">
    <h2>Northwind Store</h2>
    </div>

    The code above produces the following output











    9.  To style the jumbotron we have to create our own stylesheet so that it does not interfere with the default bootstrap styles.  So create a new css file in the ~/Content folder and give it the name Styles.css.

    10.  In the Styles.css file type the following code

    body {
    }

    #header-jumbotron{
    background-color: #6f5499;
    }
    #navbar {
    margin-left: 50px;
    }

    #header-jumbotron h2{
    margin-left: 40px;
    color: #fff;
    margin-top: 50px;
    }


    The code above defines the margin for the navbar and the jumbotron, it also set the text color and background color for the jumbotron.

    11. Now we want to wrap things up by calling the script bundles at the bottom of the page

            @RenderBody()
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")

    12. The complete code for the _Layout.cshtml file is the following

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>@Page.Title</title>
    @RenderSection("head", required: false)
    @Styles.Render("~/Content/bootstrap")
    @Styles.Render("~/Content/css")
    </head>
    <body>
    <header>
    <nav class="navbar navbar-default navbar-fixed-top">
    <div class="row">
    <div class="navbar-header">
    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" 
    data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                                        <span class="sr-only">Toggle navigation</span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="#"></a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
    <ul class="nav navbar-nav">
    <li class="active"><a href="#">Home</a></li>
    <li><a href="#about">About</a></li>
    <li><a href="#contact">Contact</a></li>
    <li class="dropdown">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">Products <span class="caret"></span></a>
    <ul class="dropdown-menu" role="menu">
    <li><a href="#">Beverages</a></li>
    <li><a href="#">Condiments</a></li>
    <li><a href="#">Confections</a></li>
    <li><a href="#">Dairy Products</a></li>
    <li><a href="#">Grains/Cereals</a></li>
    <li><a href="#">Meat/Poultry</a></li>
    <li><a href="#">Produce</a></li>
    <li><a href="#">Seafood</a></li>
    </ul>
    </li>
    </ul>
    </div><!--/.nav-collapse -->
    </div>

    </div>
    </nav>
    <div class="jumbotron" id="header-jumbotron">
    <h2>Northwind Store</h2>
    </div>
    </header>
    @RenderBody()
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    </body>
    </html>


    Friday, May 29, 2015

    JQuery : jQuery.noConflict(); Resolve the $ Conflict

    The JQuery library by design uses only two global namespace so that it would not conflict with other JavaScript libraries.
    • $ - the dollar is used as a reference to JQuery namespace
      • Also used by Prototype library, YUI and mootools
    • jQuery - is also used to reference to jQuery namespace, this the more unique reference of the two options, but nobody really uses it
    So what do you do if you wanted to use jQuey and Prototype on the same page?  Well jQuery can concede the $ sign to the other libraries with the code jQuery.noConflict() function

    This sample code shows how jQuery gives up the $ sign to the JavaScript library Prototype


    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    <title>JQuery No Conflict</title>
    <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery.noConflict();

    jQuery(document).ready(function(){
    alert("jQuery still works!");
    });
    </script>
    </head>
    <body>
    </body>
    </html>


    Note: The thing you have to remember is that the $ is no longer referring to JQuery, it now belongs to Prototype, if you try to use Prototype and JQuery on the same page without using jQuery.noConflict(), you will get a broken page with Prototype complaining that the $ does not work. However the error is not very description as you can see below in Firefox console.  You will get the TypeError: element.dispatchEvent is not a function.





    Even though we've resolved the conflict, we are now left with type jQuery instead of using the $ every time we want to use jQuery.  Well we can assign the object jQuery to another shorthand variable with the code below.


    <!DOCTYPE html>
    <head>
    <meta charset="UTF-8">
    <title>JQuery No Conflict</title>
    <script src="http://ajax.googleapis.com/ajax/libs/prototype/1.7.2.0/prototype.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script type="text/javascript">
    jQuery.noConflict();

    var jq = jQuery;

    jq(document).ready(function(){
    alert("jQuery still works!");
    });
    </script>
    </head>
    <body>
    </body>
    </html>

    The code above assigns the jQuery namespace to the variable jq. It's not as cool as the $, but at least it's less typing.