What Is HTML Markup Language?

What Is HTML In General?

What is HTMLSo what is HTML? let me tell you this, HTML(HyperTextMarkupLanguage) is a markup language that has been the standard of creating web pages and applications worldwide. With Cascading Style Sheets (CSS) and Javascript that would perfectly fit right in to create the most stunning website. Basically, the answer to “What is HTML” is that HTML = a markup language that makes website creation possible. Continue reading What Is HTML Markup Language?

JQuery JS Library

What Is Jquery?

JQuery JS LibrarySo what is Jquery JS library, well.. there is 3 main programming language that makes a website alive. Those 3 are HTML, CSS, and Javascript. In addition, Javascript has many libraries and the most popular ones are JQuery.

JQuery is especially designed to simplify the use of Javascript on your website to make it interactive and and attractive. It simplifiesĀ things such as HTML manipulation, animation etc.

Continue reading JQuery JS Library

Bug and Debugging it!

Hello, how are you doing? well i am fine indeed.On my last post we talked about function in OOP, it’s basically a named sections of a program that do specific tasks for us the operator. Today we’ll talk about bug (In coding) and how coders debug it which is frequently called debugging. First I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

Have you ever seen  a program that has errors or glitch? of course you have! every program have at least one bug inside its written code. It’s rather frustating for a coder that it’s core codes is full of bugs, of course they will try to fix it, and we’ll take a peak on how they do things just like that!. But first before we get to that let’s find out what’s the meaning of bug itself
(remember everything that is written in here is about coding except a couple of things). A bug is an error, flaw, failure or fault inside a computer program or software that will cause a program to produce a false, incorrect or any unexpected results, or to behave in unintended ways that the operator or the users doesn’t want.

Now that we have a strong grip of what the meaning of a bug is, we’ll be able to go further into debugging. Does anyone has heard the word “Debugging” ? well some of you may but some of you may not, it’s simply is a way to fix a bug inside a program or a software, for the full definition, here it is: Debugging is the process that the writers of the code do to find and to resolve of defects that will prevent the program or software to work correctly.

After we understand what bug and debugging means, you might wonder, how does coders debug their program or software?. Good question there, they usually use a Debugger tools which will enable the programmer or coder to monitor all of the execution of a program or software, he can stop it, restart it, set any breakpoints, and could change the values that is inside the memory. The word “Debugger” can also refer to a person that is doing the debugging, usually this is the creator of the program itself.

Hight-level programming language like Java, C++ etc… can make debugging activity easier, because most of them have features like exception handling that make real sources of erratic behaviour easier to spot with the coders eyes. In some programming language like CC or assembly, the bugs can create a silent problems such like memory corruption, and it is often hard to spot where the initial problem was happening. In case that happens to you, you can use memory debugger tools.

Conclusions

  •  A bug is an error, flaw, failure or fault inside a computer program or software that will cause a program to produce a false, incorrect or any unexpected results, or to behave in unintended ways that the operator or the users doesn’t want.
  •  Debugging is the process that the writers of the code do to find and to resolve of defects that will prevent the program or software to work correctly.
  • The word “Debugger” can also refer to a person that is doing the debugging, usually this is the creator of the program itself.

Function Definitions

Hello, how are you doing? well i am fine indeed.On my last post we talked about A Methods meaning, the its definitions in general and its definition inside coding world, because it is one of the most important chunk of code inside a class(see my last post abou Methods meaning). First I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

Just like always, before we start talking, first we’ll get the definition of function itself… which is this : an activity or purpose natural to or intended for a person or thing. It seems that it doesn’t have any connection with programing… well it’s because it doesn’t have any connection. That’s just the function definition in general, before we go farther away from programming… let’s just get the definition of a function, but this time… inside programming, here it is :
In programming a function is a named section of a program that performs a specific task. The simple meaning is that a function is a procedure or a routines, most programming language will seperate or make a distinction beetwen a function that will returns a value, and a procedure, that will perform some operation but will not returns a value.

