<?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>Organize and share your code snippets</title>
	<atom:link href="http://www.snippetsmania.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snippetsmania.com</link>
	<description>php, javascript, java, c, c++, ruby, jquery, actionscript and more code snippets</description>
	<lastBuildDate>Fri, 24 May 2013 02:05:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>insult generator</title>
		<link>http://www.snippetsmania.com/insult-generator/</link>
		<comments>http://www.snippetsmania.com/insult-generator/#comments</comments>
		<pubDate>Fri, 24 May 2013 02:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[curses]]></category>
		<category><![CDATA[Elizabethan]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[insult]]></category>
		<category><![CDATA[Shakespearean]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20531</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">var insult = {
// Insults nicked from [ &lt;a href="http://www.museangel.net/insult.html" &gt;http://www.museangel.net/insult.html&lt;/a&gt; ]
a: [&quot;artless&quot;,&quot;bawdy&quot;,&quot;beslubbering&quot;,&quot;bootless&quot;,&quot;churlish&quot;,&quot;cockered&quot;,&quot;clouted&quot;,&quot;craven&quot;,&quot;currish&quot;,&quot;dankish&quot;,&quot;dissembling&quot;,&quot;droning&quot;,&quot;errant&quot;,&quot;fawning&quot;,&quot;fobbing&quot;,&quot;froward&quot;,&quot;frothy&quot;,&quot;gleeking&quot;,&quot;goatish&quot;,&quot;gorbellied&quot;,&quot;impertinent&quot;,&quot;infectious&quot;,&quot;jarring&quot;,&quot;loggerheaded&quot;,&quot;lumpish&quot;,&quot;mammering&quot;,&quot;mangled&quot;,&quot;mewling&quot;,&quot;paunchy&quot;,&quot;pribbling&quot;,&quot;puking&quot;,&quot;puny&quot;,&quot;quailing&quot;,&quot;rank&quot;,&quot;reeky&quot;,&quot;roguish&quot;,&quot;ruttish&quot;,&quot;saucy&quot;,&quot;spleeny&quot;,&quot;spongy&quot;,&quot;surly&quot;,&quot;tottering&quot;,&quot;unmuzzled&quot;,&quot;vain&quot;,&quot;venomed&quot;,&quot;villainous&quot;,&quot;warped&quot;,&quot;wayward&quot;,&quot;weedy&quot;,&quot;yeasty&quot;],
b: [&quot;base-court&quot;,&quot;bat-fowling&quot;,&quot;beef-witted&quot;,&quot;beetle-headed&quot;,&quot;boil-brained&quot;,&quot;clapper-clawed&quot;,&quot;clay-brained&quot;,&quot;common-kissing&quot;,&quot;crook-pated&quot;,&quot;dismal-dreaming&quot;,&quot;dizzy-eyed&quot;,&quot;dog-hearted&quot;,&quot;dread-bolted&quot;,&quot;earth-vexing&quot;,&quot;elf-skinned&quot;,&quot;fat-kidneyed&quot;,&quot;fen-sucked&quot;,&quot;flap-mouthed&quot;,&quot;fly-bitten&quot;,&quot;folly-fallen&quot;,&quot;fool-born&quot;,&quot;full-gorged&quot;,&quot;guts-griping&quot;,&quot;half-faced&quot;,&quot;hasty-witted&quot;,&quot;hedge-born&quot;,&quot;hell-hated&quot;,&quot;idle-headed&quot;,&quot;ill-breeding&quot;,&quot;ill-nurtured&quot;,&quot;knotty-pated&quot;,&quot;milk-livered&quot;,&quot;motley-minded&quot;,&quot;onion-eyed&quot;,&quot;plume-plucked&quot;,&quot;pottle-deep&quot;,&quot;pox-marked&quot;,&quot;reeling-ripe&quot;,&quot;rough-hewn&quot;,&quot;rude-growing&quot;,&quot;rump-fed&quot;,&quot;shard-borne&quot;,&quot;sheep-biting&quot;,&quot;spur-galled&quot;,&quot;swag-bellied&quot;,&quot;tardy-gaited&quot;,&quot;tickle-brained&quot;,&quot;toad-spotted&quot;,&quot;unchin-snouted&quot;,&quot;weather-bitten&quot;],
c: [&quot;apple-john&quot;,&quot;baggage&quot;,&quot;barnacle&quot;,&quot;bladder&quot;,&quot;boar-pig&quot;,&quot;bugbear&quot;,&quot;bum-bailey&quot;,&quot;canker-blossom&quot;,&quot;clack-dish&quot;,&quot;clot-pole&quot;,&quot;coxcomb&quot;,&quot;codpiece&quot;,&quot;death-token&quot;,&quot;dewberry&quot;,&quot;flap-dragon&quot;,&quot;flax-wench&quot;,&quot;flirt-gill&quot;,&quot;foot-licker&quot;,&quot;fustilarian&quot;,&quot;giglet&quot;,&quot;gudgeon&quot;,&quot;haggard&quot;,&quot;harpy&quot;,&quot;hedge-pig&quot;,&quot;horn-beast&quot;,&quot;huggermugger&quot;,&quot;jolt-head&quot;,&quot;lewdster&quot;,&quot;lout&quot;,&quot;maggot-pie&quot;,&quot;malt-worm&quot;,&quot;mammet&quot;,&quot;measle&quot;,&quot;minnow&quot;,&quot;miscreant&quot;,&quot;mold-warp&quot;,&quot;mumble-news&quot;,&quot;nut-hook&quot;,&quot;pigeon-egg&quot;,&quot;pignut&quot;,&quot;puttock&quot;,&quot;pumpion&quot;,&quot;rats-bane&quot;,&quot;scut&quot;,&quot;skains-mate&quot;,&quot;strumpet&quot;,&quot;varlot&quot;,&quot;vassal&quot;,&quot;whey-face&quot;,&quot;wagtail&quot;],
rI: function(a){ return a[Math.floor(Math.random()*a.length)]; },
generate: function(){ var s = &quot;&quot;;
for(n=0; n&lt;Math.floor(Math.random()*3)+1; n++)
s += &quot;, &quot; + insult.rI(insult.a) + &quot;, &quot; + insult.rI(insult.b);
s += &quot; &quot; + insult.rI(insult.c);
return &quot;Thou &quot; + s.substring(2) + &quot;!&quot;;
}
}</pre>
<p><a href="/out.php?id=17118" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/insult-generator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Twitter for sending server downtime alert</title>
		<link>http://www.snippetsmania.com/using-twitter-for-sending-server-downtime-alert/</link>
		<comments>http://www.snippetsmania.com/using-twitter-for-sending-server-downtime-alert/#comments</comments>
		<pubDate>Thu, 23 May 2013 23:01:01 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20529</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">&lt;?php

