• Shortcuts : 'n' next unread feed - 'p' previous unread feed • Styles : 1 2

» Publishers, Monetize your RSS feeds with FeedShow:  More infos  (Show/Hide Ads)

Date: Saturday, 10 Oct 2009 15:23

Join us for the 6th Desert Code Camp on November 7th, 2009.

I will be presenting the following 3 sessions:

Reactive Programming - Implementing IObservable(Of T)

The Reactive Exentensions (aka the Rx Framework) might be the most important change to the .Net Framework since Generics!

In this session I will show you how IObservable(Of T) and IObserver(Of T) can enable remarkable changes in the way you think about programming.

I will introduce you to how IObservable is the mathemeatical dual to IEnumerable as well as how to implement the pattern to create reactive programs using Observable Collections and Conditional Eventing.

This truly is a remarkable addition to .Net 4.0 that you absolutely MUST learn.

Implementing the MVVM Pattern in Silverlight

Learn about what the Model-View-ViewModel Pattern is and how to implement it correctly with Silverlight.

I will cover using Silverlight 3 as the basis for creating MVVM Containers and show how it all fits together. You will walk away with:

  • A complete understanding of the framework for building MVVM Based Line of Business (LOB) Applications with Silverlight.
  • What goes into each of the M, V and VM containers (and several more layers)
  • How to use Mock Data and Unit Testing in this Pattern

Using T4 and XML Literals to Create Web Templates

Learn how to combine XML Literals, WCF Factory Services and T4 to create fast, scalable Templates from your Data Models.

In this session I will focus on using T4 Templates to create custom HTML from your Data.

In this session I use Linq to Sql, but this same technique can easily be applied to the Entity Framework, Graphs, Reports, XAML and more.

Make Ajax calls to get custom rendered HTML streams back from easy to use WCF Factory Services and automatically insert them into DIV Elements for fast, scalable solutions with no Third Party Controls.

See you There!

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 14 Sep 2009 22:48

Guess what I’m going to be diving into in the coming months :-)

What is MonoTouch?

MonoTouch is the Mono edition for Apple's iPhone and Apple's iPod Touch devices.  MonoTouch allows developers to create C# and .NET based applications that run on the iPhone and can take advantage of the iPhone APIs as well as reusing both code and libraries that have been built for .NET as well as existing skills.

MonoTouch from Novell

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 27 Aug 2009 01:24

I think it's critical for us all to start rethinking how we build interfaces.

One thing about Ford/Microsoft Sync is that it is entirely designed to expect the user to be doing something other than thinking about how to make it do what you want (like driving)

With the coming onslaught of Win7, mobile devices, better voice and pen recognition as well as multitouch we need to stop thinking about mice and keyboards as the sole primary inputs.

Personally I am delighted we are finally able to use these reliably. Microsoft’s voice development team used to be known as the “wreck a nice beach” group… Today, the Speech SDK is very usable.  My primary input for Twitter is transferring to voice from my iPhone.  I never really thought the iPhone was a critical device until I actually bought one… I use it 100x more than my iPod Touch.  Gee, there’s no mouse on that thing, the interface suddenly needs to be different.  Right-Click? what’s that?

We have a lot to learn about input and information overload.  The web is really starting to suck badly for many people such as my mother.

She was trying to upload some pictures to share with the family and couldn't figure out how to coordinate between Explorer, Picasa, EasyShare and Gallery that all the different people were using, nor should she have to.  All this stuff is FAR too overwhelming for the non-Geek. Try explaining why an Album in Picasa isn't the same as a Folder in Explorer and one program puts things in Public Pictures and another in My Pictures.  Which click, right or left… single, double or triple click… this is madness.

We might also suggest Search but all the pictures are intelligently named things like img10472.jpg, etc. So what does she search for?  Teaching her to rename everything when importing is not so fun either.  Can she get Geo-Location on the camera? Maybe, but also limited use in searching. I have thousands of picture and have no idea who is in most of them.  Why can’t my Photo Browser recognize when I say “That’s Jake and Kelly on a Horseback Ride in Cave Creek”? Then promptly update the Metadata of photo its displaying?  It already has the date, so now a search might be worth something.

