Wednesday, January 23, 2008

Burlington, VT PHP Users Group Meeting

RSVP Required

When: Wednesday January 30th, 2008, 5:30 pm - 7:30 pm
Where: Brown & Jenkins Coffee Roasters, 91 Ethan Allen Drive, South Burlington, VT 05403

Topics 

Bradley Holt will be giving a presentation on developing a web application using Zend Framework. Bradley Holt is founder and web developer for Found Line, a local design and development studio which has used Zend Framework in several recent projects. He also works as a software developer for a local non-profit. Before starting Found Line he worked as computer trainer teaching a variety of subjects including Java/JSP, ASP.NET, and PHP.

Other topics will include:

  • What tools do you use for your development environment?
  • What subjects and presenters would you like to see in future?

Refreshments - coffee and snacks - will be provided, and you'll have the chance to network and connect with fellow PHP developers.

To Participate

  1. RSVP by email to Rob Riggen <rob@riggen.org>.
  2. Sign up for the Burlington, VT PHP User Group list on Google Groups.
  3. Forward this link to anyone else you feel would be interested in the topics above.
Wednesday, January 23, 2008 5:20:55 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Bill McCarthy explained this to me in an email.

He wrote about it in this excellent article in Visual Studio Magazine "Drill Down on Anonymous Types".

But it still bit me in the ass!

So I am stamping this into my memory:

in a query results in
...select cust.CustomerID.cust.CompanyName...  Immutable anonymous type
...select New With {
                                .CustomerID=cust.CustomerID,
                                .CompanyName=cust.CompanyName} ...
Mutable anonymous type
...select New With {
                             Key .CustomerID=cust.CustomerID,
                             Key.CompanyName=cust.CompanyName} ...
Immutable anonymous type
Direct creation of object  
New With {
                 .CustomerID=cust.CustomerID,
                 .CompanyName=cust.CompanyName}
Mutable anonymous type
New With {
                  Key .CustomerID=cust.CustomerID,
                  Key .CompanyName=cust.CompanyName}
Immutable anonymous type

And just in case someone who really needs this stumbles on this post, two clarifications:

  1. All anonymous types are immutable in C#.
  2. Mutable means changeable, editable. Immutable means written in stone.
VB
Wednesday, January 23, 2008 4:48:31 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 

Ranting about the lack of updated images to use in our app development was a passion of mine for a short while (prior to VS2005). I just looked at what's included in VS2008 and was happily surprised! Read more...

[A New DevLife Post]

Wednesday, January 23, 2008 1:41:41 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Tuesday, January 22, 2008

I accidentally opened up a web application project as a website. That's not too hard to do. Just say you want to open a web site and point to the folder. It had been a while and I forgot that it was a WAP.

So I'm working on a web page and double click on a control and find myself in the markup with a new script tag and the .net code for the click event of the control. That wasn't good considering I already had some nice event handlers for that control in my code behind.

I spent a lot of time going back and forth trying to figure out why I couldn't get to my code behind.

I even remembered having this problem in the early days of Web App Project and the solution was to "convert to a Web Application Project" from the context menu in the solution explorer. But this option wasn't available.

I created a new web site and looked at the page directive and noticed that in the new website the parameter pointing to the code behind file was called CodeFile, but in my old site it was CodeBehind. Wierd.

So with that clue I googled those two words, came across Steve Smith's blog post about the opposite problem and realized my mistake!

Duh. :-)

Tuesday, January 22, 2008 8:36:14 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

It seems to me that Danny Simmons must be working on v2 of Entity Framework.

The posts he has written in the past week are examples of things that would probably have been in V1 had they had the time and resources. Now they are winding down v1, building up the team and thinking about v2.

