Blogs


Fancybox2 to Fancybox3 for image gallery

I recently migrated my image gallery to Fancybox3 from Fancybox2. Fancybox3 has some of the advantages over its previous version. The important one I like is the fact that you have to code less.

  • Import the javascript
  • Wrap the images with class and the work is done.
  • It supports the image security too. Read on →

Distributed Computing - Quorum

In a distributed database system, a transaction could be executing its operations at multiple sites. Since atomicity requires every distributed transaction to be atomic, the transaction must have the same fate (commit or abort) at every site. In case of network partitioning, sites are partitioned and the partitions may not be able to communicate with each other. This is where a quorum-based technique comes in. The fundamental idea is that a transaction is executed if the majority of sites vote to execute it.

Quorum Consensus Protocol

This is one of the distributed lock manager based concurrency control protocol in distributed database systems. It works as follows;

  • The protocol assigns each site that have a replica with a weight.
  • For any data item, the protocol assigns a read quorum Qr and write quorum Qw. Here, Qr and Qw are two integers (sum of weights of some sites). And, these two integers are chosen according to the following conditions put together;

Qr + Qw > S - rule which avoids read-write conflict. (i.e, two transactions cannot read and write concurrently)

2 * Qw > S - rule which avoids write-write conflict. (i.e, two transactions cannot write concurrently)

Here, S is the total weight of all sites in which the data item replicated.

Read on →

Is Microsoft biased towards Linux

I see news about Microsoft crafted a switch OS on Debian Linux platform, announcing its SQL server of Linux and may be some more. Though this is a surprising news as Microsoft windows has released its best OS so far, which is more stable and fast compare to its ancestors, so what could be the reason to move towards Linux is a question. Is this related to the security aspect of the operating system or is it the open source nature of the platform and the community support it has or is it just the recent decision to move towards it ? Whatever it is, I see this as a strong move towards making its environment and platform more robust and performant.

Read on →

Memory Management in Python

I came across the interesting write up somewhere on website on memory management in Python. Here are some data facts which I liked,

Python allocates memory transparently, manages objects using a reference count system, and frees memory when an object’s reference count falls to zero. In theory, it’s swell. In practice, you need to know a few things about Python memory management to get a memory-efficient program running. One of the things you should know, or at least get a good feel about, is the sizes of basic Python objects. Another thing is how Python manages its memory internally.

So let us begin with the size of basic objects. In Python, there’s not a lot of primitive data types: there are ints, longs (an unlimited precision version of ints), floats (which are doubles), tuples, strings, lists, dictionaries, and classes.

Read on →

VMware Player and Hyper-V are not compatible

I run my VMs using vmware player for multiple operating system like Ubuntu, CentOS, Fedora, Suse, Mint Linux. One fine day I noticed this error “VMware Player and Hyper-V are not compatible” from the vmplayer while starting Ubuntu. This was bit surprising for me as I had run the same vm couple of times.

I realized that disabling the hyper-V could fix this problem, but I was still curious, as of why could this start all of sudden?

Read on →