Thursday, December 22, 2016

Yay, consolidated links for free movies, shows & songs and live tv and more.

Hey guys, I have found many apps and sites/apps that provides access to free movies, series, songs and live tv and frankly speaking, I am done writing about each app one by one, so all in all I am writing this post with the links as well as apps that you can install in your Android to get going, so without further due lets gets started.

Android Apps:
  1. Terrarium TV 
  2. CartoonHd
  3. Showbox
  4. Showitme
  5. Popcorntime
  6. cinemaboxhd
  7. newestmovieshd
  8. aphim app
Websites for movies
  1. xmovies8.tv
  2. fmovies.me
  3. 123movies.is
  4. vumoo.li
  5. watchfree.to
  6. yesmovies.to
  7. projectwatchseries.com
  8. cmovieshd.com
Websites/Apps for songs
  1. freehindisongs.in(hindi)(Website)
  2. 123music.co(English)(Website)
  3. xtunes (English/Hindi)(App)
  4. fildo(English)(App)
Live TV Streaming Apps
Websites/Apps to download free apps
  1. Aptoide (Website/App)
  2. AppVn (Website/App)
  3. mob.org(Website)
  4. blackmart(App)
The list above is just a set of some of the sites/apps that provides you the free content. The installation of all the apps are possible only if you enable the installation from Unknown Sources under Security tab in your Android Phone. So make sure that you enable the same before doing the installation of any of the apps. 

Going forward I will tell you one more interesting stuff of downloading the videos from the above websites just by installing one app and that app will give you the link of all the videos that runs inside itself. So here we go.

The apps are AdBlocker Browser that can be found here and ADM that can be found here. Adblocker is important to surf the net without advs and ADM is like an IDM (Internet Download Manager) for Android. After installing these apps open any website with the video in Adblocker, and once the video starts playing, keep a finger over the video it will show you the popup to save/share the video. Now here is the hook, other apps like chrome browser/opera browser also supports the downloading of videos from the app, but they starts downloading in the default downloader that comes with Android. But that downloader is a bit slower in terms of download speed. So for that speed only we have installed ADM. Now once you get the popup click share button and share it via ADM. At this step ADM will get the link and you can start the download with quite a high speed just like IDM in PC

Attached the snapshots of AdBlocker and ADM collaboration. Please check them out and as always Happy Coding.
:)




DISCLAIMER: This post is for informational purposes and I don't owe or is related with any of the above apps. Also I don't promote these apps. So its your personal decision of installing or using these apps.

Tuesday, December 20, 2016

CartoonHd, another app to get free movies and series

Hey guys, I am back with one more app that gives you chance to download and watch free movies and series in HD format and the name is CartoonHd.

CartoonHd has the website as well as an android app. The website can be found here and the app can be found here.

As usual you can't find this app in the play store for obvious reasons and so you have to enable Installation From Unknown Sources before installing the apk.

Now once the apk is installed you can open the app and search for any movie/series of your choice and it will return you the link which can either be streamed or downloaded in different resolutions.

Here are the screens of the app and it is pretty easy to use.

First screen is the home page of the app, second is the search screen and third is the screen that will give you the links to view the episodes of the searched series. I searched for flash and I found the episodes of the series.




This app is a descent app if you want to view the series and movies directly from the internet, or in-fact you can download the same if you want to view them afterwards.

I hope you guys have might have enjoyed the review of the app, so give a thumbs up, and Happy coding :)


Monday, December 19, 2016

FileChef, Download anything for free

Filechef, downloading anything for free. This program is not a program that hosts anything rather it creates a google query and that query itself is good enough to go deep in to servers of Google to return you best possible searches to get the direct links to the files.

DESCRIPTION

FileChef is basically a program that gives you direct links to the files that are available on the net. Although the searches are not to be 100% working but gives pretty descent links and since they are direct links you need not to worry about torrents illegality or anything like that. There is a website and an app named Filechef. The website is available here and the app can be downloaded from the play store here.

DOWNLOAD

Coming to downloading of the app, since the app is available in the play store so you can download it directly from the playstore and installs it in the mobile.

INSTALLATION & APP SCREENS

Installation is straight forward and one opening of the app, there is a section available that lets you choose the type of the file you want to download like software, movie, app, book etc and a text box to give your search query. After that press the search icon and boom it will open a web page with the query formed on the basis of options you gave and the page will have the google search. You can open any link the same way you search something else in the google.

Place your search query and enjoy.

I hope you guys might have liked the app. So enjoy it and Happy Coding :)

Aptoide, playstore to have free apps

Hey Guys, today we will talk about an app named Aptoide. This app is actually a play store to give you access to many of the paid apps for free. And again you guessed it right, you can't find this on play store due to obvious reasons.

Lets break this post in following:

  1. Description
  2. Download
  3. Installation
  4. App Screens
DESCRIPTION

    As I already told you all that this app is basically a play store that offers many paid apps of Google Play Store for free. Now you may ask what about the authenticity of the app that will be downloaded then I can tell you that Aptoide servers have the inbuilt security to scan all the apps that are posted by any user and the app should go through from a number of tests to make sure that app is clean and is ready to be used.

The app itself comes as an APK as well as have the website.

DOWNLOAD & INSTALLATION

    You can find the website here  and find the android app here

Create a free account in Aptoide and after installing the apk in the phone, login with the same credentials you have created an account with. The installation is straight forward after you enable the installation from Unknown Sources.

Now after login you can search for any app and checks for the authenticity of the app by looking at the top right corner in both android app and website. If the sign says INSTALL with GREEN color, you are good to go. (Please see the app screens for more info.)

APP SCREENS


For Zooper Widget pro, you are seeing that TRUSTED (Green) icon so, that means this app can be installed without a worry. Now since it is already installed in my mobile that's why it is saying OPEN. But for you it will show INSTALL in case you don't have the app installed.

If you have the rooted phone then you might give the app SU access and by giving that it is able to install the apps automatically without you being clicking on INSTALL for every app, same as normal APK you downloads and INSTALLS .

Also if you see this same app in Play store here you will see that the app costs Rs. 185.00 /-. So enjoy the app and install some apps free for your testing.

Note: I don't support this app, this post is just for the informational purposes.

