Friday, December 18, 2009

Javascript menu goes behind Flash video

If you are using Javascript which goes on top of a video and it doesn't show properly since it goes behind it. Fortunately there is a very easy fix for this. You have to add two things to the object tag of your video and it should take care of it.

please visit adobe's site here

Wednesday, November 18, 2009

Deleting Rows in DataTable - .Net

A colleague asked me about deleting rows from DataTable. He was having an issue when removing the rows of the datatable because he was using method DataTable.Rows.Remove(index).

When you are looping through any collection using for each loop, you cannot modify the collection. In order to Delete the rows, the best way is to use the Delete method of the particular row(s) and once you are done with the loop, method accept changes of DataTable will remove the rows from DataTable. Code example is

' Loop though the table

For Each dr As DataRow In ds.Tables(0).Rows

If (dr("Name") = "ABC" Then

dr.Delete()

End If

Next

ds.Tables(0).AcceptChanges() ' this remains outside of the loop


Wednesday, October 21, 2009

How to avoid SQL cursors

Good article on sqlbook.com about how to avoid cursors. In short, there are two ways which the article suggests

1. Using temporary table with auto generated ID column and loop it through a while loop
2. Use SQL functions when possible to do calculation on a column

Read it here

I saw different articles on sites about the performance comparison between cursors and using while loop. Some places it made sense to use a cursor but the drawback is that it locks the table where while loops using temporary tables won't.

Due to its syntax and de-allocation procedure, I have never really tried using cursors which, not using them seems like a good practice according to some SQL experts. Read today on a site that one interviewer would ask people the syntax of using cursors and if they knew then he would consider it as negative since he wouldn't want people on his team to use them and knowing the syntax means that you use them :)

Monday, October 19, 2009

Querying SharePoint List Items using jQuery

Very good article by Jan Tielen about using jQuery in Sharepoint. He uses a web content editor webpart in conjunction with jQuery to load Tasks from Task list. This example queries list webservices from client side and loads task in a unordered list. Easy to use code, sort of plug-in play!

jQuery Plugins

  • Growl: Popup messages like messenger style in a browser
  • Growl use in SharePoint: using Growl to show open tasks in SharePoint. Calling webservices from client side using jQuery.

Friday, October 16, 2009

Productivity

Tools

  • ToDoList (Free) - The best to do list software I have come across. Its a great replacement for doing quick project plans and using it as a permanent clipboard where you can organize items in hierarchy
  • Winsplit Revolution (Free) - Very good tool for laptops where you want to mimic two monitors on one. Allows you arrange windows with keyboard shortcuts
  • ZScreen : Screen capture (open source) - a great tool for anyone who needs to capture screenshots. You can associate program to open whenever you hit Print screen key.
  • AVG Antivirus (Free) - lightweight free anti virus software
  • PrimoPDF (Free) - A great tool to print anything as PDF. Sometimes when you don't have a printer available, this tool makes perfect sense to be able to make it PDF and print it later when you are connected.
  • Foxit Reader (Free) - A must have pdf reader, can't even compare this to bulky adobe reader. It provides alot of features for free such as Commenting, attaching files, bookmarking etc. In short makes pdf experience great.
  • PDFill - A very good free tool as a replacement to Adobe Writer. Can merge, create/edit forms etc.
  • FireFox (Free) - When talking about great free software products, how can you avoid not mentioning the excellent browser which revolutionized browser innovation
  • CDBurnerXP (Free) - Hands down the best lightweight CD/DVD burner product. Can make iso and burn them to a media
  • Virtual Clone Drive (Free) - Great tool to map iso as a drive. No need to burn DVDs, just save it as a iso and use it as a drive whenever you need it!
  • Crimson Editor (Free) - A great replacement to lame notepad. Highlights text for known formats. You can work with multiple files at the same time. A lot of text editing great features
  • CamStudio (Free) - Free screen recording software. Lets you make a avi file for the recording.
Visual Studio

Methods

  1. TBD

Sharepoint Resources

Tools
Documentation/Tutorial

Wednesday, October 14, 2009

Sharepoint WSS/MOSS CSS Reference

Very good CSS reference at HeatherSolomon.com. Very helpful when you need to use Sharepoint CSS to match with your piece of UI. It shows examples with each selector or class and there is button to copy the css to easily copy in clipboard.

Tuesday, October 13, 2009

Understanding Lamda Expression

Came across a very good article by Panopticon Central. He explains it very well the use with both syntax for VB Net and C#. Visit the following link for details

Link: http://www.panopticoncentral.net/archive/2006/12/08/18587.aspx

Friday, October 9, 2009

MSBuild

I was reading up on MSBuild and found this very good article which explains how to write MSBuild files. A very good read. Its an excerpt from Deploying .NET Applications, by Sayed Y. Hashimi, Sayed Ibrahim Hashimi.

I also found two open source task collection for MSBuild. First one is called MSBuild Extension Pack. It is hosted at CodePlex which has about 300 tasks which includes BizTalk, SQL 2005, SQL 2008, TFS, Visual Studio and alot more.

The other one is hosted at Tigris called MSBuildTask. This has tasks for IIS, Javascript, SourceSafe, SVN, SQLServer.

Having so many tasks available during a build process is an excellent opportunity to automate pretty much the whole deployment process of development -> test -> production promotion strategy.

If you are looking to learn MSBuild, I would recommend to visit following:
Happy MSBuilding!

Thursday, October 8, 2009

Which CSS Grid Framework to use - Reading

Link: http://net.tutsplus.com/html-css-techniques/which-css-grid-framework-should-you-use-for-web-design/

LINQ to SQL CheatSheet by Damieng.com

Download Link: http://download.damieng.com/dotnet/LINQToSQLCheatSheet.pdf

How relevant is UML modeling today? - Link Back

A good article by Jeremy D. Miller

Link: http://codebetter.com/blogs/jeremy.miller/archive/2009/09/12/how-relevant-is-uml-modeling-today.aspx?CommentPosted=true#commentmessage

VS 2010 Web Optimized profile - Link Back

New profile in VS2010 for web developers

Link: http://weblogs.asp.net/scottgu/archive/2009/09/02/code-optimized-web-development-profile-vs-2010-and-net-4-0-series.aspx?CommentPosted=true#commentmessage

Requirements and Source control - Eric Sink

I was googling for branching in source control and found a very good article on Eric Sinks Blog. Not that he explained it very well but his way of explaining with examples is exceptional. You can read it at the following links

Source Control: http://www.ericsink.com/scm/source_control.html

While I was there I also read the following article about requirements; a very good one!

Requirements: http://www.ericsink.com/articles/Requirements.html

Tuesday, October 6, 2009

Dependency Injection using StructureMap

Found this very good video post from Rob Conery and Jeremy Miller. It explains setup of StructureMap (Dependency Injection) for Rob's StoreFront project. Very good explanation and easy to understand.

Great work guys!

Refactoring in Visual Basic with Refactor!

I was watching Rob Conery's video post about Dependency Injectionon ASP.Net site. I saw he used some refactoring tool to very quickly change the code to modify it for dependency. After a little bit search I found on MSDN link to free download a tool from DevExpress.

You can watch the video from the link below. Looks pretty good with alot of very useful time saving options available.

Link: http://channel9.msdn.com/posts/funkyonex/Refactoring-in-Visual-Basic-with-Refactor/

Monday, October 5, 2009

Framework Design Guidelines - .Net

While looking for some guidelines I came across the webcast by Brad Adams and Krzysztof Cwalina. Very good video with some great tips. I'm definitely looking to get the book: Framework Design Guidelines: Conventions, Idioms, and Patterns for Reusable .NET Libraries (2nd Edition)

Link: http://channel9.msdn.com/pdc2008/PC58/

Friday, October 2, 2009

.Net Custom Attributes

One of my friend asked me question about custom attributes. He wanted to know the scenarios where it should be used and why. I was looking to find him a good link/tutorial and found this great article at TechRepublic which has a sample solution for download as well.
Definition:
Attributes allow you to add descriptions to classes, properties, and methods at design time that can then be examined at runtime via reflection.
Link: http://articles.techrepublic.com.com/5100-10878_11-6175490.html?tag=rbxccnbtr1

Tuesday, September 29, 2009

Website vs Web Application VS 2008

Just recently I moved some code from one application to the other and ended up creating a website instead of web application. All the designer files started crashing on me and I ended up removing them since it wouldn't stop complaining about namespace issues.

Found this post which explains why it happens. Website model doesn't have designer files and are compiled on demand in single dlls. When you build a web application, it builds as one dll and maintain UI elements relation with code behind using designer files.

The link attached below explains how to do it, worked for me! So now I have decided that I'll use Web application instead of Website since its not suggested for non-smaller web applications.

Link: Detail Post by Guru Stop

Friday, September 25, 2009

How to get jQuery intellisense working VS2008

I followed steps from Scottgu blog post to setup jQuery in Visual Studio 2008 but it didn't work.

While searching for the solution I found this post from MWTech

Steps from the post are:

Getting jQuery Intellisense Up & Running

1. Ensure that VS2008 SP1 is installed. (Further info)
2. Ensure that Hotfix KB958502 is installed. (Further info)
3. Install the jQuery library into your project. It'll have a filename like "jquery-1.3.2.js".
4. Install the jQuery Intellisense file into your project. It may very well have a filename like "jquery-1.3.2-vsdoc2.js" but must be renamed to be identical to the jQuery library name, plus "-vsdoc". Thus in this example, it must be renamed to "jquery-1.3.2-vsdoc.js".
5. Provide a reference to the jQuery library. There are generally two ways to do this, both of which are described below.
6. In external Javascript files a direct reference to the jQuery Intellisense file must be made. More details are provided below.


Works perfectly! Have a look at the complete post if you are having same issues.

AD Group membership lookup - VBA

Found this function to check AD membership of a user from VBA. Very simple and short function.

I'm not sure where I got this from but if the author sees it, please let me know and I'll link to your website.

Function IsMember(strDomain As String, strGroup _
As String, strMember As String) As Boolean
Dim grp As Object
Dim strPath As String

strPath = "WinNT://" & strDomain & "/"
Set grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function

Tips and tricks to rescue overdue projects

A very good Article by Omar Al Zabir, conversation style, explaining true practice of Agile/Scrum for projects. Must read this if you are or planning to use Agile Methodology.

Link: http://msmvps.com/blogs/omar/archive/2008/10/20/tips-and-tricks-to-rescue-overdue-projects.aspx

Wednesday, September 9, 2009

.NET IoC Container Comparisons

While looking for a comparison between so many Dependency Injection (IoC) frameworks available. Found this link which further points to a 2 article blog post. Good color coded comparison between some of the popular frameworks out there. Its missing MEF which I looked at today. Didn't get a chance to get more details on it but it seems pretty simple and easy to use.

Link: Part1
Link: Part2

Got the links from StackOverFlow post.

Wednesday, September 2, 2009

Is User member of AD group - VBA

Came across this small function which returns true or false based on the user belonging to a AD group. No need to add a reference to any dll. Very short and works great.

Quote:
Function IsMember(strDomain As String, strGroup _
As String, strMember As String) As Boolean
Dim grp As Object
Dim strPath As String

strPath = "WinNT://" & strDomain & "/"
Set grp = GetObject(strPath & strGroup & ",group")
IsMember = grp.IsMember(strPath & strMember)
End Function
Thanks to Greg Reddick
Link: http://my.advisor.com/doc/08691

Thursday, July 30, 2009

How do you convert a string into an enum?

Yesterday I was writing a method which would pass me a string which I needed to return as an Enum type. I did it using switch but didn't like doing it that way.

I found the solution on Tim Sneath's blog. I like one liners :), using it replaced bunch of code, in my case 10 cases (could be more or less depending on how many Enum values you have).
Quote:
enum Colour
{
Red,
Green,
Blue
}

// ...
Colour c = (Colour) Enum.Parse(typeof(Colour), "Red", true);
Please visit Tim's blog post if you would like to read the full post.

Tuesday, May 26, 2009

Add icons to your file extensions in WSS 3.0

By default there is no icon for PDF. In order to add one, modification is required in DOCICON.XML in 12 Hive XML folder. Following steps I got from a blog which is located at

Link: http://servergrrl.blogspot.com/2008/02/adding-pdf-icons-to-wss-30-and-what.html

Quote:
Steps
1). Download the icon file from adobe (or whereever, some people have better ones). Make sure it's small (the default from adobe is 17x17). http://www.adobe.com/misc/linking.html#pdficon

