<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MentorMate &#187; Development</title>
	<atom:link href="http://mentormate.com/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://mentormate.com</link>
	<description>Web, Application, Mobile &#38; Custom Software Development</description>
	<lastBuildDate>Wed, 16 May 2012 15:12:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>The 100% CSS Post-it&#174; Note</title>
		<link>http://mentormate.com/blog/css-postit-note/</link>
		<comments>http://mentormate.com/blog/css-postit-note/#comments</comments>
		<pubDate>Fri, 11 May 2012 18:30:44 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://mentormate.com/?p=3711</guid>
		<description><![CDATA[100% CSS Post-It® Check it out! Who doesn&#8217;t love Post-it notes? In my previous life, before I started learning CSS, I would ask myself &#8220;how can I make a convincing looking Post-it note in Photoshop?&#8221; After extensive CSS study and research I have come to realize that some things can be done with CSS alone. [...]]]></description>
			<content:encoded><![CDATA[<div class="rotate-3">
<div class="postit" style="font-size:28px; float:right; margin-top:5px;">100% CSS Post-It® <br /> Check it out!</div>
</div>
<p>Who doesn&#8217;t love Post-it notes? In my previous life, before I started learning CSS, I would ask myself &#8220;how can I make a convincing looking Post-it note in Photoshop?&#8221; After extensive CSS study and research I have come to realize that some things <em>can</em> be done with CSS alone. That&#8217;s right, the post it you see on the right is 100% CSS. Go ahead, check it out. Here is how it is done.</p>
<p>I broke the instructions up into key elements so the uninitiated can get a feel for how I constructed everything. The process itself might be helpful for some people &#8211; it was certainly helpful for me. If you aren&#8217;t interested in my life story, feel free to skip to the end for a quick ‘plug and play’ code snippet.</p>
<h3>Making the Post-it</h3>
<pre class="wp-code-highlight prettyprint">margin: 25px;
width: 250px;
min-height:175px;
max-height:175px;
padding-top:35px;</pre>
<p>This is the basic square that will be built around your content. The height is somewhat complicated because I want the text to begin lower on the Post-it rather than at the top. To ensure the padding doesn’t add any height while still lowering the text, set a min and max parameter on the height.</p>
<h3>The Yellow Color</h3>
<pre class="wp-code-highlight prettyprint">background: rgb(255,255,136); /* Old browsers */
background: -moz-linear-gradient(-45deg, rgba(255,255,136,1) 77%, rgba(255,255,214,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right bottom, color-stop(77%,rgba(255,255,136,1)), color-stop(100%,rgba(255,255,214,1))); /*Chrome,Safari4+*/
background: -webkit-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* IE10+ */
background: linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff88', endColorstr='#ffff88',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
}</pre>
<p>This is where much of the magic happens. When you think of a Post-it note you probably think of yellow, right? It&#8217;s true, but we need to think in 3D terms. It needs a yellow gradient that fades at a 45-degree angle into a slightly lighter color at the bottom right. This will help with creating a &#8220;peeled up&#8221; illusion later on. I just used this amazing tool (<a href="http://www.colorzilla.com/gradient-editor">http://www.colorzilla.com/gradient-editor</a>) to make mine.  This code looks like a huge mess, but it&#8217;s mostly due to cross-browser support. Speaking of cross-browser support, Internet Explorer 6-9 does not like diagonal gradients so this website provides a nice fallback and converts our diagonal gradient into a horizontal gradient. This is not optimal so I recommend changing the last line of code here:</p>
<pre class="wp-code-highlight prettyprint">filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff88', endColorstr='#ffff88',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */</pre>
<p>Either make startColorstr and endColorstr the same number (which will turn off the gradient and make the Post-it a solid color) or change GradientType from 1 to 0 (this will make the gradient vertical instead of horizontal). I chose to remove the gradient.</p>
<pre class="wp-code-highlight prettyprint">border:1px solid #E8E8E8;
border-top:60px solid #fdfd86;</pre>
<p>I am doing something special with the border. You could easily give this a 1px light grey border and it would look fine, however, Post-its have that sticky glue-like substance on top that, when in use, has a slightly different look than the rest of the Post-it. I created a thick top border that is nearly the same color as the yellow I used. The effect is so slight you almost can&#8217;t tell it&#8217;s there, but anyone who does will surely appreciate it.</p>
<h3>Font Styling</h3>
<pre class="wp-code-highlight prettyprint">
font-family:'Reenie Beanie';
font-size:22px;
text-align:center;
</pre>
<p>This is my font styling. Consider putting a script font on your post it, something like Marker Felt or Comic Sans, or preferably something interesting from the <a href="http://www.google.com/webfonts">Google Font API</a> like Reenie Beanie seen here.</p>
<h3>A Peeled Corner</h3>
<p>Although Post-its are square, the bottom corners tend to peel off the surface a bit when stuck to something. This 3D effect is subtle, but adds a ton to the feel of the note. This is the code to make only the bottom right corner look peeled for most browsers. As usual, sorry IE users  <img src='http://mentormate.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<pre class="wp-code-highlight prettyprint">
-webkit-border-bottom-right-radius: 60px 5px;
-moz-border-bottom-right-radius: 60px 5px;
-o-border-bottom-right-radius: 60px 5px;
</pre>
<p>And there we have it. The final code for the Post-it class looks like this:</p>
<pre class="wp-code-highlight prettyprint">
.postit {
  text-align:center;
  width: 275px;
  margin: 25px;
  min-height:175px;
  max-height:175px;
  padding-top:35px;
  position:relative;
  border:1px solid #E8E8E8;
  border-top:60px solid #fdfd86;
  font-family:'Reenie Beanie';
  font-size:22px;
  -webkit-border-bottom-right-radius: 60px 5px;
  -moz-border-bottom-right-radius: 60px 5px;
  -o-border-bottom-right-radius: 60px 5px;display:inline-block;
  background: rgb(255,255,136); /* Old browsers */
  background: -moz-linear-gradient(-45deg, rgba(255,255,136,1) 77%, rgba(255,255,214,1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right bottom, color-stop(77%,rgba(255,255,136,1)), color-stop(100%,rgba(255,255,214,1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* IE10+ */
  background: linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff88', endColorstr='#ffff88',GradientType=0 ); /* IE6-9 fallback on horizontal gradient */
}
</pre>
<p>I know what you are thinking. Where is the shadow? Well, the shadow is actually a different piece of CSS. We’re doing more than simply adding a box shadow around the note. We could do that, but then it would look like the Post-it is floating rather than stuck on the wall.</p>
<p>Creating a non-box shadow is a bit of a workaround. We are actually going to be making a shape, giving that shape a shadow, and carefully adjusting that shape/shadow so only about 5% of it is visible. Sounds easy, right? I used this website to fine tune my effect (<a href="http://www.wordpressthemeshock.com/css-drop-shadow">http://www.wordpressthemeshock.com/css-drop-shadow</a>). It took me some playing to get it right, but I am happy with the result.</p>
<h3>The Bottom Corner Shadow</h3>
<pre class="wp-code-highlight prettyprint">
content: &quot;&quot;;
width:125px; height: 25px;
-moz-transform:skew(10deg,10deg) translate(-45px,-15px);
-webkit-transform:skew(5deg,5deg) translate(-45px,-15px);
-o-transform:skew(5deg,5deg) translate(-45px,-15px);
transform:skew(10deg,10deg) translate(-45px,-15px)
</pre>
<p>Here is our shape. It&#8217;s a long rectangle that has been skewed to have more acute angles.</p>
<pre class="wp-code-highlight prettyprint">
position:absolute;
right: 0px; bottom:9px;
z-index: -1;
</pre>
<p>This positioning hides the box behind our Post-it and makes sure it stays underneath. I ran into an interesting problem when using this on a template sites like the one you are on now. The negative z-index actually put the shadow behind the background, making it invisible. I am not sure if this will be the case on other CMS sites, or other templates, but to get around this problem you simply need to give your background a z-index of 0.</p>
<pre class="wp-code-highlight prettyprint">
background: rgba(0, 0, 0, 0.2);
 -moz-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -webkit-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -o-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  /* box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40); */
</pre>
<p>Finally, the shadow. It takes a bit of tweaking to make it show up just right. Also you might have noticed that box-shadow is commented out. This is the IE workaround. IE doesn&#8217;t support rotation or skew so the shape that is actually making our shadow doesn&#8217;t cast the correct shadow. Without a box-shadow, it is just hidden under the yellow not not bothering anyone. The shadow website I provided above wants you to put together your inline code in a funny way. After you wrap your content in the .postit class, you need to make another empty div just to hold the box shadow. Like this:</p>
<pre class="wp-code-highlight prettyprint">
&lt;div class=&quot;postit&quot;&gt;
Here is my postit content
&lt;div class=&quot;cornershadow&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>That is a bit clunky and I always want to do less inline work, so I put my own spin on things. Instead of making a separate class for the cornershadow, which would look like this:</p>
<pre class="wp-code-highlight prettyprint">
.cornershadow {
  content: &quot;&quot;;
  position:absolute;
  z-index:-1;
  right: 0px; bottom:9px;
  width:125px;
  height: 25px;
  background: rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -webkit-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -o-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  /* box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40); */
  -moz-transform:skew(10deg,10deg) translate(-45px,-15px);
  -webkit-transform:skew(5deg,5deg) translate(-45px,-15px);
  -o-transform:skew(5deg,5deg) translate(-45px,-15px);
  transform:skew(10deg,10deg) translate(-45px,-15px)
}​
</pre>
<p>…I used the psuedo class :after to simply put the cornershadow code after all postit class divs! So now all you need to do is make a div class=&#8221;postit&#8221; and put whatever you want in it!</p>
<p>The complete code:</p>
<pre class="wp-code-highlight prettyprint">
.postit {
  text-align:center;
  width: 275px;
  margin: 25px;
  min-height:175px;
  max-height:175px;
  padding-top:35px;
  position:relative;
  border:1px solid #E8E8E8;
  border-top:60px solid #fdfd86;
  font-family:'Reenie Beanie';
  font-size:22px;
  -webkit-border-bottom-right-radius: 60px 5px;
  -moz-border-bottom-right-radius: 60px 5px;
  -o-border-bottom-right-radius: 60px 5px;display:inline-block;
  background: rgb(255,255,136); /* Old browsers */
  background: -moz-linear-gradient(-45deg, rgba(255,255,136,1) 77%, rgba(255,255,214,1) 100%); /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right bottom, color-stop(77%,rgba(255,255,136,1)), color-stop(100%,rgba(255,255,214,1))); /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* Opera 11.10+ */
  background: -ms-linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* IE10+ */
  background: linear-gradient(-45deg, rgba(255,255,136,1) 77%,rgba(255,255,214,1) 100%); /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffff88', endColorstr='#ffff88',GradientType=0 ); /* IE6-9 fallback on horizontal gradient */
}

.postit:after {
   content: &quot;&quot;;
  position:absolute;
  z-index:-1;
  right: 0px; bottom:9px;
  width:125px;
  height: 25px;
  background: rgba(0, 0, 0, 0.2);
  -moz-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -webkit-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  -o-box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40);
  /* box-shadow: 40px 27px 5px rgba(0, 0, 0, 0.40); */
  -moz-transform:skew(10deg,10deg) translate(-45px,-15px);
  -webkit-transform:skew(5deg,5deg) translate(-45px,-15px);
  -o-transform:skew(5deg,5deg) translate(-45px,-15px);
  transform:skew(10deg,10deg) translate(-45px,-15px)
}
</pre>
<p>And the inline code:</p>
<pre class="wp-code-highlight prettyprint">
&lt;div class=&quot;postit&quot;&gt;Check out this Post-it &lt;br /&gt; It's 100% CSS!&lt;/div&gt;
</pre>
<div style="text-align:center; width:100%;">
<img src="http://mentormate.com/wp-content/uploads/2012/05/post-it.jpg" alt="" title="post-it" width="301" /><img src="http://mentormate.com/wp-content/uploads/2012/05/post-it-ie.jpg" alt="" title="post-it-ie" width="301" />
</div>
<div style="clear:both;"></div>
<p>If you want to further increase your Post-it fun consider separating the colored gradient and borders into its own class, naming that class .yellow. Then create a class for other Post-it colors like .blue, .pink, .orange, and so on. That way you get to name your div class=&#8221;positit pink&#8221; and get different colors. You can also give your Post-its a rotation (like the one I have at the beginning of this post) by wrapping it in a div and giving that div rotate transformation.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/css-postit-note/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Launches Web App Store for Chrome Browser</title>
		<link>http://mentormate.com/blog/google-launches-web-app-store-chrome-browser/</link>
		<comments>http://mentormate.com/blog/google-launches-web-app-store-chrome-browser/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 05:31:08 +0000</pubDate>
		<dc:creator>The MentorMate Team</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[applications]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=1124</guid>
		<description><![CDATA[Google on Tuesday unveiled its Chrome Web Store, a browser-based app store that initially features about 500 browser applications created by notable partners from Amazon to Sports Illustrated, as well as independent 3rd-party developers. ]]></description>
			<content:encoded><![CDATA[<p>First released as a beta version for Microsoft Windows in September 2008, <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a> is a web browser developed by Google that uses the WebKit layout engine and application framework. For a product that was <a href="http://blogs.wsj.com/digits/2009/07/09/sun-valley-schmidt-didnt-want-to-build-chrome-initially-he-says/" target="_blank">initially opposed</a> by Google CEO Eric Schmidt, Chrome has come a long way in the “alternative” (read: non-IE) web browser space.</p>
<p><a href="http://gs.statcounter.com/#browser-ww-monthly-201011-201011-bar" target="_blank">According to Statcounter</a>, Chrome was the third most used web browser (13%) worldwide as of November 2010, behind Firefox (31%) and ahead of Safari (4.7%). According to Google,</p>
<p>“<a href="https://chrome.google.com/webstore" target="_blank">The store</a> will be featured prominently in Chrome, helping people discover great apps and developers reach millions of users around the world,” says Google&#8217;s blog, noting that in 2010 alone, “the number of people using Chrome has tripled from 40 to 120 million.”</p>
<p>In no time, the TweetDeck has apparently <a href="http://blog.tweetdeck.com/chromedeck-the-numbers-the-web-store-and-a-bi" target="_blank">jumped to the head</a> of the pack:</p>
<blockquote><p>“In the 3 days since the launch of the Chrome Web Store, our Chrome TweetDeck has had 45,851 users and been installed 62,477 times. To give these numbers some context it&#8217;s useful to compare them with the &#8220;big boys&#8221; of the Web Store such as the New York Times (43,542 users &#8211; 56,215 weekly installs) and Gmail (40,783 users &#8211; 37,921 weekly installs).”</p></blockquote>
<p>The current layout is as simple and straightforward as a central repository should be.  In the long run, the launch is a positive nod for the developer community, which now has <a href="http://techcrunch.com/2010/07/05/mobile-developer-economics-2010/" target="_blank">yet another distribution channel</a> for their creations in the form of mobile apps, browser applications, add-ons or themes.</p>
<p>In related (and potentially converging) news, Google has also <a href="http://chrome.blogspot.com/2010/12/chrome-is-ready-for-business.html" target="_blank">made the case</a> that “Chrome is enterprise ready,&#8221; opened the mobile “<a href="http://googleresearch.blogspot.com/2010/12/letting-everyone-do-great-things-with.html" target="_blank">App Inventor for Android</a>” to all Google account holders and announced <a href="http://www.youtube.com/watch?v=lm-Vnx58UYo" target="_blank">Intel-based Chrome OS notebooks from Acer and Samsung</a> to be available in mid-2011, with Verizon Wireless providing integrated 3G cellular connectivity..</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/google-launches-web-app-store-chrome-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming Soon: HTML5 meets the Mobile Web</title>
		<link>http://mentormate.com/blog/html5-meets-the-mobile-web/</link>
		<comments>http://mentormate.com/blog/html5-meets-the-mobile-web/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 16:47:30 +0000</pubDate>
		<dc:creator>The MentorMate Team</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile Website Development]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=1111</guid>
		<description><![CDATA[Like its immediate predecessors, HTML 4.01 and XHTML 1.1, HTML5 is the fifth major revision to the open standard for structuring and presenting content on the World Wide Web.  As an increasing number of consumers turn to mobile devices, we assess the meaning of HTML5 and its impact on the mobile web experience.]]></description>
			<content:encoded><![CDATA[<h3>HTML5 Background</h3>
<p>Jointly developed by <a href="http://www.w3.org/" target="_blank">W3C</a> and <a href="http://www.whatwg.org/" target="_blank">WHATWG</a> since 2004, HTML5 was created in response to the observation that the HTML and XHTML in common use on the World Wide Web has become a mixture of features introduced by various specifications, along with those introduced by software products such as (various) web browsers.   The ultimate objective being the establishment of more uniform practices as well as to define a single markup language that can be written in either HTML or XHTML.</p>
<p>In this sense,  HTML5 adds many new syntax features to improve inclusion and handling of multimedia and graphic content on the web, new elements are designed to improve the semantic richness of documents and new attributes have been introduced to improve and simplify the semantic expression.  The standards also define the required processing for invalid documents, so that syntax errors will be treated uniformly by all conforming browsers and other user agents. Ancillary benefits promise to increase security, expand storage and offline functionality.</p>
<p>In the end, it’s about a smoother, richer, more useful web.</p>
<h3>A mobile Era</h3>
<p style="text-align: left;">While proprietary programs like Flash and Silverlight have dominated the past decade of modern desktop oriented website programming, the complexity and resources associated with such programs makes them unattractive on the mobile web. As a result, developers began responding to user demands through a logical workaround: the mobile application.  In this instance, all content, functionality and experience is contained within an app on top of a smartphones or tablet operating system.</p>
<p>The popularity and ubiquity of mobile apps has steadily increased over the years, Apple’s iPhone launch in 2007 radically altered the expectations that the public had for the mobile web by choosing to use WebKit, the same system that underpinned its desktop Safari browser. In 2008, Google followed suite by using the same open source browser engine to power Chrome, and handset makers like Nokia, Palm, Samsung and RIM have since incorporated WebKit browsers into their devices. As WebKit secures its place of dominance in mobile web browsing, the appeal of HTML5 becomes all the more attractive, considering current support for the standard ranges between 77% &#8211; 96% amongst top browsers:</p>
<p><img class="aligncenter size-medium wp-image-1112" title="HTML5 browser support" src="http://mentormate.com/wp-content/uploads/2010/12/HTML5-browser-support-269x300.png" alt="HTML5 browser support" width="269" height="300" /></p>
<h3>The Convergence</h3>
<p>Since many of the nuances have yet to be agreed upon by the collaborating development groups, it’s clear that HTML5 will need time to mature and find its stride.  But as the trend for HTML5 browser support shows that compatibility will strive for perfection in the near term (Microsoft’s IE notwithstanding), web developers can begin programming with the confidence that HTML5 will come through for the mobile masses.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/html5-meets-the-mobile-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Black Box Testing Tips for Quality Assurance</title>
		<link>http://mentormate.com/blog/black-box-testing-tips-quality-assurance/</link>
		<comments>http://mentormate.com/blog/black-box-testing-tips-quality-assurance/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 14:54:44 +0000</pubDate>
		<dc:creator>Jeni</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[quality assurance]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=957</guid>
		<description><![CDATA[There are a lot of ways to go about black box testing, but the main purpose of this post is to assist new and junior testers. Here you can read about the main strategies for testing, some terminology used and methods that will help you in the beginning of your career as a tester.]]></description>
			<content:encoded><![CDATA[<h1>Define operating and testing environments</h1>
<p>It is very important to define which operating systems and on which browsers the application should be tested. Once you define the browsers on which the system should work, make sure you check all functionality on all browsers. If there is not enough time/budget, you can check the design and the main functionalities of the site with all browsers. Most of the cosmetic problems generally appear in Internet Explorer 6.0. We like to use IETester (<a href="http://www.my-debugbar.com/wiki/IETester/HomePage">http://www.my-debugbar.com/wiki/IETester/HomePage</a>), the application supports all Internet Explorer versions.</p>
<p>For comparing the design of a site on different browsers, there is one tool named Adobe BrowserLab that works great. With it you can compare a web page in one browser next to a page in another browser or overlay the pages entirely. The tool supports the following browsers:</p>
<ul>
<li>Chrome 3.0 – Windows</li>
<li>Firefox 2.0 – OS X</li>
<li>Firefox 2.0 – windows</li>
<li>Firefox 3.0 – OS X</li>
<li>Firefox 3.0 – Windows</li>
<li>Firefox 3.6 – OS X</li>
<li>Firefox 3.6 – Windows</li>
<li>Internet Explorer 6.0</li>
<li>Internet Explorer 7.0</li>
<li>Internet Explorer 8.0</li>
<li>Safari 3.0 – OS. X</li>
<li>Safari 4.0 – OS X</li>
</ul>
<h1>Make sure that your bug reports are easy to understand</h1>
<p>The best testers have the most bug reports resolved. A good bug report is one that assists in resolving an issue. Ensure that your bug reports can easily be reproduced by making them as clear and concise as possible. Here are several steps that you can follow:</p>
<h4>1. Reproducibility – inform the developers how often the bug appears</h4>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="189" valign="top"><strong>Reproducibility</strong></td>
<td width="374" valign="top"><strong>Definition</strong></td>
</tr>
<tr>
<td width="189" valign="top">Always</td>
<td width="374" valign="top">The defect appears at all   times.</td>
</tr>
<tr>
<td width="189" valign="top">Sometimes</td>
<td width="374" valign="top">The defect does not appear   every time.</td>
</tr>
<tr>
<td width="189" valign="top">Random</td>
<td width="374" valign="top">The defect occurs   sporadically.</td>
</tr>
<tr>
<td width="189" valign="top">Not reproducible</td>
<td width="374" valign="top">The defect cannot be   reproduced again.</td>
</tr>
</tbody>
</table>
<h4 style="margin-top: 20px;">2. Severity – inform the developers of the scale of the bug.</h4>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="189" valign="top"><strong>Severity</strong></td>
<td width="374" valign="top"><strong>Description<br />
</strong></td>
</tr>
<tr>
<td width="189" valign="top">Block</td>
<td width="374" valign="top">When a bug stops the user   from working with some aspect of the system. These bugs have the highest priority.</td>
</tr>
<tr>
<td width="189" valign="top">Crash</td>
<td width="374" valign="top">When an error page appears.   Sometimes this happens when the developers forget instances of the system.</td>
</tr>
<tr>
<td width="189" valign="top">Major</td>
<td width="374" valign="top">When a bug has a major   impact on the functionality of a large aspect of the software.</td>
</tr>
<tr>
<td width="189" valign="top">Minor</td>
<td width="374" valign="top">When a bug causes major   harm to some piece of functionality, but   does not impact many aspects of the software.</td>
</tr>
<tr>
<td width="189" valign="top">Tweak</td>
<td width="374" valign="top">There is no problem with   the feature, but the way it is working should be slightly changed (tweaked).</td>
</tr>
<tr>
<td width="189" valign="top">Text</td>
<td width="374" valign="top">A problem with the text and/or   labels of the software. Usually typing mistakes or labels that don’t match   the specifications.</td>
</tr>
<tr>
<td width="189" valign="top">Feature</td>
<td width="374" valign="top">This is a new feature that   should be implemented, in most cases it is not a bug. The tester can be asked   to add such a report in order to inform the developers about a new feature   that should be added to the software.</td>
</tr>
</tbody>
</table>
<h4 style="margin-top: 20px;">3. Summary – summarize the bug with one sentence – as a title for your report. Be descriptive and concise.</h4>
<h4>4. Bug Description – this is the most important section.</h4>
<p>Be sure to include:</p>
<ul>
<li>Location of bug in the software</li>
<li>URL (if you are testing web pages)</li>
<li>Testing browsers or environment</li>
<li>Information about the bug – here you need to explain the input data you used and the sequence of steps you made to cause the bug. This point is quite important make sure that your instructions are clear and reproducible. Make sure that you use the same terminology as the developers.</li>
<li>Screen shots with comments and explanations. Firefox has one wonderful Add-on “FireShot”, this Add-on can be found also for Internet Explorer.</li>
</ul>
<p>These days, more and more people in the IT business work with clients or have coworkers that are not from their own country and who communicate in another language. No matter how well you learn to understand a language, there still can be misunderstandings that can lead to problems of all types. It helps to have a pre-planned method and agreed terminology to report bugs.</p>
<h1>There must be bugs</h1>
<p>Start to test with the idea that there should be bugs. There is not a system that does not have a few errors. This mindset will help you to be more focused on finding problems.</p>
<h1>Test situations that should not be executed</h1>
<p>Sometimes, due to a variety of reasons, users do not enter something as they are intended to, press buttons out of order, or otherwise misuse the software. It is important to try to account for these situations.<br />
If you have a registration form to test, try doing things OTHER than fill out the form. It was built to accept data, so try not entering anything and pressing the button for registration, enter invalid data such as email that does not have the “@” symbol or very long zip code or name. Use boundary cases (inputs at or just beyond maximum and minimum limits) to attempt to receive errors. There are symbols that can break the database or break the request from the database if they are entered and saved in the system. Such examples are the percentage (%) symbol, inverted commas(“”), and two minuses (&#8211;) together.<br />
If you have a combination of actions that need to be done one after another, change their sequence. Make sure that you have checked all situations that you can think of, according to the system you test.</p>
<h1>Test real situations</h1>
<p>The above tips should not turn the QA process into a highly critical and aggressive testing period. Do not test and report bugs for unrealistic situations. Make sure you have understood the specification for the application and do not tease the developers with unrealistic bugs.</p>
<h1>Test like you are a regular user, a computer illiterate user.</h1>
<p>Think about the users, question yourself. Is this system user friendly? Can you easily navigate the program? Is the text within the system clear and understandable? Are the error messages helpful? There are a lot of examples in your own personal life. Think about when you sit at home on your personal computer &#8211; which sites or programs do you prefer? Why? Which you do not like? Why? Usability is always the answer.</p>
<h1>Keep written reports</h1>
<p>Sometimes bugs are  shared verbally with the developers. This can work against you.  Make sure that you keep written documentation of all your discussions about issues or anything concerning a project.  The best practice is to have reports on every issue you find.  Sometimes when communicating bugs verbally, many testers complain that the developers take the credit for their work or that managers who calculate the productivity of a tester by the number of bugs he/she reports do not give full credit.</p>
<h1>Work to become a Team</h1>
<p>Communication with your team members is just as important as knowing good techniques for testing and is key for the successful achievement of a quality product. You need to be flexible. During your work you will meet junior developers that have never worked with testers or people who will disagree with your findings. Some developers just need to get used the fact that they have bugs in their programs. This is normal. You need to persuade them that a tester for a developer is not like a critic for an author. Help them understand that you are a team and you both want the same thing. Prove your statement with facts and knowledge of the system and specifications.</p>
<h1>Gain new knowledge</h1>
<p>Black box testing uses external descriptions of the software with no knowledge about the internal structure. If you want to become competitive and help further your career, you should take a peak at the source code and ask questions of the developers. For cosmetic issues, you can read and learn about HTML and CSS and report specific CSS styles/areas of a web page that need fixing. Some tools that can help are the Web Developer Toolbar and the Firefox Add-on, Firebug. Some knowledge about Databases also will be helpful, this way you can more clearly understand the processes in the system and the reasons why some bugs appear. With more knowledge of how the software works, you will speed up the developer&#8217;s work and make yourself more efficient in the process.</p>
<p>Approving a high quality product is a hard and complicated process. Learn from your mistakes and from the bugs you found. Keep good communication with your coworkers, defend your position in a positive manner, keep learning, and continue testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/black-box-testing-tips-quality-assurance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JFreeChart Bar Chart Tutorial for Dynamic Java Web Applications</title>
		<link>http://mentormate.com/blog/jfreechart-bar-chart-tutorial-dynamic-java-web-applications/</link>
		<comments>http://mentormate.com/blog/jfreechart-bar-chart-tutorial-dynamic-java-web-applications/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 15:24:01 +0000</pubDate>
		<dc:creator>Eleonora</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jfreechart]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=717</guid>
		<description><![CDATA[There are a lot of tutorials and posts explaining how to display a chart in a web application and which libraries to use. I am going to show the process from receiving the http request from the client to sending the response back from the server. I will share my real experience with JFreeChart and the servlet technology for creating and displaying dynamic charts in Java based web application.]]></description>
			<content:encoded><![CDATA[<p>JFreeChart is an open-source Java based library which allows the creation of complex charts in a simple way.</p>
<p>Supported chart types include:</p>
<ul>
<li>X-Y charts (line, spline and scatter);</li>
<li>Pie charts;</li>
<li>Gantt charts;</li>
<li>Bar charts (horizontal and vertical, stacked and independent);</li>
<li>Single valued (thermometer, compass, speedometer).</li>
</ul>
<p>I am going to explain how to use the chart library and how to create a bar chart with a custom color. To create a chart with JFreeChart library, first you have to make a <strong>Dataset </strong>object<em>. </em>The chart is generated from this data collection. Next you have to instate the class <strong>DefaultCategoryDataset</strong>, which is passed to the chart object. In the code below as a data source is used ArrayList, which may come from data base.</p>
<pre class="wp-code-highlight prettyprint">
// load the data
double[] data = new double[jobTitles.size()];
for (int i = 0; i &amp;lt; jobTitles.size(); i++) {
     data[i] = jobTitles.get(i).getCount();
}
// create the data set
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
for (int i = 0; i &amp;lt; data.length; i++) {
     dataset.setValue(data[i], &amp;quot;Profit1&amp;quot;, jobTitles.get(i).getTitle());
}
</pre>
<p>The next step is to do an object from chart type. The library uses a class named <strong>JFreeChart </strong>to display the chart. This chart object is an instance, which comes from the method <strong>createBarChart </strong>of<strong> </strong>the static class <strong>ChartFactory</strong>. The method takes as a parameter the formed collection (dataset). There are many properties, which you can pass to the constructor, such as labels, orientation, etc. It is possible to change colors, size, scale and many other characteristics.<strong> </strong></p>
<p>You have ready object now and the next step is to send the chart to the web page. For this purpose, the library includes a class named <strong>ChartUtilities</strong> that provides several methods for saving charts to files or writing them out to streams in JPEG or PNG format. The methods from this class can be used for creating JPEG images for static web pages. The goal, however, is not to save the chart in a hard drive; the goal is to pass the graphic to the application. To do that, you can use the servlet technology and display the dynamic data stream in the jsp pages.</p>
<p>Consequently the next step is to generate <strong>BufferedImage</strong> from your chart object and to transfer this stream through the session. You should also write the image in the http response writer.</p>
<pre class="wp-code-highlight prettyprint">
// create the chart
final JFreeChart chart = ChartFactory.createBarChart(&amp;quot;Allocation of Duties&amp;quot;,
                 &amp;quot;Values&amp;quot;, dataset, PlotOrientation.VERTICAL, true, true, true);
// set custom color
GradientPaint gradientpaint0 = new GradientPaint(0.0F, 0.0F,
                 new Color(209, 228, 246), 0.0F, 0.0F, new Color(82, 141, 201));
BarRenderer r = (BarRenderer)chart.getCategoryPlot().getRenderer();
r.setSeriesPaint(0, gradientpaint0);
ChartRenderingInfo info = null;
HttpSession session = request.getSession();
try {
     // create RenderingInfo object
     response.setContentType(&amp;quot;text.html&amp;quot;);
     info = new ChartRenderingInfo(new StandardEntityCollection());
     BufferedImage chartImage = chart.createBufferedImage(640, 400, info);
     session.setAttribute(&amp;quot;chartImage&amp;quot;, chartImage);
     PrintWriter writer = new PrintWriter(response.getWriter());
     ChartUtilities.writeImageMap(writer, &amp;quot;imageMap&amp;quot;, info, false);
     writer.flush();
} catch (Exception e) {
     e.printStackTrace();
}
</pre>
<p>Finally you should write the servlet. This is a Java object, which dynamically answers requests and built response to the client. Each servlet has two main methods &#8211; doGet(HttpServletRequest request, HttpServletResponse response) and doPost(HttpServletRequest request, HttpServletResponse response). You need to get the chart stream from the session in the servlet. The image is set to an attribute named <strong>chartImage </strong>in the session. You have to get http session instance from the request and then to retrieve the previously set attribute.</p>
<pre class="wp-code-highlight prettyprint"></pre>
<p>// Process the HTTP Get request<br />
public void mdoGet(HttpServletRequest request, HttpServletResponse response)<br />
                                       throws ServletException, IOException {<br />
    // get the chart from session<br />
    HttpSession session = request.getSession();<br />
    BufferedImage chartImage = (BufferedImage)session.getAttribute(&#8220;chartImage&#8221;);<br />
   // set the content type so the browser can see this as a picture<br />
    response.setContentType(&#8220;image.png&#8221;);<br />
    // send the picture<br />
    PngEncoder encoder = new PngEncoder(chartImage, false, 0, 9);<br />
    response.getOutputStream().write(encoder.pngEncode());<br />
}<br />
// Process the HTTP Post request<br />
public void doPost(HttpServletRequest request, HttpServletResponse response)<br />
                                       throws ServletException, IOException {<br />
    doGet(re</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/jfreechart-bar-chart-tutorial-dynamic-java-web-applications/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Facebook Application Development Tips for the Facebook API</title>
		<link>http://mentormate.com/blog/facebook-application-development-tips-facebook-api/</link>
		<comments>http://mentormate.com/blog/facebook-application-development-tips-facebook-api/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 20:42:40 +0000</pubDate>
		<dc:creator>Iva</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=505</guid>
		<description><![CDATA[Thinking of developing a Facebook FBML Application? It is certainly a very exciting and inspiring task. Let me make it as fun for you as possible by pointing out a few obstacles you may come across and ways to bypass them. I personally stumbled upon each of the problems listed below in my first steps in Facebook development. Hopefully, this will help those of you who are taking your first steps into Facebook development avoid some headaches along the way. Let’s get started!]]></description>
			<content:encoded><![CDATA[<p><strong>Facebook Application Response Timeout</strong></p>
<p>Have you ever gotten the message <em>The URL [your application url here] did not respond.</em> even when everything seems to be working on your side?<br />
One probable reason is that Facebook has a certain response timeout – approximately 12 seconds. If your page fails to respond in this time, Facebook will leave it and display an error message. I used a few simple tricks and managed to work around this issue. Try them out:</p>
<p><em>Make the Facebook application lighter:</em></p>
<ul>
<li>The basic idea is to make the page as light as possible on the first load. One way to achieve this is to leave the time consuming tasks like database interaction for later, updating the page with AJAX. <a href="http://wiki.developers.facebook.com/index.php/FBJS#AJAX">(more info)</a></li>
</ul>
<p><em>Speed up your Facebook app:</em></p>
<ul>
<li>You can  use &#8220;Preload FQL&#8221;, that is to send your FQL requests along with the first call, thus making one less roundtrip to the server. <a href="http://wiki.developers.facebook.com/index.php/Preload_FQL">(more info)</a></li>
<li>Facebook provides a Batch API. With this API, you can combine multiple API calls and send them together as one call. <a href="http://wiki.developers.facebook.com/index.php/Using_Batching_API"> (more info)</a></li>
<li>You can do the same thing with multiple queries. Wrap, send, and receive them as one using Fql.multiquery. <a href="http://wiki.developers.facebook.com/index.php/Fql.multiquery">(more info)</a></li>
</ul>
<p>AJAX calls have the same timeout issue (although the timeout here is approximately 13 seconds). Additionally all AJAX calls pass through the Facebook server which slows them down. The result is the following JavaScript error: <em>&#8220;error&#8221;:1349011,&#8221;errorSummary&#8221;:&#8221;Failed to fetch app Ajax&#8221;</em> .</p>
<p>I found a simple solution to avoid it: Use FBJS AJAX and a <a href="http://www.w3schools.com/js/js_timing.asp">timer</a> to abort the request when it reaches the time limit and send a new one.</p>
<p><strong>Facebook API Response Time and Error Count</strong></p>
<p>The Facebook API itself sometimes has latency issues causing your app pages to be fetched slower, increasing the risk of reaching the response timeout. Errors in request to their servers are also known to happen. You should always be informed about the <a href="http://developers.facebook.com/live_status.php">Facebook Platform Status</a>.</p>
<p><strong>Syntax Limitations in FQL</strong></p>
<p>The Facebook API allows you to make your own queries using a query language similar to SQL. There is a list of tables you can access (you can only view information; you are not allowed to update the information in any of these tables). You can easily make your own queries, but you should keep in mind that you cannot do a number of normal (for SQL) things such as join tables, use  &#8216;distinct&#8217;, &#8216;limit&#8217;, &#8216;group by&#8217;, etc., or use &#8220;from&#8221; against more than one table. You can easily do these operations in the code, however. Combined with the use of the <a href="http://wiki.developers.facebook.com/index.php/Fql.multiquery#Example_Requests">multiquery</a> functionality, things should work almost as fast as if you were using pure SQL.</p>
<p><strong>Facebook API Changes</strong></p>
<p>As you may guess, the Facebook API still is in development, so you should keep yourself up to date with the constant changes in its platform. Some of these changes are potentially breaking, some features are being deprecated or changed, and some cool new things are being added. It is useful to read the <a href="http://wiki.developers.facebook.com/index.php/Developer_Roadmap">Facebook Developer Roadmap</a> to be informed for the specific changes that have been planned and when to expect them. Here are some of the upcoming ones:</p>
<ul>
<li><em>an open source, faster, slimmer, and more efficient JavaScript Library will be developed</em> &#8211; I am personally looking forward to this. It will be of great help, as right now the FBJS is very limited.</li>
<li>p<em>rofile boxes, application info sections, and the Boxes tab will be removed</em> – If you want to integrate into the user&#8217;s profile, you will be able to do that only with Application tabs.</li>
<li>form<em>atting on canvas pages will be changed to better highlight an application&#8217;s brand</em> – For now, I myself am using fb:dashboard. It not only gives you clean app navigation, but also a great look by positioning the name and icon of your app nicely on every page.</li>
</ul>
<p>Until recently, some of the API changes, even when prepared for them, had unexpected effects on some applications (in some cases, bugs appeared) and there was nothing we could do about it.<br />
In late February, Facebook introduced a tool to help us prepare for the changes – the Migrations tool. When Facebook announces a new feature or fix, you can first do some testing before going to the Migrations tab in your application settings and choosing to enable it (it is disabled by default).</p>
<p>In conclusion, I can assure you that whatever problems you may stumble upon there is a huge community of developers willing to help you out. Just go to the <a href="http://forum.developers.facebook.com/">Facebook Developers Forum</a>. There is also lots of documentation and useful tips in the <a href="http://wiki.developers.facebook.com/">Facebook Developers Wiki</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/facebook-application-development-tips-facebook-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Optimized paging query implementation for Microsoft SQL Server 2005</title>
		<link>http://mentormate.com/blog/optimized-paging-queries-microsoft-sql-server-2005/</link>
		<comments>http://mentormate.com/blog/optimized-paging-queries-microsoft-sql-server-2005/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 15:03:38 +0000</pubDate>
		<dc:creator>Dimitar Dobrev</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[microsoft sql server 2005]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=45</guid>
		<description><![CDATA[Paging queries or paging records is an often-used approach in web applications. It displays subsets of data records as a page, allowing the user to navigate more easily through all pages. The straightforward implementation of a paging query running over large data sets in a stored procedure in MS SQL 2005 can cause increased server load when large numbers of paging queries are executed simultaneously.]]></description>
			<content:encoded><![CDATA[<p>We did performance tests on several methods of paging implementation and found the fastest one:</p>
<pre class="wp-code-highlight prettyprint">DECLARE @PageNumber INT
DECLARE @PageSize INT
SET @PageNumber = 2
SET @PageSize = 10
SELECT TOP (@PageSize) * FROM
(
SELECT
ROW_NUMBER() OVER (ORDER BY FieldA) As RowID,
FieldB,FieldC,
TotalRows=COUNT(*) OVER()
FROM TheTable
) TmpTable
WHERE TmpTable.RowID &amp;gt; ((@PageNumber-1)*@PageSize)</pre>
<p>One significant advantage of this implementation approach is that there is no need for a second query that returns the total count of the paged data. The total record count is returned as a column in the result set. This minimizes the number of queries that are needed to return a paged result set. If not needed, the “TotalRows” column can be removed from the query.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/optimized-paging-queries-microsoft-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>&#8220;java.lang.OutOfMemoryError: Java heap space&#8221; Unexpected Tomcat Crash &#8211; Solved</title>
		<link>http://mentormate.com/blog/javalangoutofmemoryerror-java-heap-space-unexpected-tomcat-crash-solved/</link>
		<comments>http://mentormate.com/blog/javalangoutofmemoryerror-java-heap-space-unexpected-tomcat-crash-solved/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 17:07:14 +0000</pubDate>
		<dc:creator>Dimitar Dobrev</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=35</guid>
		<description><![CDATA[Recently, we've been dealing with an issue related to our Tomcat Application Server and wanted to share how we solved this one. We found one that the application server was irrelevant (it could be Glassfish or another as well). The server was running the latest version, Tomcat Application Server 6.0.18, and it was crashing in irregular intervals. There was no easy solution because the server stopped making logs before crashing.]]></description>
			<content:encoded><![CDATA[<p>We started the usual things like upgrading the core components and making more logs that the Tomcat can output. After all these we got rows in the localhost log saying &#8220;java.lang.OutOfMemoryError: Java heap space&#8221; but with no other information like rows of code, etc. We continued to optimize the memory usage by flushing the input and output streams in the code and others. After that we received this log:</p>
<p><code>
<pre class="wp-code-highlight prettyprint">SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.OutOfMemoryError: Java heap space
at java.lang.StringCoding$StringDecoder.decode(StringCoding.java:133)
at java.lang.StringCoding.decode(StringCoding.java:173)
at java.lang.String.(String.java:444)
at org.postgresql.core.Encoding.decode(Encoding.java:193)
at org.postgresql.core.Encoding.decode(Encoding.java:205)
at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:1892)
at org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:175)</pre>
<p></code></p>
<p>This was the first time when we had a log where there was a specific row number indicating the error. After looking at the code, we found that the row was in logic, where we assign a field from the database to a string variable. It was nothing unusual, so we decided to check the field in the database table. It was a &#8220;text&#8221; field in a PostgreSQL database that we access using JDBC driver. After a SELECT length(‘field&#8217;) command, we estimated that the biggest field data is about 1 MB! So, if we wanted to take the whole table that would be about 400 MB data fetched in a single click that invoked this method. After that we were able to finally reproduce the server crash, clicking several times on the button that invoked the method fetching this abnormally large amount of data. We had to revise the code so that we take only one field when needed. This solved the crashing issue.</p>
<p>The lesson is that we need to make sure we are not requesting too much data using the SQL statements. Even if we are getting a small amount of columns like in this case, we need to have in mind that one of them could contain a lot of information and make the system crash – especially with lots of concurrent users.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/javalangoutofmemoryerror-java-heap-space-unexpected-tomcat-crash-solved/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NetBeans Visual JSF editor tutorial on web applications running over HTTPS displaying warning in IE &#8220;This page contains both secure and nonsecure items&#8221;.</title>
		<link>http://mentormate.com/blog/netbeans-visual-jsf-editor-tutorial-web-applications-running-https-displaying-warning-page-secure-nonsecure-items-2/</link>
		<comments>http://mentormate.com/blog/netbeans-visual-jsf-editor-tutorial-web-applications-running-https-displaying-warning-page-secure-nonsecure-items-2/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 19:36:53 +0000</pubDate>
		<dc:creator>Dimitar Dobrev</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[visual jsf editor]]></category>

		<guid isPermaLink="false">http://mentormate.com/blog/?p=25</guid>
		<description><![CDATA[Developers who have used NetBeans 6.1 and 6.5 for web development with Visual JSF (Woodstock) might have encountered an issue with their web application when deployed on a secured server (HTTPS) and opened with Internet Explorer. The issue lies in the way IE treats links to JavaScript and CSS files loaded in the pages. Under HTTPS, the links to JavaScript have to be absolute, not relative. IE does not assume that the "relative" folder is secured.]]></description>
			<content:encoded><![CDATA[<p>If you &#8220;view source&#8221; on the page that Woodstock generates, you will see the following line:</p>
<p><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;"> </span></p>
<pre class="wp-code-highlight prettyprint">&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/app/theme/com/sun/webui/jsf/suntheme4_2-080320/javascript/bootstrap.js&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;span style=&amp;quot;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;&amp;quot;&amp;gt;</pre>
<p>Now if you change that line to:<br />
<code><br />
</code><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;"> </span></p>
<pre class="wp-code-highlight prettyprint">&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;https://www.yourserver.com:8443/ app/theme/com/sun/webui/jsf/suntheme4_2-080320/javascript/bootstrap.js&amp;quot;&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;span style=&amp;quot;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;&amp;quot;&amp;gt;</pre>
<p>The site will now work under HTTPS without any security warnings. Obviously, this cannot be done straightforward because this piece of HTML code is generated by the Woodstock library. The solution we have implemented to resolve this problem is to change the code in the Woodstock library that generates the HTML header of the pages. The following solution is not the most elegant solution; it’s more of a simple workaround to solve this problem in production environment:</p>
<ol>
<li>Open the Woodstock project web site, https://woodstock.dev.java.net/index.html, and go to &#8220;Build it Yourself.&#8221;</li>
<li>Follow the instructions on the &#8220;Build it Yourself&#8221; page to register and get a CVS access to download the framework source code. The CVS URL will be something like: :pserver:username@cvs.dev.java.net:/cvs. You don’t need NetBeans 5.5, as it is written in the compile instructions.</li>
<li>Open the CVS repository with NetBeans and check out the module &#8220;woodstock/webui&#8221; and branch &#8220;Release42&#8243; as a new project.<img class="alignnone" src="http://mentormate.com/blog/images/netbeans-visual-jsf-tutorial-screenshot-1.jpg" alt="" width="628" height="445" /></li>
<li>Open the project and edit the &#8220;JavaScriptUtilities.java&#8221; file in package com.sun.webui.jsf.util in &#8220;src/runtime&#8221; folder.</li>
<li>In method &#8220;renderJavaScriptInclude&#8221;   change line 578 from:<code><br />
</code><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;">
<pre class="wp-code-highlight prettyprint">&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;String jsFile = getTheme().getPathToJSFile(file);&amp;lt;/code&amp;gt;&amp;lt;span style=&amp;quot;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;&amp;quot;&amp;gt;</pre>
<p>To:<code><br />
</code><span style="font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;"> </span></p>
<pre class="wp-code-highlight prettyprint">&amp;lt;/span&amp;gt;&amp;lt;code&amp;gt;String jsFile = &amp;quot;https://www.yourserver.com:8443&amp;quot; + getTheme().getPathToJSFile(file);&amp;lt;/code&amp;gt;&amp;lt;span style=&amp;quot;font-family: Georgia,'Times New Roman','Bitstream Charter',Times,serif; font-size: 13px; line-height: 19px;&amp;quot;&amp;gt;</pre>
<p></span></li>
<li>Save the file and rebuild the project. During compile, you might notice a lot of warnings, etc – just ignore them.</li>
<li>Copy and overwrite the newly compiled webui-jsf.jar and webui-jsf-dt.jar from the Woodstock source code folder &#8220;woodstockwebuidist&#8221; to the NetBeans subfolder. &#8220;visualweb2modulesext&#8221;. Keep a copy of the original jar files (see below).</li>
<li>Rebuild your WAR file and deploy it on the HTTPS server.</li>
</ol>
<p>There you go. You should now have your website working under IE with no security warnings. Note that the newly compiled .jar files will work only on the server URL you define in Step 5. They won’t work in localhost development environment, so you might want to change with original .jar files during development phase. Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://mentormate.com/blog/netbeans-visual-jsf-editor-tutorial-web-applications-running-https-displaying-warning-page-secure-nonsecure-items-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