// Specify the target URL in your server
$targetUrl  = 'http://YOUR_SERVER_URL';

// Specify what the response is from the server
$targetText = 'Hello from Daredevil';

// We will be using cURL for fetching the content
$ch = curl_init();

// Set the params
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Get the response
$response = curl_exec($ch);
curl_close($ch);

// Are things in right place ?
if ($response == $targetText) {
die('Site is up and running!');
}

// Nope, so here are the sender's twitter info
$username = 'SENDER_TWITTER_USERNAME';
$password = 'SENDER_TWITTER_PASSWORD';

// Receiver's twitter username
$receiver = 'RECEIVER_TWITTER_USERNAME';

// Alert message to send
$message = 'Daredevil is not responding, please fix ASAP!';

// The Twitter API address (new direct message)
$url = 'http://twitter.com/direct_messages/new.json';

// We will be using cURL for this
$ch = curl_init();

// Set the params
curl_setopt($ch, CURLOPT_URL, &quot;$url&quot;);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, &quot;user=$receiver&amp;amp;text=$message&quot;);
curl_setopt($ch, CURLOPT_USERPWD, &quot;$username:$password&quot;);

// Send the request
$response = curl_exec($ch);
curl_close($ch);

// Success or failure
if (!empty($response)) {
echo 'Recipient has been notified.';
} else {
echo 'No response from twitter.';
}
?&gt;</pre>
<p><a href="/out.php?id=17111" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/using-twitter-for-sending-server-downtime-alert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Translate</title>
		<link>http://www.snippetsmania.com/jquery-translate/</link>
		<comments>http://www.snippetsmania.com/jquery-translate/#comments</comments>
		<pubDate>Thu, 23 May 2013 20:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[translate]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20527</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">&lt;script type='text/javascript'&gt;
