Not Equal C && !=C && 不等于西
RSS icon Email icon Home icon
  • How to add Google adsense for search into the website

    Posted on May 29th, 2010 Sean 2 comments
    • 1. Go to Google Adsense and sign into your account (if you don’t have it, need a google account to create one)
    • 2. Click the “AdSense Setup” tab
    • 3. Select AdSense for search as the product
    • 4. Select your search type — for now, choose “Only sites I select”, later will modify the code allow user to choose what type of search they do
      (Click pics for bigger view)

    • 5. Enter the site you specify to search across
    • 6. Design your search box by choosing Google Logo placement, background color, and text box size.
    • 7. Choose your search results page, Ad location and style — for me, I choose “Open results within my own site”, and for the field of “Enter URL where search results will be displayed” enter “http://search.seantian.com” (a subdomain I wanna keep my search engine with)

    • 8. Enter a name for search engine and click “Submit and Get Code”
    • 9. You will get two code for “Search Box Code” and “Search Results Code”, paste the “Search Box Code” into the page where you’d like your search box to appear, paste “Search Box Code” and “Search Results Code” into the page where you would like your search results to appear.

    • 10. Modify the “Search Box Code” in the search results page like below, allow user to choose only search within the specify website, or entire web
      • The original code:
      • The modified code:

         Check out how it looks like Sean’s Search

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    667 views
  • How to get Latitude and Longitude values of an address on Google Maps

    Posted on May 6th, 2010 Sean 6 comments

         Basically Google Maps do not display the latitude and longitude values for an address, but you still can use some methods to find it.

    • Run a trick javascript to find it
      • 1. Find an address you want to get the values for
      • 2. Click the address to make it showing on the center of Google Maps
      • 3. When the location you want is in the center of the map, copy and paste this code into the location bar of your browser and press enter:
        javascript:void(prompt('',gApplication.getMap().getCenter()));

    • Use Google Labs to find it
      • 1. Go to Google Maps and login your Google account
      • 2. Go to the upper-right corner and select the green iconof Google Labs
      • 3. Scroll down to the LatLng Tooltip and select it’s Enable radio button.

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    694 views
  • How to fix comments submitting problem on WordPress

    Posted on May 1st, 2010 Sean Add comments

         When submit a comment on WordPress, if you see an error massage like “Error 404 Not Found” something, most likely need to modify the “.htaccess” file of PHP.
         The “.htaccess” file is located on the root directory of your hosting. find the line like showing below:

         This is a function to protect your blog from spam. You can simply just comment the line, then you are all set:

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    410 views
  • Setting up virtualhost in Apache on Windows XP

    Posted on April 27th, 2010 Sean Add comments

    1.Configuring Apache
         The first file need to edit is the Apache httpd.conf file. Usually, it’s under the root folder where the Apache was installed.
         If IIS is also used on Windows, IIS will use 80 port first, so need to change the port number of Apache server, e.g. change port 80 to 8080

         Then, add new virtualhost

         In the end, need to define the permissions of the virtualhost directory:


    2.Resolving the DNS issue
         Obviously, if typed “http://sub.localhost” in your browser, it would not be found by your Internet provider’s DNS server, and still need modify the files called “hosts”. It’s under “C:\Windows\system32\drivers\etc\”, and just add the new sub domain to the file:

  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...Loading...
    829 views
  • PHP None-Thread Safe & Thread Safe区别(非线程安全与线程安全)

    Posted on April 22nd, 2010 Sean 1 comment

         由于PHP是在Linux/Unix系统下开发的,而又由于Linux/Unix系统是采用多进程(process)的工作方式而Windows系统是采用多线程(thread)的工作方式。如果在IIS下以CGI方式运行PHP会非常慢,这是由于CGI模式是建立在多进程的基础之上的,而非多线程。一般我们会把PHP配置成以ISAPI的方式来运行,ISAPI是多线程的方式,这样就快多了。但存在一个问题,很多常用的PHP扩展是以Linux/Unix的多进程思想来开发的,这些扩展在ISAPI的方式运行时就会出错搞垮IIS。因此在IIS下CGI模式才是 PHP运行的最安全方式,但CGI模式对于每个HTTP请求都需要重新加载和卸载整个PHP环境,其消耗是巨大的。
         为了兼顾IIS下PHP的效率和安全,微软给出了FastCGI的解决方案。FastCGI可以让PHP的进程重复利用而不是每一个新的请求就重开一个进程。同时FastCGI也可以允许几个进程同时执行。这样既解决了CGI进程模式消耗太大的问题,又利用上了CGI进程模式不存在线程安全问题的优势。
         因此,如果是使用ISAPI的方式来运行PHP就必须用Thread Safe(线程安全)的版本;而用FastCGI模式运行PHP的话就没有必要用线程安全检查了,用None Thread Safe(NTS,非线程安全)的版本能够更好的提高效率。

  • 1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
    Loading...Loading...
    5,523 views