Byte My Data

A personal collection of advice and solutions I've used.

About the author

Something about the author

Where is the STSADM.EXE located?

It's on the WSS server located in:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\

If not in there for you, check the bin folder in one of the other numeric directories in the web server extensions directory.


Permalink | Comments (1) | Post RSSRSS comment feed

Where is the GACUTIL.EXE located?

There is a gacutil.exe for each version of the .NET Framework. You need to use the one that is the same as the assembly you wish to un/install.

.NET v1.1:

%windir%\Microsoft.NET\Framework\v1.1.4322\

Visual Studio 2005:

C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\

Visual Studio 2008:

C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin

Categories: .NET
Permalink | Comments (0) | Post RSSRSS comment feed

Add a blank line in a windows MS-DOS batch file

Add a period after the ECHO command:

ECHO.


Permalink | Comments (0) | Post RSSRSS comment feed

Installing and activating SharePoint feature

Original Post: http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/ef50eb2d-7e12-4373-90c8-75832c20ac21

INSTALL:

stsadm.exe -o installfeature -filename "foldername\feature.xml"

ACTIVATE:

stsadm.exe -o activatefeature -filename "foldername\feature.xml" -url http:\\sharepoint.website.com

Note: the filename is the relative path to the Feature.xml file in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES.


Permalink | Comments (0) | Post RSSRSS comment feed

Deploying a site from WSS 3 or transferring to MOSS 2007

Here's a great post that tells you step by step what you need to do:

http://blogs.microsoft.co.il/blogs/joe/archive/2008/11/22/transferring-a-site-from-wss-3-to-moss-2007-part-1.aspx


Permalink | Comments (0) | Post RSSRSS comment feed

Uninstall assembly from GAC

The usual way:

    C:\>gacutil.exe /u[f] <assembly name>

If it can't find gacutil.exe, check the %windir%\Microsoft.NET\Framework\v1.1.4322\ directory.

In this command, assembly name is the name of the assembly to uninstall from the GAC. The following example removes an assembly named hello.dll from the GAC.

    gacutil /u "hello,Version=1.0.0.0, Culture=neutral, PublicKeyToken=0123456789ABCDEF"

If you still can't uninstall it, here's a solution from Peter Huang [MSFT] that should work. The original post is at: http://bytes.com/topic/net/answers/49299-uninstall-assembly-gac#post366811

  1. Run cmd in run dialog.
  2. cd %systemroot%\assembly\gac\ClassLibrary1\1.0.1322.2 1592__22df95e3b227e638
  3. (My test dll is ClassLibrary1.dll)
  4. del ClassLibrary1.dll
  5. del __AssemblyInfo__.ini
  6. cd..
  7. rd 1.0.1322.21592__22df95e3b227e638
  8. cd..
  9. rd ClassLibrary1

You may perform the steps above to see if the ClassLibray1 has been removed from the GAC.


Permalink | Comments (0) | Post RSSRSS comment feed

WinRAR command line syntax, commands and switches manual/documentation

Here's an online manual for WinRAR:

http://www.downloadatoz.com/manual/wi/winrar/html/HELPCommandLineSyntax.htm


Permalink | Comments (0) | Post RSSRSS comment feed

Sharepoint weather web part using RSS and weather.yahoo.com

I was looking for a free weather web part to replace an evaluation version of the one I had. I knew that the web part was using the weather.yahoo.com RSS so I figured I'd build my own with a little help from Google :-). I found a great post from Ketaanh Shah with a solution for exactly what I needed and without even creating a custom webpart!

The original post is here: http://blogs.msdn.com/ketaanhs/archive/2008/03/22/showing-weather-web-part-using-rss-weather-yahoo-com-in-sharepoint-2007.aspx

One thing to note in step #2:
For myself I am passing the following parameters (instead of p) as described on http://developer.yahoo.com/weather/#req

For the Weather RSS feed there are two parameters:

  • w for WOEID.
  • u for degrees units (Fahrenheit or Celsius).

The WOEID parameter w is required. Use this parameter to indicate the location for the weather forecast as a WOEID.

http://weather.yahooapis.com/forecastrss?w=location

