Jun 30, 2009

PHP Google Adword Keyword Tool Data Analysis

In learning PHP, I have done the script to get data from google adwords keyword tool and make an analysis report by them. That's interesting way to learn PHP really.
 
When I was doing that tool, I didn't know that the scraper is not good for the web site. Even I didn't know what's the meanings of scraper. After I read "scraper" in http://www.wikipedia.com, I think that I should close the whole project. 
 
Google is a very good tool in the Interent, and many of its tools are free and open, good and useful, even excellent. It helps many people, I think, including me. I won't hurt anything about google. I heard that google are overload in recently, and I think that many people try to use its service with greedy mind, that's hurt. We get to use the service freely, and we even don't need to pay it. We should appreicate them not just request something intensivly from them. Hope google will be better and better, help more people in the right way.
 
As a programmer, we get to learn something from others, and I like to learn from others. I think sometimes maybe I can help someone, if they get here and tell me what they want. I will help them as my pleasure. If you need any helps, please leave me a comment, you can add your email address in the comment <Just account and host, not exactly the format avoid the web email scraper>, I will not open the comment in public.
 
Anyway, I am just learning PHP, not very good at it. When I talk with you, indeed I am learning from you...^_^
 
Good Luck!

Who Care About Us?

I just saw the news from here http://www.informationweek.com/news/security/vulnerabilities/showArticle.jhtml?articleID=218101988 named "China Delays 'Green Dam' Mandate", well, I'd like to say that thanks for all people around the world inside or outside China to against that bad action.
 
That's not obiviously directly to help us in money or else, but it help us in courage, in justice, in freedom, in human right, and with goodwill. They did the right choice. For a long time we have been suffered from the bad and evil power under controlled by CCP, and I am wondering who are they? Are they Chinese? Why they so cruel to the people living in the same country and telling the same language? Crackdown people who pursuit freedom and human right, prosecute people who have the true and right belief, and cheat all people in the country with lies by saying that those national guys are state enemy, even more. I don't know what to say.
 
I can see that finally people around the world will hold together to see the truth, and against the evil power, like the whole around the world, they didn't come from China, but they did know the meanings of justice and the meanings of human been. They did right choice, and I hope that more and more Chinese people will did the right choice too.

Jun 16, 2009

Away3D A Powerful Way to Run 3D In Flash

