Archive for the 'microsoft' Category
Excel and php without activeX
By Justin Silverton
Introduction
Spreadsheet_Excel_writer is a PEAR component for creating Excel files without the need for COM components. The files generated are in the Excel 5 (BIFF5) format, so all functionality until that version of Excel (but not beyond) should be available.
Using
The most common use for Spreadsheet_Excel_Writer will be spitting out large (or not so large) amounts of information in the form of a spreadsheet, which is easy to manipulate with a fairly ubiquitous spreadsheet program such as Excel (or OpenOffice).
Example 1:
send(’test.xls’);
// Creating a worksheet
$worksheet =& $workbook->addWorksheet(’My first worksheet’);
// The actual data
$worksheet->write(0, 0, ‘Name’);
$worksheet->write(0, 1, ‘Age’);
$worksheet->write(1, 0, ‘John Smith’);
$worksheet->write(1, 1, 18);
// Let’s send the file
$workbook->close();
?>
The first thing you should notice, is that we created a workbook before any worksheets. All worksheets are contained within a workbook, and a workbook may contain several worksheets.
Another important thing, which you should have in mind when programming with Spreadsheet_Excel_Writer, is that ampersand sign (&) that appears when we created our worksheet. That ampersand means we are referencing a Worksheet object instead of copying it. If you don’t know what that means, don’t worry, all you have to remember is to always use ampersands when calling addWorksheet() for creating a worksheet, or addFormat() for creating a format.
Saving to a regular file
You may have noticed also the following line:
// sending HTTP headers
$workbook->send(’test.xls’);
What that means is that we are sending our spreadsheet to a browser. But what if we just want to save the spreadsheet in our machine? Well, you just have to omit that line and give a valid file path to the workbook constructor.
For example, if we wanted to save the same spreadsheet we created in our first example to a file named ‘test.xls’, we would do it like so:
Example 2:
addWorksheet(’test worksheet’);
$worksheet->write(0, 0, ‘Name’);
$worksheet->write(0, 1, ‘Age’);
$worksheet->write(1, 0, ‘John Smith’);
$worksheet->write(1, 1, 10);
// We still need to explicitly close the workbook
$workbook->close();
?>
More info and documentation on this component can be found here
2 commentsUsing the iis 6 ftp service

