Friday, 30 January 2015

Paradigms of programming language





Some of the most common paradigms are:-

1)  Imperative — Control flow is an explicit sequence of commands.
2)  Functional (Applicative)— Computation proceeds by (nested) function calls that avoid any                                                             global state.
3)  Logic (Rule-based) — Programmer specifies a set of facts and rules, and an engine infers the                                                   answers to questions.
4)  Object-Oriented — Computation is effected by sending messages to objects; objects have state                                            and behavior.


   #Those were the most common paradigms of programming language.Other programming paradigms are as follows:-


*   Structured :          Programs have clean, goto-free, nested control structures.
*   Procedural :          Imperative programming with procedure calls.
*   Declarative :         Programs state the result you want, not how to get it.
*   Function-Level :  Programs have no variables.
*   Class-based :        Objects get their state and behavior based on members in a class.
*   Prototype-based :Objects get their behavior from a prototype object.
*   Event-Driven :     Control flow is determined by asynchronous actions (from humans or                                                     sensors).
*   Flow-Driven :       Computation is specified by multiple processes communicating over                                                     predefined channels.
*   Constraint :          Programmer specifies a set of constraints, and an engine infers the answers to                                       questions.
*   Aspect-Oriented : Programs have cross-cutting concerns applied transparently.
*   Reflective :            Programs manipulate their own structures.
*   Array :                  Operators are extended to arrays, so loops are normally unnecessary.


     # Programming languages included in most common paradigms has been listed below:-


1)  Functional- Lisp,ML,Scheme,etc.
2)  Imperative- Fortran,algol,Pascal,C,Cobol,etc.
3)  Logic- prolog Datalog,GHC,Parlog,Vulcan,Polka,Mercury,Fnil,etc
4)  Object Oriented- C++,java,smalltalk,eiffel,delphi,etc.
   

    # Along with that there are some programming languages which allows programming in many paradigms which is called multi-paradigm language.Some of it are python,PHP,perl,Scala,D,Ada,etc


  #Information about some paradigms are as follows:


**  Imperative paradigm **

Introduction:
 - The imperative programming paradigm assumes that the computer can maintain through                  environments of variables any changes in a computation process. Computations are performed            through a guided sequence of steps, in which these variables are referred to or changed. The order      of the steps is crucial, because a given step will have different consequences depending on the            current values of variables when the step is executed. 
Advantages:
 -efficient,close to the machine,popular,familiar.
Disadvantages:
 -The semantics of a program can be complex to understand or prove.


** Logic paradigm **

Introduction:
 - The Logical Paradigm takes a declarative approach to problem-solving. Various logical assertions       about a situation are made, establishing all known facts. Then queries are made. The role of the           computer becomes maintaining data and logical deduction. 
Advantages:
 -Programming steps themselves are kept to a minimum;
 -Proving the validity of a given program is simple.


** Functional paradigm **

Introduction:
 -The Functional Programming paradigm views all subprograms as functions in the mathematical         sense-informally, they take in arguments and return a single solution. The solution returned is based   entirely on the input, and the time at which a function is called has no relevance. The computational   model is therefore one of function application and reduction. 
Advantages:
 -The lack of dependence on assignment operations, allowing programs to be evaluated in many           different orders. 
Disadvantages:
 -Less efficiency


** Object-Oriented **

Introduction:
 -Object Oriented Programming (OOP) is a paradigm in which real-world objects are each viewed as     seperate entities  having their own state which is modified only by built in procedures, called               methods.Because objects operate independently, they are encapsulated into modules which contain     both local environments and methods. Communication with an object is done by message passing.
