Field 1 Field 2
09.24.20 If you imagine a product as the human body, the bones represent the code which give it structure. The organs represent the UX design: measuring and optimizing against input for supporting life functions. And UI design represents the cosmetics of the body; its presentation, its senses and reactions.
[caption id="attachment_1453" align="alignnone" width="900"]Difference between UI & UX Difference between UI & UX[/caption]
09.24.20

Διαλυτικά και τόνος (  ΐ    ΰ ):
Χρησιμοποιείστε το Δεξί Alt + τόνο & γράμμα.

Χαρακτήρας Alt + num Συνδυασμός Σχόλιο
§ Alt 21   Σύμβολο παραγράφου
Alt 0128 Alt Ctrl e (Ελληνικό πληκτρολόγιο)
Alt 0133   Τρεις τελείες
± Alt 0177 Alt Ctrl -  
     
     
     
    Μικρότερο ή ίσον
    Μεγαλύτερο ή ίσον
Alt 0137    
² 0178   Ύψωση στο τετράγωνο
       
³ Alt 0179   Ύψωση στον κύβο
¼ Alt 0188    
½ Alt 0189    
¾ Alt 0190    
Alt 8730   Τετραγωνική ρίζα
Alt 8731    
Alt 8732    
Alt 10003    
Alt 10004    
Alt 10140    

Ο αριθμός πρέπει να δοθεί από το αριθμητικό πληκτρολόγιο. Πρέπει το Num Lock να είναι ενεργοποιημένο.

09.24.20

Έκδοση του Red Hat Linux

cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.8 (Santiago)

Στοιχεία του kernel

uname -a

Linux venus.amsec.gr 2.6.32-642.13.1.el6.x86_64 #1 SMP Wed Nov 23 16:03:01 EST 2016 x86_64 x86_64 x86_64 GNU/Linux

09.24.20
// Fetching MySQL table rows to array: $new_array while($row =mysqli_fetch_array($result, MYSQLI_ASSOC)) { $new_array[] = $row; } // Transposing Array $out = array(); foreach($new_array as $key => $a){ foreach($a as $k => $v){ $out[$k][$key] = $v; } }

PHP Example

$new_array[]=[1,"Jim","Developer"]; $new_array[]=[2,"Nick","Architect"]; $new_array[]=[3,"Stelios","Engineer"]; $new_array[]=[4,"George","IT"]; echo '<table>'; foreach ($new_array as $row) { $cols=sizeof($row); echo '<tr>'; for ($col = 0; $col < $cols; $col++) { echo '<td>' . $row[$col] . '</td>'; } echo '</tr>'; } echo '</table><br>'; $out = array(); foreach($new_array as $key => $a){ foreach($a as $k => $v){ $out[$k][$key] = $v; } } echo '<table>'; foreach ($out as $row) { $cols=sizeof($row); echo '<tr>'; for ($col = 0; $col < $cols; $col++) { echo '<td>' . $row[$col] . '</td>'; } echo '</tr>'; } echo '</table><br>';

Output

Initial table

1JimDeveloper
2NickArchitect
3SteliosEngineer
4GeorgeIT

Transposed table

1234
JimNickSteliosGeorge
DeveloperArchitectEngineerIT
09.24.20

Shape file μέσω ArcGIS

Παράδειγμα από ΕΓΣΑ87 σε WGS84

  • Ελέγχουμε αν το shapefile είναι στο Σύστημα Αναφοράς Greek Grid.

    Τα Shapefiles (μας) προέρχονται από τα Arcinfo Coverages (σε ΕΓΣΑ87) οπότε εμφανίζουν Σύστημα Αναφοράς: User_Defined_Transverse_Mercator. Για να μπορέσει να γίνει σωστά ο μετασχηματισμός θα πρέπει να αποδοθεί στο Σύστημα Αναφοράς Greek Grid.

    Από το ArcToolbox επιλέγουμε Project

    Επιλέγουμε το Shape file (ενδεικτικά στο παράδειγμα line4.shp)

    Αν δούμε Coordinate System: User_Defined_Transverse_Mercator τότε το διορθώνουμε, απλά πληκτρολογώντας τον κωδικό 2100 που είναι το Greek Grid. Αν αντί γιοα Enter πιέσουμε Tab θα μας δείξει το Greek_Grid.

    Σε κάθε περίπτωση αν είναι μέσα στη χαρτοσύνθεση μπορούμε να ελέγξουμε το Σύστημα Αναφοράς:

  • Εφ' όσον όλα είναι εντάξει προχωράμε στον μετασχηματισμό.

    Από το ArcToolbox επιλέγουμε Define Projection

    Επιλέγουμε το Shape file (ενδεικτικά στο παράδειγμα line4.shp)

    Επιβεβαιώνουμε πως είναι στο Σύστημα Αναφοράς Greek Grid

    Ορίζουμε το output Dataset ή Feature Class

    Πληκτρολογούμε τον κωδικό 4326 που είναι το WGS84 (Εναλλακτικά μπορούμε να πληκτρολογήσουμε το 32634 που αντιστοιχεί στο WGS_1984_UTM_Zone_34N.

    Αυτόμαρα θα φορτώσει και τον Γεωγραφικό Μετασχηματισμό GGRS_1987_To_1984.

Σχετικά:

ESPG:2100 GGRS87 / Greek Grid

ESPG:4326 WGS 84 - WGS84 - World Geodetic System 1984, used in GPS

ESPG:32634 WGS 84 / UTM zone 34N

09.24.20

Εφαρμόζουμε την παρακάτω συνάρτηση στο κελί της στήλης D.

=REPT(" ",6-LEN(B2)) &B2 & REPT(" ",6-LEN(C2)) &C2

FTEMME2

09.24.20 Χρησιμεύει για να μεταφέρουμε τα ονόματα των Sheets, ενός Workbook, μέσα σε ένα φύλλο, είτε σε γραμμές είτε σε στήλες. Επιλέγουμε το κελί πάνω στο οποίο θα εφαρμοστεί ο κώδικας. Alt+F11 για να ανοίξουμε τον VBA Editor Insert Module από το Insert Menu Κάνουμε paste τον παρκάτω κώδικα. Τρέχουμε τον κώδικα.

 

Για να γράψει τα ονόματα σε γραμμές:
Sub SheetNames2cellLines() activeCol = ActiveCell.Column activeRow = ActiveCell.Row For i = 1 To Sheets.Count Cells((activeRow - 1) + i, activeCol) = Sheets(i).Name Next i End Sub

 

Για να γράψει τα ονόματα σε στήλες (και να τις κάνει και AutoFit):
Sub SheetNames2cellColumns() activeCol = ActiveCell.Column activeRow = ActiveCell.Row For i = 1 To Sheets.Count Cells(activeRow, (activeCol - 1) + i) = Sheets(i).Name Columns(i + 1).EntireColumn.AutoFit Next i End Sub

Αρχική εικόνα

Μετά την εκτέλεση του κώδικα (και για γραμμές και για στήλες)

09.24.20 Χρησιμεύει για να ορίσουμε τα ονόματα Sheets από επιλεγμένα κελιά (στήλη). Αν δεν υπάρχει το αντίστοιχο πλήθος των sheets, τότε τα δημιουργεί. Αν ένα κελί δεν έχει περιεχόμενο (είναι κενό) τότε θα δώσει αριθμητική τιμή στο όνομα του Sheet (Δείτε 2ο παράδειγμα). Επιλέγουμε τα κελιά πάνω στα οποία θα εφαρμοστεί ο κώδικας. Alt+F11 για να ανοίξουμε τον VBA Editor Insert Module από το Insert Menu Κάνουμε paste τον παρκάτω κώδικα. Τρέχουμε τον κώδικα.
Sub Cells2SheetNames() Dim sheet As Worksheet 'Mark active Sheet. Will Re-Activate ActSheet = ActiveSheet.Name Dim rng As Range Set rng = Selection activeCol = ActiveCell.Column fromRow = rng.Row toRow = rng.Row + rng.Rows.Count - 1 'Start column. May Choose another one cnt = 1 'Calculate the number of sheets required SheetsRequired = (toRow - fromRow) - Sheets.Count + cnt 'Add the required number of Sheets If SheetsRequired > 0 Then Set sheet = ActiveWorkbook.Sheets.Add(After:=ActiveWorkbook.Worksheets(ActiveWorkbook.Worksheets.Count), Count:=SheetsRequired) End If Worksheets(ActSheet).Activate For i = fromRow To toRow If Not IsEmpty(Cells(i, activeCol)) Then Sheets(cnt).Name = Left(Cells(i, activeCol), 31) Else 'Sheets(cnt).Name = "-" + Trim(Str(cnt)) + "-" Sheets(cnt).Name = Trim(Str(cnt)) End If cnt = cnt + 1 Next i End Sub

 

Παράδειγμα 1

Μετά την εκτέλεση του κώδικα

 

Παράδειγμα 2

Μετά την εκτέλεση του κώδικα

09.24.20 Χρησιμεύει για να αυξήσουμε μαζικά και ομοιόμορφα το ύψος των γραμμών ενός spreadsheet, ετσι ώστε να μην "κολλάνε" οι γραμμές μεταξύ τους. Επιλέγουμε τις γραμμές πάνω στις οποίες θα εφαρμοστεί ο κώδικας. Alt+F11 για να ανοίξουμε τον VBA Editor Insert Module από το Insert Menu Κάνουμε paste τον παρκάτω κώδικα. Ορίζουμε την τιμή του N (μπορούμε να την ξανατροποιήσουμε και να ξανατρέξουμε τον κώδικα αν δεν μας ικανοποίησε η αλλαγή) Τρέχουμε τον κώδικα.
Sub ExtendRowHeight() ' Chgange Rows' Height to fit + N ' You can disable AutoFit by commenting the line: Rows(i).AutoFit ' Extra space N = 10 Dim rng As Range Set rng = Selection fromRow = rng.row toRow = rng.row + rng.Rows.Count - 1 For i = fromRow To toRow ' Autofit Line. Set Original required height Rows(i).AutoFit a = Rows(i).rowheight Rows(i).rowheight = a + N Next i End Sub

Αρχική εικόνα

Μετά την αλλαγή τους ύψους των γραμμών

09.24.20

Introduction

Typical usage

<?php
require_once 'Spreadsheet/Excel/Writer.php';

// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();

// sending HTTP headers
$workbook->send('test.xls');

// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');

// The actual data
$worksheet->write(00'Name');
$worksheet->write(01'Age');
$worksheet->write(10'John Smith');
$worksheet->write(1130);
$worksheet->write(20'Johann Schmidt');
$worksheet->write(2131);
$worksheet->write(30'Juan Herrera');
$worksheet->write(3132);

// Let's send the file
$workbook->close();
?>

Installation

Download OLE-1 (required package) from Doqnload OLE-1 to c:\Downloads\pear folder

Download Spreadsheet_Excel_Writer from Spreadsheet_Excel_Writer to c:\Downloads\pear folder

 

If pear fails to install due to Tar.php error, change:

$v_att_list = & func_get_args(); to $v_att_list = func_get_args(); see: pear

 

Install OLE-1 (required package) from cmd window:
pear install c:\Downloads\pear\OLE-1.0.0RC3.tgz

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in PEAR\PackageFile\v2\Validator.php on line 1933 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933 install ok: channel://pear.php.net/OLE-1.0.0RC3

Install Spreadsheet_Excel_Writer from cmd window:

pear install c:\Downloads\pear\Spreadsheet_Excel_Writer-0.9.4.tgz

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in PEAR\PackageFile\v2\Validator.php on line 1933 PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\php\pear\PEAR\PackageFile\v2\Validator.php on line 1933 Package "pear.php.net/Spreadsheet_Excel_Writer" dependency "pear.php.net/OLE" has no releases install ok: channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.4

09.24.20

Περιβάλλον IDLE της python

Μπορεί να ξεκινήσει και μέσα από τηην Python με τις εξείς εντολές:

Python 2

from idlelib.PyShell import main main()

Python 3

from idlelib.pyshell import main main()

09.24.20

A Command line mail program

Windows console utility to send mail via SMTP or post to usenet via NNTP by P.Mendes,M.Neal,G.Vollant,T.Charron,T.Musson,H.Pesonen,A.Donchey,C.Hyde

Blat <filename> -to <recipient> [optional switches (see below)] Blat -SaveSettings -f <sender email addy> -server <server addr> [-port <port>] [-try <try>] [-profile <profile>] [-u <login id>] [-pw <password>] or Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q] Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q] Blat -h

