Event in ASP.NET AJAX lib Explained

In ASP.NET AJAX lib, there're 2 important types of events, event for Component (Sys.Component) and event for DOM Element.

Let's revise our old knowledge first.

Component (So, its derived class obtains these characteristics)

  • Has to relation with DOM at all.
  • Has no UI representation (not like Control (derived from Component base class) that has).
  • Encapsulates client codes to reuse it across applications *** this is the purpose of Component that exceeds the original DOM elements. In AJAX lib, DOM elements are represent(encapsulate and enrich, indeed) by Sys.UI.Control base class, which actually derive from Sys.Component. So, Component is not Control, but its super class. Component means AJAX lib can manage that things. Some components you wouldn't see with bare eyes (like timer,etc.). Did you get it?
  • Has Handler (cross-browser) that can bind with client object events.
  • Implement Sys.IDisposable.
  • Can raise the propertyChanged notification event when object property changed.
  • You can access events of that Component using get_ and set_ events.

To manage events of Component, we use Sys.EventHandlerList class. It's a dictionary of client events for a component, with event names as keys and the associated handlers as values. It has 3 methods addHandler, clearHandler, and getHandler. For example, when binding event to Component:

   add_tick: function(handler) {
this.get_events().addHandler('tick', handler); }, remove_tick: function(handler) {
this.get_events().removeHandler('tick', handler); }

 this means anything (any class,whatever) that's derived from Component base class. The very important thing is here:

var h = this.get_events().getHandler('tick');
if (h) h(this, Sys.EventArgs.Empty);

This will execute the handler function h. Remember that this handler belongs this Component. For example, Handler 'tick' (this handler) might be the event that is specified from a page developer outside our authority. We, a component developer, may not know this handler at all. He may want to do some special effects presenting to the user on top of UI layer after the time ticked. Page developer doesn't have an idea what's inside our Component too, he just uses it cluelessly.

On the other hand, event for DOM element, when we attach it to that element we call it event binding to DOM element. For example, I bind 'click' event to my button on the page. When it's clicked, it'll do my handler function. Don't forget that, DOM is not the same as Component. It's just a small subset. Here, it is (complete list of its methods): http://msdn.microsoft.com/en-us/library/bb383775.aspx. I think you're familiar with it, no need to explain much:

//register handler for click event on the expand control
$addHandler(yourElement, 'click', yourHandlerFunction);

$clearHandlers(yourElement);

Note that if this.get_element() that you love returns AJAX lib wrapped up DOM element. So, you can attach it an event like this example as well.

Stay tuned for the very near article. Thanks.

Categories:   AJAX Technology | Javascript | Tip(s)
Actions:   E-mail | del.icio.us | Permalink | Comments (2) | RSS


Character Segmentation from the Image [1 line]

Today, I will talk about how to segment character from the image by using MATLAB. At this time, I will show about the concept and the result first, next time I will show the code to implement this. In this entry, I will create automate segmentation step by step. 1. Read the grayscale image.

                               

 

2. Clean the image by using median filter: http://en.wikipedia.org/wiki/Median_filter There are a lot of method to reduce noise from the image but in this picture I found that median filter is the best way to reduce the noise from the image.

3. Now, we can extract foreground image from the background.

 

4. We will see that there are noise stay in the image so, we have to clean the image again by using median filter.

 

5. Find the projection in the vertical and horizontal to see the space between each character which we have to use this to separate each character.

 

Horizontal Histogram

 

Vertical Histogram

6. We have to match the boundary of each character by concave down and concave up of the histogram. [In horizontal, we have only 1 pair because we have only 1 line of characters.]

7. Finally, we cut the selected zone from the image to display a character.

 

8. Do these for all characters.

 

So, we will know the basic steps to segment the characters and the next time I will show and explain about the code to implement it. Hope this will guide you an idea.

 

 

Categories:   Image Processing
Actions:   E-mail | del.icio.us | Permalink | Comments (4) | RSS


Firebug 1.5 stable released!

New firebug that comes out before Firefox3.6 with the following enhancements:

  • Mike Radcliffe’s Inspector. A key feature, now solid as a rock,
  • Jan ‘Honza’ Odvarko’s expanded and refined Net panel, with accurate timings,
  • Steve Roussey’s reworking of HTML editing and entity support,
  • Kevin Decker’s CSS and Style side panel improvements,
  • Support for dynamic, graphical breakpoints through out Firebug.
  • Tested support for the soon-to-be-released Firefox 3.6

