Sunday, February 07, 2010

10000 Factorial in perl

Using perl, here is the shortest way to calculate the factorial of a big number like 10000

use strict;
use Math::BigInt;

sub fact {
my ($num) = @_;
return 1 if (($num == 1) or ($num == 0));
return $num * fact($num - 1);
}

my $init = time();
print Math::BigInt->new($ARGV[0])->bfac();
my $last = time();

print "Number of minutes: " . (($last - $init)/60) . "\n";

Thursday, November 06, 2008

VMWare and Ubuntu

I just configured the VMplayer and run Ubuntu (Linux) on Windows XP. You can try the steps below if you need to run Linux within windows:

Steps-

Download VMplayer from this link:

http://www.vmware.com/download/desktop_virtualization.html

And then download Ubuntu 8.04.1 Desktop (~900 MB) from the link below

http://www.vmware.com/appliances/

This will be a 7-Zip file so use the 7-Zip utility to extract that.

  1. Then Install VMWare Player
  2. Reboot the computer
  3. Launch VM Player and point to the path where the virtual OS is present (.vmx) file, it will be there in the extracted folder by 7-Zip.
  4. Then the Linux will start booting within XP.
  5. User Name : user
  6. Password : user
  7. Done, you can enjoy the best flavor of Linux now in Windows though 3D CUBE and compiz fusion will not be there by default which we don’t need for our purpose.( They are better graphics than Vista so bad to miss them in Virtual image) ,but you can browse WEB as its auto configured.

Now you can enjoy with linux without quitting windows!!

Thursday, October 30, 2008

Deleted Windows Boot process article.

I got one request from one of the visitors on my blog to remove the Windows boot Process Article as that was copyrighted material so i have removed that.Already good information about windows operating system is not freely available so i thought of sharing an article worth reading but rules are rules so i will try to soon do the rework.

In coming days i will describe how Linux Boots and i would try to put Windows Boot Loader description as well.

I appreciate the person to point that copyright issue out.

Thanks for reading.

Friday, September 05, 2008

Google Chrome

Google has also launched its much awaited Web Browser Chrome yesterday. I believe that it is much better than MS IE8 which was launched earrly this week.
You can also share your comments on this.

Monday, September 01, 2008

Internet Explorer 8

Microsoft just launched the Beta version revision 8 of its popular search engine Internet explorer.It can be downlaoded from http://www.microsoft.com/windows/internet-explorer/beta/

Its full of cool features like

1.Private IP sessions to hide your content views from others.Do you want to be better protected from phishing and malicious software downloads? Need to browse with more privacy for that special gift online? Concerned about identity theft and your privacy? The latest version of Windows Internet Explorer has been designed to address these potential threats and more

2. Improved Search Searching for information is the most commonly performed task on the web. You'll now see results show up instantly as you start typing in the built-in search box; these results will become more accurate each time you type a letter! This function will be supported by a wide variety of search providers including Windows Live™, Yahoo! and Google.

3. Search Suggestions Now you can type a search term and see real-time search suggestions from your chosen search provider, recommending common searches related to the text that is typed. Click on a suggestion at any time to immediately execute the search, saving you time and increasing the relevance of the search.

4.Visual Search Microsoft is partnering with top search providers like Microsoft® Live Search, Wikipedia, Yahoo, Amazon, and more to deliver direct results and "visual search" images that provide you with immediate answers. For example, typing "Seattle weather" with Live Search will instantly show you a preview of the current weather directly in the Search Box drop-down.

Monday, August 18, 2008

Some queries

Hi all

Please find the questions below

1. Which language among C/C++ is best in terms of performance?
2. If C is best, which factor in C++ makes it unfit in performance?
3. And if C program is compiled by C++ compiler, will the performance
be reduced?

Answers
1. C is better performance wise when compared to C++. We would chose C+
+ programming for portability and highly restricted access to critical
resource from the applications (Encapsulation)
2. The factor that makes C++ unfit in performance is that Run Time
overhead. Means the features like Run Time polymorphism (not supported
in C) in C++ would result in slower execution
3. No idea

