Archive for July, 2009

Free eBook – Developer-Evangelism.com

My first job at Microsoft was as a developer evangelist.

The company I ran before I came to Microsoft did a great deal of “technical evangelism” for ASP, Java, Flash, and others.

And many of the folks who read my blog are “Technical Evangelists”, either as part of their job, or in their work with their developer community of choice.

So – I wanted to share this super (and free) eBook.

http://developer-evangelism.com/

I love the part on “Remove the Brand”.

Hope you enjoy it !

 

Whitepaper – Social Networking and Security

Brad Dinerman (who worked for me for a while in the 1990s) recently published an interesting paper on security issues with regards to Social Networking.

I’d like to share it.

http://www.fieldbrook.net/TechTips/Security/SocialNetworking.asp

Linus Torvalds: Microsoft Hatred is a Disease

I’ve been doing “Open Source” stuff for a decade, but I work at Microsoft (They don’t call me Misfit for nothing.)

There are a few folks in the so called Open Source Community that viscerally HATE Microsoft. Personally I consider this a chosen form of stupidity.

I love working at Microsoft and I love many of our products, and I dislike some of the others.

I love and use many non-Microsoft products, and hate others.

But I do so based on the products attributes.

Lest we forget what the original Open Source thing was all about,

Linux Magazine reports on some interesting Linus Torvalds comments…

I’m a big believer in “technology over politics”. I don’t care who it comes from, as long as there are solid reasons for the code, and as long as we don’t have to worry about licensing etc issues.

I may make jokes about Microsoft at times, but at the same time, I think the Microsoft hatred is a disease. I believe in open development, and that very much involves not just making the source open, but also not shutting other people and companies out.

There are ‘extremists’ in the free software world, but that’s one major reason why I don’t call what I do ‘free software’ any more. I don’t want to be associated with the people for whom it’s about exclusion and hatred.”

There is not a single word here that I can disagree with. While I think it’s perfectly acceptable to for the Free and open source community to be a little more vigilant when it comes to Microsoft’s forays into this world, the outright blind hatred is nothing but a detrimental force that holds the Free and open source community back.

…and

I agree that it’s driven by selfish reasons, but that’s how all open source code gets written! We all “scratch our own itches”. It’s why I started Linux, it’s why I started git, and it’s why I am still involved. It’s the reason for everybody to end up in open source, to some degree.

So complaining about the fact that Microsoft picked a selfish area to work on is just silly. Of course they picked an area that helps them. That’s the point of open source – the ability to make the code better for your particular needs, whoever the ‘your’ in question happens to be.

Does anybody complain when hardware companies write drivers for the hardware they produce? No. That would be crazy. Does anybody complain when IBM funds all the POWER development, and works on enterprise features because they sell into the enterprise? No. That would be insane.

So the people who complain about Microsoft writing drivers for their own virtualization model should take a long look in the mirror and ask themselves why they are being so hypocritical.

It’s always refreshing to hear someone level-headed discuss issues like this. I guess this is also the reason why, after so many years, Linus is still the undisputed benevolent dictator of

More questions on Professional Development Reading Habits

Vaibhav emailed me yesterday with some questions about [ this blog post. ]

In truth, I have slowed my technical reading since having children in preference to non-technical books, but I’ve been getting back to Tech Books recently as I have some “catching up” to do.

I’ve had hundreds of email about this blog post so I though (with Vaibhav’s permission) I’d answer his questions “out loud” sort of speak.

I’ve been thrilled by the response and enthusiasm about “reading” technical books.

One thing that makes our profession unique is that the problems that we solve, the tools that we use, and the nature of the solutions that we provide are ALL constantly changing.

“New learning” is in integral part of being (and staying) successful in Software Development.

Here is Vaibhav ‘s email …..

Hi Joe

How are you doing? Many thanks for the many inspirational articles on your website (www.misfitgeek.com).

