Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
2
Task/Filter/Apple/filter-1.apple
Normal file
2
Task/Filter/Apple/filter-1.apple
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
> even. #. 𝔸8926012345
|
||||
Vec 6 [8, 2, 6, 0, 2, 4]
|
||||
2
Task/Filter/Apple/filter-2.apple
Normal file
2
Task/Filter/Apple/filter-2.apple
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
> [(x˙)'even.⩪x] 𝔸8926012345
|
||||
Vec 6 [8, 2, 6, 0, 2, 4]
|
||||
13
Task/Filter/DuckDB/filter-1.duckdb
Normal file
13
Task/Filter/DuckDB/filter-1.duckdb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
--Create the original array (table #nos) with numbers from 1 to 10
|
||||
create table nos (v int);
|
||||
insert into nos from range(1,11);
|
||||
|
||||
--Select the subset that are even into the new array (table #evens)
|
||||
create table evens as (from nos where v % 2 = 0);
|
||||
|
||||
-- Show #evens
|
||||
from evens;
|
||||
|
||||
# There is no need to drop the tables just for sake of repeating, because
|
||||
# DuckDB supports "CREATE OR REPLACE", but the basic DROP TABLE syntax
|
||||
# is the same.
|
||||
7
Task/Filter/DuckDB/filter-2.duckdb
Normal file
7
Task/Filter/DuckDB/filter-2.duckdb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
create temporary table nos (v int);
|
||||
insert into nos values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
|
||||
create temporary table evens (v int);
|
||||
insert into evens select v from nos where v%2=0;
|
||||
select * from evens order by v;
|
||||
drop table nos;
|
||||
drop table evens;
|
||||
1
Task/Filter/DuckDB/filter-3.duckdb
Normal file
1
Task/Filter/DuckDB/filter-3.duckdb
Normal file
|
|
@ -0,0 +1 @@
|
|||
create temporary table evens select * from nos where v%2=0;
|
||||
1
Task/Filter/DuckDB/filter-4.duckdb
Normal file
1
Task/Filter/DuckDB/filter-4.duckdb
Normal file
|
|
@ -0,0 +1 @@
|
|||
create temporary table evens as from nos where v%2=0;
|
||||
1
Task/Filter/DuckDB/filter-5.duckdb
Normal file
1
Task/Filter/DuckDB/filter-5.duckdb
Normal file
|
|
@ -0,0 +1 @@
|
|||
DELETE FROM nos WHERE v%2=1;
|
||||
2
Task/Filter/DuckDB/filter-6.duckdb
Normal file
2
Task/Filter/DuckDB/filter-6.duckdb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
select list_filter(lst, v -> v % 2 = 0) as evens, lst
|
||||
from (select range(1,11) as lst);
|
||||
3
Task/Filter/DuckDB/filter-7.duckdb
Normal file
3
Task/Filter/DuckDB/filter-7.duckdb
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
create or replace function evens(lst) as (
|
||||
list_filter(lst, v -> v % 2 = 0)
|
||||
);
|
||||
|
|
@ -9,5 +9,5 @@ public program()
|
|||
|
||||
var evens := array.filterBy::(n => n.mod(2) == 0).toArray();
|
||||
|
||||
evens.forEach(printingLn)
|
||||
evens.forEach(PrintingLn)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,5 +9,5 @@ public program()
|
|||
|
||||
array
|
||||
.filterBy::(int n => n.mod(2) == 0)
|
||||
.forEach::(int i){ console.printLine(i) }
|
||||
.forEach::(int i){ Console.printLine(i) }
|
||||
}
|
||||
|
|
|
|||
5
Task/Filter/Pluto/filter.pluto
Normal file
5
Task/Filter/Pluto/filter.pluto
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
local a = range(10)
|
||||
b = a:filter(|x|->x%2==0)
|
||||
|
||||
b:mapped(|i|->io.write(i,'\t'))
|
||||
print()
|
||||
Loading…
Add table
Add a link
Reference in a new issue