Saturday, 19 December 2009
Three Dimensions: Where did they come from?
-------------------------------
(c) Copyrighted materials, Copy rights, Peter Jones December 2009.
Monday, 14 December 2009
A Decimal Calendar
Division of a circle into 360 degrees is due to Babylonians. They noticed that the sun rotating round the earth in three hundred and sixty days and night to go back to its last year position in heaven at the dawn. They recognized it was more than that a bit, but 360 had all the divisors from one to ten except seven, and it was good enough. They could not find a number that can add seven to other divisors and be near to 365 solar days. That brought the idea from ancient time that seven should be a sacred number exempted from being a divisor and an exception to that celestial rule. Babylonian further divided each degree of 360 degree into sixty "minutes" and each minute into sixty "seconds" for further precision of their calculations. They had to do calculations in cumbersome 60 radix. To reward the resilience of seven they created "Week" which is "Seven" solar days and seven got its own and unique position of honour among the "ten" numbers.
French revolution could not change number of solar days to 400 days and make the calendar decimal. They wanted to make things more precise not less. Hence, they left it as before. Day is divided into twenty four hours in accordance to idea of Babylonian such that each quarter of day be six hours and each hour be sixty minutes and each minutes be sixty seconds.
As astronomers were dealing with solar 365 days they were reluctant to abandon 360 degrees and adopt the French revolution 400 grads and its decimal fractions. Changing astronomical and naval tables and charts of the world at that time was a formidable task if not impossible. Geometers and trigonometers who were actually workers of astronomers also followed the old Babylonian style of 360 degrees for the circle. Most of the times they even do not need that and they use an intrinsic measure of angles called "radian." Still, all the calculators and computer programs are able to work with any of these three units of angles, though rarely one might find "grad" of any usage.
In my decimal calendar I have not divided the year into 400. I have divided it into twenty months. Each season has five months and year is consistent with real solar day from spring equinox to next spring equinox. Further I have divided each solar day into 20 hours instead of twenty four hours. Then I have divided each hour into 100 minutes and each minuets into 100 seconds. Hence my minutes and seconds are shorter and more consistent with modern usage of more precision in time. In this way each solar day is equal to 200000 seconds of my proposed clock instead of difficult to remember, 86400 seconds of conventional clock. You see in sports, for instance, that many fractions will not need to be used anymore in this way. I also created a five days "Week" that consolidate the sacred day of Christians -Sunday-, Judaism -Saturday-, and Moslems -Friday- in a single common day.
You can download a decimal clock of mine from my Google Code page, or click here. There is also a software for conversion of Gregorian to Decimal calendar for dates after spring of 2000, at the same place, or click here. You can see the length of each months and more details of the calendar by clicking here.
Tuesday, 1 December 2009
Tuning Google Analytic for Microsoft Office Live
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._setDomainName(".messiahpsychoanalyst.org");
pageTracker._trackPageview();
} catch(err) {}
</script>
]]>
</xsl:template>
</xsl:stylesheet>
The modified part is in bolface letters. I used my own website domain ".messiahpsychoanalyst.org" by dropping "www" from the web address. I did that such that Google Analytic can track the inner pages of my website, too.
Thursday, 26 November 2009
Google Analytic for Microsoft Office Live
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._trackPageview();
} catch(err) {}
</script>
In the statement "UA-XXXXXXXX-X" the letter "X" stands for the numbers given by the Google Analytic profile for the desired website. Then I put this piece of code inside an xsl document like this
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<![CDATA[
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-XXXXXXXX-X");
pageTracker._trackPageview();
} catch(err) {}
</script>
]]>
</xsl:template>
</xsl:stylesheet>
The Google Analytic codes are shown as boldface fonts inside the xls template. I put this in a notepad and saved it as, say, aStyle.xsl. The extension .xsl should not be forgotten and the file format is in UTF_8. Then I upload it to my "Documents Gallery" at my Microsoft Office Live website designing console.
Now I go to my "Page Manager" page in my Microsoft Office Live console and click on "Edit" for my home page. When the "Home Page" opens in "Edit" mode I notice two tabs. I select "Page Editor" tab. There, at the top from the "Insert" pane, I click on the second icon with a drop down menu; it is the "Insert Module" menu. I move the highlight down until I get to the "Custom footer." Upon selecting this, a dialogue opens. There is an option for "Link to an xslt file" and a "Select file" button. If you select this option then it takes you directly to the "Documents gallery" where you already had uploaded your file. You can point to the mentioned "aStyle.xsl" file. Looking at the zone that you have selected for the tracking "footer," then you can see a dashed border area. That does not show anything in your site. It is, merely, the Google tracking snippet resided there. Now go to your Google Analytic and follow their instructions. It immediately informs you of being successful in installing the tracker.
Saturday, 25 July 2009
Boot Loaders
Sunday, 19 July 2009
XOSL: Use or not to Use?
Monday, 6 July 2009
Writing GParted GRUB Menu
default 0
title GParted live
root (hd0,0)
kernel /live/vmlinuz1 toram boot=live union=aufs noswap noprompt vga=normal ip=frommedia
initrd /live/initrd1.img
boot
title CDROM
root (hd0,5)
kernel /boot/grub/memdisk
initrdl /boot/grub/sbootmgr.dsk
kernel is the core of each operating system loaded to do house keeping jobs such as delegating jobs to the the hardware and doing their requests. initrd job is to intialize physical memory of computer that is to put the image of operating system in RAM. This image is called the system and its job is to boot or make the computer live. I remember that I had the required files “memdisk” and “sbootmgr.dsk” on my customized GParted ISO. I use the copy command
“cp –pf /live/image/memdisk /mnt/boot/grub/memdisk” and
“cp –pf /live/image/sbootmgr.dsk /mnt/boot/grub/sbootmgr.dsk” to copy these two files into the grub boot file. They load GParted from the GParted CD instead of GParted hard disk partition if I opt to. Let me tell you I can add more sections to this grub menu to load any further operating system from GParted partition and add a nice splash to the menu with cool listing and get rid of XOSL! So why not? It is because I do experiment with tools to become more efficient.
Sunday, 28 June 2009
Java FX: A new cool platform for developing rich web applications
It is a while that Java FX platform is available. Already it was part of the NetBeans IDE bundle downloads until it became gradually independent, though one can download it with a NetBeans IDE attached independently designated for developing Java FX or as a plug-in into the newer versions of NetBeans. Now the platform is on its feet and can be used as a platform for its own. I liked this new tool since
- I could learn its basic lessons in a morning
- I need only a day to learn advanced features such as animation. Actually this feature is the only part that a Java programmer needs to concentrate.
- The language takes me back to all memories of C programming days as I notice structure and enumeration and unions have had a comeback from java to C grand-parents.
- Ease of using is similar to using Basic programming at its first emergence after horrible punch card programming era.
- NetBeans IDE allows me to exploit all the java capabilities, besides the new elegant Java FX.
- Events handling Listeners and Adapters are more friendly in FX than Java programming. That is the case with implementing Abstract classes too.
Still, I could not find documentations of classes for Java FX. Also in java projects that one is doing in NetBeans IDE, the IDE does not show the Java classes documents neither for pure Java nor for Java FX. I believe gradually I will use the Java FX platform for most of my work. That animation experience makes it more desirable and faster to be used.
Saturday, 27 June 2009
Creating Partition on Virtual Box
After finishing on creating partition, it is a good idea to roam around “Debian” and become used to its environment. Just enter “ls” to get a list of facilities that I got on the root. if I enter “ls /sbin” I’ll get a list of loads of utilities available for me. One is “mke2fs” that creates Ext2 file system for Linux partition. I can remember that I liked to install permanently a GParted on an extended logical partition at the beginning of my hard disk. I enter “mke2fs –L GParted /dev/hda6” at the command prompt. It does its job and creates a Linux partition on my hda6 logical device. I use option “–L GParted” to have a volume label for my partition, besides. I notice always to keep the required blank spaces. before and after that option in the command and after “L”. Now I run an “–pfv e2fsck /dev/hda6” to have some expert information about my logical device. Again those switches help me to keep things under control and unattended. I should plan everything ahead and leave them to be done without having been around to watch them. At the end I can read the report or any log file to find out what has gone. So “unattended but verbose” is desired. Now it is time to “mount” the logical partition on a directory. I can create any directory that I like, but already there is a directory in “Debian” for that: it is “/mnt” directory on the root. I enter “mount /dev/hda6 /mnt”. At times it is necessary to use “mount –t ext2 /dev/hda6 /mnt” to explicitly guide the commands to the type of mounted partition. Now, everything is fresh and clean and I do not need to do that. I have the device mounted now I start to install my own image and directories. I follow advise of GParted site. I should decompress GParted.zip into the root of “/mnt”. I should find the place of “unzip” command and gparted .zip on the CD image that right now I have live on the RAM disk space. If I enter just “ls” I see a “live” folder in the list. I enter “cd live” that takes my inside the “live” directory. There I have two folders: “cow” and “image” I enter “cd image” Here is the list of all files and folders that I put when I was creating my custom GParted CD ROM. Among them now I need gparted.zip and “unzip”. They are here. Now I follow GParted website command but I should have all paths in commands. Alternatively I can copy these two files to the root of “Debian live RAM” I enter “/live/image/unzip /live/image/gparted.zip –d /mnt”. I note that I should repeat the complete path for each file and folder and unzip is completely case sensitive. Switch “ – d” shows the directory of installation. I did whatever GParted advised. From here, or at the root I check “ls /mnt” and find out every thing is as it should. I have “COPYING” file at the root. From now on it works on the hard disk but now I am in a logical partition and have other plans hence I need a “GRUB” for loading this device from “XOSL” I go into the root and enter “mkdir /mnt/boot” That creates the required “/boot” directory for installing “GRUB”. Then I enter “/sbin/grub-install ––no-floppy ––root-directory=/mnt /dev/hda6 ” Switch –no-floppy shows that I do not use a floppy for loading “—root-directory=/mnt is the place that “GRUB” finds its “/boot” directory as already created and ready and at the end we have installing device. Usually “GRUB” gives a warning about “device.map” that should be ignored. I can inspect “ls /mnt/boot/grub” for installed folders. It is better to sort out things by invoking GRUB command environment by entering “sudo grub” There at the “grub>” prompt, I enter “find /bbot/grub/stage1” It replies “(hd0,5)” It is in the brackets and I know that it means the partition number 6 (5+1) on the device number 1 (=0+1). Grub counts from zero rather than one. Then at the “grub>” prompt I enter “root (hd0,5)” It replies “file system type is ext2fs, partition type ex83” both have the same meaning. Then I enter “setup (hd0,5)” It gives few lines of message and news of successful installation. Then I enter “quit” and back to “Debian” command prompt. So far so good. Now remains to edit the “menu.lst” of GRUbB and a nice splash for it.
Saturday, 20 June 2009
Creating Partitions on Virtual Disks
After those calculations, I have better idea of what going on in hypothetical geometry of hard disks. Now I open my xVM virtualBox. I create a “New” machine. For operating system I select “Other.” For the Version, I select “other,” for version. I select a new virtual hard disk for it as much as 16Gb. I mount my custom made GParted.iso as CD on the “Other” machine and then I start the machine. It boots from GParted.iso. I select the second row from the GParted menu, to be able to un-mount the CD if I opt to. Then I select the default key map of GParted. And finally I select the language from the language menu. After that a menu loads that ask me for three options: [0], [1], and [2]. I select [2] to take me to the GParted “Debian” command. Then I type “fdisk /dev/hda” at the prompt and then “enter.” It gives number of cylinders C=33288, and usual Linux warning on exceeding C=1024 and then subcommands for “fdisk” comes as “command (m for help).” If I type “m” and then “enter” a list of available commands and at the bottom “x” for expert commands. I type “x” and “enter.” A sub-subcommand comes for expert commands. In this if I type “m” and “enter” another list comes for available expert sub-subcommands. Now I type “c” to change number of cylinders and “enter.” A prompt offers me possible number of cylinders from 1 to 33288. I type 2088 as my previous calculations show. It accepts. Then I type “s” to confirm number of sectors. I can change it for adventure but not for work. I select the default S=63 without any change by typing 63 at the prompt and “enter.” Then I type “h” and “enter” to change heads. It offers me from one to 255 and default 16. I type 255 for H=255 and “enter.” At the next prompt I type “r” to go back to “fdisk” non-expert subcommand prompt. To do my partitions I type “n” and “enter.” It asks me with a help menu “type e for extended” and “type p for primary.” I enter “e” Then it asks me for partition number (1-4). Here I adventure to put the extended partition at the beginning of the disk contrary to usual practice that puts it at the end. I enter “1” Then it asks me for the size. It asks me for beginning cylinder by offering (1 to 2088). Here I get confirmation that my calculated scheme is under way. I enter “1” and then for the end of extended partition I enter “40” I leave 2048 cylinder for two XP side by side. Then again I enter “n” This time it offers me “l for logical partition” since we cannot have any more extended partition but we can have only logical partitions inside the extended partition. I enter “p” and it asks me for partition number (2 to 4). I select “2” This time it offers 41 for beginning of partition as default that I accept by entering for the end of partition I type 1064 (=40+1024) I confine number of cylinder to its maximum of 1024. I repeat the procedure for the last partition from 1065 to 2088. Then again I enter “n” - what for this time? to create logical partitions inside extended partition. At the next menu, I enter “l” for logical partition. It offers me to select a number (5 and greater) since logical partitions at any situation begin from 5. I enter “5” Then It asks for the beginning that I enter default cylinder “1” and for the end I enter “3” This is my XOSL partition, 24Mb. I cannot have less than this. I repeat the procedure for second logical partition that keeps my customized GParted from cylinder 4 to cylinder 40 in partition “6”. Now I have four partitions ready. I type “a” at the “fdisk” subcommand to make GParted partition bootable. It asks me for the partition number (1 to 6). I enter “6”. To be sure of my operation I enter “p” It gives a list of my partition with their number of cylinders as “/dev/hda1” –the extended partition, “/dev/hda2” – the first primary, “/dev/hda3”, as the other primary, “/dev/hda5” first logical and at last “/dev/hda6” the other logical partition. I can see a “*” is next to “/dev/hda6” showing that it is bootable. I enter “w” to save the partition table and come out of the “fdisk” subcommand.
Tuesday, 16 June 2009
Installing GParted and XOSL
Sunday, 14 June 2009
Geometry of Hard Disk
Sunday, 31 May 2009
Utilizing Virtual Box
Saturday, 30 May 2009
Working with Virtual Box
Friday, 29 May 2009
Using Virtual PC Box
Thursday, 28 May 2009
Tools That I Need
Tuesday, 26 May 2009
Virtual Box
Sunday, 24 May 2009
Virtual Box
Wednesday, 20 May 2009
Making Enhanced GParted ISO Image
Sunday, 17 May 2009
Building ISO Image
Friday, 15 May 2009
Injecting Files into ISO Image
First, download a virtual drive software. This software instals a virtual CD/DVD driver on your computer similar to your real CD/DVD/Blu-ray driver. Only that instead of real CD/DVD/Blu-ray you put a an ISO image on it. Then you can open that image and copy the content of that image into your computer. Then add (inject) your additional files into the content. And at last create a second new ISO that includes the injected files. There are many virtual drivers out there, but the one that I have used is the free Daemon Tool Light When you are installing it be careful not to accept its optional features such as the toolbar if you do not agree with them. Only instal the virtual drive. Also download it from its official website; otherwise, you might end up downloading annoying bloated softwares and ad-wares. Also there are many other products are advertised in the page that you should carefully find Daemon download among them.
In second method, I downloaded WinImage tools from here. This tool is not free but you can use it for thirty days free and meanwhile sort out your projects. I created a new folder in "My Documents" named it with GParted ISO file, showing versions and everything similar to my GParted version. Only I deleted .iso from its name. The folder is empty. Then I opened WinImage tool. From the "File" menu item "Open" command, I opened the GParted.iso. All files and folders inside the image appears in explorer frame and navigation pane of WinImage. I notice that the CD image includes isolinux but GParted.zip for hard disk included syslinux as it is obvious from their application. Isolinux puts an ISO image of a CD on the memory, syslinux puts the image from a hard disk on the physical memory. Then I go to "Image" menu item "Extract" command and brows to GParted empty folder I have created in "My Documents" to extract all files and folders of ISO CD in this folder. Now contents of ISO are accessible for adding new items. I added "unzip" file to the root of folder to use it later on my "Debian" command line for unzipping GParted.zip. I also added file GParted.zip to the root. Now I can reconstruct the folder back to a new ISO image of mine, using free "ImgBurn: Image Burn" utility as I explain in the next post.