So what do we as designers and developers do? Alienate all non technically degreed users?  I have a friend from high-school that subscribes to my Facebook page, which echoes my Twitter feed. I laugh out loud nearly every time he replies that he has no idea what the heck I am saying… ever, which is frequent.  Computers are supposed to be tools, not instruments of torture or mass destruction.

I think it is up to us geeks to make these things more intelligent so not only is it easier for the user to shuffle stuff around from 3 or 4 cameras, notebooks, phones, music players, game devices, cars, TVs, etc. but at the same time make it so a developer of this stuff doesn’t lose their mind trying to accommodate the ever increasing demands of users who have no idea how to use any of this software nor any time to learn the intricacies of the interfaces.

One thing is for sure. The days of the dedicated PC are over. Sharing is important. No one cares how organized my files are or what they are named but I still need to find things. We need to be able to move important items from one place to another without hassle, often someplace other people have access to them who don’t care about your organizational skills.

I don't always type emails from a desktop computer any more. Sometimes it is my phone, sometimes it's my notebook. Can I easily sync my email?  Not really, Contacts... Harder... Calendar, next to impossible. In a semi-connected, mobile world mixed with different OSes, Consumer Electronics and PCs we have a lot to think about before we sit down and start hacking a program together for even the simplest tasks these days.

This was originally a post written on my iPhone in reply to thoughts about developing for things like Microsoft Sync in a language not supported because apparently Microsoft and Ford don’t think anyone is capable of writing apps for it.  I thought the idea deserved to be expanded just a little and blogged for more visibility because it is a driving force in what my company, Digital Dreamshop does.  We try to make interfaces for everyone, not just people who are used to using computers or can tweak settings here and there to make the software “work for them”.

More and more we are finding that people using our software know less and less about how a computer works and strive to accommodate that.  They are using our software to accomplish a task, if it’s overwhelming, “your software sucks”.  If you get in the users way, they hate your app.  I recommend reading http://www.whysoftwaresucks.com/ as well as David Platt’s book if you are not a developer.  Another good read is http://www.sensible.com/ even though the site truly sucks in appearance :-)  I recommend these for the general ideas they represent, not necessarily their solutions.

We will never live in a one philosophy world, especially when it comes to software, OSes and Interfaces, get over it and figure out how to make it easier to get things in and out of your application and how to treat the User as the one controlling the reason you have a job.

If your boss is telling you that their way is the only way and the users don’t know, quit and get a job with someone who gives a damn about User Experience. Old mentalities of forcing methodologies on users and putting them in a box is going to die fast. 

Our Applications need to talk to the outside world, both in terms of the Interface and the Data.  One thing is for sure, the number of devices, programs, and the data they contain will only grow with time.  How will your Applications interact in that world?  Do you even have a plan?

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 26 Aug 2009 22:28

Jeff makes several Great points here about Regions,  Comments, Threading, Refactoring and Naming conventions.

We don’t always practice them all here, but strive to do better.  Most of our Code Generation templates do output code that is very descriptive and readable even if we don’t expect people to read the code, the Philosophy is along the lines of “but what if we need to during debugging or something…”  Having clear and concise coding guidelines makes that task much easier.  Describing what something is supposed to accomplish in the comments has been an essential practice for a long time, code no longer describes itself when you are not writing monolithic apps, even then it was a sure challenge just to find things.

Great custom control development is a skill that takes more than time and experience to perfect. It’s also not a widely documented practice. When it comes to Silverlight controls, there are similarities and differences from WPF custom control development, too – so that chapter on controls in your favorite WPF book often is not directly applicable.

I do admit that there’s a lot of flexibility in control development, so I’ll be basing a lot of my tips on both official and unofficial practices on the Silverlight Toolkit team. And I understand if you don’t agree with everything I have to say. But I do hope this information will be useful!

Jeff Wilcox – Custom Control Development: Simple code guidelines

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 14 Aug 2009 23:21
My Technobabble

Lately there is a lot of momentum and interesting conversation around Model-View-View-Model. There’s several good resources out there that discuss the basics of the pattern, who the actors are that are involved and what role the play. I’ll let those speak for themselves, including John Gossman’s great post here, Martin Fowler’s post on the more general PresentationModel pattern and more recently Josh Smith’s MSDN article, Rob Eisenberg’s new series, and Ward Bell’s posts which touch on some of the deeper complexities involved.

