Tuesday, April 17, 2007

Bookmark Bliss: The Developer Cheat Sheet Compilation

This is a post I put together a few months back for one of my friends blogs before I got started doing things myself. I guess he wasn’t much for blogging longevity and sort of gave up before he even began. Like my article on 50 sources for web design inspiration, this list comes primarily from my years of accumulated bookmarks. I think this article was a great resource though and is one I think Fuzzy Future readers will be interested in, so I decided to post it here as well so it didn’t go extinct. I’ve added some new stuff I’ve found since the original posting so hopfully this is as useful to you as it has been for me…

I know personally, I’m not one of those people that can remember every detail of every language without looking things up. It’s nice to have a cheat sheet with a quick summary of some of the most commonly used procedures, tags, tools, syntax, etc, saving time that would have been used to look it up on Google or dig through documentation either online or in printed text. The following is a list of links to several different cheat sheets on a wide variety of tasks and tools. You can print them out and hang them on your wall (my personal choice) or simply bookmark them for easy access down the road. If you have any additional suggestions or see something I’ve missed, let me know…

Command Line

  1. Windows NT/XP Command Line Reference
  2. Bash Command Line Reference
  3. Bash Command Line Programming Reference
  4. DOS Commands

Databases

  1. Firebird SQL Cheat Sheet
  2. MySQL Cheat Sheet
  3. MySQL Reference List
  4. Oracle Cheat Sheet
  5. Oracle PL/SQL Cheat Sheet
  6. Oracle 9i Server Reference (PDF)
  7. Oracle 9i Command Reference
  8. PostgreSQL Cheat Sheet
  9. PostgreSQL Cheat Sheet List
  10. SQL Cheat Sheet
  11. SQL Server 2005 Commands

Programming

  1. Ada Syntax Card (PDF)
  2. ASP/VBScript Cheat Sheet
  3. C++ Language Summary
  4. C++ Reference Sheet (PDF)
  5. C++ Containers Cheat Sheet
  6. C# Language Reference
  7. C# Programmer’s Reference Sheet
  8. Delphi Technical Reference Card (PDF)
  9. Java Syntax Cheat Sheet
  10. Java Quick Reference (PDF)
  11. Java Reference for C++
  12. JSP 2.0 Syntax Reference Sheet (PDF)
  13. LaTeX Reference Card (PDF)
  14. .NET Cheat Sheets
  15. Perl Cheat Sheet
  16. Perl Reference Card (PDF)
  17. Perl Regular Expression Quick Reference (PDF)
  18. Perl Reference Guide
  19. PHP Cheat Sheet
  20. PHP Developer Cheat Sheet
  21. Python 101 Cheat Sheet
  22. Python 2.5 Quick Reference
  23. Python Cheat Sheet
  24. Python Quick Reference (PDF)
  25. Ruby Cheat Sheet (PDF)
  26. Ruby on Rails Cheat Sheet Collectors Edition
  27. Ruby Reference
  28. Ruby on Rails Reference Sheet

Unix/Linux

  1. Debian Linux Reference Guide (PDF)
  2. Linux Shortcuts and Commands
  3. One Page Linux Manual (PDF)
  4. TCP Ports List
  5. Treebeard̢۪s Unix Cheat Sheet
  6. Unix Command Line Tips

Web Development

  1. Actionscript 2.0 Cheat Sheet (PDF)
  2. Actionscript 3.0 Cheat Sheet (PDF)
  3. Cold Fusion Cheat Sheet
  4. CSS Cheat Sheet
  5. CSS 2 Reference Card (PDF)
  6. CSS Reference Sheet
  7. CSS Shorthand Guide
  8. CSS Useful Properties
  9. Drupal 4.7 Cheat Sheet
  10. .htaccess Cheat Sheet
  11. HTML Cheat Sheet
  12. HTML Dom Quick Reference Card (PDF)
  13. Javascript Cheat Sheet
  14. Javascript Quick Reference
  15. Javascript Reference Page * No Longer Available
  16. JQuery Cheat Sheet (PDF)
  17. JQuery Reference (PDF)
  18. JQuery Visual Map
  19. Mod_Rewrite Cheat Sheet
  20. Scriptaculous Combination Effects Field Guide (PDF)
  21. XHTML Cheat sheet
  22. XHTML Reference
  23. XHTML & HTML Cheat Sheet
  24. XML Syntax Quick Reference (PDF)
  25. XML Schema Reference (PDF)
  26. XSLT and XPath Quick Reference (PDF)

Miscellaneous Topics

  1. Ascii Codes Cheat Sheet
  2. CVS Cheat Sheet
  3. EMacs Keyboard Shortcut Reference
  4. Regular Expressions Cheat Sheet
  5. RGB Hex Colour Chart
  6. Subversion Quick Reference (PDF) * No Longer Available
  7. Theoretical Computer Science Cheat Sheet (PDF)
  8. UML Quick Reference Card (PDF)
  9. UML Cheat Sheet
  10. Vi Cheat Sheet
  11. Vim Commands Cheat Sheet
  12. XEmacs Commands Cheat Sheet

Have you found this list useful? If so, show your support by subscribing to our news feed. We’ve posted several other entries in our Bookmark Bliss series that you might find interesting as well…

  1. Bookmark Bliss: 50 Sources for Web Design Inspiration
  2. Bookmark Bliss: The Developer Cheat Sheet Compilation
  3. Bookmark Bliss: 30 Web Developer Community Forums
  4. Bookmark Bliss: 101+ Stock Image Resources

As always, your comments are welcome and please let us know of any sites we might have missed.

Monday, April 09, 2007

Java Sand Box

A security measure in the Java development environment. The sandbox is a set of rules that are used when creating an applet that prevents certain functions when the applet is sent as part of a Web page. When a browser requests a Web page with applets, the applets are sent automatically and can be executed as soon as the page arrives in the browser. If the applet is allowed unlimited access to memory and operating system resources, it can do harm in the hands of someone with malicious intent. The sandbox creates an environment in which there are strict limitations on what system resources the applet can request or access. Sandboxes are used when executable code comes from unknown or untrusted sources and allow the user to run untrusted code safely.

The Java sandbox relies on a three-tiered defense. If any one of these three elements fails, the security model is completely compromised and vulnerable to attack:

  • byte code verifier -- This is one way that Java automatically checks untrusted outside code before it is allowed to run. When a Java source program is compiled, it compiles down to platform-independent Java byte code, which is verified before it can run. This helps to establish a base set of security guarantees.
  • applet class loader -- All Java objects belong to classes, and the applet class loader determines when and how an applet can add classes to a running Java environment. The applet class loader ensures that important elements of the Java run-time environment are not replaced by code that an applet tries to install.
  • security manager -- The security manager is consulted by code in the Java library whenever a dangerous operation is about to be carried out. The security manager has the option to veto the operation by generating a security exception.

Software Patch Makes Car More Fuel-efficient

