Profile

Cover photo
apostolis ntokos
Lived in athens
19 followers|10,142 views
AboutPostsPhotosVideos

Stream

apostolis ntokos

Shared publicly  - 
 
Reduction from SAT to Clique (proving NP-complete)
SAT problem description: Assume a boolean expression in CNF (conjuctive normal form). The question for this decision problem is, can you set the variables to a combination of TRUE/FALSE so that the boolean expression becomes true. (Using the laws of Boolean...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Ordered Dictionary Python
In this post, we are going to examine python's dictionaries. A python dictionary has the following form: my_dict = { 'anna' : 3 , 'george' : 6 , 'john' : 2 , 'tomas' : 5 } If we print my_dict the output is going to be:  {'tomas': 5, 'john': 2, 'george': 6, ...
In this post, we are going to examine python's dictionaries. A python dictionary has the following form: my_dict = {'anna': 3, 'george': 6, 'john': 2, 'tomas': 5} If we print my_dict the output is going to be:  {'tomas': 5,...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Python execute Linux commands
Executing Linux shell commands using Python In this post, we are going to execute linux shell commands in a python script using subprocess module. Example 1) import subprocess

p = subprocess.Popen( "ls /" , stdout =subprocess.PIPE, shell = True )
(output, ...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Socket programming python
Socket programming 'means' server-client model                             SERVER - CLIENT  So,we have to two python script. One for the server and one for the client. For the server: from socket import *

HOST = '' #localhost / 192.168.1.1 # LAN - 192.168...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Python script in php code
Αρχικά δημιουργούμε ένα αρχείο php και το ονομάζουμε test.php . To αρχείο έχει την παρακάτω μορφή: <?php $python = `python hello.py`; echo $python; ?> Βλέπουμε οτι υπάρχει μία μεταβλητή $python στην οποία ουσιαστικά αποθηκεύεται το αποτέλεσμα του αρχείου he...
 ·  Translate
1
Add a comment...
In his circles
55 people
Have him in circles
19 people
Kostas Livieratos's profile photo
Anna Koukio's profile photo
Stella Rouzi Differentreality's profile photo
Marcel Kühlhorn's profile photo
ANNA TRIANTAFYLLOPOYLOY's profile photo
George Bratsos's profile photo
Theodosis Ghikas's profile photo
daniel ioannou's profile photo
Sophie A's profile photo

apostolis ntokos

Shared publicly  - 
 
 
Vertex Cover (python implementation)
MINIMUM VERTEX-COVER Description Formally, a vertex-cover of an undirected graph   is a subset  V′  of  V  such that if edge  (u, v)  is an edge of  G , then  u  is in  V′ , or  v  is in  V′ , or both. The set  V′  is said to "cover" the edges of  G . The f...
MINIMUM VERTEX-COVER Description Formally, a vertex-cover of an undirected graph  is a subset V′ of V such that if edge (u, v) is an edge of G, then u is in V′, or v is in V′, or both. The set V′ is said to "cover" the edge...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
cProfile python
Python includes a profiler called cProfile. It not only gives the total running time, but also times each function separately, and tells you how many times each function was called, making it easy to determine where you should make optimizations. For exampl...
Python includes a profiler called cProfile. It not only gives the total running time, but also times each function separately, and tells you how many times each function was called, making it easy to determine where you shoul...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Unittest Python
UNITTEST PYTHON   In computer programming, unit testing is a software testing method by which individual units of source code,
sets of one or more computer program modules together with associated
control data, usage procedures, and operating procedures, ...
UNITTEST PYTHON  In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage proced...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
IP scanning python
In order to find the IPs using python, we are going to install nmap module. You can installing it, by typing in the terminal the following command : sudo apt-get install python-nmap ip_scan.py import nmap

nm = nmap.PortScanner()
cidr2 = '192.168.1.99/24' ...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
Find all .txt files
In this post, you are going to see how to find all .txt files in your computer using python's os module. You can see the code below: import os def find_all_txtfiles(): for root, dirs, files in os.walk( "/" ): for file in files: if file.endswith( ".txt" ): p...
1
Add a comment...

apostolis ntokos

Shared publicly  - 
 
**
Ειναι σημαντικο όταν προσπαθεί κανείς να λύσει ένα προγραμματιστικό πρόβλημα (ή και γενικότερα ένα προβλημα), να μπορεί να το διασπάσει σε υποπροβλήματα, φτάνοντας στην υλοποίηση του, υλοποιώντας τα επιμέρους αυτα υποπροβλήματα. Ας πάρουμε για παράδειγμα το...
 ·  Translate
Ειναι σημαντικο όταν προσπαθεί κανείς να λύσει ένα προγραμματιστικό πρόβλημα (ή και γενικότερα ένα προβλημα), να μπορεί να το διασπάσει σε υποπροβλήματα, φτάνοντας στην υλοποίηση του, υλοποιώντας τα επιμέρους αυτα υποπροβλήμα...
1
Add a comment...
People
In his circles
55 people
Have him in circles
19 people
Kostas Livieratos's profile photo
Anna Koukio's profile photo
Stella Rouzi Differentreality's profile photo
Marcel Kühlhorn's profile photo
ANNA TRIANTAFYLLOPOYLOY's profile photo
George Bratsos's profile photo
Theodosis Ghikas's profile photo
daniel ioannou's profile photo
Sophie A's profile photo
Work
Occupation
Student at university of pireus (computer science)
Skills
Theoretical computer science, python, Linux, discrete mathematics
Basic Information
Gender
Male
Story
Bragging rights
IEEE computer science member
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Previously
athens
Links