Tuesday, March 15, 2005

Ajax: A New Approach to Web Applications


by Jesse James Garrett
February 18, 2005

If anything about current interaction design can be called “glamorous,” it’s creating Web applications. After all, when was the last time you heard someone rave about the interaction design of a product that wasn’t on the Web? (Okay, besides the iPod.) All the cool, innovative new projects are online.

Despite this, Web interaction designers can’t help but feel a little envious of our colleagues who create desktop software. Desktop applications have a richness and responsiveness that has seemed out of reach on the Web. The same simplicity that enabled the Web’s rapid proliferation also creates a gap between the experiences we can provide and the experiences users can get from a desktop application.

That gap is closing. Take a look at Google Suggest. Watch the way the suggested terms update as you type, almost instantly. Now look at Google Maps. Zoom in. Use your cursor to grab the map and scroll around a bit. Again, everything happens almost instantly, with no waiting for pages to reload.

Google Suggest and Google Maps are two examples of a new approach to web applications that we at Adaptive Path have been calling Ajax. The name is shorthand for Asynchronous JavaScript + XML, and it represents a fundamental shift in what’s possible on the Web.

Defining Ajax


Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:


The classic web application model works like this: Most user actions in the interface trigger an HTTP request back to a web server. The server does some processing — retrieving data, crunching numbers, talking to various legacy systems — and then returns an HTML page to the client. It’s a model adapted from the Web’s original use as a hypertext medium, but as fans of The Elements of User Experience know, what makes the Web good for hypertext doesn’t necessarily make it good for software applications.

Wednesday, March 09, 2005

VC++ Tool for Debugging and Testing

Thursday, March 03, 2005

Good C++ Interview Questions

Link: http://www.techinterviews.com/index.php?p=69
1. How do you decide which integer type to use?
2. What should the 64-bit integer type on new, 64-bit machines be?
3. What’s the best way to declare and define global variables?
4. What does extern mean in a function declaration?
5. What’s the auto keyword good for?
6. I can’t seem to define a linked list node which contains a pointer to itself.
7. How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?
8. How can I declare a function that returns a pointer to a function of its own type?
9. My compiler is complaining about an invalid redeclaration of a function, but I only define it once and call it once. What’s happening?
10. What can I safely assume about the initial values of variables which are not explicitly initialized?
11. Why can’t I initialize a local array with a string?
12. What is the difference between char a[] = “string"; and char *p = “string"; ?
13. How do I initialize a pointer to a function?

Tuesday, March 01, 2005

POSIX Threads Programming

How to Create a Worker Thread?

Threads: How to create a worker thread?
Q: How to create a worker thread?A: There are several ways to create a worker thread:
'_beginthread()' (C run-time library)
'_beginthreadex()' (C run-time library)
'CreateThread()' (Win32 API)
'CreateRemoteThread()' (Win32 API)
'AfxBeginThread()' (MFC)The following samples will show the creation of a thread using the three functions '_beginthreadex()', 'CreateThread()' and 'AfxBeginThread()'.
'_beginthreadex()'
Code:class CFoo
{
public:
CFoo()
{
m_uiThreadID = 0;
m_ulThreadHandle = 0;
}

bool Create()
{
m_ulThreadHandle = _beginthreadex(0,
0,
ThreadFunc,
this,
0,
&m_uiThreadID);
if(!m_ulThreadHandle)
{
// Could not create thread
return false;
}
return true;
}

private:
unsigned int m_uiThreadID;
unsigned long m_ulThreadHandle;

static unsigned int __stdcall ThreadFunc(void *pvParam);
};

'CreateThread()'
Code:class CFoo
{
public:
CFoo()
{
m_dwThreadID = 0;
m_hThread = 0;
}

~CFoo() { CloseHandle(m_hThread); }

bool Create()
{
m_hThread = CreateThread(0,
0,
ThreadFunc,
this,
0,
&m_dwThreadID);
if(!m_hThread)
{
// Could not create thread
return false;
}
return true;
}

private:
DWORD m_dwThreadID;
HANDLE m_hThread;

static DWORD WINAPI ThreadFunc(LPVOID pvParam);
};

'AfxBeginThread()'
Code:class CMyDialog : public CDialog
{
public:
CMyDialog(CWnd* pParent = NULL)
: CDialog(CMyDialog::IDD, pParent)
{
m_pThread = 0;
}

bool Create()
{
m_pThread = AfxBeginThread(ThreadFunc, this);
if(!m_pThread)
{
// Could not create thread
return false;
}
return true;
}

private:
CWinThread *m_pThread;

static UINT ThreadFunc(LPVOID pvParam);
};