Enjoy the app and Happy Coding, :).



Sunday, December 18, 2016

Mobdro, free live channel streaming

Hey Guys I am back with a new App named Mobdro.

Lets break out this post in following parameters:

  1. Description
  2. Download
  3. Installation
  4. App Screens

DESCRIPTION

    This app is very useful for bachelors, who don't want to spend the money on Tata Sky, Airtel DTH and like that to view the channels, whether it is a match or whether it is a reality show. Now coming to this there is still a chance of viewing the series after they are broad-casted (by the channels) by searching the recorded cast. Now for those who want to view the series or anything live and that too without spending the penny on DTH services, there is a hope for them named Mobdro. This app lets you stream many channels(National as well international) live and that too with pretty descent quality which mainly depends on the speed of the internet.

DOWNLOAD

    As you guys have already guessed it, that this app can't be founded in the play store due to pretty obvious reasons and that is sharing a live content for free. You know play store is like a great enemy of free content (:P). So coming to the downloading of the apk, then the app can be downloaded from the direct lik here, and the site for the same can be found here.

Also since the app is not there in the play store you have to enable Unknown Sources, in the 
Security And Installation tab in Settings.

INSTALLATION

    Installation is pretty straight forward and you just have to follow the on screens instructions to get the app installed, and when it comes to the permission access the app asks for 3 permissions (by the time I was writing the post) named Contact, Storage and Location. And out of these 3 I had given only storage and denied other 2. And even after the denial of those 2 services the app is running perfectly fine.

SCREENSHOTS

    This app is really simple and useful in the things it offers. There are different categories of channels and depending on your choice you can choose the category respectively. There is a section of showing the recent channels you viewed as well. As soon as you click your choice, the chosen Channels starts streaming after which you can either start casting it on the TV if your TV supports or you can just keep seeing the channels in Mobile itself. Here is the simple screenshot for the app.


Enjoy the live streaming of the Channels and let me know in case of any discrepancy.

Disclaimer: This post is purely for educational purposes. I am not at all related to any of the apps explained in this article. Also, I am not responsible in case of Phone Damage or Data theft, caused by any of the apps explained above.


Happy Coding :) 

Monday, December 12, 2016

Fildo, get me and get all the songs free

Yeah yeah, I know, I am pretty late, infact too much late in writing this, but since since we can't change that so lets get started with the new app named Fildo.

Lets break out this app in following parameters:

  1. Description
  2. Download
  3. Installation
  4. App Screens

DESCRIPTION

    This app is useful if you are a musical guy, if you want to get the mp3's of English songs and don't want to spend your bandwidth again and again in listening those songs from online music services like Gaana, Saavna and many more. This app lets you download the English songs and that too in MP3 version so that you can listen them in any player of your choice


DOWNLOAD

     This app can be downloaded from the site given above or apk version directly from here. Since this app is rejected by the Google play store for the pretty obvious reason of giving the songs as free, so you can't get it there. Also because this app is not getting downloaded from the play store you need to enable a special setting in the Settings of your phone to let install the Apk from untrusted sources as this one.
 Note: Enabling the installation unknown sources is a risky step, so be very careful in installing the apps that are trustworthy or is coming from trusted sources, but yeah the step is required to install these type of programs which are good enough but are removed from the play store due to very obvious reasons.


INSTALLATION

    Installation of this app is pretty straight forward like other apps, but needs an extra step of enabling installation from unknown sources. For enabling that follow :
  • Go to settings -> Security & Fingerprint and enable Unknown sources by saying yes when asks for confirmation 
  • Now go to folder where the Apk, is downloaded (mostly in Downloaded folder) and open the apk
  • Follow the wizard and install the app
  • Now go to Settings  - Apps - Fildo - Permissions - Give only storage 
  • Now come to Home Screen and open Fildo and wait for some time to till the waiting bar is rotating 
  • Once the app shows you some of the albums drag the screen from left hand side and that screen contains the Search bar, type the name of the song or else name of the Album or name of the star and press enter in your keyboard
  • Let it search for sometime and boom you have the song that can be downloaded
  • Choose a file to get downloaded by the 3 dots visible in front of the songs

APP SCREENS

Settings screen with app screens.


 Also you can change the directory structure under which your mp3's will gets downloaded, That is available under the Configurations menu of the app,  So tweak that according to your own understandings of the folder structure and and comes back making it save the changes.

I hope you guys have enjoyed the overall explanation of the App so please let me know, by comments like, share and every damn thing available to share.

Thanks all,
Happy Coding.

:)



Wednesday, October 5, 2016

Glance Lock Screen, new sensation in lock screen department

Hey guys, I am back with one more great app.

The app is Glance Lock Screen. Yeah I know, you guys might b thinking, not again, one more lock screen, but believe me guys this lock screen is one of the best for FingerPrint Secured mobiles.

You might ask whats unique in this, we have lots and lots of lockscreens that supports the fingerprint strategy to access the mobile, whats great in this. So let me tell you one thing the finger print security in this app doesn't gets asked after the swipe, which in turn means as soon as you take out the mobile you can place the finger on the finger print scanner and the phone gets unlocked its not like that you have to firstly swipe then use finger print to unlock.

Also one more feature is that the app gives you new info over a period of time every time you want to unlock the device. Also the app has the functionality to show the notifications in hidden as well as normal mode. So if you choose the hidden mode the notifications title is shown and not the content whereas in normal mode title as well the content is shown whenever the new notification arrives.

The setup is pretty straight forward, you have to install the app and have to give the permission to draw over other apps, notification access to get the notification content on to the lock screen and boom, the setup is done.

By default all the apps show the notification but we can select the apps that might not get shown in the application.

I have attached some of the snapshots to give you guys an idea about the app. Here are the snapshots.



Now the setup is ready the app is good to go.

Hope you guys like the app, please comment, like, share and do subscribe.

Happy coding.

:)





Saturday, September 24, 2016

Apidocs for Rest in Node js

Hey guys, I know I am pretty late in creating the content but this sharing a worth .

So now for all of you I want to tell you that I started working in Node js from past 6 months and found it really interesting in the way it handles the stuff and ease by which new things gets created in Node.

