Monday, September 15, 2008
R project
You can install it in Linux Ubuntu with:
sudo apt-get install r-base
Then type R (in big case) and like in Python, you get a console for commands. Also you can write a program and save it in a file and call it for execution:
R -f myfile.r
a <- read.table("compofdistances.dat", header=T, sep="\t")
#this will read the data from a file, header is true (it has a header) and the separations are by tabs.
plot(a[,1],a[,2])
#this will plot the first column against the other. One is plotted on X axis and the other on Y axis as reference. In other words, if the first column is the vector (1,2,3) and the second column is the vector (4,5,6), then the points in the graph will be 1,4 ; 2,5 and 3,6.
b <- read.table("compofdistances.dat", header=T, sep="\t")
plot(a[,1],b[,2],col=c("red","blue"))
#This will plot the point alternately in red and blue.
#Another example, suppose we have the next file called triangle_areas.txt:
0 36267.2574608
1 12386.1343796
2 6417203.85229
3 6616673.58732
4 6417203.85229
5 6417203.85229
6 63352.669897
7 12386.1343796
8 188188.032427
9 6417203.85229
.
.
.
1920 39008.7753129
1921 12386.1343796
1922 156563.806249
1923 83012.3642354
1924 29033.6398076
1925 67316.811118
1926 36147.5333869
1927 6616673.58732
1928 14443.5575429
1929 12386.1343796
#Then in R we write the next command:
a<-read.table("triangle_areas.txt")
b<-a[a[,2]<10000,2]
#this is recursive, the second part inside the square brackets (the number 2) indicates that we are refering to the second column from the file. In the first part we are referring only to those less than 10000, and we put them in b.
plot(b)
#To plot the results
> length(b)
[1] 972
#To know the length of "b".
> b
[1] 36267.257 12386.134 12386.134 36540.916 19763.353 36267.257 19763.353
[8] 15872.262 30528.117 36540.916 2292.506 2292.506 14199.754 12386.134
[15] 12386.134 32088.702 36540.916 15378.449 36540.916 29033.640 1167.037
[22] 12386.134 15378.449 20265.898 1167.037 33405.568 36540.916 9910.127
[29] 15378.449 45617.156 1167.037 28488.625 1167.037 17056.617 12386.134
[36] 29033.640 32088.702 29033.640 32088.702 12365.535 19763.353 19763.353
[43] 20265.898 14443.558 12386.134 36540.916 28581.609 28488.625 19763.353
[50] 32088.702 12386.134 32088.702 1799.776 25689.556 1167.037 12386.134
[57] 36540.916 30528.117 1062.624 9021.118 25325.056 29033.640 19763.353
[64] 19763.353 19763.353 25689.556 15378.449 12386.134 19763.353 32088.702
[71] 36267.257 9910.127 15378.449 1062.624 36540.916 25689.556 1167.037
[78] 33217.250 12386.134 29033.640 32088.702 45417.858 8887.827 48636.615
[85] 29033.640 48636.615 9910.127 12386.134 32088.702 1167.037 1167.037
[92] 32088.702 12386.134 12386.134 36267.257 36540.916 36540.916 12386.134
[99] 19763.353 8887.827 32088.702 12386.134 36267.257 32088.702 36540.916
> a<-read.table("triangle_areas.txt", header<-F)
#Here, I guess we are saying that the header part is FALSE. In other words, that the file does not have a header.
Link to some examples.
http://www.harding.edu/fmccown/R/
In 4shared.
How to make a bootable MSDOS CD from a floppy image
http://www.bootdisk.com/
http://sharkysoft.com/
http://mandrivausers.org/
http://www.troubleshooters.
==============================
Archiving Floppy Disks Using Images
We all have a stack of floppies sitting around that none of us ever use, but which we can't bare to throw away because we know that as soon as we do, we will miss them. On top of that, we also know that the lifetime of a floppy is very short; even if you do have a place to store all your floppies, odds are good that eventually the bits on them will go bad anyway. This mini-tutorial offers a technique you can use to archive your floppies onto more durable media, such as your hard drive or a CD-ROM, in a manner that allows you to reconstruct any of the floppies at a later time.
Often, it is not enough just to back up the files on a floppy. Sometimes the exact arrangement of data blocks on the disk are important. When backing up a commercial floppy, for example, it is usually best if you can create a bit-for-bit copy of the original. The techniques illustrated in this document achieve this goal.
Floppy disk images
All of the data on your floppy, including the files, the directory tables, etc. can be represented in a single file called an "image." Images are useful because they encapsulate the entire structure of a disk without regard to what is actually on the disk. Thus, images can be used to represent disks of various formats.
Unfortunately, the techniques described in this document work only with 31/2 inch high density (1.44 Mb) disks. However, they can be adapted for other types of disks if you know the correct parameters. Some formats that might not work with the techniques described in this document include Macintosh and the special format Microsoft used to distribute copies of Windows 95. (If you figure out the correct parameters for these formats, let me know so that I can include them here.)
Reading imagesThere are various commercial utilities available for DOS and Windows that can read floppy disk images. Unfortunately, I have not been able to find any of them that are free. If you use Linux, however, the process is quite easy and no commercial software is required. Simply put your disk in the drive and execute the following command:
dd if=/dev/fd0 of=floppy.img count=1 bs=1440k
Of course, you can replace floppy.img with the file name that you want the extracted image to have.
When the command completes, you will have a single file on your hard drive representing the entire disk. This file, called an "image," can be used to reconstruct the floppy at any given time. From this point, you just need to keep the file on your hard drive, write it a CD-ROM or tape, or preserve it in any other way you feel appropriate. Note that you can fit more than 400 floppy images on a single CD_ROM. (That'll save a lot of space!) As long as you can keep the images safe, you can dispose of the original floppies, and reconstruct them later if it ever turns out you need them.
Writing images
Red Hat, Inc. has published a DOS utility you can use to write floppy disk images back to floppy disks. It's call rawrite.exe and is included on any Red Hat Linux CD-ROM. Since it is freely redistributable, I am happy to offer you a copy of the program and its documentation. It's really quite simple to use. Just run it and follow the prompts.
If you are running Linux, the command to restore an image to the floppy is:
dd if=floppy.img of=/dev/fd0 count=1 bs=1440k
where floppy.img is, of course, the name of your archived image file.
Acknowledgements
Thanks to Alen Peacock for teaching me most of the knowledge embodied in this tutorial.
==============================Executive Summary:
A big thank you goes out to LEAP member Mark Alexander for supplying much of the technical information in this document...If you're old enough to remember IT in the 1980's, you remember a time when floppies were reliable. They had to be. For most PC type computers, floppies were the preferred software distribution media. and the preferred backup media. Skip ahead 20 years, and floppies are almost never used for these purposes. My observation using floppies is that manufacturers of floppy media and drives no longer insist on high quality. Why bother -- the last use of floppies is boot media for computers.
My experience indicates you might need to try 5 or 6 floppies before you get a good boot floppy. This is a hardship, to say the least.
Meanwhile, CD media and drives have gotten better and better over the years. Wouldn't it be nice if you could burn that floppy image as a bootable CD, and then use the CD as installation media? Keep in mind that most computers made in the last 5 years can boot to CD.
This document describes how to burn a floppy image file onto a CD.
For this exercise we'll use /scratch/linuxinst/m91inst/
Mastering And Burning It the Easy way
Assuming the floppy image file to be turned into a bootable CD is /scratch/linuxinst/m91inst/mkisofs -pad -b floppy.img -R -o /tmp/cd.iso \Note the following:
/scratch/linuxinst/m91inst/images/floppy.img
Command parameter or part | Functionality |
-pad | Add padding to the end to make it readable on all CD players |
-b floppy.img | -b tells mkisofs which *floppy image* to use for booting. If the floppy image boots as a floppy, it will boot as a CD. Note that there is no path prepended to floppy.img. The floppy.img bootable image is assumed to be relative to the file being imagized, in this case /scratch/linuxinst/m91inst\ |
-R | Include Rock-Ridge extensions for readability everywhere |
-o /tmp/cd.iso | This defines the output file, an ISO9660 image ready for burning |
/scratch/linuxinst\ | This is the file to put on the CD. |
Your next step is to actually burn it. Use the following command:
cdrecord dev=0,3,0 speed=12 blank=fast -pad -v -eject /tmp/cd.iso
Command parameter or part | Functionality |
dev=0,3,0 | The CD burner device. If you don't know it, use the cdrecord -scanbus command to find out. |
-speed=12 | Set this to the fastest speed supported by your burner/media combination. |
-blank=fast | Use this ONLY if burning a rewriteable. This erases the current CD contents, but does it fast rather than thoroughly. |
-pad | Add padding to the end to make it readable on all CD players. Without this, the CD will error out when read on many Linux boxes |
-v | Verbose |
-eject | Eject when finished |
/tmp/cd.iso | The ISO image you're burning. In this case it's the ISO you just made with mkisofs. |
Remove the CD, and boot it on a machine known able to boot CD's. You should get a bootable version of whatever boot floppy image you used. The advantage to a boot CD is CD media are much more reliable, so you needn't go through several floppies finding just the right one to burn properly.
Mastering and Burning it the Complete Way
The easy CD boots and installs just like the floppy, but it does not contain the floppy's files in the root of the CD. To get all the files visible in the root, you need to create a temporary directory, copy all the floppy image files to it, copy the floppy image to it, and run mkisofs. The cdrecord step is the same as described in the Mastering and Burning it the Easy Way article:- As root, make sure there's a /mnt/test directory
- As root, mount -o loop,ro /scratch/linuxinst/m91inst/
images/floppy.img /mnt/test - The remainder of the steps are done as a regular user
- mkdir /tmp/floppycopy
- cp -Rp /mnt/test/* /tmp/floppycopy
- cp -p /scratch/linuxinst/m91inst/
images/floppy.img /tmp/floppycopy - mkisofs -pad -b floppy.img -R -o /tmp/cd.iso /tmp/floppycopy
- cdrecord dev=0,3,0 speed=12 blank=fast -pad -v -eject /tmp/cd.iso
NOTE As mentioned before, you must determine your device number based on cdrecord -scanbus, and your speed based on media and drive. |
How to make a bootable MSDOS USB key
*NOTE: A USB key will boot only if the BIOS in your computer explicity supports that feature.
http://www.bootdisk.com/
http://www.abxzone.com/forums/
http://www.weethet.nl/english/
http://www.laptopvideo2go.com/
http://www.hardforum.com/