Tuesday, October 21, 2008

How to use Attachment Caching with WSF/PHP

WSF/PHP 2.0.0 has the support for caching attachments ( writing to a file ). This effectively reduces the amount of memory used when sending and receiving attachments and its specially useful, if your application requires to send or receiving a very large file in the scale of megabytes.

WSF/PHP adds two php.ini entries in order to allow attachment caching.

1. wsf.attachment_cache_dir

2.wsf.enable_attachment_caching

wsf.attachment_cache dir is the location where the received attachments will be saved.

wsf.enable_attachment_caching option enables attachment caching.

By default, attachment caching can be done only for attachments larger than 1 MB.

Lets see a code sample on how to use this. This is a simple php service, which reads a binary file and send it to the client as an MTOM attachment.

ini_set("wsf.enable_attachment_caching", 1);
ini_set("wsf.attachment_cache_dir","E:\\");

function sendAttachment($msg)
{
$responsePayloadString = << http://php.axis2.org/samples/mtom">
test.jpg
http://www.w3.org/2004/06/xmlmime">
http://www.w3.org/2004/08/xop/include" href="cid:myid1">


XML;

$responseMessage = new WSMessage($responsePayloadString,
array( "attachments" => array("myid1" => "../resources/large_image.jpg")));
return $responseMessage;
}

$operations = array("download" => "sendAttachment");

$service = new WSService(array("operations" => $operations, "useMTOM" => TRUE));

$service->reply();

?>

Now in above code, I have highlighted the important code pieces.

1. The php ini settings at the top of the code where the attachment_cache_dir is set and attachment caching is enabled.

ini_set("wsf.enable_attachment_caching", 1);
ini_set("wsf.attachment_cache_dir","E:\\");

2. Setting of a fake content id to which the actual attachment is assigned.

href="cid:myid1"

3. Instead of setting binary attachment as an string in the attachment array, we should set the actual path to the file.

array("myid1" => "../resources/large_image.jpg")

Thats all you need to do to get attachment caching working. The same technique can be used for the client as well. It will be consuming lot less amount of memory.


http://phpwebservices.blogspot.com/2008/10/how-to-use-attachment-caching-with.html

Friday, October 17, 2008

What's new with iGoogle?

iGoogle?

I'm an iGoogle addict. I check my news, email, stocks, feeds and weather there and sometimes even manage to squeeze in a game or two during the day. Having everything in one place is super convenient, but I often wish I could deal with all my stuff without having to leave my iGoogle page. With today's release, I can. We've rolled out an updated design for iGoogle to all U.S. users, which includes full canvas views for gadget and support for full feed reading.

Not all of our gadgets have canvas views yet, but here are some of the best:
  • News - New gadgets from The New York Times, The Wall Street Journal and The Washington Post give me full-page views of what's new in the world. Nice.
  • Games - The Sudoku gadget lets me play thousands of full-page Sudoku puzzles without squinting at 6-point type. The GoComics gadget gives me my fix of Garfield and Doonesbury and lets me choose from all of their other comics. I've also spent many coffee breaks browsing through videos from YouTube and CurrentTV.
  • Entertainment - I've configured the TV Guide gadget to my zip code and just used it today to figure out when the newest episode of The Office is playing. Flixster's movies gadget lets me access trailers, ratings, and theater information for any movie. I also use the iLike gadget to browse news, concerts, and free MP3s from my favorite musicians.
  • Google stuff - The new Gmail gadget lets me read my full email and perform simple actions like send or reply to emails without leaving iGoogle. Last but not least, a gadget that I authored and use every day is for Google Finance, which provides full-screen finance charts and news of the stocks in my portfolio.
Here's a full list of our highlighted canvas view gadgets.

We've also replaced the tabs at the top with a left navigation that allows for access to any gadget with one click. We're very excited about these changes because it makes iGoogle a more useful homepage and a better platform for developers. And this is just the beginning: Expect to see more canvas gadgets created by developers and more new features on iGoogle soon. Not in the U.S.? Don't worry. We'll also be rolling out this updated version in other countries very soon.

Thursday, September 11, 2008

10 Principles of the PHP Masters

1. Use PHP Only When You Need it

PHP was created out of a need to solve web development problems. However, you can't use PHP for everything. PHP is a just like a tool in your toolbox, and that even PHP has limitations. Trying to use PHP for everything isn't efficient, and it certainly isn't the best use of your time as a web developer. Don't be afraid to to use other languages if PHP isn't working out for your project.

2. Use Many Tables With PHP and MYSQL for Scalability
3. Never, ever trust your users
4. Invest in PHP Caching
5. Speed up PHP Development with an IDE, Templates and Snippets
6. Make Better Use of PHP's Filter Functions
7. Use a PHP Framework - Josh Sharp

