Skip to content

Instantly share code, notes, and snippets.

@huttneab
huttneab / ContentProvider.java
Created September 26, 2012 18:54
the original openFileMethod of my content provider and the two alternate methods I use instead
// including the imports to for the sake of the io objects
import info.guardianproject.database.sqlcipher.SQLiteDatabase;
import info.guardianproject.database.sqlcipher.SQLiteQueryBuilder;
import info.guardianproject.iocipher.File;
import info.guardianproject.iocipher.FileInputStream;
import info.guardianproject.iocipher.FileOutputStream;
import info.guardianproject.iocipher.VirtualFileSystem;
@huttneab
huttneab / first error
Created September 27, 2012 19:52
stacktrace
09-27 15:22:20.072: I/WorkingMessage(30595): ##### send #####
09-27 15:22:20.072: I/WorkingMessage(30595): mConversation (beginning of send): [419-351-9133] (tid 20)
09-27 15:22:20.072: I/WorkingMessage(30595): recipientsInUI: 419-351-9133
09-27 15:22:20.312: I/Posix(30595): path: /app_parts/PART_1348773740321 c2 600
09-27 15:22:20.312: I/Posix(30595): sqlfs_proc_create
09-27 15:22:20.312: D/SecureComMmsProvider(30595): creating new part file: /app_parts/PART_1348773740321
09-27 15:22:20.352: I/SecureComMmsProvider(30595): returning file output stream for: /app_parts/PART_1348773740321 and uri: content://com.gryphn.providers.securecommmsprovider/part/69
09-27 15:22:20.352: I/Posix(30595): path: /app_parts/PART_1348773740321 241 600
09-27 15:22:20.352: I/Posix(30595): sqlfs_proc_open
09-27 15:22:20.352: D/PduPersister(30595): is mounted: true
@huttneab
huttneab / databasehelper.java
Created March 8, 2013 14:54
gist from modified smsmmsdatabasehelper
private SecureComMmsSmsDatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
mContext = context;
initializePassword();
}
public void initializeWithPassword(String password){
if (mPassword == null) {
mPassword = new char[128];
public class PasswordUtils {
private static final String TAG = "PasswordUtils";
private static boolean mScreenIsLocked = false;
private static PasswordUtils mInstance = null;
// private static KeyCachingService keyCachingService;
private static Context mContext;
private PasswordUtils(Context context) {
@Override
public void onClick(View v) {
String password1 = mPass1View.getText().toString();
if (mIsFirstTime) {
String password2 = mPass2View.getText().toString();
if (password1.equals(password2)) {
RKEntityMapping *mapping = [RKEntityMapping mappingForEntityForName:@"conversation" inManagedObjectStore:managedObjectStore];
mapping.identificationAttributes = @[@"identifier"];
[mapping addAttributeMappingsFromDictionary:@{
@"@metadata.identifier" : @"identifier"
}];
[mapping addPropertyMapping:[RKRelationshipMapping relationshipMappingFromKeyPath:@"members" toKeyPath:@"otherUsers" withMapping:[self profileObjectMapping:managedObjectStore]]];
require 'test_helper'
class Api::V1::RegistrationControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
include Devise::TestHelpers
class City < ActiveRecord::Base
scope :city_roulette, to_a
scope :find_cities, ->(timezone) {where(timezone:timezone)}
end
04-14 12:24:58.425 5973-6015/com.ridecharge.android.taximagic E/com.ridecharge.android:ZoneMessageCommand﹕ org.json.JSONException: Unterminated object at character 118 of {"zone_messages":[{"zone_message":{"id":154,"title":"TEST","message":"","message_html":"<html>\n<head>
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-6.newrelic.com","errorBeacon":"jserror.newrelic.com","licenseKey":"d054b3ad77","applicationID":"1643760","transactionName":"dV9aQ0VeXghUFkoQBERGXVRSQh0QUBwMPAxXV11UaF1dB1AQDAwPGUpbWVJuXwFCFwQEBEU=","queueTime":0,"applicationTime":241,"ttGuid":"","agentToken":null,"agent":"js-agent.newrelic.com/nr-380.min.js"}</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function t(n,e,o){function r(a){if(!e[a]){var i=e[a]={exports:{}};n[a][0].call(i.exports,function(t){var e=n[a][1][t];return r(e?e:t)},i,i.exports,t,n,e,o)}return e[a].exports}for(var a=0;a<o.length;a++)r(o[a]);return r}({D5DuLP:[function(t,n){function e(t,n){var e
04-14 12:24:58.425 5973-6015/com.ridecharge.android.taximagic E/com.ridecharge.android:ZoneMessageCommand﹕ org.json.JSONException: Unterminated object at character 118 of {"zone_messages":[{"zone_message":{"id":154,"title":"TEST","message":"","message_html":"<html>\n<head>
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-6.newrelic.com","errorBeacon":"jserror.newrelic.com","licenseKey":"d054b3ad77","applicationID":"1643760","transactionName":"dV9aQ0VeXghUFkoQBERGXVRSQh0QUBwMPAxXV11UaF1dB1AQDAwPGUpbWVJuXwFCFwQEBEU=","queueTime":0,"applicationTime":241,"ttGuid":"","agentToken":null,"agent":"js-agent.newrelic.com/nr-380.min.js"}</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function t(n,e,o){function r(a){if(!e[a]){var i=e[a]={exports:{}};n[a][0].call(i.exports,function(t){var e=n[a][1][t];return r(e?e:t)},i,i.exports,t,n,e,o)}return e[a].exports}for(var a=0;a<o.length;a++)r(o[a]);return r}({D5DuLP:[function(t,n){function e(t,n){var e