For example, to get weather for Yahoo! Headquarters in Sunnyvale, CA, use the WOEID code for Sunnyvale (2502265):

http://weather.yahooapis.com/forecastrss?w=2502265

The location parameter needs to be a WOEID. To find your WOEID, browse or search for your city from the Weather home page. The WOEID is in the URL for the forecast page for that city. You can also get the WOEID by entering your zip code on the home page. For example, if you search for Los Angeles on the Weather home page, the forecast page for that city is http://weather.yahoo.com/united-states/california/los-angeles-2442047/. The WOEID is 2442047.

_____________________________________________________________

Showing Weather web-part using RSS & weather.yahoo.com (in Sharepoint 2007)

One of my Colleagues happen to ask me how do we show the weather web-part on our Sharepoint Portal. The Solution was pretty simple and thought I should share this with you all. Following are the steps:

1. Add the RSS web-part on your sharepoint portal (MOSS, Sharepoint 2007) site.

2. Give the RSS feed as: http://weather.yahooapis.com/forecastrss?p=08810 (p is the Parameter for your zip code)

3. Now the most important part, open the XSL editor of your RSS web-part and remove everything from there and then just paste one of the XSL codes (show below) into that. Thats it you are done, your weather web-part is ready now. So all that is important here is XSL.

First XSL Variation:

1st XSL Variation

<?xml version="1.0" encoding="ISO-8859-1"?> 

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<xsl:output method="html" indent="yes"/> 

<xsl:template match="/"> 

<xsl:variable name="scale">
    <xsl:value-of select="rss/channel/yweather:units/@temperature"/>
</xsl:variable> 

<table width="100%" border="0" cellspacing="0" cellpadding="3" class="Normal">
  <tr bgcolor="#CCCCCC"> 
    <td colspan="2"><strong>Weather Report - <xsl:value-of select="rss/channel/item/title"/></strong></td>
  </tr>
  <tr> 
    <td><strong>Currently <font size="4"><xsl:value-of select="rss/channel/item/yweather:condition/@temp"/><xsl:text>°</xsl:text><xsl:copy-of select="$scale" /></font></strong><br/>
      High <xsl:value-of select="rss/channel/item/yweather:forecast/@high"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> <br/>
      Low <xsl:value-of select="rss/channel/item/yweather:forecast/@low"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> </td>
    <td>
      <xsl:text disable-output-escaping="yes"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
      <xsl:value-of select="rss/channel/item/yweather:condition/@code"/>
      <xsl:text disable-output-escaping="yes">.gif"/></xsl:text>
      <br/>
      <xsl:value-of select="rss/channel/item/yweather:condition/@text"/></td>
  </tr>
  <tr bgcolor="#CCCCCC"> 
    <td colspan="2"><strong>2 Day Forecast</strong></td>
  </tr>
  <tr> 
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="3" class="Normal">
      <xsl:for-each select="(rss/channel/item/yweather:forecast)[position() < 3]">
        <tr>
          <td><xsl:value-of select="@day"/></td>
          <td>
            <xsl:text disable-output-escaping="yes"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
        <xsl:value-of select="@code"/>
        <xsl:text disable-output-escaping="yes">.gif"/></xsl:text>
          </td>
          <td><xsl:value-of select="@text"/><br/>High: <xsl:value-of select="@high"/>
            <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> 
             Low: <xsl:value-of select="@low"/><xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> 
          </td>
        </tr>
       </xsl:for-each>
      </table></td>
  </tr>
  <tr bgcolor="#CCCCCC"> 
    <td colspan="2"><strong>More Current Condition Details</strong></td>
  </tr>
  <tr> 
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="3" class="Normal">
        <tr> 
          <td>High </td>
          <td><xsl:value-of select="rss/channel/item/yweather:forecast/@high"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /></td>
        </tr>
        <tr> 
          <td>Low </td>
          <td><xsl:value-of select="rss/channel/item/yweather:forecast/@low"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /></td>
        </tr>
        <tr> 
          <td>Wind Chill </td>
          <td><xsl:value-of select="rss/channel/yweather:wind/@chill"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /></td>
        </tr>
        <tr> 
          <td>Wind Speed </td>
          <td>
            <xsl:value-of select="rss/channel/yweather:wind/@speed"/>
            <xsl:text> </xsl:text>
            <xsl:value-of select="rss/channel/yweather:units/@speed"/>
          </td>
        </tr>
        <tr> 
          <td>Wind Direction </td>
          <td>
            <xsl:value-of select="rss/channel/yweather:wind/@direction"/>
          </td>
        </tr>
        <tr> 
          <td>Sunrise </td>
          <td>
            <xsl:value-of select="rss/channel/yweather:astronomy/@sunrise"/>
          </td>
        </tr>
        <tr> 
          <td>Sunset </td>
          <td>
            <xsl:value-of select="rss/channel/yweather:astronomy/@sunset"/>
          </td>
        </tr>
        <tr> 
          <td>Latitude </td>
          <td><xsl:value-of select="rss/channel/item/geo:lat"/></td>
        </tr>
        <tr> 
          <td>Longitude </td>
          <td><xsl:value-of select="rss/channel/item/geo:long"/></td>
        </tr>
        <tr>
          <td>
            <p><xsl:text> </xsl:text></p>
            <p>
              <a href="http://weather.yahoo.com" target="_blank"></a>
            </p>
          </td>
        </tr>
      </table></td>
  </tr>
