Archive for May 2007
CSS Hack only for IE 6
these days we got many browsers, sometime i feel if i were a king of the world i would love to eliminate all extra browsers. anyway, our designer bro (_ryan) and me were struggling to figure out some IE 6 specific hack. which won’t affect IE 7.x or other browsers.
we tried applying “@” prefix hack, for example: @width, but it worked on IE 6 and 7. so later we tried the old style “/* \*/” comment hack, exactly the same problem.
so suddenly our designer bhai (ryan), got a nice hack, it was “_”. for example: “_width: 22px”.
surprisingly it worked Wow on IE 6 without affecting IE 7 or other browsers. thanks allah, at least we found something that is working.
this blog is for those who are stucking with such problem.
best wishes,
Open Search Servlet – build open search configuration on the fly
Here is open search specification – http://www.opensearch.org/Specifications/OpenSearch/1.1
Let’s enable your browser to detect your search engine automatically; using open search servlet you can generate open search configuration file on the fly.
Download information is here –
Binary war file (includes example usages)
Usages:
- Copy “open-search-x.jar” file on your WEB-INF/lib/ directory
- Edit web.xml file.
- add these entries -
< servlet >
< servlet-name >openSearch< /servlet-name >
< servlet-class >com.we4tech.openSearch.servlet.OpenSearchServlet< /servlet-class >
< !-- URL matching pattern -- >
< init-param >
< param-name >url-match< /param-name >
< param-value >.*/(.+).osd< /param-value >
< !--< param-value >.*/search/(.+)< /param-value >-- >
< /init-param >
< !-- map open search configuration with url -- >
< init-param >
< param-name >open-search< /param-name >
< param-value >open-search.properties< /param-value >
< /init-param >
< init-param >
< param-name >somewherein-blog< /param-name >
< param-value >somewherein-blog.properties< /param-value >
< /init-param >
< /servlet >
< servlet-mapping >
< servlet-name >openSearch< /servlet-name >
< !--< url-pattern >/search/*< /url-pattern >-- >
< url-pattern >*.osd< /url-pattern >
< /servlet-mapping >
- Now place configuration properties file with in your WEB-INF/classes/
- for example: “open-search.properties”
# Default open-search. properties
shortName=colorful moment.
description=somewhere in blog
contact=hasan@somewherein.net
url.1=text/html,get,http://www.somewherein.net/blog/index.php?s={searchTerms}&submit=
image.1=16,16,image/x-icon,http://www.searchmash.com/favicon.ico
- Congratulations you have completed all steps
Sample usages on your web site can be found here –
http://www.opensearch.org/Specifications/OpenSearch/1.1#Autodiscovery_in_HTML.2FXHTML
Best wishes,
JavaFX: Parse HTML content with DOMParser
I have started an interesting project. I will illustrate a crawler based on JavaFX scripting. Though there is no specific reason beyond using JavaFX except to enhance my knowledge on JavaFX scripting.
Here is some preliminary code that I have already written:
Import statement and package declaration –
———————————————————
package com.we4tech.linkcrawler.fx.script;
import java.lang.*;
import java.io.*;
import java.net.*;
import java.util.*;
import org.xml.sax.SAXException;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.NamedNodeMap;
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
Remind me: servlet, Jsp performance tuning note
hi,
here is a great collection on servlet jsp performance related stuffs.
http://www.javaperformancetuning.com/tips/j2ee_srvlt.shtml
best wishes,
JavaFX: How to run your HelloWorld
Today i have started learning JavaFX. so you will get my new learning over my blog site.
Problem how to run your first hello world FX:
there are 3 alternatives as far i know -
1. using NetBeans.
2. using Eclipse JavaFX plugin.
3. using manual execution
1. using net beans – you will find enough information from the starter example over here
https://openjfx.dev.java.net/Getting_Started_With_JavaFX.html
2. using eclipse plugin – install plugin from this url :
http://download.java.net/general/openjfx/plugins/eclipse/site.xml
3. using manual execution:
include 4 directory/jar over your classpath
i. javafxrt.jar
ii. swing-layout.jar
iii. Filters.jar
iv. your src directory (where you will store your *.fx) files
Main-class: net.java.javafx.FXShellyourPackage.ScriptFileName
best wishes,
ApacheDS – Directory Service
I knew about this project since it has started, but never felt interest to give it a try. so today at morning i just had it with my breakfast yammy yammy. it taste like sweat meat though bit fatty. it was really a great breakfast.
ApacheDS is using Spring IoC container. it seems more promising, i wrote the following configuration to let my “dc=escenic, dc=com” DN works .
(#) File: $APACHE_DS_HOME/conf/server.xml
—————————-
escenic
dc=escenic,dc=com
objectClass
ou
uid
objectClass: dcObject
objectClass: organization
dc: escenic
o: Escenic
description: Escenic content management system
Yet another configuration. let apacheds know about your new partition. this could be done adding a new property under “configuration” bean.
Thats all, it is working like shhhhhhhhhhhhh…..!!
best wishes,
struts rewrite, link rewrites url with “;jsessionid=” session id.
hi,
on my server i found some strange problem. it was actually related with tag. the problem was with the url rewriting, which was performed by struts tag library. struts tag library was creating an invalid URL.
for example i wrote the following code:
< img src=”my-image.gif” />
as i have only wrapped “${urlPrefix}” with in html:rewrite tag. so struts tag library wrote the following output.

which is totally a wrong url.
so how i resolved it?
very simple just fixing my weired code. now it looks like the following -
< img src=”" />
the generated output looks like -

here is a regex which may help you to find out the error tags:
“(.+)”
yeap it is working now
আসো আদর্শ সফটও্যয়ার প্রোগ্রামিং শিখি – ২ (”final” এর ব্যবহার)
“আমার টারগেট রিডার হল যারা java জানেন”।
(টপিক: “final” keyword এর ব্যবহার).
java তে final ব্যবহার হয় কোন variable কে read only করার জন্য ।
member/local variable গুলো ভুল বশত value override হবার সম্ভনা দুর করার জন্য final ব্যবহার করার প্রয়োজন ।
final এর কিছু ব্যবহার দেখানোই আমার আজকের পোস্ট:
১. static initialized variable গুলো তে final ব্যবহার করুন । যেমন:
private static final BLA = new Bla(..);
২. class member variable গুলো তে value override করার প্রয়োজন না হলে, initialize করার সময় final ব্যবহার করূন । যেমন:
private Bla mBla = new Bla();
৩. local variable গুলোতে final ব্যবহার করুন । যেমন:
final String name = mBla.getName();
৪. for loop এর index variable কে final ব্যবহার করুন । যেমন:
for (final int i = 0; i < 10; i++) {…}
৫. foreach loop এর variable কে final ব্যবহার করুন ।
যেমন:
for (final Bar bar : bars) {…}
৭. method parameter কে final করূন । যেমন:
private void doBla(final String pName, final String pEmail) {…}
৮. protected method গুলোতে extended class গুলোর override করা দুর করার জন্য final ব্যবহার করুন । যেমন:
class Animal {
protected final String getRootType() {
return “animal”;
}
protected String getType() {
return getRootType();
}
}
class Cat extends Animal {
/* Compilation error block start */
protected String getRootType() {
return “Bang”;
}
/* Compilation error block end */
protected String getType() {
return “Cat”;
}
}
এখানে
protected String getRootType() {
return “Bang”;
}
এই কোড টুকু কম্পাইল টাইম এরর দিবে …
আর মনে পরছেনা (ক্লোজআপহাসি)




