Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -0,0 +1,15 @@
|
|||
with Ada.Containers.Ordered_Sets, Ada.Text_IO;
|
||||
use Ada.Text_IO;
|
||||
|
||||
procedure Duplicate is
|
||||
package Int_Sets is new Ada.Containers.Ordered_Sets (Integer);
|
||||
Nums : constant array (Natural range <>) of Integer := (1,2,3,4,5,5,6,7,1);
|
||||
Unique : Int_Sets.Set;
|
||||
begin
|
||||
for n of Nums loop
|
||||
Unique.Include (n);
|
||||
end loop;
|
||||
for e of Unique loop
|
||||
Put (e'img);
|
||||
end loop;
|
||||
end Duplicate;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
include sort.e
|
||||
|
||||
function uniq(sequence s)
|
||||
sequence out
|
||||
s = sort(s)
|
||||
out = s[1..1]
|
||||
for i = 2 to length(s) do
|
||||
if not equal(s[i],out[$]) then
|
||||
out = append(out, s[i])
|
||||
end if
|
||||
end for
|
||||
return out
|
||||
end function
|
||||
|
||||
constant s = {1, 2, 1, 4, 5, 2, 15, 1, 3, 4}
|
||||
? s
|
||||
? uniq(s)
|
||||
|
|
@ -0,0 +1 @@
|
|||
$data = 1,2,3,1,2,3,4,1
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
$h = @{}
|
||||
foreach ($x in $data) {
|
||||
$h[$x] = 1
|
||||
}
|
||||
$h.Keys
|
||||
|
|
@ -0,0 +1 @@
|
|||
$data | Sort-Object -Unique
|
||||
|
|
@ -0,0 +1 @@
|
|||
$data | Select-Object -Unique
|
||||
|
|
@ -0,0 +1 @@
|
|||
print mold unique [1 $23.19 2 elbow 3 2 Bork 4 3 elbow 2 $23.19]
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
data: { 6 5 5 7 "a" 1 2 3 2 4 1 5 "a" }
|
||||
unique data |sort |print
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
Function remove_duplicates(list)
|
||||
arr = Split(list,",")
|
||||
Set dict = CreateObject("Scripting.Dictionary")
|
||||
For i = 0 To UBound(arr)
|
||||
If dict.Exists(arr(i)) = False Then
|
||||
dict.Add arr(i),""
|
||||
End If
|
||||
Next
|
||||
For Each key In dict.Keys
|
||||
tmp = tmp & key & ","
|
||||
Next
|
||||
remove_duplicates = Left(tmp,Len(tmp)-1)
|
||||
End Function
|
||||
|
||||
WScript.Echo remove_duplicates("a,a,b,b,c,d,e,d,f,f,f,g,h")
|
||||
Loading…
Add table
Add a link
Reference in a new issue