Skip to content

Instantly share code, notes, and snippets.

View brodybits's full-sized avatar

Chris Brody brodybits

View GitHub Profile
@brodybits
brodybits / Android-SQLCipher-MultiThreadReadWriteTest-crash-log.txt
Created May 29, 2015 16:51
Full output of Android SQLCipher MultiThreadReadWriteTest that crashed with net.sqlcipher.database.SQLiteMisuseException: library routine called out of sequence
NOTE: this is for https://github.com/sqlcipher/android-database-sqlcipher/issues/176
===
I/Zetetic ( 6187): Running test:Multi-threaded read/write test
I/net.zetetic.sqlcipher.test( 6187): Unicode (ICU) Test - success:true
I/MultiThreadReadWriteTest( 6187): Starting writer thread 0
I/MultiThreadReadWriteTest( 6187): Starting writer thread 1
I/MultiThreadReadWriteTest( 6187): Starting writer thread 2
I/MultiThreadReadWriteTest( 6187): Starting writer thread 3
I/MultiThreadReadWriteTest( 6187): Starting writer thread 4
I/MultiThreadReadWriteTest( 6187): Starting writer thread 5
@brodybits
brodybits / Android-SQLCipher-MultiThreadReadWriteTest-sample-DatabaseObjectNotClosedException-errors-log.txt
Created May 29, 2015 16:59
Partial output of Android SQLCipher MultiThreadReadWriteTest that crashed, with some DatabaseObjectNotClosedException errors
NOTE: this is for https://github.com/sqlcipher/android-database-sqlcipher/issues/176
===
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:223, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:193, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:224, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:194, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:225, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 2 - record:226, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:195, a:one for the money b:two for the show
I/MultiThreadReadWriteTest( 6187): reader thread 1 - record:196, a:one for the money b:two for the show
@brodybits
brodybits / README.txt
Created July 12, 2016 13:45
Proposal: fix SQLITE_OMIT_FLOATING_POINT for SQLite 77c692a6 (trunk)
If I build SQLite 77c692a6 (trunk) with CFLAGS="-DSQLITE_OMIT_FLOATING_POINT"
I get a bunch of errors. Here is a patch in 3 parts that would fix this issue:
* SQLite-77c692a6-double-fix-part-1.diff - fix sqlite.h.in to use a proper
typedef to define a new sqlite_double typedef instead of using a macro
to overwrite double
* SQLite-77c692a6-double-fix-part-2.diff - fix other headers to use
the new sqlite_double typedef instead of double
@brodybits
brodybits / A-simple-case-for-JavaScript-closures.txt
Last active November 2, 2016 10:55
A simple case for JavaScript closures
CREDIT FOR INSPIRATION:
http://www.w3schools.com/js/js_function_closures.asp
ORIGINAL PURPOSE:
This is to help address a Flow Based Programming discussion comment at:
https://groups.google.com/d/msg/flow-based-programming/SckVpqE5IZM/ldeBRp5hAwAJ
The W3 schools sample above presents an easy to understand explanation of
@brodybits
brodybits / cpp_utf8_utf16.cpp
Created November 9, 2017 17:07 — forked from gchudnov/cpp_utf8_utf16.cpp
C++ string conversion UTF8 <-> UTF16
#include <string>
#include <locale>
#include <codecvt>
//UTF-8 to UTF-16
std::string source;
//...
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>,char16_t> convert;
std::u16string dest = convert.from_bytes(source);
@brodybits
brodybits / HelloCovariance.java
Created December 11, 2017 03:25 — forked from AlainODea/HelloCovariance.java
Exception in thread "main" java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class HelloCovariance {
public static void main(String[] args) {
ConcurrentHashMap<String, String> properties = new ConcurrentHashMap<>();
Set<String> keySet = properties.keySet();
}
}
@brodybits
brodybits / executeSqlBridgeForPhonegapSQLitePlugin.js
Last active January 4, 2018 15:44 — forked from orbitaloop/executeSqlBridgeForPhonegapSQLitePlugin.js
executeSql Bridge For ORIGINAL @davibe PhonegapSQLitePlugin ONLY (because there are some differences between the WebSQL API and the ORIGINAL @davibe plugin)
/* to use WebSQL or the SQLite plugin (https://github.com/davibe/Phonegap-SQLitePlugin) with the same function) */
executeSqlBridge: function(tx, sql, params, dataHandler, errorHandler) {
var self = this;
if (typeof self.db.dbPath !== 'undefined') {
//Native SQLite DB with phonegap : https://github.com/davibe/Phonegap-SQLitePlugin/
//this is a native DB, the method signature is different:
var sqlAndParams = [sql].concat(params);
var cb = function(res) {
@brodybits
brodybits / howto-filemerge-git-osx.md
Created August 3, 2018 04:56 — forked from bkeating/howto-filemerge-git-osx.md
HOWTO: Using FileMerge (opendiff) with Git on OSX

HOWTO: Using FileMerge (opendiff) with Git on OSX

FileMerge (opendiff) can really come in handy when you need to visually compare merging conflicts. Other times it's just a nice visual way to review your days work.

The following method works by creating a simple bash script (git-diff-cmd.sh) that sets us up with the proper command line arguments for Git to pass off files to FileMerge.

@brodybits
brodybits / android-emulator-homebrew.sh
Last active April 5, 2021 06:09 — forked from spilth/android-emulator-homebrew.sh
Android Emulator with Homebrew
# Recommended prerequisites:
# - Xcode is installed
# - Homebrew is installed - I am using a custom subdirectory as described in:
# - https://superuser.com/questions/1336025/how-should-i-install-homebrew-into-usr-local-subdirectory-manually
# - OpenJDK 8 is installed - here are a couple recommended resources:
# - https://apple.stackexchange.com/questions/349465/how-can-i-upgrade-from-oracle-jdk-8-to-openjdk-8-using-homebrew
# - https://dzone.com/articles/install-openjdk-versions-on-the-mac - good but shows formulae that I did not see
# - brew doctor does not show any issues
# I think this is not needed any more: