Mike Taulty's Blog
Bits and Bytes from Microsoft UK

June 2007 - Mike Taulty's Blog

Blogs

Mike Taulty's Blog

Elsewhere

  • Vista and "Local Only" Network Access

    I still occasionally (i.e. it's not as frequent as in the betas) have a problem where Vista won't connect to my wireless network. I had it today. I have my Vista desktop and my Vista laptop. Both are on my wireless network. The desktop goes to sleep. Later on, for some reason, it will not connect to the wireless whereas the laptop does. When I say "will not connect", what I actually see is a; "Unidentified Network (Local Only)" message and also if I try and ping anything I get; "PING: transmit failed, error code 1231" I can find myself stuck with this for ages. I tried two mechanisms for fixing this today and they did seem to get me around it. One is taken from Steve's blog post here; Making Vista less aggressive... and the other was taken from this KB article here; Windows Vista cannot obtain an IP address from certain routers or from certain non-Microsoft DHCP servers This fixed the problem for me today but whether it'll stay fixed I'm not sure yet and I'm not sure which action "fixed" it.
  • Grrr. Windows Update

    I get this screen; and then I get this screen; I think this is pretty poor to be honest; No cancel button whilst "Checking for updates..." No visual indication (other than an animated progress bar) of what on Earth is going on whilst it's actually "Checking for updates...". Can it find the update server? Has it got any data from it yet? Is it likely to take another 1 minute or another 2 days? Display 0x80072EFD to a user is just a horrible thing to do. <rant over>
  • blog.Suspend()

    This blog is going to be a little quiet for a few weeks whilst I'm out on holiday. Once the old batteries have been recharged I'm hoping to start doing some things with the Entity Framework as I feel like it's looming on the horizon and demanding attention :-) If you're going to the DDD5 then have a great day and I apologise in advance for missing it this time around ( it's the first one that I'll have missed :-( ) but the power of holiday cannot be ignored :-)
  • Expression Blend Tutorials

    I watched the Blend tutorials from http://www.lynda.com the other day - they're free and they're really good. There weren't that many things in there that I didn't already know about Blend but I just found the style and the structure a pleasure to watch. On a similar theme, you might want to also have a look at http://www.nibblestutorials.net/ which has some more Blend/Silverlight tutorials. That site is a really nice site and (as far as I can tell) it's all done in Silverlight.
  • MIXUK

    "That Internet thing will never take off". But...just in case it does....it might be a good idea to be at MIXUK later in the year to see what's going on in the world of web technologies. Ian's post will get you started in getting signed up for further details as they become available .
  • Print to XPS

    Fairly obvious one this but I'm finding "Print to XPS" particulaly useful for saving web pages offline (especially those kinds of web pages where I've booked a ticket and I want to keep some kind of record). It's a lot more useful (to me) than saving the web page anywhere.
  • Alienware Barebones

    Wow, I see Alienware are offering their really quite nifty case as a "barebones". I'd like to dress up my existing desktop in one of these and was just about to do it when I realised that they're quite pricey for a case (albeit with a 700W PSU in it). Nice though if you've got the cash to spare.
  • Presentation Tips

    Couple of (pretty specific) presentation tips. Use A Desktop Manager I've started doing this and it's working pretty well for me. In some places you might be lucky enough to have both a "Slide" and a "Demo" machine (or maybe more than 1 demo machine) but, generally, I find that if I'm out doing a talk then I'm just running from my laptop. To give the "multi-machine experience" I've started using Yodm3D to manage 4 desktops and then I can just have PowerPoint on one desktop and up to 3 sets of different demo bits available on the other 3 desktops and I can just flick between them. Works really well for me. Expression Blend and Design Expression Blend is a great tool but it's a pig to demonstrate at 1024x768 because you really need more space to show it. I find that at 1024x768 if you drop the global workspace zoom (it's on the Options menu since they moved it from the main UI) to about 65% then it's a lot easier to show things. (The same thing works well in Expression Design)
  • Why's the LINQ Query Expression Pattern "Backwards"?

    I was chatting to MikeO today and he was saying "How come the LINQ query expression syntax is backwards". That is, why is it; from c in <Something> select c.<Property> rather than; select c.<Property> from c in <Something> like we would see in SQL. As far as I know (or can guess) this relates to IntelliSense in that once you have typed the <Something> in the first example the editor can start to help with the <Property> bit whereas in the second example it's a bit tricky for the editor to know what you're doing until you get to the end. That's my story anyway :-) Not necessarily the "official" line.
  • Paging Data in LINQ to SQL

    I saw a question over here about "How do I implement paging of data in LINQ to SQL". For me, this is one of the nice things about LINQ to SQL so I thought I'd drop it into a post (it's pretty intuitive). We can do something like; NorthwindDataContext ctx = new NorthwindDataContext( "server=.;database=northwind" ); ctx.Log = Console.Out; var query = from c in ctx.Customers orderby c.CustomerID descending select c; Console.WriteLine( "Enter page size" ); int pageSize = int .Parse(Console.ReadLine()); while ( true ) { Console.WriteLine( "Enter page number" ); int pageNumber = int .Parse(Console.ReadLine()); var thisQuery = query.Skip(pageNumber * pageSize).Take(pageSize); Console.WriteLine( "Page {0} of data" , pageNumber); Console.ForegroundColor = ConsoleColor.Yellow; List<Customer> customers = thisQuery.ToList(); Console.ResetColor(); foreach (Customer c in customers) { Console.WriteLine(c.CustomerID); } } Or something like that anyway. Note that the ToList is only really there so that I can easily log out...
  • Ian Posts a Video about Silverlight Streaming

    I've only had the one little play around with Silverlight Streaming but I noticed that IanM has made a video on using it . Mine was a custom app whereas Ian is taking the results from Expression Media Encoder straight up to Silverlight Streaming as far as I can see.
  • Want LINQ to (Anything But) SQL?

    Then, this should be of interest; Database Vendors Discuss the Entity Framework and LINQ at TechEd
  • More Dynamic Queries

    Took this slightly further (which you could definitely describe as making it worse :-)) by adding a limited form of an OrElse; namespace MyExtensions { public enum Operand { Equal, NotEqual, LessThan, LessThanEqual, GreaterThan, GreaterThanEqual } public static class Extensions { public static IQueryable<T> AddOrElse<T, V, U>( this IQueryable<T> queryable, string lhsName, Operand lhsOperand, V lhsValue, string rhsName, Operand rhsOperand, U rhsValue) { ParameterExpression pe = Expression.Parameter( typeof (T), "p" ); IQueryable<T> query = queryable.Where<T>( Expression.Lambda<Func<T, bool >>(Expression.OrElse( MakeBinaryExpression<T, V>(pe, lhsName, lhsOperand, lhsValue), MakeBinaryExpression<T, U>(pe, rhsName, rhsOperand, rhsValue)), new ParameterExpression[] { pe })); return (query); } public static IQueryable<T> AddClause<T, V>( this IQueryable<T> queryable, string propertyName, Operand operand, V propertyValue) { ParameterExpression pe...
  • Bit More on Dynamic Queries

    I took this a little bit further and ended up with; namespace MyExtensions { public enum Operand { Equal, NotEqual, LessThan, LessThanEqual, GreaterThan, GreaterThanEqual } public static class Extensions { public static IQueryable<T> AddClause<T, V>( this IQueryable<T> queryable, string propertyName, Operand operand, V propertyValue) { IQueryable<T> query = queryable.Where<T>( MakeExpression<T, V>(propertyName, operand, propertyValue)); return (query); } private static Expression<Func<T, bool >> MakeExpression<T, V>( string propertyName, Operand operand, V propertyValue) { ParameterExpression pe = Expression.Parameter( typeof (T), "p" ); Func<Expression, Expression, bool , MethodInfo, BinaryExpression> fn = GetFuncForOperand(operand); Expression<Func<T, bool >> e = Expression.Lambda<Func<T, bool >>( fn(Expression.Property( pe, typeof (T).GetProperty(propertyName)), Expression.Constant(propertyValue, typeof (V)), false , null )...
  • LINQ and Dynamic Queries

    After quite a few LINQ talks, people have asked me about dynamic queries and I always feel a bit of a headache coming on as it's an order of magnitude harder than what I've been talking about. Now, when people ask for dynamic queries they're not talking about; NorthwindDataContext ctx = new NorthwindDataContext( "server=.;database=northwind" ); string variableCountry = "" ; var query = from c in ctx.Customers where c.Country == variableCountry select c; Console.WriteLine( "Which country?" ); variableCountry = Console.ReadLine(); foreach (Customer c in query) { Console.WriteLine(c.CustomerID); } Note that I deliberately chose to alter the variable after the query definition there. Now, generally speaking, they're not talking about something like this (which is pretty interesting in itself); NorthwindDataContext ctx = new NorthwindDataContext( "server=.;database=northwind" ); string variableCountry = "" ; var query = from c in ctx.Customers where c.Country == variableCountry select c; Console.WriteLine( "Which country...
1 2 Next >