Posts by Chang Park

Android Application

android-application-development

  • Written in Java language
  • They are compiled to Android’s own bytecode format, Dalvik executable(DEX)
  • Doesn’t have a single entry-point, such as the main method in Java
  • Four components
    • Activities: visible parts of an application
    • Services: run in the background and are not interacting with the user directly, used for long running background such as mp3 playback
    • Broadcast receivers: react to global events, such as incoming calls or text messages
    • Content providers: implement domain-specific databases for, e.g. contacts
  • onCreate(): gets called when the activity is launched for the first time
  • Android Emulator: virtual mobile device that runs on a computer and is similar to a real device.
  • Android API calls
    • Log.i(String tag, String msg):
      • Static methods which writes an info messages to the log
      • The log can be browed using the tool LogCat
    • findViewById(int id)
      • returns references to GUI objects

MySQL Basic Queries

Remeber

Do not ever use lowercase letter for query

  • It works, but it is hard to read

Space, enter doesn’t affect to query

  • You can use one query per line if you want.

Example


SELECT names
FROM customers

Queries

SELECT name FROM customers

  • Gets name column from customers table

SELECT name,zip FROM customers

  • Gets name and zip columns from customers table
  • You can get multiple columns by using commas

SELECT * FROM customers

  • Gets all columns from customers table

SELECT DISTINCT state FROM customers

  • Gets only one time for same value(No duplicate)

SELECT id, name FROM customers LIMIT 5

  • Gets first 5 items

SELECT id, name FROM customers LIMIT 5,10

  • From 5 , gets 10 items
  • First 5 is just as index, so it starts from 0
  • In here, you will start getting from 6th item

Hadoop – Mapper & Reducer

Definition

MapReduce is a processing technique and a program model for distributed computing based on java. The MapReduce algorithm contains two important tasks, namely Map and Reduce.

  • Map takes a set of data and converts it into another set of data, where individual elements are broken down into tuples (key/value pairs).
  • Reduce task takes the output from a map as an input and combines those data tuples into a smaller set of tuples.

As the sequence of the name MapReduce implies, the reduce task is always performed after the map job.

diagram

Example code is in my project.