Argief vir die ‘Laaste Onderwerpe’ Kategorie

Fout PHP Te Diep Nesting Vlak Recursieve Afhanklikheid

Maart 12, 2010

Ek het geïnstalleer PHP 5.2 by een van my rekenaars toets vandag en 'n paar stukkies van die kode wat voorheen gewerk het in die weergawe boete 5.1.6 fatale foute gegooi in die nuwe weergawe. Die fout boodskap was "Nesting vlak te diep - rekursiewe afhanklikheid?"En dit het 'n bietjie tyd

te hou op die wortel van die probleem. Hier is wat ek verkeerd gedoen wil.

In PHP is daar twee vergelyking operateurs, == En ===. Dit is algemeen bekend dat die eerste is nie streng oor die tipe, maar die tweede is. So, byvoorbeeld

echo ( valse == 0 ); // ware

echo ( valse === 0 ); // valse

- 0 'n heelgetal is en valse is' n booleaanse

My probleem ontstaan uit die gebruik van nie-streng tik met voorwerpe.

$a = new MyObj();
$b = new MyObj();
indien( $a == $b )

Ek het nie oorweeg wat ek besig was met hierdie kode. Wanneer twee voorwerpe vergelyk met die nie-streng vergelyking operateur (==) PHP vergelyk al die eienskappe van die oogmerke en indien hulle voldoen aan die oogmerke word geag gelyk te wees. As dit nie ooreenstem met hulle nie gelyk is. In effek, Ons het 'n rekursiewe vergelyking van al die eienskappe van elke voorwerp, en al hulle eiendomme, ens. tot ons by basiese gegewens tik, soos snare en heelgetalle.

If, egter, gebruik ons streng vergelyking (===), PHP sal kyk of die twee voorwerpe is presies dieselfde voorwerp, nie net voorwerpe met dieselfde eienskappe.

klas MyObj
{
openbare $ p;
}

$a = new MyObj();
$b = new MyObj();
$c = new MyObj();
$a->p = 1;
$b->p = 1;
$c->p = 2;
echo ( $a == $c ); // valse
echo ( $a == $b ); // ware
echo ( $a === $b ); // valse

Die probleem ontstaan as jy het 'n ronde in jou voorwerpe verwysings eiendomme. So, byvoorbeeld

klas MyObj
{
openbare $ p;
}
klas OtherObj
{
openbare $ q;
}

$a = new MyObj();
$b = new OtherObj();
$a->p = $ b;
$b->q = $ 'n; // die omsendbrief verwys: $a->p->Q === $ 'n

$c = new MyObj();
$d = new OtherObj();
$c->p = $ d;
$d->q = $ h;// 'n ander omsendbrief verwys: $c->p->q $ c ===

echo ( $a == $c ); // Fatale fout:
Nesting level too deeprecursive dependency?

Met die oog op $ a tot $ te vergelyk c, PHP moet vergelyk hul eiendomme. Dus is die logika in PHP gaan iets soos dit: $a == $c if $a->p == $c->p if $a->p->q == $c->p->q if $a->p->q->p == $c->p->q->p ens. onbepaalde tyd.

PHP 5.1 skynbaar glad oor die probleem een of ander manier (waarskynlik na 'n sekere vlak van rekursie dit eenvoudig terug valse) – en gewoonlik is dit fyn uitgewerk. PHP 5.2 korrek produseer die fatale fout hierbo.

Sodra jy weet wat die probleem, die oplossing is eenvoudig – gebruik streng vergelyking.

echo ( $a === $c ); // valse (en geen fout)

Die streng vergelyking sal net kyk of die twee voorwerpe is op dieselfde plek in die geheue en dus nie eens kyk na die waardes van die eiendomme.

NB. Dieselfde probleem kan ontstaan wanneer die gebruik van die vergelyking operateurs ontken (gebruik !== In plaas van !=) en wanneer die gebruik van in_array (gebruik in_array se derde parameter streng vergelyking aan te dui).

Deel en geniet

  • 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

Hoe om te ontvang en te ontleed met behulp van POP3 e-pos en PHP

Maart 1, 2010

Ek wil graag 'n paar metodes te beskryf oor hoe om die verwerker vir inkomende e-pos te skryf. Ek het so 'n manipulasie te gebruik om parse e-pos uit verskillende bronne ontvang. Dit kan handig wees vir die skryf van jou eie spam filter sisteem, antwoord masjien of kaartjie stelsel aansoeke per e-pos te ontvang.

Om die uitvoering van die e-pos ontleder algoritme ons nodig het

  1. in verbinding bly en log-op die e-pos bediener
  2. die getal van inkomende briewe
  3. totaalbedrag e-pos vanaf die bediener protokol met POP3
  4. proses om die e-pos headers en liggaam en maak die ontleding van
  5. … om enige verdere optrede

Ok, daar is baie spesifieke taak PHP coding, Daarom moet ons dit ondersteun hosting eksterne konneksie. Ek stel voor besluit nie heeltemal uit omdat daar baie is wat gerealiseer word met talentvolle programmeerders wat reeds kan skryf. Byvoorbeeld, gereed is kan jy 'n module wat jou sal toelaat om te aanvaar e-pos vanaf' n eksterne bediener.

Thank's op Manuel Lemos en sy module (Php klas) wat die naam pop3.php.

Om 'n verbinding wat in jou kode klas, jy hoef net te gebruik is die volgende of enige bevel: vereis(“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($user,$accesscode,$apop);
indien ($fout<>'Wagwoord fout: Teken misluk: onbekende gebruiker naam of sleg wagwoord. ") {echo $error; afrit;}
// Now get the statistic how many emails are stored and the size of them $result=$pop3_connection->Statistics($messages, $size);
echo "$hostname contains  $messages van $size bytes.";

//..... Daar kan ons e-pos ontvang in die siklus en pars hulle .... //

// As daar niks om te doen - we can close the connection
$error=$pop3_connection->Close(); //
echo $error;
?>

Nou weet ons hoe om aan te sluit en log-on op die POP3-bediener en hoe die aantal Inbox e-pos aan te vra en hulle groottes. Volgende, Ons moet elke e-pos ontvang en ontleed die kop en liggaam skikking.

Word vervolg

Deel en geniet

  • 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

Gratis MBOX Converter te EML

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: Turnpike, Mac Mail, Entourage, 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 Turnpike, Mac Mail, Entourage, MailCopa, Thunderbird, Eudora en 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.

Gratis MBOX Converter te EML 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.

Deel en geniet

  • 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

Ruimtependeltuig video van begin tot einde

Januarie 25, 2010

NASA! Ek het absoluut amazing hierdie video. Twaalf minute van die optrede van Ruimtependeltuig dele. Begin van die aarde en af na die see. Ruimte kameras op elke deel van die shuttle, lyk baie interessant. Baie mooi Ruimtependeltuig video.

STS-129 video highlights as compiled by the SE&Ek beelde span hier by JSC van al die grond, lug, ET en SRB bates.

Deel en geniet

  • 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