Most of the programming language that exists, it will come with a prewritten or build-in set of function that are kept inside a library. And besideMost programming languages come with a prewritten set of functions that are kept in a library. And beside that, you also can make your own written function inside your program that can do specialized tasks.

Here is an example of function:

Integer two = add1.apply(1); //yields 2 
String answer = concat1.apply("0 + 1 = "); //yields "0 + 1 = 1"
 

So, as you can see every function has a method apply that we use to invoke it and pass it an argument.
And what if I already have a method that does that, can I use it as a function?
Yes, since an alternative way to create functions is by using methods we had already defined and that are compatible with our function definition.

Suppose that we have the following class definition with methods as defined below:

public class Utils {
   publicstatic Integer add1(Integer x) { return x + 1; }
   publicstatic String concat1(String x) { return x + 1; }
}
 

As you can see the methods in this class are compatible with our original function definitions, so we could use them as “method references” to create the same functions we did before with lambda expressions.

Function<Integer,Integer> add1 = Utils::add1; 
Function<String,String> concat1 = Utils::concat1;
 

These two are just the same thing as the ones we did before.

Conclusions

  • In General, An activity or purpose natural to or intended for a person or thing.
  • In programming, a function is a named section of a program that performs a specific task. 

A Methods Meaning

Hello, how are you doing? well i am fine indeed.On my last post we talked about class in programming, today we’ll talk about Methods because methods are one of the most important chunk of code inside a class(check out my last post about Classes). First I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

Methods… hmmm… methods, I wonder what it is, and what does it have to do with classes and objects. To get the answer let’s take a look at methods definion? well here it is
: a methods is a particular form of procedure  for accomplishing or approaching something, especially a systematic or established one.


You might wonder, what the heck does that suppose to mean? well… first… you’re tricked, this is not the real definition of methods in programming, this is a methods definition in general (haha!). I feel bad doing this, so I’ll just give you the definition of methods in programming, and here it is : A method in OOP is a programmed procedure that is defined as a part of a class and will be included in any object in that class.

How to call or execute a method? that is easy, well it took me some time to understand it but you will to eventually, here is how to call a method : 

Let’s take a look at an example of a methods :

/** the snippet returns the minimum between two numbers */ public static int minFunction(int n1, int n2) {
      int min;
      if (n1 > n2) min = n2;
      else min = n1; 
      return min; 
}

 There are actually two ways in which a method is called i.e. method returns a value or returning nothing (no return value). The process of method calling is simple. When a program invokes a method, the program control gets transferred to the called method. This called method then returns control to the caller in two conditions, when: 

  • return statement is executed.
  • reaches the method ending closing brace.

Easy right? you’ll get yourself better at it within time and within a lot of practicing. 

How about now? feeling better understanding this? well I hope you do, if you’re feeling better… let’s get to one of the most important method capabilities that is provided is methods overriding. The same name (e.g., area) can be used for multiple different kinds of classes. This allows the sending objects to invoke behaviors and to delegate the implementation of those behaviors to the receiving object. Methods inside Java programming will set the behaviour of the class object. For example, an object can send an area message to another object and the appropriate formula’s that is created will be invoked whether the receiving object is a rectangle, circle, triangle, or something else etc…
 
 Conclusions

  • A methods is a particular form of procedure  for accomplishing or approaching something, especially a systematic or established one. (In General).

  • A method in OOP is a programmed procedure that is defined as a part of a class and will be included in any object in that class.
  • This called method then returns control to the caller in two conditions, when: 
    • return statement is executed.
    • reaches the method ending closing brace. 

 

Object Inheritance

Hello, how are you doing? well i am fine indeed.Since we talked about OOP much lately, let’s just get into one more important thing that OOP provides for us programmers or coders, which is an inheritance.We’ll get into it’s deep meaning and we’ll understands it more. First I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

 Okay, there is one more important thing in OOP that i want to talk about, which is an object inheritance, before we get to coding object inheritance, let’s just get the general explanation for inheritance.
