Rob Chartier ~ Contemplation...

.NET, C#, Work, etc.

News

www.flickr.com
This is a Flickr badge showing public photos from Rob & Kat Chartier. Make your own badge here.


Website Counter

Even Quicker Links

Open Source Panel Discussion at DevTeach, Vancouver

--better late than never--

Back in December I participated in a recording of the .NET Rocks! Show with Carl and Richard.  The topic was a discussion panel on Open Source. 

Here is the url for the page:

http://www.dotnetrocks.com/default.aspx?showNum=296

Show #296 | 12/6/2007 (77 minutes)
Open Source Panel Discussion at DevTeach, Vancouver

Carl and Richard host a panel discussion on open source software at the DevTeach developer conference in Vancouver, BC. Panelists: Rod Paddock, Shaun Walker, Rob Chartier, and Sara Ford.

 

Timeline .NET

My latest project over on CodePlex.com is Timeline .NET. 

The Project Description…

Timeline .NET is the most complete ASP.NET WebControl which wraps the MIT Simile Timeline API.

Control such things as the data feed which can come directly from an RSS feed or add Timeline Events directly with a fully managed API. You can also control the Height and Width of the Timeline itself; the Bubble Height and Width; full control over type different bands in use (HotZone, Original, Standard) and adding any number of Zones to each band, etc...

View the samples online here.

I wanted to put together a quick article on the usage of the control and some of its options.

Usage

First off we will download the current release off of the Codeplex website, found at: http://www.codeplex.com/timelinenet/Release/ProjectReleases.aspx  Right now I have made available a direct download to the DLL alone, named “TimelineNet.dll”.

Next create a new Web Application using Visual Studio.  By the way, I’m using Visual Studio 2008 (and ASP.NET 2.0),  so the dialogs might be slightly different if you are using 2005.

In this Web Application you will need to set a reference to the TimelineNet.dll which you previously downloaded.  Right click the project in the solution explorer, and choose “Add Reference”.  Browse until you find the DLL and then hit OK.

 

The next step that you might want to do is add it to the Toolbox in VS.NET.  To do this right click the Toolbox and first add a new tab called “Timeline”.  In that tab right click and choose “Choose Items”.  Again browse for the TimelineNet.dll.  You should now see the Timeline control in the Toolbox.

 

Drag the Timeline control onto the page and lets add in a few basic properties:

        <cc1:Timeline        DataSourceType="rss"        DataUrl="http://weblogs.asp.net/rchartier/rss.aspx"        Height="300"        Width="100%"        ID="Timeline1" runat="server" />

Notice that we are instructing the control to grab the RSS feed from my weblog.  This will instruct the Ajax Handler (which we will get to in 2 seconds) to yank the RSS feed content and use it as the datasource for the events which will be rendered in the Timeline.

Now in order to actually load data into the timeline, the DLL contains a http module which we need to register in the web.config file.  In your web.config file, find the <system.web> section and add:

    <httpHandlers>      <add verb="*" path="*.ashx" type="TimelineNet.TimelineAjaxHandler, TimelineNet" />

    </httpHandlers>

Once you have completed that, all you need now is to hit F5 and give the control a test.  (If you get a dialog about modifying the web.config to enable debugging, just hit ok).

You should see something similar to:

 

A very basic timeline rendering events from the RSS feed you supplied.

Additional Usage

Once you managed to get the basic timeline rendering you will want to start to tweak the control.  Here is the current complete list of properties available:

Property

Description
JSName The name of the variable in javascript to represent our timeline. This should be set to a unique value per instance
LabelWidth The width of the label
BubbleWidth The typical width of the bubble
BubbleHeight The typical height of the bubble
ParentElementID The client side element to render the timeline into
LocalTimelineJSFolder If you set the ScriptSourceLocation variable to local, you can set the root path to the timeline folder. Typically this will be the relative path from the root of the current applicaiton which contains the timeline-api.js file
ScriptSourceLocation Allows you to choose remote vs local script source/ Remote location defaults to: http://simile.mit.edu/timeline/api/timeline-api.js
TimelineData The root of our data source to add events to. This is your starting point for adding data.
Theme The theme which will be used to render the timeline. Default is the ClassicTheme
EnableSearchAndFilter Allows you to control the Search and Filter controls. Note: If this is enabled it will force the script source location to remote
DataSourceType The type of data source.
Bands A list of the bands to render. This is your starting point for adding bands of different types and time ranges. A zone is added to the specific band itself.
DataUrl If you are using a remote or local data source (other than named) you must provide the URL to the resource to load
SearchAndFilterTag The client side DOM element which to render the Search and Filter elements
 

The two key properties to notice are “TimelineData” and “Bands”.

 Custom Timeline – HotZone

If you need to manipulate the basic bands in use, here is an example:

