Skip to main content

Posts

Showing posts from January, 2018

Python Matrix Multiplication

Here you will get program for python matrix multiplication. If we want to multiple two matrices then it should satisfy one condition. We need to check this condition while implementing code without ignoring. A mxn x B pxq then n should be equal to p. Then only we can multiply matrices. Now we will see how to multiply two matrices using python nested list matrix representation. Python Matrix Multiplication Below is python program to multiply two matrices. def print_matrix(matrix): for i in range(len(matrix)): for j in range(len(matrix[0])): print("\t",matrix[i][j],end=" ") print("\n") def main(): m = int( input("enter first matrix rows")); n = int( input("enter first matrix columns")); p = int( input("enter second matrix rows")); q = int( input("enter second matrix columns")); if( n != p): p...

Building a Raspberry Pi Car Robot with WiFi and Video

Last year I found a company called SunFounder that makes great Raspberry Pi-related kits and stuff . I got their Raspberry Pi 10" Touchscreen LCD and enjoyed it very much. This month I picked up the SunFounder PiCar 2.0 kit and built it with the kids. The kit includes everything you need except for the Raspberry Pi itself, a mini SD Card (the Pi uses that as  hard drive), and two 18650 rechargeable lithium batteries . Those batteries are enough to power both the Pi itself (so the car isn't tethered) as well as provide enough voltage to run the 3 servos AND motors to drive and steer the car around. You can also expand the car with other attachments like light sensors, line followers, and more . The PiCar 2.0 includes the chassis, a nice USB WiFi adapter with antenna (one less thing to think about if you're using a Raspberry Pi  like me), a USB webcam for computer vision scenarios. It includes a TB6612 Motor Driver, PCA9685 PWM (Pulse Width Modulation) Servo Driver with ...

Python Matrix Addition

Here you will get program for python matrix addition. In python “list” concept is there rather than arrays.  For implementing matrix we should take help of lists in python. Matrix can be represented as nested lists. Suppose if we want to implement 2×3 matrix then python syntax will look like this. Matrix=[[1,2,3],[4,5,6]]     #This is 2×3 matrix If we want to implement 3×2 matrix then Matrix=[[1,2],[3,4],[5,6]]     #This is 3×2 matrix. Python Matrix Addition Below is python program for addition of two matrices. Program is made and tested in python 3. def print_matrix(matrix): for i in range(len(matrix)): for j in range(len(matrix[0])): print("\t",matrix[i][j],end=" ") print("\n") def main(): m=int(input("enter rows")); n=int(input("enter columns")); #in python initilization is needed before indexing. matrix1=[[0 for j in range(0,n)] for i in...

You got this! You know the fundamentals. You are a learner. Plus The Imposter's Handbook

Sometimes we all get overwhelmed. There's a million (no irony there) reasons to be overwhelmed today, to be sure. I got an email from a community member who was feeling like they hadn't kept up on the latest tech. Of course, anything you learn today will be obsolete tomorrow, right? I'm overwhelmed thinking of it! I wrote a little thread about this on Twitter and I wanted to expand on it here. A brief thread for my developer friends who have 10-15-20 years in the game. Maybe you're a dev who's been keeping up and fresh on the latest since jump, or maybe you've been using the same reliable framework for your whole career. pic.twitter.com/H228QRmlTr — Scott Hanselman (@shanselman) January 26, 2018 Maybe you're a dev who's been keeping up and fresh on the latest since jump, or maybe you've been using the same reliable framework for your whole career. It can be totally overwhelming when you "wake up" and look around and notice that yo...

7 Things Every New Visitor Expects From Your Website

It is all but essential to have a website for your business in this day and age. As the first port of call for any newcomer to your brand, it needs to offer key information about your services and direct people on how to use them. Beyond this, it needs to foster an immediate sense of trust in your business and help to build your reputation. This means that your website needs to be working just as hard as you are. What makes a website stand out? Below you’ll find a list of the seven most important features any website needs in order to impress new visitors and guarantee they will keep returning to it. From design to performance, there are various aspects of a modern website that can hugely influence the way visitors view and interact with it. Clean Design The appearance of your site is hugely important for making a positive impact on visitors. Gone are the ways of the 90s, where basic HTML design would suffice. Consider how you want your site laid out, with which elements brought t...

Stack vs Heap – Difference between Stack and Heap in Data Structure

In this tutorial you will learn about stack vs heap data structures. Stack Stack is a simple data structure used for storing data. In stack, the order in which the data arrives is important. A suitable example for stack is, a pile of plates in kitchen. When we want a plate we will take which was last placed in that pile. This is the main property of stack we say Last in first Out (LIFO) or First in Last out (FILO). So stack is a ordered list in which insertion and deletion are done at one end, called top. Stack Operations: Push: When an element inserted into the stack, we call it as push operation. Top: When we want to know what is the top element of the stack we get it by top operation. Pop: When we remove an element from the top of the stack, we call it as pop operation. IsEmptyStack (): To check whether stack is empty or not. IsFullStack(): To check stack is full or not. And some other properties are, Stack underflow: When we want to pop an element from the empty st...

