Pages

Thursday, 10 November 2016

Superstitions in India

Superstition is the belief in supernaturalcausality—that one event causes another without any natural process linking the two events—such as astrology and certain aspects linked to religion, like omenswitchcraft, and prophecies, that contradict natural science.
The word superstition is generally used to refer to the religion not practiced by the majority of a given society – such as Christianity in Western culture – regardless of whether the prevailing religion contains superstitions. It is also commonly applied to beliefs and practices surrounding luck, prophecy, and certain spiritual beings, particularly the belief that future events can be foretold by specific (apparently) unrelated prior evenorg
Here is a video related to Superstitions in India

SOURCE : www.Wikipedia.org

Monday, 25 April 2016

Stephan Hawking---A Brief History of Time (EPUB/PDF)



A landmark volume in science writing by one of the great minds of our time, Stephen Hawking’s book explores such profound questions as: How did the universe begin—and what made its start possible? Does time always flow forward? Is the universe unending—or are there boundaries? Are there other dimensions in space? What will happen when it all ends?

Told in language we all can understand, A Brief History of Time plunges into the exotic realms of black holes and quarks, of antimatter and “arrows of time,” of the big bang and a bigger God—where the possibilities are wondrous and unexpected. With exciting images and profound imagination, Stephen Hawking brings us closer to the ultimate secrets at the very heart of creation.

“[Hawking] can explain the complexities of cosmological physics with an engaging combination of clarity and wit. . . . His is a brain of extraordinary power.”—The New York Review of Books

“This book marries a child’s wonder to a genius’s intellect. We journey into Hawking’s universe while marvelling at his mind.”—The Sunday Times (London)

“Masterful.”—The Wall Street Journal

“Charming and lucid . . . [A book of] sunny brilliance.”—The New Yorker




Thursday, 21 April 2016

भगवान इंसान की सबसे बड़ी खोज ।

वेदों एवं पुराणों के अनुसार ब्रह्माण्ड की संरचना भगवान ब्रह्मा ने की थी । साथ ही साथ यह भी कहा जाता है की वे विष्णु भगवान की नाभि से निकले कमल से अवतरित हुए थे । ठीक है हम यह मान लेते हैं की यह सच है तो विष्णु ने भगवन कहां से जन्म लिया था । इन सब सवालों के जवाब तो अभी तक कई इंसानों को नहीं पता है । तो आइये चलते हैं इनके जवाब ढूँढ़ने ।


अगर हम किसी भी धर्मों में झाँक के देखें तो हम सही ढंग से यह अनुमान लगा सकते है की हम जिस भी प्राकृतिक घटना को अगर हम समझ नहीं सके तो हमने उसे भगवान का नाम दे दिया । कुछ उदाहरण है जैसे की :-
1 ) सूर्य के प्रकाश का कोई भी कारण हमें नहीं पता था तो हमने उन्हें सूर्य देव बन दिया ।

2 ) इंद्रधनुष को जो की प्रकाश के अपने अलग अलग रंगों में टूटने के कारण बनता है । देवेन्द्र का धनुष बन गया ।


What is Science?

The Fabric of Space and Time

What is Science? is one of the most simplest questions a child curious to know asks.The question itself seems to be a simple one but when one starts explaining it, the answer seems to be a never ending. So what exactly science is what you will came to know today!

The word 'Science' originates from Latin verb Scientia, meaning 'to know'. The Sanskrit word Vijnana(विज्ञान) expresses similar meanings.

Fewer Definitions of Science are :


Science alone of all the subjects contains within itself the lesson of the danger of belief in the infallibility of the greatest teachers in the preceeding generation . . .As a matter of fact, I can also define science another way: Science is the belief in the ignorance of experts.

                                 ----------Richard Feynman, Nobel-prize-winning physicist,
                                       in The Pleasure of Finding Things Out
                                       as quoted in American Scientist v. 87, p. 462 (1999).





The systematic observation of natural events and conditions in order to discover facts about them and to formulate laws and principles based on these facts. 2. the organized body of knowledge that is derived from such observations and that can be verified or tested by further investigation. 3. any specific branch of this general body of knowledge, such as biology, physics, geology, or astronomy.

                                -----------Academic Press Dictionary of Science & Technology




Science is an intellectual activity carried on by humans that is designed to discover information about the natural world in which humans live and to discover the ways in which this information can be organized into meaningful patterns. A primary aim of science is to collect facts (data). An ultimate purpose of science is to discern the order that exists between and amongst the various facts.

           -----------Dr. Sheldon Gottlieb in a lecture series at the University of South Alabama


Wednesday, 23 March 2016