Now a days the frameworks are getting created by keeping a motto in mind that the client feels very less friction in attaching it. So for that only the concept of REST is becoming very popular.

Since in case of REST you don't need that the client have to install any executable or generate any stubs (as in case of SOAP), to interact with your server. Its just a normal HTTP/HTTPS call on which you send your data and the result is sent to you either in the form of JSON or XML depending on the request.

Now one thing that really bothers for all developers is that how will you document your api so that the client have clear cut understanding how to call an api and what kind of data he will get back as the response. For documenting the REST apis number of libraries are there that gives you the functionality, out of which some of the names are :
  1. Swagger
  2. ApiDocs
Now there are many more but these 2 are mainly used in the Node js community.

Today we are mainly going to concentrate on ApiDocs although Swagger is more popular but when I wanted to do the documentation I felt ApiDocs much more easy to understand and maintain as compared to Swagger.

This is because the Swagger forces you to learn a whole new way of creating the documentation like you have to write the info of documentation in YAML language which in turn is translated in to JSON by the Swagger API and that JSON is then utilized to show the HTML view of the documentation.

So coming back to the ApiDocs, let me tell you the system works very simple. You create a rest layer in a folder named rest (most of the times, there is a rest folder where you write the code for routes).

So what you can do is that you write the normal comments in a special format that is given by ApiDocs and then ask ApiDocs plugin to generate the documentation by the help of the these comments to a specific folder.

The only draw back which I felt is not that important is that ApiDocs doesn't provide the demo caller functionality as in case of Swagger that means you can't test the call from the ApiDoc UI itself.

Lets start coding. :D 
  1. Okay so first of all you have to install the ApiDoc module. 
    • npm install --save apidoc
  2. Now this will install the apidoc in a local mode and believe me its more than sufficient although the documentation of ApiDoc say that you should have to install it globally but its ok to install in locally.
  3. Configure the ApiDoc. 
    • For this there are 2 modes either you can give a json file individually and then tell the ApiDoc to pick this json file of you can give the config in package.js file (the same file which is the npm file).
    • Config looks like :
      "apidoc": {
          "name": "Name",
          "version": "1.0.0",
          "description": "Name API's",
          "title": "Title",
          "url": "http://localhost:3555/api/1.0.0"
        }
    • The name shown in the UI in the top is Name, Version is 1.0.0, title as Title, and the base Url is http://localhost:3555/api/1.0.0
  4. You have to put the comments in a specific format like:
         /***
         * @apiDefine ServerError
         * @apiErrorExample 500:
         * HTTP/1.1 500 Server Error
         * {
         *      "statusCode": 500,
         *      "status": false,
         *      "message": "Internal Server Error.",
         *      "data" : "{Message with the Internal server error}"
         * }
         */
         /***
         * @api {get} /users/:userId Get Users
         * @apiName GetUserById
         * @apiGroup Users
         * @apiVersion 1.0.0
         *
         * @apiParam {String} userId Users unique ID.
         *
         * @apiSuccessExample {json} Success-Response:
         * HTTP/1.1 200 OK
         *
         * {
         *      "statusCode": 200,
         *      "status": true,
         *      "message": null,
         *      "data": {
         *          "_id": "{userId}",
         *          "userName": "{userName}",
         *          "addresses": {
         *              "user": [
         *                  {
         *                      "_id": "{addressId}",
         *                      "name": "{addressName}",
         *                      "addressLine1": "{addressLine1}",
         *                      "addressLine2": "{addressLine1}",
         *                      "street": "{street}",
         *                      "city": "{city}",
         *                      "country": "{countyCode}",
         *                      "pincode": "{pincode}"
         *                  }
         *              ]
         *          }
         *      }
         * }
         *
         * @apiUse ServerError
         */
         router.get("/:userId", function(request, response){
            //rest handler
        });
  5. Now after this if we have to generate the documentation.
    • base_directory_of_your_project/node_modules/.bin/apidoc -i folder_with_files_commented/ -o folder_to_get_output_to
    • -i -> Input Parameter
    • -o -> output parameter
Now this is just an example, that is self explanatory. 

The command in step 5 will generate the html files with the documentation on the basis of the special comments you have given to the rest layer.

FYI: 

  1. In order to automate the building process you can use gulp tasks.
  2. The demo of the apidocs is available here, please clone and read the README.md in order to get the taste of APIDOCS.

Hope you guys liked it, happy coding
:D

Friday, August 19, 2016

Dango - the dragon for the gifs and emoticons

Hello guys, I am back with a whole new app named Dango, here.

Now coming to the usage of this app, the app provides you the emoticons and gifs based on the word you type. The catch here is that it doesn't restricts you to use any specific keyboard, like the Google or Swiftkey, rather it actually reads the input of the user and then calls the server to get the list of GIFS or emoticons that matches the word.

Here are some of the snapshots :


Now some of the key features of this app is that it converts the gifs into MP4 if the app does not support GIF animation as in case of whatsapp.

The app automatically downloads the mp4 version of the gif and sends it to the contact you are chatting with.

Now coming to the setup of the app the app asks for Accessibility setting for itself. You can find accessibility setting in Settings->Accessibility.

Here is the snapshot:


After giving the permission we are set to go. Just open any app where you want to type and the Dango Assistant will be there with the suggestions of the emoticons and gifs. Also there is one more option in the dango app where you can blacklist the apps in which you don't want to get disturbed.

Hope you guys like the app and please subscribe, share, comment and like the my page as well as channel.

Happy coding :)

Friday, August 12, 2016

Terrrium, the Swiss knife of Series and Movies

Hey, all, I am back with new android app, that is too cool to be handled, and the name is Terrarium. 

Believe me guys its really a Swiss knife for Movies and Series.

This app is not available in Play store, so can install it by suppressing the setting for unknown sources installation and downloading the Terrarium app from the site, terrariumtv.com

Download the apk and install it.

Prerequisites to installation:
  • Allowing unknown sources to get installed in the mobile
    • For this please follow following.
      • Settings -> Security and FingerPrint ->Unknown Sources, this is with respect to One Plus 3 View
      • As soon as you want to enable them, android system will show you the warning about the stuff that this is not good and blah blah, ignore it and just enable it.


