Programming Tips
Ranked #1,237 in Internet, #70,129 overall | Donates to Squidoo Charity Fund
Programming Tips and Hints
I have a lot of great information on my programming blog (at http://jwcooney.com) that I want to share, and that I'm hoping will be helpful to people who are starting out programming or who have interest in a particular area. So I've created this lens to outline & review the best content and articles that I think will be informative to you.
Currently I cover a combination of Microsoft products and general Web development technologies including VB.NET and ASP.NET for Visual Studio 2010, T-SQL for SQL Server 2008, JQuery and JavaScript.
If you are interested in the world of programming, please check out some of the articles, and feel free to leave a comment below. I hope you will find the information useful and informative!
Table of Contents
- Poll: What do you think?
- JQuery - An Amazing Javascript Library that makes it Easy to Create Great Functionality on your Site
- ASP.NET
- JavaScript
- MS SQL Server Tips
- VSTO Programming for Outlook 2007 with Visual Studio 2010
- Information Security
- Miscellaneous Technology Articles
- About Me
- Here are Other Lenses I'm Curating
- New Guestbook Comments
- Latest Tweets from Twitter
Poll: What do you think?
Strongly Typed Languages or Weakly Typed Languages?
A key difference between the many varieties of programming languages is strong typing vs. weak typing. Both come with advantages and disadvantages. What is your preference?
Just to review, here are the main differences between strongly typed and weakly typed languages:
- A weakly typed language allows a value of one type to be used as a value of another type, such as treating a number as a string. This can make a language easier to work with but can make maintaining the code logic more difficult and can introduce unexpected behaviors. Examples of weakly typed languages are PHP, JavaScript, or VB.NET with Option Strict Off or Option Infer Off.
- A strongly typed language enforces operations to take place between values of the same type, so that all types are known at compile time. This can make development somewhat slower, but can save a lot of time and effort in the long run. Java and C# are examples of languages that are considered strongly typed.
JQuery - An Amazing Javascript Library that makes it Easy to Create Great Functionality on your Site
- The Default zIndex of a JQuery UI Dialog
- Some of the absolutely positioned layers on a page will overlap with a JQuery UI dialog when dragging the dialog object across the form due to inadvertent conflicts between page z-index settings and the default z-index of the JQuery Dialog control. Read on to find out more...
- JQuery - Basic DatePicker Calendar Example with Code
- The JQuery DatePicker Calendar control is simple to add to your Web pages, but can be configured quite extensively if the need arises. In this article I describe how to add a basic DatePicker windget to your Web page, how to style its the background color of the days of the week, and how to set the DatePicker widget to work with dates in the yyyy-mm-dd format. I also give a complete sample page to use as a starting point.
- JQuery - Basic AutoComplete Example with Code
- The JQuery AutoComplete widget is a fun control to add to your page in order to provide your text boxes with a way of populating themselves from a list of options. The options list can range from a simple array of JavaScript variables, to a list provided via a callback function. I explain the basics of hooking up an AutoComplete widget to your Web page, and I give the HTML for a bare-bones example AutoComplete widget.
- Internet Explorer Compatibility Mode Breaks JQuery
- The many iterations of Internet Explorer (IE) each come with idiosyncrasies that a developer should know about. The latest version of IE come with a new feature called 'Compatibility Mode' that started with good intentions, but just seems to cause mysterious behavior in the browser. In this article I delve into the how and why of it, as well as how to address this issue when you are creating an IE-compatible Web page.
- Create and Style an Editable Select List Using a JQuery Combobox
- There is no HTML canned control that can act as both a dropdown list and an editable input area. So how can one create a control that behaves this way for the Web? The JQuery UI offers a Combobox widget which works like a charm and is easy to plug in. Read on for more info and example code!
- JQuery – Set up Basic Tabbing and Programmatically Control Tab Activation
- Tabs on a Web form can help organize data in a manner that is more visually intuitive to users. The JQuery UI JavaScript library adds easy to use tabbing that can be added to any Web page with a minimal amount of code.
ASP.NET
A great framework for getting things done quickly and efficiently.
- ASP.NET GridView Paging Problem - Paging Increases the First Column Width
- When using a GridView control the first column of a report can end up being far too wide for the data it shows. This article discusses the details of why and how to correct this.
- RadioButtonList Binding Overview for ASP.NET WebForms
- The RadioButtonList control is situationally useful, but when it is needed, it's good to know how to use it. This article covers the specifics.
- WebForms Declarative Data Binding using Eval & Bind
- I have been using Visual Studio's Declarative WebForms programming model lately to quickly create Web-based form interfaces. It's easy to do and with help from this article you can too!
- ASP.NET Using the Form Option when Defining your DataSource Parameters
- When working on binding a SQLDataSource to a GridView control one goes through a series of steps in the Visual Studio DataSource configuration wizard. One step that I often use but do not look much into is the step of associating a parameter source with the parameters being passed to the database. This article reviews the details of using the Form option.
- Call a JavaScript Function After an ASP.NET Save Event
- It can be useful to be able to call a JavaScript function after an ASP.NET event has completed. Read further about how exactly this can be done.
- AutoGenerate a Form Page Step-by-Step Without a Single Line of Code - ASP.NET WebForms in Visual Studio 2010
- Have you ever wanted to create a Web-based form without all the hassle of having to write code to handle the logic? With Visual Studio this is all possible. Read this article and you too will be able to do this!
- VB Data Types VB6/VB.net - Comparison Chart
- A chart and detailed information comparing VB6 and VB.NET data types.
- ASP.NET GridView RowUpdating Event Handler - Programmatically Reference Controls and set SqlDataSource UpdateParameters
- Binding a GridView control can sometimes get tricky when using the VisualStudio editor, especially when working with DropDownList controls within the grid. Read here for further details!
- VB.NET Type Conversion (Casting) Overview
- VB.NET supports several type conversion functions. Widening conversions are handled by the compiler and don't need to be explicitly written, but narrowing conversions require use of VB.NET's type conversion functions. This article looks further into the various options available to developers and their performance consequences.
- Classic ASP Revisited: A Simple Name Parsing Function
- A short foray into writing classic ASP code to parse user names. Nostalgic!
- Use RAD with Visual Studio WebForms to Programmatically Query a SQLDataSource Control from Custom Code
- Rapid Application Development (RAD for short) is an important concept for any programmer. The basics of RAD stem from rapidly being able to get functionality prototyped and working. This is key when deadlines are tight and budgets virtually non-existent. This article explains how to use RAD with Visual Studio 2010 to quickly set-up a database connection and then manipulate the results programmatically. Bottom line here is that this RAD concept simplifies a common and tedious task that all programmers encounter at one time or another.
- IIS6 - Change the ASP.NET Version Without Restarting the W3SVC Service Using Aspnet_regiis.exe
- IIS6 is a great Web server that is still used throughout much of the industry. One drawback of IIS6 is that when you use the GUI tool to change the .NET Framework version for one of your Web sites hosted on IIS, the entire W3SVC service needs to be restarted. This results in a minor service interruption for all of your sites that also includes loss of session information. If possible it's naturally best to avoid this, but the only way to do so is using the aspnet_regiis command-line tool. It's not as difficult as it sounds though, and this article will take you through the details step-by-step.
- Classic ASP: Example of a Basic Database Connection (SQLOLEDB)
- Classic ASP is still used throughout the programming industry. Whether you need to write something quickly and simply or need to maintain an older project, it's still important to be familiar with classic ASP. This article describes how to set up a simple database connection and then output the results in an HTML table using classic ASP.
JavaScript
- showModalDialog Opens a New Window on Submit or location.href
- Until recently only Internet Explorer supported displaying modal dialog boxes using the Window.showModalDialog command, but it has now become an HTML5 standard. Read on for further details!
- IE Blocks Cookies in an iFrame: IE & P3P
- IE blocks cookies from pages that are called in an iFrame. In my case this involved an ASP.NET application called from a Drupal CMS via a jQuery-based FancyBox. What's going on here? Read on to find out more!
- Referencing GridView Controls Using JavaScript
- An investigation into pairing client-side JavaScript with a Server-Side ASP.NET GridView.
- Disabling an ASP.NET ASP:Button Control with JavaScript
- An article looking into the basics of preventing multiple form submissions using client-side JavaScript to manage ASP.NET server controls such as the submit button.
- Simple JavaScript to Stop Forms Being Submitted Twice
- To prevent forms from being submitted more than once I sometimes like to add a simple JavaScript function to the Submit button that disables the button when it is clicked. Here's how...
- Enabling / Disabling Form Elements Using JavaScript
- I sometimes find the need to dynamically enable or disable form elements especially since I often use ASP.NET webforms. For this purpose I find that the default HTML attributes are not sufficient, and JavaScript is needed. This article discusses why HTML is not enough, and how to use JavaScript to disable the form elements correctly.
- How to Extend the Expanded Select List Options for Older Browsers
- Web browsers render dropdown lists in various & often inconsistent ways. IE 8 and below for example would render the width of a dropdown list as the same length as the dropdown element on the page. This would not be the best behavior if there is not enough space on the page, or the data is being retrieved dynamically. Optimally the select list should be a specified width with long data shown as cropped until the list is expanded, at which point the options should be shown full length.
This article goes into detail on how to create a cross-browser expandable select list using simple HTML and JavaScript markup. - Looking into the HTML5 Canvas Element and Cross Browser Support
- Various browsers support the HTML5 canvas element in different ways. Internet Explorer is currently late to the game and only supports HTML5's canvas element in its own unique way that can cause confusion for programmers. Read more in this article to get the scoop on what's going on!
MS SQL Server Tips
- Delete Duplicate Records Except the First Duplicate Record
- An article explaining the SQL needed to find all duplicate records in the table, but keep the first of each of the duplicate records. This type of query is not often needed, but can be quite handy to have when it is!
- How to Ad-Hoc Query an Excel Spreadsheet using OpenRowset
- Step by step overview of using MS SQL Server to query a Microsoft Excel spreadsheet.
- Query All Clustered & NonClustered Indexes
- An article explaining how to review all of the Clustered and NonClustered Indexes set up for a particular database is to query the SQL Server system tables
- How to List the Full Properties of all Linked Servers
- Using the SQL Server properties window doesn't provide enough information when one wants to review a linked server. What is the best way to see the full properties of all of the Linked Servers in SQL Server in one go? A SQL query is naturally the best way using SQL Server's system tables!
- How to Query for SQL Server Version and Server Information
- Useful to anyone looking for more information about an instance of SQL Server. There are three commands that can be used in SQL Server to query version information or information about the server hosting SQL Server. These commands can be run in SSMS directly, or can be used in code.
- Global Temporary Tables in SQL Server
- Review of SQL Server Global Temporary Tables. Global Temporary tables are similar to regular temporary tables in that they exist in tempdb and cause less locking and logging than permanent tables. To boost query performance when working with small data sets (under 1000 rows) it is advisable to use table variables rather than temporary tables since table variables run within server memory and are not created in tempdb
- When to Use the TSQL WITH NOLOCK Hint
- If the data is not mission critical and no modifications are being made to the database based on the SELECT that uses WITH (NOLOCK), then using the hint allows the query to run without having to worry about table locks. This article reviews the pros and cons of using the hint.
- Temporary Table and Table Variable Performance
- Did you know: temporary tables and table variables in SQL Server actually perform quite differently under different circumstances. More to read in this article.
- Using TRY - CATCH Blocks in SQL Server Stored Procedures
- In SQL Server 2008 Microsoft has added .NET like error handling to SQL Server by adding support for TRY - CATCH blocks. In my opionion this is a great new feature since the old @@ERROR syntax was quite unwieldy and non-intuitive.
- tSQL to Show Key Word or Phrase Frequency
- It can be useful to be able to search for the number of occurrences of a particular word or phrase within a table column... this article explains how.
- T-SQL to Return a Date as YYYY-MM-DD
- I am a fan of the yyyy-mm-dd date format for clarity and simplicity reasons. Since SQL Server defaults date outputs to the mm/dd/yyyy format, here is information on how to structure your T-SQL queries to return dates in the yyyy-mm-dd date format.
- SQL OpenRowSet Excel Query Returns Null Values
- When using SQL Server Management Studio to connect to an Excel spreadsheet you can get misleading results on mixed data-type columns. If your worksheet contains numeric as well as alphabetic data, this will confuse the driver and depending on the order of the data in your Spreadsheet, null results will be returned instead of the numeric data. A special setting is required to correct this.
- No-SQL vs Relational Databases Overview
- There is a lot of hype around No-SQL databases, even to the point where people are saying that the relational database (RDBMS) model is obsolete. I don't think this is true at all.
VSTO Programming for Outlook 2007 with Visual Studio 2010
- VSTO .NET4 Outlook 2007 Add-in: Referencing Form Regions Programmatically
- VSTO development of MS Outlook Add-in components using Visual Studio 2010. Microsoft has provided programmers with the Globals class which gives the programmer run time access to Outlook form regions and their contained controls. I think this is pretty cool!
- .NET Save Outlook Email to Database as Byte Array
- How can an Outlook.MailItem object be programmatically converted to a .MSG file and then be saved to the database?
- Outlook Custom Add-In to Archive Emails on Send Based on Keyword in Subject Line (Visual Studio 2010)
- The basics of creating an Outlook Add-in for Visual Studio 2010 that executes an action when the user clicks the Send email button.
- Outlook 2007 Image Distortion in Email
- Ever tried to set up an email marketing campaign with embedded images that keep losing resolution or changing size? Best to read this article about how to configure your images to be Outlook-friendly.
- Outlook Email Searches Broken by Indexing
- Running email searches in Outlook stops returning any results for even the simplest searches. This article looks into some of the reasons why this may happen.
- VSTO for MS Outlook 2007 - Using msocontroledit and msoControlComboBox in the Commandbars
- VSTO for MS Outlook gives programmers a powerful tool for extending the functionality of Outlook. There are some syntax quirks and strange behaviors to be mindful of. For example when adding a text box to the Outlook command bar header, Outlook will clear any text the user has entered when focus is lost from the control. This article goes into some depth on how to correct this behavior.
Information Security
- Gamigo Database Hacked & User Data Compromised
- Attacks on sites are increasing year by year. Security compromises skyrocketed in 2011 and 2012 has been a dangerous year as well. For example, the Gamigo site was compromised at the start of March 2012 and was down for several days. The attackers stole usernames and passwords along with other account data. See the article for more details.
Miscellaneous Technology Articles
- Best Ultrabook Laptops of 2012
- In this Squidoo lens I review the best ultrabook laptops available in 2012. The industry is changing all the time and lightweight and powerful mobile computing is all the rage!
About Me
Here are Other Lenses I'm Curating
New Guestbook Comments
-
-
Inthepresentation
May 18, 2012 @ 3:14 pm | delete
- Nicely presented. Because I'm not programming savvy I'm grateful that other people are so good at it.
-
-
-
goo2eyes
May 1, 2012 @ 2:41 pm | delete
- thank you for sharing this lens. very helpful for programmers. unfortunately, i am not.
-
-
-
TTMall
Mar 3, 2012 @ 11:17 am | delete
- It looks very helpful. Thank you very much!
-
-
-
Arnolda
Feb 29, 2012 @ 12:45 pm | delete
- Thanks for visiting my lens!
I really enjoyed reading this lens, very informative. I love to program too, mostly in flash.
-
-
-
jwcooney
Mar 1, 2012 @ 11:02 am | delete
- I'm glad you enjoyed my lens, it's nice to get good feedback!
I've been meaning to look into flash programming; it's a powerful and popular platform.
-
- Load More
Latest Tweets from Twitter
by jwcooney
I'm a programmer, blogger, and general tech enthusiast.
I have been programming professionally since 1997 using a number of different technologies...
more »
- 5 featured lenses
- Winner of 19 trophies!
- Top lens » Programming Tips
Explore related pages
- Mastering The Office Prank Mastering The Office Prank
- Best Gaming Chairs 2011 - 2012 Best Gaming Chairs 2011 - 2012
- Demotivators - The Opposite of Motivational Posters Demotivators - The Opposite of Motivational Posters
- Motivational Office Art Motivational Office Art
- Heavy Duty Electric Pencil Sharpener Heavy Duty Electric Pencil Sharpener
- Google APIs: Search, Map, Translate and more...keys, services, javascript examples Google APIs: Search, Map, Translate and more...keys, services, javascript examples
