Commercial Law – Online Courses

The Romanian Association of Youth with Initiative, PRO VORBIS and Siveco Romania launched a programme called  “Fii tânar antreprenor pentru viitor” [Be a young entrepreneur for the future] with the scope of promoting the business culture among young individuals.

After seeing an add online about it I decided to join a course called Entrepreneurial Competencies – Commercial Law. This online course is about the type of corporations that exist, and information from how they are formed to how they can be dissolved and more.

What interests me is PFAs and how I can join the workforce by becoming a freelance developer, so I really think that picking this course was the best idea from where to get started.

The one thing that discourages me is the cost associated with making a PFA, and the need for constant projects as to be sucessful, especially in the beginning. But all in good time, I will slowly build a portofolio and be ready with the knowlege I need when the time comes for me to make my own PFA.

Am adoptat un pisoi

Am adoptat un pisoi

Acesta este Luxor, un pisoi in varsta de 3 luni pe care l-am adoptat in urma cu o luna. In poza de pe net era alb cu ochi albastri, dar cand am fost dupa el, doamna mi-a spus ca poza era de cand l-a gasit, si ca in timp culoarea lui s-a tot inchis.

Nu conteaza, eu il iubesc si asa. Ma bucur ca il am si ne intelegem de minune.

Cum ajungem la Castelul Corvinilor/ Huniazilor din Hunedoara

Acesta este un mic ghid destinat celor care vor sa viziteze castelul Corvinilor/Huniazilor din Hunedoara.

Eu am calatorit pana acolo partial cu trenul, partial cu microbusul.
Ceea ce trebuie sa stiti daca vrei sa folositi trenul este ca CFR are trenuri numai pana in Deva sau Simeria. Adica nu puteti merge direct pana in Hunedoara pentru ca o parte din calea ferata este privata(mai exact acea parte care apartine de orasul Hunedoara.)

Dar nu trebuie sa va faceti griji.La iesirea din gara Deva gasiti autogara la 100m in
partea stanga. Autobusele merg incepand cu ora 5.30 dimineata iar rutele
pana in Hunedoara sunt foarte dese.Nu e departe,in 30 de minute ajungeti.

De la autogara la castel sunt 2km pe aceasta ruta:


o puteti parcurge in 30 de minute de mers lejer, nu va speriati si mergeti pe jos ca doar sunteti in excursie.
De la autogara daca o luati in jos si ramaneti pe partea autogarii dupa 10-15 minute de mers veti gasi  un restaurant cu porti din fier forjat,care se deschide la ora 9 dimineata.  Are meniul afisat afara iar locul pare extravagant
desi preturile nu sunt asa. Daca mergeti mai jos pe aceeasi strada veti gasi un hotel / pensiune care serveste mancare incepand cu ora 7 dimineata.

Sala de mese este la etaj iar din exterior sunt scari care va duc direct acolo.Din cate imi amintesc afara este expus un bucatar “de jucarie.

Chiar inaite sa treceti apa, adica foarte aproape de castel, mai este o pizzerie, Castello,care se deschide la ora 10.Este foarte aproape de parcul libertatii, unde este o terasa numai buna de baut bere.Acolo se afla si Catedrala Ortodoxa care e foarte frumoasa iar in dreapta ei se afla primaria.

Resumption in Java Exception Handling

Resumption means that the exception handler is expected to do something to rectify the situation, and then the faulting method is retried, presuming success the second time.If you want this, try placing your try-catch in a while loop that keeps reentering the try block until the result is satisfactory”

And then the 5th exercise on page 319 of THINKING IN JAVA by BRUCE ECKEL askes to make a resumption like behaviour using a while loop.

I’m not sure if this is very well,but here is my solution:

============================================================

public static void main(String[] args) {
Random r=new Random();
boolean done=false;

while(!done){
try{
int nr = r.nextInt(35);
if(34%nr != 0) throw new Exception();
else {done=true; System.out.println(nr);}
}catch(Exception e){ System.out.println(“nr not good”);}
}
}

===================================================================

Output:

nr not good
nr not good
nr not good
nr not good
nr not good
nr not good
nr not good
nr not good
2

=============================

I guess its not the best solution out there,but I think I got what resumption is.

Error Handling with Exceptions

[My notes from Thinking in Java by Bruce Eckel]
  • The ideal time to catch an error is at compile time.
  • Exception handling is the only official way that Java reports errors.
  • Problems are handled in the exception handler ,so the code that describes what you want to do during normal execution is separated from the code executed when things go off road.

BASIC EXCEPTIONS

  • exceptional condition= problem that prevents the continuation of the current method or scope. So, you can’t continue because you don’t have the necessary info to fix the problem in the current context, so you pass it to a higher context. This is what happens when we declare a method throws an exception.
  • what happens when we throw an exception ?      An exception object is created on the heap,with new.the current path of execution is stopped and the exception-handling mechanism takes over and begins to look for an appropriate place to continue executing the program.
  • The exception handler’s job is to recover from the problem so the program can either try another track or just continue.
  • throwing an exception = sending information about the error into a larger context by creating an object that represents the information and “throwing” it out of the current context.       ex:        if (t==null) throw new NullPointerException();  -> throwing this exception we pass the responsibility for thinking about the issue.
  • Exceptions alow us to,if nothing else, stop the execution and tellus what was wrong, or force the program to deal with the problem and return to a stable state.

EXCEPTION ARGUMENTS

  • As with any object in Java, we create exceptions on the heap,using new,thus allocating storage and calling a constructor.
  • There are 2 constructors in all standard exceptions: the default constructor, and the one that takes a string argument so we can place info about the exception. example: throw NullPointerException(“t==null”);
  • Throwing an exception also allowes us to exit from ordinary scopes.
  • We can throw any type of  THROWABLE, as it is the exception root class.

CATCHING AN EXCEPTION

  • guarded region = section of code that might produce exceptions
  • a method that throws an exception will exit in the process of throwing, to prevent exiting we use a try block.

                                          try{  //code that might thrown exceptions  }

catch(Type id){}

  • The catch is the exception handler    and it always  follows the try block   .

TERMINATION / RESUMPTION

  • Termination = the error is critical and the execution stops.
  • Resumption = the problem can be fixed by the handler and the error-throwing code is retried with success. (placing try blocks into while loops).

MAKING YOUR OWN EXCEPTION CLASS

  • to create our own exception class we inherit from an exisitng exception class.For ex: class MyException extends Exception{}.
  • It is smart to send error output to the standard error stream by writing to System.err.

EXCEPTION SPECIFICATION

  • We need to list all the exceptions a method throws:

void  myMethrod() throws ExceptionA, ExceptionB, ExcentionC {……………..

  • If there is code that throws any exception that is not handled the compiler says that we need to either handle it or use a exception specification to declare it may be thrown.
  • Checked exception = exceptions that are checked and enforced at compile time.
  • catch(Exception e){…} will catch any exception,but it needs to be put last of all the catches.
  • The call stack shows all the method calls that brought you to the point of throwing.(printStackTrace();)

RETHROWING AN EXCEPTION