There has always been a debate as to whether to use a PHP framework like Zend, CakePHP, Code Igniter, or any other framework. There are upsides and downsides to using one, and many developers have their own opinions about whether or not to go down this road.

Josh Sharp is a web developer who makes his bread and butter creating websites for clients. This is why you should trust him when he says it's a good idea to use a PHP framework to save time and eliminate mistakes when programming. Why? Josh believes it's because PHP is too easy to learn.
But PHP's ease of use is also its downfall. Because there are less restrictions on the structure of the code you write, it's much easier to write bad code. But there is a solution: use a framework.
PHP frameworks help standardize how you program, and can save lots of time in the development process. You can read more about the benefit of using a PHP framework at Josh's blog.

8. Don't use a PHP Framework - Rasmus Lerdorf

Contrary to Josh's belief that one should use a PHP framework, Rasmus Lerdorf, the Godfather of PHP himself, believes that frameworks aren't that great. Why? Because they perform much slower than simple PHP.

During Rasmus' presentation at Drupalcon 2008(http://szeged2008.drupalcon.org/), Rasmus compared the response times to a PHP page with a simple "Hello World" example, and compared it to a few PHP frameworks (http://talks.php.net/show/drupal08/24 - slides 24-32), and showed that PHP frameworks are much slower than straight PHP.

You can listen or watch the entire presentation where Rasmus shows the performance losses with PHP frameworks. In short, Rasmus shows that performance takes a major hit when you use a PHP framework as opposed to using pure PHP.

9. Use Batch Processing
10. Turn on Error Reporting Immediately

Source :- http://nettuts.com/articles/10-principles-of-the-php-masters/

Tuesday, August 12, 2008

Recent Trends in Custom Web Development

In the early days of Internet, having a website was looked upon as a luxury. However, with the winds of change the whole concept of Internet usage has transformed enormously. If you are a businessman and do not have a website people will look at you with wonder struck eyes. And why shouldn’t they? Internet has today become an important tool of online business and therefore custom web development is necessary for all companies who want to make a mark in their area of business.

Custom web development is the foremost tool to get you a professional website that will cater to the needs of the visitors. Today the developers look for recent programming languages and templates to give an ultra modern look to websites. With every passing day the web developers are provided with more tools to make their sites livelier. So it is of utmost importance to look into the details of the recent developments in custom web development.

With the high demand by webmasters for a dynamic and updated site loaded with features, there has been a revelation in the field of custom web development. Ever evolving world of computer programming has come up with new features that can be incorporated with Java and PHP programming language. Let us take a plunge into the world of web development and find out what is hot.

Protect Your Private Data With PHP 5

Recently launched PHP 5 has come up with a feature that will keep your data protected and therefore is a great tool for custom web development. By using PHP 5 you can create private data members who will have the sole access to the protected areas of your site, which contains vital information about the organization. PHP 5 makes the work easy for the developers to work with public, protected and private class members. As a developer, you can categorize the visitors according to the webmaster’s wishes. This avoids all chances of information leak because PHP 5 creates three distinct levels of members under- public, protected and private. You can pour data in your website according to your wish and then categorize them for viewing purposes.

Make Effective Inputs to Your Site With iText

iText sharp is a great addition for Java language programmers. With the use of this new development programmers can incorporate lively pictures into their sites. It has been widely seen that texts alone cannot attract web visitors, so there is always need for images. With the use of iText one can incorporate vibrant graphics into a PDF document. iText supports all types of images and graphics and has no complexities involved in the process. You can also effectively position the images as per your liking, if you want to have the image on the extreme left of your website then you can do so with the use of a simple code. By using iText a web developer can style texts in various ways, align the text according to his choice and use indents and spaces in many ways.

If you are a webmaster, it is high time that you look for these updates and get custom web development in your site using these effective and updated tools. Updated websites impress visitors and they make good money for the webmaster. So if you want to have a profitable e-commerce website custom web development is important.

Friday, August 1, 2008

Web Development the Next Five Years

Tuesday, July 22, 2008

Cheat Sheets for Front-end Web Developers

Quickly remember codes, syntax and related concepts visually
Here are some links for your reference.


The Web Developer’s SEO Cheat Sheet
http://www.seomoz.org/user_files/SEO_Web_Developer_Cheat_Sheet.pdf

The WordPress Help Sheet

http://wpcandy.com/wp-content/uploads/WordPress-Help-Sheet.pdf

HTML Help Sheet
http://www.gosquared.com/images/help_sheets/HTML%20Help%20Sheet.pdf

