Setting up Microsoft Lync from Office 365

After installing Lync on my 64-bit PC using 64-bit intall it would not connect.

Cannot sign in because the server is temporarily unavailable. If the problem continues contact your support team

Solved with the steps on this site:

http://community.office365.com/en-us/f/164/p/21113/99750.aspx#99750

specifically:

Configure the Lync settings
==============================

  1. In the upper-right area of Lync 2010, click the Gear icon to open the Options page.
  2. In the Lync – Options dialog box, click Personal.
  3. Next to the sign-in address, click Advanced.
  4. Make sure that Manual Configuration is selected and that the configuration values are exactly as follows:

Internal server name or IP address: sipdir.online.lync.com:443
External server name or IP address: sipdir.online.lync.com:443

I did not need to change the firewall. So any changes I had tried, I reversed and removed.

Muda

Japanese for Waste

  • Inventory
  • Motion
  • Defects
  • Over-Processing
  • Waiting
  • Over-Production
  • Unnecessary Transport

How do I … create a Custom DataGridViewColumn and DataGridViewCell

Uses may include:

  • Storing extra data in a cell
  • Controlling SortMode for all columns
Public Class DataGridViewPlanColumn
    Inherits DataGridViewTextBoxColumn

    Sub New()
        Me.CellTemplate = New DataGridViewPlanCell
        Me.SortMode = DataGridViewColumnSortMode.NotSortable
    End Sub

End Class

Public Class DataGridViewPlanCell
    Inherits DataGridViewTextBoxCell

    Property WO As Nullable(Of Integer)
End Class

How do I … use Reflection to build a project that will inspect/analyse other assemblies

For instance:

  • My preference is that TableAdapters are not in the component tray of forms, but ideally in a DAL, or if not that good then in a using part of the forms code. I have always struggled to find these. I want a Reflection utility that will find these

Key reflection code snippets to do this are:

How do I … use reflection to load an Assembly at runtime

Dim asm = System.Reflection.Assembly.LoadFrom(AssemblyFileName)

or

Dim asm = System.Reflection.Assembly.GetExecutingAssembly

How do I … loop around forms of a Loaded assembly

ForEach t1 In asm.GetTypes.Where(Function(f) f.IsPublic).Where(Function(f) f.BaseType.Name = “Form”)

Me.ListBox1.Items.Add(String.Concat(t1.Name))

Next

How do I … loop around forms and GetFields

For Each f1 In asm.GetTypes.Where(Function(f) f.IsPublic).Where(Function(f) f.BaseType.Name = “Form”)

For Each prop In f1.GetFields(Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic).Where(Function(f) f.Name.ToLower.Contains(FieldName))

Me.ListBox1.Items.Add(String.Concat(f1.Name, “: “, prop.Name, “: “, prop.FieldType.Name))

Next

Next

 

How do I … move projects to a different collection in VS-TFS

After a few years I got to a point of over 40 projects in one solution. Solution explorer required a vertical scroll bar even before expanding any projects.
Some projects are clearly not relevant to the solution or are abstract. I was keeping them in the solution because I wanted to promote abstraction, so wanted to regularly change these projects. Because they are abstract there is an argument to separate them out and potentially use them elsewhere.

I have taken the plunge. And this article is to record how I have done it.

There are other views and procedures on web.
Also in Microsoft Connect there is a request for this feature to be added.

I found the following to work and seemed easier than the other procedures:

  1. Make sure project is loaded in current solution
  2. VS IDE File > Source Control > Change Source Control
  3. Select project to move > Unbind > OK ( this may be reversed by binding again )
  4. In Solution Explorer remove the project
  5. Save all
  6. In Windows Explorer copy the project to the location of the destination collection
  7. Close Visual Studio if ncessary saving the changes to the solution
  8. Open the destination collection
  9. Add the project.
    • If you miss out step 3 then it will not show as to add to source control
    • If you include step 2 then it will show to add to source control
  10. Check-in optionally with a work item
  11. You could potentially keep the project in the original solution and use > File > Source Control > Add project from Source Control
  12. Or more common delete by:
    • > Source Control Explorer > Selecting the folder > Right-click Delete > Check-in
    • This will not delete it from the local folder > so this may be deleted manaully > you may need to close the current solution

How do I .. use Reflection to get the values of an Enum at runtime

Thanks to:
http://www.vb-helper.com/howto_net_list_enum.html

Module Module1

Sub Main()

ForEach field As System.Reflection.FieldInfoInGetType(TestEnum).GetFields.Where(Function(f) f.IsLiteral)
  ‘Console.WriteLine(field.Name + vbTab + CInt(field.GetValue(Nothing)).ToString)
  Console.WriteLine(CInt(field.GetValue(Nothing)).ToString + ” “ + field.Name)
Next
Console.ReadLine()

End Sub

End Module

Public Enum TestEnum
  Cheese = 1
Wallace
Grommit
Wheelbarrows
End Enum

How do I … identify dataset constraint type that has failed when I get exception: System.Data.ConstraintException: Failed to enable constraints. One or more …

How do I … identify dataset constraint type that has failed when I get exception:

This is a nice trick

System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Write a test that Fills the requried table. I use a helper class for datasets, but you could change this to put the tableadapter in here.
Then loop through the columns and remove the constraints
Also remove the primary key constraint
Prove that the Fill now works. Then stop turning the constraints off one-by-one until you find the type of constraint.