Please let me know if any thing wrong mentioned in this. And please
let me know the answer for 3rd question.

Wednesday, July 23, 2008

Boot Parameters to Manipulate Memory

Here we discuss about the memory options at the boot time for a pc.

You can simulate a low-memory environment for testing without changing the amount of physical memory on the computer. Instead, you can limit the memory available to the operating system by using the /burnmemory and /maxmem boot parameters in Windows Server 2003 and Windows XP, and by using truncatememory or removememory options with the BCDedit /set command on Windows Vista.
The /burnmemory parameter, which is available on Windows Server 2003 and Windows XP, reduces the memory available to Windows by the specified amount. It is calibrated in megabytes (MB). Set the value to any amount less than the actual physical memory on the computer.
The /maxmem parameter specifies the maximum amount of memory available to Windows. It is calibrated in megabytes (MB). Set the value to any amount less than the actual physical memory on the computer.
The /maxmem parameter actually determines the largest memory address available to Windows. Due to gaps in the mapping of physical memory, Windows might receive somewhat less memory than the value of /maxmem. For more precision, use /burnmemory.
The truncatememory or removememory options are available on Windows Vista. The truncatememory option disregards all memory at or above the specified physical address. The removememory option reduces memory available to Windows by the specified amount (measured in MB). Both options reduce memory, but the removememory option is better at restricting the operating system to use the specified memory while accounting for memory gaps.
Boot Parameters to Test in a Low-memory Environment in Operating Systems prior to Windows Vista
To simulate a low-memory environment on Windows Server 2003 and Windows XP, add the /burnmemory parameter to a boot entry. Set its value to the amount of physical memory on the system minus the desired memory size for this test.
For example, to limit the memory of a computer with 1 GB of physical memory to a maximum of 128 MB of available memory, set the value of the /burnmemory parameter to 896 (1 GB (1024 MB) - 128 MB = 896 MB).
The first boot entry in the following sample Boot.ini file has the /burnmemory parameter.
[boot loader]timeout=30default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Low Memory" /fastdetect /burnmemory=896multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
To add the /burnmemory parameter to a boot entry, use Bootcfg. Because Bootcfg does not have a parameter-specific switch for /burnmemory, use the Bootcfg /raw switch, which allows you to specify any boot parameter for a boot entry.
In the following Bootcfg command, the /raw switch adds the content of the string, "/burnmemory=896" to a boot entry. The /A switch directs Bootcfg to append the string to the entry, rather than replacing all boot parameters for the entry. The /ID switch identifies the boot entry.
bootcfg /raw "/burnmemory=896" /A /ID 1
The following Bootcfg display shows the result of the command on a system with a Boot.ini file.
Boot Entries------------Boot entry ID: 1Friendly Name: "Microsoft Windows XP Professional"Path: multi(0)disk(0)rdisk(0)partition(1)\WINDOWSOS Load Options: /fastdetect /burnmemory=896
Boot Parameters to Test in a Low-memory Environment in Windows Vista
To simulate a low-memory environment on Windows Vista , use the BCDedit /set command and the removememory option to modify a boot entry. Set the value of removememory to the amount of physical memory on the system minus the desired memory size for this test.
For example, to limit the memory of a computer with 2 GB of physical memory to a maximum of 512 MB of available memory, set the value of the removememory parameter to 1536 (1 GB (2048 MB) - 512 MB = 1536 MB).
The following example shows a BCDEdit command used to remove 1536 MB of memory from the total available to the system for the specified boot entry.
bcdedit /set {18b123cd-2bf6-11db-bfae-00e018e2b8db} removememory 1536
You can also use the truncatememory option with the bcdedit /set command to achieve the same result. When you use this option, Windows ignores all memory at or above the specified physical address. Specify the address in bytes. For example, the following command sets the physical address limit at 1 GB for the specified boot entry. You can specify the address in decimal (1073741824) or hexadecimal (0x40000000).
bcdedit /set {18b123cd-2bf6-11db-bfae-00e018e2b8db} truncatememory Ox40000000
Because the removememory option makes more efficient use of system memory, its use is recommended instead of truncatememory.
Boot parameters to debug in a low-memory environment in operating systems prior to Windows Vista
To simulate a low-memory environment on Windows 2000, add the /maxmem parameter to a boot entry. Set its value to the desired memory size for the test.
The first boot entry in the following sample Boot.ini file includes the /maxmem parameter.
[boot loader]timeout=30default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS[operating systems]multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Low Memory" /fastdetect /maxmem=128multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect
In this example, the /maxmem parameter is used to limit Windows to 128 MB of memory and the computer is configured for debugging with a debug (null modem) cable. This configuration requires two Bootcfg commands.
The first Bootcfg command uses the Bootcfg /addsw (add switch) switch with the /MM argument and a value of 128 to add the /maxmem parameter and to set it to a value of 128 (MB). The /ID switch identifies the boot entry.
bootcfg /addsw /MM 128 /ID 1
The second Bootcfg command uses the Bootcfg /debug switch with a value of ON to add the /debug parameter to the boot entry. It uses the /port switch with a value of COM1 to add the /debugport parameter and to set it to COM1, and it uses the /baud switch with a value of 19200 to add the /baudrate parameter and set it to 19,200 BPS. The /ID parameter identifies the boot entry.
bootcfg /debug ON /port COM1 /baud 19200 /ID 1
The following Bootcfg sample shows the resulting boot entry. The newly added parameters are displayed in bold type.
Boot Entries------------Boot entry ID: 1Friendly Name: "Windows XP 128MB Debug"Path: multi(0)disk(0)rdisk(0)partition(1)\WINDOWSOS Load Options: /fastdetect /maxmem=128 /debug /debugport=COM1 /baudrate=19200

