<?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"
	>

<channel>
	<title>Developer Bloq</title>
	<atom:link href="http://bloq.cenq.net/feed" rel="self" type="application/rss+xml" />
	<link>http://bloq.cenq.net</link>
	<description>C#, VB.NET, SQL Server</description>
	<pubDate>Wed, 10 Dec 2008 02:35:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>ASP.NET Slider Control</title>
		<link>http://bloq.cenq.net/aspnet-slider-control.html</link>
		<comments>http://bloq.cenq.net/aspnet-slider-control.html#comments</comments>
		<pubDate>Wed, 10 Dec 2008 02:34:47 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[Asp.net Ajax Component]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[.net slider]]></category>

		<category><![CDATA[asp.net ajax slider component]]></category>

		<category><![CDATA[prototype slider component]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=55</guid>
		<description><![CDATA[Powerful ajax slider script in script.aculo.us . I created new asp.net slider component using this. Orjinal script.
ScreentShots: 
]]></description>
			<content:encoded><![CDATA[<p>Powerful ajax slider script in script.aculo.us . I created new asp.net slider component using this. <a href="http://www.aldenta.com/examples/script.aculo.us/">Orjinal script.</a></p>
<p>ScreentShots: 
<a href='http://bloq.cenq.net/aspnet-slider-control.html/asd1' title='asd1'><img src="http://bloq.cenq.net/wp-content/uploads/2008/12/asd1-150x150.jpg" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://bloq.cenq.net/aspnet-slider-control.html/asd2' title='asd2'><img src="http://bloq.cenq.net/wp-content/uploads/2008/12/asd2-150x150.jpg" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://bloq.cenq.net/aspnet-slider-control.html/asd3' title='asd3'><img src="http://bloq.cenq.net/wp-content/uploads/2008/12/asd3-150x150.jpg" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/aspnet-slider-control.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>ASP.NET Image Croper Component with JCrop</title>
		<link>http://bloq.cenq.net/aspnet-image-croper-component.html</link>
		<comments>http://bloq.cenq.net/aspnet-image-croper-component.html#comments</comments>
		<pubDate>Wed, 10 Dec 2008 01:39:25 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[Asp.net Ajax Component]]></category>

		<category><![CDATA[asp.net image croper]]></category>

		<category><![CDATA[asp.net jcop component]]></category>

		<category><![CDATA[crop and upload]]></category>

		<category><![CDATA[free image croper for asp.net]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=42</guid>
		<description><![CDATA[
JCrop is powerful image croper javascript tool. I created asp.net ajax control for jcrop and opened download. Follow the images. Jcrop is free software released under MIT License.

Save as croped area when clicked cropit button.



btnCropIt Click code example:
Image1.ImageUrl = &#8220;~/Uploads/Image/&#8221; + ImageCroper1.Crop(Server.MapPath(&#8221;Uploads/Image/&#8221;));

Download dll file
]]></description>
			<content:encoded><![CDATA[<p><br class="spacer_" /></p>
<p>JCrop is powerful image croper javascript tool. I created asp.net ajax control for jcrop and opened download. Follow the images. Jcrop is free software released under MIT License.</p>
<p><img src="http://www.cenq.net/files/ImageCroper/ads1.jpg" alt="" /></p>
<p>Save as croped area when clicked cropit button.</p>
<p><br class="spacer_" /></p>
<p><img src="http://www.cenq.net/files/ImageCroper/ads2.jpg" alt="" /></p>
<p><br class="spacer_" /></p>
<p>btnCropIt Click code example:</p>
<p>Image1.ImageUrl = &#8220;~/Uploads/Image/&#8221; + ImageCroper1.Crop(Server.MapPath(&#8221;Uploads/Image/&#8221;));</p>
<p><img src="http://www.cenq.net/files/ImageCroper/ads3.jpg" alt="" /></p>
<p><a title="asp.net image croper component" href="http://www.cenq.net/files/ImageCroper/OmrCommon.rar">Download dll file</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/aspnet-image-croper-component.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Best WordPress bug</title>
		<link>http://bloq.cenq.net/best-wordpress-bug.html</link>
		<comments>http://bloq.cenq.net/best-wordpress-bug.html#comments</comments>
		<pubDate>Thu, 28 Aug 2008 17:53:44 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[best wordpress scheduled bug]]></category>

		<category><![CDATA[scheduled contents bug]]></category>

		<category><![CDATA[wp-cron and wp-supercache are negatif]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=37</guid>
		<description><![CDATA[If you are more content,  if you need are legal money, if your ideas is using wordpress then your site is crashed.I&#8217;m using wordpress too many sites. I known wordpress db is safe but i have 30,000+ content (15,000 published and ~15,000 scheduled.), result : wp-cron.php has crashed my site. Memory-Cpu %100 and crash.
I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>If you are more content,  if you need are legal money, if your ideas is using wordpress then your site is crashed.I&#8217;m using wordpress too many sites. I known wordpress db is safe but i have 30,000+ content (15,000 published and ~15,000 scheduled.), result : wp-cron.php has crashed my site. Memory-Cpu %100 and crash.</p>
<p>I&#8217;m try wp super cache pluging and wp-cron+ plugin but negatif.</p>
<h4>I don&#8217;t use wordpress</h4>
<p> when i have too many scheduled content.</p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/best-wordpress-bug.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Authentication by Usb Flash Driver</title>
		<link>http://bloq.cenq.net/authentication-by-usb-flash-driver.html</link>
		<comments>http://bloq.cenq.net/authentication-by-usb-flash-driver.html#comments</comments>
		<pubDate>Fri, 22 Aug 2008 12:58:38 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<category><![CDATA[ManagementObjectSearcher]]></category>

		<category><![CDATA[ObjectQuery]]></category>

		<category><![CDATA[Searching Plugged Driver C# and VB.NET]]></category>

		<category><![CDATA[Wmi]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=31</guid>
		<description><![CDATA[This article is another method for authentication. General method is simple username and password required authentication. This method may be additional your auth. method. Authorization is using for a role based security.
Required Equipments:
Another usb flash driver. (It&#8217;s damaged or secured, it can saw a &#8220;my computer&#8221; only.)

Analysis
We are get the usb flash drive PNPDeviceID, if [...]]]></description>
			<content:encoded><![CDATA[<p>This article is another method for authentication. General method is simple username and password required authentication. This method may be additional your auth. method. Authorization is using for a role based security.</p>
<h3>Required Equipments:</h3>
<p>Another usb flash driver. (It&#8217;s damaged or secured, it can saw a &#8220;my computer&#8221; only.)</p>
<p><br class="spacer_" /></p>
<h3>Analysis</h3>
<p>We are get the usb flash drive PNPDeviceID, if my drive is needed drive than condition has true else false.  Checking usb flash drive is another advantage for user: User use a another computer. (Same Rooming Profile for Server Operating System).</p>
<p><span style="font-family: Arial;"><span style="font-size: x-small;">WMI (Windows Managment Interface) : WMI has created windows 2000 and later windows os. (Win NT Based OS). It&#8217;s get more information on running system and checking and managing litle system object. Any query with WQL for WMI. Windows Xp has approximate 900 WMI object. If you see wmi tester then click start menu and click run, write wbemtest and click Ok. For more information<a href="http://en.wikipedia.org/wiki/Windows_Management_Instrumentation"> click here.</a><br />
 <strong>Example</strong>: &#8220;SELECT * From Win32_LogicalFileAccess&#8221;,</span></span><span style="font-family: Arial;"><span style="font-size: x-small;"> &#8220;SELECT * From Win32_LoggedOnUser&#8221; &#8230; like sql query:)</span></span></p>
<h4>Writing Code</h4>
<p>Create a new console project in visual studio 2005/2008<br />
 Open program.cs and paste following method</p>
<pre name="code" class="c#">        private static bool ScanNeededDiskDriver(string PNPDeviceID)
        {
            Console.WriteLine("Starting query");
            ManagementObjectSearcher mOSClass = new ManagementObjectSearcher();
            mOSClass.Query = new ObjectQuery("SELECT * From Win32_DiskDrive");

            Console.WriteLine("\tSarching disk driver.");
            foreach (ManagementObject mOClass in mOSClass.Get())
            {
                if (mOClass["PNPDeviceID"].ToString() == PNPDeviceID)
                {
                    Console.WriteLine("\t\tSucces. Needed driver was found.");
                    return true;
                }
            }
            Console.WriteLine("\t\tNeeded disk driver can not be found.\r\n\t\tPlease insert another driver.");
            return false;
        }
</pre>
<p>and paste following code in the main method</p>
<pre name="code" class="c#">            if (ScanNeededDiskDriver(@"USBSTOR\DISK&amp;VEN_SONY&amp;PROD_STORAGE_MEDIA&amp;REV_1.00\A304050400186&amp;0"))
            {
               // to do ...
            }
            else
            {
               // to do ...
            }
</pre>
<p>If your needed driver has been plugged then method is return true else false. For more information <a href="http://msdn.microsoft.com/en-us/library/system.management.managementobjectsearcher(VS.80).aspx">ManagementObjectSearcher Class</a></p>
<p><b>Full Code:</b></p>
<pre name="code" class="c#">
using System;
using System.Collections.Generic;
using System.Text;
using System.Management;

namespace Usb
{
    public class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            if (ScanNeededDiskDriver(@"USBSTOR\DISK&#038;VEN_SONY&#038;PROD_STORAGE_MEDIA&#038;REV_1.00\A304050400186&#038;0"))
            {
               // to do ...
            }
            else
            {
               // to do ...
            }
        }

        private static bool ScanNeededDiskDriver(string PNPDeviceID)
        {
            Console.WriteLine("Starting query");
            ManagementObjectSearcher mOSClass = new ManagementObjectSearcher();
            mOSClass.Query = new ObjectQuery("SELECT * From Win32_DiskDrive");

            Console.WriteLine("\tSarching disk driver.");
            foreach (ManagementObject mOClass in mOSClass.Get())
            {
                if (mOClass["PNPDeviceID"].ToString() == PNPDeviceID)
                {
                    Console.WriteLine("\t\tSucces. Needed driver was found.");
                    return true;
                }
            }
            Console.WriteLine("\t\tNeeded disk driver can not be found.\r\n\t\tPlease insert another driver.");
            return false;
        }
    }
}
</pre>
<p><b>VB.NET</b></p>
<pre name="code" class="vb.net">
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Management

Namespace Usb
    Public Class Program
        <STAThread()> _
        Private Shared Sub Main(ByVal args As String())
                    ' to do ...
            If ScanNeededDiskDriver("USBSTOR\DISK&#038;VEN_SONY&#038;PROD_STORAGE_MEDIA&#038;REV_1.00\A304050400186&#038;0") Then
                    ' to do ...
            Else
            End If
        End Sub

        Private Shared Function ScanNeededDiskDriver(ByVal PNPDeviceID As String) As Boolean
            Console.WriteLine("Starting query")
            Dim mOSClass As New ManagementObjectSearcher()
            mOSClass.Query = New ObjectQuery("SELECT * From Win32_DiskDrive")

            Console.WriteLine("" &#038; Chr(9) &#038; "Sarching disk driver.")
            For Each mOClass As ManagementObject In mOSClass.[Get]()
                If mOClass("PNPDeviceID").ToString() = PNPDeviceID Then
                    Console.WriteLine("" &#038; Chr(9) &#038; "" &#038; Chr(9) &#038; "Succes. Needed driver was found.")
                    Return True
                End If
            Next
            Console.WriteLine("" &#038; Chr(9) &#038; "" &#038; Chr(9) &#038; "Needed disk driver can not be found." &#038; Chr(13) &#038; "" &#038; Chr(10) &#038; "" &#038; Chr(9) &#038; "" &#038; Chr(9) &#038; "Please insert another driver.")
            Return False
        End Function
    End Class
End Namespace
</pre>
<p>If ManagementObjectSearcher class can not be found then please add <strong>System.Managament.dll</strong> reference. </p>
<p>Have fun.</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/authentication-by-usb-flash-driver.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Recover loss mssql database</title>
		<link>http://bloq.cenq.net/recover-loss-mssql-database.html</link>
		<comments>http://bloq.cenq.net/recover-loss-mssql-database.html#comments</comments>
		<pubDate>Thu, 21 Aug 2008 23:09:32 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[MS SQL]]></category>

		<category><![CDATA[recover damaged mssql database]]></category>

		<category><![CDATA[repair damaged database on mssql server]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=25</guid>
		<description><![CDATA[First : DBCC CHECKDB (&#8217;DatabaseName&#8217;) &#8212; this command is list of database errors
Second: DBCC CHECKDB (&#8217;DatabaseName&#8217;, REPAIR_REBUILD) &#8212; if first command is return errors than execute this command. This command is repair successful of database.
Third: DBCC CHECKDB (&#8217;DatabaseName&#8217;, REPAIR_ALLOW_DATA_LOSS) &#8212; if second command is return errors than  you may use this command but this [...]]]></description>
			<content:encoded><![CDATA[<p><strong>First</strong> : DBCC CHECKDB (&#8217;DatabaseName&#8217;) &#8212; this command is list of database errors</p>
<p><strong>Second</strong>: DBCC CHECKDB (&#8217;DatabaseName&#8217;, REPAIR_REBUILD) &#8212; if first command is return errors than execute this command. This command is repair successful of database.</p>
<p><strong>Third</strong>: DBCC CHECKDB (&#8217;DatabaseName&#8217;, REPAIR_ALLOW_DATA_LOSS) &#8212; if second command is return errors than  you may use this command but this command is dangerious because it&#8217;s make data loss for minimum damage. Run this command when absolutely create a backup.</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/recover-loss-mssql-database.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Encrypting Data</title>
		<link>http://bloq.cenq.net/encrypting-data.html</link>
		<comments>http://bloq.cenq.net/encrypting-data.html#comments</comments>
		<pubDate>Thu, 21 Aug 2008 22:46:58 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[MS SQL]]></category>

		<category><![CDATA[Data Encrypting]]></category>

		<category><![CDATA[DecryptByPassPhrase]]></category>

		<category><![CDATA[EncryptByPassPhrase]]></category>

		<category><![CDATA[Mssql Encryption Support]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=17</guid>
		<description><![CDATA[Mssql 2005 has provides a lot of encrption function: PassPhrase, synrommetric, asymmetric and encryption by certificate.
 PassPhrase function is basicaly method for data encryption. It&#8217;s use e user defined decryption key.
Encrypting data by PassPhrase:
Declare @EncryptedData varbinary(MAX)
Select @EncryptedData = EncryptByPassPhrase('cenq', 'mypassword' )
Select @EncryptedData

Decrypting data by PassPhrase:

Declare @DecryptedData nvarchar(36)
Set @DecryptedData = Convert(VarChar(36),DecryptByPassPhrase('cenq', 0x010000000F11B98B5BC8D062F57F404B59C12B0084EF898ABFCC7477F47C99BCF1259C00))
Select @DecryptedData

Output:
mypassword
]]></description>
			<content:encoded><![CDATA[<p>Mssql 2005 has provides a lot of encrption function: PassPhrase, synrommetric, asymmetric and encryption by certificate.<br />
 PassPhrase function is basicaly method for data encryption. It&#8217;s use e user defined decryption key.</p>
<h3>Encrypting data by PassPhrase:</h3>
<pre name="code" class="sql">Declare @EncryptedData varbinary(MAX)
Select @EncryptedData = EncryptByPassPhrase('cenq', 'mypassword' )
Select @EncryptedData
</pre>
<h3>Decrypting data by PassPhrase:</h3>
<pre name="code" class="sql">
Declare @DecryptedData nvarchar(36)
Set @DecryptedData = Convert(VarChar(36),DecryptByPassPhrase('cenq', 0x010000000F11B98B5BC8D062F57F404B59C12B0084EF898ABFCC7477F47C99BCF1259C00))
Select @DecryptedData
</pre>
<h4>Output:</h4>
<p>mypassword</p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/encrypting-data.html/feed</wfw:commentRss>
		</item>
		<item>
		<title>Converting UnixTime To DateTime</title>
		<link>http://bloq.cenq.net/converting-unixtime-to-datetime.html</link>
		<comments>http://bloq.cenq.net/converting-unixtime-to-datetime.html#comments</comments>
		<pubDate>Thu, 21 Aug 2008 22:15:17 +0000</pubDate>
		<dc:creator>cenq</dc:creator>
		
		<category><![CDATA[MS SQL]]></category>

		<guid isPermaLink="false">http://bloq.cenq.net/?p=10</guid>
		<description><![CDATA[Unixtime is 32-bit integer. It&#8217;s a second counter. A problem is converting datetime to unix time on mssql server. This solution convert unixtime to datetime.
For a more information for Unix Time by wikipedia.
Declare @UnixTime int
Set @UnixTime = 1219366020 -- 08.22.2008 00:47:00
Select dateadd(ss,@UnixTime,'1970-01-01')

To Function:
Create Function fn$UnixTimeToDatetime(@UnixTime int)
Returns Datetime
Begin
Return dateadd(ss,@UnixTime,'1970-01-01')
End

Go


Usage:
Select dbo.fn$UnixTimeToDatetime(1219366020) As DateAndTime


]]></description>
			<content:encoded><![CDATA[<p>Unixtime is 32-bit integer. It&#8217;s a second counter. A problem is converting datetime to unix time on mssql server. This solution convert unixtime to datetime.</p>
<p>For a more information for <a title="unixtime info" href="http://en.wikipedia.org/wiki/Unix_time" target="_blank">Unix Time</a> by wikipedia.</p>
<pre name="code" class="c#">Declare @UnixTime int
Set @UnixTime = 1219366020 -- 08.22.2008 00:47:00
Select dateadd(ss,@UnixTime,'1970-01-01')
</pre>
<p>To Function:</p>
<pre name="code" class="sql">Create Function fn$UnixTimeToDatetime(@UnixTime int)
Returns Datetime
Begin
Return dateadd(ss,@UnixTime,'1970-01-01')
End

Go
</pre>
<p><br class="spacer_" /></p>
<p>Usage:</p>
<pre name="code" class="sql">Select dbo.fn$UnixTimeToDatetime(1219366020) As DateAndTime
</pre>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://bloq.cenq.net/converting-unixtime-to-datetime.html/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