Danny has written three blogs posts filled with really handy extension methods for entity framework (and LINQ to Objects) [here's the third which contains pointers to the first two] and now he is building a state bag for dealing with getting  entities across boundaries SOA style (i.e. web services and dealing with the limitations of XML serialization - something many of us have been writing about for a while).

I"m really pleased to see this coming out of Microsoft (although what happened to whitepapers? ;-)). I have come up with my own methods (some with help from Danny and some on my own) but it's always a little unnerving when you are just making your best guess at what they might have planned for.

Months ago I started a thread on the MSDN forum about this issue and it ended up being a 3 or 4 page thread because every time someone on the team said "well, just do this" I said "no - that doesn't really solve the problem". I was pretty relentless (thanks to all of the work I have done with web services and ws-* in the past) and finally Danny ended the thread with "okay, obviously there's more we need to look at here."

Since then I have struggled to come up with disconnected solutions that deal with binary and xml serialization and presented them at a few conferences. This was with Beta2 and there are some new goodies in Beta3 that will ease the pain somewhat but it's still pretty complex.

For the last week or so, Danny has been writing a series of blogs where he's using his indepth understanding of entities, object services, statemanagment, etc. to build a "state bag" for transferring the whole kit 'n caboodle across processes. It's impressive as hell but there was something bugging me that I was dwelling on, and Roger Jenning's pointed it out on his blog as well.The answer to "why is ObjectContext not serializable?" is that it's big and it would not be scalable. And no, I'm not suggesting that Danny forgot this. :-) Which is why I'm biding my time to see how it comes out.

I'm assuming that Danny's state bag is a proof of concept for a v2 solution (though he has been clear that because of some obvious issues with interop, it just may not go in.) And as he suggested in today's post, readers (like me) are probably "chomping at the bit" to see how he does the object context part so that we can see how streamlined it is.

Most people have no clue how deep Entity Framework goes and what the ADO.NET team is setting up for us to be able to do with it down the road. It's probably clear by now that I'm really excited about Entity Framework and I'm struggling to keep up with all of the great ideas that people are trying out as evidenced in the forums.

So while we're all looking forward to the release of Entity Framework, I'm already starting to get excited about what's going to come in V2.

Tuesday, January 22, 2008 7:17:31 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I've been thinking about the EntityDataSource that has been mentioned in the forums. It is something that is going to be added to Entity Framework by RTM, but it doesn't exist in current bits for us to experiment with.

The reason I've been thinking about it is because of some of the issues/confusion with the LINQDataSource and I'm really hoping that the EF team will be looking at that, learning from it, and making sure that some of those problems don't exist in the new component.

Most of the issues with the LINQDataSource are a result of very realistic limitations. But where I see the problem is just the difficulty many users have using it because they don't understand what's going on underneath and to work within the limitations, there are some very non-intuitive things they need to do.

I wrote a bunch of LINQDataSource demos for a presentation and spent a lot of time learning workarounds in order to achieve some very common scenarios although not quite as common as the typical demos. That's where I hope EntityDataSource makes it easier. I don't want to have to work so hard to discover how to make it work.

Here's an example of a something I think is a common scenario.

I have an Entity for SalesOrderHeaders from AdventureWorksLT.

I would like to have an editable gridview of these records.

I'd like to display the customer name in the grid not the customer ID.

Not too strange, right?

But there are a lot of issues encountered along the path to create this solution.

1)One of the most often asked questions about the LINQDataSource is "why can't I edit?". The answer is most often because the developer selected the fields they wanted displayed in the grid and a huge number of people don't realize that they are creating an anonymous type by doing this. Yes there are some clues. The "advanced' button goes away. There's no "enable delete" etc. checkboxes on eh Task menu.

A better way? It would be much easier if the wizard started out by asking if you have any intention of editing and if the answer was yes, does NOT present the end user with the option to select fields.

An even better way? I know the model won't allow this but it would be great to have another entity definition (subset of the properties) for this entity without creating an EntityKey conflict.

2) This also means that I can't really take touch the CustomerName in the EntityRef (SalesOrderHeaders.Customer)unless I create an anonymous type, which I don't want to do. So the next obvious solution is to create a LINQDataSource for the Customers and format the CustomerID column in my gridview to be a template field with a dependency on the CustomerLINQDataSource.

         <asp:templatefield HeaderText="CustomerID" SortExpression="CustomerID">
                    <edititemtemplate>
                        <asp:DropDownList ID="DropDownList1" runat="server"
                            DataSourceID="LinqDataSource2" DataTextField="CompanyName"
                            DataValueField="CustomerID" SelectedValue='<%# Bind("CustomerID") %>'>
                        </asp:DropDownList>
                    </edititemtemplate>
                    <itemtemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Customer.CompanyName") %>'></asp:Label>
                    </itemtemplate>
                </asp:templatefield>

But this creates yet another problem that I may not have any awareness of. The default deferred loading will cause an extra round trip to the database for each SalesOrderHeader record to get the CustomerName.

