Thursday, December 22, 2016

Enabling VoLTE in Redmi 3S

I bought Redmi 3S recently.Though it is a VoLTE enabled handset,the signal is not shown. So on inserting the Jio Sim card, i couldn't see the VoLTE signal. To overcome this here's a small tweak : Go to Settings -> Sim cards and mobile networks -> Here you will find the sim cards 1 and 2 Go to the specific sim card where there is Jio Sim Next go to Access point names . Here you need to add a new APN with name as Jio 4G and APN as jionet Next go to more and save the settings. The APN will reset. You should be able to see the VolTE/HD sign now. If not, try changing the Access Point to something else and again switch back to the newly set Access Point. Voila! the VoLTE should be back.

It may happen that after this even if u disable mobile data it may not be disabled. So for that you need to go to the network settings as mentioned above and Restore default APN . Now you should have a working VoLTE as well as internet.

All the best.

Sunday, December 9, 2012

Digits/Life of PI

Well this post comes mainly after watching Life of Pi and being inspired by it. I always wanted to solve this problem PIVAL but never quiet got the kick untill watching the movie.

Till date about 10 million digits of PI have been successfully known. I started with Machin's Machin's formula which gives correct values till 100 decimal places. Then i came upon this formula by Chudnovsky which helped me to calculate around 35000 digits of PI within the time limit specified (~25 secs). On applying binary splitting and a customized square root function (Newton's method) i was able to improve to 37000. Hope to increase more and in search of better results.

Saturday, October 6, 2012

Modifying the Euler Totient Funtion

Hi All, Came across an interesting problem and thought of sharing it. Most would know about the ETF , which basically helps one to count the number of integers co-prime and less than N . However to get the count of integers which are co-prime to N but less than a specified limit (say M <= N ) is not so common.

At first i thought of modifying the ETF calculation ETF calculation by initialising result to m . The results were 'almost' accurate but not correct. So as a turnaround , i got a different approach. We can factorise N and then from M do an inclusion-exclusion principle on the factors of N . i.e say the factors of N are p1,p2, . Then the required solution would be : M - sum(M/pi) (1<=i<=k) + sum(M/pi*pj) - ..sum(M/pi*pj*

Though i had got the result but coding it was the next challenge. 1. First step was easy as it involved just factoring N . (O(sqrt(N)))
2. Next we had to get all combinations of the factors, in other words all the subsets. This can be done by bitmask technique, i.e consider binary representation of integers and if the ith bit is set then the integer is in the set . We can store each subset in a vector and then based on the size of the subset calculate the denominator with appropriate sign!
3. Thus we can calculate the answer perfectly. :)

Hope it was useful. Finally a post after almost 6 months.Been really busy , specially after getting into this corporate world.

Sunday, March 4, 2012

A tutorial on trees

I came across this site eternally confuzzled which seems really good on data structures, specially trees and thought of sharing it..Hope it's useful :)

Monday, December 12, 2011

divisibility by 7

Hi, recently i came across a problem where it was required to check if a number is divisible by 7 . Though quiet an elementary task, i think its not very commonly known. This is what i found.
Test 1:
Reverse the number . Mulitply each digit of this reversed number by the digits 1(=1%7),3(=10%7),2(=100%7),6(=1000%7),4(=10000%7),5(=100000%7) consequtively till all digits are covered. Sum the products. If this value is divisible by 7 then the original number is too.
Actually these numbers are the cyclic remainders of division by 7.
Test 2:
Take the last digit of the number and subtract it from the number formed by the remaining digits.If this value is divisible by 7 then the original number is too. We can do it recursively to reduce the number .

Hope that helps.

Thursday, October 20, 2011


Hi, recently came across an article which through some questions, has great explanation of pointers . They show that arrays are not pointers which is common pitfall.
Here's the link:
Njoy reading. :)

Tuesday, October 18, 2011

Adding Javadoc of a jar in eclipse

Hi, recently i was facing with this problem of how to add the javadoc files of a jar in eclipse. I used netbeans earlier in which it was a simple process but here its not so straightforward.
First go to configure build-path of the project and select the jar in libraries tab. On expanding the jar file add the javadoc location to it and you'r done.
Hope its hopeful.