Inheritance is all part of a person’s estate/assets that is given to an heirs once the person is deceased or dead. An Inheritance basically is a cash endowments that is given to it’s younger heirs from the people that are deceased. If at the time of death a will is not in place, determining the rightful heirs can be a much more complicated matter.

Wait!! we’ve gone to far now! Pheww, I lost my tracks. Let’s get back to coding, now we’ve understand what inheritance in general means, let’s get to OOP inheritance. If an inheritance in general lead to cash endowment or assets, coding inheritance is a bit different, just imagine a bycicle superclass is bycicle then after that comes another placements, types of bycicle, there are mountain bike, tandem bike etc… now the types of the bycicle are the class that inherits from bycicle, both of them had their own properties but will, have the properties that is passed down from superclass Bycicle, if you’re confused just read this, in coding an inheritance is when an object is based from a prototype of another object, using the same implementation (inheriting from object or class) specifying implementation of the object to maintain the behavior to be similar.

There we go! now that’s a coding inheritance, in coding we won’t be confused with an heirs and assets(haha). Now that we know what inheritance in coding is, let’s get some more information about object inheritance, there are 5 types of inheritance that I know, which is :

  • Single inheritance: Where the subclasses of an object will inherit the features of one superclass. A class acquires the properties of another class.
  • Multiple inheritance: Where one class can have more than one superclass and the object will inherit features from all parent classes.
  • Multilevel inheritance: The class A serves as a base class for the derived class B, which in turn serves as a base class for the derived class C. The class B is known as intermediate base class because it provides a link for the inheritance between A and C. The chain that we got from A, B and C is usually well known as an inheritance path
  • Hierarchical inheritance: Where one class of an object will serves as a superclass (base class) for more than one sub class.
  • Hybrid inheritance: A mix of two or more of the above types of inheritance.

Conclusions

  • General : Inheritance is all part of a person’s estate/assets that is given to an heirs once the person is deceased or dead.
  • Coding :  inheritance is when an object is based from a prototype of another object, using the same implementation (inheriting from object or class) specifying implementation of the object to maintain the behavior to be similar.

Java vs Javascript

Hello, how are you doing? well i am fine indeed.On my last post we just made ourself another version of movingBall program, it’s the same movingBall program but written in different programming language. We made ourself 2 movingBall program, first one in Java and second one in Javascript, well now it’s time for us to take a look at pros and cons from both Java and Javascript. First I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

First let’s get the definition of both Java and Javascript, Java is an Object Oriented Programming language while Javascript is an Object Oriented Programming Scripting Language. Both of them are an OOP language but there is a difference, Javascript is a OOP scripting language and what does that means? a scripting language is a programming language that supporst script, program written for a special run-time environment that automate the execution of somekind a task that alternatively can be executed one by one with human operator. An environments that can be automated through scripting is, software applications, web pages within browser, and some numerous numbers of games.


Java is a compiled programming language, it is typically written in an Integrated Development Environment (IDE) and compiled into a bytecode, bytecode is not readable for human language and any Java Virtual Machine could run it. Javascript is a programming language that is Interpreted rather than Compiled, an Interpreted programming language is a programming language that execute the instruction directly, without previously compiling it into a machine-language. Javascript may be easier to create because it doesn’t need to be compiled and deployed like Java, Javascript sometimes can be just created by using a simple text editor like notepad++

Both of java and javascript can be runned inside a browser, in modern browser they obviously take advantages to enhance’s the users experience.Java applet can also be runned in browser, but it have been declining in it’s popularity for various of reasons, first it’s compatibility issues even to security reasons. It is been widely common for a website visitors that it’s javascript is enabled and it is also widely common for a website visitors that it’s Java applet is disabled, especially in mobile browsers.

In javascript you need to send it to the internet first or to your browser first to get the program works, but Java can create a standalone application that doesn’t need any other intermediary to run it, it works on it own. The standalone application is called a Java “applet” (so-called like that because it is a little application) that is a fully contained program. While javascript can only be runned in Javascript with the help of Html and CSS.