Science Daily A car wastes energy almost continuously. Whether it is running in first, second, or a higher gear, there is only one position of the accelerator that guarantees optimal performance. Accelerating a little less or a little bit more can cause considerable loss of energy. John Kessels has designed a way to save energy by enabling the car to achieve optimal engine performance more frequently. With a relatively small modification it is possible to reduce fuel consumption by 2.6%. Kessels obtained his doctorate from the Technical University Eindhoven (TU/e) on Wednesday February 14, 2007.

Car manufacturers are frequently criticized for failing to reduce fuel consumption. In order to meet the Kyoto objectives, European car manufacturers have agreed to reduce the emission of CO2 for their fleet to 140 grams per kilometer in 2008. Many car manufacturers have not yet attained this reduced emission. Ford is one of them and the company has been diligently searching for a way to further increase the fuel-efficiency of its cars.

Hybrid cars

One way to reduce fuel consumption is to build so-called hybrid cars. In these cars the internal combustion engine is more fuel-efficient because a secondary power source is available: a generator. If the power from the combustion engine exceeds the actual power demand for driving, this generator stores the excess power in the car’s battery. It also works the other way around. The generator can provide extra power if the car needs more power than the combustion engine can provide at optimum performance. Hybrid vehicles thus reduce fuel consumption by 25% or more.

Electric energy systems

Kessels examined the possible savings without using the advanced hybrid technology. He found that excess power can be used to charge the car battery. In addition, the generator, which charges the car battery, can be turned off when it is inefficient for the engine to power it, which leads to reduced fuel consumption. The car can also brake electrically, generating energy, which can be stored in the battery. Finally, he found that it is possible to partly shut off the electric energy systems, such as rear window and seat heating, for further improvement of the power supply system.

Software patch

With his new method Kessels can achieve a total fuel savings of 2.6%, without having to replace any of the parts of the car. Simply uploading a software patch to the car’s computer and adding one single small cable suffices. If it were possible to shut the engine off when it is idle, a savings of 5 to 6% could be achieved. This, however, would require significant adjustments to the car, including installing a more powerful starter motor and an automatic gearbox.

Note: This story has been adapted from a news release issued by Eindhoven University of Technology.

Sunday, April 08, 2007

Adobe Systems Inc. on Jan. 29 announced that it has released the full PDF (Portable Document Format) 1.7 specification to AIIM, the Association for In

Q&A:Adrian Ford, CTO of Global Graphics, explains the specification that Microsoft is developing with his company's help.


Adrian Ford At the WinHEC keynote in April, Microsoft Corp. founder Bill Gates previewed Metro, the company's next-generation, XML-based, electronic-document initiative that is expected to become available at around the same time Windows Longhorn is released.

In conjunction with Microsoft's announcement of Metro, UK-based software company Global Graphics announced that for the last two years it has been working closely with Microsoft to develop Metro's specifications. At WinHEC, Global Graphics demonstrated ways in which the printing industry might make use of Metro once it becomes available.

Recently, PDFzone sat down with Dr. Adrian Ford, Global Graphics' chief technology officer, to discuss Metro's functionalities and his company's involvement with its development.

PDFzone: Please give us an overview of Metro.

Ford: Metro is really three different things in one.

First off, it's a new document file format, similar in many ways to PDF.

It's also a spool format. When you print on a Windows or a Mac computer, the print system has a format that it uses to communicate the data through the print subsystem and spool it to the device.

And it's also a page description language, similar to PCL PostScript, that can be used to transmit that information all the way down to a printer, where it turns into the data that comes out on a piece of paper.

In addition to this format, there is also a new printing subsystem. Microsoft announced they're fixing a number of the printing bottlenecks and issues in the current Windows subsystem by implementing a new architecture for printing that includes Metro as a key foundation of that architecture.

PointerClick here to read more about Microsoft's "Metro" and analysts' reactions to the demonstration at WinHEC.

PDFzone: Given that it is expected to become available at the same time as Longhorn, is Metro specifically being designed for Longhorn?

Ford: It's tied to Longhorn, but it's part of what [Microsoft is] calling WinFX. WinFX is going to be available on Longhorn, Windows XP and Windows 2003. So the time scales are the same as Longhorn, but the potential install base is much bigger than the Longhorn platform.

PDFzone: When did Microsoft approach you to work on Metro, and for what reasons do you believe the company wanted to work with you?

Ford: We've been working closely with [Microsoft] since early 2003. One of the reasons they came to us and asked us to help them is honestly because we have a lot of expertise and experience working with other document formats with the products that we have in the PDF space and also with other PDLs [Page Description Languages], our work with PostScript and PDF RIP [Raster Image Processor] products and technology.

We've also got a very wide and broad customer base. Virtually all of our products go out through OEM and ISV channels, where the technology we provide is built into other people's products. So a lot of the industry's problems and issues that they face, we're very aware of what they are.

One of the things we've been able to do, as well as providing our expertise and feedback to that specification, is to bring a lot of industry issues that our partners experience and make sure that they're addressed in the work that Microsoft is doing. And that consultation work is quite a valuable exercise on both sides for making sure this actually does address real-world issues for the print subsystem on Windows.

PointerClick here to read David Morgenstern's take on Metro.

PDFzone: What sort of work are you doing on behalf of Microsoft for Metro?

Ford: We've been doing work to develop a prototype implementation of our Metro high-performance RIP. This is a component that takes Metro documents and converts those into the raster data needed to print them.

We've been doing that for a number of reasons. One of them is so that we can demonstrate with Microsoft and the industry that you can consume this format in a device. And that was part of a demonstration that we were showing at WinHEC.

We've also been working closely with the hardware vendors in that area. It's given us very valuable feedback into the specification, so there's actually a real implementation behind a lot of the feedback that we give Microsoft from the spec itself.

[In addition], we're also taking the core technology that we're developing and making it available as a reference implementation for the print industry. If you have a third party generating Metro documents, there's a reference implementation that can be used to make sure that the implementation conforms with this print reference. That is quite a wide project that we've been working with them on, but that kind of sums it up.

PDFzone: What is Microsoft's motivation for developing Metro?

Ford: Metro is very tightly related to this thing called WinFX. WinFX is a supplementary or replacement set of APIs that will allow people to develop applications in a way that mixes the best of the rich-client approach, the best of an application that runs on Windows today that has a rich user interface, and mix that with the best of a Web-based application, the kinds of things you get from things like Flickr or Google maps or things like that. [Microsoft] can mix those two development paradigms into one way of generating applications.

WinFX [provides] this new user interface for developers, and that user-interface model is the same as the one used in the Metro format. So there's a very tight linkage there between the ways developers can use the API that Microsoft provides to author documents and user interfaces on the platform.

PDFzone: Is Microsoft trying to compete directly with Adobe with its development of Metro?

Ford: That's a question that, in all honesty, has to be directed at Microsoft and Adobe.

PDFzone: How is Metro similar to PDF?

Ford: [Like PDF], you can have a Metro document that sits on disk and that you share with other people and e-mail around, and that document contains all the graphical data and resources and images and fonts and everything else, and supports compression in an efficient container, and people can view that document in a viewer that isn't related to content creation applications. In that sense the format does have similar characteristics with PDF.

