Ajax Based Google Translation Application

March 27, 2008

Another Ajax Based Google Translation Application Released


Recently, Google offered to the public their latest offering of language translation applications. Via public API, developers should be able to apply to their own website Google translates for developers to easily configure their website to any other languages they prefer. Aside from website add-on, developers can also use this API to build their custom designed gears which could be launched among the independently developed Google Gears. Adding this gear to their desktop, users should be able to type in simple commands for quick translation.


As of this writing, 13 languages are available and the number could be more in the following months. If your language is not on the list, maybe it is your chance to infuse the translation bot as part of the application. But if you are experienced in API and Gears development is not that extensive, you can use the API and apply it to your website.


We have indicated that this product is the latest of Google’s language applications. There are already a bunch of language related applications released by Google. Some of them could even translate Google Talk conversation on the spot. A language detection feature in Google’s IM was also released. You will then have the option of changing the language to your preferred tongue.


This added feature by Google is definitely a good thing. I am not sure if Google has the hidden agenda behind all these but I think the ability to understand another language fast online is a good application. But as a developer, there are concerns that are raised especially for end users.


First is the application security. Google has released an API for developers to build their own application and use it in any setting they prefer. There are of course developers who want nothing more than the advancement of communications. They steadily study this application so that others could enjoy the internet more.


However, as much as there are developers who are out there with good intentions. You can actually study the application and look for loopholes so that you can easily insert a script to update you with personal information. The latest API for language translation by Google is Ajax based which signals that another loophole is available for hackers to exploit. I may not be able to think of ways wherein really personal information could be used but as long as personal information could be accessed, this is always a security risk.


Another concern is speed. Even though this is an Ajax based application, launching this feature as Google Gear might be a little bit slower than expected. But this could be easily addressed when the API is stripped down to its bare essentials. It will not have any flashy interface but it will work well. You can still enjoy the power of language translation without being fancy.


Personally, this application might the best Google has made in the language translation application. But good things are coming from Google and as Ajax becomes more powerful, developers should be able to avail more API and source codes related to language translation.

Four Easy Steps for Ajax Development

Time and time again, developers are at awe on any Ajax based website. It’s complexity that matches its efficiency has made the developers and web owners to scramble for knowledge to develop this technique to this hottest web coding today. Although other codes have been thriving, none of them could be compared to JavaScript and the mark-up language XML – the main components of Ajax.


Fortunately, there are individuals who are already proficient in JavaScript long before it even become integrated to Ajax. Because of this, they were able to move ahead of figuring out how Ajax can be built in a simpler manner. Frameworks after frameworks have been released along with the battery of libraries that provide pre-built functions to developers. All the developers need to do is to change some things in the current library.


But that does not mean building an Ajax based website and application is easier in itself. Even with the framework, it is still complicated and could not be handled by any starting developer. 


On the other hand, if you are rearing to try your hands to develop an application in tune with today’s hottest development technique here are the simple steps in developing an Ajax based application:


Select the right framework – Let’s face it, you need a framework to build and application. Do not think that the set of libraries will diminish your creativity. There are already hundreds of frameworks out there and each of them has so many functions that most of them might not be even used. There are also frameworks that will help you develop an Ajax based application that do not even require knowledge of JavaScript. Personally, you might end up with a server side if you do not know JavaScript as most of the non-JavaScript frameworks are on that side.


Never overdo the framework – Keep it simple. There are so many functionalities out there and they might have “special considerations” especially for browser compatibility. There are lots of frameworks that could have cross browser so you will not have to stick to one framework and look for answers so that it could be compatible to different browsers. The libraries are already made so you just have to stick to the plane and customize only according to looks.


Not everything should be Ajaxed – Ajax is a very fascinating development technology but it does not have to be used in every part of the webpage. As of this writing, Google’s web crawlers for recognizing web content are not that optimized yet for Ajax. Leave some parts for HTML and meta-tags so that your website will somehow be recognized by web crawlers and be provided with the appropriate ranking.


Test your code – Never, never let your application go without testing it. As of today, there are applications that have been built to test Ajax based website. Some of it could come with a fee to ensure that the application works as planned.


These are only four steps to an Ajax based application. It stresses the importance of using a framework as this provides stability and reusability of the application. Use them and test the so that your application works as planned.

Parsing and Generating XML

March 3, 2008

