Archive for February, 2011
Apache doesn’t start in XAMPP
I’ve already had this problem a lot of times. Apache does not start in XAMPP. I’ve had this problem in my computers and computers of my friends. As I know based on my practice, the key of this problem is in ports. Because ports that Apache uses are busy it cannot start.
By default, Apache listens a port number 80 for HTTP and a port number 443 for HTTPS.
In your system other web server may run. For example, Internet Information Services (IIS) or something else. This web server can use ports that Apache needs, I mean 80 and 443. In this way, to fix the problem you need to change the default numbers of ports of Apache or numbers of ports of the other web server that runs on your system. To change this values find Listen command in these files and change the value:
- C:\xampp\apache\conf\httpd.conf
- C:\xampp\apache\conf\extra\httpd-ssl.conf
If you have Skype it also uses these ports. In this way, to fix the problem you should uncheck the usage of these ports in Skype settings or change the numbers of ports using the method above.
How to change the font in MySQL Workbench editor
Today I downloaded MySQL Workbench 5.2.31 CE. I usually work with different languages and I found that SQL Editor didn’t show russian letters correctly. I went to the Preferences but there I found that I can’t change the font. In the Preferences you can only see what the font is used but you cannot change it. Fortunately, there’re a lot of config files in XML format you can change. Before change any setting file you should close the Workbench. I use Windows 7 and to change the font I oppened this file C:\Users\User\AppData\Roaming\MySQL\Workbench\wb_options.xml and found this key workbench.general.Editor:Font and changed it to the value I needed. Here is what I have in my wb_options.xml:
|
Just remember, before changing this option close the MySQL Workbench and after the changing start it, doing this you will avoid your option to be overwritten.
Code Assist for JQuery
Hi! I use Aptana to edit JavaScript, HTML, CSS etc. In this article, I will explain how to enable Code Assist for JQuery in Aptana. It’s very comfortable to edit JavaScript using this great editor and it’s became more comfortable with JQuery autocomplete! Just test it and you will understand
- Download Aptana.
- Go to Window -> My Studio.
- Click Install Plugins.
- Select Ajax tab and click Get it for the JQuery.
- After the JQuery library support installed go to the Window -> Preferences and select Editors -> JavaScript -> CodeAssist -> JQuery.
- Enjoy!
Split string but keep separator in C#
Today I tried to split the string but preserve split characters. I didn’t find native methods for this need. If somebody know how to do it please write the comment.
Here is my code:
var separator = '@'; var result = new Dictionary<int, string>(); var key = 0; for (var i = 0; i < testString.Length; i++) { var c = testString[i]; if (c == separator) key++; if (result.ContainsKey(key)) { result[key] += c; } else { result.Add(key, c.ToString()); } } |