Well, good morning.
Now I am working on a game by using Flash/3D programming. And there are many very good 3D open source libraries for us to learn and use freely (You need donate it if you use it in commercial way). I have gone around the Interent with google (http://www.google.com), and the best (I mean that it has good tutours and demo, lessons and API documents, so it's easy to learn. Others is good too.) is Away3D (http://away3d.com/tutorials). From now on, I will write a series of articles for learning Away3D programming, and hope that will help others anyway.
 
In fact, Flash CS4 has new 3D Class and it's very good, and if you are interested in it, the good book is: http://www.friendsofed.com/book.html?isbn=1430216085. This book is the best I have ever read since then, and it has many advance topic for programming. Especially authors of the book is very talent, one of authors is the one of founders of papervision3d.

Jun 11, 2009

Blogger Have Been Blocking In Mainland China

Not just blogger.com, anything concerned with the truth is blocked insanly by CCP. That's a big humiliation to Chinese People with free will and all people around the world with goodwill again. I am sorry to someone who comes here and asks something for help, and I can't respond easily to you. So if you have any wants, please send your contact with me, I will write to you and never show off it in public.

Good Luck!
http://freelancerworker.blogspot.com

Jun 7, 2009

Google Map Tutorial - make a shape around the zone

I am not good at google map API programming, just know little about it really. But I think that it's a good and power tool for applications in the Internet. There are many good tutorials in the Internet. And I think that the better way to learn google map API from different projects, whatever. If you have no goal, it's hard to learn something pratical and useful.
 
In this script, you may note that there are many coordinates in it. That's the shape coordinates data around the zone. If you want to get that from different area, you can use google earth and its kml function to retrieve it. That's easy to do. Note: all scripts comes from
 
 

1. add this in your html tag: xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml
2. add this in script tag inside the head tag:
src="http://maps.google.com/maps?file=api&v=2&key="
3. add this in a script:
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var polys = [];
var labels = [];
// === Algorithm from http://alienryderflex.com/polygon/
GPolygon.prototype.Contains = function(point) {
var j=0;
var oddNodes = false;
var x = point.lng();
var y = point.lat();
for (var i=0; i < this.getVertexCount(); i++) {
j++;
if (j == this.getVertexCount()) {j = 0;}
if (((this.getVertex(i).lat() < y) && (this.getVertex(j).lat() >= y))
|| ((this.getVertex(j).lat() < y) && (this.getVertex(i).lat() >= y))) {
if ( this.getVertex(i).lng() + (y - this.getVertex(i).lat())
/ (this.getVertex(j).lat()-this.getVertex(i).lat())
* (this.getVertex(j).lng() - this.getVertex(i).lng()) oddNodes = !oddNodes
}
}
}
return oddNodes;
}
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.addControl(new GOverviewMapControl(),
new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(5, 5)));
var center = new GLatLng(47.391700,-121.570800);
map.setCenter(center,6);
iconDot = new GIcon();
iconDot.image =""; // put your own img url here
iconDot.shadow = ""; // put your own shade img url here
iconDot.iconSize = new GSize(25, 18);
iconDot.shadowSize = new GSize(40, 18);
iconDot.iconAnchor = new GPoint(25, 18);
iconDot.infoWindowAnchor = new GPoint(25,18);
iconDot.infoShadowAnchor = new GPoint(18, 25);
var marker = new GMarker(center, iconDot)
map.addOverlay(marker);
GEvent.addListener(marker,"mouseover", function() {
marker.openInfoWindowHtml("") // put your html code here.
});
var label = "Washington";
var color = "#88ff00";
var pts = [];
pts[0] = new GLatLng(49.0023,-123.3208);
pts[1] = new GLatLng(49.0027,-123.0338);
pts[2] = new GLatLng(49.0018,-122.065);
pts[3] = new GLatLng(48.9973,-121.7491);
pts[4] = new GLatLng(48.9991,-121.5912);
pts[5] = new GLatLng(49.0009,-119.6082);
pts[6] = new GLatLng(49.0005,-118.0378);
pts[7] = new GLatLng(48.9996,-117.0319);
pts[8] = new GLatLng(47.9614,-117.0415);
pts[9] = new GLatLng(46.506,-117.0394);
pts[10] = new GLatLng(46.4274,-117.0394);
pts[11] = new GLatLng(46.3498,-117.0621);
pts[12] = new GLatLng(46.3384,-117.0277);
pts[13] = new GLatLng(46.2848,-116.9879);
pts[14] = new GLatLng(46.2388,-116.9577);
pts[15] = new GLatLng(46.2022,-116.9659);
pts[16] = new GLatLng(46.1722,-116.9254);
pts[17] = new GLatLng(46.1432,-116.9357);
pts[18] = new GLatLng(46.1009,-116.9584);
pts[19] = new GLatLng(46.0785,-116.9762);
pts[20] = new GLatLng(46.0537,-116.9433);
pts[21] = new GLatLng(45.996,-116.9165);
pts[22] = new GLatLng(46.0008,-118.033);
pts[23] = new GLatLng(45.9998,-118.9867);
pts[24] = new GLatLng(45.932,-119.1302);
pts[25] = new GLatLng(45.9278,-119.1708);
pts[26] = new GLatLng(45.9402,-119.2559);
pts[27] = new GLatLng(45.9354,-119.3047);
pts[28] = new GLatLng(45.922,-119.3644);
pts[29] = new GLatLng(45.9172,-119.4386);
pts[30] = new GLatLng(45.9067,-119.4894);
pts[31] = new GLatLng(45.9249,-119.5724);
pts[32] = new GLatLng(45.9196,-119.6013);
pts[33] = new GLatLng(45.8565,-119.67);
pts[34] = new GLatLng(45.8479,-119.8052);
pts[35] = new GLatLng(45.8278,-119.9096);
pts[36] = new GLatLng(45.8245,-119.9652);
pts[37] = new GLatLng(45.7852,-120.071);
pts[38] = new GLatLng(45.7623,-120.1705);
pts[39] = new GLatLng(45.7258,-120.211);
pts[40] = new GLatLng(45.7057,-120.3628);
pts[41] = new GLatLng(45.6951,-120.4829);
pts[42] = new GLatLng(45.7469,-120.5942);
pts[43] = new GLatLng(45.746,-120.634);
pts[44] = new GLatLng(45.7143,-120.6924);
pts[45] = new GLatLng(45.6721,-120.8558);
pts[46] = new GLatLng(45.6409,-120.9142);
pts[47] = new GLatLng(45.6572,-120.9471);
pts[48] = new GLatLng(45.6419,-120.9787);
pts[49] = new GLatLng(45.6529,-121.0645);
pts[50] = new GLatLng(45.6078,-121.1469);
pts[51] = new GLatLng(45.6083,-121.1847);
pts[52] = new GLatLng(45.6721,-121.2177);
pts[53] = new GLatLng(45.7057,-121.3392);
pts[54] = new GLatLng(45.6932,-121.401);
pts[55] = new GLatLng(45.7263,-121.5328);
pts[56] = new GLatLng(45.7091,-121.6145);
pts[57] = new GLatLng(45.6947,-121.7361);
pts[58] = new GLatLng(45.7067,-121.8095);
pts[59] = new GLatLng(45.6452,-121.9338);
pts[60] = new GLatLng(45.6088,-122.0451);
pts[61] = new GLatLng(45.5833,-122.1089);
pts[62] = new GLatLng(45.5838,-122.1426);
pts[63] = new GLatLng(45.566,-122.2009);
pts[64] = new GLatLng(45.5439,-122.2641);
pts[65] = new GLatLng(45.5482,-122.3321);
pts[66] = new GLatLng(45.5756,-122.3795);
pts[67] = new GLatLng(45.5636,-122.4392);
pts[68] = new GLatLng(45.6006,-122.5676);
pts[69] = new GLatLng(45.6236,-122.6891);
pts[70] = new GLatLng(45.6582,-122.7647);
pts[71] = new GLatLng(45.6817,-122.775);
pts[72] = new GLatLng(45.7613,-122.7619);
pts[73] = new GLatLng(45.8106,-122.7962);
pts[74] = new GLatLng(45.8642,-122.7839);
pts[75] = new GLatLng(45.912,-122.8114);
pts[76] = new GLatLng(45.9612,-122.8148);
pts[77] = new GLatLng(46.016,-122.8587);
pts[78] = new GLatLng(46.0604,-122.8848);
pts[79] = new GLatLng(46.0832,-122.9034);
pts[80] = new GLatLng(46.1028,-122.9597);
pts[81] = new GLatLng(46.1556,-123.0579);
pts[82] = new GLatLng(46.1865,-123.121);
pts[83] = new GLatLng(46.1893,-123.1664);
pts[84] = new GLatLng(46.1446,-123.281);
pts[85] = new GLatLng(46.147,-123.3703);
pts[86] = new GLatLng(46.1822,-123.4314);
pts[87] = new GLatLng(46.2293,-123.4287);
pts[88] = new GLatLng(46.2691,-123.4946);
pts[89] = new GLatLng(46.2582,-123.5557);
pts[90] = new GLatLng(46.2573,-123.6209);
pts[91] = new GLatLng(46.2497,-123.6875);
pts[92] = new GLatLng(46.2691,-123.7404);
pts[93] = new GLatLng(46.235,-123.8729);
pts[94] = new GLatLng(46.2383,-123.9292);
pts[95] = new GLatLng(46.2677,-123.9711);
pts[96] = new GLatLng(46.2924,-124.0212);
pts[97] = new GLatLng(46.2653,-124.0329);
pts[98] = new GLatLng(46.2596,-124.2444);
pts[99] = new GLatLng(46.4312,-124.2691);
pts[100] = new GLatLng(46.8386,-124.3529);
pts[101] = new GLatLng(47.1832,-124.438);
pts[102] = new GLatLng(47.4689,-124.5616);
pts[103] = new GLatLng(47.8012,-124.7566);
pts[104] = new GLatLng(48.0423,-124.8679);
pts[105] = new GLatLng(48.2457,-124.8679);
pts[106] = new GLatLng(48.3727,-124.8486);
pts[107] = new GLatLng(48.4984,-124.7539);
pts[108] = new GLatLng(48.4096,-124.4174);
pts[109] = new GLatLng(48.3599,-124.2389);
pts[110] = new GLatLng(48.2964,-124.0116);
pts[111] = new GLatLng(48.2795,-123.9141);
pts[112] = new GLatLng(48.2247,-123.5413);
pts[113] = new GLatLng(48.2539,-123.3998);
pts[114] = new GLatLng(48.2841,-123.2501);
pts[115] = new GLatLng(48.4233,-123.1169);
pts[116] = new GLatLng(48.4533,-123.1609);
pts[117] = new GLatLng(48.5548,-123.222);
pts[118] = new GLatLng(48.5902,-123.2336);
pts[119] = new GLatLng(48.6901,-123.2721);
pts[120] = new GLatLng(48.7675,-123.0084);
pts[121] = new GLatLng(48.8313,-123.0084);
pts[122] = new GLatLng(49.0023,-123.3215);
var poly = new GPolygon(pts,"#333399",3,1,color,.1);
polys.push(poly);
labels.push(label);
map.addOverlay(poly);
}
else {
alert("Sorry, Google Maps is not compatible with this browser.");
}
}
//]]>
5. add this in the body tag: onLoad="load()" onunload="GUnload()"
6. add this div tag in your body tag: id="map" style="height:400px;width:400px"

