i’ve been having issues when connected to my local wifi at home, with my android facebook app (as well as fb messenger) not loading profile pictures. it would work fine when connected to my cellular network, or even the wifi at work. but for some reason, it wasn’t working at home.

after doing some digging around with logcat on my phone, it appeared to be a problem with resolving the domain name “fbcdn-profile-a.akamaihd.net”. when i ran the host command i got the following:

[[email protected] ~]$ host fbcdn-profile-a.akamaihd.net pi
;; Truncated, retrying in TCP mode.
... rest of host output ...

it appeared to work fine when run with the dig command. after some googling of the above error message, i found talk of the minimal-responses yes; option for bind. i added it to my config file, and everything started working as expected on my phone.

my guess would be is that the host command was using a smaller buffer than the dig command, which is why it was saying that is was “Truncated”. i’m assuming that either the facebook app or the network stack used in android was using a small buffer as well but not retrying with TCP mode.

yes, we are still using visual studio 2005 for our development, although we hope to cut over to 2010 in the next few weeks. anyways, a customer was having problems printing reports to a particular printer, and from previous research i knew the problem was turning the “No Printer” option on in the crystal reports designer. now we have a lot of reports, so i wanted to automate this process for all our reports. so i turned to the built-in scripting functions of visual studio, however, it turns out that you can’t control dialogs through macros. so one person recommended using autohotkey, and i had a basic knowledge of that, so I would give it a try.

Continue reading

after much searching and reading many blogs and forums, i never found a comprehensive answer on the best way to get the index of a datarow from the currencymanager in vb.net. i found a few posts that led me in the right direction, not none that did exactly what i wanted. so this is what i came up with, i’m not sure if it’s the most efficient, but it seems to work.

1
2
3
4
5
6
7
8
9
10
11
12
13
' RowToFind is the DataRow we are looking for the index of
Dim cm As CurrencyManager = Me.BindingContext.Item(dataSource, dataMember)
Dim dv As DataView = DirectCast(cm.List, DataView)
Dim idx as Integer = -1
 
For i As Integer = 0 To dv.Count - 1
    If dv.Item(i).Row Is RowToFind Then
        idx = i
        Exit For
    End If
Next 
 
cm.Position = idx
' RowToFind is the DataRow we are looking for the index of
Dim cm As CurrencyManager = Me.BindingContext.Item(dataSource, dataMember)
Dim dv As DataView = DirectCast(cm.List, DataView)
Dim idx as Integer = -1

For i As Integer = 0 To dv.Count - 1
    If dv.Item(i).Row Is RowToFind Then
        idx = i
        Exit For
    End If
Next 

cm.Position = idx

our problem with the previous method, was that when you deleted a row, it would return the wrong index. this appears to bypass that problem.