Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mcaliman committed Sep 29, 2023
1 parent 7fc0373 commit f9006b8
Show file tree
Hide file tree
Showing 69 changed files with 367 additions and 316 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: post
lang: en
title: "Explore the World of Artificial Intelligence"
excerpt: "Five Websites to Boost Your Productivity and Creativity"
category: data-science
category: artificial-intelligence
date: 2023-05-15 05:45:33
tags: [English,Artificial Intelligence]
comments: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
layout: post
lang: en
title: "Introduction to Machine Learning"
excerpt: "Machine learning is a powerful technology that allows computers to learn from data without being explicitly programmed. It is used in a wide range of applications, including image recognition, text classification, and event prediction"
category: artificial-intelligence
date: 2014-09-23 22:45:33
tags: [English,"Machine Learning"]
comments: true
share: true
---



Machine learning is a branch of artificial intelligence that deals with the development of algorithms that can learn from data without being explicitly programmed. In other words, machine learning allows computers to learn from information without being provided with precise instructions.

Machine learning is a powerful technology that can be used to solve a wide range of problems, including:

* Image and video recognition
* Text classification
* Event prediction
* Information retrieval
* System control

There are different types of machine learning algorithms, each with its own characteristics and strengths. The most common types of machine learning algorithms include:

* Supervised learning, in which the algorithm is trained on a dataset of input and output examples.
* Unsupervised learning, in which the algorithm is trained on a dataset of input examples without output.
* Semi-supervised learning, in which the algorithm is trained on a dataset of input and output examples, but only a portion of the examples have output.

Machine learning is based on a variety of mathematical tools, including:

* Statistics
* Probability
* Calculus
* Data science

Machine learning is a rapidly evolving technology, with new algorithms and techniques being developed constantly. Machine learning is having a significant impact on a wide range of industries, including healthcare, finance, education, and manufacturing.

Some examples of machine learning applications

Here are some examples of machine learning applications:

* Facial recognition, used to unlock mobile phones, access computer systems, and identify people in images.
* Speech recognition, used to control electronic devices, translate languages, and answer questions.
* Image classification, used to organize images into categories, such as landscapes, animals, or people.
* Sales forecasting, used by businesses to forecast demand for products and services.
* Drone control, used to fly drones safely and efficiently.

Machine learning is a powerful technology that has the potential to improve our lives in many ways.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
layout: post
lang: en
title: "Generic visit algorithm for a tree"
excerpt: ""
category: data-structures-and-algorithms
date: 2014-10-10 22:45:33
tags: [English,"Data Structures","Algorithms"]
comments: true
share: true
---

One of the most common tasks to be performed on a tree is to perform a visit to it, i.e. to review each of its nodes. By the natural language term 'reviewing' we mean 'applying some function' to the node under examination, even if it is simply printing on the screen that it has been visited.

The most generic possible visiting procedure can be seen in the pseudocode algorithm below

```
proc generic_tree_visit(node r)
S ← { r }
while S ≠ ∅ do
u ← get node from S
visit(u)
S ← S ∪ { children of u}
od
end proc
```

the algorithm keeps instant by instant in `S` the nodes representing the branch points left over and from which the visit must continue, we say that these nodes are open and form a fringe of the tree, a node becomes closed when it is removed from `S`.

Concerning costs in terms of space occupied in memory and time for execution we have the following theorem.

Theorem: The generic visiting algorithm applied to the root of a tree with n n nodes terminates in `O(n)` iterations, and the space used is `O(n)`.

This is self-evident in itself and is formally provable. Demonstrating it is beyond the scope of this post, which is only to lay the foundations for subsequent posts which explore the theoretical and practical aspects in more detail.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
layout: post
lang: en
title: "DFS o Depth First Search"
excerpt: ""
category: data-structures-and-algorithms
date: 2014-10-12 22:45:33
tags: [English,"Data Structures","Algorithms"]
comments: true
share: true
---



