Saturday, January 5, 2019

Poco Phone F1 - Moving from Motorola to Mi

I have been using Motorola Android phones for a while now. Moto G, Moto X Play, Moto G 4 Plus, Moto G5 S Plus, Moto E and So on. They are not only considered to be the robust phone but also they run stock Android OS. It was part of Google and Nexus series for a while. However recently I gave up on them because of their camera. Even today they don't have a good phone with camera comparable with other phones in the same price range.

I bought the Poco Phone F1 recently and it has a really good camera comparable to the flagship phones like One Plus, Samsung Galaxy S* etc. Initially I was skeptical about the Xiomi phones because they were new, cheap and it is a Chinese company but I changed my opinion after hearing from friends who have been using the same Xiomi Mi phones since more than 2 years and have excellent photos from its camera for half of the price you pay for flagship phones. Poco was there best phone so far from the specification wise (probably except Mi Mix).

Here are the good things I found after switching from Moto G series phones.
  1. Poco F1 has pretty much all sensors that Moto G silently compromises. Moto phones did not have the gyro and compass sensors which were a problem while watching VR and using stargazing apps.
  2. Excellent camera, no grain. good night light photos.
  3. Face unlock (even in dark) yay!
  4. Snapdragon 845 processor and 6 GB of ram, I am not expecting it to slow down when I install a lot of apps.   
  5. The battery is long lasting.
What am I missing?
  1. Because of the notch, I miss out on a lot of notifications after they arrive in the top bar. Even Bluetooth connected or not, you have to slide down.
  2. No front flash, the bright screen does not make a lot of light.
  3. No shake to turn on flashlight or launch camera. (I had to set the flashlight on double press power button gesture)
  4. No NFC! 
  5.  It's USB C-Type. All my chargers and cables at home are micro-USB. I bought some cheap adapters.
  6. Google Now in the left to the home screen. (I found a workaround - Install Nova launcher and a companion pack)
Maybe the bad points are just about getting used to. 

Yi 4K Action Camera

This is probably one of the first reviews I have ever written. You would find a lot of content about gadgets in youtube (with so many tech channels these days) but the only problem I have with that is I can not skim-through the video content just to see if there anything relevant that I need to know. I need to see/hear the full specifications and comparison what the video has to say. With this post (and possibly a series of posts with other gadgets that I own ) I am trying to have some notes that are usually not in the Amazon listing or manual or any overall review videos.

Yi 4K Action Camera one of the affordable action camera. Following are the observation.
  • The build quality is really good and quite compact.
  • The time lapse works great, here is a sample. This is the most detailed version i.e. one frame per 0.5 seconds. For slow moving scenes like the cloud or sea, one can use even slower settings like one frame per 10 seconds and beyond.
  • I also tested for the other extreme - slow motion. It highest setting that it has is 8x slower and I compared the slo-mo of a fast moving ceiling fan shot by this action camera and POCO phone F1, video from this one looked better.

  • It has a really wide angle field of view which sets action cameras apart from the mobile cameras.
