Posted by Admin on 1/28/2010 8:32 PM | Comments (0)

Some people I know are asking me about the iPad.  If you're interested, here's a small explanation that might give you a better idea of what it really is.

Think iphone with no phone, with a 9.7 inch screen with four times the screen area, and a battery that can last for 10 hours of use. That's what it is in a nutshell. It can run iphone apps, but developers can also write apps that take advantage of the bigger screen. Because of the bigger screen, it can be a good ereader (it will have its own bookstore), and it is better than the iphone for productivity apps like documents and spreadsheets. It will be $499 for the 16gb version, $599 for the 32, and $699 for the 64. There will also be versions with AT&T wireless built in; they'll be $130 more, plus $29 a month.

A huge downside IMO is that it can still only run one app at a time, just like the iphone. And you can't run the same apps you could run on a macbook or other laptop.  On a bigger device like this, you'd want to do more with it, and do those things simultaneously, so this is a serious limitation. Think about if your laptop could only run one app at a time.  When you consider you can get a netbook for $300 that can run multiple apps simultaneously, has a physical keyboard and even a bigger screen, it's a tough decision.

Anyway, that's my $.02.  Hopefully this doesn't sound biased, because it's not meant to be.  I really thought I'd probably get one, and still might, but the limitations mentioned, plus the fact I already have a netbook, will probably cause me to hold off.

Posted by admin on 8/25/2009 10:43 AM | Comments (0)

I’m building apps on top of asp.net 4.0 ajax preview 4, and it’s pretty cool.  The name is a bit of a misnomer, since you can use all of the client-side ajax functionality without asp.net 4.0 at all.  In fact, I’m using the client-side templating abilities by calling in to an asp.net mvc app that returns json results.  Here’s a link to the preview bits.

http://www.codeplex.com/aspnet/Wiki/View.aspx?title=AJAX&referringTitle=Home

I’ll have more up in a bit, as soon as I can write a demo for it!

Tags: , | Posted by admin on 8/25/2009 8:19 AM | Comments (0)

MSDN help is the most frustrating creation ever.  Even when it really does answer the “what”, it almost never answers the “why”.  In this case, I’m working with Linq to SQL.  I’m using the repository pattern and passing in a read-only or read-write datacontext depending on the situation.  I’m making a datacontext read-only by setting ObjectTrackingEnabled=false.  Here’s the MSDN article on ObjectTrackingEnabled.

http://msdn.microsoft.com/en-us/library/system.data.linq.datacontext.objecttrackingenabled.aspx

Here is the key sentence:

“If ObjectTrackingEnabled is false, DeferredLoadingEnabled is ignored and treated as false. In this case, the DataContext is read-only.”

Ok.  I get that ObjectTrackingEnabled=false by necessity makes the context read-only.  After all, if you’re not tracking changes, how do you know what to update?  What I don’t understand is why DeferredLoadingEnabled gets set to false as well?  If I have the following object model:

Order –> Status

I want to be able to have status lazy load when I do something such as reference the status description, like so:

Order.Status.Description <= This *should* lazy load the Status object

Why, oh why, can’t I still get lazy loading with a read-only datacontext?  The Status object could simply be loaded with the same read-only context, couldn’t it?  Someone at MS made this decision.  But I have absolutely no idea how to find out the reasoning behind it.  What I do know is that retrieving the status description in the example above has to be written two different ways now depending on my scenario.  Ugly…

Tags: , | Posted by Admin on 8/19/2009 7:20 PM | Comments (0)

I’m a Microsoft Action Pack Subscriber.  Being in the partner program provides sales and training resources, and also provides internal-use licenses for Microsoft software.  It’s a great way to eat the Microsoft dogfood that you’re recommending to your customers.  It lets you tell the pros and cons of MS software from experience, not just from sales slicks.

By passing a pretty easy online test, you can also get the software in the “Web Solutions Toolkit”.  This additional software includes Visual Studio Standard and the Expression suite.  Here’s where the frustration comes in.  I was going to create a prototype Windows Mobile app for a customer of mine.  I’ve written WM apps in Visual Studio 2005 Standard before with no issues.  I’ve since moved to VS2008, of course, specifically the standard version in the MAPS kit.  So, I fired up VS, went to the C# project types, and looked for the “Smart Device” projects.  Imagine my surprise when it wasn’t there.  I figured I was missing an SDK or something, so I downloaded and installed the latest CF 3.5 SDK and Emulators.  Still no dice.  It was only after doing some Binging that I came upon this thread on MS’s forums.  I couldn’t believe my eyes!  From VS2005 to VS2008, Microsoft actually made it *harder* to create WM apps.  I found another thread on the partner forum, and saw a response from a MS Partner representative, confirming all of this (here’s the link to the thread, but it’s secured).

