sâmbătă, 26 septembrie 2015

Sortare tabel HTML


Nume Prenume Data Suma
1 Popescu Otilia 01.03.2015 24
2 Ionescu Gheorghe 01.06.2015 534
3 Dunca Vlad 21.02.2011 21
4 Moerescu Ion 11.02.2015 12
5 Blandiana Ana 01.02.2005 45

1. Cerinte preliminare

Libraria javascript jQuery:
https://jquery.com/download/
Libraria javascript tablesorter:
https://mottie.github.io/tablesorter/docs/index.html

2. Cod tabel 

   Pentru a construi acest exemplu am folosit un tabel simplu cu 5 coloane si 6 randuri. De asemenea am folosit mai multe tipuri de date pentru a vedea cum se comporta sortarea.
   Identificatorii (id si class) leaga urmatoarele functionalitati:
1. myTable - scriptul de initializare al sortarii pe tabel
2. tabelAvansat - stilul CSS general al tabelului
3. resetSortare - scriptul de resetare al sortarii, un clic pe aceasta celula va reseta sortarea
4. celulaIndex - stilul CSS pentru coloana de index al tabelului

2. Cod stil CSS


3. Cod javascript


La incarcarea paginii se apeleaza functia de initializare a tabelului. In acest exemplu am setat tipul de data dare va fi folosit in tabel si am dezactivat sortarea pe primul tabel. De asemenea am atasat functia de resetare a sortarii pe prima celula din header.

luni, 16 martie 2015

Eclipse Luna - FindBugs install and simple configuration

1. Install FindBugs plugin


Under this section you will find all the install steps done to add the FindBugs plugin to your Eclipse Luna IDE.
Before starting the installation check for the newest repository link for the plugin. After a quick search on the FindBugs official site (http://findbugs.sourceforge.net/) you should find the repository link:
http://findbugs.cs.umd.edu/eclipse

1.1 Access "Install new software..." Eclipse view 


Click on the "Help" menu and select the "Install new software..." menu item.
This will lead you to the "Install" window.


1.2 Select the FindBugs repository

 

Press on the "Add..." button to open the "Add repository" dialog.
Fill the "Name" text box. Any non existing name can be introduced.
Fill the "Location" text box. Add the repository link from the official site:
                     http://findbugs.cs.umd.edu/eclipse
Press "OK" to finish adding the new FindBugs repository.

 

1.3 Select the plugin for install


After you finish adding the repository a new entry should be available.
Select the "FindBugs" check box and press the "Next" button to start the install.


 

1.4 Confirm installation for the selected sofware


The "Install Details" view will appear for you to see your current selections and confirm their install.
You will see details about your selected plugins: name, version and id.
To continue press "Next" button.


 

1.5 Review and confirm License agreement 


The "Review Licenses" view will appear.
Read the license and select the "I accept the terms and license agreement" to continue.
The "Finish" button becomes available.
After pressing the "Finish" button, the install will start.

 

1.6 Confirm security warning


A security warning will be displayed.
To continue the installation you will need to press the "OK" button.

 

1.7 Restart Eclipse


The restart prompt for Eclipse Luna will appear after the changes are done.
Press "Yes" button.
The plugin should be visible after the Eclipse is restarted.

 

2. Configuration


The plugin comes with a default configuration and can be used without further changes.
But you might want to make additional changes to the FindBugs plugin behavior.

 

2.1 Access Eclipse "Preferences" view


Click the "Window" menu and select the "Preferences" menu item.
The "Preferences" dialog will be opened.

 

2.2 Select FindBugs configuration view


Select the "FindBugs" entry from the tree to open it's configuration.
On the "Reporter Configuration" tab select the reported categories, level and marker type.
For example I add the "Malicious code vulnerability", "Security" and "Internationalization" categories to the plugin default selection.

 

2.3 Plugin settings


On the "Plugins and misc. Settings" you can change some of the plugin behavior.
It's a good idea to select the "Switch to FindBugs perspective after analysis" check box.

 

2.4 Rule configuration for FindBugs


On the "Detector configuration" tab you can select rules one by one.
But keep in mind that the selected rules won't be reported, if their category is not checked in the "Reporter Configuration" tab. These rules are greyed out.

miercuri, 11 februarie 2015

Comanda shutdown

Comanda shutdown permite unui utilizator sa execute, prin intermediul liniei de comanda, operatiuni de inchidere a calculatorului.

1. Inchidere planificata a calculatorului

Pentru a inchide calculatorul la un anumit interval de timp dupa lansarea comenzii folositi urmatoarea linie:

shutdown -s -f -t 2400

-s este folosit pentru stingerea calculatorului
-f va forta oprirea aplicatiilor din fundal. In general este recomandata folosirea acestei optiuni pentru a nu ramane cu calculatorul deshis.
-t este folosit pentru a defini perioada de timp dupa care se va inchide calculatorul. Perioada este definita in secunde. 2400 reprezinta 40 de minute.

2. Anularea inchiderii planificate

Daca s-a planificat inchiderea calculatorului si se doreste renuntarea la aceasta actiune.
Folositi urmatoarea linie:

shutdown -a

Optiunea -a anuleaza comanda. Poate fi folosita doar cand este planificata o actiune cu -t.

3. Restartarea calculatorului

Pentru a restarta calculatorului, folositi urmatoarea linie:

shutdown -r

-r este folosita pentru restartarea calculatorului
Daca se doreste si repornirea aplicatiilor curente folositi optiunea -g.


4. Crearea unui .bat

Pentru a executa comanda mai usor se poate crea un fisier .bat.
Acesta se poate executa ca orice alt program din sistemul de operare.
Pentru a crea acest fisier urmati urmatorii pasi:
- deshideti notepad
- scrieti linia de comanda
- salvati fisierul cu extensia .bat . Folositi "Save as.." din meniul file, si dati numele Inchide.bat
- dati dublu click pe fisier si se va executa comanda introdusa in fisier
- deshideti fisierul cu Notepad pentru  a modifica comanda stocata

5. Executarea comenzii fara a crea un fisier

Comanda se poate executa din cmd.
Pentru a deschide un cmd executati urmatorii pasi:
- apasati butonul de windows
- scrieti cmd si apasati enter (functioneaza pentru Windows 7)