2007-05-07

Top 5 javascript frameworks�

» Top 5 javascript frameworks� - Jaslabs: High performance php

By Justin Silverton

5) Yahoo! User Interface Library

The Yahoo! User Interface (YUI) Library is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The YUI Library also includes several core CSS resources. All components in the YUI Library have been released as open source under a BSD license and are free for all uses.

Features

Two different types of components are available: Utilities and controls. The YUI utilities simplify in-browser devolvement that relies on cross-browser DOM scripting, as do all web applications with DHTML and AJAX characteristics. The YUI Library Controls provide highly interactive visual design elements for your web pages. These elements are created and managed entirely on the client side and never require a page refresh.

utilities available:

  • Animation: Create "cinematic effects" on your pages by animating the position, size, opacity or other characteristics of page elements. These effects can be used to reinforce the user's understanding of changes happening on the page.
  • Browser History Manager: Developers of rich internet applications want bookmarks to target not just pages but page states and they want the browser's back button to operate meaningfully within their application's screens. Browser History Manager provides bookmarking and back button control in rich internet applications.
  • Connection Manager: This utility library helps manage XMLHttpRequest (commonly referred to as AJAX) transactions in a cross-browser fashion, including integrated support for form posts, error handling and callbacks. Connection Manager also supports file uploading.
  • DataSource Utility: DataSource provides an interface for retrieving data from arrays, XHR services, and custom functions with integrated caching and Connection Manager support.
  • Dom Collection:The DOM Utility is an umbrella object comprising a variety of convenience methods for common DOM-scripting tasks, including element positioning and CSS style management.
  • Drag & Drop: Create draggable objects that can be picked up and dropped elsewhere on the page. You write code for the "interesting moments" that are triggered at each stage of the interaction (such as when a dragged object crosses over a target); the utility handles all the housekeeping and keeps things working smoothly in all supported browsers.

Controls available:

  • AutoComplete: The AutoComplete Control allows you to streamline user interactions involving text-entry; the control provides suggestion lists and type-ahead functionality based on a variety of data-source formats and supports server-side data-sources via XMLHttpRequest.
  • Button Control: The Button Control provides checkbox, radio button, submit and menu-button UI elements that are more impactful visually and more powerful programmatically than the browser's built-in form widgets.
  • Calendar: The Calendar Control is a graphical, dynamic control used for date selection.
  • Container: The Container family of controls supports a variety of DHTML windowing patterns including Tooltip, Panel, Dialog and SimpleDialog. The Module and Overlay controls provide a platform for implementing additional, customized DHTML windowing patterns.
  • DataTable Control: DataTable leverages the semantic markup of the HTML table and enhances it with sorting, column-resizing, inline editing of data fields, and more.
  • Logger: The YUI Logger provides a quick and easy way to write log messages to an on-screen console, the FireBug extension for Firefox, or the Safari JavaScript console. Debug builds of YUI Library components are integrated with Logger to output messages for debugging implementations.
  • Menu: Application-style fly-out menus require just a few lines of code with the Menu Control. Menus can be generated entirely in JavaScript or can be layered on top of semantic unordered lists.

Download and more information: here

4) Prototype

Prototype is a JavaScript Framework that aims to ease development of dynamic web applications.

Featuring a unique, easy-to-use toolkit for class-driven development and the nicest Ajax library around, Prototype is quickly becoming the codebase of choice for web application developers everywhere.

Features

  • Easily deploy ajax applications: Besides simple requests, this module also deals in a smart way with JavaScript code returned from a server and provides helper classes for polling.
  • DOM extending: adds many convenience methods to elements returned by the $() function: for instance, you can write $('comments').addClassName('active').show() to get the element with the ID 'comments', add a class name to it and show it (if it was previously hidden).
  • Utilizes JSON (JavaScript Object Notation): JSON is a light-weight and fast alternative to XML in Ajax requests

Download and more information here

3) Rico

Designed for building rich Internet applications.

Features

  • Animation Effects: provides responsive animation for smooth effects and transitions that that can communicate change in richer ways than traditional web applications have explored before. Unlike most effects, Rico 2.0 animation can be interrupted, paused, resumed, or have other effects applied to it to enable responsive interaction that the user does not have to wait on
  • Styling: Rico provides several cinematic effects as well as some simple visual style effects in a very simple interface.
  • Drag And Drop: Desktop applications have long used drag and drop in their interfaces to simplify user interaction. Rico provides one of the simplest interfaces for enabling your web application to support drag and drop. Just register any HTML element or JavaScript object as a draggable and any other HTML element or JavaScript object as a drop zone and Rico handles the rest.
  • AJAX Support: Rico provides a very simple interface for registering Ajax request handlers as well as HTML elements or JavaScript objects as Ajax response objects. Multiple elements and/or objects may be updated as the result of one Ajax request.

Download and more information here

2) Qooxdoo

qooxdoo is one of the most comprehensive and innovative Open Source multipurpose AJAX frameworks, dual-licensed under LGPL/EPL. It includes support for professional JavaScript development, a state-of-the-art GUI toolkit and high-level client-server communication.

Features

  • Client detection: qooxdoo knows what browser is being used and makes this information available to you.
  • Browser abstraction: qooxdoo includes a browser abstraction layer which tries to abstract all browser specifics to one common "standard". This simplifies the real coding of countless objects by allowing you to focus on what you want and not "how to want it". The browser abstraction layer comes with some basic functions often needed when creating real GUIs. For example, runtime styles or positions (in multiple relations: page, client and screen) of each element in your document.
  • Advanced property implementation: qooxdoo supports "real" properties for objects. This means any class can define properties which the created instances should have. The addProperty handler also adds getter and setter functions. The only thing one needs to add - should you need it - is a modifier function.
  • Event Management: qooxdoo comes with its own event interface. This includes event registration and deregistration functions.

    Furthermore there is the possibility to call the target function in any object context. (The default is the object which defines the event listener.) The event system normalizes differences between the browsers, includes support for mousewheel, doubleclick and other fancy stuff. qooxdoo also comes with an advanced capture feature which allows you to capture all events when a user drags something around for example.

Download and more information here

1) Dojo

Dojo allows you to easily build dynamic capabilities into web pages and any other environment that supports JavaScript sanely. You can use the components that Dojo provides to make your web sites more usable, responsive, and functional. With Dojo you can build degradable user interfaces more easily, prototype interactive widgets quickly, and animate transitions. You can use the lower-level APIs and compatibility layers from Dojo to write portable JavaScript and simplify complex scripts. Dojo's event system, I/O APIs, and generic language enhancement form the basis of a powerful programming environment. You can use the Dojo build tools to write command-line unit-tests for your JavaScript code. The Dojo build process helps you optimize your JavaScript for deployment by grouping sets of files together and reuse those groups through "profiles".

