-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
367 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
...science/artificial-intelligence/machine-learning/2023-09-23-machine-learning.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
34 changes: 34 additions & 0 deletions
34
...data-structures-and-algorithms/2014-10-10-generic-visit-algorithm-for-a-tree.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
54 changes: 54 additions & 0 deletions
54
...er-science/data-structures-and-algorithms/2014-10-12-depth-first-search-tree.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...1-04-04-common-errors-when-configuring-adobe-pdf-ifilter-for-sharepoint-2007.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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`. |
85 changes: 85 additions & 0 deletions
85
...science/programming-languages/2014-08-14-considerations-related-to-recursion.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
56 changes: 56 additions & 0 deletions
56
.../theoretical-computer-science/2018-03-20-alphabets-symbols-strings-languages.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Σ. | ||
|
||
In other words, beginning to use some mathematical formalism, we have that Σ ≠ ∅ | ||
|
||
An example of an alphabet for binary numbers is Σ = {0,1} , the lower case Greek letter sigma σ is commonly used to indicate generic symbols, with a numeric index if necessary. | ||
|
||
We could then represent a 3-symbol alphabet with Σ = {σ0,σ1,σ2} and say that σ0 is a σ1 is b and σ1 is c, hence that Σ = {a,b,c}. | ||
|
||
We can write that σ∈ Σ to indicate that a given symbol σ belongs to the alphabet Σ. 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 Σ = {0,1}. | ||
|
||
The lower case Latin letters u,v,w are usually used to indicate generic strings. | ||
|
||
Mathematically speaking, a string u on an Σ alphabet is a total function with domain [1,n] and codomain Σ given a certain n, where n is then the length of our string u. | ||
|
||
Hence, u:[1,n]->Σ 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 ε and sometimes by the upper case Greek letter 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 \|ε\|=0 or if you prefer the other representation \|Λ\|=0. | ||
|
||
If we wanted to represent all possible strings on a given alphabet Σ we could use the Σ* representation where the asterisk is placed at the same height as an exponent. Σ* is more than just a representation, it represents an operation. | ||
|
||
For now, we are content to know that if Σ= {0,1} which is by definition a finite set, then Σ * is a set with an infinite number of elements, i.e. all the strings that I can construct with the symbols of the alphabet Σ therefore Σ * = {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 Σ * or of the set of strings on Σ 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 Σ * , L is not an infinite set, since it is a subset of Σ * , formally L ⊂ Σ * , 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 Σ* 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) |
Oops, something went wrong.