Also, if you look at the specifications for PDF and for Metro they have similar functionalities defined within them.

PDFzone: How does Metro differ from PDF?

Ford: It's mainly the usage things that we see as being different between the two. Who's going to use them and where they're going to use them are big questions at the moment, where they're going to be different.

One of the key things about Metro is the use of it within the print subsystem on Windows. There are number of issues and limitations you have to face printing on Windows. The application developers or printer-driver developers have to work extremely hard to make those things work and to bypass these limitations in the print subsystem.

Today you could have an application that understands RGB wide-gamut photo printing, but the application can't send that data through the print subsystem to a printer because that extra information gets lost. So today you often get software that bypasses the print subsystem, and you can't go file to print nice pictures on your Epson printer. There are a number of real issues that Metro solves on the print side that PDF doesn't solve.

PDFzone: How would Metro fix the aforementioned problem? Please elaborate.

Ford: You can buy fairly cheaply a digital camera that supports a wide gamut, greater than 8-bit RGB color, and you can get very cheaply an ink-jet printer that has got a very wide gamut of color reproduction and [obtain] excellent photographic prints from it.

Right now, if you drop that image into Microsoft Word and hit "file-print," you lose all that extended color information because the print path can't handle it. With Metro that format can handle that extended information in the same way that PDF can. You'll be at the printer in the normal way. Many users won't even realize that Metro is being used, they won't care what's under the hood, but they'll get much better quality of the stuff that they print on the Windows platform.

PDFzone: Describe another way in which Metro solves a specific problem.

Ford: Another example would be making PDFs today. Many people make PDFs in the application they are working in, and they print to Distiller or to something else, and what's happening underneath is that the application is printing through the Windows print subsystem through a thing called the GDI [Graphic Device Interface] print subsystem. A print driver converts that to PostScript, and the PostScript gets converted to PDF.

However, there are a number of features that PDF supports that you can't actually get into the PDF files through that route. An example of that is transparency. Applications like PowerPoint and Word in Office 2003 support transparency, but if you try to make a PDF from those, you don't get that transparency information even though PDF can support that transparency.

Metro will enable people like Adobe or Global Graphics to make better PDFs on the Windows platform. So you can see the print subsystem is being improved by the stuff that Microsoft is doing that will enable that information to be passed down and help people make better PDFs than they can today.

An analogy of that is to say that at the moment there's a four-lane highway, and when that [highway] hits the print subsystem, it becomes a single-track road with passing places. Everything slows down, and you don't get as much data through that pipeline. With WinFX coming, it's very clear that the highway is going to get much wider, but the print subsystem is still this single-track road with passing places. So one of the key things that Microsoft is doing [by developing Metro] is bringing the print subsystem up to a point where it can support the stuff that is coming with WinFX.

PDFzone: Which format do you see as being more viable, PDF or Metro?

Ford: From the Global Graphics perspective, we see segments and markets where both these formats are going to be very important and where they have specific strengths either in the format itself or in the platform that supports that format. From our business point of view, we see having to supply technology that supports both platforms across pretty much all markets. There are things that Metro will provide say a corporate user or environment, for example, and there are a number of things that the whole of the Metro initiative—not just the format, but the bits that go with it—will provide that PDF doesn't and will solve problems that PDF doesn't solve. And there are things that PDF provides that Metro won't.


PDF to become an open, ISO standard


Adobe Systems Inc. on Jan. 29 announced that it has released the full PDF (Portable Document Format) 1.7 specification to AIIM, the Association for Information and Image Management. AIIM, in turn, will start working on making PDF an ISO standard.

In this release, Adobe is opening up the full PDF 1.7 specification as defined in Adobe's PDF Reference Manual. According to Sarah Rosenbaum, Adobe's director of product management, this is the next logical step for Adobe with its PDF formats. In the 14 years since Adobe published the complete PDF specification in 1993, PDF has become a de facto global standard for secure and dependable information exchange and archival storage.

Since 1995, Adobe has participated in various working groups that develop technical specifications for publication by ISO, and worked within the ISO process to deliver specialized subsets of PDF as standards for specific industries and functions. Through these efforts, PDF/Archive (PDF/A) and PDF/Exchange (PDF/X) have already become ISO standards, and PDF for Engineering (PDF/E) and PDF for Universal Access (PDF/UA) are well on their ways to becoming ISO standards.

Additionally, PDF for Healthcare (PDF/H) is an AIIM proposed Best Practice Guide. AIIM already serves as the administrator for PDF/A, PDF/E, PDF/UA and PDF/H.

One reason Adobe is releasing the full PDF 1.7 specification at this time is that so many industry-specific versions of PDF already were ISO standards, Rosenbaum explained. "We see a lot of standards based on PDF format that are specific to industries or archiving. That's great, but for customers want to do documents in PDF, submitting the entire specification will make it easier for them," she said.

From here, a joint committee formed under AIIM will identify issues to be addressed, as well as proposed solutions with the proposed standard. This committee will then develop a draft document that will be presented to a Joint Working Group of ISO for development and approval as an international standard.

By opening up PDF in this manner, Adobe's customers will be more easily able to use PDFs in all their document management programs. Additionally, this move will also "provide an umbrella for the current alphabet soup of Adobe PDF standards," Rosenbaum added. Another factor in Adobe's decision was that with the rise of ODF (open document format), "there's a stronger market trend towards standardizing on open standards ... umbrella."

However, this move by Adobe does not, Rosenbaum asserted, have anything to do with Microsoft's PDF competitor: the Metro format, aka XPS (XML Paper Specification) print path.

XPS, which is now available in Vista, at one time was described as a "PDF killer." In Vista, XPS appears as a printer named "XPS Document Writer." If a user prints to this "printer" from an application, the resulting file will be an XPS Document. XPS is also supported in Office 2007.

Kevin Lynch, Adobe's chief software architect and senior vice president of company's platform business unit, stated: "Today's announcement is the next logical step in the evolution of PDF from de facto standard to a formal, de jure standard. By releasing the full PDF specification for ISO standardization, we are reinforcing our commitment to openness. As governments and organizations increasingly request open formats, maintenance of the PDF specification by an external and participatory organization will help continue to drive innovation and expand the rich PDF ecosystem that has evolved over the past 15 years."

Interestingly, this announcement by Adobe comes just one day prior to the Jan. 30 public release of both Vista and Office 2007 by Microsoft.


-- Steven J. Vaughan-Nichols

Related stories:

Open-source Replicator? Home-built 3-D Printer Could Launch A Revolution, Engineers Say



Science Daily The Altair 8800, introduced in the early 1970s, was the first computer you could build at home from a kit. It was crude, didn't do much, but many historians would say that it launched the desktop computer revolution.


Hod Lipson, assistant professor of mechanical and aerospace engineering, right, and engineering graduate student Evan Malone work with a "Fab@Home" machine in the Computational Synthesis Lab in Upson Hall Feb. 22. On the stage is a Lego tire duplicated by the Fab@Home. (Credit: Lindsay France/University Photography)