</table> 

</xsl:template> 

</xsl:stylesheet> 

Second XSL Variation:

2nd XSL Variation

<?xml version="1.0" encoding="ISO-8859-1"?> 

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<xsl:output method="html" indent="yes"/> 

<xsl:template match="/"> 

<xsl:variable name="scale">
    <xsl:value-of select="rss/channel/yweather:units/@temperature"/>
</xsl:variable> 

<table width="100%" border="0" cellspacing="0" cellpadding="3" class="Normal">
  <tr bgcolor="#CCCCCC"> 
    <td colspan="2"><strong>Weather Report - <xsl:value-of select="rss/channel/item/title"/></strong></td>
  </tr>
  <tr> 
    <td><strong>Currently <font size="4"><xsl:value-of select="rss/channel/item/yweather:condition/@temp"/><xsl:text>°</xsl:text><xsl:copy-of select="$scale" /></font></strong><br/>
      High <xsl:value-of select="rss/channel/item/yweather:forecast/@high"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> <br/>
      Low <xsl:value-of select="rss/channel/item/yweather:forecast/@low"/> <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> </td>
    <td>
      <xsl:text disable-output-escaping="yes"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
      <xsl:value-of select="rss/channel/item/yweather:condition/@code"/>
      <xsl:text disable-output-escaping="yes">.gif"/></xsl:text>
      <br/>
      <xsl:value-of select="rss/channel/item/yweather:condition/@text"/></td>
  </tr>
  <tr bgcolor="#CCCCCC"> 
    <td colspan="2"><strong>2 Day Forecast</strong></td>
  </tr>
  <tr> 
    <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="3" class="Normal">
      <xsl:for-each select="(rss/channel/item/yweather:forecast)[position() < 3]">
        <tr>
          <td><xsl:value-of select="@day"/></td>
          <td>
            <xsl:text disable-output-escaping="yes"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/</xsl:text>
        <xsl:value-of select="@code"/>
        <xsl:text disable-output-escaping="yes">.gif"/></xsl:text>
          </td>
          <td><xsl:value-of select="@text"/><br/>High: <xsl:value-of select="@high"/>
            <xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> 
             Low: <xsl:value-of select="@low"/><xsl:text>°</xsl:text><xsl:copy-of select="$scale" /> 
          </td>
        </tr>
       </xsl:for-each>
      </table></td>
  </tr>
    <tr>
    <td colspan="2">
        <p>
            <a href="http://weather.yahoo.com" target="_blank">Powered by Yahoo Weather</a>
        </p>
    </td>
  </tr>
</table> 

</xsl:template> 

</xsl:stylesheet>

Third XSL Variation:

3rd XSL Variation

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:yweather="http://xml.weather.yahoo.com/ns/rss/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
 <xsl:output method="html" indent="yes"/>

 <xsl:template match="/">
  <style type="text/css">
   .location {
    width: 100%;
    text-align: left;
    font-family:  Tahoma;
    font-size: 10pt;
    background: #ffffff;
    color: #075199;
    border-collapse:collapse;
    border-color: #ace #ebf3fb #ace;
   }
   
   .location a:link, a:visited { text-decoration: none;  }
   .location a:hover   { text-decoration: underline;}
   
   .weather-condition {
    padding: 0px; 0px; 0px; 0px;
    width: 80px;
    min-width: 80px;
    max-width: 100px;
    text-align: center;
    font-family:  Tahoma;
    font-size: 8.4pt;
    bacground: #ffffff;
    color: #666;
   }

   .temprature {
    width: 50px;
    max-width: 70px;
    padding: 3px 6px 3px 6px;
    text-align: center;
    font-family: Tahoma;
    font-size: 10.5pt;
    border-collapse:collapse;
    border-color: #ace #ebf3fb #ace;
    color: #333333;
    font_weight: 700;
   }

   .high-low-text {
    padding-right: 3px;
    text-align: left;
    font-family: Tahoma;
    font-size: 8.4pt;
    font-weight: 700;
    color: #666;
   }
   .high-low-value {
    text-align: left;
    font-family:  Tahoma;
    font-size: 8.4pt;
    font-weight: 400;
    color: #075199;
    color: #333333;
   }
  </style>
  <table align="center">
   <tr>
    <td class="location" colspan="3">
     <a class="location" href="{rss/channel/item/link}">
      <xsl:value-of select='rss/channel/yweather:location/@city'/>
      <xsl:choose>
       <xsl:when test="rss/channel/yweather:location/@country='US'">
        , <xsl:value-of select='rss/channel/yweather:location/@region'/>
       </xsl:when>
       <xsl:otherwise>
        , <xsl:value-of select='rss/channel/yweather:location/@country'/>
       </xsl:otherwise>
      </xsl:choose>
     </a>
    </td>
   </tr>
   <tr>
    <td>
     <table>
      <tr>
       <td class="weather-condition" >
        <img src="http://us.i1.yimg.com/us.yimg.com/i/us/we/52/{rss/channel/item/yweather:condition/@code}.gif" />
       </td>
      </tr>
      <tr>
       <td class="weather-condition" >
        <xsl:value-of select='rss/channel/item/yweather:condition/@text'/>
       </td>
      </tr>
     </table>
    </td>
    <td class="temprature" >
     <xsl:value-of select='rss/channel/item/yweather:condition/@temp'/>
     <xsl:text>°</xsl:text>
    </td>
    <td>
     <table>
      <tr>
       <td class="high-low-text">High:</td>
       <td class="high-low-value">
        <xsl:value-of select="rss/channel/item/yweather:forecast/@high"/>
        <xsl:text>°</xsl:text>
       </td>
      </tr>
      <tr>
       <td class="high-low-text">Low:</td>
       <td class="high-low-value">
        <xsl:value-of select="rss/channel/item/yweather:forecast/@low"/>
        <xsl:text>°</xsl:text>
       </td>
      </tr>
     </table>
    </td>
   </tr>
  </table>
  <hr style="color:#C0C0C0; height:1px; padding: 0px 0px 0px 0px"/>
 </xsl:template>
</xsl:stylesheet>


Categories: RSS | SharePoint
Permalink | Comments (0) | Post RSSRSS comment feed

JTableMenu::store failed - Duplicate entry '0' for key 1 SQL=INSERT INTO `jos_menu` (

If you get this it means the auto-increment isn't set for the id primary key in the table.

All you have to do is change the column to auto-increment through MySQL Administrator or phpMyAdmin and that will solve it.

In phpMyAdmin, edit the id column and set the "Extra" attribute to auto_increment.


Categories: Joomla | MySQL
Permalink | Comments (0) | Post RSSRSS comment feed

How do I make a copy of a VirtualBox vdi hard drive?

The VBoxManage.exe command found in the C:\Program Files\Sun\VirtualBox directory.

To use:

VBoxManage.exe clonevdi source.vdi destination.vdi

 


Categories: VM
Permalink | Comments (0) | Post RSSRSS comment feed