New blog/Blog reboot

by JasonRShaver 14. July 2011 15:43

About 4 months ago, my colocated server farm had an 'issue' that killed my old blog site.  I have been intended to recover and transfer the previous posts to this new site, but I never got around to it.  The downside to moving across the country for my job at Microsoft, is that I end up having to do so many other things that I never get around to doing the 'minor' things.  

Even this update was forced upon me.  My new Silverlight TV epidosde on Databinding Debugging in Silverlight 5 should be posted any day now and I needed a blog to post it to.  Ultimately this blog will consist of everything that ends up in my MSDN blog as well as anything else that interests me.

Tags: , , ,

Blog

Table Tennis Gear

by JasonRShaver 19. February 2010 17:03

 I find that I keep forgetting what I have, so I thought I would keep a post up here with a list.

And some old bats:

  • AR+, Butterfly Cretu
    • Just got rid of the old rubber, just bare wood for right now
  • AR+, Stiga Original WRB
    • Just got rid of the old rubber, just bare wood for right now
  • Off-, Killerspin Smash
    • Speed: 9.5, Spin: 9.5, Control: 8.5
    • Just got rid of the old rubber, just bare wood for right now

** UPDATE **

Well, since I wrote that, my wife started a table tennis online store, www.TTXOnline.com and as a result, everything changed =)

Tags:

Blog

Best SQL example ever...

by JasonRShaver 1. February 2010 17:02

 This is an example I saw today on Simple Talk:

 

CREATE TABLE "╚╦╩╗" ( "└┬┴┐" nvarchar(10))

DECLARE @ nvarchar(10)  set @='═'

INSERT  INTO "╚╦╩╗"

        ( "└┬┴┐" )

        SELECT  replicate(@,5)

SELECT  *

FROM    "╚╦╩╗"

 

Tags:

Blog

Christmas List 2009

by JasonRShaver 5. December 2009 17:02

Because it seemed effective last year, I am going to put my wants and desires online for all to see, I also going to try to break things up into context.

Golf

I have taken the sport of Golf pretty seriously over the past year or two and lets just say that I am not good enough to have my ball survive very long.  That being said, when looking for them in the brush or leaves, it is really annoying to find 15 balls and not know which one is mine.  So, someone please pick me up some golfs balls with my name (Jason R. Shaver) on them.  Any brand-name ball that is on the cheaper side is good ($14-20 per box of 12).  Recently I have been playing with Nike and Titleist.

I need a wedge to go between my Pitching and my Sand, called a 'Gap Wedge 52deg'.  There build I that matches my current set of clubs is from GigaGolf.com as follows: SGS, Gap Wedge 52deg, Winn V17-AVS Soft Midsize Grip, Standard Tre Temper Feather Flight - Firm Flex, +1 inch, +2 degrees Lie.  Should run under $50 if my memory is right.

Practice balls, I use them to practice in my living room.  Yes, I know that is a bad idea, but it makes me happy.  Anything of the 'wiffle' style works.

Home Enjoyment

It is about time I get a Blu-Ray player, and the LG DB390 ($259) (as at Best Buy for ~$270) seems to have the features I want.

In addition, my home center speaker has been dying since I left my mother's house.  It would like to go to sleep.  The younger, sexier version would be the Bose VCS-10 ($179) or the Yamaha NS-C225 ($149).

Also, I have this dream of mounting my TV on the wall and move the audio stuff to the back of the room.  To do this, I need a REALLY LONG video cable, such as this 50ft HDMI cable ($18) and/or this 50ft Component Cable ($49.99)

Yo-Yos

I am pretty happy on this front.  I find my skill advancement is no longer hurt by the performance of my Yo-Yos.  That being said, if someone was able to find an Audley L3, it would make me very happy.  I already own one, but they are extremely hard to find in the US and would like to have a spare or two.  They cost about $30-40 new in China, and in the States, anything under $60 is a good price.  I doubt anyone will find one though.

Otherwise I am pretty happy.  There are some things on my 'long term' plan, such as a Windows Home Server, but in general I find myself without that many 'needs'.  I will update this list if anything else comes to mind.

 

 

Tags:

Blog

Guidance on using CSLA’s EditableRootList for Management UIs

by JasonRShaver 28. October 2009 17:01

 

I commonly have the situation in my Silverlight 3 Line-of-business (LOB) applications of having a screen with the left side being a EditableRootList (such as CustomerList) and the right side being the EditableRoot (such as Customer) that is being edited.  As a note, you may want to use the “stretch” button at the top right of this blog to make the code more readable.  What I want is a UI where I can:

