One of the great functions of Eclipse IDE is that it can be tightly integrated to the any repository, which is very useful especially you want to share your codes with others and works on them together. Even, CVS is a very useful tool for your own since you can easily track the changes you make your source codes while you are developing your programs on Eclipse. Here, in this blog we try to set up a CVS system on Windows XP and we will explore the usage of it within different programs. Notice that in order to this we use the service provided by Freepository which is the perfect online CVS repository service that you can deploy your codes.
Requirements
First of all the instructions provided here is on Windows XP machine so I do not know whether it can be used in other operation systems but it should work if you apply some modifications whenever necessary for your system.
The programs that you should have during this process are Eclipse, TortoiseCVS. The versions of these programs that I have are:
TortoiseCVS 1.8.26 (CVSNT 2.5.03 Build 2260)
Eclipse 3.1.2
Also you need an account on Freepository. And you should have at least one installed repository. During this blog the name of the repository I have is "cvsroot". In order to use it for Eclipse or TortoiseCVS, we need to see the parameters of that repository. To do that, in the website of the Freepository, we select the repository "cvsroot" and then click "My cvsroot". If it is the first time, the server warns you that you should first create secure entries. Thus, you should click the link left to "My cvsroot" which is "Secure ID entries". Then you can click "My cvsroot". If everything goes well, then you can have a table as following which gives you the parameters you need to configure Eclipse or TortoiseCVS:
We will return these parameters later during the installation.
Installation Process
First of all, in order to use CVS function on Windows machine, we need to set up CVSNT. Since the installation of TortoiseCVS does this already, we do not need to install it separately.
Configuring TortoiseCVS
After installing TortoiseCVS and restarting the PC, we move on any folder in any directory in the file system and right click on the mouse.
Then select "CVS" > "Make new Module". The screen will look like as the following:
Here you should supply the following information:
Protocol : SSL(:sserver:)
Protocol parameters : version=1
Server : freepository.com
Port : the port number that you see in the table of parameters of your Freepository repository.
Repository folder : the information under "fq cvsroot" of the table above.
User name : your user name.
Module : if you already have a module, then write its name or write "." (without quotation marks).
When you click "OK", TortoiseCVS will attempt to connect to the Freepository Server and prompt for the password. Write your account password and get a connection to the repository. If everything goes successfully you will have a connection to the repository. Again in an any folder right click on an empty place and click to "CVS checkout" to see if everything works fine.
Configuring the Eclipse
Before configuring the Eclipse, we need to install CVS SSL plug-in for Eclipse. To download the version of that plug-in for the usage of Eclipse 3.1, click the link here:
http://home.arcor.de/rolf_wilms/cvsssl/rwi.eclipse.team.ccvs.ssl_3.1.0.zip
After downloading the plug-in, extract the context to the Eclipse's "plugins" folder and restart the Eclipse.
To start configuring the Eclipse, first of all we need to switch to CVS perspective by "Window" > "Open Perspective" > "Other" > "CVS Repository Exploring".
In the left pane, right click on an empty place and select "New" > "Repository Location". The screen should look like this:
The settings should be as the following:
Host : freepository.com
Repository path : the information under "fq cvsroot" of the table above
User : your Freepository account name
Password : your password
Connection type : cvs-sserver
Use port : the port number that you see in the table of parameters of your Freepository repository
Also check "Validate connection on finish" and "Save password" settings for your inconvenience.
Just after that click "Finish" and if everything goes well, you can establish a connection to your Freepository repository from Eclipse.
After that you can create new projects and deploy them to your CVS repositories. I will discuss the usages of CVS repositories and modules both on the Eclipse projects and TortoiseCVS in further blogs.
2006/08/14
CVS : Setting up Eclipse and TortoiseCVS for Freepository
Tags: cvs, eclipse, freepository, tortoiseCVS
Installing PHPEclipse on Eclipse including Debugging Engine
To write PHP codes, you do not need to have a sophisticated IDE or program that helps you. Because PHP script language is perhaps one of the easiest script languages in the world. On the other hand, when your project tends to increase in the size and you do not know exactly where it is going, it will be your advantage to use some alternatives IDEs in the market.
One of the best ones is Eclipse. It is easy to use and of course free to develop your PHP codes. On the other hand, you should install the packages that you are required carefully. I spent hours on the internet to find out a very good way of doing that. There are plenty of good resources on the internet. So I thought that I can contribute to those by writing this blog.
Well, first of all I use a PC running on Windows XP, so all the instructions that I give here will depend on it. To start with I use Eclipse 3.1.x (I need to check for the exact version later). Actually I installed WTP-all-in-one-sdk since it includes Eclipse 3.1 along with Web Standards Tools. This package is very useful since you do not need to install the packages you need in web development separately. Of course, you also need to install PHP engine prior to the PHP development. For that I preferred to use PHP 5.1.2. And I used Windows Installation package so that I do not need to extract the zip files required to certain folder that is alternative to Windows Installation package. By the way, I have to tell that I do not use XAMPP that is I installed Apache Server, MYSQL Server and PHP separately.
So far so good, our configuration is as following:
Eclipse 3.1.2
WTP 1.0.2
PHP 5.1.2
The very first thing we need to do is to install PHPEclipse (the version I use is 1.1.8). Well the installation can be done very different ways but I preferred to extract the zip files to Eclipse folder. When I started to use Eclipse I managed to create a "PHP Project" and a few lines of codes of PHP worked fine on the program. However, the real question for me is to use debugging features and this is where all the troubles occur.
Debugging
Well, to do that we need to certain things. We need to install DBG Debugger. The version I used is 2.13.1 and it can be downloaded here:
http://dd.cron.ru/dbg/downloads.php
In that side, you only need to download the modules so you do not need to download listeners. In that zip file find the correct DLL for your version of PHP. For instance I use PHP 5.1.2 so I find the file "php_dbg.dll_5.1.2" and rename it with "php_dbg.dll" and put it under Windows root folder (in my case it was "C:\Windows").
At this point, you need to change some lines in your "PHP.ini" file. It can be found under the Window's root folder. Here are the things you need to do in that file:
Find out the lines starts with "extension_dir" and the change the entire line as following (do not include the codes in brackets):
extension_dir = "c:/windows/" (Here, this is my root folder for windows).
Then, at the end of the file, put the following lines of codes:
[debugger]
extension=php_dbg.dll
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=localhost (host names or IP's that are allowed to use debuggers)
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16
Save the file and close the file.
Now it is time to test the settings by using Eclipse. Start your Eclipse and create a new PHP Project named "test3". Then create a php file named "debugTest.php" and add the following line of codes in it:
Now to make a blue dots there, go to that line and double click on that area. This indicates a break on the program which we will use in debugging. Now, change the perspective to Debug ("Window > Open Perspective > Debug"). After that, click "Run > Debug.."
In the File tab, change the "Name", "Project", and "File" fields as indicated in the image below:
Then move to "Environment" tab and in "Remote Debug" sub tab, tick "Remote Debug" and write the absolute path of your project to the text field of "Remote Sourcepath". It will look like as this:
Finally, in the "Interpreter" subpart, point the absolute location of where your PHP program's application file is located:
Then Click the "Debug" to run the debugger. If everything goes well (I hope), you will have a screen like that:
As you can see, from now on by using the same approach, you can debug your PHP files by using Eclipse. If you have some problems, you can use the information provided here:
http://www.plog4u.org/index.php/Using_PHPEclipse_:_Installation_:_Installing_the_DBG_Debugger
It is very good resource and deal with some problems that you can have.
That's all. Enjoy your PHP codes in Eclipse.
Tags: debugging, eclipse, php, phpeclipse
A few words about installing java apps on Razr V3
Right after you enjoy sleek design of Razr V3, you wonder whether the software is as good as the design. One of the weak points about the phone is that by default it does not allow installing java application using the associated usb cable or bluetooth connection. Well, the only way you can install a java application is that you have to download it over the air (OTA) which means that you should point the URL of the application internet by using, say, the mini browser on the phone, and then download the associated files for the application.
On the other hand, this approach can be costly if you want to install applications so often for design purposes (which is my first intention, I really like to program those small applications and see that they are working in my phone). Normally, I am planning to write a blog in details that gives the step by step instructions. Indeed, I came across this link that gives a fair guide that can be very helpful. You can reach it from here:
http://viciousglitch.tripod.com/motorola.htm
Well, according to the author, some people even tried to sell the instructions on Ebay. Well, it is free and is worth trying.
By the way, there is an another way that you can activate the java application loader but it needs some kind of concept called "seem editing" and it can be very dangerous if you are not careful enough or do not know what you are doing. Still, it is tempting to do so after the moment you see that there is no limit for you to change the software on the phone by seem editing. :)
Syncronization with Motorola Razr V3
One of the key functions of Motorola Razr V3 is that it comes up with a calendar that can be easily synchronized with Microsoft Outlook. After installing the latest version of Motorola Phone Tools and having a proper connection with the phone, you can easily synchronize the calendars. Here rather than explaining how you can manage synchronization, I will try to give some tricks that solve the problems that I face while synchronizations:
- One of the bad points of the calendar that comes with Motorola Razr V3 is that it does not support the reoccurrences of events that last before specific date or specific amounts of occurrences. Therefore in order to avoid such cases, you should set those events reoccurred in every week, month or years than delete those occurrences that you do not want to have.
- It is always a good practice not to determine the priority between the cell phone and the computer. Let the program to ask you what to do in those kinds of situations those conflicts occur. Otherwise, you might lose some valuable data (such as contacts, information about where an event occurs, etc).
- Before going into synchronization, you should always make backup of your data. Of course, it does not mean that every time you should make backups of your data. But you should periodically especially before some significant changes occur.
That’s all for now. I am planning to add more if I have time for that.
User Authentication in Apache
Say you want to restrict your visitors by user authentication mechanism in your Apache web server. There are several ways of doing this, but I found the followings are the most simple and easiest way of doing this. After restarting Apache server, you should be able to see effects of these changes when you access your web pages with your web browser. The password and user name screen should appear. After giving the correct combination, you should access your web pages. If this is not the case or there are some errors, the very first thing you should look is the Apache's error log file (located in C:\Apache\logs). Reviewing this will give you best clues of what went wrong. Please feel free to ask me questions by using comments in this blog.
In this case, we want to give access to our web server for those that supply the correct user name and password. First of all, we need to create the file that usernames and passwords will be restored.
Before, going into the details of how we can do that, there are a few points about this file. We should save it to the folder that are not accessible through our web folders (e.g. it should not be located in the C:\Apache\htdocs folder). The good place for that is the root directory of the Apache server (e.g. C:\Apache). Even if someone gets that file anyhow, since the passwords in that file is encrypted by MD5 algorithm (default in Windows system), he will not be able to get exact user name and password combination.
With these in mind, we have to run the utility that makes the files for user lists. This program is named htpassword and should be located in the bin directory under the installed Apache root (e.g. c:\Apache\bin\). By using console, we write the followings:
htpasswd -c ../users can
Here, "-c" is used for the first time in order to create the user file. and the "../users" describes the name of the file "users" and the location of it (by relative path, it means C:\Apache\ since right now we are in C:\Apache\bin\). "can" is the name of the user we specify.
Then the console prompts for the password for that user. We verify this password in the next step. If everything goes well, you will get "Adding password for user can" indicating that the operation is finished.
At the second part, we have to declare to Apache that we need basic authentication in accessing the web server. To do this, we open the Apache configuration file (located in C:\Apache\conf\httpd.conf). We find the lines that includes
Order allow,deny
Allow from all
Just after that, we include the following lines:
AuthName "restricted stuff"
AuthType Basic
AuthUserFile users
require user can
AuthName will appear at the top when the user name and password screen in web browser appears. And the AuthType is the method we use in this example. AuthUserFile is the file that user name and password is stored (here it is relative to the path C:\Apache\). Finally require user is used for the users that we want to give access to our web servers.
Here, there are a few remarks that might help you:
Disabling Directory Listing in Apache
One of the things that sometimes become nasty is that Apache by default lists all the files in the same directory if that directory does not contains the default index page (e.g. index.html, index.htm).
To disable Apache's directory content listing feature, you should configure the Apache Configuration file (httpd.conf that is located in the "conf" directory of the Apache installation directory).
Find the line that includes "Options Indexes" that is couples of lines after the line "
To illustrate, the following codes:
...
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options Indexes FollowSymLinks MultiViews
...
is replaced with:
...
# This may also be "None", "All", or any combination of "Indexes",
# "Includes", "FollowSymLinks", "ExecCGI", or "MultiViews".
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
Options -Indexes FollowSymLinks MultiViews
...
Changing Directory Index in Apache
When any directory is called from Apache web server, the web server checks whether the directory has index.html file. If it is not, it will show all the files that are in that directory. If someone wants to change the default index file or add more files, he should modify the Apache httpd.conf Configuration File.
htttpd.conf file is located under the "conf" directory of apache installation directory (for instance C:\Apache\conf). After opening it with notepad or other text editor, find the tag named "directory". By default, it has only one file named "index.html". By separating with comma, you can add other files such as index.php, default.php, index.htm.
An example of the same line is as follows:
DirectoryIndex index.html index.php
Firefox with Google Toolbar: A Great Couple
Recently, one of my friends sent me an interesting shockwave flash file (swf) and asked me to look at it and wanted to hear my thoughts about it. On the other hand, I could not find a program that opens swf files. Here, Internet Explorer, since it is a browser, is supposed to view it. On the other hand, every time I tried, I got a silly error indicating it is belong to forbidden sites. That drove me crazy and I started to find workarounds.
Hundreds of trials, I could not come up with a player that plays swf files. Even Macromedia web site lacks of it. Therefore, something occurred my mind and I asked myself that “Why don’t I use another browser?”.
Since, I am kind of using an advertisement program of Google (yeah, those huge ads), I clicked the link at the left of my web pages and downloaded the Firefox with Google Toolbar.
Well, prior to this, I had some experience with Firefox, and to tell the truth, I did not really like it since I am true fan of Internet Explorer and I really stocked with it. Well it is always easy to get habits, and it is always difficult to quit (though I am one of those quite a few lucky people who witnessed the Netscape Navigators’ triumph over IE).
But the work that both Firefox and Google community put together is quite fascinating just after a few trials of which-button-does-which-job.
Well, I gotta tell you that Google Toolbar is bundled with Mozilla Firefox so perfectly that it enables you to exploit the web faster and efficient than before. Let me briefly discuss the advantages of Firefox over IE:
Moreover, I really like to point the perfect tool: Google Toolbar. I think that Google is one of those things that become necessity in our lives. My eight-years-old cousin complained me he can’t find gogle (Turkish pronunciation of Google) just after I set-up his new computer. And I was quite surprised when one of my uncles who is technologically illiterate -he uses his 3G mobile phone just for calling-, suggesting my father to use Google, to get the address of the bank he works with. Google is becoming so popular that, perhaps, Bill Gates should review his claims that their main rival is IBM.
Enough with anecdotes, here is the list of what Google Toolbar offers:
Well, I have to acknowledge that Google Toolbar can be used with IE but it always seems to me that Google Toolbar becomes superficial and it is not integrated to IE as tight as Firefox.
Of course, there are some weak points for FwGT (odd to remember using abbreviation for that at the end of writing). Turkish is not allowable when you download the product (though Firefox has Turkish version). And similarly, some functions of GT is only limited to English and other popular Western languages and some services of GT is offered in limited geographical places (well US or UK for instances).
Well, back to the point that I started, with Firefox, I was able to open the swf file just after I downloaded flash plug-in. That is very unlikely in the internet age, -to be able to get back where you start.
Tags: firefox, google toolbar
Email Settings for Razr V3
Motorola RAZR V3 comes with a small application that is a simple e-mail client. It supports POP3 / IMAP and SMTP. After couple of tries, I could not be able to set up a simple account for this simple client for Motorola Razr V3. I was pretty sure that the settings of my GMAIL account are ok but still I could not connect to the server.
After several hours of working on it (though I do not count the bill I incurred), I finally managed to get the decent method of reaching the server by using the email client in Motorola Razr V3. By the way, I have to say that that customer representative in Turkcell was very angry on the phone that I called with a phone that I would like to set. She insisted too much to call her with another phone and then get the parameters. I think someone should make it clear for them that customer can take notes.
Well, here are the secret settings that you can not find over the web site of Turkcell. This is for Motorola Razr V3 but similar settings can be used in Motorola V series.
ISP Settings
Connection Type: GPRS
APN address: internet
User name: leave empty
Password: leave empty
DNS IP: leave empty, if not able to do so, leave as 0.0.0.0
Email Provider: Custom
Protocol: POP3
User ID: username@gmail.com
Password: your password
Sending Host: smtp.gmail.com
Sending port: 587 (Here is the key for sending mail with GMAIL, it is odd but other ports cannot be reached!)
Receiving host: pop.gmail.com
Receiving port: 995
Return address: username@gmail.com
Name: Your Name
Cleanup: None (is used for cleaning mails from the server after the days you specify)
Save on server: Yes (well, I could not figure out the differences between this one and the previous one)
Notification: On
Check new msgs: No (If you want to check your mail periodically, choose other options)
Hide fields: leave empty (though it is up to you)
Auto Signature: leave empty (thoug it is up to you)
Security
Use SSL for sending: Yes (GMAIL supports SSL)
Use SSL for receiving: Yes (GMAIL supports SSL)
Warnings in Background: Proceed
Size restriction: 65535 (messages that are bigger than this amount of byte are not downloaded).
Well, that is basically it. Here though I showed here setting of POP3 account, it is always good to use an IMAP mail account for cellular phones (Indeed, I moved to an IMAP client). However, it is a different story :)