A big ‘thank you’ especially for the blog post – “I’m asked, how did you learn what you know ?”. I am quite sure that this article will be like a ray of light in the tunnel of darkness for those who would like to follow in your foot steps and be as technical competent as you are.

Joe, in this article you mention the following:-

<QUOTE>

For much of my your career I made myself read at least one technical book per week (if I finished early I would start another or read a business or personal development book.

</QUOTE>

Joe, can you provide some insights or tips on how are you able to finish a technical book in one week. It would be really helpful if you can answer the following questions:-

  1. What is the average time do you spent on a technical book, say, consisting of 500 pages or so?
  2. How much hours at the minimum do you devote to reading the technical book?
  3. Do you type in the code samples given in the book or you download the code from the associated website and execute the code?

No matter how hard I try, it takes me ever and ever to finish reading a technical book. The actions which are responsible for making my technical book reading this longer are as under:-

  1. I have a habit of underlining/highlighting the text in the book, which I feel is either important or is a good candidate for reference.
  2. I do practice the code samples given in the book, by typing the code by hand. Somehow I believe, I know this might sound stupid, that by typing the code, I am actually reinforcing the concepts in my brain.

Please advise if you follow any patterns or something to finish your technical reading faster.

Kind regards

Vaibhav Sharma

My answers……

1.) What is the average time do you spent on a technical book, say, consisting of 500 pages or so?

It’s impossible to say. 8 hours ? 100 Hours ? Some books are easy to read, others can be hard (becuase they’re poorly written, or because they are simply PACKED with data to be assimilated.

There are a couple of things that I do to try to “keep the rhythm”.

  1. I never EVER fail to finish a book. If I finish the first chapter, I commit to real the whole thing. There are acceptations for truly terrible books or books that I find to contain more than a little incorrect information, but this is my rule for ALL books (technical and other).
  2. Choose Titles Carefully. Sometimes I think authors are paid by the page. More pages doesn’t NOT necessarily mean more INFORMATION.
  3. Alternate. I’m between HARD books, read easy ones. After a 900 page book, read a 180 page book (or 2).
  4. Read EVERY NIGHT. Even if it’s only a few pages, build the habit.
  5. I always have 2 or 3 books going at any time. 1 Technical, 1 Fiction, and 1 Non-Fiction. Each night I read some of the Technical book FIRST !  Tech books require more brain power so I read some of a Tech book first. As I get more tired I switch to a pleasure book that has less need for detailed retention.
  6. Kindle – I still read Tech books on Paper but I do other reading on the Kindle as much as I can. It’s instant on and I can add to my daily reading time by getting in 15 minutes waiting for the kids, etc.
  7. Buy Fiction as Audio Books – I can listen at night long after my eyes get too tired to read. There are TONS and TONS of books on CD or downloadable as MP3. I can also listenwhile I mow the lawn, work around the house, etc.

2.) How much hours at the minimum do you devote to reading the technical book?

I don’t set a fixed number of hours per week.  But if my week lacks progress, then the following week I will “MAKE UP” time in the following week. (Reading at night and large energy drinks go very well together. :) )

3.) Do you type in the code samples given in the book or you download the code from the associated website and execute the code?

NO ! – Not the first time I read a book. For me, continuity improves my learning experience so I head the book cover to cover 1st and then I might play with the samples. (This might also be why yo have trouble finishing many of the books that you start.)

4.) I have a habit of underlining/highlighting the text in the book, which I feel is either important or is a good candidate for reference.

I used to do this in every non-fiction book that I read. Now I almost never do. I’ll only highlight something because I need to go back to it later and I want it to be easy to find later.

5.) I do practice the code samples given in the book, by typing the code by hand. Somehow I believe, I know this might sound stupid, that by typing the code, I am actually reinforcing the concepts in my brain.

For me, I don’t need to enter the code to commit the concept to memory. I will almost never take the time to hand enter a book’s source samples, but I will often download the code when it’s available. Most often, I do this so that I can try variations on the original code.

The Microsoft Live Services Plug-in for Moodle