·         Add or Delete items from the list on the left

·         Modify items on the right

·         Have my Apply button save ALL the changes in the list.

Here are some of the key points in the XAML file, note the “emphasized” sections:

Defining the resources and CslaDataProviders:

<UserControl.Resources>

            <csla:CslaDataProvider x:Key="Customer"

                           ManageObjectLifetime="False"

                           IsInitialLoadEnabled="False"

                           ObjectType="Entities.Customer"

                           DataChanged="Customer_DataChanged" />

            <csla:CslaDataProvider x:Key="CustomerList"

                           ManageObjectLifetime="True"

                           IsInitialLoadEnabled="True"

                           ObjectType="Entities.CustomerList "

                           FactoryMethod="GetAll"

                           Saved="CustomerList_Saved"/>

            <core:NullToBooleanConverter x:Key="NullToBooleanConverter" />

            <core:VisibilityConverter x:Key="VisibilityConverter" />

            <core:DeletedToOpacityConverter x:Key="DeletedToOpacityConverter" />

</UserControl.Resources>

Defining the left side ListBox:

      <ListBox x:Name="listCustomers" ItemsSource="{Binding Source={StaticResource CustomerList}, Path=Data}"

                        SelectionChanged="listCustomers_SelectionChanged" >

            <ListBox.ItemTemplate>

                  <DataTemplate>

                        <StackPanel Orientation="Horizontal">

                              <TextBlock Text="{Binding Path=Name}"  

     Opacity="{Binding IsDeleted, Converter={StaticResource DeletedToOpacityConverter}}" />

                              <TextBlock Text="(Deleted)" Foreground="Red" Margin="2,0,0,0"

                                         Visibility="{Binding IsDeleted, Converter={StaticResource VisibilityConverter}}" />

                              <TextBlock Text="(New)" Foreground="Red" Margin="2,0,0,0"

                                         Visibility="{Binding IsNew, Converter={StaticResource VisibilityConverter}}" />

                        </StackPanel>

                  </DataTemplate>

            </ListBox.ItemTemplate>

      </ListBox>

And in your code behind, I put these helpers

      private CslaDataProvider CustomerProvider

      {

            get { return ((CslaDataProvider)this.Resources["Customer"]); }

      }

      private Customer Customer

      {

            get { return CustomerProvider.ObjectInstance as Customer; }

      }

      private CslaDataProvider CustomerListProvider

      {

            get { return ((CslaDataProvider)this.Resources["CustomerList"]); }

      }

      private CustomerList CustomerList

      {

            get { return CustomerListProvider.ObjectInstance as CustomerList; }

      }

And the general event handlers look like this:

      private void listCustomers_SelectionChanged(object sender, SelectionChangedEventArgs e)

      {

            CustomerProvider.ObjectInstance = listCustomers.SelectedItem;

      }

private void btnApply_Click(object sender, RoutedEventArgs e)

      {

            CustomerListProvider.Save();

      }

private void btnNewCustomer_Click(object sender, RoutedEventArgs e)

      {

            CustomerProvider.FactoryMethod = "NewCustomer";

            CustomerProvider.FactoryParameters.Clear();

            CustomerProvider.Refresh();

      }

private void btnDeleteCustomer_Click(object sender, RoutedEventArgs e)

      {

            this.CustomerProvider.Delete();

      }          

private void Customer_DataChanged(object sender, EventArgs e)

      {

            var ThisItem = Customer as Customer;

            if (ThisItem != null && ThisItem.IsNew)

                  if (CustomerList.Contains(ThisItem) == false)

                        this.CustomerList.Add(ThisItem);

      }

      private void CustomerList_Saved(object sender, Csla.Core.SavedEventArgs e)

      {

            CustomerListProvider.Refresh();

      }

And the “converters” required to make this work:

public class VisibilityConverter : IValueConverter

      {

            public object Convert(object value,Type targetType,object parameter,CultureInfo culture)

            {

                  bool visibility = (bool)value;

                  return visibility ? Visibility.Visible : Visibility.Collapsed;

            }

 

            public object ConvertBack(object value,Type targetType,object parameter,CultureInfo culture)

            {

                  Visibility visibility = (Visibility)value;

                  return (visibility == Visibility.Visible);

            }

      }

public class DeletedToOpacityConverter : IValueConverter

      {

            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

            {

                  bool IsDeleted = (bool)value;

                  return IsDeleted ? (Double)0.3 : (Double)1.0;

            }

 

            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

            {

                  throw new NotSupportedException();

            }

      }

