Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my previous posts I was asking some pretty easy questions but now that I have figured out how to add the references to my project so that I can start coding I cannot find any documentation about the syntax of the program and what each command does? if I type raptordb I get a list of the following:


1. byterr
2. byte array comparer
3. global
4. hash
5. index
6. indextype
7. murmurhash2unsafe
8. RaptorDB
9. safedictionary
10. storagefile

my goal is to add the contents of my text file to this database and then use my program to read from the database. I would also like to sort it by hash but if someone could give me a rundown of the functions I have listed here it would greatly help as there is very limited documentation describing the ways to use it and what it has to offer. Thank you in advance!
Posted

1 solution

All you need is the RaptorDB class, convert the following sample to vb and you are good to go.
C#
RaptorDB.RaptorDB rap = RaptorDB.RaptorDB.Open("strings", 30, false, INDEXTYPE.HASH);
rap.IndexingTimerSeconds = 1;
rap.InMemoryIndex = true;
string key = "some very long string";

for (int i = 0; i < count; i++)
{
	string ss = key + i.ToString("000000");
	rap.Set(ss, ss);
}

rap.SaveIndex(true);
int j = 0;
for (int i = 0; i < count; i++)
{
	string ss = key + i.ToString("000000");
	byte[] bb = null;
	if (rap.Get(ss, out bb) == false)
		j++;// Console.WriteLine("error");
}
 
Share this answer
 
Comments
Dale 2012 4-Sep-11 19:19pm    
Ok the code you supplied is now converted to VB.NET but the variable "Count" is not declared and I still have no idea what you mean by "strings" and "Some very long string" and also "000000" in the code?. Where do I place my Signature text file so that it is added to the database and properly indexed? and once that is done what is the line of code to read all lines from the database?


Dim rap As RaptorDB.RaptorDB = RaptorDB.RaptorDB.Open("strings", 30, False, INDEXTYPE.HASH)
rap.IndexingTimerSeconds = 1
rap.InMemoryIndex = True
Dim key As String = "some very long string"

For i As Integer = 0 To count - 1
Dim ss As String = key & i.ToString("000000")
rap.Set(ss, ss)
Next i

rap.SaveIndex(True)
Dim j As Integer = 0
For i As Integer = 0 To count - 1
Dim ss As String = key & i.ToString("000000")
Dim bb() As Byte = Nothing
If rap.Get(ss, bb) = False Then
j += 1 ' Console.WriteLine("error");
End If
Next i
Dale 2012 4-Sep-11 20:11pm    
My best attempt to understand this is:

Dim rap As RaptorDB.RaptorDB = RaptorDB.RaptorDB.Open("Master MD5 SIG.txt", 30, False, INDEXTYPE.HASH)
rap.IndexingTimerSeconds = 1
rap.InMemoryIndex = True
Dim key As String = MD5Textload.Text

For i As Integer = 0 To count - 1
Dim ss As String = key & i.ToString("000000")
rap.Set(ss, ss)
Next i

rap.SaveIndex()
Dim j As Integer = 0
For i As Integer = 0 To count - 1
Dim ss As String = key & i.ToString("000000")
Dim bb() As Byte = Nothing
If rap.Get(ss, bb) = False Then
j += 1 ' Console.WriteLine("error");
End If
Next i


WIll you please clarify where to add my text file? thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900