Most developers use cache in their application code. But only few developers know advanced patterns such as Read Through Cache. In this article, we will explain the default way of using the cache and compare it with other advanced patterns, especially Read Through Cache.

Cache Aside Model

Request data from the cache using a key. If cache has the data, return it to the caller immediately.…

Read More

Good code is reusable, maintainable, scalable and performs well.

Reusability

There is a popular maxim:

When in hurry, copy-paste. And later refactor.

When we think reusability, we think about reusable components or reusable packages.Some sort of utility. Which can be reused all over. But reusability is much more than that. If two methods look similar, create another method. Call the third method for each of the two methods.…

Read More

Playing audio in an iOS app consists of two steps:

  1. Creating an Audio session using AVAudioSession class.
  2. Playing the audio using Audio player using AVAudioPlayer class.

AVAudioSession

We want to play audio in apps even though the background music is running. For that, create a shared audio session. The code for initializing a shared session is shown below.

-(void)initAudio
{
    NSError *error;
    
    [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
    BOOL success = [[AVAudioSession sharedInstance] setActive: YES error: &error];
    if(!success)
Read More

There are SEO problems while using frameworks like KnockoutJS or AngularJS or ReactJS. The page loads, then javascript loads. JavaScript renders the HTML elements. Web crawlers of today do not execute the JavaScript. So, the page content is often missing or incorrect. Hence, the SEO suffers.

Update (Sep 2017): Search engines, especially Google, runs the JavaScript. SEO has improved for JavaScript frameworks.…

Read More

Microsoft FAST Search for SharePoint provides enterprise search and information retrieval capabilities. FAST provides a API to query documents indexed in the server. The API is available in a proprietary assembly, Esp-SearchApi.

We will write a simple program to perform a search. We use the following namespaces.

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using Com.FastSearch.Esp.Search.Http;
using Com.FastSearch.Esp.Search.Result;
Read More

Knockout is a UI framework for building single page apps. In Knockout, observable and observableArray are two basic functions. Observable enables two-way binding between the UI and the data in View Model.

ObservableArray stores a collection of View Models. When a View Model is added or removed from the array, the bindings are re-evaluated. And the UI is re-rendered. Most of the array operations are supported.…

Read More

Knockout.js is a good framework for building single page applications. But, it has a few drawbacks. But before going over the drawbacks, we will discuss the problem that it solves.

Too many View Models

With Knockout.js, we create a View Model. Then bind the View Model to the HTML elements. Whenever the data within the View Model changes, the framework updates the view or HTML elements.…

Read More