Archive for May, 2009

Zend Studio 5 doesn’t list php files

I have to say that this is the best discovery this week, and it seems very stupid when it is solved. The php files can not be listed in zend studio.

Solution:

Just open the file manager window, at the bottom there is a drop-up list which let you choose what kind of files you want to list.

I got this problem one year ago, and searched everywhere but couldn’t find the solution. At that time, I reinstalled zend studio, still doesn’t work. Holy crap. It is solved this way.

A tool to increase blog visitor count

For some blogs, if you refresh the page, the count will increase such as blogs of sina, sohu, etc. I make the a java tool that call IE to open the blog page and close IE, repeat this process until you get a million count. It is very easy to increase the count using this tool, but I’m not sure how much benefit the number can bring to you.

The windows executable file is here. I have tested it on XP and Vista, but you will need first to install Java on your computer, if it is not installed.

If you are interested in the code, read the following part. First, I use regular expression to get valid URL for IE to open it. Then call IE to open the address. This problem is really simple, but shows you how to use launch4j to wrap your jar file and make it a windows executable files.

import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
public class OpenClose {
	public static void main(String[] args) {
		System.out.println("plase input a full valid web address, such as http://www.google.com");
		while (true) {
			Scanner in = new Scanner(System.in);
 
			String url = in.next();
			System.out.println("You input: "+url);
 
			// regular expression goes here
 
			Pattern pattern = Pattern.compile("http://.*");
			// In case you would like to ignore case sensitivity you could use
			// this
			// statement
			// Pattern pattern = Pattern.compile("\\s+",
			// Pattern.CASE_INSENSITIVE);
			Matcher matcher = pattern.matcher(url);
			// Check all occurance
			if (matcher.find()) {
				// System.out.print("Start index: " + matcher.start());
				// System.out.print(" End index: " + matcher.end() + " ");
				// System.out.println(matcher.group());
 
				while (true) {
					try {
						Process p = Runtime.getRuntime().exec(
								"C:\\Program Files\\Internet Explorer\\iexplore.exe \""
										+ url + "\"");
						Thread.sleep(5000);
						p.destroy();
						System.out.println("executed! " + p.waitFor());
					} catch (Exception e) {
					}
				}
			} else {
				System.out.println("please input a valid address!");
			}
		}
	}
}

Convert java jar file to exe

Using eclipse or Netbeans, you can get executable jar files, but this jar file can not be launched by the most novice users, especially if the program need user’s input to proceed. To conver jar file to windows executable file, there is a good tool called launch4j. You can easily convert a jar file to exe, then let common users use your program. Cool! It’s free, as normal.

The following is other features it gives:

Continue »

Java code: Open IE browser and close it

I want to refresh my blog on Sohu to increase the visitor count. The following is the code for open IE browser and then close it. This will be done every 5 seconds, and in one day the count should be able to increase 3600*24/5 = 17280. So If you open your computer 10 days,  the count will become 172800. That will be an popular blog. It doesn’t work for your website, but seems to work for those blogs site.

Continue »

Summary of making money with Google Adsense

My hard work is finally paid off. I’m very excited to share my experience here. This is the first time I make some money from my website. I am so satisfied and encouraged.

“No pain, no gain”.  To earn something, you have to pay. This is the basic attitude to make a website that can bring your money. One who has right attitude to do things can surely make a good website, a useful site that can provide some useful information or service to it’s visitors.

Continue »

CSS Font and Text Wizard v1.0

I made a tool to generate font and text style css. Just finish it and put it on line.  I will see if people like it. http://programcreek.com/projects/

Currently, it doesn’t support adding multiple font-family which is normally requirement of development. Because the browser will pick the first font-family it can recognize.  Now you can only choose from the most common font families, and if you want to add a sepecific you have to input manually. Also some other features need to be improved.

An idea to make a decision support tool (3) — Implementation

Here is the very simple implementation of the idea I did using Netbeans. Every components in the form is hard coded and can not changed. However, when it comes to real users, a user may change the number of the pros and cons list.  Here is the link to download this small tool. I just completed the prototype idea, and it just shows how it gets to work. Actually, I think this should be extended to a lot of fancy ideas, such as make it a free iPhone application, or a web page and add some professional psychology idea.

An idea to make a decision support tool (2)

The following is the example program that demonstrate how this idea will work. I’m not sure this is the best way. So if anyone who sees this post can provide any suggestions, I will thank you. Maybe it the idea is improved by anyone, I will give the person an award. We will discuss about that later, but first take a look at the following screen shot.

Continue »