Skip to content

Instantly share code, notes, and snippets.

@Override
protected void writeMessage(OutputStream os) throws IOException {
OutputStreamWriter osw = new OutputStreamWriter(os);
String json = getGson().toJson(m_Envelope);
osw.write("\n\n--"); osw.write(MULTIPART_BOUNDARY); osw.write("\n");
osw.write("Content-Type: application/json\n");
osw.write("Content-Disposition: form-data\n\n");
osw.write(json);
osw.flush();
/*
* Copyright (C) 2006 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
!SESSION 2012-10-11 13:56:24.939 -----------------------------------------------
eclipse.buildId=I20120608-1400
java.version=1.6.0_35
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments: -product org.eclipse.epp.package.java.product -keyring /Volumes/chris.sarbora/.eclipse_keyring -showlocation
Command-line arguments: -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Volumes/chris.sarbora/.eclipse_keyring -showlocation
!ENTRY org.eclipse.core.resources 2 10035 2012-10-11 13:56:26.397
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
@tophyr
tophyr / gist:3772812
Created September 23, 2012 19:51
tcpdump output
12:41:44.347135 IP (tos 0x0, ttl 64, id 43177, offset 0, flags [DF], proto TCP (6), length 64, bad cksum 0 (->940c)!)
localhost.60791 > localhost.5037: Flags [S], cksum 0xfe34 (incorrect -> 0xed52), seq 797130492, win 65535, options [mss 16344,nop,wscale 3,nop,nop,TS val 494896226 ecr 0,sackOK,eol], length 0
E..@..@[email protected]../.>..........4....?........
...b........
12:41:44.347197 IP (tos 0x0, ttl 64, id 61597, offset 0, flags [DF], proto TCP (6), length 64, bad cksum 0 (->4c18)!)
localhost.5037 > localhost.60791: Flags [S.], cksum 0xfe34 (incorrect -> 0xffbb), seq 1156646579, ack 797130493, win 65535, options [mss 16344,nop,wscale 3,nop,nop,TS val 494896226 ecr 494896226,sackOK,eol], length 0
E..@..@[email protected].../.>......4....?........
...b...b....
12:41:44.347205 IP (tos 0x0, ttl 64, id 1465, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->3709)!)
localhost.60791 > localhost.5037: Flags [.], cksum 0xfe28 (incorrect -> 0x79ad), ack 1, win 65535, options [nop,nop,TS v
11:57:55.683499 IP (tos 0x0, ttl 64, id 60076, offset 0, flags [DF], proto TCP (6), length 64, bad cksum 0 (->5209)!)
localhost.59563 > localhost.5037: Flags [S], cksum 0xfe34 (incorrect -> 0x66cf), seq 2954897313, win 65535, options [mss 16344,nop,wscale 3,nop,nop,TS val 492283543 ecr 0,sackOK,eol], length 0
E..@..@.@................ '..........4....?........
.W..........
11:57:55.683571 IP (tos 0x0, ttl 64, id 3070, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->30c4)!)
localhost.59563 > localhost.5037: Flags [.], cksum 0xfe28 (incorrect -> 0x8d70), ack 1233995204, win 65535, options [nop,nop,TS val 492283543 ecr 492283543], length 0
E..4..@.@................ '.I.E......(.....
.W...W..
11:57:55.683685 IP (tos 0x0, ttl 64, id 9369, offset 0, flags [DF], proto TCP (6), length 52, bad cksum 0 (->1829)!)
localhost.59563 > localhost.5037: Flags [F.], cksum 0xfe28 (incorrect -> 0x8d6f), seq 0, ack 1, win 65535, options [nop,nop,TS val 492283543 ecr 492283543], length 0
void filter(list_item *item, int (*passes)(list_item *item))
{
pthread_mutex_lock(&list_lock);
while (item != NULL)
{
if (!passes(item))
_remove_internal(item);
item = item->next;
}
pthread_mutex_unlock(&list_lock);
~ $adb shell pm list packages | grep samsung
package:com.zinio.samsung.android
package:com.samsung.android.livewallpaper.microbesgl
package:com.samsung.android.app.divx
package:com.samsung.SMT
package:com.samsung.InputEventApp
package:com.kobobooks.samsung.android
package:com.samsung.bt.avrcp
package:com.samsung.swift.app.kiesair
package:com.samsung.music
if [ "$TEST_PLATFORMS" = "single" ] then
AVDS=4.0-hdpi-normal
elif [ "$TEST_PLATFORMS" = "full" ] then
AVDS=`$ANDROID list avds -c`
fi
/*
* Copyright (C) 2006 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
public void testLogin() {
if (!waitForActivity(LoginActivity.class, Timeouts.SHORT)) {
assertActivityShown(HomeActivity.class, Timeouts.NOW);
clickImageView(R.id.home_image_logout);
}
assertActivityShown(LoginActivity.class);
EditText email = getEditText(R.id.login_email);
EditText password = getEditText(R.id.login_password);