A simple introduction to the Python programming language. In Italian. OLD: superseeded by Pycrashcourse 3.1.
Originally presented during the Networking class of the Computer Science course at the University of Parma
A simple introduction to the Python programming language. In Italian. OLD: superseeded by Pycrashcourse 3.1.
Originally presented during the Networking class of the Computer Science course at the University of Parma
A simple introduction to the Python programming language. In Italian. OLD: superseeded by Pycrashcourse 3.1.
Originally part 1 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
2. Il problema della gestione delle dipendenze affligge da tempo qualsiasi sviluppatore che non voglia reinventare la ruota. Questo problema può essere affrontato da due punti di vista: quello dello sviluppatore che ha bisogno di usare una libreria e quello dello sviluppatore che ha creato la propria libreria e vuole distribuirla
3. Una prima possibile soluzione al problema è: scaricare i sorgenti della libreria e installarli a mano. Questa soluzione ovviamente è molto scomoda e ha molti difetti: difficoltà di manutenzione, difficoltà di replicazione, difficoltà o impossibilità di versionamento. È stata mostrata solo per motivi "storici"
4. PEAR è stato per molto tempo lo standard de facto per la gestione delle librerie. Il suo problema principale era nella necessità di dover installare le librerie a livello di sistema, mentre spesso è necessario gestire versioni diverse su progetti diversi. Un altro problema è che è rimasto poco sviluppato e ancorato alla compatibilità con PHP4
5. Un altra possibile soluzione è la gestione delle dipendenze nel sistema di versioanmento: externals per subversion, submoduli per git, eccetera. Difetti di questo approccio: lo sviluppatore di librerie dovrebbe tenere un repository per ogni sistema, l'utilizzatore è costretto a gestire in contemporanea aggiornamenti delle revisioni del suo progetto e aggiornamenti delle librerie
6. Un approccio più recente e interessante è stato quello adottato da Symfony 2.0, cioè uno script di gestione scritto ad hoc. Purtroppo non era in grado di gestire le dipendenze indirette ed era legato strettamente a git
8. Il primo passo per usare Composer è installarlo. La procedura è molto semplice, trattandosi di uno script PHP da linea di comando: basta scaricare l'installer ed eseguirlo. Non obbligatorio, ma consigliato, spostare l'eseguibile sotto a un percorso incluso in $PATH. Pper sistemi non Unix-compatibili... non lo so! Arrangiatevi
9. L'installazione delle librerie è facile: basta eseguire il comando seguito dal parametro "install". Occorre però preparare un file di configurazione
10. Questo esempio di file di configurazione di Composer è tratto da Symfony Standard Edition, con alcune righe tagliate per questioni di spazio.
11. Vediamo ora un esempio su come pubblicare la propria libreria, tratta da un caso reale; un bundle per Symfony2 creato sotto PUGX. Il primo passo è quello di pubblicare il progetto su github
12. Questo è il file composer.json del bundle, con le sue dipendenze e le impostazioni per l'autoloading
13. Il passo successivo consiste nel pubblicare la libreria su Packagist, configurando le impostazioni relative all'integrazione con github
14. Tutto qui! Come direbbe il Principe, è fatta! Non serve niente di più di questo, è molto facile e consente di gestire dipendenze a cascata.
15. Ma se io avessi l'esigenza di usare una libreria che non è open source e quindi non posso mettere su github? Si possono impostare altri reposi
Simple presentation on Twisted fundamentals.
Originally part 4 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
The document summarizes key concepts in social network analysis including metrics like degree distribution, path lengths, transitivity, and clustering coefficients. It also discusses models of network growth and structure like random graphs, small-world networks, and preferential attachment. Computational aspects of analyzing large networks like calculating shortest paths and the diameter are also covered.
This document discusses interoperability between Clojure and Python. It outlines Jython, which allows Python code to run on the Java Virtual Machine (JVM), and Clojure, a Lisp dialect that also runs on the JVM. It then covers how Clojure and Jython code can interact and call each other due to both running on the JVM. It provides examples of implementing Python objects in Clojure and calling Jython functions from Clojure.
Game theory is the study of mathematical models of conflict and cooperation between rational decision-makers. It analyzes strategic decision-making through modeling games with several players under conditions of both cooperation and conflict. Game theory looks at solution concepts such as Nash equilibria, which are strategy profiles where each player's strategy is a best response to the other players' strategies. It is used to understand outcomes in strategic interactions in economics, political science, and other fields.
The document discusses properties in Python classes. Properties allow accessing attributes through normal attribute syntax, while allowing custom behavior through getter and setter methods. This avoids directly accessing attributes and allows for validation in setters. Properties are defined using the @property and @setter decorators, providing a cleaner syntax than regular getter/setter methods. They behave like regular attributes but allow underlying method calls.
- O documento discute redes sociais e sistemas complexos, incluindo análise de redes sociais, ferramentas como NodeXL e Gephi, métricas de redes, detecção de comunidades, e sistemas complexos emergentes em redes.
Object Oriented programming in Python.
Originally part 3 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
The document discusses concepts in social network analysis including measuring networks through embedding measures and positions/roles of nodes. It covers network measures such as reciprocity, transitivity, clustering, density, and the E-I index. It also discusses positions like structural equivalence and regular equivalence and how to compute positional similarity through adjacency matrices.
PyCon APAC 2014 - Social Network Analysis Using Python (David Chiu)David Chiu
This document discusses using Python for social network analysis on Facebook data. It provides examples of:
- Connecting to the Facebook API and obtaining an access token
- Retrieving user and friend data via API calls
- Analyzing likes on posts to determine who likes a user's posts the most
- Performing text mining on post messages using NLTK and Jieba to determine popular topics
- Modeling the friendship network as a graph and using NetworkX and community detection to identify groups within the social network.
Social Network Analysis (SNA) and its implications for knowledge discovery in...ACMBangalore
Social Network Analysis (SNA) and its implications for knowledge discovery in Informal Networks- Talk by Dr Jai Ganesh, SETLabs, Infosys at Search and Social Platforms tutorial, as part of Compute 2009, ACM Bangalore
The document provides an introduction and overview of the Python programming language including:
- Its origins and timeline from 1989 to present.
- How it combines functional, imperative and object-oriented paradigms.
- Details on dynamic vs static typing and how Python interprets source code.
- Benefits of its interactive shell, readability, large standard library and thriving community.
- Common uses like scripting, web development, science/engineering tasks, and jobs that utilize Python skills.
This document discusses social choice theory and group decision making. It covers topics like voting procedures, properties of voting systems, and impossibility theorems. Plurality voting is introduced as the simplest voting method where candidates are ranked first. Condorcet's paradox shows that no voting system can satisfy all voters. Arrow's theorem states that no voting system can satisfy certain desirable and reasonable criteria. Gibbard-Satterthwaite's theorem suggests that any voting system can be manipulated.
Part 1: Concepts and Cases (the language of networks, networks in organizations, case studies and key concepts)
Part 2: (Starts on #44) Mapping Organizational, Personal, and Enterprise Networks: Tools
An update to last year's Social Network Analysis Introduction and Tools...
O documento descreve métricas de análise de redes que podem ser medidas pelo software Gephi. Essas métricas incluem grau médio, diâmetro da rede, e coeficiente de grupalização para caracterizar a rede como um todo ou nós individuais. Algoritmos como PageRank e centralidade eigenvector medem a importância dos nós.
O documento discute representações de redes usando grafos e matrizes de adjacência, e conceitos como grau de conectividade, centralidade por proximidade e intermediação, e transitividade, que medem características estruturais de redes.
An introductory-to-mid level to presentation to complex network analysis: network metrics, analysis of online social networks, approximated algorithms, memorization issues, storage.
A simple introduction to the Python programming language. In Italian. OLD: superseeded by Pycrashcourse 3.1.
Originally part 1 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
2. Il problema della gestione delle dipendenze affligge da tempo qualsiasi sviluppatore che non voglia reinventare la ruota. Questo problema può essere affrontato da due punti di vista: quello dello sviluppatore che ha bisogno di usare una libreria e quello dello sviluppatore che ha creato la propria libreria e vuole distribuirla
3. Una prima possibile soluzione al problema è: scaricare i sorgenti della libreria e installarli a mano. Questa soluzione ovviamente è molto scomoda e ha molti difetti: difficoltà di manutenzione, difficoltà di replicazione, difficoltà o impossibilità di versionamento. È stata mostrata solo per motivi "storici"
4. PEAR è stato per molto tempo lo standard de facto per la gestione delle librerie. Il suo problema principale era nella necessità di dover installare le librerie a livello di sistema, mentre spesso è necessario gestire versioni diverse su progetti diversi. Un altro problema è che è rimasto poco sviluppato e ancorato alla compatibilità con PHP4
5. Un altra possibile soluzione è la gestione delle dipendenze nel sistema di versioanmento: externals per subversion, submoduli per git, eccetera. Difetti di questo approccio: lo sviluppatore di librerie dovrebbe tenere un repository per ogni sistema, l'utilizzatore è costretto a gestire in contemporanea aggiornamenti delle revisioni del suo progetto e aggiornamenti delle librerie
6. Un approccio più recente e interessante è stato quello adottato da Symfony 2.0, cioè uno script di gestione scritto ad hoc. Purtroppo non era in grado di gestire le dipendenze indirette ed era legato strettamente a git
8. Il primo passo per usare Composer è installarlo. La procedura è molto semplice, trattandosi di uno script PHP da linea di comando: basta scaricare l'installer ed eseguirlo. Non obbligatorio, ma consigliato, spostare l'eseguibile sotto a un percorso incluso in $PATH. Pper sistemi non Unix-compatibili... non lo so! Arrangiatevi
9. L'installazione delle librerie è facile: basta eseguire il comando seguito dal parametro "install". Occorre però preparare un file di configurazione
10. Questo esempio di file di configurazione di Composer è tratto da Symfony Standard Edition, con alcune righe tagliate per questioni di spazio.
11. Vediamo ora un esempio su come pubblicare la propria libreria, tratta da un caso reale; un bundle per Symfony2 creato sotto PUGX. Il primo passo è quello di pubblicare il progetto su github
12. Questo è il file composer.json del bundle, con le sue dipendenze e le impostazioni per l'autoloading
13. Il passo successivo consiste nel pubblicare la libreria su Packagist, configurando le impostazioni relative all'integrazione con github
14. Tutto qui! Come direbbe il Principe, è fatta! Non serve niente di più di questo, è molto facile e consente di gestire dipendenze a cascata.
15. Ma se io avessi l'esigenza di usare una libreria che non è open source e quindi non posso mettere su github? Si possono impostare altri reposi
Simple presentation on Twisted fundamentals.
Originally part 4 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
The document summarizes key concepts in social network analysis including metrics like degree distribution, path lengths, transitivity, and clustering coefficients. It also discusses models of network growth and structure like random graphs, small-world networks, and preferential attachment. Computational aspects of analyzing large networks like calculating shortest paths and the diameter are also covered.
This document discusses interoperability between Clojure and Python. It outlines Jython, which allows Python code to run on the Java Virtual Machine (JVM), and Clojure, a Lisp dialect that also runs on the JVM. It then covers how Clojure and Jython code can interact and call each other due to both running on the JVM. It provides examples of implementing Python objects in Clojure and calling Jython functions from Clojure.
Game theory is the study of mathematical models of conflict and cooperation between rational decision-makers. It analyzes strategic decision-making through modeling games with several players under conditions of both cooperation and conflict. Game theory looks at solution concepts such as Nash equilibria, which are strategy profiles where each player's strategy is a best response to the other players' strategies. It is used to understand outcomes in strategic interactions in economics, political science, and other fields.
The document discusses properties in Python classes. Properties allow accessing attributes through normal attribute syntax, while allowing custom behavior through getter and setter methods. This avoids directly accessing attributes and allows for validation in setters. Properties are defined using the @property and @setter decorators, providing a cleaner syntax than regular getter/setter methods. They behave like regular attributes but allow underlying method calls.
- O documento discute redes sociais e sistemas complexos, incluindo análise de redes sociais, ferramentas como NodeXL e Gephi, métricas de redes, detecção de comunidades, e sistemas complexos emergentes em redes.
Object Oriented programming in Python.
Originally part 3 of a 4 lectures seminar for the Networking class of the Computer Science course at the University of Parma
The document discusses concepts in social network analysis including measuring networks through embedding measures and positions/roles of nodes. It covers network measures such as reciprocity, transitivity, clustering, density, and the E-I index. It also discusses positions like structural equivalence and regular equivalence and how to compute positional similarity through adjacency matrices.
PyCon APAC 2014 - Social Network Analysis Using Python (David Chiu)David Chiu
This document discusses using Python for social network analysis on Facebook data. It provides examples of:
- Connecting to the Facebook API and obtaining an access token
- Retrieving user and friend data via API calls
- Analyzing likes on posts to determine who likes a user's posts the most
- Performing text mining on post messages using NLTK and Jieba to determine popular topics
- Modeling the friendship network as a graph and using NetworkX and community detection to identify groups within the social network.
Social Network Analysis (SNA) and its implications for knowledge discovery in...ACMBangalore
Social Network Analysis (SNA) and its implications for knowledge discovery in Informal Networks- Talk by Dr Jai Ganesh, SETLabs, Infosys at Search and Social Platforms tutorial, as part of Compute 2009, ACM Bangalore
The document provides an introduction and overview of the Python programming language including:
- Its origins and timeline from 1989 to present.
- How it combines functional, imperative and object-oriented paradigms.
- Details on dynamic vs static typing and how Python interprets source code.
- Benefits of its interactive shell, readability, large standard library and thriving community.
- Common uses like scripting, web development, science/engineering tasks, and jobs that utilize Python skills.
This document discusses social choice theory and group decision making. It covers topics like voting procedures, properties of voting systems, and impossibility theorems. Plurality voting is introduced as the simplest voting method where candidates are ranked first. Condorcet's paradox shows that no voting system can satisfy all voters. Arrow's theorem states that no voting system can satisfy certain desirable and reasonable criteria. Gibbard-Satterthwaite's theorem suggests that any voting system can be manipulated.
Part 1: Concepts and Cases (the language of networks, networks in organizations, case studies and key concepts)
Part 2: (Starts on #44) Mapping Organizational, Personal, and Enterprise Networks: Tools
An update to last year's Social Network Analysis Introduction and Tools...
O documento descreve métricas de análise de redes que podem ser medidas pelo software Gephi. Essas métricas incluem grau médio, diâmetro da rede, e coeficiente de grupalização para caracterizar a rede como um todo ou nós individuais. Algoritmos como PageRank e centralidade eigenvector medem a importância dos nós.
O documento discute representações de redes usando grafos e matrizes de adjacência, e conceitos como grau de conectividade, centralidade por proximidade e intermediação, e transitividade, que medem características estruturais de redes.
An introductory-to-mid level to presentation to complex network analysis: network metrics, analysis of online social networks, approximated algorithms, memorization issues, storage.
Introdução à Teoria dos Grafos e Análise de Redes Sociaisfabiomalini
O documento apresenta um curso sobre extração, mineração e visualização de controvérsias em redes sociais. O curso objetiva capacitar os participantes no uso de ferramentas para análise de redes sociais, compreender termos e métricas básicas e realizar atividade prática analisando um caso sobre o Marco Civil da Internet no Twitter.
The document discusses exploratory social network analysis using Pajek software. It covers network fundamentals like defining networks, manipulating them, determining structural features, and visual inspection. Various network analysis concepts are explained such as cohesion, attributes, relations, sentiments, affiliations, and partitioning networks. Examples and applications are provided to demonstrate different network analysis techniques in Pajek.
This document discusses social network analysis and its applications. It defines a social network as being composed of actors (people or groups) connected by social relationships. Social network analysis can be used to map these relationships visually using sociograms, understand information flow and community structure, and identify influential actors through metrics like centrality and betweenness. Tools like NodeXL and Gephi enable network extraction, visualization, and analysis to glean strategic insights from social networks.
co-authors: Scola Davide and Maia Nicoletta
Small workshop on Inferno, Limbo and the Dis virtual machine.
Inferno is a new operative system developped for creation and support of network systems and distribuited services.
There are three fundamental programming principles: all resources are files in a hierarchic file system, the network is a unic namespace like a file system hierarchic, it uses Styx that is a standard protocol of comunication for local and remote resources.
Limbo is the programming language for the Inferno OS.
The language is Object Based, you can compile it or interpret it with the Dis virtual machine (like Java virtual machine with a JIT compiler).
Limbo has a native support for: array, string, int, float, tuple (like record), channel (linda-like), and other...
The Limbo's channels are used to comunicate with other processes or with thread.
The Dis virtual machine is an environment for Limbo programs and it has important features: CISC architecture, memory-to-memory, many high level types, just in time compiler, ecc...
In the end of presentation there is a comparison between Dis, Java VM and C# .Net VM.
Oggi possiamo finalmente lasciarci alle spalle l’idea di dover utilizzare PHP per lo sviluppo web. Durante la presentazione verrà spiegato un semplice workflow che utilizzo per lavorare con Python, Flask, SQLite, Apache e Git per ridurre i bug, semplificare il codice e ottimizzare i tempi di deployment.
Questo intervento ha fatto parte del Linux Day 2017.
Il video è disponibile qui: https://youtu.be/0Rwd75iHZN4
Queste slide dal titolo provocatorio cercano di dare l'idea che la stupidità e la pigrizia possono avere un effetto positivo nela programmazione per la ricerca di soluzioni semplici. Nello specifico caso parliamo di funzioni in C
[Luca Cracco] - DevOps: strumenti di automazione per Drupal8Wellnet srl
Spesso durante lo sviluppo e la manutenzione di un progetto siamo costretti a svolgere attività ripetitive o noiose (dall’esecuzione di un task alla replicazione e aggiornamento del sistema). Per risolvere alcuni di questi problemi proveremo ad usare Zaratan, un comodo strumento basato su Docker per installare tutte le componenti necessarie al funzionamento di Drupal, e Robo, un task runner scritto in PHP in grado di eseguire sia comandi Drush che azioni sul filesystem, sul database, ecc...
2. Outline 2
Very (very )* short introduction to Python
Some small examples
Evolutionary game
3. Parlando del
futuro... 3
We will perhaps eventually be
writing only small modules that are
identified by name as they are
used to build larger ones, so that
devices like indentation, rather than
delimiters, might become feasible
for expressing local structure in the
source language.
Donald E. Knuth, Structured
Programming with go to
Statements, 1974
4. Introduzione 4
Python è concepito da Guido van Rossum alla fine
degli anni ‘80 per Amoeba
Pubblico 1991, stabile 1994.
Linguaggio di alto livello ed orientato agli oggetti.
Utilizzato per programmazione di sistema e di rete, e
calcolo scientifico, applicazioni desktop, integrazione di
videogiochi, MMORPG backend, ...
Si impone in ambito web/enterprise, con soluzioni
come Zope/Plone, Django,Twisted, GAE, OpenERP.
6. Oggetti in Python 6
In Python tutto è un oggetto:
Un numero, una stringa sono oggetti
Gli oggetti sono oggetti (ehm...)
Una funzione è un oggetto
Una classe è un oggetto
Gli oggetti sono cittadini di prima classe,
possiamo manipolarli riccamente e
comodamente (introspezione, etc.)
Possiamo fare, in definitiva, tutto
7. Tipizzazione in Python 7
Python è un linguaggio ad oggetti a tipizzazione
dinamica e forte
Tipizzazione forte:
Gli errori di tipo sono sempre generati. Es. Stringhe
non diventano interi e viceversa
Ogni oggetto ha una classe, questa non cambia
Tipizzazione dinamica
Gli errori di tipo sono generati a runtime
Duck typing
9. Dettagli implementativi 9
$ cat hello.py
Tipicamente Python viene
#!/usr/bin/python
compilato a byte-code e
questo viene interpretato da print "Hello, world!"
una macchina virtuale (come
$ python hello.py
Java) Hello, world!
Diversamente da Java la $ chmod 755 hello.py
$ ./hello.py
compilazione è trasparente Hello, world!
per l’utente $ python
Python 2.5.1 (...)
Possiamo anche usare ...
l’interprete interattivo >>> print "Hello, world"
Hello, world
10. Interprete interattivo 10
L’interprete interattivo ufficiale ha
>>> import os
come prompt >>> >>> print “foo”
foo
Scriviamo comandi (statements) >>> os.getcwd()
“/Users/enric/pycourse”
che vengono byte-compilati ed >>> import sys
eseguiti >>> sys.stdout.write(“ciaon”)
ciao
Se il comando valuta in un >>> def f(a):
... sys.stdout.write(a)
espressione (es. un expression ... return a
...
statement), l’espressione viene >>> f(“ciaon”)
stampata ciao
“ciaon”
11. Esempio 01:
System Scripting 11
import os
import shutil
for fname in os.listdir(os.getcwd()):
if fname.endswith(('pyc', 'pyo')):
os.remove(fname)
elif fname.endswith('py'):
shutil.copy(fname, fname + '.bak')
12. Esempio 2:
“semplice wget” (GvR) 12
import sys
import urllib
import os
def hook(*a):
print '%s: %s' % (fn, a)
for url in sys.argv[1:]:
fn = os.path.basename(url)
print url, "->", fn
urllib.urlretrieve(url, fn, hook)