hashtable

Can I safely use hashes of tuples containing 64 bit integers (longs) as unique keys in a python dictionary?

I have to store objects that have two attributes (ida and idb) inside a dict. Both attributes are 64 bit positive integers and I can only store one object for a unique arrangement(combination in which the order matters) of ida and idb. For example: obj1 = SomeClass(ida=5223372036854775807, idb=2) obj2 = SomeClass(ida=2, idb=522337203685...

Consume Java Web Service that returns a hash table in .NET

Hi, I want to consume a web service built in Java from a .NET application. The web service returns a hash table in one of the methods and when I run soapUI against that method I can see that it works. But when I add the web service as a Service Reference in VS2008 the hash tables are converted into arrays... Could I configure the servi...

Unable to cast object of type 'System.String' to type 'System.Collections.Hashtable'.

I am getting this error when I converting Application level variable into Hashtable; First In Global.aspx file I have store Hashtable into Application variable like that: Hashtable htErrorDescription = new Hashtable(); htErrorDescription.Add("Error 1","General Error"); htErrorDescription.Add("Error 2","Service Error"); context.Applica...

How to test thread safety of adding to a hashtable?

We're using a hashtable to store sessions in a web service. I want to test thread safety of adding to this session. I wrote a Console App which generates lots of threads and adds to this session. But I am neither getting an exception nor losing any data. Am I doing anything wrong or isn't this much of operation a threat to hashtable?! ...

VB.net - creating a hashtable with values

Is it possible to create a hashtable "pre-populated" with values? i.e. something like: dim myHash as new Hashtable() = {"key1", "value1", "key2", "value2" } ...

how to implement n:m relation in java?

Sorry for this newbie question, but I just never worked with java... My problem is I need to implement an n:m relation in java. The use case is a catalog. a product can be in multiple categories a category can hold multiple products the classic... My current solution is to have a mapping class that has to hashmaps. The key of the ...

C# : Using hashtables to store two of the same value. Is it possible?

Hi. I'm fairly new to programming C#, and I have written a program that uses hashtables to store data (in my case, the users name, and if they are "Ready" or "Not Ready". I have 2 tables in total. The first table has the key as the username and the IP address of the client in the value box. the second table has the Ready/Not Ready status...

Time complexity of Hash table

I am confused about the time complexity of hash table many articles state that they are "amortized O(1)" not true order O(1) what does this mean in real applications. What is the average time complexity of the operations in a hash table, in actual implementation not in theory, and why are the operations not true O(1)? ...

Array of Linked lists on disk

I am trying to find how to store and process (search, add, remove) an array of linked lists on disk. For example in memory, it would like struct list { int a; struct list *next; }LIST LIST *array[ARRAY_SIZE] int main{ ... LIST *foo = array[pointer]; /* Search */ while(foo!=NULL){ ... foo=foo->next } } I believe that by ...

C# - Best way to store sets of data (In a table)

I have a client and a server program, and I am currently using hashtables to store the clients Name and ip address when they connect. I now need to add another variable that the client will send to the server when it connects, but as far as I understand it, hashtables only have 2 columns (Key and value). Is there another way I could stor...

Hashtable. Name history. Why not HashTable?

we know: ArrayList; LinkedList; TreeMap and other... and all names in CamelCase format, but why Hashtable, not HashTable? it is unprincipled question, just wondering :) ...

c++ unordered_map compiling issue with g++

i am using g++ in ubuntu g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3 Copyright (C) 2009 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. i have this code #include<unordered_map> using namespace std; bool ifuni...

Hashtable. How it works?

Now, I'm trying to understand how to construct the Hashtable. The most interesting - as objects are added to the Hashtable? I have read in a book that: at first step: Calculated hashCode() object. Next, we determine the position of this object in the Hashtable: obj.hashCode() % Hashtable.length. For example, add more elements to the...

Sync'd Hashtable not PowerShell display-friendly. Try: [HashTable]::Synchronized(@{})

I have an object coming from .Net that has a property of type SyncHashTable that can't be viewed w/o an exception being thrown. One-line repro: [HashTable]::Synchronized(@{}) Multi-line easier to play with repro: $ht = new-object hashtable $ht.add("foo", "bar") $hts = [Hashtable]::Synchronized($ht) $hts The error: format-default ...

HashTable or Dictonary lookup time

Is the Lookup Time for a HashTable or Dictionary Always O(1) as long as it has a Unique Hash Code? If a HashTable has 100 Million Rows would it take the same amount of time to look up as something that has 1 Row? ...

Need help with hashTable

Hello guys, I have coded something which would return the contents of a excel sheet as a hashTable. The code is public Object[][] validDataProviderScenarioOne() { excelWorker excel = new excelWorker(); String pathValue = excelWorker.LocatingXls("Data.xls"); Hashtable<String, String>[] hashDrv =(Hashtable<String, S...

__gnu_cxx hash map with keys of type std::pair<std::string, unsigned int>?

Hi experts, Since std::pair<std::string, unsigned int> is not defined for __gnu_cxx hash map, how do I create a __gnu_cxx hash map with keys of type std::pair<std::string, unsigned int> and values of type std::pair<int, CBTNODE>? (CBTNODE is typedef as typedef int CBTNODE) If it's possible, I would really want to substitute std::pair<...

Import hashtable's fields in a adodb recordset

Hi have a hashtable and an adodb.recordset. The field's names of hashtable are same of fields adodb.recordset How can i import the fields value of hashtable in fields adodb.recordset without do it manually? ex Dim Tot As ADODB.Recordset Dim h As Hashtable = New Hashtable h("a") = 1 h("b") = 2 h("d") = 4 the recordset tot has fields...

How can I include doxygen perlmod in my perlscript?

Hi How can I include doxygen perlmod in my perlscript? I've noticed that you can generate a alternative output with doxygen that is called perlmod, but I can't find any examples on how to use this part. I've found 2 nice files in there DoxyDocs.pm and DoxyStructure.pm, and they contain some kind of nice structure that represents th...

Iterating over a JavaScript object in sort order based on particular key value of a child object

Hello all Short version: I'm looking for the JavaScript equivalent of Perl's for my $key ( sort { $hash{$a}{foo} cmp $hash{$b}{foo} } keys %hash ) { # do something with $key } More detail: I have a JSON object which consists of a bunch of other JSON objects which have identical properties to each other, like a hash of hashes in ...