In many of these discussions (not including the posts I referred to) it seems like one aspect of ViewModel get’s lost, which is “Why use it in the first place?” This leads to a lot of debate around details of implementation including one item in particular which is whether or not code in the code-behind is an anti-pattern. Building off of the stage Phil set in his great LOD post, I’ll say ViewModel is not a code-counting exercise.

These are all GREAT points. 

Something else Glenn covers is Commands:

The last thing I want to touch on relates to invoking commands, and usage of command parameters through element binding, vs using bound properties on the ViewModel. The user selects an item in the Order list, and double clicks. Do we a) Use element binding and have clicking on the “Open Order” button invoke the OpenOrder command passing in the currently selected order as a parameter, or b) Set the orders list selected item to bind to a SelectedOrder ViewModel property and then have a parameterless OpenOrder command which uses the SelectedOrder order property on the VM itself.

I agree with his assessment that this stuff should use method B.

My reasoning is sort of the same.  Element Binding is nice, but it does make the Designer responsible for something that should be in a Unit Test and this I feel is a no-no.

Element binding is useful for scaling with a slider, but NOT for changing display based on Persisted Data; that relationship belongs in the ViewModel.

Views can have code as long as they exclusively touch Display Only elements, an example would be Style Changes, if you need to invoke some code to load a resource, then that should be in the ViewModel, but to invoke a change based on binding, like a trigger, that may be perfectly fine in the View.

While we are still in the beginnings of applying these patterns to Silverlight, I should point out that if we are forced to overcome a “bug” in rendering, keep that in the View, because the ViewModel just gets muddied up if you don’t; especially if you intend to share your ViewModel with WPF.  Most likely the same “bug” would not exist in both UIs.  Then when a refresh is done and the “bug” goes away in Silverlight, you only have to deal with a change in the Silverlight View.

Maintainability is the key here and the reason these patterns exist.  Keep your code where it belongs for maintainability and you a following the pattern correctly.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Sunday, 09 Aug 2009 12:37

The August 2009 meeting of the Phoenix Silverlight User Group featured a fabulous demonstration of Prism with Silverlight.

Adam J Wolf presented a great sample of a project he created.

The Silverlight Prism Prezi was also very impressive and Comprehensive (click the link to view it.)

Adam dove into lots of code and walked us through how Prism makes a compelling case for Flexible, Loosely-coupled Silverlight development.

He showed us how a Modular Design can speed development and offer great flexibility for the future of your App.

One particular part of the Architecture I really liked was how he made a Secure Shell, then loaded all the components from independent XAPs.

This allowed his App to start fast and dynamically get the components it needed on first run, then cache those for future use.

Hats off to Adam for delivering a tremendously useful presentation.

Tim Heuer stayed afterward and showed us the new HP TouchSmart tx2z multitouch enabled Tablet.

This got many people thinking about how Touch can be really useful and change the way some UI elements are engineered.

Thank you again to Adam and Tim for making this another great meeting.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 06 Aug 2009 23:29

With the introduction of Windows 7 we have a new method we can use for booting. There is also a backport for Vista if you are so inclined to still run that as your main OS

The Windows(R) Image to Virtual Hard Disk (WIM2VHD) command-line tool allows you to create sysprepped VHD images from any Windows 7 installation source. VHDs created by WIM2VHD will boot directly to the Out Of Box Experience, ready for your first-use customizations. You can also automate the OOBE by supplying your own unattend.xml file, making the possibilities limitless.
Fresh squeezed, organically grown, free-range VHDs – just like Mom used to make – that work with Virtual PC, Virtual Server, Microsoft Hyper-V, and Windows 7’s new Native VHD-Boot functionality!

Win7, 2008 R2, Boot from VHD and more! - Christopher Kusek, Technology Evangelist

I am using this same technique for my main desktop and Laptop.  By creating the VHD images I just copied it to the new machine ran my BCDEDIT script and booted.

No re-install from DVD, find an ISO Loader, etc.

Welcome to the new Virtual World.

In addition, I now employ Differencing Disks on my MAIN OS.  You know what this means?

