Skip to content

Instantly share code, notes, and snippets.

View first087's full-sized avatar

Artit Kiuwilai first087

View GitHub Profile
@first087
first087 / LoadAdsBeforeEnableFeature.java
Created November 27, 2013 09:14
Android Application : Load Ads (AdMob) Before Enable Feature
package com.ethanf.admob.enablefeature;
import android.content.Context;
import android.util.Log;
import android.view.View;
import com.google.ads.*;
import com.google.ads.AdRequest.ErrorCode;
public class ExActivity extends Activity {
@first087
first087 / frmRandomNumber.Designer.vb
Last active August 29, 2015 13:56
RandomNumberEx on VB.NET 3.5
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmRandomNumber
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
@first087
first087 / LoadAdsBeforeEnableFeatureGooglePlayServices.java
Created February 15, 2014 05:50
Android Application : Load Ads (AdMob) Before Enable Feature (Google Play Services Library)
package com.ethanf.admob.enablefeature;
import android.content.Context;
import android.util.Log;
import android.view.View;
import com.google.android.gms.ads.*;
public class ExActivity extends Activity {
private Context context;
@first087
first087 / MainActivity.java
Last active February 14, 2024 00:22
Android Application : In-app Billing Example. Test app at https://play.google.com/store/apps/details?id=com.ethanf.in_app_billing_ex
package com.ethanf.in_app_billing_ex;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import com.android.vending.billing.IInAppBillingService;
import android.os.Bundle;
@first087
first087 / MainActivity.java
Last active January 13, 2019 18:01
Android Application : In-app Billing Example with Utility. Test app at https://play.google.com/store/apps/details?id=com.ethanf.in_app_billing_ex2
package com.ethanf.in_app_billing_ex2;
import com.ethanf.in_app_billing_ex2.util.IabHelper;
import com.ethanf.in_app_billing_ex2.util.Inventory;
import com.ethanf.in_app_billing_ex2.util.IabResult;
import com.ethanf.in_app_billing_ex2.util.Purchase;
import com.ethanf.in_app_billing_ex2.util.SkuDetails;
import android.os.Bundle;
import android.app.Activity;
@first087
first087 / frmBGWorker.Designer.vb
Last active November 20, 2015 17:42
BackgroundWorkerEx on VB.NET
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmBGWorker
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
@first087
first087 / WordCount.java
Last active August 29, 2015 14:03
MapReduce Framework
package org.myorg;
import java.io.IOException;
import java.util.*;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapred.*;
import org.apache.hadoop.util.*;
@first087
first087 / updater-script
Created November 14, 2014 08:50
updater-script from update package file of Nexus 9 LRX21L to LRX21Q
getprop("ro.product.device") == "flounder" || abort("This package is for \"flounder\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "google/volantis/flounder:5.0/LRX21L/1546449:user/release-keys" ||
getprop("ro.build.fingerprint") == "google/volantis/flounder:5.0/LRX21Q/1573789:user/release-keys" ||
abort("Package expects build fingerprint of google/volantis/flounder:5.0/LRX21L/1546449:user/release-keys or google/volantis/flounder:5.0/LRX21Q/1573789:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
apply_patch_check("EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:8020736:cb05bb08e37fa54271cc3f7986fa0f716f610499:8000256:3172d86057339cb034c308640c1d7f838fbbe0a7") || abort("\"EMMC:/dev/block/platform/sdhci-tegra.3/by-name/LNX:8020736:cb05bb08e37fa54271cc3f7986fa0f716f610499:8000256:3172d86057339cb034c308640c1d7f838fbbe0a7\" has unexpected contents.");
# ---- start making changes
@first087
first087 / layout_main1.xml
Created May 16, 2015 14:23
Word Quiz Game - Layout Main
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">
@first087
first087 / TheCount.java
Last active September 4, 2015 02:05
Hadoop Training (Hadoop 2) - Day 1
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.Mapper;