After the above condition is done, please open the apk that you downloaded before and install it by following the wizard.

And, ta da......the app is ready to use, and I can say its by far one of the most simple app I have ever used.
  • There are 2 sections of the app
    1. Series
    2. Movies
  • You can search in the specific section for a specific series/movies, bookmarks them and can browse them in future.
The app view is like this:


You can search the series/movies, bookmark them like:




Almost every series is available with all the seasons in here is the most important thing that you can even select the resolution in which you want to watch the episode with subtitles. Yes you heard it correct we can watch the seasons in our own preference of the resolution and that too without having hassle of finding the matched subtitles and all.

The app itself gives the option to download as well as stream the content directly without downloading the video.

All though you need the MX Player, to see the stream-able link because the app by default streams the content via MX Player.

I was pretty surprised the first time I have used the app. I can tell you guys that this app is too good to follow the series, and also a blessing for series lovers, who don't want to waste the time in collecting the seasons or viewing them as a stream-able content.

Go try it.

I hope you guys have liked the app.

:) 

Wednesday, July 20, 2016

Microsoft VScode, new beast in town

Javascript has emerged as a non serious language, a client side language that was meant for just validating the client side and showing the errors as and when required. But from past few years it is emerging more of a serious language and also is getting more and more advanced as well as more matured.

While competing with already available, settled and matured languages like Java, Php and .Net the requirement for an IDE is must. Also its becoming a prominent factor for the success of any language that how good the support of it is available via IDE.

I still remember my old college days when people say that coding in .Net is so much fun then in Java since in my college using any IDE for Java is strictly prohibited. In a way or the other it was pretty good since using the text editor to code gives you more insight view of the language. But yeah when the language roars over newbie, IDE is the only saviour.

Some of the things that I feel for an IDE to provide includes better RAM management, ease of use and one of the most important being light in nature both in case of speed and weight, :D.

If you have worked on the IDE's like Eclipse, Netbeans, Webstorm and .Net Visual Studio you might have faced the issue where your whole PC gets slows down and not able to even play a simple song in VLC.

For all those guys who don't need hell lot of features rather just needs an editor that gives you features of an advanced editor with very few but important features like plugin, github and last but not the least lint support. For all those Microsoft VsCode editor is like a blessing.

It has almost everything that you thinks of.

Some of the most promising features are:
  1. It is very small in size, just 30-35 mb
  2. It is light in nature
  3. It supports github by default
  4. Supports plugins
  5. It supports linting, tested javascript linting via a plugin called jshint, can be found here
  6. Last but not the least, and most imoprtant it is FREE, yes you heard it right it is free.
I have been using this IDE and really found it quite fascinating to work with.

Here is the view that you get when you first open the VsCode after installation.


The support to github comes by default.

One more feature which I really liked is the ability to create snippets, that means you can create short hands that on being used expands itself and saves your lot of time. 

Let me tell you how a basic snippet in case of Javascript can be created. Lets think you want to create a snippet for :
  • console.log(""); with the shorthand of cl
that means when you type cl and press enter, it will be expanded in to console.log("|"); and your cursor is being blinking at |

For this you have to follow: 
  1. open File->Preferences->User Snippets->Select Javascript
  2. It will open a file named javascript.json. Add the following into that file.
    {
       "Print to console" : {
          "prefix" : "cl",
          "body" : [
              "console.log('$1');"
          ],
          "description" : "Logs output to console"
       }
       //more snippets can be added here
    }
  3. In the above Json, 
    • Print to console -> name of the snippet
    • prefix -> shortcut
    • body -> by what prefix is going to be replaced with
    • $1 is the first position of the cursor after the snippet is expanded, you can keep as many pointers and the cursor will follow them via ENTER or TAB
  4. One more feature is that code snippet in VsCode supports the placeholders as well like in case of:
    {
       "Print to console" : {
          "prefix" : "hello",
          "body" : [
              "Hello ${name:Enter your name}.",
              "Goodbye ${name}!"
          ],
          "description" : "Logs output to console"
       }
       //more snippets can be added here
    }
    when we type hello and press enter it gets changed to:
  5. As soon as you start typing a string the place holder in line number 3 starts updating, these helps a lot while you have to do the same stuff again and again as in case of loop this might be useful like:
    {
       "For Loop": {
             "prefix": "for",
             "body": [
                 "for (var ${index} = 0; ${index} < ${array}.length; ${index}++) {",
                   "\tvar ${element} = ${array}[${index}];",
                   "\t$0",
                 "}"
             ],
             "description": "For Loop"
         }
    }
I hope you all liked this post do share comment like and subscribe, happy coding and keep smiling, thank you.
:)

Tuesday, July 19, 2016

Alias Creation in Linux

We all use commands to do the stuff in any OS. We often face situations where we have to issue the same commands again and again in order to do the stuff.

For instance, we might face the situation in which we have to come to a particular directory and have to issue the commands. Also, there might be the case that the command issued have to keep running and because of which we have to open another terminal and have to issue other command but in the same directory in which the last command is issued.

For those type of things, there is a trick of creating the alias in Linux OS.

Now before going forward let me explain to you what does ALIAS means?
    In simple language, Alias is a shortcut to do some specific stuff.

Let's try to create one alias that takes you to the specific directory. For example, your working directory is ~/user/work. And you have to issue all the commands in this specific directory. In that you have to open a terminal and always have to issue a command that looks like this:
  • cd /home/user/work
For this we will create an alias named cdw (change directory to work, for instance).
  • Open the bashrc file for the user to whom you have to provide an alias for.
    • vi ~/.bashrc
  • Come to insert mode and add the following line at the end of the file with the following syntax.
    • press i to come to insert mode
    • Add the following at the end:
      • alias cdw='cd /home/user/work'
  • Save and exit the vi editor.
    • press ESC, then :wq then ENTER 
  • Exit the terminal and reopen new terminal to get the new settings.
The commands used are self-explanatory and tell that the name of the alias would be cdw which will redirect you to the /home/user/work directory.

Creating an alias on a Mac machine is very simple. Mac OS comes with a command named alias that can be used to generate a new alias and can be used to see the alias as well. Similarly, in order to delete an alias, you can use unalias.

