Archive

Archive for May, 2009

The funny thing about me.

May 25, 2009 shamzu 1 comment

After working for few extra hours, I was thinking about the previous post. I decided to get down and stepped into lift.

Pressed the door close button and resumed my thought, assuming that lift is going to ground floor. I didn’t notice anything unusual for next 15 mins. Then i noticed something wrong. Sstill I haven’t reached ground floor!  LCD showed it is still on 4th floor. May be some problem with lift? Oh shit I forgot to press floor’0′ button. :P

Categories: Funny Stuff Tags: ,

The funny thing about Governmet Job

May 25, 2009 shamzu 2 comments

Government expect infinite work from you. If you don’t do anything also, its fine, sleeping

Categories: Funny Stuff Tags:

Liferay- Drop down Menu Portlet

May 23, 2009 shamzu 8 comments

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to FurlAdd to Newsvine

Here is my Next portlet. Hope you enjoyed the Liferay theme with multilevel dropdown menu. What if you can put that drop down menu as a portlet? Here is what I did for that.

drop down portlet1. Here let’s start by downloading the required files. [dropdown_menu portlet.zip]

2. Put these files in webapps\ROOT\html\portlet\ext\dropdown_menu\

3. Copy the following code to webapps\ROOT\WEB-INF\portlet-ext.xml under <portlet-app> tag

<portlet>
<portlet-name>dropdown_menu</portlet-name>
 <display-name>Dropdown Menu</display-name>
<portlet-class>com.liferay.util.bridges.jsp.JSPPortlet</portlet-class>
 <init-param>
 <name>view-jsp</name>
 <value>/html/portlet/ext/dropdown_menu/view.jsp</value>
 </init-param>
 <expiration-cache>0</expiration-cache>
 <supports>
 <mime-type>text/html</mime-type>
 </supports>
 <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
 <security-role-ref>
 <role-name>guest</role-name>
 </security-role-ref>
 <security-role-ref>
 <role-name>power-user</role-name>
 </security-role-ref>
 <security-role-ref>
 <role-name>user</role-name>
 </security-role-ref>
 </portlet>

4. Copy the following code to webapps\ROOT\WEB-INF\liferay-portlet-ext.xml under <portlets> tag

<portlet>
<portlet-name>dropdown_menu</portlet-name>
 <configuration-action-class>com.liferay.portlet.sitemap.action.ConfigurationActionImpl</configuration-action-class>
<portlet-data-handler-class>com.liferay.portlet.sitemap.lar.SitemapPortletDataHandlerImpl</portlet-data-handler-class>
 <use-default-template>true</use-default-template>
 <restore-current-view>false</restore-current-view>
 <layout-cacheable>true</layout-cacheable>
 <instanceable>true</instanceable>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
 <render-weight>50</render-weight>
 <header-portlet-css>/html/portlet/ext/dropdown_menu/css.jsp</header-portlet-css>
 <css-class-wrapper>portlet-site-map</css-class-wrapper>
 <add-default-resource>true</add-default-resource>
 </portlet>

5.  Also make an entry in webapps\ROOT\WEB-INF\liferay-display.xml under <category name=”category.cms”>> as follows

 <display>
 <category name="category.cms">
 ......
<portlet id="dropdown_menu" />
 </category>
 .......
 </display>

You can even customize the root folder for the  drop down menu.

Have you seen the dynamic sitemap portlet? This is a modification of that one. I applied CSS to display the sitemap portlet as a drop down menu. It works pretty well in Firefox and Ie.

WolframAlpha put to Test.

May 16, 2009 shamzu 1 comment

Add to FacebookAdd to NewsvineAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Furl

wolframalphaWolfram alpha is the first step to make all systematic knowledge immediately computable by anyone. Wolfram announced the release of Alpha in this month. I was extreamly curious about how the world is gonna change with this. Definitely it will make your homeworks a piece of cake. What will happen to our favourite answering machine google? on the brighter side, i hope google will come up with something better than Alpha. About 6 hours back, they announced the release of much awaited Alpha in Wolfram_Alpha tweets. I jumped to Their web page. Most of the weird questions i asked lead me no where. Thogh I am impressed with the resuls when the questions was direct. Here is some questions i tried and the answers it retrieved . My exact queries are marked in red.

Read more…

Liferay Dynamic Site Map Portlet

May 16, 2009 shamzu 6 comments

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to FurlAdd to Newsvine

Here is my second liferay portlet. I modified the usual site map portlet to work like a  dynamic site explorer (see the screen shot).

you can download the required files here.

Download Dynamic Site Map Portlet[site_map.zip ]

to modify your current site map portlet, extract these files and overwrite over webapps\ROOT\html\portlet\site_map directory.

SITE MAP

If you want to create a new portlet, follow these steps.

1. rename the extracted folder to sitemap_1

2. create a folder under webapps\ROOT\html\portlet\ named ext

3. copy sitemap_1 folder to ext folder

4. copy the following code to webapps\ROOT\WEB-INF\portlet-ext.xml

<portlet>
<portlet-name>sitemap_1</portlet-name>
 <display-name>Site Map 1</display-name>
<portlet-class>com.liferay.util.bridges.jsp.JSPPortlet</portlet-class>
 <init-param>
 <name>view-jsp</name>
 <value>/html/portlet/ext/sitemap_1/view.jsp</value>
 </init-param>
 <expiration-cache>0</expiration-cache>
 <supports>
 <mime-type>text/html</mime-type>
 </supports>
 <resource-bundle>com.liferay.portlet.StrutsResourceBundle</resource-bundle>
 <security-role-ref>
 <role-name>guest</role-name>
 </security-role-ref>
 <security-role-ref>
 <role-name>power-user</role-name>
 </security-role-ref>
 <security-role-ref>
 <role-name>user</role-name>
 </security-role-ref>
 </portlet>

