Skip to content

Instantly share code, notes, and snippets.

View Eugeny's full-sized avatar

Eugene Eugeny

View GitHub Profile
public <E extends Bean> List<E> getObjects() {
List<E> r = new ArrayList<E>();
Cursor cursor = this.db
.query(new E().getTable(), new String[] { "data", "id" }, null, null,
null, null, "id ASC");
if (cursor.moveToFirst()) {
do {
try {
E b = (E) this.DecryptObject(cursor.getString(0));
b.ID = cursor.getInt(1);
public abstract class Bean implements Serializable {
public abstract String getTable();
public int ID = 0;
}
public class ServerBean extends Bean {
private static final long serialVersionUID = 1L;
public String name = "New server";
@Override
public boolean onMenuItemClick(MenuItem arg0) {
Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.putExtra(android.content.Intent.EXTRA_STREAM, "file://" + t.data); // t.data starts with "/sdcard"
ctx.startActivity(Intent.createChooser(intent, "Share via"));
return false;
}
64 GB
[1] 200 Mb -> Ubuntu /boot
[2] 15 Gb -> Ubuntu /
[3] 15 Gb -> Windows C:
[4] 15 Gb reserved
[5] 15 Gb reserved
1 Tb
[1] 1 Tb -> Ubuntu /media/Data + Windows D:/
public abstract class Model<T>
public class Child extends Model<Child>
Child a = ...
a.getType().isAssignableFrom(Model.class) == false - WTF?
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.IO;
// Compiled from Dialog.java (version 1.5 : 49.0, super bit)
public class android.app.Dialog implements android.content.DialogInterface, android.view.Window$Callback, android.view.KeyEvent$Callback, android.view.View$OnCreateContextMenuListener {
// Method descriptor #12 (Landroid/content/Context;)V
// Stack: 3, Locals: 2
public Dialog(android.content.Context context);
0 aload_0 [this]
1 invokespecial java.lang.Object() [1]
4 new java.lang.RuntimeException [2]
7 dup
@Override
public void onBinded(IPlayerService svc, ServiceConnection conn) {
mConnection = conn;
mPlayer = svc;
try {
LinearLayout ll = (LinearLayout) findViewById(R.id.barcontainer);
min = mPlayer.getEqMinVal();
max = mPlayer.getEqMaxVal();
public class SearchAdapter extends ArrayAdapter<SearchResult> {
List<SearchResult> items;
private LayoutInflater inflater;
private ProgressDialog mBox;
private Context mContext;
public SearchAdapter(Context context, List<SearchResult> objects) {
super(context, R.layout.search_image_result, objects);
items = objects;