“Hi Tony,
Thank you for the post. I am afarid we have only Visual Studio 2008 Standard Edition included in the Web Solutions Toolkit currently. However, we appreciate your valuable advice and I will forward your feedback to the concerning team for their reference. Hope Visual Studio 2008 Professional Edition can be made available in the future.

I proceeded to add my response to the thread.

“I have to add another +1 to this thread.  It's absolutely amazing that even partners can't use the provided software to develop Windows Mobile apps.  How can we convince our customers to extend their LOB apps to WM if we can't even create prototype apps to show them?  That's what I was about to start doing tonight for a customer (I have previously written WM apps with VS2005 with no issues) when I ran into this showstopper.  I'm not paying $500+ for an upgrade to Pro just to convince a customer of the merits of WM development.  The whole point of the MAPS was to give us the software we need for just this purpose.

I'm very disappointed!

John West”

My response pretty much sums it up.  MAPS is all about giving us the tools to convince our customers that they should use MS software.  I’m a firm believer that MS does make the best software, and has the best overall software ecosystem, for businesses.  It’s not perfect, and doesn’t suit all scenarios, but it’s the best fit for most.  So when I’m not given the tools to prove this to the customers I serve, I get upset.  Come on, MS, help us out.  We *want* you to compete with the iphone by showing customers that WM also has a good app dev story.  We can’t do this when you make it so difficult.  Give us the tools we need, and let us help our customers, and, as a byproduct of wanting to help those customers, help you!

Tags: | Posted by Admin on 7/23/2009 3:32 AM | Comments (0)

I have fought with the issue below with Design 2, and anxiously downloaded Design 3, hoping it would be fixed.  No dice!

The problem is when I’m exporting selected objects to jpg (or png, for that matter).  The dimensions of an object on the design surface will be different from the dimensions when exporting the selected object.  Why???  Why can't my dimensions when exporting be exactly the same as when designing them?  I thought maybe it was antialiasing, but unchecking that made no difference.  I also made sure my X and Y locations were integers, thinking there was some kind of rounding problem.  Still no difference.

More...

Tags: , , | Posted by Admin on 7/2/2009 3:59 AM | Comments (0)

I’ve been thinking a lot about Windows Mobile 6.5 and 7.0.  Everyone is very focused on the user experience that Microsoft will provide.  Will they show the hexes or hide the hexes… Will it have Multitouch or not?  Zune integration?  Will it be more stable?  These are all great questions, but as a developer, none of them are the right question for me.  I mean, I want the Zune Marketplace on my WM device, no doubt about it.  However, there’s one thing I want more than any other as a developer.

More...

Tags: , | Posted by admin on 2/21/2009 3:11 AM | Comments (0)

I have an AT&T Fuze with the original, stock Windows Mobile 6.1 installed.  I have tried repeatedly on two different machines to get Internet Sharing working over either bluetooth or usb.  No dice.  Finally, I stumbled on this blog: http://stevenharman.net/blog/archive/2008/10/03/windows-mobile-internet-connection-sharing-hack.aspx.  The important part wasn’t how to hack the registry.  What I needed was to know that the AT&T ISP connection needed to point to wap.cingular instead of isp.cingular.  I made that simple change and my connection worked flawlessly!  Hopefully this helps someone else.

Tags: , , | Posted by Admin on 11/21/2008 3:10 AM | Comments (0)

Note: The examples are for VB.NET.

I have a separate assembly that hosts the layer containing my LINQ to SQL model. If you're going to use the L2S designer, you need to let L2S store the connectionstring in the settings.settings file, as shown here.

image

This is great, until you move your website to staging/production.  You need to be able to change this connectionstring by way of a web.config setting.  This method assumes that your L2Q data context has the following settings:

Connection: ExampleConnectionString (MySettings)
Connection String: xxx
Application Settings: True
Settings Property Name: ExampleConnectionString

It turns out that it’s really simple.  Just add a connectionstring entry to override the one in the assembly containing the L2S connectionstring.  Here’s mine for the example above:

  <connectionStrings>
    <add name="App.My.MySettings.ExampleConnectionString"
      connectionString="server=svrprod; uid=secureuser;password=xxx; initial catalog=db"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

