Crea sito

How to Find length of a List in Haskell

Hi guys, in these weeks I’m studying Haskell and Functional Programming in general and since I’m finding this language very interesting and funny I want to share with you some tips and tricks on how to solve common problems. In this post I want to show you how to find the length of a List

Find the missing number in two Arrays

PROBLEM: Let A,B be two Arrays. Suppose B is a sub-array of A and there is one element that appears only in A. Find the element of A that is missing in B. Example: A = 1, 5, 6, 3, 4, 2 B = 6, 3, 5, 1, 4 Output: 2 IDEA: If you want

Find the Number which occurs odd number of times

I’m practicing again with Algorithms and I’ve found an interesting Algorithmic Challenge named “Find the Number which occurs odd number of times in an Array”, so I have decided to try it and fortunately I solved it, but not without any problem. I want to show you what the challenge exactly was and the code

How to quickly check the Highest Normal Form

This tutorial is written for students who still have some notions about Functional Dependencies and Normal Forms.  Thus I will not explain what these concepts means, because you can find their definition in books and on the web. I write this article only for the ones that have to deal with Normal Forms exercises and

How to install Ubuntu 16.10 in external HDD

Installing Ubuntu 16.10 (or other older versions) in an external HDD is a very simple and fast operation. There could be a lot of reasons for doing this and I’m going to show you how can you make it. You will need these things before starting: Your favorite Ubuntu release (For example you can download

How to Update Ubuntu Bash in Windows 10

Since I wrote a a personal review about the new Ubuntu Linux Bash present in Windows 10 Anniversary, I want to show you also how to keep your Bash updated and upgraded. This is a simple and fast operation that could be fundamental in order to have a perfectly working Shell. I will divide this

Windows 10 Anniversary: Ubuntu Bash Review

The new Windows 10 Update named 1607, also known as Windows Anniversary, is full of new features and improvement, in particular Redmond added the Ubuntu Linux Bash in his own Operating System. Even if the Bash is still a beta, it has the more common features available in other Linux Systems like Ubuntu. I tried

How to find the maximal sum in Array in Java

INTRODUCTION TO THE ALGORITHMIC PROBLEM: Imagine that you receive a 50$ gift card which can be used in a famous shop of your town. You can use this gift card to buy only two items and the sum of their prices must be lower than 50$. This shop has a lot of products and you

Lara Croft explains Moore’s Law with Infographic

I was reading a videogame’s blog this afternoon when I saw a beautiful infographic about Lara Croft, the main character of Tomb Raider. This image shows how Lara changed during the years and I realized that these changes were perfect to explain the Moore’s Law with practical example. So I decided to post this infographic

Clock Rate calculation exercise with Solution

Problem: Our favorite program runs in 1.5 seconds on computer A, which has a 700 Mhz. Clock Rate. We are trying to help a computer designer build a new (faster) machine B. The designer can use new technology to substantially increase the clock rate, but has informed us that this increase will affect the rest