Skip to content

Instantly share code, notes, and snippets.

02-06 18:27:35.746 I/System.out(16409): +-----------------------------------------------------------------------------+
02-06 18:27:35.746 I/System.out(16409): | >>>>>>exception caughted<<<<<< |
02-06 18:27:35.773 I/System.out(16409): | at Channel:[id: 0x53cf01f8] |
02-06 18:27:35.773 I/System.out(16409): | Cause :android.os.NetworkOnMainThreadException |
02-06 18:27:35.777 I/System.out(16409): +-----------------------------------------------------------------------------+
02-06 18:27:35.785 D/CloudClient(16409): [ LoginActivity.java: 174 ] _____ attemptLogin - postLogin >>>>>
02-06 18:27:35.789 D/CloudClient(16409): [ LoginActivity.java: 176 ] _____ attemptLogin - postLogin <<<<<
02-06 18:27:35.812 W/dalvikvm(16409): VFY: unable to find class referenced in signature (Ljava/net/ProtocolFamily;)
02-06 18:27:35.812 I/dalvikvm(16409): Could not find method java.nio.channels.DatagramChannel.op
package com.android.soundrecorder;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
@shaobin0604
shaobin0604 / city_list_header.xml
Created December 4, 2012 09:09
4.2 DeskClock WorldClock city chooser section header
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@shaobin0604
shaobin0604 / gist:3912136
Created October 18, 2012 14:15
coding-instinct-theme_vs2008.vssettings
<UserSettings>
<ApplicationIdentity version="9.0"/>
<ToolsOptions>
<ToolsOptionsCategory name="Environment" RegisteredName="Environment"/>
</ToolsOptions>
<Category name="Environment_Group" RegisteredName="Environment_Group">
<Category name="Environment_FontsAndColors" Category="{1EDA5DD4-927A-43a7-810E-7FD247D0DA1D}" Package="{DA9FB551-C724-11d0-AE1F-00A0C90FFFC3}" RegisteredName="Environment_FontsAndColors" PackageName="Visual Studio Environment Package">
<PropertyValue name="Version">2</PropertyValue>
<FontsAndColors Version="2.0">
<Categories>
public static byte[] getWifiHostAddress(Context context) {
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
DhcpInfo dhcp = wifiManager.getDhcpInfo();
int host = (dhcp.ipAddress & ~dhcp.netmask);
byte[] quads = new byte[4];
for (int k = 0; k < 4; k++) {
quads[k] = (byte) ((host >> k * 8) & 0xFF);
}
--------- beginning of /dev/log/main
01-03 08:30:06.510 D/VCharge ( 1181): start
01-03 08:30:06.510 D/VCharge ( 1181): func: uevent_init line: 176 get 7
01-03 08:30:06.510 D/VCharge ( 1181): open vcharge channel success vbpipe_fd=9
01-03 08:30:06.510 D/VCharge ( 1181): inital status usb: 1 ac: 0
01-03 08:30:06.510 D/VCharge ( 1181): file: /data/.battery_nv empty
01-03 08:30:06.510 D/VCharge ( 1181): vcharge start
01-03 08:30:06.510 D/VCharge ( 1181): adc cal got 0x0,0x0,0x3941068,0x30f0e10
01-03 08:30:06.510 E/VCharge ( 1181): parse_data: can't find cal_flag
01-03 08:30:06.510 D/VCharge ( 1181): parse_data: adc_0: 0x0, adc_1: 0x0, bat_0: 0x3941068, bat_1: 0x30f0e10,cal_flag: 0x0
01-03 08:14:01.930 E/JNIHelp ( 1217): Native registration unable to find class 'android/debug/JNITest', aborting
01-03 08:14:01.930 F/libc ( 1217): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
01-03 08:14:02.330 I/DEBUG ( 1213): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-03 08:14:02.330 I/DEBUG ( 1213): Build fingerprint: 'Huawei/T8808D/hwT8808D:4.0.3/HuaweiT8808D/CHSC01B025:eng/release-keys'
01-03 08:14:02.330 I/DEBUG ( 1213): pid: 1217, tid: 1217 >>> zygote <<<
01-03 08:14:02.330 I/DEBUG ( 1213): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad
01-03 08:14:02.330 I/DEBUG ( 1213): r0 deadbaad r1 00000001 r2 a0000000 r3 00000000
01-03 08:14:02.330 I/DEBUG ( 1213): r4 00000000 r5 00000027 r6 00010500 r7 00000002
01-03 08:14:02.340 I/DEBUG ( 1213): r8 401afaa0 r9 4018dd02 10 0000904c fp 00009062
01-03 08:14:02.340 I/DEBUG ( 1213): ip ffffffff sp befa7a48 lr 4001efa1 pc 4001b6c8 cpsr 60800030
@shaobin0604
shaobin0604 / gist:3652951
Created September 6, 2012 08:20
server control command
// start server
adb shell am broadcast -a com.pekall.pctool.AmCommandReceiver.ACTION_MAIN_SERVER_START -n com.pekall.pctool/.AmCommandReceiver
// stop server
adb shell am broadcast -a com.pekall.pctool.AmCommandReceiver.ACTION_MAIN_SERVER_STOP -n com.pekall.pctool/.AmCommandReceiver
@shaobin0604
shaobin0604 / gist:3607968
Created September 3, 2012 08:52
CMD_QUERY_CONTACTS response
cmd_type: CMD_QUERY_CONTACTS
result_code: 0
result_msg: "OK"
contact_record {
id: 8883
name: "\345\225\212\345\267\264\351\273\216"
nickname: ""
photo_modify_tag: false
version: 3
sync_result: NO_CHANGE
@shaobin0604
shaobin0604 / Solution.java
Created June 15, 2012 02:02
满分答案
// you can also use imports, for example:
// import java.math.*;
class Solution {
int equi(int[] a) {
final int b = a.length;
long left = 0;
long right = 0;
for (int i = 0; i < b; i++) {
right += a[i];