A better way? Give us a Deferred Loading or Eager Loading option in the wizard!

3) There is a really weird gotcha because we are using EntityRefs for the CustomerID/CustomerName DropDown. Editing doesn't work properly unless you set the LINQDataSource property to StoreOriginalValuesinViewState to False. It's logical but again, totally non-intuitive. If you don't do it, you will get this error message:
"System.InvalidOperationException: Could not find a row that matches the given keys in the original values stored in ViewState.  Ensure that the 'keys' dictionary contains unique key values that correspond to a row returned from the previous Select operation." That's scary, huh? It took some googling to figure this one out.

A better way? If the LINQDataSource could trap this exception and give some better guidance about what the problem is and how to deal with it. Or something...


These are some of the things I spent a ridiculous amount of time on in order to get this scenario working. And seems like nothing compared to what Roger Jennings banged his head on!

It would be great not to have to go through this again with the ObjectDataSource, if it's possible to make some of these issues easier to deal with!

Tuesday, January 22, 2008 12:30:15 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
 Monday, January 21, 2008

I was just bemoaning the fact that I won't be able to drive to Boston for David Chappell's special appearance at a multi-user group event at the end of the month when I discovered that he'll be doing the keynote at the Developer Summit in Stockholm, Sweden where I will also be presenting.

<plug> I'll be doing a full day workshop on Entity Framework as well as an Advanced EF session and a Silverlight Annotation session.</plug>

Monday, January 21, 2008 7:39:11 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Kathleen Dollard recently wrote about VS2008 letting us easily make our app settings publically accessible to other projects. It inspired me to share my solution for how I did this in VS2005 when it wasn't so easy. Read more...

[A New DevLife Post]

Monday, January 21, 2008 1:54:23 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Sunday, January 20, 2008

For the last bunch of years, Rich and I have subscribed to Netflix during the winter when it gets dark early and cancel it around late spring when we can stay outdoors later, then start up again around Christmas time.

When Netflix introduced streaming this summer, we started looking into options for connecting our laptops (no s-video or DVI) to our TV. We never thought of watching the movies on our computers. At first, the offer was that you could watch as many hours as the cost in dollars of your plan - $19/month for the 3 movies at a time plan meant you could also watch 19 hours online. Which should be more than enough!

But that all changed recently when Netflix opened up the streaming with no limits (that I'm aware of).

We still, however, don't have the hookup for the tv.

But I've been sick with a really nasty cold for the past week which seems to get worse and worse. Can you imagine ME actually not being able to talk! (Yes, Rich thinks its a small miracle! :-)) But today, I curled up in bed where I wanted to be, picked a sweet, not quite sappy, indy film (The Treatment) and watched it over the wireless network in our house. It was perfect.

There was a point when it went a little crazy because I ran out of room on my C:\. SO I had to crash it and go clean up things like the 4GB VS2008 install file that was on my desktop and then I watched the rest of the movie with no problems.

 

Sunday, January 20, 2008 6:57:54 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, January 19, 2008

And you thought Microsoft files a lot of patents!

Here's the article:

http://www.burlingtonfreepress.com/apps/pbcs.dll/article?AID=/20080119/BUSINESS/801190312/1003

Saturday, January 19, 2008 10:26:37 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

I had never really though thought about using a spell checker for my code comments before. A blog post on the WebDevTools team blog got me thinking more about it. Read more

[A New DevLife Post]

Saturday, January 19, 2008 11:05:34 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
 Friday, January 18, 2008

I was moving some code around and had a nice WCF Service Interface and Service Class created. So I copied them into a new project where I was re-creating my work.

When I tried to debug (self-host) the service, just to test it out with the embedded WCF Test Client.

But I kept getting this error:

"The client was unable to retrieve service metadata. Make sure the service is running and exposing metadata."

This made no sense. My config file was fine. I even created a new WCF service in the solution, confirmed that it worked properly, then compared the config files line by line.

No problems.

After going around in circles for a while (including getting zero google results for that error message), a thought occurred to me. I copied and pasted the entire contents of the Interface and the service class. I hadn't changed the namespace!

That was the problem. I fixed the namespace and the service ran in the Test Client just fine.

Friday, January 18, 2008 4:52:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

A few weeks ago, I was mooning over Extension Methods. Somehow, in the collection of language enhancements to VB9 and C#3, they have become a bit of a sleeper feature in light of LINQ. Everything is though, right?

So I wrote about them and thought about them, but then went back to my task at hand.

Danny Simmons also recently started seeing the light about Extension MEthods. But instead of going back to what he was doing, he spent quite a bit of time playing with them and is now blogging an Entity Framework Extension Method Extravaganza!

He's going crazy with it already. What fun!

Friday, January 18, 2008 1:59:26 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

How dorky is it that two programmers are all excited about showing each other the complex reports they have pulled off with Crystal? :-)  read more