Difference between Internet and Intranet

In this article, you’ll see the difference between internet and intranet. Both Internet and intranet are used to connect many devices to each other to share information. But there are many differences between them. Some of differences are given below. Image Source Internet vs Intranet – Difference between Internet and Intranet   Internet Intranet What is Worldwide system of connected networks. Each network consist millions of devices like computers, servers, routers , printers and many other devices. A  private network, within an Enterprise or Organization. Users Unlimited Limited Accessible to Everyone Authorized users Identified by Unique IP address among all the computers in the world. Also identified by IP address, which is unique among all the computers in that particular intranet. Safety Not safe as intranet because anyone can access it and share anything. More safe because only authorized users can share information. Owned by ...

Python Read and Write File

In this tutorial, you’ll learn how to read and write file in Python. Program to Write to File f = open("newtext.txt","w") f.write("something to be write") f.close() Output: this program will create a new file (if not exist) named as “newtext.txt” in the same directory where our program is located and write a line “something to be write”. Program to Read File f = open("newtext.txt","r") print f.read() f.close() Output: something to be write As we have seen the program, it is very easy to read and write into a file in python. In python we can work with two type of files Text files and Binary files. In this tutorial we are working with text file. Python Read and Write File Let’s understand above programs. f = open("newtext.txt", "w") open() is just a function to get the file object. It gets the file object and returns it to the f , we can name f as we want. using file object’s methods and attributes we...

Difference between varchar and varchar2

In this tutorial you will learn about difference between varchar and varchar2. Varchar stands for variable length character string . Both Varchar and Varchar2 are data types to store character strings for particular column (field) in databases. These are reserved by ORACLE. If we relay empty string and NULL being the same, then we should use varchar2 instead of varchar. Because it treats both null and empty strings as same. Oracle stated that, “Do not use varchar datatype” although currently both used for same purpose. But in future varchar usage may change. It is for future purpose. So now it is better to stick with varchar2. Difference between varchar and varchar2 Varchar Varchar2 1) Varchar can identify NULL and empty string separately. 1) Varchar2 cannot identify both separately. Both considered as same for this. 2) Varchar can store minimum 1 and maximum 2000 bytes of character data. 2) Varchar2 can store minimum 1 and maximum 4000 bytes of character data. 3) Al...

Difference between float and double

Here you will learn about difference between float and double i.e. float vs double. These are two commonly used floating point data types in programming languages like C, C++, Java, etc. Both float and double are used to store values with decimal point but there are some differences between them that are mentioned below. float vs double – Difference between float and double   Float Double Precision Single precision (1 bit for sign, 8 bits for exponent, 23 bits for fraction) Double precision (1 bit for sign, 11 bits for exponent, 52 bits for fraction) Size 4 Bytes (32 Bits) 8 Bytes (64 Bits) Range -3.4E+38 to +3.4E+38 -1.7E+308 to +1.7E+308 Accuracy 6 decimal digits 15 decimal digits Comment below if you have queries related to above tutorial for float vs double. The post Difference between float and double appeared first on The Crazy Programmer . from The Crazy Programmer https://www.thecrazyprogrammer.com/2018/01/difference-float-double.html

Difference between Process and Thread

Here you will learn about difference between process and thread i.e. process vs thread. Process: In simple words a process is executing a program. But not all, it’s only an instance of a computing program. Several processes may be associated with the same program. Process contains program code and its current activity. Thread: We can say thread is a light weight process. A thread of execution is the smallest sequence of programmed instructions that can be managed independently by scheduler. Threads reside inside the process. Each thread belongs to exactly one process. No thread exists outside the process. Image Source Process vs Thread – Difference between Process and Thread Process Thread 1) System calls involved in process. 1) No system calls involved. 2) Context switching required. 2) No context switching required. 3) Different process have different copies of code and data. 3) Sharing same copy of code and data can be possible among different threads.. 4)...

Difference between Python 2 and 3

