Thursday, 20 June 2019

C Program for Addition of Two Numbers

Program for addition of two numbers
 
                    


Output:
       


Code :-


#include <stdio.h>
#include <stdlib.h>

int main()
{
int a,b,c;
printf("Enter a number:\n");
scanf("%d",&a);
printf("Enter another number:\n");
scanf("%d",&b);
c=a+b;
printf("The Sum is : \n=%d ",c);
return 0;
}

Monday, 17 June 2019

Lecture 9 - While Loop Example GCD

While Loop Example GCD                                                                                                                                                                                                          
                                                                                                             

Lecture 8 - While Loop Example

While Loop Example                                                                                                                                                                 


Lecture 7 - While Loop 1

While Loop Example                                                                                                                                                              
In this lecture we will learn about introduction to while loop.                                                                                                                                                                                                                                                

Saturday, 15 June 2019

Lecture 6 :- Operators in C

Operators in C                                                                                                           
In this lecture we will learn about different types of operators in C.                                                                                                                                                                  


Lecture 5 :- Variables in C

Variables in C                                                                                                                                                                                                                            
In this lecture we will learn about variables in C                                                                                                                   

Lecture 4 Tracing a Simple Program

 Tracing a Simple Program

  In this video we will learn  how to write a basic program in C.How to run a program in C.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

Lecture 3 :- The Programming Cycle

The Programming Cycle


In this video we will learn about what are the basics steps to run a program in C                                                                                                                                                                                                           

Lecture 2: Introduction to Greatest Common Divisor


In this video you will learn about Euclid's Greatest Common Divisor (Theorem) and its relation with C language.We will also learn some basics step to run a program.                                                                                                                                     


Lecture 1- Introduction The Process of Programming

Introduction The Process of Programming                                                                                                                                                                                                                            



Sunday, 19 May 2019

Learning Embedded Android N Programming by Ivan Morgillo (Author), Stefano Viola (Author)

Create the perfectly customized system by unleashing the power of Android OS on your embedded device About This Book * Understand the system architecture and how the source code is organized * Explore the power of Android and customize the build system 

* Build a fully customized Android version as per your requirements Who This Book Is For If you are a Java programmer who wants to customize, build, and deploy your own Android version using embedded programming, then this book is for you. What You Will Learn *

 Master Android architecture and system design * Obtain source code and understand the modular organization * Customize and build your first system image for the Android emulator * Level up and build your own Android system for a real-world device * 

Use Android as a home automation and entertainment system * Tailor your system with optimizations and add-ons * Reach for the stars: look at the Internet of Things, entertainment, and domotics In Detail Take a deep dive into the Android build system and its customization with Learning Embedded Android Programming, written to help you master the steep learning curve of working with embedded Android. Start by exploring the basics of Android OS, discover Google's "repo" system, and discover how to retrieve AOSP source code. 

You'll then find out to set up the build environment and the first AOSP system. Next, learn how to customize the boot sequence with a new animation, and use an Android "kitchen" to "cook" your custom ROM. By the end of the book, you'll be able to build customized Android open source projects by developing your own set of features. 

Style and approach This step-by-step guide is packed with various real-world examples to help you create a fully customized Android system with the most useful features available.

Buy :

Learning Embedded Android N Programming Paperback – Import, 6 Jan 2016 by Ivan Morgillo (Author), Stefano Viola (Author) 

PDF Download :

Learning Embedded Android N Programming Paperback – Import, 6 Jan 2016 by Ivan Morgillo (Author), Stefano Viola (Author) 



Thursday, 16 May 2019

Redirect and Errors

Flask class has a redirect() function. When called, it returns a response object and redirects the user to another target location with specified status code.
Prototype of redirect() function is as below −
Flask.redirect(location, statuscode, response)

In the above function − 1.location parameter is the URL where response should be redirected. 2.statuscode sent to browser’s header, defaults to 302. 3.response parameter is used to instantiate response.

The following status codes are standardized − 1.HTTP_300_MULTIPLE_CHOICES 2.HTTP_301_MOVED_PERMANENTLY 3.HTTP_302_FOUND 4.HTTP_303_SEE_OTHER 5.HTTP_304_NOT_MODIFIED 6.HTTP_305_USE_PROXY 7.HTTP_306_RESERVED 8.HTTP_307_TEMPORARY_REDIRECT
The default status code is 302, which is for ‘found’. In the following example, the redirect() function is used to display the login page again when a login attempt fails.
from flask import Flask, redirect, url_for, render_template, request # Initialize the Flask application

