modery.net

Archive for May, 2009

Tax Payable – $0.00

Categories: Singapore
Comments: No

Today, I received the letter from the Inland Revenue Authority of Singapore (IRAS) with my tax assessment. However, I wasn’t expecting them to state that I don’t have to pay any tax, they stated for tax payable $0.00

I checked with our HR manager, and we found out that she had transmitted my salary information to IRS under my old Foreign Identification Number (FIN), whereas I filed my taxes under my new (current) one. So basically, IRAS was not aware of any income for my new FIN, only for my old one.

I called IRAS, and luckily the officer was able to help me immediately, they’re going to merge my 2 accounts and send me a new letter with the (hopefully) correct tax I have to pay.


The swine flu has reached Singapore, as just reported:

 SINGAPORE has confirmed its first case of Influenza A (H1N1), the Health Ministry said on Wednesday.
The patient is a 22 year-old Singaporean woman who was in New York from May 14 to 24. She arrived back in Singapore from New York on SQ25 on Tuesday at 6.30 am.

She began to develop a cough while onboard. She passed the thermal scanner uneventfully as she did not have fever then. Later in the morning, she consulted a GP who decided to send her to TTSH via a 993 ambulance, given her travel history. She was immediately admitted for testing.

Laboratory confirmation of her infection was made at midnight on Tuesday. The patient is currently being treated at the Communicable Disease Centre at Tan Tock Seng Hospital (TTSH) and is in stable condition.

 

http://www.straitstimes.com/Breaking%2BNews/Singapore/Story/STIStory_382278.html


Recently, I wanted to display some small statistics about how often people participated in the discussions in a SharePoint discussion board. I wanted to show the total number of postings in a small web part. The solution for this requires SharePoint Designer, as it makes use of the Data View Web Part.

I’ll show the steps to display the list of people who participated in a discussion board and their total number of postings from the beginning:
First, I create a new blank site and add a discussion board:
Discussion Board Postings

I open the site in SharePoint Designer and add a Data View Web Part into the right web part zone. In the Data Source Library to the right, I select the discussion board, and then Show Data:
Discussion Board Postings

Right now, only the discussion topics are contained in the rows returned, but not all postings. To change this, click on the name of your Data Source, in my case Discussion Board:
Discussion Board Postings

In the following dialog, select RecursiveAll under Item and folder scope:
Discussion Board Postings

Next, select Created By (if wanted also additional fields), and choose Insert Selected Fields as…. Multiple Item View. The Data View Web Part is now populated with the selected fields.

In the Data View Web Part, select Sort and Group from its menu:
Discussion Board Postings

Sort by Created By, and select Show group header and Collapse group by default:
Discussion Board Postings

You will get something similar to the left part of the following image:
Discussion Board Postings
I then removed the unnecessary parts as seen in the image above, and added a new column for the number of postings. 

Click inside the cell underneath Postings, and in the source code add the following line into it:

<xsl:value-of select="count($nodeset)" />

Next we need to change the query fetching the rows. Find the following line 

<xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Row[((@Author)=$groupheader0 or ((not(@Author) or @Author='') and $groupheader0=' '))]" />

and replace it with 

      <xsl:with-param name="nodeset" select="msxsl:node-set($dvt_Rows)/root//Row[substring-before(substring-after(string(@Author),'userdisp.aspx?ID='),'&quot;')=substring-before(substring-after(string($groupheader0),'userdisp.aspx?ID='),'&quot;')]" />

 

That’s it, the result will look like this:
Discussion Board Postings

 

The drawback at the moment here is that it doesn’t sort by the number of Postings, which I haven’t found out (yet) how to do. 


flooded singapore

Categories: Web
Comments: No

image1014182361.jpg

Mobile Blogging from here.


Update 14 December 2009: Improved slightly, first the tags are stripped, then content shortened. 

