Saturday, February 23, 2019

Estimating Software Development Costs

Estimating Software Development Costs for a Patient Multimedia Education Project

Validating date formats

Using one of the built-in validator controls allow you to easily validate date formats for user inputs.

The CompareValidator has a DataTypeCheck operator that simply validates the format according to datatype... The caveat however is that if presentation format differs from input format, it will always give out errors on redisplaying the page, i.e. for dates, you must display dates in the standard numerical formats as opposed to ...

Monday, January 05, 2015

C# and Javascript events

I tend to be creative when it comes to using the standard provided C# validation controls but there are cases where Javascript validation comes in handy. One of them is restricting the length of a textarea "control" or rather a Multiline Textbox.
After some trial and errors, as well as trying out some ideas found on the web, here's what I found to work best.
Define a Javascript function (directly in your .aspx page or as a linked Javascript file) as follows:
function checkSize(oSrc, maxLen){
if (oSrc.value.length > maxLen)
{
        alert ("Your comments should have a maximum of " + maxLen + " characters long.");
        oSrc.value = oSrc.value.substring(0, maxLen);
        oSrc.focus();
        return false;
}
On the control itself, there is nothing to do. However, to make the function fire up, you need to add the following code in the codebehind, in a section that will be called before the object is rendered*:
wObjectName.Attributes.Add("onkeyup", "checkSize(this, 255);");
* For DataGrid controls and the like, you need to issue a FindControl("wObjectName") before you can add attributes so you may need to do this in an onCreate method.Hope it helps someone.

Viewing SQL Binary Data

A simple post-it note to remember how to view binary data...
SELECT     CAST(CONVERT(varbinary(MAX), ColName) AS xml) AS ColName
FROM         dbo.TableName
WHERE     ([where clause])

Conditional formatting when comparing cells in Excel

I'm sure there are easier ways than this but I wanted to get a visual of the differences between two tables after conversion.
Description
Table A was an Access 97 table that had been converted to SQL 2008 by our vendor. This was not a straight up conversion but rather some massaging of the data had to occur so we needed to find out the differences.
Table B of course was created in SQL.
I exported both tables to Excel and rather than putting them in separate sheets, I pasted them both on the same one (personal preference for this task).
Solution
Select column A.
Select Conditional Formatting | Highlight Cells Rules | More Rules.
On the lower portion of the dialogue, change "Greater than to" the operator you're looking for. In my case I wanted to highlight cells that were different so I chose "Not equal to".
In the formula box, I clicked the picker and clicked on the first cell of the compare to column (column DA) and came back to the dialogue.
The formula now looks like "=$DA$1".
Remove the fixed row indicator so that you get "=$DA1".
Set the formatting and click OK.

Where are My Links in SharePoint 2007

Following a hardware migration, I was able to get the My Site and personal sites working but as stated here (http://msmvps.com/blogs/shane/archive/2007/11/21/finding-my-links-in-the-database.aspx), the My Links are actually part of the SSP (or User Profile Service), thus not easily retrievable.
As mentionned in the above article, editing the SharePoint databases is not supported. However, I had to find a way to get my users' links back in there.
      1. So I copied the [NewSSP].dbo.QuickLinksAdd stored procedure to a personal "toolbox" database on the server.
      2. I modified this "local" storedproc to fetch the user's RecordId and force the policy number to a fixed value.So basically, the start of the stored proc goes like this:
        ALTER PROCEDURE [dbo].[QuickLinksAdd]
        --@RecordId bigint,
        @NTName nvarchar(400),
        @PageURL nvarchar(1250),
        @Title nvarchar(500),
        @ContentClass nvarchar(200) = null,
        @Group nvarchar(400) = '',
        @GroupType int = 2,
        @ItemSecurity int = 1,
        @PolicyId uniqueidentifier = '861D8FB6-7012-4CD9-A7A0-A615AED038B3',   --may be relative to our implementation
        @ColleagueRecordId bigint = null,
        @LinkUserIdIsWorkgroup bit = null,
        @LinkMemberGroupId bigint = null
        
        AS
        SET NOCOUNT ON
        DECLARE @RecordId bigint, 
        @ProfileObjectType int,
        @LinkId bigint
        
        -- Constants (used for events)
        DECLARE @ProfileChangeType_Add int
        SET @ProfileChangeType_Add = 1
        
        -- CHECK FOR CURRENT USER
        SELECT @RecordId = [RecordID] FROM [NewSSP].[dbo].[UserProfile_Full] WHERE NTName = @NTName
        IF (@@ERROR <> 0 )
          RETURN -1
        ...
        Followed by the rest of the stored proc, adding the database name where other stored procs are called.
      3. After testing one, I ran a loop on the data from the original SSP database.

Copy a PivotTable as values with formatting

After following instructions from http://excelusergroup.org/forums/t/760.aspx, I was still not able to copy the values and formatting without getting an error about the data not being found.
So I started fiddling around with the pasting options.
The trick is rather than selecting the page that contains the pivot table, you MUST select the pivot table itself by clicking any cell inside the table, from the PivotTable Tools /Options ribbon, select the entire PivotTable.
Go to a blank sheet (or workbook for that matter), click the starting cell then from the Home ribbon, select Paste / Values. Then, while the new area is still selected, select Paste / Formatting.
Voilà!
Hope this helps someone.

SharePoint branding

Why use a solution to package your branding

http://www.sharepointcat.com/2011/08/every-problem-has-a-solution-even-sharepoint-branding/
Wireframes
SharePoint Visio Stencils

Links to SSRS Information

Customising the Office Ribbon

Customizing the Office 2007 user interface
This is an article about two nifty tools to easily customize Word's ribbon and toggle between Word 2003 and 2007 toolbars.
Update 2010-10-25: That seems to become mute now with Office 2010.

Visual Studio website vs web application

Visual Studio website vs. web application

2014
January
31
Earlier this year (2008) I decided to switch my web apps in favour of websites in Visual Studio 2005. To my surprise, the website mode does not generate XML documentation. So I am switching my projects back to web apps with the help of instructions on this site: http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx
2009-04-07: Must add this: web apps has the added benefit of allowing debugging through F5… running on a virtual port. It’s a bit of a drag compared to having your browser open to your app at all times and simply refreshing but the benefits far outweigh this caveat.

Friday, February 15, 2013

SharePoint Cookbook: How to get the %20 out

SharePoint Cookbook: How to get the %20 out

You can't get rid of them without recreating the colums without the spaces, however, she gives a good explanation of their presence.

When we migrated to 2010, I ensured that all columns were recreated without spaces, then while migrating files, we remapped old columns to new ones.

Monday, July 28, 2008

SqlDataSource ConnectionString Dumb Issue

Today I resolved an odd issue I was having with a specific page in a web application I developed.
Although the error message seemed to point to a Named Pipe configuration issue with the remote SQL Server, I just could not get my mind around this one until duh! the connection string for the Page SqlDataSource was different from my dynamic connection strings.

Essentially, I've been using dynamic connection strings for ages. Something I developped a few years back that allows be to store all my SQL server connection strings in my web.config file and the application picks the one that is relevant depending which environment (Local, Dev, Staging or Prod) the web browser is calling.

Now, since the advent of GridViews and the likes, I started developping sections of pages using SqlDataSources... obviously pointing to my local SQL server.

Since the server does exist, I can't really think of a smart error handling routine so as part of my InitPage() method, I reset the SqlDataSource.ConnectionString to the value for my dynamic strings and voilà. Simple solution to a rather obscure simple problem.

Tuesday, February 12, 2008

Using AD Custom Attributes to Extend User Profiles

I wanted to find a way to have user pictures show up automatically in Users' Profiles without having them to individually upload their personal picture or corporate mug shot.
We essentially had a couple of options:
- Storing the pictures in our CRM application
- Storing the pictures in our HR Management application
- Pointing to a picture repository in AD.

One more thing, once rolled-out this had to be maintainable by HR and the users themselves.

After doing a bit of research, our CRM application did not provide for a picture storage or mapping funtionality. We could customize it but...
Our CRM application publishes employees information back to the HR Management application...
Our HR Management application caches the pictures locally into the logged on user's cache (the HR person's cache), so not good.
Now, Sharepoint imports User Profiles from AD, so this seemed like the best option. So how do we go about it?

I found these 2 excellent blog posts that got me going:
http://blog.henryong.com/2007/02/21/importing-user-pictures-from-active-directory-to-moss-2007/
and
http://paulhorsfall.co.uk/archive/2007/07/13/Unable-to-Configure-MOSS-Property-Import-Mappings.aspx

Now that I had the means, our corporate policy does not allow administrators to edit custom attributes. I'm still working on getting access so I'll be back to update...

Thursday, December 22, 2005

Wednesday, May 11, 2005

Wi-Fi Wireless Internet Access

Satellite Networking

Tuesday, May 10, 2005

Mini-Entrepôts

Déménagement La Capitale 5 x 10: 65$/mois
Location de mini-entrepôts Locaccès Blainville entreposage 5 x 10: 85$/28 jrs
GoCube.com Cube de 5 x 8 x 7.3: 89$/mois mais ils font la livraison et la cueillette du cube.

Motion Sickness



McGill Health Sciences department is conducting a study on motion sickness for the aerospace industry and I'll be participating. I had my first session May 9th, didn't get sick. Not that I won't with future exercises but this one didn't quite work. Just a slight discomfort and disorientation.

Medication: dimenhudrinate, scopolamine

Megaproxy - free anonymous web surfing

When behind a firewall, or when the site you want to visit is proxied, you can use Megaproxy to perform basic tasks. The free service does not allow you to login anywhere, submit forms, or surf non-standard HTTP ports.

Thursday, May 05, 2005

VoIP

  • Voxilla :: Broadvoice Takes The "Limits" Off "Unlimited"

  • http://www.broadvoice.com/rateplans_byod.html
  • Tuesday, May 03, 2005

    Monday, May 02, 2005

    ASP.net

    Reflection IT Home

    Quote

    "Years from now you will be more dissappointed by the things you didn't do than by the ones you did do. So throw off the bow lines, sail away from the safe harbor catch the trade winds in your sails... explore... dream... discover."
    Mark Twain