Posts

Showing posts from July, 2012

C# Remove HTML/XML Tags

Removing HTML tags from strings Input: <p>The <b>dog</b> is <i>cute</i>.</p> Output: The dog is cute. Performance test for HTML removal HtmlRemoval.StripTagsRegex: 2404 ms HtmlRemoval.StripTagsRegexCompiled: 1366 ms HtmlRemoval.StripTagsCharArray: 287 ms [fastest] File length test for HTML removal File tested: Real-world HTML file File length before: 8085 chars HtmlRemoval.StripTagsRegex: 4382 chars HtmlRemoval.StripTagsRegexCompiled: 4382 chars HtmlRemoval.StripTagsCharArray: 4382 chars HtmlRemoval static class [C#] using System; using System.Text.RegularExpressions; /// <summary> /// Methods to remove HTML from strings. /// </summary> public static class HtmlRemoval { /// <summary> /// Remove HTML from string with Regex. /// </summary> public static string StripTagsRegex(string source) { return Regex.Replace(so...

Working with Power Builder Data Window

1) create a custom object with  n_Connection  name and class with  GetConn and   return as transcation data type... // Profile myprofile Transaction trans SQLCA.DBMS = "SNC SQL Native Client(OLE DB)" SQLCA.LogPass = "**************" SQLCA.ServerName = "000.000.000.000" SQLCA.LogId = "User ID" SQLCA.AutoCommit = False SQLCA.DBParm = "Database='Database Name',Provider='SQLNCLI10',TrustedConnection=1" connect using sqlca; trans=sqlca return trans 2) Bind Data window... n_Connection obj obj = create n_Connection Transaction tran tran  = create Transaction tran=obj.GetConn() connect using tran; datawindow .SetTransObject(tran) datawindow .Retrieve() disconnect using tran; 3) Update record after change data in grid itself... n_Connection obj obj = create n_Connection Transaction tran tran  = create Transaction tran=obj.GetConn() connect using tran; datawindow.SetTransObject(tran) datawindow ...

What is Magic table in SQL ?

Magic tables are nothing but INSERTED, DELETED table scope level, These are not physical tables, only Internal tables.  This Magic table are used In SQL Server 6.5, 7.0 & 2000 versions with Triggers only.  But, In SQL Server 2005, 2008 & 2008 R2 Versions can use these Magic tables with Triggers and Non-Triggers also.  Using with Triggers:   If you have implemented any trigger for any Tables then,  1.Whenever you Insert a record on that table, That record will be there on INSERTED Magic table.  2.Whenever you Update the record on that table, That existing record will be there on DELETED Magic table and modified New data with be there in INSERTED Magic table.  3.Whenever you Delete the record on that table, That record will be there on DELETED Magic table Only.  These magic table are used inside the Triggers for tracking the data transaction.  Using Non-Triggers:  You can also use the Magic tables with Non-Trigger activities using...

Verify Whether a SQL Server Agent Job is Running

DECLARE @jobname sysname ='Running Job' -- Enter the job name here SET NOCOUNT ON IF NOT EXISTS (SELECT * FROM msdb..sysjobs Where Name = @jobname) BEGIN PRINT 'Job does not exists' END ELSE BEGIN CREATE TABLE #xp_results ( job_id UNIQUEIDENTIFIER NOT NULL, last_run_date INT NOT NULL, last_run_time INT NOT NULL, next_run_date INT NOT NULL, next_run_time INT NOT NULL, next_run_schedule_id INT NOT NULL, requested_to_run INT NOT NULL, -- BOOL request_source INT NOT NULL, request_source_id sysname COLLATE database_default NULL, running INT NOT NULL, -- BOOL current_step INT NOT NULL, current_retry_attempt INT NOT NULL, job_state INT NOT NULL ) INSERT INTO #xp_results EXECUTE master.dbo.xp_sqlagent_enum_jo...

CSS3 GENERATOR

http://www.webtutorialplus.com

Automatic link source in your every copy paste text.

Add this script in your master page/page and change text " Your Site Name " with your website name and enjoy.  <script type="text/javascript">         function addLink() {             var body_element = document.getElementsByTagName('body')[0]; var selection;             selection = window.getSelection();             var pagelink = "<br /><br /> Read more at: <a href='" + document.location.href + "'>" + document.location.href + "</a><br />Copyright &copy; Your Site Name";             var copytext = selection + pagelink; var newdiv = document.createElement('div'); newdiv.style.position = 'absolute'; newdiv.style.left = '-99999px'; body_element.appendChild(newdiv); newdiv.innerHTML = copytext; selection.selectAllChildren(newdiv); window.setTimeout(function () { body_element.removeChild(newdiv); }, 0...

Human Blood Type Chart

Human Blood Type Chart A, B, AB or O ABO Blood Type Per Cent of General Population Can DONATE Red Cells To: Can RECEIVE Red Cells From: Chance of Finding A Compatible Donor O+ 38.5% O+, A+, B+, AB+ O+, O- 1 out of 2 50% O- 6.5% All Types (universal donor) O- 1 out of 15 7% A+ 34.3% A+, AB+ A+, A-, O+, O- 4 out of 5 80% A- 5.7% A-, A+, AB-, AB+ A-, O- 1 out of 8 13% B+ 8.6% B+, AB+ B+, B-, O+, O- 3 out of 5 60% B- 1.7% B-, B+, AB-, AB+ B-, O- 1 out of 12 9% AB+ 4.3% AB+ All Types (universal recipient)  100% AB...

ASP.NET Page Life Cycle Overview

Image
Page Life-Cycle Stages Page request  The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page. Start   In the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. The page also sets the UICulture property. Initialization  During page initialization, controls on the page are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state. Load  During load, if th...

Responsive design using Foundation with ASP.Net MVC

http://www.simple-talk.com/dotnet/asp.net/responsive-design-using-foundation-with-asp.net-mvc/

Alter Table Alter Column

CREATE TABLE dbo.Employee ( EmployeeID INT IDENTITY (1,1) NOT NULL ,FirstName VARCHAR(50) NULL ,MiddleName VARCHAR(50) NULL ,LastName VARCHAR(50) NULL ,DateHired datetime NOT NULL ) -- Change column name sp_rename 'table name','old column name','column' -- Change the datatype to support 100 characters and make NOT NULL ALTER TABLE dbo.Employee ALTER COLUMN FirstName VARCHAR(100) NOT NULL -- Change datatype and allow NULLs for DateHired ALTER TABLE dbo.Employee ALTER COLUMN DateHired SMALLDATETIME NULL -- Set SPARSE columns for Middle Name (sql server 2008 only) ALTER TABLE dbo.Employee ALTER COLUMN MiddleName VARCHAR(100) SPARSE NULL

Chandra Bhushan Prasad: Exposing Agile Software Development Myths

Chandra Bhushan Prasad: Exposing Agile Software Development Myths : Agile development is a movement that started 11 years ago and now is a commonplace discussion for software development teams. Prior to t...

Open Source Jquery Slideshow

http://www.scoop.it/t/web-designing-pictomedia/p/2179864292/open-source-jquery-slideshow?hash=5d02fe62-7922-45b3-b37a-9510c9979b00

15 Extra Ordinarily Collection Of JQuery Drag And Drop Plugins

http://smashingspy.com/extra-ordinarily-collection-of-jquery-drag-and-drop-plugins/