Tuesday, May 06, 2008

Don't pencil it in; ink it in!

May 22nd at Vermont Technical College in Williston from 9am to 4pm.

You may notice that May 22nd is on a THursday. I will put money on the fact that Chris scheduled this so that he can go to Bove's. THe last few times he hit town at the beginning of the week, but Bove's is closed on Sundays and Mondays and I think I heard the sobs all the way down here in Huntington. Thankfully, he discovered The Skinny Pancake down by the water front and is now a fan of that resto, too!

Read more details about the roadshow on Chris' blog!

Tuesday, May 06, 2008 10:25:05 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

It was pointed out to me recently that I've gotten a bit lazy with my coding. I completely blame it on implicitly typed local variables. Read more here...

[A New DevLife Post]

Tuesday, May 06, 2008 10:21:49 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, May 05, 2008

 

spring 002 (Custom)

spring 003 (Custom)

Veggie garden's ready in case I ever get ready. I did already put some lettuce and peas in on the left.
Only super hardy stuff goes in now. We can't do our regular planting (tomatoes etc) until after Memorial Day.
Short growing season in Vermont.

spring 004 (Custom)

Compost is ready and waiting.

spring 005 (Custom)

Lupine are coming up. They are SO hardy.There are hundreds of them in the front field. Looks amazing in early June!

spring 006 (Custom)

The front garden has already got blooms in it and everything else is growing like mad. 

spring 007 (Custom)

And the winner is.... the first tulip opened today.

spring 008 (Custom)

Columbine will be in bloom in another month. They spread on their own so there's a bunch of this.

spring 009

This lilac is making flowers for the first time this year. It's neighbor is still flowerless. Maybe next year.

spring 010

Lots of Lilies. There are also miles of bee balm along this fence as well as berries and lupine and a very hardy delphinium.

spring 011 (Custom)

Is this bucolic enough? I love this ancient Maple tree down by our mailbox.

But best of all, my favorite flowers are STILL here

tasha may 2008

Tasha, now 14 1/2 which is insanely old for a Newfie.

spring 017 (Custom)

And Daisy, the puppy in the house. She's 13 1/2.

Monday, May 05, 2008 1:19:00 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Thursday, May 01, 2008

I am thrilled to share this fabulous news ... INETA Noram has a new website. The reason for my jubilation is that for a variety of reasons, INETA has been trying to create a new website for about 4 years, so to see it actually happen is wonderful.

This may have just launched because I hadn't heard anything about it yet or maybe I overlooked it in the last newsletter.

Not only does it have a new look but it has some long awaited features such as an integrated map to find user groups. They have partnered with Component Source so you can buy .NET components right from the site.

I also found the live.ineta.org website that I didn't know about. It has videos (user group YouTube?), a blog that lists things like upcoming code camps and INETA related events and some other resources. 

Thursday, May 01, 2008 10:18:25 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Wednesday, April 30, 2008

This week I had to make a very difficult decision. It will make you laugh, but really, it was hard.

I had to decide if my book will say "Julie Lerman" or "Julia Lerman".

After a LOT of deliberation, I decided to go with my grown up name: Julia Lerman. Which means that any searching on Amazon or whereever for "that book by Julie Lerman" won't find it.

Wednesday, April 30, 2008 8:36:36 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [6]  | 
 Monday, April 28, 2008

EntityStateObjects, to me, are one of the most important little pieces of the EF puzzle. IT is the EntityStateObject that maintains all of the critical info for change tracking. But it's hard to get the big picture of what's going on in there when debugging because all of the important stuff is delivered through methods, not properties.

I wanted so badly to write a debugger visualizer for them but they are not serializable (big pout) so instead, I wrote an extension method that uses a ConditionalAttribute to ensure it doesn't pop up during run time. It's for my book but I didn't want to hold onto it until October when the book should be published.

Since it's not a Debugger Visualiser, I refer to it as a DebugTime visualizer. :-)

Here's what my ObjectStateEntry Visualizer looks like in action:

All of the info is pulled from the ObjectStateEntry. At the top it tells the fully qualified name of the type of the object being inspected as well as the object's EntityState.

Then I use the various methods of the ObjectStateENtry to get the Original Values, the Current Values, the names of the fields and a list of the names of the modified fields.

All of this data I feed into the grid.

If the object is detached, then there is no ObjectStateEntry and the visualizer shows this message when you try to run it:

So enough with the screenshots. Here's the code. And here's a collection of important punctuations for you C# programmers who feel a need to translate

[ ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;  ; ; ; ; ; ; ; ; ; ; ; ; ; ;]

 

Imports System.Runtime.CompilerServices
Imports System.Data.Objects

