Sunday, December 25, 2016

Got prohibition sign trying to boot Mac OS X from USB drive

My first laptop is Macbook Pro 13'' late 2016 running OSX Lion v10.7. Today, I've just bought another Macbook Air 11'' June 2013 and it has MacOS Sierra installed. My problem is my eyes hurt after staring at the screen for about half an hour but it happens only for Mac OSX v10.8 and later. I can stare at screen for a whole day without any problem if the machine runs OSX Lion v10.7. i'm not sure about the cause of the problem but perhaps it's because OSX v10.8 and later were made for Retina display screen and my both macbooks are non-retina display.

Then, i tried to install OSX Lion on my new Macbook Air using bootable USB. I used Cabon Copy Cloner to clone the OSX Lion drive from my Macbook Pro to the USB drive. I tried to boot my Macbook Air from that bootable USB but i got the prohibition sign and nothing happened. I could boot successfully from that USB with my Macbook Pro.

After that, i thought it might be because the OSX version is too old for my Macbook Air so i used my Macbook Pro to create Mavericks bootable USB and then tried to boot my Macbook Air again from that USB but no luck.

Moreover, I even used CloneZilla to backup the OSX hard drive on the Macbook Pro and then restored it to the OSX hard drive on the Macbook Air, and I still got the prohibition sign booting from the hard drive of the Macbook Air.

Therefore, I assumed that the root cause is not the problem with the version of OSX. As the bootable USB made on my Macbook Pro worked only with that machine, I thought it might be the version of the OS or/and the machine that we used to create the bootable USB is the problem. Hence, I used my Macbook Air running MacOS Sierra to create the bootable USB from the Mavericks installation file (DMG) instead (using Disk Utilities application). Bingo! it worked.

Monday, December 5, 2016

My experience with creating database in MySQL

I'm using Mac OS X Lion v10.7 and writing MySQL script to generate tables for my assignment project, Library Management.

Creating table

create table member(
 id varchar(16) not null,
 first_name varchar(128) not null,
 last_name varchar(128) not null,
 sex enum('M', 'F') not null,
 date_created timestamp not null,
 date_updated timestamp not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table book (
 id bigint not null,
 ddc varchar(45) not null,
 title varchar(255) not null,
 author varchar(128) not null,
 year_published smallint not null,
 primary key (id)
) engine=innodb default charset=utf8;

create table borrow (
 member_id varchar(16) not null,
 book_id bigint not null,
 date_borrowed timestamp not null,
 date_returned timestamp,
 primary key (member_id, book_id, date_borrowed),
 foreign key (member_id) references member(id),
 foreign key (book_id) references book(id)
) engine=innodb default charset=utf8;

- There are a set of integer data types: tinyint(-128 to 127), smallint(-32768 to 32767), mediumint(-8388608 to 8388607)int(-2147483648 to 2147483647), and bigint.
- The option "default charset=utf8" allows me to store characters in many languages such as Spanish.
- From MySQL v5.7 and up, innodb is the default storage engine. It can handle concurrent transactions while myisam cannot.




Entity Relationship Diagram Drawing Tool

I'm using Mac OS X Lion v10.7 and the program I'm using to draw ER diagram is Dia (or download it from here). It's open source and support all platforms (Windows, Mac, and Linux). For the current version of Mac OS X I'm using, it asked me to install additional program called XQuartz (or you can download it from here) and re-login before I could use Dia.

Alternatively, you can use this online tool https://www.draw.io/