Starting from the generic algorithm shown and using a Stack/Stack to represent `S`, we obtain the depth first search (or DFS)

```
procedure DFS(node r)
Stack S
S.push(r)
while not S.isEmpty() do
u ← S.pop()
if u ≠ null then
visit(u)
S.push(right_child_of(u))
S.push(left_child_of(u))
fi
od
end
```

in a visit in depth we continue the visit from the last node left over
since we stack first the right-hand child of each node and then the left-hand child we tend to follow all the left-hand children going deep until the first left-hand leaf is reached in general we will only visit each right-hand subtree in a node when the left-hand subtree has been visited altogether


By reversing the order in which we add the children we have the symmetrical variant

The recursive deep-visit version shown below is much more elegant:
the stack does not appear explicitly in the algorithm as it is the stack of records for activating recursive calls to keep nodes open.

There are the obvious variations if we alter the order of the visit and child addition instructions in the S-stack.
* preorder visit = we visit the root first then left child and then right child
* symmetrical visit = left first,then root and then right
* visit in post order = first left,then right and finally root

```
-- DFS recursive visit
procedure DFS(node r)
if r = null then return
visit(u)
DFS(left_child_of(r))
DFS(right_child_of(r))
end
```
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
layout: post
lang: it
title: "Algoritmo di visita in ampiezza per un albero (BFS o Breadth First Search)"
lang: en
title: "BFS Breadth First Search"
excerpt: ""
category: "Computer Science"
category: data-structures-and-algorithms
date: 2014-10-14 22:45:33
tags: [Italian,"Data Structures","Algorithms"]
tags: [English,"Algorithms"]
comments: true
share: true
---

> "PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals."
(Jon Ribbens)

Partiamo dal algoritmo di generico di visita e usando una coda per rappresentare `S` otteniamo visita in ampiezza (Breadth First Search o BFS).
We start with the generic visitation algorithm and using a queue to represent `S` we obtain breadth-first visitation (Breadth First Search or BFS).

I nodi vengono visitati per livelli,prima radice,poi figli della radice,poi i figli dei figli.
Nodes are visited by levels, first root, then children of the root, then children of the children.

```java
proc BFS(nodo r)
```
proc BFS(node r)
Queue C
C.enqueue(r)
while not C.isEmpty() do
Expand All @@ -29,5 +29,5 @@ proc BFS(nodo r)
C.enqueue(right_child_of(u))
fi
od
endproc
```
end proc
```
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ date: 2011-02-03 22:45:33
tags: [English,MySQL]
comments: true
share: true
permalink: /databases/mysql/2
---
We download the tar.gz from the mysql site www.mysql.com
place it in /usr/local unpack the tar.gz with the command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ modified: 2017-05-03 22:45:33
tags: [English,MySQL]
comments: true
share: true
permalink: /databases/mysql/3
---
Well, you probably have different collations in some mysql views, try to force collation like this
```sql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ layout: post
lang: en
title: "The Data Model Resource Book Vol 1 & 2"
excerpt: "About the series book..."
category: data-science
category: data-engineering
date: 2023-05-06 05:11:55
modified: 2023-05-13 05:11:55
tags: [English,"Data Science","Data Engineering"]
tags: [English,"Data Engineering"]
comments: true
share: true
updated: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
layout: post
lang: en
title: "Common errors when configuring Adobe PDF iFilter for SharePoint 2007"
excerpt: ""
category: information-systems
date: 2011-04-04 22:45:33
tags: [English,SharePoint]
comments: true
share: true
---
A common mistake you can run into when installing iFilter for SharePoint 2007 is forgetting to replace the value of the key

```
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office
server\12.0\Search\Setup\ContentIndexCommon\Filters\Extension\.pdf`
```

with the new value for iFilter, for iFilter 9 platform 64 bit and SharePoint 2007 the value to set is


