Capturing the thumbnail of a website is pretty useful when you are creating a web application like web 2.0 directory, site review, website preview, etc... So how do you implement it in your language? I did it in my asp.net application which was was very easy. And i searched for the way in PHP. Although, PHP doesn't support natively, there are tricks that you can use to capture screenshots of websites. Here is the code snippets; 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. It should work with any kind of window as long as you give the correct handle (usually $obj->HWND).
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
$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");
?>
Monday, September 17, 2007
Website screenshot capture with ASP.NET and PHP
Friday, August 31, 2007
Free Charting Components for .NET
As you know, few weeks ago I have introduced about WebChart, a free and open source .NET charting and graph library. You can read that post here. But now, let me introduce three more charting components which are also free to use, and open source. You can use these libraries for drawing professional graphs and charts with different types for desktop applications as well as web based applications.
- 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
Template engines are designed to allow the separation of business logic from the presentation layer, which means allowing MVC architecture to the developers. With the aid of template engines, we are able to develop websites with different looks but the same logic or the core code. Template engines are lately known as not good ideas because recent platforms already have embedded template engines to separate views from logic, generate code etc... As you see there are very few template engines in .NET and Java comparing to the PHP. But they are still pretty useful tools for developers.
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.
Tuesday, August 14, 2007
Most Active Open Source Projects in Codeplex
It is nice to see the open source projects' progress in Microsoft world, especially it is been extremely fast growth after the Codeplex launched, and also GotDotNet suggests their hosted projects to move on to Codeplex. As you might remember, I have submitted a post about Codeplex a few weeks ago; Microsoft Open Source Projects. This time, it is proud to list most popular and active top 25 projects that has been hosted in Codeplex.
- AJAX Control Toolkit - a collection of samples and components which make it easier than ever to build and consume rich client-side controls and extenders built on the Microsoft AJAX Library and ASP.NET 2.0 AJAX Extensions. The Toolkit provides both ready to go samples and a powerful SDK to simplify the creation and re-use of your own custom controls and extenders.
- BlogEngine.NET - a full featured blog engine targeted at .NET developers. It is light weight and very simple to modify and extend.
- SharpMap - an easy-to-use map rendering and display engine, including AJAX-powered ASP.Net UserControl and a WinForm 2.0 control. You supply it with GIS data for use in web and desktop applications, and it generates eye-catching, useful maps. Written in C# 2.0.
- VMukti P2P Multipoint Real-time Rich Media Collaboration Platform - Web2.0, distributed, peer-to-peer, grid computing, unified communications SAAS platform for web, phone, and IM rich media collaboration & conference. This Multipoint VoIP, VVoIP Video service delivery platform is based on C#, WPF, WCF, & .NET 3.5.
- GoTraxx - C# program that plays the game of Go.
- DocProject for Sandcastle - drives the Sandcastle help generation tools using the power of Visual Studio 2005/2008 and MSBuild. Choose from various project templates that build compiled help 1.x or 2.x for all project references. DocProject facilitates the administration and development of project documentation with Sandcastle, allowing you to use the integrated tools of Visual Studio to customize Sandcastle's output.
- IronPython - a new implementation of the Python programming language on the .NET Framework. It supports an interactive interpreter with fully dynamic compilation. It is well integrated with the rest of the framework and makes all .NET libraries easily available to Python programmers.
- umbraco - a Content Management Platform (CMS) written in c# on the Microsoft .NET platform. It's fast, flexible and with a user interface that makes it a charm to use.
- Coding4Fun Developer Kit - a collection of components, controls and samples in both Visual Basic and Visual C#. The features of the kit include a single installation file that provides users easy access off the Windows Start Menu to the documentation, sample executables and source code; a toolbox entry within Visual Studio for all components and controls for easy drag 'n drop experience.
- Community Kit for SharePoint - a set of best practices, templates, Web Parts, tools, and source code that enables practically anyone to create a community website based on SharePoint technology for practically any group of people with a common interest.
- Facebook Developer Toolkit - the original Facebook Developer Toolkit for the Microsoft Visual Studio Express Team. This project contains .NET wrappers to the Facebook API. Also, includes sample projects and controls. We are going to start by trying to maintain both the vb.net and C# code bases.
- TheBeerHouse - CMS & e-commerce StarterKit, an ASP.NET 2.0 website which features a layout with user-selectable themes, a membership system, a content management system for publishing and syndicating articles and photos, polls, mailing lists, forums, an e-commerce store with support for real-time credit card processing, homepage personalization, localization and more.
- Vista Battery Saver - tinny program will save up to 70% of your battery by disabling those nice, but greedy Vista features. Running in task bar with private workset of 5.5M and 0% CPU it will do all work for you, by enabling and disabling customizable features when power source changed or battery power fall under certain percent.
- Ajax.NET Professional - one of the first AJAX frameworks for Microsoft ASP.NET and is working with .NET 1.1 and 2.0. The framework will create proxy classes on client-side JavaScript to invoke methods on the web server with full data type support working on all common web browsers including mobile devices.
- Sandcastle Help File Builder - consists of a GUI front end that lets you interactively build help files using Sandcastle. A console mode version is also supplied that allows you to build help files as part of the normal project build. The GUI front end provides access to project settings that let you configure various aspects of the resulting help file including the ability to add additional content, build HTML Help 1, HTML Help 2, or website output.
- dashCommerce - a free, open source e-commerce storefront written specifically for ASP.NET 2.0. It features out-of-the-box product catalog and shopping cart functionality that allows website owners to setup, run, and maintain an online store with little or no costs, license fees, or limitations. dashCommerce offers .NET developers of all skill levels the ability to create an e-commerce site quickly and efficiently. The project is built in C# and takes advantage of features of the Microsoft.NET Framework 2.0. It also supports PayPal Website Payments Standard and Pro as the payment engine.
- PHP Excel 2007 classes - a set of classes for the PHP programming language, which allow you to write to Excel 2007 files and read from Excel 2007 files.
- Power Toys Pack Installer - one-stop download utility for all things power toys. Get latest releases and updates from just a single executable.
- ProMesh.NET Web Application Framework - a MVC-ready lightweight web application framework for .NET 2.0. It includes a full unit testing framework.
- Terminals - a multi tab terminal client to ease the work of anyone who needs to connect simultaneously to more then one terminal server/remote desktop.
Terminals uses Microsoft Terminal Services ActiveX. - Vista Virtual Desktop Manager - A virtual desktop manager made for Windows Vista using the new thumbnail APIs to create a live preview of all of your desktops.
- DinnerNow.net - a fictitious marketplace where customers can order food from local restaurants for delivery to their home or office. This sample application is designed to demonstrate how you can develop a connected application using several new Microsoft technologies, including: IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, Windows Presentation Foundation, Windows Powershell, and the .NET Compact Framework.
- SQL Server Hosting Toolkit - A suite of tools designed to enable shared hosters to provide a great experience around hosted SQL Server.
- Ionics Isapi Rewrite Filter - a small, cheap, easy to use, URL rewriting ISAPI filter that combines a good price (free!) with good features. It is implemented in about 1700 lines of C code, works with IIS 5.x and 6, does regular-expression matching, rewriting, redirects, and RewriteCond. IIS7 will have a nice model for managed ISAPI, but IIRF is available now.
- PowerShell Community Extensions - provides a widely useful set of additional cmdlets, providers, aliases, filters, functions and scripts for Windows PowerShell that members of the community have expressed interest in but didn't make it into PowerShell v1.0. Examples of these cmdlets are Get-Clipboard, Out-Clipboard, Get-Hash, Get-ShortPath, Set-FileTime, New-SymLink, Format-Hex, Format-Xml, Test-Xml, Test-Assembly, Ping-Host, etc.
- QuickGraph 2.0 - provides generic directed graph datastructures and algorithms for them. It also comes with algorithms such as depth first seach, breath first search, shortest path, network flow etc...
- SharePoint 2007 Features - add new functionality to a SharePoint 2007 farm, site collection, or site. This project will create Features to address deficiencies in SharePoint 2007 or add new capabilities. You should understand a little about Features before trying these out. The packages here use batch files or WSP files to install the Features. After installation, be sure to activate the Features to see them in SharePoint.
- iTunes 2.0 - an online rich internet application. Using ajax.asp.net and silverlight im going to bring the iTunes experience completely online.
- Facebook.NET - a framework for creating Facebook applications in .NET. It is optimized for creating ASP.NET-based Facebook applications.
- ASP.NET RSS Toolkit - gives ASP.Net applications the ability to consume and publish to RSS feeds.
- BDCToolkit - The MOSS BDC & DAL generator is a tool that generates typed webservices and a typed c# data access layer from an BDC application definition. It also ensures that the code that has been generated is used on the correct application definition.
- DbEntry.Net - a lightweight Object Relational Mapping (ORM) database access compnent for .Net 2.0. By using Generics and Anonymous Method, it has clearly and easily programing interface. It based on ADO.NET, and supported C#, Visual Basic, ASP.NET, Access, SqlServer, MySql and SQLite etc...
- System Search to LinQ - create a LinQ extension to interact with the new functionality of desktop search using de advantages of the elegant and efficient programming model introduced by C# 3.0
- D.NET (DDotNet) - a "Development for .NET" framework, created to help all developers to create a better applications. Contains a implementation of ORM (Object Relational Mapping) framework with Business Objects Framework and other components.
- TFSBuildLab - simplify the day to day operations when using automated builds and Team System.
- Blind Shark - a musical game, where you have to find the music being played before your opponents.
- Balder - A 3D game engine for Silverlight and possibly other .net based technologies.
- Elephant Game Framework - a small Game Framework, currently set with a focus on game development through Microsoft XNA.
- PoshConsole - a more modern PowerShell Console.
- ASP.NET AJAX Resources, Samples, Articles, Tutorials and Toolkits
- Most popular free/open source IDEs and Editors
- Essential firefox add-ons for web programmers
- Open source .NET libraries you should be already using
- Sharepoint and MOSS 2007 resources, articles and tutorials
- Top 10+ source code search engines
- Most Useful 20+ Visual Studio Add-ins
- J2EE vs ASP.NET vs PHP
- Why you shouldn't use Typed Dataset...!
Update;
I got slashdotted, please go and read the comments on slashdot.
Checkout;
To run an online business related to webmaster tools requires somewhat different strategies to get good pay per click revenues. You can’t rely on simple techniques like email marketing. It’s recommended highly to save an online backup and get powerful adsl connectivity if you’re providing open source projects in Codeplex on your website.
Thursday, August 9, 2007
Why you shouldn't use Typed Dataset...!
When working with persistent layer in .NET environment, you feel something is needed like hibernate or ibatis as a data access layer which automatically makes relations between tables and object, and give us an opportunity to call stored procedures and queries like we call methods of an object. Although hibernate is ported into .NET version, i don't trust its performance and other issues because of why i don't know. Then i looked around for different solutions and found bingoo Typed Dataset. If you haven't used it or know it, you can have a quick check here; Using Strongly-Typed Data Access in Visual Studio 2005 and ASP.NET 2.0. It has many nice sides such as simplifying many things, lessening code size, fastening development time in persistent layer etc... I have implemented all my tables, stored procedures and views using this method. It was really fun to make them. Click, Next, Select Ding dang finish. And it works fine. But after some time, i begin to see the disadvantages and problems of it. So let me list these problems and warn you not to do the same mistakes i did.
Finally, i want to say that i am writing these problems because i didn't find the solution myself. i will be glad if you share with us, if you know the way how to handle these problem.
You created your typed data access layer with wizards. It is okay. But it saves database name, db username information in XSS files, means when you try to deploy your application, you have to use the same database name in a production server. You cannot change the name of the database. Big problem it there is a database with the same name in our production table, or when you try to create two instance of the application which is not possible.
It is common to change the database tables' structure depending on new requirements or because of the wrong analysis. Maybe we need to change the data type of a column of a table, or length or size of a column. So if you change the table's structure you have also to change your entire typed datasets which are related to that table, which is a big headache. Everytime you change table structure, you also need to change dataset.
I suggest you to create your tables and stored procedures under the name "dbo", not custom user. If you create your stored procedure as a "customuser.SelectProducts" instead of "dbo.SelectProducts", the username "customuser" is stored in XSS files of typed dataset. So you cannot change the user name of the database in any place in the future. Same problem again like "Database name change"
Hope it help ;)
See Also;
Tuesday, August 7, 2007
Refactoring Tools for Java and .NET
Refactoring is the process of changing a software system in such a way that it does not alter the external behavior and result of the code yet improves its readability and internal structure. Object oriented developers recognize the value of refactoring working code. Until recently good tools have not been available. This list contains Refactoring tools and IDEs features Refactoring support.
Java
- Eclipse - provides a powerful set of automated refactorings that, among other things, let you rename elements, move classes and packages, create interfaces from concrete classes, turn nested classes into top-level classes, and extract a new method from sections of code in an old method. Becoming familiar with Eclipse's refactoring tools is a good way to improve your productivity.
- RefactorIt - tool for Java developers. A developer can take source code of any size and complexity and rework it into well-designed code by means of over automated refactorings. It may be used as a stand-alone tool or installed as a plug-in to Eclipse, NetBeans, JDeveloper, and JBuilder.
- JRefactory - a plug-in for JBuilder, NetBeans, and Jedit. Also does UML diagrams.
- Transmogrify - Java source analysis and manipulation tool. The current focus of Transmogrify is as a cross-referencing and refactoring utility.Available as a plug-in for two IDEs: Borland's JBuilder, and Sun's Forte4Java.
- JafaRefactor - provides a means of automatically refactoring compilable Java source code using a small catalog of refactoring patterns. This currently includes class, field, method, and package renaming and PushDown and PullUp of methods and fields in an inheritance hierarchy. Other refactorings should be added in a future version.
- XRefactory - an emacs plug-in that is professional development tool for C and Java providing code completion, source browsing and refactoring.
- JBuilder - Borland's primary tool offers some refactoring support. Various plug in tools offer deeper support.
- JFactor - a plug-in tool - works with JBuilder and Visual Age. Instantiations is a well respected outfit with a long history in Smalltalk and Java VM and compiler technology.
- ReSharper - brings unrivalled code analysis, a superior unit testing solution, Go to Symbol navigation, a handy To-do Explorer with multiple unit test sessions, and many other features - to boost individual and team productivity in the world of .NET development.
- C# Refactory - performs a large number of refactorings, allowing you to re-shape your c-sharp code as needs arise. Refactoring is an essential part of the extreme programming development approach. C# refactory enables you to automate many refactorings thus increasing the reliability and speed with which you can refactor your c-sharp code.
- Refactor! - free version code refactoring tool includes 29 time-saving refactorings and is available to all developers working in Visual Studio 2005 and Orcas Beta 1.
- Visual Assist X - Refactoring tool for Visual Studio handling all three .NET languages. Features are suggestions, acronyms and autotext, enhanced syntax coloring, case correction and error underlining, easy access to methods, and hovering class browser
- JustCode! enhances Visual Studio with solution-wide on-the-fly error checking, smart code navigation features, refactoring and other powerful coding tools for C#, J#, Visual Basic .NET, ASP.Net, JavaScript and HTML.
Please visit Martin Fowler's site for more refactoring resources.
See Also;
Friday, July 27, 2007
Open source .NET libraries you should be already using
As we know, there are many good, enterprise level, open source libraries, frameworks and projects implemented in Java. Most of them are being ported into different platforms like .NET and PHP, so developers are migrating to the these platforms with their familiar tools. For example, i have been using Ant, JUnit, Log4J, iText and many mores when i was developing in Java, but now i am still using Log4Net and Nunit in my current .NET projects. You can find many more open source .NET alternatives from the following list;
- AOP.NET (NAop) is an Aspect Oriented Programming (AOP) framework for .NET framework
- NAnt - NAnt is a Ant like build tool for .NET
- ZedGraph is a set of classes, written in C#, for creating 2D line and bar graphs of arbitrary datasets. The classes provide a high degree of flexibility -- almost every aspect of the graph can be user-modified. At the same time, usage of the classes is kept simple by providing default values for all of the graph attributes. The classes include code for choosing appropriate scale ranges and step sizes based on the range of data values being plotted. ZedGraph also includes a UserControl interface, allowing drag and drop editing within the Visual Studio forms editor, plus access from other languages such as C++ and VB
- NCover - A test code coverage tool for C# .NET
- YetAnotherForum - Yet Another Forum.net is a opensource discussion forum or bulletin board system for web sites running ASP.NET. It is ASP.NET based with a MS SQL backend database.
- SharpDevelop - #develop (short for SharpDevelop) is a free IDE for C# and VB.NET projects on Microsoft's .NET platform.
- NInstall - A project to produce an package that can compete with the commercial installer products
- StructureMap - StructureMap is a lightweight Inversion of Control (IoC) Container written for .NET development. StructureMap can improve the architectural qualities of an object oriented .NET system by reducing the mechanical costs of good design techniques.
- BugBye - BugBye is a web-based bugtracking system developed using ASP.NET technology and C# as scripting language
- log4net - log4net is a tool to help the programmer output log statements to a variety of output targets. log4net is a port of the excellent log4j framework to the .NET runtime.
- OpenSmtp.net - OpenSmtp.net is an SMTP component written
- NMail provides an SMTP client & server, POP3 & IMAP4 servers written in C#
- iTextSharp - iTextSharp is a library that allows you to generate PDF files on the fly.
- iBATIS.NET helps you create better persistence layers for .NET applications.
- Personal .NET Portal - is a .NET based Web Portal for personal use. The purpose is to build a Homepage easily. Pages are build through Tabs and Modules.
- NProfiler - An application profiler for .NET
- User Story.NET - This project is a tool for Extreme Programming projects in their User Story tracking.
- RSS Bandit - A desktop news aggregator written
- NxBRE is the first open-source rule engine for the .NET platform and a lightweight Business Rules Engine (aka Rule-Based Engine)
- NetCvsLib - NetCvsLib is a CVS client written entirely for the .NET platform. It is implemented as an assembly, and thus can easily be incorporated into other projects.
- Database Commander - Database Commander is a database manager with user-friendly interface for Windows operation system.
- NVelocity - NVelocity is a .Net-based template engine. It permits anyone to use the simple yet powerful template language to reference objects defined in .Net code.
- NUnit - NUnit is a unit-testing framework for all .Net languages. Initially ported from JUnit
- Maverick.NET - Maverick.NET is a .NET port of Maverick, a Model-View-Controller (aka "Model 2") framework for web publishing. It is a minimalist framework which focuses solely on MVC logic, allowing you to generate presentation using a variety of templating and transformation technologies.
- SharpWebMail - SharpWebMail is an ASP.NET Web Mail application that is written. It uses a POP3 server as the mailstore and sends mail through a SMTP. It is very simple to configure (Only a few settings in the web.config file). You can compose HTML messages, search your inbox, read complex mime messages and much more.
- NUnitAsp - NUnitAsp is a tool for automatically testing ASP.NET web pages. It's an extension to NUnit
- ProntoWiki - is a wiki engine/site written in C# with VWD (Visual Web Developer), using ASP.NET 2.0 with SQLExpress 2005 as the backend. The wiki engine is quick and easy to use, and allows text markup equivalent to that of a rich text editor. It accepts image and file attachments automatically through the web interface. Other features include page preview prior to post/update, user authentication based on roles, a customizable appearance and layout using web parts, history tracking, and search functionality.
- ScrewTurn Wiki is a fast, powerful and simple ASP.NET wiki engine, installs in a matter of minutes and it's available in different packages, fitting every need. It's even free and opensource.
- SAX.NET - SAX dot NET is a C# port of the original Java based SAX API specifications.
For detailed lists of open source .NET projects, go to SCharp Source.
Hope it helps ;)
See Also;
- Essential firefox add-ons for web programmers
- Sharepoint and MOSS 2007 resources, articles and t...
- Top 10+ source code search engines
- Let's have a break - Programmer's Life
- Most Useful 20+ Visual Studio Add-ins
- J2EE vs ASP.NET vs PHP
Wednesday, July 25, 2007
Sharepoint and MOSS 2007 resources, articles and tutorials
From now on, i will try to introduce one blog in a week. Here is the Heather Solomon's Blog, which contains an index of resources for SharePoint products and technologies. This list is slightly slanted towards design and customization, but there are also several resources related to other SharePoint topics. All links are organized into categories, then into resource type (article, blog post, topic, etc).
This is the some titles of categories, each including more than 10 articles, blog posts and tutorials.
- SharePoint References and Resources
- Reference Sites
- SharePoint 2003 - Customization/Modifications Tutorials and Articles
- SharePoint 2003 - Miscellaneous
- SharePoint 2003 - Product and Technology Info and Tools
- SharePoint 2003 - Web Parts
- SharePoint 2007 - Customization/Modifications
- SharePoint 2007 - Miscellaneous
- SharePoint 2007 - Product and Technology Info and Tools
- SharePoint 2007 - Web Content Management (WCM)
Monday, July 23, 2007
Most Useful 20+ Visual Studio Add-ins
This is the list of the Visual Studio Add-ins, most of which are open source or free. I hope this list will help you to code more faster and effective. If there is not your favorite add-in in the below list, do not hesitate to add it as a comment.
- TestDriven.NET - makes it easy to run unit tests with a single click, anywhere in your Visual Studio solutions. It supports all versions of Microsoft Visual Studio .NET and it integrates with the best .NET development tools including NCover, NCoverExplorer, Reflector, TypeMock, dotTrace, NUnit, MbUnit, ZaneBug, MSBee & Team System.
- AnkhSVN - is a Visual Studio .NET addin for the Subversion version control system. It allows you to perform the most common version control operations directly from inside the VS.NET IDE. Not all the functionality provided by SVN is (yet) supported, but the majority of operations that support the daily workflow are implemented.
- C# Refactory - performs a large number of refactorings, allowing you to re-shape your c-sharp code as needs arise. Refactoring is an essential part of the extreme programming development approach. C# refactory enables you to automate many refactorings thus increasing the reliability and speed with which you can refactor your c-sharp code.
- GhostDoc - is a free add-in for Visual Studio that automatically generates XML
documentation comments for C#. Either by using existing documentation inherited
from base classes or implemented interfaces, or by deducing comments from
name and type of e.g. methods, properties or parameters. - SharpTools is an extensible add-in to the Microsoft Visual Studio.NET development environment, and a software development kit (SDK) supporting the rapid development of further extensions which will run within SharpTools.
- Google Plugin - Search Google from Visual Studio .NET
- Resource Refactoring Tool - provides developers an easy way to extract hard coded strings from the code to resource files.
- BIDS Helper - A set of VS.Net add-ins that extend and enhance the functionality of the SQL Server BI Development Studio.
- Power Toys for Visual Studio - are small tools that provide aid to developer pain-points or assist in diagnosing development-related issues. In addition to providing support, the power toys are released as Microsoft Shared Source to provide sample code to real-world solutions and allow for collaborative-development.
- Koders IDE - enable software developers to perform Koders searches directly from within the Eclipse or Visual Studio development environments by extending the reach of the Koders.com open source code index to the desktop.
- Codekeep - Once you've downloaded and installed a CodeKeep add-in, you can manage your code snippets and search for other code snippets without ever having to leave Visual Studio.
- CodeShare - Add-in is a Visual Studio.NET plugin for sharing code snippets in an enterprise. It provides menu options within the IDE to contribute and find code snippets from a central repository.
- RSS Blog Reader - open source add-in and a full-featured RSS / Blog aggregator which integrates into the familiar dockable panes of the Visual Studio.NET IDE.
- csUnit is a free and open source unit testing tool for the .NET Framework. csUnit works with all .NET languages including C#, Visual Basic .NET, J#, and managed C++. It comes with a choice of command line, graphical user interface, and an addin for Visual Studio.
- Oracle Developer Tools for Visual Studio .NET - The Oracle Developer Tools for Visual Studio .NET (ODT) is a tightly integrated Add-in for Microsoft Visual Studio. Features are generate SQL scripts for Oracle schema, generate ASP.NET web applications with very little coding required, drag and drop and automatically generate .NET code, seamlessly step from your .NET code into your PL/SQL stored procedure code and back out again, etc...
- WSCF - A Free Visual Studio Add-In and Command Line Tool for ImprovedSchema-Based Contract-First Web Services Design and Programming
- ZipStudio - provides a means of zipping up complete or partial Visual Studio solutions and projects and associated files, directly from in Visual Studio itself.
- MySQL Developer Tools is a powerful add-in designed to simplify the MySQL database application development process. It integrates into Visual Studio and Delphi, making all database development and administration tasks available from your favorite IDE. It provides an easier way to explore and maintain existing databases, design compound SQL statements, query and manipulate data in different ways.
- Comment Reflower - is an Add-in for Visual Studio 2003 and 2005 to reflow the text in comments in source files to have even word wrapping. It does more than simply just wrapping all text in comment blocks.
- VSCmdShell - provides users with a shell window inside the Visual Studio IDE that can be used for Visual Studio commands as well. Current version allows user to use either Windows Command Shell (cmd.exe) or Windows PowerShell.
- IBM Database Add-ins - development Add-In and managed provider for the Microsoft .NET platform includes RAD features, DB2 database project, scripting wizards, and CLR stored procedures to simplify building DB2 applications using Visual Studio .NET.
- VSdocman is a tool for commenting and the quick automatic generation of class documentation from your C# and VB .NET source code files. It is ideal tool for you if you create .NET component, control, application, smart device or web site (ASP .NET) projects
- CopySourceAsHtml - An add-in for Microsoft Visual Studio 2005 that allows you to copy source code, syntax highlighting, and line numbers as HTML. CSAH uses Visual Studio's syntax highlighting and font and color settings automatically.
- Codexchange - is an Visual Studio.NET add-in providing you with instant integrated access to an online repository of ready to use .NET code snippets
- ADO.NET Express - is an add-in for Visual Studio 2003 that automates common tasks of writing repetitive data access code. ADO.NET Express generates class methods for calling stored procedures and executing common types of SQL statements.
- VSTypeFinderAddin - for Visual Studio 2005 provides the possibility to search for all classes, structs, enums and delegates in a solution.
- AopDotNetAddIn - is a Visual Studio AddIn that provides the aspect oriented capabilities to the .Net languages (C#,VB.Net,J#), this AddIn was developed as a graduation project
- Reflector is the class browser, explorer, analyzer and documentation viewer for .NET. Reflector allows to easily view, navigate, search, decompile and analyze .NET assemblies in C#, Visual Basic and IL.
- DPack– Free collection of VS .NET 2003 and 2005 tools. Brings tools designed for greatly increase developer’s productivity, automate repetitive processes and expand upon some of VS features.
- Regionerate (pronounced ri-jeh-neh-rate) is a new open-source tool for developers and team leaders that allows you to automatically apply layout rules on C# code.
- Consolas is intended for use in programming environments and other circumstances where a monospaced font is specified. All characters have the same width, like old typewriters, making it a good choice for personal and business correspondence. Optimizing the font specifically for ClearType allowed a design with proportions closer to normal text than traditional monospaced fonts like Courier. This allows for more comfortable reading of extended text on-screen.
- Project MRU Cleaner Add-In
- Explore In Windows Add-In for Visual Studio 2005
- Creating Visual Studio .NET Add-Ins
- Bring Windows Desktop Search Into Visual Studio With Our Cool Add-In
- Creating a tool window add-in with Visual Studio 2005
- Addin Manager for VS 2002-2005
- A Custom Action for Deploying Visual Studio 2005 Add-in
- Tutorial : Creating Visual Studio Add-Ins
- Line Counter - Writing a Visual Studio 2005 Add-In
- A Visual Studio Add-In That Converts C# Code To Visual Basic
- Powertoys WebLog
- More Freeware SharpTools Plug-ins
- Visual Studio Add-in: Use Vista Search directly from Visual Studiot
- List of Microsoft Visual Studio Add-ins
Checkout;
The ecommerce web hosting lessons provides access to add in hosting which enables you to inquire the pipeline root directory for add-ins executing a definite interface for cheap web hosting. You can extend your web design applications with external add-ins. Though, it would be a real pain if you’ve to create all the web development assemblies at your own. Rather it’s easier when performed with the help of 20+ Visual Studio Add-ins tutorials.
Sunday, July 22, 2007
J2EE vs ASP.NET vs PHP
In this article, I wanted to compare the web application development platforms which I have been using for recent years. My comparison has no aim to make one platform better than others, or vice versa. These are all my own thoughts and what I have experienced during the development of web applications using the three platforms. It is open to you to express your opinions and stands as a comment.

Scores mean
10 – Best.
9 – Very Good.
8 – Good.
Syntax
I love Java syntax, a real object oriented syntax. PHP have some odd characters like “->, ::” and function calls are made directly like “substr, strreplace” which makes me feel like using procedural language. For ASP.NET, I have been using VB.NET.
J2EE: 10, ASP.NET: 9, PHP: 8
Easy to Learn
Believe or not, I learned PHP in two weeks. One day I decided to learn PHP and visited PHP official website. The website had one question explaining what is PHP and how and where to start. Manuals, documentation and samples were all there and ready to download. To prepare development environment was straight easy. ASP.NET was also easy to learn but bit difficult than PHP. J2EE was the most difficult and long process for me.
J2EE: 8, ASP.NET: 9, PHP: 10
Development Speed
For simple, small-size and CRUD applications, ASP.NET is the fastest one because of the pre-implemented controls, components and APIs. In PHP, if you use the right framework, it is also fast process.
J2EE: 8, ASP.NET: 10, PHP: 9
Platform
Although PHP works best on LAMP (Linux, Apache, MySQL and PHP) environment, you can deploy PHP web applications on other platforms such as Windows, Solaris etc…
ASP.NET have only one choice; Windows. There is a Mono tool for development and deployment of ASP.NET on Linux, but not ready for enterprise use. J2EE runs best everywhere.
J2EE: 10, ASP.NET: 8, PHP: 9
Database
Simplest theory is MySQL for PHP, Oracle for J2EE and MSSQL for ASP.NET. There are many other good databases out there. You can use most of them with all three languages by adding or installing appropriate drivers.
J2EE: 10 , ASP.NET: 10, PHP: 10
IDE – Integrated Development Environments
ASP.NET has only one choice, Visual Studio which is very cool IDE but costs puff ;) PHP have commercial and open source IDE-s. Most known PHP IDEs are Zend Studio and PHP Coder as far as I know. J2EE has nice open source choices as well as commercial. Eclipse is the most used and best IDE I have ever used. With its plug-in structure, you can use Eclipse almost for all purposes, even for PHP development. Beside Eclipse, there are some more good IDE-s like IntelliJ, Netbeans, Sun Studio etc…
J2EE: 10 , ASP.NET: 10, PHP: 9
OOP – Object Oriented Support
J2EE and ASP.NET win here. PHP have OOP support in its latest versions.
J2EE: 10, ASP.NET: 10, PHP: 9
AOP – Aspect Oriented Support
J2EE have some AOP frameworks one of which I have used. I don’t know whether ASP.NET and PHP supports AOP or not.
J2EE: 10 , ASP.NET: 9, PHP: 9
Security
J2EE is the most secure one I guess. Once, I had my PHP web application hacked by someone. So PHP is secure only when you code secure ;) For ASP.NET, people have some doubts because of previous versions of windows security holes and hells. I didn’t experience any security problem of ASP.NET till now.
J2EE: 10, ASP.NET: 9, PHP: 9
Performance
I liked PHP Performance. For web applications I have ever developed, the most satisfied application was written in PHP. J2EE was little bit heavier to start, and consumes huge system resources. I have not tested my ASP.NET applications against huge loads in real life. Till now, I didn’t have any complaint about performance of my ASP.NET applications.
J2EE: 9 , ASP.NET: 9, PHP: 10
Web Server
ASP.NET has only one choice; IIS. For PHP and J2EE, you have plenty of choices; commercial and open source. Apache is the most popular one for PHP. Sun AS, JBoss AS, Oracle AS, Weblogic, Tomcat, and some more are for J2EE. Most of the J2EE servers cost high.
J2EE: 10, ASP.NET: 9, PHP: 10
Libraries and Frameworks
All of three languages have third party libraries and frameworks. In PHP and J2EE, most of the frameworks and libraries are open source or free. In ASP.NET, most of the libraries and components out there are commercial.
J2EE: 10, ASP.NET: 9, PHP: 10
Support and Community
There are plenty of forums, mailing lists, user groups, communities, developers, blogs and websites for all of three platforms. Most of the ASP.NET support, documentation and forums are managed by Microsoft, while PHP support is given by developers itself. J2EE have both commercial and open source support groups.
J2EE: 10, ASP.NET: 10, PHP: 10
Cost
PHP have big advantage on cost, both TCO and Maintenance. You can have IDE, Web Server, Operating System and Database all for FREE ;)
For ASP.NET development, first you have to pay for Visual Studio, then for Windows Server and for MSSQL. I don’t how much it costs total because my company already paid for them. For J2EE, you have choices. As I mentioned before, there are commercial and open source tools and software available. It depends on you and your company whether to use commercial, supported alliances or not. For example, if