Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
1
Task/URL-encoding/Apex/url-encoding.apex
Normal file
1
Task/URL-encoding/Apex/url-encoding.apex
Normal file
|
|
@ -0,0 +1 @@
|
|||
EncodingUtil.urlEncode('http://foo bar/', 'UTF-8')
|
||||
1
Task/URL-encoding/Lasso/url-encoding.lasso
Normal file
1
Task/URL-encoding/Lasso/url-encoding.lasso
Normal file
|
|
@ -0,0 +1 @@
|
|||
bytes('http://foo bar/') -> encodeurl
|
||||
2
Task/URL-encoding/Lingo/url-encoding.lingo
Normal file
2
Task/URL-encoding/Lingo/url-encoding.lingo
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
put urlencode("http://foo bar/")
|
||||
-- "http%3a%2f%2ffoo+bar%2f"
|
||||
2
Task/URL-encoding/LiveCode/url-encoding.livecode
Normal file
2
Task/URL-encoding/LiveCode/url-encoding.livecode
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
urlEncode("http://foo bar/")
|
||||
-- http%3A%2F%2Ffoo+bar%2F
|
||||
3
Task/URL-encoding/Nim/url-encoding.nim
Normal file
3
Task/URL-encoding/Nim/url-encoding.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import cgi
|
||||
|
||||
echo encodeUrl("http://foo/bar/")
|
||||
7
Task/URL-encoding/Sidef/url-encoding.sidef
Normal file
7
Task/URL-encoding/Sidef/url-encoding.sidef
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
func urlencode(str) {
|
||||
str.gsub!(%r"([^-A-Za-z0-9_.!~*'() ])", {|a| "%%%02X" % a.ord});
|
||||
str.gsub!(' ', '+');
|
||||
return str;
|
||||
}
|
||||
|
||||
say urlencode('http://foo bar/');
|
||||
1
Task/URL-encoding/jq/url-encoding-1.jq
Normal file
1
Task/URL-encoding/jq/url-encoding-1.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
"á" | @uri
|
||||
9
Task/URL-encoding/jq/url-encoding-2.jq
Normal file
9
Task/URL-encoding/jq/url-encoding-2.jq
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
def url_encode:
|
||||
# The helper function checks whether the input corresponds to one of the characters: !'()*
|
||||
def recode: . as $c | [33,39,40,41,42] | index($c);
|
||||
def hex: if . < 10 then 48 + . else 55 + . end;
|
||||
@uri
|
||||
| explode
|
||||
# 37 ==> "%", 50 ==> "2"
|
||||
| map( if recode then (37, 50, ((. - 32) | hex)) else . end )
|
||||
| implode;
|
||||
1
Task/URL-encoding/jq/url-encoding-3.jq
Normal file
1
Task/URL-encoding/jq/url-encoding-3.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
"http://foo bar/" | @uri
|
||||
1
Task/URL-encoding/jq/url-encoding-4.jq
Normal file
1
Task/URL-encoding/jq/url-encoding-4.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
"http://foo bar/" | @uri == url_encode
|
||||
1
Task/URL-encoding/jq/url-encoding-5.jq
Normal file
1
Task/URL-encoding/jq/url-encoding-5.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
[range(0;1024) | [.] | implode | if @uri == . then . else empty end] | join(null)
|
||||
1
Task/URL-encoding/jq/url-encoding-6.jq
Normal file
1
Task/URL-encoding/jq/url-encoding-6.jq
Normal file
|
|
@ -0,0 +1 @@
|
|||
[range(0;1024) | [.] | implode | if url_encode == . then . else empty end] | join(null)
|
||||
Loading…
Add table
Add a link
Reference in a new issue