I can install Betas to my heart’s content and run them at pretty much full speed with no worry of trashing my OS. I am getting about a 3% performance hit from the VHD on an SSD and I have FULL Hardware support.

I have never liked the 10% or more performance hit I was getting from Virtual Machines as well as the pain of double Natting and hardware limitations they have.

BootFromVHD is really awesome for a development machine or for someone who tends to try out a lot of software.  If something goes horribly wrong, simply drop the Differencing Disk.

You do have to take merging down the differencing disk into consideration, as well as creating a new one before installing big Betas but they are stackable.  I have 4 or 5 differencing disks sometimes. for example, I have VS2010 and VS2008 in separate spaces and a third that has them side by side. Then I have a differencing disk for trying out new programs.  My Main OS Install is not touched unless I merge the differencing disk down.

There are some drawbacks, you can’t BootFromVHD with anything but Windows, and only with Vista, Server 2008 and Win7, but that is fine for me, I don’t need to boot to Linux or XP on my dev boxes.  You also can’t do some things like Windows Experience Index, but I don’t need to do that most of the time and I have other machines for that sort of thing.

I would suspect that at some point this will become a pretty common scenario once Windows developers figure out just how nice it is to develop in this environment.

One thing that always bugged me was installing device drivers in a VM, it’s much easier with BootFromVHD and if the driver BSODs, bye-bye differencing disk, no restore/rollback necessary.

Here is a guide for doing it with ONLY the Win7 Install CD if you don't need/want a sysprepped image


Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 10 Jul 2009 10:22

This is awesome and exciting!

Some of the places to look might be hard to find until later today, the sites are all being updated.

Christian Schormann (Blend PM) has kindly provided a set of working links to everything available now.

Silverlight3 RTW, Blend3, SketchFlow, DeepZoom Available for Download

He also has terrific posts and demos about the Concepts and Overviews

Watch Visual Kitchen here: http://vepexp.microsoft.com/seethelight

And go visit See the Light for a nice vision of what the new versions of Silverlight and Blend can do to help your development shine.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 03 Jul 2009 16:41

Dave McCarter has released a great package of Tips and Helpers.

After lots new coding, refactoring and upgrading to .NET 3.5, dotNetTips.Utility 3.5 is finally released! This assembly is much of the common code I have been writing for the past 8+ years all wrapped up in a nice package and easy to use.

read more: dotNetTips.Utility 3.5 Released

What’s great about this is that you will get some serious tools and the VB.Net source to see how they work.  Dave is a proponent of Standards and you can see in this library how he implements some of the techniques he talks about.

From AvailablePhysicalMemory to UsStateCollection the helpers get you from nowhere to somewhere fast.

Highly Recommended!

Codeplex Project: http://dotnettips.codeplex.com/

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Wednesday, 01 Jul 2009 09:00

Antonio has put together a great list of VB Influencers to follow on Twitter

Antonio Chagoury - Tweeps List: Microsoft Visual Basic MVP’s

While his title says MVPs, there are some other influencers listed

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 29 Jun 2009 07:59

Who is the “typical VB.NET developer”? Is there one? There are millions of VB.NET developers in the world, and they each have their own unique story.

Here’s mine:

· How long have you been using VB?

Since V1. In 1992, I was looking for a replacement to QBasic when developing a Point of Sale Application for Windows.

· What industry do you work in?

Software Development. We are very diversified in our client base, touching Medical Records, Financial Services, Home Automation, Factory Floor Control, Online Gaming, Media and Training.

· How big is your development team?

We are a small shop in terms of size. We leverage Code Generation heavily to compensate for not having code monkeys to type in all the repetitive code that goes along most applications.

· What kind of apps do you most commonly build?

Line of Business Web Applications.

· What’s the most interesting app you’ve ever built?

That's Top Secret. :-) I am doing my most interesting app development right now! Think Silverlight, Home Automation and Green Technology. Details will come out soon.

· Please tell us about an app that you’re working on at the moment.

Currently one of my applications is a system for helping Non-Profit Organization raise funds and advertise. We built the Proof of Concept in Silverlight 1.1 and are currently re-engineering for release in Silverlight 3.

· What other technologies do you most commonly use?

