Functions To Get DNA and RNA Complementary Codes

For my most recent project at U of C, I had to write some script to find places where DNA and RNA might bind.

DNA (and RNA) will bind when 2 strands have a complementary sequence.  A binds with T, T bind with A, G binds with C and C binds with G. 

Basically the same thing happens with RNA.

Here are 2 functions that will quickly find the complementary sequence for DNA and RNA:

Public Function FlipRnaCode(ByVal sEnd As String) As String
    sEnd = Replace(sEnd, "U", "a", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "A", "u", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "G", "c", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "C", "g", 1, -1, CompareMethod.Binary)
    sEnd = UCase(sEnd)
    Return sEnd
End Function

Public Function FlipDnaCode(ByVal sEnd As String) As String
    sEnd = Replace(sEnd, "T", "a", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "A", "t", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "G", "c", 1, -1, CompareMethod.Binary)
    sEnd = Replace(sEnd, "C", "g", 1, -1, CompareMethod.Binary)
    sEnd = UCase(sEnd)
    Return sEnd
End Function

 

 

Left Off Crains List

I wasn’t included in Crain’s list of Chicago based web development consultant firms.

Seeing as how I am basically a 1 man firm, I don’t really expect to be on these types of lists, but there are a few on there that I measure up well, and others where I am clearly more profitable.

Maybe they will include me next time :).  But if not, who cares?

How to get the TOP X rows from a DataTable or DataView

Here is a function I found that can trim down a datatable/dataview to a limited number of rows.  Basically, it’s like doing a “TOP X”.

''' <summary>
''' Will return a dataview with only the top "number" of rows.
''' </summary>
''' <param name="myDataView">dataview to "trim"</param>
''' <param name="number">the number of rows to return</param>
''' <returns></returns>
''' <remarks></remarks>
Public Shared Function GetTopDataViewRows(ByVal myDataView As DataView, ByVal number As Integer) As DataView
    Dim tableToClone As DataTable = myDataView.Table.Clone
    Dim i As Integer
    For i = 0 To number - 1
        If i >= myDataView.Count Then Exit For
        tableToClone.ImportRow(myDataView(i).Row)
    Next
    Return New DataView(tableToClone, myDataView.RowFilter, myDataView.Sort, myDataView.RowStateFilter)
End Function

I didn’t write this, credit goes to this post.

Cisco APs – Remember to enable the radio [Duh]

I was recently at a client reconfiguring some of their access points (Cisco 1100).  I was having trouble connecting to one of the new devices.

After some clicking around, I noticed that, by default, the wireless radio is disabled.

This is not totally apparent as you are setting up the network (it is in a different section of the web config utility).

So yea… it helps to enable the radio. 🙂