Skip to main content

Posts

Showing posts from August, 2017

PL/SQL Program for Armstrong Number

Here you will get pl/sql program for armstrong number. A number is said to be an armstrong number if sum of its digits raised to the power n is equal to number itself, where n is total digits in number. For example 407 is armstrong number as 4 3  + 0 3 + 7 3  = 64 + 0 + 343 = 407. PL/SQL Program for Armstrong Number declare n number:=407; s number:=0; r number; len number; m number; begin m:=n; len:=length(to_char(n)); while n>0 loop r:=mod(n,10); s:=s+power(r,len); n:=trunc(n/10); end loop; if m=s then dbms_output.put_line('armstrong number'); else dbms_output.put_line('not armstrong number'); end if; end; / Output armstrong number The post PL/SQL Program for Armstrong Number appeared first on The Crazy Programmer . from The Crazy Programmer http://www.thecrazyprogrammer.com/2017/08/plsql-program-armstrong-number.html

PL/SQL Program to Swap two Numbers

Here you will get pl/sql program to swap two numbers with and without using temporary variable. Method 1: Using Temporary Variable declare a number; b number; temp number; begin a:=5; b:=10; dbms_output.put_line('before swapping:'); dbms_output.put_line('a='||a||' b='||b); temp:=a; a:=b; b:=temp; dbms_output.put_line('after swapping:'); dbms_output.put_line('a='||a||' b='||b); end; / Output before swapping: a=5 b=10 after swapping: a=10 b=5 Method 2: Without Using Temporary Variable declare a number; b number; begin a:=5; b:=10; dbms_output.put_line('before swapping:'); dbms_output.put_line('a='||a||' b='||b); a:=a+b; b:=a-b; a:=a-b; dbms_output.put_line('after swapping:'); dbms_output.put_line('a='||a||' b='||b); end; / The post PL/SQL Program to ...

Pl/SQL Program for Palindrome Number

Here you will get pl/sql program for palindrome number. A number is called palindrome number if its reverse is equal to itself. For example 12321 is palindrome while 123 is not palindrome. Pl/SQL Program for Palindrome Number declare n number; m number; i number; rev number:=0; r number; begin n:=12321; m:=n; while n>0 loop r:=mod(n,10); rev:=(rev*10)+r; n:=trunc(n/10); end loop; if m=rev then dbms_output.put_line('number is palindrome'); else dbms_output.put_line('number is not palindrome'); end if; end; / Output number is palindrome Comment below if you have any queries regarding above palindrome program in pl sql. The post Pl/SQL Program for Palindrome Number appeared first on The Crazy Programmer . from The Crazy Programmer http://www.thecrazyprogrammer.com/2017/08/plsql-program-palindrome-number.html

C++ STL Map Container – std::map

In this tutorial you will learn about STL Map container in C++ i.e., std::map and all functions applicable on it. Map is an associative container. Map satisfies the word “associative”. That means every value in map is associated with a key. All keys are unique. No two mapped values can have same key. The type of key and stored values may differ. All elements follow a strict order. When we insert element automatically stored in its correct position. C++ STL Map Iterators that can be applicable on map: begin(): returns iterator to the beginning. end(): returns iterator to the end of the map. rbegin(): returns reverse iterator to reverse beginning. rend(): returns reverse iterator to reverse end. cbegin(): Returns constant iterator to the beginning. cend(): Returns constant iterator to the end. These iterators we can use in our programs. First thing we need to include map header file. Which is #include<map> Let see some functions associated with map: Inserting ele...

Experimental: Reducing the size of .NET Core applications with Mono's Linker

The .NET team has built a linker to reduce the size of .NET Core applications. It is built on top of the excellent and battle-tested mono linker . The Xamarin tools also use this linker so it makes sense to try it out and perhaps use it everywhere! "In trivial cases, the linker can reduce the size of applications by 50%. The size wins may be more favorable or more moderate for larger applications. The linker removes code in your application and dependent libraries that are not reached by any code paths. It is effectively an application-specific dead code analysis ." - Using the .NET IL Linker I recently updated a 15 year old .NET 1.1 application to cross-platform .NET Core 2.0 so I thought I'd try this experimental linker on it and see the results. The linker is a tool one can use to only ship the minimal possible IL code and metadata that a set of programs might require to run as opposed to the full libraries. It is used by the various Xamarin products to extract...

C++ STL Set Container – std::set

In this tutorial you will learn about STL Set container in C++ i.e. std::set and all functions applicable on it. Set is a associative container. We know that in associative containers each element is unique. So sets are also containers that stores unique elements following in a specific order. The word associative means each value associated with a key value. For any kind of operation key will be more preferred than actual value. Here sets are special type of associative containers where value itself is key value. Some more facts about set are, elements in set are constant. It means that we are unable to modify once we insert the element. If we want to update element then we should delete that element and again insert with updated element. The elements in the set are always sorted. C++ STL Set Let see some functions associated with sets: Before working with functions let see iterators that can apply on list to manipulate the data in list. begin(): returns iterator to the beginni...

Difference between HTML and HTML5

In this article you will learn about difference between HTML and HTML5. Introduction to Markup Languages The term markup language may not ring the bell for an individual who has never been a part of the web designing universe but for the professionals, it is no less than the gravitational force that keeps the world wide web organized and accessible. The markup languages are basically used to process, embed, manage and manipulate text in style files and tags by making them easier for computers to understand and control. The markup languages laid the foundation of World Wide Web years ago and all that you see in organized format is due to the perfect combination of design (CSS), text (markup) and their interaction with the help of front end scripts. HTML HTML (Hyper Text Markup Language) was the first out and out markup language for web development purposes and all the web pages that we see in an organized and interactive format with engaging multi media, styled texts, and many more ...

