Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Tuesday, February 1, 2011

Share printer from Windows XP from Windows 7

One common problem I have run into with clients is trying to share a printer connected to a Windows XP machine with Windows 7. There are lots of people out there that have USB connected printers attached to one computer, usually a Windows XP machine.

If you get a new laptop running Windows 7, it makes sense to share that printer so that any computer can print to it. Unfortunately, trying to print to an shared printer on XP from Windows 7 is not as simple as it should be !

continue reading

How to Host MultiSpeak Web Services on Your Windows PC?

You can load the MultiSpeak web service definitions on a local PC for convenience. In order to do so you must have Microsoft's Internet Information Server (IIS) loaded on the PC.

How to install IIS and load the MultiSpeak web services on Windows XP Professional:


  1. Insert the Windows XP Professional CD-ROM into your CD-ROM drive.
  2. From the Start Button, go to Settings, and then Control Panel.
  3. In the Control Panel window, select Add/Remove Programs.
  4. In the Add/Remove window, select Add/Remove Windows Components.
  5. In the Wizard window, check Internet Information Services, leaving all of the default installation settings intact. Click NEXT. Wait for Windows to finish loading IIS, then click FINISH.
  6. An Inetpub folder will be created on your hard drive.
  7. Open the Inetpub folder and find the folder named wwwroot.
  8. Unzip the file named MultiSpeakBusArchitecture Vxxx MMDDYY.zip into the wwwroot folder (where Vxxx is the version name, e.g. V30qb for Version 3.0, bus build q, and MMDDYY is the date of the release).
  9. Next we would like to make sure that the web server is running. Open the Control Panel, then Administrative Tools, and double-click on the "Internet Information Services" icon. While in the Internet Information Services window, click the plus sign next to the name of your computer to expand the tree view, then click the plus sign on the "Web Sites" entry to expand that entry, and finally expand the "Default Web Site" entry by clicking its plus sign. Right click on "Default Web Site" and make sure that the word "Start" is greyed out; if not, click on "Start" to start the localhost web server.
  10. Next we want to create a virtual directory for the MultiSpeak web services. Right click on the "Default Web Site" entry, choose "New" and then "Virtual Directory" from the menu. A Virtual Directory Creation Wizard window will open. Follow the instructions to create a new virtual directory. Begin by choosing an alias name for the directory. For this example I will use the alias to be "MultiSpeakWebServices", but you could use any folder name you like. Click NEXT. The Virtual Direction Creation wizard will open. Next browse to the directory that was created when you unzipped the web services in the C:/Inetpub/wwwroot folder in step 8. It should have the same name as the zip file you unzipped in step 8. Click the NEXT button to accept the directory. Next the wizard will ask you to choose "Access Permissions". Accept the default access permissions by clicking the "Next" button, and then the "Finish" button to complete the wizard. The Internet Information Services window should now show a new entry under the "Default Web Sites" tree entry that is named "MultiSpeakWebServices" (or whatever name you chose when you created the new virtual directory in this step).
  11. In the Internet Information Services Manager window, right click on the new virtual directory that you just created, choose properties, and the ASP.NET tab in the Properties window. Make sure that the ASP.NET version is 2.0 or higher. If the ASP.NET tab does not exist, or if ASP.NET version 2.0 or higher is not an option from the pull down menu in the ASP.NET version box, then you will have to download the .NET Framework Version 2.0 or higher from the Microsoft web site. You can get the .NET Framework Version 2.0 download from: http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en . This will download a file named dotnetfx.exe. Follow the setup wizard to install dotnetfx.exe and repeat this step to ensure that the virtual directory defaults to ASP.NET version 2.0 or higher.
  12. Open your browser and type in http://localhost/MultiSpeakWebServices/IndexPage.aspx . If you chose a different name than "MultiSpeakWebServices" for your new virtual directory in step 11, substitute that name in the URL shown above (for instance if you used "MyNewVirtualDirectory" instead of MultiSpeakWebServices" the URL would be http://localhost/MyNewVirtualDirectory/IndexPage.aspx .
  13. The opening index page for the Web services should come up.


 

Sorting the methods alphabetically

