Sketchbook app for Android
I have a Samsung Galaxy Note II. As you may already know, it has a big screen and the fact that it comes with a note taking app made by Samsung (I think) makes it very useful to jot down ideas, doodle, etc. I, however, wondered if there was an app that would facilitate doodling even more - a Photoshop caliber doodling app, if you will. Thus, began my search for a graphic program.
I tried the Sketchbook Express app and fell in love with it. It's a bit limiting but you get an idea of what the paid version can do. I like the way the UI works, too. It doesn't have any menus or anything visible on the screen - just a dot at the bottom. You tap the dot and out pop all tools. It has all sorts of brushes, color picker, the eye-dropper, etc. You can make a custom brush if preset ones don't meet your needs.
After fiddling with the free version, I decided to get the paid version of the app (which was for $2.13 with taxes when I bought it). I am not an artist but after messing with the free and paid versions, I was able to draw these images.
This picture took me 2-3 hours on the free version:

I started making this one in the free version and completed it in the paid version (took me 3 weeks to complete - a few minutes here, a few minutes there):

Just to be safe: No one is allowed to use these images without my written permission.
A second look at MariaDB
After my last post on MariaDB, I installed it and played around with it. It really is a project that was forked from MySQL some time ago since MySQL is increasingly becoming closed source. There is another fork of MySQL called Drizzle, which claims that they have made the database faster by removing chunks from the code that were not relevant to web related queries.
The reason I was very excited about MariaDB is that it claims to be a hybrid of RDBMS and noSQL philosophies. However, their stable version (5.5 as of this post) lacks proper support for noSQL queries. It supports noSQL through something people at MariaDB call "dynamic columns". The dynamic columns work as intended if you use numeric keys for your column names. However, if you use alphabetical keys, you can have just one column. If you try to add multiple keys, it will error out. If you try to add more keys using an update statement, it will replace the key you had before.
All hope is not lost, though. They do have a version (10.0.1 as of this post) which worked properly in my tests but it is in alpha stage and it will be some time before it becomes stable. If you are not looking for a noSQL solution the latest stable version is still great. It has percona's proprietary engine (Xtradb) which is a better implementation of InnoDB, a better MyISAM engine, etc.
MariaDB – A better replacement for MySQL?
A friend of mine mentioned that Suse and another Linux distribution were going to switch from MySQL to MariaDB. So I got curious and looked at it. According to their website, it is a drop-in replacement for MySQL. You can uninstall MySQL, install MariaDB and things will just work. No need to change any code.
The thing that impressed me about MariaDB is that they have XtraDB engine (among other engines not available in MySQL) which is supposed to be a better implementation of InnoDB. Percona offers it for MySQL if you buy their services. So, I was glad to see that it is being packaged with MariaDB. For those of you who want to try out document based databases like MongoDB, CouchBase, etc. MariaDB supports document based database engines too. So you can have an relational database and an document/object database in one server.
I found out about MariaDB not that long ago. So, I have yet to explore all the things it can and cannot do. But, if all of these features make you curious, you can head over to their website (https://mariadb.org) to learn more.
The new light sensor
In my last post, I spoke about creating a light sensing "widget" that I could attach to my projects. I used a 10k resistor and was reading the light readings off of the analog pin on Arduino. However, I noticed that attaching an LED to the circuit was throwing the readings way off.
so, I found another way of calculating brightness. I found this article which talked about using a capacitor attached to the photocell which is in turned attached to a digital pin on Arduino. I was able to attach an LED without throwing off my readings a lot. While I was making these modifications, I also decided to make some other improvements (like getting an LED holder to hold my power indicator)
Here's a pic:

If you guys are looking for an informative tutorial on how to use a photocell, I found this article very helpful: http://learn.adafruit.com/photocells/using-a-photocell
Light sensor for Arduino
Okay, I know this is not rocket science. All you do is hook up a photocell to a resister and hook that up to Arduino. Viola! you have a light sensor. I wanted to create a modular light sensor I could attach / detach from projects so I took a container of Airborne and put my sensing circuit in there. Here are a few pics:
I do have a problem with the readings this gives me though. I went the analog route and tried to get readings off it from the analog pin. It gives me random readings. So, I am thinking that maybe attaching a capacitor and using a PWM pin is probably the answer. Do any of you have any experience with this? Please contact me if you do.




Wirelessly controlling Arduino
After I got my curtains open/close from my computer, I wanted to be able to do things wirelessly so I didn't have to go to my computer every time I wanted to switch my fan on or open and close my curtains.
If you don't want to get the XBee wireless module for Arduino (which is expensive if you ask me), you can control your Arduino through an RF receiver and transmitter. I had an old cheap remote controlled car laying around so I took out the RF receiver from the car and attached it to Arduino. The RF receiver board had 4 data wires, and 2 power wires (positive and ground).
I attached the board to Arduino's 3.3v, ground and PWM pins, and read the signals sent by the RF receiver board when the remote was at normal state and when I pressed a button. Then using those values, I wrote a program to turn the relay on/off. If you don't already have a cheap remote controlled car or can't get one for less than 10 dollars, then you can buy RF receiver and transmitter from sparkfun.com.
Here is a video of me controlling my fan through the remote. I can also control it from my computer.
Here's a picture of the car I destroyed for my project:
Here's the RF receiver I took out of the car and soldered wires to:
My adventures with Arduino
About two month ago, someone I know told me about this micro-controller called Arduino that can be used to make some cool things. So, I started experimenting with it and I have to say it really is very cool. You can make robots with it, control your lights, open or close your curtains, etc. The possibilities are endless. Since then, I have been playing around with it.
Over this weekend, I tried getting it to open and close my curtains. I was half successful. I can get it to close but opening it is a problem because the rope gets tangled. Here is a video of the curtain closing (and stopping mid way)
Here's a video of the fan being controlled from my computer:
Copying tables in MySQL
There are multiple ways this can be done. I will mention two here.
Method 1
In MySQL, run these statements:
/*This will create table2 with the schema of table1*/ CREATE TABLE `table2` LIKE `table1` /*This will copy the data from table1 to table2*/ INSERT INTO `table2` SELECT * FROM `table1` |
Method 2
On the command line, run these commands:
# Create a dump from MySQL. # The -d flag will only copy the structure/schema of the tables. If you want # to copy the data along with the schema then dont use -d flag # # In here, two MySQL commands are piped so the output from mysqldump is sent # to mysql command mysqldump -d -u username -pPassword db_name | mysql -u username -pPassword db_new_name |
Get just the fields names of a table in MySQL
If you do:
DESCRIBE `table_name` |
Mysql will give you table information which will contain field names, their types, etc. What if you want just the field names and nothing else? You can run this query and do just that:
SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tablename' AND table_schema = 'dbname'; |
Code Assist in Zend Studio (eclipse based)
Have you noticed there is a delay autocomplete suggestions when you type in a variable name or a function name? My typing speed is decent and I found the code assist delay to be too much. By the time Zend Studio was ready to show me the suggestions, I had already typed the variable name.
By default, Zend Studio has a 200 millisecond delay in showing code assist. You can shorten it if you feel the delay is too long. I set it to 100 milliseconds.
Go to Preferences -> Java -> Editor -> Content Assist -> Auto-Activation and decrease Auto activation delay from 200 to 100 (or whatever suits you better).