But the alias and unalias command is temporary in nature and you can follow the above same procedure in ~/.bash_profile and add the alias you want to keep it permanent.

Using above steps will create an alias and makes your life a bit easier.

Happy coding to you all.  :)

Tuesday, May 24, 2016

Getting MotoG active display without Root

Hey guys, I am starting a new series of introducing some of the very cool apps of Android.

Today I am going to review an app that will emulate MotoG Active Display feature. The app is ACDisplay.

Here are steps to install ACDisplay and make it look alike Active Display.
  1. Install it using the play store, link.
  2. After installation open it.

  3. Clicking the yellow mark will tell you what all permissions you have to give AcDisplay.


  4. Give all the permissions to it, namely Device Administrators and Notification Access.

      
  5. Device Administrators is required to lock the Device and Notification Access is required so that you can read all the notifications(although you can configure it, which Apps you don't need).
  6. You are almost done (yellow mark is also gone), after you give the permissions your basic setup is ready to use.
  7. Enable the global button on the top right hand corner.

  8. This will enable the app. Now lets change some config. 
  9. Settings will have 2 sections:
    1. Features
      1. LockScreen
        1. Go to this and enable it on the top right hand corner, this will make this as the lock screen
        2. Check Enable when no notifications if you want to show it irrespective of whether there are 0 notifications or more than that.
      2. Active Mode
        1. Go to this and enable it on top right hand corner, this will give you options for the behavior of the AcDisplay, wave to wake, disable on low battery etc.
    2. Settings
      1. Notifications
        1. This will give you the option what to do with the notification, like wake up or not on arrrival of new notification, to show always on notifications or not etc.
      2. Interface
        1. This will give you the option to use the desktop wallpaper as background for this lock screen, animation, colors etc.
      3. Apps
        1. This will be useful to blacklisting the app, that means app which you don't want to show the notifications for.
      4. More
        1. This gives you the option when to make this app active, only on charging or everytime, inactive hours (for which app will be in sleep), shortcuts like lower left hand shortcut, lower right hand shortcut etc.
  10. After then when you lock the device and wake it up, AcDisplay will spread its magic, but the main problem is that it just disappears if you press the home button, and comes to home screen, so in order to solve that we will pattern protect our phone via default locker. 
  11. For that go to Settings->Lock Screen->Screen Lock->Pattern and give the pattern, confirm it.
  12. Enable :
    1. Directly Show pattern view, 
    2. make pattern visible
    3. show pattern error
    4. show pattern dots
  13. Set automatically lock to immediately, enable power button instantly locks
  14. At last we will disable notifications in lock screen, since our notifications will come at AcDisplay, for that Settings->Notifications->When device is locked->Don't show notifications at all
  15. Now lock the screen, and whenever notification come, depending on the wake up setting of the AcDisplay, mobile will lighten up, and show the notification very similar to the Moto Active Display, tap the small icon and read the notification, tapping after selecting the notification will take you to the app itself, but before that you have to give correct pattern.

Notes:

  1. The AcDisplay best works with default lockscreen, do not use with other lock screens.
  2. Don't forget to set the pattern or pin or password lock for default lock since pressing the menu button bypasses the AcDisplay screen.
  3. It acts as a module of Xposed as well, which is an optional setting, you can enable it in Xposed Module, modules section, if your Xposed module is setup, that means both rooted and Xposed installed and configured.

Monday, May 16, 2016

Remove duplicates from sorted array.

There are a number of approaches when it comes to remove the duplicates, from the array. Here are some of them:

  1. Make a Set out of the array so that you have only the unique elements out of it, also considering the further point if you want to keep track of the order of the elements you can use LinkedHashSet that guarantees the uniqueness as well as order of the Collection.
  2. Next approach is bit granular and we traverse the array and keeps on pushing the pointers till I am getting the same element:
    1. Start with 2 pointers first marked at 0 (since it is an array, lets name it as f) and second marked at 1(lets name it as s).
    2. Keep incrementing the second pointer till the elements at ARRAY[f] and ARRAY[s] are equal.
    3. When above condition is false make ARRAY[f] = ARRAY[s] and increment both f and s since the position of f and s are traversed.
Coming to the implementation, here is the working code.

This is the code you can find the running code here.

import java.util.*;
import java.lang.*;
import java.io.*;
 
class Ideone
{
      public static int[] duplicatesRemoval(int[] input){
 
        int f = 0;
        int s = 1;
        //RETURN IF THE ARRAY LENGTH IS LESS THAN 2;
        if(input.length < 2){
            return input;
        }
        while(s < input.length){
            if(input[s] == input[f]){
                s++;//
            }else{
             /*
             **THIS PART CAN BE SHORTENED BY input[++f] = input[s++];
             */
             f++;//SINCE LAST POSITION IS 1 BACK TO CURRENT ONE
                input[f] = input[s];
                s++;//SINCE s POSITION IS ALREADY TRAVERSED SO INCREMENT IT
            }   
        }
        //reassigning to new array element
        int[] result = new int[f+1];
        for(int k=0; k<result.length; k++){
            result[k] = input[k];
        }
 
        return result;
    }
    public static void main(String a[]){
        int[] input = {2,3,6,6,8,9,10,10,10,12,12};
        int[] output = duplicatesRemoval(input);
        for(int i:output){
            System.out.print(i+" ");
        }
    }
}

Wednesday, May 11, 2016

Next greater number with same set of digits

This is pretty interesting question I came across when facing an interview.

The question was pretty straight forward, you have given a number and you have to find the next greater number with the same set of digits as in the given number. So for an instance if Number is:
  1. 1234 then output should be 1243
  2. 4321 then output should be not possible since its the largest among all the possible numbers with the same digits as in 1234
  3. For other cases we have to develop the algorithm (:D).
Now coming to the solution of this problem, one straight forward algorithm would be:
  1. Find all the possible combination of the string (given number) and collect it in a Sortable Collection like TreeSet and take the next element after the given number. This is pretty straight forward approach but it is waste since we have to calculate the full set of numbers that are possible to get generated and then find the next number in the TreeSet. This is simple to understand but memory wise, order wise and space wise pretty heavy.
    Although I have given this answer only :D, but the interviewer was happy with it at all. Since there are better approaches to this.
  2. Next approach is pretty simple but a bit difficult to understand. Here it goes:
    1. First 2 condition will be same as the ascending and descending one.
    2. If the case is different then we will :
      1. take pair of digits from right where right digit is greater then left digit, and mark the index to be right digit index - 1.
      2. Then we have to take the smallest digit from the right hand side digits of the marked index which is greater then the indexed digit
      3. Then sort the right side of the index digit in ascending order.
      4. What, what what :D
    3. Lets take an example: 54362
      1. In this example start from the right in pair, (2,6) [we will ignore since 2<6] and move to next pair that is (6,3). This is correct pair since 6>3.
      2. So our marking index would be 2 and the number to be updated is 3.
      3. Now taking the number which appears in right side of index number(ie 2) and is smallest among them but larger then 3.
      4. In this case it is 6 only since 2 is smallest but 2>3 is false.
      5. So we swap 3 and 6 which will make the number as 54632 and sort the right hand of index(2) that means numbers 3,2 have to be sorted which is true in this case.
Lets make the program of this. Here it goes:

MyData.java
import java.util.Arrays;

/**
 * @author ankur
 *
 */
public class MyData {

 private int n;
 private int nAsc;
 private int nDesc;
 private int[] nIntArr;
 private int length;
 
 private String sAsc;
 private String sDesc;
 
 
 public MyData(int n){
  this.n = n;
  
  process();
 }
 
 private void process(){
  String s = "" + this.n;
  char [] sArr = s.toCharArray();
  
  nIntArr = new int[sArr.length];
  for(int i=0, len=sArr.length; i<len; i++){
   nIntArr[i] = Integer.parseInt("" + sArr[i]);
  }
  Arrays.sort(sArr);
  sAsc =  new String(sArr);
  sDesc = new StringBuffer(sAsc).reverse().toString();
  nAsc = Integer.parseInt(sAsc);
  nDesc = Integer.parseInt(sDesc);
  length = this.sAsc.length();
 }
 
 public int getN() {
  return n;
 }
 public void setN(int n) {
  this.n = n;
 }

 public int getnAsc() {
  return nAsc;
 }

 public void setnAsc(int nAsc) {
  this.nAsc = nAsc;
 }

 public int getnDesc() {
  return nDesc;
 }

 public void setnDesc(int nDesc) {
  this.nDesc = nDesc;
 }

 public String getsAsc() {
  return sAsc;
 }

 public void setsAsc(String sAsc) {
  this.sAsc = sAsc;
 }

 public String getsDesc() {
  return sDesc;
 }

 public void setsDesc(String sDesc) {
  this.sDesc = sDesc;
 }

 public int[] getnIntArr() {
  return nIntArr;
 }

 public void setnIntArr(int[] nIntArr) {
  this.nIntArr = nIntArr;
 }

 public int getLength() {
  return length;
 }

 public void setLength(int length) {
  this.length = length;
 }
 
 
}

Main.java
package com.av.ngnsd;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {

 public static void main(String[] args) {
  MyData myData = new MyData(54362);
  try{
   int nextNum = process(myData);
   System.out.println("Next number is " + nextNum);
  }catch(Exception ex){
   //ex.printStackTrace();
   System.out.println(ex.getMessage());
  }
 }
 public static int process(final MyData n) throws Exception{
  int result = 0;
  int nDesc = n.getnDesc();
  int nAsc = n.getnAsc();
  if(nDesc == n.getN()){
   throw new Exception("Not possible");
  }else if(nAsc == n.getN()){
   String s = "" + nAsc;
   result = Integer.parseInt(s.substring(0, s.length()-2) + "" + s.charAt(s.length()-1) + s.charAt(s.length()-2));  
  }else{
   //TODO the main code
   int []nCharArr = n.getnIntArr();
   int indexOfChange = -1;
   for(int i=n.getLength()-1; i>0; i--){
    if(nCharArr[i]>nCharArr[i-1]){
     indexOfChange = i;
     break;
    }
   }
   
   if(indexOfChange <= 0){
    throw new Exception("Not possible");
   }
   else{
    int numberToBeSwapped = nCharArr[indexOfChange-1], smallestIndex = indexOfChange;
    //getting the smallest among the right side of the index which is greater then index digit
    for(int i=indexOfChange+1; i<n.getLength(); i++){
     if(numberToBeSwapped < nCharArr[i] && nCharArr[i] < nCharArr[smallestIndex] ){
      smallestIndex = i;
     }
    }
    
    //swapping the 2 digits
    int temp = numberToBeSwapped;
    nCharArr[indexOfChange-1] = nCharArr[smallestIndex];
    nCharArr[smallestIndex] = temp;
    
    //for sorting the right hand side of the index
    List<Integer> nArrayList = new ArrayList<Integer>();
    for(int i=indexOfChange+1; i<n.getLength(); i++){
     nArrayList.add(nCharArr[i]);
    }
    
    //int indexOfChangeCopy = indexOfChange;
    Collections.sort(nArrayList);
    for(int num:nArrayList){
     nCharArr[++indexOfChange] = num;
    }
    StringBuilder strNum = new StringBuilder();
    for (int num : nCharArr) 
    {
         strNum.append(num);
    }
    result = Integer.parseInt(strNum.toString());
   }
  }
  
  return result;
 }
 
}


Sunday, April 17, 2016

Installing gnome and enabling all windows in top bar

Ubuntu comes with the default launcher as Unity Launcher that looks like this:


Now this launcher is pretty but if you want the Gnome desktop you can continue or else press the (X) button :D .
  1. For installing the Gnome desktop, we first install tasksel, that is pretty useful in order to install many packages.
  2. For that go to Ubuntu Software Center and type tasksel
  3. Install the package and run using sudo tasksel 
  4. Pressing arrows you can navigate and pressing space bar can check/uncheck the package
  5. Go to Ubuntu Gnome desktop and press space bar to select it and pressing tab will take you to ok at the bottom.
  6. Press space bar being at OK
  7. Wait till the package is installed and after that restart the system using either command or either via UI.
  8. When you restart the system you will find out that now your desktop is changed to Gnome.
Now the problem with gnome (or feature) is that it only shows the active window in the top bar and not all the windows that are opened. In this pic although there are 3 windows opened but only one is showing in the top bar in left corner which is active one:

In order to do get all the windows we have to install the extension and enable it to work with GNOME desktop.

Extensions are very useful in extending the functionality of the Gnome desktop. 

The extension we need for showing all the opened windows in the top bar is YAWL, which you can get here
  1. sudo apt-get install gnome-common autoconf autogen automake intltool libglib2.0-dev
  2. cd /path/to/where/you/want/subdir/with/yawl
  3. git clone https://github.com/dbfin/gnome-shell-extension-yawl
  4. cd gnome-shell-extension-yawl
  5. ./install-extension yawl
Once this is done, this means that you have installed the extension but till now didn't enabled it. For enabling the extension we have to install the gnome-tweak-tool, which is capable of tweaking the settings of Gnome desktop. For installing gnome-tweak-tool use:
  1. sudo apt-get install unity-tweak-tool gnome-tweak-tool
Once this is done you can start it using sudo gnome-tweak-tool .
Go to extensions, scroll to Yawl and enable it once that is enabled you have all the windows and favorites available at the top bar


This will give you all the opened windows at the top bar including the favorites.

Also in some cases you might see the message that the extension is not compatible with shell version, this is because as the shell is updated their might be the chance that extension might not support that change in that cases we have to switch off the default feature of the gnome that checks for the compatibility of the extension by the command:

gsettings set org.gnome.shell disable-extension-version-validation "true"


Phew this was a pain in my case since I have actually searched a lot in order to all these things. Hope this helped you all :) .