2). Save the icon to the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES folder. I renamed it "icpdf.gif" myself, just so it matches the format of all the other doc icon files used in the DOCICON.XML.

3). Open the DOCICON.XML file in notepad (the DOCICON.XML file is located in the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML folder).

4). Once in the DOCICON.XML file, go to the "" section (see figure above) and add the tag: ""(minus the quotes, they're just there to tell you what you are supposed to type-- again, blogger hates it when you add non- html tags)

The tag means that the icon "icpdf.gif" (or whatever you named your pdf icon file) will be mapped to the .pdf extension. I do not have an open control (like using Word to edit a doc file) for pdfs, so I left it blank between the quotes.

5). Save the file, then drop to a command prompt and do an IISRESET. This should let sharepoint know there has been a change and repopulate the pages with new icons appropriately.

IISReset is required after all the above

Wednesday, May 13, 2009

Modifying the width & height of a Sharepoint Page Viewer web part dynamically

Issue:
By default Page viewer web part doesn't allow you to have height expand dynamically. It expects a unit for the height. This small javascript I got from GuiCreate.com does a great job. Basically this script needs to be copied into the page which needs to be displayed in the web part.

JavaScript code:

function resizeMe(that) {
window.resizeTo(document.body.scrollWidth, document.body.scrollHeight);
}
window.attachEvent("onload", function() {
window.setTimeout("resizeMe()", 100);
});


Link: http://www.guicreative.com/blog/sharepoint-2007/modifying-the-width-height-of-a-sharepoint-page-viewer-web-part-dynamically/

WSS Sharepoint Search - no results

In order to turn search ON in WSS 3.0, There two steps

1). Under Operations > Services on Server setup Windows Sharepoint Search Service. Use a domain account when setting this up. If service is already running then skip Step 1 but make sure its properly setup.

2). Under Application Management > Content Databases, click on your content database and then on the page make sure Search Server is selected.

After the above two steps, wait few minutes so Sharepoint crawls your site collection. WSS only lets you search a single site collection. Anything you search under a sub site will give you result at the site collection level.

Thursday, April 16, 2009

Rename Sharepoint WSS 3.0 /MOSS 2007 Machine

Very good steps to perform a machine name change. Look at the comments of the post if you encounter any issues.

Link: http://www.raoulpop.com/2007/how-to-rename-a-wss-30-server/

Blog Archive