$(document).ready(function(){
$.getScript('http://jquery-translate.googlecode.com/files/jquery.translate-1.3.2.min.js', function(){ //when the script is loaded
$.translate(function(){ //when the Google Language API is loaded
$.translate().ui('select', 'option') //generate dropdown

.change(function(){
$('#translateit').translate( 'en', { //revert to english first
not: 'select, pre'
})

.translate( 'en',  $(this).val(), {
not: 'select, pre',
async:  true,
toggle: true,
walk: false
});
})
.val('English') //select English as default
.appendTo('#nav'); //insert the dropdown to the page
});
});
});
&lt;/script&gt;</pre>
<p><a href="/out.php?id=17107" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/jquery-translate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sqlDataObj in PHP5</title>
		<link>http://www.snippetsmania.com/sqldataobj-in-php5/</link>
		<comments>http://www.snippetsmania.com/sqldataobj-in-php5/#comments</comments>
		<pubDate>Thu, 23 May 2013 17:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20525</guid>
		<description><![CDATA[&#8211; mysql connection handler &#8211; &#60;? class mysql { var $dbase; var $dbcon; var $db_user; var $db_pw; /* Constructor */ function __construct($base,$user,$pw) { $this-&#62;dbase = $base; $this-&#62;db_user = $user; $this-&#62;db_pw = $pw; $this-&#62;dbcon = mysql_connect(&#34;url-to-your-db&#34;,$this-&#62;db_user,$this-&#62;db_pw); if (!$this-&#62;dbcon) { die( &#34;&#60;p&#62;Unable to connect to the database server at this time.&#60;/p&#62;&#34; ); } else { if (!@mysql_select_db($this-&#62;dbase,$this-&#62;dbcon)) [...]]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint"></pre>
<p>-- mysql connection handler --</p>
<p>&lt;?</p>
<p>class mysql {<br />
var $dbase;<br />
var $dbcon;<br />
var $db_user;<br />
var $db_pw;</p>
<p>/* Constructor */<br />
function __construct($base,$user,$pw) {</p>
<p>$this-&gt;dbase = $base;<br />
$this-&gt;db_user = $user;<br />
$this-&gt;db_pw = $pw;</p>
<p>$this-&gt;dbcon = mysql_connect(&quot;url-to-your-db&quot;,$this-&gt;db_user,$this-&gt;db_pw);<br />
if (!$this-&gt;dbcon)  {<br />
die( &quot;&lt;p&gt;Unable to connect to the database server at this time.&lt;/p&gt;&quot; );<br />
} else {<br />
if (!@mysql_select_db($this-&gt;dbase,$this-&gt;dbcon))  {<br />
die( &quot;&lt;p&gt;Could not choose this database: &quot;.$this-&gt;dbase.&quot; Please try again later.&lt;/p&gt;&quot; );<br />
}<br />
}<br />
} // connect end</p>
<p>function closeconnection() {<br />
mysql_free_result();<br />
mysql_close($this-&gt;dbcon);<br />
} // closeconnection end</p>
<p>}<br />
?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/sqldataobj-in-php5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Hosted jQuery + Document Ready</title>
		<link>http://www.snippetsmania.com/google-hosted-jquery-document-ready/</link>
		<comments>http://www.snippetsmania.com/google-hosted-jquery-document-ready/#comments</comments>
		<pubDate>Thu, 23 May 2013 14:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20523</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;
(function($){
$(function(){
// Do stuff...
});
})(this.jQuery);
&lt;/script&gt;</pre>
<p><a href="/out.php?id=17096" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/google-hosted-jquery-document-ready/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ejemplo de un widget de Blogger</title>
		<link>http://www.snippetsmania.com/ejemplo-de-un-widget-de-blogger/</link>
		<comments>http://www.snippetsmania.com/ejemplo-de-un-widget-de-blogger/#comments</comments>
		<pubDate>Thu, 23 May 2013 11:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blogger]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20521</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">&lt;b:widget id='HTMLxx' locked='true' title='' type='HTML'&gt;
&lt;b:includable id='main'&gt;
&lt;!-- only display title if it's non-empty --&gt;
&lt;b:if cond='data:title != &amp;quot;&amp;quot;'&gt;
&lt;h2 class='title'&gt;&lt;data:title/&gt;&lt;/h2&gt;
&lt;/b:if&gt;
&lt;div class='widget-content'&gt;
&lt;data:content/&gt;
&lt;/div&gt;
&lt;/b:includable&gt;
&lt;/b:widget&gt;</pre>
<p><a href="/out.php?id=17094" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/ejemplo-de-un-widget-de-blogger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>drawing</title>
		<link>http://www.snippetsmania.com/drawing/</link>
		<comments>http://www.snippetsmania.com/drawing/#comments</comments>
		<pubDate>Thu, 23 May 2013 08:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20519</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">var loc:Vector.&lt;Point&gt; = new Vector.&lt;Point&gt;();
var lifts:Vector.&lt;int&gt; = new Vector.&lt;int&gt;();
var index:int = 0;
var resolution:int = 1;
var down:Boolean;
stage.addEventListener(MouseEvent.MOUSE_DOWN, onDown);
stage.addEventListener(MouseEvent.MOUSE_UP, onUp);
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyReleased);
addEventListener(Event.ENTER_FRAME, onLoop);
function onKeyReleased(evt:KeyboardEvent):void{
if (evt.keyCode == Keyboard.RIGHT){
resolution -= 1;
if (resolution &lt;1) resolution = 1;
}else
if (evt.keyCode == Keyboard.LEFT){
resolution += 1;
}
}
function onDown(evt:MouseEvent):void{
down = true;
lifts.push(index);
}
function onUp(evt:MouseEvent):void{
down = false;
}
function onLoop(evt:Event):void {
if (down){
loc[index] = new Point(mouseX, mouseY);
index++;
}
graphics.clear();
graphics.lineStyle(0,0x000000);
var j:int = 0;
var lift:int;
var liftLength:int = lifts.length;
var lastLoc:int =  loc.length  - 1;
for (var i:int = 0; i&lt;liftLength; i++){
j =  lifts[i];
graphics.moveTo(loc[j].x, loc[j].y);
if (i &lt;liftLength - 1){
lift = lifts[i + 1] - 1;
}else{
lift = lastLoc;
}
while (j &lt;lift){
j++;
if (j % resolution == 1 || resolution == 1){
graphics.lineTo(loc[j].x, loc[j].y);
}
}
graphics.lineTo(loc[j].x, loc[j].y);
}
}</pre>
<p><a href="/out.php?id=17091" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Font Short Cutty</title>
		<link>http://www.snippetsmania.com/font-short-cutty/</link>
		<comments>http://www.snippetsmania.com/font-short-cutty/#comments</comments>
		<pubDate>Thu, 23 May 2013 05:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[font]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20517</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">package {

