Archive for the ‘Τελευταία Θέματα’ category

PHP Σφάλμα Nesting Επίπεδο πολύ βαθιά Αναδρομική εξάρτηση

12η Μαρτίου, 2010

Έχω εγκαταστήσει την PHP 5.2 σε κάποιον από τους υπολογιστές δοκιμών μου σήμερα και ένα ζευγάρι από τα κομμάτια του κώδικα που εργάστηκε κατά το παρελθόν πρόστιμο στην έκδοση 5.1.6 έριξε μοιραία λάθη στην νέα έκδοση. Το μήνυμα σφάλματος ήταν «καταφύγιο επίπεδο πάρα πολύ βαθιά - recursive εξάρτηση?»Και πήρε λίγο χρόνο

να εντοπίσουμε τη ρίζα του προβλήματος. Εδώ είναι τι είχα κάνει λάθος.

Στην PHP υπάρχουν δύο χειριστές σύγκριση, == Και ===. Είναι γενικά γνωστό ότι η πρώτη δεν είναι αυστηρά όσον αφορά τον τύπο, αλλά το δεύτερο είναι. Έτσι, για παράδειγμα

ηχώ ( ψευδή == 0 ); // αλήθεια

ηχώ ( ψευδή === 0 ); // ψευδής

- 0 είναι ένας ακέραιος και ψευδής είναι μια boolean

Το πρόβλημά μου προέκυψε από τη χρήση μη αυστηρή τυποποίηση με αντικείμενα.

$a = new MyObj();
$b = new MyObj();
αν( $a == $b )

Δεν είχε εξετάσει τι έκανα με αυτό τον κωδικό. Κατά τη σύγκριση των δύο αντικείμενα που χρησιμοποιούν τη μη αυστηρή φορέα σύγκριση (==) PHP συγκρίνει όλες τις ιδιότητες των αντικειμένων και αν ταιριάζει με τα αντικείμενα που θεωρούνται ότι είναι ίσο. Αν δεν ταιριάζουν, δεν είναι ίσοι. Στην πραγματικότητα, έχουμε μια αναδρομική σύγκριση όλων των ιδιοτήτων του κάθε αντικειμένου, και όλες τις ιδιότητές τους, κλπ.. μέχρι να φτάσουμε βασικοί τύποι δεδομένων, όπως strings και ακέραιοι.

If, ωστόσο, χρησιμοποιούμε αυστηρή σύγκριση (===), PHP θα ελέγξει αν τα δύο αντικείμενα είναι ακριβώς το ίδιο αντικείμενο, δεν είναι μόνο τα αντικείμενα με τις ίδιες ιδιότητες.

τάξη MyObj
{
δημόσια $ p;
}

$a = new MyObj();
$b = new MyObj();
$c = new MyObj();
$a->p = 1;
$b->p = 1;
$c->p = 2;
ηχώ ( $a == $c ); // ψευδής
ηχώ ( $a == $b ); // αλήθεια
ηχώ ( $a === $b ); // ψευδής

Το πρόβλημα ανακύπτει αν έχετε κυκλικές αναφορές σε αντικείμενα που σας ιδιότητες. Έτσι, για παράδειγμα

τάξη MyObj
{
δημόσια $ p;
}
τάξη OtherObj
{
δημόσια $ q;
}

$a = new MyObj();
$b = new OtherObj();
$a->p = $ b;
$b->q = $ a; // η κυκλική αναφορά: $a->p->=== Q $ a

$c = new MyObj();
$d = new OtherObj();
$c->p = $ d;
$d->q = $ c;// μια άλλη κυκλική αναφορά: $c->p->q $ c ===

ηχώ ( $a == $c ); // Μοιραίο λάθος:
Nesting level too deep – recursive εξάρτηση?

Για να συγκρίνετε $ a και $ c, PHP πρέπει να συγκρίνει τις περιουσίες τους. Έτσι, η λογική στην PHP πάει κάπως έτσι: $a == $c if $a->p == $c->p if $a->p->q == $c->p->q if $a->p->q->p == $c->p->q->p κλπ. επ 'αόριστον.

PHP 5.1 φαινόταν να λειάνει πέρα από το πρόβλημα με κάποιο τρόπο (πιθανότατα μετά από ένα ορισμένο επίπεδο αναδρομής απλά επιστρέφει false) – και συνήθως επέλυσε πρόστιμο. PHP 5.2 σωστά παράγει το μοιραίο λάθος παραπάνω.