`{E8978DA6-047F-4E3D-9C78-CDBE46041603}`
Another error or problem is that the `PDFFilter.dll` DLL is not registered correctly.
in which case a check can be performed and the problem rectified using `regedt32.exe`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: post
lang: en
title: "Considerations on recursion"
excerpt: ""
category: programming-languages
date: 2014-08-14 22:45:33
tags: [English]
comments: true
share: true
---


In programming languages, the repetition of commands or statements is achieved by loops, usually realised with constructs such as `for`, `foreach` and `white`. For particular problems, recursion is a valid alternative, more elegant, natural and simple to implement.
We have recursion when a function (in Java a method) calls itself.
A classical example of recursion is the factorial function: given a number n we denote by `n!` the result of the product of all the integers from `1` to `n`, by convention the factorial of `0`, i.e. the `0!` is equal to `1`.

The factorial can be calculated recursively by observing that `!n = n * !(n-1)`.
A possible implementation in Java is

```java
public static int factorial(int n){
if(n==0) return 1;
else return n*factorial(n-1);
}
```

By using the recursive definition of a problem and implementing it via recursive method calls, we can avoid complex analyses and the use of nested loops. In other words, we do not necessarily give up efficiency and achieve more readable and compact code.

There are three forms of recursion

1. linear
2. binary
3. multiple

The simplest is linear, an example of which we have just seen: the factorial calculation. From the point of view of definition, we can say that we are in the presence of linear recursion when recursive methods are defined in such a way as to make at most one recursive call each time they are called.

In other words, and more formally, when we have schemes of this type.

```java
int m(int i){
if(g(i) return x;
return m(f(i) + y;
}
```
A further example of linear recursion is the sum of elements of a list

```java
int sum(int[] a,n){
if(n=1) return a[0];
else sum(a,n-1) + a[n-1]
}
```

The inversion of an array, or rather the order of its elements

```java
void reverse(int[] a,i,j){
if(i<j) {
swap(a[i],a[j]);
reverse(a,i+1,j-1);
}
return;
}
```The reverse method makes use of linear recursion and makes use of tail recursion, i.e. the recursive call is the last operation performed by the method.

Binary recursion occurs when two recursive calls are made. A classic example is the Fibonacci sequence.

```java
f[0] = 0
f[1] = 1
f[i] = f[i-1] + f[i-2] (per ogni i>1)
```

An example implementation in Java is as follows

```java
int fibonacci(int k){
if(k<=1) return k;
else return fibonacci(k-1) + fibonacci(k-2);
}
```
Finally, multiple recursion is but a generalisation of binary recursion, in that it is defined as such when more than two recursive calls are made.

On several occasions during my career I have heard recursion spoken of as and worse than the devil, something extremely complex and dangerous, but the worst damage I have personally seen caused by iterative methods with half a dozen nested loops and guard conditions in while constructs so complex as to be incomprehensible, let alone debuggable.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
layout: post
lang: en
title: "Alphabets, Symbols, Strings and Languages"
excerpt: "What are alphabets, symbols and strings from the point of view of theoretical computer science"
category: theoretical-computer-science
date: 2018-03-20 22:45:33
tags: [English,"Programming Languages","Computer Science"]
comments: true
share: true
---

> Kleeneliness is next to Gödeliness
What is meant by the term `alphabet` in theoretical computer science?
Simply a set of objects that we call `symbols`. The set must be finite and non-empty.
To indicate an alphabet, we commonly use the capital Greek letters sigma &Sigma;.

In other words, beginning to use some mathematical formalism, we have that &Sigma; &ne; &empty;

An example of an alphabet for binary numbers is &Sigma; = {0,1} , the lower case Greek letter sigma &sigma; is commonly used to indicate generic symbols, with a numeric index if necessary.