Features:
 -Objects are organized into classes, from which they inherit methods.
 -The ability to use inheritance is the single most distinguishing feature of the OOP paradigm. 
  Its chief benefit over other programming paradigms - relatively easy code reuse and extension             without the need to change existing source code.
 -Ideally, the state of an object is manipulated and accessed only by that object's methods. (Most O-O   languages allow direct manipulation of the state, but such access is stylistically discouraged). In this   way, a class' interface (how objects of that class are accessed) is separate from class' implementation  (the actual code of  the class' methods). Thus encapsulation and information hiding are inherent  benefits of OOP.

32 bit adder-subtractor


I have made this circuit in a software called logisim.....


First of all We have to make 1 bit full adder using different logic gates..







Now you have to make 8 bit adder- circuit using the concept of subcircuit in logisim.Actually subcircuit is used to make circuit less complex.For eg. to make 8 bit adder circuit we will use eight 1 bit adder circuit.You will clearly understand this after looking following figure:






Now to make 32 bit adder subtractor circuit we have to again use concept of subcircuit.
Final circuit has been displayed below:






In the above circuit if you will keep input carry as 1 then it will act as subtractor circuit otherwise adder circuit(input carry-0).I have also mentioned part for detection of overflow at right most part.





Sunday, 23 November 2014


Forgot Wifi password ??  Here's the solution

 People keep forgetting their passwords all the time, but if there's one kind
of password that no one bothers to remember it has to be the Wi-Fi password. 
If you have forgotten
 the password of your Wi-Fi network, follow these steps to recover it.

Windows

While you might come across several apps that claim to let you recover saved Wi-Fi
passwords, you don't need any of those on Windows PCs. Even if you don't have
 administrator access on your PC, you can look up the Wi-Fi password by following
 these steps. Note that this method only works when the security is set to
 Personal - if you're connected to an Enterprise network, such as your office Wi-Fi,
 then this method will not show the password.
1. Using a PC that is connected to the Wi-Fi network in question, go to Start >
 Control Panel > Network and Sharing Centre. On Windows 8 computers, you
can tap Windows key + C, click Search and look for Network and Sharing Center.
2. Click Change adapter settings on the left sidebar.
3. Right-click the Wi-Fi network you're using and click on Status.
4. Click Wireless properties.
5. Click the Security tab.
6. Now you will see the name of the Wi-Fi network and the hidden password.
 Check Show characters to reveal the saved password.
wifi_password_windows.jpg

Mac

You can find saved Wi-Fi passwords through the Keychain Access app on the Mac. Here's how.
1. Go to /Applications/Utilities.
2. Open Keychain Access. Go to the System keychain listed under the Keychains on the top left.
3. Search for the Wi-Fi network you are trying to find the password for, by typing the name of the network (SSID) in the search box in the top right corner, or by manually finding it in the list.
4. Double-click the name of the network and in the resultant box, check the Show password option.
4. Enter the user account password when prompted and you'll be shown the saved Wi-Fi password in clear-text.
wifi_password_mac.jpg


Motorola launches keylink
Motorola launches Keylink phone and keys tracker

 
NEW DELHI: Motorola has launched Keylink, a small device that users can attach to their keychain and keep a track of their phone as well as their keys. The device is available in the US at $24.99. The India pricing and availability is not known at the moment.

Interestingly, the Keeling device is compatible with both Android and iOS devices, and can be connected via the Motorola Connect app which can be downloaded from the Google Play Store or the Apple App Store.

Users can make their phone ring by the press of a button on the Keylink if they misplace it. Similarly, they can make the Keylink ring by using the Motorola Connect app if they misplace the device (and keys). The device connects through Bluetooth Smart and has a range of 100feet. It is powered by a coin cell battery that lasts upwards of a year.

Users who own a Moto X (2nd gen), Droid Turbo or a phone running Android 5.0, Lollipop, can use the trusted device settings on their device to enable the ability to keep their phone unlocked when the keys are nearby. They don't need to enter their password to use their phones (if set) when the device is in the vicinity.

Nokia also offers a similar device called 'Treasure Tag' to keep track of objects through a Windows Phone device. It was launched at Rs 2,100, earlier this year.