Creating a node module and using it

As you all knows, Node is getting better day by day and also there is an option of using node modules that are generated by other developers and are available to use.

Also, there is no good in making a Node project without user defined modules or in other words I can say that there is not possible (all though you can create a single module project but that is of no use) to generate the project in which you do not create the modules.

So, going forward Node modules are just the way of exposing a functionality from a Node file so that you can use that in other functions. For instance you want to create a calculator in Node js and for that you have decided that there would be four different modules namely add, subtract, division and multiply so that you can control them very gracefully and also tracing bugs would be easy since there are individual modules so when the bug got traced you can easily go to specific module in order to debug it.

So in order to do that, follow the steps:
  1. lets create a folder named node-calculator, for that browse to your docs and create a new folder either through right click and new folder or from shell using
    $ mkdir node-calculator 
  2. Go inside the folder using cd node-calculator and create one more directory named my_modules using :
    $ mkdir my_modules
  3. Now our basic setup is ready so we will code the things.
  4. Let us first create a module named add. 
  5. For that we will create a directory inside my_modules named add
  6. We will create a file inside add folder named index.js with following contents:
    var addition = function(a,b){
      return a+b;
    }
    
    module.exports = {
      addition_two_numbers  : addition 
    }
  7. In this the function addition is pretty simple and in order to expose that function to be useful in other files we have exported it with the name, addition_two_numbers
  8. Now create a file in node_calculator directory named calc.js with following contents:
    var add_module = require("./my_modules/add");
    console.log("Add module ", add_module.addition_two_numbers(2,2));
    
  9. Similarly create other modules named div, sub and mul. 
  10. Now the tree node-calculator command to see the contents and you will see something like this :
