Feb 28, 2020

How i do freelancing without skill

Freelance Work That Require No Skillful Skill

        Some freelance works that requires no proper experience and not has to learn outside of our daily works just focus on some rear things and you can easily do freelancing..From my respected sir 'Sir Hisham Sawar' some very important tips and works that will bring a positive changes in you career specaially for medical, law and engineering student that want to do freelancing. 
  
            

how i do freelance without skill, works that requires no skill in freelancing
freelancing without skill


THREAD PRIORITY IN MULTITHREADING


thread priority, thread priority in java, default priority of thread, thread priority example,
C# thread priority

C# THREAD PRIORITY 

“C# thread priority is the process of setting priority for the threads so that the can execute/perform their task as the priority specified is known as thread priority in multithreading. “
When we perform multithreading inc# then the CPU utilize its resources equally among all the thread and give equal time to execute that threads. Now the problem is if we have two different methods and that are executing by two different threads but the method one has to do more work than two in these case we can set the priority for the threads we can give specify more CPU resources to thread one to complete its work as compare to thread two, therefore we use thread priority in multithreading.
            We have five level of thread priority in multithreading
1.    Lowest
In this the level the selected thread consumes least CPU resources as compare to the all others to execute.
2.    Below Normal
After lowest this level will came. This level consume more CPU resources as compare to Lowest but less as compare to all others.
3.    Normal
The default priority of threads when we create threads then the CPU utilize its resources equally among the threads that is the Normal level.
4.    Above Normal
It consume more resources as compare to the above four but less resources as compare to highest level.
5.    Highest  
Last and powerful level in this level the selected thread consumes the highest resources of CPU as compare to the all others. It is used when a thread have to work more than all thread exist in program.

Syntax

            After instantiating child thread and specify its task, we can set the priority in such a way.
                [<Th>].Priority = ThreadPriority. <Level>
           Dot Priority = ThreadPriority. is the keyword in c# thread priority, where in place of <Th> the thread instance will come and in place of <Level> the five level which is detailed above will placed. If the syntax does work then try this one.
                [<Th>].Priority = System.Threading.ThreadPriority. <Level>;
Sometime the compiler does not recognize only ThreadPriority so don't vary about this error use the full syntax of System. Threading .ThreadPriority and then mention level

Feb 21, 2020

THREAD LOCKING C#


thread lock, c# lock keyword, c# lock static object,  c# lock keyword exaxmple, c# thread lock examples
c# thread lock

C# THREAD LOCK  

“C# thread lock is a process of locking of block of codes or resource to preventing the access of multiple threads for a same resource at a point of time”. 
    C# thread lock process play very important rule in multithreading ,when multiple user trying to access for a same resources of Data in Data Base System and Web Server System at a time.

Syntax of Thread locking

               To lock the blocks of code we use the keyword ‘Lock (this)’ and place the codes 
in-between starting and closing braces like given below, now once you lock the codes then that is accessable for only one thread at a time all the other thread have to wait in line to get acess to thoes code which is locked. C# thread lock syntax is
Lock (this)
{
  Statements;
  Or block of codes;
}

EXAMPLE OF THREAD LOCKING

            Suppose an example. That has a lock method accessing by different thread, make sure to add directive above of namespace that is ‘System. Threading’.
using System.Threading;
namespace ThraedLock
{
    class Program
    {
        public void ThreadLockdemo()
        {
            lock (this)
            {
                for (int i = 1; i <= 50; i++)
                    Console.WriteLine("Printing line number " + i );
            }
        }
        static void Main(string[] args)
        {
            Program p = new Program();
            Thread t1 = new Thread(p.ThreadLockdemo);
            Thread t2 = new Thread(p.ThreadLockdemo);
            Thread t3 = new Thread(p.ThreadLockdemo);
            t1.Start();
            t2.Start();
            t3.Start();
            Console.ReadKey();
        }
    }
}
       This program will program the line in sequence otherwise without using lock threading sequence will disturbed run it and see the outputs and then remove the lock body and see the output you will notice the changes.

MULTITHREADING JOIN METHOD IN C#

join method, c# join join method python, c# join example, thread join example
join in multithreading

JOIN METHOD IN MULTITHREADING IN C#

            Join is the keyword which is used in multi-threading, when the Main Thread need to stay in program until the child threads does not complete their task”.

Syntax of Join method

<Thread-instance> Join ( );
            In between the brackets you can also specify the time to allow the Main thread go away from the program, if the specific thread does not complete its task in given time.  Like
<Thread-instance> Join (4000);

Why we use Join method in multithreading?

            In different project we have to make multiple child threads to execute different block of code as needed, but what happen in this process the Main Thread which is responsible to execute the entire program going to make child threads and itself exits form program, thus we want to stay the Main Thread until the child threads complete their task, we want that the Main thread should exist after all the child threads exited.

MULTITHREADING IN C#

multithreading,multithreading in java, c++ multithreading, multithreading in c,multic# thread example thread example
multitreading in c#

MULTITHREADING IN C#

            “Multiple threading is a process of using multiple threads in a project to execute different methods separately without waiting for one another”
            Basically by default all applications are single threaded model in which only one thread or only main thread executes all the instruction in sequence. If any problem such as server response or data base response delay due to any reason, then the entire program wait until the response without executing the rest of lines or method our program stay stuck in a method without executing the other methods. Therefore we use multiple threading in project to execute different method separately, if one method stuck for a while then all the rest method will execute without wasting time.

