What is the MVP model? MVP is a user-oriented GUI model, designed to facilitate unit testing and increase segregation between the data layer and the data layer in the MVC model. The MVP model allows the separation of the presentation layer (the Presenter) from the data layer, so interaction with the interface is separate from … Continue reading Learn about the MVP programming model in android

# install Scala version 2.12.4 news

The most popular way to get Scala is either using Scala through sbt, the Scala build tool, or to use Scala through an IDE. 1 First, make sure you have the Java 8 JDK installed. To check, open the terminal and type: java -version(Make sure you have version 1.8.) (If you don't have it installed, download … Continue reading install Scala version 2.12.4 news

# What’s New Angular 5: New features and updates?

After two major upgrades in the last 14 months, Angular - Google’s popular JavaScript framework - has released Angular 5, which arrived 1 November 2017. After missing previous release targets of 18 September and 23 October 2017, Angular 5 promises better code sharing capabilities, an updated HttpClient, faster rebuilds and an emphasis on making it easier to build progressive web apps. Some of the … Continue reading What’s New Angular 5: New features and updates?

# Angular 1 vs Angular 2+ Comparing

Since the release of Angular 2 Final I've been slowly going through my Angular 1 tutorials and converting them to Angular 2, both to help me learn the new Ng2 framework as well as share the code with other developers. I find the best way to learn new technologies by building practical real world examples … Continue reading Angular 1 vs Angular 2+ Comparing

# JavaScript implicit coercion of empty arrays

JavaScript implicit coercion of empty arrays example: [] == ![] //toBoolean [1] [] == !true [] == false //loose equality round one [2] //toPrimitive([]) [3] "" == false //loose equality round two //toBoolean("") [4] false === false true explanations: 1) First there is operator precedence so ! evaluates before == Negating something calls the internal toBoolean method onto that "something" first. … Continue reading JavaScript implicit coercion of empty arrays

# Sort numbers in ascending order using Python

This is Python code to sort the numbers in ascending order input: 3,0,1,4,2 out:0,1,2,3,4 Example is my: numbers = input("Enter numbers separated by a comma: ") numbers = [int(n) for n in numbers.split(',')] end = len(numbers) - 1 while end != 0: for i in range(end): if numbers[i] > numbers[i + 1]: numbers[i], numbers[i + … Continue reading Sort numbers in ascending order using Python

# Prime Number Generator (6n + 1 or 6n – 1)

Prime Number Generator (6n + 1 or 6n - 1) This generator is like most where it brute forces an integer: it see whether the integer is divisible by any of the primes; if so, then it's not a prime and vice versa. This though only compares values 6n + 1 and 6n - 1 starting with n as 1 as … Continue reading Prime Number Generator (6n + 1 or 6n – 1)

# Print the N longest lines in a file java

I got a full 100 score and 182ms execution time of their data set on the site so I consider the code to be working and effective. What I'm wondering is, is there something I can do to make this faster than it already is? Did I miss anything? Any other comments? Input: 2 Hello … Continue reading Print the N longest lines in a file java

# Collatz Conjecture Meet of 2 Numbers in python

def first_collatz(n, visited): counter = 0 while n > 1: counter += 1 n = 3 * n + 1 if n & 1 else n >> 1 if n not in visited: visited[n] = counter def secondd_collatz(n, other): counter = 0 if n not in other: while n > 1: counter += 1 n … Continue reading Collatz Conjecture Meet of 2 Numbers in python

# Simple budget program in python

I've decided to start working on a budget application for the purposes of enhancing my Python skills. In its current form this program takes given expenses and income and tells the user whether they have a surplus, a deficit, or if they are breaking even. Example: import os import sys class Application(): def __init__(self): self.income … Continue reading Simple budget program in python