Here you will know about difference between python 2 and 3. As a newbie, everyone confuses that which version of Python should learn and use (Python 2.x or 3.x, where x means versions). Let’s see the key differences between them. Image Source Python 2 vs 3 – Difference between Python 2 and 3   Python 2 Python 3 1. Integer Division print 9/2 >> 4 print(9/2) >> 4.5 2. Print function print “Hello world” >>Hello world print(“Hello world”) >>Hello world 3. Unicode print type(Unicode(“Hello”)) >>  <type ‘unicode’>   print type(b’Hello’) >> <type ‘str’>   print ‘hello’ +  b’ world’ >>hello world   print type(bytearray(b’hello world’)) >> <type ‘bytearray’>   print (‘\u03BCnico\u394e!’) >> µnico∆e!   print(type(b’hello’)) >> <class ‘bytes’>   print(‘hello’ + b’ world’)) >> TypeError   print(type(bytearray...

ASP.NET Single Page Applications Angular Release Candidate

I was doing some Angular then remembered that the ASP.NET "Angular Project Template" has a release candidate and is scheduled to release sometime soon in 2018. Starting with just a .NET Core 2.0 install plus Node v6 or later, I installed the updated angular template. Note that this isn't the angular/react/redux templates that came with .NET Core's base install. I'll start by adding the updated SPA (single page application) template: dotnet new --install Microsoft.DotNet.Web.Spa.ProjectTemplates::2.0.0-rc1-final Then from a new directory, just dotnet new angular Then I can open it in either VSCode or Visual Studio Community (free for Open Source). If you're interested in the internals, open up the .csproj project file and note the checks for ensuring node is install, running npm, and running WebPack. If you've got the Angular "ng" command line tool installed you can do the usual ng related stuff, but you don't need to run "ng...

Difference between TCP and UDP

In this tutorial you will learn about difference between TCP and UDP. TCP TCP stands for Transmission Control Protocol. This is one of the main protocols of the Internet protocol suite. TCP is a connection – oriented protocol that provides a reliable flow of data communication between two computers. That means from source to destination all information in both ways must be reached. So TCP connection – oriented protocol establishes a communication link between a source port/IP address and a destination port/IP address. The ports are bound together via this link until the connection is terminated and the link is broken. An example of connection – oriented protocol is a telephone conversation. A telephone connection is established, communication takes place and finally connection terminated. UDP UDP stands for User Datagram Protocol. This is connection less protocol. It sends independent packets of data (we call these independent packets as datagrams ) from one computer to other com...

Difference between Testing and Debugging

Here you will learn about difference between testing and debugging. Testing is a process of finding bugs or errors in a software product that is done manually by tester or can be automated. Debugging is a process of fixing the bugs found in testing phase. Programmer or developer is responsible for debugging and it can’t be automated. Lets differentiate both terms in tabular form. Difference between Testing and Debugging Testing Debugging The purpose of testing is to find bugs and errors. The purpose of debugging is to correct those bugs found during testing. Testing is done by tester. Debugging is done by programmer or developer. It can be automated. It can’t be automated. It can be done by outsider like client. It must be done only by insider i.e. programmer. Most of the testing can be done without design knowledge. Debugging can’t be done without proper design knowledge. Comment below if you have doubts related to above testing vs debugging tutorial....

Difference between Alpha and Beta Testing

Here you will learn about difference between alpha and beta testing. We might have come across these terms while studying or even at our work place, alpha test is the first phase of testing the software whereas the beta test is the second phase which is performed by real time users, let us know the exact differences these two tests have between them. Alpha vs Beta Testing – Difference between Alpha and Beta Testing  Alpha Testing Beta Testing Alpha testing is  a type of acceptance testing, performed within the organization, by the developers within the site of development itself. Beta testing is always conducted usually in the real time environment by customers or end users at the clients place (not in the organization). For alpha testing it requires lab environment or testing environment, and the developer is present as well. But at times the beta testing is also performed by an independent testing team. Beta testing doesn’t require any specific environment or ...

Introduction to Artificial Intelligence (AI)

Here you will get an introduction to artificial intelligence. First of all let us quickly recall what we have learnt in previous blog posts to get an idea of what we already have covered and shouldn’t invest time on. So far, we’ve learnt about Machine Learning concepts, the algorithms, packages and IDEs etc. Now when we are quite familiar about the term Machine Learning, it is time to explore further in the domain. It is time to understand what Artificial Intelligence is? Many people use Machine Learning and AI interchangeably and think both of them as the same. But the fact is they are not the same as inferred by majority. Come let’s understand how these two terms (ML and AI) are not the same. Image Source As we can see in the image above it is quite clear that we see AI and ML differently instead a single domain. In other words “ML is a subset of AI.” Artificial Intelligence can be thought of as a broader term in which a machine is expected to behave humanly. Whereas on the oth...

Difference between Circuit Switching and Packet Switching

In this tutorial you will learn about difference between circuit switching and packet switching i.e. circuit vs packet switching. What is Switching? In network communication sender sends a message and receiver receives it. But both sender and receiver may lies in different networks with very much far distance. To reach message from sender to receiver it must pass through different devices, different networks. So message must be exchanged between different intermediate networks to reach destination. This mechanism is called switching. There are different types of switching like Circuit switching, Packet switching and Message switching. Circuit Switching This is connection oriented system. In circuit switching method, for each and every communication/connection there is a dedicated path between sender and destination. All data regarding that communication flow in that same path only. For example connecting one telephone to other telephone through a long wire for communication. Pack...