I am happy with most of the things with the camera, except
  • The wifi works for AP mode where you can connect your phone to the camera via wifi bit the station mode does not work. Neither I could get any documentation what is it supposed to do.
  • You may have to spend extra on accessories like waterproof cover, tripod, remote etc. (The voice action vacation is cool tough if you don't want to use a remote.)
Update -

I thought it's worth mentioning the following couple of tools which I found out while creating this post.

1 - Online video editor -  I could crop and resize videos using

2. Using FFmpeg I could stitch the slo-mo videos in command line itself to show them side by side. Thanks to StackExchange.

ffmpeg \
  -i input1.mp4 \
  -i input2.mp4 \
  -filter_complex '[0:v]pad=iw*2:ih[int];[int][1:v]overlay=W/2:0[vid]' \
  -map [vid] \
  -c:v libx264 \
  -crf 23 \
  -preset veryfast \

Monday, November 12, 2018

Free Tier Serverless Cloud Platforms

Last week I was trying to write an Amazon Alexa Skills (Earlier I had created Google Assitant App using dialogue flow ) and found creating Alexa app was not as intuitive as dialogue flow as a beginner. Probably it's just the UI/UX. There are much more incentives of creating Google assistant apps as it can be accessed via android phones right from your lock screen as opposed to Alexa skills which you need to use the echo devices or Alexa app on phone and keep it running in the background.

Nevertheless I needed a service endpoint which would feed data to my Alexa app and the recommended way was to have an AWS lambda function, however, you could also put any public endpoint URL of your own. I recently did a lot of work on Google Cloud Function so I opted for it. Tough the network latency may be marginally more because now Amazon data centre needs to talk to Google data centre. But the difference was smaller when compared to my home internet connection's latency to cloud. is a great tool to know your nearest GCP zone where you can deploy your services if the userbase is around your location. For me of course it was Mumbai which is one of the recent data centre of Google Cloud Platform.

Google Cloud Functions Free tier.

The factor that outweighed the latency factor was a free tier. Since it was a side project I had to run it for free as long as possible. I found Google Cloud Function's free tier quota is twice as much as AWSs for the same memory and network quota. Cloud functions offered first 2 million invocations free while both  AWS lambda and Azure functions had only 1 million free calls per month. In fact, Azure charges you for the storage that is used for staging the code file. I remember Cloud functions used to ask for a storage bucket for the same but in the recent version, they have made this process transparent to the user and just give you the location where it uploads internally.  Cloud Functions tough limited to only a few languages was pretty good for me. One good thing about the serverless platform is you are charged only when it is invoked, there is no VM running that you have to pay for even if no one is using it, which is the case for new projects as you never know if users are going come or not. I am sure I did not take all factors into consideration so I put this question our for experts

Google Developer Expert Romin has some valid points about it.

One can also use firebase functions' spark plan if you don't have any outbound calls outside Google's network.

Tuesday, October 30, 2018

GDG Devfest 2018 Hyderabad

It was the 7th year in a row Google Developers Group hosted their flagship event devfest in Hyderabad. This time it was big because it was not only a 2-day event with dedicated days for sessions and codelab/workshops, but also it accommodated more than 600 developers including professionals and students.

Workshop - Google Cloud Functions with Node.js (No, I am not playing Guitar here :) )

Lately, I have been working on Google Cloud Functions at work as it went GA during the GCP Next'18 earlier this year. I decided to submit a proposal around the same for this event. Slides and Code Lab instructions. 

While the proposal was accepted by the committee, it was moved to code lab instead of a session as it was more of a hands-on session and not much advanced for someone not who have not done cloud functions earlier.  While I was preparing the steps which I will ask participants to follow during the workshop, I realized there was a big problem in terms of GCP projects. Cloud Functions requires a GCP project which is billing enabled although it is free up to a few millions of invocation and enabling billing for GCP projects needs a credit card. I could not really expect participants to punch in their credit card number for the project they were supposed to create to deploy their functions along with me.

I realised from Stackoverflow that Firebase functions have a tier in which it is free and you don't need a billing account for Firebase project. Firebase functions and Google Cloud Functions are similar except some differences in the syntax how you define the function. Both run  Node.js and confirm to ExpressJS request-response interfaces. It looked like I could not demo Firebase functions instead of Google Cloud Functions. While doing the POC I very soon realised that Firebase functions did not have the same tools for deploying locally or debugging that Google Cloud Functions. My main agenda was to demonstrate the full work flow including local testing, debugging, writing tests, deploying to cloud and debugging in the cloud. Some of these were not possible with Firebase Functions. I could not even use the emulator to deploy locally. Firebase has its own way of serving locally and it has an interactive shell instead of letting you put breakpoints like traditional debugging. That was a turn-off.

