CodexPi [π] - Programming & Techology Blog
Welcome to My Blog

Personal blog. I write mostly about Android, Java, Python, Web Dev.

Follow me now to keep you posted!
QuickSort Python Iterative and Recursive implementations
Posted 27 November 2014 / By / Algorithms/ Python

QuickSort is one of the most famous sorting algorithms in computer science. I implemented the QuickSort in Python using two approaches including Recursive QuickSort and Iterative QuickSort.
The implementation were done in Python to explore a different approach than the traditional C and Java languages. Finally I scored the average running time obtained by running multiple times each approach.
Read More

Add Android ADB path Mac OS X Yosemite
Posted 26 November 2014 / By / Android/ Mac

With the new release of Mac OS X Yosemite I decided to update the instructions of how to add the Android Adb path to Mac from Mavericks to Yosemite. The instructions are quite similar so here we go:
Read More

Nexus 5 Red vs White Photos Comparison
Posted 18 February 2014 / By / Android

Nexus 5 red vs white

Today I did a small video with some pictures that I took from the Nexus 5 Red and White. I just want to share with you so you can have a look the differences as I was undecided which one to keep. At the end, I chose the red one and my girlfriend kept the white one. As you will be able to see the Nexus 5 Red is quite different to the white one.

The Android nexus phone line is the best out there. The price is really good for the specifications of the phones. In addition, is perfect for Android app development.

Which one do you prefer?

Add Android ADB path Mac OS X Mavericks
Posted 16 February 2014 / By / Android

When we start developing Android Apps on is useful to add the Android SDK path variables to OSX so we can execute the platforms tools such as the “adb” in the Terminal and control your Android development set up.

The steps are:

– Download the SDK from the android official page
– Unzip the file and save in the Home folder for example
– Launch the Terminal App
– Navigate to the Home folder “cd ~/”
– Write the command “echo $PATH” to see your current environment variables. It will return something similar to the line 2 below

Jorges-MacBook-Pro:~ jorge$ echo $PATH

– Create the .bash_profile file with the command “touch .bash_profile” Read More

Java vs C++ Performance Comparison, JIT Compilers, Java Hotspot & C++ Native Compiler
Posted 7 January 2014 / By / C++/ Java
Java vs C++

Java vs C++

The gap between Java vs C++ performance has been narrowing for the past years; studies (Y Nikishkov, G Nikishkov & Savchenko, 2003; Taboada et al. 2013; Lewis & Neumann 2013; Oracle n.d.; Oancea et al. 2011) have shown that Java can achieve similar performance to natively compiled languages such as C++. Taboada et al. (2013, p425) argue that thanks to the Just-in-Time (JIT) compiler of the Java Virtual Machine (JVM) Java obtains native performance from Java bytecode.

Just-In- Time (JIT) compiler can significantly speed up the execution of Java applications. The JIT, which is an integral part of the JVM takes the bytecodes and compile them into native code before execution. Since Java is a dynamic language, the JIT compiles methods on a method-by-method basis just before they are called. If the same method called many times or if the method contains loop with many repetitions the effect of re-execution of the native code can dramatically change the performance of Java code (Y Nikishkov & G Nikishkov & Savchenko 2003. p2402).

With JIT the compilation can be optimized to the targeted CPU and the operating system model where the application runs. The system is able to collect statistics about how the program is actually running in the environment it is in, and it can rearrange and recompile for optimum performance. Read More

Java vs C++ Memory Management Features Comparison
Posted 6 January 2014 / By / C++/ Java
Java vs C++

Java vs C++

There exist great differences between Java vs C++ memory management. One of the strengths of the Java platform is that performs automatic memory management; thereby developers do not need to worry about the complexity of explicit memory management. On the other hand, C++ provides developers with control over memory allocation and de-allocation using pointers, which indicate the memory can be use more efficiently and that performance programs can be optimized. However, Sun Microsystem (2006, p3) states that this can lead to serious executions errors. As a result, a large proportion of developers time is often spend debugging and trying to correct such error. In addition, there is nothing that restrains C++ developers from accessing OS data, or even executable code that resides in the memory (Vivanco & Pizzi 2005, p241). Read More