Installation

-SaveSettings : store common settings to the Windows Registry. Takes the same parameters as -install, and is only for SMTP settings. -install[SMTP|NNTP|POP3|IMAP] <server addr> <sender email addr> [<try n times> [<port> [<profile> [<username> [<password>]]]]] : set server, sender, number of tries and port for profile (<try n times> and <port> may be replaced by '-') port defaults are SMTP=25, NNTP=119, POP3=110, IMAP=143 default profile can be specified with a '-' username and/or password may be stored to the registry order of options is specific use -installNNTP for storing NNTP information use -installPOP3 for storing POP3 information (sender and try are ignored, use '-' in place of these) use -installIMAP for storing IMAP information (sender and try are ignored, use '-' in place of these)

The Basics

<filename> : file with the message body to be sent if your message body is on the command line, use a hyphen (-) as your first argument, and -body followed by your message if your message will come from the console/keyboard, use the hyphen as your first argument, but do not use -body option. -of <file> : text file containing more options (also -optionfile) -to <recipient> : recipient list (also -t) (comma separated) -tf <file> : recipient list filename -cc <recipient> : carbon copy recipient list (also -c) (comma separated) -cf <file> : cc recipient list filename -bcc <recipient>: blind carbon copy recipient list (also -b) (comma separated) -bf <file> : bcc recipient list filename -maxNames <x> : send to groups of <x> number of recipients -ur : set To: header to Undisclosed Recipients if not using the -to and -cc options -subject <subj> : subject line, surround with quotes to include spaces(also -s) -ss : suppress subject line if not defined -sf <file> : file containing subject line -bodyF <file> : file containing the message body -body <text> : message body, surround with quotes (") to include spaces -sig <file> : text file containing your email signature -tag <file> : text file containing taglines, to be randomly chosen -ps <file> : final message text, possibly for unsubscribe instructions

Registry overrides

-p <profile> : send with server, user, and port defined in <profile> : use username and password if defined in <profile> -profile : list all profiles in the Registry -server <addr> : specify SMTP server to be used (optionally, addr:port) -serverSMTP <addr> : same as -server -serverNNTP <addr> : specify NNTP server to be used (optionally, addr:port) -serverPOP3 <addr> : specify POP3 server to be used (optionally, addr:port) when POP3 access is required before sending email -serverIMAP <addr> : specify IMAP server to be used (optionally, addr:port) when IMAP access is required before sending email -f <sender> : override the default sender address (must be known to server) -i <addr> : a 'From:' address, not necessarily known to the server -port <port> : port to be used on the SMTP server, defaults to SMTP (25) -portSMTP <port>: same as -port -portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119) -portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110) -portIMAP <port>: port to be used on the IMAP server, defaults to IMAP (110) -u <username> : username for AUTH LOGIN (use with -pw) or for AUTH GSSAPI with -k -pw <password> : password for AUTH LOGIN (use with -u) -pu <username> : username for POP3 LOGIN (use with -ppw) -ppw <password> : password for POP3 LOGIN (use with -pu) -iu <username> : username for IMAP LOGIN (use with -ipw) -ipw <password> : password for IMAP LOGIN (use with -iu) -k : Use UNKNOWN mutual authentication and AUTH GSSAPI -kc : Use UNKNOWN client-only authentication and AUTH GSSAPI -service <name> : Set GSSAPI service name (use with -k), default "smtp@server" -level <lev> : Set GSSAPI protection level to <lev>, which should be one of : None, Integrity, or Privacy (default GSSAPI level is Privacy) -nomd5 : Do NOT use CRAM-MD5 authentication. Use this in cases where the server's CRAM-MD5 is broken, such as Network Solutions.

Miscellaneous RFC header switches

-organization <organization> : Organization field (also -o and -org) -ua : include User-Agent header line instead of X-Mailer -x <X-Header: detail> : custom 'X-' header. eg: -x "X-INFO: Blat is Great!" -noh : prevent X-Mailer/User-Agent header from showing Blat homepage -noh2 : prevent X-Mailer header entirely -d : request disposition notification -r : request return receipt -charset <cs> : user defined charset. The default is iso-8859-1 -a1 <header> : add custom header line at the end of the regular headers -a2 <header> : same as -a1, for a second custom header line -dsn <nsfd> : use Delivery Status Notifications (RFC 3461) n = never, s = successful, f = failure, d = delayed can be used together, however N takes precedence -hdrencb : use base64 for encoding headers, if necessary -hdrencq : use quoted-printable for encoding headers, if necessary -priority <pr> : set message priority 0 for low, 1 for high -sensitivity <s>: set message sensitivity 0 for personal, 1 for private, 2 for company-confidential -mdn <type> : set Message Disposition Notification to <type> where type can be displayed, dispatched, processed, deleted, denied, or failed. The message will be marked "MDN-sent-automatically"

Attachment and encoding options

-attach <file> : attach binary file(s) to message (filenames comma separated) -attacht <file> : attach text file(s) to message (filenames comma separated) -attachi <file> : attach text file(s) as INLINE (filenames comma separated) -imaf : ignore missing attachment files. Do not stop for missing files. -embed <file> : embed file(s) in HTML. Object tag in HTML must specify content-id using cid: tag. eg: <img src="cid:image.jpg"> -af <file> : file containing list of binary file(s) to attach (comma separated) -atf <file> : file containing list of text file(s) to attach (comma separated) -aef <file> : file containing list of embed file(s) to attach (comma separated) -base64 : send binary files using base64 (binary MIME) -uuencode : send binary files UUEncoded -enriched : send an enriched text message (Content-Type=text/enriched) -unicode : message body is in 16- or 32-bit Unicode format -html : send an HTML message (Content-Type=text/html) -alttext <text> : plain text for use as alternate text -alttextf <file>: plain text file for use as alternate text -mime : MIME Quoted-Printable Content-Transfer-Encoding -8bitmime : ask for 8bit data support when sending MIME -multipart <size> : send multipart messages, breaking attachments on <size> KB boundaries, where <size> is per 1000 bytes -nomps : do not allow multipart messages -contentType <string> : use <string> in the ContentType header for attachments that do not have a registered content type for the extension For example: -contenttype "text/calendar"