Vigenere Cipher in C and C++

In this tutorial you will learn about vigenere cipher in C and C++ for encryption and decryption. Vigenere Cipher is kind of polyalphabetic substitution method. It is used for encryption of alphabetic text. For encryption and decryption Vigenere Cipher Table is used in which alphabets from A to Z are written in 26 rows. Also Read:  Caesar Cipher in C and C++ [Encryption & Decryption] Also Read:  Hill Cipher in C and C++ (Encryption and Decryption) Vigenere Cipher Encryption Message Text:  THECRAZYPROGRAMMER Key:  HELLO Here we have to obtain a new key by repeating the given key till its length become equal to original message length. New Generated Key: HELLOHELLOHELLOHEL For encryption take first letter of message and new key i.e. T and H. Take the alphabet in Vigenere Cipher Table where T row and H column coincides i.e. A. Repeat the same process for all remaining alphabets in message text. Finally the encrypted message text is: Encrypted Message: ...

How to Convert Website to Android App Using Android Studio

In this tutorial you will learn how to convert website to android app using Android Studio. Before reading this tutorial I hope that you already have basic knowledge of Android App Development . Otherwise you won’t be able to understand anything. What I will do here is simply open the website in webview with a loading bar so that it will look like we are using an android app. By using this method you can convert website or wordpress blog into android application. You can follow this link to see an example app that I have created using this process. Note:  Make sure the website for which you want to create app is responsive, otherwise the app will not look proper. If you want to integrate admob and google analytics in your app then you can follow below tutorials. Also Read:  Android Google Analytics Integration Tutorial Also Read:  Android AdMob Tutorial How to Convert Website to Android App Create an android studio project with the website name. Add internet a...

Solve error: lvalue required as left operand of assignment

In this tutorial you will know about one of the most occurred error in C and C++ programming, i.e.  lvalue required as left operand of assignment. lvalue means left side value. Particularly it is left side value of an assignment operator. rvalue means right side value. Particularly it is right side value or expression of an assignment operator. Example: a = b + 5; In above example  a  is lvalue and b + 5  is rvalue. In C language lvalue appears mainly at four cases as mentioned below: Left of assignment operator. Left of member access (dot) operator (for structure and unions). Right of address-of operator (except for register and bit field lvalue). As operand to pre/post increment or decrement for integer lvalues including Boolean and enums. Solve error: lvalue required as left operand of assignment Now let see some cases where this error occur with code. Example 1: #include<stdio.h> int main(){ int a =5,b=5; if(a%b=0) ...

Android Google Analytics Integration Tutorial

This tutorial is about google analytics android integration. Google Analytics will help you to track how many people are using your app, real time users, etc. The tutorial is divided into three parts, first create an account in Google Analytics, then generate configuration file and finally implement google analytics in your app. Android Google Analytics Integration Tutorial 1. Create Google Analytics Account Go to  https://analytics.google.com and login with your gmail credentials. There select Mobile app type and add all details like Account Name , App Name , etc according to you. I have shown one example in below screenshot. Now click on Get Tracking ID button and then accept the terms to create the account. After creating the account you will see a screen as shown below. Here you can see the Tracking ID, just save it somewhere as we will need it later. 2. Generate google-services.json Configuration File 1. Go to  https://developers.google.com/mobile/add . Make...

5 Ways to Improve Your Website Security

Here you will know about some important website security tips. Owning a website is similar in a lot of ways to owning a brick-and-mortar store. It serves to promote and advertise your products and services, it’s a good place to look if customers would like to contact the owners, and, like any location that stores valuable commodities, it’s vulnerable to security breaches. In recent years the number of data breaches taking place worldwide has spiked considerably, but many webmasters still haven’t taken the necessary steps to tighten web security and prevent potential data thefts. And if you’d like to create the perfect website , then security should really be at the top of your priority list. Below, we’ll address a number of security tips that webmasters should be enforcing to keep their sites safe and secure. Image Source 5 Ways to Improve Your Website Security Install SSL If you have a website that sells anything or deals with sensitive customer information then it’s vital that ...

C++ STL Forward List Container – std::forward_list

In this tutorial you will learn about C++ STL forward list i.e., std::forward_list and operations, methods applicable on it. Forward Lists come under sequence containers. Forward List implements singly linked list. Insertion, removal and moving operations are very fast than other containers. Every element of forward list contains its next element address. Main disadvantage of forward list is that cannot be iterated backwards and its individual elements cannot be accessed directly. When singly linked list preferred over double linked list, Forward list is better than List. Because list behaves a like double linked list. Example for where we can use forward list is chaining in hashing, adjacency list representation of graph etc. Also Read:  C++ STL List Container – std::list C++ STL Forward List Now let’s see what are the operations we can apply on forward list: assign(): Just like insert method, assign() will store the values. By using assign() we can insert elements in two wa...

Difference between Tree and Graph Data Strucutre

In this tutorial you will learn about the difference between tree and graph. Both trees and graphs are two well known mostly used data structures in algorithms. Tree Data Structure In Computer science, a tree is a widely used Abstract Data Structure (ADT). It can be defined recursively as a collection of nodes, where each node contains a value, starting with root node and list of references to other nodes (children), with the constraint, that no reference from it, is called leaf node. Graph Data Structure In Computer science, graph also an abstract data structure (ADT), that is mean to implement undirected graph and directed graph concepts of mathematics especially the field of graph theory. Graph is a mathematical representation of a set of objects and relationships or links between objects. We represent objects as nodes or vertices in graph and relations between vertices as edges or arcs. So, we can define that graph is set of vertices V and set of edges E. These edges may be di...