For your information:
  1. Code is available here
  2. The output shown at step 10 is of the command tree node_calculator
  3. If you don't have the tree command you can get it by:
    apt-get install tree
  4. In order to run the file use the node filename.js .
So for us it would be node calc.js and you will get the answer 4.

Saturday, April 16, 2016

Wifi router speed issues and solutions

I have been working lately in my laptop (while connected to wifi) and suddenly the internet becomes very slow. I have tested the speed of internet using the www.speedtest.net. The result of speedtest was awesome and I thought it might be the case with my laptop since it is running from 2 days (not continuously, uses hibernates when need to stop working, ;) ) let us restart the machine and then will look again on the issue. But surprisingly the issue didn't solved, then I called the ISP provider call center and have scheduled a time for next day when their engineer might come and look in to the issue.

Okay, next day the engineer came and before saying anything he took my laptop and used some of the commands like:
  • ping google.com
  • ping youtube.com
to see that the net is working or not. He shown me the result saying sir there is no loss in the packets.

I was also confused how this is possible I am unable to play a single youtube video without buffering even when my internet speed package is 40 mbps plan which is pretty descent to run youtube videos in HD.

Then I started searching the internet that what is the issue and came to know that since Wifi is a machine that works in radio waves, there may be chances that other systems might be interfering in the signals of the router and so you might face some of the issues. The solutions are pretty simple and here are some of them what I got from internet.
  1. Don't place the router near to TV, Sound Systems, Microwaves or anything that is capable of creating the Radio waves and might be responsible to interfere in the signals of your router.
  2. Place the router somewhere at top, since it is tested that the signals never broadcast parallel to the position of router rather they actually circulate and go down after some distance so if you place the router at some where which is at more height than it might be the case that you can get better connectivity at the corners of your house.
  3. Check the interference of the signals with the help of an Android program named Wifi Analyser that analyses all the wifi signals in both the bands (2.4ghz, 5ghz) under all channels, and then decide which channel is best suited for your router to work properly. The output of the wifi analyser is somewhat looks like this:



    Now this is pretty confusing but let me give you a brief explanation that this is actually showing all the wifi signals that you are receiving in your area and all the channels under which the wifi routers are broadcasting their signals. Most of the wifi routers work at the auto mode of channels so this application tells you which signal is best for your router to work so that you can change the settings of your router from the settings page that you can get at  http://192.168.1.1
I actually did all these and the problem never gets solved. At last I came to know that the solution of these situations are either you gets shifted to places where there is less congestion that is next to impossible or you have to change your router, this means change the router and get the one that has high frequency meaning 5 ghz. Since my router works on 2.4 ghz and there are too many routers that are working in the same frequency I am getting the issues but if you change your router there are very chances that you might get the interference since very few people takes 5 ghz router. 

So for all of you, you can follow some of the above steps to get the problem solved or either get the new router with 5 ghz frequency, their might be the case that you can get the same problem in 5 ghz router as well but chances are very low.

