Archive for April 2011
Netbeans 7.0 on Ubuntu Installation – OpenJDK problem
Installation
The installation process is simple:
- Download the version you want to install from here.
- Navigate to the folder were the
.sh
file was downloaded. - Give executable permissions to the
.sh
file. - Execute the installer (
.sh
) file either pretendingsudo
command (in order to install it in the default/usr/local/netbeans-7.0
location) or without (in order to install it in the/home/Username/netbeans-7.0/
location) - Use the Graphical Installer to do the installation.
For example:
[~] $ cd ~/Desktop/ # Step 2 [~/Desktop] $ ls -l netbeans-7.0-ml-cpp-linux.sh -rw-r--r-- 1 *** *** 45967360 2011-05-03 09:21 netbeans-7.0-ml-cpp-linux.sh [~/Desktop] $ chmod +x netbeans-7.0-ml-cpp-linux.sh # Step 3 [~/Desktop] $ ls -l netbeans-7.0-ml-cpp-linux.sh -rwxr-xr-x 1 *** *** 45967360 2011-05-03 09:21 netbeans-7.0-ml-cpp-linux.sh [~/Desktop] $ sudo ./netbeans-7.0-ml-cpp-linux.sh # Step 4 Configuring the installer... Searching for JVM on the system... Extracting installation data... Running the installer wizard... |
OpenJDK Problem
The problem with OpenJDK
Configuring the installer... Searching for JVM on the system... Extracting installation data... Running the installer wizard... null |
while installing Netbeans 6.9.1 on Ubuntu is the same for Netbeans 7. Netbeans needs Sun JDK to work, otherwise even the installation wizard (GUI) does not appear.
Read more details about the problem and how to solve it in the post about Netbeans 6.9.1.
Introduction to Erlang : BIFs & Predefined Modules
Built-in Functions (BIFs)
Erlang’s Built-in Functions (shorthand BIFs) are commonly used functions that are intergrated into the Erlang’s VM for performance reasons. Most of them belong to the erlang
module, but there are some in other modules, such as lists
.
The BIFs can be separated to standard and non-standard. The standard ones are auto-imported; they can be called without the use of the module name prefix (remember the effect of the -import(...)
directive). On the other hand, the non-standard ones have to be called following the normal module:function(...)
convension. In the erlang
module’s man pages (here) the distinction between standard and non-standard is visible by the lack or existence of the erlang
(module’s name) prefix.
elrang
abs/1
Arithmetic absolut value of an integer or float.
erlang:append_element/2
Appends an element to a tuple.
apply/2|3
Calls the function passed as a parameter.
atom_to_list/1
Returns a string which corresponds to the text representation of Atom.
Read the rest of this entry »
Introduciton to Erlang : Recursion (2/2)
Accumulators
In several cases, as with the mlists:length/1
example, the non-tail recursive function can be easily turned to a tail recursive one by using the notion of accumulator. An accumulator is an extra argument introduced to a function in order to aggregate the partial results of the function. It turns the “bottom-up” collection of the final result to “top-down”.
In order to add and initialize the accumulator argument one has to introduce an extra function definition.
tlr(...) -> tlr(..., Accumulator_initial_value). % the clause that "breaks" the recursion and % returns the result tlr(..., Accumulator) -> Accumulator; tlr(..., Accumulator) -> ..., Accumulator_new_value = ..., ..., trl(..., Accumulator_new_value). |
Notice that typically you would only export the tlr/1
function and the tlr/2
would remain for inner-module use and not visible to the module’s users.
Read the rest of this entry »