Hod Lipson, Cornell assistant professor of mechanical and aerospace engineering, thinks a little machine he calls a Fab@Home may have the same impact.

Some day, Lipson believes, every home will have a "fabber," a machine that replicates objects from plans supplied by a computer. Such devices could change how we acquire common products, he suggests: Instead of buying an iPod, you would download the plans over the Internet and the fabber would make one for you.

Such machines could evolve from the 3-D printers currently used by industrial engineers for "rapid prototyping." They design parts in computer-aided design programs and feed the designs to 3-D printers to make working plastic models. A 3-D printer has a small nozzle that scans back and forth across a surface, depositing tiny droplets of quick-hardening plastic. After each scan, the nozzle moves up a notch and scans again until it has built up the complete object, layer by layer. With multiple nozzles or a means of swapping supply cartridges, the machine can create objects made of many different materials. An electronic circuit, for example, can be made by combining an organic semiconductor, metallic inks and ceramic insulators.

Price tags for these machines average around $100,000, but you can build your own Fab@Home for about $2,300 worth of off-the-shelf parts. The prototype, designed by Evan Malone, a Ph.D. candidate in Lipson's Computational Synthesis Laboratory, is slower than the commercial models, and its resolution, or ability or produce fine detail, is lower, but people are finding practical -- and often unexpected -- uses for it.

Commercial machines can't be modified, which, Lipson says, impedes the progress of the technology, but the Fab@Home is "open source." Anyone can download the plans at http://www.fabathome.org, which is getting about 20,000 hits a day. The site also includes construction hints, ideas for applications, notes on the history of 3-D printing and discussion groups. People are invited and encouraged to make improvements, and a sort of cult is slowly forming.

So far, Lipson says, about a dozen people have said they are building one, and he knows of three that are actually up and running -- two at the University of Washington and one in Innsbruck, Austria. Lipson's group has built several and lent a couple to other researchers.

Some recent developments:

Biologists at Rockefeller University have been using a Fab@Home to deposit slime mold cells in various arrangements to see how the distribution influences their ability to form colony organisms.

The British magazine Auto Express suggests that fabbers could be used to make auto parts, allowing individuals to customize cars in ways that were previously available only to those with large manufacturing facilities.

While the usual expectation is to make solid objects out of epoxy or other quick-hardening plastic, the Fab@Home also can be used with plaster, Play-Doh, silicone, wax (to make forms for casting), low-melting-point metals and a variety of other materials.

Cornell graduate student Dan Periard and Jennifer Yao '08 have been loading commercial frosting into the machine to make cake decorations. It's not frivolous work, Lipson says: Because frosting dissolves in water it can provide temporary support for hollow structures and later be washed away.

A high school student in Kentucky is experimenting with a heated syringe to "fab" with chocolate.

Future fabbing machines will have to shift from one raw material to another in midstream and probably deposit material in three dimensions, not just layers, says Lipson. Research in his lab is taking early steps. Malone has built a machine that uses a rack of interchangeable cartridges to make devices out of several materials at once. So far, it has made a working battery, complete with outer case. Malone's long-range goal is to "print" a complete robot, including limbs, actuators, control circuitry and batteries.

Meanwhile, Lipson says, just as the Altair inspired tinkerers to add disk drives, keyboards and monitors and write operating systems and word processors, perhaps the Fab@Home will inspire new fabbing technology.

Note: This story has been adapted from a news release issued by Cornell University.

Net firms tackle Vista headache

CD being placed in drive, BBC
Some new PC owners have faced problems getting online
Windows Vista is causing problems for some new PC owners hooking up their machine to a broadband connection.

Some old installation discs that simplify the task of configuring a PC for broadband have refused to work on machines loaded with Vista.

One reader was warned by Virgin Media that it would be "weeks" before its software worked with Vista.

Other net service firms have also admitted that the appearance of Vista has caused some hiccups for users.

Disc delays

Microsoft launched the consumer versions of Windows Vista on 30 January and anyone buying a PC since that date is likely to have it installed on their brand new machine.

Many are thought to have suffered the same problem as Swansea-based Rob Evans who found that he could not use his existing Virgin Media account with his new PC from Tesco.

After ringing Virgin for help he was told that Vista support may not be forthcoming for some time.

A spokesman for Virgin Media, formerly NTL/Telewest, admitted that its discs did not yet work with Vista but added that Mr Evans was now using his broadband service.

"We can get people online without the installation disc," he added. "It's not that it does not work, it's just the disc."

The spokesman said that other net service firms were also known to be taking time to get to grips with Vista.

Windows Vista on sale, PA
Microsoft launched Windows Vista to consumers in January
"It's such a big product that to train staff up on it fully and make sure all your services are tested and compliant takes time," he said.

A spokesman for BT said: "I think we are now supporting it though we did have some issues with it."

In particular, he said, Vista was conflicting with the Norton security software that BT sells with some of its broadband bundles.

"That's now been ironed out," he added.

The spokesman said BT had created a help page devoted to Vista to make it easier for people to get their PC connected.

Net service firm Tiscali advises its users to back-up important data on their Vista PC before attempting to connect it to broadband.

Andrew Ferguson, editor at Think Broadband, said: "I suspect Vista is going to break a lot of things as it makes some major changes to how things are done in Windows."

"Many places aren't up to speed with Vista yet," he said.

Programming With the Java XML Digital Signature API

One of the significant new features of the Java Platform, Standard Edition 6 (Java SE 6) is the Java XML Digital Signature API. This API allows you to generate and validate XML signatures. XML signatures are a standard for digital signatures in the XML data format, and they allow you to authenticate and protect the integrity of data in XML and web service transactions.

This article will give you an overview of XML signatures and show you how to use the API in your applications.


Overview of XML Signatures

What is a digital signature? RFC 2828 defines a digital signature as "a value computed with a cryptographic algorithm and appended to a data object in such a way that any recipient of the data can use the signature to verify the data's origin and integrity." JDK 6 includes a cryptographic digital signature API that is described in more detail in a lesson on the security trail in the Java Tutorial.

An XML signature is a digital signature with several key properties. It defines a process and a format for generating digital signatures in the XML format, and it has many additional features. For instance, it allows you to sign more than one piece of data -- in binary or XML -- and to use any underlying cryptographic signature algorithm.

An XML signature can sign arbitrary data, whether it is XML or binary. It can also sign only a portion or a subset of an XML document rather than the entire document. The data to be signed is identified by Uniform Resource Identifiers (URIs). XML signatures are often described as being of one or more of three types:

  • A detached signature is over data that is external to the Signature element. This could be data outside of the document, such as a web page retrieved by way of HTTP, but it could also be data that is in the same document, such as a sibling element of the signature.
  • An enveloping signature is over data that is inside the Signature element.
  • An enveloped signature is a signature that is over data that contains the Signature element itself, such as the entire document.

Perhaps the best way to describe an XML signature is to step through the contents of an example in detail. The example that this article will use is an enveloped XML signature generated over the contents of an XML document, a sample purchase order. The article will also use this sample in the subsequent sections on using the API. XML Sample 1 shows the contents of the purchase order before it is signed.

