Saturday, October 22, 2011

Twitter Analytics: Thinc Iowa Popularity Contest

I find it more and more difficult to attend a conference without the assistance of Twitter.  It allows me to quickly get a feel for the room.  The quotes that landed well with people, what they disagree with, the interesting side stories of the day.  I've often thought the Twitter Search function lacks much of what I wish it could do/should do.  How would Q & A sessions be improved if Twitter was used to crowd source the questions (or the answers for that matter)?  This idea, of course, can be applied more broadly and is not just relevant to conferences.  Analyzing tweets based on #hashtags, instant polls of crowds - How would our world change if this data was put to use?

Now this may be considered a bad example (in every way) of what I mean, but let's take a look at some of the most occurring @mentions in Tweets that can be related to the Thinc Iowa closing party.  One reason I would consider this a bad example is because number of occurrences alone is not very meaningful.  But nonetheless, here are the results (in no particular order):


By far the most @mentions
@thinciowa  - makes sense :-)

The Speakers
@bpmilne
@paigecraig
@8en                      (interesting to see the common misspellings of his user name...)
@tscottcase
@nickseguin
@robbievitrano
@jchou
@dougkolson
@AndyMurrayX

The "Startups"     (what about the "corporations" :-)
@startupamerica

@dwolla
@pinterest

@betterworks

and The Ink
@SiliconPrairie
@slobotski
@geoffwood


Some other interesting/commonly tweeted words:

great
love
thanks
Iowa
"Des" - which was tweeted more often than "Moines"...


-Aaron


Wednesday, April 13, 2011

Visual Studio Macro to Break on Every Method in File

While tracking down the source of certain features (read bugs) within overly complex applications, I have sometimes found it useful to break on every call to every method within a file.

The functionality to "Break on Every Method" is not built into Visual Studio, but it is possible to set up the necessary break points through a macro.  I did not originally write this macro, but while trying to find it again at a recent job I couldn't, so I decided to post it here for safe keeping.  It is fairly primitive, but it gets the job done.  Simply place the cursor within the file you are working with right before the first method you want to break on.  The macro will then search through the file for each opening brace "{" and place a break point at each one.  Hope it helps someone.

To "install" this macro simply open up your macro explorer, edit a module and paste this macro/method in.  If you do not have any macros you will need to record an empty macro first to get a default module created for you.

--------

Sub BreakOnAllMethods()
    Dim returnValue As vsIncrementalSearchResult

    Dim findresult As vsFindResult

    Dim safeguard As Integer

    safeguard = 1

    DTE.Find.FindWhat = "{"
    DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
    DTE.Find.MatchCase = False
    DTE.Find.MatchWholeWord = False
    DTE.Find.Backwards = False
    DTE.Find.MatchInHiddenText = True
    DTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
    DTE.Find.Action = vsFindAction.vsFindActionFind

    While safeguard < 100

        findresult = DTE.Find.Execute()

        If (findresult = vsFindResult.vsFindResultNotFound) Then
            Return
        End If

        DTE.ExecuteCommand("Debug.ToggleBreakpoint")
        DTE.ExecuteCommand("Edit.GotoBrace")
        DTE.ActiveDocument.Selection.CharRight()

        safeguard = safeguard + 1

    End While

End Sub


--------

Enjoy!

Tuesday, December 28, 2010

Microsoft Excel Find Next Value Change in Column Macro

I find that if I’m working with data from a SQL query it is easier to manipulate, sort, and filter that data in Excel than it is in the SQL query itself.  I am also a fan of using Excel as a Data Visualization/Reporting tool.  Because of these two things I tend to work in Excel quite a bit and have developed a few macros to help make my life easier.

Many times when you are working with data from a SQL query and you sort on a “type” column (example below) you will have many repeated values in a single column.  If you want to page through the data and find when the values changes from one to the next, Excel does not have the built in ability to do this.  However the Macro to perform this function is pretty easy to write.

In the image below the data was sorted on the “Type” column.  If cell B3 is selected and the FindNextValueChangeInColumn macro is run, cell B7 would be selected.  If it is run a second time cell B12 would be selected and so on.


Here are the Macros to copy and paste into an Excel VBA Module:


Sub FindNextValueChangeInColumn()
'
' FindNextValueChangeInColumn Macro
'
On Error GoTo ErrHandler

Dim currentValue As String
Dim compareValue As String

currentValue = ActiveCell.Value

If (currentValue = "") Then
' Value is blank, this could mean we are at the bottom of all the values
' use xlDown for performance
Selection.End(xlDown).Select
Else
' select next cell down (priming read)
ActiveCell.Offset(1, 0).Select
compareValue = ActiveCell.Value

Do While currentValue = compareValue
ActiveCell.Offset(1, 0).Select
compareValue = ActiveCell.Value
Loop
End If

Exit Sub

ErrHandler:
Exit Sub
End Sub


Sub FindPreviousValueChangeInColumn()
'
' FindPreviousValueChangeInColumn Macro
'
On Error GoTo ErrHandler

Dim currentValue As String
Dim compareValue As String

currentValue = ActiveCell.Value

If (currentValue = "") Then
' Value is blank, this could mean we are at the top of all the values
' use xlUp for performance
Selection.End(xlUp).Select
Else
' select next cell down (priming read)
ActiveCell.Offset(-1, 0).Select
compareValue = ActiveCell.Value

Do While currentValue = compareValue
ActiveCell.Offset(-1, 0).Select
compareValue = ActiveCell.Value
Loop
End If

Exit Sub

ErrHandler:
Exit Sub

End Sub



Hope this saves you some time!

-Aaron