Jun 1, 2009

Personal View: Microsoft Bing is lame in China mainland

I have no such good skill to test that what search engine is the best, but I just think that www.bing.com is not good. As I was searching in microsoft www.bing.com, it's very sad that it seems they act different country as different information zone, so I hardly saw (never saw so far) good news from the good site located in different country except China. All news or informations are come from the local internet network, that's obviously misleading user to know the truth around the world.
 
I don't know why? Maybe I make wrong operations? or else? Even so, I have good experience in google, pretty good. In my searching experience in China mainland, Microsoft www.bing.com just like baidu is running by filtering all informations that the CCP fears what people can see, they fear that they lose their benefit in China Mainland, so they band over and lose its respect among intelligent people.
 
So perhaps I was wrong, I have little experience in using www.bing.com. In my opinions, I can see that why microsoft will be failed in internet, because they take too much mind to earn money not for helping people get more freedom and chance to touch the truth, to know the world truly. Human in the world need to know the thing which is true, that's the basic right of human been and basic requirement of human been. Although we need have the meat and drink every day, we are not living for that in deed. Did they think of internet carefully? Why internet is open and free all around the world? Why it become the widest bridge between all kinds of people all around the world? Even we have different languages and culture? But we become more close to each other by that connection, why? It's open and freedom, and it's the main goal inside the heart to know more things openly and freely, and try to know more the truth. Personal view, so if anything wrong with Microsoft, never mind.

May 26, 2009

PHP Regular Expression Resource

I have done some kind of PHP works by using regular expression, and it's very powerful I think. Even though at first I feel it's very hard to understand, yeah, it's a new thing for me, but as you have been using it in the project, you can feel that it's not hard at all. I have read something about Regular Expressions, in wiki, and you can find the most basic one, but not good enough to do with your job. I think, that is the good one for programmer in PHP:
 
I don't want to say anything about how to use it, because I am still a beginner. But I'd like to mention something here to know, if you are finding something within html, you should note that:
<.*>
<.*?>
<(\s|.)*?>
<[^>]*>
 
The first one will never work because '*' is greedy, so it will eat up '>'. along a '?' is to avoid this situation.
The second will never work well sometimes because '.' will never represent 'newline' by default
The third one will work well but it's not good enough, sometimes in PHP 'preg_match' will retain something between '(' ')'.
The forth seems not good but it's really the good one.
 
Blogger.com and blogspot.com are both blocked by the insane one here, you know what I mean.  
Good Luck!