clip_image001

I thought this was cool – a new way to integrate Live@edu into a Moodle virtual learning environment!

This plug-in is a free download that provides integrated access to Live@edu services such as e-mail, calendar, instant messaging and search within the Moodle environment.

http://blogs.msdn.com/ukliveatedu/archive/2009/07/22/hello-moodle.aspx

Technorati Tags: ,

The patterns & practices team plans to create some new Web guidance and we need your help prioritizing the requirements through a survey that just went live.

They have split the effort into 2 projects.

The first project will be to update the Web Client Software Factory (WCSF) to run on Visual Studio 2010.

The second project will take a fresh look at creating new Web Guidance.

Your feedback from the survey will help define the scope for this second project.

So, go take the survey and let us know your priorities.

[ CLICK HERE TO TAKE THE SURVEY ]

Application Request Routing (ARR) Version 2 for IIS7 Beta 2 released.

Microsoft Application Request Routing (ARR) for IIS 7.0 is a proxy-based routing module that forwards HTTP requests to application servers based on HTTP headers, server variables, and load balance algorithms.  

ARR Version 2 Beta 2 is an incremental release that includes all of the features from Version 1, and adds support for disk-based cache. More specifically, this feature allows IIS to compete as a cache proxy in a whole new market place:

Download ARRv2 beta 2 from:

· Microsoft Application Request Routing Version 2 for IIS7 Beta 2 (x86)

· Microsoft Application Request Routing Version 2 for IIS7 Beta 2 (x64)

What’s new in ARRv2 beta 2:

  • Disk-based caching (Improved in Beta 2)
    In addition to the kernel memory cache in ARR Version 1, Version 2 Beta 2 adds support for disk-based cache.  This feature is improved in Beta 2 with an introduction to secondary cache concept.
  • Cache hierarchy management
    Define and manage relationships between cache nodes, including support for the Cache Array Routing Protocol (CARP).  
  • Cache proxy node in CDN/ECN environment   (Improved in Beta 2)
    Because ARR is a proxy-based HTTP request routing module with support for disk cache and CARP, ARR can be used as a cache proxy in a CDN/ECN environment. This feature is improved in Beta 2 with support for more advanced routing rules, such as being able to set host headers to route requests accordingly.
  • Caching compressed objects
    Disk-based cache stores compressed objects so that the objects do not have to be compressed in real time for every request.  
  • Browse cached contents using IIS manager (New in Beta 2)
    Browse through cached contents across multiple drives in one consolidated graphical view in IIS manager.
  • Intelligent live request support (New in Beta 2)
    ARR is designed to work with Live Smooth Streaming to support live content requests without over-loading the live streaming server.
  • Caching while serving response
    Caching large content, such as a movie clip, may take some time. ARR Version 2 Beta 2 is capable of caching the content while serving the response immediately.

Support:

· Support for the beta release is available only on the forum.

Adding Persistence to the .NETOOP Edit in Place control.

I’ve added persistence to the “In-Place-Editor” control at .NETOOP  using SQLExpress and the LINQ to Entities.

Since the Control itself can be used for ANY text content, the page that contains the control is responsible for population and persistence.

Note the code below. The control is populated by the first notice in the notices table (other use may use multiple records.)

Of particular interest is the push back to the database.

Note that this code is called from the Page_SaveStateComplete event handler.


NETOOP_DataEntities ctx = new NETOOP_DataEntities();
protected void Page_Load(object sender, EventArgs e)
{
// Populate the In-Place Editor Control
var result = ctx.NETOOP_AnnouncementSet.Where(p => p.Id == 1);
if (!IsPostBack)
{
NETOOPNoticeEditor.Content = result.First().ContentText;
}
}
 
