Jump to content

User:Ajuanca/sandbox

From Wikipedia, the free encyclopedia

Hi! This page is the official Ajuanca´s sandbox. To know more about what a sandbox is, visit this page.

TASK 1

[edit]

Flock of Cedar Waxwings3.jpg

imgs

TASK 2

[edit]

Q1. What keyword marks the start of a function definition? A1. The keyword is function.

Q2. Which letter is conventionally used in Scribunto modules to hold the table of functions? A2. The common letter used is p.

Q3. What keyword marks the end of a function definition? A3. The keyword is end.

Hello, world!

Hello from Lua to my friend Ada.



TASK 3

[edit]

5 degrees Celsius is 41 degrees Fahrenheit. That's the same as say 278.15 Kelvin. It is cold.

25 degrees Celsius is 77 degrees Fahrenheit. That's the same as say 298.15 Kelvin. It is warm.

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

-8 degrees Celsius is 17.6 degrees Fahrenheit. That's the same as say 265.15 Kelvin. It is cold.

48 degrees Celsius is 118.4 degrees Fahrenheit. That's the same as say 321.15 Kelvin. It is warm.

  • When the temperature is 9, the comparison considers it smaller. I added a specific answer for temperature equals 9:

9 degrees Celsius is 48.2 degrees Fahrenheit. That's the same as say 282.15 Kelvin. It isn't neither warm nor cold.

  • When no value is given to celsius parameter, it considers that it isn't given:

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

  • When the wrong variable type is written, it considers that it isn't given:

0 degrees Celsius is 32 degrees Fahrenheit. That's the same as say 273.15 Kelvin. It is cold.

TASK 4

[edit]

Tables

[edit]
Extended content

The 4 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times 4 equals 4
2 times 4 equals 8
3 times 4 equals 12
4 times 4 equals 16
5 times 4 equals 20
6 times 4 equals 24
7 times 4 equals 28
8 times 4 equals 32
9 times 4 equals 36
10 times 4 equals 40
11 times 4 equals 44
12 times 4 equals 48

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -7 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -7 equals -7
2 times -7 equals -14
3 times -7 equals -21
4 times -7 equals -28
5 times -7 equals -35
6 times -7 equals -42
7 times -7 equals -49
8 times -7 equals -56
9 times -7 equals -63
10 times -7 equals -70
11 times -7 equals -77
12 times -7 equals -84

The -9 times table.

When no number is given or no parameter is sended, the default value is used. Instead of 2, the default number is generated randomly between -12 and 12, and in this case is -7.
1 times -9 equals -9
2 times -9 equals -18
3 times -9 equals -27
4 times -9 equals -36
5 times -9 equals -45
6 times -9 equals -54
7 times -9 equals -63
8 times -9 equals -72
9 times -9 equals -81
10 times -9 equals -90
11 times -9 equals -99
12 times -9 equals -108

People

[edit]

Hello Agnetha
Hello Betty
Hello Carlos
Hello Davinder
Hello Eloise
Hello Martin
Hello Doug
Hello Diego

TASK 5

[edit]

Sub-strings and case

[edit]

This is simple

Patterns and matching

[edit]

Q1. What does %w+ match in a Lua pattern? A1. As it's written in the documentation, it represents all ASCII alphanumeric characters. In this case, they'll correspond to the month.

Q2. What does %d+ match in a Lua pattern? A2. As it's written in the documentation, it represents all digits. In this case, they'll correspond to the day or year.

Year = 2018
Day = 31
Month = October, that is the tenth month.
Yes, I can figure out how does it works. The input is passed to the function and then saved to the variable dmy. After that, there're declared three variables that will come from casting dmy into three pieces, thanks to the method string.match that, as it's written in the documentation, it compares the first parameter, in this case, dmy, with a given parameter as a second attribute, in this case, numbers characters numbers, that are saved corresponding to the variables d, m and y. Finally, the variables are concatenated with some text and returned.