XML Sample 1




Video Game
10.29


My Name

One Network Drive
Burlington
MA
United States
01803




The resulting enveloped XML signature, indented and formatted for readability, appears in XML Sample 2.

XML Sample 2




Video Game
10.29


My Name

One Network Drive
Burlington
MA
United States
01803











tVicGh6V+8cHbVYFIU91o5+L3OQ=



dJDHiGQMaKN8iPuWApAL57eVnxz2BQtyujwfPSgE7HyKoxYtoRB97ocxZ
8ZU440wHtE39ZwRGIjvwor3WfURxnIgnI1CChMXXwoGpHH//Zc0z4ejaz
DuCNEq4Mm4OUVTiEVuwcWAOMkfDHaM82awYQiOGcwMbZe38UX0oPJ2DOE=




CN=My Name,O=Test Certificates Inc.,C=US


MIIB9zCCAWCgAwIBAgIERZwdkzANBgkqhkiG9w0BAQUFADBAMQswCQYD
VQQGEwJVUzEfMB0GA1UEChMWVGVzdCBDZXJ0aWZpY2F0ZXMgSW5jLjEQ
MA4GA1UEAxMHTXkgTmFtZTAeFw0wNzAxMDMyMTE4MTFaFw0zMTA4MjUy
...







Note that the Signature element has been inserted inside the content that it is signing, thereby making it an enveloped signature. XML Sample 3 shows the SignedInfo element that contains the information that is actually signed

XML Sample 3









tVicGh6V+8cHbVYFIU91o5+L3OQ=



The CanonicalizationMethod element defines as a URI the algorithm used to canonicalize the SignedInfo element before it is signed or validated. Canonicalization is the process of converting XML content to a physical representation, called the canonical form, in order to eliminate subtle changes that can invalidate a signature over that data. Canonicalization is necessary due to the nature of XML and the way it is parsed by different processors and intermediaries, which can change the data in such a way that the signature is no longer valid but the signed data is still logically equivalent. Canonicalization eliminates these permissible syntactic variances by converting the XML to a canonical form before generating or validating the signature.

The SignatureMethod element defines as a URI the digital signature algorithm used to generate the signature, in this case the PKCS#1 RSA-SHA1 algorithm as described in RFC 2437. One or more Reference elements identify the data that is signed. Each Reference element identifies the data by way of a URI. The example in XML Sample 3 contains a single Reference element, and the URI is the empty String, "", which indicates the root of the document -- in other words, the whole document. The Reference URIs could also point to external data, such as "http://java.sun.com", or to references within the same document, such as "#purchaseOrder".

The optional Transforms element contains a list of one or more Transform elements, each of which describes a transformation algorithm used to transform the data before it is digested and signed, or validated. This example contains one Transform element for the enveloped transform algorithm. The enveloped transform is required for enveloped signatures so that the Signature element itself is removed before calculating the signature value. Otherwise, the signature would include itself in the data to be signed, which is not correct. Another example of a useful transform algorithm is the XPath Filter transform, which allows you to specify an XPath expression that selects a subset of nodes to be signed.

The DigestMethod element defines as a URI the algorithm used to digest the data, in this case, SHA1. The DigestValue element contains the actual base64-encoded digest value.

The SignatureValue element contains the base64-encoded signature value of the signature over the SignedInfo element, as XML Sample 4 shows.

XML Sample 4


dJDHiGQMaKN8iPuWApAL57eVnxz2BQtyujwfPSgE7HyKoxYtoRB97ocxZ
8ZU440wHtE39ZwRGIjvwor3WfURxnIgnI1CChMXXwoGpHH//Zc0z4ejaz
DuCNEq4Mm4OUVTiEVuwcWAOMkfDHaM82awYQiOGcwMbZe38UX0oPJ2DOE=


The optional KeyInfo element contains information about the key that is needed to validate the signature, as in XML Sample 5.

XML Sample 5



CN=My Name,O=Test Certificates Inc.,C=US

MIIB9zCCAWCgAwIBAgIERZwdkzANBgkqhkiG9w0BAQUFADBAMQswCQYD
VQQGEwJVUzEfMB0GA1UEChMWVGVzdCBDZXJ0aWZpY2F0ZXMgSW5jLjEQ
MA4GA1UEAxMHTXkgTmFtZTAeFw0wNzAxMDMyMTE4MTFaFw0zMTA4MjUy
...




The KeyInfo element can contain various kinds of content, such as X.509 certificates and Pretty Good Privacy (PGP) key identifiers. See the KeyInfo section of the XML Signature standard for more information on KeyInfo and the types of information it may contain. In this example, KeyInfo contains an X509Data element that contains an X509SubjectName element identifying the subject Distinguished Name of the signer's X.509 certificate and an X509Certificate element containing the signer's base64-encoded certificate. This certificate contains the public key needed to validate the signature. The KeyInfo section of the XML Signature Recommendation provides more information on the different KeyInfo types.

It is important to note that the XML signature standard does not define how the recipient establishes trust in the key that is needed to validate the signature. The KeyInfo element is merely a collection of information that the recipient can use to help find and subsequently establish trust in that key.


API Architecture

The Java XML Digital Signature API was defined under the Java Community Process program as JSR 105. The API is designed to support all of the required or recommended features of the W3C Recommendation for XML-Signature Syntax and Processing. The API is based on the Java Cryptography Service Provider Architecture. This allows you to develop a service provider implementation of the API. Service providers implement a specific XML mechanism that identifies the XML-parsing mechanism that the implementation uses. The service provider in Sun's implementation of Java SE 6 supports the Document Object Model (DOM) mechanism. See the XML Digital Signature API overview for more information on service providers.

The API contains six new packages, as Table 1 indicates.

Table 1. New Packages in the Java XML Digital Signature API


Package
Contents
Contains common classes that are used to perform XML cryptographic operations.
Contains DOM-specific classes for the javax.xml.crypto package.
Contains classes that represent the core elements defined in the XML digital signature specification. Of primary significance is the XMLSignature class, which allows you to sign and validate an XML digital signature. The XMLSignatureFactory class is an abstract factory that is used to create objects that implement these interfaces.
Contains DOM-specific classes for the javax.xml.crypto.dsig package.
Contains classes that represent the KeyInfo structures defined in the XML digital signature recommendation. The KeyInfoFactory class is an abstract factory that is used to create objects that implement these interfaces.
Contains classes representing input parameters for the digest, signature, transform, or canonicalization algorithms used in the processing of XML signatures.


Generating an XML Signature

This section will show you how to use the API to generate an XML signature over the contents of the PurchaseOrder element that the article introduced earlier.

For this example, you will use DOM to parse the XML data that you will be signing. Code Sample 1 shows a few of the key steps in generating an XML signature:

Code Sample 1

// Create a DOM XMLSignatureFactory that will be used to
// generate the enveloped signature.
XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM");

