Removing Extra Space Underneath An Image

You have already applied normalize.css but there is still additional white space underneath an image. This is because the browsers by default will recognize the images as an inline-element, hence additional “line-height” is apply.

For example, key in the following html:

<div style='border:1px solid red;'>
 <img src='marvel.jpg'/>

Noticed that extra space (line-height)?


  1. Either add in “display:block” to the image
    <div style='border:1px solid red;'>
     <img src='marvel.jpg' style='display:block;'/>
  2. Or add in “line-height:0” to the containing dom
    <div style='line-height:0;border:1px solid red;'>
     <img src='marvel.jpg'/>

IBM WebSphere Portal Woes

We have been working with IBM WebSphere Portal for almost 8 years (from version 6.0 to 8.5) and we often realized that there are some points that IBM sales personnels deliberately wouldn’t let you know.

Disclaimer: We are still happy with IBM WebSphere Portal.

Poor PMR (aka Service Request) support

They wouldn’t attempt to read and replicate the issue in their own environment on their first reply (despite how much information you have provided them).

For example, we had reported recently that the Top Left Edit Tools in WebSphere Portal v8.5 were not showing in the latest Chrome version (44.0.2403.125) and even pointed out that we had experienced similar issue with the portal provided in one of the IBM training workshops.

We were thinking that L2 should be able to replicate the issue easily as L2 just need to update his Chrome browser. We are wrong:

Didn’t mean to be mean but we have already tried our best to provide you as much information as we could and it is really difficult to get trace.log from client environment with all the red tapes involved. Plus in this case, all you need to do is to update your Chrome browser to the latest version:

Mystery resolved (once L2 decided to update his browser and escalated the issue):

2) You can’t get rid of “/wps/portal” in your URL

Windows Update Takes Forever to Update

One of my Windows 2008 R1 servers suddenly refuses to update. The process seems to be taking forever (or rather stuck) even for searching for updates.

Luckily the solution for me is simple:

  • At the Task Manager, search for “wuauserv” process (in Window 10, search for Windows Update) and stop the process.
  • Delete all of the files found under C:\Windows\SoftwareDistribution directory
  • Run Windows Update (issue should be resolved)

WebSphere Portal – Error 404: EJCBD0006E: The resolution of a URI failed. Refer to the SystemOut.log for more detailed information.

If you are encountering the following errors:

  • “Error 404: EJCBD0006E: The resolution of a URI failed. Refer to the SystemOut.log for more detailed information.” .
  • And your SystemOut.log is returning you:
    [7/30/15 15:11:47:539 SGT] 00000124 ExceptionLogg W logThrowable An exception occurred: [EJCBC0009E: The entity [[ObjectIDImpl 'Z6_00000000000000A0BR2B300G10', CONTENT_NODE, VP: 16576, [Domain: rel], DB: C040-000000000000000080026B8B35008001]] could not be be found.]. Enable traces for [] to see the exception stack trace.
    [7/30/15 15:11:47:543 SGT] 00000124 ResolvedPrepr I process The resolution process failed, for more details enable tracing for [].


This might be a issue with the “Web Content Authoring” page under Hidden Pages (Content Root > Hidden Pages > Web Content Authoring).

  1. Go to Administration > Portal User Interface > Manage Pages.
  2. Ensure that “Web Content Authoring” page is Active.
  3. Ensure that the particular user has a USER role for that page.


Notes on Regular Expression

  1. What is the difference between “*” and “+”?
    “*” will match the character zero or more times whereas “+” will match one or more times. For example, “\d*” regular expression will return the following results for:

    • 2b – will match “2b”
    • 3ab – will match “b” (since digit character is optional)

    Now consider “\d+” regular expression:

    • 2b – will still match “2b”
    • 3ab – will not return any match as “+” required one or more times matches.
  2. <continue…>

Javascript: How to Calculate Number of Working Days?

Date.workingDaysFrom(fromDate) calculates the number of working days between 2 Date objects (excluding weekends; Sat and Sun). The method will return “-1” if the fromDate is an invalid Date object or is later than the compared Date.

Do take note that this method does not take public holidays into consideration and each date is consider as a full day.

 // ensure that the argument is a valid and past date
 if(!fromDate||isNaN(fromDate)||this<fromDate){return -1;}

 // clone date to avoid messing up original date and time
 var frD=new Date(fromDate.getTime()),
     toD=new Date(this.getTime()),

 // reset time portion

  var day=frD.getDay();
 return numOfWorkingDays;



Comparing 8-Jul-2015 (Wed) to 13-Jul-2015 (Mon)

var startDate = new Date("8/8/2015");
var endDate = new Date("13/8/2015");
endDate.workingDaysFrom(startDate); // returns 4

Comparing same date, 8-Jul-2015 (Wed)

var startDate = new Date("8/8/2015");
var endDate = new Date("8/8/2015");
endDate.workingDaysFrom(startDate); // returns 1


How to Generate Facebook Access Token for Public Page Feed?

Most clients would prefer a customized Facebook feed (especially those supporting multiple social media) , hence this bring us to this question:

“What is the easiest method to generate a Facebook access token just to retrieve their public page feed?”

A simple step is to create an “empty” Facebook application and use its access token (note that most likely the UI is going to change but the idea is there):

  1. Go to
  2. Go to “Add a New App” (My Apps > Add a New App).
  3. Select “WWW” (or any) and click on “Skip and Create App ID”.
  4. Give the application a suitable name and namespace for future reference.
  5. Grats! You have generated your own access token! For secret key, remember to click on the “Show” button.
  6. To verify, key in the following url and you should be able to see the public page feed:<page id>/posts?access_token=<App ID – as shown in above image>|<App Secert>

WebSphere: How to Access Portal Theme Tags in JSP?

Add “<%@ taglib uri=”/WEB-INF/tld/portal.tld” prefix=”portal” %>” in order to access the portal theme tags like “<portal-logic/>” and “<portal-navigation/>“.

To call the tag function, simply call <portal:<function name>/>. For example in portal theme, we would call:

<portal-logic:if loggedIn="yes">...</portal-logic:if>


<portal:if loggedIn="yes">...</portal:if>

Just another WordPress site