Each of them had their own pros and cons, you should pick one programming language that suites you heart, the one that you get comfortable with. Well you could learn both of them but after that choose one that you’ll go deeper with.

Conclusions:

  • Java is an Object Oriented Programming language
  • Javascript is an Object Oriented Programming Scripting Language
  • a scripting language is a programming language that supporst script, program written for a special run-time environment that automate the execution of somekind a task that alternatively can be executed one by one with human operator.
  • Java is a compiled programming language
  • Javascript is a programming language that is Interpreted
  • A compiled programming language is a language that compiles codes into machine-language
  • Both of java and javascript can be runned inside a browser
  • Java can create a standalone application that doesn’t need any other intermediary to run it

MovingBall in Javascript

Hello, how are you doing? well i am fine indeed.In my last post we get our brain and finger exercised on Javascript, we did our exercise in Chrome development console well it’s just for an exercise, but today we’ll do some real Javascript coding, we’ll simply make a Movingball program just like in Java.The way to do this is we need to make a Html file that contains javascript, so let’s do that right now.  first I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

First we need to make an HTML file, you can do this in the notepad++ it can be freely downloaded, now let’s make the structure of the Html, since we don’t really talk about Html much in this blog i’m just going to give you the important Html code structure which looks like this, the canvas is just how big that we want  the background of the painting will be, so don’t worry:


<!DOCTYPE html>
<head> 
<title>MovingBall</title>
</head>

<body>
    <canvas id=”canvas” width =”700″ height=”700″></canvas>
    <script> 

                  /*the section that
                 
we’ll write some Javascript in it*/

    </script>
</body>
</html>

 you just need to write this inside the notepad++ and save as Ball.html (you could name it whatever you want, as long it ends with .html) now after you save that as Ball.html  you will see some changes that is applied to your code, now it has colors right it’s just a helping technique that will help programmer write their code more efficient and more easy.

Now after we finished with the html, let’s work some javascript! the structure prototype and function of this MovingBall is a lot similar with the one that we did with Java, but this one is going to be more easy because it doesn’t have variable typing and class that needs to be created etc… so let’s write it inside the
<script></script>:
first we’re going to make the ball object or ball prototype :
  var Ball = function() {
    this.x = 100;
    this.y = 100;
    this.xSpeed = -5;
    this.ySpeed = 6;
    this.border = 10;
    };

after this we’re going to create a function that will draw a circle whenever it’s called or executed, this is how we write it:
  var circle = function(x, y, radius, fillCircle){
        ctx.beginPath();
        ctx.arc(x, y, radius, 0, Math.PI * 2, false);
        if (fillCircle) {
            ctx.fill();
        } else {
            ctx.stroke();
        }
    };

good now we have created a circle function, now let’s add some more function for our ball, just like draw, move and checkCollisions :
    Ball.prototype.draw = function(){
        circle(this.x, this.y, 20, true);
    };
   
    Ball.prototype.move = function(){
        this.x += this.xSpeed;
        this.y += this.ySpeed;
    };
   
    Ball.prototype.checkCollision = function() {
        if (this.x < 0 + this.border || this.x > 700 – this.border) {
        this.xSpeed = -this.xSpeed;
    }
        if (this.y < 0 + this.border || this.y > 700 – this.border) {
        this.ySpeed = -this.ySpeed;
    }
    }

