Monday, 30 November 2015

Javascript: Outputting text

I want to output a text into/inside a local paragraf instead of using canvas. How can I do that?

There are 5 steps you need to do:
1. First thing you need to define the paragraph where you want to the text to showed up. Like this:
<p></p>

2. Second thing, you need to insert a span tag into that paragraph tag. Like this below:
<p><span></span></p>

3. Third, you need to give an id to that span tag; just the opening tag, not the closing tag. Like this below:
<p><span id="here"></span></p>

4. Last you need to define below inside your script tag:
<script>
document.getElemenytById("here").innerHTML="<your text>"

</script>

5. Last, finish, run the code.

Warning: Remember to use .innerHTML not .value.

For complete code:
<body>
<p><span id="here"></span></p>

<script>
document.getElementById("here").innerHTML = "<your text>"
</script>
</body>

Javascript: Converting hexadecimal to decimal

I want to convert hexadecimal value (for i.e. "0xff") to a decimal value, how can I do this?

1. Put your hexadecimal-value into a string and then into a variable, like this below:
var a = "0xff" //don't forget the double-quotes

2. then use a function like this:




I usually dealing hexadecimal value with color.
Test

Javascript: Operating on a string

What can we do upon a string?
1. Looking its length
2. Searching index of a string from it
3. Extracting a string from it
4. Inserting a string into it.

Looking for how long / length

a.length


Searching for index
indexOf()
lastIndexOf()

Powerful search using RegEx.

Extracting parts
slice(firstindex, lastindex)

You want to convert a string that contain hex value to a decimal?

You want to convert a string that contains hex value to a decimal? How can you do that?

For example:
var x="#fffffa"
You can't convert this type of string into decimal-number. Reason: because there is a pound (#) sign inside that string. Solution: remove the pound sign first.

This case is retrieving value from <input type="color">

 

JavaScript Data Types

JavaScript Data Types

In JavaScript there are 5 different data types that can contain values:
  • string
  • number
  • boolean
  • object
  • function
There are 3 types of objects:
  • Object
  • Date
  • Array
And 2 data types that cannot contain values:
  • null
  • undefined

Bagaimana cara menggunakan google spreadsheet sbg database kamu

It looks like you must build your own API tools.

What is API?
An API is a set of methods and tools that can be used for building software applications.

So how?
Learn to use Youtube API, learn to use googlespreadsheet API, twitter API, learn to use google map API.

Where?
www.codecademy.com
or

For i.e.:
1. Create an object; learn object oriented programming
2. 



Sunday, 29 November 2015

WLAN Security: WEP mode

WEP 64-bits :
For each key, please enter either (1) 5 characters excluding symbols, or (2) 10 characters ranging from 0~9, a, b, c, d, e, f.

WEP 128-bits :
For each key, please enter either (1) 13 characters excluding symbols, or (2) 26 characters ranging from 0~9, a, b, c, d, e, f.