Features

  • Multiple Points Of Entry: A fundamental concept in the design of Dojo is "multiple points of entry". This term means that Dojo should work very hard to make sure that users should be able to start using Dojo at the level they are most comfortable with.
  • Interpreter Independence: Dojo tries very hard to ensure that it's possible to support at least the very core of the system on as many JavaScript enabled platforms as possible. This will allow Dojo to serve as a "standard library" for JavaScript programmers as they move between client-side, server-side, and desktop programming environments.
  • Unifies several codebases: builds on several contributed code bases (nWidgets, Burstlib, and f(m)).

Download and more information here

14 Comments so far

  1. Dougal Matthews April 24th, 2007 10:58 am

    Have you not tried ExJS? http://extjs.com/

    Oh and I'd personally put Yahoo UI higher, 1st or 2nd.

    Also, unless you are ignoring non open source stuff… what about Microsoft's AJAX (Atlas)?

  2. Nate Cavanaugh April 24th, 2007 11:20 am

    No jQuery? Cmon, it's one of the best JS libraries around. :)

  3. Mike April 24th, 2007 12:23 pm

    Great list.

    submitted in queue @ tweako

    ( http://www.tweako.com )

  4. Tony T. April 24th, 2007 12:52 pm

    I'm just curious if you considered mootools as one of these frameworks, or if it just fell below the top 5? I really like mootools mainly because of it's really light weight (and the ability to build a js package of only the components you want straight from their website). I've been using YUI the past few months on a project made specifically for broadband clients. I wouldn't recommend it for any normal production website because of it's size.

  5. Tony T. April 24th, 2007 12:53 pm

    I guess everyone has their favorites :-)

  6. jaredmellentine April 24th, 2007 1:02 pm

    I have to agree with Nate. jQuery is pretty amazing and extremely well documented.

  7. nate koechley April 24th, 2007 3:19 pm

    It would be interesting to hear a bit about your ranking criteria and notes on the pros and cons of each library.

    thanks,
    nate

  8. Shane April 25th, 2007 1:45 am

    Why isn't jQuery in the list? Rico is like so yesterday!

  9. cliff April 25th, 2007 3:39 am

    I've got some professional experience with dojo, and if it's the best thing going then I'm afraid the other libraries must be worse to be rated below it… and that's pretty bad from my personal experience.

  10. Tom Sieron April 25th, 2007 4:47 am

    I was suprised not see jQuery here as well. It has comparable features to the libraries you've mentioned, plus it's lightweight and comes with abundance of plugins (and works with Ext now). Right now I'm preparing a presentation on JS libraries (for php developers at a local barcamp-thing) and your post is one of my resources for the comparison, it would be great if you could shed some light on your criteria, coz I've been pondering upon that all morning and I'm having trouble identifying the important issues for a webdev (im a designer by trade). Cheers.

  11. Justin Silverton April 25th, 2007 6:55 pm

    "I've got some professional experience with dojo, and if it's the best thing going then I'm afraid the other libraries must be worse to be rated below it… and that's pretty bad from my personal experience."

    What issues did you hava with dojo? Im curious because I've used it a couple of times and found it to be a fairly complete framework.

  12. Dennis Kayser May 6th, 2007 2:44 am

    What! jQuery is not in the top 5! There's got to be a mistake. Seriously I'd like to hear why jQuery is not in here? It'd be interesting to know.

  13. Justin Silverton May 6th, 2007 10:29 am

    "What! jQuery is not in the top 5! There's got to be a mistake. Seriously I'd like to hear why jQuery is not in here? It'd be interesting to know."

    it's mostly because I don't have much experience with it (it also seems like the main page for it is down: http://jquery.com/). Can you post some reasons why you think it is better than the frameworks listed?

  14. shoebappa May 6th, 2007 9:36 pm

    jQuery is good because of its modular plug-in architecture making it small while providing flexibility by adding plug-ins. The main benefit of jQuery is that it sits along side of your site so you can easily make a site that can function without JavaScript but if the user has JS enabled the jQuery code would go into action and add the additional functionality. That and its CSS selector and XPath style queries for interacting with the DOM is invaluable. Should definitely be at the top of the list IMO…

    Looks like they're moving servers but you have to give jQuery a look, I didn't see how incredible it was until I started to hose around with it.

Read more ...

2007-04-30

Vincent Partington: Top 10 Java EE performance problems

Vincent Partington: Top 10 Java EE performance problems

For the last two and a half months, Vincent Partington has been blogging about the top ten Enterprise Java Application Performance Problems. The list:Now he wraps up the countdown with some conclusions about Enterprise Java performance in general:
  • First of all, Java developers should consider performance an importance quality requirement of their application to which they should pay attention from the start to the end of the project.
  • Secondly, Java developers need to work with the people that can help them improve the performance of their application like application server and database administrators.
Read more ...

在局域网内部实现MSN通讯服务 资讯中心-计世网

在局域网内部实现MSN通讯服务 资讯中心-计世网

MSNMessengerService集即时消息、网络电话、自动检查邮件等功能于一体,很受广大"网虫"的喜爱,但是您知道吗,MSNMessengerService不但可以登录到MSN的Messenge

rServer,还可以登录到局域网内的ExchangeServer呢!无需连接到Internet,您一样可以享受MSNMessengerService的强大功能!

下面笔者就如何建立局域网内部的通讯服务做详细介绍:

前提条件

网络中有一台计算机安装了MicrosoftExchangeServer2000(MicrosoftExchangeServer2000的安装方法不是本文重点,所以不做介绍了。详情请参阅: http://support.microsoft.com)

准备工作

1、一张MicrosoftExchangeServer2000安装光盘。

2、下载MSNMessengerService的最新版本( http://messenger.msn.com/lccn)。

安装与设置过程

一、添加ChatServices和InstantMessagingServices

1、将MicrosoftExchangeServer2000安装光盘放入服务器光驱,单击"ExchangeServerSetup"。

2、当出现"MicrosoftExchangeInstallation向导"时,单击"下一步"。在"Action"栏选择"Change",将ChatServices和InstantMessagingServices都选择成"Install",单击"下一步"安装向导会自动完成安装任务。

二、配置InstantMessaging

1、单击"开始",指向"程序→MicrosoftExchange",单击"SystemManager",双击"Servers",双击您的计算机名,双击" Protocols",右击"InstantMessaging(RVP)",选择"新建",单击"InstantMessagingVirtualServer",在DisplayName栏中输入配置文件名。

2、单击"下一步",在ChooseIISWebSite中选择Web站点。单击"下一步",在DN SDomainName栏中输入DNS名(例如:home.net),此DNS名将作为用户登录邮件地址@符号后面的部分。单击"下一步",在"Allowthisservertohostaccounts"前面打勾,使配置文件马上生效,配置完成后建议重新启动服务器。

三、配置用户账户

1、在"管理工具"中单击"ActiveDirectory用户和计算机",单击"Users",任意选择一个用户(例如:administrator),双击账户,在"ExchangeFeatures"选项卡中,选中"InstantMessaging"。

2、单击"Enable→Browse",在"ServerName"中选择配置文件名,单击"确定"。回到上一级选项卡。单击"确定",即完成用户账户配置。

四、安装、配置MSNMessengerService

1、将MicrosoftExchangeServer2000安装光盘放入客户机光驱;在客户机,单击"开始→运行",键入"X:INSTMSGI386CL IENTCHSMMSSETUP.EXE"(X代表您的光驱的盘符),开始安装MSNMessengerService2.2forExchange。

2、MSNMessengerService2.2forExchange安装完毕后,再安装您从网上下载的MSNMessengerService3.x。

3、安装完毕后在MSNMessengerService3.x主窗口, 单击"工具";选择"选项",在"账户"选项卡中的"首先用此账户登录"选项中选择"Exchange账户"在Exchange账户"登录名"框中输入登录名 administrator@home.net

4、单击"确定",选择"单击这里登录",即可登录到MicrosoftExchangeServer2000InstantMessagingService。

注意:您必须首先安装MSNMessengerService2.2forExchange,然后再升级到MSNMessengerService3.x才能有登录到MicrosoftExchangeServer2000InstantMessagingService的选项,否则MSNMessengerService3.x中将没有登录到MicrosoftExchangeServer2000InstantMessagingService选项 。

5、重复3、4步即可创建、配置用户账户及客户端。

Read more ...

2007-04-26

Yod'm 3D - About - Visual Tooltip

Yod'm 3D - About - Visual Tooltip: "Yet anOther Desktop Manager 3D
( Windows 2000/XP/Vista )
( DirectX 9 required )




Yod'm 3D is a virtual desktop manager with the fashionable effect : the cube





By default, the rotation of the cube is done with the keys CTRL+SHIFT+Arrows :

* CTRL+SHIFT+Left/Right = Next/prev desktop

* CTRL+SHIFT+Up = Activate and show a 'far' view of the current desktop, Left and right to turn the cube

* CTRL+SHIFT+Down = Activate and show a 'near' view of the current desktop, Left and right to turn the cube

Hold down CTRL+SHIFT to use the mouse to turn the cube.
( The rotation is possible only horizontally )" Read more ...

2007-04-25

Enum Types (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

Enum Types (The Java™ Tutorials > Learning the Java Language > Classes and Objects): "Java programming language enum types are much more powerful than their counterparts in other languages. The enum declaration defines a class (called an enum type). The enum class body can include methods and other fields. The compiler automatically adds some special methods when it creates an enum. For example, they have a static values method that returns an array containing all of the values of the enum in the order they are declared. This method is commonly used in combination with the for-each construct to iterate over the values of an enum type. For example, this code from the Planet class example below iterates over all the planets in the solar system.

for (Planet p : Planet.values()) {
System.out.printf('Your weight on %s is %f%n',
p, p.surfaceWeight(mass));
}" Read more ...

Nested Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

Nested Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects): "A nested class is a member of its enclosing class and, as such, has access to other members of the enclosing class, even if they are declared private. As a member of OuterClass, a nested class can be declared private, public, protected, or package private. (Recall that outer classes can only be declared public or package private.)

Terminology: Nested classes are divided into two categories: static and non-static. Nested classes that are declared static are simply called static nested classes. Non-static nested classes are called inner classes." Read more ...

2007-04-24

60 best CSS directories you would die to watch! at Witty Sparks

60 best CSS directories you would die to watch! at Witty Sparks: "With new technologies flooding the web,different tools are available with which a web designer can showcase his creativity and craft. But despite putting in the effort and sweat, numerous websites with fantastic creativity fail to get noticed. Also, the surge in designing is driving designers to dig for creativity, color schemes and layouts.

Keeping these aspects in mind, we came up with a compendium of best CSS directories, CSS showcase, CSS galleries that rank / grade websites (using CSS) on the basis of ‘alexa ranking’, colors, categories, tags, ratings and RSS.

If you feel that a particular site is worth to get showcased, then drop the URL’s in your comments so that they become a part of our next list.

If you found this article useful, digg it to ensure that a designer’s effort doesn’t go unnoticed." Read more ...

2007-04-19

MSSQL数据库移植后的用户权限问题

把数据库备份还原到另一个服务器时,可能会遇到孤立用户的问题
举例:数据库test有用户U_tom,对应的登录帐户为L_tom,按以下步骤操作将会出现孤立用户U_tomf:

备份test->删除数据库test->删除登录L_tom->还原test

查看:
1、企业管理器->展开要查看的数据库->用户 ,会发现相应的用户没有对应的登录
2、在查询分析器中执行 EXECsp_change_users_login @Action='Report'

解决:
办法一、自动新增一个和用户名相同的登录帐户,并影射
EXEC sp_change_users_login 'Auto_Fix', 'U_tom'

办法二、新增一个登录帐户,然后将此登录帐户映射到孤立的用户
EXEC sp_addlogin 'L_tom'
--Change the user account to link with the 'L_tom' login.
EXEC sp_change_users_login 'Update_One', 'U_tom', 'L_tom'

或者:
1、找到该用户的ID 例如:
select sid from sysusers where name='U_tom'
结果为
0x67E19EC564D7344CB19AC35085C1A36B

2、新增一个登录帐户L_tom,将此登录帐户映射到孤立的用户
EXEC sp_addlogin @loginame = 'L_tom',
@sid = 0x67E19EC564D7344CB19AC35085C1A36B

参考:sp_change_users_login 、sp_addlogin 的语法参考 Read more ...

2007-04-17

VoIP Now: 74 Open Source VoIP Apps & Resources

VoIP Now: 74 Open Source VoIP Apps & Resources: "When a body of independent auditors and experts recommended that the State of California consider open-source software and voice over Internet Protocol telephony (VoIP) as two measures to cut costs in 2004, that was the signal that open source and VoIP should unite. After all, what's better than free software? Open source is better, because you have access to the code. What's better than open source? Open source that's focused on VoIP. That's what you get here — 74 open source apps tucked into categories that you can use 'as is' or change to fit your specific VoIP needs.

The following apps and resources are categorized by SIP, H.323, IAX, and RTP protocols and include clients, libraries, gatekeepers, and any other open source resource available for those specific protocols plus PBX and IVR platforms. You'll also find tools like faxware, voicemail apps, and middleware that applies to one or more of the previously mentioned protocols." Read more ...

2007-04-16

Zolved - How to reduce the memory usage on Firefox?

Zolved - How to reduce the memory usage on Firefox?: "Most of the time, Firefox doesn't use abnormal amount of system memory, it sometimes due to other sources, like number of plug-ins, themes and extensions. It is also highly recommended that you have the latest version of Firefox as the memory usage is minimized. If you want to download the latest copy of Firefox, click here.

Follow these steps to check what is causing the abnormal memory usage:

* Check your Extensions and Themes.
* Check the Plug-ins.
* Clear Download History.
* Restart Firefox Periodically.
* Assign Memory Cache on Firefox." Read more ...

2007-04-14

预防措施

预防措施: "★ 禁酒及含酒精类饮料
  酒精在体内主要通过肝脏分解、解毒,所以,酒精可直接损伤肝功能,引起肝胆功能失调,使胆汁的分泌、排出过程紊乱,从而刺激胆囊形成新的息肉及/或使原来的息肉增长、变大,增加胆囊息肉的癌变系数。
  ★ 饮食要规律、早餐要吃好
  规律饮食、吃好早餐对胆囊息肉患者极其重要。人体内肝脏主管分泌胆汁,分泌的胆汁存储入胆囊内,而胆汁的功能主要是消化油性食物。如果不吃早餐,则晚上分泌的胆汁利用不上,存留于胆囊内" Read more ...

2007-04-13

11amDesign Tutorials and Articles - 101 Hidden Tips & Secrets For Photoshop

1. Press Tab will hide tool bar and palette, Shift+Tab will hide only palette.

2. Hold Shift + click the top blue bar for toolbar and palette will move them to the nearest edge.

3. Double click the top blue bar, on any palette window, to minimize it.

4. Double click the gray background will bring up open file option, Hold Shift+double click will open up the browser.

5. Sick of the default gray background around your image? Select paint bucket, hold shift and click on the gray background, it will change to whatever color you have in your foreground color box.

6. In Photoshop, all "Cancel" buttons in a window can be changed to a "Reset" button by holding Alt.

7. Caps lock will switch your cursor for accuracy.

8. Press F button, it will switch between 3 different screen modes and give you more working area.

9. To draw a straight line, click then move to the end point and hold shift + click.

10. Hold Ctrl will temporary make any tool into move tool until you release Ctrl.

11. Ctrl + Alt and click drag the image, it will make a duplication of the current image over lay on top.

12. Hold Space bar, it will make any tool into "Hand Tool" until you release Space bar.

13. While in Zoom Tool, Ctrl+space = zoom in, alt+space = zoom out.

14. Hold Ctrl and press "+" or "-" it will change the % for image in navigator window.

15. When Using eyedropper tool to capture foreground color, hold Alt and click, it will instantly capture the color for background.

16. With Measure Tool, draw a line then hold Alt and draw another line from the end of the first line, it will measure the angle.

17. Ctrl+Alt+Z and Ctrl+Shift+Z will go back and forth in the history.

18. Alt+Backspace and Ctrl+Backspace will fill in the whole screen with foreground color or background color, Shift+backspace will bring up option window, Alt+Shift+Backspace and Ctrl+Shift+Backspace, will fill the image with foreground or background color but will leave the alpha transparent area alone.

19. When free transforming with Ctrl+T, hold Alt to keep the original image and then to transform a duplicated layer of it. Ctrl+Shift+T to repeat whatever you did in the last transform.

20. To make sure your Crop is on the edge of the image, hold Ctrl while cropping.

21. Ctrl+J will duplicate the current layer.

22. Ctrl+Shift+E will merge all visible layers to one layer, Ctrl+Shift+Alt+E will make a copy of the original and merge all visible layers.

23. While using Marquee Tools, hold Alt it will make the starting point as a center of the selection.

24. Ctrl + D to deselect, Ctrl+Shift+D to reselect what you deselected.

25. While selecting with Marquee tool, pressing the space bar can allow you to move the selection.

26. Hold Shift and press "+" or "-" it will switch between the layer mode:

N = Normal
I = Dissolve
M = Multiply
S = Screen
O = Overlay
F = Soft Light
H = Hard Light
D = Color Dodge
B = Color Burn
K = Darken
G = Lighten
E = Difference
X = Exclusion
U = Hue
T = Saturation
C = Color
Y = Luminosity
Q = Behind 1
L = Threshold 2
R = Clear 3
W = Shadow 4
V = Midtones 4
Z = Highlights 4


***The shortcut works even for following situation:

***Alpha turned off, Indexed Mode, Line tool, Bucket Tools, Dodge and Burn Tools

27. While using Brush or any other tools, change the opacity by typing the number.

*** type one number for % of it's ten times [4=40%]

***type two number for exact % [press 7 then 2 will get 72%]

28. Hold Alt while clicking on the eye icon beside the layer, it will hide all other layers.

29. Hold Alt while clicking the pen icon beside the layer, it will unchain this layer from all layers.

30. Select a layer, hold Alt and click the top edge of another layer, it will group them.

31. Hold Alt and click the button "Create a new layer", it will create a new adjustment layer.

32. Select a layer and hold Alt, then click on the garbage can button. It will instantly delete the layer, marquee where you want alpha and Ctrl+click the "Create new channel" button, it will create an alpha only on the area you marquee.

33. File> Automate > Contact Sheet: this can create a small thumbnail for every file, this can save you some time from searching.

34. When Move Tool is selected, toolbox on top can be useful from time to time, these are "Auto select layer" and "Show bounding box".

35. While Move Tool is selected, hold Shift (Alt+Shift+Right click) and allow whether or not to make a current layer chain with your upper layer.

36. With grid on, click the top left corner of the grid and drag to anywhere on the image to set the pivot, double clicking on the icon again reset the pivot.

37. After, draw a path on the image with pen tool, Ctrl+shift+H can hide/show it.

38. Control Navigator with keyboard sometimes can be more time efficient than mouse.

***

Home = move to top left corner
End = move to right bottom corner
PageUp = move up one page
PageDown = move down one page
Ctrl+PageUp = move left one page
Ctrl+PageDown = move right one page
Shift+PageUp = move up 10 pixel
Shift+PageDown = move down 10 pixel
Ctrl+Shift+PageUp = move left 10 pixel
Ctrl+Shift+PageDown = move right 10 pixel


39. Ctrl+Tab allows you to switch between different image files you are working on.


40. F12 = Revert to how the file was the last time you saved it.


41. Shortcuts for Channel: RGB, CMYK, indexed color...

***

Ctrl+"~" = RGB
Ctrl+1 = red
Ctrl+2 = green
Ctrl+3 = blue
Ctrl+4 = other path
Ctrl+9 = other path
Ctrl+"~" = CMYK
Ctrl+1 = light green
Ctrl+2 = pink red
Ctrl+3 = yellow
Ctrl+4 = black
Ctrl+5 = other path
Ctrl+9 = other path
Ctrl+1 = Indexed
Ctrl+2 = other path
Ctrl+9 = other path

42. hold Ctrl then you can draw a red box in the Navigator thumbnail for viewing.

43. Hold Alt and click on any of the history steps, that step will be copied and become the most recent one.

44. Alt drag a step from a serial action can copy it to another action.

45. Alt-click the flare preview thumb, and you can fill in numerical co-ordinates for lens flare.

46. Holding Shift + Alt while transforming an object will do it proportionally, from the center.

47. If you have the move tool selected and you want something duplicated just hold the alt key and move the image, holding the Shift + Alt while doing this, it will move it along one axis.

48. If you want to straighten an image that is crooked (maybe from scanning), click on the eyedropper tool or hit the I key 3 times to get the ruler. Click on the left side of the straight edge, then the right side of the straight (but crooked) edge. The choose Image> Rotate Canvas> Arbitrary, Photoshop will give you the degrees of rotation you just click ok.

49. If you create something in Illustrator, copy and paste it in Photoshop, it will ask you if you want this to be a pixel, path, or shape layer.

50. If you have a mask on a layer and you want to place a image in there and keep the mask. Simply open the image, say copy, and then Ctrl click on the layer to select the mask and use Shift + Ctrl + V to paste it into the mask which will also put it on a new layer as well.

51. To center an image, Ctrl + A , Ctrl + X, Ctrl + V, I think it also puts that image on a new layer.

52. Ctrl+E will merge the highlighted layer down to the next

53. When you have a brush selected, using [ or ] will scroll up or down that brush list.

54. Double clicking the zoom tool will make the image 100%, double clicking the hand tool will fit the image to your screen resolution.
55. Typing Content:

Ctrl + H will hide the highlight on your selected type.

If you click once while your type is selected on the font list, you can use your arrows to scroll up and down and see the fonts change on the fly!

Alt + Left or Right arrows will change your tracking in increments of 10
Ctrl + Alt + Left or Right arrows will change your tracking in increments of 100
Ctrl + Alt + Up or Down arrows will change your leading in increments of 10 pts
Shift + Ctrl with <> will change your font size in increments of 2 pts

56. Ctrl + Alt + T to make a copy of the layer in which you want to transform.

57. Ctrl + Alt + Right arrow. duplicates the layer you are on.

58. Change the active layer : Alt + [ or ].

59. Move the active layer up and down : Ctrl + [ or ].

60. Link 2 layers: with move tool click in the first layer hold Shift and click in the second one.

61. Ctrl+[plus key] will let you zoom in on an image anytime while Ctrl+[minus key] zooms out. Ctrl+Alt+[plus key] will zoom in AND RESIZE the window to fit the image size... same for Ctrl+Alt+[minus key] as well.

62. When using the Polygonal Lasso Tool, click backspace to undo a lasso step.

63. Pressing X will switch the selected foreground and background colors.

64. Pressing D will reset the foreground and backgrounds colors to black and white.

65. If your image has multiple layers, create a Marquee selection and press Ctrl+Shift+Cit won't work if you selected a hidden layer) will copy the image into memory as if they were flattened! Paste it on a new document to see the result.

66. Ctrl+Alt+Z will do multiple undo, versus just one.

67. Ctrl+click a layer thumbnail to select the layer transparency

68. To see what your layer mask looks like (and edit it), Alt+click its thumbnail in the layers palette

69. Press and hold Ctrl+Alt and click the Help bar with your mouse, drag it down and highlight "About Photoshop" and let go of the left mouse button for a different About Photoshop splash/screen.

70. When using Polygon lasso tool hold Shift to make a perfect line, it goes every 30 degrees

71.Photoshop CS2: Group many layers by clicking the layers you want to group by clicking it while holding the Shift key down, and then press Ctrl+G to group them into a folder for means of better organization.

72. Ctrl+Shift+N creates a new layer with a dialog box; Ctrl+Shift+Alt+N gets you a new layer without the hassle.

73. Back to brush, [ and ] will increase/decrease your brush size, Shift + [ or ] will soften or harden your brush edge.

74. Still in [ and ], Ctrl + [ or ] will move your currently selected layer up and down the hierarchy and Shift + [ or ] will select upper layer or lower layer.

75. Stamp Tool (s) is used to copy an area of image (defined by alt+clicking and area) and paint it somewhere else (cloning). It also works when you have multiple images open at the same time. Alt click an area of any opened file image and paint it anywhere else.

76. After you created a text you can click on font type tab and tap "down" key over and over to scroll through the font list and see the changes in (relatively) real time. A feature that I am tired of waiting to happen in illustrator.

77. Still in text mode, a trick from Microsoft word to apply hi-light to your text hit Ctrl+Shift+ <> to resize your text, to your preferred font size. Pressing Ctrl key while you are typing also gives you a free transform box temporarily and will go if you release it. Resizing text also works by pressing Ctrl+T (on selected layer, not when you are typing). It still retains as an editable text layer after.

78. And remember, pressing enter when you type will take you to a new line just like typing a letter but pressing Ctrl+Enter or Enter on numeric key will finish what you type.

79. You can drag a layer on to any other opened images in Photoshop and it will copy it as a layer (better than copy and paste image). Holding down Shift while moving it will snap the image right on the center of the other opened image

80. If you are working with sets....

Click on the set, in the blending mode it shows pass through by default... if you have an adjustment layer within a set and you want that adjustment layer to effect those layers underneath it within the set only, set the blending mode of the set to "normal" instead.

CODE


Mentioned before with more explanation:

- Pressed F to switch to 3 different viewing mode... when I first try it I said "wtf? what it's for?" Well, if you are sick of painting your image on the corners just to find yourself resizing your current image window, with F you can pan way outside your image. Happy corner painting!!


- Create a new file, 500x500 px, create a new layer, get a standard brush and paint a dot on the top center of your image (like the number 12 position on a clock). Press Ctrl+Alt+T, it will duplicate your original layer and free transform the new one. Move the pivot point (the circle with little dot in it found when you are free transforming something) to the center of your image, rotate your image 30 degrees to the right and hit OK to confirm the transform

now.........


Be excited..........


Hit Ctrl+Shift+Alt+T 10 times and see what happens!

81. When using the "move tool" you can select any layer by holding down the CTL key(CMD on a Mac) and clicking on the part of the layer on the canvas with your mouse. This way you won't have to go to the Layers palette every time and you don't have to keep checking on or off the auto select options for the move tool.

82. You can link up layers without going into the layers palette, by selecting the layer (how I just mentioned above) and holding down CTL + Shift(CMD + SHIT on a Mac) for each additional layer you want to link up. You can unlink them by clicking on the layer again.

83. You can delete more than one layer at a time.......by linking up all the layer you want to delete, and holding down CTL(CMD on a Mac) while you click on the garbage icon to delete the layer.

84. When using the type tool you can ok it by pressing CTL + Enter(CMD + Enter on a Mac) instead of clicking on the check mark on the options.

85. If you have more than one type layer, and want to make any of the following changes color/font/size/alignment/initializing to all of the type layers at the same time.....All you have to do is link up the type layer, hold down the Shift key and in the options for the type tool make your change i.e. color, size, etc.

86. You can use your number pad to change opacity for a layer.... I.e. type 5 and the opacity will be 50; type 55 and the opacity will be 55. You can use the number pad for any tool that uses opacity...like the airbrush tool, stamp tool, brush, gradient, etc.

87. Pressing Tab key will hide the Tools palette and any other palette that you have on the stage. Pressing "F" will change between Full Screen modes. Using these two tips you can view your work Full Screen without any palettes.(You can press CTL+Alt+0 to fit your work to the screen, or you can press CTL+0 to zoom to 100%)

88. Pressing the "+" and "-" keys while holding down CTL+Alt will resize the whole document window, not just the work area.

89. You can delete a layer by holding down the "Alt" key and pressing "L" twice......actually now with Photoshop 7 you got to press "L" three times. It's not actually a keyboard shortcut, but it's a quick way to do it....don't know if it works on a MAC.

90. Pan documents with the space bar.

91. Ctrl+click a layer (in layers palette) to select it's transparency.

92. Ctrl+Alt+click between 2 layers in the palette to group them.

93. Alt + click in “add layer mask” button to add a black layer mask (instead of a white one).

94. When you select something, pressing Ctrl+J will copy the selected area and add another layer with the copied area - opposing copying the layer, making a new layer, and pasting it.

95. To glue the palettes together (all palettes combined into one strip), you just drag & drop a palette onto the end of another palette (watch the rectangle that indicates where the palette will get attached to).

96. Hold down Alt while Burning to Dodge instead, and vice versa.

97. Ctrl-click a layer to select an objects; alternatively, you may select more than one object/s in more than 1 layer by holding Shift while using the method just mentioned (Ctrl-click). To deselect, just press Ctrl+D.

98. If you have a mini scroll on your mouse, you may use that to zoom in (scroll up) or zoom out (scroll down).

99. Need to locate a layer quick? Use the Move Tool (V) and right click on the area the object lays. There should now be a “cursor-menu” with all the layers that is in that particular area. Now take a good guess and see which one of them fits the shoe; select a layer and Ctrl-Click the layer in the Layer Palette - see if the selection traces the object you desired to edit/find. Useful for those messy people (i.e. me!).

100. Need to get rid of a background quick? Assuming you at least know how to crop around an object, do so. Now press Ctrl+I or Shift+Ctrl+I for Inverse Selection. Press Ctrl+X to %@#!* that part out, and you should be left with the object!

101. Want to save the time from loading All your Photoshop brushes, when your Photoshop accidentally forgets to load them up (happens to me sometimes)? Select the brush tool, and click the little arrow pointing right (located at the top toolbar), next to the Master Diameter tick. Go down to Preset Manager and now there should be a menu of all the brushes currently loaded. Click on the first brush (top left) and scroll down to the bottom. Now hold Shift and click the last brush (bottom right). This should highlight all the brushes. See the “Save Set” to the right in the menu? Click that and name your brush set whatever you want, for this matter I just name it All (so I remember that this brush set contains all the brushes I currently have loaded, and is located near the top when loading the brushes up).

Last update: 2007-03-22 07:13
Author: Gary Logsdon
Revision: 1.0

Read more ...

2007-04-12

EJSChart :: 100% Pure JavaScript Charting Solution

EJSChart :: 100% Pure JavaScript Charting Solution: "# Interactive: Features such as Hints, Mouse Tracking, Mouse Events, Key Tracking and Events, Zooming, Scrolling, and Crosshairs raise interactivity and user experience in web charting to a new level.
# Sample Area ChartAxis Scaling: There's no need to determine your data range before hand. EJSChart will calculate and scale automatically to fit whatever data it is presented with.
# Auto Zooming, Scrolling: Too much data and not enough screen real estate? Show it all. Let your end users zoom in on the pieces they're most interested in. Axis locking for single axis zoom, scrolling and automatic axis scaling are all included.
# Sample Stacked ChartStackable Series: Multiple chart series can be stacked and combined to fit many charting needs.
# Multiple Chart Types: Line, Area, Scatter, Pie, Bar and Function series are just the beginning. New series are just a few lines of JavaScript code away." Read more ...

2007-04-08

怎样让Delphi做出来的程序在任务栏上显示不止一个按钮?


主  题: 怎样让Delphi做出来的程序在任务栏上显示不止一个按钮?

怎样让Delphi做出来的程序在任务栏上显示不止一个按钮?
我想让一个不是主窗口的窗口在任务栏上显示一个按钮,以便和主窗口来回切换,怎么办?



回复人: u2m(breeze_wang) ( ) 信誉:125 2003-04-12 13:34:15Z 得分:0


在Delphi中我们可以静态或动态地创建窗体,所谓静态创建窗体是指在设计程序时一并建好窗体,动态创建是指在程序运行时根据需要使用Create方法 创建新窗体,然后使用Show方法来显示窗体。但令人遗憾的是,在显示非启动窗体时,不论用户在程序中创建多少个窗体,每个应用程序只能有一个程序图标, 在Windows的任务条上只显示一个程序图标。
在编写应用程序时,有时我们需要同一应用程序显示两个程序图标,那么如何实现呢?我们只需重载窗体的CreateParams过程即可实现,下面以一个示例来说明如何使用。
 
一、应用实例
 
在Delphi集成环境中创建两个窗体,其中窗体一为主窗体,即程序启动窗体,在其上添加显示窗体二的按钮。因为要让窗体显示的同时在任务栏上再显示一个 程序图标,为了区别,将窗体二的图标更换,然后在窗体二的private部分声明重载CreateParams过程:
unit Unit2;
……
private
{ Private declarations }
procedure CreateParams(var Params: TCreateParams); override;
最后在单元文件的实现部分(Implementation)添加重载过程的实现代码:
procedure TForm2.CreateParams(VAR Params: TCreateParams);
begin
Inherited CreateParams(Params);
Params.WndParent := GetDesktopWindow;
end;
运行程序中,当按下启动窗体中的“显示窗口二”按钮时,会显示窗体二,并且在Windows的任务栏上同时会出现一个新的程序图标,如图1所示。
 
二、程序分析
 
当程序需要创建一个窗体、向系统发出要创建一个新窗体的WM_CREATE消息时,系统将指示程序调用CreateWnd方法来创建窗体, CreateWnd方法在创建窗体前,需要调用CreateParams过程来获得窗体的初始化参数,在获得这些参数后,最后再调用 CreateWindowHandle方法创建一个窗体句柄,完成了一个窗体的创建工作。因此,如果我们要使某一窗体在任务栏上显示程序图标,就需要修改 窗体的初始化参数,重载CreateParams过程。
程序窗口的初始化参数被封装成一个TCreateParams类型的对象,该类型的定义如下所示:
type
TCreateParams = record
{窗体的标题文字}
Caption: PChar;
{窗体的类型,比如WS_CHILD 、WS_DISABLED等}
Style: DWORD;
{扩展的窗体类型}
ExStyle: DWORD;
{窗体的左上角位置}
X, Y: Integer;
{窗体的宽、高}
Width, Height: Integer;
{该窗体的父窗体句柄}
WndParent: HWND;
{指向WM_CREATE消息LParam参数}
Param: Pointer
{该类包含了一些与窗体有关的信息,如鼠标光标、选单等}
WindowClass: TWndClass;
{该窗体的类名}
WinClassName: array[0..63] of Char;
end;
CreateParams过程是当窗体创建时执行,它初始化窗体创建的参数记录。所以如果要显示某一窗体的图标,必须要提高该窗体的级别,即将它的父窗体 置为Windows的桌面,桌面的句柄可以通过API函数GetDesktopWindow来获得,因此只要我们在重载函数体中添加语句 “Params.WndParent
:= GetDesktopWindow;”,就可以实现窗体的图标显示,正如上例所演示的那样。

对MDI子窗口:
procedure TForm2.Button1Click(Sender: TObject);
var hd:hwnd;
begin
hd:=GetDesktopWindow();
windows.SetParent(self.Handle,hd);
self.WindowState:=wsMinimized;
end; Read more ...

2007-04-07

FullerScreen :: Firefox Add-ons

FullerScreen :: Firefox Add-ons: "This extension enhances the Full Screen mode into a really full screen mode, hiding the remaining toolbars and statusbar and making them visible again when the mouse pointer hits an edge of the screen.

This cross-platform extension is tested on Windows and Linux, should work fine on Mac, and is licensed under the Mozilla Public License." Read more ...

2007-04-06

ADG (IndySSL)

ADG (IndySSL): "SIMPLE INDY 9/10 SSL CLIENT AND SERVER EXAMPLES

Written by Ralph Sickinger, Best Manufacturing Practices Center of Excellence (BMPCOE)

e-mail: ralph @ bmpcoe.org

SSL CLIENT:
This program is a simple TCP Client that makes an SSL connection on port 3000. To connect to a server, enter the IP address of the server in the box labeled 'Host:', and then press the 'Connect' button. Once a connection has been established, the client displays any text received from the server in the memo area. To send text to the server, enter it in the available edit box, and then press [enter].

SSL SERVER:
This program establishes a TCP Server that listens for SSL connections on port 3000. When a connection is received, the server responds with 'Hello', and then listens for any other lines of text sent from the client. When a line is received, it is echoed to the screen as well as back to the client.

Note: in order to run this program, you must have libeay32.dll and ssleay32.dll installed where the application can find them (either in the Windows System32 folder, or in the same folder as the application itself. These files can be downloaded from: http://indy.fulgan.com/SSL/ The server also requires that the certificate files (sample.crt, sample.key, and sampleRoot.pem) be available in the same folder as the excutable." Read more ...

2007-03-29

InfoQ: Introduction to JBoss Seam

InfoQ: Introduction to JBoss Seam: "JBoss Seam is a 'lightweight framework for Java EE 5.0'. What does that mean? Isn't Java EE (Enterprise Edition) 5.0 itself a collection of 'frameworks'? Why do you need another one that is outside of the official specification? Well, we view Seam as the 'missing framework' that should have been included in Java EE 5.0. It sits on top of Java EE 5.0 frameworks to provide a consistent and easy-to-understand programming model for all components in an enterprise web application. It also makes stateful applications and business process-driven applications a breeze to develop. In another words, Seam is all about developer productivity and application scalability." Read more ...

Pure servlets: Rethink the view

Pure servlets: Rethink the view: "For Web pages with dynamic content, Java™Server Pages (JSP) technology is touted as a means of separating the developer's concerns from those of the UI designer. Unfortunately, JSP is too complex for many designers, so Java developers tend to handle the JSP code themselves, often with unsatisfactory results. This article demonstrates the advantages of an unorthodox alternative: using simple helper objects to build a Web interface based on servlets alone." Read more ...

2007-03-27

LocalApplicationSamePlaceSuite - xmpp4moz - XMPP for Mozilla - Trac

LocalApplicationSamePlaceSuite - xmpp4moz - XMPP for Mozilla - Trac: "SamePlace is a set of extensions for Firefox, Flock and Thunderbird to keep in touch, chat, play and interact with your contacts without leaving your browser or mail client." Read more ...

Anonymouser :: Firefox Add-ons

Anonymouser :: Firefox Add-ons: "Open link anonymously with...

Open link anonymously with anonymouse.org" Read more ...

ReloadEvery :: Firefox Add-ons

ReloadEvery :: Firefox Add-ons: "Reloads web pages every so many seconds or minutes. The function is accessible via the context menu (menu you get when you right click on a web page) or via a drop down menu on the reload button ...

Reloads web pages every so many seconds or minutes. The function is accessible via the context menu (menu you get when you right click on a web page) or via a drop down menu on the reload button

Keywords: auto refresh, auto reload" Read more ...

Tempomail :: Firefox Add-ons

Tempomail :: Firefox Add-ons: "Create temporary email adresses to prevent your mailbox from...

Create temporary email adresses to prevent your mailbox from spam
Works with:" Read more ...

IE Tab :: Firefox Add-ons

IE Tab :: Firefox Add-ons: "IE Tab - an extension from Taiwan, features: Embedding Internet Explorer in tabs of Mozilla/Firefox...

This is a great tool for web developers, since you can easily see how your webpage displayed in IE with just one click and then switch back to Firefox.

If you need some instructions.
Please visit our official website on http://ietab.mozdev.org" Read more ...

BrowseAtWork :: Firefox Add-ons

BrowseAtWork :: Firefox Add-ons: "Allows you to open the current page, or a link on the current page, anonymously with BrowseAtWork.com by adding a shortcut to the context menu...

Allows you to open the current page, or a link on the current page, anonymously with BrowseAtWork.com by adding a shortcut to the context menu.
Ideal for viewing webpages blocked by many corporate or school filters. Licensed under the GNU GPL.

*~* Please see the developer comments for information regarding support queries. Thanks. *~*" Read more ...

Dictionary Tooltip :: Firefox Add-ons

Dictionary Tooltip :: Firefox Add-ons: "Press ctrl+shift+D (or) double-click (or) right-click after selecting a word to see its meaning. This extension is ideal for those who doesn't like to switch their window to see the meaning of a word. ...

Press ctrl+shift+D (or) double-click (or) right-click after selecting a word to see its meaning. This extension is ideal for those who doesn't like to switch their window to see the meaning of a word.

If you have problems like "Error opening input stream (invalid filename?", install v1.1.3 from the website. Especially Mac users, please install it from my website. Report any other bugs via email.

New version released on the website at http://www.rjonna.com/ext/dictionarytip.php" Read more ...

2007-03-23

dhtmlxGrid - sortable Javascript DHTML grid with rich script API

dhtmlxGrid - sortable Javascript DHTML grid with rich script API: "dhtmlxGrid is a Ajax-enabled JavaScript grid control that provides professional solution for representing and editing tabular data on the web. Carefully designed, with powerful script API, this editable DHTML grid is easy configurable with XML or js methods and shows convincing results working with large amounts of data.

dhtmlxGrid allows easy implementation of nice looking (managed through css or predefined skins) DHTML tables with rich in-cell editing, fixed multiline headers/footers, resizable, sortable and draggable columns. Numerous event handlers let you add necessary interactivity to grid-based interfaces. Smart Rendering technology and built-in paginal output allow this data grid to work effectively with huge datasets." Read more ...

2007-03-11

Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

Passing Information to a Method or a Constructor (The Java™ Tutorials > Learning the Java Language > Classes and Objects): "Arbitrary Number of Arguments
You can use a construct called varargs to pass an arbitrary number of values to a method. You use varargs when you don't know how many of a particular type of argument will be passed to the method. It's a shortcut to creating an array manually (the previous method could have used varargs rather than an array)."

Arbitrary Number of Arguments

You can use a construct called varargs to pass an arbitrary number of values to a method. You use varargs when you don't know how many of a particular type of argument will be passed to the method. It's a shortcut to creating an array manually (the previous method could have used varargs rather than an array).

To use varargs, you follow the type of the last parameter by an ellipsis (three dots, ...), then a space, and the parameter name. The method can then be called with any number of that parameter, including none.

public Polygon polygonFrom(Point... corners) {
int numberOfSides = corners.length;
double squareOfSide1, lengthOfSide1;
squareOfSide1 = (corners[1].x - corners[0].x)*(corners[1].x - corners[0].x)
+ (corners[1].y - corners[0].y)*(corners[1].y - corners[0].y) ;
lengthOfSide1 = Math.sqrt(squareOfSide1);
// more method body code follows that creates
// and returns a polygon connecting the Points
}
You can see that, inside the method, corners is treated like an array. The method can be called either with an array or with a sequence of arguments. The code in the method body will treat the parameter as an array in either case.

You will most commonly see varargs with the printing methods; for example, this printf method:

public PrintStream printf(String format, Object... args)
allows you to print an arbitrary number of objects. It can be called like this:
System.out.printf("%s: %d, %s%n", name, idnum, address);
or like this
System.out.printf("%s: %d, %s, %s, %s%n", name, idnum, address, phone, email);
or with yet a different number of arguments. Read more ...

Equality, Relational, and Conditional Operators (The Java™ Tutorials > Learning the Java Language > Language Basics)

Equality, Relational, and Conditional Operators (The Java™ Tutorials > Learning the Java Language > Language Basics):

The Type Comparison Operator instanceof

The instanceof operator compares an object to a specified type. You can use it to test if an object is an instance of a class, an instance of a subclass, or an instance of a class that implements a particular interface.

The following program, InstanceofDemo, defines a parent class (named Parent), a simple interface (named MyInterface), and a child class (named Child) that inherits from the parent and implements the interface.

class InstanceofDemo {
public static void main(String[] args) {

Parent obj1 = new Parent();
Parent obj2 = new Child();

System.out.println('obj1 instanceof Parent: ' + (obj1 instanceof Parent));
System.out.println('obj1 instanceof Child: ' + (obj1 instanceof Child));
System.out.println('obj1 instanceof MyInterface: ' + (obj1 instanceof MyInterface));
System.out.println('obj2 instanceof Parent: ' + (obj2 instanceof Parent));
System.out.println('obj2 instanceof Child: ' + (obj2 instanceof Child));
System.out.println('obj2 instanceof MyInterface: ' + (obj2 instanceof MyInterface));
 }
}

class Parent{}
class Child extends Parent implements MyInterface{}
interface MyInterface{}
Output:
obj1 instanceof Parent: true
obj1 instanceof Child: false
obj1 instanceof MyInterface: false
obj2 instanceof Parent: true
obj2 instanceof Child: true
obj2 instanceof MyInterface: true
When using the instanceof operator, keep in mind that null is not an instance of anything. Read more ...

2007-02-27

g.georgovassilis - Using the GWTHandler

g.georgovassilis - Using the GWTHandler: "If you have used Spring before and are already using GWT for serious applications you might have considered using Spring controllers instead of GWT's RemoteServiceServlet. There are plenty good reasons for doing so actually." Read more ...