<TestMethod()> _

Public Sub FillTest()

Dim dsValue As New <datasetname>
Dim target As New <dataset>Helper(dsValue)
For Each col As DataColumn In dsValue.<tablename>.Columns
If col.Ordinal < 10 Then   'Use to reduce possible columns down
col.MaxLength = -1       'Rem in or out to reduce possible constraints. And next line
col.AllowDBNull = True
End If
Next

dsValue.<tablename>.PrimaryKey = Nothing
Dim aList = dsValue.<tablename>.Constraints

Stop
target.Fill

End Sub

 

Optional helper methods

    Private Sub SetAllowDBNULLTrue(dt As DataTable, Optional MinOrdinal As Integer = 0, Optional MaxOrdinal As Nullable(Of Integer) = Nothing)

        If Not MaxOrdinal.HasValue Then MaxOrdinal = dt.Columns.Count

        For Each col As DataColumn In dt.Columns
            If col.Ordinal > MinOrdinal AndAlso col.Ordinal < MaxOrdinal Then   'Use to reduce possible columns down
                If col.AllowDBNull = False Then
                    Debug.Print("Changing column to allow null " + col.ColumnName)
                    col.AllowDBNull = True
                End If
            End If
        Next

    End Sub

    Private Sub SetMaxLengthToMinus1(dt As DataTable, Optional MinOrdinal As Integer = 0, Optional MaxOrdinal As Nullable(Of Integer) = Nothing)

        If Not MaxOrdinal.HasValue Then MaxOrdinal = dt.Columns.Count

        For Each col As DataColumn In dt.Columns
            If col.Ordinal > MinOrdinal AndAlso col.Ordinal < MaxOrdinal Then   'Use to reduce possible columns down
                If col.MaxLength <> -1 Then
                    Debug.Print("Changing column MaxLength to -1 for " + col.ColumnName)
                    col.MaxLength = -1       'Rem in or out to reduce possible constraints. And next line
                End If
            End If
        Next

    End Sub

 

Time Management Matrix (7 habits, and now Personal Kanban)

From plural sight on Kanban. Also reference http://www.personalkanban.com/pk/

Time Management Matrix (important/urgent matrix General Eisenhower, Stephen Covey, Personal Kanban)

  • Important Urgent – SC refers to these as mission critical. Personal Kanban as emergencies that should be considered in retrospective review
  • Important but not urgent – SC refers to these as quality quadrant – Personal Kanban as Quadrant of Kaizen
  • Urgent but not important – SC quadrant of deception – personal Kanban as Social Investment
  • Not urgent and not important – SC waste – Personal Kanban as organic quadrant. It’s your life! may have real value – also relax, restore, recharge

Kanban – including Little’s Law

From pluralsight video and link here http://leanandkanban.wordpress.com/

Interesting link between manufacturing and IT. I have been aware of the ideas of Little’s Law for some years in manufacturing, although would not have known it’s name:
“The average time in the system is equal to the average time in queue plus the average time it takes to receive service” which leads to, two ways to reduce cycle time. Same/same manufacturing:

  1. Increase Throughput
    • normally requires investment or hire of additional resources
  2. Reduce WIP
    • simply a policy decision

Little’s Law L = ƛW

L = Length of Queue
ƛ = Arrival rate
Q = Average Wait Time

Wait Time = Lenght of Queue / Arrival Rate
Cycle Time = WIP / Throughput

http://leanandkanban.wordpress.com/2009/04/18/lead-time-vs-cycle-time/

Lead time clock starts when the request is made and ends at delivery. Cycle time clock starts when work begins on the request and ends when the item is ready for delivery. Cycle time is a more mechanical measure of process capability. Lead time is what the customer sees.
Lead time depends on cycle time, but also depends on your willingness to keep a backlog, the customer’s patience, and the customer’s readiness for delivery.
Another way to think about it is: cycle time measures the completion rate, lead time measures the arrival rate. A producer has limited strategies to influence lead time. One is pricing (managing the arrival rate), another is managing cycle time (completing work faster/slower than the arrival rate).
Corey Ladas

The pluralsight kanban video then goes onto to talk about value stream Ready, Doing, Done limiting WIP in Ready. Other options of columns

Electronic Tools (just list from pluralsight not used any):

  1. AgileZen
  2. Trello
  3. LeanKit Kanban
  4. TargetProcess

Books

Kanban by David Anderson

LocalReport set-up and publish

How do I … keep reports in a sub-directory

May be set in code or in ReportViewer control

Dim report as New LocalReport()
report.ReportPath = “Reports\ReportName.rdlc”

How do I … fix Local reports that work in Visual Studio not when published

The errors you may get include:

  • An error occurred during local report processing copy
    The report definition for report ‘..\some_path_to_report\<reportname>.rdlc’ has not been specified
    Could not find file ‘C:\inetpub\wwwroot\some_path_to_report\tse.rdlc’.

When reports are added their default Build Action is Embedded Resource.
To fix this change to Content and choose a copy policy, probably Copy if Newer

How do I … use a report in a referenced project

Add the report as a “Linked” file ( Add existing item > Add as Link )(probably) at the same directory level as in the referenced project
Then on these linked files choose the necesary options as above