NNTP specific options

-groups <usenet groups> : list of newsgroups (comma separated)

Other options

-xtndxmit : Attempt to use POP3 to transmit when accessing POP3 first -h : displays this help (also -?, /?, -help or /help) -q : suppresses all output to the screen -debug : echoes server communications to a log file or screen (overrides -q if echoes to the screen) -log <file> : log everything but usage to <file> -timestamp : when -log is used, a timestamp is added to each log line -overwritelog : when -log is used, overwrite the log file -logcmds : when -log is used, write command line options to log file -ti <n> : set timeout to 'n' seconds. Blat will wait 'n' seconds for server responses -try <n times> : how many times blat should try to send (1 to 'INFINITE') The default is 1.) -binary : do not convert ASCII | (pipe, 0x7c) to CrLf in the message body -hostname <hst> : select the hostname used to send the message via SMTP this is typically your local machine name -raw : do not add CR/LF after headers -delay <x> : wait x seconds between messages being sent when used with -maxnames or -multipart -comment <char> : use this character to mark the start of comments in options files and recipient list files. The default is ; -superdebug : hex/ascii dump the data between Blat and the server -superdebugT : ascii dump the data between Blat and the server -superDuperDebug: log many more debugging messages about Blat's function calls
Note that if the '-i' option is used, is included in 'Reply-to:' and 'Sender:' fields in the header of the message. Optionally, the following options can be used instead of the -f and -i options: -mailfrom <addr> The RFC 821 MAIL From: statement -from <addr> The RFC 822 From: statement -replyto <addr> The RFC 822 Reply-To: statement -returnpath <addr> The RFC 822 Return-Path: statement -sender <addr> The RFC 822 Sender: statement For backward consistency, the -f and -i options have precedence over these RFC 822 defined options. If both -f and -i options are omitted then the RFC 821 MAIL FROM statement will be defaulted to use the installation-defined default sender address.
09.24.20

Display a list of package(s) dependencies

Installation

Κατ ευθείαν από το Internet

pip install pipdeptree ––proxy proxy.amsec.gr:3128 pip install pipdeptree ––user ––proxy proxy.amsec.gr:3128

Μέσω τοπικού αρχείου στον υπολογιστή. Download pipdeptree-master.zip from pipdeptree-master.zip

pip install pipdeptree-master.zip pip install pipdeptree-master.zip ––user

Checking the dependencies of a specific package

pipdeptree –r cryptography

cryptography==2.9 - cffi [required: >=1.8,!=1.11.3, installed: 1.14.0] - pycparser [required: Any, installed: 2.20] - six [required: >=1.4.1, installed: 1.14.0]

Αν δεν δοθούν παράμετροι ελέγχει όλα τα packages

pipdeptree

dwave-networkx==0.8.3 - decorator [required: >=4.1.0,<5.0.0, installed: 4.4.1] - dimod [required: >=0.8.0,<0.9.0, installed: 0.8.19] - numpy [required: >=1.15.0,<2.0.0, installed: 1.18.1] - six [required: >=1.10.0,<2.0.0, installed: 1.14.0] - networkx [required: >=2.0,<3.0, installed: 2.4] - decorator [required: >=4.3.0, installed: 4.4.1] matplotlib==3.1.2 - cycler [required: >=0.10, installed: 0.10.0] - six [required: Any, installed: 1.14.0] - kiwisolver [required: >=1.0.1, installed: 1.1.0] - setuptools [required: Any, installed: 45.1.0] - numpy [required: >=1.11, installed: 1.18.1] - pyparsing [required: >=2.0.1,!=2.1.6,!=2.1.2,!=2.0.4, installed: 2.4.6] - python-dateutil [required: >=2.1, installed: 2.8.1] - six [required: >=1.5, installed: 1.14.0] ogr==0.9.0 - cryptography [required: Any, installed: 2.8] - cffi [required: >=1.8,!=1.11.3, installed: 1.13.2] - pycparser [required: Any, installed: 2.19] - six [required: >=1.4.1, installed: 1.14.0] - Deprecated [required: Any, installed: 1.2.7] - wrapt [required: >=1.10,<2, installed: 1.11.2] - GitPython [required: Any, installed: 3.0.5] - gitdb2 [required: >=2.0.0, installed: 2.0.6] - smmap2 [required: >=2.0.0, installed: 2.0.5] - PyGithub [required: Any, installed: 1.45] - deprecated [required: Any, installed: 1.2.7] - wrapt [required: >=1.10,<2, installed: 1.11.2] - pyjwt [required: Any, installed: 1.7.1] - requests [required: >=2.14.0, installed: 2.22.0] - certifi [required: >=2017.4.17, installed: 2019.11.28] - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4] - idna [required: >=2.5,<2.9, installed: 2.8] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.8] - six [required: Any, installed: 1.14.0] - python-gitlab [required: Any, installed: 2.0.0] - requests [required: >=2.22.0, installed: 2.22.0] - certifi [required: >=2017.4.17, installed: 2019.11.28] - chardet [required: >=3.0.2,<3.1.0, installed: 3.0.4] - idna [required: >=2.5,<2.9, installed: 2.8] - urllib3 [required: >=1.21.1,<1.26,!=1.25.1,!=1.25.0, installed: 1.25.8] - PyYAML [required: Any, installed: 5.3] pipdeptree==0.13.2 - pip [required: >=6.0.0, installed: 19.3.1]

09.24.20

How to repair broken python site-packages installation

Μπορεί να συμβεί όταν κατά την εγκατάσταση/απεγκατάσταση ενός Package αυτό τύχει να χρησιμοποιείται.

pip3 freeze ––local > c:\temp\pipfreeze.txt pip3 install ––upgrade ––force-reinstall ––no-cache-dir ––proxy proxy.amsec.gr:3128 -r c:\temp\pipfreeze.txt
09.24.20

List of installed site packages

pip3 list

Package Version --------------- ---------- certifi 2019.11.28 cffi 1.13.2 chardet 3.0.4 cryptography 2.8 cycler 0.10.0 decorator 4.4.1 Deprecated 1.2.7 dimod 0.8.19 dwave-networkx 0.8.3 gitdb2 2.0.6 GitPython 3.0.5 idna 2.8 kiwisolver 1.1.0 matplotlib 3.1.2 networkx 2.4 numpy 1.18.1 ogr 0.9.0 pip 19.3.1 pycparser 2.19 PyGithub 1.45 PyJWT 1.7.1 pyparsing 2.4.6 python-dateutil 2.8.1 python-gitlab 2.0.0 PyYAML 5.3 requests 2.22.0 setuptools 45.1.0 six 1.14.0 smmap2 2.0.5 urllib3 1.25.8 wrapt 1.11.2


pip3 freeze

certifi==2019.11.28 cffi==1.13.2 chardet==3.0.4 cryptography==2.8 cycler==0.10.0 decorator==4.4.1 Deprecated==1.2.7 dimod==0.8.19 dwave-networkx==0.8.3 gitdb2==2.0.6 GitPython==3.0.5 idna==2.8 kiwisolver==1.1.0 matplotlib==3.1.2 networkx==2.4 numpy==1.18.1 ogr==0.9.0 pycparser==2.19 PyGithub==1.45 PyJWT==1.7.1 pyparsing==2.4.6 python-dateutil==2.8.1 python-gitlab==2.0.0 PyYAML==5.3 requests==2.22.0 six==1.14.0 smmap2==2.0.5 urllib3==1.25.8 wrapt==1.11.2

09.24.20

Εγκατάσταση python πακέτου (python package) με τη χρήση του pip

pip install packageName pip3 install packageName pip3 install packageName.whl (wheel pachage) pip3 install packageName.zip (zip) pip3 install packageName.tar.gz (gz)
Με επιλογή της έκδοσης python, με τη χρήση του py.
py -3.5 -m pip install [module] py -2.7 -m pip install [module]
* Στην Αττικό Μετρό (ο Σταμάτης "εξαίρεσε τον proxy από SSL inspection"):
pip install packageName ––proxy proxy.amsec.gr:3128 pip3 install packageName ––proxy proxy.amsec.gr:3128 pip3 install packageName ––user ––proxy proxy.amsec.gr:3128

Εγκατάσταση python πακέτου (python package) χωρίς το pip

  1. Κάνετε unzip το package
  2. Μπαίνετε (με cd) στον κατάλογο που έχετε κάνει unzip το πακέτο. Θα είστε στο σωστό κατάλογο αν δείτε το πρόγραμμα setup.py.
  3. Από εκεί εκτελείτε την εντολή:
    python setup.py install

Εγκατεστημένη έκδοση pip

pip ––version

pip 19.3.1 from C:\Users\USERNAME\AppData\Roaming\Python\Python37\site-packages\pip (python 3.7)

Αναβάθμιση (upgrade) pip