// Create a Reference to the enveloped document (in this case,
// you are signing the whole document, so a URI of "" signifies
// that, and also specify the SHA1 digest algorithm and
// the ENVELOPED Transform.
Reference ref = fac.newReference
("", fac.newDigestMethod(DigestMethod.SHA1, null),
Collections.singletonList
(fac.newTransform
(Transform.ENVELOPED, (TransformParameterSpec) null)),
null, null);

// Create the SignedInfo.
SignedInfo si = fac.newSignedInfo
(fac.newCanonicalizationMethod
(CanonicalizationMethod.INCLUSIVE,
(C14NMethodParameterSpec) null),
fac.newSignatureMethod(SignatureMethod.RSA_SHA1, null),
Collections.singletonList(ref));

The first step in the generation of an XML signature is to instantiate an XMLSignatureFactory mechanism. The getInstance method of the XMLSignatureFactory class looks for a service provider that supports DOM and returns an XMLSignatureFactory implementation from the provider with the highest preference. The XMLSignatureFactory is a key class in the API and, as shown in Code Sample 1, is used to assemble the different components of the XMLSignature.

The second block of code in Code Sample 1 creates the Reference object, which identifies the data that will be digested and signed. The Reference object is assembled by creating and passing as parameters each of its components: the URI, the DigestMethod, and a list of Transforms.

The third block of code in Code Sample 1 creates the SignedInfo object that the signature is calculated over. Like the Reference object, the SignedInfo object is assembled by creating and passing as parameters each of its components: the CanonicalizationMethod, the SignatureMethod, and a list of References.

Code Sample 2 shows the steps involved in constructing the KeyInfo object.

Code Sample 2

// Load the KeyStore and get the signing key and certificate.
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream("mykeystore.jks"), "changeit".toCharArray());
KeyStore.PrivateKeyEntry keyEntry =
(KeyStore.PrivateKeyEntry) ks.getEntry
("mykey", new KeyStore.PasswordProtection("changeit".toCharArray()));
X509Certificate cert = (X509Certificate) keyEntry.getCertificate();

// Create the KeyInfo containing the X509Data.
KeyInfoFactory kif = fac.getKeyInfoFactory();
List x509Content = new ArrayList();
x509Content.add(cert.getSubjectX500Principal().getName());
x509Content.add(cert);
X509Data xd = kif.newX509Data(x509Content);
KeyInfo ki = kif.newKeyInfo(Collections.singletonList(xd));

For this example, the signing key and certificate are stored in a KeyStore file. The first block of code retrieves the signer's X.509 certificate from the keystore. The second block of code creates the KeyInfo object, using a KeyInfoFactory, which is a factory for assembling KeyInfo objects. The KeyInfo object consists of an X509Data object containing the certificate and the subject Distinguished Name.

Now you instantiate the document to be signed, create the XMLSignature object, and generate the signature, as Code Sample 3 shows.

Code Sample 3

// Instantiate the document to be signed.
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
Document doc = dbf.newDocumentBuilder().parse
(new FileInputStream("purchaseOrder.xml"));

// Create a DOMSignContext and specify the RSA PrivateKey and
// location of the resulting XMLSignature's parent element.
DOMSignContext dsc = new DOMSignContext
(keyEntry.getPrivateKey(), doc.getDocumentElement());

// Create the XMLSignature, but don't sign it yet.
XMLSignature signature = fac.newXMLSignature(si, ki);

// Marshal, generate, and sign the enveloped signature.
signature.sign(dsc);

The Document now contains the Signature element. You can verify this by using the JAXP Transformer API to dump the contents of the document to a file, as Code Sample 4 shows.

Code Sample 4

// Output the resulting document.
OutputStream os = new FileOutputStream("signedPurchaseOrder.xml");
TransformerFactory tf = TransformerFactory.newInstance();
Transformer trans = tf.newTransformer();
trans.transform(new DOMSource(doc), new StreamResult(os));


Validating an XML Signature

You will now learn to use the API to validate an XML signature over the contents of the PurchaseOrder element that you just signed. Code Sample 5 shows the key steps in validating an XML signature.

Code Sample 5

// Find Signature element.
NodeList nl =
doc.getElementsByTagNameNS(XMLSignature.XMLNS, "Signature");
if (nl.getLength() == 0) {
throw new Exception("Cannot find Signature element");
}

// Create a DOMValidateContext and specify a KeySelector
// and document context.
DOMValidateContext valContext = new DOMValidateContext
(new X509KeySelector(), nl.item(0));

// Unmarshal the XMLSignature.
XMLSignature signature = fac.unmarshalXMLSignature(valContext);

// Validate the XMLSignature.
boolean coreValidity = signature.validate(valContext);

First, you must find the location of the Signature element that you wish to validate. One way to do this is to use the DOM getElementsByTagNameNS method as shown in Code Sample 5. The second block of code creates a DOMValidateContext object containing a KeySelector object and a reference to the Signature element. The purpose of the KeySelector object is to obtain the public key using the information in the KeyInfo element and hand it back to be used as the validation key. The next section will discuss KeySelectors in more detail. The last two lines of code unmarshal and validate the signature. The validate method returns true if the signature is valid and false if it is invalid.

If the signature is invalid, some additional code is necessary to determine the cause of the failure, as Code Sample 6 shows.

Code Sample 6

// Check core validation status.
if (coreValidity == false) {
System.err.println("Signature failed core validation");
boolean sv = signature.getSignatureValue().validate(valContext);
System.out.println("signature validation status: " + sv);
if (sv == false) {
// Check the validation status of each Reference.
Iterator i = signature.getSignedInfo().getReferences().iterator();
for (int j=0; i.hasNext(); j++) {
boolean refValid = ((Reference) i.next()).validate(valContext);
System.out.println("ref["+j+"] validity status: " + refValid);
}
}
} else {
System.out.println("Signature passed core validation");
}

The code in Code Sample 6 determines the cause of an invalid signature as one of two possibilities:

  • An invalid signature. The cryptographic verification of the signature failed. This can be caused by an incorrect validation key or a change to the SignedInfo contents since the signature was generated.
  • An invalid reference or references. The verification of the digest of a reference failed. This can be caused by a change to the referenced data since the signature was generated.

Before moving on to the next section, it is important to note that transforms can change the contents of the data that is referenced before it is signed. Therefore, it may be important to show the contents of exactly what has been signed to the validating user. You can do this by enabling reference caching in the DOMValidateContext object before validating the signature and invoking the getDigestInputStream method of the Reference objects contained in the signature, as Code Sample 7 shows.

Code Sample 7

valContext.setProperty("javax.xml.crypto.dsig.cacheReference", Boolean.TRUE);
// Unmarshal the XMLSignature.
XMLSignature signature = fac.unmarshalXMLSignature(valContext);
// Validate the XMLSignature.
boolean coreValidity = signature.validate(valContext);

Iterator i = signature.getSignedInfo().getReferences().iterator();
for (int j=0; i.hasNext(); j++) {
InputStream is = ((Reference) i.next()).getDigestInputStream();
// Display the data.
}

These and other security concerns are discussed in more detail in the security considerations section of the XML Signature Recommendation.