Friday, July 18, 2008

DTM Step by step

Preparing for Unclassified Signature Testing




Before running the tests, you must configure at least one client system and install the operating system. This section summarizes the related procedures.


Device and Driver Installation

Install your driver and device on at least one client computer system.

DTM Client Software Installation

Install Device Test Manager (DTM) client software. After DTM client is installed, open DTM Studio and add the new client to a machine pool.

Create a Machine Pool

If a machine pool has not already been created, create one.

Right-click the ‘$’ in the left-hand Machine Pool window, and click Add Machine Pool.

In the Add Machine Pool dialog box, type a name for the machine pool, and click OK.

Right-click the new machine pool, click Properties, and click the MCU Policy tab.

In the Available dimensions area, click Wdk\ConfigureUnclassified, click Add, and then click OK.

Add the newly installed client to the machine pool by dragging and dropping it
from the Default Pool window to the newly created machine pool.
Make the client ready for scheduling

In the machine pool to which you added the newly installed client, right-click
The client computer in the Machines windows, click Change Status, then click Reset.

The Unclassified Master Config Job will automatically schedule and run on
The client computer. When the job has completed, the client is ready to
Begin an Unclassified submission.

Repeat the preceding step for each client in the machine pool.
/**************************************************************************************/


Running the Unclassified Signature Tests

To run the Unclassified Signature tests, do the following:
Open Driver Test Manager (DTM) Studio.

On the Explorers menu, click Device Console.

Select View By Submission.

From the Submission control, click New Submission. The Create New Submission Wizard appears.

From the OS Window, select the Windows operating system that is installed on
the client, and then click Next.

From the Select Category window, click Device Submission, and then click Next.
Under Logo Program, scroll to the bottom of the list, click Unclassified, and then click Next.

From the Qualification window, click Unclassified Signature, and then click Next.

Type a name for the submission, click the machine pool, and then click Next.

Type the path to the INF file and click Load. You can also use the
Browse button to find your INF file.