python -m pip install ––upgrade pip py -3.5 -m pip install ––upgrade pip py -2.7 -m pip install ––upgrade pip
09.24.20

Χρήση διαφορετικών εκδόσεων python στον ίδιο υπολογιστή

Ελέγχουμε ποιες εκδόσεις υπάρχουν εγκατεστημένες:
py ––list Installed Pythons found by py Launcher for Windows -3.7-64 * -2.7-64 -2.7-32
Επιλέγουμε την έκδοση:
py –3 py –2.7–64

 

Κλήση προγράμματος pip
py –3.5 –m pip install [module] py –3.5 –m pip version
Περισσότερες λεπτομέρειες για το pip
09.24.20
GTFS currently defines a number of route types that can be used to describe the type of service for a particular route (eg. bus vs rail vs ferry) via the route_type column in the routes.txt file. To support a more rich set of types, an extension has been proposed to allow specifying route types using Hierarchical Vehicle Type (HVT) codes from the European TPEG standard. For more information, see the original discussion.
The following table outlines the proposed route types. Not all route types are supported by Google Maps. Support types are specifically noted. If you are interested in using an unsupported route type in your feed, please contact Google and let us know.
Code Description Support Examples
100 Railway Service Yes
101 High Speed Rail Service Yes TGV (FR), ICE (DE), Eurostar (GB)
102 Long Distance Trains Yes InterCity/EuroCity
103 Inter Regional Rail Service Yes InterRegio (DE), Cross County Rail (GB)
104 Car Transport Rail Service
105 Sleeper Rail Service Yes GNER Sleeper (GB)
106 Regional Rail Service Yes TER (FR), Regionalzug (DE)
107 Tourist Railway Service Yes Romney, Hythe & Dymchurch (GB)
108 Rail Shuttle (Within Complex) Yes Gatwick Shuttle (GB), Sky Line (DE)
109 Suburban Railway Yes S-Bahn (DE), RER (FR), S-tog (Kopenhagen)
110 Replacement Rail Service
111 Special Rail Service
112 Lorry Transport Rail Service
113 All Rail Services
114 Cross-Country Rail Service
115 Vehicle Transport Rail Service
116 Rack and Pinion Railway Rochers de Naye (CH), Dolderbahn (CH)
117 Additional Rail Service
200 Coach Service Yes
201 International Coach Service Yes EuroLine, Touring
202 National Coach Service Yes National Express (GB)
203 Shuttle Coach Service Roissy Bus (FR), Reading-Heathrow (GB)
204 Regional Coach Service Yes
205 Special Coach Service
206 Sightseeing Coach Service
207 Tourist Coach Service
208 Commuter Coach Service
209 All Coach Services
400 Urban Railway Service Yes
401 Metro Service Yes Métro de Paris
402 Underground Service Yes London Underground, U-Bahn
403 Urban Railway Service Yes
404 All Urban Railway Services
405 Monorail Yes
700 Bus Service Yes
701 Regional Bus Service Yes Eastbourne-Maidstone (GB)
702 Express Bus Service Yes X19 Wokingham-Heathrow (GB)
703 Stopping Bus Service 38 London: Clapton Pond-Victoria (GB)
704 Local Bus Service Yes
705 Night Bus Service N prefixed buses in London (GB)
706 Post Bus Service Maidstone P4 (GB)
707 Special Needs Bus
708 Mobility Bus Service
709 Mobility Bus for Registered Disabled
710 Sightseeing Bus
711 Shuttle Bus 747 Heathrow-Gatwick Airport Service (GB)
712 School Bus
713 School and Public Service Bus
714 Rail Replacement Bus Service
715 Demand and Response Bus Service Yes
716 All Bus Services
717 Share Taxi Service Yes Marshrutka (RU), dolmuş (TR)
800 Trolleybus Service Yes
900 Tram Service Yes
901 City Tram Service
902 Local Tram Service Munich (DE), Brussels (BE), Croydon (GB)
903 Regional Tram Service
904 Sightseeing Tram Service Blackpool Seafront (GB)
905 Shuttle Tram Service
906 All Tram Services
907 Cable Tram Yes Cable car (San Francisco, US)
1000 Water Transport Service Yes
1100 Air Service
1200 Ferry Service Yes Please use 1000
1300 Aerial Lift Service Yes Telefèric de Montjuïc (ES), Saleve (CH), Roosevelt Island Tramway (US)
1400 Funicular Service Yes Rigiblick (Zürich, CH)
1500 Taxi Service
1501 Communal Taxi Service Yes Please use 717
1502 Water Taxi Service
1503 Rail Taxi Service
1504 Bike Taxi Service
1505 Licensed Taxi Service
1506 Private Hire Service Vehicle
1507 All Taxi Services
1700 Miscellaneous Service Yes
09.24.20

Introduction

The Google Transit team continuously works to improve the General Transit Feed Specification (GTFS) to accommodate the needs of our partners. Several extensions have been proposed for inclusion in the GTFS spec that in the meantime can be used by partners in their feed submitted to Transit in Google Maps. Below, you can find a comprehensive list of these features. If you have your own proposals for extending the GTFS specification, see the official GTFS Change process.

Maximum transfer count for a particular fare

In order to support fare attributes in a feed with multiple agencies, the following extensions have been proposed:

fare_attributes.txt

Field Name Required Details
transfers Optional Google Transit accepts values from 0 to 5; the GTFS spec states that it can take values from 0 to 2. Use this field to set the maximum number of transfers (excluding block transfers) allowed with the fare.

Additional Route Types

GTFS currently defines a number of route types that can be used to describe the type of service for a particular route (eg. bus vs rail vs ferry). To support a more rich set of types, an extension to the routes.txt route_type field has been proposed. For more details, see Extended GTFS Route Types.

Station vehicle types

An extension has been proposed to allow specifying the type of vehicles serving a particular stop.

stops.txt

Field Name Required Details
vehicle_type Optional Use this field to describe the type of transportation used at the stop. It accepts an valid routes.txt route_type value, including our proposed Extended GTFS Route Types values.

Trip Diversions

It is useful to indicate trips that operate outside of regular schedule or are diverted from the usual route due to special events or planned disruptions (such as track work, etc). We propose an extension to trips.txt to indicate such exceptional services.

trips.txt

Field Name Required Details
exceptional Optional Set this field to 1 to indicate a service exception, such as services added due to special events or services diverted away from the usual route due to planned disruptions(trackwork). Set this field to 0 for regular services.

Translations

In regions that have multiple official languages, transit agencies and operators typically have language-specific names and web pages. To best serve riders in those regions, it's useful for the GTFS feed to include these language-dependent values. The recommended GTFS-Translations format uses feed_info.txt and translations.txt files to define how translations are applied. No modifications to other files are needed. This makes GTFS-Translations fully compatible with those GTFS customers that ignore translations.txt.

feed_info.txt

File: Conditionally required This file is required if translations.txt is provided. The following table extends the core feed_info.txt definition. It modifies the existing feed_lang field and adds a new default_lang field.
Field Name Type Required Description
feed_lang Language code Required Provides the default language used for the text in this dataset. This setting helps GTFS consumers choose capitalization rules and other language-specific settings for the dataset. If an additional language needs to be defined, then the language field in translations.txt can be used. If the dataset contains values in multiple languages, such as in multilingual countries like Switzerland, Belgium, or Canada, use the ISO 639-2 language code mul in the feed_lang field. In such cases, the best practice is to provide a translation for each of the languages used in the dataset. For example, a dataset in Switzerland could have feed_lang=mul and contain the default stop names "Genève" for Geneva, "Zürich" for Zurich, and "Biel/Bienne" for the bilingual city of Biel/Bienne. Then translations could be provided for each of the following languages:
  • German: "Genf," "Zürich," and "Biel"
  • French: "Genève," "Zurich," and "Bienne"
  • Italian: "Ginevra," "Zurigo," and "Bienna"
  • English: "Geneva," "Zurich," and "Biel/Bienne"
default_lang Language code Optional Defines the language to be used when the data consumer doesn’t know the language of the rider. It's often en—English.

translations.txt

Field Name Type Required Description
table_name Enum Required Defines the dataset table that contains the field to be translated. The following values are allowed:
  • agency
  • stops
  • routes
  • trips
  • stop_times
  • feed_info
field_name Text Required Provides the name of the field to be translated. Fields with the type "Text" can be translated, while fields with the types "URL," "Email," and "Phone number" can be included here to provide those resources in the correct language.
language Language code Required Provides the language of translation. If this language is the same as the one from feed_lang in feed_info.txt, the original value of the field is the default value used in languages without specific translations. For example, in Switzerland, a city in a bilingual canton is officially called "Biel/Bienne," but it would simply be called "Bienne" in French and "Biel" in German.
translation Text, URL, Email, or Phone number Required Provides the translated value for the specified field_name.
record_id ID Conditionally Required Defines the record that corresponds to the field to be translated. The value in record_id needs to be a main ID from a dataset table, as defined in the following table:
table_name record_id
agency agency_id
stops stop_id
routes route_id
trips trip_id
stop_times trip_id
pathways pathway_id
levels level_id
The following conditions determine how this field can be used:
  • Forbidden if table_name equals feed_info.
  • Forbidden if field_value is defined.
  • Required if field_value is empty.