Μόλις ξέρετε το πρόβλημα, η λύση είναι εύκολη – χρήση αυστηρή σύγκριση.

ηχώ ( $a === $c ); // ψευδής (και δεν υπέπεσε σε πλάνη)

Η αυστηρή σύγκριση απλά θα ελέγξει αν τα δύο αντικείμενα που βρίσκονται στην ίδια θέση στη μνήμη και έτσι δεν κάνει ούτε μια ματιά στις τιμές των ακινήτων.

Σημείωση:. Το ίδιο πρόβλημα μπορεί να προκύψει κατά τη χρήση του αναιρείται φορείς σύγκριση (χρήση !== Αντί για !=) και όταν χρησιμοποιούν in_array (τρίτη παράμετρο in_array χρησιμοποιούν για να αναφέρουν αυστηρή σύγκριση).

Μοιραστείτε και απολαύστε

  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency
  • wp socializer sprite mask 16px PHP Error Nesting Level Too Deep Recursive Dependency

Πώς μπορείτε να λάβετε και να αναλύσει τα ηλεκτρονικά ταχυδρομεία που χρησιμοποιούν POP3 και PHP

1 Μάρτη, 2010

Θα ήθελα να περιγράψει ορισμένες μεθόδους για τον τρόπο γραφής του μεταποιητή για την εισερχόμενη αλληλογραφία. Έπρεπε να χρησιμοποιήσει αυτές τις καταστρατηγήσεις σε αναλύσει e-mail λαμβάνονται από διάφορες πηγές. Αυτό μπορεί να είναι χρήσιμο για τη σύνταξη του δικού συστήματος φιλτραρίσματος spam, τηλεφωνητή ή εισιτήριο σύστημα να παραλάβουν την αίτηση με e-mail.

Για την εφαρμογή του e-mail αλγόριθμος parser που χρειαζόμαστε

  1. συνδεθούν και να συνδεθείτε στο διακομιστή e-mail
  2. μετράει τον αριθμό των εισερχομένων επιστολών
  3. λαμβάνω e-mail από τον server που χρησιμοποιούν πρωτόκολλο POP3
  4. διεργασία οι κεφαλίδες e-mail και το σώμα και να parsing
  5. … εφαρμογή τυχόν πρόσθετα μέτρα

Εντάξει, υπάρχει πολύ συγκεκριμένο καθήκον PHP κωδικοποίηση, αυτό χρειαζόμαστε τη φιλοξενία που υποστηρίζει εξωτερική σύνδεση. Δεν προτείνω να γράψετε απόφαση εντελώς επειδή πολλά έχουν υλοποιηθεί από ταλαντούχους προγραμματιστές που έχουν ήδη. For example, μπορείτε να πάρετε μια έτοιμη ενότητα που θα επιτρέψουν να δεχθεί μηνύματα ηλεκτρονικού ταχυδρομείου από απομακρυσμένο διακομιστή.

Σας ευχαριστούμε για την Manuel Λαιμού και του module (τάξη php) η οποία ονομάζεται pop3.php.

Για να συνδέσετε αυτή την κατηγορία με τον κωδικό σας, το μόνο που χρειάζεται να χρησιμοποιήσετε συμπεριλάβει ή να απαιτούν εντολή: απαιτήσει(“pop3.php”);


hostname=$hostname;
$result=$pop3_connection->Open();