you see it’s not that different than what we write in our Java coding right? so this will be pretty much easy. Do you have any clue for what we need to write next? we’ll since we’re in javascript environtment inside html inside a browser (yeah right! we’re going to run it in a browser) we need to call a chunk of code that will get the 2d context for the program and this is how we do it:
    var canvas = document.getElementById(“canvas”);
    var ctx = canvas.getContext(“2d”);

 after we create the canvas and context environtment now we’re going to call the ball object or ball prototype and after that we paint or call everybit of code in this program repeatedly over and over, so we write it like this:
 var ball = new Ball(); //we call the ball object or prototype
   
    setInterval(function () {
        ctx.clearRect(0, 0, 700, 700); //we clear the background
        
        ball.draw();
        ball.move();
        ball.checkCollision();
      
        ctx.strokeRect(0, 0, 700, 700); //we create a stroke for the background
        ctx.
        ctx.fillRect(350, 350, 40, 40); //we create a white background
    }, 30);

And you need to remember that you need to write this inside the <script></script> tags or it will never work.
Now, the way you run it is you go to the location of you saved Ball.html, now right click on Ball.html and select open with>(you can choose any browser, but i recommend using firefox or chrome) then… tada!!!! you just make a moving bouncing ball in javascript inside html inside a browser, fun right this may seems much easier for you to understand rather than Java that is a strong typed language, well javascript is easier but each of them had their own advantage and disadvantages just find which one you’re comfortable with.

Javascript Warm Up

Hello, how are you doing? well i am fine indeed.In my last post we talk about Javascript, its history, the guy who made it, what is its used for, “var” and more. We also use Javascript to make our web browsing more unique by implementing animation and rendering, which is very cool and we also could do things like that if we learn Javascript. Now, we’re going to exercise JS or JavaScript, first I apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

First we need to find a place to learn our javascript, and luckily Chrome serves us right! Chrome implemented a development console in the browser to do JS stuff, well firefox also did implement development console but lets just use chrome for the sake facility. Now, open your chrome and go to a blank page, if you don’t know how you just type about:blank in the address bar, well this is only optional but it’s easier to just see blank page first when writing our code, now let’s get to writing part!.


Now we got that sorted out let’s write some javascript! now you need to open the development console in the chrome, if you don’t know how this is how you do it, first open the google chrome control menu –> hover you mouse to more tools –> click development tools. That’s the long way to open the development  console, for simplicity sake just use Ctrl+Shift+I, got you! (haha). Now for a warm up, let’s just write the most simplest code that we’ll write today, just type 1 + 1 you don’t need to put an equal( = ) sign, just do that and hit ENTER and… that’s it you just write a succesful piece of code(By the way it should output the number 2). You may try to even billions of number calculating but the computer will always answer as long as you put the syntax right.


Remember when I say javascript is an Untyped programming language, it means that we could use “var” variables for any type of data we want, we could put number inside it, text, commas, special character etc… so if you want to make a position of an object that is keep changing you could use the “var” variable, for example ” var x1 = 200 ” as position 1 and we need to make it move 100 pixels to the right and we make a variable for that too ” var x2 = 200 ” and what we need to do is add those 2 variables together, so we do this “ x1 + x2 ” and it will output 400, it’s just the same when we calculate just the number only, like 200 + 200 but in this case we use the variable to keep track of the numbers that is keep changing.

Well it’s quite easy isn’t it?! it’s just a tini tiny part of code that you can write in javascript, now let’s move to a bit more advanced javascript coding, let’s output your name into the console of javascript world, first you make a variable called “name” and inside that variable you put your name in a string type, it should look like this ” var myName = “you’re name”; ” well it wouldn’t output anything at the moment but it’s just the shell for our next code. After that lets output our name to the world, type this in the console  myName + ” is awesome”; ” (you could put anything inside that string), here what it would output if I do it with my own name :
Rafif is awesome
tada! we made it isn’t it fun, (tell me how you did it with your own name).

Now let’s get to a more complex piece of code, we’ll output our name to the console 10 times automatically without human help, what do I mean without human help? it means that when we execute the code the computer will automatically outpute 10 of the requested output, so lets do that right now!. first you make your name variable just like before, second we’ll make a function that will output the information of our variable for 10 times, here is how we create the function:

var myName = function (howMany) {
for (var i = 0; i < howMany; i++) {
console.log( i + name + ” is awesome”);
}
};