protected void Page_Load(object sender, EventArgs e) {        if(!Page.IsPostBack) {            TimelineNet.Library.Zone dayZone = new TimelineNet.Library.Zone(DateTime.Now.AddDays(-2), DateTime.Now, 10, TimelineNet.Library.Enums.TimelineDateTime.HOUR);             HotZoneBand YEAR = new HotZoneBand(10, Enums.TimelineDateTime.YEAR, 100);            HotZoneBand MONTH = new HotZoneBand(10, Enums.TimelineDateTime.MONTH, 100);            HotZoneBand DAY = new HotZoneBand(80, Enums.TimelineDateTime.DAY, 100);             YEAR.Overview = true;            MONTH.Overview = true;            YEAR.TrackGap = new decimal(0.5);            MONTH.TrackGap = new decimal(0.5);             MONTH.SynchWith = 0;            YEAR.SynchWith = 0;            this.Timeline1.Bands.Add(DAY);            this.Timeline1.Bands.Add(MONTH);            this.Timeline1.Bands.Add(YEAR);             DAY.Zones.Add(dayZone);         } 

Here we are adding a year, month and day band.  In the Day band we are adding a HotZone broken down by hour, this will have the effect of:

Notice that the top band breaks down to hour increments on the right side, a HotZone.

 Custom Timeline – Named Events

Update the aspx file to simply be:

        <cc1:Timeline                Height="300"  Width="100%"               ID="Timeline1" runat="server" /> 

And then in the code behind we can do something like:

         protected void Page_Load(object sender, EventArgs e) {            if(!Page.IsPostBack) {                Timeline1.DataSourceType = TimelineNet.DataSourceTypes.named;                Timeline1.TimelineData = new TimelineData();                Timeline1.TimelineData.Add(new Event(DateTime.Now.AddDays(-5), DateTime.Now.AddDays(-1), false, "Hello World", null, "This is a sample event", null));                Timeline1.TimelineData.Add(new Event(DateTime.Now.AddDays(-1), DateTime.Now.AddDays(3), false, "Goodbye World", null, "This is another sample event", null));             }        } 

We change the DataSourceType to be a named data source, which means that we are going to rely on the fact that the Event Data will come directly and not automatically derived from an XML document or RSS feed.  The next few lines above initialize the TimelineData object and then create two simple events.  This will render as:

 Whats left? A few of the bits that are still remaining to discuss include:1.      I added a non-standard “GroupedEvent”.  Which has the additional property of “GroupName”.  This allows for a visual grouping by text color of the events in the timeline.2.      Search and Filter controls can be turned on and off via the “EnableSearchAndFilter” property.  Be sure to also set the “SearchAndFilterTag” property, which should be the name of a HTML DOM element on the page, which the Search and Filter controls will be rendered out to. 

 

IE7 : This page contains both secure and nonsecure items

I just spent about 4 hours trying to solve this really annoying error which only exists in Internet Explorer 7 (IE7) over a Secure (SSL) page.  I just stumbled upon the solution and it was just so damn obscure I felt I had better write it down or it will be forever lost in the bit-bucket that I call my brain.

Although my issue was related to using MIT’s Simile Timeline control it is not limited to that in any way (here is the URL to the defect).

 

So here is the error in question:

 

When prompted with this, as a veteran in the web world, I first turn to standard proxy tools, like Fiddler.  I look for the big gotchas where a HTTP request simple doesn’t go over HTTPS.  Another is if any requests are throwing back a 404 (document not found).  When that does help, next I common the IIS Log files, and see if anything is not going over port 443.  Simply fix anything that behaves badly and re-test.

When that does not fix the issue, what’s next?  Well next you need to dig into iframes.  If you have any iframes in your output (dynamic via Javascript/DOM or static on the page) be sure to specify the src attribute, and not just any src attribute will do.  Options include “#”, or “javascript:void(0);” or even "javascript:'<html></html>';".    Play with these and other which Google will turn up and decide which is your best option.

My next inclination was to do a deep dive into the Javascript world and start debugging the crap out of things.  This really did not bear much fruit at all.  It was actually quite frustrating.  –Try to avoid this as much as possible, but if you do make use of both the alert(‘’); and debugger; calls.

Now when that does not bear any fruit it’s time to really dig deep.  I found out that when you are manipulating a DOM element (lets say creating a DIV tag), and are setting its style.background property to a incomplete url, for example:

div.style.background="url(/images/message-top-left.png) ";

It seems that IE7 (and only IE7) will make this request over 443, but treat the data as one of these pesky “nonsecure items”.

So, the work-around which I implemented was to specify the FULL url like:

div.style.background="url(“+prefix+“/images/message-top-left.png) ";

Where “prefix” is something along the lines of:

prefix = document.location.protocol + "//" + document.location.hostname;

 

Finally, if that is a dead end as well, consider the idea of cutting the feature out of the next release!

 

References, more help:

http://friedcellcollective.net/outbreak/2006/06/09/this-page-contains-both-secure-and-nonsecure-items/

http://support.microsoft.com/kb/925014

 

 

Smartphone.Enabled();

I have finally decided to upgrade from your average Joe cell phone to a Windows Mobile 6 enabled Smartphone (not a touch screen device).  I got myself a HTC Shadow via Ebay.  Its branded to T-Mobile but unlocked so I can use it up here in Canada.

I must admit Microsoft has done a real nice job on the software for these devices.  The Windows CE OS/Windows Mobile 6 feature set is rich and useful. 

Since I live, eat and breath Microsoft .NET the fact that I can write up a bit of code and deploy it to my device (or emulator) in seconds is just fantastic.  The last time I was involved with writing anything for mobile was for the JVM world, and it was a less than stellar experience.  Kudos goes out to the VS.NET IDE, and Mobility teams at Microsoft for making this extremely painless.

One thing that the HTC Shadow came with is the Neo Interface (look at some of the Videos on it on youtube or something).  This interface has very polished feel and is quite usable.  I did some hacking around and most if not all of the settings exist in the registry.  After a few quick hacks I found out how to easily manipulate the Neo UI items.  Most of the leaf nodes just call out to executables.

What I really wanted to add was a shortcut to dial my voice mail and automatically punch in my access code (yes, I know this is not very secure).  For the life of me I couldn’t find any executable on the device that you can add some command line arguments and it will place the call.  Google offered little or no help tracking down the right executable to use.  The fact that this doesn’t exist gave me my first useful WM6 code snippet.

Code Snippet – cDialer.exe

using Microsoft.WindowsMobile.Telephony; namespace cDialer {    
  class Program  {       
    static void Main(string[] args)
{
            if(args == null || args.Length <= 0) return;
            string number = args[0];
            string prompt = "true";
            if(args.Length>1) prompt = args[1];
            bool p = true;
            try { p = bool.Parse(prompt); } catch(System.Exception) { }
            Phone phone = new Phone();
            phone.Talk(number, p);
        }
    }
} 

This is compiled for Windows Mobile 6 Standard SDK as a Console Application and placed into the \Windows\  folder.

So, in the entry for the menu item all I need to do is specify something like:

\windows\cDialer.exe; 6045555555p123456789#p1

The “p” instruct the dialer to wait a second or two.

You can also create a file:  CallVoiceMail.lnk with the contents:

110#"\windows\cDialer.exe" "6045555555p123456789#p1" "true"

The 110 indicates the number of characters after the # mark and the rest should be obvious.

 
My advice to you for new years...

Since I have a bit of free time this afternoon I decided to get a few more blog posts out of the way (scroll down, this will be my third in the last hour or so).  Anyways, I just got off a MSN conversation with another MVP which lives in the south (Dallas?).  First off he wanted to wish me a Happy Ho Ho, and then he started in with the questions about why I have been so quiet this past year.

So what have I been up to? 

My biggest adventure, if you can call it that, is my current employment situation, its a startup which is focusing on a Cancer Survivorship solution for the US Healthcare Market. [some info here].  This year we had a very successful ramp up of the core business and although it was super busy around here I cant help but feel that this is really the calm before the storm.  The deals that are being inked in the last few months (which I will post on soon enough) will ultimately change the face of people surviving with cancer in the long term, and to tell you the truth it is the most fulfilling position in any organization I have ever had.  Over the course of my career I have never had the opportunity to work with such high caliber people for a cause such as this.  It really makes all the hard work worth it.

Another big change in my life is my health.  For all of you that I have had the opportunity to meet you will notice that I'm not exactly a person of good health.  I have always been careless and it shows.  Well, with lots of help (and patience) from my wife, Katerina, I have begun a long and exhaustive change for the better.  To date (in the last 3 to 6 months) I have managed to shave off about 30 pounds, and that is just for starters.  Its quite difficult for me to actually articulate how much work has gone into acheiving this and I can barely imagine how much more work that I will need to put in for me to reach my ultimate goal (to get rid of another 50lbs!!).

My new years advice to those that have read this far is that if you are in a position in life which you do not like; your job sucks; your health is in question; or whatever your issues are simply STOP what you are doing; go no further.  Face it, what you are doing right now just is not working.  Plan out a new approach, get some advice from your trusted circle of friends and family and make the change.  Whatever that change is it is probably better than wasting away being miserable for the rest of your life.

Posted: Dec 20 2007, 04:45 PM by Rob Chartier | with no comments
Filed under: ,
Microsoft IT Pro and Developer Community in Vancouver

Recently, I have been receiving more and more emails asking about the local Microsoft community scene.  I noticed more people emailing me directly so I just decided to post up an item to quickly cover it.

Essentially, there are a few key groups that you need to know about:

1. .NET
Name: .netBC Users Group
URL: http://netbc.ca/
Contact: Medhat Elmasry

2. Sql Server
Name:VanPASS (Vancouver PASS Chapter)  (PASS == Professional Association for Sql Server)
URL: http://www.vanpass.com/
Contact: Scott Stauffer or Richard Baumet

3. IT Pro (General)
Name: VanTug  (which is now free!)
URL: http://www.vantug.com/
Contact: Graham Jones

 4. Small Business Server
Name: Vancouver Small Business Server User Group
URL: http://www.vansbs.com/
Contact: Jasminder Rai
 
Aside from User Groups there are of course two major events which are typically planned either once a year or every 18 months.  The first is the big event which I personally put on:

5. Vancouver Technology Festival
URL: http://www.vancouvertechfest.ca
Contact: Rob Chartier
Schedule: About once a year

And finally JR from DevTeach has decided to bring his event to Vancouver as well:

URL: http://www.devteach.com
Contact: Jean-Rene Roy
Schedule: About every 18 months


If you feel your group or event should be on this list, let me know!



 

Topic: JavaScript essentials for the ASP.NET Developer

 I recently gave a presentation @ the local user group ( .NET BC users group http://www.netbc.ca) on Javascript essentials for the ASP.NET Developer. 

 I would like to thank Medhat Elmasry for the opportunity to speak to his fine group.

----

Here are the event details:

Date & Time: Wednesday, 2007/12/05, 6:30 PM [Welcome Time: 6:00 PM]
 
Location: Room 282/284, BCIT Downtown Campus, 555 Seymour Street, Vancouver, British Columbia, V6B 3H6 , Canada


Topic: JavaScript essentials for the ASP.NET Developer

Not many people have ever really given JavaScript its full and due attention. Do you realize that you can do full Object Orientated Programming with JavaScript, within most browsers? There is more to it than “Ajax”! Did you know that it uses a “prototype-based” style as opposed to classical inheritance? Come and watch Rob Chartier, one of the few local Microsoft MVP’s, give a presentation on how to leverage JavaScript in your ASP.NET Applications today!

Speaker:
Rob Chartier,
Director, Software Development

http://netbc.ca/DNCal/EventDetail.aspx?date=2007/12/05

 

For those that attended you can download the slide deck here:

Javascript-Rob.Chartier.zip

 

Adobe : Stop trying to sell me Google's garbage

Just a small, quick rant I needed to get off of my chest....

IMHO Adobe should focus on keeping their Flash Player dominant the market (ahead of Silverlight) instead of making lame deals to distribute the Google Toolbar bundled with their products. 

 Now back to your regular scheduled programming...

 

Your 2003 Server has been rebooted...

 

For some reason 4 out of the 5 Windows Server x64 SKU's we have running in our office decided to reboot last night.  I checked the one that did not, and it had issues downloading the updates (thats a seperate issue).  Of the 4 that did reboot, I checked Automatic Updates and it appears that *somehow* they are all now set to download and install updates automatically.  Now, as most of us know you should set this to never install updates blindy on production machines.  Its always good to stage/test any new software installed into production, including service packs and Windows updates.  I double checked with my IT guy and he defintely remembers changing that setting during intial install (its part of our standard checklist).   

 

 This happened at 3am:

 Restart Required: To complete the installation of the following updates, the computer will be restarted within 5 minutes:
- Security Update for Windows Server 2003 x64 Edition (KB944653)
- Update for Windows Server 2003 x64 Edition (KB942763)
- Security Update for Windows Server 2003 x64 Edition (KB941569)
- Update for Outlook Junk Email Filter 2007 (KB943597)
- Windows Malicious Software Removal Tool x64 - December 2007 (KB890830)
- Cumulative Security Update for Internet Explorer 7 for Windows Server 2003 x64 Edition (KB942615)
- Security Update for Windows Server 2003 x64 Edition (KB941568)

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

 

Restart required?  And it actually forced it?  Wow....   Anyone else notice this?

 

This just feels dirty to me...

 

Posted: Dec 12 2007, 09:28 AM by Rob Chartier | with 8 comment(s) |
Filed under: , ,
Terminals 1.6c has been released

 

I decided to push out another release of Terminals.  This 1.6c release includes many bug fix's since the last release, plus a whole bunch of common networking tools:

  1. Ping
  2. Trace Route
  3. WMI Explorer
  4. TCP Connections
  5. Network Interfaces
  6. Whois
  7. DNS Lookups
  8. CPU History Graph
  9. Shares List
  10. Time Syncronization
  11. Servers List

The two most significant bugs that I can recall off the top of my head include hitting the Cancel button when the tool asks for the Master allows the application to launch, but all passwords are not useable, and the Telnet and SSH connections did not work.  Both of these have been fixed.

Download here

 

More Posts Next page »