Alphabet D Of Asterick '*'

# To print Alphabet D of Asterick '*'
# Set your font type As Courier New


n=int(raw_input("Enter a Number : "))
m=n
n=(n-1)/2
for i in range(n) :
    print "*",
print
for i in range(m-2) :
    print "*",
    for i in range(n-1) :
        print " ",
    print "*"
for i in range(n) :
    print "*",
print

OUTPUT
Enter a Number : 9
* * * *
*       *
*       *
*       *
*       *
*       *
*       *
*       *
* * * *

Sunday, 20 March 2016

Alphabet C Of Asterick '*'

# To print Alphabet C of Asterick '*'
# Set your font type As Courier New

n=int(raw_input("Enter a Number : "))
n=(n-1)/2
print " ",
for i in range(n) :
    print "*",
print
for i in range(2*n-1) :
    print "*"
print " ",
for i in range(n) :
    print "*",
print

OUTPUT
Enter a Number : 9
  * * * *
*
*
*
*
*
*
*
  * * * *

Tuesday, 15 March 2016

Alphabet B of Asterick "*"

# To print Alphabet B of Asterick '*'
# Set your font type As Courier

n=int(raw_input("Enter a Number : "))
n=(n-1)/2
for i in range(n) :
    print "*",
print
for i in range(n-1) :
    print "*",
    for i in range(n-1) :
        print " ",
    print "*"
for i in range(n) :
    print "*",
print
for i in range(n-1) :
    print "*",
    for i in range(n-1) :
        print " ",
    print "*"
for i in range(n) :
    print "*",
print

OUTPUT
Enter a Number : 9
* * * *
*       *
*       *
*       *
* * * *
*       *
*       *
*       *
* * * *

Alphabet A of Asterick "*"

# To print Alphabet A of Asterick '*'
# Set your font type As Courier
n=int(raw_input("Enter a Number : "))
m=n
n=(n-1)/2
a=-1
for i in range(n) :
    print (m-1)*" ",
    print "*",
    for k in range(a) :
        print " ",
    if a==-1 :
        print
    else :
        print "*"
    a=a+1
    m=m-1
print (m-1)*" ",
m=m-1
a=a+1
for i in range(n+1) :
    print "*",
print
for i in range(n) :
    print (m-1)*" ",
    print "*",
    for k in range(a) :
        print " ",
    print "*"
    a=a+1
    m=m-1

OUTPUT
Enter a Number : 9
         *
        * *
       *   *
      *     *
     * * * * *
    *         *
   *           *
  *             *
 *               *


Thursday, 10 March 2016

Pallindrome String

# WAP to check if a string is pallindrome or not
# Set Your Font as Courier New

z=raw_input("Enter a string: ")
z.lower()
for i in range(-len(z),0) :
x=x+z[i]
if x==z :
print "Given String is Pallindrome"
else :
print "Given String is not a Pallindrome"

Output 1
Enter a string: aIbohPhoBiA
Given String is Pallindrome

Output 2
Enter a string: palindrome
Given String is not a Pallindrome

Thursday, 25 February 2016

Binary Search In Python

# Write A Program For Binary Search In Linear List….
# Set your Font type as Courier

def bsearch(L,z) :
    M=list(L)
    f=0
    l=len(L)
    for i in range(len(L)) :
        mid=(f+l)/2
        if L[mid]==z :
            return mid+1
        elif L[mid]!=z :
            if L[mid]>z :
                l=mid-1
            elif L[mid]<z :
                f=mid+1
    return 0
n=int(raw_input("Enter the length of list"))
L=[0]*n
for i in range(n) :
    L[i]=int(raw_input("Enter Element"+str(i+1)+" : "))
L.sort()
z=int(raw_input("Enter item to be searched for : "))
p=bsearch(L,z)
if p==0 :
    print"Not found"
else :
    print "Element Found at Position",p

Linear search in Python

# Write A Program For Linear Search In Linear List….
# Change your Font Type as Courier

def linear_search(L,z) :
    for i in range(len(L)) :
        if L[i]==z :
            print "Element found at index :",i,"Position :",i+1
    else :
        print "Element not in the List"
n=int(raw_input("Enter desired linear-list size (max. 50)..."))
print "Enter elements for Linear List"
L=[0]*n
for i in range(n) :
    L[i]=raw_input("Enter Element "+str(i)+" : ")
z=raw_input("Enter Element to be searched for . . . ") 
linear_search(L,z)

Monday, 22 February 2016

Hybrid Inheritance

# Write A Program To Show Hybrid Inheritance….
# Set Your Font Type as Courier