Code Generation, this is a pretty broad definition... I use many technologies depending on the needs of my client. Some of those include: Silverlight, WCF, ASP.Net, ASP.Net MVC, MEF and nHibernate.

· What are some of your favorite VB features?

XML Literals, Background compiler, Linq syntax in VB, Case Insensitivity.

· What do you like most about VB as a programming language?

I like VB because I can use it everywhere I work (asp, silverlight, office) and still retain a sense of familiarity with my syntax. VB code is much easier for me to read and review than other more cryptic languages. Also pretty much EVERYONE can read and understand my code... even the perl developers. I can't really say that about any other language.

For other interviews in this series, please visit http://imavb.net.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 23 Jun 2009 14:12

I do lots of work with collections and one thing I tend to frequently is log all the information I can about a certain Request under certain conditions.

I found myself needing to serialize or save all the Request.ServerVariables.

Now, we could walk through the items, blah, blah, blah, this ends up being much easier with an Extension Method:

Public Module NameValueCollectionExtension
    <Runtime.CompilerServices.Extension()> _
    Public Function ToXElement(ByVal self As NameValueCollection, ByVal RootElementName As String) As XElement
        With self
            If RootElementName = Nothing Then
                RootElementName = .GetType().Name
            End If

            Dim xel As New XElement(RootElementName)
            If .HasKeys Then
                For i As Integer = 0 To .Count - 1
                    xel.Add(New XElement(.Keys(i), .Item(.Keys(i))))
            End If
            Return xel
        End With
    End Function

    <Runtime.CompilerServices.Extension()> _
    Public Function ToXElement(ByVal self As NameValueCollection) As XElement
        Return self.ToXElement(String.Empty)
    End Function
End Module

To use this in your code, save the above as a Module.

Then in your ASPX Code Behind or elsewhere applicable (like Silverlight), simply use this:


Dim data = Request.ServerVariables.ToXElement()

Or This:


Dim data = Request.ServerVariables.ToXElement("ServerVariables")

I took the consideration of allowing you to set a ROOT Element if you don’t want to use the Variable’s Type Name by providing an Override that accepts a String for the Name.

Et, voila! You have a perfectly good XML Snapshot of all the Request’s Server Variables:

              HTTP_CONNECTION: Keep(-Alive)
              HTTP_ACCEPT:image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
              HTTP_ACCEPT_ENCODING: gzip, deflate
              HTTP_ACCEPT_LANGUAGE: en(-us)
              HTTP_COOKIE: ASP.NET_SessionId = *********************
              HTTP_USER_AGENT:Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; MS-RTC LM 8; .NET CLR 4.0.20506)
    <ALL_RAW>Cache-Control: no-cache
             Connection: Keep(-Alive)
             Content-Length: 7654
             Content-Type: application/x-www-form-urlencoded
             Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
                     Accept(-Encoding) : gzip, deflate
                     Accept(-Language) : en(-us)
             Cookie: ASP.NET_SessionId = *****************
             Host: localhost:22318
             Referer: http://localhost:22318/Public/MyPage.aspx
             User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; MS-RTC LM 8; .NET CLR 4.0.20506)
    <HTTP_ACCEPT>image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*</HTTP_ACCEPT>
    <HTTP_USER_AGENT>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; MS-RTC LM 8; .NET CLR 4.0.20506)</HTTP_USER_AGENT>


Remember, this is NOT limited to HttpServerVariables, it works with ANY NameValueCollection.

This can be a huge amount of data depending on what you are doing.  You can always use Linq to get a subset of the Collection, or .Remove() some known XElements, like ALL_HTTP, ALL_RAW or All the empty nodes before persisting or displaying this.

Extension Methods offer a great solution to common problems when you don’t have access to write a Method for the Class.  They are also great for making shortcuts to common scenarios for work you do with Collections or Conversions.

Click here for another useful extension for NameValueCollection by Tony Cavaliere from which I derived this idea, Thanks for sharing Tony!

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 19 Jun 2009 10:30

Lisa Feigenbaum from the .NET Managed Languages Group about Visual Basic .NET. Does VB.NET have a future ? Does Microsoft love C# more than VB.NET? Listen and find out.