after we create the function it’s time to execute or call the function!:

myName(10);

tada! you just make another piece of working code, by the way this is how my output looks like :

0Rafif is awesome
1Rafif is awesome
2Rafif is awesome
3Rafif is awesome
4Rafif is awesome
5Rafif is awesome
6Rafif is awesome
7Rafif is awesome
8Rafif is awesome
9Rafif is awesome

In javascript you could make such many other things, not only number calculating but you can make an animation or even a game! wooww! cool right? you could do such things like that if you learn it and understand it, and by it I mean javascript, so keep learning!.

Javascript

Hello, how are you doing? well i am fine indeed.In my last post we talk about an IDE, what is its definition, what is its used for, example for an IDE and more. We also use an IDE to make our MovingBall program, which is very cool and its very helpful for new coders. Now, we’re going to talk about JS or JavaScript, first i apologize if there is any mistake, any help or knowledge would be nice. Lets be done with the chit-chat and lets begin.

(The history of Javascript, Javascript was created in 10 days in May 1995 by Brendan Eich, you know… that Javascript wasn’t the first name that is used for this language, first time it was mocha and  in September of 1995 the name was changed to LiveScript, then in December of the same year, upon receiving a trademark license from Sun, the name JavaScript was adopted. This was somekind of a marketing move at the time, and because that Java being very popular programming language around then.) 

Since we talk a lot about Java, Javascript feeling a little bit lonely, but now the time has come for us to know Javascript.First, what is Javascript? for the most simple explanation, javascript is a programming language, just like java. Now for the long explanation, my understanding of javascript is, “a high-level, untyped programming language that is widely used for major web browser“alongside with the HTML and CSS, it is one of the three core programming language that is used for the technologies of world wide web.

Now let me explain this little by little, first javascript is a high-level programming language just like Java so what does this means? a high-level programming language is a programming language that is more closer to human language and further from the machine language so this makes the coder jobs easier because it is using a  language that is more understandable by human brain. Next one is the “untyped“, what does untyped means? of course it doesn’t means that you don’t need to type it to the computer but it means that, not like Java… Javascript does not use typing for its language, perhaps the word typing is familiar to you, well I already told you in my previous post (Java Variables) that Java is a strongly typed language this means that any data needs to be stored in the right variables, like Integer for number, String for words, and double for numbers that contains decimal.Well javascript doesn’t use that kind of thing, it only uses one variable for all kind of data which is “var” variable, it is a    for variables, right? did you catch that before me? so that is what it means to be an untyped programming language.

Javascript is widely used by the web, because it is the only scripting language that is supported by every major web browser approved by  ECMA(Internet Explorer, Firefox, Chrome, Netscape, Safari, Opera, Camino, etc). Moving on to the next thing, why do I say HTML, CSS and Javascript is the three core for world wide web? just see that everything you see in this page in you browser is made by those 3 programming language, can you guess what language do what? if you don’t let me tell you, first… can you see text inside the pages you see (of course right? or maybe the text is readed to you) well the text that you see is made by the HTML language, HTML is used to make any kind of text, second… can you see color or text style in this page? well CSS is the one that made such a thing, CSS is used to style a page, and now…. do you see a scrollbar in your page?(if you didn’t see it in this page try to go to a page that contains a lot of text)can you scroll it up and down?of course, and that thing uses Javascript to make it, Javascript is used to render or animate things.

You see those three programming language to be the structure to make web pages. Without one of those programming language a web page would be boring and not interesting, so if you want to make a web page make sure that you have all those 3 programming language implemented in your web page.

Conclusions

  • Javascript is “a high-level, untyped programming language that is widely used for major web browser”.
  • HTML, CSS and Javascript are the three core of world wide web.
  • A high-level programming language is a programming language that is more closer to human language and further from the machine language.
  • Javascript only uses one variable for all kind of data which is “var” variable so its considered to be an untyped programming language.
  • Javascript is the only scripting language that is supported by every major web browser approved by  ECMA