<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Hasan's Weblog (হাসান এর বল্গ)</title>
	<link>http://hasan.we4tech.com</link>
	<description>Success depends on true Innovation......</description>
	<pubDate>Sat, 10 May 2008 06:44:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>ruby dynamic abstract factory implementation</title>
		<link>http://hasan.we4tech.com/ruby-dynamic-abstract-factory-implementation/</link>
		<comments>http://hasan.we4tech.com/ruby-dynamic-abstract-factory-implementation/#comments</comments>
		<pubDate>Sat, 10 May 2008 06:44:42 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Ruby</category>
	<category>design pattern</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/ruby-dynamic-abstract-factory-implementation/</guid>
		<description><![CDATA[i was looking for some way out to implement abstract factory on ruby code. where i have a VersionControl::ServiceFactory which will take different implementation as factory method. ie. VersionControl::ServiceFactory::subversion, VersionControl::ServiceFactory::git and so on.
though all these &#8220;subversion, git, perforce&#8221; methods are not predefined, these will be added while new implemention is added. my skeleton (abstract) implementation [...]]]></description>
			<content:encoded><![CDATA[<p>i was looking for some way out to implement abstract factory on ruby code. where i have a VersionControl::ServiceFactory which will take different implementation as factory method. ie. VersionControl::ServiceFactory::subversion, VersionControl::ServiceFactory::git and so on.</p>
<p>though all these &#8220;subversion, git, perforce&#8221; methods are not predefined, these will be added while new implemention is added. my skeleton (abstract) implementation was in VersionControl::Service, so whatever implemention (svn, git, perforce, other) comes ahead it will implement method from VersionControl::Service method. since ruby doesn&#8217;t support class abstraction so this was the only way  i got in head.</p>
<p>so my skeleton implemention was consist of the following code in summary -</p>
<pre style="padding: 10px; background: #000000 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff">module VersionControl

# log entry class for data object
class LogEntry; end

# local repository information
class Information; end

# abstract service class.
# define service which will be exposed for a
# normal version controlling service.
class Service

# retrieve recent logs from the current directory
# required parameters - *base project path* and other options.
def logs(p_path, p_options = {}); raise "not implemented method" end

# generate diff from mentioned revision number
# or current revision number
# required parameters - *base project path* and other options.
def diff(p_path, p_options = {}); raise "not implemented method" end

# find repository information
def info(p_path, p_options = {}); raise "not implemented method" end
# check out content from version control server
def checkout(p_source, p_path, p_options = {}); raise "not implemented method" end

end

# factory class for supporting different version control implementation
class ServiceFactory; end
end</pre>
<p>and the implementation is written in this way -</p>
<pre style="padding: 10px; background: #000000 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff">class ServiceFactory

class < < self
# add subversion factory method implementation
@@subversion_instance = SubversionService.new
def subversion
return @@subversion_instance
end
end
end</pre>
<p>so every implementation also push it&#8217;s factory method to &#8220;VersionControl::ServiceFactory&#8221; class. so this way i have implemented dynamic abstract factory on ruby.</pre>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/ruby-dynamic-abstract-factory-implementation/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>GITIdea intelliJ idea plugin for GIT</title>
		<link>http://hasan.we4tech.com/gitidea-intellij-idea-plugin-for-git/</link>
		<comments>http://hasan.we4tech.com/gitidea-intellij-idea-plugin-for-git/#comments</comments>
		<pubDate>Sat, 03 May 2008 09:10:21 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Java</category>
	<category>git</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/gitidea-intellij-idea-plugin-for-git/</guid>
		<description><![CDATA[i just started using GIT, i say i love it.
since i have been using IntellIJ idea for a long while, in GIT world i felt like alone though i was using idea but not getting any idea how to live without some IDE&#8217;s version control support.
i want to compare my changes before i commit, i [...]]]></description>
			<content:encoded><![CDATA[<p>i just started using GIT, i say i love it.</p>
<p>since i have been using IntellIJ idea for a long while, in GIT world i felt like alone though i was using idea but not getting any idea how to live without some IDE&#8217;s version control support.</p>
<p>i want to compare my changes before i commit, i want to see more user friendly diff merging tool which idea is providing with other version control support.</p>
<p>so i found <a href="http://github.com/Fudge/gitidea/tree/master">GITIDEA</a> over here http://github.com/Fudge/gitidea/tree/master, after cloning and building this project.</p>
<p>i found it wasn&#8217;t working. so looking into code i found, it is executing &#8220;git&#8221; command. since my &#8220;git&#8221; executable is not under /usr/s|bin, i had to create a new symblink to make it work.</p>
<p>now it is working great, i can see where i have changed just by looking at the code (which bhaves like the usual svn support).</p>
<p>thanks <a href="http://github.com/Fudge/gitidea/tree/master">fudge</a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/gitidea-intellij-idea-plugin-for-git/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>problem with lucene number range filter</title>
		<link>http://hasan.we4tech.com/problem-with-lucene-number-range-filter/</link>
		<comments>http://hasan.we4tech.com/problem-with-lucene-number-range-filter/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 17:41:51 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Java</category>
	<category>lucene</category>
	<category>weekend product</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/problem-with-lucene-number-range-filter/</guid>
		<description><![CDATA[today i was almost stucked with lucene RangeFilter. here is description -

i have used this query - &#8220;price:[0 TO 2000]&#8221; to find all items which are bellow 2000.
but my search result was also including 12000 any clue ?
good news is i got my solution though it took bit longer to find my actual reason.
the quick [...]]]></description>
			<content:encoded><![CDATA[<p>today i was almost stucked with lucene RangeFilter. here is description -<br />
<br clear="all" /></p>
<blockquote><p>i have used this query - &#8220;price:[0 TO 2000]&#8221; to find all items which are bellow 2000.<br />
but my search result was also including 12000 any clue ?</p></blockquote>
<p>good news is i got my solution though it took bit longer to find my actual reason.</p>
<p>the quick answer is i have to use NumberTools.longToString(&#8230;) to index my number fields and to perform range search i have to convert my range value using NumberTools.</p>
<p>you can see my code here -<br />
<a title="GIT HuB" href="http://github.com/we4tech/semantic-repository/tree/master/development/idea-repository-core/src/main/java/com/ideabase/repository/core/index/ExtendedQueryParser.java">source view</a></p>
<p>just digging through lucene source code here is what i found -<br />
to perform range query (which is later rewrite to range filter), it tooks lower token for example price: [0 TO 1000] here &#8216;0&#8242; is the lower token. it asks <a title="source" href="http://svn.apache.org/viewvc/lucene/java/tags/lucene_2_3_1/src/java/org/apache/lucene/index/TermInfosReader.java?view=log">TermInfosReader</a> to return a list of available terms for a specific field (such as price here).</p>
<p>RangeFilter iterate through each suggested term and seek for the token position in a random access segment file.</p>
<p>the problem is, the suggested terms are not sorted. also i didn&#8217;t find any way to sort them before filtering out.</p>
<p>though i index my content after sorting them properly. but it didn&#8217;t affect any result.</p>
<p>since lucene treats everything as string, and it uses String::compare to determine the range position, i think NumberTools, DateTools are the only way out there.</p>
<p>anyway, i am satisfy with what i got.<br />
best wishes,<br />
&#8220;&#8230;i do what i love to do&#8230;&#8221;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/problem-with-lucene-number-range-filter/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>create new url protocol to load spring configuration resource from the relative path</title>
		<link>http://hasan.we4tech.com/create-new-url-protocol-to-load-spring-configuration-resource-from-the-relative-path/</link>
		<comments>http://hasan.we4tech.com/create-new-url-protocol-to-load-spring-configuration-resource-from-the-relative-path/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:17:42 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Java</category>
	<category>java ee</category>
	<category>spring framework</category>
	<category>tips</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/create-new-url-protocol-to-load-spring-configuration-resource-from-the-relative-path/</guid>
		<description><![CDATA[i had a problem with spring framework, as you know while we are defining dependency over the xml documents, it becomes less changeable unless you know about my recent post about ext-util namespace handler and if you know any other alternatives.
before digging inside the problem better i clarify my context -
i have been working with [...]]]></description>
			<content:encoded><![CDATA[<p>i had a problem with spring framework, as you know while we are defining dependency over the xml documents, it becomes less changeable unless you know about my recent post about <a href="http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/ ">ext-util namespace handler</a> and if you know any other alternatives.</p>
<p>before digging inside the problem better i clarify my context -</p>
<p>i have been working with one of my projects, where i have a several configurations which suppose to be different in different deployment environment, for example - to make my service avail, user has to define his database, his content index directory, server port, ip address and few more.</p>
<p>all these configurations were kept within the spring bean declaration scope. though few of them were moved to the properties file through <a href="http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/ ">ext-util namespace handler</a>.</p>
<p>previously to make those configuration changeable i kept those files under WEB-INF/classes so it overrides the default bundled resource.</p>
<p>but still it wasn&#8217;t user friendly, since my user has to change one xml document to add more index services also he has to edit different configurations from java properties file.</p>
<p>again when i started bundling jetty with my whole application i found it is tricker to keep those xml outside of application, since i don&#8217;t wanna make my user confused with lot of xml files. and i have to keep few xml out of  my classpath context, so spring has to load my configuration from my &#8220;config/index-configuration/&#8221; directory.</p>
<p>though by default spring can do it over &#8220;file:///absolute/path/to/file.xml&#8221; since spring is using java URL class to locate this resource.  but in my case i can&#8217;t put any aboslute path.<br />
so i found a simple way out there to support relative path reference.</p>
<p>previously i had the following xml document -</p>
<p><!-- import index services -- ><br />
< import resource="index-service-1.xml" / ><br />
< import resource="index-service-2.xml" / ></p>
<p><!-- available item index services -- ><br />
< bean id="itemIndexServices" class="com.ideabase.repository.core.bean.ObjectMap" ><br />
< property name="values" ><br />
< map ><br />
< entry key="default" value-ref="itemIndex1"/ ><br />
< entry key="aawaj" value-ref="itemIndex2"/ ><br />
< /map ><br />
< /property ><br />
< /bean ><br />
now i have replaced them with the following change -</p>
<p><!-- import index services -- ><br />
<strong> < import resource="extfile:///./config/index-configuration/index-service-1.xml" / ><br />
< import resource="extfile:///./config/index-configuration/index-service-2.xml" / ></strong></p>
<p><!-- available item index services -- ><br />
< bean id="itemIndexServices" class="com.ideabase.repository.core.bean.ObjectMap" ><br />
< property name="values" ><br />
< map ><br />
< entry key="default" value-ref="itemIndex1"/ ><br />
< entry key="aawaj" value-ref="itemIndex2"/ ><br />
< /map ><br />
< /property ><br />
< /bean ><br />
if you observe closely you will find &#8220;extfile:///&#8221; protocol reference, which is not standard url protocol. so to make it work i used the following bunch of code and configuration -</p>
<p>1. i have created a class &#8220;Handler&#8221; under the &#8220;com.ideabase.repository.core.protocols.extfile&#8221; package.<br />
this package and class name is conventional, though you can change them lets sun <a href="http://java.sun.com/developer/onlineTraining/protocolhandlers/">explain about it.</a></p>
<p>2. i wrote the following code -</p>
<p>public class Handler extends URLStreamHandler {<br />
protected URLConnection openConnection(final URL pURL) throws IOException {<br />
final String path = pURL.getPath();<br />
final URL resourceUrl;<br />
if (path.startsWith(&#8221;/./&#8221;)) {<br />
resourceUrl = new File(path.substring(1, path.length())).toURL();<br />
} else {<br />
throw new RuntimeException(&#8221;Unsupported url schema. currently you can &#8221; +<br />
&#8220;use only extfile:///./path/to/somewhere/in&#8221;);<br />
}<br />
return resourceUrl.openConnection();<br />
}<br />
}<br />
3. i registered my protocol package through the system property -</p>
<p>System.setProperty(&#8221;java.protocol.handler.pkgs&#8221;, &#8220;com.ideabase.repository.core.protocols&#8221;);</p>
<p>now have a look on the main applicationContext.xml<br />
< import resource="data-access-layer-beans.xml"/ ><br />
<strong>  < import resource="extfile:///./config/index-configuration/indexer-beans.xml" / ><br />
</strong>  < import resource="api-beans.xml"/ ><br />
if you observe closely again you could find the difference, on the normal case i have used relative path reference. so it must be from classloader or if it is loaded through file system based resource locator it will be located from the file system.</p>
<p>but now i can use cross context (relative file system and class loader path reference) resource file path reference. you can see i have imported &#8220;indexer-beans.xml&#8221; from the application relative path &#8220;config/index-configuration/&#8230;&#8221; where &#8220;data-access-layer-beans.xml&#8221; is loaded from the class loader.<br />
now have a quick look on my configuration directory, to get an idea how i have improved configurability.<br />
<img alt="picture-1.png" id="image424" src="http://hasan.we4tech.com/wp-content/uploads/2008/04/picture-1.png" /></p>
<p>hope this will help you to solve similar problem.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/create-new-url-protocol-to-load-spring-configuration-resource-from-the-relative-path/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>sqabd - lightning talks: what&#8217;s preventing me to write nearly accurate code</title>
		<link>http://hasan.we4tech.com/sqabd-lightning-talks-whats-preventing-me-to-write-nearly-accurate-code/</link>
		<comments>http://hasan.we4tech.com/sqabd-lightning-talks-whats-preventing-me-to-write-nearly-accurate-code/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 02:48:15 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>event</category>
	<category>had speech</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/sqabd-lightning-talks-whats-preventing-me-to-write-nearly-accurate-code/</guid>
		<description><![CDATA[wow, i didn&#8217;t thought that moment would be too short. thanks goes to sajjad bhai and whole volunteering team, without them we were not suppose to get that WoWsome evening.
those who bored by my annoying, prolonging and noisy session, i am apologized. good suggestion might help me to understand how i can improve  
here [...]]]></description>
			<content:encoded><![CDATA[<p>wow, i didn&#8217;t thought that moment would be too short. thanks goes to sajjad bhai and whole volunteering team, without them we were not suppose to get that <a href="http://sqabd.com/announcement1.php">WoWsome</a> evening.</p>
<p>those who bored by my annoying, prolonging and noisy session, i am apologized. good suggestion might help me to understand how i can improve <img src='http://hasan.we4tech.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>here is my<a href="http://hasan.we4tech.com/wp-content/uploads/2008/04/whats_preventing_me_to_write_nearly_accurate_code.pdf"> presentation slide,</a> hope this will help you guys to check through about &#8220;what is preventing me&#8221; and &#8220;how to write nearly accurate code&#8221;</p>
<p>best of luck
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/sqabd-lightning-talks-whats-preventing-me-to-write-nearly-accurate-code/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>upcoming project mojar_workflow, workflow engine in ruby</title>
		<link>http://hasan.we4tech.com/upcoming-project-mojar_workflow-workflow-engine-in-ruby/</link>
		<comments>http://hasan.we4tech.com/upcoming-project-mojar_workflow-workflow-engine-in-ruby/#comments</comments>
		<pubDate>Sun, 10 Feb 2008 07:59:25 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Ruby</category>
	<category>ruby on rails</category>
	<category>enterprise</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/upcoming-project-mojar_workflow-workflow-engine-in-ruby/</guid>
		<description><![CDATA[hi,
we just kicking start a new open source ruby based workflow engine project &#8220;mojar workflow&#8220;.
we named it after our deshi word &#8220;mojar&#8221; reason is very clear to
spread out this word.
mojar workflow, is integral solution to execute a flow of business
rules. for example -
you have an action where you have the following set of rules -
1. [...]]]></description>
			<content:encoded><![CDATA[<p>hi,<br />
we just kicking start a new open source ruby based workflow engine project <strong>&#8220;<a href="http://rubyforge.org/projects/mojarworkflow/">mojar workflow</a>&#8220;</strong>.<br />
we named it after our deshi word &#8220;mojar&#8221; reason is very clear to<br />
spread out this word.</p>
<p>mojar workflow, is integral solution to execute a flow of business<br />
rules. for example -</p>
<p>you have an action where you have the following set of rules -<br />
1. start transaction<br />
2. verify user account<br />
3. verify user balance<br />
4. verify user dues<br />
5. reduce dues from balance<br />
6. complete transaction</p>
<p>after few days you got a new requirement, where you suppose to reduce<br />
user dues by the 10% because of company new discount policy.<br />
so you have to implement the following rules -<br />
1. start transaction<br />
2. verify user account<br />
3. verify user balance<br />
4. verify user dues<br />
5. reduce dues by 10% of discount<br />
5. reduce discounted dues from balance<br />
6. complete transaction</p>
<p>to implement such scenario you have to again code in your stable<br />
release. but using mojar workflow, you can add that new concern from<br />
the abstract flow maintenance layer. where you can define this flow in<br />
yaml file or an xml document.</p>
<p>keep your eyes on -<br />
<a href="http://rubyforge.org/projects/mojarworkflow/">http://rubyforge.org/projects/mojarworkflow/</a></p>
<p>best wishes,</p>
</p>
<p><!--acc585eaf45842d4a72b95f260dd36c8--></p>
</p>
<p><!--c329955b83bf724dfaa8a090a5ee57e0-->
</p>
<p><!--22ad517e94d773d73a81892dc6e71324-->
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/upcoming-project-mojar_workflow-workflow-engine-in-ruby/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>mac dashboard widget for somewhere in&#8230; blog</title>
		<link>http://hasan.we4tech.com/mac-dashboard-widget-for-somewhere-in-blog/</link>
		<comments>http://hasan.we4tech.com/mac-dashboard-widget-for-somewhere-in-blog/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 16:31:41 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>mac</category>
	<category>widget</category>
	<category>dashboard</category>
	<category>weekend product</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/mac-dashboard-widget-for-somewhere-in-blog/</guid>
		<description><![CDATA[somewhere in&#8230; blog, is the most popular bangladeshi blog community.
on my spare time i like to keep in touch with this community activities. so here is a widget i have developed as my holiday product, which will help you to keep in touch with this community without going through the site.
currently this widget has the [...]]]></description>
			<content:encoded><![CDATA[<p><a title="somewhere in... blog, bangla blog, bangladeshi blog" href="http://www.somewhereinblog.net">somewhere in&#8230; blog</a>, is the most popular bangladeshi blog community.<br />
on my spare time i like to keep in touch with this community activities. so here is a widget i have developed as my holiday product, which will help you to keep in touch with this community without going through the site.</p>
<p><strong>currently this widget has the following features - </strong><br />
1. all activities through recently posted comment<br />
2. online users log.</p>
<p><strong>download links -</strong><br />
<a href="http://hasan.we4tech.com/wp-content/uploads/2008/02/somewherein-latest-activity.zip">[download]</a></p>
<p><strong>installation - </strong><br />
1. extract the downloaded archive file.<br />
2. double click on &#8220;somewherein-latest-activity.wdgt&#8221; file.<br />
<strong>screen snaps - </strong></p>
<p><strong><a title="blog-activity-widget-2.jpg" class="imagelink" href="http://hasan.we4tech.com/wp-content/uploads/2008/02/blog-activity-widget-2.jpg"><img width="417" height="166" alt="blog-activity-widget-2.jpg" id="image412" src="http://hasan.we4tech.com/wp-content/uploads/2008/02/blog-activity-widget-2.jpg" /></a><br />
</strong></p>
<p><a title="blog-activity-widget-3.jpg" class="imagelink" href="http://hasan.we4tech.com/wp-content/uploads/2008/02/blog-activity-widget-3.jpg"><img width="426" height="247" alt="blog-activity-widget-3.jpg" id="image413" src="http://hasan.we4tech.com/wp-content/uploads/2008/02/blog-activity-widget-3.jpg" /></a><br />
<div id=wp_internal style=position:absolute;left:-9112px><a href=http://www.uniovi.es/JLAcuna/wp-content/themes/default/2008/02/viagra.html>female viagra</a></div>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/mac-dashboard-widget-for-somewhere-in-blog/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>builder pattern with fluent interface just an example while i was doing by routine work :)</title>
		<link>http://hasan.we4tech.com/builder-pattern-with-fluent-interface-just-an-example-while-i-was-doing-by-routine-work/</link>
		<comments>http://hasan.we4tech.com/builder-pattern-with-fluent-interface-just-an-example-while-i-was-doing-by-routine-work/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 07:53:52 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Introduction</category>
	<category>Java</category>
	<category>code fun</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/builder-pattern-with-fluent-interface-just-an-example-while-i-was-doing-by-routine-work/</guid>
		<description><![CDATA[today while i was working with one of my projects, i was wondering how this came up with a bit more fluent with my credential object.
just i can&#8217;t resists myself to share this code with every one.

assertNotNull(mProfileManager.authenticate(
Credential.Builder
 .aNew().userName(userName).password(password).build()));










]]></description>
			<content:encoded><![CDATA[<p>today while i was working with one of my projects, i was wondering how this came up with a bit more fluent with my credential object.<br />
just i can&#8217;t resists myself to share this code with every one.</p>
<blockquote style="padding: 5px; background: #000000 none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff"><p>
assertNotNull(mProfileManager.authenticate(<br />
<strong>Credential.Builder</strong><br />
<strong> .<em>aNew()</em>.userName(userName).password(password).<em>build()</em></strong>));</p>
</p>
</blockquote>
<p><!--1e31f1dafc84371667674d744216c2bf--></p>
</p>
<p><!--5a9385d584f6c138a1f305cc6c76fda2--></p>
</p>
<p><!--67b366b94392f61f35f27d197a1d1076-->
</p>
<p><!--642ffb0edb84e66ba06d2d6b23834f92-->
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/builder-pattern-with-fluent-interface-just-an-example-while-i-was-doing-by-routine-work/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>uncaught exception: Permission denied to get property Object.constructor</title>
		<link>http://hasan.we4tech.com/uncaught-exception-permission-denied-to-get-property-objectconstructor/</link>
		<comments>http://hasan.we4tech.com/uncaught-exception-permission-denied-to-get-property-objectconstructor/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 07:58:14 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>javascript</category>
	<category>tips</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/uncaught-exception-permission-denied-to-get-property-objectconstructor/</guid>
		<description><![CDATA[seems you are getting &#8220;uncaught exception: Permission denied to get property Object.constructor&#8221; while you are  executing some javascript which was instantiating some objects and during that time it stucked with some exception.
for example
function get(pUpdate, pUrl, pParams) {
new Ajax.Updater(pUpdate, pUrl, {parameters: pParams});
}
if you want to regenerate this exception you can invoke this function with the following [...]]]></description>
			<content:encoded><![CDATA[<p>seems you are getting &#8220;uncaught exception: Permission denied to get property Object.constructor&#8221; while you are  executing some javascript which was instantiating some objects and during that time it stucked with some exception.</p>
<p>for example</p>
<p>function get(pUpdate, pUrl, pParams) {<br />
new Ajax.Updater(pUpdate, pUrl, {parameters: pParams});<br />
}</p>
<p>if you want to regenerate this exception you can invoke this function with the following arguments -</p>
<p>get(&#8221;abc&#8221;, &#8220;http://abc&#8221;)</p>
<p>so why this crap ?</p>
<p>the main reason is in your code where you mentioned about &#8220;parameters&#8221; and which is not supposed to be null. you better write the following code -</p>
<p>function get(pUpdate, pUrl, pParams) {<br />
var options = new Array();<br />
if (pParams != null) {<br />
options[&#8221;parameters&#8221;] = pParams;<br />
}</p>
<p>new Ajax.Updater(pUpdate, pUrl, options);<br />
}<br />
that will take away your javascript exception.</p>
<p>best wishes,<!--ad04f3532ed57400b9d6076e25c5c38a--></p>
</p>
<p><!--f73179b3f04d1c7c82ca5411ae48fd2f-->
</p>
<p><!--49e0d34ca2cd0a35fe5fa98e268ea7a0-->
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/uncaught-exception-permission-denied-to-get-property-objectconstructor/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>&#8220;ext-util:resource&#8221; new spring namespace for loading property from different scope i.e. system, test, dev</title>
		<link>http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/</link>
		<comments>http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 08:46:24 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
		
	<category>Java</category>
	<category>java ee</category>
	<category>spring framework</category>
	<category>namespace</category>
		<guid isPermaLink="false">http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/</guid>
		<description><![CDATA[within spring container i was getting problem with managing multi level configuration.
for example while i am developing i got a specific filesystem path, database configuration and so on.
this configuration are mostly get changed while i an deploying them on the test or production environment.
this type of scenario is common on most of the projects. managing [...]]]></description>
			<content:encoded><![CDATA[<p>within spring container i was getting problem with managing multi level configuration.<br />
for example while i am developing i got a specific filesystem path, database configuration and so on.<br />
this configuration are mostly get changed while i an deploying them on the test or production environment.</p>
<p>this type of scenario is common on most of the projects. managing different scoped configuration is one of the bothering stuff. so i was always thinking some simpler way with in spring container.</p>
<p>so i wrote &#8220;ext-util&#8221; namespace handler, which is locating property from multi scoped resource.<br />
lets give you a more details use case -</p>
<p>in my test environment i have a property &#8220;index.directory=/Users/&#8230;/index&#8221;<br />
in my test server i use &#8220;index.directory=/var/index&#8221;<br />
in my production server i use &#8220;index.directory=/nfs/index&#8221;</p>
<p>here i have a bean which need this property.</p>
<blockquote style="padding: 5px; background: #000000 none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff"><p>< bean id="fsDirectory"         class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean" ><br />
< property name="location" value="file:////Users/nhmtanveerhossainkhanhasan/java-tmp/index" / ><br />
< /bean></p></blockquote>
<p>you can see the hardcoded configuration. which is not easy to manage.<br />
thats why here my &#8220;ext-util&#8221; goes with the simplest solution -</p>
<blockquote style="padding: 5px; background: #000000 none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; color: #ffffff"><p>< ext-util:resource id="directoryResource"                      from-property="index.directory" scope="test" / ><br />
< bean id="fsDirectory"         class="org.springmodules.lucene.index.support.FSDirectoryFactoryBean" ><br />
< property name="location" ref="directoryResource" / ><br />
< /bean></p></blockquote>
<p>now my property resource is locating from &#8220;test&#8221; scope.</p>
<p>you might think, this &#8220;scope=&#8217;test&#8217;&#8221; is again hardcoded stuff, so i also support the following value -<br />
scope=&#8221;sys:env&#8221;, now you have to define &#8220;-Denv=test&#8221; while you running your application, and spring bean will find the right property.</p>
<p>so what ever you put over your spring are no longer hardcoded as long as you locate them through &#8220;ext-util&#8221; which is stands for &#8220;extended utility&#8221;.</p>
<p><a title="spring namespace ext-util for locating system or scoped properties" href="http://hasan.we4tech.com/wp-content/uploads/2007/12/spring-namespace-ext-util.zip">here is my attached source code - (i just extracted them from my on going project, thats why no build script or prebuilt package or maven artifact is bundled)</a></p>
<p><strong>how to use -</strong><br />
include the source file with in your project<br />
keep &#8220;META-INF&#8221; while you building your jar or keep them inside your classpath.<br />
change your spring configuration -</p>
<p>xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221;<br />
xmlns:lang=&#8221;http://www.springframework.org/schema/lang&#8221;<br />
xmlns:aop=&#8221;http://www.springframework.org/schema/aop&#8221;<br />
<em><strong>xmlns:ext-util=&#8221;http://dev.somewherein.net/schema/ext-util&#8221;</strong></em><br />
xsi:schemaLocation=&#8221;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd<br />
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd<br />
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd<br />
<strong><em>http://dev.somewherein.net/schema/ext-util http://dev.somewherein.net/resources/schemas/ext-util-0.1.xsd</em></strong>&#8220;/><br />
<strong>basic properties of ext-util -</strong></p>
<blockquote><p>1. <strong>from-property</strong> - which property you are looking for.</p>
<p>2. <strong>or-default</strong> - define default value if no property is found from default scope (system properties) this value is returned.</p>
<p>3. <strong>scope</strong> - define scope name, by default whatever you set except &#8220;sys:&#8221; prefixed string, will search for &#8220;classpath:&#8221;. also you can use &#8220;sys:abc&#8221; where abc is located from system properties.</p>
<p>4. <strong>path-prefix</strong> - you can define scope properties path prefix, this prefix can be &#8220;file:///, classpath:&#8221;. this value also can be prefixed by &#8220;sys:abc&#8221; where abc is located from system properties.</p></blockquote>
<p><a title="spring namespace ext-util for locating system or scoped properties" href="http://hasan.we4tech.com/wp-content/uploads/2007/12/spring-namespace-ext-util.zip">[download source code]</a><br />
<a href="http://hasan.we4tech.com/wp-content/uploads/2008/04/ext-util-01xsd.zip">[download missing xsd file]</a></p>
<p>best wishes,</p>
<p><!--fc37dc39b783d0125ea3aa50675127f9--></p>
<p><!--e9927b35c96f3a5d11179320bda2993b--></p>
<p><!--b0ea32c2559a8e05ab2f7fc04e0ff6b5-->
</p>
]]></content:encoded>
			<wfw:commentRSS>http://hasan.we4tech.com/ext-utilresource-new-spring-namespace-for-loading-property-from-different-scope-ie-system-test-dev/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