The key is the name.  You have to prefix your connection string’s name with “RootNamespaceForYourAssembly.My.MySettings.”.  That’s it.  Your web.config settings will now override the assembly’s settings when you view the website, and yet the designer will continue to use the settings in the assembly!

John

ps.  I do recommend you verify your changes before moving this to production to make sure your web.config connectionstring is being used.  To do this, simply make your production web.config connectionstring point to an invalid server and make sure you get the error on your website.  That way you’ll know for sure that it’s reading it correctly.

Tags: , , | Posted by admin on 11/21/2008 3:01 AM | Comments (0)

I’ve always wanted to have and play my music from anywhere.  As of today, I’m getting really close.  Two things happened to make it easier.

First, Zune Pass with Free MP3s (if you have MP3s from other sources, skip this section and move on to “Mesh” below)

First, I’m a Zune Pass guy.  For $14 a month, you get unlimited music to listen to on your PCs and Zunes.  Of course, if you end the subscription, you don’t keep the music.  That’s mostly true as of today, with a great exception.  As of now, every month you’re a Zune Pass subscriber, you get to download 10 DRM-free MP3s from the Zune library.  These credits show up as you browse your music, and when you go to buy an MP3, you’ll see ‘NO CHARGE’ as long as you have credits remaining (note: these aren’t rollover credits – you need to use them every month).

image

These MP3s are yours forever, regardless of whether you have a Zune pass, or even Zune hardware or software.  They’re POMP3s (plain-ole MP3s) to do with as you like.

Second, Mesh

Ok, so it’s great that I get free MP3s.  And since I can copy them around, I can take them with me on any device.  However, it’s time-consuming to copy files and make sure everything’s in sync.  It also doesn’t help if you’re at someone else’s computer.  That’s where Live Mesh comes in.  Live Mesh, although much more, includes file-synching capabilities.  Once you install Mesh (www.mesh.com) on the desired computers, you can join them into your own sort of personal network (called a Mesh, of course), simply by using your Live/Msn/Hotmail Logon.  Once they’re in the Mesh, you can add any folder on any computer to be synced, and specify that it should also be synced with any/all of the other computers.  So, Computer A and B sync a folder called ‘ZuneMP3s’.  Any changes on either computer will automatically be synced through the included computers without you doing a thing!  Add some MP3s on computer A and they’ll be on computer B, and vice versa.  Any problems with making sure all your devices have the MP3s is solved.  And you can have nearly unlimited computers in your mesh.

That’s great.  Your PCs all have your MP3s.  But wait, there’s more.  This is where it gets really, really good!  In addition to syncing the folders to your devices, you can sync it to your Mesh “Live Desktop”.  This is your mobile desktop on the web.  As you can see below, I’m syncing my MP3s to my Live Desktop.  (Note: there’s currently a 5gig limit to your Live Desktop while it’s in beta).

image 

Why is this important?  It’s important because your Live Desktop includes a built-in media player by way of the Silverlight plugin.  This means, yes, you can play your MP3s from the browser, from any computer that supports Silverlight (Mac, Windows, Firefox, Safari, etc)!  At a friends house?  Just log on to your Live Desktop and start playing your music!

Bonuses

Bonus #1: Soon you’ll be able to include Mobile devices and Macs in your Mesh.  That means you can have your MP3s sync to your phone for play on the road!

Bonus #2: Mesh includes remote desktop abilities.  That means that you can remotely connect to any machine in your Mesh as if you’re sitting in front of it.

Bonus #3: Mesh is set to be much more than just a file-synching solution.  Silverlight apps can be hosted within it, and developers can write apps that use it to sync whatever types of information is relevant. 

Summary

I can sync and play my MP3s from any PC in my Mesh, and I can play my MP3s anytime, anywhere, from a browser!  How’s that for cool?!?!

Tags: | Posted by Admin on 7/15/2008 4:09 AM | Comments (0)

I'm trying to reuse an animation that I create programmatically.  The why isn't important.  What is important is that the second time I try to run it with animation.Begin(), it bombs.  Well, with some properties it bombs.  With others, it works.  Transform properties cause the error, but standard properties like opacity and canvas location work when you run the animation multiple times.

Below is a sample app.  Button one and two are two instances of the same created animation.  Each of them will run once, but fail the second time.  This shows that it's not the object being animated, but the animation itself that is causing the error.  Button three and four are opacity animations, and show that animations that change opacity never fail when run multiple times.