Syntax of Multithreading

    using System.Threading;
          Main function
      {
            Thread t1 = new Thread(METHOD NMAE);
            Thread t2 = new Thread(METHOD NAME);
            Thread t3 = new Thread(METHOD NAME);
            t1.Start();
             t2.Start();
             t3.Start();

    }

            First of all we have to include the System . Threading directive in our project after then we will instantiate the instance of Thread and will pass the method name as parameter that should execute through that thread, if the methods are non-static then in parameter section we also have to specify the instance of class in that class the specific method defines. At last we explicitly start the thread. See the example for more deep.

Feb 7, 2020

APPLICATION EXCEPTION IN C#


c# applicationexception, application exception overridden by rollback exception,applicationexception, exception application, exception in c#, exception
applicationexception c#

APPLICATION EXCEPTION

            “The Type of exception that define by programmer at the programming time for their own project, these exception is not predefined the system libraries these are built by programmer based on their own need.”

Steps to Define an Application Exception (Syntax)

            There are few step involve in Application exception definition.
        1.    Define a Class with a specific exception name and specify its return type.
[<Modifier>]  Class <Ex.Name>
{
   //;
}
        2.    Build inheritance with the Pre-defined Exception class, the parent may be system exception or any other class but the most prefer parent class will be Application Exception.
[<Modifier>]  Class <Ex.Name>: Application Exception  
{
   //;
}
        3.    Here the base class will be the Exception class because the Application Exception is further inherited by Exception class. There is a predefined virtual Massage method in Exception class override it by your own need method’s Massage. Also specify the return type usually it is string.
[<Modifier>]  Class <Ex.Name>: Application Exception  
{
   [<Modifier>] <Return> override Message ()
  {
    Statement;   //Here the massage will write that should display if the exception   
                           Rise by help of get accessor, see example below
   }
}
       4.    Now it’s time to call the exception, in case of system exception the CLR make instance and throw the exception for abnormal terminate, but here the programmer responsible to create the instance of exception and have to throw it explicitly. Like
By specifying the condition
If (condition)
{
   <Exception-Name> obj = new <Exception-Name> ( );
    Throw obj; 
}
But we can throw without creating instance name because we are not going to call any member of class so no need of instance name ‘obj’ simply you can do
If (condition)
{
   Throw new <Exception-Name> ( );
}

Throw

            Throw is a keyword which is used to throw the exception, see example for better understand.

Feb 2, 2020

EXCEPTION HANDLING


exception , exception handling in #, try catch finally javascript, c# throw exception, try catch c#,
exception handling

EXCEPTION IN C#

            “Exception is classes which is responsible for the abnormally terminating of a program due to runtime error.”
   We have two type of exception classes that's inherit exception as a base class. which is 
            1.   System-Exception 
            2.   Application-Exception 
   Why classes, see exception is not a one class it having multiple class for every error there is a class which responsible to handle that.  There are hundred exception classes. Some System-Exception classes are. 

  ð  Indexoutofbound exception

Index out of bound means we use a loop that execute for 5 times but we start it from 0 and went to 5, now there are total six iteration five will print our required result but how about the six one, here this exception class is responsible for the abnormal termination.

  ð  Dividebyzero exception

We know that no number can divide by zero if we try to do such thing in our program here immediately the divide by zero exception class will came into picture to cause the abnormal terminate of program.

  ð  Overflow exception

If any value that exceeding the size limit will give overflow.

  ð  Format exception

This class came into role when you trying to convert a double type value into integer or may be trying to convert string into double.
Exception handling            
            It is clear that what is exception and no it’s time see how exception is occur and to handle the exception means what we do when our program terminate abnormally without give the required output in run time.
            How the exception is occur see we all know that our programs runs in supervision of CLR inside when CLR found any mistake then it immediately make an instance that similar to any exception and send to that exception class when this class run our program terminate by displaying the relevant error message and exist flow of control without executing the remaining statements.
 Now once the abnormal terminate occurred we have a mechanism called as exception handling

EXCEPTION HANDLING IN C#

            “It is a process of stopping the abnormal termination of a program whenever runtime error is occur in program.”
            We can handle the exception by putting the code into two blocks
  ð  Try block
          In order to handle the exception we make to separate block, Try block is the first block or also call fitrst step to handle the exception. After making algorithm of problems we differentiate the statement that may cause the run time error and write all that statement or block of code in try block.  
  ð  Catch block
          Where the Catch block is used to write all those statement or block of code that should execute if the run time error is occur. Here we can display an user friendly massage or we also done an alternative action of the specific errors, such as if user enter an invalid value then by saying the actual value type we can regain the value.
try block, catch block, exception handling, try except, exception handling in c# try catch finally
try catch
Like this
try
 {
-       Statements;    //Here those statement require to write that cause the error and those that doesn’t require to run if the error occur.
  }
catch (<exception class name><variable>)
{
-       Statements;    //here the statement will write that have to execute when only there is a runtime error in program.
  }
In catch block either you display a message or done an alternative action for those error.

ERROR Compile time error, Runtime error

error, compile time error, runtime error, exception handling in java, python exception,
error

ERROR

            Error is the mistake that makes a program not function properly”. In programming there are two types of error which can raise during programming that’s are
  ð  Compile time error
  ð  Runtime error