Displaying a textual preview of an wiki’s article in SharePoint is quite easy. All one needs to do is create a data view web part with SharePoint Designer (free since April 1) and have it display the field ‘Wiki Contents’ from the wiki’s pages library. Now the contents of this field contain all the HTML markup of the article, which we now need to strip of the tags and also reduce in size.

In order to strip the ‘Wiki Contents’ of the HTML markup, we need to apply XSLT. In the xsl:stylesheet section of the data view web part, add the following template:

<xsl:template name="strip-tags">
  <xsl:param name="text"/>
  <xsl:choose>
    <xsl:when test="contains($text, ‘&lt;’)">
     <xsl:value-of select="substring-before($text, ‘&lt;’)"/>
     <xsl:call-template name="strip-tags">
      <xsl:with-param name="text" select="substring-after($text, ‘&gt;’)"/>
     </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
     <xsl:value-of select="$text"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Afterwards, find <xsl:value-of select="@WikiField" /> and replace it with the following

<xsl:variable name="strippedWiki">
  <xsl:call-template name="strip-tags">
     <xsl:with-param name="text" select="string(@WikiField)"/>
  </xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat(substring($strippedWiki,1,800),
        substring-before(substring($strippedWiki,801,850),’ ‘))"/>
<a href="{@LinkFilenameNoMenu}" mce_href="{@LinkFilenameNoMenu}">….(more)</a>

This calls the template above with a part of the wiki article’s content (replace 800, 801, and 850 accordingly if you want to show more/less) and adds a link to it add the end. The concetanation here is to avoid having a word cut off by adding text add the end of the first substring until the first space is encountered.

The result looks like this:

sharepoint wiki preview

HungryGoWhere.com is one of Singapore’s most famous food guides. It’s community-driven, meaning that users can rate and review restaurants etc., and comment on other people’s reviews. The restaurants are categorised according to their offers, and further information like e.g. phone number, address, etc. is provided.
The corresponding iPhone application offers several neat features, that integrate directly with the website.

Start Screen 1
iPhone hungrygowhere

Start Screen 2
iPhone hungrygowhere

 

 Finding a place to eat can be done through two ways: either searching directly with a keyword, and if wanted, a location, or searching places nearby (the applications makes use of the iPhone’s GPS to determine the current location)

Keyword Search
iPhone hungrygowhere

Places nearby
iPhone hungrygowhere

Results are listed with the name of the restaurant, the approximate distance to it, the location, the price range, and the average rating of other people.

Results
iPhone hungrygowhere

Selecting a place gives a more detailed overview with all the necessary information (opening times, location, detailed information about ratings). Very neat is also the integration with the maps, which allows one to see one’s current location and the location of the selected food outlet.

Details 1
iPhone hungrygowhere

Details 2
iPhone hungrygowhere

Map
iPhone hungrygowhere

Lastly, it is possible to bookmark one’s favourites. However, one has to register at the HungryGoWhere.com website first.

Bookmarks
iPhone hungrygowhere


Every morning on my way to work, I read the morning news while on the MRT/bus. My preferred sources for local news are the Straits Times and Channel NewsAsia, both for which an application for the iPhone exists (Note: there’s also an application for Today called iToday, however I never read Today, and thus haven’t tested this application; also, I have two other applications (Bloomberg, Wall Street Journal) installed which I use for other news).

Straits Times
The Straits Times application downloads the latest news during startup. These news are grouped into different categories (Singapore, SE Asia, Asia, etc.) and an aggregated view with the top stories of each category. The news preview displays the time when it was posted, the headline, and (if available) a small image. Within an article, that image and the article’s text are displayed. However, it has to be noted that, like with the online version, for some articles not the whole text is available (only in the printed version).

Startup screen
iPhone news applications

 
Top Stories
 iPhone news applications

Article view
iPhone news applications

Channel NewsAsia
The CNA application downloads the news online on-demand and not all during startup. Similar to the Straits Times app, it groups the news into different categories, and for each article it displays the time, the headline, and a picture.

Startup screen
iPhone news applications

Category view
iPhone news applications

Select more categories
iPhone news applications

Article view
iPhone news applications