5. copy the following code to webapps\ROOT\WEB-INF\liferay-portlet-ext.xml

<portlet>
<portlet-name>sitemap_1</portlet-name>
 <configuration-action-class>com.liferay.portlet.sitemap.action.ConfigurationActionImpl</configuration-action-class>
<portlet-data-handler-class>com.liferay.portlet.sitemap.lar.SitemapPortletDataHandlerImpl</portlet-data-handler-class>
 <use-default-template>true</use-default-template>
 <restore-current-view>false</restore-current-view>
 <layout-cacheable>true</layout-cacheable>
 <instanceable>true</instanceable>
<private-request-attributes>false</private-request-attributes>
<private-session-attributes>false</private-session-attributes>
 <render-weight>50</render-weight>
 <header-portlet-css>/html/portlet/ext/sitemap_1/css.jsp</header-portlet-css>
 <css-class-wrapper>portlet-site-map</css-class-wrapper>
 <add-default-resource>true</add-default-resource>
 </portlet>

6.  make an entry in webapps\ROOT\WEB-INF\liferay-display.xml under <category> as follows

<category name="category.cms">
.
.
.
.
.
<portlet id="sitemap_1" />
</category>

7. Restart lifery.

you can locate your new portlet under Content Management

Liferay Theme with Multi level Drop down Menu

May 16, 2009 shamzu 15 comments

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to FurlAdd to Newsvine

A theme with multi level dropdown menu is one in the most wanted list. You can download modified igoogle theme with 5 level dropdown menu from the link below. It works for liferay 5.2.2 in Firefox and Ie.

Download i-google theme with 5 level drop down menu.

If you want to make a drop down menu like this on some other, you can use following files.DROP DOWN MENU

copy custom.css to css folder in theme directory.

copy navigation.vm to templates folder.

copy javascript.js to javascript  folder.

deploy your war and enjoy your new drop down menu :D

Few Liferay portlets for Liferay fans.

May 15, 2009 shamzu 8 comments

liferayL-logoLiferay is one the famous open source enterprise portal platform. It supports JSR 286 portlets. I use this platform for my personal project. Avery good collection of official and community plugins is available in www.liferay.com.

Besides that, I had to develop some more portlets and themes to meet my requirements. I googled a lot to find out if any of them are available off the self. But most of the time I ended up in discussion forums where people asking for the same. So I had to develop these portlets.

You can download these portlets free of cost from my future posts. Please discuss if you find any problem with these codes.

Here is my first one Liferay Theme with Drop down Menu.


Why we should not forward such mails

May 14, 2009 shamzu 1 comment

How many mails  did you received saying that if you don’t forward it, bad luck will fall up on you or if yo forward this blah blah blah….

Obviously, the originators of such messages have some hidden gain if you forward such mail. The mail sounds like, like a curse upon who is not going to forward it.

Studies shows that, if you believe a curse is going to affect you, it will. Even physically. it works in a similar manner as placebo effect works. In placebo treatment, patient is given an inert “sugar pill” and physician convinces him that it is going to work. The treatment sometimes improves the patient’s condition.

the opposite is happening with curses or voodoo. Here is a recent article in newscientist.com The science of voodoo: When mind attacks body. Go on, its worth reading. You will get a clear picture of what I am telling..

Categories: Science Tags: , , ,

Why One is 1,Two is 2 ,Three is 3?

May 13, 2009 shamzu 2 comments

Thought of sharing this info i got by email about number system.

The numbers we write are made up of  algorithms, (1, 2, 3, 4, etc) called Arabic algorithms to distinguish them from the roman algorithms  (I; II; III; IV; etc.),

The Arabs popularize these algorithms. But their origin goes back to the Phoenician merchants that used them to count and do their commercial countability.

Have you ever asked the question why 1 is “one”, 2 is “two”, 3 is “three”…..?

What is the logic that exist in the Arabic algorithms?

There are angles!Look at these algorithms written in their primitive form and check it up!

numbersAnd the most interesting and intelligent of all…..

zero

Web 2.0, Social Networking and Morality Crisis

May 11, 2009 shamzu Leave a comment

social networks

When web upgraded to web 2.0, man became a social networking animal. Still some people don’t bother about social networks. An age in which we consider such people as retards or introverts is not too far. After all revolutions in web are happening in a blink of an eye.

Do you think we are wasting our time in silly website?  No, we are building a novel and efficient way for socialization of future generation. Collaboration and natural selection is the key elements to evolve a social network.  Once this transition period is over, we can say, we gave birth to a new age.

When this whole web 2.0 started like an avalanche, knowledge started flowing like a torrent over our minds. There are few potential dangers for this.

Ever notice that older generation had a better moral system than ours? We (especially youngsters) learn morals from our own and others experiences gathered though variety of media. Once we had such an experience, the moral sinks in to our mind spending some time.

Emotions play a good role here. The moral acquired by you entirely depend on your unique emotional response. Unlike quick thinking, U needs to spend some time to get emotionally attached to a new experience. It is because of the hormonal mechanism through which emotions work.

Now this torrent of experiences from the social networking media, gives you no option for such a settling time. So it will seriously affect the formation of morality of new generation.

social networks

As a solution, we may get adapted to a quick emotional lifestyle. But that will take generations of natural selection with things we do.

Another hope is that, we can build a solution into today’s social networks. If some network could do this effectively, we can hope that ‘every networked being’ will accept it full hearted. They will find something they always missed from social networks.