tag:blogger.com,1999:blog-73641987876485490852024-03-14T00:52:10.927+05:30Sandeep Aparajit"Cheers to the true fighting spirit of IT professionals"Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.comBlogger107125tag:blogger.com,1999:blog-7364198787648549085.post-89701259638298833162018-11-06T09:31:00.001+05:302018-11-06T09:49:36.529+05:30<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwgTfDG5t5B4PaRQjUr3Z7ZFxUO98iv_VBiqFf2qvkkWwP_eG6w1Fo5bhzHmx4zyjZl74EAMIoFgOI0nmwj7WnK6xAn8ILtx2EmJ1FRSRJgqAy_ko_vP4UrLH9unGYbXZPafW25d7pn00/s1600/Dynamics.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="64" data-original-width="48" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwgTfDG5t5B4PaRQjUr3Z7ZFxUO98iv_VBiqFf2qvkkWwP_eG6w1Fo5bhzHmx4zyjZl74EAMIoFgOI0nmwj7WnK6xAn8ILtx2EmJ1FRSRJgqAy_ko_vP4UrLH9unGYbXZPafW25d7pn00/s1600/Dynamics.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWZjwcbgZvDaN25nkAB_fXRNz9nMw7WOyAxcpnnCfrCV9bC7Jdmct6Js69Y6sM8b3kEqoV5R5mUhAz9oNSU1a60puXrIk0yALLNs8Penyw5OV7xVV_xvOBI8K_mgafJEAVaJnD3gjJyMw/s1600/button_customize-alert.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="40" data-original-width="197" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWZjwcbgZvDaN25nkAB_fXRNz9nMw7WOyAxcpnnCfrCV9bC7Jdmct6Js69Y6sM8b3kEqoV5R5mUhAz9oNSU1a60puXrIk0yALLNs8Penyw5OV7xVV_xvOBI8K_mgafJEAVaJnD3gjJyMw/s1600/button_customize-alert.png" /></a></div>
<br /></div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-41988237096677821922018-10-20T02:47:00.001+05:302018-10-20T02:47:19.670+05:30<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJqSOBe8QgUwCsgSjgy7jQGATZDYyy1qKPlBXaKcBkjANigEqUBXXqu24MYnon2TObRnrqK0Sw5xQDONqPuuNK7cM6EWbqJrxTywzvo-ioJBeI8gep862u1eaRl9aef_TduwyryQhaYlA/s1600/cube.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="257" data-original-width="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJqSOBe8QgUwCsgSjgy7jQGATZDYyy1qKPlBXaKcBkjANigEqUBXXqu24MYnon2TObRnrqK0Sw5xQDONqPuuNK7cM6EWbqJrxTywzvo-ioJBeI8gep862u1eaRl9aef_TduwyryQhaYlA/s1600/cube.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsOpoEItn5k0zXV1zZ7Qyy4XELVAL2cMoBg45ROiHYt-xwoz1lEuhpBY1WZDhnmQJuS33ZOLvKT_qAHPE_Ma4gqIRYJj8U-ZApfVb7wH_IOWosawSg-XOepLr1T1CDPSJFNQ-mmcsLGMg/s1600/nopic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="81" data-original-width="121" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsOpoEItn5k0zXV1zZ7Qyy4XELVAL2cMoBg45ROiHYt-xwoz1lEuhpBY1WZDhnmQJuS33ZOLvKT_qAHPE_Ma4gqIRYJj8U-ZApfVb7wH_IOWosawSg-XOepLr1T1CDPSJFNQ-mmcsLGMg/s1600/nopic.jpg" /></a></div>
<br /></div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-36904360591448023852018-09-12T22:20:00.002+05:302018-09-12T22:30:36.197+05:30<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCVy2N2JwWe584kO4mQaoZ8cilE7FVoby0aFY9vB-XrIbMuCM7uX7dgZNxZcnWjkUiCS3UA0Ro724vG23y7bO6FNSMPFPSUv_Odz47HOUyi-2XN9Dxzr150TSCEx0pBDNRRci382l-ybs/s1600/Popularity_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="478" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCVy2N2JwWe584kO4mQaoZ8cilE7FVoby0aFY9vB-XrIbMuCM7uX7dgZNxZcnWjkUiCS3UA0Ro724vG23y7bO6FNSMPFPSUv_Odz47HOUyi-2XN9Dxzr150TSCEx0pBDNRRci382l-ybs/s320/Popularity_1.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfR-C-2KBM-O00UZp-swX7oNSi9eetkcWzTzG1i_hoC_yMVjm9-xxgBVsTb8mfZURxdFyzhQ6rYPvsb1OZWLSVb806yYfe5xv3pQf8g3cAO-CqFhhQN7rIm_hqsNNM2jmrfTqPCaq6IrI/s1600/Popularity_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="476" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfR-C-2KBM-O00UZp-swX7oNSi9eetkcWzTzG1i_hoC_yMVjm9-xxgBVsTb8mfZURxdFyzhQ6rYPvsb1OZWLSVb806yYfe5xv3pQf8g3cAO-CqFhhQN7rIm_hqsNNM2jmrfTqPCaq6IrI/s320/Popularity_2.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga1B2rUc8BKTspHedjdq_BQpoML8my2vYnUV3FrHoKpNrqIvZQ2wF7Au3dptslPjOSBkr0wY3Q2n0s0DYBuwksctNXiZdPmkvXouojCngebUh6GKBd3tuLpANIHD0knGZ1fMKWlcHQzQY/s1600/Popularity_3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="477" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga1B2rUc8BKTspHedjdq_BQpoML8my2vYnUV3FrHoKpNrqIvZQ2wF7Au3dptslPjOSBkr0wY3Q2n0s0DYBuwksctNXiZdPmkvXouojCngebUh6GKBd3tuLpANIHD0knGZ1fMKWlcHQzQY/s320/Popularity_3.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9trKHFS34fohyDnpmKUmWDfITmETEkDsmHqi_G_ti6PpVt4ChHATSIdsI2255BigKV7YtkNVF6HHhInwlLJd6ulD7rJXTiwIb2kYv84sdt4rAM8Lo7PtoFUL-5RrPxcFXg-xf9z7DBg/s1600/Sentiment_1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="426" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9trKHFS34fohyDnpmKUmWDfITmETEkDsmHqi_G_ti6PpVt4ChHATSIdsI2255BigKV7YtkNVF6HHhInwlLJd6ulD7rJXTiwIb2kYv84sdt4rAM8Lo7PtoFUL-5RrPxcFXg-xf9z7DBg/s320/Sentiment_1.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5gcxqIWgm5k1VWkwHA4BPx9NMQlJvjS0gyJDB2ZAbaNrtmG6AlhPhTGxV0BhnUpm5_KXtwbR1cMircHQ9KN3MDwvagotLwVugfBBM90T3O_j8ZfVUbYHIuCo3LnmgeUQ64GJwTO5GuQo/s1600/Sentiment_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="283" data-original-width="431" height="210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5gcxqIWgm5k1VWkwHA4BPx9NMQlJvjS0gyJDB2ZAbaNrtmG6AlhPhTGxV0BhnUpm5_KXtwbR1cMircHQ9KN3MDwvagotLwVugfBBM90T3O_j8ZfVUbYHIuCo3LnmgeUQ64GJwTO5GuQo/s320/Sentiment_2.jpg" width="320" /></a></div>
<br /></div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-14070236031273746002018-09-07T00:37:00.000+05:302018-09-07T00:37:18.157+05:30<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiREIjJXvwtf8O4w_xVpynR6C_Om2til7N_dqRDAn0YWq_uQtV6U9r-6ToUozyxvVX59BXaY1npdNmhcaHOHimhMlJyRuIe8a-Goe0pmxghhPSc1nnXIy7eQtCPKFFNocYFHt-9W_NjsuM/s1600/NewsDigest.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="290" data-original-width="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiREIjJXvwtf8O4w_xVpynR6C_Om2til7N_dqRDAn0YWq_uQtV6U9r-6ToUozyxvVX59BXaY1npdNmhcaHOHimhMlJyRuIe8a-Goe0pmxghhPSc1nnXIy7eQtCPKFFNocYFHt-9W_NjsuM/s1600/NewsDigest.jpg" /></a></div>
<br /></div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-69492512876235771842013-06-14T06:00:00.000+05:302014-08-26T21:50:20.309+05:30Tutorial: Conditional Random Field (CRF)<div dir="ltr" style="text-align: left;" trbidi="on">
Conditional Random Field (CRF) is a probabilistic model for labeling a sequence of words. CRF has found applications in address parsing, NER (names entity recognition), NP chunking etc.<br />
<br />
In order to understand how CRF works, it is important to understand the basic concepts like:<br />
<ul style="text-align: left;">
<li>what are probabilistic models</li>
<li>what are graphical models</li>
<li>basics of probability</li>
<li>basic probabilistic models such as naive bayes, maximum entropy and HMM</li>
</ul>
All these concepts will lead to a concrete understanding of CRFs. Below presentation will help you in understanding the details of CRF.<br />
<br />
<span style="font-size: large;"><span style="color: blue;"><b><a href="https://skydrive.live.com/view.aspx/Blog/How%20does%20CRF%20work.ppsx?cid=cb7a0af59275aa5d&id=documents&app=PowerPoint&authkey=!ACA1XbZcwG4mGFc&&wdSlideId=265" target="_blank">Open Fullscreen</a></b></span></span><br />
<br />
<iframe frameborder="0" height="527" scrolling="no" src="https://onedrive.live.com/embed?cid=CB7A0AF59275AA5D&resid=CB7A0AF59275AA5D%211452&authkey=ALIXS7iCj7GlsvU&em=2" width="702"></iframe>
<br />
<br />
<br />
This is the version 1.0 of the presentation I'm developing. I'm planning to add more details like Baum-Welch algorithm, Perceptron/SGD training algorithm, Regularization etc.<br />
<br />
Stay tuned and feel free to suggest additional CRF topic to be included.</div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com6tag:blogger.com,1999:blog-7364198787648549085.post-32346596890019194332013-03-08T07:18:00.000+05:302013-03-08T07:18:16.121+05:30Basics of Machine Learning (Video)<div dir="ltr" style="text-align: left;" trbidi="on">
This is a basic video course on machine learning (ML) that covers the basic theory, algorithms, and applications.
<br />
<ul>
<li>Lecture 1: <b><span style="color: green;">The Learning Problem</span></b></li>
<li>Lecture 2: <b><span style="color: red;">Is Learning Feasible?</span></b></li>
<li>Lecture 3: <b><span style="color: blue;">The Linear Model I</span></b></li>
<li>Lecture 4: <b><span style="color: green;">Error and Noise</span></b></li>
<li>Lecture 5: <b><span style="color: red;">Training versus Testing</span></b></li>
<li>Lecture 6: <b><span style="color: red;">Theory of Generalization</span></b></li>
<li>Lecture 7: <b><span style="color: red;">The VC Dimension</span></b></li>
<li>Lecture 8: <b><span style="color: red;">Bias-Variance Tradeoff</span></b></li>
<li>Lecture 9: <b><span style="color: blue;">The Linear Model II</span></b></li>
<li>Lecture 10: <b><span style="color: blue;">Neural Networks</span></b></li>
<li>Lecture 11: <b><span style="color: green;">Overfitting</span></b></li>
<li>Lecture 12: <b><span style="color: blue;">Regularization</span></b></li>
<li>Lecture 13: <b><span style="color: blue;">Validation</span></b></li>
<li>Lecture 14: <b><span style="color: red;">Support Vec</span><span style="color: blue;">tor Machines</span></b></li>
<li>Lecture 15: <b><span style="color: red;">Kernel</span> <span style="color: blue;">Methods</span></b></li>
<li>Lecture 16: <b><span style="color: blue;">Radial Basis Functions</span></b></li>
<li>Lecture 17: <b><span style="color: green;">Three Learning Principles</span></b></li>
<li>Lecture 18: <b><span style="color: green;">Epilogue</span></b></li>
</ul>
<left>
<b>
<span style="color: red;">theory - mathematical</span>
<br /><span style="color: blue;">technique - practical</span>
<br /><span style="color: green;">analysis - conceptual</span></b></left><br />
<left><b><span style="color: green;"> </span>
</b></left>
<br />
<iframe allowfullscreen="" frameborder="0" height="480" src="http://www.youtube.com/embed/videoseries?list=PLSemhTU4xrcyAeQXOuLzW3QOCVzhHJg90" width="853"></iframe>
</div>
Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-65589782593994882102012-01-23T14:20:00.010+05:302012-01-23T22:35:37.080+05:30Differential & Integral Calculus (lim, ∂, ∫) [Video Lectures]<div style="text-align: justify;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://upload.wikimedia.org/wikipedia/commons/7/7a/Graph_of_sliding_derivative_line.gif"><img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 400px;" src="http://upload.wikimedia.org/wikipedia/commons/7/7a/Graph_of_sliding_derivative_line.gif" alt="" border="0" /></a>The Calculus is an important branch of mathematics. In this post we'll go through the lectures on differential and integral calculus, which are one of the hard problems students face during their college.<br /></div><br /><div style="text-align: justify;">The "<span style="font-weight:bold;">Derivative</span>" is a measure of how a function changes as its input changes.Loosely speaking, a derivative can be thought of as how much one quantity is changing in response to changes in some other quantity; for example, the derivative of the position of a moving object with respect to time is the object's instantaneous velocity. Or how fast the temperature of a room is changing with respect to time. The derivative of a function at a chosen input value describes the best linear approximation of the function near that input value. For a real-valued function of a single real variable, the derivative at a point equals the slope of the tangent line to the graph of the function at that point. In higher dimensions, the derivative of a function at a point is a linear transformation called the linearization.<br /><br /><br />Understanding "<span style="font-weight:bold;">Limits</span>" is important before starting with derivatives or integration. Informally, a function f assigns an output f(x) to every input x. The function has a limit L at an input p if f(x) is "close" to L whenever x is "close" to p. In other words, f(x) becomes closer and closer to L as x moves closer and closer to p. More specifically, when f is applied to each input sufficiently close to p, the result is an output value that is arbitrarily close to L. If the inputs "close" to p are taken to values that are very different, the limit is said to not exist.<br /></div><br />Above stuff seems confusing, let's take a deeper look at these concepts using the video lectures:<br /><br /><iframe src="http://www.youtube-nocookie.com/embed/videoseries?list=PL6C200C1EFC187E79&hl=en_GB" allowfullscreen="" frameborder="0" height="480" width="853"></iframe><br /><br />A Big Thanks to UCLA for posting these lectures.Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-40532504530719251932010-07-07T16:31:00.026+05:302010-07-07T17:44:57.966+05:30Machine Learning - Tutorial & Stanford Lecture Videos<span style="color: rgb(255, 153, 0); font-weight: bold;font-size:130%;" >What is Machine Learning?</span><br />A computer program is said to <b>learn</b> from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E. - Tom M. Mitchell (1997).<br /><br /><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">Prerequisites</span></span><br />Following are the recommended prerequisites for this course:<br /><ul><li><a href="http://en.wikipedia.org/wiki/Normal_distribution">Normal distribution</a></li><li><a href="http://en.wikipedia.org/wiki/Gaussian_function">Gaussian function</a></li><li><a href="http://wiki.stat.ucla.edu/socr/index.php/Probability_and_statistics_EBook">Basic probability</a><br /></li><li><a href="http://en.wikipedia.org/wiki/Derivative">Derivatives</a><br /></li></ul><br /><span style="color: rgb(255, 153, 0); font-weight: bold;font-size:130%;" >Lecture handouts</span><br /><table style="border: 1px solid gray;" width="520px" cellpadding="2px" cellspacing="2px"> <tbody><tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes1.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes1.pdf</a> </td> <td>Linear Regression, Classification and logistic regression, Generalized Linear Models </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes2.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes2.pdf</a> </td> <td>Generative Learning algorithms </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes3.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes3.pdf</a> </td> <td>Support Vector Machines </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes4.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes4.pdf</a> </td> <td>Learning Theory </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes5.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes5.pdf</a> </td> <td>Regularization and model selection </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes6.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes6.pdf</a> </td> <td>The perceptron and large margin classifiers </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes7a.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes7a.pdf</a> </td> <td>The k-means clustering algorithm </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes7b.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes7b.pdf</a> </td> <td>Mixtures of Gaussians and the EM algorithm </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes8.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes8.pdf</a> </td> <td>The EM algorithm </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes9.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes9.pdf</a> </td> <td>Factor analysis </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes10.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes10.pdf</a> </td> <td>Principal components analysis </td> </tr> <tr class="bgGreenTables"> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes11.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes11.pdf</a> </td> <td>Independent Components Analysis </td> </tr> <tr> <td width="30%"><a href="http://see.stanford.edu/materials/aimlcs229/cs229-notes12.pdf" target="_blank" onclick="javascript: pageTracker._trackPageview('/downloads/CS229-Handouts-pdf'); ">cs229-notes12.pdf</a> </td> <td>Reinforcement Learning and Control </td> </tr> </tbody></table> <br /><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Machine Learning - Standford University Lectures</span><br /><ul><li><a href="javascript:ShowHide('lec1');">Lecture 1</a><br /><span id="lec1" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/UzxYlbK2c7E&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/UzxYlbK2c7E&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><span></span></span></li><br /><li><a href="javascript:ShowHide('lec2');">Lecture 2</a><br /><span id="lec2" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/5u4G23_OohI&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/5u4G23_OohI&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec3');">Lecture 3</a><br /><span id="lec3" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/HZ4cvaztQEs&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/HZ4cvaztQEs&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec4');">Lecture 4</a><br /><span id="lec4" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/nLKOQfKLUks&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/nLKOQfKLUks&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec5');">Lecture 5</a><br /><span id="lec5" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/qRJ3GKMOFrE&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/qRJ3GKMOFrE&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec6');">Lecture 6</a><br /><span id="lec6" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/qyyJKd-zXRE&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/qyyJKd-zXRE&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec7');">Lecture 7</a><br /><span id="lec7" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/s8B4A5ubw6c&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/s8B4A5ubw6c&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec8');">Lecture 8</a><br /><span id="lec8" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/bUv9bfMPMb4&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/bUv9bfMPMb4&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec9');">Lecture 9</a><br /><span id="lec9" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/tojaGtMPo5U&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/tojaGtMPo5U&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec10');">Lecture 10</a><br /><span id="lec10" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/0kWZoyNRxTY&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/0kWZoyNRxTY&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec11');">Lecture 11</a><br /><span id="lec11" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/sQ8T9b-uGVE&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/sQ8T9b-uGVE&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec12');">Lecture 12</a><br /><span id="lec12" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ZZGTuAkF-Hw&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/ZZGTuAkF-Hw&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec13');">Lecture 13</a><br /><span id="lec13" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/LBtuYU-HfUg&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/LBtuYU-HfUg&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec14');">Lecture 14</a><br /><span id="lec14" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/ey2PE5xi9-A&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/ey2PE5xi9-A&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec15');">Lecture 15</a><br /><span id="lec15" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/QGd06MTRMHs&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/QGd06MTRMHs&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec16');">Lecture 16</a><br /><span id="lec16" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/RtxI449ZjSc&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/RtxI449ZjSc&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec17');">Lecture 17</a><br /><span id="lec17" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/LKdFTsM3hl4&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/LKdFTsM3hl4&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec18');">Lecture 18</a><br /><span id="lec18" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/-ff6l5D8-j8&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/-ff6l5D8-j8&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec19');">Lecture 19</a><br /><span id="lec19" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/UFH5ibWnA7g&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/UFH5ibWnA7g&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /><li><a href="javascript:ShowHide('lec20');">Lecture 20</a><br /><span id="lec20" style="display: none;"><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/yCqPMD6coO8&hl=en_US&fs=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/yCqPMD6coO8&hl=en_US&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></span></li><br /></ul><br />A Big thanks to the <a href="http://see.stanford.edu/see/courseinfo.aspx?coll=348ca38a-3a6d-4052-937d-cb017338d7b1">Standford University</a> for posting these lectures.Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-51123843312947050712010-02-01T21:53:00.016+05:302012-03-23T21:05:49.468+05:30How To: Execute and Save SSRS Report using C#It is often required to execute a SSRS report from within C# and save it in the required file format like PDF, XLS etc.<br /><br />SQL Server Reporting Services (SSRS) exposes two web services using which we can execute a report and save it in the required file format. The two web services are:<ul><li>Reporting Service 2005 : <span style="color: rgb(255, 0, 0);">http://[SERVER]<server>/reportserver/reportservice2005.asmx</server></span><br /></li><li>Report Execution Service : <span style="color: rgb(255, 0, 0);">http://</span><span style="color: rgb(255, 0, 0);">[SERVER]</span><span style="color: rgb(255, 0, 0);"><server>/reportserver/reportexecution2005.asmx</server></span><br /></li></ul><br />Add the above two web services as "<span style="font-weight: bold;">Web Reference</span>" to your project with the following namespace RS2005 and RE2005:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_B6Inl7DeaMnN-zdcJKsr5G0cmtuWr-b84CrTKh2XNUqGOxl_D_UoD95FoEkaipX2UvxTZfvs8J4DLsnxIoAeYmo9tsPZsjAjix-K2wUWjgLiCa7U5-xzV88Murecg0V83yaV5-5pJpg/s1600-h/1.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 295px; height: 372px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_B6Inl7DeaMnN-zdcJKsr5G0cmtuWr-b84CrTKh2XNUqGOxl_D_UoD95FoEkaipX2UvxTZfvs8J4DLsnxIoAeYmo9tsPZsjAjix-K2wUWjgLiCa7U5-xzV88Murecg0V83yaV5-5pJpg/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5433318173935251330" border="0" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTF9ZHW3QRTsHxZ9WSe6KPgcyvfIpp9VvZKBMACjSh18alHxJU6yXHa9U1XeIbNqsviy834Gz3CAJMukbktuoO7D8wZuCGfNY7Ag3Xa3jtFavoKbeqP1jAK5Ohq7Yfm-vc1uoebPT8dwc/s1600-h/2.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 281px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTF9ZHW3QRTsHxZ9WSe6KPgcyvfIpp9VvZKBMACjSh18alHxJU6yXHa9U1XeIbNqsviy834Gz3CAJMukbktuoO7D8wZuCGfNY7Ag3Xa3jtFavoKbeqP1jAK5Ohq7Yfm-vc1uoebPT8dwc/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5433318340433178162" border="0" /></a><br /><span style="font-weight: bold;">Use the C# code below to execute and save the report</span>:<br /><!-- code formatted by http://manoli.net/csharpformat/ --><br /><pre class="csharpcode"> <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> SaveReport()<br />{<br /><br /> RS2005.ReportingService2005 rs;<br /> RE2005.ReportExecutionService rsExec;<br /><br /> <span class="rem">// Create a new proxy to the web service</span><br /> rs = <span class="kwrd">new</span> RS2005.ReportingService2005();<br /> rsExec = <span class="kwrd">new</span> RE2005.ReportExecutionService();<br /><br /> <span class="rem">// Authenticate to the Web service using Windows credentials</span><br /> rs.Credentials = System.Net.CredentialCache.DefaultCredentials;<br /> rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials;<br /><br /> rs.Url = <span class="str">"http://<SERVER>/reportserver/reportservice2005.asmx"</span>;<br /> rsExec.Url = <span class="str">"http://<SERVER>/reportserver/reportexecution2005.asmx"</span>;<br /><br /> <span class="kwrd">string</span> historyID = <span class="kwrd">null</span>;<br /> <span class="kwrd">string</span> deviceInfo = <span class="kwrd">null</span>;<br /> <span class="kwrd">string</span> format = <span class="str">"EXCEL"</span>;<br /> Byte[] results;<br /> <span class="kwrd">string</span> encoding = String.Empty;<br /> <span class="kwrd">string</span> mimeType = String.Empty;<br /> <span class="kwrd">string</span> extension = String.Empty;<br /> RE2005.Warning[] warnings = <span class="kwrd">null</span>;<br /> <span class="kwrd">string</span>[] streamIDs = <span class="kwrd">null</span>;<br /><br /> <span class="rem">// Path of the Report - XLS, PDF etc.</span><br /> <span class="kwrd">string</span> fileName = <span class="str">@"c:\samplereport.xls"</span>;<br /> <span class="rem">// Name of the report - Please note this is not the RDL file.</span><br /> <span class="kwrd">string</span> _reportName = <span class="str">@"/Marketing_Report"</span>;<br /> <span class="kwrd">string</span> _historyID = <span class="kwrd">null</span>;<br /> <span class="kwrd">bool</span> _forRendering = <span class="kwrd">false</span>;<br /> RS2005.ParameterValue[] _values = <span class="kwrd">null</span>;<br /> RS2005.DataSourceCredentials[] _credentials = <span class="kwrd">null</span>;<br /> RS2005.ReportParameter[] _parameters = <span class="kwrd">null</span>;<br /><br /> <span class="kwrd">try</span><br /> {<br /> _parameters = rs.GetReportParameters(_reportName, _historyID, _forRendering, _values, _credentials);<br /> RE2005.ExecutionInfo ei = rsExec.LoadReport(_reportName, historyID);<br /> RE2005.ParameterValue[] parameters = <span class="kwrd">new</span> RE2005.ParameterValue[1];<br /><br /> <span class="kwrd">if</span> (_parameters.Length > 0)<br /> {<br /> <span class="rem">//parameters[0] = new RE2005.ParameterValue();</span><br /> <span class="rem">//parameters[0].Label = "";</span><br /> <span class="rem">//parameters[0].Name = "";</span><br /> <span class="rem">//parameters[0].Value = "";</span><br /> }<br /> rsExec.SetExecutionParameters(parameters, <span class="str">"en-us"</span>);<br /><br /> results = rsExec.Render(format, deviceInfo,<br /> <span class="kwrd">out</span> extension, <span class="kwrd">out</span> encoding,<br /> <span class="kwrd">out</span> mimeType, <span class="kwrd">out</span> warnings, <span class="kwrd">out</span> streamIDs);<br /><br /> <span class="kwrd">using</span> (FileStream stream = File.OpenWrite(fileName))<br /> {<br /> stream.Write(results, 0, results.Length);<br /> }<br /> }<br /> <span class="kwrd">catch</span> (Exception ex)<br /> {<br /> <span class="kwrd">throw</span> ex;<br /> }<br /><br />}<br /><br /></pre><br />Following output file formats are available: <span style="font-weight: bold;">XML, CSV, IMAGE, PDF, EXCEL, WORD, HTML 4.0 and MHTML</span><br /><br />Hope this helps!Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com51tag:blogger.com,1999:blog-7364198787648549085.post-89404398246942183532010-01-23T17:27:00.011+05:302010-01-23T18:23:56.393+05:30JSON to XML and XML to JSON Converter in C#<span style="color: rgb(255, 153, 102); font-weight: bold;font-size:130%;" ><span>What is JSON?</span></span><br /><div style="text-align: justify;">JSON, short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects). The JSON format was originally specified in <a href="http://tools.ietf.org/html/rfc4627">RFC 4627</a> by <a href="http://en.wikipedia.org/wiki/Douglas_Crockford">Douglas Crockford</a>. The official Internet media type for JSON is application/json. The JSON filename extension is .json. More information on JSON can be found at <a href="http://www.json.org/">http://www.json.org</a><br /></div><br />Some examples of XML and its equivalent JSON as given below:<br /><span style="font-weight: bold;">XML</span>: <xx yy='nn'><mm>zzz</mm></xx><br /><span style="font-weight: bold;">JSON</span>: { "xx": {"yy":"nn","mm":"zzz"}}<br /><br /><span style="font-weight: bold;">XML</span>: <xx yy='nn'><mm>zzz</mm><mm>aaa</mm></xx><br /><span style="font-weight: bold;">JSON</span>: { "xx": {"yy":"nn", "mm":["zzz","aaa" ] } }<br /><br /><span style="font-weight: bold;">XML</span>: <xx><mm>zzz</mm>some text</xx><br /><span style="font-weight: bold;">JSON</span>: { "xx": {"mm":"zzz", "value":"some text"} }<br /><br /><span style="font-weight: bold;">XML</span>: <xx value='yyy'>some text<mm>zzz</mm>more text</xx><br /><span style="font-weight: bold;">JSON</span>: { "xx": {"mm":"zzz", "value":[ "yyy", "some text", "more text" ] } }<br /><br /><span style="color: rgb(255, 153, 102);font-size:130%;" ><span style="font-weight: bold;">JSON to XML and XML to JSON Converter</span></span><br />James Newton-King has created an excellent library for JSON conversion in C#. The library has following features:<br /><ul><li>LINQ to JSON</li><li>The JsonSerializer for quickly converting your .NET objects to JSON and back again</li><li>Json.NET can optionally produce well formatted, indented JSON for debugging or display</li><li>Attributes like JsonIgnore and JsonProperty can be added to a class to customize how a class is serialized</li><li>Ability to convert JSON to and from XML</li><li>Supports multiple platforms: .NET, Silverlight and the Compact Framework</li></ul><br />You can <a href="http://www.codeplex.com/Json">download the JSON C# library here</a>. More information about the JSON Utilities library can be found at <a href="http://james.newtonking.com/projects/json-net.aspx">http://james.newtonking.com/projects/json-net.aspx</a>.<br />Hats off James, this is an excellent work!Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com4tag:blogger.com,1999:blog-7364198787648549085.post-42042408347240422152010-01-05T21:46:00.003+05:302010-01-05T21:58:45.458+05:30MS Exchange 2010 Web service Helper Class in C#<div style="text-align: justify;">I have created a helper class for interfacing with MS Exchange 2010 Web Service. This class does not include all the methods exposed by the web service, but includes the major ones.<br /></div><br /><pre class="csharpcode"><span class="preproc">#region</span> References<br /><br /><span class="kwrd">using</span> System;<br /><span class="kwrd">using</span> System.Collections.Generic;<br /><span class="kwrd">using</span> System.Linq;<br /><span class="kwrd">using</span> System.Net;<br /><span class="kwrd">using</span> System.Text;<br /><span class="kwrd">using</span> System.Net.Security;<br /><span class="kwrd">using</span> System.Security.Cryptography.X509Certificates;<br /><br /><span class="preproc">#endregion</span> References<br /><br /><span class="kwrd">namespace</span> Exchange2007Manager<br />{<br /> <span class="kwrd">class</span> ExchangeHelper<br /> {<br /> <span class="kwrd">static</span> ExchangeServiceBinding service = <span class="kwrd">new</span> ExchangeServiceBinding();<br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * INITIALIZE MS EXCHANGE WEB SERVICE</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">void</span> InitMSExchange(String userName, String domain, String password)<br /> {<br /><br /> service.RequestServerVersionValue = <span class="kwrd">new</span> RequestServerVersion();<br /> service.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2010;<br /><br /> ServicePointManager.ServerCertificateValidationCallback = <span class="kwrd">delegate</span>(<br /> Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)<br /> {<br /> <span class="rem">// trust any certificate</span><br /> <span class="kwrd">return</span> <span class="kwrd">true</span>;<br /> };<br /><br /> <span class="rem">// enable compression</span><br /> service.EnableDecompression = <span class="kwrd">true</span>;<br /> <span class="rem">// your email account userName, password and the windows domain</span><br /> service.Credentials = <span class="kwrd">new</span> NetworkCredential(userName, password, domain);<br /> service.Url = <span class="str">@"https://server.com/EWS/exchange.asmx"</span>;<br /> }<br /><br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * GET UNREAD ITEMS FROM A FOLDER</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">public</span> <span class="kwrd">static</span> List<ItemType> GetUnReadItems(String folderName)<br /> {<br /> <span class="rem">// serialize response2 object for diagnostics purposes here</span><br /> List<ItemType> lst = <span class="kwrd">new</span> List<ItemType>();<br /> <span class="kwrd">int</span> count = GetUnreadFolderItemsCount(folderName);<br /><br /> <span class="kwrd">if</span> (count != 0)<br /> {<br /> lst = GetUnReadFolderItems(folderName);<br /> }<br /><br /> <span class="kwrd">return</span> lst;<br /> }<br /><br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * MARK ITEM AS READ</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">bool</span> SetReadStatus(ItemIdType item)<br /> {<br /> SetItemFieldType setField = <span class="kwrd">new</span> SetItemFieldType();<br /> PathToUnindexedFieldType path = <span class="kwrd">new</span> PathToUnindexedFieldType();<br /><br /> MessageType message = <span class="kwrd">new</span> MessageType();<br /> message.IsRead = <span class="kwrd">true</span>;<br /> message.IsReadSpecified = <span class="kwrd">true</span>;<br /> setField.Item1 = message;<br /> path.FieldURI = UnindexedFieldURIType.messageIsRead;<br /><br /> setField.Item = path;<br /> ItemChangeType[] updatedItems = <span class="kwrd">new</span> ItemChangeType[1];<br /> updatedItems[0] = <span class="kwrd">new</span> ItemChangeType();<br /> updatedItems[0].Updates = <span class="kwrd">new</span> ItemChangeDescriptionType[1];<br /> updatedItems[0].Updates[0] = setField;<br /><br /> ItemChangeDescriptionType[] updates = <span class="kwrd">new</span> ItemChangeDescriptionType[1];<br /> updates[0] = <span class="kwrd">new</span> ItemChangeDescriptionType();<br /> updates[0].Item = path;<br /><br /> updatedItems[0].Item = <span class="kwrd">new</span> ItemIdType();<br /> ((ItemIdType)updatedItems[0].Item).Id = item.Id;<br /> ((ItemIdType)updatedItems[0].Item).ChangeKey = item.ChangeKey;<br /> UpdateItemType request = <span class="kwrd">new</span> UpdateItemType();<br /> request.ItemChanges = updatedItems;<br /> request.ConflictResolution = ConflictResolutionType.AutoResolve;<br /> request.MessageDisposition = MessageDispositionType.SaveOnly;<br /> request.MessageDispositionSpecified = <span class="kwrd">true</span>;<br /><br /> UpdateItemResponseType response = service.UpdateItem(request);<br /><br /> <span class="kwrd">if</span> (response.ResponseMessages.Items[0].ResponseClass !=<br /> ResponseClassType.Success)<br /> <span class="kwrd">return</span> <span class="kwrd">false</span>;<br /> <span class="kwrd">else</span><br /> <span class="kwrd">return</span> <span class="kwrd">true</span>;<br /> }<br /><br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * GET UNREAD ITEM COUNT FROM A FOLDER</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">public</span> <span class="kwrd">static</span> <span class="kwrd">int</span> GetUnreadFolderItemsCount(String folderName)<br /> {<br /> <span class="kwrd">int</span> unReadCount = -1;<br /> <span class="rem">// Identify the folder properties to return.</span><br /> FolderResponseShapeType properties = <span class="kwrd">new</span> FolderResponseShapeType();<br /> PathToUnindexedFieldType ptuft = <span class="kwrd">new</span> PathToUnindexedFieldType();<br /> ptuft.FieldURI = UnindexedFieldURIType.folderManagedFolderInformation;<br /> PathToUnindexedFieldType[] ptufts = <span class="kwrd">new</span> PathToUnindexedFieldType[1] { ptuft };<br /> properties.AdditionalProperties = ptufts;<br /> properties.BaseShape = DefaultShapeNamesType.AllProperties;<br /><br /> <span class="rem">// Form the get folder request.</span><br /> BaseFolderIdType p_folder = FindFolderID(folderName);<br /><br /> GetFolderType request = <span class="kwrd">new</span> GetFolderType();<br /> request.FolderIds = <span class="kwrd">new</span> BaseFolderIdType[1] { p_folder };<br /> request.FolderShape = properties;<br /><br /> <span class="rem">// Send the request and get the response.</span><br /> GetFolderResponseType response = service.GetFolder(request);<br /><br /> ArrayOfResponseMessagesType aormt = response.ResponseMessages;<br /> ResponseMessageType[] rmta = aormt.Items;<br /> <span class="kwrd">foreach</span> (ResponseMessageType rmt <span class="kwrd">in</span> rmta)<br /> {<br /> <span class="kwrd">if</span> (rmt.ResponseClass == ResponseClassType.Error)<br /> {<br /> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(rmt.MessageText);<br /> }<br /> <span class="kwrd">else</span><br /> {<br /> FolderInfoResponseMessageType firmt;<br /> firmt = (rmt <span class="kwrd">as</span> FolderInfoResponseMessageType);<br /> BaseFolderType[] folders = firmt.Folders;<br /><br /> <span class="kwrd">foreach</span> (BaseFolderType rfolder <span class="kwrd">in</span> folders)<br /> {<br /> <span class="kwrd">if</span> (rfolder <span class="kwrd">is</span> FolderType)<br /> {<br /> FolderType myFolder;<br /> myFolder = (rfolder <span class="kwrd">as</span> FolderType);<br /> <span class="kwrd">if</span> (myFolder.UnreadCountSpecified)<br /> {<br /> unReadCount = myFolder.UnreadCount;<br /> }<br /> }<br /> }<br /> }<br /> }<br /> <span class="kwrd">return</span> unReadCount;<br /> }<br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * FIND FOLDER ID FOR THE NAME GIVEN</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">public</span> <span class="kwrd">static</span> FolderIdType FindFolderID(String folderName)<br /> {<br /> DistinguishedFolderIdType objSearchRootFolder = <span class="kwrd">new</span> DistinguishedFolderIdType();<br /> objSearchRootFolder.Id = DistinguishedFolderIdNameType.msgfolderroot;<br /><br /> FindFolderType requestFindFolder = <span class="kwrd">new</span> FindFolderType();<br /> requestFindFolder.Traversal = FolderQueryTraversalType.Deep;<br /> requestFindFolder.ParentFolderIds = <span class="kwrd">new</span> DistinguishedFolderIdType[] { objSearchRootFolder };<br /> requestFindFolder.FolderShape = <span class="kwrd">new</span> FolderResponseShapeType();<br /> requestFindFolder.FolderShape.BaseShape = DefaultShapeNamesType.IdOnly;<br /><br /> <span class="rem">//Search filter definition</span><br /> requestFindFolder.Restriction = <span class="kwrd">new</span> RestrictionType();<br /><br /> <span class="preproc">#region</span> Contains expression<br /><br /> ContainsExpressionType objContainsExpression = <span class="kwrd">new</span> ContainsExpressionType();<br /> objContainsExpression.ContainmentMode = ContainmentModeType.FullString;<br /> objContainsExpression.ContainmentModeSpecified = <span class="kwrd">true</span>;<br /> objContainsExpression.ContainmentComparison = ContainmentComparisonType.Exact;<br /> objContainsExpression.ContainmentComparisonSpecified = <span class="kwrd">true</span>;<br /><br /> PathToUnindexedFieldType objFieldFolderName = <span class="kwrd">new</span> PathToUnindexedFieldType();<br /> objFieldFolderName.FieldURI = UnindexedFieldURIType.folderDisplayName;<br /> objContainsExpression.Item = objFieldFolderName;<br /><br /> objContainsExpression.Constant = <span class="kwrd">new</span> ConstantValueType();<br /> objContainsExpression.Constant.Value = folderName;<br /><br /> <span class="preproc">#endregion</span> Contains expression<br /><br /> requestFindFolder.Restriction.Item = objContainsExpression;<br /><br /> FindFolderResponseType objFindFolderResponse =<br /> service.FindFolder(requestFindFolder);<br /><br /> <span class="kwrd">if</span> (objFindFolderResponse.ResponseMessages.Items.Length == 0)<br /> <span class="kwrd">return</span> <span class="kwrd">null</span>;<br /><br /> <span class="kwrd">foreach</span> (ResponseMessageType responseMsg <span class="kwrd">in</span><br /> objFindFolderResponse.ResponseMessages.Items)<br /> {<br /> <span class="kwrd">if</span> (responseMsg.ResponseClass == ResponseClassType.Success)<br /> {<br /> FindFolderResponseMessageType objFindResponse =<br /> responseMsg <span class="kwrd">as</span> FindFolderResponseMessageType;<br /> <span class="kwrd">foreach</span> (<br /> BaseFolderType objFolderType <span class="kwrd">in</span> objFindResponse.RootFolder.Folders)<br /> {<br /> <span class="kwrd">return</span> objFolderType.FolderId;<br /> }<br /> }<br /> }<br /> <span class="kwrd">return</span> <span class="kwrd">null</span>;<br /> }<br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * GET UNREAD FOLDER ITEMS</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">private</span> <span class="kwrd">static</span> List<ItemType> GetUnReadFolderItems(String folderName)<br /> {<br /><br /> FindItemType findRequest = <span class="kwrd">new</span> FindItemType();<br /> findRequest.ItemShape = <span class="kwrd">new</span> ItemResponseShapeType();<br /><br /> ItemResponseShapeType itemProperties = <span class="kwrd">new</span> ItemResponseShapeType();<br /> <span class="rem">// Use the Default shape for the response. </span><br /> itemProperties.BaseShape = DefaultShapeNamesType.AllProperties;<br /> itemProperties.BodyType = BodyTypeResponseType.Text;<br /> itemProperties.BodyTypeSpecified = <span class="kwrd">true</span>;<br /><br /> RestrictionType restrict = <span class="kwrd">new</span> RestrictionType();<br /> IsEqualToType isEqTo = <span class="kwrd">new</span> IsEqualToType();<br /> PathToUnindexedFieldType ptuift = <span class="kwrd">new</span> PathToUnindexedFieldType();<br /> ptuift.FieldURI = UnindexedFieldURIType.messageIsRead;<br /> isEqTo.Item = ptuift;<br /> FieldURIOrConstantType msgReadYes = <span class="kwrd">new</span> FieldURIOrConstantType();<br /> msgReadYes.Item = <span class="kwrd">new</span> ConstantValueType();<br /> (msgReadYes.Item <span class="kwrd">as</span> ConstantValueType).Value = <span class="str">"0"</span>; <span class="rem">//1= boolean yes; so you'll get the list of read messages</span><br /> isEqTo.FieldURIOrConstant = msgReadYes;<br /> restrict.Item = isEqTo;<br /> findRequest.Restriction = restrict;<br /><br /> findRequest.ItemShape = itemProperties;<br /><br /> <span class="rem">//Set the inbox as the parent search folder in search attachementRequest.</span><br /> BaseFolderIdType p_folder = FindFolderID(folderName);<br /> findRequest.ParentFolderIds = <span class="kwrd">new</span> BaseFolderIdType[] { p_folder };<br /> findRequest.Traversal = ItemQueryTraversalType.Shallow;<br /><br /><br /> <span class="rem">// Perform the inbox search</span><br /> FindItemResponseType response = service.FindItem(findRequest);<br /> FindItemResponseMessageType responseMessage = response.ResponseMessages.Items[0] <span class="kwrd">as</span> FindItemResponseMessageType;<br /> <span class="kwrd">if</span> (responseMessage.ResponseCode != ResponseCodeType.NoError)<br /> {<br /> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(responseMessage.MessageText);<br /> }<br /> <span class="kwrd">else</span><br /> {<br /><br /> <span class="rem">// find items details</span><br /> GetItemResponseType response2 = service.GetItem(<span class="kwrd">new</span> GetItemType<br /> {<br /> ItemIds = ((response <span class="kwrd">as</span> FindItemResponseType)<br /> .ResponseMessages<br /> .Items<br /> .Select(n => n <span class="kwrd">as</span> FindItemResponseMessageType)<br /> .Select(n => n.RootFolder).Single().Item <span class="kwrd">as</span> ArrayOfRealItemsType)<br /> .Items<br /> .Select(n => <span class="kwrd">new</span> ItemIdType { Id = n.ItemId.Id })<br /> .ToArray()<br /> ,<br /> ItemShape = <span class="kwrd">new</span> ItemResponseShapeType<br /> {<br /> BaseShape = DefaultShapeNamesType.Default,<br /> BodyType = BodyTypeResponseType.Text<br /> }<br /> });<br /><br /> List<ItemType> messages = <span class="kwrd">new</span> List<ItemType>();<br /><br /> <span class="kwrd">for</span> (<span class="kwrd">int</span> j = 0; j < response2.ResponseMessages.Items.Count(); j++)<br /> messages.Add(((ItemInfoResponseMessageType)response2.ResponseMessages.Items[j]).Items.Items[0]);<br /><br /><br /> <span class="kwrd">return</span> messages;<br /> }<br /> }<br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * GET ITEM FOR ID SUPPLIED</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">private</span> <span class="kwrd">static</span> ItemType GetItemForID(String id)<br /> {<br /> ItemIdType iit = <span class="kwrd">new</span> ItemIdType();<br /> iit.Id = id;<br /><br /> GetItemType git = <span class="kwrd">new</span> GetItemType();<br /> git.ItemIds = <span class="kwrd">new</span> ItemIdType[] { iit };<br /> git.ItemShape = <span class="kwrd">new</span> ItemResponseShapeType();<br /> git.ItemShape.BaseShape = DefaultShapeNamesType.AllProperties;<br /><br /> GetItemResponseType girt = service.GetItem(git);<br /><br /> <span class="kwrd">if</span> (girt.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Error)<br /> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(String.Format(<span class="str">"Unable to get message item and Mime Content\r\n{0}\r\n{1}"</span>,<br /> girt.ResponseMessages.Items[0].ResponseCode,<br /> girt.ResponseMessages.Items[0].MessageText));<br /> ItemType message = <span class="kwrd">null</span>;<br /> <span class="kwrd">if</span> (girt.ResponseMessages.Items.Count() > 0)<br /> message = (((ItemInfoResponseMessageType)girt.ResponseMessages.Items[0]).Items.Items[0]);<br /><br /> <span class="kwrd">return</span> message;<br /> }<br /><br /> <span class="rem">/********************************************************************</span><br /><span class="rem"> * REPLY AN EMAIL WITH THE ITEMID AND THE REPLYBODY</span><br /><span class="rem"> ********************************************************************/</span><br /> <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> Reply(String itemID, String replyBody)<br /> {<br /><br /> ItemIdType iit = <span class="kwrd">new</span> ItemIdType();<br /> iit.Id = itemID;<br /><br /> CreateItemType request = <span class="kwrd">new</span> CreateItemType();<br /> request.MessageDisposition = MessageDispositionType.SendAndSaveCopy;<br /> request.MessageDispositionSpecified = <span class="kwrd">true</span>;<br /> request.SavedItemFolderId = <span class="kwrd">new</span> TargetFolderIdType();<br /> request.SavedItemFolderId.Item = <span class="kwrd">new</span> DistinguishedFolderIdType();<br /> (request.SavedItemFolderId.Item <span class="kwrd">as</span> DistinguishedFolderIdType).Id = DistinguishedFolderIdNameType.sentitems;<br /><br /> ReplyToItemType reply = <span class="kwrd">new</span> ReplyToItemType();<br /> <span class="rem">// Id of the message to which to reply</span><br /> reply.ReferenceItemId = iit;<br /> reply.NewBodyContent = <span class="kwrd">new</span> BodyType();<br /> reply.NewBodyContent.BodyType1 = BodyTypeType.HTML;<br /> reply.NewBodyContent.Value = replyBody;<br /><br /> <span class="rem">// Set additional properties on the reply object if you wish...</span><br /> CreateItemResponseType response = service.CreateItem(request);<br /><br /> <span class="kwrd">if</span> (response.ResponseMessages.Items[0].ResponseClass == ResponseClassType.Success)<br /> {<br /> <span class="rem">// Success, the reply was sent and saved in the SentItems folder.</span><br /> <span class="rem">// NB: Since sending a message is an asynchronous operation, NO ITEM ID IS RETURNED.</span><br /> <span class="rem">// To obtain the Id of the reply message, set the MessageDisposition flag above to SaveOnly.</span><br /> <span class="rem">// The Id can be found in the response:</span><br /> <span class="rem">// ItemIdType replyId = ((ItemInfoResponseMessageType)response.ResponseMessages.Items[0]).Items.Items[0].ItemId;</span><br /> <span class="rem">// You can then call SendItem to send the message.</span><br /> }<br /> <span class="kwrd">else</span><br /> {<br /> <span class="rem">// An error has occurred</span><br /> }<br /> }<br /> }<br />}</pre>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com3tag:blogger.com,1999:blog-7364198787648549085.post-67229082969120384802010-01-05T20:57:00.009+05:302010-01-05T21:27:17.137+05:30Regular Expressions Cheat Sheets<div style="text-align: justify;">The regular expression (regex or regexp for short) is a special text string for describing a search pattern. Regular expressions are often required to search for specific patterns, what so ever language you use. Usually we search for files in Windows Explorer using the string "*.txt", which means search all files having extension as "txt". The string "*.txt" is nothing but a regular expression. Regular expression has a wide variety of syntax to describe various operators like *, +, $, ^ etc. It is difficult to remember all these operators and their meanings, in such cases these cheat sheets become handy!<br /></div><div class="cheatSheet"><br /><h3>RegEx Cheat Sheets</h3><a href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/"><img src="http://www.scottklarr.com/media/cheatsheets/regex/1.jpg" alt="Regular Expressions Cheat Sheet" /> </a><a href="http://regexlib.com/CheatSheet.aspx"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/2.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://www.funduc.com/regexp.htm"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/3.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://krijnhoetmer.nl/stuff/regex/cheat-sheet/"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/4.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://opencompany.org/download/regex-cheatsheet.pdf"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/5.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><br /><h3>.NET Regular Expressions Cheat Sheets</h3><a href="http://www.edocr.com/doc/59/net-regular-expression-cheat-sheet"><img src="http://www.scottklarr.com/media/cheatsheets/regex/6.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://bmortimore.com/Technical/NETCheatSheets/NETRegularExpressionCheatSheet/tabid/181/language/en-US/Default.aspx"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/7.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://www.scriptmonkeys.net/scriptmonkeys/RegExp.html"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/8.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><br /><h3>Perl Regular Expressions Cheat Sheet</h3><a href="http://www.mnlab.cs.depaul.edu/%7Eehab/Courses/TDC568/resources/PerlQuickRef.pdf"><img src="http://www.scottklarr.com/media/cheatsheets/regex/10.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><br /><h3>Mysql Regular Expressions Cheat Sheet</h3><a href="http://php-regex.blogspot.com/2008/01/mysql-regular-expressions-cheat-sheet.html"><img src="http://www.scottklarr.com/media/cheatsheets/regex/11.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><br /><h3>Php Regular Expressions Cheat Sheets</h3><a href="http://www.webcheatsheet.com/php/regular_expressions.php"><img src="http://www.scottklarr.com/media/cheatsheets/regex/9.jpg" alt="Regular Expressions Cheat Sheet" /></a><a href="http://www.phpguru.org/downloads/PCRE%20Cheat%20Sheet/PHP%20PCRE%20Cheat%20Sheet.pdf"> <img src="http://www.scottklarr.com/media/cheatsheets/regex/12.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><h3>Javascript Regular Expressions Cheat Sheet</h3><a href="http://www.visibone.com/regular-expressions/"><img src="http://www.scottklarr.com/media/cheatsheets/regex/13.jpg" alt="Regular Expressions Cheat Sheet" /></a><br /><p class="dynAd">Many thanks to all the Cheat Sheet providers, who spent their efforts to create such helpful cheat sheets....!<br /></p></div>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-46412136731950207762009-06-17T11:45:00.010+05:302009-06-17T12:28:41.868+05:30How to effectively use a Search Engine?<div style="text-align: justify;">Most of the people think that Search Engine is a website where we can search a term or a phrase and the search engine gives back the results. When this is absolutely true, the power of a Search Engine is not limited to just searching a few terms/phrases. Search Engines are a very powerful tool that can help us find virtually everything on the internet.<br /></div><br /><div style="text-align: justify;">At present there are three major search engines competing in market, Google, Yahoo and Bing! In this article let’s unleash the power of a search engine and see how effectively we can use it. But before going ahead with the details, let’s first brush-up our basics about a search engine.<br /></div><br /><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">What is a Search Engine?</span></span><br /><div style="text-align: justify;">A Web search engine is a tool designed to search for information on the World Wide Web. The search results are usually presented in a list and are commonly called hits. The information may consist of web pages, images, information and other types of files.<br /></div><br /><div style="text-align: justify;">Web search engines work by storing information about many web pages, which they retrieve from the WWW itself. These pages are retrieved by a Web crawler (sometimes also known as a spider) — an automated Web browser which follows every link it sees. Exclusions can be made by the use of robots.txt. The contents of each page are then analyzed to determine how it should be indexed (for example, words are extracted from the titles, headings, or special fields called meta tags).<br /></div><br /><div style="text-align: justify;">Now that we know what the search engine is, let’s begin by understanding how to effectively use search terms or phrases. Badly given search terms may result in unexpected search results. Hence it is very important to know – What to search for?<br /></div><br /><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">Building Effective Search Words/Phrases</span></span><br /><div style="text-align: justify;">When we want to search a particular article, we first think of what is the focused area of that article. For example, if I want to search for “anonymous methods in C#”, then my search phrase should contain the highly occurring words from that article. These words should be spelled correctly and should be short and to-the-point. Let’s see some of the key points for making searches more effective:</div><ul style="text-align: justify;"><li>Spell words correctly</li><li>Remember to leave a space between each word in your search query</li><li>Use most effective words – i.e. words that you expect to occur frequently in that web site. The choice of words makes a lot difference to the search engines. Remember that every word matters to the search engine!</li><li>Use <span style="color: rgb(255, 153, 0);">OR </span>and <span style="color: rgb(255, 153, 0);">NOT </span>keywords to combine or exclude words. The support for all or some of these keywords differs from search engine to search engine. Also, note that the words OR and NOT should be capitalized </li><li>Use fewer descriptive words, or try words that have a different but similar meaning. This may result in different search results and the one you are expecting </li><li>Search for exact phrases by placing the search words within quotation marks</li><li>Do not use long search phrases, since search engines limit the number of words that could be searched</li><li>Click on the category to see category-specific search results such as web, images, people, maps etc.</li></ul>Here are few key points to be noted about most of the search engines:<br /><ul style="text-align: justify;"><li>Search engines aren’t case sensitive</li><li>Common words such as a, the, an, as etc are ignored by the search engine. These are called as <span style="font-weight: bold;">STOP </span>words. If you want these words to be included, then enclose them in double quotation marks</li><li>If you are searching for a date, then make sure you use standard date formats. Any custom date format that you are using might not be known to the search engine. Also as far as possible, use month names instead of their integer equivalents</li><li>There is no need to use the word “AND” in your search query. By default all the searches are “AND” searches .i.e. they will use your search words using AND. For example: “green trees” means “green AND trees”</li></ul>Apart from these you can use binary operators and wildcards to fine tune your search results:<br /><ul style="text-align: justify;"><li><span style="font-weight: bold;">Phrase Search (“”)</span>: As discussed earlier, use double quotation marks for searching exact phrases.</li><li><span style="font-weight: bold;">Search within a website (site:[site_name])</span>: The search of a query can be limited to a particular website by including the term “site:[site_name]” for example: C# site:sandeep-aparajit.blogspot.com. This search query will search for C# in the website http://sandeep-aparajit.blogspot.com.</li><li><span style="font-weight: bold;">Search for a title (intitle:[search_words])</span>: If you want to search for pages with specific title, then you can use the “intitle” tag for searching the query. For example: intitle:Sandeep, will search all the pages which has title containing word “sandeep”.</li><li><span style="font-weight: bold;">Search exact term (+)</span>: By attaching a + immediately before a word (remember, don't add a space after the +), you can get the search results for the precisely typed word. This will specifically ignore any synonyms.</li><li><span style="font-weight: bold;">Terms to exclude (-)</span>:Attaching a minus sign immediately before a word indicates that you do not want pages that contain this word to appear in your results. This is typically used to exclude a word from your search result. The (-) sign works similar to the NOT keyword we discussed above.</li><li><span style="font-weight: bold;">Fill in the blanks (*)</span>: The * represents a wildcards and indicates that the search engine should consider * as a set of unknown words.</li></ul><div style="text-align: justify;">Apart from these generic tips, there are some search engine specific tips that you can find on their respective help pages. By following these common rules you can make an effective search.<br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Searching for Files</span><br /><div style="text-align: justify;">It is often required to search for files on the internet. And at the same time it is very difficult to visit all the websites and check if the required file is present in that website or not. For example if I want to search for PowerPoint presentations on C#. I can search the presentations i.e. a file having extension .ppt or .pptx using the “filetype” tag as shown below:<br /></div><br /><div style="text-align: left;"><span style="font-style: italic;">Search Query</span>: C# filetype:ppt<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuaEG4py775cCHJyQ-cgtI5D6aP4XsBK4t8i9UDZ0xzbBvv6Gw4Fba8IDgTMRtjUuk9wzFB_3qyfdBylxO1R-OGfzICJAVkJcNhIGep5J1yky4xKQzK7zPqbPtRQX0CBsgZ6iuz8x27II/s1600-h/filetype_ppt.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 275px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuaEG4py775cCHJyQ-cgtI5D6aP4XsBK4t8i9UDZ0xzbBvv6Gw4Fba8IDgTMRtjUuk9wzFB_3qyfdBylxO1R-OGfzICJAVkJcNhIGep5J1yky4xKQzK7zPqbPtRQX0CBsgZ6iuz8x27II/s400/filetype_ppt.jpg" alt="" id="BLOGGER_PHOTO_ID_5348180760158538290" border="0" /></a><br /><div style="text-align: justify;">This will give me search results that directly points to the PowerPoint presentation which are related to C#. This is supported by Google, Yahoo and Bing.<br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Finding Vulnerabilities Using Search Engine</span><br /><div style="text-align: justify;">This might sound weird at first sight, but this is absolutely true. Hackers or Malicious attackers make use of search engines to find web based vulnerabilities. A powerful search engine is actually a helpful tool for hackers for finding various flaws and vulnerabilities. Let’s understand this using an example. TSWEB is a tool used to acquire a Remote Desktop Connection via Internet. Many of the companies expose their computer systems via TSWEB for flexible operation and controlling of the system. You need to expose an URL for letting internet user access you computer system via TSWEB. The TSWEB tool is specifically used by system administrators to control the systems remotely. But when this exposed URL gets indexed by search engine, it actually gets exposed to Hackers. Hackers search for TSWEB enabled system using the search engine and then these systems are attacked. Hence it is a best practice to hide such URL’s from hackers, using robots.txt. Thus it becomes important to make the website Search Engine Optimized for efficient searching and security reasons.<br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Search Engine As Calculator</span><br /><div style="text-align: justify;">Yes! Your search engine is your handy online calculator. Search engines are made intelligent enough to search for mathematical calculations and at the same time performing those calculations and giving out the result. So if you search for 5+2 in search engine, then it will give the result as 7 and will also search for websites containing the expression 5+2. Most of the arithmetic calculations are performed by search engines.<br /></div><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8aX8nmZqFUf5jDWCQteBW3Nn7GlWzRBREiTG5EfiEnjQ8b0ooHKMsjhDSGGKb7H0sKS71LH7GWtFbtDNtBow67Unhc4LkG8trIupoWU2WqpuaRS8ZiFOm295G-n7HpvHWKZvGLYiBKik/s1600-h/SE_Calculation.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 221px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8aX8nmZqFUf5jDWCQteBW3Nn7GlWzRBREiTG5EfiEnjQ8b0ooHKMsjhDSGGKb7H0sKS71LH7GWtFbtDNtBow67Unhc4LkG8trIupoWU2WqpuaRS8ZiFOm295G-n7HpvHWKZvGLYiBKik/s400/SE_Calculation.jpg" alt="" id="BLOGGER_PHOTO_ID_5348181106821372786" border="0" /></a><br /><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Custom Search Engine For Your Website</span><br /><div style="text-align: justify;">Often we require a search engine which will search for keywords ONLY in our site or in a list of site. This is typically required for products site, where a huge list of products are display on the web and the user wants to search for a particular product on your site. This can be achieved by creating a custom search engine. Both Google and Bing provide facility for creating a custom search engine that suits your needs. Bing also provides programmatic interface to the search engine where it sends the search result in the form of XML or JSON. Bing API’s are exposed for achieving this.<br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Why Not Earn Money From Search Engines?</span><br /><div style="text-align: justify;">Yes, search engines provide facility to embed advertisements into the result set of your custom search engine. When users click on these advertisements, you get paid. Well this is not the primary use of search engine, but definitely one of the most used options for earning ;)<br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >Search Engine Optimization</span><br /><div style="text-align: justify;">Search engine optimization (SEO) is the process of improving the volume or quality of traffic to a web site from search engines via "natural" ("organic" or "algorithmic") search results. By following the SEO practices you increase the probability of your site appearing at higher positions in the search result. It’s important to note that SEO practices provide the potential for higher content coverage and ranking, but do not guarantee it. SEO discussion is out of scope for this topic. You can read my blog on <a href="http://sandeep-aparajit.blogspot.com/2009/06/seo-and-iis-seo-toolkit.html">SEO tips for search engines</a>.<br /></div><br /><div style="text-align: justify;">This is only a part of the Search Engine capabilities that we have discussed here. The Search Engine is a huge beast! Kudos to Google, Yahoo and Bing for providing such powerful search engines!<br /></div>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-69753051138285934712009-06-16T11:54:00.002+05:302009-06-16T12:33:12.638+05:30SEO and IIS SEO ToolkitI have created a presentation to help you understand the basics of Search Engine Optimization (SEO). SEO techniques are used to optimize the web pages for search engines. Some key SEO tips and tricks helps us increase the page rank and eventually list our site in the top few search results.<br />The presentation also has links for the usage of the IIS SEO Toolkit.<br /><br /><a title="View SEO and the IIS SEO Toolkit on Scribd" href="http://www.scribd.com/doc/16467315/SEO-and-the-IIS-SEO-Toolkit" style="margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;">SEO and the IIS SEO Toolkit</a> <object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id="doc_221771482521127" name="doc_221771482521127" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" align="middle" height="500" width="100%" rel="media:presentation" resource="http://d.scribd.com/ScribdViewer.swf?document_id=16467315&access_key=key-2a9xi6zxab0ulhdp49rx&page=1&version=1&viewMode=" xmlns:media="http://search.yahoo.com/searchmonkey/media/" xmlns:dc="http://purl.org/dc/terms/" > <param name="movie" value="http://d.scribd.com/ScribdViewer.swf?document_id=16467315&access_key=key-2a9xi6zxab0ulhdp49rx&page=1&version=1&viewMode="> <param name="quality" value="high"> <param name="play" value="true"> <param name="loop" value="true"> <param name="scale" value="showall"> <param name="wmode" value="opaque"> <param name="devicefont" value="false"> <param name="bgcolor" value="#ffffff"> <param name="menu" value="true"> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="salign" value=""> <embed src="http://d.scribd.com/ScribdViewer.swf?document_id=16467315&access_key=key-2a9xi6zxab0ulhdp49rx&page=1&version=1&viewMode=" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" play="true" loop="true" scale="showall" wmode="opaque" devicefont="false" bgcolor="#ffffff" name="doc_221771482521127_object" menu="true" allowfullscreen="true" allowscriptaccess="always" salign="" type="application/x-shockwave-flash" align="middle" height="500" width="100%"></embed> </object>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com2tag:blogger.com,1999:blog-7364198787648549085.post-81542735505864656242009-06-02T09:20:00.005+05:302009-06-02T09:35:46.550+05:30Bing! Microsoft's new search engine is live!<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO92KBc0PoxH6mUicDlGw0R0uIKT4xbQm5nxWKw8TWDFPtKjay02Hq_pbEfq9E3EFAXKHTtcIDvWgd8aFs_rLhJFQ3ZeTIyObxJ2PHjpDM5dnZvhrRfH4ZKC8JHG-7ssuCnMTVnffXH_E/s1600-h/Bing.JPG"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 197px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO92KBc0PoxH6mUicDlGw0R0uIKT4xbQm5nxWKw8TWDFPtKjay02Hq_pbEfq9E3EFAXKHTtcIDvWgd8aFs_rLhJFQ3ZeTIyObxJ2PHjpDM5dnZvhrRfH4ZKC8JHG-7ssuCnMTVnffXH_E/s400/Bing.JPG" alt="" id="BLOGGER_PHOTO_ID_5342575958120917250" border="0" /></a><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">It' Bing!</span></span><br /><div style="text-align: justify;">Bing is a phonic sound to indicate you found the thing you were searching for. I think, by the term "Bing" Microsoft wants to tell that you can find the things that you are searching at Bing.com. Microsoft has evolved the search engines from Live.com to Bing.com. Bing has a very powerful and improved search engine. Even the indexing mechanism has been improved. Microsoft claims Bing to be a <span style="font-style: italic;">decision engine</span> rather than just a <span style="font-style: italic;">search engine</span>.<br /></div><br /><div style="text-align: justify;">Lets see, how Stefan Weitz, a director on the Microsoft Search team, discusses the development of Bing around users’ needs, focusing on four key areas: speed, relevance, previews and multi-media.<br /></div><br /><iframe src="http://www.discoverbing.com/behindbing/ClientBin?vidID=userNeeds" frameborder="0" height="417" scrolling="no" width="561"></iframe><br /><br />You can find the press release of Bing <a href="http://www.microsoft.com/presspass/press/2009/may09/05-28NewSearchPR.mspx">here</a>.Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-81470050514276306372009-06-01T18:43:00.008+05:302009-06-01T19:12:34.982+05:30General Motors (GM) files bankruptcy!<div style="text-align: justify;"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 400px; height: 266px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwh_FeMPPH6KSGfCYRSF-fW5g1mmrBjNYaSEYz8CcKHbvyCcSRxheHixijF8acTAS6TLRI3bDMfki3fC1gTeN3CkN2qyrsWtF9vAmjnDjikeTiFA42fmLLg3nksxBZ8K_baM7OG6ixSN8/s400/large_General-Motors.jpg" alt="" id="BLOGGER_PHOTO_ID_5342347735958868306" border="0" />General Motors (GM) has filed for Chapter 11 bankruptcy protection Monday morning, submitting its reorganization papers to a federal clerk in Lower Manhattan. This is in accordance to the Obama administration's plan to shrink the automaker to a sustainable size and give a majority ownership stake to the federal government. This has made the 100 years old giant to ruin in soil. GM was one of the largest auto makers in America and had a strong economic hold. About 20,000 workers are expected to lose their jobs due to this bankruptcy directly and numerous indirectly.<br /></div><div style="text-align: justify;"><div style="text-align: justify;"><br />GM's bankruptcy is going to have a huge impact on Indian economy too. Many of the Indian giants such as TCS, Infosys hold a share in GM's growth, which has now stunted. The recession is deepening and there are no signs of getting a rescue from this situation. Let’s hope to improve this situation in next two or three quarters. If this situation continues, it’s going to create more criminals than wise men.<br /></div><br />Let’s keep our fingers crossed…and try to improve this situation!<br /><div style="text-align: right;"><a href="http://www.nytimes.com/2009/06/02/business/02auto.html?_r=1&hp">Read more...</a><br /></div></div>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-12280137491834422572009-05-28T10:42:00.008+05:302009-10-30T17:57:19.037+05:30Google Page Rank Checker<iframe style="border: 0px none ; width: 600px; height: 125px;" src="http://aparajit.co.in/GooglePageRankChecker.aspx" frameborder="no"></iframe><br /><br />You can embed this Page Rank Checker on your website using the code given below: <pre class="csharpcode"><br /><span class="kwrd"><</span><span class="html">iframe</span> <span class="attr">style</span><span class="kwrd">="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; WIDTH: 600px;<br />HEIGHT: 125px; BORDER-TOP: 0px; BORDER-RIGHT: 0px"</span><br /><span class="attr">src</span><span class="kwrd">="http://server.com/GooglePageRankChecker.aspx"</span> <span class="attr">frameborder</span><span class="kwrd">="no"</span><span class="kwrd">></</span><span class="html">iframe</span><span class="kwrd">></span></pre>In the next post I will be giving some cool images for displaying the page rank on the website.Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-22030241185795094632009-05-25T10:21:00.002+05:302009-05-25T10:26:21.628+05:30ASP.NET Ajax 4.0 by Stephen Walther - TechEd PresentationHere is a tech-ed presentation delivered by Stepehen Walther on ASP.NET Ajax 4.0 at Hyderabad.<br /><br /><div style="width: 425px; text-align: left;" id="__ss_1474371"><a style="margin: 12px 0pt 3px; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; display: block; text-decoration: underline;" href="http://www.slideshare.net/rsnarayanan/walther-ajax4?type=powerpoint" title="Walther Ajax4">Walther Ajax4</a><object style="margin: 0px;" height="355" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=waltherajax4-090522072149-phpapp02&stripped_title=walther-ajax4"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=waltherajax4-090522072149-phpapp02&stripped_title=walther-ajax4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"></embed></object></div><br /><br /><div style="width: 425px; text-align: left;" id="__ss_1474373"><a style="margin: 12px 0pt 3px; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; display: block; text-decoration: underline;" href="http://www.slideshare.net/rsnarayanan/walther-aspnet4?type=powerpoint" title="Walther Aspnet4">Walther Aspnet4</a><object style="margin: 0px;" height="355" width="425"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=waltheraspnet4-090522072202-phpapp01&stripped_title=walther-aspnet4"><param name="allowFullScreen" value="true"><param name="allowScriptAccess" value="always"><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=waltheraspnet4-090522072202-phpapp01&stripped_title=walther-aspnet4" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="355" width="425"></embed></object></div><br /><span style="font-size:85%;">Courtsey: <a href="http://www.slideshare.net/rsnarayanan">SlideShare.net</a></span>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-7947914249498739152009-05-22T16:56:00.017+05:302009-05-25T10:10:10.553+05:30How to create an IE8 Web Slice in ASP.NET?Web Slice is a cool feature in IE8!<br /><div style="text-align: justify;"><br />In frequently updating web sites, for monitoring status we need to visit those web sites often. Usually we keep the URL to monitor in our favorites list and hit the web site whenever required. When we hit the web site the entire page gets loaded, but our point of interest is only a small updating portion of the web site. This usually happens when visiting the stock updates web site. We want the updated stock, which is actually a very small portion of the web site. But for getting those updates we need to load the entire web page. Is there an option to view only that small updated portion of the web site? YES, indeed there is an option to only view the small updated portion of the web site with IE8's Web Slice feature!<br /><br />Using Web Slices user can add small snippets of a web site in the IE favorite toolbar and monitor their updates. These Web Slices needs to be enabled during web site creation. Please note that this feature is <span style="font-weight: bold;">only supported in IE8</span>. Figure below shows the Web Slice for the updated section.<br /><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeM9XvVJc7NEl1kP88tU9nh4wVwKPNz3gVmkWA47raDGJKMPWXD4LIqt1tfDm-u8-c95QT98IKcUxShSiHEa0Vh0IwUAonZTdtVQ90Q8KDbSjReqENbE9UsBRIS6LBn59lFnGQkOtVFKs/s1600-h/WebSlice.JPG"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 223px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgeM9XvVJc7NEl1kP88tU9nh4wVwKPNz3gVmkWA47raDGJKMPWXD4LIqt1tfDm-u8-c95QT98IKcUxShSiHEa0Vh0IwUAonZTdtVQ90Q8KDbSjReqENbE9UsBRIS6LBn59lFnGQkOtVFKs/s400/WebSlice.JPG" alt="" id="BLOGGER_PHOTO_ID_5338612763932006386" border="0" /></a><span style="font-weight: bold;">Figure 1: Web Slice</span><br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >How to create a Web Slice?</span><br />To enable a WebSlice on your site, just add HTML annotations to your webpage. A WebSlice uses a combination of the <a href="http://microformats.org/wiki/hatom">hAtom Microformat</a> and the WebSlice format.<br /><pre class="csharpcode"><span class="kwrd"><</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">="hslice"</span> <span class="attr">id</span><span class="kwrd">="item123"</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">p</span> <span class="attr">class</span><span class="kwrd">="entry-title"</span><span class="kwrd">></span>Stock: Reliance Petro<span class="kwrd"></</span><span class="html">p</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">="entry-content"</span><span class="kwrd">></span>BSE: XXX, NSE: XXX<br />…<br /><span class="kwrd"></</span><span class="html">div</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">div</span><span class="kwrd">></span></pre>These three annotations helps IE recognize that it is a WebSlice and treat it like a feed; handling the discovery, subscription, and processing of the WebSlice. You can also add additional properties to a WebSlice, such as expiration, time-to-live value, and an alternative source as shown below:<pre class="csharpcode"><br /><span class="kwrd"><</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">="hslice"</span> <span class="attr">id</span><span class="kwrd">="datafound"</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">p</span> <span class="attr">class</span><span class="kwrd">="entry-title"</span><span class="kwrd">></span>Stock: Reliance Petro<span class="kwrd"></</span><span class="html">p</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">a</span> <span class="attr">rel</span><span class="kwrd">="feedurl"</span><br /><span class="attr">href</span><span class="kwrd">="http://localhost:24730/StockInfo/DataFoundUpdate.aspx#datafound-update"</span> <span class="kwrd">/></span><br /><span class="kwrd"></</span><span class="html">div</span><span class="kwrd">></span></pre>In the above sample we have used a URL for the feed as "<span><span class="kwrd">http://localhost:24730/StockInfo/DataFoundUpdate.aspx#datafound-update</span></span>". Please note that this URL has ID of the container DIV preceded by "#" as "<span><span class="kwrd">#datafound-update</span></span>". It is better to have separate aspx page for showing the updates, because this separate page will be lightweight and hence can be rendered quickly. The DataFoundUpdate.aspx page mentioned in the above example has code as shown below:<br /><pre class="csharpcode"><span class="kwrd"><</span><span class="html">html</span> <span class="attr">xmlns</span><span class="kwrd">="http://www.w3.org/1999/xhtml"</span> <span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">head</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">title</span><span class="kwrd">></span>Untitled Page<span class="kwrd"></</span><span class="html">title</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">head</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">body</span><span class="kwrd">></span><br /><span class="kwrd"><</span><span class="html">form</span> <span class="attr">id</span><span class="kwrd">="form1"</span> <span class="attr">runat</span><span class="kwrd">="server"</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">div</span> <span class="attr">class</span><span class="kwrd">="hslice"</span> <span class="attr">id</span><span class="kwrd">="datafound-update"</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">h2</span> <span class="attr">class</span><span class="kwrd">="entry-title"</span><span class="kwrd">></span>Data Found Report<span class="kwrd"></</span><span class="html">h2</span><span class="kwrd">></span><br /> <span class="kwrd"><</span><span class="html">a</span> <span class="attr">class</span><span class="kwrd">="entry-content"</span> <span class="attr">rel</span><span class="kwrd">="entry-content"</span><br /><span class="attr">href</span><span class="kwrd">="http://localhost:24730/StockInfo/SilverlightDisplay.aspx"</span> <span class="kwrd">/></span><br /> <span class="kwrd"></</span><span class="html">div</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">form</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">body</span><span class="kwrd">></span><br /><span class="kwrd"></</span><span class="html">html</span><span class="kwrd">></span></pre>In the above code we have referenced a silverlight page, just to show rich UI interface to the user. Instead you can also render the updated content. Authentication is also enabled for the Web Slice. You can set User name and Password by changing the Properties of a Web Slice. The Web Slice properties can be change by right clicking the favorite slice --> Properties.<br /><br />Some important links on Web Slice:<br />1. <a href="http://blogs.msdn.com/ie/archive/2009/03/11/web-slice-and-feed-authentication-developer-guidelines.aspx">More information on Web Slice</a><br />2. <a href="http://technet.microsoft.com/en-us/ie/dd700697.aspx">Watch Web Slice Video</a><br />3. <a href="http://download.microsoft.com/download/5/C/8/5C8489C0-A01D-426A-BDB8-E03401676570/source-ws.zip"><span style="font-weight: bold;">Download </span>the source code</a><a href="http://download.microsoft.com/download/5/C/8/5C8489C0-A01D-426A-BDB8-E03401676570/source-ws.zip"><br /></a><br />Here is a cool framework developed for <a href="http://www.codeplex.com/webslices">Creating Web Slices in ASP.NET at CodePlex</a>.<br />Hope this helps you!<br /></div>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-60811980379832128652009-05-21T12:04:00.002+05:302009-05-21T12:15:37.874+05:30Microsoft to Ban MemCopy()<div style="text-align: justify;">The C runtime library was created about 25 years ago, when the threats to the computers were altogether different. The computers were not interconnected and were majorly used for professional purposes. But today, almost everybody has his own computer connected in a network or to the internet. Thus the network threats to the computer has increased and so the coding vulnerabilities.<br /><br />Let's take a look at What MemCopy() function does..</div><br /><div style="border: 1px solid gray; background-color: rgb(237, 237, 237);"><p><span style="font-weight: bold; color: rgb(0, 0, 0);font-size:130%;" >MEMCopy()</span><br />The MEMCopy() intrinsic function is used to efficiently copy blocks of data from one memory array to another.<br /><br />void MEMCopy( source_ptr, destination_ptr, num_bytes );<br /><br />any ptr source_ptr;<br />A pointer to a source memory block. Pointer can be of any type.<br /><br />any ptr destination_ptr;<br />A pointer to the destination memory block. Pointer can be of any type.<br /><br />int num_bytes;<br />The number of bytes of data to copy.<br /><br />Example:<br />Copy 10000 bytes starting 5000 bytes into array src to a newly allocated destination buffer (dst).<br /><br />local byte ptr src, byte ptr dst<br />...<br />dst = EAlloc(byte,10000)<br />call MEMCopy(src + 5000, dst, 10000)<br /></p></div><br /><div style="text-align: justify;">Thus, the MemCopy() function is primarily responsible for copying blocks of memory from one location to another. Later this year Microsoft is planning to ban this API for security reasons. There is a whole list of API's that are banned due to security reasons, which you can find <a href="http://msdn.microsoft.com/en-us/library/bb288454.aspx">here</a>.</div>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-86194796450448549382009-05-21T10:13:00.016+05:302009-05-21T11:34:04.230+05:30How to trace visitor information in ASP.NET?<div style="text-align: justify;">It is often required to trace or gather the details of the visitor for maintaining website statistics. This can be easily done in ASP.NET using the Server variables and the Request information available. Various attributes such as remote host name, IP address, browser type and version etc can be known using the Server variables.<br /><br /><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">Source Code:</span></span><br /></div><pre class="csharpcode"><span class="asp"><%</span><br />Response.Write(<span class="str">"<b>Name:</b> "</span> + Request.ServerVariables[<span class="str">"REMOTE_HOST"</span>] + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>IP:</b> "</span> + Request.ServerVariables[<span class="str">"REMOTE_ADDR"</span>] + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>User agent:</b> "</span> + Request.ServerVariables[<span class="str">"HTTP_USER_AGENT"</span>] + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Language:</b> "</span> + Request.ServerVariables[<span class="str">"HTTP_ACCEPT_LANGUAGE"</span>] + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Browser:</b> "</span> + Request.Browser.Browser + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Type:</b> "</span> + Request.Browser.Type + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Version:</b> "</span> + Request.Browser.Version + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Major version:</b> "</span> + Request.Browser.MajorVersion + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Minor version:</b> "</span> + Request.Browser.MinorVersion + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Beta:</b> "</span> + Request.Browser.Beta + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Cookies:</b> "</span> + Request.Browser.Cookies + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Frames:</b> "</span> + Request.Browser.Frames + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Tables:</b> "</span> + Request.Browser.Tables + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>ActiveX:</b> "</span> + Request.Browser.ActiveXControls + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Java Applets:</b> "</span> + Request.Browser.JavaApplets + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>JavaScript:</b> "</span> + Request.Browser.JavaScript + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>VBScript:</b> "</span> + Request.Browser.VBScript + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Platform:</b> "</span> + Request.Browser.Platform + <span class="str">"<br />"</span>);<br />Response.Write(<span class="str">"<b>Crawler:</b> "</span> + Request.Browser.Crawler + <span class="str">"<br />"</span>);<br /><span class="asp">%></span></pre><span style="font-size:100%;"><a href="http://aparajit.co.in/My_Data/Website_Tracker.zip"><span style="font-weight: bold;">Download Source Code</span></a></span><br /><br /><span style="color: rgb(255, 153, 0);font-size:130%;" ><span style="font-weight: bold;">Output:</span></span><br /><iframe src="http://aparajit.co.in/WebsiteTracker.aspx" noborder="true" style="border: 0px none ;" height="500" width="100%"></iframe><br /><span style="font-style: italic; color: rgb(255, 153, 0);">Tip: This information is also gathered by hackers to find vulnerabilities on your machine!</span><br /><br />You can download the source code <a href="http://aparajit.co.in/My_Data/Website_Tracker.zip">here</a>.<br />Hope this helps you!Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-826877391622988232009-05-21T08:45:00.010+05:302009-05-21T09:43:53.734+05:30Enhance website security with ASP.NET AJAX NoBot Control<div style="text-align: justify;">It has been a common security attack to bombard a site with (n) number of requests per second. This type of attach will reduce the server response time and will make the system less usable. There are various mechanisms to prevent such attacks, one of them is the CAPTCHA security implementation. When using CAPTCHA security, the user (human) has to enter the code that appears on the image shown (see figure-1 below). The image may show a code, an arithmetic calculation etc.Thus the automated programs will not be able to enter the exact CAPTCHA code and will prevent unwanted requests to the website.<br /></div><br /><div style="text-align: center;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDLfeAioUEa4qrJmJHiCCCzD9FGM8lpprocdainJK7JK3eYA0rV6L9lKd09NwfhSZvm7wMCkVfp5uhR-l3Y_0Mt2HTRHpmXC1F2Yk_VRwkmkVnZj_IQBtHAVv1S5eCgIiSKLw00b4eCS8/s1600-h/KCAPTCHA.gif"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 290px; height: 60px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDLfeAioUEa4qrJmJHiCCCzD9FGM8lpprocdainJK7JK3eYA0rV6L9lKd09NwfhSZvm7wMCkVfp5uhR-l3Y_0Mt2HTRHpmXC1F2Yk_VRwkmkVnZj_IQBtHAVv1S5eCgIiSKLw00b4eCS8/s400/KCAPTCHA.gif" alt="" id="BLOGGER_PHOTO_ID_5338121763960060866" border="0" /></a><span style="font-weight: bold;">Figure -1</span><br /></div><br /><span style="font-weight: bold; color: rgb(255, 153, 0);font-size:130%;" >The NoBot Control</span><br /><br /><div style="text-align: justify;">NoBot is an ASP.NET Ajax control that provides a CAPTCHA like security without any human intervention. The NoBot control provides a no human interaction security with simple JavaScript and server side logic. NoBot employs a few different anti-bot techniques:<br /></div><br /><ul style="text-align: justify;"><li>Forcing the client's browser to perform a configurable JavaScript calculation and verifying the result as part of the postback. (Ex: the calculation may be a simple numeric one, or may also involve the DOM for added assurance that a browser is involved)</li><li>Enforcing a configurable delay between when a form is requested and when it can be posted back. (Ex: a human is unlikely to complete a form in less than two seconds)</li><li>Enforcing a configurable limit to the number of acceptable requests per IP address per unit of time. (Ex: a human is unlikely to submit the same form more than five times in one minute)</li></ul><span style="font-size:78%;">Courtsey: <a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/NoBot/NoBot.aspx">www.asp.net</a></span><br /><br />The NoBot control can be initialized as shown below:<br /><pre class="csharpcode"><br /><span class="kwrd"><</span><span class="html">ajaxToolkit:NoBot</span><br /><span class="attr">ID</span><span class="kwrd">="NoBotForLoginPage"</span><br /><span class="attr">runat</span><span class="kwrd">="server"</span><br /><span class="attr"><i>OnGenerateChallengeAndResponse</i></span><span class="kwrd">="CustomChallengeResponse"</span><br /><span class="attr"><i>ResponseMinimumDelaySeconds</i></span><span class="kwrd">="2"</span><br /><span class="attr"><i>CutoffWindowSeconds</i></span><span class="kwrd">="60"</span><br /><span class="attr"><i>CutoffMaximumInstances</i></span><span class="kwrd">="5"</span> <span class="kwrd">/></span></pre><br />The properties in <span style="font-style: italic;">italics </span>are optional.<br /><ul style="text-align: justify;"><li><span style="font-weight: bold;">OnGenerateChallengeAndResponse </span>- [<span style="color: rgb(255, 153, 0);">Optional</span>] EventHandler<noboteventargs> providing implementation of the challenge/response code</noboteventargs></li><li><noboteventargs> <span style="font-weight: bold;">ResponseMinimumDelaySeconds </span>- [<span style="color: rgb(255, 153, 0);">Optional</span>] Minimum number of seconds before which a response (postback) is considered valid</noboteventargs></li><li><noboteventargs><span style="font-weight: bold;">CutoffWindowSeconds </span>- [<span style="color: rgb(255, 153, 0);">Optional</span>] Number of seconds specifying the length of the cutoff window that tracks previous postbacks from each IP address</noboteventargs></li><li><noboteventargs><span style="font-weight: bold;">CutoffMaximumInstances </span>- [<span style="color: rgb(255, 153, 0);">Optional</span>] Maximum number of postbacks to allow by a single IP addresses within the cutoff window</noboteventargs></li></ul><noboteventargs><br />A short video showing the usage of the NoBot control is given below:<br /><br /><object style="width: 400px; height: 338px;" autoupdate="true" data="data:application/x-silverlight-2," type="application/x-silverlight-2"><param value="2.0.31005.0" name="MinRuntimeVersion"><param name="source" value="http://www.asp.net/clientbin/mediaplayer/MSCommunities.MediaPlayer.xap"><param value="videoid=1271" name="InitParams"><a href="http://go2.microsoft.com/fwlink/?LinkID=114576&v=2.0"><img style="border-width: 0px;" alt="Install Silverlight" src="http://static.asp.net/themes/silverlight/images/mediaplayer/slplayer_disabled.png" /></a></object><br /><br /><div>Hope this helps you prevent unauthorized access..<br /><div style="text-align: justify;">Be secure.. Be safe!<br /></div></div></noboteventargs>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com2tag:blogger.com,1999:blog-7364198787648549085.post-45640766653127199372009-05-19T17:29:00.003+05:302009-05-19T17:43:25.877+05:30New flaw found in IIS 6.0 - 18 May 09<div style="border: 1px solid gray; background-color: rgb(250, 248, 204);"><i><p>Microsoft Internet Information Services (IIS) version 6.0 contains a vulnerability that could allow an unauthenticated, remote attacker to bypass security restrictions and access sensitive information.<br /><br />The vulnerability is due to improper processing of Unicode characters in HTTP requests. An unauthenticated, remote attacker could exploit this vulnerability by sending a malicious HTTP request to the system. An exploit could allow the attacker to bypass security restrictions and download arbitrary files from the targeted system.<br /><br />Exploit code is available.<br /><br />Microsoft has not confirmed this vulnerability and updates are not available.</p><p><span style="font-size:85%;"><i><i>Courtesy: <a href="http://tools.cisco.com/security/center/viewAlert.x?alertId=18261">Cisco</a></i></i></span></p></i></div><br />A new flaw has been found in IIS 6.0 having WebDav. <a href="http://tools.cisco.com/security/center/viewAlert.x?alertId=18261">Cisco</a> has reported the details of this flaw and Microsoft team is investigating around it. At present there is no patch available and it is recommended to disable WebDav till the patch is available.<br /><br /><div style="border: 1px solid gray; background-color: rgb(250, 248, 204);"><i><p>The vulnerability is due to improper processing of Unicode characters in HTTP requests. When IIS is configured with WebDav, it improperly translates Unicode %c0%af (/) characters. Microsoft IIS may process an HTTP request that contains the character before requiring authentication to a protected resource. An unauthenticated, remote attacker could exploit this vulnerability by sending a malicious HTTP request to the targeted server. An exploit could allow the attacker to list directory contents or download protected files that are hosted by IIS without providing authentication credentials.</p><p><span style="font-size:85%;">Courtesy: <a href="http://tools.cisco.com/security/center/viewAlert.x?alertId=18261">Cisco</a></span></p></i></div><br />Microsoft may soon release a patch to cover-up this vulnerability.<a href="http://tools.cisco.com/security/center/viewAlert.x?alertId=18261"><br /></a>Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0tag:blogger.com,1999:blog-7364198787648549085.post-2644162402096294942009-05-19T17:07:00.003+05:302009-05-19T17:22:37.088+05:30Windows API Code Pack for accessing Windows 7 features in .NETThe Windows API Code Pack provides a library for Microsoft .NET Framework that can be used to access new Windows 7 features and some of the features in Vista from managed code. The existing .NET framework does not encompass these features. This library can be used with .NET Framework 3.5.<br /><br />The features included in the API code pack are:<br /><ul><li>Support for Windows Shell namespace objects, including the new Windows 7 libraries, Known Folders and non file system containers.</li><li>Windows Vista and Windows 7 Task Dialogs.</li><li>Windows 7 Explorer Browser Control supporting both WPF and Windows Forms.</li><li>Support for Shell property system.</li><li>Helpers for Windows 7 Taskbar Jumplists, Icon Overlay and Progress bar.</li><li>Support for Windows Vista and Windows 7 common file dialogs, including custom file dialog controls.</li><li>Support for Direct3D 11.0 and DXGI 1.0/1.1 APIs.</li><li>Sensor Platform APIs</li><li>Extended Linguistic Services APIs</li></ul>Important links for Windows API Code Pack<a href="http://code.msdn.microsoft.com/Wiki/View.aspx?ProjectName=WindowsAPICodePack&wa=wsignin1.0">:</a><br /><span style="font-weight: bold;">1</span>. <a href="http://code.msdn.microsoft.com/Wiki/View.aspx?ProjectName=WindowsAPICodePack&wa=wsignin1.0">More information on Windows API Code Pack</a><br /><span style="font-weight: bold;">2</span>. <a href="http://code.msdn.microsoft.com/WindowsAPICodePack/Release/ProjectReleases.aspx?ReleaseId=2636">Download the Windows API Code Pack</a><br /><br />This is really helpful for developing Windows 7 related features in .NET.Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com1tag:blogger.com,1999:blog-7364198787648549085.post-77899224190198973122009-05-15T15:17:00.003+05:302009-05-15T15:27:16.122+05:30Gather all requirements and resources before committing to the client!<div style="text-align: justify;">This is cool e-mail I received from one of my friends. It just relates to our behavior of committing things to our client even before analyzing and gathering the requirements. Whenever a client ask "I want XYZ functionality. Will I get it?" and the immediate answer from the lead is "Yes Yes! Why not... ". After a couple of days (or months) we find that the words "Yes Yes! Why not... " have made our life miserable. Well, lets go on to the small story...<br /></div><br /><div style="border: 1px solid gray; background-color: rgb(250, 248, 204);"><br />A new vacuum cleaner salesman knocked on the door on the first house of<br /><div style="text-align: justify;">the street. A tall lady answered the door.<br /><br />Before she could speak, the enthusiastic salesman barged into the living<br />room and opened a big black plastic bag and poured all the cow droppings<br />onto the carpet.<br />"Madam, if I cannot clean this up with the use of this new powerful<br />Vacuum cleaner, I will EAT all this dung!" exclaimed the eager salesman.<br /><br />"Do you need chilly sauce or ketchup with that" asked the lady.<br />The bewildered salesman asked, "Why, madam?"<br /><br />"There's no electricity in the house..." said the lady.<br /><br /></div></div><br /><span style="color: rgb(255, 153, 0); font-weight: bold;">MORAL</span>: Gather all requirements and resources before working on any<br />project and committing to the client...!!!Sandeep Aparajithttp://www.blogger.com/profile/12815968401451052342noreply@blogger.com0