record_sub_id ID Conditionally Required Helps to translate the record that contains the field when the table referenced in record_id doesn’t have a unique ID. The value in record_sub_id is the secondary ID of a dataset table, as defined in the following table:
table_name record_sub_id
agency NONE
stops NONE
routes NONE
trips NONE
stop_times stop_sequence
pathways NONE
levels NONE
The following conditions determine how this field can be used:
  • Forbidden if table_name equals feed_info.
  • Forbidden if field_value is defined.
  • Required if table_name equals stop_times and record_id is defined.
field_value Text, URL, Email, or Phone number Conditionally Required Instead of using record_id and record_sub_id to define which record needs to be translated, field_value can be used to define the value for translation. When used, the translation is applied when the field identified by table_name and field_name contains the exact same value defined in field_value. The field must exactly match the value defined in field_value. If only a subset of the value matches field_value, the translation isn't applied. If two translation rules match the same record, one with field_value and the other one with record_id, then the rule with record_id is the one that needs to be used. The following conditions determine how this field can be used:
  • Forbidden if table_name equals feed_info.
  • Forbidden if record_id is defined.
  • Required if record_id is empty.

Route-to-route and trip-to-trip transfers

Right now, the GTFS specification allows an agency to define transfer semantics using the transfers.txt file, supporting features such as preferred transfers, timed transfers, and restricted transfers. Currently, those transfers only apply to stops. Google has received feedback from a number of agencies that they'd like to be able to specify more detailed transfer information at a route or even a trip level. Working with these agencies, we've come up for a proposal for modeling route-to-route and trip-to-trip transfers and we are looking for feedback from the GTFS community.

Motivation

We want to be able to specify transfers between specific routes or even specific trips for a given stop pair, without having to specify the same transfer for all the trips of that stop pair. For example:
  • If two trips arrive at the same platform and wait for each other, we want to specify a timed transfer between these two trips. But we do not want all the transfers at this train station to be timed transfers.
  • If a train is know to be often late by up to 30 minutes, we want to disallow the transfers from this train to any other train if there is less than 35 minutes between the scheduled arrival and the departure.

Details

Add 4 optional fields to transfers.txt:
  • from_route_id
  • to_route_id
  • from_trip_id
  • to_trip_id
The from_route_id and to_route_id fields can contain a route_id (as specified by routes.txt), reducing the scope to which the given transfer applies. If from_route_id is specified, the transfer will only apply to the arriving trip with the given route id, at the given from_stop_id. If to_route_id is specified, the transfer will only apply to the departing trip with given route id, at the given to_stop_id. The from_trip_id and to_trip_id fields can contain a trip_id, as specified by trips.txt. If from_trip_id is given, from_route_id is ignored, and if to_trip_id is given, to_route_id is ignored. If from_trip_id is specified, the transfer will only apply to the arriving trip with the given trip id, at the given from_stop_id. If to_trip_id is specified, the transfer will only apply to the departing trip with the given trip id, at the given to_stop_id.

Specificity of a transfer

Some transfers are more specific than others. We want to define a simple ranking mechanism to determine when a transfer should be applied. We thus define the "specificity" of a transfer. The specificity of the source of the transfer is 0 if only from_stop_id is given, 1 if from_route_id is specified, and 2 if from_trip_id is specified. The same applies for target: 0 if only to_stop_id is given, 1 if to_route_id is specified, and 2 if to_trip_id is specified. The sum of these 2 values gives the specificity of the transfer, between 0 and 4 inclusive. For a given ordered pair of arriving trip and departing trip, the transfer with the greatest specificity that applies between these 2 trips is chosen. So for any pair of trips, there should NOT be two transfers with equally maximal specificity that could apply. Example of an ambiguous rule:
from_stop_id,to_stop_id,from_route_id,to_route_id,transfer_type
stopFrom,stopTo,routeFrom,,0
stopFrom,stopTo,,routeTo,1
These two transfers both have a specificity of 1. But for transfers between a trip with id route id routeFrom arriving at stop stopFrom, to a trip with route id routeTo arriving at stop stopTo, either of these two rules can apply.
09.24.20

Ανοίγουμε την εργαλειοθήκη του ArcGIS

Φορτώνουμε το toolbox

Εκτελούμε ένα ένα τα εργαλεία

Επιλέγουμε το αρχείο των Stops & και την κλάση που θα δημιουργηθεί.

Επιλέγουμε το αρχείο τον κατάλογο στον οποίο βρίσκονται τα GTFS δεδομένα (txt αρχεία) & και την κλάση που θα δημιουργηθεί.

Σχετικά

09.24.20 Use Display GTFS in ArcGIS to visualize your GTFS stops and route shapes in ArcMap. The Display GTFS Stops tool makes a feature class of stops using information from the GTFS stops.txt file. The Display GTFS Route Shapes tool converts the information from the GTFS routes.txt and shapes.txt files into an ArcGIS feature class, allowing you to view your transit lines on a map. The output will contain one line feature for each unique shape in your GTFS data. The attributes for each line contain all the information about the routes represented by the shape. Lines can be displayed in the color designated in the routes.txt file. This tool is deprecated in ArcGIS Pro 2.2 and higher. To convert your GTFS stops and shapes to feature classes in ArcGIS Pro 2.2 and higher, please use the GTFS Stops To Features and GTFS Shapes To Features tools in the Conversion Tools toolbox.
User's Guide
Download
09.24.20 Επιλεγμένες παράμετροι
robocopy Drive:\DirName Drive:\DirName /E /V /r:0 /w:1 /tee /XJD /LOG:Drive:\temp\DirName.log robocopy Drive:\DirName Drive:\Backups\DirName /E /V /r:0 /w:1 /tee /XJD /LOG:Drive:\temp\DirName.log
/tee βλέπουμε τη λίστα και στην οθόνη, παρ'όλο που δημιουργείται το log file /LOG: δημιουργία log file /E αντιγράφει και τα άδεια diretories /V εμφανίζει τις ενέργειες /XJD exclude junction points /XA:SH skip hidden and system file /FFT allows a 2-second difference when comparing timestamps of files, such that minor clock differences between your computer and your backup device don't matter.  
09.24.20 Για να διαβαστούν σωστά τα Ελληνικά από export cover θα πρέπει να δώσω την εντολή για να ορισθεί το codepage
chcp 737
και μετά να εκτελεστεί η εντολή import cover.
09.24.20

Επίλυση του προβλήματος στην περίπτωση για την οποία λαμβάνουμε το παρακάτω μήνυμα:

host xxx.xxx.xxx.xxx is not allowed to connect to this mysql server

Η προεπιλεγμένη ρύθμιση του MySQL server είναι να ακούει στο 127.0.0.1. Για αλλαγή: Στο my.ini (windows) ή my.cnf προσθέτουμε στο section [mysqld] τη γραμμή bind-address=

[mysqld]
# The next three options are mutually exclusive to SERVER_PORT below. # skip-networking # enable-named-pipe # The Pipe the MySQL Server will use # socket=mysql
# The TCP/IP Port the MySQL Server will listen on port=3306
# Path to installation directory. All paths are usually resolved relative to this. # basedir="C:/Program Files/MySQL/MySQL Server 5.6/"
# Path to the database root datadir="C:/WorkSpace/MySQLdatabases/data/"
# The default character set that will be used when a new schema or table is # created and no character set is defined character-set-server=utf8
# Αν θέλουμε να ακούει μόνο στην 172.10.20.4 τότε bind-address=172.10.20.4 # Αν θέλουμε να ακούει σε όλες (και στην 127.0.0.1 και στην 172.10.20.4 κα) τότε bind-address=0.0.0.0

Επίσης στα δικαιώματα της ΒΔ (Users and Privieges) θα πρέπει να έχουμε επιτρέψει ο χρήστης root να μπορεί να συνδέεται από την σχετική IP διεύθυνση ή απ' όλες τις διευθύνσεις. Έτσι : στην τυπική περίπτωση (127.0.0.1) τα δικαιώματα είναι:

root localhost root 127.0.0.1

για συγκεκριμένη IP (172.10.20.4) μπορούμε να προσθέσουμε:

root localhost root 127.0.0.1
root 172.10.20.4

αν θέλουμε να ακούει σε όλες τις διευθύνσεις (περίπτωση bind-address=0.0.0.0) τότε αρκεί :

root %

Αντίστοιχα προσθέτουμε και τους λοιπούς χρήστες.

Σχετικό

How to Allow MySQL Client to Connect to Remote MySQL server

MySQL Ρυθμίσεις για remote πρόσβαση.doc