I'm sure one suggestion will be to recreate the animation each time.  However, in my real-world app, I capture some object properties at the time the animation is created, and need to have these same values used each time the animation runs.  If I were to grab the properties over each time I recreated the animation, the object might be in a different state.  And I don't want to cache the initial values, because 1) it makes my animation library less flexible, and 2) I just want to do it this way, 'cause it's easier :).

I've added my code after the sample app.  If anyone has any idea what I can do to prevent this while still creating the animations programmatically, please add a comment.

 

Here is the xaml (Page.xaml).

<UserControl x:Class="AnimationReuseTest.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">
    <Grid x:Name="LayoutRoot" Background="White">
        <Rectangle x:Name="recMain" Height="54" Canvas.Top="225" Stroke="#FF000000" Margin="65,136,76,110" VerticalAlignment="Stretch" d:LayoutOverrides="Height" Fill="#FF941414" RenderTransformOrigin="0.5,0.5" Opacity="0.1" >
            <Rectangle.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Rectangle.RenderTransform>
        </Rectangle>
        <Button Height="40" Margin="24,0,0,70" VerticalAlignment="Bottom" Content="Animate1-scalex" x:Name="btnAnimate1" Click="btnAnimate1_Click" Width="163" HorizontalAlignment="Left"/>
        <Button Height="40" Margin="0,0,37,70" VerticalAlignment="Bottom" Content="Animate2-scalex" x:Name="btnAnimate2" Click="btnAnimate2_Click" Width="163" HorizontalAlignment="Right"/>
        <Button Margin="24,0,0,26" VerticalAlignment="Bottom" Content="Animate3-opacity" x:Name="btnAnimate3" Click="btnAnimate3_Click" HorizontalAlignment="Left" Width="163" Height="40"/>
        <Button Height="40" Margin="0,0,37,26" VerticalAlignment="Bottom" Content="Animate4-opacity" x:Name="btnAnimate4" Click="btnAnimate4_Click" Width="163" HorizontalAlignment="Right"/>
        <TextBlock Height="124" Margin="8,8,8,0" VerticalAlignment="Top" TextWrapping="Wrap" x:Name="lblErrorMsg" FontSize="8" />
    </Grid>
</UserControl>

And here is the code (Page.xaml.vb).

Partial Public Class Page
    Inherits UserControl

    Dim s1 As New Storyboard
    Dim s2 As New Storyboard
    Dim s3 As New Storyboard
    Dim s4 As New Storyboard

    Public Sub New()
        InitializeComponent()

        'add storyboards to resources - not sure why, but I'm following examples I've seen
        LayoutRoot.Resources.Add("S1", s1)
        LayoutRoot.Resources.Add("S2", s2)
        LayoutRoot.Resources.Add("S3", s3)
        LayoutRoot.Resources.Add("S4", s4)
        'initialize the storyboard to animate the rectangle
        CreateAnimation(s1, "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)")
        CreateAnimation(s2, "(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)")
        CreateAnimation(s3, "(UIElement.Opacity)")
        CreateAnimation(s4, "(UIElement.Opacity)")
    End Sub

    Sub CreateAnimation(ByVal s As Storyboard, ByVal Prop As String)
        'create new doubleanimation
        Dim d As New DoubleAnimation
        'set timespan to half a second
        d.Duration = New Duration(TimeSpan.FromSeconds(0.5))
        'reverse animation
        d.AutoReverse = True
        'set target to the rectangle
        Storyboard.SetTarget(d, recMain)
        'we're animating x-axis scale - other props, like (Canvas.X) will work, though
        Storyboard.SetTargetProperty(d, New PropertyPath(Prop))
        'animating from start value of to 1
        d.To = 1
        'add doubleanimation to storyboard
        s.Children.Add(d)
    End Sub

    Private Sub btnAnimate1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        'begin animation when button is clicked - we'll get the error below the second time we click the button.
        'Cannot resolve TargetProperty (UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX) on specified object.
        Try
            s1.Begin()
        Catch ex As Exception
            lblErrorMsg.text = ex.ToString
        End Try
    End Sub

    Private Sub btnAnimate2_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        'begin animation when button is clicked - we'll get the error below the second time we click the button.
        'Cannot resolve TargetProperty (UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX) on specified object.
        Try
            s2.Begin()
        Catch ex As Exception
            lblErrorMsg.text = ex.ToString
        End Try
    End Sub

    Private Sub btnAnimate3_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        'begin animation when button is clicked - we won't get an error on animating
        s3.Begin()
    End Sub

    Private Sub btnAnimate4_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        'begin animation when button is clicked - we won't get an error on animating
        s4.Begin()
    End Sub
End Class