Thursday, November 29, 2007

Avoid new console creation.

When another process (.exe) is started by a dos command, usually we see the console opened in background as a parent process. You can use START command with /B parameter to start an application without creating a new console window.

Example in XP (startSite.bat):
start /B C:\WINDOWS\ServicePackFiles\i386\iexplore.exe http://www.codedeliver.blospot.com

Wednesday, October 24, 2007

Java Line separator

Different systems use different characters or sequences of characters as line separators. Do not hardcode "\n", "\r", or "\r\n" as the line separator in your program. Instead, use the println() method of PrintStream or PrintWriter, which automatically terminates a line with the line separator appropriate for the platform, or use the value of the line.separator system property.

Friday, October 12, 2007

How to Peel Your Web Pages

This company provides an innovative solution to peel the web page as in this image. It is very interesting:

http://www.visualsteel.net/pagepeel.shtml

You can find more effects with "visualsteel".

Wednesday, October 10, 2007

Panose tag in font table “OS/2”

PANOSE is a classification number of 10 bytes. This 10 byte series of numbers is used to describe the visual characteristics of a given typeface. These characteristics are then used to associate the font with other fonts of similar appearance having different names.

The Panose values are fully described in the Panose "greybook" reference.
http://www.fonts.com/hp/panose/greybook/
http://www.panose.com/hardware/pan2.asp

Thursday, October 4, 2007

Hiding navigation bar in your Blog

You may already know how this is done, but for the ones who doesn't
Add the following code just after the "<head>" tag to remove or hide the navigation bar of your blog.

<!--Remove NavBar -->
<style type='text/css'>#b-navbar {height: 0px; visibility: hidden; display: none;}</style>
<style type='text/css'>#navbar-iframe {height: 0px; visibility: hidden; display: none;}</style>

Wednesday, October 3, 2007

Identify Bold, Italic fonts

Font specifications state that "fsSelection" bits in "OS/2" table (or "macStyle" bits in "head" table) determine whether the font was designed with features like "Italic", "Bold" etc.

"fsSelection" bits ->
Bits 0 & 5 can be used to determine if the font was designed with these features or whether some type of machine simulation was performed on the font to achieve this appearance.

Bit 0 -> Italic if set as 1
Bit 5 -> Bold if set as 1

Tuesday, September 11, 2007

Vista Meiryo font Italic feature

Font Meiryo introduced in Microsoft Vista is very interesting, It only has Italic glyphs for Latin, Greek, Coptic, and Cyrillic characters. Following image shows that only latin glyphs are slanted when Italic property is applied. WOW!
The top row shows italized text.


In Windows Vista, Meiryo is distributed as two TrueType Collection files, with regular and bold glyphs stored in separate files. Each file also contains an italic variant of the font.

Wednesday, August 29, 2007

Glyph Shapes in Windows XP vs Vista

In JIS X 0213:2004, the standard shapes of some glyphs are modified. Glyph shape of “MS Gothic” in XP differs that from in Vista. The version of msgothic.ttc,msmincho.ttc is 2.3 on XP, but 5.0 in Vista. Font version 2.5 and 5.0 includes both old "1990" shape and new "2004" shape.

Font version 2.3 – have only old “1990” shapes. (XP’s default)
Font version 2.5 – have both “1990” and “2004” shapes and “1990” shapes as default.
Font version 5.0 – have both “1990” and “2004” shapes and “2004” shapes as default. (Vista’s default)


New font “Meiryo” has only version 5.0 up-to-date.

Friday, August 17, 2007

Spring: ResourceBundleViewResolver

When using ResourceBundleViewResolver, applicationContext.xml will contain following configuration.

<bean id="viewResolver"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver" >
<property name="basename"><value>views</value></property>
</bean>


The “basename” property is used to tell ResourceBundleViewResolver how to construct
the names of the properties files that contain View definitions.

Sample views.properties file will look like as follows; It should reside in the classes folder of the server(..\WEB-INF\classes\).

pdfView.class=com.springinaction.training.mvc.BookListPdfView

home.class=org.springframework.web.servlet.view.JstlView
home.url=/WEB-INF/jsp/home.jsp
listBooks.class=org.springframework.web.servlet.view.JstlView
listBooks.url=/WEB-INF/jsp/listBooks.jsp
bookdetail.class=org.springframework.web.servlet.view.JstlView

bookdetail.url=/WEB-INF/jsp/bookdetail.jsp

Thursday, August 16, 2007

Apache Axis2/Java Version 1.3 Released


The core engine for Web services, Apache Axis2 a complete re-design and re-write of the widely used Apache Axis SOAP stack, built on the lessons learnt from Apache Axis.


New version is available now @
http://ws.apache.org/axis2/

Wednesday, August 15, 2007

No more NoClassDefFoundError or ClassNotFoundException

I found very interesting site that allow you to find jars,
http://www.docjar.com

Eg: If you want to find jars containing a class just search packagename.CLASSNAME, result will list all the jars containing that class.

Monday, August 13, 2007

Spring Controller interface

Simple Controller (HomeController.java)

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HomeController implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
return new ModelAndView("home", "message", greeting);
}
private String greeting;
public void setGreeting(String greeting) {
this.greeting = greeting;
}
}

applicationContext.xml should include :

<bean name="homeControler" class="com.springinaction.training.mvc.HomeController">
<property name="greeting">
<value>Welcome to Book Store!</value>
</property>
</bean>


Also the view resolver and url mapping should be specified in this xml file.

You can access the message variable in home.jsp as :

${message}

Search