Monday, January 26, 2015

Blogger SEO CSS | BlogSpot - Blogger Tips

SEO - Analysis Tool


Using SEO analysis tools is crucial, check out the following tools:


http://www.metachecker.net
http://seositecheckup.com
http://www.seoworkers.com

Since different tools use different algorithms to analyze your web pages, you may need to use more than one tool for a single page.


SEO - Use Headings


Try to use proper headings (h1, h2, etc. tags) for important content on your blog.


SEO - Page Title


By default, the blog name is put before the post title in the title tag; however search engines put more weight on the early words, so there is a need to change the pattern.


First, go to your template and edit the HTML; try to find the following snippet:

<title><data:blog.pageTitle/></title>

Then replace it with:
<b:if cond='data:blog.pageType == "item"'>
<title><data:blog.pageName/> - <data:blog.title/></title>
<b:else/>
<title><data:blog.pageTitle/></title>
</b:if>
 

SEO - Change Permalink


Permalink change is done at individual post level.

For new post, go to the edit post page and click on the 'Permalink' on the right of the page and choose 'Custom Permalink'.

For published post, at the same page, click 'revert to draft', then click on the 'Permalink' to show the 'Custom Permalink' option. 

SEO - Add Meta Author


Go to your blogger template and edit it by adding the following:
<meta name="author" content="Zhang Hao"/> 

SEO - Add Meta Description


Go to the edit post page, click on the 'Search Description' on the right of the page, then key in your description and click 'Done' button.

Wrapper Text in 'PRE' tag


By default, the text in 'PRE' tag is not wrapped, which causes part of long text will exceed the border of its container.


To address this, edit the template and find the location of stylesheet (by searching '/* Content' in the template), and add the following:



pre {
white-space:pre-wrap;
}

Cannot find 'Search Description' Option


Go to your blog's 'Setting -> Search Preference' page and enable 'Description' option, then the 'Search Description' option on each blog will appear.


 


Create a Successful Online Store at Bigcommerce! Try it Free Now!

Hibernate Mapping File PostgreSQL Uppercase letters | Hibernate Tool - Generate Mapping Files for PostgreSQL Tables with Uppercase Letters

Upper Case Letters Issue for Hibernate Mapping File Generation

I have problems using Hibernate tools when using uppercase letters in a PostgreSQL database (either in table name or column name).

Hibernate Configuration shows the tables, but it doesn't show columns. Reverse engineering also doesn't work.

The solution to this is to implement your own MetaDataDialect and put it into hibernate.cfg.xml.

Steps:

  1. Create a subclass of JDBCMetaDataDialect.
  2. Configure Hibernate to use the PostgreSQLMetaDialect by updating hibernate.cfg.xml.
  3. Add the class to the classpath.


Create Subclass of JDBCMetaDataDialect

The subclass of JDBCMetaDataDialect:

import org.hibernate.cfg.reveng.dialet.JDBCMetaDataDialect ;

public class PostgreSQLMetaDialect extends JDBCMetaDataDialect
{
    public boolean needQuote(String name)
    {        
        if(null != name && 0 != name.compareTo(name.toLowerCase()))
        {
            return true;
        } 
        else 
        {
            return super.needQuote(name);
        }
    }
}

Change hibernate.cfg.xml

hibernate.cfg.xml:

hibernatetool.metadatadialect=somepackage.PostgreSQLMetaDialect 





Create a Successful Online Store at Bigcommerce! Try it Free Now!

JBoss AS 7.1.1 - Crypto Libreary Not Found Issue When Migration from JBoss 4.2.3

JBoss 7.1.1 Crypto Library Not Found Issue

When I was migrating an application from JBoss 4 (4.2.3) to JBoss 7 (7.1.1), I encountered an issue:

java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE

JBoss 7.1.1 Crypto Library Not Found Solution

After some search on the Internet, I managed to find a solution. Steps:
  1. Create a directory modules/sun/jdk/main;
  2. Under 'main', create a file module.xml;
  3. Add the following content to the file.
<module xmlns="urn:jboss:module:1.1" name="sun.jdk">
<resources>
    <resource-root path="service-loader-resources"/>
</resources>
<dependencies>
    <system export="true">
        <paths>
            <path name="com/sun/crypto/provider"/>
            <path name="com/sun/script/javascript"/>
            <path name="com/sun/jndi/dns"/>
            <path name="com/sun/jndi/ldap"/>
            <path name="com/sun/jndi/url"/>
            <path name="com/sun/jndi/url/dns"/>
            <path name="com/sun/security/auth"/>
            <path name="com/sun/security/auth/login"/>
            <path name="com/sun/security/auth/module"/>
            <path name="sun/misc"/>
            <path name="sun/io"/>
            <path name="sun/nio"/>
            <path name="sun/nio/ch"/>
            <path name="sun/security"/>
            <path name="sun/security/krb5"/>
            <path name="sun/util"/>
            <path name="sun/util/calendar"/>
            <path name="sun/util/locale"/>
            <path name="sun/security/provider"/>
            <path name="META-INF/services"/>
        </paths>
        <exports>
            <include-set>
                <path name="META-INF/services"/>
            </include-set>
        </exports>
    </system>
</dependencies>

The tricky part is path name="com/sun/crypto/provider"/>, which instructs JBoss to load necessary crypto lib for you.



Create a Successful Online Store at Bigcommerce! Try it Free Now!

Saturday, January 24, 2015

Graphviz Cannot Load Font Issue



Problem: 
couldn't load font: (dot.exe:XXX): Pango-WARNING **: couldn't load font "XX Not-Rotated YY", falling back to "Sans Not-Rotated YY", expect ugly output.

Solution:


Create a Successful Online Store at Bigcommerce! Try it Free Now!

Borland Together License Issue

Problem:

After Windows login ID changed, the license does not work.

Solution:

Run Together.exe as Administrator (local machine) first, then rerun it as domain user (new account).




Create a Successful Online Store at Bigcommerce! Try it Free Now!