// We are trying to open connection and display the result
echo $result;
// Trying to logon and display the error if any appear
$error=$pop3_connection->Login($χρήστη,$accesscode,$apop);
αν ($σφάλμα<>«Το σφάλμα κωδικού: Αποτυχία σύνδεσης: άγνωστο όνομα χρήστη ή λανθασμένο κωδικό πρόσβασης. ") {echo $error; έξοδος;}
// Now get the statistic how many emails are stored and the size of them $result=$pop3_connection->Statistics($messages, $size);
ηχώ "$hostname contains  $messages του $size bytes.";

//..... Εκεί μπορούμε να λαμβάνετε e-mails στον κύκλο και να αναλύσει τους .... //

// Σε περίπτωση που δεν σχετίζονται - we can close the connection
$error=$pop3_connection->Close(); //
echo $error;
?>

Τώρα ξέρουμε πώς να συνδέσετε και να συνδεθείτε σε έναν διακομιστή POP3 και πώς να ζητήσει από τον αριθμό των εισερχομένων μηνυμάτων ηλεκτρονικής και τους μεγέθη. Επόμενο, θα πρέπει να λαμβάνουν κάθε e-mail και να αναλύσει τις κεφαλίδες και array σώμα.

Για να συνεχιστεί

Μοιραστείτε και απολαύστε

  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP
  • wp socializer sprite mask 16px How to receive and parse emails using POP3 and PHP

Δωρεάν mbox για EML Converter

February 14th, 2010

It is good that today there are still programmers who write excellent software at no cost. What I am talking about? Want to tell you how I found another program for my collection of must-have utilities.

Apple MAC computers are widespread used in our office. This is the policy of the company. Despite the policy of the company, our boss prefers Windows and uses its featured laptop. Who should break the rules? Of course the boss, the rest is not allowed icon smile Free MBOX to EML Converter I must say that I share that preference, so I have installed Windows 7 to my home laptop.

Our attorneys should pass some investigations from time to time and they should review the correspondence of our staff but they accepted only the files in the Outlook PST format.

In a previous article I wrote about incredibly necessary program Outlook Import Wizard, which saved me a lot of time when importing eml files into Outlook. The task that I had to complete just put me into shock. It is necessary to convert e-mails of our employees into the Outlook .pst file. How can we reconcile incompatible things? How to combine MAC OS with the Windows?

For a start I had to conduct an audit and found that our employees using various e-mail clients. There are just some of them: Δρόμος με διοδία, Mac Mail, Συνοδεία, MailCopa, Thunderbird, Eudora, Berkeley Mail. The conversion task did not seem doable. I decided that if a search engine does not immediately bring me the solution, then I will say to my Boss that the mission is impossible.  So I did search for the phraseentourage, thunderbird, mac mail, to eml to pst free mboxand the search was successful, it proved something I never expected. Moreover, the word FREE does not tally with me with the task that had to do. Imagine my surprise when on the description page of the another one eml to pst converter, I found the free mbox to eml converter.

The software review showed that despite the fact that the program is free, it has the incredible potential. Nevertheless the mailbox files format of different programs vary, the program was able accurately identify all meta signatures and correctly recognize the file format. I’m not kidding, all mailbox files Δρόμος με διοδία, Mac Mail, Συνοδεία, MailCopa, Thunderbird, Eudora και Berkeley Mail were transformed into arrays of e-mail files in EML format. Having the Outlook Import Wizard at my hands allow me to import all eml files into Outlook PST.

Δωρεάν mbox για EML Converter works as a batch-processor. First you should select all necessary mbox files from which you want to retrieve eml messages. It is easy to select all files with the Shift key. After that, you need click the Processing button, point to the empty directory at your hard drive and wait for the result. The program processing all files sequentially, it creates a directory for each file and fill it with extracted eml files. In my case I had a lot of mailbox files that were named in accordance with user-names of our employees. Eventually I got a lot of folders, each had a user name and contained all corresponding eml files retrieved from the mailbox.

Μοιραστείτε και απολαύστε

  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter
  • wp socializer sprite mask 16px Free MBOX to EML Converter

Διαστημικό Λεωφορείο βίντεο από την αρχή μέχρι τέλος

25 Ιαν., 2010

NASA! Βρήκα αυτό το βίντεο απολύτως καταπληκτικό. Δώδεκα λεπτά δράσης του Διαστημικό Λεωφορείο εξαρτήματα. Ξεκινήστε από τη Γη και προς τη θάλασσα. Space κάμερες σε κάθε τμήμα της κλειστής διαδρομής, φαίνεται πολύ ενδιαφέρον. Πολύ όμορφο Διαστημικό Λεωφορείο βίντεο.

STS-129 Video αναδεικνύει όπως υπολογίζονταν από την SE&I ομάδα εικόνων εδώ σε JSC από όλα από το έδαφος, αέρας, ET και SRB περιουσιακών στοιχείων.

Μοιραστείτε και απολαύστε

  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end
  • wp socializer sprite mask 16px Space Shuttle video from start to end