Saturday, September 29, 2012

iPhone 5 Gets Really Hot

After having used it for a couple of weeks now, I've noticed that it gets really hot when I'm browsing the Internet with 3G. It's cool when I'm running over WIFI.  It gets hot when I am doing voice calls, too.  Not sure if this is normal?

Set Default XCode

Context:
XCode 4.3
XCode 4.5

Problem:
I want to keep XCode 4.3 and default to XCode 4.5.  I want to switch between the two.

Solution:
At command line,

xcode-select --print-path to show the current path
sudo xcode-select -switch /Applications/XCode4.5/Xcode.app

Thursday, September 27, 2012

Apple iPhone 5 - Unhappy Customers - Apple Failed

Context:
Advanced Apple User and Owner - owning many Apple products (iPod nano, iPod, iPad, MacBook Air, MacBook Pro, Mouse, Keyboard, Headphones and now, iPhone)

New Apple iPhone 5

Problem:
Ok, we preordered three new iPhone 5.  Two of the iPhones (mine and one of my brothers' rattle.  Sounds like the internal components are loose.  My brother took his to the Apple Store and asked what was wrong.  They replaced him with a new one.  He didn't pay too much attention to the new one -- thinking that it must be good since it's coming out of the box.  He walked out of the store.  On his way, he noticed that there was a nick (notch, dent, scratch, however, you call it) on the silence switch.  He went right back to the store and asked for another one.  They refused to replace again.  WTF?  We are very unhappy with the situation.  I still have the rattled phone.  Right now, only one of the three is good. One rattles; and the other one has a nick.  Looks like Apple failed us this time.  This makes me think twice now before I buy another Apple product.  I always thought that Apple products were high quality, and their customer service was top notch.  Well, today, I certainly don't think that way anymore.  I've recommended and persuaded my friends to buy Apple products before.  I guess I can't and won't do that anymore.  Apple, you lost my trust and loyalty in you.

Solution:
Apple needs to correct this problem before the customers become too unhappy and never want to buy Apple products again.

Tuesday, August 14, 2012

In-App Purchase - No Products Returned

Context:

iPad
iOS 5.1
In-App Purchase

Problem:

Everything is set up correctly for in-app purchases (if you don't know how, you can read up on how to set it up); however, no products are returned when queried.  So very annoying problem.

Solution:

Well, at least for me, deleted the app from my iPad, built and ran my project again in Xcode.  That's it!

Wednesday, May 30, 2012

Default parameter specifiers are not permitted

   
Context:

Windows XP
Visual Studio 2010
.NET 2.0

Problem:

I have this code:

XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load(reportXslFilename, XsltSettings.TrustedXslt, null);

 
When I ran it in .NET 4.0, it worked fine.  When I switched my project to .NET 2.0, I started getting this error:

System.Xml.Xsl.XslLoadException {"Default parameter specifiers are not permitted"}

Stack trace:
at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
   at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)

...

Solution:

Since the error occurred at xslt.Load(reportXslFilename, XsltSettings.TrustedXslt, null), I thought it was something here.  Well, it turned out that it was something in my XSL.

I had script and something like this:

public string SayHello(string name = "World") { 
  return "Hello " + name; 
}

As you can see here, I have the default value for the parameter "name."

Removing this fixed my problem.  

Thursday, May 24, 2012

Green File Names In Windows

Context:

Windows Server 2008


Problem:

Green file names, resulting in files not readable by program.

Solution:

To make it not green anymore, right-click on the file, choose properties, then Advanced and uncheck "Encrypt contents to secure data"

Wednesday, May 23, 2012

XSLT Loop Over a Comma Delimited String

Context:

XSLT 1.0
XPath 1.0

Problem:

I needed to loop over a comma delimited string to work individually with each value in the string.

Solution:

Here's the sample string:  1,2,3,4,        

<xsl:call-template name="SimpleStringLoop">
    <xsl:with-param name="input" select="'1,2,3,4,'"/>
</xsl:call-template>

<xsl:template name="SimpleStringLoop">
    <xsl:param name="input"/>
    <xsl:if test="string-length($input) &gt; 0">
      <xsl:variable name="v" select="substring-before($input, ',')"/>
      <xsl:value-of select="$v"/>
      <xsl:call-template name="SimpleStringLoop">
        <xsl:with-param name="input" select="substring-after($input, ',')"/>
      </xsl:call-template>
    </xsl:if> 

</xsl:template>