How to redirect homepage in Joomla

1 Comment


Joomla is a wonderful platform to publish websites. With readily available templates you can have your website up and running in no time. Sometimes though you may need to direct your visitors to a different page than your regular home page, for instance you may want to direct all the visitors to a promotion page during special sales events. There is a very simple and easy way of doing this in Joomla. More

article clipper vert How to redirect homepage in Joomla
 

How to search for a string in a file using Java regular expression.

4 Comments


If you need to search for a phrase or a string in a text file Java regular expression is the easiest way to accomplish this task. Here is a simple example that demonstrates how you can use Java regular expression to find a string or a phrase in a text file.
More

article clipper vert How to search for a string in a file using Java regular expression.
 

How to read properties file in Spring.

13 Comments



If you need to read properties file in your Spring application all you need is to configure a PropertyPlaceholderConfigurer bean in your application context.
Following example shows how to read property values from a properties file named config.properties. This file needs to be in your classpath so Spring can find it.

Let’s begin by creating a simple Java class that will use the properties values from the file.

package com.zparacha.spring.examples.config;

public class CreateUser {
	//Spring will populate these fields through Dependency Injection.
        private String name;
	private String email;
	private String URL;

	public CreateUser(){}
	public String getName() {
	  return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getURL() {
		return URL;
	}

	public void setURL(String url) {
		URL = url;
	}
	public void displayUser() {
		System.out.println("Name=" + this.name);
		System.out.println("Email="+ this.email);
		System.out.println("URL=" + this.URL);
	}
}

More

article clipper vert How to read properties file in Spring.
 

How to remove Ctrl-M (^M) from Unix files?

1 Comment

no caret m How to remove Ctrl M (^M) from Unix files?Sometimes when you upload or FTP files from a Windows system to a UNIX box you will see ^M at the end of each line. ^M is the UNIX equivalent of DOS line break. Not only does it not look pretty, this extra character may break all sorts of scripts that you try to run on your file. So how do you remove ^M? Here are two ways to get rid or ^M (Ctrl-M) from your files. More

article clipper vert How to remove Ctrl M (^M) from Unix files?
 

Print large string in PL/SQL.

No Comments

For PL/SQL developers put_line is a quite useful method. I use it for logging purposes. Recently I found out that the method has an annoying limitation. You cannot print more than 255 characters per line!
Now that is a strange feature. I don’t know what is the reasoning behind this restriction but it does make this method somewhat risky to use. Because if you use put_line to log a string more than 255 characters long it will raise an exception and you program might fail. Unless you catch the exception and continue on with your flow. Obviously no good programmer would want the trouble of adding exception handling code for such a mundane task as logging. So far I have not found an alternative method to print out large string in PL/SQL but I came up with a work around.
I created a little procedure to print large string.



Here is the method. More

article clipper vert Print large string in PL/SQL.