Hope you guys enjoyed my info, sorry but there is no solution I got that worked for me, that's why I have given the solution which is not that feasible but its ok :)

Wednesday, April 6, 2016

Callback hell and promises


Callback? What the hell is callback? Well in a nutshell, call back means:

Now this is what just the English meaning of call back. This in turn means executing something when other thing is finished and this in turn is not something that keeps on waiting for the thing to finish, rather keeps on doing its other stuff and executes when the thing is finished on an event basis.

1. What is callback?

The statement above is a bit lengthy in a way to understand, but think of this that when you give exams in school you never waits for the result( although you do :D ), rather you start preparing for the next class and when the result arrives, go to school to collect it. So if we have to think this in a code manner it would look something like this:

giveExams(getResult(){
     //when results arrive
})


This pattern is very common in Javascript world. If you ever been worked with Javascript in client side ( or server side, since Node js made that possible ) you would have faced the situation when you have to get some data from the server without doing the full reload of the page using ajax call and then have to display the result on the page at some specific div or text area.

This can be done using callback in Javascript like this:

$.ajax({
     url : "", //where to hit

     type : "POST",//how to hit, POST, GET, DELETE, PUT
     data : {},//what to send
     success : function(resposne){//in case of success
          //this executes when call gets successful and we have the response in the response object of the function paramter
     },

     error : function(error){//in case of failure
          //this executes when call faces some error

     }
});


FYI : The call above uses Jquery framework to call the ajax function.

The function named success and error are nothing but the callbacks, since they are going to be called once the main call comes back either with the failure or with the success status.

2. What is callback hell?

The way callback is handled a pretty different then most of the other languages handle the stuff. For instance in Java:
public static void sleepAndPrint() throws Exception{
     System.out.println("I am before sleep");
     Thread.currentThread().sleep(2000);
     System.out.println("I am after sleep");
}

Calling the above function will provide you the output as:

I am before sleep. (There will be a pause of 2 seconds and then next statement occurs)
I an after sleep.

Now considering the same and making it in Javascript we have something like this:
function sleepAndPrint(){
     console.log("I am before timeout");
     setTimeout(function(){
          console.log("I am in timeout");
     }, 2000);
     console.log("I am after timeout");
}

Now when you run this you will get some thing like this:

I am before timeout.
I am after timeout.
I am in timeout.

If you see at the time of timeout function the code didn't stopped and keeps on executing so the statement that was inside the timeout block actually got executed after the whole program gets done.

This is good in a way that Javascript actually follows Non-Blocking I/O model, but it also creates a problem for those who wants to do the stuff in a sequential basis, like you want to get the data of a user from the database, that will contain the github id of the user from which you can query the github servers using the github api and get the avatar url of the user so that you can download it in a temporary folder. Now the above mentioned sequence is a straight forward one if we have to do it in Java like this:
public User getData(final int userId) {
     //this will be having the code to access the db layer and get the User model out of it
     return user;
}

public String getUserAvatarUrlFromUser(final int userId){
     User user = getData(userId);
     String avatarUrl = user.getAvatarUrl();
     return avatarUrl;
}

public Image getImageFromGihubForAvatarUrl(final int userId){
     String avatarUrl = getUserAvatarUrlFromUser(userId);
     Image image = github call to get the image of the avatar url just found;
     return image;
}
//Some where in the code
getImageFromGihubForAvatarUrl(1);

This will go on the way we have planned and the code when talking to database actually waits for the operation to complete and in the same way while talking to the github servers actually waits which makes our program to run in sequence and thus does not make any problem for us.

But in case of Javascript since the default behavior is different this sequence is not going to work properly.

So we have to do work like this, not exactly but something like this:
var getUserAvatarWithCallback = function(userId, callback){
  db.getUsers("userId", function(error, response){
    if(error){callback(error, null);}
    else{
      var userIdOfGh = response.user.githubId;
      github.search.users({ q : userIdOfGh }, function(err, res){
        if(err){ callback(err, null); }
        else{
          var avatarUrl = res.items[0].avatar_url;
          callback(null, avatarUrl);
        }
      });
    }
  })
};

Using this will be something like this:
getUserAvatarWithCallback("userIdToFind", function(error, response){
     if(error){console.error("Error", error);}
     else{
          console.log("Found the user, url is ", response);
     }
});

Now can you imagine how the indentation is going inward and inward since in order to do the stuff in a sequential manner we have to keep on making the calls inside the callbacks again and again, that makes the stuff pretty ugly. This is termed as the CALLBACK HELL or PYRAMID OF DOOM.

3. What is a Promise?

A Promise represents a proxy for a value not necessarily known when the promise is created. via Mozilla, here

Now if you go through the definition you find out it says that it is a proxy whose value is not known or available at the time of creation of the promise. So when we make promise we just code the way we do it in other languages.

Let us take an example of Promise using the above example only:
var getUserGithubIdFromDb = function(userId){
     return (new Promise(function(resolve, reject){
          db.getUsers(userId, function(error, response){
               if(error){reject(error);}//(A)
               else{
                    resolve(response.user.githubId);//(B)
               }
          });
     }));
};
var getAvatarUrlFromGithub = function(githubUserId){
     return(new Promise(function (resolve, reject) {        
          github.search.users({q: githubUserId}, function(error, response){
               if(error){reject(error);}
               else{
                    resolve(response.items[0].avatar_url);
               }
          });
     }));
};

The code above is going to be used as follows:
getUserGithubIdFromDb("userIdToFind")
     .then(function(response){//(D)
          getAvatarUrlFromGithub(response);
     })
     .catch(function(error){//(C)
          console.log("error", error);
     });

If you see this code is pretty maintainable and also is continuous in nature meaning it will be chained to more promises the way we did for 2 functions.

The main thing to note is that at equation (A) we called the reject(error), where reject is the parameter in the Promise constructor which will stop the further execution of the function and throw the error there itself which is going to be caught at (C), and if you are successful in your execution then you have to call resolve(response) [please see equation(B)], where response is passed as a parameter to equation (D), where we have passed it as a parameter to my further processing. This pattern is continuous in nature and you can chain as much promises as you want.