class Vehicle :
    def __init__(self,name,model) :
        self.name=name
        self.model=model
    def details(self) :
        print "Name:",self.name,"\n","Model:",self.model
class Car(Vehicle) :
    def __init__(self,name,model,colour) :
        Vehicle.__init__(self,name,model)
        self.colour=colour
    def details(self) :
        Vehicle.details(self)
        print "colour:",self.colour
class Truck(Vehicle) :
    def __init__(self,name,model,hp) :
        Vehicle.__init__(self,name,model)
        self.hp=hp
    def details(self) :
        Vehicle.details(self)
        print "Horse Power:",self.hp
class MonsterTruck(Car,Truck) :
    def__init__(self,name,model,colour,hp,price):
        Car.__init__(self,name,model,colour)
        Truck.__init__(self,name,model,hp)
        self.price=price
        print "Initialized MonsterTruck:",
        print self.name
    def details(self) :
        Car.details(self)
        Truck.details(self)
        print "Price:",self.price
m=MonsterTruck("Mustang",2009,"Blue",900,4200000)

m.details()

Over-riding in Python

# Write A Program To Show Overriding With Super Function….
# Set Your font type as Courier

class A(object) :
    def __init__(self,a) :
        self.a=a
        print "A's __init__"
    def method1(self) :
        print "A's method1 : a is",self.a
class B(A) :
    def __init__(self,b,a) :
        self.b=b
        print "B's __init__"
        super(B,self).__init__(a)
    def method1(self) :
        print "B's method1 : b is",self.b
        super(B,self).method1()
obj1=B(17,22)

obj1.method1()

Multilevel Inheritance

# Write A Program To Show Multilevel Inheritance….
# Set Your font type as Courier

class Vehicle(object) :
    def __init__(self,l=0,w=0) :
        self.length=l
        self.width=w
    def define(self) :
        print "Vehicle with length",self.length,"in & width",self.width,"in"
class Car(Vehicle) :
    def __init__(self,clr,seats,l,w) :
        Vehicle.__init__(self,l,w)
        self.colour=clr
        self.seatingCapacity=seats
    def changeGears(self,gr) :
        print "Changed to Gear",gr
    def turn(self,direction) :
        print "Turned to",direction,"direction"
class RacingCar(Car) :
    def __init__(self,clr,seats,l,w,tr,spd) :
        Car.__init__(self,clr,seats,l,w)
        self.turnRadius=tr
        self.speed=spd
        print "Racing Car instance created"
    def start(self) :
        self.define()
        self.changeGears(2)
        print "Racing Car Starts - Ready to vroom!"
rcar=RacingCar("Blue",2,206,78.5,6,200)
rcar.start()

rcar.turn("left")

Hierarchical Inheritance

# Write A Program To Show Hierarchical Inheritance….
# Set Your font type as Courier

class Animal(object) :
    def __init__(self,name) :
        self.name=name
    def speak(self) :
        print self.name,"says",self.sound()
class Cow(Animal) :
    def __init__(self,name) :
        Animal.__init__(self,name)
    def sound(self) :
        return"moo"
class Horse(Animal) :
    def __init__(self,name) :
        Animal.__init__(self,name)
    def sound(self) :
        return"neigh"
class Sheep(Animal) :
    def __init__(self,name) :
        Animal.__init__(self,name)
    def sound(self) :
        return"baaaaa"
h=Horse("Chetak")
h.speak()
c=Cow("Rambha")
c.speak()
s=Sheep("Mithi")

s.speak()

Multiple Inheritance

# Write A Program To Show Multiple Inheritance….
# Set Your font type as Courier
class SpecialEngine(object) :
    def __init__(self,p) :
        self.power=p
    def ignition(self) :
        print "Engine Started"
class Car(object) :
    def __init__(self,clr,seats) :
        self.colour=clr
        self.seatingCapacity=seats
    def changeGears(self,gr) :
        print "Changed to Gear",gr
    def turn(self,direction) :
        print "Turned to",direction,"direction"
class RacingCar(SpecialEngine,Car) :
    def __init__(self,clr,seats,p,tr,spd) :
        SpecialEngine.__init__(self,p)
        Car.__init__(self,clr,seats)
        self.turnRadius=tr
        self.speed=spd
        print "Racing Car instance created"
    def start(self) :
        self.ignition()
        self.changeGears(2)
        print """Racing Car Starts - Ready to vroom!"""
rcar=RacingCar("Blue",2,750,6,200)
rcar.start()

rcar.turn("left")

Sunday, 7 February 2016

Stack Operations in Python

#program for stack operations
def isempty(stk) :
    if len(stk)==0 :
        return True
    else :
        return False
