Posts

Showing posts from 2014

Webhost Phpmyadmin 4.1.8 Blank Page After Login

Just got this strange result of Phymyadmin 4.1.8 successful login return white/blank screen. If you do think already input the correct user and password of a database than simply reload the page and you will get the phpmyadmin panels working. Happy coding ^^

Android SQLite Example

 Stress out to find a good example of ` How to Android SQLite ` had leaded me to collect piece-by-piece. The result a working apk that uses SQLite as database. The example below is from |1| but with little changes MainActivity.java package com.example.webview2; import android.app.Activity; import android.content.ContentValues; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebView; import android.widget.Button; import android.widget.EditText; public class MainActivity extends Activity { // Constants public static final String DATABASE_NAME = "highscores.db"; public static final String HIGH_SCORE_TABLE = "highscore"; public static final String COLUMN_ID = "ID"; public static final String COLUMN_SCORE = "SCORE"; public static final String COLUMN_NAME = "NAME&q

Kivy 1.8.0 Python-for-Android Failed to Build Twisted module

Failed to built Twisted module in python-for-android ? Well you are in luck :D You  could try this command below: 1. you are on python-for-android root dir $ pwd /opt/phython-for-android Your python-for-android root could be somewhere but mine is located on /opt $ ./distribute -m "zope setuptools pkg_resources twisted" I found that at the end of the build virtualenv is being auto built and in my case it failed to build but we don't need it anyway. At this point i assume you are already successful to build twisted module. Have fun ^^

Linux Python 2.7.X Failed to Compile cmathmodule.c undefined reference to `_Py_log1p`

Compile Python 2.7.5 was never thought by me. As this article written i had to compile Python from scratch. Just to troubleshoot why Python-for-android `distribute.sh -m ``kivy``` failed to build. Here is the log: And found out that `_math.o` is required since where it has the _Py_log1p defined. I manually exec this compile and linker command as follow: $ pwd /opt/phython-for-android/build/python/Python-2.7.5 $ gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE  -c ./Modules/_math.c -o Modules/_math.o $ ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/zipimport.o  Modules/symtablemodule.o  Modules/arraymodule.o Modules/_math. _math.c  _math.h  _math.o $ ar rc libpython2.7.a Modules/threadmodule.o  Modules/signalmodule.o  Modules/posixmodule.o  Module

Linux XUbuntu 14.04 Unlocked My blocked Wifi

Wow! Yes XUbuntu 14.04 deserved it. My Lenovo Ideapad Y450 Laptop had its wifi lock bit set. Well it was locked by the technician whom repaired the charger IC. Lack of linux knowledge leaded the technician to use winOS to boot my laptop by simply replace the harddrive. Disabled the wifi by software and did not switch it back on. I've been using Fedora for about 7 years. In Fedora 20, i have no idea to switch it back on. Goggling and several trial and error had been attempted with no success. Okay, i dropped the case and no longer want to find out how to switch it back on since i have a free wifi modem and got it connect with cable therefor internet backs on! After using the Fedora 20 for a while i think my hardware had defected and leads to unstable operation. And the most of all is that my Chrome browser could not even stand out for 5 minutes. It crashes frequently and so the desktop ( XFCE4 ). Curious if it is really hardware problem, i download the Chromium browser

Linux: Clear all Logs

Found this answer to clear all logs in my /var/log/* Really save my day, thank you

PHPExcel Max Rows 65356 Problem

PHPExcel to generate *.xls file with list of data around 140K rows but limited to only showing 65356 (~65K) rows per worksheet/sheet. Are you having the same problem like me? If you are, then simply split the data to multiple sheets. Lets say i have 140K of data then split the datas to 3 worksheets. Done? Not quite. I had tried to implements the workaround to split the datas but the loading process of the data, it pop-up a dialog with error message in microsoft-office while other office application don't, then blank multiple sheets. If you set the name for each sheet then you will see that the sheets are succesful renamed or set to desired name. How come? well i do not have the exact answer but after some trials and errors, i come up with 39999 (~39K) rows max for each sheet. And everything works as expected. After i set the data to 300K and split the datas to multiple sheets with ~39K rows per sheet, all the data generated and shown as expected. So the real max rows

Linux Remote Desktop Without Login

Remote Desktop options already set allow to connect and password is set. But whenever you reboot and try to connect, you only see black screen. Well you need to install tigervnc-server . I am using Fedora then $ sudo yum install tigervnc-server Edit /etc/sysconfig/vncservers to your desire, but keep in mind that: 1. Make sure the setting of  `1` then [1]  should match. 2. Check using ps -ef | grep vnc, and find rfbport 590X.     where X shud match your configuration 3. If you set to config 1:yourusername then the rfbport will be     5900 + 1 => rfbport 5901, where 5900 is the standard port of vnc 4. Similar to #3 if you set config 2:othername then the rfbport will be     5900 + 2 => rfbport 5902 5. When you try to connect do not forget to specify to which port you     are trying to connect. IP:PortNumber, 192.168.0.1:5901.     If no port specified then default port to be connected is 5900 6. Check your firewall, make sure it allows connection to tcp with     de

CI 2.1.2 Profiler shows Warning at line 509, expected string got Object

Just want to note what i just found a bug of CI 2.1.2 in system/library/Profiler.php. Where the $val is not evaluated to is_object and only expecting is_string() or is_array(). With no validation of is_object() the profiler triggers warning and it is ugly :D Adding validation is_object() would fixed the warning. at line 509: Current: if (is_array($val) ) { $val = print_r($val, TRUE); } Patched: if (is_array($val) or is_object( $val)) { $val = print_r($val, TRUE); }

JAVASCRIPT KeyPress Return Modified KeyCode

Streesss.. yup trying to solve a problem, that everytime a user hit single or double quote inside input or textarea the keyCode should be return ` or `` respectively. Googling and found: 1.  Dispatching Custom Event 2.  Clever get cursor and insert char Solution The #2 is my best solution. Also learn new stuf with #1. This is a short article but will found very useful with the links. Keep coding.

LXDE Screenshot

Migrating from Gnome3 to LXDE  is so much fun! Experiencing lightweight desktop. But hitting my PrtSc  resulting no respon... What? Argghh i have to added manually. The keybinding of PrtSc to LXDE. Calm down.. it wont hurt you anyway. Here is the How-to: 1. $ sudo yum install -y scrot 2. create a bash-script then copy-paste and name it screenshot.sh #!/bin/bash scrot '%Y-%m-%d%H:%M:%S_scrot.png' -e 'mv $f /home/adesanto/Pictures' 3. $ sudo chmod a+x screenshoot.sh 4. Copy the script to /usr/local/bin/screenshot.sh 5. Add this code into ~/.config/openbox/lxde-rc.xml             screenshot.sh     6. $ openbox --reconfigure For additional feature i would like to have a click or snap sound whenever my PrtSc button got hit/press. Edit the screenshot.sh to scrot '%Y-%m-%d%H:%M:%S_scrot.png' -e 'mv $f /home/adesanto/Pictures' && paplay /opt/android-sdk-linux/samples/android-13/AccessibilityService/res/raw/sound_view_clicked.ogg

LXDE, Lightweight Desktop. Touchpad Tap to be Disabled

My installed Fedora 19  is shipped with Gnome3  as default desktop, actually i downloaded the installer which Gnome3 default. The experiences learned that most of the applications run kinda unstable and specially when my system wake-up from sleep or hibernation. My frequent applications are: 1. GVim 2. Chrome (browser) 3. sqldeveloper 4. Terminal 5. Skype 6. Empathy Whenever the Sqldeveloper runs the problem starts to rise. The Gnome-shell could hit to 430MB++, sqldeveloper usually hits around 400MB++, and the other applications shrink my 4GB memory to +-700MB free left. Lucky to me to drop Eclipse as primary IDE/Editor, usually takes around 500MB++. Browsing on the net returned me with Cinnamon as lightwright desktop, but hummm... wait. Somebody talks about LXDE , glorius victory! I just punch the keyboard straight $ sudo yum -y install @lxde Hurrayy! But wait.. my touchpad seems to sensitive. Setting using Keyboard/Mouse at Prefferences does not help to reduce the

Fedora 19 Gnome Synaptics Vertical Edge Scroll Permanently

Hi, just playing around and accidentally delete my ~/.config ~/.gnome and ~/.gnome2. All my settings are reset and my touchpad no longer be able to vertical edge scrolling . Googling with a little light pointing me to do $ man synaptics.  The manual page was like hieroglyph but re-read over and over again earned me some of knowledge to set some of the synaptics properties. So here is my ~/.profile , i added 2 lines of the properties at the end of the file xinput --set-prop "SynPS/2 Synaptics TouchPad" "Synaptics Edge Scrolling" 1 1 0 As the manual says: Synaptics Edge Scrolling               8 bit (BOOL), 3 values, vertical, horizontal, corner where the "1 1 0" meaning Vertical "on", Horizontal "on", Corner "off". Happy scrolling ^^

Linux Gnome Login to Black Screen and Loop

Arghh... Linux Gnome Login to Black Screen and Loop . Something gone wrong and i do not know what caused the loop . The ~/.xsession-errors shows: [2350:2350:3195506791:ERROR:chrome_browser_main_x11.cc(62)] X IO Error detected thunderbird12: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0. gnome-panel: Fatal IO error 0 (Success) on X server :0.0. thunderbird12: Fatal IO error 2 (No such file or directory) on X server :0.0. exe: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0. exe: Fatal IO error 2 (No such file or directory) on X server :0.0. XOpenDisplay() failed gnome-power-manager: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0. ** (gnome-power-manager:1850): WARNING **: Failed to send buffer ** (gnome-power-manager:1850): WARNING **: Failed to send buffer The application 'gnome-power-manager' lost its connection to the display :0.0; most likely the X server was shut down or you killed/destroye

USBAspLoader with Atmega16A-PU Atmega16 Atmega32A-PU Atmega32

Image
Running USBAspLoader atmega8A-16PU with no problem. It was a very victorious moment. Since i am a newbie in micro-controller. Began with a little conversation in the electronic group. That somebody has a problem to get the USBAspLoader run in atmega16. Thanks to him, i encouraged myself to fork the source code at github  and succeeded. Here are the steps to setup everything to work (well i works in my case): 1. Clone or Download the code from the github . 2. The Makefile.inc already set the target MCU to atmega16 with xtal 16MHz 3. Plugin your ISP ( i use my cloned arduino as ISP) 4. Modify Makefile.inc if necessary to match-up your programmer.     ( i use avrdude and notice i have set the -P /dev/ttyACM0, modfiy       to match yours) 5. Goto the directory above firmware directory.     $ make fuse     $ make flash 6. At the hardware site make sure to arrange the 2 capacitors as described in      the schematic. As you could noticed, the schematic

Linux Eagle 6.5.0 missing libssl.so.1.0.0 and libcrypto.so.1.0.0 How to

Image
So excited to know the popular Eagle CAD an Electronic Design Automation tool is available in Linux . So got it download from cadsoftusa freeware . I am running Fedora 19 64bit Kernel is 3.11.10-200.fc19.x86_64. The eagle CAD is pre-compiled, so executed with $ ~/eagle-6.5.0/bin/eagle It throw error that libssl.so.1.0.0 not found . I have made sure that OpenSSL is installed. Why it could not found the shared library. $ locate libssl /usr/lib/.libssl.so.1.0.1e.hmac /usr/lib/.libssl.so.10.hmac /usr/lib/libssl.so.1.0.1e /usr/lib/libssl.so.10 /usr/lib64/.libssl.so.1.0.1e.hmac /usr/lib64/.libssl.so.10.hmac /usr/lib64/libssl.so.1.0.1e /usr/lib64/libssl.so.10 Ahah! The solution is simple, just create a new symlink foreach lib and lib64: # cd /usr/lib # ln -s  /usr/lib/libssl.so.10 /usr/lib/libssl.so.1.0.0 # ln -s  /usr/lib/libcrypto.so.10 /usr/lib/libcrypto.so.1.0.0 # cd /usr/lib64 # ln -s  /usr/lib/libssl.so.10 /usr/lib/libssl.so.1.0.0 # ln -s  /usr/lib/libcrypto.s

Linux AVR-CDC ttyACM Open and Close by modem-manager

Image
Got stuck with my avr-cdc device detected as ttyACM. Ever since my kernel upgraded to 3.11.10-200.fc19.x86_64 the modem-manager takes place and keep restarting my avr-cdc. I ended up stuck unable to upload any sketch to my arduino. After googling for about an hour to find proper way to disable the modem-manager, no luck. Ok, i will do it my way. Simply rename the modem-manager in /usr/sbin/modem-manager to modem-manager-removed and kill the process. Ahah! It never restart anymore since the kernel could not find the modem-manager application anymore. Playing with my arduino with no problem :D