I can’t stop laughing: android log.wtf method rocks :’)
I can’t stop laughing: android log.wtf method rocks :’)
When i don’t sleep i do something constructive, more ore less, last time i learned the basics for GIT, now i did some exploring.
Exploring WordPress SVN server which is kinda cool, and for all code freaks out there, the links below are ALL the links for *.svn.wordpress.org
Core – core.svn.wordpress.org
Plugins – plugins.svn.wordpress.org
Themes – themes.svn.wordpress.org
BBpress – bbpress.svn.wordpress.org
Unit Test – unit-test.svn.wordpress.org
Unit Tests – unit-tests.svn.wordpress.org
Open After the Deadline – openatd.svn.wordpress.org
Support Press – supportpress.svn.wordpress.org (i have no ideea what this is)
Code – code.svn.wordpress.org (check out this one http://code.svn.wordpress.org/wordpresscom-video-server/ )
Google Sumer of Code – gsoc.svn.wordpress.org
Source code for the mobile wordpress software:
Android – android.svn.wordpress.org
iPhone – iphone.svn.wordpress.org (same thing is ios.svn.wordpress.org)
BlackBerry – blackberry.svn.wordpress.org
Nokia – nokia.svn.wordpress.org
Windows Phone – windowsphone.svn.wordpress.org
WebOS – webos.svn.wordpress.org
date_default_timezone_set("Europe/Bucharest");
$begin = new DateTime( '2000-1-1' );
$end = new DateTime( '2001-1-1' );
$interval = DateInterval::createFromDateString('1 day');
$period = new DatePeriod($begin, $interval, $end);
foreach ( $period as $dt )
echo $dt->format( "Y-m-d\n" );
The above code will echo all dates from 2000-1-1 to 2001-1-1
function checkEmail($email) {
// Regex for checking email format
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
$valid = 0;
// Validate the email format
if (eregi($regexp, $email)) {
//split email address if its valid so we can check domain
list($username,$tld) = split("@",$email);
// Validate the domain
if (getmxrr($tld,$mxrecords))
$valid = 1;
} else {
$valid = 0;
}
return $valid;
}
The big picture: validate the mail with regex, then fetch the MX records for the domain, if the mx records exists the mail is somewhat valid.
Enjoy!
Quote: C’mon it is not practical to rewrite Photoshop.
Well it took me a bit to find out how to do that but here it is:
I am doing a all check-in client for Foursquare and Gowalla and this is problematic:
first get all venues from Foursquare (obviously more populated than Gowalla) and list them, then get the name from the selected one and compare it with the Gowalla names in the array.
And the rest is history.
The hard part is comparing 2 strings but i found a function that can do that, well found 2:
similar_text("This is a text", "A text this is", $percent); // yoda stile :')
echo $percent; // 42.8571428571
This is quite good because it results are ok for 2-3 word names comparison.
Else there is the Levenshein argorithm
$lev = levenshtein("This is a text", "A text this is");
echo $lev; // 14
The result is quite disappointing for me but maybe someone else needs it.
PS: This class may be useful some day or for some one.
And yes, i am remaking the Foursquare Mobile Client aka 4sqr
By the way, anyone got a better idea for comparing 2 strings?
Back to coding now.
Hello folks, just finished v2 of Give A Beer is kind of rough but will fix that in v3 hopefully.
oh please give a beer to me
cheers!