Category Archives: Software Development

array_merge behaving differently on 32-bit and 64-bit architecture

PHP has a large number of functions one of which commonly used is array_merge. It basically merges 'n' number of arrays. We have used it quite often in my code and found out that it does not preserve keys when moved from 32-bit architecture to 64-bit. Let's figure out why this happened ? Recently We moved our ubuntu servers from 32-bit to 64-bit. Then suddenly some of arrays started losing their indexes which were working on previous server. Then we figured out it was an issue with array_merge. Code was using big numbers as indexes in multiple arrays which needs to be merged. Here... Read More

Agile : Retrospective

Retrospective : (Dictionary meaning) the action of looking back on or reviewing past events or situations, especially those in one's own life.   Let us start with a very simple example. Say someone is trying to lose weight for last 6 months and nothing works out for her. Then her friend suggests that running 3 miles/day for a month will do the trick. So she started running as suggested. Now should she keep on running for months or observe the results for the activity for last one month?   If your answer lies in second half of the question Welcome to agile Retrospective.   In... Read More

Restful WebServices (Microservices) in Phalcon Framework

About Phalcon:   Phalcon is a full-stack framework. It promotes the MVC architecture and offers features like an ORM, a Request object library, a templating engine, caching, pagination. In short Phalcon: Is a PHP C-extension based framework. Is a C-Extensions are loaded together with PHP one time on the web server’s daemon start process Is a classes and functions provided by the extension are ready to use for any application Is a the code is compiled and isn’t interpreted because is already compiled to a specific platform and processor   The preliminary... Read More

How naukri made pages faster using PUSH STATE API

Some time back, here at Naukri we had a scenario: There were three pages with almost similar structure, a common navigation bar, a common right widget and a common footer (all summing upto 90% content of the page), with only few different descriptive lines(only 10% of the total content on the page) . The general requirements of the pages were: SEO was important for all of them All of them had to be assigned to different urls , title and meta tags The pages had to be bookmarkable and their urls could be shared. This may sound very simple, but… The challenge was Just... Read More

Using php constants and static functions directly in smarty template of Symfony2

The Symfony Framework is well-known for being really flexible and is used to build micro-sites, enterprise applications that handle billions of connections and even as the basis for other frameworks. Some time back we started using Symfony2 for our new projects. Symfony2 comes with twig as the default templating engine but we chose to use smarty as the templating engine using the SmartyBundle of Symfony2. Smarty is great, but for maintainability reasons, they have deprecated the possibility of adding php tags in the template. This means we will not be able to use php class constants... Read More

Career Timeline

What is the most important thing a recruiter looks into a Resume? The answer is past employments and experience of the candidate. Challenges It’s painful for the recruiters to look at the past employments of a jobseeker as he needs to scroll down and find the work experience section of the resume preview page. During project revamp, we took the challenge to build a feature which will help recruiters to look at employment details without spending much time. Solution Why not show the entire career of the jobseeker graphically in a single line and place it strategically in the CV... Read More

Better Practices in PHP – Speed up your code

“There's ALWAYS a way to fix something.” --Steven Wolff And when you are using PHP, there are multiple ways to fix something. What we need to determine is, that which way is the best. Computation is not like solving a maths problem, where simplicity can be determined by the number of lines. Computation requires resources, for example CPU Cycles and memory. Now when we have got multiple ways to solve a problem, we need to think in terms of computation and how much resources it will take. The objective is to accomplish the task in minimal number of steps, but different functions in... Read More

Measuring Non User Initiated Events in Android Apps

We use Google Analytics to measure events like button clicks and generation of notifications etc... in our apps. With the help of this data we get to know how people are using our product, which enables us to identify areas of improvement and maximize the success of product in market.  Post publishing a version of the android app, we saw a spike in both the number of active users and sessions (in Google Analytics). However, at the same time we witnessed a decrease in the screen views/session. On investigating further, we found that since we are logging (in Google Analytics) some events... Read More

Parse Emails in PHP

Problem statement : 1.Extracting information from emails in PHP (eg-attachments), 2. Simulating a daemon using PHP. Extracting information from emails in PHP Email Protocols Popular protocols for retrieving mail include POP3 and IMAP4, sending mail is usually done using the SMTP protocol.Another important standard supported by most email clients is MIME, which is used to send binary file email attachments. Attachments are files that are not part of the email proper, but are sent with the email. In computing, the Post Office Protocol (POP) is an application-layer Internet standard... Read More