Install LPCXpresso on fedora 17

Sometimes, after installing on Fedora 17, LPCExpresso does not start. The error shown is

java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
        /usr/local/lpcxpresso_5.2.4_2122/lpcxpresso/configuration/org.eclipse.osgi/bundles/214/1/.cp/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
        no swt-pi-gtk in java.library.path
        /home/laji/.swt/lib/linux/x86/libswt-pi-gtk-4236.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
        Can't load library: /home/laji/.swt/lib/linux/x86/libswt-pi-gtk.so

 

To solve this dependency problem, gtk-engines  for linux32 has to be installed on the system, with the command:

sudo yum install gtk2-engines.i686

Now LPCXpresso starts without any error.

 

Convert timezone abbreviation to hours

Convert timezone abbreviation to hours

<hours><xsl:value-of select="local:getTimeZoneHours('CET')"/></hours>

will have as result

<hours>1</hours>

 

Here is the function code:

<!-- Returns TimeZone in hours-->

<xsl:function name="local:getTimeZoneHours">
<xsl:param name="timezone" as="xs:string"/>
<xsl:variable name="timezones">
<timezones>
<timezone>
<time>0</time>
<name>GMT</name>
<description>Greenwich Mean Time</description>
</timezone>
<timezone>
<time>0</time>
<name>UTC</name>
<description>Universal Coordinated Time </description>
</timezone>
<timezone>
<time>0</time>
<name>WET</name>
<description>Western European Time </description>
</timezone>
<timezone>
<time>-2</time>
<name>AT</name>
<description>Azores Time</description>
</timezone>
<timezone>
<time>-4</time>
<name>AST</name>
<description>Atlantic Standard Time</description>
</timezone>
<timezone>
<time>-5</time>
<name>EST</name>
<description>Eastern Standard Time </description>
</timezone>
<timezone>
<time>-6</time>
<name>CST</name>
<description>Central Standard Time </description>
</timezone>
<timezone>
<time>-7</time>
<name>MST</name>
<description>Mountain Standard Time </description>
</timezone>
<timezone>
<time>-8</time>
<name>PST</name>
<description>Pacific Standard Time</description>
</timezone>
<timezone>
<time>-9</time>
<name>YST</name>
<description>Yukon Standard Time</description>
</timezone>
<timezone>
<time>-10</time>
<name>AHST</name>
<description>Alaska-Hawaii Standard Time </description>
</timezone>
<timezone>
<time>-10</time>
<name>CAT</name>
<description>Central Alaska Time </description>
</timezone>
<timezone>
<time>-10</time>
<name>HST</name>
<description>Hawaii Standard Time </description>
</timezone>
<timezone>
<time>-11</time>
<name>NT</name>
<description>Nome Time </description>
</timezone>
<timezone>
<time>-12</time>
<name>IDLW</name>
<description>International Date Line West</description>
</timezone>
<timezone>
<time>1</time>
<name>CET</name>
<description>Central European Time </description>
</timezone>
<timezone>
<time>1</time>
<name>FWT</name>
<description>French Winter Time </description>
</timezone>
<timezone>
<time>1</time>
<name>MET</name>
<description>Middle European Time </description>
</timezone>
<timezone>
<time>1</time>
<name>MEWT</name>
<description>Middle European Winter Time </description>
</timezone>
<timezone>
<time>1</time>
<name>SWT</name>
<description>Swedish Winter Time </description>
</timezone>
<timezone>
<time>2</time>
<name>EET</name>
<description>Eastern European Time </description>
</timezone>
<timezone>
<time>3</time>
<name>BT</name>
<description>Baghdad Time </description>
</timezone>
<timezone>
<time>7</time>
<name>WAST</name>
<description>West Australien Time</description>
</timezone>
<timezone>
<time>8</time>
<name>CCT</name>
<description>China Coast Time  </description>
</timezone>
<timezone>
<time>9</time>
<name>JST</name>
<description>Japan Standard Time </description>
</timezone>
<timezone>
<time>10</time>
<name>EAST</name>
<description>East Australian Standard Time </description>
</timezone>
<timezone>
<time>10</time>
<name>GST</name>
<description>Guam Standard Time</description>
</timezone>
<timezone>
<time>12</time>
<name>IDLE</name>
<description>International Date Line East</description>
</timezone>
<timezone>
<time>12</time>
<name>NZST</name>
<description>New Zealand Standard Time </description>
</timezone>
<timezone>
<time>1</time>
<name>BST</name>
<description>British Summer Time </description>
</timezone>
<timezone>
<time>-3</time>
<name>ADT</name>
<description>Atlantic Daylight Time </description>
</timezone>
<timezone>
<time>-4</time>
<name>EDT</name>
<description>Eastern Daylight Time </description>
</timezone>
<timezone>
<time>-5</time>
<name>CDT</name>
<description>Central Daylight Time </description>
</timezone>
<timezone>
<time>-6</time>
<name>MDT</name>
<description>Mountain Daylight Time </description>
</timezone>
<timezone>
<time>-7</time>
<name>PDT</name>
<description>Pacific Daylight Time </description>
</timezone>
<timezone>
<time>-8</time>
<name>YDT</name>
<description>Yukon Daylight Time </description>
</timezone>
<timezone>
<time>-9</time>
<name>HDT</name>
<description>Hawaii Daylight Time </description>
</timezone>
<timezone>
<time>2</time>
<name>MEST</name>
<description>Middle European Summer Time</description>
</timezone>
<timezone>
<time>2</time>
<name>CEST</name>
<description>Central European Summer Time</description>
</timezone>
<timezone>
<time>2</time>
<name>SST</name>
<description>Swedish Summer Time </description>
</timezone>
<timezone>
<time>2</time>
<name>FST</name>
<description>French Summer Time</description>
</timezone>
<timezone>
<time>8</time>
<name>WADT</name>
<description>West Australian Daylight Time</description>
</timezone>
<timezone>
<time>11</time>
<name>EADT</name>
<description>East Australian Daylight Time </description>
</timezone>
<timezone>
<time>13</time>
<name>NZDT</name>
<description>New Zealand Daylight Time </description>
</timezone>
</timezones>
</xsl:variable>

<xsl:variable name="hours">
<xsl:value-of select="$timezones//timezone[name=upper-case($timezone)]/time"/>
</xsl:variable>

<xsl:value-of select="xs:integer($hours)"/>
</xsl:function>