Calculate Age from DoB (Date of Birth)

When the date of birth (DOB) is available it looks very straightforward to calculate age programmatically, but it isn't always accurate due to the complexity of handling leap years. Advanced programming languages also don't provide relevant functionality out-of-the-box because of many variations in logic available on the internet. Deviation in calculating age also gets impacted due to the difference in timezone between the client machine and application server.

The easiest method to accurately calculate the age without worrying about leap years is explained below:

Age = First 3 bytes of the result obtained by subtracting DOB from Today's date.

Example 1: If an employee's DOB is 11th May 2000 (20000511) and Today's date is 11th May 2018 (20180511) then Age is 18.

Calculation is 2180511 - 2000511 = 0180000

Example 2: If an employee's DOB is 15th May 2000 (20000515) and Today's date if 14th May 2018 (20180514) then Age is 17.

Calculation is 2180514 - 2000515 = 0179999

Example 3: If an employee's DOB is 12th May 1998 (19980512) and Today's date if 16th May 2018 (20180516) then Age is 19.

Calculation is 2180516 - 1980512 = 200004

Modify email files arriving into SMTP server

When you send any email it arrives into Pickup folder of SMTP server in the form of .eml file. SMTP server continuously monitor Pickup folder for any incoming file. If any file is available, then it is read and checks its integrity.

If the format of .eml is incorrect then it is sent to BadFiles folder, otherwise it is sent to Queue folder from where SMTP forwards email to specified recipients.

If there a requirement to modify recipients, subject or content of the email after it arrives to SMTP server, then it can be achieved using different mechanism:

SMTP server rules:
You can create rules in SMTP server to modify email before forwarding to recipients.

Create macros:
Macros are very powerful scripts that can read the content of .eml files. They can be written in VB Script (.vbs file) which can read each incoming .eml file within Pickup folder and process as needed.

Socket programming:
Write a code based on socket programming or HTTP pipeline that picks the inflow of content to SMTP server.

Merge, Compress or Convert documents to PDF

Merge, Compress or Convert documents to PDF
We frequently come across the need to merge multiple documents into one document or convert image to PDF document. Even there are requirements to compress large PDF document without losing their quality. Though these are basic requirements in our day-to-day life but are not freely provided out-of-the-box by Adobe Reader.

Here are some of the fantastic websites that swiftly merge, compress or convert any document to a PDF file:

http://jpg2pdf.com - Merge multiple images into a single PDF document and share with others. There is no limit in file size, no registration and no watermark. This service automatically rotates, optimizes and scales down images, but retains the original resolution.

http://combinepdf.com - Merge multiple PDF documents into a single PDF document without installing any software.

http://pdfcompressor.com - Compress PDF files for publishing on web pages, sharing in social networks or sending by email. Unlike other services this tool doesn't change the DPI, thus keeping your documents printable and zoomable.

http://topdf.com - Instantly convert text documents, presentations, spreadsheets and images to PDF format with this free online PDF converter.

How to buy cryptocurrencies in India?

Several virtual currencies are available in the market for years, but they have recently gained much popularity in India. The main reason behind this increased attraction towards cryptocurrencies is a sudden spike in their price which raised public eyeballs all over the world. 

Bitcoin is the most popular virtual currency that came in highlights when it surged from $1000 to $19000 within just one year.


Bitcoin

Multiple platforms are operating in India through which you can buy or sell cryptocurrencies. A platform having the facility to trade more than one cryptocurrency is also referred to as a currency exchange. This is similar to the stock exchange where you can buy or sell various stocks. The stocks are stored in a Demat account, similarly, cryptocurrencies are stored in currency wallets.

Buying any cryptocurrency like bitcoin, ethereum, ripple, etc. can seem a little scary for the first time but it is just as simple as registering in any shopping cart, authenticating the registration and placing a new order. Follow these four simple steps to accomplish this:
  1. Find a cryptocurrency wallet provided by portals like Zebpay, Unocoin, Ethx, Koinex, etc.
  2. Create an account within the selected portal and complete KYC.
  3. Transfer fund from your linked bank account.
  4. Place order to buy cryptocurrency.


Cryptocurrencies

These wallets offer referral programs through which users gain a small percentage of cryptocurrency as a welcome bonus on registering to their platform. To register to these platforms use the referral links available here:
  • Zebpay and UnoCoin are two popular mobile apps that can be used to buy or sell bitcoins using Indian rupees of your bank account.
  • Ethx.in website can be used to buy ethereum at a cheaper rate.
  • Koinex.in can be used to buy bitcoin, ethereum, ripple, litecoin and bitcoin cash.
  • Sragy.com can be used to buy ethereum, ethereum classic, ripple, litecoin, dash and iota.
  • BuyUcoin.com can be used to buy various cryptocurrencies.


The new concept of the crypto community platform is also catching public interest nowadays due to their commitment to very high monthly returns from either lending, staking, mining or trading of tokens provided by them. A detailed analysis should be done before investing in such community platforms.

Few crypto community platforms that are growing at a faster pace are shared below:
  • Crypterium - digital crypto-bank with credit subtoken and open platform
  • Storiqa - a crypto marketplace that connects one million offline stores worldwide.