HTML Cheat Sheet
http://www.addedbytes.com/download/html-cheat-sheet-v1/pdf/
http://www.addedbytes.com/download/html-cheat-sheet-v1/png/

HTML Character Entities Cheat Sheet
http://www.addedbytes.com/download/html-character-entities-cheat-sheet/pdf/
http://www.addedbytes.com/download/html-character-entities-cheat-sheet/png/


XHTML Cheat Sheet v. 1.03
http://floele.flyspray.org/htmlcheatsheet.pdf

CSS Cheat Sheet (V2)
http://www.addedbytes.com/download/css-cheat-sheet-v2/pdf/
http://www.addedbytes.com/download/css-cheat-sheet-v2/png/

CSS Cheat Sheet

http://lesliefranke.com/sandbox/ref/csscheatsheet.pdf
http://lesliefranke.com/sandbox/ref/csscheatsheet.html

CSS Shorthand Cheat Sheet
http://www.leigeber.com/wp-content/uploads/2008/04/css-cheat-sheet.pdf

CSS Level 1 Quick Reference

http://refcards.com/docs/deepx/css1/CSS1.pdf

CSS Level 2 Quick Reference
http://refcards.com/docs/jungb/css2/css2.pdf

CSS2.1 Quick Reference Card
http://www.explainth.at/downloads/cssquick.pdf

CSS2 Reference Guide
http://www.veign.com/downloads/guides/qrg0007.pdf

JavaScript Cheat Sheet
http://www.addedbytes.com/download/javascript-cheat-sheet-v1/pdf/
http://www.addedbytes.com/download/javascript-cheat-sheet-v1/png/


Addison-Wesley’s JavaScript Reference Card
http://wps.aw.com/wps/media/objects/2234/2287950/javascript_refererence.pdf

JavaScript and Browser Objects Quick Reference
http://www.dannyg.com/dl/JSB6RefBooklet.pdf

The most common DOM methods at a glance
http://www.wait-till-i.com/stuff/JavaScript-DOM-Cheatsheet.pdf

JavaScript Quick Reference Card/Cheatsheet
http://www.explainth.at/downloads/jsquick.pdf

mootools 1.2 cheat sheet
http://mediavrog.net/blog/wp-content/uploads/2008/06/mootools-12-cheat-sheet.pdf

jQuery Cheatsheet
http://colorcharge.com/wp-content/uploads/2007/12/jquery12_colorcharge.png

jQuery 1.2 Cheat Sheet
http://www.gscottolson.com/jquery/jQuery1.2.cheatsheet.v1.0.pdf

jQuery Visual Map
http://jquery.com/images/jQuery-Map.png

RGB Hex Colour Chart
http://www.addedbytes.com/download/rgb-hex-cheat-sheet-v1/pdf/

E-Learning CD Store
http://www.indusnetacademy.com/store/

If any one who is reading this and knows another sources please comment it here.
Enjoy :)

Tuesday, July 15, 2008

Web Developer Tool Bar

A must needed tool bar for developers,The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.

Features

The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools like:-
View Anchor Information
View Color Information
View Document Outline
View Document Size
View Generated Source
View Meta Tag Information
The 'Clear Session Cookies'
The 'Display Element Information'
The 'Display Image File Sizes'
The 'Display Ruler'
The 'Display Topographic Information'
The 'Edit CSS' feature
The 'Show Comments'
Disable Proxy
Disable Strict JavaScript Warnings
Display Abbreviations
Display Page Magnifier
Display Page Validation
Outline Images With Oversized Dimensions
Outline Links With Ping Attributes
Outline Table Captions
Validate Local Accessibility
Clear All Private Data
Convert Select Elements To Text Inputs
Delete Path Cookies
Disable External Site Images
Disable Meta Redirects
Disable Minimum Font Size
Disable Print Styles
Display Alt Attributes
Display Div Order
Display Element Information
Display Line Guides
Display Object Information
Display Stack Levels
Display Table Depth
Display Table Information
Display Title Attributes
Edit HTML
Enable Form Fields
Make Frames Resizable
Make Images Full Size
Outline All Images
Outline Background Images
Outline External Links
Outline Headings
Outline Positioned Elements
Show Hidden Elements
Show Window Chrome
Small Screen Rendering
And many more..

Get it here
https://addons.mozilla.org/en-US/firefox/addon/60
http://chrispederick.com/work/web-developer/

Some other Web Development firefox Add-ons
https://addons.mozilla.org/en-US/firefox/browse/type:1/cat:4
https://addons.mozilla.org/en-US/firefox/addon/1843