If the web service methods are not displayed alphabetically, you can force ASP.NET to sort the methods by modifying the DefaultWsdlHelpGenerator.aspx page which is used to create that test page (%windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG\DefaultWsdlHelpGenerator.aspx).  ASP.NET gathers up the description information for the requested web service/asmx and passes that data to the help generator page.  You can modify this page however you see fit (or you can tell ASP.NET to look in a different location for the generation page by modifying the machine.config's system.web/webServices/wsdlHelpGenerator node).

If you look in this file, you'll see around line 1285:

        Hashtable methodsTable = new Hashtable();
        operationExists = false;
        foreach (ServiceDescription description in serviceDescriptions) {
                foreach (PortType portType in description.PortTypes) {
                        foreach (Operation operation in portType.Operations) {
                                string messageName = operation.Messages.Input.Name;
                                if (messageName == null || messageName.Length == 0) messageName = operation.Name;
                                if (messageName == operationName)  operationExists = true;
                                if (messageName == null) messageName = String.Empty;
                                methodsTable[messageName] = operation;
                        }
                }
        }
        MethodList.DataSource = methodsTable;

The code is creating a hashtable of all of the methods available in the Web service and is then binding the repeater you see on the test page that lists all of the methods to this hashtable.  This sheds light one why the methods appear to be in no particular order on the test page: the code is enumerating a Hashtable rather than an ordered list, so the ordering is at the mercy of the hash values generated for messageName and thus the buckets into which the operations are placed.

To get the methods listed in alphabetical order, all we need to do is make a one line change, from:
        Hashtable methodsTable = new Hashtable();
to
        SortedList methodsTable = new SortedList();

Instead of being placed into a Hashtable, the operations will all be placed into the SortedList, indexed by messageName.  When MethodList is bound to methodsTable (which we would probably also want to rename just for clarity's sake), methodsTable will be enumerated in alphabetical order (thanks to SortedListEnumerator), and thus the methods listed on the test page will be in alphabetical order.

continue reading

How to convert your data files from .bt1 format to .raw and .gsas formats?

You will need to download the 2 files (gformat.exe and proprep.exe) contained on the main page. Put them into a folder that you will work from on your computer. You may also want to download the cmpr file which will enable you to examine all data before you convert.



 

From the start menu select 'Run'.

Type 'cmd' in the dialog box and click 'OK'

This should have opened a separate window. Now you need to get to your files.

Type 'cd' in the command file and then type the exact location of where the files you want to work with are. Example: cd C:\username\mydocuments\userfile\

Then press enter, you should now be in this directory. If this doesn't work then try doing this gradually, first type 'cd C:' and enter, then type 'cd username' and enter etc etc until you are in the correct folder.

Once in your folder you can view and convert your files as normal. By putting your gformat and proprep conversion files into this same folder you can keep everything together and do all data conversions at once.


 

In order to correctly convert your data files you must first use Proprep to produce a .raw file. This must be done to ensure that the first few points from the first 3 detectors are dropped correctly, accounting for any excess background from the incident beam. Once the .raw file has been created the file can then be converted into a .gsas file using the gformat program. You can do this for just one file or you use the gformat program to sum together multiple files.


 

There are standard procedures which MUST be followed by ALL users in order to maintain good and correct data from BT-1. The system is set-up so that no data is missed and standard deviations are correctly computed. This also ensures the best data for publications. Please, please follow this method of converting your data and refrain from taking shortcuts.


 

To create your .raw file using proprep:


 

In the command line, type 'proprep filename.bt1' where filename represents your specific filename. Example 'proprep file1001.bt1'. Then press enter.


 

The system will then ask you to enter a cut-off value. The default for this is 3, this should be kept as the default. This is the point at which the system removes the first few points from the first 3 detectors, you do not need anymore to be removed and you should not want any less, so keep this at 3. Press enter. Your .raw file has been created. You can check this by looking at the files in the current directory (type 'dir' to do this).


 

To create your .gsas file using gformat:


 

In the command line type 'gformat filename' and then press enter. Note that here you do not need to add the file type – it assumes a .raw file is being converted. If you have not already created the .raw file it will not recognize the command.


 

If you would like to sum multiple files then you should type 'gformat –s filename1 filename2 filename3' and press enter – this will sum the three files named and create one file in the .gsas format. Please note that only when ALL procedures have been followed should you sum files. These procedures are detailed below.


 

1)  Examine ALL data sets using cmpr in a multidetector mode, to make sure that there are no problems with the raw data (check detector overlap).

 
 

2)  Examine ALL data sets to be combined using cmpr in a pseudo-1-detector mode (i.e., plotted on top of one another) to ensure that they are, in fact, the same.


 