And finally you need to make sure you EditableRootList implementations have a DataPortal_Update() implementation.  Here is a simple one:

protected void DataPortal_Update()

      {

         foreach (var Item in this)

         {

            Item.Save();

         }

      }

If you found this useful, please leave a comment.  If you find a way to do it better, PLEASE leave a comment.  

 

Tags:

Blog

Online patent lists

by JasonRShaver 1. September 2009 17:01

 I just came across this site: 

http://www.faqs.org/patents/inv/205753

and found it pretty cool that there is a list of my patents (my as in one of the inventors, not as in ownership).  

Tags:

Blog

New 'Danger' reporting rules

by JasonRShaver 22. July 2009 17:01

 There is a new report going around about Apple iPods going up in flames. The CPSC has received 35 confirmed reports of this happening. Some news stations are going to run 'special reports' on this information. I have a new proposed rule. Next to every statistic, you need to report your chance of being hit by lighting right next to it. For example. Odds of your iPod exploding on you since 2001: 1 in 5,952,380 Odds of getting stuck by lighting since 2001: 1 in 87,719 People hit by lighting for every person's iPod exploding: 67 And as backup info, there are ~300,000,000 people in the US and 398 reported deaths and injuries from lighting strikes each year.

Tags:

Blog

Zombies?

by JasonRShaver 21. July 2009 17:00

 Tell me this is not the best error message ever!  ZombieCheck!

 

System.InvalidOperationException
 
Message:
This SqlTransaction has completed; it is no longer usable.
 
Stack Trace:
   at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Rollback()
   at MobilePro.Data.TransactionManager.Rollback() in MobileProInvoice\MobilePro.Data (Generated)\MobilePro.Data\TransactionManager.cs:line 205
   at MobilePro.Services.CustomersServiceBase.Save(Customers entity) in MobileProInvoice\MobilePro.Data (Generated)\MobilePro.Services\CustomersServiceBase.generated.cs:line 904
   at MobilePro.Quickbooks.QuickBooksSession.ProcessCustomer(Customers qbCustomer, Customers mpCustomer) in MobilePro.Quickbooks\QuickBooksSession.cs:line 459
   at MobilePro.Quickbooks.QuickBooksSession.ProcessQuickbooksCustomers(List`1 customers) in MobilePro.Quickbooks\QuickBooksSession.cs:line 307
   at MobilePro.Quickbooks.QuickBooksSession.ProcessResponse(String response) in MobilePro.Quickbooks\QuickBooksSession.cs:line 259
   at MobilePro.WebService.QuickBooksWebConnector.Service1.receiveResponseXML(String ticket, String response, String hresult, String message) in MobilePro.WebService.QuickBooksWebConnector\Service1.asmx.cs:line 306   

 

Tags:

Blog

.TestRunConfig windows closes when clicking Code Coverage in VS2008

by JasonRShaver 20. July 2009 17:00

 Ok, I am seeing this all the time and finding the solution in Google is next to impossible, so I am hoping this gets indexed high so others can find it in the future.

If you try to change the property settings in the .TestRunConfig file in your project and you have any of the following product types in your solution:

  • VS2008 Database Edition GDR
  • Silverlight
  • WiX Installer Project

the dialog box closes automatically.  No crash, no error, just a nice clean close.  This also happens when you try to run the "Create Unit Tests" wizard by right clicking on your classes.

The issue is with the OutputLoc property for these project types, because they don't support the OutputLoc concept, they just throw a NotImplementedException whenever they get called, and the dialog does not seem to handle that well.  There are two solutions to this problem:

  • Unload the offending projects from your solution, do what you need to do, then load them back up.
  • Install the fix described in KB 962866

Tags:

Blog

Exchange 2007 messages going straight to Drafts.

by JasonRShaver 5. June 2009 16:59

So I had this issue today where all emails that I wrote would be sent to the 'Drafts' folder instead of sending.  I was also unable to recieve new emails as well.  At first I thought this would be some kind of 'back pressure' issue and ignored it, but when it kept happening and the server still had 50GB of hard drive space left and 1GB of RAM available I figured that something else must be wrong.

Well, it turns out the 'Microsoft Exchange Transport' server stopped (still can't figure out why exactly).  So I started it up and everything is fine again. 

Just a heads up for anyone with an issue like this where back pressure is not the problem.

Tags:

Blog

About the author

I am a software developer working for Microsoft in Redmond, WA.  In addition, my wife and I own TTXOnline, what is likely the 3rd largest table tennis store in the US.

Month List

Page List