In order to get the values of the day, month and year in this format, we should modify the line that saves each value in the variable, searching in the first place instead of the day the month, in second place the day and lastly the year. Note that as also a comma (,) is introduced, we also should cast it. I made a function p.unpackUS that applies this changes. I also implemented some lines to get the ordinal position of the month. In the above example, the given value was "mdydate=October 31, 2018"

Year = 2018
Day = 31
Month = October, that is the tenth month.

TASK 6

[edit]

Languages libraries for MediaWiki

[edit]

WikiMedia possible languages

[edit]
Extended content

oc - occitan
sc - sardu
ady - адыгабзэ
ike-latn - inuktitut
ab - аԥсшәа
glk - گیلکی
sli - Schläsch
lb - Lëtzebuergesch
nb - norsk bokmål
xal - хальмг
wal - wolaytta
ast - asturianu
ca - català
ba - башҡортса
gag - Gagauz
ga - Gaeilge
sr-ec - српски (ћирилица)
da - dansk
kus - Kʋsaal
ja - 日本語
mus - Mvskoke
lus - Mizo ţawng
gan-hant - 贛語(繁體)
la - Latina
sa - संस्कृतम्
haw - Hawaiʻi
ruq - Vlăheşte
wa - walon
ta - தமிழ்
cpx-hans - 莆仙语(简体)
scn - sicilianu
tly-cyrl - толыши
nan-hant - 閩南語(傳統漢字)
zh-min-nan - Bân-lâm-gú
mnc-latn - manju gisun
pag - Pangasinan
mag - मगही
nan-latn-tailo - Bân-lâm-gú (Tâi-lô)
lij - Ligure
stq - Seeltersk
se-fi - davvisámegiella (Suoma bealde)
rki - ရခိုင်
nah - Nāhuatl
bcc - جهلسری بلوچی
lki - لەکی
crh-cyrl - къырымтатарджа (Кирилл)
aeb - تونسي / Tûnsî
pcm - Naijá
pcd - Picard
tdd - ᥖᥭᥰ ᥖᥬᥲ ᥑᥨᥒᥰ
bxr - буряад
ibb - ibibio
ace - Acèh
jbo - la .lojban.
kbd-cyrl - адыгэбзэ
se-no - davvisámegiella (Norgga bealde)
acm - عراقي
chy - Tsetsêhestâhese
cdo - 閩東語 / Mìng-dĕ̤ng-ngṳ̄
kk-arab - قازاقشا (تٴوتە)
kjh - хакас
shy - tacawit
sco - Scots
nan - 閩南語 / Bân-lâm-gú
ban - Basa Bali
gan - 贛語
shi-latn - Taclḥit
kai - Karai-karai
jam - Patois
pam - Kapampangan
mad - Madhurâ
nys - Nyunga
aae - Arbërisht
guw - gungbe
sat - ᱥᱟᱱᱛᱟᱲᱤ
kaa - Qaraqalpaqsha
zgh-latn - tamaziɣt tanawayt
lbe - лакку
lez - лезги
kbd - адыгэбзэ
gcf - kréyòl Gwadloup
kab - Taqbaylit
rgn - Rumagnôl
sah - саха тыла
rsk - руски
szl - ślůnski
fiu-vro - võro
acf - Kwéyòl Sent Lisi
kcg - Tyap
sk - slovenčina
ksw - စှီၤ
tk - Türkmençe
ku-latn - kurdî (latînî)
ik - Iñupiatun
dga - Dagaare
mk - македонски
bar - Boarisch
syl - ꠍꠤꠟꠐꠤ
ext - estremeñu
gan-hans - 赣语(简体)
myv - эрзянь
ug-arab - ئۇيغۇرچە
fj - Na Vosa Vakaviti
lzh - 文言
kj - Kwanyama
koi - перем коми
krj - Kinaray-a
kea - kabuverdianu
ccp - 𑄌𑄋𑄴𑄟𑄳𑄦
zh-classical - 文言
zh - 中文
pdc - Deitsch
ti - ትግርኛ
si - සිංහල
kri - Krio
hi - हिन्दी
mnc-mong - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
fi - suomi
hyw - Արեւմտահայերէն
li - Limburgs
ki - Gĩkũyũ
tg-latn - tojikī
dtp - Dusun Bundu-liwan
bh - भोजपुरी
ch - Chamoru
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
nmz - nawdm
kum - къумукъ
ceb - Cebuano
mui - Baso Palembang
pwn - pinayuanan
sh - srpskohrvatski / српскохрватски
tly - tolışi
tum - chiTumbuka
mh - Ebon
nup - Nupe
sh-latn - srpskohrvatski (latinica)
ko-kp - 조선말
ady-cyrl - адыгабзэ
atj - Atikamekw
pih - Norfuk / Pitkern
bpy - বিষ্ণুপ্রিয়া মণিপুরী
bg - български
lg - Luganda
kg - Kongo
ng - Oshiwambo
mg - Malagasy
ojb - Ojibwemowin
ig - Igbo
tg - тоҷикӣ
sg - Sängö
ug - ئۇيغۇرچە / Uyghurche
hak-hant - 客家語(繁體)
za - Vahcuengh
gcr - kriyòl gwiyannen
shi - Taclḥit
ff - Fulfulde
af - Afrikaans
loz - Silozi
kbp - Kabɩyɛ
pt-br - português do Brasil
rut - мыхаӀбишды
hak-hans - 客家语(简体)
ckb - کوردی
jut - jysk
mnw - ဘာသာမန်
cpx-latn - Pó-sing-gṳ̂ (Báⁿ-uā-ci̍)
vmw - emakhuwa
nyo - Orunyoro
ee - eʋegbe
de - Deutsch
ce - нохчийн
be - беларуская
nds-nl - Nedersaksies
nia - Li Niha
ne - नेपाली
wuu-hans - 吴语(简体)
ie - Interlingue
he - עברית
ryu - うちなーぐち
te - తెలుగు
mwl - Mirandés
tg-cyrl - тоҷикӣ
es-419 - español de América Latina
tzm - ⵜⴰⵎⴰⵣⵉⵖⵜ
nl-informal - Nederlands (informeel)
yue-hant - 粵語(繁體)
skr-arab - سرائیکی
hif-latn - Fiji Hindi
tt-latn - tatarça
abs - bahasa ambon
gd - Gàidhlig
sd - سنڌي
efi - Efịk
sh-cyrl - српскохрватски (ћирилица)
dty - डोटेली
yrl - Nhẽẽgatú
is - íslenska
ks - कॉशुर / کٲشُر
ms - Bahasa Melayu
trv - Seediq
ps - پښتو
ss - SiSwati
sty - себертатар
pnb - پنجابی
ur - اردو
se-se - davvisámegiella (Ruoŧa bealde)
gpe - Ghanaian Pidgin
apc - شامي
mnc - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
as - অসমীয়া
cs - čeština
bs - bosanski
fr - français
hr - hrvatski
kr - kanuri
mr - मराठी
or - ଓଡ଼ିଆ
kk-latn - qazaqşa (latın)
frp - arpetan
sr - српски / srpski
tru - Ṫuroyo
crh - qırımtatarca
brh - Bráhuí
smn - anarâškielâ
ar - العربية
br - brezhoneg
cr - Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ
sma - åarjelsaemien
nds - Plattdüütsch
lmo - lombard
sq - shqip
crh-latn - qırımtatarca (Latin)
arz - مصرى
shy-latn - tacawit
en-ca - Canadian English
ary - الدارجة
luz - لئری دوٙمینی
be-tarask - беларуская (тарашкевіца)
fon - fɔ̀ngbè
vep - vepsän kel’
ses - Koyraboro Senni
ts - Xitsonga
rmc - romaňi čhib
bdr - Bajau Sama
krl - karjal
es-formal - español (formal)
bo - བོད་ཡིག
nso - Sesotho sa Leboa
nog - ногайша
btm - Batak Mandailing
tok - toki pona
arn - mapudungun
kk-cn - قازاقشا (جۇنگو)
ban-bali - ᬩᬲᬩᬮᬶ
roa-tara - tarandíne
pnt - Ποντιακά
to - lea faka-Tonga
so - Soomaaliga
no - norsk
mo - молдовеняскэ
tpi - Tok Pisin
bto - Iriga Bicolano
io - Ido
lo - ລາວ
ko - 한국어
fo - føroyskt
srn - Sranantongo
ho - Hiri Motu
an - aragonés
bn - বাংলা
sro - sardu campidanesu
lrc - لۊری شومالی
yi - ייִדיש
hsb - hornjoserbsce
ase - American sign language
inh - гӀалгӀай
rn - ikirundi
sn - chiShona
tn - Setswana
mn - монгол
nn - norsk nynorsk
vro - võro
kn - ಕನ್ನಡ
ln - lingála
en - English
gn - Avañe'ẽ
nqo - ߒߞߏ
kk-tr - qazaqşa (Türkïya)
am - አማርኛ
mhr - олык марий
diq - Zazaki
gom-deva - गोंयची कोंकणी
qug - Runa shimi
sm - Gagana Samoa
rm - rumantsch
nrm - Nouormand
om - Oromoo
nod - ᨣᩤᩴᨾᩮᩬᩥᨦ
km - ភាសាខ្មែរ
bew - Betawi
frc - français cadien
mni - ꯃꯤꯇꯩ ꯂꯣꯟ
nan-latn-pehoeji - Bân-lâm-gú (Pe̍h-ōe-jī)
hsn - 湘语
nov - Novial
crh-ro - tatarşa
ltg - latgaļu
yo - Yorùbá
vo - Volapük
new - नेपाल भाषा
sl - slovenščina
tl - Tagalog
chr - ᏣᎳᎩ
pl - polski
ml - മലയാളം
nl - Nederlands
kl - kalaallisut
vot - Vaďďa
isv-latn - medžuslovjansky
el - Ελληνικά
ku-arab - کوردی (عەرەبی)
igl - Igala
shn - ၽႃႇသႃႇတႆး
egl - Emiliàn
bgn - روچ کپتین بلوچی
en-gb - British English
chn - chinuk wawa
zh-cn - 中文(中国大陆)
mos - moore
uz - oʻzbekcha / ўзбекча
bho - भोजपुरी
cbk-zam - Chavacano de Zamboanga
dz - ཇོང་ཁ
pi - पालि
liv - Līvõ kēļ
hz - Otsiherero
cho - Chahta anumpa
zu - isiZulu
zh-tw - 中文(臺灣)
zh-sg - 中文(新加坡)
zh-my - 中文(马来西亚)
zh-mo - 中文(澳門)
pdt - Plautdietsch
ms-arab - بهاس ملايو
az - azərbaycanca
hif - Fiji Hindi
gor - Bahasa Hulontalo
zh-hans - 中文(简体)
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
zea - Zeêuws
yue-hans - 粵语(简体)
xmf - მარგალური
xsy - saisiyat
my - မြန်မာဘာသာ
yue - 粵語
ky - кыргызча
xh - isiXhosa
wuu-hant - 吳語(正體)
guc - wayuunaiki
wuu - 吴语
lzz - Lazuri
wo - Wolof
de-ch - Schweizer Hochdeutsch
cy - Cymraeg
uz-cyrl - ўзбекча
war - Winaray
hy - հայերեն
es - español
fy - Frysk
olo - livvinkarjala
ann - Obolo
tet - tetun
vmf - Mainfränkisch
ay - Aymar aru
os - ирон
na - Dorerin Naoero
szy - Sakizaya
vi - Tiếng Việt
ksh - Ripoarisch
arq - جازايرية
vec - vèneto
ve - Tshivenda
lfn - Lingua Franca Nova
sms - nuõrttsääʹmǩiõll
sdh - کوردی خوارگ
de-formal - Deutsch (Sie-Form)
uz-latn - oʻzbekcha
vls - West-Vlams
wls - Fakaʻuvea
hrx - Hunsrik
bat-smg - žemaitėška
uk - українська
cpx-hant - 莆仙語(繁體)
ug-latn - Uyghurche
hno - ہندکو
udm - удмурт
pfl - Pälzisch
got - 𐌲𐌿𐍄𐌹𐍃𐌺
tyv - тыва дыл
ty - reo tahiti
tw - Twi
map-bms - Basa Banyumasan
ttj - Orutooro
ks-deva - कॉशुर
hu-formal - magyar (formal)
als - Alemannisch
tt-cyrl - татарча
aa - Qafár af
tr - Türkçe
fa - فارسی
be-x-old - беларуская (тарашкевіца)
rue - русиньскый
dag - dagbanli
ka - ქართული
ia - interlingua
ha - Hausa
pa - ਪੰਜਾਬੀ
mi - Māori
th - ไทย
jv - Jawa
tcy - ತುಳು
iba - Jaku Iban
ruq-cyrl - Влахесте
co - corsu
sw - Kiswahili
bcl - Bikol Central
ro - română
rw - Ikinyarwanda
eml - emiliàn e rumagnòl
su - Sunda
kw - kernowek
eo - Esperanto
alt - алтай тил
csb - kaszëbsczi
zh-hk - 中文(香港)
anp - अंगिका
dsb - dolnoserbski
sv - svenska
sr-el - srpski (latinica)
bci - wawle
ike-cans - ᐃᓄᒃᑎᑐᑦ
zh-hant - 中文(繁體)
gld - на̄ни
kjp - ဖၠုံလိက်
skr - سرائیکی
sje - bidumsámegiella
bm - bamanankan
arc - ܐܪܡܝܐ
simple - Simple English
gv - Gaelg
lad - Ladino
mdf - мокшень
gom-latn - Gõychi Konknni
cv - чӑвашла
dv - ދިވެހިބަސް
ks-arab - کٲشُر
roa-rup - armãneashti
fat - mfantse
kk-kz - қазақша (Қазақстан)
gaa - Ga
grc - Ἀρχαία ἑλληνικὴ
kv - коми
lv - latviešu
ilo - Ilokano
aln - Gegë
bqi - بختیاری
din - Thuɔŋjäŋ
sgs - žemaitėška
bbc - Batak Toba
khw - کھوار
aeb-latn - Tûnsî
sei - Cmique Itom
se - davvisámegiella
min - Minangkabau
sdc - Sassaresu
av - авар
bug - Basa Ugi
aeb-arab - تونسي
gsw - Alemannisch
gl - galego
ruq-latn - Vlăheşte
bgc - हरियाणवी
iu - ᐃᓄᒃᑎᑐᑦ / inuktitut
hu - magyar
gu - ગુજરાતી
rup - armãneashti
eu - euskara
ru - русский
hil - Ilonggo
azb - تۆرکجه
qu - Runa Simi
kge - Basa Kumoring
bbc-latn - Batak Toba
rmy - romani čhib
rif - Tarifit
kk-cyrl - қазақша (кирил)
ku - kurdî
kk - қазақша
nit - కొలామి
de-at - Österreichisches Deutsch
prg - prūsiskan
pms - Piemontèis
zh-yue - 粵語
st - Sesotho
tt - татарча / tatarça
niu - Niuē
fit - meänkieli
tay - Tayal
hak-latn - Hak-kâ-ngî (Pha̍k-fa-sṳ)
frr - Nordfriisk
awa - अवधी
sjd - кӣллт са̄мь кӣлл
pap - Papiamentu
it - italiano
gom - गोंयची कोंकणी / Gõychi Konknni
nyn - runyankore
ht - Kreyòl ayisyen
et - eesti
ny - Chi-Chewa
nv - Diné bizaad
cpx - 莆仙語 / Pó-sing-gṳ̂
hak - 客家語 / Hak-kâ-ngî
bi - Bislama
ii - ꆇꉙ
pt - português
ang - Ænglisc
nap - Napulitano
bjn - Banjar
lt - lietuvių
mzn - مازِرونی
ami - Pangcah
mt - Malti
mrj - кырык мары
fur - furlan
gur - farefare
mrh - Mara
mai - मैथिली
lld - Ladin
krc - къарачай-малкъар
blk - ပအိုဝ်ႏဘာႏသာႏ
kiu - Kırmancki
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
avk - Kotava
id - Bahasa Indonesia
cps - Capiceño

