Kamis, 02 Februari 2017

English Assignment II


   Every human in this earth has their own strength and weak points, especially when we are talking about our English language abilities. In some case, there are people who have really good skills in speaking English, yet they have lack of skills in writing. Meanwhile, there are also people who have really good skills in writing, but they have lack of skills in speaking.



   Just like the others, I also have my strength and weak points. I feel quite confident in reading, because I can understand well the English language when I was reading, and it helps a lot to know more of the vocabulary. Also, I’m reasonably happy with my listening skills, but speaking is another story. Of the four skills, speaking remains my weak points. I have a hard time when speaking in English, because sometimes I get to speak without thinking about the grammar first, and become so careless. Therefore, I personally need to concentrate on my speaking skills. I think the best way to achieve this is by doing a lot of practice to speak in front of a mirror as confident as possible.  Having a conversation with a native speaker of English, or with an English lecturer, or with someone who is good on speaking English might be worth a try.  I’ve sensed slight of my speaking skills improvement recently. But still, improving my grammar is often an issue for me. I want to immerse myself in an English speaking environment and I need to socialize more with  English speakers.

Sabtu, 28 Januari 2017

A Very Best Friend of Mine

ENGLISH ESSAY



Ever since I was a little girl, I have a very close friend who does a lot of things with me. Her name is Fena. We first met when we were about 5 years old, in Sunday School (Church). I couldn’t remember the first thing we were talked about. Together we played fun games, we were joking around, running in the church, even the tutor was mad at us because we were too noisy. Turns out she lived in my neighborhood. I had never seen her in my neighborhood before, until I stop by to her house, after the Sunday School had finished. Her house was only around 100 meters away from my house. We have always been doing many things together ever since. Even thou we went to different school, we keep on hanging around in our neighborhood with the other friends. We spent so much time together. Some people said that we look like sisters when we walked together, because I’m a bit taller than her and she looks like my little sister. We have tons of things in commons. We both like the same movies or dramas, we like to eat meatballs, we like the same actor or actresses. For example, when I told her that I like actor Chris Evan, she also would told me that she like that actor too. But not every time we had the same opinions. Another similarity that we have is that we like to travelling, jogging, and we like the same colors. Also, we used to relax in the beach or in the pool, whenever we had free time on the weekend. She’s like my non biological sister. when I was scolded by my parents, because of hanging around until late at night, she would defend me in front of my parents, and vice versa. She is a very best friend of mine.


Thank you for visiting my blog~

Kamis, 01 Desember 2016

Transforming Background Color with HTML5 events.


Hola guys..
Today’s post will be about HTML5 events. Do you know what is html5 events? I’ll explain it to you. Html5 (hyper text markup language) is the latest version of standard markup language for creating Web pages, and it describes the structure of Web pages using markup. So, HTML5 events can be something the browser does, or something a user does. Let’s begin..
First, open any kind of text editor, I’m using notepad++, and save it as html file. You can create your own title and background color as you like. For example, see the picture below.


Use the tag <title> to write the title of the page, and close it with </> (applies for all the tag in html). To create background color on the body of the page, use tag <body bgcolor=(the color)>. You can simply change it to red or blue or any color you want, but excluding the # and “” sign. Inside the body tag, you can put any text using the <text> tag, or <p> paragraph tag, or without tags.


Now, let’s apply one html event first. We’ll start with the onkeydown event attributes. Onkeydown event attributes will fires when a user is pressing a key. So, if we type something, the font and background color will change.



We create a textbox as the place to type, using the <input type=”text” id=”text”> tag with the id. Then, we use the document.getElementById to get the element with id “text”.  The element with the id “text” will be used and will be applied together with event attribute onkeydown, and this event attribute will change the format of the element id=”text” with the format in function test1. In function text1, it’s written style properties this.style.background and this.style.color. It is used to change the font and background color before, and change it with the one that is inside the style properties. In simple way, the element background will be replaced with background in function text1 by the time user press the keyboard (onkeydown). So when we press the keyboard, the font color will become white and the background color will be change into pink.
Basic Step:
document.getElementById(“text”).onkeydown = text1;
function text1 () {
     this.style.background = 'pink';
     this.style.color = 'white'; }

----------------------------------------------------------------