protected void Page_SaveStateComplete(object sender, EventArgs e)
{
// Push Edited Changes back to the database. 
// This can NOT be done in the Page_Load event becuase the 
// "DataDirty" flag gets set in a control event which doesn't
// fire until after Page_Load
if (NETOOPNoticeEditor.ContentIsDirty)
{
var result = ctx.NETOOP_AnnouncementSet.Where(p => p.Id == 1);
result.First().ContentText = NETOOPNoticeEditor.Content;
ctx.SaveChanges();
}
}

It needs to be done here because the dirty content flag is set in the Editor Control’s “ContentChanged” event handler.


protected void ContentEditor_ContentChanged(object sender, EventArgs e)
{
ContentIsDirty = true;
ViewState[this.ID.ToString()] = ContentEditor.Content;
Content = ContentEditor.Content;
}

The ContentChanged event fires AFTER the Page_Load event so we need to move the “Save” call to later in the Lifecycle.

Note also the explicit ViiewState population which is necessary to maintain the user edits on post-back.

Some MISSING items …… 

  • Save Exception Handling
  • Safari / Chrome Support (This is a multi-view control issue.)
  • Security – (No role constraints, anyone can edit.)
  • Multiple Announcement Record Support

 

Technorati Tags: ,,NETOOP,,

Using the ASP.NET AJAX Editor Control to Implement In-Place Content Editing.

In-Place editing is a slick feature for managing some of a web sites content.

I’ve mocked up a demo of In-Place editing using the new ASP.NET Ajax Control Toolkit’s Editor control and the ASP.NET Multi-View control.

Also, I’m implementing this as a User Control so it can be easily and widely used throughout my project.

Here’s how it works.

Note the little “Pencil” on the top / right of the content are. If you hover over it you get an edit hint.

7-9-2009 10-49-53 AM 

When you click on it you enter edit mode.

Note the Ajax style behavior accomplished by a combination of using ASP.NET’s MultiView control and ASP.NET Ajax’s UpdatePanel.

7-9-2009 10-50-39 AM

Now some rich text entry.

7-9-2009 10-52-33 AM

Clicking on the Floppy Disk Icon “Saves” the new content (actual persistence is not yet implemented) and clicking on the X cancels.

Hovering over the icons provides guidance. Note that the Editor Sizes with the text area. 

Click save and ….

7-9-2009 10-52-54 AM

Presto.

Here are a few implementation details …..

First, lets look at the control in design view.

7-9-2009 11-12-16 AM

… the markup

   1:  <asp:UpdatePanel ID="InPlaceEditorCOntrolUpdatePanel" runat="server">
   2:  <ContentTemplate>
   3:  <asp:MultiView ID="EditInPlace_MultiView" runat="server" ActiveViewIndex="0">
   4:     <asp:View ID="DisplayView" runat="server">
   5:         <asp:Panel ID="ContentDisplayPanel" runat="server">
   6:         <p style="text-align: right">
   7:            <asp:ImageButton ID="Edit_ImageButton" runat="server" Height="16px"
   8:                          ImageUrl="~/InPlaceEditorControl/Images/Edit_Icon.png"
   9:                          Width="16px"
  10:                          ToolTip="Click to Enter Edit Mode"
  11:                          onclick="Edit_ImageButton_Click" />
  12:         </p>
  13:         <asp:Label ID="ContentLabel" runat="server" Width="100%"></asp:Label>
  14:         </asp:Panel>
  15:     </asp:View>
  16:     <asp:View ID="EditView" runat="server">
  17:         <asp:Panel ID="ContentEditPanel" runat="server">
  18:         <p style="text-align: right">
  19:            <asp:ImageButton ID="Save_ImageButton" runat="server" Height="16px"
  20:                          ImageUrl="~/InPlaceEditorControl/Images/Save_Icon.png"
  21:                          Width="16px"
  22:                          ToolTip="Click to SAVE and Exit Edit Mode."
  23:                          onclick="Save_ImageButton_Click"
  24:                             />
  25:            <asp:ImageButton ID="Abort_ImageButton" runat="server" Height="16px"
  26:                          ImageUrl="~/InPlaceEditorControl/Images/Abort_Icon.png"
  27:                          Width="16px"
  28:                          ToolTip="Click to Exit Edit Mode Without Saving."
  29:                          onclick="Abort_ImageButton_Click" />
  30:         </p>
  31:         <act:Editor ID="ContentEditor" runat="server" Width="100%" Height="100%"
  32:                 oncontentchanged="ContentEditor_ContentChanged" />
  33:         </asp:Panel>
  34:     </asp:View>
  35:  </asp:MultiView>
  36:  </ContentTemplate>
  37:  </asp:UpdatePanel>

