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.

July 28, 2013

How to make Ubuntu Live Thumbdrive

To run Ubuntu from a USB stick, the first thing you need to do is insert a USB stick with at least 2GB of free space into your PC.

The easiest way to put Ubuntu onto your stick is to use the USB installer provided at pendrivelinux.com. You’ll need to download and install and follow the instructions.


1) Install this software -> http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/



2) Click 'Browse' and open the ISO file you downloaded.




3) Choose the USB drive and click 'Create'.




Now connect the created USB drive while you reboot and it will boot into a live session. You may have to configure Boot Device Order from BIOS setup to achieve this. How to do this ? Follow the below instructions.



1) While you are booting your PC or Laptop, press del key (depends on different computers. Check for yours) to enter BIOS setup.

It will look like this.




2) Now enter advanced BIOS featured and change boot order.




3) Now save and exit.

Now it will boot with USB device.


Hope this helps.

July 21, 2013

Ubuntu Forum HACKED ?



You may have seen this when you opened Ubuntu Forum. If you ask my reaction , SHOCKED !
I really thought someone is messing with my Wifi and I was a victim of a Man-In-Middle Attack, until I googled about it.

Yes, the Ubuntu Forums have been hacked. The attacker took over the entire database of it.
They have every user's local username , password and e-mail address.

While the data from the forums has been compromised they stress that other Ubuntu/Canonical services such as Launchpad, Ubuntu One, ' are not affected by the breach'.

What Happened ?

Reports of the forums being ‘defaced’ surfaced on late Saturday (July 20th). The main page was redirected to that of an image touting a twitter account – @Spuntn1k_ – and text that read: “You dun goofed, it’s as simple as that”.

Early Twitter accounts of the hack say that an unspecified music track was also played when accessing the homepage.



So how did this happen? That’s the question Canonical will be trying to find out as soon as possible.

A Security blog , Sucuri, suggest that the hack may have been achieved due to lax protection on the backend. According to an unnamed source they've been told that the forum was running an outdated version of vBulletin that ‘didn't have the admin panel protected’.

Canonical has since redressed the breach, replacing the image with an announcement on what happened so far.

Hope Ubuntu Forum get well soon... 

June 26, 2013

An Introduction to Interactive Programming with Python




A few weeks ago, I was looking for some MOOCs (massive open online courses) which teaches interactive python, with which I can make a few games or something. My search ended here.
An Introduction to Interactive Programming with Python





The most exiting thing about this course that you will learn to make some cool games. Moreover you don't even have to download anything to make the games. You just have to code it on Codeskulptor through which you can submit the codes , share with your friends, show off your games. Yes, you maybe wondering what is Codeskulptor.

CodeSkulptor is a browser-based Python interpreter. It implements a subset of Python 2.6, plus the addition of two graphical libraries, SimpleGui and SimplePlot.






This course is taught by four professors from Computer Science Department of Rice University , Joe Warren , Scott Rixner , John Greiner and Stephen WongThey are the most fun professors I ever saw. They make this course more fun.

Prof. Scott Rixner, one of the course’s instructors, is a smart cookie with a Ph.D in electrical engineering from MIT. He developed CodeSkulptor, that lets you edit, save and run Python interactively.
It’s based on two open-source packages that let you edit and run Python code in your browser with just a button click. It’s easy enough for anyone to use it.

This is a some games designed with Codeskulptor - 


  • RiceRocks



  • Pyman



  • Rice Racer



Moreover , if you sign up for Signature Track, you can get Verified Certificate which conforms your identity and can be added into your Curriculum Vitae (CV).Find more about Signature Track here. Signature Track will require a fee of around 80 $ (for this course). But if you don't want to pay that you can always get a regular "Statement of Accomplishment" but it does not conforms the identity of the course taker, so the certificate is rather useless, but you will still learn Interactive Python. 
The following is a sample Signature Track Certificate.








As a conclusion, I would like to say that this is a very nice course. I did it myself and it was an awesome experience.

Course Syllabus

Our course syllabus can be seen at www.codeskulptor.org/coursera/syllabus.html.

Recommended Background

High school mathematics
(Well, I did it with 10th standard education)

Course Format


Our course will last nine weeks.  The lectures from each week will focus on the topics listed in the syllabus while an associated weekly “mini- project” will serve to reinforce these concepts in practice.  Grades for these mini-projects will be determined via peer-assessment.  The class will also include two quizzes each week to provide further feedback.

FAQ

  • Will I get a certificate after completing this class?
    Yes. Students who successfully complete the class will receive a Statement of Accomplishment signed by Joe, Scott, John, and Stephen.

  • What resources will I need for this class?
    The only requirement for the class is access to a modern web browser. All coding and program development will be done in a web-based programming environment that supports building interactive applications in Python. The programs that you create will be saved, shared and graded via the cloud.

  • What is the coolest thing I'll learn if I take this class?
    You’ll be able to build your own games in Python.