Yahoo! goes very global by leveraging internationalized platform:
USA -- http://g.sports.yahoo.com/soccer/world-cup/
US Spanish -- http://g.espanol.sports.yahoo.com/futbol/mundial/
Argentina -- http://g.ar.sports.yahoo.com/futbol/mundial/
Brazil -- http://g.br.esportes.yahoo.com/futebol/copa/
Canada -- http://g.ca.sports.yahoo.com/soccer/world-cup/
Germany -- http://g.de.eurosport.yahoo.com/fussball/wm/
Spain -- http://g.es.eurosport.yahoo.com/futbol/copa-mundial/
France -- http://g.fr.sports.yahoo.com/football/coupe-du-monde/
Hong Kong -- http://g.hk.sports.yahoo.com/football/world-cup/
Italy -- http://g.it.eurosport.yahoo.com/calcio/mondiali/
Korea -- http://g.kr.sports.yahoo.com/football/world-cup/
Mexico -- http://g.mx.sports.yahoo.com/futbol/mundial/
Malaysia -- http://g.malaysia.sports.yahoo.com/football/world-cup/
Singapore -- http://g.sg.sports.yahoo.com/football/world-cup/
Intl EU -- http://g.eurosport.yahoo.com/football/world-cup/
UK & Ireland -- http://g.uk.eurosport.yahoo.com/football/world-cup/
Friday, December 4, 2009
Tuesday, May 19, 2009
Time for a Subversion and Eclipse Upgrade
My day started with another transition from CVS to SVN in Eclipse 3.3.2. (Europa). But no luck:
svn: Malformed network data
svn: No repository found in 'svn+ssh://svn.corp.yahoo.com/yahoo/media'
svn: Malformed network data
So hunting down the fix lead me to this error message:
Buckminster - Core (1.1.340.r10097) requires plug-in "org.eclipse.ecf"
Which, after trying to upgrade to the latest Eclipse via its own wizard, lead me to:
RCP Patch 2 for 3.3.1 (3.3.1.v20071204_331) requires feature "org.eclipse.rcp (3.3.1)
Which drove me to manually download the latest Eclipse, open it, select my previous workspace (it's the folder you usually work in with a .metadata file in its root), and install Subversion within this fresh new Eclipse.
I found no other way...
svn: Malformed network data
svn: No repository found in 'svn+ssh://svn.corp.yahoo.com/yahoo/media'
svn: Malformed network data
So hunting down the fix lead me to this error message:
Buckminster - Core (1.1.340.r10097) requires plug-in "org.eclipse.ecf"
Which, after trying to upgrade to the latest Eclipse via its own wizard, lead me to:
RCP Patch 2 for 3.3.1 (3.3.1.v20071204_331) requires feature "org.eclipse.rcp (3.3.1)
Which drove me to manually download the latest Eclipse, open it, select my previous workspace (it's the folder you usually work in with a .metadata file in its root), and install Subversion within this fresh new Eclipse.
I found no other way...
Monday, April 13, 2009
Flash CS3, ActionScript 3.0, JSON keep it simple tutorial
Here's what I recently found to work if you want Flash CS3 to read JSON structured data via ActionScript 3 and the Adobe core library:
1. Create the JSON file. My file is called numbers.php which looks like this and the JSON is echoed via PHP:
[ {"name":"Jaylo", "number":"3243251"}, {"name":"Jenny", "number":"8675309"}]
Note: having var People= {} ; People.numbers = [The above JSON data] seems to break Adobe's decode static function so JSON needs to be in pure form.
2. Download the adobe core library. After download, the files you should be concerned with are located in src/com/adobe/serialization/json.
3. Create a new layer in your flash file, label it "actionscript", select frame 1 on that layer, then hit F9 (Windows)/Option + F9 (Mac) to open the Actions window. Here's what the ActionScript 3.0 should look like inside of the Actions window:
/*Import all the classes you need (you can skip the next three imports if your ActionScript is NOT in an external package but in frame 1 of the main flash file. */
import flash.net.URLRequest ;
import flash.net.URLLoader ;
import flash.events.* ;
import com.adobe.serialization.json.JSON /*Path to the JSON class (in JSON.as). NOTE: make sure to keep all the classes in the original json folder together and that at the very beginning of each class file in the json folder, the file path after the word 'package' accurately reflects that path to the FOLDER in which all the classes are located. E.g. package com.adobe.serialization.json*/
/*Create the objects you need*/
var loader:URLLoader = new URLLoader() ;
var request:URLRequest = new URLRequest() ;
/*Connect to and load the data within the numbers.php file*/
request.url = "http://path_to_file.com/numbers.js" ;
loader.load(request) ;
/*Attach a listener to the loader object that will point to and fire a decodeJSON function upon completion of the file load.*/
loader.addEventListener(Event.COMPLETE, decodeJSON) ;
/*decodeJSON function will decode (convert the data into a Flash object) and present the data. Function will not return anything (:void).*/
function decodeJSON(event:Event):void {
var loader:URLLoader = URLLoader(event.target) ;
var People:Array = JSON.decode(loader.data) ;
/*Trace the JSON data, remember it used to look like this ([ {"name":"Jaylo", "number":"3243251"}, {"name":"Jenny", "number":"8675309"}])*/
trace(People[0].name) ; //Jaylo
trace(People[0].number) ; //3243251
trace(People[1].name) ; //Jenny
trace(People[1].number) ; //8675309
/*Or, you can also use a loop...*/
for (var key:Object in People) {
trace(People[key].name) ;
trace(People[key].number) ;
}
}
There you have it, a way to connect to a JSON file via Flash. Happy programming.
Download Example Package
1. Create the JSON file. My file is called numbers.php which looks like this and the JSON is echoed via PHP:
[ {"name":"Jaylo", "number":"3243251"}, {"name":"Jenny", "number":"8675309"}]
Note: having var People= {} ; People.numbers = [The above JSON data] seems to break Adobe's decode static function so JSON needs to be in pure form.
2. Download the adobe core library. After download, the files you should be concerned with are located in src/com/adobe/serialization/json.
3. Create a new layer in your flash file, label it "actionscript", select frame 1 on that layer, then hit F9 (Windows)/Option + F9 (Mac) to open the Actions window. Here's what the ActionScript 3.0 should look like inside of the Actions window:
/*Import all the classes you need (you can skip the next three imports if your ActionScript is NOT in an external package but in frame 1 of the main flash file. */
import flash.net.URLRequest ;
import flash.net.URLLoader ;
import flash.events.* ;
import com.adobe.serialization.json.JSON /*Path to the JSON class (in JSON.as). NOTE: make sure to keep all the classes in the original json folder together and that at the very beginning of each class file in the json folder, the file path after the word 'package' accurately reflects that path to the FOLDER in which all the classes are located. E.g. package com.adobe.serialization.json*/
/*Create the objects you need*/
var loader:URLLoader = new URLLoader() ;
var request:URLRequest = new URLRequest() ;
/*Connect to and load the data within the numbers.php file*/
request.url = "http://path_to_file.com/numbers.js" ;
loader.load(request) ;
/*Attach a listener to the loader object that will point to and fire a decodeJSON function upon completion of the file load.*/
loader.addEventListener(Event.COMPLETE, decodeJSON) ;
/*decodeJSON function will decode (convert the data into a Flash object) and present the data. Function will not return anything (:void).*/
function decodeJSON(event:Event):void {
var loader:URLLoader = URLLoader(event.target) ;
var People:Array = JSON.decode(loader.data) ;
/*Trace the JSON data, remember it used to look like this ([ {"name":"Jaylo", "number":"3243251"}, {"name":"Jenny", "number":"8675309"}])*/
trace(People[0].name) ; //Jaylo
trace(People[0].number) ; //3243251
trace(People[1].name) ; //Jenny
trace(People[1].number) ; //8675309
/*Or, you can also use a loop...*/
for (var key:Object in People) {
trace(People[key].name) ;
trace(People[key].number) ;
}
}
There you have it, a way to connect to a JSON file via Flash. Happy programming.
Download Example Package
Labels:
actionscript 3,
ajax,
as 3,
flash,
front-end,
json,
web development
How to do more than one table join in MySQL
I hope this saves people trying to learn this next level of MySQL a lot of time...
1. First, do your SELECT statement. You can select virtually any column and any number of columns from any table as long as you place the letter corresponding to the right table in front of the column's name (see Step 2).
SELECT a.animal, c.owner
2. Tell MySQL all the tables that will be involved in your join and substitute the names with letters to keep everything short.
FROM tableOne AS a, tableTwo AS b, tableThree AS c
3. Link all the tables you're dealing with together based on one and any common element between tables (I like to link one table to the next table in the same order I declared the tables in Step 2).
WHERE a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID
4. Get more picky with your search.
WHERE a.rowID = b.rowID
AND b.any_other_ID = c.anyotherID AND c.animal = "Cow"
or...
WHERE a.ghost LIKE "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
Etc....
Here's what the final query looks like...
SELECT a.animal, c.owner
FROM tableOne AS a, tableTwo AS b, tableThree AS c
WHERE a.ghost LIKE "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
Sample Result:
animal | owner : ghost (you won't see this column nor a.rowID, b.rowID etc.) :
Cow | mike : Scary :
Cow | jim : Scary :
Cow | bill : Scary :
Heck, lets join one more table while we're at it...
SELECT a.animal, c.owner, d.priceOfOwner
FROM tableOne AS a, tableTwo AS b, tableThree AS c, tableFour AS d
WHERE a.ghost = "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
AND c.rowID = d.rowID
Sample Result:
animal | owner | priceOfOwner : ghost :
Cow | mike | $1 : Scary :
Cow | jim | $2 : Scary :
Cow | bill | $5 : Scary :
Notice the importance of having a common column (rowID) in every table. Also, I usually open up as many browsers (running MySQL Admin) as the tables I want to join. I then load each table on each browser, minimize each browser, and place them side by side. I then write the most basic join statements (Steps 1-3) while going from one side of my computer screen to the other. I then make the query more picky from there (Step 4). Meanwhile, I test each query by using the MySQL Admin query box.
1. First, do your SELECT statement. You can select virtually any column and any number of columns from any table as long as you place the letter corresponding to the right table in front of the column's name (see Step 2).
SELECT a.animal, c.owner
2. Tell MySQL all the tables that will be involved in your join and substitute the names with letters to keep everything short.
FROM tableOne AS a, tableTwo AS b, tableThree AS c
3. Link all the tables you're dealing with together based on one and any common element between tables (I like to link one table to the next table in the same order I declared the tables in Step 2).
WHERE a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID
4. Get more picky with your search.
WHERE a.rowID = b.rowID
AND b.any_other_ID = c.anyotherID AND c.animal = "Cow"
or...
WHERE a.ghost LIKE "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
Etc....
Here's what the final query looks like...
SELECT a.animal, c.owner
FROM tableOne AS a, tableTwo AS b, tableThree AS c
WHERE a.ghost LIKE "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
Sample Result:
animal | owner : ghost (you won't see this column nor a.rowID, b.rowID etc.) :
Cow | mike : Scary :
Cow | jim : Scary :
Cow | bill : Scary :
Heck, lets join one more table while we're at it...
SELECT a.animal, c.owner, d.priceOfOwner
FROM tableOne AS a, tableTwo AS b, tableThree AS c, tableFour AS d
WHERE a.ghost = "Scary" AND a.rowID = b.rowID
AND b.any_other_ID = c.any_other_ID AND c.animal = "Cow"
AND c.rowID = d.rowID
Sample Result:
animal | owner | priceOfOwner : ghost :
Cow | mike | $1 : Scary :
Cow | jim | $2 : Scary :
Cow | bill | $5 : Scary :
Notice the importance of having a common column (rowID) in every table. Also, I usually open up as many browsers (running MySQL Admin) as the tables I want to join. I then load each table on each browser, minimize each browser, and place them side by side. I then write the most basic join statements (Steps 1-3) while going from one side of my computer screen to the other. I then make the query more picky from there (Step 4). Meanwhile, I test each query by using the MySQL Admin query box.
How to get Hotmail to receive email sent via PHP
My Story
I had an excuse to create my first email invitation system driven by PHP several months ago. And thanks to PHP, the learning process was effortless…
mail($To, $subject, $message);
Voila, users magically will find an invitation in their inboxes. I tested the function several times by sending messages to Yahoo Mail, Gmail, and Hotmail to see what my potential invitees would be seeing. All the emails looked fine. A few months later, I went to send an automated invitation to a hotmail friend and they never received the email. Nope, not even in their junk folder, the email vanished and I had to accept this.
Yet, I still did a little research and found that I potentially got myself blacklisted by Hotmail. Yes, only Microsoft thinks I am a massive spammer and not Yahoo or Google.
With a little more research I found that other people share my problem. Including Mxdwn.com: a site that has been serving legitimate content to thousands of people for years.
Possible Solutions
First check to see if you were black listed by sending an email from what_ever_name@your_domain.com to a Hotmail account.
If it bounces back or never arrives, chances are you’re on the list. Also, try checking your server’s error log after you send an email.*
Contact your hosting company, Hotmail, and/or your ISP to get off the list.
Pray.
Believe it or not, that’s all I found when it comes to solutions (made up the last one). Most of the dense documentation out there mainly talks about how to decrease your chances of getting black listed in the first place.
Preventive Measures
I dug up the following documentation to increase the probability of having Hotmail receive your email.*
Make sure you have an unsubscribe link in emails you send.*
Check to see if your emails may look like spam to hotmail and polish them up if they do.
Try to keep your hotmail list clean.
Make sure your DNS report looks pretty.*
Publish your SPF record*, although I also found how this did not work for one person. Note, some of this stuff can get tricky.
Make sure you have Reply-To in your mail headers and that you fully disclose where the email is coming from (discussed below) .
Ian, has one last quick simple yet effective preventive measure:
Make sure your PHP function looks like this…
$header = 'From: "Any Name" <invitation@your_domain.com>\n Reply-To: support@your_domain.com';
$additional_input = '-f your_ftp_login@your_host’s_address.com';
mail($To, $subject, $message, $header, $additional_input);
A quick way to get the your_host’s_address part is to send an email with the first function I had in this post to your own email account (not a hotmail one!).
For example, when I ran the most basic PHP mail function sending an email to my Gmail account, I received an email from nobody@montreal.dnsdc7.com.
So my email function now looks like…
$header = 'From: "'.$userName.'" <invitation@your_domain.com>\n Reply-To: support@your_domain.com';
$additional_input = '-f MyCoolFTPLogin@montreal.dnsdc7.com';
mail($To, $subject, $message, $header, $additional_input);
End Note
Test email by sending to only Gmail and/or Yahoo Mail.
* = This needs to be explained by someone in a KISS (Keep it Simple Stupid) way.
I had an excuse to create my first email invitation system driven by PHP several months ago. And thanks to PHP, the learning process was effortless…
mail($To, $subject, $message);
Voila, users magically will find an invitation in their inboxes. I tested the function several times by sending messages to Yahoo Mail, Gmail, and Hotmail to see what my potential invitees would be seeing. All the emails looked fine. A few months later, I went to send an automated invitation to a hotmail friend and they never received the email. Nope, not even in their junk folder, the email vanished and I had to accept this.
Yet, I still did a little research and found that I potentially got myself blacklisted by Hotmail. Yes, only Microsoft thinks I am a massive spammer and not Yahoo or Google.
With a little more research I found that other people share my problem. Including Mxdwn.com: a site that has been serving legitimate content to thousands of people for years.
Possible Solutions
First check to see if you were black listed by sending an email from what_ever_name@your_domain.com to a Hotmail account.
If it bounces back or never arrives, chances are you’re on the list. Also, try checking your server’s error log after you send an email.*
Contact your hosting company, Hotmail, and/or your ISP to get off the list.
Pray.
Believe it or not, that’s all I found when it comes to solutions (made up the last one). Most of the dense documentation out there mainly talks about how to decrease your chances of getting black listed in the first place.
Preventive Measures
I dug up the following documentation to increase the probability of having Hotmail receive your email.*
Make sure you have an unsubscribe link in emails you send.*
Check to see if your emails may look like spam to hotmail and polish them up if they do.
Try to keep your hotmail list clean.
Make sure your DNS report looks pretty.*
Publish your SPF record*, although I also found how this did not work for one person. Note, some of this stuff can get tricky.
Make sure you have Reply-To in your mail headers and that you fully disclose where the email is coming from (discussed below) .
Ian, has one last quick simple yet effective preventive measure:
Make sure your PHP function looks like this…
$header = 'From: "Any Name" <invitation@your_domain.com>\n Reply-To: support@your_domain.com';
$additional_input = '-f your_ftp_login@your_host’s_address.com';
mail($To, $subject, $message, $header, $additional_input);
A quick way to get the your_host’s_address part is to send an email with the first function I had in this post to your own email account (not a hotmail one!).
For example, when I ran the most basic PHP mail function sending an email to my Gmail account, I received an email from nobody@montreal.dnsdc7.com.
So my email function now looks like…
$header = 'From: "'.$userName.'" <invitation@your_domain.com>\n Reply-To: support@your_domain.com';
$additional_input = '-f MyCoolFTPLogin@montreal.dnsdc7.com';
mail($To, $subject, $message, $header, $additional_input);
End Note
Test email by sending to only Gmail and/or Yahoo Mail.
* = This needs to be explained by someone in a KISS (Keep it Simple Stupid) way.
Subscribe to:
Posts (Atom)