Learn & Share http://zulkifliishak.com A blog where I learn and Share Mon, 08 Oct 2018 12:36:56 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 149499638 How to use excel VLOOKUP function http://zulkifliishak.com/how-to-use-excel-vlookup-function/ Sat, 06 Oct 2018 18:14:55 +0000 http://zulkifliishak.com/?p=68 Excel VLOOKUP is a very useful function to retrieve data from table rows. We lookup function easily return the data in a table  or a range by row. As example, to lookup the age of a person. 

Excel VLOOKUP formula


Syntax : VLOOKUP (value, table, col_index, [range_lookup])

  • Value : The value to search from first column of a table
  • Table : Table range
  • col_index : which column of the table to retrieve the data.
  • range_lookup : False – Exact Match/True approximate match

The syntax can be summarized as as VLOOKUP(Value to look up, table range to lookup the value, table column number to return the value,FALSE/TRUE)

Example 

example Excel VLOOKUP 
`
  • Value : C14 – the cell to write the Name 
  • Table :B3:E6 the range of the table from B2 until E6.
  • col_index : 2 , the second column of the table.
  • range_lookup : False – Exact Match
  • Syntax : VLOOKUP(C14,B2:E6,2,FALSE)
]]>
68
How to check a string is number in java using regular expression http://zulkifliishak.com/how-to-check-a-string-is-number-in-java-using-regular-expression/ Mon, 06 Aug 2018 00:18:07 +0000 http://zulkifliishak.com/?p=52 Checking whether a string is number or not can be very useful in certain application. In Java there are various way to check whether a number is a string or not. We can use the Exception , try .. catch block, checking character by character or by using regular expression. 

Compared to all the methods, checking whether a string is number or not by using regular expression is basically the easiest.

The comparison is based on pattern matching, regular expression is used to create the pattern and is compared to the string. If the pattern match it will return TRUE, if the pattern mismatch it will return FALSE. 


1
2
3
4
5
6
7
8
public static boolean isNumeric(String token) {
String regex,regex1,regex2;
    regex = "[-+]?[0-9]+.?[0-9]+";
    regex1 = "[-+]?[0-9]+.?";
    regex2 = "[-+]?.?[0-9]+";
return token.matches(regex)|token.matches(regex1)|token.matches(regex);
}
}

]]>
52
public static void main(String[] args) explaination http://zulkifliishak.com/public-static-void-mainstring-args-explaination/ Mon, 16 Jul 2018 12:17:08 +0000 http://zulkifliishak.com/?p=36 The

public static void main(String[] args) // starting a program in Java

is one of the strange line for Java beginners. It automatically trigger a question, why its like that. Compared to

 void main() // starting a program in C

in C which are much simpler.

So what does it means?

First of all lets go back to main, and void main.

Main is basically the entry point of the program. The main program then can invoke any other function.

void means the main program returns nothing to the operating system.

So what is public and static for in Java?

Public – Public is to declare that the method main is a public method.  Main method must be public so that Java Virtual machine can find the main method.

 

]]>
36
Printing Hello World in Java http://zulkifliishak.com/printing-hello-world-in-java/ Mon, 16 Jul 2018 09:43:13 +0000 http://zulkifliishak.com/?p=25  

1
2
3
4
5
6
public class HelloWorld
{
    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

Above program is example of how to print hello world in Java.

To print out, java print method is used.

 System.out.println("Hello World!");

println will print the string “Hello World” together with a new line.

 

]]>
25
How to write formula in wordpress blog post http://zulkifliishak.com/how-to-write-formula-in-wordpress-blog-post/ Mon, 16 Jul 2018 09:11:59 +0000 http://zulkifliishak.com/?p=21 If you are going to write the formula in wordpress blog, you need to install appropriate plugin that enable to write formula.

In this blog, we are using MathTex equation editor plugin which can be downloaded for free.

Installing MathTex equation editor plugin will add an icon to the WordPress editor Toolbar. Clicking the icon will execute a popup to create and insert the equation into blog post.

]]>
21
Let p denote the probability of some event. Plot the amount of information gained by the occurrence of this event for 0≤𝑝≤1 . http://zulkifliishak.com/let-p-denote-the-probability-of-some-event-plot-the-amount-of-information-gained-by-the-occurrence-of-this-event-for-0%e2%89%a4%f0%9d%91%9d%e2%89%a41/ Mon, 16 Jul 2018 09:03:38 +0000 http://zulkifliishak.com/?p=15 The question is asking to plot I vs p. I is the information while p is the probability.

Given that, the formula of I in term of p are as follows:

I = -log_{{2}} p

By using excel , the graph are as follows:

I vs P
Graph I vs P

 

]]>
15