Of course it does… As Lisa says, it’s not in Microsoft’s best interest to stop moving VB.NET forward.

Yes, there is a bias about VB in general, but 99.9% of this comes from VB perception and not VB.NET.  VB.NET is completely different and people do not realize it’s only related by SOME (not nearly all) syntax.  The underlying IL is not really any different from C# when compiled.  This is a marked difference in the way VB works internally.

Overall, I think this is a good refresher for people who (quite wrongly) think VB is going nowhere.  VB is here for the long haul, bashers need to just get over it… You will see VB.Net development continue for the rest of most of our careers.  That makes me a very happy developer. 

Anyone still bashing VB is A) ignorant of what VB.Net really is and B) no different from being a racist, beating a drum that is stupid and irrelevant.

Misfit Geek Podcast

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 15 Jun 2009 14:23

I was looking for a way to create some Repeating Strings easily and I got tired of typing.

You may notice that the String() constructor will allow you to create single repeating characters, but it does not let you create repeating Strings.

For example, creating this is simple:

Dim zeros As New String("0", 10)

which results in a String of ten zeros or “0000000000”.

This is a great way to make String with a single repeating character.  So how to I repeat whole strings?

The first technique would be to use StringBuilder.Append, which is pretty efficient and apparently what most people use.

Then I saw this fairly old (2005) post from Eddie Garmon.

As a result, here is my VB version of String.Repeat()

Public Module StringExtensions
    ''' <summary>
    ''' Maximum performance for Initializing a repeating String
    ''' </summary>
    ''' <remarks></remarks>
    <Runtime.CompilerServices.Extension()> _
    Public Function Repeat(ByVal input As String, ByVal count As Integer) As String
        If input Is Nothing Then
            Return Nothing
        ElseIf (input = String.Empty) OrElse (count < 1) Then
            Return String.Empty
        End If
        Return String.Join(input, New String(count) {})
    End Function
End Module

NOTE: in VB, don’t forget the {} Initializer or String uses the wrong Constructor and you get a compile error.

Now I have a really simple way to create repeated strings:

Dim repeated = "<col/>".Repeat(5)

or this:

Dim repeatThis = "<td></td>"
Dim repeated = repeatThis.Repeat(5)

which is easier to type than:

Dim repeated = String.Join(input, New String(5) {})

In addition, it’s going to handle the basic Error Trapping so I don’t have to repeat that every time too.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Monday, 01 Jun 2009 12:23

Right on the heels of the last major Phoenix event, we are happy to have Jaime Rodriquez and Karl Shifflett presenting a FREE 2 day course on the subject.  If you can possibly get there, then you should.

Registration Link

Day One:

  • Lap Around WPF
  • WPF Tools ( Blend, Visual Studio 2008)
  • Graphics Subsystem
  • Layout
  • WPF Fundamentals and new concepts
    • Application Model
    • Dependency Properties
    • Trees (logical & visual)
    • Events
    • Threading
    • Resources
  • Controls
  • Styling
  • Templating
  • Q&A with instructors at end of day

Day Two:

  • WPF integration with Win32 and Windows Forms
  • Data binding
  • Introduction to Model-View-ViewModel
  • Commanding in M-V-VM
  • Views, Navigation and Transitions
  • Data Validation
  • Error handling, Model dialogs, Logging
  • Unit Testing
  • MVVM & LOB tips and tricks
  • Q&A with the instructor

Knowing Karl, this is going to be a really DEEP DIVE, not a simple demo of stuff we would never use in production.  I was very impressed by what Jaime presented last week and I was sorry to see him cut short.

I’ll be there helping out when I can on the Silverlight side of things and with M-V-VM the Architecture Pattern in General.

The real thing about programming in an architectural model like this is that it is a complete paradigm shift from the Winforms or Asp.Net style of programming.  The Architecture is the most important thing to understand when you are creating Applications with these new Frameworks.  Understanding the Architecture in full will help you to understand how what YOU do every day fits into that structure, making you a more valuable team member.  If you are a Team of One, then it is even more important for you as a developer to really “get this.”

Every one of these concepts also applies to Silverlight, with the possible exception of Win32 Interop.  If you think you would look more to Silverlight than WPF this tour is still going to help you in 90% of its content.

