Alejandro G. Carlstein Ramos Mejia Blog



Note: Remember. JavaScript is a prototype-based language.

var Module  = (function() {
    // declare private variables and/or functions
    var private_variable = "private variable content";
  
    var private_method = function(){
        console.log("private_method()");
        console.log("-> private method content");     
    }
    return {
        // declare public variables and/or functions     
        public_variable: "public variable content",
        public_method: function(){
            console.log("public_method()");
            console.log("->" + private_variable);     
        }
    };
})();
  
// Execution
console.log(Module.public_variable);
Module.public_method();
console.log("------------------------------");
console.log(Module.private_variable);
console.log(Module.private_method());
 
// Output
public variable content
public_method()
-> private variable content
------------------------------
undefined
Uncaught TypeError: Module.private_method is not a function

 

Share

I am currently (Dec 13, 2016) taking a class on Groovy, and I found that the Groovy console have a huge bug which doesn’t allow it to obtain input from the user. System.console() gives ‘null’ and all the solutions involving the use of System.in or the input reader buffer seems to fail.

These input-from-user bugs seems to be known based on what the instructor told me when I showed this solution. After some research, I found that they were reported but nothing have being done so far to solve the issue.

Share

Example of Binary Search Tree (BST) as template by using vectors, iterators, and time STL.

NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code is given ‘as is’. I do not take responsibilities of how they are used.

Share

Cupid-4-stupid is now for the Nook Color and Tablet!

Share

Example of Huffman algorithm by using heap.

NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code is given ‘as is’. I do not take responsibilities of how they are used.

Share

As you may know, Microsoft is getting into the open source community with the ASP.NET and DNX with the mono project.
The .NET Execution Environment (DNX) is a software development kit which allows you to run .NET applications on Windows, Mac, and Linux using different frameworks such as .NET framework, .NET Core, and Mono. However, everything are not roses. There are many incomplete libraries, incompatibilities, lack of documentation, and most of the examples such as doing SQL or SOAP do not work depending on which the library targets you are planning to code for. Therefore, I decided to test the basics on all the library targets. I am starting with DNX451.

Anonymous Methods seems to be working fine in DNX451 with C#. Below is a code example for those who wish to play with it.

Share

NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. The code is given ‘as is’. I do not take responsibilities of how they are used.

This tutorial assume that you have some experience with C++ and concepts of Programming Languages.

Share