[A New DevLife Post]

Friday, January 18, 2008 8:44:37 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

You can now finally get at the .NET Source code through VS2008! Read more

[A New DevLife Post]

Friday, January 18, 2008 8:42:43 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

Memory is really cheap now - computer memory has dropped and thumb drives capacity is getting really big. Why is it that it makes me even more of a worrier? read more

[A New DevLife Post]

Friday, January 18, 2008 8:41:36 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Monday, January 14, 2008

Jeff McWherter and his very cool wife (what a lucky geek he is!) have come from Lansing, Michigan to Vermont with hopes of ice climbing and so that Jeff can speak at the VTdotNET group. Unfortunately we lost all of our snow in the last week (though it's finally snowing again) and the good ice for climbing is a little hard to find right now. Our neighbor, a rock climber, made some calls last night and hooked them up with some good insider info on where there's some good ice. I told Jeff he can't do that until AFTER he has spoken to the user group. Not that I want him to whack that brainy skull of his in half AFTER the user gruop presentation either!

When I spoke in Michigan this summer, Jeff came to my presentation both nights. It was the same talk , well at least the same title: Intro to Entity Framework, two nights in a row. He witnessed that the two talks were completely different from one night to the next.

We took them to a great local brew pub last night (BobCat Cafe in Bristol, VT). I will see if it's possible to get a photo of Jeff without a glass of beer in his hand.

Definitely looking forward to tonight's presentation!!

We also are fortunate to have gobs of swag. The magazines (CoDE and aspNET Pro) have been piling up for two months (they always seem to arrive the day after the meeting). We got lots of books sent at Christmas time and I always seem to have a bunch of Infragistics .NET Advantage licenses to give away now.

Additionanlly, we have a sponsor taking care of the whole meeting's expenses- room fee and pizza - tekSystems. Thanks!!

Monday, January 14, 2008 10:46:21 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Saturday, January 12, 2008

I am very excited about this!!

I will be presenting 2 sessions and a full-day workshop at the Developer Summit 2008 in Stockholm April 9-11.

The workshop is "Entity Framework 0-60"  and the sessions are Entity Framework in the Enterprise and Silverlight Annotation.

Patrik Lowendahl, one of the organizers, tells me that Stockholm is really lovely in the Spring!

It also means I get to see my buddy Christian Weyer and meet Tess Ferrandez (the ASP.NET goddess at Microsoft Support), Jimmy Nillson and a bunch of people I've heard about for a long time and not had the chance to meet.

In case you can't get to Sweden, I"ll be doing the full-day workshop at DevConnections in Orlando in late April.

Saturday, January 12, 2008 8:44:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 

Data Systems has a full-time opening for a good problem solver with a solid programming background and a strong interest in designing, coding and supporting accounting applications.

We have an immediate need for an entry-level programmer but would consider creating a position for the right candidate with more experience in software development or  accounting.

Data Systems is a worker-owned corporation and candidates with an  interest in being a business owner are encouraged to apply.

Job Requirements
Work with senior analysts to design software for new applications, support and enhance existing products written in the fourth generation programming language PRO-IV. We will provide training in our development environment. Other useful skills for this position include experience in accounting, software sales, system administration on Linux, Unix, or Win2000,  database administration, Java, Ruby, PHP, or web design.

Email resumes to datasystems@datasystems.coop

 

Saturday, January 12, 2008 11:54:01 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
 Thursday, January 10, 2008

Every time I see a reply on a forum, listserv or a blog comment that starts with "Err..." or "ummm...", it translates in my brain as "how stupid are you anyway?" and reeks of arrogance.

I've always wondered if it's intentional and if the person writing this realizes the effect it has...

Generally I give them the benefit of cluelessness.

Thursday, January 10, 2008 10:52:01 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [7]  |