04.30.20 [et_pb_section fb_built="1" _builder_version="3.29.3"][et_pb_row _builder_version="3.25" background_size="initial" background_position="top_left" background_repeat="repeat"][et_pb_column type="4_4" _builder_version="3.25" custom_padding="|||" custom_padding__hover="|||"][et_pb_text _builder_version="3.27.4" background_size="initial" background_position="top_left" background_repeat="repeat"]Χρησιμεύει για να μεταφέρουμε τα ονόματα των Sheets, ενός Workbook, μέσα σε ένα φύλλο, είτε σε γραμμές είτε σε στήλες. Επιλέγουμε το κελί πάνω στο οποίο θα εφαρμοστεί ο κώδικας. Alt+F11 για να ανοίξουμε τον VBA Editor Insert Module από το Insert Menu Κάνουμε paste τον παρκάτω κώδικα. Τρέχουμε τον κώδικα. Για να γράψει τα ονόματα σε γραμμές:
Sub SheetNames2cellLines() activeCol = ActiveCell.Column activeRow = ActiveCell.Row For i = 1 To Sheets.Count Cells((activeRow - 1) + i, activeCol) = Sheets(i).Name Next i End Sub

 

Για να γράψει τα ονόματα σε στήλες (και να τις κάνει και AutoFit):
Sub SheetNames2cellColumns() activeCol = ActiveCell.Column activeRow = ActiveCell.Row For i = 1 To Sheets.Count Cells(activeRow, (activeCol - 1) + i) = Sheets(i).Name Columns(i + 1).EntireColumn.AutoFit Next i End Sub

 

Αρχική εικόνα

Μετά την εκτέλεση του κώδικα (και για γραμμές και για στήλες)

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]
09.26.19

Χρήση datetime πεδίου της MySQL στην PHP

$time = strtotime( $row['datetime'] ); echo date('d-m-Y H:i', $time);

Ενημέρωση datetime πεδίου της MySQL με την τρέχουσα ημερομηνία και ώρα

Insert into table (datetime) values (now());
09.26.19

Export

Για να κάνετε export μια Βάση Δεδομένων από το Command Prompt ακολουθείτε τα παρακάτω βήματα.

Αν δεν είναι στο path η MySQL πηγαίνετε στον κατάλογο εγκατάστασης η την τρέχετε από τον κατάλογο εγκατάστασης. Στο παρακάτω παράδειγμα η εγκατάσταση έχει γίνει με xampp.

cd /d c:\xampp\mysql\bin
 

Με την 1η εντολή εξάγουμε όλο το περιεχόμενο της ΒΔ planning_new σε ένα αρχείο.

Με την 2η εντολή εξάγουμε όλο το περιεχόμενο της ΒΔ planning_new, στο οποίο όμως προσθέτει και την εντολή δημιουργίας της ΒΔ.

mysqldump -u USER -p planning_new > C:\backups\planning_new.sql mysqldump -u USER -p --databases planning_new > C:\backups\planning_new.sql

Αν θέλουμε να εξάγουμε συγκεκριμένους πίνακες (έναν ή περισσότερους), προσθέτουμε τα ονόματά τους

mysqldump -u USER -p planning_new TABLE1 TABLE2 > C:\backups\some_tables.sql

Αν θέλουμε να παρατηρήσουμε την εξέλιξη προσθέτουμε την παράμετρο -v

mysqldump -u USER -p planning_new -v TABLE1 TABLE2 > C:\backups\some_tables.sql

-- Connecting to localhost... -- Retrieving table structure for table TABLE1... -- Sending SELECT query... -- Retrieving rows... -- Retrieving table structure for table TABLE2... -- Sending SELECT query... -- Retrieving rows... -- Disconnecting from localhost...

Import

Για να κάνετε import το περιεχόμενο ενός αρχείου sql σε μια Βάση Δεδομένων από το Command Prompt ακολουθείτε τα παρακάτω βήματα.

Αν δεν είναι στο path η MySQL πηγαίνετε στον κατάλογο εγκατάστασης η την τρέχετε από τον κατάλογο εγκατάστασης. Στο παρακάτω παράδειγμα η εγκατάσταση έχει γίνει με xampp.

cd /d c:\xampp\mysql\bin
 

Για να εισάγετε πίνακες κλπ στη ΒΔ planning_new από ένα αρχείο:

mysql -u USER -p planning_new < C:\backups\planning_new.sql
09.26.19 [et_pb_section fb_built="1" _builder_version="3.22" fb_built="1" bb_built="1" _i="0" _address="0"][et_pb_row _builder_version="3.25" background_size="initial" background_position="top_left" background_repeat="repeat" _i="0" _address="0.0"][et_pb_column type="4_4" _builder_version="3.0.47" custom_padding="|||" custom_padding__hover="|||" _i="0" _address="0.0.0"][et_pb_text _builder_version="3.29.3" z_index_tablet="500" hover_enabled="0" text_text_shadow_horizontal_length_tablet="0px" text_text_shadow_vertical_length_tablet="0px" text_text_shadow_blur_strength_tablet="1px" link_text_shadow_horizontal_length_tablet="0px" link_text_shadow_vertical_length_tablet="0px" link_text_shadow_blur_strength_tablet="1px" ul_text_shadow_horizontal_length_tablet="0px" ul_text_shadow_vertical_length_tablet="0px" ul_text_shadow_blur_strength_tablet="1px" ol_text_shadow_horizontal_length_tablet="0px" ol_text_shadow_vertical_length_tablet="0px" ol_text_shadow_blur_strength_tablet="1px" quote_text_shadow_horizontal_length_tablet="0px" quote_text_shadow_vertical_length_tablet="0px" quote_text_shadow_blur_strength_tablet="1px" header_text_shadow_horizontal_length_tablet="0px" header_text_shadow_vertical_length_tablet="0px" header_text_shadow_blur_strength_tablet="1px" header_2_text_shadow_horizontal_length_tablet="0px" header_2_text_shadow_vertical_length_tablet="0px" header_2_text_shadow_blur_strength_tablet="1px" header_3_text_shadow_horizontal_length_tablet="0px" header_3_text_shadow_vertical_length_tablet="0px" header_3_text_shadow_blur_strength_tablet="1px" header_4_text_shadow_horizontal_length_tablet="0px" header_4_text_shadow_vertical_length_tablet="0px" header_4_text_shadow_blur_strength_tablet="1px" header_5_text_shadow_horizontal_length_tablet="0px" header_5_text_shadow_vertical_length_tablet="0px" header_5_text_shadow_blur_strength_tablet="1px" header_6_text_shadow_horizontal_length_tablet="0px" header_6_text_shadow_vertical_length_tablet="0px" header_6_text_shadow_blur_strength_tablet="1px" box_shadow_horizontal_tablet="0px" box_shadow_vertical_tablet="0px" box_shadow_blur_tablet="40px" box_shadow_spread_tablet="0px" _i="0" _address="0.0.0.0"]

A Command line mail program

Windows console utility to send mail via SMTP or post to usenet via NNTP by P.Mendes, M.Neal, G.Vollant, T.Charron, T.Musson ,H.Pesonen, A.Donchey, C.Hyde

Blat <filename> -to <recipient> [optional switches (see below)] Blat -SaveSettings -f <sender email addy> -server <server addr> [-port <port>] [-try <try>] [-profile <profile>] [-u <login id>] [-pw <password>] or Blat -install <server addr> <sender's addr> [<try>[<port>[<profile>]]] [-q] Blat -profile [-delete | "<default>"] [profile1] [profileN] [-q] Blat -h

Installation

-SaveSettings : store common settings to the Windows Registry. Takes the same parameters as -install, and is only for SMTP settings. -install[SMTP|NNTP|POP3|IMAP] <server addr> <sender email addr> [<try n times> [<port> [<profile> [<username> [<password>]]]]] : set server, sender, number of tries and port for profile (<try n times> and <port> may be replaced by '-') port defaults are SMTP=25, NNTP=119, POP3=110, IMAP=143 default profile can be specified with a '-' username and/or password may be stored to the registry order of options is specific use -installNNTP for storing NNTP information use -installPOP3 for storing POP3 information (sender and try are ignored, use '-' in place of these) use -installIMAP for storing IMAP information (sender and try are ignored, use '-' in place of these)

The Basics