app = Flask(__name__) @app.route('/') def index(): return render_template('log_in.html') @app.route('/login',methods = ['POST', 'GET']) def login(): if request.method == 'POST' and request.form['username'] == 'admin' : return redirect(url_for('success')) return redirect(url_for('index')) @app.route('/success') def success(): return 'logged in successfully' if __name__ == '__main__': app.run(debug = True)
Flask class has abort() function with an error code. Flask.abort(code)
The Code parameter takes one of following values − 1.400 − for Bad Request 2.401 − for Unauthenticated 3.403 − for Forbidden 4.404 − for Not Found 5.406 − for Not Acceptabl 6.415 − for Unsupported Media Type 7.429 − Too Many Requests

Let us make a slight change in the login() function in the above code. Instead of re-displaying the login page, if ‘Unauthourized’ page is to be displayed, replace it with call to abort(401).
from flask import Flask, redirect, url_for, render_template, request, abort

app = Flask(__name__) @app.route('/') def index(): return render_template('log_in.html') @app.route('/login',methods = ['POST', 'GET']) def login(): if request.method == 'POST': if request.form['username'] == 'admin' : return redirect(url_for('success')) else: abort(401) else: return redirect(url_for('index')) @app.route('/success') def success(): return 'logged in successfully' if __name__ == '__main__': app.run(debug = True)

Tuesday, 7 May 2019

Computer Science Programming Basics in Ruby: Exploring Concepts and Curriculum with Ruby by Ophir Frieder (Author), Gideon Frieder (Author), David Grossman (Author)

If you know basic high-school math, you can quickly learn and apply the core concepts of computer science with this concise, hands-on book. Led by a team of experts, you’ll quickly understand the difference between computer science and computer programming, and you’ll learn how algorithms help you solve computing problems.
Each chapter builds on material introduced earlier in the book, so you can master one core building block before moving on to the next. You’ll explore fundamental topics such as loops, arrays, objects, and classes, using the easy-to-learn Ruby programming language. Then you’ll put everything together in the last chapter by programming a simple game of tic-tac-toe.
  • Learn how to write algorithms to solve real-world problems
  • Understand the basics of computer architecture
  • Examine the basic tools of a programming language
  • Explore sequential, conditional, and loop programming structures
  • Understand how the array data structure organizes storage
  • Use searching techniques and comparison-based sorting algorithms
  • Learn about objects, including how to build your own
  • Discover how objects can be created from other objects
  • Manipulate files and use their data in your software
  •  

Buy :

Computer Science Programming Basics in Ruby: Exploring Concepts and Curriculum with Ruby 1st Edition, Kindle Edition by Ophir Frieder (Author), Gideon Frieder (Author), David Grossman (Author) 

PDF Download :

Computer Science Programming Basics in Ruby: Exploring Concepts and Curriculum with Ruby 1st Edition, Kindle Edition by Ophir Frieder (Author), Gideon Frieder (Author), David Grossman (Author) 




Thursday, 2 May 2019

Make Your Own Twine Games! Paperback – Import, 26 Mar 2019 by Anna Anthropy (Author)

Twine is a free online tool that lets anyone new to programming create their own interactive, story-based adventure games in a web page.

In Make Your Own Twine Games!, game designer Anna Anthropy takes you step-by-step through the game development process, from coming up with a basic idea to structuring your game. You’ll learn the basics of Twine like how to use links and apply images and formatting to make your game look more distinct. You’ll get tips on how to test your game, export it, and publish it online, and even understand more advanced features like scripting to get your game to remember and respond to player choices. As you make your way through the book and begin crafting your own interactive fiction, you’ll learn other cool tricks like how to:

• Write stories that follow multiple paths using hyperlinks
• Create variables to track your player’s actions
• Add scripting like “if” and “else” to decide when ghosts should appear in your game
• Use hooks to add fancy touches like text effects, pictures, and sound 

With example games to act as inspiration, Make Your Own Twine Games! will take you from story-teller to game designer in just a few clicks! Ready player one? The game starts now.

Covers Twine 2


Buy :

Make Your Own Twine Games! Paperback – Import, 26 Mar 2019 by Anna Anthropy (Author) 

PDF Download :

Make Your Own Twine Games! Paperback – Import, 26 Mar 2019 by Anna Anthropy (Author) 




Finding a Year is leap or not in Python

@author python.learning
>>> def check_year(year):
...      if year%4==0 and year%100!=0 or year%400==0:
...            print ('leap year')
...      else:
               print ('not a leap year')
>>>  check_year(1972)
leap year
>>>  check_year(1975)
not a leap year



# or check with calendar
>>> import calendar
>>> print (calendar.isleap(1972) )
True
>>> print (calendar.isleap(1975) )
False

Tuesday, 30 April 2019

Learn RStudio IDE

Discover how to use the popular RStudio IDE as a professional tool that includes code refactoring support, debugging, and Git version control integration. This book gives you a tour of RStudio and shows you how it helps you do exploratory data analysis; build data visualizations with ggplot; and create custom R packages and web-based interactive visualizations with Shiny. 
In addition, you will cover common data analysis tasks including importing data from diverse sources such as SAS files, CSV files, and JSON. You will map out the features in RStudio so that you will be able to customize RStudio to fit your own style of coding.