Let’s apply the second event attribute, which is onkeyup attributes. It still has the connection with the previous event attribute. Onkeyup attributes will fires when user releases a key. It is the opposite type with the previous event attribute, but has the same usage which is to change the font and background color. Step to create it is also the same, but since that the text box has already exist, then we can just continue to the next step. Create the document.getElementById using the same id “text”, but change the event attributes from onkeydown to onkeyup. Then create new function with same format like before, using this.style.background and this.style.color, and change the font color to black and the background color to grey, but you can also change it to different color. So when we press a key, the font color will be white and the background color will be pink, however when we releases the key the font color will be black and the background color will be black.

The display when user presses a key.

The display when user releases key.



Third Event Attributes. In this stage, we will use two event attributes and function, with one id, just like the two previous attributes (onkeydown and onkeyup). I will explain directly two event attributes at once not separatedly. The two attributes is onmousemove and onmouseout. Onmousemove attribute will fires when the mouse pointer is moving while it is over an element, meanwhile onmouseout attribute will when the mouse pointer moves out of an element. Same step applies like before, but in this events does not use the textbox, only using the document.getElementById and creating a function. After that, make the text with the id.

The display when Pointer Moving in an element


The display when Pointer Moving out of an element




The fourth attribute is ondblclick. Ondblclick will fires if a mouse double click on an element. It has the same basic step with previous (onkeydown), we just have to make new id, new function and new element (text/button).





The button font and background color has change after user click it.

The last event attributes that I’m going to explain to you guys is ondblclick. This event attribute is just like the other event attribute. It fires when user double click an element. For this event attribute, I am going to change the background of a canvas. First, make the blank canvas with the <canvas> tag (don’t forget about the id) and declare the variable to create a rectangle inside the canvas. Then, continue to the basic step like in the previous attribute. Use the getElementById, create the function and the event attribute. Look at the picture below.





That is the last event attribute that I’ve already explain, and here’s the whole code of the five event attributes.
<html>
<head>
<title> Transform Background Color with HTML5 events </title>
</head>
<body bgcolor="#ff6363">
<text> <center><font face='Segoe Print' size=5px> Follow Instruction Below to See Different Background Color </font></center></text>
<text> <font face='Segoe Script'> Change Color When Type Something :      </font></text>&nbsp &nbsp
<input type="text" size="30" id="text"> <br />
<text> <font face='Segoe Script'> Move Mouse Pointer to the Text : </font></text> &nbsp &nbsp
<font face='comic sans ms' id="pointer"> WARNING! </font> <br /> <br />
<text> <font face='Segoe Script'> Click The Button : </font></text> &nbsp
<input type="button" value="Click" id="klik"> <br /><br />
<canvas id="canvas" width="300" height="150" style="border:1px solid #000000;"></canvas>

<script>

var cont = document.getElementById("canvas");
var context = cont.getContext("2d");
context.fillStyle = "#FF0000";
context.fillRect(150, 25, 150, 100);

document.getElementById("canvas").ondblclick = dble;
document.getElementById("klik").onclick = klik;
document.getElementById("text").onkeydown = text1;
document.getElementById("text").onkeyup = text2;
document.getElementById("pointer").onmousemove = pmove;  
document.getElementById("pointer").onmouseout = pout;

function klik() {
     this.style.background = 'black';
     this.style.color = 'white';}
function text1 () {
     this.style.background = 'pink';
     this.style.color = 'white'; }
function text2() {
     this.style.background = 'grey';
     this.style.color = 'black';}
function pout() {
     this.style.background = 'black';
     this.style.color = 'white';}
function pmove() {
     this.style.background = 'red';
     this.style.color = 'white';}
function dble() {
     this.style.background = 'white'}
</script>
</body>
</html>

This would be the display




That’s all from me and thank you for visiting..

Selasa, 20 September 2016

Decision Making, Looping, Array, Function

Decision Making

Decision making structures require that the programmer specifies one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.

  1. If, else if.
An if statement consists of a Boolean expression followed by one or more statements. An if statement can be followed by an optional else statement, which executes when the Boolean expression is false. Or for easy way to remember, if the “if condition” was not fulfilled, it will be run with the next condition which is “else if”, and if it is also not fulfilled by “else if” condition, it will be run by the last condition which is “else”.
The syntax for if, else if is:
if (boolean_expression) {
     statement1 /*will execute if the boolean expression is true*/
}
else {
     statement /*will execute when the boolean expression is false*/
} 

note: /* */ is a comment, it will not be show in the program.




