Skip to content

Instantly share code, notes, and snippets.

// You'll want to load this from resource
private static char[][] T9_MAP = new char[][] {
{ '0' }, // Default
{ '1' },
{ '2', 'a', 'b', 'c' },
{ '3', 'd', 'e', 'f' },
{ '4', 'g', 'h', 'i' },
{ '5', 'j', 'k', 'l' },
{ '6', 'm', 'n', 'o' },
{ '7', 'p', 'q', 'r', 's' },
import java.util.Scanner;
public class HexToDecWithBonus {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter hex: ");
int dec = in.nextInt(16);
System.out.println("Decimal: " + dec);
System.out.println("Binary: " + Integer.toBinaryString(dec));
}
@pawitp
pawitp / Main.java
Created February 24, 2012 06:13
Question 1 - OCR
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
@pawitp
pawitp / gist:4104332
Created November 18, 2012 09:12
TinyHAL for JB 4.2 Bring up
diff --git a/tinyhal/audio_hw.c b/tinyhal/audio_hw.c
index 0c0d66e..29827a5 100644
--- a/tinyhal/audio_hw.c
+++ b/tinyhal/audio_hw.c
@@ -110,6 +110,12 @@ struct tiny_dev_cfg {
unsigned int off_len;
};
+enum {
+ IN = 0,
From 1e15efe8b70865b1006c1911daa2743e077da6cf Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 17 Apr 2013 13:49:01 +0700
Subject: [PATCH] libbt: switch to N_BRCM_HCI line disclipline for userial ioctl
Change-Id: I47ea7d535ab5fba976efb7d65f6dcecc64a603b1
---
libbt/src/userial_vendor.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
From 0bbd9e8b361a761d858a2ffe53d60d234a938654 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 24 Apr 2013 11:37:19 +0700
Subject: [PATCH] OMXCodec: Re-implement requires-flush-before-shutdown quirk
Support is already there, but is not in the codec quirk reading list.
Re-implement it as required by Broadcom's OMX
Change-Id: I1beac06af8118dcf0c248b631bc8e6dbbab2c1d5
---
From f7c0c6d9de40a3d221a5ee532092f8b9bbefb72d Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Wed, 24 Apr 2013 11:05:24 +0700
Subject: [PATCH] libhardware: padding for samsung BCM audio blob
Change-Id: I156d25a85fc09413e67a8816f91af3d1db8e4159
---
include/hardware/audio.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
@pawitp
pawitp / hwc.diff
Last active December 24, 2015 23:59
From 8a7dd8133d3280eadba63207b4a3da6ae7261a79 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 8 Oct 2013 12:12:12 +0700
Subject: [PATCH] sf: temporary disable HWC in landscape
Until we upgrade to 4.2 hwc with 4.2 bootloader (I9082)
Change-Id: Ib3e1874406e7b65378160ec0e5df4cefea546c9f
---
services/surfaceflinger/DisplayHardware/HWComposer.cpp | 5 +++--
@pawitp
pawitp / patch.diff
Last active December 30, 2015 21:59
From b8f9e36338d1b7812b9e6a43ca69ec3483aecda2 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 19:38:17 +0700
Subject: [PATCH 1/4] binder: add compat symbols
Required for libtvservice_binder.so on I9082
Change-Id: I059e92f19e4c5a911d38faa9c4df549c75c90761
---
libs/binder/Parcel.cpp | 12 ++++++++++++
From 814e9318a2eb62cfe0cd2ec6a71226017b259ea5 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 10 Dec 2013 19:38:17 +0700
Subject: [PATCH] binder: add compat symbols
Required for libtvservice_binder.so on I9082
Change-Id: I059e92f19e4c5a911d38faa9c4df549c75c90761
---
libs/binder/Parcel.cpp | 12 ++++++++++++