<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-24632729</id><updated>2024-09-19T17:56:01.494+05:30</updated><category term="dissert"/><category term="internet"/><category term="tips"/><title type='text'>Keymark</title><subtitle type='html'>Scribe of digital ink</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-24632729.post-5448671501692850264</id><published>2018-10-06T13:43:00.002+05:30</published><updated>2018-10-06T13:50:25.564+05:30</updated><title type='text'>Quickly creating a progressive web app PWA</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Progressive web apps are web apps that can avail some native app like features. They can have their own window. They can show notifications and can optionally work offline. To write a minimal PWA, you need a page to display (index.html) and two files for service worker (sw.js) and manifest (manifest.json).&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Note that service worker requires a secure connection so the site has to be served over HTTPS protocol.&lt;br /&gt;
&lt;br /&gt;
First, in the web page add a link tag for manifest.json and in body add a script tag for registering service worker as shown below.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
index.html&lt;/h4&gt;
&lt;pre&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
        &amp;lt;title&amp;gt;PWA&amp;lt;/title&amp;gt;
        &amp;lt;link rel=&quot;manifest&quot; href=&quot;manifest.json&quot;&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
        &amp;lt;h1&amp;gt;My PWA&amp;lt;/h1&amp;gt;
        &amp;lt;script&amp;gt;
            if (&#39;serviceWorker&#39; in navigator) {
                navigator.serviceWorker.register(&#39;/sw.js&#39;);
            }
        &amp;lt;/script&amp;gt;
    &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Now we need to create a manifest file. This is a json file that stores properties like app name, starting point, display type, icon etc. Many of these are required to identify your site as PWA.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
manifest.json&lt;/h4&gt;
&lt;pre&gt;{
  &quot;name&quot;: &quot;My Progressive Web App&quot;,
  &quot;short_name&quot;: &quot;My PWA&quot;,
  &quot;lang&quot;: &quot;en-US&quot;,
  &quot;start_url&quot;: &quot;/index.html&quot;,
  &quot;display&quot;: &quot;standalone&quot;,
  &quot;icons&quot;: [
    {
      &quot;src&quot;: &quot;http://pngimg.com/uploads/smartphone/smartphone_PNG8511.png&quot;,
      &quot;sizes&quot;: &quot;512x512&quot;,
      &quot;type&quot;: &quot;image/png&quot;
    }
  ]
}&lt;/pre&gt;
&lt;br /&gt;
Finally, we need to add a service worker. A service worker is responsible for managing app caches in the site. In our case, we cache list of static files in install event and then in fetch event we check cache before fetching file.&lt;br /&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
sw.js&lt;/h4&gt;
&lt;pre&gt;/* Cache static files for offline availability */  
self.addEventListener(&#39;install&#39;, event =&amp;gt; {
  event.waitUntil(caches.open(&#39;static&#39;)
    .then(cache =&amp;gt; cache.addAll([&#39;/&#39;, &#39;manifest.json&#39;, &#39;sw.js&#39;]))  
  )
});

/* Fetch file if not in cache */
self.addEventListener(&#39;fetch&#39;, event =&amp;gt; {
  event.respondWith(caches.match(event.request) 
    .then(cached =&amp;gt; cached || fetch(event.request))
  );
});&amp;nbsp;&lt;/pre&gt;
&lt;br /&gt;
Serve above three files from a web server (can use localhost without HTTPS) and point your browser to the site. If your browser supports PWA then it may allow you to install a shortcut on the launcher. Note that browsers have criteria for allowing this. The shortcut will open a standalone window. Once loaded, it should display the page offline also. &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/5448671501692850264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2018/10/quickly-creating-progressive-web-app-pwa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/5448671501692850264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/5448671501692850264'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2018/10/quickly-creating-progressive-web-app-pwa.html' title='Quickly creating a progressive web app PWA'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-2275130763599115706</id><published>2018-09-29T18:54:00.002+05:30</published><updated>2018-09-29T19:07:26.516+05:30</updated><title type='text'>Javascript Promises with chaining in ES6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp;Javascript in version ES6 has introduced Promises. They allow asynchronous tasks to be coordinated. A promise takes two arguments resolve and reject and the asynchronous code calls one of them depending on result. An example would be to fetch a file from network.&lt;br /&gt;
&lt;br /&gt;
The promise can register functions to be called after resolve is called using &#39;then&#39; method. Similarly, functions to be called after reject are registered using &#39;catch&#39; method.&lt;br /&gt;
&lt;br /&gt;
&#39;then&#39; method in turn returns a new promise which can be chained.&lt;br /&gt;
&lt;br /&gt;
Following is an annotated example which demonstrates these concepts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;/* Create a new promise with async action inside
    It takes two functions as arguments: resolve, reject */
const myPromise = new Promise( (resolve, reject)=&amp;gt;{
    /* This function represents async work */
    function doWork () {
        // If current time is even then resolve else reject.
        const fulfilled = (((new Date()).getTime()) % 2 == 0);
        (fulfilled)? resolve(fulfilled): reject(fulfilled);
    }
    // Schedule the work after some time.
    setTimeout(doWork, 1000);
    // Return before doWork finishes.
    return;
});

// If resolve is called in doWork function then call following function.
var myPromise2 = myPromise.then( (fulfilled) =&amp;gt; {
    console.log(&quot;Resolved with &quot; + fulfilled);
    return fulfilled;
});

// If reject is called in doWork function then call following function.
myPromise.catch( (fulfilled)=&amp;gt;{
    console.log(&quot;Rejected with &quot; + fulfilled);
    return fulfilled;
});

// Chain this function after &quot;Resolved With &quot; is called.
myPromise2.then( (fulfilled)=&amp;gt;
    console.log(&#39;Chained Promise with &#39; +  fulfilled));


&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/2275130763599115706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2018/09/javascript-promises-with-chaining-in-es6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/2275130763599115706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/2275130763599115706'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2018/09/javascript-promises-with-chaining-in-es6.html' title='Javascript Promises with chaining in ES6'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-2022076294177924684</id><published>2018-09-23T11:24:00.000+05:30</published><updated>2018-09-29T18:57:23.419+05:30</updated><title type='text'>Encapsulation with closures in javascript</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Javascript supports many programming styles like Object oriented and functional. Functional style in Javascript allows new ways of programming for programmers already having knowledge of languages like C++ or java.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Javascript supports first class functions. Javascript originally has lexical scoping of variables. This means that you can declare and define functions not only at global level but also inside other functions. With lexical scoping, a function has access to all variables in the ascendant functions. Inner functions, when returned from outer function keep reference to the variables of outer function even after outer function exits. These variables can only be accessed by the inner functions.&lt;br /&gt;
&lt;br /&gt;
This restricted visibility of outer function variables allow encapsulation of data. Following is an example of such a case.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;/* Function hiding variable h.
    It returns two function closures. */
    function fn () {
    var h = 0;
    /* Return object with two methods as properties.
        These methods have access to hidden variable h. */
    return {

        // Overwrite variable h
        set : function(v) { h = v; },
        // Read variable h and print.
        log : function() { console.log(h); },
    }
    }  

// Test above function
var ret = fn();
var ret2 = fn();
ret2.set(10);
ret.log();
ret2.log();

/* Output is  
    0
    10
*/
&lt;/pre&gt;
&lt;br /&gt;
fn is outer function. it returns an object with two functions set and log as properties. The inner functions are function closures that have reference to outer function variables.&lt;br /&gt;
&lt;br /&gt;
The function fn is invoked twice with return values assigned to ret and ret2 variables. Then set function is invoked on ret2 to overwrite the hidden variable of ret2. Finally, we log the values to see that ret and ret2 has separate copies of variable h.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/2022076294177924684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2018/09/encapsulation-with-closures-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/2022076294177924684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/2022076294177924684'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2018/09/encapsulation-with-closures-in.html' title='Encapsulation with closures in javascript'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-4565112029440641883</id><published>2018-09-12T19:42:00.000+05:30</published><updated>2018-09-17T21:40:11.824+05:30</updated><title type='text'>Overview of MV* design patterns MVC MVP MVVM</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Over the years many design patterns have emerged to enforce separation of concerns in code bases. The MV* patterns have found use in server side technology such as Java EE and Dot Net as well as on browser in some modern libraries. Here we attempt an overview of these patterns.&lt;br /&gt;
&lt;br /&gt;
The MV* patterns have three separations: Model, View and the Glue. The interaction between separated model and the view is facilitated by the Glue, which goes by name of Controller, Presenter or ViewModel. Hence the pattern Model-View-Controller (MVC), Model-View-Presenter (MVP) or Model-View-ViewModel (MVVM).&lt;br /&gt;
&lt;br /&gt;
Model is the encapsulation of business data and logic. This contains the internal representation of the data relevant to the software. It contains business logic, which is the processing of data in order to achieve desired function of the software. It is not concerned with how that information is laid out on the user interface or formatting thereof.&lt;br /&gt;
&lt;br /&gt;
View is the encapsulation of visual aspects of data being presented to user on user interface. This means layout, formatting, effects rendered to the user. It is not concerned about how the data is stored and processed internally for achieving desired functionality of software.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDkSeuBeasFnN6rOSQRJM7fftKgyQHXDtoaJtZ6jtIDGsPiOgZQf6ROfbXbFSV3y41r_jIW8OJH9FF1ljbyOmY_oxTHKVgK-p0L65KAXXgvAjwTSN4ARfNTI8TEuLKpPOtPkEeQ/s1600/mvc.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;288&quot; data-original-width=&quot;384&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDkSeuBeasFnN6rOSQRJM7fftKgyQHXDtoaJtZ6jtIDGsPiOgZQf6ROfbXbFSV3y41r_jIW8OJH9FF1ljbyOmY_oxTHKVgK-p0L65KAXXgvAjwTSN4ARfNTI8TEuLKpPOtPkEeQ/s320/mvc.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
MVC has Controller as the glue. The controller is responsible for receiving user input. After receiving user input it interacts with model to update it. After that the model notifies the view that now it is ready to render. View renders the data and sends it to the user.&lt;br /&gt;
&lt;br /&gt;
The separation of model from view allows testing of model independently from the view. However, the controller is tied to the view and can contain some processing which is not easy to test.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis8usBm3Ljt3A8VO1wah7oUAEGXf97XJYd5-S2caZkVikxUNXEigLXSR6xzI0wOE6lAx3QilbJvE1wiLB6Oglkk1TxxyFzKVCyAdNqSQm1LPth7gK2yxFsuG_lffAGnvThyphenhyphen99EoA/s1600/mvp.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;288&quot; data-original-width=&quot;384&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis8usBm3Ljt3A8VO1wah7oUAEGXf97XJYd5-S2caZkVikxUNXEigLXSR6xzI0wOE6lAx3QilbJvE1wiLB6Oglkk1TxxyFzKVCyAdNqSQm1LPth7gK2yxFsuG_lffAGnvThyphenhyphen99EoA/s320/mvp.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
MVP has Presenter as the glue. The presenter is obtains input from the view and then interacts with model to update it. The results are fetched from model and presenter then updates the view.&lt;br /&gt;
&lt;br /&gt;
The View in MVP does not contain any processing for display. Processing is shifted to the presenter. This allows testing of presenter and model easily. &lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFs8qmgypUf9OfvlyFUjiu8p2OpxmElASxtjtbBUO7jEBJeOnTSbYm3B5hD0y-sIeu1bXpach_IB-wiOcTZOi9RP43OFQ8nJkdPZgnAdNr-hICAXsm7bWWV6D4z-gTb_l_SQh3eA/s1600/mvvm.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;288&quot; data-original-width=&quot;384&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFs8qmgypUf9OfvlyFUjiu8p2OpxmElASxtjtbBUO7jEBJeOnTSbYm3B5hD0y-sIeu1bXpach_IB-wiOcTZOi9RP43OFQ8nJkdPZgnAdNr-hICAXsm7bWWV6D4z-gTb_l_SQh3eA/s320/mvvm.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
MVVM has ViewModel as the glue. In practice, MVVM relies on a &quot;data binding&quot;. Data binding automatic synchronization of data in view to data in viewmodel. ViewModel is responsible for updating the model.&lt;br /&gt;
&lt;br /&gt;
The binding in MVVM reduces boilerplate code required. Without platform support for binding, Implementing MVVM requires much more effort.&lt;br /&gt;
&lt;br /&gt;
MVC, MVP and MVVM has their own applications. All are used in various software frameworks which are popular today.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/4565112029440641883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2018/09/overview-design-patterns-mvc-mvp-mvvm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/4565112029440641883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/4565112029440641883'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2018/09/overview-design-patterns-mvc-mvp-mvvm.html' title='Overview of MV* design patterns MVC MVP MVVM'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWDkSeuBeasFnN6rOSQRJM7fftKgyQHXDtoaJtZ6jtIDGsPiOgZQf6ROfbXbFSV3y41r_jIW8OJH9FF1ljbyOmY_oxTHKVgK-p0L65KAXXgvAjwTSN4ARfNTI8TEuLKpPOtPkEeQ/s72-c/mvc.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-3833391722744588504</id><published>2010-01-22T19:59:00.001+05:30</published><updated>2010-01-22T20:02:45.245+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="internet"/><title type='text'>Ways of accessing gmail on mobile and desktop</title><content type='html'>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;Gmail is one of the most flexible email services in the cloud when it comes to options to access it. There are many ways to login to gmail from various systems. Here we enlist options provided by gmail when it comes to reading or sending emails.&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Standard Interface:&lt;br/&gt;The default interface at &lt;a target=&#39;_blank&#39; href=&#39;http://mail.google.com/mail&#39;&gt;http://mail.google.com/mail&lt;/a&gt; is an AJAX interface which has access to all the features of gmail.&lt;/li&gt;&lt;li&gt;HTML Interface:&lt;br/&gt;accessible at &lt;a target=&#39;_blank&#39; href=&#39;http://mail.google.com/mail/h/&#39;&gt;http://mail.google.com/mail/h/&lt;/a&gt; is lighter version gmail interface which is useful on low-bandwidth connections and on browsers not supported by standard interface. It is vary fast to load and layout is suitable for desktop interface.&lt;/li&gt;&lt;li&gt;Mobile interface:&lt;br/&gt;available at &lt;a target=&#39;_blank&#39; href=&#39;http://mail.google.com/mail/x/&#39;&gt;http://mail.google.com/mail/x/&lt;/a&gt; is another light version of gmail interface. It is optimized for mobile access.&lt;/li&gt;&lt;li&gt;Desktop IMAP/POP clients:&lt;br/&gt;You can also use mail clients like thunderbird or outlook to access email using POP/IMAP protocol supported by these clients and send mail using SMTP. Many mobiles also have applications for POP/IMAP. &lt;br/&gt;&lt;/li&gt;&lt;li&gt;Web interfaces of IMAP clients:&lt;br/&gt;Third party websites like &lt;a target=&#39;_blank&#39; href=&#39;http://mail2web.com&#39;&gt;http://mail2web.com&lt;/a&gt; allow access to gmail using POP/IMAP settings. These sites may also have mobile interface to allow access from mobiles.&lt;br/&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;Each option described above caters to various devices and useful in some conditions. However, only the standard interface allows access to gmail&#39;s advanced features and integration. Also the contacts are only accessible from gmail&#39;s own web interfaces (first three). On the other hand POP/IMAP access supports multiple accounts at same time which is not available in gmail&#39;s web interfaces.&lt;br/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/3833391722744588504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2010/01/ways-of-accessing-gmail-on-mobile-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/3833391722744588504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/3833391722744588504'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2010/01/ways-of-accessing-gmail-on-mobile-and.html' title='Ways of accessing gmail on mobile and desktop'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-4523199033615722941</id><published>2006-11-04T13:39:00.001+05:30</published><updated>2007-01-09T12:54:17.173+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="internet"/><title type='text'>Secure email address against spam using email forw...</title><content type='html'>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;Email spam is a concern for most these days. It might not take long before you receive spam in your fresh active email account.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;A spam email is an email &lt;span id=&#39;SPELLING_ERROR_0&#39; class=&#39;blsp-spelling-corrected&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;received&lt;/span&gt; which you did not ask for. Most of the time, it would be from unknown source. It may even have a fake sender name to make you open it. Spam is sent for various reasons like cheap publicity, frauds and even works as pollinators for computer viruses.&lt;br&gt;&lt;/br&gt;Listed are some precautions for protection against spam.&lt;br&gt;&lt;/br&gt;&lt;ul&gt;&lt;li&gt;Do not give your email ID to anyone!&lt;br&gt;&lt;/br&gt;Then ... how to use it? The key is to classify contacts and then use appropriate forwarding mechanisms. A forwarding mechanism allows any email sent to some other address to be automatically received at your email address.&lt;br&gt;&lt;/br&gt;&lt;/li&gt;&lt;li&gt;For temporary addresses, check &lt;a href=&#39;http://www.spamgourmet.com/&#39;&gt;&lt;span id=&#39;SPELLING_ERROR_1&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spamgourmet&lt;/span&gt;.com&lt;/a&gt; It offers temporary email forwarding addresses of form &#39;&lt;span id=&#39;SPELLING_ERROR_2&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;tempname&lt;/span&gt;.&lt;span id=&#39;SPELLING_ERROR_3&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;youraccount&lt;/span&gt; at &lt;span id=&#39;SPELLING_ERROR_4&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spamgourmet&lt;/span&gt;.com&#39; where &lt;span id=&#39;SPELLING_ERROR_5&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;tempname&lt;/span&gt; is any arbitrary word and &lt;span id=&#39;SPELLING_ERROR_6&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;youraccount&lt;/span&gt; is your &lt;span id=&#39;SPELLING_ERROR_7&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spamgourmet&lt;/span&gt; account name. This address would expire after some number of emails and that would automatically stop too many emails coming from that sender. For example, this can be used for site registrations where you do not expect more than a couple of emails for registration.&lt;br&gt;&lt;/br&gt;&lt;/li&gt;&lt;li&gt;Social networking sites allow hiding email address and access control. This way only friends can write to you without giving away actual address.&lt;br&gt;&lt;/br&gt;&lt;/li&gt;&lt;li&gt;Use Email service providers that allow email forwarding, e.g, &lt;a href=&#39;http://mail.google.com/&#39;&gt;gmail&lt;/a&gt;. Aggregate mails from these accounts into another account, which is not given even to trusted parties. Thus, if one of your addresses are compromised, it would not effect others.&lt;br&gt;&lt;/br&gt;&lt;/li&gt;&lt;li&gt;Extended email address are provided by some email providers. If your address is a@b.c, a+anything@b.c also delivers mail to a@b.c, but with added advantage that a+anything@b.c can be filtered out if it is subjected to spam.&lt;br&gt;&lt;/br&gt;&lt;/li&gt;&lt;/ul&gt;Why not share email address with friends? Because they might unknowingly pass your email address to &lt;span id=&#39;SPELLING_ERROR_8&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spammers&lt;/span&gt;. It works like this: user1 forwards a message to user2 and user3. He uses To: and CC: field to address them. This way, now user2 and user3 have each other&#39;s addresses, but they never intended to do so. Now this message is forwarded many time and ends up either in a &lt;span id=&#39;SPELLING_ERROR_9&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spammer&#39;s&lt;/span&gt; hand with all the email addresses or is posted on some site ready for &lt;span id=&#39;SPELLING_ERROR_10&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;spammer&lt;/span&gt; to crawl.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;The moral of this story is, when you forward messages to many email addresses, always use &lt;span id=&#39;SPELLING_ERROR_11&#39; class=&#39;blsp-spelling-error&#39; onclick=&#39;BLOG_clickHandler(this)&#39;&gt;BCC&lt;/span&gt; field, not TO or CC. use your address in TO if the software forces to write some address there. Unless your friends follow this, your email address is in risk of getting into hands of anyone.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;The indirect method of contacts such as social networks has added benefit, that your changes in email address are transparent to your friends. Thus, if your email address is compromised by mistake of someone you share address with or you want to check out new cool email service, you can change the email address without involving people who do not share it directly with you, e.g. users of online groups and social networking sites.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;These tips can take little time to practice, but provides good defense against spam.&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/4523199033615722941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2006/11/secure-email-address-against-spam-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/4523199033615722941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/4523199033615722941'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2006/11/secure-email-address-against-spam-using.html' title='Secure email address against spam using email forw...'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-6753794010927145531</id><published>2006-10-13T21:41:00.000+05:30</published><updated>2008-02-04T18:43:52.314+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="tips"/><title type='text'>Using Google talk (Jabber) on linux behind proxy and firewall</title><content type='html'>The official Google talk client works beautifully behind firewall and proxy , but Linux users face difficulties trying to connect behind a proxy and firewall. Google Talk client is not available for Linux. A page describing how to connect using other Instant Messengers (IM) is provided on the Google Talk page, but the details shown there are for standard setup.&lt;br /&gt;&lt;br /&gt;Google talk uses an open standard named Jabber for communication between the user-client and the server. This protocol Allows connecting in 3 modes: Direct connection, tunneling over HTTP and HTTP polling.&lt;br /&gt;&lt;br /&gt;The HTTP Tunneling mode can be used when the proxy allows HTTP tunneling over Jabber ports 5222 and 5223. Most of the proxies block this.&lt;br /&gt;&lt;br /&gt;Recently is has become possible to connect to GTalk Jabber server using port 443. for more details, &lt;a href=&quot;http://forum.psi-im.org/thread/3393&quot;&gt;refer this page&lt;/a&gt; Thus, for people behind firewall and proxy, the parameters of connections are as follows.:&lt;br /&gt;&lt;br /&gt;Try a good jabber client, e.g. &lt;a href=&quot;http://psi.affinix.com/&quot;&gt;Psi&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Jabber ID: your.user.id@gmail.com&lt;br /&gt;Password: gmail password&lt;br /&gt;&lt;br /&gt;Proxy server name, port and password from your network administrator&lt;br /&gt;&lt;br /&gt;Also select following options&lt;br /&gt;Use SSL Encryption&lt;br /&gt;Ignore SSL Warnings&lt;br /&gt;Allow Plaintext Login&lt;br /&gt;Manually specify server host/port; Host: talk.google.com; Port: 443&lt;br /&gt;&lt;br /&gt;Save the setup and try luck!&lt;br /&gt;&lt;br /&gt;Also, have a look at the page describing how to use &lt;a href=&quot;http://www.bigblueball.com/forums/google-talk-news/33739-connect-google-talk-aim-msn-yahoo.html&quot;&gt;Google Talk with other IM services&lt;/a&gt; like AIM, MSN, Yahoo, ICQ etc.</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/6753794010927145531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2006/10/using-google-talk-jabber-on-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/6753794010927145531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/6753794010927145531'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2006/10/using-google-talk-jabber-on-linux.html' title='Using Google talk (Jabber) on linux behind proxy and firewall'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-114400168545642688</id><published>2006-04-02T20:43:00.001+05:30</published><updated>2008-04-21T02:31:13.728+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dissert"/><title type='text'>Parser generators : ANTLR, SableCC, JavaCC, bison at a glance.</title><content type='html'>One looks towards parser generators (or compiler compilers) when there is a need to translate something in one language to other language. Basically you need to read a sequence of characters, make a data structure which represents the same. For many interesting problems, you want to build a tree. Using this, one can generate a new sequence of character, which is translation of input or just do things on that data structure.&lt;br /&gt;&lt;br /&gt;A grammar (context free grammar, technically speaking) says what type of children a node can have. The leaves of tree cannot have any nodes under them and they directly correspond to the characters in the input. Looking at the input, we try to construct a tree which complies with the rules declared by grammar. If only one such tree can be made for any valid input, then the grammar is called unambiguous.&lt;br /&gt;&lt;br /&gt;To construct the tree, we have many choices for selecting nodes, which can lead to the leaves to correspond to the input sequence seen so far. If we try to construct it from leaves, it is called bottom up approach. This approach usually uses a method of construction called LR parsing. If we attempt to build the tree top-down, the method usually used is called LL parsing.&lt;br /&gt;&lt;br /&gt;Now let us discuss about the free tools that we have at our hand. Given a grammar and instructions on what to do with various nodes, these tools generate a parser.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.antlr.org/&quot;&gt;ANTLR&lt;/a&gt; is derived from good old C/C++ &lt;a href=&quot;http://www.polhode.com/pccts.html&quot;&gt;PCCTS&lt;/a&gt; tool. Antlr has lots of features and can generate the parser in Java or C/C++. It uses top down approach to parsing.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;https://javacc.dev.java.net/&quot;&gt;JavaCC&lt;/a&gt; is a tool used in many applications, which is much like antlr, with few features different here and there. However, it just generates Java code.&lt;br /&gt;&lt;br /&gt;The top down parser generators mentioned also support predicates, using which you can try to &#39;peep&#39; in upcoming input. This is against the rules of game of context free parsing, but convenient in practice.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://sablecc.org/&quot;&gt;SableCC&lt;/a&gt; is a bottom up parser, which takes an unconventional and interesting approach of using object oriented methodology for constructing parsers. This results in easy to maintain code for generated parser. However, there are some performance issues at this point of time. It generates output in both C++ and Java&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.gnu.org/software/bison/bison.html&quot;&gt;GNU Bison&lt;/a&gt; is classical bottom up parser. It generates C language output. It has been the standard tool on many unix operating system distributions. Now, it has also acquired the capability of parsing grammars with GLR method. It&#39;s implementation of it is not the best around, but we may have a look at lesser used parsing methods some other time.&lt;br /&gt;&lt;br /&gt;There is a plethora of such tools. refer to &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_compiler-compilers&quot;&gt;Wikipedia - compiler compilers&lt;/a&gt; for details.</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/114400168545642688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2006/04/parser-generators-antlr-sablecc-javacc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/114400168545642688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/114400168545642688'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2006/04/parser-generators-antlr-sablecc-javacc.html' title='Parser generators : ANTLR, SableCC, JavaCC, bison at a glance.'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-24632729.post-114368226840577230</id><published>2006-03-30T06:01:00.001+05:30</published><updated>2008-04-21T02:31:31.252+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dissert"/><title type='text'>Parsing C++ Source Code: An overview of available tools</title><content type='html'>C++ is a popular programming language. On the other hand, compared to Java, there are few good programming tools available for C++. My favorite example is refactoring. Why should it be like that?&lt;br /&gt;&lt;br /&gt;It happens to be the case that C++ was not designed with these issues in mind and also, it carries some legacy from it&#39;s ancestor, C. Technically speaking, C++ cannot be accurately specified using a context free grammar. A context free grammar is a grammar in which you can look at only a part of the whole document, and can give a name to that part without looking at other parts. An unambiguous grammar is one in which you can give exactly one name to that part.&lt;br /&gt;&lt;br /&gt;Due to this, much hand-tinkering is required to write a C++ parser. However, many parsers take approach of accepting some source code which are not written in C++ and sort it out later in a second try called semantic pass. C++ has many dialects due to it&#39;s evolution and various compiler providers. These dialects differ from each other significantly.&lt;br /&gt;&lt;br /&gt;If one can spend some money, there is a respected product which can parse C++ very accurately and also help you building tools on it. It can be found at: &lt;a href=&quot;http://www.edg.com/&quot;&gt;http://www.edg.com/ &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For free options, there are basically three approaches. First is to start from scratch and write a grammar (or use someone elses). There is a C++ grammar written by Edward D. Willink for his &lt;a href=&quot;http://www.computing.surrey.ac.uk/research/dsrg/fog/&quot;&gt;FOG&lt;/a&gt; . The thesis also contains good account of issues in the C++ grammar. The popular antlr parser generator also claims a C++ grammar which is updated from old PCCTS based grammar.&lt;br /&gt;&lt;br /&gt;The second option is to use a parser tool that generates some type of intermediate representation which is easy to process programmatically. The noteworthy here is elsa. It is a C++ parser built using a special parser generator called elkhound.  It can be found at &lt;a href=&quot;http://www.cs.berkeley.edu/%7Esmcpeak/elkhound/&quot;&gt;Elkhound and Elsa&lt;/a&gt; site.&lt;br /&gt;&lt;br /&gt;The last approach is to let compiler do the job! Prominent example is the modified C++ frontend for &lt;a href=&quot;http://llvm.org/&quot;&gt;LLVM&lt;/a&gt; project, which translates the C++ code to bytecode and then provides infrastructure to write processing of this bytecode.&lt;br /&gt;&lt;br /&gt;Apart from these, there are parsers coded for IDEs like &lt;a href=&quot;http://www.eclipse.org/cdt&quot;&gt;Eclipse&lt;/a&gt;  &lt;a href=&quot;http://www.kdevelop.org/&quot;&gt;KDevelop&lt;/a&gt;, &lt;a href=&quot;http://anjuta.sourceforge.net/&quot;&gt;Anjuta&lt;/a&gt; etc. These are usually heuristics-driven, meaning that they would make some educated guesses when required to make analysis efficient.&lt;br /&gt;&lt;br /&gt;One often forgotten pragmatic difficulty is the pre-processing of source. The first two approaches most of the time takes for granted preprocessed code.&lt;br /&gt;&lt;br /&gt;These issues make parsing C++ code difficult and hinder the development of tools for C++ source code.</content><link rel='replies' type='application/atom+xml' href='http://keymark.blogspot.com/feeds/114368226840577230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://keymark.blogspot.com/2006/03/parsing-c-source-code-overview-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/114368226840577230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/24632729/posts/default/114368226840577230'/><link rel='alternate' type='text/html' href='http://keymark.blogspot.com/2006/03/parsing-c-source-code-overview-of.html' title='Parsing C++ Source Code: An overview of available tools'/><author><name>Pratik Mehta</name><uri>http://www.blogger.com/profile/09266796944430290645</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>