= 546 languages

Fallback languages

[edit]
is fallback languages

1 - en
There's 1 possible plan-Bs languages.

cv fallback languages

1 - ru
2 - en
There're 2 possible plan-Bs languages.

kk fallback languages

1 - kk-cyrl
2 - en
There're 2 possible plan-Bs languages.

Pageinfo

[edit]

Get title

[edit]

Extension:Scribunto/Lua reference manual

Basic information

[edit]
Test 1
[edit]

The input is Color

Color exists and isn't a redirect.

Test 2
[edit]

The input is Colour

Colour exists and is a redirect.

Test 3
[edit]

The input is Colr

Colr doesn't exist and isn't a redirect.

Test 4
[edit]

The input is Polymerase

Polymerase exists and isn't a redirect.

Test 5
[edit]

The input is UK

UK exists and is a redirect.

Test 6
[edit]

The input is Wikimedia_foundation

Wikimedia_foundation exists and is a redirect.

Experimenting
[edit]
  • When you give the character *, the function is called and the Wikimedia syntax interprets it as a bulleted-list item.
  • exists and is a redirect.
  • When you give #, a non-related Sandbox problem appears:

Lua error in mw.title.lua at line 206: bad argument #1 to 'pairs' (table expected, got nil).

  • When no attribute is given, the following error appears:

Lua error: bad argument #1 to 'title.new' (number or string expected, got nil).

  • When no value is given to the attribute (titleOfPage=):

You need to give a value to the titleOfPage attribute.

  • When you request a page that existed but now is deleted:

Like_this_one doesn't exist and isn't a redirect.

Non-requested implementations

[edit]
  • Now detects subpages and talk pages:

The input is Talk:Australia

Talk:Australia exists and is a talk page.

The input is Wikipedia:Tip_of_the_day/March_8

Wikipedia:Tip_of_the_day/March_8 exists and is a subpage.

Organize all languages [in development]

[edit]
  • Return list with ordered languages.


TASK 7

[edit]

Fetching a date

[edit]

In the below example, we can see how the data is returned from the Wikimedia database. A + precedes the date (obviously a time-data type). After it, the year, a -, the month, another -, the day, and without any separation, a T that indicates the start of the specific time in the form hh:mm:ss, which null value is 00:00:00, and finally, also without separation, a Z.

+1952-03-11T00:00:00Z

  • The input is qid=Q42 and prop=P569.

The year is 1952, the month is 03 and the day is 11.
This date in an ISO-style is 1952-03-11.

  • The input is qid=Q151973 and prop=P569.

The year is 1925, the month is 11 and the day is 10.
This date in an ISO-style is 1925-11-10.

  • The input is qid=Q34851 and prop=P570.

The year is 2011, the month is 03 and the day is 23.
This date in an ISO-style is 2011-03-23.

Fetching a full date

[edit]
  • The input is qid=Q42 and prop=P569.

11 March 1952

  • The input is qid=Q151973 and prop=P569.

10 November 1925

  • The input is qid=Q34851 and prop=P570.

23 March 2011

Fetching an item

[edit]
  • The input is qid=Q42 and prop=P1196.

natural causes

  • The input is qid=Q151973 and prop=P26.

Elizabeth Taylor