Archive

Archive for June, 2012

jQuery Thickbox – Refresh parent when closing dialog

June 27th, 2012 No comments

This patch is for Thickbox 3.1

1. Open the non-compressed version of thickbox.js

2. Find function tb_remove(). This will be line# 268 if you have correct version

3. Add parent.location.reload(1); above return false; statement.

4. Done.

The code will look like this:

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
 
    parent.location.reload(1); // Patch - Newly added line
 
    return false;
}
VN:F [1.9.18_1163]
Rating: 5.0/5 (3 votes cast)
Categories: Code Snippets, Web Design

Visual Studio 2012 RC is available

June 27th, 2012 No comments

image

Visual Studio 2012 and TFS 2012 are out for your experiments.

You can download the express versions from here.

Well, you require Windows 8 Preview (x86/x64) for installation.

VN:F [1.9.18_1163]
Rating: 3.0/5 (1 vote cast)
Categories: DOTNET, News

SharePoint 2010 Editions Comparison

June 24th, 2012 No comments

Check here to find out the differences between Foundation, Standard and Enterprise editions.

http://sharepoint.microsoft.com/en-us/buy/Pages/Editions-Comparison.aspx

Extract pasted here:

Read more…

VN:F [1.9.18_1163]
Rating: 5.0/5 (2 votes cast)
Categories: Useful Links, Web Design

Free E-Book Offer: Introducing Windows Server 2012

June 21st, 2012 No comments

Click here to visit the download page.

Windows Server 2012 is 256 pages and includes 5 chapters loaded with insider information from the Windows Server Team.

image

VN:F [1.9.18_1163]
Rating: 3.0/5 (1 vote cast)
Categories: General, Useful Links

iTextSharp Hello World sample

June 20th, 2012 No comments

Get a version of iTextSharp from sourceforge first. Add a reference to the core dll – itextsharp.dll in the project.

Use this in all the scripts:

using iTextSharp.text;
using iTextSharp.text.pdf;

Here goes the beginner’s hello world code snippet:

 

Document doc = new Document();
FileStream fs = new FileStream("c:\\test.pdf", FileMode.Create);
PdfWriter pw = PdfWriter.GetInstance(doc, fs);
doc.Open();
doc.Add(new Paragraph("Hello World"));
doc.Close();
fs.Close();

 

Below code snippet can be used to position text:

 

Document doc = new Document(PageSize.A4);
FileStream fs = new FileStream("c:\\test.pdf", FileMode.Create);
PdfWriter pw = PdfWriter.GetInstance(doc, fs);
doc.Open();
PdfContentByte cb = pw.DirectContent;
BaseFont bfnt = BaseFont.CreateFont(BaseFont.HELVETICA_BOLD, 
	BaseFont.WINANSI, BaseFont.NOT_EMBEDDED);
cb.SetFontAndSize(bfnt, 50);
cb.SetTextMatrix(200, 600);
cb.ShowText("Hello World");
doc.Close();
fs.Close();
VN:F [1.9.18_1163]
Rating: 5.0/5 (2 votes cast)
Categories: C#, Code Snippets

Six Sigma White Belt Certified now

June 7th, 2012 1 comment

Got Six Sigma White Belt certified and below is the certificate.

image

Check this link for more details about the certification.

VN:F [1.9.18_1163]
Rating: 5.0/5 (3 votes cast)
Categories: Personal

t-sql: Default value of a column depending on another field

June 4th, 2012 No comments

Below INSERT TRIGGER code updates the value of SortOrder column with the maximum value in that column + 1

	CREATE TRIGGER trigger_UpdateSortOrder
	ON arc_Categories
	FOR INSERT
	AS
		UPDATE arc_Categories
		SET sortorder = (SELECT MAX(sortorder)+1 
			FROM arc_Categories)
		WHERE CatID = @@IDENTITY
	GO
VN:F [1.9.18_1163]
Rating: 4.0/5 (2 votes cast)
Categories: SQL