Under Drivers for Submission, select the driver that you want to
submit, and then click Next.

Note The No INF check box is not applicable to an Unclassified submission.
Click Finish.

The new submission appears on the left side of the Available Devices window
in the Device Console.

In Available Jobs, select the Driver Reliability check box,
and then expand the Driver Reliability category to show the individual jobs.

The Prefast for Drivers Test requires that you manually edit the
parameters for your driver. The following procedure assumes you have already run
Prefast for Drivers on your source code and created the results file (Defects.xml). The Prefast for Drivers test will import information from that file into your submission package.

For more information about this requirement, see Prefast for Drivers Test.
Right-click Prefast for Drivers, and click Edit Parameters.

Enter the path to the Prefast for Drivers results file as described
in the Prefast for Drivers test documentation. When the Prefast for Drivers parameters are complete, close the Parameters windows.

Note If your submission contains a kernel-mode device driver or
kernel-mode service, the Prefast for Drivers results file is required
for Logo or Unclassified Signature. Refer to the Windows Logo Program guide for more information about this requirement.

To schedule the Unclassified Submission jobs, do the following:
Click Add Selected, and then click Schedule Jobs.
Note At this point, you can return to the Job Monitor and observe job completion.
From the Device Console, click the Status button to launch the Submission Status Tool.

After the submission jobs are complete, create a submission package.
Open Device Console, and in the Available Devices window on the left,
right-click the submission name that you created earlier.

Click Create Submission Package.

In the Save File dialog box, type a name for the submission, and then click Save.
Important This is the file that you will submit to Microsoft along with your driver package.


/******************************************************************************/

Submitting Logo Test Results

The final step required to obtain a “Designed for Microsoft Windows” logo is to
submit your successful logo test results to Microsoft’s Windows Hardware Quality Labs (WHQL).

To create a package and submit your logo test results Right-click the main node in tree-view of the Device Console window and select Create Submission Package.

Select a location and name for the cabinet file that contains the results
of the successful logo tests.

Click Save to save the file.

Now download WinQual uploader tool from WHQL website to create the XML and Cab files.

Then Put a digital stamp on that using verisign technique.
You can goto my blog http://yera-raj.blogspot.com/2008_04_01_archive.html for verisign steps.


Go to the WHQL Web site and follow the instructions there to submit your package.

Note You can check on the status of your submission by logging back into the same website

Sunday, April 27, 2008

Verisign Instructions for digitally signing a CAB file

I will soon update this space with the elaborate process details................

Here i am .......


Please follow these steps on how to sign a file using signcode.exe…

Put the following files in a folder called c:\keys

Signcode.exe
myfile.cab or anyfile.exe (this is the file that you want to sign)
myprivatekey.pvk
// you should have .pvk and .spc files. If you dont please get them from //verisign , its a paid process.
mycredentials.spc
Open up a DOS window by going to Start, Run, Type “cmd.exe”, Press Enter
In the DOS Window enter the following…
Type: c:
Press Enter
Type: cd\ and then Press Enter
Type: cd keys
Press Enter
The prompt should now read.... c:\keys

Type in the following command on one line and press enter...

signcode -spc mycredentials.spc -v myprivatekey.pvk -t http://timestamp.verisign.com/scripts/timstamp.dll myfile.cab

You will then be prompted for the password that Verisign has assigned to you. If the result says, succeeded, then the file has been signed. If there is any error, try to make sure that the file names match the names that you copied to the c:\keys folder on your computer.

Here is the Getting Started guide that walks you through the registration and submission process…
http://www.microsoft.com/whdc/getstart/qualify.mspx

Thursday, April 24, 2008

Hi,

Its been a long time since i was thinking of being a bit active for updating my blog regularly.....but as they say ...better late than never........so here i am...............

I will put technical,philosophical,entertaining stuff and as the time will progress it will become better and better place for blogging....so with hopes in my heart i start...

Tuesday, March 11, 2008

Hi,

This is my first Blog.....