MediaWiki API result
This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.
See the complete documentation, or the API help for more information.
{
"batchcomplete": "",
"continue": {
"gapcontinue": "Regulamentul_laboratoarelor_POO_\u0219i_ASC",
"continue": "gapcontinue||"
},
"warnings": {
"main": {
"*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
},
"revisions": {
"*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
}
},
"query": {
"pages": {
"161": {
"pageid": 161,
"ns": 0,
"title": "Realizarea \u0219i execu\u021bia unui program Java",
"revisions": [
{
"contentformat": "text/x-wiki",
"contentmodel": "wikitext",
"*": "Pentru realizarea unui program in Java, sunt necesare dou\u0103 opera\u021bii: compilarea unui fi\u0219er surs\u0103 \u0219i rularea programului \u00een ma\u0219ina virtual\u0103. Fi\u0219ierul surs\u0103, \u00een principiu, se poate scrie \u00een orice editor de text. Pentru Microsoft Windows, o variant\u0103 bun\u0103 este [http://notepad-plus-plus.org/ Notepad++]. Pentru Linux, \u00een func\u021bie de tipul de interfa\u021b\u0103, pute\u021bi folosi ''Kate'' pentru KDE, sau ''gedit'' pentru Gnome. \u00cen cadrul laboratorului de POO, vom folosi editorul ''Kate''. \u00cen laborator, acesta se porne\u0219te tast\u00e2nd combina\u021bia \"Alt + F2\", apoi \u00een fereastra care apare tasta\u021bi ''kate'', apoi tasta enter.\n\n== Tutorial pentru lucrul \u00een linia de comand\u0103 ==\n\n\u00cenainte de instruc\u021biunile de compilare \u0219i execu\u021bie efective, vom avea nevoie de o introducere \u00een modul de utilizare a consolei \u00een MS Windows \u0219i Linux.\n\n=== MS Windows cmd ===\n\n\u00cen Windows, consola se porne\u0219te ap\u0103s\u00e2nd combina\u021bia \"winkey + r\", tast\u00e2nd ''cmd''. Ea arat\u0103 \u00een felul urm\u0103tor:\n\n[[Fi\u0219ier:cmd.png|Consola sistemului de operare Windows]]\n\nC\u00e2teva comenzi utile \u00een linia de comand\u0103:\n\n* dac\u0103 fi\u0219ierele surs\u0103 se afl\u0103 pe alt\u0103 parti\u021bie, cum ar fi D, sau E, comanda care schimb\u0103 calea curent\u0103 pe parti\u021bia D, spre exemplu, este:\n<syntaxhighlight lang=\"dos\">\nc:\\Users\\Echo> d:\nd:\\>\n</syntaxhighlight>\n* pentru schimbarea directorului curent, se folose\u0219te comanda ''cd'' (change directory):\n<syntaxhighlight lang=\"dos\">\nc:\\Users\\Echo> cd Documents\nc:\\Users\\Echo\\Documents> cd work\nc:\\Users\\Echo\\Documents\\work> cd ..\nc:\\Users\\Echo\\Documents>\n</syntaxhighlight>\n* pentru listarea con\u021binutului directorului curent se folose\u0219te comanda ''dir'':\n<syntaxhighlight lang=\"dos\">\nC:\\Users\\Echo\\Documents\\work\\poo> dir\n Volume in drive C has no label.\n Volume Serial Number is 9C96-4AC6\n\n Directory of C:\\Users\\Echo\\Documents\\work\\poo\n\n18-Jul-12 10:42 <DIR> .\n18-Jul-12 10:42 <DIR> ..\n18-Jul-12 10:43 117 MainClass.java\n 1 File(s) 117 bytes\n 2 Dir(s) 22,145,564,672 bytes free\n\nC:\\Users\\Echo\\Documents\\work\\poo>\n</syntaxhighlight>\n* pentru crearea unui director nou, se folose\u0219te comanda ''md'' (make directory):\n<syntaxhighlight lang=\"dos\">\nC:\\Users\\Echo\\Documents\\work\\poo> md test\n\nC:\\Users\\Echo\\Documents\\work\\poo> dir\n Volume in drive C has no label.\n Volume Serial Number is 9C96-4AC6\n\n Directory of C:\\Users\\Echo\\Documents\\work\\poo\n\n18-Jul-12 10:45 <DIR> .\n18-Jul-12 10:45 <DIR> ..\n18-Jul-12 10:43 117 MainClass.java\n18-Jul-12 10:45 <DIR> test\n 1 File(s) 117 bytes\n 3 Dir(s) 22,145,433,600 bytes free\n\nC:\\Users\\Echo\\Documents\\work\\poo>\n</syntaxhighlight>\n\n=== Linux Bash ===\n\n\u00cen Linux, consola se porne\u0219te ap\u0103s\u00e2nd combina\u021bia de taste \"Alt + Ctrl + T\", sau select\u00e2nd aplica\u021bia '''Terminal''' din ''Applications - Accesories''. Aceasta arat\u0103 \u00een felul urm\u0103tor:\n\n[[Fi\u0219ier:linux_console.png|Consola din Linux]]\n\nC\u00e2teva comenzi utile \u00een linia de comand\u0103:\n* pentru aflarea directorului curent, se folose\u0219te comanda ''pwd'' (print working directory):\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~$ pwd \n/home/student\nstudent@olympus07:~$\n</syntaxhighlight>\n* pentru schimbarea directorului curent, se folose\u0219te comanda ''cd'' (change directory):\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~$ cd work\nstudent@olympus07:~/work$ pwd \n/home/student/work\nstudent@olympus07:~/work$ cd ..\nstudent@olympus07:~$ pwd \n/home/student\nstudent@olympus07:~$\n</syntaxhighlight>\n* pentru listarea con\u021binutului directorului curent se folose\u0219te comanda ''ls -l'' (list structure, long listing format):\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~/work/poo$ ls -l\ntotal 4\n-rw-rw-r-- 1 student student 110 Jul 18 11:08 MainClass.java\nstudent@olympus07:~/work/poo$\n</syntaxhighlight>\n* pentru crearea unui director nou, se folose\u0219te comanda ''mkdir'' (make directory):\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~/work/poo$ mkdir test\nstudent@olympus07:~/work/poo$ ls -l\ntotal 8\n-rw-rw-r-- 1 student student 110 Jul 18 11:08 MainClass.java\ndrwxrwxr-x 2 student student 4096 Jul 18 11:10 test\nstudent@olympus07:~/work/poo$\n</syntaxhighlight>\n\n== Scrierea, compilarea \u0219i execu\u021bia unui program Java == \n\n=== Editarea codului surs\u0103 ===\n\nPrimul pas \u00een realizarea unui program Java este scrierea efectiv\u0103 a codului. Pentru asta, folosi\u021bi editorul preferat \u0219i salva\u021bi fi\u0219ierul cu extensia .java.\n\n<div class=\"regula\"><font color=\"#ff0000\">Regul\u0103:</font> \u00centotdeauna, extensia unui fi\u0219ier care con\u021bine un program Java este .java</div>\n\n\n<div class=\"regula\"><font color=\"#ff0000\">Regul\u0103:</font> \u00centotdeauna, numele clasei con\u021binut\u0103 \u00eentr-un fi\u0219ier .java, trebuie s\u0103 fie identic cu numele fi\u0219ierului. Ex: Clasa MainClass trebuie salvat\u0103 \u00eentr-un fi\u0219ier cu numele MainClass.java. Aten\u021bie: Java este case-sensitive!!!</div>\n\nPentru exemplu, vom realiza urm\u0103toarea clas\u0103:\n<syntaxhighlight lang=\"java\">\npublic class MainClass{\n\npublic static void main(String[] _args){\n System.out.println(\"Hello world!\");\n}\n\n}\n</syntaxhighlight>\n\nAceast\u0103 clas\u0103 se salveaz\u0103 \u00eentr-un fi\u0219ier cu numele MainClass.java.\n\n=== Compilarea sursei ===\n\n\u00cen consol\u0103, se navigheaz\u0103 folosind comenzile prezentate mai sus p\u00e2n\u0103 \u00een directorul \u00een care a fost salvat fi\u0219ierul surs\u0103. Apoi, folosind executabilul ''javac'' (Java Compiler), se compileaz\u0103:\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~/work/poo$ javac MainClass.java\nstudent@olympus07:~/work/poo$ ls -l\ntotal 8\n-rw-rw-r-- 1 student student 424 Jul 18 11:22 MainClass.class\n-rw-rw-r-- 1 student student 110 Jul 18 11:08 MainClass.java\n</syntaxhighlight>\n\n\n<div class=\"regula\"><font color=\"#ff0000\">Regul\u0103:</font> \u00centotdeauna, compilatorul Java va lua ca argument '''numele fi\u0219ierului''' (cu tot cu extensie) care trebuie compilat.</div>\n\nDac\u0103 execu\u021bia compilatorului nu a afi\u0219at nici o eroare, atunci compilarea s-a \u00eencheiat cu succes \u0219i a fost generat fi\u0219ierul executabil pentru ma\u0219ina virtual\u0103, cu extensia .class.\n\nDac\u0103 compilatorul nu a putut fi g\u0103sit, atunci verifica\u021bi variabila de sistem PATH, conform instruc\u021biunilor de instalare pentru JDK.\n\nDac\u0103 compilatorul a afi\u0219at erori, citi\u021bi-le cu aten\u021bie \u0219i repara\u021bi problemele din codul surs\u0103 Java.\n\n=== Execu\u021bia programului \u00een ma\u0219ina virtual\u0103 ===\n\n\u00cen locul unde s-a compilat codul surs\u0103, folosind executabilul ''java'' (ma\u0219ina virtual\u0103), se execut\u0103 programul:\n\n<syntaxhighlight lang=\"bash\">\nstudent@olympus07:~/work/poo$ java MainClass\nHello world!\nstudent@olympus07:~/work/poo$ \n</syntaxhighlight>\n\n\n<div class=\"regula\"><font color=\"#ff0000\">Regul\u0103:</font> \u00centotdeauna, ma\u0219ina virtual\u0103 Java va lua ca argument '''numele clasei''' (f\u0103r\u0103 extensie) care trebuie executat.</div>\n\n\n<div class=\"regula\"><font color=\"#ff0000\">Regul\u0103:</font> O clas\u0103 Java nu poate fi rulat\u0103 \u00een ma\u0219ina virtual\u0103 dec\u00e2t dac\u0103 con\u021bine metoda main, exact cum este defint\u0103 \u00een specifica\u021bie: ''public static void main(String[])''</div>"
}
]
},
"701": {
"pageid": 701,
"ns": 0,
"title": "Regulament protectia muncii",
"revisions": [
{
"contentformat": "text/x-wiki",
"contentmodel": "wikitext",
"*": "INSTRUC\u0162IUNE INTERN\u0102 privind instruirea de securitatea muncii:[[Fi\u0219ier:prot_muncii.pdf]]"
}
]
}
}
}
}