import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;

public class Test extends MovieClip {

// be sure this is pointing to a ttf font in your hardrive
[Embed(source=&quot;C:WINDOWSFontssomefont.ttf&quot;, fontFamily=&quot;foo&quot;)]
public var bar:String;

public function Test() {

var format:TextFormat	      = new TextFormat();
format.font		      = &quot;foo&quot;;
format.color                = 0xFFFFFF;
format.size                 = 130;

var label:TextField         = new TextField();
label.embedFonts            = true;
label.autoSize              = TextFieldAutoSize.LEFT;
label.antiAliasType         = AntiAliasType.ADVANCED;
label.defaultTextFormat     = format;
label.text                  = &quot;Hello World!&quot;;
addChild(label);
}
}
}</pre>
<p><a href="/out.php?id=17089" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/font-short-cutty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSLT Helper class</title>
		<link>http://www.snippetsmania.com/xslt-helper-class/</link>
		<comments>http://www.snippetsmania.com/xslt-helper-class/#comments</comments>
		<pubDate>Thu, 23 May 2013 02:01:00 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[snipitpro]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20515</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">using System;
using System.IO;
using System.Xml;
using System.Xml.Xsl;

namespace [[Name Space]]
{
public class [[Class Name]]
{
/// &lt;summary&gt;
/// Transforms the supplied xml using the supplied xslt and returns the
/// result of the transformation
/// &lt;/summary&gt;
/// &lt;param name=&quot;xml&quot;&gt;The xml to be transformed&lt;/param&gt;
/// &lt;param name=&quot;xslt&quot;&gt;The xslt to transform the xml&lt;/param&gt;
/// &lt;returns&gt;The transformed xml&lt;/returns&gt;
public string TransformXml(string xml, string xslt)
{
// Simple data checks
if (string.IsNullOrEmpty(xml))
{
throw new ArgumentException(&quot;Param cannot be null or empty&quot;, &quot;xml&quot;);
}
if (string.IsNullOrEmpty(xslt))
{
throw new ArgumentException(&quot;Param cannot be null or empty&quot;, &quot;xslt&quot;);
}

// Create required readers for working with xml and xslt
StringReader xsltInput = new StringReader(xslt);
StringReader xmlInput = new StringReader(xml);
XmlTextReader xsltReader = new XmlTextReader(xsltInput);
XmlTextReader xmlReader = new XmlTextReader(xmlInput);

// Create required writer for output
StringWriter stringWriter = new StringWriter();
XmlTextWriter transformedXml = new XmlTextWriter(stringWriter);

// Create a XslCompiledTransform to perform transformation
XslCompiledTransform xsltTransform = new XslCompiledTransform();

try
{
xsltTransform.Load(xsltReader, new XsltSettings(true, true), null);
xsltTransform.Transform(xmlReader, transformedXml);
}
catch (XmlException xmlEx)
{
// TODO : log - &quot;Could not load XSL transform:

&quot; + xmlEx.Message
throw;
}
catch (XsltException xsltEx)
{
// TODO : log - &quot;Could not process the XSL:

&quot; + xsltEx.Message + &quot;
On line &quot; + xsltEx.LineNumber + &quot; @ &quot; + xsltEx.LinePosition)
throw;
}
catch (Exception ex)
{
// TODO : log
throw;
}

return stringWriter.ToString();
}
}
}
</pre>
<p><a href="/out.php?id=17080" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/xslt-helper-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>formatBytes</title>
		<link>http://www.snippetsmania.com/formatbytes/</link>
		<comments>http://www.snippetsmania.com/formatbytes/#comments</comments>
		<pubDate>Wed, 22 May 2013 23:01:01 +0000</pubDate>
		<dc:creator>snippets</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bytes]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[size]]></category>

		<guid isPermaLink="false">http://www.snippetsmania.com/?p=20513</guid>
		<description><![CDATA[source]]></description>
			<content:encoded><![CDATA[<pre class="prettyprint">function formatBytes($bytes, $precision = 2) {
$units = array('B', 'KB', 'MB', 'GB', 'TB');

$bytes = max($bytes, 0);
$pow = floor(($bytes ? log($bytes) : 0) / log(1024));
$pow = min($pow, count($units) - 1);

$bytes /= pow(1024, $pow);

return round($bytes, $precision) . ' ' . $units[$pow];
}</pre>
<p><a href="/out.php?id=17075" rel="nofollow">source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snippetsmania.com/formatbytes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
