76. Minimum Window Substring in Swift

Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string “”. The testcases will be generated such that the answer is unique. A substring is a contiguous sequence of characters within the string. Example 1: Input: s = “ADOBECODEBANC”, t = “ABC”

Continue Reading →

Largest Triple Products in Swift

Largest Triple Products You’re given a list of n integers arr[0..(n-1)]. You must compute a list output[0..(n-1)] such that, for each index i (between 0 and n-1, inclusive), output[i] is equal to the product of the three largest elements out of arr[0..i] (or equal to -1 if i < 2, as arr[0..i] then includes fewer

Continue Reading →

All the new features in iOS 11

Drag and drop In iOS 11 https://en.wikipedia.org/wiki/Apple_File_System app store multiple days / user reviews iOS 11 – 64bit only. 32 bit apps not supported anymore High sierra last release to support 32bit release Jan 2018 – 64bit only app store Xcode 9 is much faster Semantic highlight – useful for functions opening and closing braces

Continue Reading →

How to setup your project in Xcode to support multiple frameworks and sub-projects using XCCONFIGS?

If you have multiple targets use config files. This is the way to create them. Below is a sample of what you can specify in the config files. ARCHS = arm64 CLANG_CXX_LANGUAGE_STANDARD = gnu++98 CLANG_CXX_LIBRARY = libstdc++ LD_NO_PIE = NO OTHER_LDFLAGS = -Wl,-warn_compact_unwind HEADER_SEARCH_PATHS = ../code/ FRAMEWORK_SEARCH_PATHS = ../debug One of the things you can

Continue Reading →

ipps90legacy.h not found error

Goto https://software.intel.com/en-us/articles/intel-ipp-legacy-libraries and download the links for your OS. Then follow the installation text file inside the zipped file. The password is specified in the installation file. Once downloaded extract the headers and libs into the proper folder. e.g. /opt/intel/include…

Continue Reading →

Preprocessor macros and configuration

In your xcode settings, you might have seen the configurations as shown below: You can find the current configuration : xcodebuild -workspace test.xcworkspace -scheme “UXtests” -showBuildSettings You would use it in the code as follows : #ifdef TESTING // do something #endif But how would you apply the debug and testing configurations. These preprocessor statements

Continue Reading →

Testing guidelines

TEsting Guidelines Define API requirements. It is important to define requirements and outcomes for each method or function that you add to your project. For requirements, include input and output ranges, exceptions thrown and the conditions under which they are raised, and the type of values returned (especially if the values are instances of classes).

Continue Reading →

Testing page performance

Recently I was involved in a project, which involved converting all links from http to https, basically making the site SSL enabled. After we did the changes we needed to measure the performance of the pages. You can test this using a combination of techniques described here : a. Using chrome developer tools, you can

Continue Reading →

Wheel based dynamic filters

The treat app makes use of a wheel based selection menu. This is used for selecting occasions, photos and moods. I have tried to explain the reasoning behind the implementation of this, as shown below. If you want a sample implementation of this project its here: https://github.com/kmdarshan/wheel Below are some of the reasons, we had

Continue Reading →

Using Sprites

You would have probably learnt about using sprites from here http://www.w3schools.com/css/css_image_sprites.asp or somewhere else on the web. Many tutorials who have told you to use background positioning to position the sprite. This is somewhat correct, but you aren’t really thinking long term over here. If in the future, there is a change in the sprite generation

Continue Reading →

Create a timer using Web Workers/Javascript

If you don’t know about web workers learn them here: https://developer.mozilla.org/en-US/docs/Web/Guide/Performance/Using_web_workers Disclaimer: Might not follow strict coding standards, this is just a demo. This post basically shows how you can use webworkers to display a timer. For this I will be using the following files: a. index.php b. worker.js Inside your index.php, lets write some

Continue Reading →

cardinal rule of setting the .htaccess

my sample url => http://localhost/emp/api/v1/hello.json folder(emp) -> folder(api) -> folder(v1) -> method(hello.json) .htaccess file is placed in the folder V1 # Turn on the rewrite engine Options +FollowSymlinks RewriteEngine on # Request routing RewriteRule ^([a-zA-Z_-]*)\.(html|json|xml)?$ index.php?method=$1&format=$2 [nc,qsa] goto your httpd.conf file in your apache server : # AllowOverride controls what directives may be placed in

Continue Reading →