The KeySelector Class

A KeySelector is an abstract class that is responsible for finding and returning a key using the data contained in a KeyInfo object. In Code Sample 5, you passed an X509KeySelector object, which is a very simple implementation of KeySelector that looks for and returns a public key of an X.509 certificate, as Code Sample 8 shows.

Code Sample 8

public class X509KeySelector extends KeySelector {
public KeySelectorResult select(KeyInfo keyInfo,
KeySelector.Purpose purpose,
AlgorithmMethod method,
XMLCryptoContext context)
throws KeySelectorException {
Iterator ki = keyInfo.getContent().iterator();
while (ki.hasNext()) {
XMLStructure info = (XMLStructure) ki.next();
if (!(info instanceof X509Data))
continue;
X509Data x509Data = (X509Data) info;
Iterator xi = x509Data.getContent().iterator();
while (xi.hasNext()) {
Object o = xi.next();
if (!(o instanceof X509Certificate))
continue;
final PublicKey key = ((X509Certificate)o).getPublicKey();
// Make sure the algorithm is compatible
// with the method.
if (algEquals(method.getAlgorithm(), key.getAlgorithm())) {
return new KeySelectorResult() {
public Key getKey() { return key; }
};
}
}
}
throw new KeySelectorException("No key found!");
}

static boolean algEquals(String algURI, String algName) {
if ((algName.equalsIgnoreCase("DSA") &&
algURI.equalsIgnoreCase(SignatureMethod.DSA_SHA1)) ||
(algName.equalsIgnoreCase("RSA") &&
algURI.equalsIgnoreCase(SignatureMethod.RSA_SHA1))) {
return true;
} else {
return false;
}
}
}

This is a very simple implementation of a KeySelector that returns the public key from the first X.509 certificate it finds in the X509Data. It is for demonstration purposes only and should not be used in real-world applications. A more complete X.509 key selector implementation would check other types of X509Data and establish trust in the validation key by using a keystore of trusted keys, or by finding and validating a certificate chain from a trust anchor to the certificate containing the public key. See the Java PKI Programmer's Guide for more information about trust anchors and Java APIs that you can use to establish trust in keys.


Logging and Debugging

The Java SE 6 implementation of the XML Signature API has extensive logging support that, when enabled, will provide you with additional information to help you debug validation failures. The log messages use the JDK logging facility, java.util.logging.

To enable XML signature logging, you must first configure the logging facility so that the XML signature-logging messages are emitted. You can do this by editing the JRE's default logging.properties file directly, or by creating your own file and setting it with the java.util.logging.config.file property, for example:

java -Djava.util.logging.config.file=logging.properties ...

where logging.properties contains the following code:

handlers= java.util.logging.ConsoleHandler
.level= INFO
java.util.logging.ConsoleHandler.level = FINER
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
org.jcp.xml.dsig.internal.level = FINER
com.sun.org.apache.xml.internal.security.level = FINER

This will emit log messages of level FINER and higher to the console. All other components will emit log messages of level INFO and higher.

This article will not describe every log message in detail, but Table 2 lists some of the most helpful messages.

Table 2: Some Useful Log Messages


Log Message
Explanation
[java] FINER: Pre-digested input: ...
This message displays the content of the referenced data just before it was digested. This is useful for debugging reference validation failures.
[java] FINE: Expected digest: ...
[java] FINE: Actual digest: ...
These messages display the expected and actual base64-encoded digest values of a Reference element. This is also useful for debugging reference validation failures.
[java] FINE: Canonicalized SignedInfo: ...
This message displays the canonicalized SignedInfo element before it is signed. This is useful for debugging canonicalization and signature verification failures.


Conclusion

The purpose of the article was to get you started with using the API and to show you the basic steps in generating and validating an XML signature. To learn more about the Java XML Digital Signature API, consult the documentation and references in the "For More Information" section.

The Java XML Digital Signature API is available in Java SE 6, as well as in the GlassFish project. Project WSIT, also known as Project Tango, uses the Java XML Signature API to implement the Web Services Security (WSS) specification.


For More Information

Java XML Signatures: This article discusses XML digital signatures and the Java XML Signature API and discusses ways to speed up performance using cryptographic hardware accelerators.
JSR 105 Java Community Process
Java XML Digital Signature Overview and Tutorial
Java XML Digital Signature API Specification
Java PKI Programmer's Guide
Sean Mullan's Blog

Install XAMPP for easy, integrated development

Install XAMPP for easy, integrated development

Middleware stacks like this could revolutionize open source, multi-tier software development









Level: Introductory

Nils-Erik Frantzell (nfrantze@ucsc.edu)Computer Science Department, UC Santa Cruz

30 Nov 2004

Open source stacks such as XAMPP from Apache Friends are simplifying open source development by making it easier to write and distribute applications in a stable and standardized environment. Traditionally, AMPP -- Apache, MySQL, PHP, and Perl -- have all been installed and configured as separate products. The trend of combining them into integrated middleware stacks promises to make open source development more competitive with J2EE™ application development, at least for low-end applications. In this article, you'll learn how to install, configure, and back up XAMPP on Mandrake Linux™ 10.0 and also how to configure and administer XAMPP, as well as how to install your own applications in an XAMPP environment.

The advent of Java 2 Enterprise Edition™ dramatically changed the software landscape by providing an integrated middleware stack that greatly simplified the task of writing and deploying Java™ applications. For a while, the open source community was left behind because it lacked a similar integrated architecture.

Recently, with the introduction of integrated open source stacks like XAMPP from Apache Friends, this situation has started to change. These stacks are still quite simple and rudimentary when compared with J2EE, but they are nevertheless an important step on the way to fuller systems integration. PHP 5.0 (which makes PHP fully object oriented) is a good indicator that this trend will accelerate.

The focus of this article is on one of the integrated, open source stacks: XAMPP from Apache Friends.

Introducing XAMPP

XAMPP is a full-featured AMPP (Apache MySQL, PHP, Perl) package that is one of the few non-commercial AMPP middleware stacks available on Linux. With its tight integration, XAMPP makes it possible to run anything from a personal home page to a full-featured production site (though only for development purposes; XAMPP is not meant to be used on a production server due to security issues).

XAMPP really shines in the following areas:

  • It is easy to install and set up.
  • It contains a number of useful packages that make it easy to do things like generate traffic reports and accelerate PHP content.
  • It has been thoroughly tested on the SUSE, Red Hat, Mandrake, and Debian Linux distributions, as well as on Windows® and Solaris.

For this article, we will install XAMPP under Mandrake Linux 10.0. Let's start by looking at the default packages that come with XAMPP.

Basic packages

Basic packages include system, programming, and server software:

  • Apache, the famous Web server
  • MySQL, an excellent, free, open source database
  • PHP, the programming language (in versions 4.3.8 and 5.0.1 at the time of this writing)
  • Perl, the programming language
  • ProFTPD, an FTP server
  • OpenSSL, for secure sockets layer support

Graphics packages