With XML, you can effortlessly exchange data between programs written in different languages, running on different operating systems, located on computers anywhere in the world. At least, that’s what enthusiastic computer programmers and salespeople who work for companies that sell XML tools will tell you. They’re sort of telling the truth. XML does make it easier to trade structured information between two programs. But you still have to do some work to herd your data into the right structure. This chapter shows you how to do that work with PHP.

XML is a markup language that looks a lot like HTML. An XML document is plain text and contains tags delimited by < and >. There are two big differences between XML and HTML:

XML doesn’t define a specific set of tags you must use.

XML is extremely picky about document structure.

In one sense, XML gives you a lot more freedom than HTML. HTML has a certain set of tags: the <a></a> tags surround a link, the <ul></ul> tags denote an unordered list, the <li></li> tags indicate a list element, and so on. An XML document, however, can use any tags you want. Put <rating></rating> tags around a movie rating, <height></height> tags around someone’s height, or <favoritecolor></favoritecolor> tags around someone’s favorite color—XML doesn’t care. Of course, whomever (or whatever program) you’re sharing the XML document with also needs to agree to use and understand the same set of tags.

While you get more freedom in the tag-choice department, XML clamps down much harder than HTML when it comes to document structure. HTML lets you play fast and loose with some opening and closing tags. The HTML list in Example renders just fine in a web browser.

Example: HTML list that’s not valid XML
<ul>

  <li>Braised Sea Cucumber

  <li>Baked Giblets with Salt

  <li>Abalone with Marrow and Duck Feet

</ul>

Why PHP 5?

March 2, 2008

To understand why PHP 5 came to exist, it’s necessary to quickly review the evolution of PHP as a language.

When Rasmus Lerdorf created PHP back in 1995, it wasn’t even called PHP—his Personal Home Page/Forms Interpreter language was known as PHP/FI. At the time, PHP/FI’s main focus was solving small-time web tasks: guest books, hit counters, and basic forms processing. Its major benefit was its simplicity; PHP/FI made it easy to handle all the messy tasks thrown at a web developer. Additionally, it’s C-like syntax was already understood by many programmers.

Over the next two years, PHP/FI gradually grew in popularity. However, by 1997, PHP/FI was already showing its age. As the Internet gathered steam, programmers began to create more complex applications, such as e-commerce shopping carts. PHP/FI’s quirks and limitations hindered development. It was too slow and was missing some basic features, such as for and foreach loops.

These problems caused Zeev Suraski and Andi Gutmans, of Zend fame, to begin work on a new version of PHP/FI. This version, which became PHP 3, solved many difficulties faced by PHP/FI developers while remaining true to the essential nature of PHP/FI.

In particular, PHP 3 was faster and more efficient than PHP/FI. The new parser also provided the opportunity to iron out some language oddities, making PHP more consistent. PHP 3’s other major advance was an easy-to-use extension API. Developers from all over contributed extensions to PHP, effectively turning PHP from a programming language into an entire web development environment.

PHP 3 retained PHP/FI’s procedural syntax, but it also introduced a very simplistic object-oriented syntax. Originally the result of a weekend hack, developers flocked to objects, much to the surprise of Zeev and Andi. Unfortunately, PHP 3 was ill-equipped to provide all the object-oriented features developers demanded.

A few months after PHP 3 went final in June of 1998, work started on PHP 4. Again, the problem was speed. The new extension infrastructure provided the opportunity to create larger and more complex web sites than ever imagined. In the words of Alan Greenspan, "irrational exuberance" was at hand.

While PHP 4 provided yet another burst of power, its secondary objective was backward compatibility. There was a strong emphasis on not breaking PHP 3 scripts under PHP 4. As a result, beefing up the core language was not a main focus of PHP 4. PHP 4 was released in May 2000, almost two years after PHP 3.

A lot has happened over the last four years. Perl may be the "duct tape of the Internet," but PHP is the real glue that holds the Web together. However, PHP still faces challenges. The problems of performance and flexibility have long been conquered, but now PHP is under attack from the twin foes of Java and C#.

Over the past 10 years, Java and C# have introduced advanced object-oriented programming concepts to web development. Yet in many ways, despite all the improvements, PHP 4.3 is still the same procedural language that Rasmus wrote a decade ago. PHP 5 finally grants developers their wish, providing a full set of object-oriented features.

These features, allow developers to more easily develop large-scale applications without resorting to the cumbersome workarounds necessary in PHP 4. They also let you write cleaner code that’s less error-prone and more maintainable.

Get free blog up and running in minutes with Blogsome | Theme designs available here