We could then represent a 3-symbol alphabet with &Sigma; = {&sigma;0,&sigma;1,&sigma;2} and say that &sigma;0 is a &sigma;1 is b and &sigma;1 is c, hence that &Sigma; = {a,b,c}.

We can write that &sigma;&isin; &Sigma; to indicate that a given symbol &sigma; belongs to the alphabet &Sigma;. Alphabets are sets so we can use all the mathematics pertaining to sets, making our lives easier.

So what are strings? A succession of symbols? Informally we can say that strings are actually a succession of symbols taken from a given alphabet, for example the string '010' representing the binary number 010 is a string on the alphabet &Sigma; = {0,1}.

The lower case Latin letters u,v,w are usually used to indicate generic strings.

Mathematically speaking, a string u on an &Sigma; alphabet is a total function with domain [1,n] and codomain &Sigma; given a certain n, where n is then the length of our string u.

Hence, u:[1,n]->&Sigma; and for example in the case of u = '010' we have that u(1)=0,u(2)=1,u(3)=0 where u(i) is the symbol at position i(-th) of the string u.

Definitely familiar, isn't it? If we think of character arrays, u is our array containing a string and the index identifies the symbol or character we are interested in. This should remind us that computer science is mathematics and how important the latter is.

Returning to the concept of string, there is a special one, the meaning of which will not appear immediately clear nor of any use, but which will play a crucial role later on, its name is string vuolta and commonly in texts it is represented by the lower case Greek letter epsilon &epsilon; and sometimes by the upper case Greek letter lambda &Lambda;.

Its characteristic is that it has length zero, i.e. if u is a string and in particular is the empty string, we have \|u| = 0 where the vertical bars (the pipes) on either side of the letter indicate the length of the argument, thus \|&epsilon;\|=0 or if you prefer the other representation \|&Lambda;\|=0.

If we wanted to represent all possible strings on a given alphabet &Sigma; we could use the &Sigma;* representation where the asterisk is placed at the same height as an exponent. &Sigma;* is more than just a representation, it represents an operation.

For now, we are content to know that if &Sigma;= {0,1} which is by definition a finite set, then &Sigma; * is a set with an infinite number of elements, i.e. all the strings that I can construct with the symbols of the alphabet &Sigma; therefore &Sigma; * = {0,1,01,11,10,001,00001,...} where the three dots ... indicate that one can continue indefinitely by generating strings of arbitrary length.

The concept of &Sigma; * or of the set of strings on &Sigma; allows us to take a further step forward and be able to define something whose concept is more familiar to us in our everyday professional (programmer) life, namely the concept of a language on a certain alphabet, commonly a language is indicated by the capital letter L, and contrary to what happens for &Sigma; * , L is not an infinite set, since it is a subset of &Sigma; * , formally L &sub; &Sigma; * , referring to the example seen above for binary numbers we could define a language for binary numbers of strings of length 2 and in this case our L would be the subset of &Sigma;* composed of the strings {00,01,10,11}.

For purely mathematical reasons, we have that both the empty set and the set consisting of the only element of the empty string (i.e. the singleton) are languages on any alphabet.

An interesting aspect is the possibility of modelling as mathematical objects even operations that we can commonly do on strings, such as concatenation.

In addition to the operations that we can do on strings, there are similar operations on languages. Of particular interest are the closure operations or closures, the positive closure represented by a + sign at the exponent L+ and the Kleene closure represented by the asterisk symbol L * . Informally the former is the union of all languages of length 1 to n, the latter of all languages of length 0 to n, so it also includes the string of length 0.

If you want to learn something Stephen Cole Kleene you can go to

1. [https://it.wikipedia.org/wiki/Stephen_Kleene](https://it.wikipedia.org/wiki/Stephen_Kleene)
2. [https://en.wikipedia.org/wiki/Stephen_Cole_Kleene](https://en.wikipedia.org/wiki/Stephen_Cole_Kleene)
Loading

0 comments on commit f9006b8

Please sign in to comment.