'NOTE: The objects in use here are not serializable so they can't be used
'in debugger visualizers. Instead, you'll need to use them directly, but you can 
'give them a debug attribute so they are only available during debug mode.
<Extension()> _
Public Module Visualizers


  <ConditionalAttribute("DEBUG")> _
  <Extension()> _
  Public Sub VisualizeObjectStateEntry(ByVal eKey As EntityKey, ByVal context As ObjectContext)
    Dim ose As ObjectStateEntry = Nothing
    If Not context.ObjectStateManager.TryGetObjectStateEntry(eKey, ose) Then
      Windows.Forms.MessageBox.Show("Object is not currently being change tracked and no ObjectStateEntry exists.", _
"ObjectStateEntry Visualizer", Windows.Forms.MessageBoxButtons.OK, Windows.Forms.MessageBoxIcon.Warning) Else Dim currentValues = ose.CurrentValues Dim originalValues = ose.OriginalValues Dim valueArray As New ArrayList For i = 0 To currentValues.FieldCount - 1



'you can get from the ObjectStateEntry into the MetaData which actually comes from the EDM
Dim sName = currentValues.DataRecordInfo.FieldMetadata.Item(i).FieldType.Name Dim sCurrVal = currentValues.Item(i) Dim sOrigVal = originalValues.Item(i)
'nothing like a little LINQ query to find some info Dim changedProp = (From prop In ose.GetModifiedProperties Where prop = sName).FirstOrDefault Dim propModified As String propModified = If(changedProp = Nothing, "", "X")

'the funky property naming in this anonymous type is to get around a wierdness with
'LINQ databinding that only occurs in VB - it alphabetizes the fields
valueArray.Add(New With _
{._Index = i.ToString, ._Property = sName, .Current = sCurrVal, _
.Original = sOrigVal, .ValueModified = propModified}) Next Dim frm As New debuggerForm With frm.DataGridView1 .DataSource = valueArray End With frm.lblState.Text = ose.State.ToString frm.lblType.Text = ose.Entity.ToString frm.ShowDialog() End If End Sub End Module

The form has no code, just a few controls:

I created an assembly for my Entity Framework extension methods and just reference the assembly anywhere I want to use it.

Then when I want to use it, I call it against the EntityKey of an Entity Object:

  context = new AWModel.AWModel.AWEntities();
  cust = context.Customers.Where(c => c.CustomerID == 223).First();
  cust.CompanyName = "JULIE COMPANY";
  cust.EntityKey.VisualizeObjectStateEntry(context);

This has been an enormously useful tool for when I have been presenting as well as just working.

Enjoy!

Monday, April 28, 2008 8:07:48 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Sunday, April 27, 2008

Along with a few hundred other DevConnections attendees, I got a sneak peek of the EntityDatasSource control on Monday during Danny Simmons' Entity Framework Architecture session.

 

I think I paid more attention to the control than what Danny was saying because I was desperate to see how it was set up.

 

Before digging in though, I also wanted to note that the UI of the EDM Designer looks really pretty. I noticed that the association lines/connectors looked different; the whole thing was cleaner looking (were the association names gone?) and the Entities have their own little representative icon now. I can't wait to see this in more detail.

 

The EntityDataSource wizard identifies EntityConnections in the config file and offers those to as choices for building the data source from. Once that is selected, the EntityContainer is also identified, offering the list of EntitySets from the container to use for the data source.

 

Like the LINQDatasource, you have the option of selecting all of the properties at once or selecting specific properties which will perform projection. Like the LINQDataSource, if you project properties, then you won't get a full type back and the data will not be updatable.

 

There was a drop down list below the one where you choose which EntitySet you want to work with but I don't recall what it's name was. Danny did not drop it down. All I can think of that might be there (hopeful) is derived types since they don't have their own EntitySet.

 

Although I don't remember seeing it during the session, Danny did say that you can choose to eager load related data in the same way that you can with the Include method. I don't know how this is done or if it will impact updating, but I don't know why it would.

 

Like the LinqDataSource,  the EntityDataSource performs server side paging, and it does client side caching - of current AND original data. The original data is not stored as complete objects, but the minimal data necessary to reconstruct state when it's time to update. Updates happen, like any other data source, one at a time. So you have to pick an item, edit it and update it.

 

 I've got some of my own examples of using series of entities in web apps which are very different from this. My solution, however, is aimed at a different scenario. Where the EntityDataSource is more scalable because of the server side paging and the fact that it is not caching full objects, my solution allows the user to do a bunch of edits then save them all at once. I keep the objects in the client side cache (I know - horrors! - but it's an option for a developer to choose) and a collection of original objects cached on the server, though it's an application cache, not a session cache.

 

