Sunday, December 2, 2007
30 AJAX Tutorials
Alternate Ajax Techniques, Part 1
By now, nearly everyone who works in web development has heard of the term Ajax, which is simply a term to describe client-server communication achieved without reloading the current page. Most articles on Ajax have focused on using XMLHttp as the means to achieving such communication, but Ajax techniques aren't limited to just XMLHttp. There are several other methods.
Dynamic HTML and XML: The XMLHttpRequest Object
Thanks to the little-known XMLHttpRequest object, an increasing range of web clients can retrieve and submit XML data directly, all in the background.
Guide to Using XMLHttpRequest
Using XMLHttpRequest with php and mysql
Make asynchronous requests with JavaScript and Ajax
Make asynchronous requests with JavaScript and Ajax. In this article, you'll begin with the most fundamental and basic of all Ajax-related objects and programming approaches: The XMLHttpRequest object.
Instant Tutorial
Simply put, AJAX allows you to make a call to an http server (typically an RSS feed or a webpage), get it’s content and load them into your existing page without having to refresh the whole page. This means that services like email don’t have to reload the whole page everytime you click a message, saving on bandwidth (loading the header/footer all over again) and making things more efficient.
Advanced Requests and Responses in AJAXR
In this article, Brett McLaughlin will show you the different status codes and demonstrate how browsers handle each and he will showcase the lesser-used HTTP requests that you can make with Ajax.
AJAX Drag and Drop Tutorials
Fun with Drag and Drop with RICO
For those of you who haven't seen Rico its another AJAX library, with quite a few cool extras. What I'm going to cover here is my first expiriment with Rico and their 'drag and drop' functionality. Getting basic drag and drop functionality is extremely easy with this library, and with just a bit of modification you can easily make it fit whatever you could want.
Drag & Drop Sortable Lists with JavaScript and CSS
In Web applications I've seen numerous, and personally implemented a few, ways to rearrange items in a list. All of those were indirect interactions typically involving something like up/down arrows next to each item. The most heinous require server roundtrips for each modification...boo.
Building a Drag-and-Drop Shopping Cart with AJAX
For this article, we'll create an interactive shopping experience allowing us to add items to our shopping basket by dragging and dropping them onto an icon of a shopping cart. We'll add AJAX functionality, allowing us to update our shopping cart without redrawing the entire screen.
AJAX Form Tutorials
Accessible Forms and Unobtrusive Javascript
I usually try to separate backend logic from the user interface logic when creating new PHP applications. I am pro fat gui and usually have a lot of client side scripting going on. I mostly use AJAX or other remote scripting techniques to call actions defined in the PHP backend.
Submit a form with Ajax
The new release of CakePHP (RC2) comes with a completely rewritten AjaxHelper::form() function (with the disadvantage that it breaks existing code).
Niceforms
Web forms. Everybody knows web forms. Each day we have to fill in some information in a web form, be it a simple login to your webmail application, an online purchase or signing up for a website. They are the basic (and pretty much the only) way of gathering information on the web.
AJAX File Uploader Tutorial
Better File Uploads with AJAX and JavaServer Faces
In this article, we will take fresh approach and implement an AJAX-powered component that will not only upload the file to server, but also monitor the actual progress of a file upload request in "real time."
AJAX Framework and Toolkit Tutorials
AJAX Tutorial with Prototype
I wanted to give an example of a good use of AJAX, and at the same time keep it simple. So I thought a good example would be to build a zip code verifier. As soon as the person enters the zip code it makes a request to the server to see if the zip code is in the database, and returns the city and state.
Learn xajax in 10 Minutes
xajax is designed to be extremely easy to implement in both existing web applications as well as new projects. You can add the power of xajax to nearly any PHP script in seven easy steps.
Using Ajax with PHP and Sajax
This tutorial explains how to use Ajax with PHP and introduces the Simple Ajax Toolkit (Sajax), a tool written in PHP that lets you integrate server-side PHP with JavaScript that makes this work.
Developer Notes for prototype.js
If you tried to use this library recently, you probably noticed that documentation is not one of its strongest points. As many other developers before me, I got my head around prototype.js by reading the source code and experimenting with it. I thought it would be nice to take notes while I learned and share with everybody else.
AJAX Getting Started Tutorial
AJAX:Getting Started
This article guides you through the AJAX basics and gives you two simple hands-on examples to get you started.
AJAX Image Gallery Tutorial
Ajax: What is it Good For?
AJAX image gallery tutorial with some history and commentary
AJAX Keyword Suggest Tutorials
How to create the Google Suggest feature with ASP.NET 2.0
Google Suggest seems to be the topic du jour in the blogosphere. It is a cool feature, but what I really enjoy is that it is yet another real world example of a "chubby" client.
Creating an Autosuggest Textbox with JavaScript, Part 1
Over the past year, Google has branched out from its search engine into other types of Web applications. One that caused a great deal of excitement among Web developers is Google Suggest. The basic idea is very simple: as you type, Google suggests search terms that come up with results. The first suggestion is filled into the textbox as you type while a list of several suggestions appears in a dropdown list beneath the textbox.
AJAX Live Search Tutorials
HOWTO: Animated Live Search / Ordered List
've been meaning for some time to give a little tutorial on the live search I created for this latest design. There are a few steps involved, and I'll do my best to explain each as we go.
Live search explained
Live search will gradually replace traditional search in web applications. As mainstream programs such as Windows Vista matures up to release, and live search is deeply integrated, we can expect more web pages implementing live search.
AJAX Rounded Corner Tutorials
Rico rounded corners without all of Rico
I extracted and made very minimal changes to Rico's rounded corner implementation so I could use it without needing all of Rico. Currently I'm using Script.aculo.us in all of my projects and didn't need all of Rico, but Script.aculo.us doesn't have a Rounded Corners implementation. All credit to the talented guys over at OpenRico for this!
AJAX Sorting Tutorial
Make all your tables sortable
Tutorial on how to make all your tables sortable
AJAX Tabbed Pages Tutorials
Building Tabbed Content
This workshop we will be building a tabbed content browser that's Ajax powered. When ever a user clicks a tab the Ajax will communicate with the server and send back the appropriate data for that tab. We will start this workshop off with the XHTML and CSS for the tabbed content browser.
Make an AJAX Website in Less than 10 Minutes
I've been toying around with AJAX apps and XMLHttpRequest but have wanted to put up a site that loads all of its content asynchronously. If you're like me and you learn best from working with examples you're only 10 minutes away from your first AJAX website.
Very Dynamic Web Interfaces
One of the classic drawbacks to building a web application interface is that once a page has been downloaded to the client, the connection to the server is severed. Any attempt at a dynamic interface involves a full roundtrip of the whole page back to the server for a rebuild--a process which tends to make your web app feel inelegant and unresponsive. In this article, I'll be exploring how this problem can be tackled with the use of JavaScript and the XMLHttpRequest object.
AJAX Design Patterns
Excellent tutorial on how to build an AJAX powered website, with dynamic page loads.
Beautiful JavaScript-Powered Pages
I've been delving deeply into the world of Javascript-powered interfaces. Now that I've had some time to play and learn about the scripts and techniques that are out there, I've come to what I believe to be the ultimate combination.
Saturday, December 1, 2007
Study at MIT for free - MIT Open Courseware
OCW is a free publication of course materials used at MIT.
- Get lecture notes, problem sets, labs and more.
- Watch lecture videos and demonstrations.
- Study a wide variety of subjects.
MIT is committed to advancing education and discovery through knowledge open to everyone.
OCW shares free lecture notes, exams, and other resources from more than 1800 courses spanning MIT's entire curriculum.
MIT OpenCourseWare is an idea—and an ideal—developed, supported, and embraced by the MIT faculty, who share the Institute's mission to advance knowledge and educate students in science, technology, and other areas of scholarship to best serve the nation and the world. In 1999 the Faculty considered how to take best advantage of the Internet to advance education, and in 2000 proposed OCW.
Friday, November 30, 2007
Easy setup and configure WampServer - MySQL5, PHP5 + PECL, Apache2, PhpMyAdmin on Windows XP
WampServer installs automatically (installer), and its usage is very intuitive. You will be able to tune your server without even touching the setting files.
WampServer also has a trayicon to manage your server and its settings.
Thinwire - Next generation Ajax Framework
Tutorials
- Build Web apps with ThinWire and Java code, Part 1: Manage Web app layout
With ThinWire, an open source development framework, you can build Web applications that look and feel like desktop applications. In this five-part series of tutorials, you'll learn how to develop rich Web applications using ThinWire and Java(TM) programming. In Part 1, you begin the process and learn how to deal with user interface layout issues in ThinWire. You will discover in this tutorial that providing dynamic layout management using the ThinWire framework is a relatively easy thing to do. - Build Web apps with ThinWire and Java code, Part 2: Using the SplitLayout Class
With ThinWire, an open-source development framework, you can build Web applications that look and feel like desktop applications. In this five-part series, you'll learn how to develop rich Web applications using ThinWire and Java. In Part 2, you learn to use the SplitLayout class in conjunction with your own layout management code to dynamically change the layout of a ThinWire GUI based on the current size of the Web browser window. - Build Web apps with ThinWire and Java code, Part 3: Styling support
With ThinWire, an open-source development framework, you can build Web applications that look and feel like desktop applications. In this five-part series, you'll learn how to develop rich Web applications using ThinWire and Java programming. Here in Part 3, you learn to use ThinWire styling support at both a global level and an individual component level. - Build Web apps with ThinWire and Java code, Part 4: Write a template class
ThinWire is an open source development framework that lets you build Web applications that look and feel like desktop applications. This five-part series explores how to develop rich Web applications using ThinWire and Java programming. In this installation, learn how to write a template class that defines one of the most commonly used Web page layouts. - Build Web apps with ThinWire and Java code, Part 5: Page switching
Part 5 of the "Build Web apps with ThinWire and Java code" series explores a methodology for separating your ThinWire and Java Web site into multiple pages, providing the ability for your clients to switch among those pages using either direct pointer links or sequential page access. - Developing Ajax Web Applications using ThinWire and Java
For those who know how to write stand-alone, event-driven Java/OOP applications, this is the easiest way that I know of to develop rich web applications.
MySQL Singleton Class with PHP5
class MysqlDB{
static private $instance_MysqlDB = null;
private
$objMysqli;
/**
* Instantiate the object
**/
private function __construct(){
$this->objMysqli = new mysqli("localhost", "root", "", "mysql");
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
}
/**
* Perform a query
*
* @param string $sql
*/
public function select($sql){
$this->objMysqli->query($sql);
$this->var_dumping();
}
/**
* Var dump the current object
*/
public function var_dumping(){
var_dump($this);
}
/**
* Get the current instance for the object
*
* @return object
*/
static public function getInstance(){
if(self::$instance_MysqlDB == null){
self::$instance_MysqlDB = new self;
}
return self::$instance_MysqlDB;
}
}
---------------------------------------
To use the singleton we will never use the constructor method. We will call the getInstance method.Here is an example :
include_once("MysqlDb.php");
MysqlDB::getInstance()->select("SELECT * FROM `help_category` LIMIT 5");
Zend Framework Overview
Is it a framework?
The first thing that I always have to explain when talking about the Zend Framework is that to me it is not a ‘framework’ or not in the same way others are frameworks. This causes a lot of confusion and misunderstand of what the Zend Framework has to offer. To me most frameworks require you to conform to how they ‘think’ (something Ruby/Rails suffers from) and breaking out from their thinking requires actual alteration of the framework.
To me the Zend Framework is actually a Library, something that I can pick and choose from and although a good percentage of each module does also interact with other modules this behavior can in most cases be overridden or sub-classed and behaviour changed.
The MVC
Another difference is that a lot of Frameworks revolve around their own implementation of the MVC (Model View Controller) and again if you want to break out from how they work then you may as well not use any of the framework. The Zend Framework does of course include modules that assist in setting up a MVC and it has many great tutorials on ‘the standard’ way of doings things. But once you begin to understand how everything fits together it has incredible power for those who want to stretch its legs.
Not for beginners?
I will at this point make lots of enemies by saying that the Framework is a professional product and is not really for the beginner. Although it has made strides towards simplifying some aspects of the MVC (and other modules) it is still certainly more complex than others and if you have no inclination to do anything ‘out of the ordinary’ then my advice is to use something else.
The Modules
The Zend Framework as I mentioned earlier is made up of a range of modules (full list here) most of which fav.or.it uses at one level or another. I wont go into detail for all of them as I would just be repeating what is said in the manual.
Zend_Acl - Access Control List
I have previous written at length about the ACL and done a podcast on the subject. It is a little hard to get your head around to start off with (the reason I tried to explain it in the PodCast) but it is extremely powerful and versatile.
Zend_Auth - Authentication
Authentication made simple. Although again we have sub-classed and extended the functionality it again got us up and running within hours and then let us think about the more complex tasks by filling in the basics.
Zend_Cache - Caching
The cache is fundamental for anyone who is serious about long term scalability. It allows caching of pages/parts of pages or just raw data. It has two killer features for me 1) Range of backend solutions (File,SQL, Memcache, ZendPlatform) 2) Tagging. The back end options give me great flexibility to choose the right kind of caching for the situation plus it is easy to extend to add your own. The tagging is a delightful way to group together different pieces of information so that they can be cleaned up / listed by tag or tags.
We created a whole new interface so we could view the current state of the various caches we have and allows us to clear out entries by key (every item must have a unique key) or by tag.
For anyone thinking about investing in Zend Platform it also means that when that time comes that any caching can be handed over to the platform.
Zend_Controller / Zend_View
I am a massive fan of well structured MVC’s and the Zend Framework gives me the flexibility to do everything we could possibly want. As default creating mapping between URL & method/controller gives you quick setup. You can then easily extend the routing (how a URL gets translated).
We have a whole set of custom routes, we have a fully sub-classed dispatcher and make use of the helpers when we can.
The Zend_View is quite simple as a starting point but is easily extended and can achieve a range of design patterns. We have various extensions to give us partials and layouts. The partials allow us easy blocks that have local variables assigned to render pages. The layout lets us arrange numbers of blocks/sections.
Zend_Db - Database
I cannot recommend Zend_Db enough! It is at once very simple to get going but fantastically full of depth. I had never considered myself much of a database expert and Zend_Db allowed me to think about the programming problem rather than SQL. The ability to build select statements programmatically with a consistent interface is a dream come true.
Zend_Feed
fav.or.it is all about feed aggregation and Zend_Feed gave us a fantastic head start on consuming and producing feeds. We have sub-classed this heavily as we have a lot of special requirements but it did save us lots of time covering the basics.
Zend_Filter + Zend_Filter_Input + Zend_Validate
I put these all in together as they all have similar tasks. Although at first I found constantly building up filter/validation chains long winded (but very readable) I soon starting building helper functions that let me build the chains with shorter (not sure if clearer) syntax which could then be easily repeated.
e.g.
const FILTER_EXAMPLE = 'Alnum:Alpha:StringTrim';
$string = Filter_Helper::filter(FILTER_EXAMPLE,$string);
The same can be applied for building up Validators. At some point I will release the full syntax and the code.
The Rest
- Zend_Gdata - Easy to use and very powerful, we use it to access blogger services
- Zend_XmlRpc - This is still in its infancy but it still does the job for most tasks
- Zend_Http - Want to perform some custom request? this handles nearly everything, we use it all over the place for a range of tasks and has proved to be very robust
- Zend_Date - Dates come in lots of formats and Zend_Date means you treat them all the same, a few question marks over future performance when over using this
- Zend_Log - Does what it says on the tin, quite lightweight but easily extended to give a few extra features that makes it worthwhile
- Zend_Session - I try and keep clear of over using session data but having the ability to namespace your sessions makes this very useful
Conclusion
The Zend Framework does a fantastic job of giving you a professional quality set of tools to get going with quickly and then when required it doesn’t stop you customizing it when you need to. As you grow more confident and start to understand the underlying reasoning behind the framework you start to work with it more and more and it encourages you to achieve the same kind of extensibility that it has achieved.
Thursday, November 29, 2007
Beginning Symfony tutorial - Moving from plain PHP to Framework based development
With the release of symfony 1.0, it's time for those who haven't tried it yet to see what's inside this beautiful framework. Stable, fully documented, and released under the open-source MIT license, symfony is used by hundreds of web sites, including some very large ones (Yahoo! Bookmarks, with its 20 million-strong user base, is built with symfony). If you haven't taken the time to look at the introductory screencasts on the symfony project website, this simple tutorial will lead you through the basics.
The best way to learn and understand symfony is to use it, so this article will lead you through the creation of a photo album application with this framework. You already know the basic features such an application should offer: the ability to upload photos, to describe and tag them, and the ability for visitors to browse and comment on your photos.
Symfony is a Model-View-Controller (MVC) framework written in PHP that's aimed at building web applications. If you're already familiar with the MVC paradigm, you won't be surprised by the way symfony organizes scripts. If you aren't familiar with MVC, you just need to understand that separating the code into three parts -- the logic code (called the Model), the presentation code (the View), and the request handling code (the Controller) -- is a good way to ensure the maintainability and reusability of code.
Not only is Symfony an MVC implementation in PHP, it also integrates a lot of objects that facilitate the development of web applications -- and integrates them all with a coherent syntax. Smart URLs, code generation, easy templating, internationalization, caching, automated form validation, and Ajax, are among the most appreciated symfony features. Developing an application with symfony is slightly different than building it with any other framework, or without any framework at all. It's faster, more productive, and just plain fun. But enough talk, let's see some code.
Checkout;
Now php scripts are developed that are more compatible to generate highest pay per click revenues. These are a nice choice for the webmaster that is a beginner, since php based web design is not easier to develop and master. A beginner can just think of getting cheap domain names and high speed broadband services but has little access to search engine optimization tricks.
Tuesday, October 23, 2007
Tune your web application's performance
- JMeter - used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.
- ab - is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving.
- Web Application Stress Tool - The Microsoft WAS web stress tool is designed to realistically simulate multiple browsers requesting pages from a web site. You can use this tool to gather performance and stability information about your web application. This tool simulates a large number of requests with a relatively small number of client machines. The goal is to create an environment that is as close to production as possible so that you can find and eliminate problems in the web application prior to deployment.
Thursday, October 4, 2007
First cheque from Google ;)
Sunday, September 30, 2007
Icons and Flags; Famfamfam
Saturday, September 29, 2007
Submit your codes to be refactored by experts
Issue tracking systems for Agile development
- Trac is a web-based software project management and bug/issue tracking system. It provides an interface to Subversion and an integrated wiki.
- Roundup is a simple-to-use and -install issue-tracking system with command-line, web and e-mail interfaces
- Mantis is a free popular web-based bugtracking system, written in the PHP scripting language and works with MySQL, MS SQL, and PostgreSQL databases and a webserver. Known to be good one written in PHP.
- Flyspray is an simple, web-based bug tracking system written in PHP for assisting with software development.
- Whups is Horde's bug tracking/ticketing system, designed to be extremely flexible in letting users define kinds of tickets, different lifecycles (sets of states) and priorities for each kind of ticket, and mixing types of tickets into sets of queues.
- EZ-Ticket is a PHP/SQL web based Ticket system, built with SIMPLICITY in mind. Unlike other ticket systems, this ticket system has the same functionality that other ticket systems have, without all the complexity, making it's use efficient and effective.
- Eventum is a user-friendly and flexible issue tracking system that can be used by a support department to track incoming technical support requests, or by a software development team to quickly organize tasks and bugs.
- BugTracker.NET is a free, open-source, web-based bug or customer support issue tracker written using ASP.NET, C#, and Microsoft SQL Server
- phpBugTracker is a web-based bug tracker with functionality similar to other issue tracking systems, such as Bugzilla. Design focuses on separating the presentation, application, and database layers.
- Zwiki Tracker is a simple issue tracking system which can be enabled in any zwiki. Issues can be created via web form, by mail-in, or by renaming an ordinary wiki page.
- BUGS - the Bug Genie is an open source enterprise level issue tracking system, built on open source technology. "BUGS" enhances your development process, by offering an advanced tool to manage bug reports, feature requests and user feedback for your products.
- JTrac is an open source and highly customizable issue-tracking web-application written in Java.
Thursday, September 20, 2007
RubyOnRails vs Everyone
Two more videos are going to release soon, so stay tuned.
Wednesday, September 19, 2007
Zend Framework reviews, articles, tutorials, blogs and resources
Introduction & Reviews
- A first look at the Zend Framework
- Will the Zend Framework save PHP?
- A review of the Zend Framework, (includes 3 parts)
- So What Is ‘Zend Framework’, Anyhow...?
- Quick Zend Framework review
- Zend Framework: First Impressions
- Zend Framework: PHP + MVC + More!
- Zend Releases Version 1.0 of Framework App
- PHP Framework - The Zend Framework
- Zend Framework Preview Release Available
- Zend Framework Introduction
- Zend Framework: Getting Started Screencasts
- Step-by-step first look tutorial by Chris Shiflett, and ZF contributor
- Understanding the Zend Framework, IBM series of tutorials(1-9)
- Zend Framework: Creating a CRUD Application
- Automatic testing of MVC applications created with Zend Framework
- Syndicate content with Zend Framework Zend_Feed classes
- Beginning with Zend Framework
- Getting Started with the Zend Framework (1.0)
- Getting Started with Zend_Auth (0.9+)
- Getting to know Zend_View
- Integrating Smarty with the Zend Framework
- RESTful Web Services with Zend Framework
- Using Smarty as template engine
- Zend_Search (Java Lucene)
- Zend Framework Online Demo
- Getting Started with Zend_Search_Lucene
- Zend Framework Bootstrap.php - Introduction
Sites
- Zend Framework Official Site
- Zend Framework: Documentation
- ZendWork - Coding Samples, Tutorials, Code Snippets, Articles,How-To`s
- Akra’s DevNotes
- Maugrim The Reaper's Blog
- Big Room Blog
- Zend Framework Daily
- Nick’s Notepad
- L-P Huberdeau Blog
- Graphics by Greg Blog
- Alex@Net
- Phly, boy, phly
Resources
Update on 06/02/2008
Monday, September 17, 2007
Website screenshot capture with ASP.NET and PHP
ASP.NET
Never forget that ASP.NET and Windows Forms applications are all about .NET Framework. So theoretically we can do all the things in an ASP.NET application like we do in Windows Forms. The idea behind our solution will be to initialize a hidden WebBrowser component and load our web site inside it to be able to get screenshot.
Original article can be found on Codeproject.
Imports System
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Windows.Forms
Imports System.Diagnostics
Namespace GetSiteThumbnail
Public Class GetImage
Private S_Height As Integer
Private S_Width As Integer
Private F_Height As Integer
Private F_Width As Integer
Private MyURL As String
Property ScreenHeight() As Integer
Get
Return S_Height
End Get
Set(ByVal value As Integer)
S_Height = value
End Set
End Property
Property ScreenWidth() As Integer
Get
Return S_Width
End Get
Set(ByVal value As Integer)
S_Width = value
End Set
End Property
Property ImageHeight() As Integer
Get
Return F_Height
End Get
Set(ByVal value As Integer)
F_Height = value
End Set
End Property
Property ImageWidth() As Integer
Get
Return F_Width
End Get
Set(ByVal value As Integer)
F_Width = value
End Set
End Property
Property WebSite() As String
Get
Return MyURL
End Get
Set(ByVal value As String)
MyURL = value
End Set
End Property
Sub New(ByVal WebSite As String, ByVal ScreenWidth As Integer, &_
ByVal ScreenHeight As Integer, ByVal ImageWidth As Integer,&_
ByVal ImageHeight As Integer)
Me.WebSite = WebSite
Me.ScreenWidth = ScreenWidth
Me.ScreenHeight = ScreenHeight
Me.ImageHeight = ImageHeight
Me.ImageWidth = ImageWidth
End Sub
Function GetBitmap() As Bitmap
Dim Shot As New WebPageBitmap(Me.WebSite, Me.ScreenWidth, &_
Me.ScreenHeight)
Shot.GetIt()
Dim Pic As Bitmap = Shot.DrawBitmap(Me.ImageHeight, &_
Me.ImageWidth)
Return Pic
End Function
End Class
Class WebPageBitmap
Dim MyBrowser As WebBrowser
Dim URL As String
Dim Height As Integer
Dim Width As Integer
Sub New(ByVal url As String, ByVal width As Integer, &_
ByVal height As Integer)
Me.Height = height
Me.Width = width
Me.URL = url
MyBrowser = New WebBrowser
MyBrowser.ScrollBarsEnabled = False
MyBrowser.Size = New Size(Me.Width, Me.Height)
End Sub
Sub GetIt()
MyBrowser.Navigate(Me.URL)
While MyBrowser.ReadyState <> WebBrowserReadyState.Complete
Application.DoEvents()
End While
End Sub
Function DrawBitmap(ByVal theight As Integer, &_
ByVal twidth As Integer) As Bitmap
Dim myBitmap As New Bitmap(Width, Height)
Dim DrawRect As New Rectangle(0, 0, Width, Height)
MyBrowser.DrawToBitmap(myBitmap, DrawRect)
Dim imgOutput As System.Drawing.Image = myBitmap
Dim oThumbNail As System.Drawing.Image = New Bitmap(twidth, &_
theight, imgOutput.PixelFormat)
Dim g As Graphics = Graphics.FromImage(oThumbNail)
g.CompositingQuality = Drawing2D.CompositingQuality.HighSpeed
g.SmoothingMode = Drawing2D.SmoothingMode.HighSpeed
g.InterpolationMode = Drawing2D.InterpolationMode. &_
HighQualityBilinear
Dim oRectangle As Rectangle
oRectangle = New Rectangle(0, 0, twidth, theight)
g.DrawImage(imgOutput, oRectangle)
Try
Return oThumbNail
Catch ex As Exception
Finally
imgOutput.Dispose()
imgOutput = Nothing
MyBrowser.Dispose()
MyBrowser = Nothing
End Try
End Function
End Class
End Namespace
PHP
Original article can be found here on The Pimp. Alternatively you can use third party thumbnail generators API, but your app will be dependent which you will not want.
$im = imagegrabscreen();
imagepng($im, "myscreenshot.png");
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$im = imagegrabwindow($handle);
$browser->Quit();
imagepng($im, "iesnap.png");
$im = imagegrabscreen();
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->Navigate("http://blog.thepimp.net");
/* Still working? */
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
$browser = new COM("InternetExplorer.Application");
$handle = $browser->HWND;
$browser->Visible = true;
$browser->FullScreen = true;
$browser->Navigate("http://blog.thepimp.net");
/* Is it completely loaded? (be aware of frames!)*/
while ($browser->Busy) {
com_message_pump(4000);
}
$im = imagegrabwindow($handle, 0);
$browser->Quit();
imagepng($im, "iesnap.png");
?>
It should work with any kind of window as long as you give the correct handle (usually $obj->HWND).
- php_gd2.dll for 5.2.x thread safe build
- php gd image documentation
- IE manual
Hiding your files in image on Windows
- Rar(archive) your files using Winrar.
- Find any picture that you want your files hidden in it. Lets say that picture name is "pic.jpg"
- Open windows command console. (Start->Run->cmd)
- Run following command; copy /b pic.jpg + secrets.rar picwithsecrets.jpg
Hope it helps ;)
Sunday, September 16, 2007
How to be productive
It really works, believe me. Nothing to lose if you try.
1. Write down tasks
2. Break tasks down into the smallest unit possible
3. Prepare your most comfortable environment
4. Start with the easiest tasks first
5. Set small, medium, and long term goals
6. Only work on one task a time
My Programs
Firefox - Everything you need when you are connected. With its add-ons, you can do anything you wish.
Irfanview - For image
Notepad++ - Simple notepad replacement to see code files without loading huge IDES. It has nice syntax coloring, and formating feature for all languages you know.
Filezilla - Using it when transferring
7zip - Very cool archiving software that you can use instead of winrar, winzip etc... Support many formats of archives.
Bsplay - Free and old version of BSPlay. New version now costs money ;) After installing codec package, you can watch all types of video.
Winamp - Listen to the music, radio and online tv.
Bitlord- Sometimes you need to download from torrent world. Bitlord is the coolest and simplest client. i like it, but the old one. New version looks like very complex.
Pdfcreator - Convert your any types of files into PDF.
Gtalk - Easy to use and simple chat that is integrated with Gmail. I Love Google.
Friday, August 31, 2007
Free Charting Components for .NET
- ZedGraph - most mature .NET library for 2D charting. You can use it for your enterprise applications instead of commercial charting components.
- NPlot - a free charting library for .NET. It boasts an elegant and flexible API. NPlot includes controls for Windows.Forms, ASP.NET and a class for creating Bitmaps.
- SasqChart - support both ASP.NET and WinForms. Able to draw Bar Charts, Stacked Bar, Line Charts, Area Charts, Stacked Area and Pie Charts.
Tuesday, August 28, 2007
60+ template engines for JAVA, PHP and .NET
Java
- The Apache Velocity Engine - a free open-source templating engine. Velocity permits you to use a simple yet powerful template language to reference objects defined in Java code. It is written in 100% pure Java and can be easily embedded into your own applications
- StringTemplate - a java template engine (with ports for C# and Python) for generating source code, web pages, emails, or any other formatted text output. StringTemplate is particularly good at multi-targeted code generators, multiple site skins, and internationalization/localization.
- FreeMarker is a "template engine"; a generic tool to generate text output (anything from HTML to autogenerated source code) based on templates. It's a Java package, a class library for Java programmers. It's not an application for end-users in itself, but something that programmers can embed into their products. Integrates with servlets, XML, Python and more
- JBYTE - JavaBY Template Engine is a general template engine used for generating any type of text document from a template. JavaBY Template Engine is used mostly for generating HTML from servlets but it can also be used for generating XML, RTF, WML, e-mail text, source code and configuration files.
- Jamon - a text template engine for Java, useful for generating dynamic HTML, XML, or any text-based content. Jamon clearly is aimed at the View (or presentation) layer. It has a rich feature set to support encapsulation, parameterization, functional decomposition, and reuse of presentation logic.
- Tea is a simple yet powerful template language. Tea is most commonly used for creating dynamic web pages in the TeaServlet. Tea is a strongly typed, compiled programming language, designed to work within a Java-based hosting environment. Tea is designed to enforce a separation between data acquistion and presentation, without sacrificing basic programming constructs.
- JDynamiTe is a simple yet powerful tool used to create dynamic documents from "template" documents. It is based on the same concept as those of "FastTemplate", which is a very popular PHP extension used in many Web sites to create dynamic HTML pages. Note: JDynamiTe is not a Java port of FastTemplate.
- BTE (Better Templates for Everyone) - A template system designed to make the creation of web sites easier.
- Jxp (Java scripted page) is a script-processor that process JSP-like files. It contains a parser to parse the script file into an abstract syntax tree and a tree processor (JxpProcessor) that will process the syntax tree to execute the code using reflection API to produce output.
- SiteMesh - a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.
- LSP is an advanced web template language based on XML technology. LSP provides powerful and easy to use presentation logic, but keeps business logic and technical details out of templates. LSP is compiled into Java bytecode for efficient execution.
- Dynamator - a simple but powerful tool that transforms standard HTML and XML files into server pages or programs. Dynamator works with any page generation technology, including JSP, XSL, PHP, ASP, Velocity, Cold Fusion, and Java. Dynamator is compatible with any application architecture, and has no performance impact.
- Jtpl - a template engine for Java Servlet which allows you to store your HTML code apart from your Java code.
- Bluprints - a JSP templating framework that provides a simple and powerful alternative to Tiles and other frameworks. JDK 1.5 is required to run Bluprints.
- WebMacro - more effective for rendering web pages than JavaServerPages, PHP, and ASP. We say this because, since 1999, programmers around the world have used both and universally endorsed WebMacro.
- Canvas - a template generator based on the Groovy language. It uses the familiar Velocity Java API to bind variables and allows you to use the full expressivity of Groovy inside your templates.
- IKAT - the purpose of IKAT is to establish a complete separation between presentation and business logic.
- Asp.NET HTML Template Engine - create HTML templates for your ASP.NET application. Multiple template regions can be defined; you are no longer restricted by the usual header / footer templates.
- NVelocity - a .Net-based template engine. It permits anyone to use the simple yet powerful template language to reference objects defined in .Net code.
- Netro - a .Net-based template engine. It allows the use of simple yet powerful template language to reference objects defined in .Net code.
- Evolve MasterPages - a powerful template engine which allows you to merge the contents of your ASP.NET web forms with a Master Page (template). It's very easy to use and provides full designer support. It's extremely easy to use and provides full designer support. The engine provides a new approach regarding the separation of ASP.net templates and webforms and makes it extremely easy to get your templates working. It prevents you from scattering additional HTML all over your web application and enforces a clean separation of design and development.
- StringTemplate.NET - an idiomatic C# implementation of the Java StringTemplate Library. It runs on C#/CLI platforms such as Microsoft .NET, Novell Mono and dotGNU. StringTemplate.NET is a template engine for generating formatted text output. Examples of such output includes source code, web pages and emails. It differs from most other template engines by [more] strictly enforcing Model-View separation.
- Smarty - a template engine that compiles the templates into PHP scripts, then executes those scripts. Very fast, very flexible.
- web.template - new template system, works only with PHP5, uses XML-like look language, and you can call for templates method in your classes.
- XTemplate - a cool templating engine for PHP, allows you to store your HTML code separately from your PHP code (as opposed to compiling your template into PHP as per Smarty etc.). It has many useful features such as nested blocks and various kinds of variable interpolation, and yet the code is very short and very optimized.
- Open Power Template - a template engine written in PHP, and probably the one, which natively supports PHP 5. While developing it we chose two main goals for it: to be fast, and to be flexible. OPT uses a very effective template parsing algorithm, which compiles the templates into the PHP code.
- FryPHP - very young, fast and easy to learn templating engine/system for PHP5, written in object oriented manner using test driven development (TDD), allows local variables for each template, you also can set global variables.
- Template Class - very easy to use yet powerful and quick template engine. It can handle simple variable replacement and table building using two dimensional arrays and/or MySQL result sets. Performance is excellent. Has support for multiple template files. Documentation is included in the zip file.
- Template Lite - written under PHP 5 and is currently being written under PHP 5.2.1 with E_STRICT enabled. Template Lite works without error under all versions of PHP 5 from 5.1.3 and higher. Before PHP 5.1.3 VAR would give a warning notice under E_STRICT. Template Lite works under PHP 5 without any errors but does not use any PHP 5 specific attributes.
- PHPTAL - a XML/XHTML template library for PHP. Some PHPTAL advantages and features; enforce the separation between logic and presentation, no more htmlentities, quite clean and readable templates, ability to insert sample text inside template to preview template result without PHP backend, integrates quite well with WYSIWYG HTML editors, data abstraction using xpath like system, cool html macro system, integrated internationalization system, ability to replace xpath system with php expressions, nearly no speed loss, and template source filter interface
- Savant - a powerful but lightweight object-oriented template system for PHP. Unlike other template systems, Savant by default does not compile your templates into PHP; instead, it uses PHP itself as its template language so you don't need to learn a new markup system.
- YATS - seeks to preserve FastTemplate features while improving on usability and speed. It is not a direct port of FastTemplate, as it adds/removes some features, changes the syntax, and simplifies a few things, such as template definition.
- Simple Turtle PHP Template - a simple, small, fast and quick to use function that helps separate between the logic and presentation layers in PHP programs. It is simple because all it does is string replacements, for both single words and in blocks.
- Templeet is an open-source project initiated by Pascal Courtois and Fabien Penso. It allows you to create photo galeries, news systems, personal sites, blogs, etc. Using Templeet, you can generate HTML, CSS, SVG pictures, SMIL, and any kind of text files.
- Enzyme - simply put, is an engine for storing structured data for structured searching.
- Bleetz - a revolutionary templates parser based on XML generating PHP. It translates Bleetz control tags into universal php code. It is designed to be fully integrated with Macromedia Dreamweaver.
- SSTP (Server-Side Template Parser) - powerful tool for formatting pages based on templates. It will work with virtually any HTML/XHTML page, and has support for advanced features such as syndication of content and intelligent link correction.
- VOOT (Vanilla Object Oriented Templates) - a simple ('vanilla') PHP class for creating web pages with templates. It supports user-defined HTTP headers, and it is capable of processing PHP contained in rendered templates.
- ecTemplate - quit making dirty HTML pages. Separate your PHP code from your HTML. Finally that graphic designer will talk to you again ;)
- phemplate - simple and fast templating engine for php. it provides a way of substituting variables into text templates and do some dynamic block functionality including loops.
- Yapter is a PHP template engine. Other template engines all lacked some kind of functionality for me to just like them 100%.
- ETS - easy template system - a template system written with PHP that enables you to transform a set of data to any type of document.
- PatTemplate is a template system that gives us the power and flexibility to add templates to our PHP driven sites.
- Qtpl - intended for use in CGI scripts. The library will be released in 6 versions: Plain Perl, Plain PHP, C version, PHP/C module, Perl/XS version, C++ version. All of them will support uniform syntax.
- SledgeHammer - a template engine for PHP. It provides separation of business-logic and presentation in web-based applications.
- PHPService is a powerful template engine based on an easy-extensible XML-Metalanguage.
- Virtual Template - class for PHP4 & PHP5 (french)
- SimpleT - An HTML Compiler
- AvanTemplate - is a template engine for PHP. It is multi-byte safe and consumes little computing resource. It supports variable replacement, block that can be set to hidden or shown, loop, multple-depth loop, and include statement in template file.
- TemplatePower - offers you the ability to separate your PHP code and your (HTML) layoutfile. It's simular to the popular template class FastTemplate, but than a lot faster (about 6x faster).
- htmltmpl: templating engine - A templating engine for Python and PHP. Provides web application developers, who need to separate the program code and the design (HTML code) of their web application projects, with a templating tool that can easily be used by cooperating webdesigners with no programming skills.
- MiniTemplator - compact template engine for HTML files. It features a simple syntax for template variables and blocks. Blocks can be nested.
- Layout Solution - simplifies website development and maintenance. It holds commonly used variables and page elements, allowing you to focus on designing your pages rather than worrying about correctly duplicating common layouts over and over.
- TinyButStrong - a library that enables you to create HTML pages dynamically. It enables you to easily display information from your database, but also to seriously harmonize and simplify your PHP programming. TinyButStrong is oriented to HTML but not specialized to Html. This means it can work as well with Text files, XML, RSS, RTF, WML, Excel (xml), ...
- WACT - a template engine that separates code from design.
- bTemplate - small and fast template class that allows you to separate your PHP logic from your HTML presentation code.offers you the ability to separate your PHP code and your (HTML) layoutfile. It's simular to the popular template class FastTemplate, but than a lot faster (about 6x faster).
- QuickTemplate - a PHP extension for mananging templates and performing multi level variable and block interpolation.
- VarPage - very simple PHP class for building websites based on Template files
- FastTemplate - PHP extension for mamanging templates and performing variable interpolation, robust and flexible, and allows you to build very complex HTML documents/interfaces. It is also completely written in PHP and (should) work on Unix or NT.
- Vemplator is PHP template engine that strives to be light-weight yet featured, and does quite well in only 200 lines of code. The template syntax is concise, and the code is written to be extensible. Though it may be somewhat strict (doesn't allow function calls from the template, among other things) it's very usable. The strictness is intended to constrain the template logic to that which relates to presentation.
Monday, August 27, 2007
Red Hat Developer Studio - Introduction
I have downloaded the installer for Windows platform, and installation was pretty simple 8 step. JBoss is bundled with the installer.
Here is the Splashscreen of Red hat developer studio. Little bit heavy than standard eclipse release since it loads pretty much plugins.
The workspace is the one we are already familiar with. The first most important and biggest differences are rich component Palette, Web tab, and additional perspective.
The lovely palette contains pre-configured, useful tools, categorized in the following order.
- HTML
- All elements
- JBoss
- Ajax4jsf
- RichFaces
- Seam
- JSF
- Core
- Facelets
- HTML
- JSTL
- Core
- Formatting
- SQL
- XML
- MyFaces
- Extensions
- Sandbox
- Tomahawk
- Oracle ADF Faces
- Core
- HTML
- Struts
- Bean
- Common
- Form
- HTML
- Logic
- Nested
- Tiles
- Struts Shale
- Clay Plugin
- Core
- XHTML
- List
- Object
- Structural
- Table
- Text
- XForms
- Basic
See also;
Sunday, August 26, 2007
How i am slashdotted
Normally, my blog has approximately 800 visits a day. When the slashdot linked me, it rised to 38,000 a day, which means about 50 times increase. I just started "plenty of code" a month ago, so i had only few bucks in my adsense account. Through the slashdot effect, my account amount is tribled in only two days. What can i say? You guys really encouraged me. Big big big thanks to Slashdot.
I noticed that the slashdot effect brings other effect at the same time, such as digg, del.icio.us, stumpleupon, etc... Here is the tree that shows the effect in general (not exact. what i observe from the analytics report)
...cnet news
...|__ newz.dk
...|__ csdn
...|__ slashdot
............|___hup.hu
............|___downloadblog.it
............|___del.icio.us
.....................|___popurls
.....................|___fichey
.....................|___makeuseof
.....................|___jimmyr
.....................|___many more...
..........|___stumbleupon
..........|___digg
..........|___downloadsquad
..........|___larkware
..........and goes on...
Special thanks to qualified resources sites for developers. My articles have been in popular lists several times. I also find very very useful stuffs from these sites.
...dzone
...dotnetkicks
...Joe On .NET
Things shouldn't be so complex.
See Also;