def PUSH(stk) :
    x=[]
    n=raw_input("Enter Your Name : ")
    no=int(raw_input("Enter Your Number"))
    x.append(n)
    x.append(no)
    stk.append(x)       #x Stores the data in list [Name,Number]
    return stk
def POP(stk) :
    if isempty(stk) :
        print "Empty Stack"
    else :
        x=stk.pop()
        return x
def DISPLAY(stk) :
    y=len(stk)
    z=y
    for i in range(y) :
        if i==0 :
            x=POP(stk)
            print "Item number",z,"is",x,"<----Top"
            z=z-1
        elif i==y-1 :
            x=POP(stk)
            print "Item number",z,"is",x,"<----Bottom"
            z=z-1
        elif i!=0 :
            x=POP(stk)
            print "Item number",z,"is",x
            z=z-1
        no=x.pop()
        n=x.pop()
        print "Name : ",n
        print "Number : ",no
stk=[['Anurag', 9958220446],['Ayush', 8138987125],['Jagrat', 9956288854]]
while True :
    print """Choose from the following menu : -
1) PUSH
2) POP
3) DISPLAY
4) EXIT"""
    ch=int(raw_input("Enter Your Choice : "))
    if ch==1 :
        PUSH(stk)
    elif ch==2 :
        if isempty(stk) :
            x=None
            print "Empty Stack"
        else :
            x=POP(stk)
            print x,"is the popped item."   #To show the popped data
            no=x.pop()
            n=x.pop()
            print "Name : ",n
            print "Number : ",no
    elif ch==3 :
        DISPLAY(stk)
    else :
        break



Tuesday, 26 January 2016

How to make a program on a topic?

Wondered how easy can a program becomes when you think of the program
to be giving output in your mind.

Programming in python is one of the interesting and easiest thing I have ever
encountered in my life. So a program can be made with high quality and less quantity.

1. First write an output model of your program.

2. Then think of what could be the possible way for it to be done.

3. Then make use if your programming instinct to make your program on the run.

4. If needed you can refer to a book for the functions and statements needed to do what
    you thought earlier in step 2.

5. Finally saving all see the output of your hard work in the output window.

Thank You!

You can follow me on twitter @AnuragShukla47


Matrix addition


# To do addition in matrices # First change your font type as Courier

Wednesday, 20 January 2016

Hollow Diamond Of Asterick '*'

# To print a Hollow diamond of Asterick '*'
# Set your font type As Courier

n=int(raw_input("Enter a no"))
x,y=" ","*"
n=(n-1)/2
b=2
q=-1
m,o=n,n
print (m+1)*x,y
for i in range(n) :
    a=n*x
    n=n-1
    p=q*x
    q=q+1
    if q==0 :
        print a,y,y
    else :
        print a,y,p,p,y
for j in range(m,0,-1) :
    c=b*x
    b=b+1
    r=(m-3)*x
    m=m-1
    if m==0:
        print (o+1)*x,y
    elif m==1 :
        print (o)*x,y,y
    else :
        print c,y,r,r,y

Output
Enter a number 9
      *
     * *
    *   *
   *     *
  *       *
   *     *
    *   *
     * *
      *

Diamond OF Asterick '*'

# To print a diamond of Asterick '*'
# Set your font type As Courier
n=int(raw_input("Enter a no."))
n=(n-1)/2
w=n
x=1
for i in range(n) :
    for j in range(w,0,-1) :
        print " ",
    w=w-1
    for k in range(-1,i*2) :
        print "*",
    print
for i in range(n,-1,-1) :
    for j in range(0,w) :
        print " ",
    w=w+1
    for k in range(i*2-1,-2,-1) :
        print "*",
    print

Output
Enter a no. 9
        *
      * * *
    * * * * *
  * * * * * * *
* * * * * * * * *
  * * * * * * *
    * * * * *
      * * *
        *

Diamond Number 2

# To print a diamond of numbers
# Set your font type As Courier

n=int(raw_input("Enter a number"))
n=(n)/2
w=n
for i in range(1,n+2) :
    for j in range(w,0,-1) :
        print " ",
    w=w-1
    for l in range(i,0,-1) :
        print l,
    for k in range(2,i+1) :
        print k,

    print
for i in range(n,-1,-1) :
    for j in range(0,w+2) :
        print " ",
    w=w+1
    
    for l in range(i,0,-1) :
        print l,
    for k in range(2,i+1) :
        print k,
    print

Output
Enter a number 9
        1
      2 1 2
    3 2 1 2 3
  4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
  4 3 2 1 2 3 4
    3 2 1 2 3
      2 1 2
        1