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]

Lake view from Beartooth Pass.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 - башҡортса
aa - Qafár af
ga - Gaeilge
sr-ec - српски (ћирилица)
da - dansk
kus - Kʋsaal
ja - 日本語
mus - Mvskoke
lus - Mizo ţawng
na - Dorerin Naoero
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
mai - मैथिली
pam - Kapampangan
fat - mfantse
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 - саха тыла
bgc - हरियाणवी
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î)
gsw - Alemannisch
kk - қазақша
mk - македонски
bar - Boarisch
syl - ꠍꠤꠟꠐꠤ
ext - estremeñu
gan-hans - 赣语(简体)
myv - эрзянь
hrx - Hunsrik
fj - Na Vosa Vakaviti
lzh - 文言
kj - Kwanyama
koi - перем коми
krj - Kinaray-a
kea - kabuverdianu
ccp - 𑄌𑄋𑄴𑄟𑄳𑄦
zh-classical - 文言
zh - 中文
pdc - Deitsch
ti - ትግርኛ
si - සිංහල
ii - ꆇꉙ
hi - हिन्दी
mnc-mong - ᠮᠠᠨᠵᡠ ᡤᡳᠰᡠᠨ
fi - suomi
mi - Māori
li - Limburgs
ki - Gĩkũyũ
tg-latn - tojikī
dtp - Dusun Bundu-liwan
bh - भोजपुरी
ch - Chamoru
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
nmz - nawdm
rup - armãneashti
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 - себертатар
simple - Simple English
ur - اردو
se-se - davvisámegiella (Ruoŧa bealde)
gpe - Ghanaian Pidgin
apc - شامي
mnc - manju gisun
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 - العربية
gom - गोंयची कोंकणी / Gõychi Konknni
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
kk-kz - қазақша (Қазақстан)
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
map-bms - Basa Banyumasan
an - aragonés
bn - বাংলা
anp - अंगिका
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
gl - galego
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
zh-my - 中文(马来西亚)
pi - पालि
dz - ཇོང་ཁ
zh-tw - 中文(臺灣)
zh-sg - 中文(新加坡)
liv - Līvõ kēļ
hz - Otsiherero
cho - Chahta anumpa
zu - isiZulu
zh-mo - 中文(澳門)
sro - sardu campidanesu
sr-el - srpski (latinica)
zh-hans - 中文(简体)
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
zea - Zeêuws
az - azərbaycanca
hif - Fiji Hindi
gor - Bahasa Hulontalo
yue-hans - 粵语(简体)
wuu - 吴语
xsy - saisiyat
xmf - მარგალური
xh - isiXhosa
wuu-hant - 吳語(正體)
my - မြန်မာဘာသာ
yue - 粵語
ky - кыргызча
wo - Wolof
ug-latn - Uyghurche
hak - 客家語 / Hak-kâ-ngî
war - Winaray
lzz - Lazuri
es - español
de-ch - Schweizer Hochdeutsch
cy - Cymraeg
vmf - Mainfränkisch
isv-latn - medžuslovjansky
hy - հայերեն
vi - Tiếng Việt
fy - Frysk
olo - livvinkarjala
ann - Obolo
tet - tetun
os - ирон
ay - Aymar aru
vec - vèneto
ve - Tshivenda
szy - Sakizaya
ksh - Ripoarisch
uz-latn - oʻzbekcha
arq - جازايرية
uz-cyrl - ўзбекча
pnb - پنجابی
lfn - Lingua Franca Nova
sms - nuõrttsääʹmǩiõll
sdh - کوردی خوارگ
de-formal - Deutsch (Sie-Form)
uk - українська
vls - West-Vlams
wls - Fakaʻuvea
ug-arab - ئۇيغۇرچە
bat-smg - žemaitėška
kri - Krio
cpx-hant - 莆仙語(繁體)
udm - удмурт
tyv - тыва дыл
hno - ہندکو
pfl - Pälzisch
ty - reo tahiti
tw - Twi
mad - Madhurâ
ttj - Orutooro
als - Alemannisch
tt-cyrl - татарча
ks-deva - कॉशुर
jam - Patois
hu-formal - magyar (formal)
tig - ትግሬ
tr - Türkçe
gag - Gagauz
fa - فارسی
be-x-old - беларуская (тарашкевіца)
rue - русиньскый
dag - dagbanli
ka - ქართული
ia - interlingua
ha - Hausa
gan-hant - 贛語(繁體)
pa - ਪੰਜਾਬੀ
th - ไทย
lad - Ladino
kum - къумукъ
mrh - Mara
tcy - ತುಳು
ami - Pangcah
nap - Napulitano
iba - Jaku Iban
sw - Kiswahili
rw - Ikinyarwanda
co - corsu
su - Sunda
kw - kernowek
bcl - Bikol Central
ro - română
eml - emiliàn e rumagnòl
zh-hk - 中文(香港)
eo - Esperanto
ho - Hiri Motu
sv - svenska
alt - алтай тил
bci - wawle
csb - kaszëbsczi
zh-hant - 中文(繁體)
dsb - dolnoserbski
ike-cans - ᐃᓄᒃᑎᑐᑦ
skr - سرائیکی
arc - ܐܪܡܝܐ
kjp - ဖၠုံလိက်
sje - bidumsámegiella
got - 𐌲𐌿𐍄𐌹𐍃𐌺
gv - Gaelg
bm - bamanankan
rsk - руски
gom-latn - Gõychi Konknni
cv - чӑвашла
dv - ދިވެހިބަސް
ks-arab - کٲشُر
roa-rup - armãneashti
mrj - кырык мары
lua - ciluba
bqi - بختیاری
mdf - мокшень
kv - коми
lv - latviešu
ilo - Ilokano
aln - Gegë
gaa - Ga
din - Thuɔŋjäŋ
grc - Ἀρχαία ἑλληνικὴ
sgs - žemaitėška
khw - کھوار
jv - Jawa
sei - Cmique Itom
bbc - Batak Toba
min - Minangkabau
aeb-latn - Tûnsî
av - авар
se - davvisámegiella
aeb-arab - تونسي
sdc - Sassaresu
gld - на̄ни
bug - Basa Ugi
ruq-latn - Vlăheşte
iu - ᐃᓄᒃᑎᑐᑦ / inuktitut
hu - magyar
gu - ગુજરાતી
ruq-cyrl - Влахесте
eu - euskara
ru - русский
hil - Ilonggo
azb - تۆرکجه
qu - Runa Simi
rmy - romani čhib
bbc-latn - Batak Toba
kge - Basa Kumoring
rif - Tarifit
prg - prūsiskan
ku - kurdî
ik - Iñupiatun
nit - కొలామి
de-at - Österreichisches Deutsch
dga - Dagaare
pms - Piemontèis
zh-yue - 粵語
st - Sesotho
tt - татарча / tatarça
niu - Niuē
fit - meänkieli
tay - Tayal
pdt - Plautdietsch
frr - Nordfriisk
pap - Papiamentu
sjd - кӣллт са̄мь кӣлл
hak-latn - Hak-kâ-ngî (Pha̍k-fa-sṳ)
it - italiano
awa - अवधी
guc - wayuunaiki
ht - Kreyòl ayisyen
et - eesti
br - brezhoneg
nyn - runyankore
cpx - 莆仙語 / Pó-sing-gṳ̂
ny - Chi-Chewa
nv - Diné bizaad
nog - ногайша
pt - português
ang - Ænglisc
bi - Bislama
bjn - Banjar
lt - lietuvių
isv-cyrl - меджусловјанскы
hyw - Արեւմտահայերէն
mzn - مازِرونی
kk-cyrl - қазақша (кирил)
fur - furlan
gur - farefare
mt - Malti
ms-arab - بهاس ملايو
lld - Ladin
krc - къарачай-малкъар
kiu - Kırmancki
blk - ပအိုဝ်ႏဘာႏသာႏ
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
avk - Kotava
id - Bahasa Indonesia
cps - Capiceño

= 549 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