2. Switch
A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.


What would happen if we erase the "break;" on case 2? It  will happen like this(look at the picture below). The program will execute and it will stop until it find the "break;" That's why the program show two cases.





LOOPING
When a block of code needs to be executed several number of times. In general, statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on.
A loop statement allows us to execute a statement or group of statements multiple times. 
1.     While
A while loop might not execute at all. When the condition is tested and the result is false, the loop body will be skipped and the first statement after the while loop will be executed.
The syntax of a while loop is like this
while (condition) {
      statement(s);

}
For example look at the picture below.


2. Do-while
Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop in C programming checks its condition at the bottom of the loop.
A do...while loop is similar to a while loop, except the fact that it is guaranteed to execute  the statement(s) at least one time, and then it will checks the condition later on.
If the condition is true, the flow of control jumps back up to do, and the statement(s) in the loop executes again. This process repeats until the given condition becomes false.
The syntax of a do while loop is like this:
do {
    statement(s);
} while (condition);
For example look at the picture below.

3.  For 
A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times.The syntax of a for loop is like this.
for (init/start; condition; increment/step) {
     statement(s);
}
For example look at the picture below.




ARRAY
Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as number0, number1, ..., and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and ..., numbers[99] to represent individual variables. A specific element in an array is accessed by an index.
type arrayName [arraySize];



FUNCTION
A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions.
The general form of a function in C programming language:
return_type function_name (parameter list) {
   body of the function
}










REFERENCES

Jumat, 09 September 2016

THE DIFFERENCE BETWEEN IDE and COMPILER


Compiler:  Compiler is a part of IDE which transform the source code that you write into a machine code or computer language.

Integrated Development Environment : IDE is the one that run your compilers, give facilities for software development and it can not run without a compiler. 


How to Install C/C++ and IDE (Cygwin – Netbeans – windows10)

I’m going to show you guys how to install Cygwin and Netbeans on windows 10.
First up Netbeans.
2.  Download the C/C++ as supported technologies by clicking the Download x86 option on the C/C++ column (look at the picture below).

3. Once you click, it will be downloaded automatically.
 4. Open the recently downloaded Netbeans. Run the  program, and click next.




 5. And that’s it. You have installed the Netbeans IDE


Now I’m going to show you guys how to install Cygwin (C/C++).
1.      1. Go to https://cygwin.com/install.html . There are two versions in Cygwin, you can choose between 32 bit versions or 64 bit versions (I am using the 32 bit versions, because netbeans is also 32 bit versions, so the c/c++ (Cygwin) bit versions has to match with the IDE (netbeans)).
 2.      Open and run the Cygwin. And just like installing Netbeans, just keep clicking next.
  3.    After you download it, you have to select packages to download.  Packages that are required to download for Netbeans must be at least gcc-core : Compiler, gcc-g++: C++ compiler, gdb: The GNU Debugger, make: the GNU version of the 'make' utility. You can find all of it on Devel. Download the packages first by clicking the “+” sign beside Devel, then find the gcc-core:Compiler and others, and click the Skip label beside it, which are going to reveal the package version number. Click next.
 4.      Cygwin and the packages are installed.
 5.      Now we have to add the Cygwin compiler to our path to enable Netbeans IDE. How? First open the control panel, and type “var” on the Search Control Panel box. Click “Edit the System Environment Variables”.
6.  Click the “Advandced” tab and the “Environment Variables”
 7.      On the environment variables panel, select Path, and click the Edit. And browse the Cygwin path. And click Ok. Now netbeans and Cygwin are good to go.






How To Compile A Simple Source Code


1. Open Netbeans 8.1. Select the “New Project” on the left top, or you can just press Ctrl+Shift+N to make it fast.
 2.   On the choose project step, select the Samples and then C/C++ categories. After that choose the “Welcome” projects. Click next.
 3.      Write the new project name and browse the location. My new project name is “What’s Up Everyone”. Click finish.
 4. Right click the What’s Up Everyone files on the left side, and select debug

 5.      Now simply change the “Welcome…” to “What’s Up Everyone”.  (from number 37 there are actually more, but for example like this you could just erase those part, because this blog is just to explain the easy (beginner) way).  And then right-click the “What’s Up Everyone” file, and select  Build and right-click again and select Run. It’s done…
 6.      You also can add some other simple words like the pictures below.  




ThankYou....