Finally, you will see how to save a ton of time by adopting best practices and using packages to extend RStudio. Learn RStudio IDE is a quick, no-nonsense tutorial of RStudio that will give you a head start to develop the insights you need in your data science projects.


What You Will Learn
  • Quickly, effectively, and productively use RStudio IDE for building data science applications
  • Install RStudio and program your first Hello World application
  • Adopt the RStudio workflow 
  • Make your code reusable using RStudio
  • Use RStudio and Shiny for data visualization projects
  • Debug your code with RStudio 
  • Import CSV, SPSS, SAS, JSON, and other data

Who This Book Is For

Programmers who want to start doing data science, but don’t know what tools to focus on to get up to speed quickly. 

Buy :

PDF Download :


Friday, 12 April 2019

Scatter Plots in R Language

Scatterplots show many points plotted in the Cartesian plane. Each point represents the values of two variables. One variable is chosen in the horizontal axis and another in the vertical axis.

The simple scatterplot is created using the plot()function.

Syntax

The basic syntax for creating scatterplot in R is −

plot(x, y, main, xlab, ylab, xlim, ylim, axes)
Following is the description of the parameters used −

x is the data set whose values are the horizontal coordinates.

y is the data set whose values are the vertical coordinates.

main is the tile of the graph.

xlab is the label in the horizontal axis.

ylab is the label in the vertical axis.

xlim is the limits of the values of x used for plotting.

ylim is the limits of the values of y used for plotting.

axes indicates whether both axes should be drawn on the plot.

Example

We use the data set "mtcars" available in the R environment to create a basic scatterplot. Let's use the columns "wt" and "mpg" in mtcars.

input <- mtcars[,c('wt','mpg')] print(head(input))
When we execute the above code, it produces the following result −

wt mpg Mazda RX4 2.620 21.0 Mazda RX4 Wag 2.875 21.0 Datsun 710 2.320 22.8 Hornet 4 Drive 3.215 21.4 Hornet Sportabout 3.440 18.7 Valiant 3.460 18.1
Creating the Scatterplot

The below script will create a scatterplot graph for the relation between wt(weight) and mpg(miles per gallon).

# Get the input values. input <- mtcars[,c('wt','mpg')] 
# Give the chart file a name. png(file = "scatterplot.png") 
# Plot the chart for cars with weight between 2.5 to 5 and mileage between 15 and 30. plot(x = input$wt,y = input$mpg, xlab = "Weight", ylab = "Milage", xlim = c(2.5,5), ylim = c(15,30), main = "Weight vs Milage" )
 # Save the file. dev.off()
When we execute the above code, it produces the following result −

Scatterplot Matrices

When we have more than two variables and we want to find the correlation between one variable versus the remaining ones we use scatterplot matrix. We use pairs() function to create matrices of scatterplots.

SYNTAX

The basic syntax for creating scatterplot matrices in R is −

pairs(formula, data)
Following is the description of the parameters used −

formula represents the series of variables used in pairs.

data represents the data set from which the variables will be taken.

EXAMPLE

Each variable is paired up with each of the remaining variable. A scatterplot is plotted for each pair.

# Give the chart file a name. png(file = "scatterplot_matrices.png") # Plot the matrices between 4 variables giving 12 plots. 
# One variable with 3 others and total 4 variables. pairs(~wt+mpg+disp+cyl,data = mtcars, main = "Scatterplot Matrix") # Save the file. dev.off()
When the above code is executed we get the following output.

Popular Posts

Categories

100 Python Programs for Beginner (49) AI (34) Android (24) AngularJS (1) Assembly Language (2) aws (17) Azure (7) BI (10) book (4) Books (173) C (77) C# (12) C++ (82) Course (67) Coursera (226) Cybersecurity (24) data management (11) Data Science (128) Data Strucures (8) Deep Learning (20) Django (14) Downloads (3) edx (2) Engineering (14) Excel (13) Factorial (1) Finance (6) flask (3) flutter (1) FPL (17) Google (34) Hadoop (3) HTML&CSS (47) IBM (25) IoT (1) IS (25) Java (93) Leet Code (4) Machine Learning (59) Meta (22) MICHIGAN (5) microsoft (4) Nvidia (3) Pandas (4) PHP (20) Projects (29) Python (929) Python Coding Challenge (351) Python Quiz (21) Python Tips (2) Questions (2) R (70) React (6) Scripting (1) security (3) Selenium Webdriver (3) Software (17) SQL (42) UX Research (1) web application (8) Web development (2) web scraping (2)

Followers

Person climbing a staircase. Learn Data Science from Scratch: online program with 21 courses