code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*
* Copyright (C) 2008 Google Inc.
*
* 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 agree... | zzhangumd-apps-for-android | Samples/Downloader/src/com/google/android/downloader/DownloaderTest.java | Java | asf20 | 2,200 |
/*
* Copyright (C) 2008 Google Inc.
*
* 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 agree... | zzhangumd-apps-for-android | Samples/Downloader/src/com/google/android/downloader/PreconditionActivityHelper.java | Java | asf20 | 2,672 |
/*
* Copyright (C) 2008 Google Inc.
*
* 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 agree... | zzhangumd-apps-for-android | Samples/Downloader/src/com/google/android/downloader/DownloaderActivity.java | Java | asf20 | 40,004 |
/*
* Copyright (C) 2008 Google Inc.
*
* 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 agree... | zzhangumd-apps-for-android | LolcatBuilder/src/com/android/lolcat/LolcatView.java | Java | asf20 | 25,915 |
/*
* Copyright (C) 2008 Google Inc.
*
* 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 agree... | zzhangumd-apps-for-android | LolcatBuilder/src/com/android/lolcat/LolcatActivity.java | Java | asf20 | 30,490 |
package tools.common;
public class Tag {
public static String CONNECTIVITY_CHANGE = "android.net.conn.CONNECTIVITY_CHANGE";
public static String BATTERY_CHANGED = "android.intent.action.BATTERY_CHANGED";
public static String SMS_RECEIVER = "android.provider.Telephony.SMS_RECEIVED";
//自定义
public static String XINT... | zzy-test-client | trunk/com_1/src/tools/common/Tag.java | Java | bsd | 878 |
package tools.common;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.conten... | zzy-test-client | trunk/com_1/src/tools/common/Tools.java | Java | bsd | 9,528 |
package tools.common;
import java.io.ByteArrayOutputStream;
public class Base64Util {
private static final char[] base64EncodeChars = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g',... | zzy-test-client | trunk/com_1/src/tools/common/Base64Util.java | Java | bsd | 4,041 |
package tools.common;
import java.security.Key;
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.Cipher;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
public class DES2
{
... | zzy-test-client | trunk/com_1/src/tools/common/DES2.java | Java | bsd | 2,740 |
package tools.common;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.telephony.SmsMess... | zzy-test-client | trunk/com_1/src/tools/common/SmsReceiver.java | Java | bsd | 7,512 |
package tools.common;
import java.io.File;
import java.io.RandomAccessFile;
import java.util.Date;
import android.os.Environment;
import android.util.Log;
/**
* BUG调试工具
* @author
*
*/
public class Logger {
//自定义标签
public final static String TAG = "sms";
/** 调试开关*/
public final static bo... | zzy-test-client | trunk/com_1/src/tools/common/Logger.java | Java | bsd | 3,351 |
package tools.common;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.InetSocketAddress;
import java.net.Socket;
import ... | zzy-test-client | trunk/com_1/src/tools/common/AService.java | Java | bsd | 19,553 |
package tools.common;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class DbHelper extends SQLiteOpenHelper{
public static final String TASKDB = "taskbd";
pu... | zzy-test-client | trunk/com_1/src/tools/common/DbHelper.java | Java | bsd | 3,334 |
#include "QHttp.h"
#include "RefCounted.h"
#include "ThreadPool.h"
#include <list>
#include <curl/curl.h>
#include <fstream>
#include <algorithm>
#include <sstream>
#include <map>
#include <iostream>
#include "QCookieManager.h"
void static trim_right(std::string& s, const char* str = " ") {
s.erase(s... | zzip | QHttp/src/QHttp.cpp | C++ | asf20 | 18,947 |
#ifndef DownloadController_h__
#define DownloadController_h__
#include "Object.h"
#include "QHttpObject.h"
namespace q {
} // namespace q
#endif // DownloadController_h__ | zzip | QHttp/include/QHttpController.h | C++ | asf20 | 190 |
#ifndef DownloadObject_h__
#define DownloadObject_h__
#include "TypeDefs.h"
#include "Object.h"
namespace q {
//class IHttpObject : public Object {
//public:
// virtual const char* url() = 0;
// virtual const char* header(const char*) = 0;
// virtual int status() = 0;
// virtual ~IHttpObject() {};... | zzip | QHttp/include/QHttpObject.h | C++ | asf20 | 918 |
#ifndef QHttp_h__
#define QHttp_h__
#include "Object.h"
namespace q {
enum READYSTATE {
UNINITIALIZED = 0,
LOADING,
LOADED,
INTERACTIVE,
COMPLETED
};
enum ACTION {
GET = 0L,
POST = 1L,
};
struct IHttpRequest;
struct IEvent : Object {
virtual void onReadyStateChange(IHttpRequest*, ... | zzip | QHttp/include/QHttp.h | C++ | asf20 | 946 |
#include "thread.h"
#ifndef WIN32
#include <pthread.h>
#include <time.h>
#else
#include <process.h>
#endif
namespace q {
Thread::Thread()
: thread_(0)
, bRunning_(false)
, bWaitStop_(false)
{
}
Thread::~Thread(){}
bool Thread::start(){
if(!bRunning_) {
#ifdef OS_WIN
thread_ = (HANDLE... | zzip | base/Thread.cc | C++ | asf20 | 1,552 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This is a low level implementation of atomic semantics for reference
// counting. Please use base/ref_counted.h directly instead.
//
// The i... | zzip | base/atomic_ref_count.h | C++ | asf20 | 2,938 |
#ifndef __INTERLOCK_H__
#define __INTERLOCK_H__
/*
Abstract:
Implementation of Interlocked functions for the Intel x86
platform. These functions are processor dependent.
--*/
//SET_DEFAULT_DEBUG_CHANNEL(SYNC);
/*++
Function:
InterlockedIncrement
The InterlockedIncrement function increment... | zzip | base/InterLock.h | C | asf20 | 4,051 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is an internal atomic implementation, use base/atomicops.h instead.
#ifndef BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
#define BASE_ATOMI... | zzip | base/atomicops_internals_x86_msvc.h | C++ | asf20 | 5,928 |
#ifndef __LOCKER_H__
#define __LOCKER_H__
#ifndef WIN32
#include <pthread.h>
#include <sys/types.h>
#include <errno.h>
#if defined( __GNUC__ ) && ( defined( __i386__ ) || defined( __x86_64__ ) )
#include "InterLock.h"
#endif
#else
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#ifde... | zzip | base/Locker.h | C++ | asf20 | 3,518 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file adds defines about the platform we're currently building on.
// Operating System:
// OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (M... | zzip | base/builder_config.h | C | asf20 | 3,959 |
#include "ThreadPool.h"
namespace q {
WorkThread::WorkThread( ThreadPool* pool )
: pool_(pool)
{
}
WorkThread::~WorkThread() {}
bool WorkThread::loop() {
if(NULL != pool_) {
return pool_->work_proc();
}
return false;
}
////////////////////////////////////////////////////////////
... | zzip | base/ThreadPool.cc | C++ | asf20 | 1,912 |
#ifndef __APPLICATION_H__
#define __APPLICATION_H__
#include "thread.h"
namespace base {
namespace framework {
template<class T> class MainThread;
template<class T>
class Application {
public:
Application() {};
~Application(){};
virtual bool run() {
return true;
}
virtual bo... | zzip | base/application.h | C++ | asf20 | 571 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "RefCounted.h"
namespace base {
namespace subtle {
RefCountedBase::RefCountedBase()
: ref_count_(0)
// #ifndef NDEBUG
// , in_dtor... | zzip | base/RefCounted.cc | C++ | asf20 | 2,156 |
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_REF_COUNTED_H_
#define BASE_REF_COUNTED_H_
#pragma once
#include "atomic_ref_count.h"
namespace base {
namespace subtle {
class Re... | zzip | base/RefCounted.h | C++ | asf20 | 7,065 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is an internal atomic implementation, use base/atomicops.h instead.
#ifndef BASE_ATOMICOPS_INTERNALS_X86_MACOSX_H_
#define BASE_ATO... | zzip | base/atomicops_internals_x86_macosx.h | C++ | asf20 | 8,885 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This module gets enough CPU information to optimize the
// atomicops module on x86.
#include <string.h>
#include "atomicops.h"
// This file... | zzip | base/atomicops_internals_x86_gcc.cc | C++ | asf20 | 3,530 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is an internal atomic implementation, use base/atomicops.h instead.
#ifndef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
#define BASE_ATOMIC... | zzip | base/atomicops_internals_x86_gcc.h | C++ | asf20 | 9,145 |
#include "StdAfx.h"
#include "filehelper.h"
#include <io.h>
#include <direct.h>
bool base::utils::filehelper::CreateFolder(tstring sPath, bool bFile) {
tstring pathTmp = sPath;
//format path string to unix style.
for (size_t i=0; i<pathTmp.size(); ++i)
{
if (pathTmp[i] == _T('\\'))
pathTmp[i] = _T(... | zzip | base/utils/filehelper.cc | C++ | asf20 | 803 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is an internal atomic implementation, use base/atomicops.h instead.
//
// LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google ... | zzip | base/atomicops_internals_arm_gcc.h | C++ | asf20 | 4,024 |
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// For atomic operations on reference counts, see atomic_refcount.h.
// For atomic operations on sequence numbers, see atomic_sequence_num.h.
//... | zzip | base/atomicops.h | C++ | asf20 | 6,228 |
//
// package_helper.hpp
// ~~~~~~~~~
//
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#ifndef package_helper_h__
#d... | zzip | package_helper.hpp | C++ | asf20 | 543 |
test | zzip | test.c | C | asf20 | 4 |
//-------------------------------------------------------------------------
//
// Copyright (C) 2004-2005 Yingle Jia
//
// Permission to copy, use, modify, sell and distribute this software is
// granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express o... | zzip | ZZipLib/AcfDelegate.h | C++ | asf20 | 3,208 |
//-------------------------------------------------------------------------
//
// Copyright (C) 2004-2005 Yingle Jia
//
// Permission to copy, use, modify, sell and distribute this software is
// granted provided this copyright notice appears in all copies.
// This software is provided "as is" without express o... | zzip | ZZipLib/AcfDelegateTemplate.h | C++ | asf20 | 9,715 |
package org.teremail.server;
import org.teremail.client.TableSelectionListener;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.ui.FlexTable;
public class GwtTestTableSelectionListener extends GWTTestCase {
public String getModuleName() {
return "org.teremail.TestTereMa... | zzuoqiang-teremail | teremail-web/src/test/java/org/teremail/server/GwtTestTableSelectionListener.java | Java | lgpl | 856 |
package org.teremail.server;
import org.teremail.client.FolderController;
import org.teremail.client.MailServiceAsync;
import org.teremail.client.MessageSummary;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
public... | zzuoqiang-teremail | teremail-web/src/test/java/org/teremail/server/GwtTestFolderController.java | Java | lgpl | 1,744 |
package org.teremail.server;
import org.teremail.client.MailServiceAsync;
import org.teremail.client.MessageSummary;
import org.teremail.client.SummaryController;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
publi... | zzuoqiang-teremail | teremail-web/src/test/java/org/teremail/server/GwtTestSummaryController.java | Java | lgpl | 2,014 |
package org.teremail.server;
import junit.framework.Assert;
import org.teremail.client.ErrorHandler;
public class VerificationHelper {
public final static ErrorHandler mockErrorHandler = new ErrorHandler() {
public void showMessage(String message) {
Assert.fail(message);
}
};
}
| zzuoqiang-teremail | teremail-web/src/test/java/org/teremail/server/VerificationHelper.java | Java | lgpl | 319 |
package org.teremail.client;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTMLTable;
import com.google.gwt.user.client.ui.SourcesTableEvents;
import com.google.gwt.user.client.ui.TableListener;
public class TableSelectionL... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/TableSelectionListener.java | Java | lgpl | 1,689 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
public class FolderController {
private final FlexTable view;
private final ErrorHandler errorHandler;
private final MailServiceAsync service;
private String mailboxName;
... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/FolderController.java | Java | lgpl | 1,940 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.SerializableException;
public class FolderNotExistsException extends SerializableException {
private static final long serialVersionUID = 1L;
public FolderNotExistsException() {
super();
}
public FolderNotExistsException... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/FolderNotExistsException.java | Java | lgpl | 372 |
package org.teremail.client;
public interface ErrorHandler {
/**
* Show a message
*
* @param message
*/
void showMessage(String message);
}
| zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/ErrorHandler.java | Java | lgpl | 171 |
package org.teremail.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/TereMailClient.java | Java | lgpl | 3,856 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
public interface MailServiceAsync {
// String[] getFolders();
void getFolders(String mailbox, AsyncCallback<String[]> callback);
void getMessageSummaries(String mailbox, String folder, AsyncCallback<MessageSummary[]> async... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/MailServiceAsync.java | Java | lgpl | 432 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.TextArea;
public class MessageTextController {
private final TextArea view;
private final MailServiceAsync service;
private final ErrorHandler eh;
private String messageText;
pri... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/MessageTextController.java | Java | lgpl | 1,366 |
package org.teremail.client;
import java.io.Serializable;
public class MessageSummary implements Serializable {
private static final long serialVersionUID = 1649645381320609521L;
private int uid;
private String address;
private String subject;
private String date;
public MessageSumm... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/MessageSummary.java | Java | lgpl | 788 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.RemoteService;
public interface MailService extends RemoteService {
String[] getFolders(String mailbox) throws Exception;
MessageSummary[] getMessageSummaries(String mailbox, String folder) throws Exception;
String getMessage(St... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/MailService.java | Java | lgpl | 378 |
package org.teremail.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HTMLTable.CellFormatter;
/**
* Links the table containing the list of messages with the back end services.
* Resposible for handling updates to the m... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/client/SummaryController.java | Java | lgpl | 2,920 |
<html>
<head>
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Wrapper HTML for TereMailClient</title>
<!-- -->
<!-- Use normal html, such as style ... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/public/TereMailClient.html | HTML | lgpl | 2,308 |
package org.teremail.server;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
import javax.servlet.ServletException;
import org.teremail.ServerSingleton;
import org.teremail.client.MailService;
import org.teremail.client.MessageSummary;
import org.teremail.common.Log;
import org.te... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/server/MailServiceImpl.java | Java | lgpl | 5,550 |
package org.teremail.server;
import org.teremail.client.MailService;
import org.teremail.client.MessageSummary;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
public class MockMailServiceImpl extends RemoteServiceServlet implements
MailService {
private static final long serialVersionUID = ... | zzuoqiang-teremail | teremail-web/src/main/java/org/teremail/server/MockMailServiceImpl.java | Java | lgpl | 1,620 |
package org.teresoft.collections.concurrent;
public class ConcurrentHashTrieTest2 extends AbstractHashTrieTest {
protected ConcurrentHashTrie2<String, String> createMap() {
return new ConcurrentHashTrie2<String,String>(1024);
}
}
| zzuoqiang-teremail | commons/src/test/java/org/teresoft/collections/concurrent/ConcurrentHashTrieTest2.java | Java | lgpl | 252 |
/*
* Written by Cliff Click and released to the public domain, as explained at
* http://creativecommons.org/licenses/publicdomain
* Big Chunks of code shamelessly copied from Doug Lea's test harness which is also public domain.
*/
import java.util.Random;
import java.util.concurrent.ConcurrentHashMap;
im... | zzuoqiang-teremail | commons/src/test/java/perf_hash_test.java | Java | lgpl | 15,118 |
package org.teresoft;
public class Preconditions {
public static void checkNotNull(Object o, String message) {
if (o == null) {
throw new NullPointerException(message);
}
}
}
| zzuoqiang-teremail | commons/src/main/java/org/teresoft/Preconditions.java | Java | lgpl | 214 |
package org.teresoft.math;
public class Arithmetic {
//------------------ Utility --------------------------
/**
* Calculate the next power of 2, greater than or equal to x.<p>
* From Hacker's Delight, Chapter 3, Harry S. Warren Jr.
*
* @param x Value to round up
* @return The next p... | zzuoqiang-teremail | commons/src/main/java/org/teresoft/math/Arithmetic.java | Java | lgpl | 481 |
package org.teresoft.collections;
import static java.lang.Integer.bitCount;
import static java.lang.System.arraycopy;
import org.teresoft.Preconditions;
@SuppressWarnings({"unchecked", "rawtypes"})
public class HashTrie<K, V> implements Map<K, V> {
private static final HashTrie EMPTY = new HashTrie(null, 0);
... | zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/HashTrie.java | Java | lgpl | 10,961 |
package org.teresoft.collections;
import static java.lang.System.arraycopy;
import static java.util.Arrays.binarySearch;
import java.util.Collection;
import java.util.Map;
import java.util.Set;
public class LongBPlusTreeMap<T> implements Map<Long, T> {
private final int nodeSize;
private final Out<Object> o... | zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/LongBPlusTreeMap.java | Java | lgpl | 8,354 |
package org.teresoft.collections.concurrent;
import static java.lang.Integer.bitCount;
import static java.lang.System.arraycopy;
import static org.teresoft.math.Arithmetic.ceilingPowerOf2;
import java.util.AbstractCollection;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Iterator;
import... | zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/concurrent/ConcurrentHashTrie.java | Java | lgpl | 23,448 |
package org.teresoft.collections.concurrent;
import static java.lang.Integer.bitCount;
import static java.lang.System.arraycopy;
import static org.teresoft.math.Arithmetic.ceilingPowerOf2;
import java.util.AbstractCollection;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Iterator;
import... | zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/concurrent/ConcurrentHashTrie2.java | Java | lgpl | 25,831 |
package org.teresoft.collections;
public interface Map<K, V> {
V get(Object key);
Map<K, V> put(K key, V value, Out<V> holder);
Map<K, V> remove(K key, Out<V> holder);
}
| zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/Map.java | Java | lgpl | 195 |
package org.teresoft.collections;
public class Out<T> {
public T value;
}
| zzuoqiang-teremail | commons/src/main/java/org/teresoft/collections/Out.java | Java | lgpl | 79 |
Subject: [Fwd: Test Image]
From: Michael Barker <mbarker@buni.org>
To: tom@localhost
Content-Type: multipart/mixed; boundary="=-aqUdPSSJmLNPlfkFjcKR"
Date: Sun, 14 Jan 2007 13:13:12 +0000
Message-Id: <1168780392.4824.4.camel@corona>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.1
X-Evolution-Source: pop://mikeb01@p... | zzuoqiang-teremail | teremail-core/src/test/resources/single-image-multi.msg | omnetpp-msg | lgpl | 4,148 |
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Type: message/rfc822
MIME-Version: 1.0
X-Mailer: MIME::Lite 1.147 (B2.09; Q2.03)
Date: Tue, 6 Jun 2000 03:20:11 UT
From: user2
To: user0
Subject: Re: Fwd: hello world
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content... | zzuoqiang-teremail | teremail-core/src/test/resources/re-fwd.msg | omnetpp-msg | lgpl | 812 |
Subject: [Fwd: Test Image]
From: Michael Barker <mbarker@buni.org>
To: tom@localhost
Content-Type: multipart/mixed; boundary="=-aqUdPSSJmLNPlfkFjcKR"
Date: Sun, 14 Jan 2007 13:13:12 +0000
Message-Id: <1168780392.4824.4.camel@corona>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.1
X-Evolution-Source: pop://mikeb01@p... | zzuoqiang-teremail | teremail-core/src/test/resources/single-image-attached.msg | omnetpp-msg | lgpl | 5,780 |
Subject: [Fwd: Test Image]
From: Michael Barker <mbarker@buni.org>
To: tom@localhost
Content-Type: multipart/mixed; boundary="=-2+DeabYuUOigcABipoEQ"
Date: Sun, 14 Jan 2007 13:13:12 +0000
Message-Id: <1168780392.4824.4.camel@corona>
Mime-Version: 1.0
X-Mailer: Evolution 2.8.1
X-Evolution-Source: pop://mikeb01@p... | zzuoqiang-teremail | teremail-core/src/test/resources/single-image-inline.msg | omnetpp-msg | lgpl | 4,090 |
package org.teremail.schema;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
TableBuilderTest.class
})
public class SchemaTestSuite {
}
| zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/schema/SchemaTestSuite.java | Java | lgpl | 243 |
package org.teremail.message;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
ContentHeaderImplTest.class,
ContentStoreTest.class,
EntityVisitorTest.class,
MultipartEntityTest.class,
AddressParserT... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/message/MessageTestSuite.java | Java | lgpl | 398 |
/**
*
*/
package org.teremail.message;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import org.teremail.panto.BodyHeader;
import org.teremail.panto.ContentHandler;
class PrintContentHandler implements ContentHandler {
private String pad = "";
private int fie... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/message/PrintContentHandler.java | Java | lgpl | 2,213 |
package org.teremail.test;
public interface Assertion<E> {
public void check(E argument) throws Error, Exception;
}
| zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/test/Assertion.java | Java | lgpl | 122 |
package org.teremail.tx;
import java.sql.SQLException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transac... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/tx/SimpleTransaction.java | Java | lgpl | 2,359 |
package org.teremail.tx;
import java.sql.Array;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.NClob;
import java.sql.PreparedStatement;
import java.sql.SQLClientInfoException;
import java.sql.SQLException;
im... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/tx/DelegateConnection.java | Java | lgpl | 7,066 |
package org.teremail.tx;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.InvalidTransactionException;
import javax.transact... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/tx/SimpleTransactionManaer.java | Java | lgpl | 4,070 |
package org.teremail.delivery;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
DeliveryHandlerTest.class,
ExchangeImplTest.class
})
public class DeliveryTestSuite {
}
| zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/delivery/DeliveryTestSuite.java | Java | lgpl | 278 |
package org.teremail.delivery;
import org.easymock.EasyMock;
import org.easymock.IArgumentMatcher;
import org.teremail.test.Assertion;
public class EasyMockUtils {
public static <E> E argAssert(Assertion<E> assertion) {
EasyMock.reportMatcher(new ArgumentMatcher(assertion));
return null;
}
... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/delivery/EasyMockUtils.java | Java | lgpl | 1,084 |
package org.teremail.mailbox;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
import org.teremail.AllTests;
im... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/mailbox/AbstractMessageDAOTestCase.java | Java | lgpl | 6,182 |
package org.teremail.mailbox;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.teremail.mailbox.Path.path;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/mailbox/AbstractMailboxDAOTestCase.java | Java | lgpl | 10,368 |
package org.teremail.mailbox;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
ListsTest.class,
MailboxServiceTest.class,
PathTest.class,
H2MailboxDAOTest.class,
PGMailboxDAOTest.class,
H2Message... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/mailbox/MailboxTestSuite.java | Java | lgpl | 400 |
package org.teremail.mailbox;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.teremail.mailbox.Path.path;
import org.easymock... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/mailbox/AbstractCacheMailboxDAOTestCase.java | Java | lgpl | 4,020 |
package org.teremail.util;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
ThreadLocalCacheTest.class
})
public class UtilTestSuite {
}
| zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/util/UtilTestSuite.java | Java | lgpl | 244 |
package org.teremail;
import javax.sql.DataSource;
import org.postgresql.ds.PGSimpleDataSource;
import org.teremail.schema.Dialect;
import org.teremail.schema.PGDialect;
public class PGDBConfig extends AbstractDBConfig {
private String name;
private String user;
private String pass;
private int ... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/PGDBConfig.java | Java | lgpl | 946 |
package org.teremail;
import javax.sql.DataSource;
import org.h2.jdbcx.JdbcDataSource;
import org.teremail.schema.Dialect;
import org.teremail.schema.H2Dialect;
public class H2DBConfig extends AbstractDBConfig {
private final String url;
public H2DBConfig(String url) {
this.url = url;
}... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/H2DBConfig.java | Java | lgpl | 538 |
package org.teremail;
import javax.sql.DataSource;
import org.teremail.schema.Dialect;
public interface DBConfig {
Dialect getDialect();
DataSource getDataSource();
}
| zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/DBConfig.java | Java | lgpl | 179 |
package org.teremail;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import javax.sql.DataSource;
public abstract class AbstractDBConfig implements DBConfig {
private final FutureTask<DataSource> instance =
new FutureTask<DataSource>(new Callable<DataSource>() {
... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/AbstractDBConfig.java | Java | lgpl | 702 |
package org.teremail.store.paged;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Before;
import org.junit.Test;
public abs... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/store/paged/AbstractBlobFactoryTestCase.java | Java | lgpl | 2,814 |
package org.teremail.store;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Random;
import org.junit.Before;
import org.junit.Test;
public abstract... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/store/AbstractStoreTestCase.java | Java | lgpl | 2,540 |
package org.teremail.store;
import javax.sql.DataSource;
import org.junit.After;
import org.teremail.tx.SimpleTransactionManaer;
public abstract class AbstractTxTestCase extends AbstractStoreTestCase {
private SimpleTransactionManaer tm;
private DataSource ds;
protected abstract DataSource createDa... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/store/AbstractTxTestCase.java | Java | lgpl | 1,082 |
package org.teremail.store;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
import org.teremail.store.jdbc3.PGJDBC3StoreTest;
import org.teremail.store.paged.H2DBBlobFactoryTest;
import org.teremail.store.paged.H2DBPagedStoreTest;
import org.teremail.store.... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/store/StoreTestSuite.java | Java | lgpl | 544 |
package org.teremail;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
import java.util.Collection;
import javax.sql.DataSource;
import org.postgresql.ds.PGSimpleDataSource;
import org.teremail.schema.Table;
import org.teremail.util.DB;
public class DropA... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/DropAll.java | Java | lgpl | 1,628 |
package org.teremail.smtp;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
SMTPCommandParserTest.class,
HELOCommandTest.class,
EHLOCommandTest.class,
QUITCommandTest.class,
NOOPCommandTest.class,
... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/smtp/SMTPTestSuite.java | Java | lgpl | 588 |
package org.teremail.smtp;
import java.io.IOException;
import java.nio.charset.Charset;
import org.apache.mina.common.ByteBuffer;
import org.apache.mina.common.IoFilter;
import org.apache.mina.common.SimpleByteBufferAllocator;
import org.apache.mina.filter.LoggingFilter;
import org.apache.mina.filter.codec.ProtocolCo... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/smtp/ServerTestCase.java | Java | lgpl | 1,404 |
package org.teremail.smtp;
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.expect;
import java.util.HashMap;
import java.util.Map;
import org.apache.mina.common.IoSession;
import org.easymock.EasyMock;
import org.easymock.IAnswer;
import org.easymock.IMocksControl;
import com.goog... | zzuoqiang-teremail | teremail-core/src/test/java/org/teremail/smtp/SMTPTestUtil.java | Java | lgpl | 1,712 |
package org.teremail.schema;
/**
* Dialect imlementation for the Derby database.
*
* @author Michael Barker
*
*/
public class DerbyDialect extends AbstractDialect {
private final static DerbyDialect instance = new DerbyDialect();
private DerbyDialect() {}
public static Dialect getInstance(... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/DerbyDialect.java | Java | lgpl | 811 |
package org.teremail.schema;
public class Column {
private final String name;
private final DBType type;
private final boolean isPrimaryKey;
private final boolean isNullable;
public Column(String name, DBType type, boolean isPrimaryKey,
boolean isNullable) {
this.name = name;
... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/Column.java | Java | lgpl | 926 |
package org.teremail.schema;
public class ColumnBuilder {
private boolean isPrimaryKey = false;
private boolean isNullable = false;
private final String name;
private final DBType type;
public ColumnBuilder(String name, DBType type) {
this.name = name;
this.type = type;
}
... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/ColumnBuilder.java | Java | lgpl | 657 |
package org.teremail.schema;
/**
* Dialect interface used to handle the difference between various databases.
*
* @author Michael Barker
*/
public interface Dialect {
/**
* Return the string used in for an integer value in a create statement.
*
* @param precision
* @return
*/
... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/Dialect.java | Java | lgpl | 1,554 |
package org.teremail.schema;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import org.teremail.store.Strings;
public class Table {
private final String name;
private List<Column> columns;
private List<List<String>> uniques;
public Table(... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/Table.java | Java | lgpl | 2,787 |
package org.teremail.schema;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.sql.DataSource;
import org.teremail.common.Log;
import org.teremail.store.StoreException;
import org.teremail.util.DB;
public cl... | zzuoqiang-teremail | teremail-core/src/main/java/org/teremail/schema/Schema.java | Java | lgpl | 1,244 |