Here’s a quote from Jaime:

“Yes, joining our training and learning WPF will help you learn Silverlight. In fact, having trained both in the past, I think our training will help you much better understand Silverlight and prepare for the future. Things like Dependency Properties, RoutedEvents, are in Silverlight, but are not fully implemented yet. In our WPF training, we explain the whys and hows of all of these. Some of this goodness will continue to trickle into Silverlight over time and I have heard from people it helps to understand the design principle behind it.”

See you There!

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Friday, 24 Apr 2009 12:20

AZGroups is pleased to present their 2009 Main Community Event featuring Scott Guthrie, Glenn Block and Jamie Rodriguez.

Here are the details and the link to register at the bottom of the post.


Presented By Scott Guthrie (ScottGu)

We’ll walkthrough building an application from scratch using the recent ASP.NET MVC 1.0 release.  You’ll learn what ASP.NET MVC is, the design decisions behind it, and how to build a real application with it.  We’ll cover topics ranging from the basics of application creation through to concepts like unit testing and dependency injection.
Silverlight 3

Presented By Scott Guthrie (ScottGu)

We’ll walkthrough building applications using the new Silverlight 3 release.  We’ll cover some of the power the new SL3 release provides, and then dive into how to program applications with it.  We’ll cover how to build data applications with it, build eye popping graphic solutions, and enable out of the browser applications with it.

Building openly extensible applications in .NET 4.0

Presented By Glenn Block

Are you tired of building monolithic style apps? Are you tired of hacking your app to bits to meet just one more requirement. Do you want to enable third parties to provide add-on value to your apps?  If the answer to any of these is yes, then come learn about the new Managed Extensibility Framework which ships in .NET 4.0.  Applications built on MEF dynamically discover and compose available components at runtime. This makes MEF ideal for third-party extensibility scenarios, where the type and number of extensions are undefined. With MEF you can enable customers and third-parties to take your apps where no man has gone before. 
The Microsoft Client Continuum: Sharing code, skills and tools between WPF and Silverlight

Presented By Jaime Rodriguez

Are you wondering why Microsoft has both WPF and Silverlight?  Do they really need two technologies (given how similar they are)?  This session will walk you through the different scenarios that both Silverlight and WPF are addressing today, we will cover the similarities, and differences between the platforms, and share pragmatic advise for building applications that exploit both platforms.


Scott Guthrie is corporate vice president of Microsoft's .NET Developer Platform, where he runs the development teams responsible for delivering Microsoft Visual Studio developer tools and Microsoft .NET Framework technologies for building client and Web applications.
A founding member of the .NET project, Guthrie has played a key role in the design and development of Visual Studio and the .NET Framework since 1999. Guthrie is also responsible for Microsoft's Web server platform and development tools teams. He has also more recently driven the development of Silverlight – a cross browser, cross platform plug-in for delivering next generation media experiences and rich internet applications for the Web.
Today, Guthrie directly manages the development teams that build the Common Language Runtime (CLR), ASP.NET, Silverlight, Windows Presentation Foundation (WPF), IIS, Commerce Server and the Visual Studio Tools for Web, Client and Silverlight development.
Guthrie graduated with a degree in computer science from Duke University.

Jaime Rodriguez is a Senior Technical Evangelist in Microsoft's Client Evangelism team. Jaime's current mission is to show customers how easy it is to accomplish both great software architecture and amazing user experiences using Windows Presentation Foundation and Silverlight. You can follow Jaime's musings at http://blogs.msdn.com/jaimer.
Glenn Block is an industry expert with broad enterprise software development experience including architecture and system design. Strong proficiency in designing software frameworks and infrastructure. Driver of technical strategy for small and large organizations. Professional speaker who has presented at both industry and community events.
Glenn Block’s Specialties:
Agile practices, Architecture, Design patterns, Driving Technical Strategy, Program Management, Product Planning

Registration: AZGroups.org 2009 Scott Guthrie Event

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 23 Apr 2009 13:43

Serge came up with a cool use of the Twitter API for his blog…

Twitter Ticker - VB

25 latest tweets about Visual Basic

sergeb.com: Twitter Ticker - Visual Basic

Nice idea to get live aggregated info from social networks that apply directly to your content

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 23 Apr 2009 12:16

