Tags "hashtable" Result

Powershell error returning hashtable

Anyone have any ideas why the following code would produce an error, see additional comments after the function for more details function callee ([Hashtable]$arg0) { [Hashtable]$hashtable = @{} $hashtable = $arg0 $hashtable.add('passed', $True) # $hashtable ######## toggle this line $type = $hashta

it1352 0 2020-11-22

serialization and Deserialization in c#

I am facing a problem while doing serialization & deserialization using c#. Basically i am using DataContractSerializer to serialize an object. Here is my serialization code: var serializer = new DataContractSerializer(typeof(ProjectSetup)); string xmlString; using (var sw = new StringWriter()) { using (var wr

it1352 1 2019-05-10


Hi y''all, If I insert a set of keys and associated values in a HashTable, how do I extract a given value for a specified key? Thanx, Bill Solution string myValue = (string)this.myHash[myKey]; ....that is assuming, of course, that your value is a string. It can be anything at all (in which case, replace the "string" definition and the

it1352 2 2019-06-25

Serialize hashtable using Protocol Buffers (.NET)

I am trying to serialize/deserialize my custom class which contains hashtable property using protobuf-net v2. [ProtoContract] public class MyClass { [ProtoMember(1)] public Hashtable MyHashTable { get; set; } } When I call Serializer.Serialize(...) exception appears: No serializer defined for type: System.Collectio

it1352 5 2019-05-06

How to convert NameValueCollection to Hashtable

I have a NameValueCollection object and I need to convert it to a Hashtable object, preferrably in one line of code. How can I achieve this? Solution You should consider using a generic Dictionary instead since it's strongly-typed, whereas a Hashtable isn't. Try this: NameValueCollection col = new NameValueCollection(); col.Add("red", "rouge"); c

it1352 0 2019-05-06

How to properly define an array of linked list in Java ?

I tried to define an array of linked list in Java like the following, which compiled fine but it generated 2 warning messages. LinkedList<Long> [] hashtable = new LinkedList[10]; warning: [rawtypes] found raw type: LinkedList LinkedList<Long> [] hashtable = new LinkedList[10]; ^ missing

it1352 2 2019-05-08