Monthly Archives: May 2014

VB strings seem to be binary safe

Code to test it:

Dim s1 As String = “”

        For i As Integer = 0 To 255
            Dim hexI As String = Hex(i)
            If hexI.Length = 1 Then
                hexI = “0” + hexI
            End If

            s1 = s1 + System.Text.RegularExpressions.Regex.Unescape(“\x” + hexI)
        Next

        For i2 As Integer = 0 To 255

            RichTextBox1.AppendText(Hex(Microsoft.VisualBasic.AscW(s1(i2))) + vbNewLine)
        Next

I didn’t check all values, but all values that could be used as delimiters(\x00 for instance) seem retrievable. Also, notepad tells me the richtextbox has 256 lines(plus one empty at the end).

You need a form and a richtextbox for this code(the code is public domain btw)

Leave a comment

Filed under Uncategorized

Separate file for the “header”

I think I’ll store meta information in a separate file. But I’ll let this idea mature a little before I get to coding.

Leave a comment

Filed under Uncategorized

VB rocks

When it comes down to GUI and cryptography, but sucks in everything else. I have a huge program and I’m not close to finishing my header-adding program, I would have already finished with few lines in python. Given that most users won’t need to add headers(only “webmasters”) I will move to python for this part. The worst part is that I don’t even know whether VB.net strings are binary-safe. That would easy my life somewhat.

Leave a comment

Filed under Uncategorized

getlocalip function…

…wasn’t completely useless now that I think about it. The IPAddress.Any property can be bound to a socket but it can’t display the external IPv4 address(it shows up as “0.0.0.0”)

Leave a comment

Filed under Uncategorized

Isn’t it curious that even if I bind a raw socket at ipaddress.any port 0 I still don’t get all traffic to my IP address(let alone my computer)?

Leave a comment

May 24, 2014 · 5:12 am

My getlocalip function at https://siliconvalleylatebloomer.wordpress.com/2014/05/19/essential-functions-getlocalip-and-byteartohex/ can be easily replaced(in fact, improved) by getting the property net.ipaddress.any instead o_O

Leave a comment

May 24, 2014 · 5:10 am

PHP(ish) function for visual studio 2010

Explode function in VB:

 

Private Function phpishExplode(ByVal del As String, ByVal s1 As String)
Dim returnValue As New ArrayList

Dim lastMatchIndex As Integer = 0
For i As Integer = 0 To s1.Count – del.Length
Dim match As Boolean = True
For i2 As Integer = 0 To del.Length – 1

If s1(i + i2) <> del(i2) Then
match = False
Exit For
End If

Next
If match = True Then
returnValue.Add(s1.Substring(lastMatchIndex, i – lastMatchIndex))
lastMatchIndex = i + del.Length

End If
Next
returnValue.Add(s1.Substring(lastMatchIndex, s1.Length – lastMatchIndex))

Return returnValue
End Function

Leave a comment

Filed under Uncategorized

Connections and Trust in P2P networks

The connection problem has been solved already, I realized that even if one connects randomly we end up with a fully connected group of networks. There are biases, which may would cause some problem if there were few connections per node and a large number of nodes, but that is not the case and the biggest bias(nodes tend to cluster around regional nodes) could be solved quickly by a simple algorithm prioritizing farther IP addresses, even if with few connections by node. So… what is the next challenge to create the exchange of:
Data
Functions
?

Simple, trust.
There is good info and bad info, how can I make good info travel as fast as possible to as many nodes as possible while limiting the spread of bad info? My next challenge. If solved, will greatly improve my living standard(when implemented).

Leave a comment

Filed under Uncategorized

Side project done.

http://yourlinkyourad.co.nf/partialLinkViewer.7z

Unzip,Install,Click load URL, paste this:

https://siliconvalleylatebloomer.wordpress.com/#%FC%F3426%FB125%FB168%FB221%FE

You should see this:

Image

 

Leave a comment

Filed under Uncategorized

Not only 2 days actually…

…when I think about it, I used stuff I learned before those two days while trying my P2P thing as it is going to also involve a “browser”(more like a client of a completely new markup language I developed)

Leave a comment

Filed under Uncategorized