Skip to content

Instantly share code, notes, and snippets.

View melvincabatuan's full-sized avatar
💭
deep learning

Melvin Cabatuan melvincabatuan

💭
deep learning
View GitHub Profile
@melvincabatuan
melvincabatuan / [Solved] exception
Created August 27, 2014 07:26
TOP-LEVEL EXCEPTION
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/home/cobalt/Android/adt-bundle-linux-x86-20131030/sdk/build-tools/19.1.0/dx --dex --num-threads=4 --output /home/cobalt/AndroidStudioProjects/DespairSQLite/app/build/intermediates/dex/debug /home/cobalt/AndroidStudioProjects/DespairSQLite/app/build/intermediates/classes/debug /home/cobalt/AndroidStudioProjects/DespairSQLite/app/build/intermediates/dependency-cache/debug /home/cobalt/AndroidStudioProjects/DespairSQLite/app/build/intermediates/pre-dexed/debug/sqliteassethelper-2.0.1-9c943fd7e171bcdd66f285e125cf9ef8a754cf63.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/readystatesoftware/sqliteasset/SQLiteAssetHelper$SQLiteAssetException;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
@melvincabatuan
melvincabatuan / [Solved] Null Pointer Exception
Created August 27, 2014 08:54
Null Pointer Exception caused by using ListActivity instead of plain Activity
08-27 16:29:03.320 10545-10545/com.cabatuan.despairsqlite E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cabatuan.despairsqlite/com.cabatuan.despairsqlite.Main}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
@melvincabatuan
melvincabatuan / IndexOutOfBoundsException
Created August 27, 2014 15:04
IndexOutOfBoundsException
08-27 23:02:53.320 16218-16218/com.cabatuan.despairsqlite E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cabatuan.despairsqlite/com.cabatuan.despairsqlite.Main}: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 2
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
@melvincabatuan
melvincabatuan / [Solved] Mismatch
Last active August 29, 2015 14:05
SQLite Mismatch
08-28 09:08:04.461 27514-27514/com.cabatuan.ecequiz D/dalvikvm﹕ Late-enabling CheckJNI
08-28 09:08:04.651 27514-27514/com.cabatuan.ecequiz W/SQLiteAssetHelper﹕ copying database from assets...
08-28 09:08:04.661 27514-27514/com.cabatuan.ecequiz W/SQLiteAssetHelper﹕ database copy complete
08-28 09:08:04.671 27514-27514/com.cabatuan.ecequiz I/SQLiteAssetHelper﹕ successfully opened database ECEQuiz
08-28 09:08:04.701 27514-27514/com.cabatuan.ecequiz D/TextLayoutCache﹕ Using debug level: 0 - Debug Enabled: 0
08-28 09:08:04.741 27514-27514/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLES_android.so
08-28 09:08:04.761 27514-27514/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libEGL_adreno200.so
08-28 09:08:04.771 27514-27514/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_adreno200.so
08-28 09:08:04.791 27514-27514/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLESv2_adreno200.so
08-28 09:08:04.871 27514-27514/com.cabatuan.ecequiz D/OpenGLRenderer﹕ Enablin
@melvincabatuan
melvincabatuan / CloseDatabase
Created August 28, 2014 02:43
Application did not close the cursor or database object
08-28 09:59:12.201 28554-28554/com.cabatuan.ecequiz D/OpenGLRenderer﹕ Flushing caches (mode 0)
08-28 09:59:15.701 28674-28674/com.cabatuan.ecequiz I/SQLiteAssetHelper﹕ successfully opened database MATH
08-28 09:59:15.721 28674-28674/com.cabatuan.ecequiz D/TextLayoutCache﹕ Using debug level: 0 - Debug Enabled: 0
08-28 09:59:15.771 28674-28674/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLES_android.so
08-28 09:59:15.771 28674-28674/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libEGL_adreno200.so
08-28 09:59:15.781 28674-28674/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_adreno200.so
08-28 09:59:15.781 28674-28674/com.cabatuan.ecequiz D/libEGL﹕ loaded /system/lib/egl/libGLESv2_adreno200.so
08-28 09:59:15.831 28674-28674/com.cabatuan.ecequiz D/OpenGLRenderer﹕ Enabling debug mode 0
08-28 10:03:56.711 28674-28674/com.cabatuan.ecequiz D/OpenGLRenderer﹕ Flushing caches (mode 0)
08-28 10:04:00.411 28792-28792/com.cabatuan.ecequiz I/SQLiteAssetHelper﹕ successfully
@melvincabatuan
melvincabatuan / SQLiteInsertRecordCommand
Created August 29, 2014 00:20
SQLite Insert Record Command Set Sample
INSERT INTO 'questions' VALUES(2,'A rectangular parallelepiped has dimensions 5 in. x 0.5 yard x 8 cm. What is the volume of this solid in cubic centimeters?','4645.2 cu. cm','3156.8 cu. cm','4899.1 cu. cm', '6585.5 cu. cm');
INSERT INTO 'questions' VALUES(3,'What is the volume of a cylinder if the radius of the circle is 5 in and the height is double its radius?','12,870 cu. cm','8,245 cu. cm','6,450 cu. cm', '14,560 cu. cm');
INSERT INTO 'questions' VALUES(4,'A standard Olympic pool has dimensions 50 m long, 8 m wide and 1.5 m deep. How many liters of water can it hold when it is full?','600,000 liters','50,000 liters','60,000 liters', '500,000 liters');
INSERT INTO 'questions' VALUES(5,'Find the 15th term in the arithmetic sequence 1, 3, 5, 7, ...','29','25','27','31');
INSERT INTO 'questions' VALUES(6,'What is the sum of the infinite series 1, -1/5, 1/25, ...','5/6','4/5','5/7','6/7');
@melvincabatuan
melvincabatuan / TruthTable.java
Created September 9, 2014 00:48
Truth Table Demo
package com.dismath.truthtable;
public class TruthTable {
public static void main(String[] args) {
boolean p, q;
System.out.println("**********************************************");
System.out.println(" p \t q \t AND \t OR \t XOR \t NOT_p");
System.out.println("**********************************************");
~/opencv/build$ cmake -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_IPP=OFF -D WITH_QT=4 -D CMAKE_INSTALL_PREFIX=/usr ..
-- The CXX compiler identification is GNU 4.8.1
-- The C compiler identification is GNU 4.8.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
@melvincabatuan
melvincabatuan / OpenCV Install
Last active August 29, 2015 14:07
Successful OpenCV Install
$ sudo make && sudo make install
$ sudo make && sudo make install
[ 4%] Built target libwebp
[ 4%] Built target opencv_core_pch_dephelp
[ 4%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
[ 4%] Built target pch_Generate_opencv_core
Scanning dependencies of target opencv_core
[ 4%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
@melvincabatuan
melvincabatuan / Akaze Test Issue
Created October 5, 2014 03:01
[SOLVED] Akaze Test Issue in OpenCV 3.0
~/Documents/OpenCV/test_kaze_akaze_opencv/build$ cmake ..
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info