Found this link today… awesome stuff here, expect a VB sample here soon.

Declarative language constructs like query comprehension syntax often worries imperatively trained developers. I hear this quite a bit, and the excuse of “It Just Works” is often not satisfactory for most of them :-). Combine this with interesting behavioral differences like lazy evaluation and lots of developers get lost in paradise.

Actually the perceived problem is not with LINQ itself, typically a lack of solid understanding about the query execution model causes grief. So one thing that can help to address this problem is a better visualization of how a query executes. Advanced query “providers” like LINQ to SQL offer logging capabilities to inspect what’s going on, but LINQ to Objects lacks such a capability.

In this post, we’ll have a look at possible approaches to make debugging LINQ to Objects (and hence LINQ to XML) queries easier. At the end of the day you’ll come to the conclusion it all boils down to knowing precisely what the semantics of the various operators are and how the execution works in the face of laziness etc.

LINQ to Objects - Debugging - B# .NET Blog

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Thursday, 09 Apr 2009 10:05

I found this today from Paul Welter… Easier way to page Linq queries.

Here is the Proper VB Equivalent Snippet:

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Public Module PageQuery
    ''' <summary>
    ''' Easily get Pages for an IQueryable(Of T)
    ''' </summary>
    ''' <typeparam name="T">any IQueryable supported Type</typeparam>
    ''' <param name="query">The Query we are Paginating</param>
    ''' <param name="page">Page Number (starts at 1)</param>
    ''' <param name="pageSize">Number of Items per Page</param>
    ''' <returns>Reduced query with a single page of information</returns>
    ''' <remarks></remarks>
    <Runtime.CompilerServices.Extension()> _
    Public Function Paginate(Of T)(ByVal query As IQueryable(Of T), _
                                   Optional ByVal page As Integer = 1, _
                                   Optional ByVal pageSize As Integer = 10) As IQueryable(Of T)
        If query Is Nothing Then Return query
        Dim skip = Math.Max(pageSize * (page - 1), 0)
        Return query.Skip(skip).Take(pageSize)
    End Function
End Module

I found this to be more intuitive for doing this:

Dim query = From row In db.Invoices _
            Order By row.InvoiceID Descending _
            Select row
Return query.Paginate(page, pageSize).ToList()

Instead of this:

Return query.Skip(skipRows).Take(takeRows).ToList()

Notes: VB doesn’t like the Namespace in the C# Sample code and it’s not needed for us.  Also remember you should always use an Order By when Paging.

I also added a trap so that if the Query is Nothing it doesn’t throw a NullReferenceException.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Date: Tuesday, 07 Apr 2009 11:53

Eric has released PLINQO version 3.0 in BOTH C# and VB for CodeSmith

Changes are an inevitable part of any project. The LINQ to SQL designer in Visual Studio provides a lot of support for manipulating entities, but does NOT make it easy when a refactor is required. The LINQ to SQL designer requires that the entity be dropped and recreated to generate the necessary updates. When the entity is dropped, any updates made for that entity are also lost and now must be re-created. This is time consuming, tedious and results in work being done over and over again. With PLINQO, make changes, right-click, generate, DONE!

PLINQO Rules! Yes, PLINQO provides several different ways to lay down the law. Rules can be added programmatically or declaratively through attributes. Constraints like property length and required field rules can be enforced. Regular Expression data validation as well as several built in rules including authorization rules are possible with PLINQO. Before any data is saved, the rules are automatically executed against any entities in your change set. If any rules are broken, a BrokenRulesException will be thrown with a list of the rules that were broken and the entity will not be updated.
The PLINQO rule manager generates rules based on the schema and any custom rules can be added to the rules collection. The rules are enforced when any attempt to save changes is made. Custom rules are a snap to add and the AddSharedRules partial method on each entity is the place to add them. Only a few lines of code and a custom rule can be added.

PLINQO - Supercharged LINQ to SQL

Very good stuff here.

Author: "H. Steele Price, IV"
Comments Send by mail Print  Save  Delicious 
Next page
» You can also retrieve older items : Read
» © All content and copyrights belong to their respective authors.«
» © FeedShow - Online RSS Feeds Reader