At this time I was determined there has to be a way to demo Google Cloud Functions and still let the audience deploy their code. It occurred to me that I could let people deploy their functions in my project itself exactly like what we do at work. We just give "Editor" role to the team members to various GCP projects so that they can view and edit resources. Also instead of giving every Google account/Gmail id, I decided to create a Google Group where people can just join and get access to my demo GCP project once I approve. I just had to add the Google Group Id to the project as "Editor" instead of adding individual ids which had to be sent by the user one by one.

Problem solved ! (Well, as long as no one abuses and my card gets charged ;) )

Now I could just focus on the content. So the idea was to write a simple node.js function which can be deployed to functions emulator locally and tested. This could also be debugged locally using VS Code or Chrome's Dev tools. Finally, it was supposed to be deployed in the cloud. Even in cloud stackdriver's debug snapshot could be used to inspect variables and log points could be used to add logs on the fly instead of having to re-deploy every time we try to debug an issue in production which is not reproducible locally. If this was not enough content I also had a plan to demo Google text to Speech api integration with it where one can provide the text, language and gender as the parameter to the HTTP endpoint and it could stream/download the audio file back.

The workshop finally went well, I was glad to see many people deploying their functions even before I did :). This was almost a miracle that more than 25 users signed up even after almost everyone missed the pre-requisite instructions that I had mentioned before the event. This has been a trend for all workshop that happened, participants did not go through the pre-requisite for none of them. It's very difficult to conduct code lab if the majority of the time goes on setting up!

Ok, enough about me. This time I also got an opportunity to contribute to the organizing team of the event. I was overwhelmed by the energy and passion that I saw in other organizers and volunteers (some of them were just new faces and contributing for the first time). The team really pulled off some amazing sponsorship and pretty much everything went as per plan if not better.

One challenge that has been always there is the fact that not all registrations could not be accomodated in the event. More than 1800 registrations were received but only 600 could be acceopted due to space contraint. It could really be unfortunate for people who wanted to be part of the event and community in general. But this event is not everything what GDG Hdyerabad community is all about. I really encourage people to watch out for GDG and GCDC meetups that happens all through the year.  Also subscribe to GDG and GCDC facebook and GDG, GCDC twitter handles for any related announcements and collaberate and network with other developers. See you next time.

Sunday, October 7, 2018

PyCon India 2018 Day 2

This post is a continuation of the post I wrote after the end of the first day. The 2nd day started with the keynote from Travis Oliphant who is well known for Python projects like NumPy, SciPy, Anaconda and many more popular libraries. It was one of the best keynotes I have heard in recent times. It not only had technical aspects of Python language development but also a lot if important challenges developers face as a human being. Starting from work-life balance to disagreements on mailing lists over decisions on python language. He gave a lot of insights and hope that anyone literally any one can contribute to the open source projects from his personal examples. The thing which stood out in his keynote was that unlike many other speakers he gave examples from real life events on every abstract point that he mentioned. His keynote motivated me a lot especially to write more, read more and communicate more as a developer.

The session by Anand S on cleaning up data was on.e of the best non-keynote session that I attended here. He seemed to be quite an experience speaker and the topic was quite interesting especially how they de-duplicated the constituency data all the way from 1951 since the first general election.

The conference of ended with an excellent keynote by Carol Willing, who has stunning 41 years of coding experience. She touched upon a lot of good attitudes that a developer should have in general and especially while contributing to Python community projects for a brighter future of Python language.

Overall it was a very well organized event at the best conference facility in the city. Thanks a lot for speakers for traveling all the way here to speak and of course goodies from sponsors (I don't have to buy T-shirts for the next 2 years :) ).

Lastly a great thanks to GDG Hyd and Google Developers for having me in this conference,, it was fun and enlightening.

Next, I am looking forward to Devfest 2018 by GDG Hyderabad on 27 and 28th of October. See you there.