XAMPP includes the following graphics-related packages:

  • GD, the "Graphics Draw" library
  • libpng, the official PNG reference library
  • libjpeg, the official JPEG reference library
  • ncurses, the character graphics library

Database packages

And what would an integrated stack be without some database packages such as:

  • gdbm, the GNU implementation of the standard UNIX® dbm library
  • SQLite, an extremely small, zero-configuration SQL database engine
  • FreeTDS, a database library that gives UNIX and Linux programs the ability to talk to Microsoft® SQL and Sybase databases

XML packages

For XML development, XAMPP includes the following:

  • expat, an XML parser library
  • Salbotron, an XML toolkit
  • libxml, an XML C parser and toolkit for GNOME

PHP packages

For PHP development, XAMPP includes the following:

  • PEAR, the PHP library
  • A pdf class that generates dynamic PDF documents with PHP
  • TURCK MMCache, a PHP performance enhancer

Other packages

And finally, XAMPP demonstrates its versatility by including the following packages:

  • zlib, a compression library
  • mod_perl, which embeds a persistent Perl interpreter in Apache
  • gettext, a toolset that assists GNU packages in producing multi-lingual messages
  • mcrypt, an encryption program
  • Ming, a Flash (SWF) output library
  • Freetype2, a software font engine
  • IMAP C-Client, a mail program API

Now let's talk about installing XAMPP.


Use this link for more information

(
http://www-128.ibm.com/developerworks/linux/library/l-xampp/)

Toyota plans ultra-inexpensive car

Cheap Wheels


22 January 2007 11:36:54

Toyota plans ultra-inexpensive car: report


TOKYO, Jan 22, 2007 (AFP) - Toyota Motor Corp. plans to build a low-cost car undercutting Renault's emerging-market Logan through a "radical" rethink in design and production, the president of the fast-growing Japanese automaker said.


"The focus is on low-cost technology," Toyota president Katsuaki Watanabe told Britain's Financial Times newspaper in an interview published Monday.

He declined to set a price for a low-cost car but said it would be "at least" less than the Logan.

Renault has started production of the Logan, which will cost from 5,000 euros (6,200 dollars) on up, touted as a budget model for consumers in emerging economies such as China and Russia that conforms to European standards.

Watanabe said that Toyota could slash the price by targetting costs throughout production.

"Everything from design to production methods will be radically changed and we are thinking of a really ultra-low-cost way of designing, using ultra-low-cost materials, even developing new materials if necessary," he said.

The plan would create a new challenge to struggling US automakers.

Toyota is set this year to overtake General Motors as the world's largest automaker. The Japanese automaker has cashed in by pioneering environmentally friendly hybrid cars and has also seen success with its luxury Lexus line.


Use this link for more information


(
http://www.lbo.lk/fullstory.php?newsID=1796333079&no_view=1&SEARCH_TERM=35 )

Jonathan Robie's XQuery Blog: XSLT vs. XQuery

XSLT vs. XQuery

About once a week, someone asks me a question about the relationship between XSLT and XQuery - is XQuery a better language than XSLT? when would I use each language in preference to the other? is there really any fundamental reason that XSLT can't be optimized for large data stores just like XQuery? which language is better for writing really large applications?

Here are some of the differences between the two languages.

  • XQuery was designed to be optimizable for large data stores. XSLT was designed for the kinds of transformations used in stylesheets - it has come to be used much more broadly, but nobody has done a good job of translating it to efficient SQL or implementing it to work efficiently on native XML databases. You can argue whether the same kind of thing could be done in XSLT, but realistically, it's unlikely that anyone will ever do that.

  • XQuery is typically easier to use for things that feel like "queries"; XSLT is easier for things that feel like transformations, especially formatting-oriented transformations on recursive data structures like those found in documents.

  • XQuery has a keyword-oriented syntax that is more like other commonly used languages than the XML-based syntax of XSLT. I don't think this is a big deal, but some programmers seem to have a hard time getting past XSLT syntax.

I have heard Mike Kay suggest that XSLT is much better for designing very large queries, and heard Jason Hunter suggest that these kinds of queries are much easier in XQuery. Personally, I am more comfortable writing very large XQueries than very large stylesheets, but I've also written a lot more large queries than large stylesheets.

There are XSLT zealots and XQuery zealots who insist that one of these two languages is best. I use both languages, and like both languages. But XQuery is clearly the language that was designed for large data stores, or for the kind of implementation that translates a query to other query languages such as SQL.

By the way, Mike Kay's useful XTech 2005 paper examines these questions in much more depth.

O'Reilly -- Top Ten Java and XSLT Tips

Top Ten Java and XSLT Tips

by Eric M. Burke
08/29/2001

My new book, Java and XSLT, examines techniques for using XSLT with Java (of course!). This article highlights ten tips that I feel are important, although limiting the list to ten items only scratches the surface of what is possible. Most of these tips focus on the combination of Java and XSLT, rather than on specific XSLT (Extensible Stylesheet Transformations) techniques. For more detailed information, there are pointers to other valuable resources at the end of this article.

The basics of XSL transformations are pretty simple: one or more XSLT stylesheets contain instructions that define how to transform XML data into some other format. XSLT processors do the actual transformations; Sun Microsystems' Java API for XML Processing (JAXP) provides a standard Java interface to various processors. Here is some sample code that performs an XSL transformation using the JAXP API:

import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import java.io.*;

public class Transform {

/**
* Performs an XSLT transformation, sending the results
* to System.out.
*/
public static void main(String[] args) throws Exception {
if (args.length != 2) {
System.err.println(
"Usage: java Transform [xmlfile] [xsltfile]");
System.exit(1);
}

File xmlFile = new File(args[0]);
File xsltFile = new File(args[1]);

// JAXP reads data using the Source interface
Source xmlSource = new StreamSource(xmlFile);
Source xsltSource = new StreamSource(xsltFile);

// the factory pattern supports different XSLT processors
TransformerFactory transFact =
TransformerFactory.newInstance();
Transformer trans = transFact.newTransformer(xsltSource);

trans.transform(xmlSource, new StreamResult(System.out));
}
}

You can click here to download a small ZIP file containing this example, along with an XSLT stylesheet and XML data file. The included README file explains how to compile and run this example.


Use this link for get more information

(
http://www.oreillynet.com/pub/a/oreilly/java/news/javaxslt_0801.html)

Make choices at runtime with XSLT parameters

Make choices at runtime with XSLT parameters

Use parameters and conditionals in your style sheets








Level: Introductory

Nicholas Chase (nicholas@nicholaschase.com), President, Chase and Chase, Inc.

01 Aug 2002

Extensible Stylesheet Langauage Transformations provide the ability to perform sophisticated manipulation of data as it is transformed from one form to another. You can increase their capabilites even further through the use of parameters that can be specified at runtime. This tip takes a basic look at using parameters and conditional statements in an XSLT style sheet.

Note:This tip uses the Xalan XSL Transformation engine, but any XSLT processor will do. It assumes that you are familiar with XSL transformations.


Use this link for get more information

(http://www-128.ibm.com/developerworks/xml/library/x-tipxsltrun/index.html)