Deep Inside Learning

I work as Android Developer. Currently learning the Machine Learning, Data Science and Life too. This is my personal blog and any views expressed here are mine, and not my employers.

Page 2


MVCPH (Move PresCon to Hel)

MVPCH is Model View Presenter Controller Helper. What is that ? That not a concept or pattern. That is something in my mind when i want to create clean structured code and how i separate them. So what is that actually ?

nb: i’m using android concept to explain this because i found this when code on my work and personal project.

M = Model, is model (pojo) like User (ex: name, birth date, gender, etc)

V = View, is a layer to show the UI to the user (ex: activity, fragment, custom view)

C = Controller, is a layer that have your business logic that will process your model to view. But i’ll no direct pass the model to view, why ? because we’ll might be not need all data to pass to view and we also need to process the model like parsing, formatting, calculate and etc. (ex: LoginController, TweetController, etc)

P = Presenter, is a layer act as bridge to communicate from Controller to...

Continue reading →


Last Thing To Do Before 25 : Hiking

After busy with my study, work, and church activity finally i have some time to check my last thing that i want to do before 25. At 6 June 2015 i’m going to hike Gede Pangrango Mountain . We are start move from Gunung Putri the shortest path to hike in mountain

This is our preparation in the morning before hiking. I’m the one who are wearing MIT shirt.

11133811_868652009838229_6216785318629519956_n.jpg

Let the adventure begin

10857882_868652789838151_5434958748983567500_n.jpg

Beside us is farm of local farmer who are life in near Gunung putri

11535862_868653369838093_9144068487723274531_n.jpg

After ¼ way from starting point.

1010215_868653736504723_3981519525903173094_n.jpg

After halfway from starting point

11402828_868655569837873_2073239556780129161_n.jpg

Way that we need to climb

11391097_868657129837717_5912556547562247549_n.jpg

After ¾ way to climb

13819_868658323170931_4945181889049353094_n.jpg

7/8 before in last checking point for staying and camping

10421208_868659206504176_5031923898048594952_n.jpg

Surya Kencana checking point. In here we are staying and build camp. Total we are hiking for 11 Hours.

11391550_868660066504090_7606792503103289794_n.jpg

11427002_868660149837415_5074319258019312544_n.jpg

10501988_868660616504035_1957325356147373170_n.jpg

11535738_868661173170646_3834182340997437490_n.jpg

10403092_868662053170558_1103714603916307106_n.jpg

10154415_868662753170488_1180088802007915068_n.jpg

11015356_868664229837007_8116039872636663291_n.jpg

IMG_4465.JPG

In the next morning

IMG_4791.JPG

Its tired vacation. The way down from Surya kencana to gunung putri is 6 hours. And after that we are coming...

Continue reading →


Developer Page For Publisher

Google release something new for Developer. Google Developer Page. The purpose developer is really good if you want to a publisher have several app that already published and they have an apps that will be featured. I think it can be a brand awareness to user that the publisher already publish several apps. But i hope in the future google will release a specific domain like play.google.com/antares How to activate Developer Page ?

Go to your google developer console.

sc1.jpg

and then personalize your page that mandatory like Promotional Text, Graphic Asset (Developer Icon (512 x 512) and Header Image (4096 x 2304) ), Featured Page and voilla your page is ready.

sc2.jpg

And here is my developer page http://antares.hasibuan.me

Screenshot_20150604-193834.png

sc3.jpg

Continue reading →


UIThread Annotation

After watching Google I/O 2015 - What’s New in Android Development Tools they mention about UiThread. What is UiThread, UiThread is annotation. This is interesting because using these annotation we can reduce some line of to be more cleaner and readble.

So we can transfer from this :

new Asyntask() {
    public void doInBackground(...) { 
        int i = 0;
        while(true) {
            i++;
            updateProgress(textview, i);
        }
    }
}

void updateProgress(final TextView textProgress, final int val) {
  runOnUiThread(new Runnable() {
    @Override
    public void run() {
      textProgress.setText( "" + val );
    }
  });
}

we can specify that updateProgress is can only called by UIThread :

@UiThread
void updateProgress(TextView textProgress, int val) {
  textProgress.setText( "" + val );
}

if you don’t put @UiThread as annotation of updateProgress method...

Continue reading →


The Power of Batak Song

I think i need to write this before my post visiting Google Indonesia office. As you know i’m batak my sure name is hasibuan. I write this for my salute for all batak people in Indonesia that already give great acknowledge in world such as Christian Siagian, Phd, Radja Nainggolan. There is some other also that have achievement in their field. But there is one thing that i find interesting from batak people Their voice. I don’t when i’m coding and listening to batak song. It likes add some super power to me (for example i can solve some puzzle easly in TopCoder when i listen to batak song). This is some of my favourite :

  • *Marsada Trio - Patik Palimahon | Lagu Batak
    *

    IMAGE ALT TEXT HERE

  • Trio Lamtama- Patik Palimahon
    IMAGE ALT TEXT HERE

  • Anak Na Burju - Trio New Lasidos
    IMAGE ALT TEXT HERE

  • Trio Lamtama - Burju Ni Dainang
    IMAGE ALT TEXT HERE

  • Trio Lamtama - Hu Ingot Do Inang
    IMAGE ALT TEXT HERE

