Wednesday, 25 May 2022
Why to learn java?
Tuesday, 8 December 2020
How to create a basic text editor using html and javascript.
How to create an online Text Editor using Html & Js
It is easy to understand the basics of programming by doing simple programming projects. Here, I am going to explain how to make a basic text editor like in MS word in an easy way. I have used html and js to create this simple project.
Functions in this editor are :
- Bold
- underline
- italic
- alignments
- undo and redo
Step 1:
Create a new folder and open it with brackets. If you don't have brackets editor, download it here. In brackets, create an html file.
Step 2:
Form the basic structure of the html & add the script which contains access to icons package from fontawesome between the head tags.:
<!DOCTYPE html>
<html>
<head>
<title> Online Text Editor </title>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
</head>
<body> </body>
</html>
Step 3:
Create a <div> and put all buttons inside the div. Then create an <iframe> which will be used as an editor to give input.
<!DOCTYPE html>
<html>
<head>
<title> Online Text Editor </title>
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
</head>
<body onload="enableEditMode();">
<div>
<button onclick="execCmd('bold')"><i class="fas fa-bold"> </i></button>
<button onclick="execCmd('underline')"><i class="fas fa-underline"> </i></button>
<button onclick="execCmd('italic')"><i class="fas fa-italic"> </i></button>
<button onclick="execCmd('justifyLeft')"><i class="fas fa-align-left"> </i></button>
<button onclick="execCmd('justifyCenter')"><i class="fas fa-align-center"> </i></button>
<button onclick="execCmd('justifyRight')"><i class="fas fa-align-right"> </i></button>
<button onclick="execCmd('justifyFull')"><i class="fas fa-align-justify"> </i></button>
<button onclick="execCmd('undo')"><i class="fas fa-undo"> </i></button>
<button onclick="execCmd('redo')"><i class="fas fa-redo"> </i></button>
</div> <br>
<iframe name="richTextField" style="width: 1000px ; height: 500px"></iframe>
</body>
</html>
Step 4:
Now create the Javascript functions to let the frame editable and make the buttons work below the <iframe> tag.
<script type="text/javascript">
function enableEditMode(){
richTextField.document.designMode = 'on';
}
function execCmd(command){
richTextField.document.execCommand(command, false, null);
}
</script>
- iframe : used to create an inline frame.
- document.designMode : Controls the editability of the frame.
- execCommand() : when an html document becomes editable using designMode, execCommand() is used to run commands that makes changes in the editable region.
Friday, 27 November 2020
How to read input from keyboard in C#
- All statements will end with ;
- Classes and methods begin with '{ ' and end with ' } '.
- Statements between { and } are called blocks. blocks defines the scope of the program elements.
Sunday, 4 October 2020
Learn OOP with C#
C# an Introduction.
- Object-Oriented
- Comes with an extensive class library
- Supports exception handling.
- Multiple types of polymorphism
- Separation of interfaces from implementations.
- Rapid application development projects.
- Projects implemented by small or large teams.
- Internet/Web applications.
- Projects with strict reliability requirements.
- namespace declaration
- a class
- main method
- program statement
Saturday, 22 August 2020
OOP basic concepts
There are 4 basic concepts in Object-Oriented Programming(OOP) :
1.Inheritance => Here, the object acquires or shows all the properties and behaviors of the parent Object. So, it will be easy to reuse code as well as it will be easy to understand the principle. For example just thing of it as a human you will be resembling the features physically and logically like your parents. That's how this works.
2.Encapsulation => This one is actually binding up codes and data together, that is binding up methods/functions with data(variables) together. Consider it like a capsule in which medicine are mixed together where we can't see anything. This is protecting the function happening in back from the site of the user. This function is simply known as Data hiding.
3.Abstraction => This is what doing that hiding thing like I mentioned earlier. So user can't find how the function is working. and this distinguishes between different objects. It classifies objects into concepts and focuses on common properties.
4.Polymorphism => Here, one functions/task is performed in different ways. For example, When we take a shape class with data of radius, length, and width; we can find the area of rectangle, circle and square with different functions.
- In Object Oriented Programming, properties are also called as attributes, and data members. These are actually the variables we create.
- And functions are called as methods, behaviors and member functions.
Sunday, 16 August 2020
Object-Oriented Programming
What are object-oriented programming?
- C#
- Java
- C++
- Python
- Dart
- Scala
- Swift
- Ruby, etc.
Object-Oriented concepts
- Inheritance
- Abstraction
- Encapsulation
- Polymorphism
Benefits of Object-Oriented Programming
- Improved productivity during software development
- Improved software maintainability
- Faster development sprints
- Lower cost of development
- Higher quality software
Challenges associated with OOP:
- Steep learning curve
- Larger program size
- Slower program execution
- Its not a one-size fits all solution.
Why to learn java?
Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms...
-
What are object-oriented programming? Object - oriented programming ( OOP ) refers to a type of computer programming method (software...
-
There are 4 basic concepts in Object-Oriented Programming(OOP) : 1. Inheritance => Here, the object acquires or shows all the properties...
-
How to create an online Text Editor using Html & Js It is easy to understand the basics of programming by doing simple programming...