July 2, 2014

Python : Tutorial 1

How to install and use Python IDLE


To get started with Python follow these steps :-

  • Visit https://www.python.org/download/ and click on the link as shown below. Be sure that you download Python 2.7.7 and as that is what is used in CBSE schools.                                             


  • Launch the installation file ("python-2.7.7.msi") after it's downloaded and install Python.
  • To launch IDLE, see the below image.

  • If you see something like the screenshot below, then you are ready to go.





































What is IDLE ?

"Python is a language, then how are we opening Python ?". Python is a language not a consumer software. The notepad-like software that you see on your screen is actually IDLE. IDLE stands for Integrated Development Environment which means that IDLE is actually a software that provides programmers ,easier learning of Python. This explains why you can even run Python programs using command line without using IDLE.

IDLE has two modes Interactive and Script mode ; -




Interactive mode :- This mode is used to execute programs line by line..
Script Mode :- This mode is used to write long programs and run it afterwards.

For example :- In the below screenshot (Input is represented by red arrow and Output by green arrow), we see input is followed by output in Interactive Mode but in Script mode all inputs are written together and executed line by line separately.




Thus we come to an end of this tutorial. In the next tutorial, we will be using Python as an Calculator and work in Interactive and Script modes.

To ask any doubts/queries or give your suggestions, just comment below. And if you feel that this tutorial has helped you, please share and comment.

P.S. - If you don't want to comment through your Google account, you can always comment as anonymous.

June 30, 2014

Python : An Introduction

If you are tired of your Python teacher or you can't understand Python or just too lazy to read "Sumita Arora", you have come to the right place. 




I am here to help through your class XI Python syllabus and make you a veteran as far as the class XI curriculum is concerned. You have to learn and memorize the theory part yourself, I can just help you with the practical part of Python. I will be posting a tutorial every week and will be posting for about 10 weeks. You can ask your queries/doubts by commenting on the blog.

So let us begin with an Introduction to Python -



Python is an programming language, recently introduced in class XI instead of C++. Python was developed by Guido Van Rossum in February 1991. Python is based on or influenced with two programming languages:
  1. ABC language 
  2. Modula-3
Python is easy-to-learn yet powerful object oriented programming language. It is a very high level language yet as powerful as many other middle-level not so high-level languages like C,C++,Java,etc.
Even if you don't understand these all terms just keep calm, you don't require to know all this but is just for your general knowledge.

In the next tutorial, I will teach you how to install Python and use IDLE.

April 24, 2014

Introduction to Raspberry Pi

An Introduction to Raspberry Pi 




Raspberry Pi is a credit-card-sized single-board computer developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.

The Raspberry Pi is manufactured in two board configurations through licensed manufacturing deals with Newark element14RS Components and Egoman. These companies sell the Raspberry Pi online. Egoman produces a version for distribution solely in China and Taiwan, which can be distinguished from other Pis by their red coloring and lack of FCC/CE marks. The hardware is the same across all manufacturers. There are two Models available:- Model A and Model B (also called Double Memory).



Components Explanation :-



A. The Processor. Same processor you would have found in the iPhone 3G. This chip is a 32-bit, 700 MHz System on a Chip, which is built on ARM11 architecture. The Model B has 512MB of RAM and the Model B has 256MB of RAM.

B. The Secure Digital (SD) Card slot. Everything including the OS in on the SD card. 

C. The USB port. On Model B there are two USB 2.0 ports, but only one on the Model A. The original Pi board supported 100mA or so, but the newer revisions are up to the full USB 2.0 specifications.

D. Ethernet port. The Model B has a standard RJ45 Ethernet port. The Model A does not, but can be connected to a wired network by a USB Ethernet adapter. WiFi connectivity via a USB dongle is another option.

E. HDMI connector. The HDMI port provides digital video and audio output and 14 different video resolutions are supported.

F. Status LEDs. The Pi has five indicator LEDs that provide visual feedback. The following is a guide to Status LEDs:-

ACT (Green):- Lights when the SD card is accessed.
PWR(Red):- Hooked up to 3.3V power.
FDX(Green):- On if network adapter is full duplex.
LNK(Green):- Network activity light.
100(Yellow):- On if the network connection is 100Mbps.

G. Analog Audio Output. This is a standard 3.5mm mini analog audio jack.

H. Composite video out. This is a standard RCA-type jack that provides composite NTSC or PAL video signals. The video format is extremely low-resolution compared to HDMI.

I. Power input. The microUSB connector is used to supply power. This isn't an additional USB port; it's only for power. MicroUSB was selected because the connector is cheap USB power supplies are easy to find.



A. General Purpose Input and Output(GPIO) and other pins. These pins are used to read buttons and switches and control actuators like LEDs, relays, or motors.

B. The Display Serial Interface (DSI) connector. This connector accepts a 15 pin flat ribbon cable that can be used to communicate with a LCD or OLED display screen.

C. The Camera Serial Interface (CSI) connector. This port allows to a camera module to be connected directly to the board.

D. P2 and P3 headers. These two rows of headers are the JTAG testing headers for the Broadcom chip (P2) and the LAN9512 networking chip (P3).


Conclusion :-


Here we come to an end of technical basics of Raspberry Pi. We will be unboxing a Raspberry Pi Starter kit on the next article, till then I leave you with a common query.

Confused between Model A and Model B ? Here is a quick look at their specifications.

Price -  Model A =25 USD (1526 Indian rupees) ------- Model B =35 USD(2137 Indian rupees)



April 23, 2014

What is "Bricking" of a device ?

Source: Lego.com -Bricking Bad is a Lego set and has nothing to do with this article. :P      




According to Wikipedia, The word "brick", when used in reference to consumer electronics,
describes an electronic device such as a smart phone, game console, router, or tablet computer that, due to a serious mis-configuration, corrupted firmware, or a hardware problem, can no longer function.

Many people use the term “bricking” incorrectly and refer to a device that isn't working properly as “bricked.” If you can easily recover the device through a software process, it’s technically not “bricked.” A bricked device cannot be fixed through normal means. For example, if Windows won’t boot on your computer, your computer isn't “bricked” because you can still install another operating system on it. However, if you tried to power your computer on and it didn't work properly at all, making it impossible to install an operating system, you could consider the computer bricked.

Here we are to give you just knowledge about bricking you want to know.








How to use the word "Brick": Lets us the following examples-

  • The device is stuck in a Boot loop or whatever software problem that can be fixed. :- No, its not Bricked and is recoverable (generally called Soft brick)
  • When the has been smashed or physically damaged (eg. water damage):- I simply call the device is "broken", though it may be not recoverable.
  • When you mess with the Firmware or something and it won't turn on but because of software damage, not Hardware. :- This is Bricking (also called Hard brick).

Problems mistaken for Bricking on Android and how to fix them:-

  1. If the device keeps rebooting:- Wipe your Data and Cache
  2. If the device boots straight into recovery:- Flash a new ROM
  3. If the device boots straight into bootloader:- Restore from a stock ROM
  4. If you get errors for all the methods above:- Reformat your SD card. It's very important that you format it through an SD card reader directly and not by plugging in your phone in USB mode.

Keep in mind, if your device turns on, there's still a good chance you can recover from whatever error you're experiencing, so don't give up just yet!

If all the above methods fail and you are sure your phone is actually bricked—that is, it won't turn on at all, no matter how hard you try—it's time to give up and move on. The first thing you can do in this situation is try to take it back to your carrier's store and play dumb—just say something like "I don't know what happened, but my phone won't turn on anymore" (don't tell them you rooted it, obviously). Most carriers don't have time to deal with such issues and they'll just give you a new phone.