2009/04/30
Screen Capture in Ubuntu
In Ubuntu, you can easily capture the full screen by press [Print Screen]or [Alt]+[Print Screen] to capture the image of an activated window.And then image processing program can be used to modify the captured image if necessary.
Windows XP in Virtual Box on Unbuntu
Some website applications are not running well in Linux platform. So that I shall have one copy of Windows XP. And the free solution is Virtual Box...
[*] Host OS : Ubuntu 9.04
[*] Virtual Box 2.2.2 r46594
Download your Virtual Box from its website first. (http://www.virtualbox.org/wiki/Downloads) And then install it.
[*] Guest OS : Windows XP Service Pack 2
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9Z4-pTz66meGbgy8p1AxjYKcQG4oQ49IB9sC4x-WFb3HGoBEhDxoIKS72GyQJ_x2veUSGJkXWNVFfCvYe9Cf3bYFwB1Pxw90EewpK7Bw_hfVok0XGBX6sBPofR0XPmM0UKYpKiHo_S7vo/s400/Screenshot-VirtualBox+-+%E9%97%9C%E6%96%BC.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwHk7lOHXz4eRErNh75ISexTR1Pf9Dxcoar2mL0Tu5XNhxUT7gptB8fHklYRaxInCcsXqGwBVfCKRwPjF_OODRQTgJn7vh90cN0lioICp4s4NHwj-5JVIyAfqwY_Z864tNrttKTtqU7qR5/s400/Screenshot-Sun+VirtualBox.png)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioW2frhoLr4yeqkEjv6uryUQb3lqlqH9ZgPYAYvcjU-gVjLUkTqF8plUYEx1-jKaK8KA8KvxCc2BEesEDD_vU9tAoIMhbdCOuX8h5D9CPJ9tByo3AseY5LbOxoIx0d-CuHpOuuCWYUeRxn/s400/vbxp.png)
OS Exercise - Disk Scheduler
A simple C program which implements the disk scheduling algorithm including FCFS, SSTF, SCAN, CSCAN, LOOK and CLOOK.
Source Codes per requestPlease choose your disk scheduling algorithm: 1. FCFS - First Come First Serve 2. SSTF - Shortest Seek Time First 3. SCAN - 4. CSCAN - Circular Scan 5. LOOK - Scan without moving to ends 6. CLOOK - Circular Look without moving to ends Your choice is (1~6, other input means EXIT): 1 *** MAIN MENU ************************* 0. Change Disk Schedule Algorithm - FCFS 1. Print Disk Scheduling Result 2. Input Disk Request to Device Queue 3. Exit Please enter your choice (0~3):1 Process# Tracks# -------------------------- Current 53 1 98 (+ 45= 45) 2 183 (+ 85= 130) 3 37 (+146= 276) 4 122 (+ 85= 361) 5 14 (+108= 469) 6 124 (+110= 579) 7 65 (+ 59= 638) 8 67 (+ 2= 640) -------------------------- Total movement: 640 tracks *** MAIN MENU ************************* 0. Change Disk Schedule Algorithm - FCFS 1. Print Disk Scheduling Result 2. Input Disk Request to Device Queue 3. Exit Please enter your choice (0~3):3 Terminated by user
OS Exercise - Memory Allocation
Screenshot as below. It can do First/Best/Worst Fit...
Source Codes per requestPlease choose your allocation algorithm: 1. First Fit 2. Best Fit 3. Worst Fit Your choose is (1/2/3, other input means EXIT): 2 MAIN MEUN 1. Display memory usage status 2. Input memory request to request queue 3. Allocate memory to the first requestor in queue 4. Terminate process in memory 5. Exit Please enter your choice (1-5):2 INPUT MEMORY USAGE Input Process #, Request Memory Size: 100, 1000 MAIN MEUN 1. Display memory usage status 2. Input memory request to request queue 3. Allocate memory to the first requestor in queue 4. Terminate process in memory 5. Exit Please enter your choice (1-5):1 MEMORY.... Start End Size Process# --------------------------- 0400 - 2559 (2160) free QUEUE.... Start End Size Process# --------------------------- 0000 - 0999 (1000) 100 MAIN MEUN 1. Display memory usage status 2. Input memory request to request queue 3. Allocate memory to the first requestor in queue 4. Terminate process in memory 5. Exit Please enter your choice (1-5):3 Fit : 2 MAIN MEUN 1. Display memory usage status 2. Input memory request to request queue 3. Allocate memory to the first requestor in queue 4. Terminate process in memory 5. Exit Please enter your choice (1-5):1 MEMORY.... Start End Size Process# --------------------------- 0400 - 1399 (1000) 100 1400 - 2559 (1160) free QUEUE.... Start End Size Process# --------------------------- MAIN MEUN 1. Display memory usage status 2. Input memory request to request queue 3. Allocate memory to the first requestor in queue 4. Terminate process in memory 5. Exit Please enter your choice (1-5):5 Terminated by user.
3 Qt Exercises After 1 Week Classess
After one week classes, we are asked to write some codes.
2. A simple painter. >> Undo![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp6KWGVPLvVTxRDi6BQ-QQMwszJ0Q-uL3bmSAi96lrUCTifk39Dedch97Gh8XDgAy2C3HzcoCk5pvoM0Er7EprPsb3EPunSsAaS22rtkHOW-EM7yfIWAgPvZwzwjEIwcZOJBmwGxUq3smO/s400/Screenshot-MainWindow.png)
3. An address book records some basic information. >> Open/Save/Insert/Delete/Head/Prev/Next/Tail
It's a pity that I don't have time to improve them at this moment. Because more other lessons are there.
1. Something like ping-pong. >> (2 buttons are used, one as ball and another as board).
2. A simple painter. >> Undo
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhp6KWGVPLvVTxRDi6BQ-QQMwszJ0Q-uL3bmSAi96lrUCTifk39Dedch97Gh8XDgAy2C3HzcoCk5pvoM0Er7EprPsb3EPunSsAaS22rtkHOW-EM7yfIWAgPvZwzwjEIwcZOJBmwGxUq3smO/s400/Screenshot-MainWindow.png)
3. An address book records some basic information. >> Open/Save/Insert/Delete/Head/Prev/Next/Tail
It's a pity that I don't have time to improve them at this moment. Because more other lessons are there.
2009/04/25
Qt 4.5 SDK Installation
Download the SDK from Qt website.
http://get.qtsoftware.com/qtsdk/qt-sdk-linux-x86-opensource-2009.02.bin
Then make the file executable by chmod u+x.
Execute as root.
./qt-sdk-linux-x86-opensource-2009.02.bin
Then you can find Qt Creator in /opt/qtsdk-2009.01 (default) or somewhere you specify during installation.
However something may be required if someother packages are not present.
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
ubuntu 9.04 Installation from HDD
If you want to taste Ubuntu in your XP only, click the wubi.exe in the live cd.
or you want a new Ubuntu in another partitiom.
1. Put the live iso in a FAT partition.
2. Extract the vmlinuz, initrid.gz from casper in iso file...
3. Install Grub4dos if you have XP only.
4. and add some words in your menu.lst as below
title (090424) Install Ubuntu 9.04
root (hd0,5)
kernel /vmlinuz boot=casper iso-scan/filename=/ubuntu-9.04-desktop-i386.iso
initrd /initrd.gz
(hd0,5) is the partition which all aboves are located.
5. Fllow the installation procedure, you will get some message that /isodevice in't able to unmount. Then you have to umount it from terminal as root with parameter -l
(#umount -l /isodevice)
Some error message will happen, but installation continues :)
6. After reboot, you get a whole new Ubuntu 9.04 (jaunty) with kernel 2.6.28-11.generic.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ3f2th67kaZLWCXSyQ64-CGQYJ-ApX7bgtDw55iJ9JWrNghJQdc3Pv8bpmRDY7V1CHwDE1-nieTLPsdIUhYXMjIapzvocGNgey3FxXp9xR-Ymud5nrnRjAzeknrj-7cnjnDNX92D_ob3a/s400/Screenshot-%E7%B3%BB%E7%B5%B1%E7%9B%A3%E6%8E%A7.png)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCr_yohagBm3WBgQQ667cZXevizQm0pYSuuMbqmNGd3mz0R_91Oeg54LHksqfVHvuWUtgtC6SyVUK-wKd3bq0YkdcQvZqosiTP5xnF9qjw6Jdv_NfQ61x1y2ov5G5XZRc8csREI9ZF9xfE/s400/Screenshot-mysql.png)
訂閱:
文章 (Atom)