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 3


YYYY DateTime Problem in Java

See this code of datetime in java

SimpleDateFormat format = new SimpleDateFormat("dd-MMM-YYYY");

Calendar day1 = new GregorianCalendar(2014, Calendar.DECEMBER, 28);
System.out.println(format.format(day1.getTime()));

Calendar day2 = new GregorianCalendar(2014, Calendar.DECEMBER, 29);
System.out.println(format.format(day2.getTime()));

This is what you get in console :

28-Dec-2015
29-Dec-2015

WTH!!!!!!!!!!!!!!!!!!!!!!!!!
But this problem doesn’t happen in Joda Time

And this is why all twitter account in android is force sign out by twitter. According to this, it says “Values calculated for the WEEK_OF_MONTH field range from 0 to 6. Week 1 of a month (the days with WEEK_OF_MONTH = 1) is the earliest set of at least getMinimalDaysInFirstWeek() contiguous days in that month, ending on the day before getFirstDayOfWeek(). Unlike week 1 of a year, week 1 of a month may be shorter than...

Continue reading →


Assignment in Gradient Descent Algorithm

Today i learn about Gradient Descent Algorithm. There is something interesting in that equation that very common use in Computer Science.

“=”

My lecturer in university never said that in programming language like Java, C, or Python this sign is for assignment not an equals.

But in Math the sign “=” is used to check that value from left side is equals to hand side. Just like :

a = b (this is means that value of variable a and value of variable b is equals)

5x^2 + 2x + 3 = 0 ( this is means that equation in the left is equals to zero)

But in programming we use this sccript :

a = a + 1 ( this is means, value of variable a is value variable a + 1) 

And in math we use this notation :

a := a+1 (ovveride new value of a with equation in the right hand side)

Continue reading →


My Learning Target in 2015

Alt text

Facing the 2015 i have write the strategy to improve my knowledge and my softskill. Source to improve that is by using online course, study, and reading some book. For online course i’m using coursera (http://coursera.org) and Harvard Manage Mentor (Provided by my company for Internal Purpose Only).

In Coursera i have plan taking some course that interesting and same path as my interested here they are :

1. Mathematical Methods for Quantitative Finance

Alt text
Alt text

Provided by University of Washingthon, one of their departement called Applied Mathematics. Why i choose this topic ? Easy first i love math, and second i need to open my mind the application of math in real life such as economic, leadership, mortgate, loan, pricing formula, etc.

Currently i learn this course untile the week 1, and already finish the quiz. Although the score is not perfect, but my score is above the average. In...

Continue reading →


Facebook Hacker Cup Qualification Round

Last weekend i’m participating on Facebook Hacker Cup, and the first stage is qualification round. If you managed to answer one of the problem you can pass to next round.

In Qualification round there is 3 problems :

  1. Cooking Books (https://www.facebook.com/hackercup/problems.php?pid=582062045257424&round=742632349177460)
    Every business can make use of a good accountant and, if they’re not big on following the law, sometimes a bad one. Bad accountants try to make more money for their employers by fudging numbers without getting caught.

    Sometimes a bad accountant wants to make a number larger, and sometimes smaller. It is widely known that tax auditors will fail to notice two digits being swapped in any given number, but any discrepancy more egregious will certainly be caught. It’s also painfully obvious when a number has fewer digits than it ought to, so a bad accountant will never...

Continue reading →


Android Performance Pattern

Hey Guys, google is releasing a new great videos about performance and hwo to improve it.

You can watch it here : http://www.youtube.com/playlist?list=PLOU2XLYxmsIKEOXh5TwZEv89aofHzNCiu

IMAGE ALT TEXT HERE

View →


Achievement of 2014 “The Year of Decision”

Today is the last day of 2014 but this year i face many things and i give tag for this year as “The Year to Train my decision”.

  • I decide to accept an offer from the biggest online travel agent in Indonesia, but unfortunately the deal is stall because several reason
  • I decide to take Master Degree.
  • I decide to accept position as President of Young Division in My Church
  • I decide to do an event with other member of Young Division in my Church which is already off for several years. And the result is very pleasure.
  • I decide to working with another church in my area because in My Church this year is “Year of Young” and together we are joining to do some event : Easter, Charitity, and Christmas. And the result is very pleasure too. We are learning anything from other (mindset, dilligent, music, choir, and how to do something in right way)
  • I decide to learning the hardest part of Computer...

Continue reading →


Job Vacancy in Samsung R&D Institute Indonesia

Hi Guys, to face 2015 year Samsung (http://www.samsung.com/) is open some vacancy in different area level :

1. Android Developer (to Apply : https://www.linkedin.com/jobs2/view/14902561?trk=job_view_similar_jobs)
Job description

  • Creating Android apps
  • Development of core components to be re-used on SAMSUNG platforms;
  • Create Technical Feasibility Studies and Proofs of Concept for selected solution challenges.
  • Contribute on ideations for new apps
  • Desired Skills and Experience
  • Bachelor degree in Software Engineering, Computer Science, Electrical - Engineering or other relevant majors
  • Proficiency in Android/Java Programming. Willing to learn new languages based on project needs.
  • Strong in Object-Oriented analysis and design
  • Ability to debug code and analyze logs
  • Must be a team player, proactive, resourceful, and creative
  • Ability to think out-of-the-box and passionate in research
  • ...

Continue reading →


m.e^(r.r.y) = x - m.a.s (AWESOME)

http://9gag.com/gag/aXEe5RD?ref=tp
aXEe5RD_700b.jpg

View →


Weak Reference in Java and Android

Last week i have trouble in Picasso(http://square.github.io/picasso/), when i want to :

    Picasso.with(context).load(url).into(new Target(){
    @Override
    public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {

    }

    @Override
    public void onBitmapFailed(Drawable errorDrawable) {

    }

    @Override
    public void onPrepareLoad(Drawable placeHolderDrawable) {

    }
};

But unfortunately when i run this code, onBitmapLoaded is not called. Why ? after read this http://stackoverflow.com/questions/24180805/onbitmaploaded-of-target-object-not-called-on-first-load i know the problem because Target object is weak because clear on JVM(http://en.wikipedia.org/wiki/Java_virtual_machine) so what is the solution ?

  1. You can make the target as Class attribute (http://docs.oracle.com/javase/tutorial/java/javaOO/variables.html), so you don’t make the target as inline...

Continue reading →


Practicing Unit Test and TDD part 1

Today, i’m very curious about Unit Test especially Unit Test in android. So, first what is Unit Test, according to wikipedia (http://en.wikipedia.org/wiki/Unit_testing) : unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures are tested to determine if they are fit for use. In this article i’m using Eclipse (https://eclipse.org/) as IDE and jUnit (http://junit.org/) to do the unit test.

Example you have this method :

    public int add(int number1, int number2){
        return number1 + number2;
    }

How you make sure that the add method give the correct result. Yes, by using unit test. This is the sample code of unit test to test add method :

    @Test public void testAdd(){
        assertEquals(3, add(1,2));
...

Continue reading →