All of songs that i give above most of them is having “Parents” as theme. Because in...

Continue reading →


Deep Learning Summer School 2015

Several months ago, i applied to Deep Learning Summer School 2015 in Canada. Organizer of this event are Yoshua Bengio, Roland Memisevic, Yann LeCun the last name that i mention is Director AI Research Facebook. The event will held on Monday August 3, 2015 until Wednesday August 12 2015, inclusively. And the price is :

  • students: 500 $CA
  • other academics: 750 $CA
  • others (industry): 1000 $CA.

The speakers who will be speak on the conference are :

  • Yoshua Bengio (University of Montreal),
  • Leon Bottou (MSR),
  • Phil Blunsom (Google DeepMind, University of Oxford),
  • Adam Coates (Baidu),
  • Aaron Courville (University of Montreal),
  • Ian Goodfellow (Google),
  • Hugo Larochelle (University of Sherbrooke),
  • Honglak Lee (University of Michigan),
  • Chris Manning (Stanford University),
  • Roland Memisevic (University of Montreal),
  • Ruslan Salakhutdinov (University of Toronto),
  • Mark Schmidt (University...

Continue reading →


Simple User Based Recommendation Using Mahout

Tonight, i want to share a little brief to give User-Based recommendation. First we need to know what is the algorithm of user-based recommendation. User Based Recommendation is using pearson correlation as main algorithm to compare similiarity user with another user. Pearson Correlation actualy give 3 result :

  • -1 => this is mean that 2 user is very different so we will not use recommendation from user’s item
  • 0 => this is mean that 2 user is not same.
  • 1 => this is mean that between 2 user they have correlation, so we can give item that other user’s like.

Correlation_coefficient.png

And we know the basic concept. Whats next, of course we need to code it. I’m using intellij as my IDE but you can use your own IDE like eclipse, vim, sublime, or etc. First you need to add mahout-core using your Maven. The latest version is 0.9. All you need to know is :

  1. Load data from file, we can do it like this :

    ...

Continue reading →


Add vs Add

Yesterday, Google release update for [appcompat v22.1][1] one of interesting thing is Sorted List one thing that comes to my mind is what method add in SortedList actually look like. Because i’m curious about how SortedList sort their data.

And then i want to measure about the performance of ArrayList and SortedList. I create a code to measure the ArrayList Peformance :

long start = System.nanoTime();
int [] sample = new int[size];
for (int i = 0; i <= 100000; i++) {
    if (i == size ){
        size = size + (size >> 1);
        sample =  Arrays.copyOf(sample, size);
    }
    sample[i]= i;
}
long last = System.nanoTime();
System.out.println("finish in : " + (last - start));

This is actual code for add in ArrayList :

public boolean add(E object) {
    Object[] a = array;
    int s = size;
    if (s == a.length) {
        Object[] newArray = new Object[s +
            (s <
...

Continue reading →


Data Science Question

Today i read post in quora about 20 question to detect fake data science. This is my answer about this questions if don’t know then i will note that i don’t know the answer.

  1. What is the P-value and is it different from type I error.
    => what i know P-values is technic to observed sample results to test our statistical hypotesis. And Type i error is incorrect of null hypothesis (“false positive”)

  2. What are the metrics to evaluate a search engine website?
    => i have hear it on coursera course about page rank. But i’m not sure yet about the method and i will update the answer later.

  3. Three ants are sitting at the three corners of an equilateral triangle. Each ant starts randomly picks a direction and starts to move along the edge of the triangle. The probability that none of the ants collide = [ ? / ? ]
    Follow-up: k ants are sitting at the k corners of an equilateral polygon. Each ant...

Continue reading →


Beautrip, Product From Mastercard Hackathon Singapore

Last 2 weeks, me and my friend muhar participated on Master Card Hackathon Singapore. Hackathon itself placed in 237.io coworking space, the place itself located exactly in front of Sri Mariamman Temple

10838476_1417062925266788_902330505_n.jpg

Theme of this hackathon is Empower Woman Using Technology and your hackathon product must use one of mastercard api and use simplify commerce. And our product idea is Beautrip, our product focused on as a place to all woman find backpacker friend and find package trip. Our model is based on how to make the woman feel safe on backpacking and how to make them get the safety.

Beautrip is actually using Simplify Commerce Api and Money Transfer API. First there is 2 actor in this product : Trip Creator and Trip Participant. In Trip Creator we divide 2 type of trip creator : Trip Creator Professional which is a expert or EO will take care of everything when do the backpacking, so you...

Continue reading →