Saturday 22 June 2019
Friday 21 June 2019
Lecture 37 Example for returning pointers return the duplicate of a string
Irawen June 21, 2019 C No comments
Lecture 20 C operators and expressions associativity of operators
Irawen June 21, 2019 C No comments
Thursday 20 June 2019
C Program for Addition of Two Numbers
Irawen June 20, 2019 C No comments
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;
}
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
Saturday 15 June 2019
Sunday 19 May 2019
Learning Embedded Android N Programming by Ivan Morgillo (Author), Stefano Viola (Author)
Irawen May 19, 2019 Android No comments
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)
* 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)
Popular Posts
-
# importing the module import pywhatkit # using Exception Handling to avoid unprecedented errors try: # sending message to receiver using ...
-
Storytelling with Data: A Data Visualization Guide for Business Professionals Don't simply show your data - tell a story with it! St...
-
Advances in Financial Machine Learning Machine learning (ML) is changing virtually every aspect of our lives. Today ML algorithms accompli...
-
Why Take a Meta Data Analyst Professional Certificate? Collect, clean, sort, evaluate, and visualize data Apply the Obtain, Sort, Explore...
-
Code: a = 'A' print(int(a, 16)) Solution and Explanation: Let's break it down step by step: a = 'A': This line assign...
-
Code: def fun(a, b): if a == 1: return b else: return fun(a - 1, a * b) print(fun(4, 2)) Solution and Explanation...
-
Code: s = 'coder' print(s[::0]) Solution and Explanation: n Python, the expression s[::0] raises a ValueError. This error occurs ...
-
from rembg import remove from PIL import Image input_path = 'p22.jpg' output_path = 'p22.png' inp = Image.open(input_path)...
-
Code: x = [1, 2, 3] y = x.copy() x[0] = 4 print(y) Solution and Explanation: let's break down what happens in the code: x = [1, 2, 3...
-
Code: x = [1, 2, 3] y = [4, 5, 6] z = [x, y] print(z[0][1]) Solution and Explanation: Let's break down the code step by step: x = [1, ...
Categories
AI
(27)
Android
(24)
AngularJS
(1)
Assembly Language
(2)
aws
(17)
Azure
(7)
BI
(10)
book
(4)
Books
(114)
C
(77)
C#
(12)
C++
(82)
Course
(60)
Coursera
(176)
coursewra
(1)
Cybersecurity
(22)
data management
(11)
Data Science
(89)
Data Strucures
(6)
Deep Learning
(9)
Django
(6)
Downloads
(3)
edx
(2)
Engineering
(14)
Excel
(13)
Factorial
(1)
Finance
(5)
flutter
(1)
FPL
(17)
Google
(19)
Hadoop
(3)
HTML&CSS
(46)
IBM
(25)
IoT
(1)
IS
(25)
Java
(92)
Leet Code
(4)
Machine Learning
(44)
Meta
(18)
MICHIGAN
(5)
microsoft
(3)
Pandas
(3)
PHP
(20)
Projects
(29)
Python
(741)
Python Coding Challenge
(192)
Questions
(2)
R
(70)
React
(6)
Scripting
(1)
security
(3)
Selenium Webdriver
(2)
Software
(17)
SQL
(40)
UX Research
(1)
web application
(8)