… and the code.

   1:  using System;
   2:  using System.Collections.Generic;
   3:  using System.Linq;
   4:  using System.Web;
   5:  using System.Web.UI;
   6:  using System.Web.UI.WebControls;
   7:   
   8:  public partial class InPlaceRichTextEditorControl : System.Web.UI.UserControl
   9:  {
  10:   
  11:      private int _ContentHeight;
  12:      public int ContentHeight
  13:      {
  14:          get
  15:          {
  16:              return _ContentHeight;
  17:          }
  18:          set
  19:          {
  20:              _ContentHeight = value;
  21:          }
  22:      }
  23:   
  24:      private int _ContentWidth;
  25:      public int ContentWidth
  26:      {
  27:          get
  28:          {
  29:              return _ContentWidth;
  30:          }
  31:          set
  32:          {
  33:              _ContentWidth = value;
  34:              ContentDisplayPanel.Width = _ContentWidth;
  35:              ContentEditPanel.Width = _ContentWidth;
  36:          }
  37:      }
  38:   
  39:      protected void Page_Load(object sender, EventArgs e)
  40:      {
  41:  
  42:      }
  43:   
  44:      protected void Edit_ImageButton_Click(object sender, ImageClickEventArgs e)
  45:      {
  46:          ContentEditor.Content = ContentLabel.Text;
  47:          EditInPlace_MultiView.SetActiveView(EditView);
  48:      }
  49:   
  50:   
  51:   
  52:      protected void Abort_ImageButton_Click(object sender, ImageClickEventArgs e)
  53:      {
  54:          EditInPlace_MultiView.SetActiveView(DisplayView);
  55:      }
  56:   
  57:      protected void Save_ImageButton_Click(object sender, ImageClickEventArgs e)
  58:      {
  59:          ContentLabel.Text = ContentEditor.Content;
  60:          EditInPlace_MultiView.SetActiveView(DisplayView);
  61:      }
  62:      protected void ContentEditor_ContentChanged(object sender, EventArgs e)
  63:      {
  64:   
  65:      }
  66:  }

And yes, I think this is NOT FINISHED.

Thoughts, suggestions ?

Technorati Tags: ,,NETOOP,

.NETOOP Global Statics Update

With lots of great feedback I’ve modified the “SiteGlobalSettings” class I wrote about earlier.

Though it still uses global static but the values are stored in a Global Resource File.

This affords us the superior performance of the mechanism, keeps the “editable” nature of the data, and keeps the simple API based initialization will facilitate multi-cultural implementation when we get there. (Cultural neutral settings can be stored in a single .resx where as language specific entries can be stored in language specific resource files.)

So, I created a Resource file and a sample entry…..

7-9-2009 10-21-23 AM 

7-9-2009 10-22-05 AM

The class code remains the same except for the property initialization.

   1:  public static class SiteGlobalSettings
   2:  {
   3:      static public string MySiteName { get; set; }
   4:      static public string MySiteOwner { get; set; }
   5:   
   6:      static SiteGlobalSettings()
   7:      {
   8:          try
   9:          {
  10:          MySiteName = (String)HttpContext.GetGlobalResourceObject("AppResources",
  11:                                                                    "SiteName");
  12:          }
  13:          catch
  14:          {
  15:              MySiteName = "*NETOOP.";
  16:          }
  17:      }
  18:  }

Technorati Tags: ,ASP.NETOOP,