Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,43 +0,0 @@
|
|||
with Ada.Strings.Hash;
|
||||
with Ada.Containers.Hashed_Maps;
|
||||
with Ada.Text_Io;
|
||||
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
|
||||
|
||||
procedure Hash_Map_Test is
|
||||
function Equivalent_Key (Left, Right : Unbounded_String) return Boolean is
|
||||
begin
|
||||
return Left = Right;
|
||||
end Equivalent_Key;
|
||||
|
||||
function Hash_Func(Key : Unbounded_String) return Ada.Containers.Hash_Type is
|
||||
begin
|
||||
return Ada.Strings.Hash(To_String(Key));
|
||||
end Hash_Func;
|
||||
|
||||
package My_Hash is new Ada.Containers.Hashed_Maps(Key_Type => Unbounded_String,
|
||||
Element_Type => Unbounded_String,
|
||||
Hash => Hash_Func,
|
||||
Equivalent_Keys => Equivalent_Key);
|
||||
|
||||
type String_Array is array(Positive range <>) of Unbounded_String;
|
||||
|
||||
Hash : My_Hash.Map;
|
||||
Key_List : String_Array := (To_Unbounded_String("foo"),
|
||||
To_Unbounded_String("bar"),
|
||||
To_Unbounded_String("val"));
|
||||
|
||||
Element_List : String_Array := (To_Unbounded_String("little"),
|
||||
To_Unbounded_String("miss"),
|
||||
To_Unbounded_String("muffet"));
|
||||
|
||||
begin
|
||||
for I in Key_List'range loop
|
||||
Hash.Insert(Key => (Key_List(I)),
|
||||
New_Item => (Element_List(I)));
|
||||
end loop;
|
||||
for I in Key_List'range loop
|
||||
Ada.Text_Io.Put_Line(To_String(Key_List(I)) & " => " &
|
||||
To_String(Hash.Element(Key_List(I))));
|
||||
end loop;
|
||||
|
||||
end Hash_Map_Test;
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
(defun hash-from-two-arrays (seq1 seq2)
|
||||
(let ((hash (make-hash-table :test 'equal))
|
||||
(list1 (if (listp seq1) seq1 (append seq1 nil)))
|
||||
(list2 (if (listp seq2) seq2 (append seq2 nil))))
|
||||
(while (and list1 list2)
|
||||
(puthash (car list1) (car list2) hash)
|
||||
(setq list1 (cdr list1)
|
||||
list2 (cdr list2)))
|
||||
hash))
|
||||
|
||||
(hash-from-two-arrays (list 'a 'b 'c) [1 2 3])
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
function create_hash ([array] $keys, [array] $values) {
|
||||
$h = @{}
|
||||
if ($keys.Length -ne $values.Length) {
|
||||
Write-Error -Message "Array lengths do not match" `
|
||||
-Category InvalidData `
|
||||
-TargetObject $values
|
||||
} else {
|
||||
for ($i = 0; $i -lt $keys.Length; $i++) {
|
||||
$h[$keys[$i]] = $values[$i]
|
||||
}
|
||||
}
|
||||
return $h
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
Set dict = CreateObject("Scripting.Dictionary")
|
||||
os = Array("Windows", "Linux", "MacOS")
|
||||
owner = Array("Microsoft", "Linus Torvalds", "Apple")
|
||||
For n = 0 To 2
|
||||
dict.Add os(n), owner(n)
|
||||
Next
|
||||
MsgBox dict.Item("Linux")
|
||||
MsgBox dict.Item("MacOS")
|
||||
MsgBox dict.Item("Windows")
|
||||
Loading…
Add table
Add a link
Reference in a new issue