3)  If necessary, you must be able to edit the file.raw data to mark any points you want to delete.  There are separate programs for doing this. Using your chosen editor (Emacs or Vi for example) simply place a minus sign (-) before the points to be deleted and the conversion programs will ignore these points.

 
 

4) Data sets MUST be added using gformat if they are of unequal length (e.g., 201 pts and 188 pts) in order to put the right esd's in the data file.


 


 

Other commands of interest.


 

'dir' – displays all files located within the current folder/directory.

'cd' – change directory. Type the name of the directory you would like to go to – note that it must be a directory contained with the current one.

'cd ../' - change to the directory one above the current directory.

'more file1001.bt1' – displays the exact detector information for the file file1001. Allows you to view the settings, temperature recorded and look at intensities etc. You can use the space bar to go through the file. Press 'q' to get out of this file.

'cmpr' – open up the cmpr program to view the plot and examine the data. You must exit from cmpr before continuing in the cmd window.


 


 

continue reading

NTFS Vs FAT

To NTFS or not to NTFS—that is the question. But unlike the deeper questions of life, this one isn't really all that hard to answer. For most users running Windows XP, NTFS is the obvious choice. It's more powerful and offers security advantages not found in the other file systems. But let's go over the differences among the files systems so we're all clear about the choice. There are essentially three different file systems available in Windows XP: FAT16, short for File Allocation Table, FAT32, and NTFS, short for NT File System.


FAT16
The FAT16 file system was introduced way back with MS–DOS in 1981, and it's showing its age. It was designed originally to handle files on a floppy drive, and has had minor modifications over the years so it can handle hard disks, and even file names longer than the original limitation of 8.3 characters, but it's still the lowest common denominator. The biggest advantage of FAT16 is that it is compatible across a wide variety of operating systems, including Windows 95/98/Me, OS/2, Linux, and some versions of UNIX. The biggest problem of FAT16 is that it has a fixed maximum number of clusters per partition, so as hard disks get bigger and bigger, the size of each cluster has to get larger. In a 2–GB partition, each cluster is 32 kilobytes, meaning that even the smallest file on the partition will take up 32 KB of space. FAT16 also doesn't support compression, encryption, or advanced security using access control lists.

FAT32
The FAT32 file system, originally introduced in Windows 95 Service Pack 2, is really just an extension of the original FAT16 file system that provides for a much larger number of clusters per partition. As such, it greatly improves the overall disk utilization when compared to a FAT16 file system. However, FAT32 shares all of the other limitations of FAT16, and adds an important additional limitation—many operating systems that can recognize FAT16 will not work with FAT32—most notably Windows NT, but also Linux and UNIX as well. Now this isn't a problem if you're running FAT32 on a Windows XP computer and sharing your drive out to other computers on your network—they don't need to know (and generally don't really care) what your underlying file system is.

The Advantages of NTFS
The NTFS file system, introduced with first version of Windows NT, is a completely different file system from FAT. It provides for greatly increased security, file–by–file compression, quotas, and even encryption. It is the default file system for new installations of Windows XP, and if you're doing an upgrade from a previous version of Windows, you'll be asked if you want to convert your existing file systems to NTFS. Don't worry. If you've already upgraded to Windows XP and didn't do the conversion then, it's not a problem. You can convert FAT16 or FAT32 volumes to NTFS at any point. Just remember that you can't easily go back to FAT or FAT32 (without reformatting the drive or partition), not that I think you'll want to.

The NTFS file system is generally not compatible with other operating systems installed on the same computer, nor is it available when you've booted a computer from a floppy disk. For this reason, many system administrators, myself included, used to recommend that users format at least a small partition at the beginning of their main hard disk as FAT. This partition provided a place to store emergency recovery tools or special drivers needed for reinstallation, and was a mechanism for digging yourself out of the hole you'd just dug into. But with the enhanced recovery abilities built into Windows XP (more on that in a future column), I don't think it's necessary or desirable to create that initial FAT partition.

When to Use FAT or FAT32
If you're running more than one operating system on a single computer, you will definitely need to format some of your volumes as FAT. Any programs or data that need to be accessed by more than one operating system on that computer should be stored on a FAT16 or possibly FAT32 volume. But keep in mind that you have no security for data on a FAT16 or FAT32 volume—any one with access to the computer can read, change, or even delete any file that is stored on a FAT16 or FAT32 partition. In many cases, this is even possible over a network. So do not store sensitive files on drives or partitions formatted with FAT file systems

continue reading