Release note ,download add-ons now!

Categories:   News
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | RSS


Apple Event on 27 Jan 10

     แอปเปิลได้ฤกษ์ส่งบัตรเชิญสื่อมวลชนร่วมงานประชุมที่ศูนย์ศิลปะ Yerba Buena Center ที่ซานฟรานซิสโกวันที่ 27 มกราคมนี้อย่างเป็นทางการ ไม่เปิดเผยว่าจะโชว์ตัวแท็ปเล็ต, ไอพ็อดทัชหน้าจอใหญ่ หรือผลิตภัณฑ์ใด มีเพียงข้อความในบัตรเชิญบรรทัดเดียวว่า "Come see our latest creation," เชื้อเชิญให้มาร่วมชมผลงานสร้างสรรล่าสุดของแอปเปิล

 

       บัตรเชิญของแอปเปิลเน้นสีสันมากมายจนทำให้นึกถึงสีสันของเครื่องเล่นเพลงไอพ็อด ซึ่งนอกจากนี้แล้ว ไม่มีข้อมูลอื่นใดบอกใบ้บนบัตรเชิญแม้แต่น้อย

 

       อย่างไรก็ตาม สำนักข่าวฟ็อกซ์นิวส์ (Fox News) เป็นสำนักข่าวเดียวที่รายงานว่าแอปเปิลจะเปิดตัวแท็บเล็ตคอมพิวเตอร์ในงานนี้แน่นอน โดยยืนยันว่าซอฟต์แวร์ iLife เวอร์ชันใหม่(2010)จะถูกโชว์ศักยภาพในงานพร้อมกับการแลกความเห็นเรื่องการอัปเดตระบบปฏิบัติการ iPhone OS 4.0 ในไอโฟน

       ฟ็อกซ์นิวส์ไม่เปิดเผยชื่อแหล่งข่าวในรายงาน โดยสาวกแอปเปิลจะต้องนับถอยหลังรอความจริงเปิดเผยว่า "ผลงานสร้างสรรชิ้นล่าสุด" ของแอปเปิลคืออะไรในวันที่ 27 มกราคมนี้ เวลา 10 โมงเช้าตามเวลาสหรัฐฯ หรือประมาณ 4 ทุ่มของบ้านเรา

       ถ้าในวันงานมีการเปิดตัวอะไร ทางเราจะพยายามหามานำเสนอต่อไปนะครับ ^^

Credit : apple191 , AppleInside , ManagerOnline

 

Categories:   News
Actions:   E-mail | del.icio.us | Permalink | Comments (1) | RSS


The Secret of Steve Job's Presentation Style

 

We refer from lifehacker.com [Full edition: http://lifehacker.com/5449141/deliver-polished-presentations-steve-jobs-style?skyline=true&s=i&autoplay=]

Steve Jobs is probably one of the most polished presenters in the world. He doesn’t use any bullet points in his presentations, his keynote addresses are free of any jargon, there are very few words in the slides but they have photographs and headlines that are hard to forget (everyone still remembers “the world’s thinnest notebook,” a phrase that Steve used to describe Macbook Air).

Whether you're an Apple devotee or not, it's tough to argue that Steve Jobs isn't an extremely polished and charismatic public speaker. Check out this video to lift a few techniques from his playbook.

Steve Jobs gives excellent presentations with clear themes, smooth transitions, and he keeps his audience hanging on his words and the material he's presenting. In the video below Carmine Gallo highlights several of the key techniques that Steve Jobs uses for a successful presentation. The video is packed with great information but does come off like, well, it's being presented by a communications coach who really loves Steve Jobs—which Gallo is and he did write a book about Jobs' presentation style after all.

 

How to Present like Steve Jobs

If you like to learn some of the techniques and styles that make Steve Jobs such a great presenter, here’s some excellent advice [video + slides] from Businessweek columnist Carmine Gallo, who is also the author of the book -- The Presentation Secrets of Steve Jobs.

Source : lifehacker.com  , labnol.org

Categories:   News | Tip(s)
Actions:   E-mail | del.icio.us | Permalink | Comments (1) | RSS


 

Tag Cloud