<filename> : file with the message body to be sent if your message body is on the command line, use a hyphen (-) as your first argument, and -body followed by your message if your message will come from the console/keyboard, use the hyphen as your first argument, but do not use -body option. -of <file> : text file containing more options (also -optionfile) -to <recipient> : recipient list (also -t) (comma separated) -tf <file> : recipient list filename -cc <recipient> : carbon copy recipient list (also -c) (comma separated) -cf <file> : cc recipient list filename -bcc <recipient>: blind carbon copy recipient list (also -b) (comma separated) -bf <file> : bcc recipient list filename -maxNames <x> : send to groups of <x> number of recipients -ur : set To: header to Undisclosed Recipients if not using the -to and -cc options -subject <subj> : subject line, surround with quotes to include spaces(also -s) -ss : suppress subject line if not defined -sf <file> : file containing subject line -bodyF <file> : file containing the message body -body <text> : message body, surround with quotes (") to include spaces -sig <file> : text file containing your email signature -tag <file> : text file containing taglines, to be randomly chosen -ps <file> : final message text, possibly for unsubscribe instructions

Registry overrides

-p <profile> : send with server, user, and port defined in <profile> : use username and password if defined in <profile> -profile : list all profiles in the Registry -server <addr> : specify SMTP server to be used (optionally, addr:port) -serverSMTP <addr> : same as -server -serverNNTP <addr> : specify NNTP server to be used (optionally, addr:port) -serverPOP3 <addr> : specify POP3 server to be used (optionally, addr:port) when POP3 access is required before sending email -serverIMAP <addr> : specify IMAP server to be used (optionally, addr:port) when IMAP access is required before sending email -f <sender> : override the default sender address (must be known to server) -i <addr> : a 'From:' address, not necessarily known to the server -port <port> : port to be used on the SMTP server, defaults to SMTP (25) -portSMTP <port>: same as -port -portNNTP <port>: port to be used on the NNTP server, defaults to NNTP (119) -portPOP3 <port>: port to be used on the POP3 server, defaults to POP3 (110) -portIMAP <port>: port to be used on the IMAP server, defaults to IMAP (110) -u <username> : username for AUTH LOGIN (use with -pw) or for AUTH GSSAPI with -k -pw <password> : password for AUTH LOGIN (use with -u) -pu <username> : username for POP3 LOGIN (use with -ppw) -ppw <password> : password for POP3 LOGIN (use with -pu) -iu <username> : username for IMAP LOGIN (use with -ipw) -ipw <password> : password for IMAP LOGIN (use with -iu) -k : Use UNKNOWN mutual authentication and AUTH GSSAPI -kc : Use UNKNOWN client-only authentication and AUTH GSSAPI -service <name> : Set GSSAPI service name (use with -k), default "smtp@server" -level <lev> : Set GSSAPI protection level to <lev>, which should be one of : None, Integrity, or Privacy (default GSSAPI level is Privacy) -nomd5 : Do NOT use CRAM-MD5 authentication. Use this in cases where the server's CRAM-MD5 is broken, such as Network Solutions.

Miscellaneous RFC header switches

-organization <organization> : Organization field (also -o and -org) -ua : include User-Agent header line instead of X-Mailer -x <X-Header: detail> : custom 'X-' header. eg: -x "X-INFO: Blat is Great!" -noh : prevent X-Mailer/User-Agent header from showing Blat homepage -noh2 : prevent X-Mailer header entirely -d : request disposition notification -r : request return receipt -charset <cs> : user defined charset. The default is iso-8859-1 -a1 <header> : add custom header line at the end of the regular headers -a2 <header> : same as -a1, for a second custom header line -dsn <nsfd> : use Delivery Status Notifications (RFC 3461) n = never, s = successful, f = failure, d = delayed can be used together, however N takes precedence -hdrencb : use base64 for encoding headers, if necessary -hdrencq : use quoted-printable for encoding headers, if necessary -priority <pr> : set message priority 0 for low, 1 for high -sensitivity <s>: set message sensitivity 0 for personal, 1 for private, 2 for company-confidential -mdn <type> : set Message Disposition Notification to <type> where type can be displayed, dispatched, processed, deleted, denied, or failed. The message will be marked "MDN-sent-automatically"

Attachment and encoding options

-attach <file> : attach binary file(s) to message (filenames comma separated) -attacht <file> : attach text file(s) to message (filenames comma separated) -attachi <file> : attach text file(s) as INLINE (filenames comma separated) -imaf : ignore missing attachment files. Do not stop for missing files. -embed <file> : embed file(s) in HTML. Object tag in HTML must specify content-id using cid: tag. eg: <img src="cid:image.jpg"> -af <file> : file containing list of binary file(s) to attach (comma separated) -atf <file> : file containing list of text file(s) to attach (comma separated) -aef <file> : file containing list of embed file(s) to attach (comma separated) -base64 : send binary files using base64 (binary MIME) -uuencode : send binary files UUEncoded -enriched : send an enriched text message (Content-Type=text/enriched) -unicode : message body is in 16- or 32-bit Unicode format -html : send an HTML message (Content-Type=text/html) -alttext <text> : plain text for use as alternate text -alttextf <file>: plain text file for use as alternate text -mime : MIME Quoted-Printable Content-Transfer-Encoding -8bitmime : ask for 8bit data support when sending MIME -multipart <size> : send multipart messages, breaking attachments on <size> KB boundaries, where <size> is per 1000 bytes -nomps : do not allow multipart messages -contentType <string> : use <string> in the ContentType header for attachments that do not have a registered content type for the extension For example: -contenttype "text/calendar"

NNTP specific options

-groups <usenet groups> : list of newsgroups (comma separated)

Other options

-xtndxmit : Attempt to use POP3 to transmit when accessing POP3 first -h : displays this help (also -?, /?, -help or /help) -q : suppresses all output to the screen -debug : echoes server communications to a log file or screen (overrides -q if echoes to the screen) -log <file> : log everything but usage to <file> -timestamp : when -log is used, a timestamp is added to each log line -overwritelog : when -log is used, overwrite the log file -logcmds : when -log is used, write command line options to log file -ti <n> : set timeout to 'n' seconds. Blat will wait 'n' seconds for server responses -try <n times> : how many times blat should try to send (1 to 'INFINITE') The default is 1.) -binary : do not convert ASCII | (pipe, 0x7c) to CrLf in the message body -hostname <hst> : select the hostname used to send the message via SMTP this is typically your local machine name -raw : do not add CR/LF after headers -delay <x> : wait x seconds between messages being sent when used with -maxnames or -multipart -comment <char> : use this character to mark the start of comments in options files and recipient list files. The default is ; -superdebug : hex/ascii dump the data between Blat and the server -superdebugT : ascii dump the data between Blat and the server -superDuperDebug: log many more debugging messages about Blat's function calls
Note that if the '-i' option is used, is included in 'Reply-to:' and 'Sender:' fields in the header of the message. Optionally, the following options can be used instead of the -f and -i options: -mailfrom <addr> The RFC 821 MAIL From: statement -from <addr> The RFC 822 From: statement -replyto <addr> The RFC 822 Reply-To: statement -returnpath <addr> The RFC 822 Return-Path: statement -sender <addr> The RFC 822 Sender: statement For backward consistency, the -f and -i options have precedence over these RFC 822 defined options. If both -f and -i options are omitted then the RFC 821 MAIL FROM statement will be defaulted to use the installation-defined default sender address.[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]
09.26.19

diff

diff -arq folder1 folder2

Για παράδειγμα. Σύγκριση των καταλόγων /disk2/hph5/MDS_2009/pt    /hph5/MDS_2009/

diff -arq /disk2/hph5/MDS_2009/pt /hph5/MDS_2009/

Only in /disk2/hph5/MDS_2009/pt: 2016 Only in /disk2/hph5/MDS_2009/pt: 2030 Only in /hph5/MDS_2009/: auto Only in /hph5/MDS_2009/: co_o.mdb Only in /hph5/MDS_2009/: distribution Only in /hph5/MDS_2009/: generation Only in /hph5/MDS_2009/: M_Split.lnk Only in /hph5/MDS_2009/: networks Only in /hph5/MDS_2009/: pt

05.07.19

linux / unix

ln

Μοιάζει λίγο με το shortcut των windows αλλά είναι στην ουσία διαφορετικό. Δημιουργείτε ένα αρχείο ή κατάλογο που στην πραγματικότητα 'δείχνει' σε άλλο αρχείο ή κατάλογο. Δημιουργείτε τον κατάλογο sl_dir (symbolic link) που 'δείχνει' στον υφιστάμενο κατάλογο existing_dir.
ln -s existing_dir sl_dir
Παράδειγμα:
Η παρακάτω εντολή δημιουργεί τον κατάλογο mydir που 'δείχνει' στον υφιστάμενο κατάλογο emme2 Έτσι, κάνοντας ls mydir βλέπω πρακτικά τα περιεχόμενα του emme2.
ln -s emme2 mydir ls emme2
hph1 hph2 lost+found
ls mydir

hph1 hph2 lost+found

Διαγράφοντας τα περιεχόμενα του mydir στην ουσία διαγράφετε τα περιεχόμενα του emme2 Για να διαγράψετε μόνο το symbolic link, mydir, χωρίς να διαγράφετε και τον κατάλογο στόχο emme2 χρησιμοποιείστε την εντολή rm.
rm mydir

Windows 10

mklink

Μοιάζει λίγο με το shortcut των windows αλλά είναι στην ουσία διαφορετικό. Δημιουργείτε ένα αρχείο ή κατάλογο που στην πραγματικότητα 'δείχνει' σε άλλο αρχείο ή κατάλογο. Με την παράμετρο /d δημιουργείτε τον κατάλογο sl_dir (symbolic link) που 'δείχνει' στον υφιστάμενο κατάλογο existing_dir.
mlink /d sl_dir existing_dir
Χωρίς παράμετρο, δημιουργείτε το αρχείο sl_file (symbolic link) που 'δείχνει' στο υφιστάμενο αρχείο existing_file.
mlink /d sl_file existing_file
Παράδειγμα:
Η παρακάτω εντολή δημιουργεί τον κατάλογο mydir που 'δείχνει' στον υφιστάμενο κατάλογο c:\xampp\phpmyadmin Έτσι, κάνοντας dir mydir βλέπω πρακτικά τα περιεχόμενα του c:\xampp\phpmyadmin.
cd c:\htdocs mklink /d myadmin c:\xampp\phpmyadmin

symbolic link created for myadmin <<===>> c:\xampp\phpmyadmin