By Justin Silverton
Install Internet Information Services and the FTP Service
Because FTP depends on Microsoft Internet Information Services (IIS), IIS and the FTP Service must be installed on the computer. To install IIS and the FTP Service, follow these steps.
NOTE: In Windows Server 2003, the FTP Service is not installed by default when you install IIS. If you already installed IIS on the computer, you must use the Add or Remove Programs tool in Control Panel to install the FTP Service.
1. Click Start, point to Control Panel, and then click Add or Remove Programs.
2. Click Add/Remove Windows Components.
3. In the Components list, click Application Server, click Internet Information Services (IIS) (but do not select or clear the check box), and then click Details.
4. Click to select the following check boxes (if they are not already selected):
Common Files
File Transfer Protocol (FTP) Service
Internet Information Services Manager
5. Click to select the check boxes next to any other IIS-related service or subcomponent that you want to install, and then click OK.
6. Click Next.
7. When you are prompted, insert the Windows Server 2003 CD-ROM into the computer’s CD-ROM or DVD-ROM drive or provide a path to the location of the files, and then click OK.
8. Click Finish.
IIS and the FTP service are now installed. You must configure the FTP Service before you can use it.
Configure The FTP Service
To configure the FTP Service to allow only anonymous connections, follow these steps: 1. Start Internet Information Services Manager or open the IIS snap-in.
2. Expand Server_name, where Server_name is the name of the server.
3. Expand FTP Sites
4. Right-click Default FTP Site, and then click Properties.
5. Click the Security Accounts tab.
6. Click to select the Allow Anonymous Connections check box (if it is not already selected), and then click to select the Allow only anonymous connections check box.
When you click to select the Allow only anonymous connections check box, you configure the FTP Service to allow only anonymous connections. Users cannot log on by using user names and passwords.
7. Click the Home Directory tab.
8. Click to select the Read and Log visits check boxes (if they are not already selected), and then click to clear the Write check box (if it is not already cleared).
9. Click OK.
10. Quit Internet Information Services Manager or close the IIS snap-in.
The FTP server is now configured to accept incoming FTP requests. Copy or move the files that you want to make available to the FTP publishing folder for access. The default folder is drive:\Inetpub\Ftproot, where drive is the drive on which IIS is installed.
adding a virtual directory
This is probably one of the most confusing issues with the IIS ftp service. To create a virtual directory, do the following:
1) right click your new ftp server that you created from above (in iis manager) and go to new->virtual directory.
2) it will ask you for the alias (how people will access this directory and the location (which is the actual physical directory on your harddrive).
3) after this is created, you may try to login to your ftp server and see if your directories are listed. They won’t be there.
4) Most FTP server use the actual file structure of your system to determine what directories to display to the user.
To allow your virtual directories to be seen, go into the home directory of your ftp site and create an empty directory with same name as your virtual one (the alias).
This works virtual directories take precidence over file-system directories.
No commentsIs the End of Microsoft Near?
By Justin Silverton
Microft has had a pretty good run. They have gone from a small development shop in the late 1970s and early 80s to the largest software company in the world.
One of the reasons the windows operating system can now be seen on 80% of the world’s computers is because of developer support. Any programmer from novice to expert has the ability to write an application and release it on the windows platform.
Recently, an article appeared over at boing boing: (http://www.boingboing.net/2006/01/30/msft_our_drm_licensi.html)
Here is an excerpt:
“Microsoft’s DRM requires that device makers pay Microsoft a license fee for each device that plays back video encoded with its system. it also requires every such vendor to submit to a standardized, non-negotiable license agreement that spells out how the player must be implemented. This contract contains numerous items that limit the sort of business you’re allowed to pursue, notably that you may not implement a Microsoft player in open source software.
The bombshell was Amir’s explanation of the reason that his employer charges fees to license its DRM. According to Amir, the fee is not intended to recoup the expenses Microsoft incurred in developing their DRM, or to turn a profit. The intention is to reduce the number of licensors to a manageable level, to lock out “hobbyists” and other entities that Microsoft doesn’t want to have to trouble itself with.”
This is a step in the wrong direction and it really makes me wonder why in their right mind they would even consider doing this.
I guess it shouldn’t come as a surprise. With Microsoft’s track record as a convicted monopolist and their blatent strongarm tactics in the hardware and software industry, another step towards world domination of total domination is only inevitable.
what alternatives do we have?
1) Linux
I started using linux back in 96, when there was no such thing as kde (I believe KDE was just starting out as a project) or gnome and most people you ask would have no idea what linux even is. It has come a long way in 10 years, but I don’t think it is ready to take the place of windows yet.
Don’t get me wrong. Linux is a great operating system. I wish I could throw away all of my insecure and buggy windows machines tomorrow and never look back, but it’s just not possible at this point. I think one of the main reasons I’m still using microsoft products, is driver support.
This isn’t the fault of the developing force behind linux, but of the sheer force of windows. Most manufacturers don’t want to put research and development into writing a driver for linux. The end result is a constant battle to keep up with the many pieces of hardware that need to be supported. Many drivers are created by reverse-engineering an existing driver.
If more manufacurers started supporting linux (at least 90%) It could be a Microsoft killer.
interested in linux? find a distro Here
2) OS X
OS X could very well be the next windows killer. In the past year or so, apple announced their compatibility with OS X and the intel platform. Although in its current state, os x cannot run on an out of the box PC, what’s to stop it from doing so in the future? This could all be in apple’s plan.
1) release intel version of os x
2) get driver support from manufacturers and fix compatiblity issues
3) profit
an interesting link about macs booting windows XP
more info on intel mac os x
6 commentsHow to make an exchange auto-install CD
By: Daniel Petri
You can configure Exchange 2000/2003 to install without having to manually enter the CD key during the setup process.
First, you should copy your Exchange 2000/2003 setup files from your CD to your hard drive.
Find a file called Setup.sdb (which is found in the \SETUP\I386 subfolder). Right click the file, select Properties, and remove the Read-only checkmark. Now open the file to edit it.
Look inside your Setup.sdb file for a section called
[Product Information]
In that section, look for a line beginning with:
DefaultPid30=
If you cannot find such a line, insert a new empty line somewhere in that section, and paste the new value in the following format:
DefaultPid30=ABCDE-FGHIJ-KLMNO-PQRST-UVWXY
note: Use your own CD key, the above string is just an example!
Save the file, burn the whole folder that contains the installation files to a CD.
That’s it! Now you can now install Exchange 2000/2003 without needing to supply a CD key during the setup process!
How to change the product key on windows 2003
By: Daniel Petri
Warning!
This document contains instructions for editing the registry. If you make any error while editing the registry, you can potentially cause Windows to fail or be unable to boot, requiring you to reinstall Windows. Edit the registry at your own risk. Always back up the registry before making any changes. If you do not feel comfortable editing the registry, do not attempt these instructions. Instead, seek the help of a trained computer specialist.
Note: Microsoft recommends that you run System Restore to create a new restore point before you complete the following steps:
1) Click Start, and then click Run.
2) In the Open box, type Regedit, and then click OK.
3) In the left pane, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\Current Version\WPAEvents
4) In the right pane, right-click OOBETimer, and then click Modify.
5) Change at least one digit of this value to deactivate Windows.
6) Click Start, and then click Run.
7) In the Open box, type the following command, and then click OK.
%systemroot%\system32\oobe\msoobe.exe /a
8) Click Yes, I want to telephone a customer service representative to activate Windows, and then click Next.
9) Click Change Product key.
10) Type the new product key in the New key boxes, and then click Update. If you are returned to the previous window, click Remind me later, and then restart the computer.
11) Repeat steps 6 and 7 to verify that Windows is activated. You receive the following message:
12) Windows is already activated. Click OK to exit.
13) Click OK.
2 comments




