I’ve been a macbook user for about 2 weeks now. As a Microsoft guy, it’s really important to me that the Macbook run Windows 7 really well. So far, I’m not impressed (hopefully this will change once you all give me some good advice). I’ve set up bootcamp on half my SSD drive and OSX Lion on the other half. VMWare seems to run reasonably well, but when I try and run Visual Studio I get lots of hanging and very very slow performance. I’ve got 16Gig of RAM and the latest macbook with a core i7. I’ve tried giving VMWARE 4 or 8 GB’s of ram, but have the same issues.
I’ve also run bootcamp native and had some hanging also, but not as bad as Fusion.
Anyone else have similar experiences? Any suggestions? I’ve heard that macbook’s are awesome at running windows 7. So far, I have not experience that.
Some Background
Years ago, my friend Bill Venners of Artima told me a life long lesson that I always seem to forget. He said that when people design installation programs, they always thoroughly test the “default” installation but not all the corner cases around custom options.
Today, while configuring my new MacBook (Best Windows 7 Computer Laptop they say), I learned this lesson all over again. So, here is the story.
How To Split Your Hard MacBook Primary Drive 50/50, IOS Lion and Windows 7
My thinking is that I need to first allocate a NTFS partition on the MacBook that takes half my hard drive and let the OSX Lion install take over the rest. After about 10 iterations of IOS complaining that it did not have enough resources, I finally decided to take a step backwards and ask myself “how would my mom be able to do this?” and we all know that Mac’s are designed for my mom. So, with that thinking, I just let the IOS Lion install take over the entire disk. Then I ran the Boot Camp Assistant. It asked me how much of my hard drive I wanted for Windows, I said 50% and everything ran perfect. No partition magic, no special setup, just take the defaults with bootcamp!
So, I know it’s hard to believe, but I am actually considering getting a Macbook to use as my main development computer. The reason is I’m using some beta mobile development tools that only support the Mac. The problem is that if I don’t use these tools and incrementally build my app with them, I will get my app far out of wac (wac being a technical term) that I will never be able to get it back in wac again.
So, I have a good friend who is a Mac wizard and I thought I’d ask him a question. Below is my question and his answer. Keep in mind, my friend is very technical in the Mac world.
Question from me (PC Guy):
I’ve been trying to figure that out for myself which Mac model to get. If I get one, I want SandyBridge or later. I think that’s quad core, but hard to tell. Apple just seems to give dates on the refurbished site for their computers. It’s also good to know they work with 16gb ram. I need that because I run big fat windows VM’s. The other thing I can’t quite figure out is if the 15’s support 2 drives internally if you are willing to forego the optical drive. I like to run the boot drive as SSD (SATA3) and the secondary drive as just a normal SATA2 or SATA3.
My Friends answer (MAC Guy)
You’re talking like a pc guy. Pick the prettiest one.
I’ve been working on an HTML5/CSS3 SenchaTouch project for many months now and near the end we our finding that we have problems on an IPad1 only and all I have is an IPad2.
My 700+ twitter buddies to the rescue.
I tweet:

And, within about 5 minutes comes back:

Not to mention from Facebook, another one because my tweets go to Facebook also.