Προσοχή, η σειρά είναι διαφορετική από αυτή του ln του linux. Διαγράφοντας τα περιεχόμενα του myadmin στην ουσία διαγράφετε τα περιεχόμενα του c:\xampp\phpmyadmin Για να διαγράψετε μόνο το symbolic link, myamdin, χωρίς να διαγράφετε και τον κατάλογο στόχο c:\xampp\phpmyadmin χρησιμοποιείστε την εντολή rmdir.
rmdir myamdin
05.06.19

Password Protected

To view this protected post, enter the password below:

06.10.18 [et_pb_section bb_built="1" fullwidth="off" specialty="on"][et_pb_column type="3_4" specialty_columns="3"][et_pb_row_inner admin_label="Row"][et_pb_column_inner type="4_4" saved_specialty_column_type="3_4"][et_pb_post_title _builder_version="3.6" title="on" meta="on" author="on" date="on" categories="on" comments="on" featured_image="off" featured_placement="below" text_color="dark" text_background="off" title_text_shadow_style="preset1" /][et_pb_text _builder_version="3.6" header_text_shadow_style="preset1"]

Installing package

pip install mysql-connector-python

In Anacoda the following packages were missing and had to be installed.

pip install grin
pip install distributed

Verifying that the packages were installed in the correct python :-) .

from distutils.sysconfig import get_python_lib
print get_python_lib()
[/et_pb_text][et_pb_text admin_label="References" _builder_version="3.6"]

Αναφορές

Inserting Data
Querying Data

[/et_pb_text][/et_pb_column_inner][/et_pb_row_inner][/et_pb_column][et_pb_column type="1_4"][et_pb_sidebar _builder_version="3.0.89" area="sidebar-1" orientation="right" show_border="on" background_layout="light" /][/et_pb_column][/et_pb_section]
06.09.18 [et_pb_section bb_built="1" fullwidth="off" specialty="on"][et_pb_column type="3_4" specialty_columns="3"][et_pb_row_inner admin_label="Row"][et_pb_column_inner type="4_4" saved_specialty_column_type="3_4"][et_pb_post_title _builder_version="3.6" title="on" meta="on" author="on" date="on" categories="on" comments="on" featured_image="off" featured_placement="below" text_color="dark" text_background="off" title_text_shadow_style="preset1" /][et_pb_text _builder_version="3.6" header_text_shadow_style="preset1"]

Environments

Create

Creating en environment allows the user to define python version and custom packages

conda create --name my_app package1 package2
conda create --name my_app python=2.7 package1 package2

Example: Create the environment my_app and install the pyside package.

conda create --name my_app pyside
or
conda create --name my_app
conda install --name my_app pyside

Activating / Deactivating

Activating an environment for the development of a specific project.

activate my_app

List installed packages in the activated environment. See example bellow:

conda list

# packages in environment at C:\Anaconda2\envs\my_app:
#
# Name                    Version                   Build  Channel
certifi                   2018.4.16                py27_0
pip                       10.0.1                   py27_0
pyside                    1.2.1                    py27_0
python                    2.7.15               he216670_0
setuptools                39.2.0                   py27_0
vc                        9                    h7299396_1
vs2008_runtime            9.00.30729.1         hfaea7d5_1
wheel                     0.31.1                   py27_0
wincertstore              0.2              py27hf04cefb_0

Deactivate the current environment and return to the base environment.

deactivate

List

List the available environments

conda env list

Remove

Removes the installed packages. Certain set of files and directories are kept!

conda remove --name my_app -all
[/et_pb_text][et_pb_text admin_label="References" _builder_version="3.6"]

Αναφορές

anaconda.com Download for Windows Python Tutorial: Anaconda - Installation and Using Conda Managing environments [/et_pb_text][/et_pb_column_inner][/et_pb_row_inner][/et_pb_column][et_pb_column type="1_4"][et_pb_sidebar _builder_version="3.0.89" area="sidebar-1" orientation="right" show_border="on" background_layout="light" /][/et_pb_column][/et_pb_section]
11.26.17 [et_pb_section bb_built="1" fullwidth="off" specialty="on"][et_pb_column type="3_4" specialty_columns="3"][et_pb_row_inner admin_label="Row"][et_pb_column_inner type="4_4" saved_specialty_column_type="3_4"][et_pb_post_title _builder_version="3.0.89" title="on" meta="on" author="on" date="on" categories="on" comments="on" featured_image="off" featured_placement="below" text_color="dark" text_background="off" title_text_shadow_style="preset1" /][et_pb_text admin_label="Code" _builder_version="3.0.89" background_layout="light" text_font_size="16" header_text_shadow_style="preset1"]

Παρουσιάζεται ο δεύτερος τρόπος με τον οποίο μπορεί να προστεθεί ηχητικό αρχείο σε μια σελίδα με τη χρήση HTML tag. Ο άλλος τρόπος, με εισαγωγή ενός media element, παρουσιάζεται σε προηγούμενη ανάρτηση.

Υπό κανονικές συνθήκες το στοιχείο πολυμέσων θα πρέπει να κρύβεται:
<audio id="myPlayer" style="display:none;" controls autoplay>

Με τη χρήση του autoplay ξεκινά αυτόματα η αναπαραγωγή του αρχείου.

Στο παραπάνω παράδειγμα του κώδικα αυτό παραμένει ορατό μόνο για λόγους ελέγχου και επισκόπησης.

[/et_pb_text][et_pb_text admin_label="References" _builder_version="3.0.89" background_layout="light"]

Αναφορές

https://www.w3schools.com/tags/ref_av_dom.asp
https://www.w3schools.com/tags/tag_audio.asp [/et_pb_text][/et_pb_column_inner][/et_pb_row_inner][/et_pb_column][et_pb_column type="1_4"][et_pb_sidebar _builder_version="3.0.89" area="sidebar-1" orientation="right" show_border="on" background_layout="light" /][/et_pb_column][/et_pb_section]
11.26.17 [et_pb_section bb_built="1" fullwidth="off" specialty="on"][et_pb_column type="3_4" specialty_columns="3"][et_pb_row_inner admin_label="Row"][et_pb_column_inner type="4_4" saved_specialty_column_type="3_4"][et_pb_post_title _builder_version="3.0.89" title="on" meta="on" author="on" date="on" categories="on" comments="on" featured_image="off" featured_placement="below" text_color="dark" text_background="off" title_text_shadow_style="preset1" /][et_pb_text admin_label="Code" _builder_version="3.0.89" background_layout="light" text_font_size="16" header_text_shadow_style="preset1"]

Παρουσιάζεται ένας από τους τρόπους με τους οποίους μπορεί να προστεθεί ηχητικό αρχείο σε μια σελίδα. Ο άλλος τρόπος, με τη χρήση html tag, παρουσιάζεται σε επόμενη ανάρτηση.

Υπό κανονικές συνθήκες το στοιχείο πολυμέσων θα πρέπει να κρύβεται:
this.sound.style.display = "none";

Στο παραπάνω παράδειγμα του κώδικα αυτό παραμένει ορατό μόνο για λόγους ελέγχου και επισκόπησης. [/et_pb_text][et_pb_text admin_label="References" _builder_version="3.0.89" background_layout="light"]

Αναφορές

https://www.w3schools.com/tags/ref_av_dom.asp
https://www.w3schools.com/tags/tag_audio.asp [/et_pb_text][/et_pb_column_inner][/et_pb_row_inner][/et_pb_column][et_pb_column type="1_4"][et_pb_sidebar _builder_version="3.0.89" area="sidebar-1" orientation="right" show_border="on" background_layout="light" /][/et_pb_column][/et_pb_section]
01.16.17 [et_pb_section bb_built="1" fullwidth="off" specialty="on"][et_pb_column type="3_4" specialty_columns="3"][et_pb_row_inner admin_label="Row"][et_pb_column_inner type="4_4" saved_specialty_column_type="3_4"][et_pb_post_title _builder_version="3.0.89" title="on" meta="on" author="on" date="on" categories="on" comments="on" featured_image="off" featured_placement="below" text_color="dark" text_background="off" title_text_shadow_style="preset1" /][et_pb_text _builder_version="3.0.89" background_layout="light"]
MySQL error 1449: The user specified as a definer does not exist 'root'@'%'

Πολλές φορές παρατηρείται πρόβλημα κατά την εισαγωγή μιας Βάσης Δεδομένων που έχει εξαχθεί με πρόβλημα στον User Definer των Views. Αυτό έχει σαν αποτέλεσμα να "χτυπήσει" η εισαγωγή και τα Views να μην εισαχθούν.

Το πρόβλημα αυτό αντιμετωπίζεται, πριν την εξαγωγή, με τον παρακάτω τρόπο:

UPDATE `mysql`.`proc` p SET definer = 'root@localhost' WHERE definer='root@%' AND db='your_database';
flush privileges;

ή

UPDATE `mysql`.`proc` p SET definer = 'root@localhost' WHERE db='your_database';
flush privileges;
[/et_pb_text][/et_pb_column_inner][/et_pb_row_inner][/et_pb_column][et_pb_column type="1_4"][et_pb_sidebar _builder_version="3.0.89" area="sidebar-1" orientation="right" show_border="on" background_layout="light" /][/et_pb_column][/et_pb_section]