Seeing the EntityDataSource has already given me some ideas of taking my solution and making it more scalable without losing the benefit of the bulk editing.

 

I can't wait to get my hands on the new bits!

Sunday, April 27, 2008 8:20:30 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, April 26, 2008

It's been in there from the start (well at least since VS2003), but I have only recently started taking advantage of the "Format Document" and "Format Selection" functions in Visual Studio to help with the readability of code or xml. Read more...

[A New DevLife Post]

Saturday, April 26, 2008 9:14:09 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Friday, April 25, 2008
I COPIED THIS ENTIRE BLOG POST DIRECTLY FROM GUY BARRETTE'S BLOG and made one little edit! So shoot me! :-)
 

If you're living in Toronto and don't attend DevTeach, [Guy Barrette says he's] gonna beat you up and force you to code in Clipper for the rest of your life.  Seriously, DevTeach has one of the greatest speakers lineup of all the .NET conferences.

Honestly, where can you hear, see, talk to, describe your problems (IT/Dev related or not) and have a beer with these guys/gals?

Scott Bellware Benjamin Day Oren Eini Cathi Gero Barry Gervin The one and only Kate Gregory YAG The Zen of Scott Hanselman Moi Beth[mond] Massi Kevin MacNeish Ted Neward Roy Osherove Rodman Partyboy Palermo Paul [Yes, it's true. I live on a boat] Sherriff Joel Semeniuk Richard Campbell Peter DeBetta Don Kiely of the Alaska Keilys Bill Vaughn Adam Machanic Carl Franklin Rob Windsor Jim Duffy

And that's only half of them!!!

Need more reasons?

Keynote by Scott Hanselman, Microsoft
Scott Hanselman is one of the most prolific, renowned and respected blogger (
http://www.hanselman.com) and podcaster (http://www.hanselminutes.com) about technologies. Scott is a hands-on thinker, a renowned speaker and writer. He has written a few books, most recently with Bill Evjen and Devin Rader on Professional ASP.NET. In July 2007, he joined Microsoft as a Senior Program Manager in the Developer Division. In his new role he'll continue to explore and explain a broad portfolio of technologies, both inside and outside Microsoft. He aims to spread the good word about developing software, most often on the Microsoft stack. Before this he was the Chief Architect at Corillian Corporation, now a part of Checkfree, for 6+ years and before that he was a Principal Consultant at STEP Technology for nearly 7 years.
http://www.devteach.com/keynote.aspx

Silverlight 2.0 workshop
For the first time an independent conference is having a workshop on Building Business Applications with Silverlight 2.0.  Join Rod Paddock and Jim Duffy as they give you a head start down the road to developing business-oriented Rich Internet Applications (RIA) with Microsoft Silverlight 2.0. In case you just crawled out from under a rock, Microsoft Silverlight 2.0 is a cross-browser, cross-platform, and cross-device plug-in positioned to revolutionize the way next generation Rich Internet Applications are developed. Microsoft’s commitment to providing an extensive platform for developers and designers to collaborate on creating the next generation of RIAs is very clear and its name is Silverlight 2.0. In this intensive, full-day workshop, Rod and Jim will share their insight and experience building business applications with Silverlight 2.0 including a review of some of the Internet’s more visible Silverlight web applications. This workshop is happening on Friday May 16 at the Hilton Toronto.
http://www.devteach.com/PostConference.aspx#PreSP

Bonus session: .NET Rock host a panel May 14th at 18:00
This year the bonus session (Wednesday May 14 at 18:00) will be a panel of speakers debating the Future of .NET. Where is .NET going? How will new development influence .NET and be influenced by .NET? Join Carl Franklin and Richard Campbell from .NET Rocks as they moderate a discussion on the future directions of .NET. The panellists include individuals who have strong visions of the future of software development and the role that .NET can play in that future. Attend this session and bring your questions to get some insight into the potential future of .NET! This bonus session is free for everyone. Panelists are: Ted Neward,Oren Eini ,Scott Bellware
http://www.devteach.com/BonusSession.aspx

Party with Palermo, DevTeach Toronto Edition
Jeffrey Palermo (MVP) is hosting Monday May 12th in Toronto is acclaimed "Party with Palermo". This is the official social event  kicking off DevTeach Toronto. The event is not just for the attendees of Toronto it’s  a free event for everyone. It’s a unique chance for the attendees, speakers and locals  to meet and talk with a free beer.   The event will be held at the Menage club  location and you need to RSVP to attend. Get all the details at this link:
http://www.partywithpalermo.com/

Make sure that DevTeach comes back to Toronto.  Register right now for this year's conference.

Friday, April 25, 2008 9:18:28 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, April 24, 2008

This bit me in the butt ... TWICE!

When using WebDataGen so that you can get a proxy class for an Astoria data service, if you are running under UAC, the output file will NOT get created, however the tool reports that the file was created successfully.

I spent a lot of time trying to find the file or figure out what I was doing wrong.

Then a week later, when it was late at night and I was sick so my brain was a little foggy, I had to create another proxy but totally forgot the pain I had gone through previously. It was an hour before I finally remembered that I had to run the command window as admin.

So word to the wise....and I should probably make a not of this in the forums.

Thursday, April 24, 2008 9:55:09 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

A local columnist went through some archives of the paper he writes for and collected a history of shocking gas prices as they were reported over the years by the paper. It's a fun read.

Just to be clear, I wasn't old enough to drive when gas was 49cents/gallon.

Thursday, April 24, 2008 12:31:36 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
 Wednesday, April 23, 2008

I left DevConnections for the Orlando airport and when I got there had another hour and a half before my flight, so headed to the Red Carpet Club. I walk in and as I go to sit down I see Dr. Neil. As I got closer to where he was sitting, there was Michele Leroux Bustamante and Mark Miller. A half hour later, in comes Tim Huckaby. So we're all here with our laptops open, chatting and dare I say - gossiping. If you call talking about how cute someone's baby is "gossip", then I guess that would be the case.

 

Wednesday, April 23, 2008 5:09:04 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, April 22, 2008

I've been in Orlando at DevConnections for the past few days. I've been a little under the weather which has made it a little rough around the edges for me, but I'm surviving. While it was a bit of a challenge to present a full day workshop with a nasty chestcold, this was nothign compared to Kathleen Dollard who gave a Workflow workshop in the room next door with bronchitis. She knew she was sick but didn't know how sick until I dragged her to a clinic that night and discovered she had a high temperature and bronchitis. Poor thing. She's surviving and did talks today and has more tomorrow.

I met a young programmer named Scott Pio at the attendee party tonight who has been writing some great blog posts about being at DevConnections  on http://spoiledtechie.com/ -- the experience as well as the sessions he has attended. It's so fun to meet young developers who are just so ready to burst with their excitement about technology. It's his first conference and I think the first time he's been somewhere where the term "geek" is actually a complement! Definitely check out his blog and especially his posts about DevConnections!

Tuesday, April 22, 2008 8:16:09 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, April 19, 2008

Hip hip hooray.

My only trip so far in 2008 was on USAirways, so I hadn't realized this until just now as I'm stuck in Dulles for 3 hours because  - oh shock! - my flight from Burlington was delayed and I missed my connection by minutes. As we landed, I saw my plane to Orlando sitting at the gate. I hoofed it down the hallway with my backpack on and my carryon in tow (not great fun in Teva's), arrived breathless to learn that it had just left. Now why don't they get the fact that I'm on a connecting flight - one of their own - and just pulling into my gate and just wait another 2 minutes?

Anyway, at least I had the nice surprise of the free wireless to go along with teh carrott sticks and packaged bites of cheese they have for us here in the lounge. Oh, how it makes me miss the Lufthansa and Ai Canada lounges with their real food and (even though I don't take advantage) local beer on tap!

 

Saturday, April 19, 2008 4:49:48 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

While it's very hard to leave Vermont when we are having incredible weather (70 - 80 degree days with blue and sunny skies!) I am on my way to Orlando, FL for DevConnections.

Once again, there is a full track dedicated to Data Access. I'll kick it off with a full day of Entity Framework tomorrow. Monday is Microsoft day and I'm thrilled that there will be talks by Mike Flasko from the Astoria team and from Danny Simmons and Colin Meek of the Entity Frameowrk team.

On Tuesday and Wednesday we'll have two more full days with topics like from LINQ to SQL, Synch Services, ADO.NET Perfomance, Entity Framework, Data Sets and more. And top noch presenters like Dino Esposito, Don Keily, Kathleen Dollard, Cathi Gero and more!

Look for the Data Access track which is listed in both the Visual Studio and ASP Connections conferences.

I'll also be doing a session on Astoria Web Mashups in the ASP Connections conference. I was bummed that the current Astoria bits don't line up with Silverlight 2.0 so I can't do that demo any more, but instead I have put together a cool little demo combining Astoria with Popfly. As far as I know, it's the only implementation out there. The session is in one of the 60 minute slots so I'll just have to talk fast, par usual.

If you're at Connections, say hi!

Saturday, April 19, 2008 1:40:52 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Friday, April 18, 2008

I was experimenting with creating data services from IQueryables. Rather than use the canonical example of creating a set of 3 person objects on the fly and exposing them, I decided to create a service for my application log. (Not something I plan to expose to the web, just a learning tool ;-)).

I created a wrapper class for the System.Diagnostics.EventLogEntry class because I needed to have an ID field that could be read. Thanks to Jonathan Carter's blog post, I knew that there was no property of the real class that would work, so I needed to create my own class with a valid field for a discoverable identity property.

Having done this, I tested my service which worked just fine:

Since I knew there are  a LOT of entries in my application log file (I don't have a sysadmin to do that maintenance for me) I thought it would be smart to filter the entries by adding /LogEntries?$top=10 to the URI. I wasn't sure how Vista would handle that and wasn't shocked to see in the debugger that the filtering was going to be left up to the dataservice:

It's definitely a huge advantage to be able to expose (or interact with) any IQueryable through Astoria, but don't forget that it's the database that has the query processor. In this case, I was returning 23,000 items to my service to be processed.

If I do the same filter to a service that exposed a database via an Entity Data Model, for example Northwind

http://localhost:55176/DataServices/NWDataService.svc/Categories?$top=10

the query is processed by the Entity Frawework and the filter is part of query sent to the database:

SELECT TOP (10)
[Extent1].[CategoryID] AS [CategoryID],
[Extent1].[CategoryName] AS [CategoryName],
[Extent1].[Description] AS [Description],
[Extent1].[Picture] AS [Picture]
FROM [dbo].[Categories] AS [Extent1]
ORDER BY [Extent1].[CategoryID] ASC

Only 10 items are returned for the service to process.

LINQ to SQL will do the same ... i.e. create a filter query that gets sent to the database.

Yes exposing my entire un-maintained application event log is not a real-life scenario and in a real network, I might even use the nice filters that Vista provides for event logs.

But the point is just to pay attention to what you may be asking your service to do.

Friday, April 18, 2008 4:34:50 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

Adding to the extensive Training Kit ofr Visual Studio 2008, Microsoft has recently released a set of Hands on Labs that are part of a training kit for the .NET 3.5 Extensions that is still in production. Read more...

[A New DevLife Post]

Friday, April 18, 2008 2:45:47 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, April 17, 2008

Richard Stallman, president of the Free Software Foundation (FSF) and founder of the GNU Project (http://www.gnu.org/), will be speaking in the Burlington area on April 17 and 18.

 

  o  Thursday, April 17, 4:30 p.m., St. Michael's College; "Copyright versus Community in the Age of Computer Networks"

 

  o  Friday, April 18, 9:30 a.m., Champlain College; "The Free Software Movement and the GNU/Linux Operating System"

 

GNU is "free software" and a different concept from open source software. Per the GNU Web site...

 

=====

"Free software" is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech”, not as in “free beer”.

 

Free software is a matter of the users' freedom to run, copy, distribute, study, change and improve the software. More precisely, it refers to four kinds of freedom, for the users of the software:

    * The freedom to run the program, for any purpose (freedom 0).

    * The freedom to study how the program works, and adapt it to your needs (freedom 1). Access to the source code is a precondition for this.

    * The freedom to redistribute copies so you can help your neighbor (freedom 2).

    * The freedom to improve the program, and release your improvements to the public, so that the whole community benefits (freedom 3). Access to the source code is a precondition for this.

=====

 

The GNU/Linux system, basically the GNU operating system with Linux added, is used on tens of millions of computers today.  Stallman has received the ACM Grace Hopper Award, a MacArthur Foundation fellowship, the Electronic Frontier Foundation's Pioneer award, and the Takeda Award for Social/Economic Betterment, as well as several honorary doctorates.

 

Thursday, April 17, 2008 3:59:33 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

After attending Mix n Mash 08 at Microsoft, I wrote an essay called "The Magic of Software" that is in the April 08 issue of MSDN Magazine. The issue (including the essay) is now online.

Thursday, April 17, 2008 12:12:52 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

FrontPorchForum, a local, very innovative community website that started here in the Burlington area, has made the cut from 5,000 community organizations to be on the shortlist of 20 to possibly win a $25,000 grant from the Case Foundation. Case Foundation will aware these grants to 5 organizations based on public voting.

So you can vote for 5 of the last 20 organizations on the list. I went to the site on behalf of FPF and was happy to see an organization from my home town (Syracuse, NY) on the list and was able to vote for them as well. Even if you don't find a local organization on the list of 20, there will surely be at least 5 that inspire you. So go help them out and vote!

Thursday, April 17, 2008 7:32:20 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |