A blog where Moazzam … rambles

  • 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…

  • 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 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…

  • 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…

  • 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…

  • 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…

  • 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…

  • 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.…

  • Importing a CSV file into a table in MySQL

    Here’s how you would import data into MySQL using a query /* If the CSV file was created in Windows, then replace ‘\n’ with ‘\r\n’ */ LOAD DATA LOCAL INFILE ‘/path/to/csv_file.csv’ INTO TABLE `table_name` FIELDS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY “\”” LINES TERMINATED BY ‘\n’ (field1, field2, field3);

Got any book recommendations?