Tech Junkie Blog

Latest Posts

Tuesday, August 14, 2018

Monday, August 13, 2018

JavaScript does not have a built-in feature to define a namespace.  A namespace is basically a container of your code that it does not pollute the other codes that's on page.  Namespace allows you to play nice with people's code and other JavaScript libraries.

Fortunately, JavaScript functions have their own contexts and scope.  Therefore, we can use functions as a namespace so that it does not pollute the global scope.

The easiest way to create a namespace on a page is to encapsulate everything in an anonymous function like the code below.


    <script>
        (function () {
            // put your code here
        }());

    </script>

Another way of using namespace is to assign the anonymous function to a variable


    <script>
       var myNameSpace = (function () {
            // put your code here
        }());

    </script>

Friday, August 10, 2018

Linux installation comes with OpenJDK, but you want to use the official JDK from Oracle instead to run most of the software.  This post will show you the steps to install the Oracle JDK

First let's check to see what version of JDK we have installed by running the command

java -version










As you can see Fedora installs the OpenJDK library by default.  What we want to do is replace it with the Oracle version instead.

Type the address http://www.oracle.com/technetwork/java/javase/downloads/index.html
into Firefox in the Fedora VM and click on the "JDK" download button


































Thursday, August 9, 2018

One of the most useful feature in Azure is the ability to reset your virtual machine's password.  There will be times when you create a virtual machine that you put aside for a long time and you forgot the password for the machine.

To reset your password do the following:

1.  Log into Azure by typing the URL https://portal.azure.com
2. Click on the "Virtual Machines" link






3. Select the virtual machine you want to reset your password on










4. Click "Start" to start the machine, your machine must be running before you can reset your password











5. Under "SUPPORT + TROUBLESHOOTING" select "Reset Password"












6.  Select the "Reset Password" radio button, enter the username and password you want to reset to.  Then click "Update" when you are finish




















Surprisingly the reset password function takes a long time to apply. So you have to wait for a while before you can use your virtual machine again.




Wednesday, August 8, 2018

An ASP.NET MVC can get big, and it could be overwhelming.  Areas are a way to break up the application into smaller segments,  A perfect candidate for an Area is the Administrative features of the site because it has multiple pages, and functionalities.  So it is a good idea to segment off the Administration area to its own area (no pun intended).

To add an Area to your MVC application right-click on the project and click "Add", then select "Area..."


















Type in the word "Admin" in the "Add Area" dialog










Tuesday, August 7, 2018