At any rate, I had 3 different people testing my app on an Ipad1 within 15 minutes.
Totally awesome and thank you social buddies!
Introduction
We have new page on the under the
// ABOUT menu on the
Silicon Valley Code Camp web site. It’s called “Live Referral Links” and essentially, it’s real time tracking of referral traffic into the code camp web site. We normally get thousands of requests a day processed by our servers. Most of these requests come from search engines, peoples email links, stored favorites, or just typing in the url themselves. However, if a person arrives by clicking on the Silicon Valley Code Camp link at the site
http://www.json.org/, that is called a referring link and it is passed to us along with the first request to display our home page. In the code camp program, we are now capturing those referral links, putting the in a database and storing them to be presented.
That’s really only half the story. Now that we have them, we need the author of that link (like Douglas Crockford in the case of
http://www.json.org) to log into there code camp account, go to a special page called “My Referral Links”, find from a list of incoming url’s the ones that are his, then essentially take credit for them. Once he has done that (as below), when any user goes to the
// ABOUT page, then selects
Live Referral Links as is pointed to by the first red arrow, they will see all the referrals to code camp’s site along with how many referrals there were and the user taking credit for those links.
Because the Silicon Valley Code Camp web site is known by the search engines as a very reliable source of knowledge, those sites listed in the Live Referral Links page will get ranked higher and will more often be found. Also, users may directly click on those links and return to the site.
This is good for everyone! Win-Win.
For the Attendees who create links to our site, they get great SEO in return as described above, and for Code Camp, well, we get more traffic and attention which is what we want. Read on for how to setup your own referral links.
(more…)
Scott Hanselman posted a while back about a browsers definition problem with some ASP.NET sites that causes problems. Microsoft has articles on this also. Having just received my BUILD tablet that includes IE10, I tested the Silicon Valley Code Camp web site and discovered that when you login, then switch to another page, the login did not stick. After uploading the two files Scott mentions (firefox.browser and ie.browser), the problem goes away.
Thanks Scott for the heads up.

I’m here at the Microsoft BUILD conference in Anaheim and am very much enjoying all the announcements surrouding the next major release of Windows (at least a year or two out). One of the big speculations that has drawn a lot of confusion over the past few months is whether .Net is going to part of the next generation of Windows. It seems that Microsoft had been telegraphing quite a bit about how C++ will be the language of choice to program going into the Microsoft future.
Well, I’m sure that .Net is a part of Windows 8. I also now know that if you want to continue to write c# or vb code for the “new” part of Windows 8 (Metro) you can, however Microsoft has created a new API they are calling WinRT. WinRT does have a full CLR and the languages c# and vb will be supported. However, the API you call has changed. Miguel has a great article that explains much of this here: http://tirania.org/blog/archive/2011/Sep-15.html
It’s a brave new world! Much has changed, much is the same.

The What and Where
Something that may not be obvious is if are creating an asp.net WebForms project and you put a datasource such as SqlDataSource or ObjectDataSource for example on the page, how can you prevent the SqlSelect associated with that datasource from being triggered.
The answer is to set the control’s visible property to false. That’s it!
(more…)
(AKA, how to not use templates to do a simple GridView Column Formatting)
This post is inspired by another post on did on GridView date formatting years ago. It’s still very popular.
If you are like me, you don’t like using GridView Templates because it makes you write ugly verbose code. In this post, I’ll show you how to do a quick customization of the BoundField asp.net server control. That is, the one you typically see in GridView as follows:

What we plan to do, is to create a custom control that looks like the following:

and will end up displaying data in a table that looks like the following:

(more…)
In this article, we will build from scratch, using Visual Studio 2010 Beta 2 a simple application that lets us view Silicon Valley Code Camp Attendees that have authorized us to share their data. We will be using no special RIA Services Visual Studio 2010 design tools to do this. We will:
- Create the Entity Framework Repository
- Create the Domain Service
- Wire up an Appropriate Get Method that Returns in IQueryable
- Call From the Client Code the Domain Service
- Show The Results
- Observations
First, we need to create a new Visual Studio Project. We do that by using the File/New Project and chose “Silverlight Business Application”.
(more…)
In this article, we will use the the Visual Studio 2010 Beta2 Tooling to create a Sessions DataGrid. We will add a Pager to it as well as a Silverlight busy indicator which will show while the data is loading. In Article 1, we build a simple DataGrid with code behind, in this article, it will all be declarative in XAML built with the Visual Studio 2010 designer.
(more…)
Say you have some logging in your code that finds something unusual going on. In my case, I have a DataContext that I check to make sure it’s not already open before I open it. The method that I call the DataContext in is a utility method that is buried many layers down. When this problem is found, I don’t want to throw an exception, but I do want to log where I was. It does not help me to know that I’m in my utility method. I need to know the stack.
(more…)
OK, so we all want to be somewhat popular, and it seems that my last article, “To Brace Or Not to Brace”, seems to have gotten a lot of attention, so, here goes my opinion on the popular semi-colon argument. First, I’m not against any languages in particular, but I have found that I do better in ones that have semi-colons. One of the features I really like is the ability to move my line returns anyplace I want, and to indent as I see fit. Though the semi-colon does not guarantee I can do this, it certainly makes life easier.
(more…)
This past Thursday evening, my wife Tammy and I went to visit our first platinum sponsor of 2009, Falafel Software in Capitola California. Lino Tadros, Chairman and CEO of Falafel let us use his office for normal working during the day, then we all went out for a great Sushi meal after. Falafel provides high qualtiy software development, consulting and training. We had the chance to see where it all happens.
(more…)
Many of you know of ORCSWeb either by reputation, or by way of Scott Forsyth, one of my ASP.NET MVP brothers. In case you don’t, they are a managed hosting solutions company specializing in Microsoft technologies. I’ve used their basic services for quite a while and have always been very happy. It has always seemed that anytime I’ve called them (and it always seems like the middle of the night) one of their tech support staff is always available to help me, and go the extra mile if necessary.
The company I’m now working at is small and we don’t have a lot of resources to maintain hardware and do operating system type support. We do have a high load requirement so we need a very robust supported solution. Before this, I’d always been in the under $50 per month type plan with ORCSWeb, but I decided I needed more servers and a higher level of support. I really did not know what level of support to expect when signing up for the managed servers but decided to go for it anyway.
All can say is WOW!!! I am over the top impressed.
(more…)
So, you have an enum defined as follows:
public enum CompanyAddressType
{
Unknown = 0,
Primary = 1,
Warehouse = 2,
Distribution_Center = 3,
Cross_Dock = 4
}
You want to iterate through the list and put the data into an asp.net dropdownlist.
(more…)
*Note 10/22/2011 (2+ years later): Microsoft is fixing this problem in EntityFramework 4.5! See my post here about it: http://peterkellner.net/2011/10/22/microsoft-to-add-auto-compiled-linq-queries-to-entity-framework-v-next/
So, I’ve been on kind of a rant lately about how slow LINQ2SQL is if you don’t compile your queries before executing them. To be fair, if you are doing Windows Forms Programming, WPF or Silverlight it really does not have much impact. The reason is that a very complex LINQ query may take 50 milliseconds (1/20th of a second). No big deal if you just have a dozen or so of them to do. The story changes though if you are using LINQ2SQL in a web environment that has limited CPU resources. That is, unless you have unlimited money, if it takes more than one web server to handle your load, your throwing away money by using uncompiled LINQ2SQL.
So, to put some more substance behind my claims, I’ve written a small test application using Visual Studio 2008 that compares the performance of using LINQ2SQL compiled verses non-compiled on a trivial web page.
(more…)
I’m doing two sessions at VS-Live in June. Both sessions are in the asp.net track. One is on High Speed performance in ASP.Net, and the other is on using ExtJS (a brilliantly fast rich JavaScript library). Hope to see you there!
Here are the descriptions:
VM1
Build Blazingly Fast ASP.NET Apps with 100% Clientside UI ExtJS
Peter Kellner
Intermediate
Need a web application that has the responsiveness and interactivity of a forms app but still looks and feels like a web? One of the best kept secrets (at least to the Microsoft community) is ExtJS. It’s a different paradigm then we are all use to, but the results are spectacular. Take a look at this url and you will see as well as learn how to do this yourself. The hardest part is shuttling the data back and forth. A lot of this session will be talking about how to do a real world app that does this. Once you go this way, you’ll be gone from serverside forms for almost ever.
(more…)
So, you want to access some content from inside a page that you created from an existing master page? The most clean way to do this is to create a public property in your master page, then access that. In my case, I have a search button on a master page that I want to use from inside to pages that derive from that page. So, Here is how I declare my master page:
1: <%@ Master Language="C#" MasterPageFile="~/MasterPages/MasterPage.Master" AutoEventWireup="true"
2: CodeBehind="ContactMasterPage.master.cs" Inherits="ThreePLogic.Web.ASPWeb.ContactPages.ContactMasterPage" %>
3:
4: <asp:Content ID="Content5" ContentPlaceHolderID="ContentCenter" runat="server">
5: <asp:TextBox ID="TextBoxSearchName" runat="server" Width="200px" CssClass="InputText"></asp:TextBox>
6: <asp:Button ID="ButtonSearchName" runat="server" CssClass="SearchBtn" />
7: </div>
8: </div>
(more…)
This is my third MVP Summit and it’s really starting out with a bang (and a little rain). I arrived today around noon to register. Immediately, I ran into at least 40 or 50 friends I have not seen since last year at this event. We then had several sessions on Microsoft products followed by two key notes, one from Rich Kaplan, and one from Toby Richards, General Manager, Community and online relations. It’s really good to see Microsoft keeps investing in it’s community, even in these rough economic times.
(more…)