26 May 2010

My Fav Blogs

Going to keep a list here of my fav bugs & online posts

My all time favourite (a toss up by SSW rules & How to report bugs effectively)

How to Report Bugs Effectively
by Simon Tatham, professional and free-software programmer



SSW Rules to better



Scott Hanselman : Tools List

Beth Massi's blog (excellent stuff)



Non IT Related

Belfast food reviews

19 May 2010

New Selection Editor Tips

None Slip editing enhancements (this update is mainly enhancements to slip editor although a few bugs have been fixed).

  • Entry of Irish Lotto Results from SIS (fixed)
  • Entry of 49s Results from SIS (fixed)
  • Settling of Fav/2nd Fav (fixed)

Enhancements to bet slip editor

  • Warnings on no rule4 applied before payout
  • Warnings on amended result before payout
  • Warnings on Stewarts Enquiries or Objections before payout

See bottom of document for screenshots.


The new results viewer is much easier on the eye


  • Dead heats/Co Favs etc... highlighted in yellow

What you will notice 


  • Some new shortcut keys (so it may take a bit of getting used too) 
  • Switching sports (e.g. Ctrl + L is much faster)
  • Filtering when typing selection names is much faster
  • Numbers editor defaults to forty nines upon login, and then last edited numbers game, for subsequent ctrl + N calls until you log back out. 

Ctrl + E will return you to text entry textbox at any time (without having to refresh coupon)
Tip: You would use this if you had clicked elsewhere, and wanted to go back to editing another selection

If using the arrow up and down to enter a selection, use "+" key on keyboard to add that particular selection (rather then the enter key)

Entering Dogs/Horses by time & number (of fav)
Tab over to the time filter text box

  • You can filter time by entering exact time (e.g. 3.05) or if you just enter 3 (it will show all races between 3pm & 4pm – and you can use up down arrow to select).  If only one race is shown the Market list box will go green. 
  • If more than one race matches your search criteria use the up down arrows (or mouse) to select appropriate race.
  • Once you are happy with the race click [Space] or [Tab] and enter your numbers of favourites
    • 2 3 (will select numbers 2 & 3)
    • 2 f (will select number 2 & the favourite)
    • 2 2f (will select number 2 & the second favourite)

How was this achieved in code?
  • Enhanced reading from database (using stream data instead of database tables)
  • Local caching of data, to prevent database calls, if stream data is not updated
  • Enhanced filtering during editing using LINQ instead of dataview

    Screenshot | 1 (Amended result + no rule 4 warning)

    R4 Missing & Amended result

    New Results Viewer

    18 May 2010

    DatagridView : Sort Generic List on any property (minimal code)

    Had been wrecking my head with this for a few hours but got a good solution (with very little code).
    Okay so it using reflection and mightn't have order log n speed, but so what if you are sorting collections with normally less than 50 items.

    I handle the Column Header Mouse Click
    Get the data property name.
    Then use some reflection to sort the generic list.  (before this I had to use select case, and sort by knowing the property name in code, but when I add new properties this was a pain to maintain).


        Private Sub SelectionsCollectionsDataGridView_ColumnHeaderMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles SelectionsCollectionsDataGridView.ColumnHeaderMouseClick
            Try
                Dim col = Me.SelectionsCollectionsDataGridView.Columns(e.ColumnIndex)
                Me.selectedMarket.SelectionsCollections.Sort(Function(p1, p2) p1.GetType.GetProperty(col.DataPropertyName).GetValue(p1, Nothing).CompareTo(p2.GetType.GetProperty(col.DataPropertyName).GetValue(p2, Nothing)))
                Me.SelectionsCollectionsBindingSource.CurrencyManager.Refresh()
            Catch ex As Exception
                MsgBox(ex.ToString, MsgBoxStyle.Critical)
            End Try
        End Sub