Saturday, January 20, 2018

How to Install Python on Windows

Python is fast becoming de facto choice for data analytics projects. Setting up Python on your system can turn up out be a little trick though and below steps would help you quickly installing it.

1. Download and install Anaconda : Browse to Anaconda site, Link, and download the appropriate version for your OS.

                              

2. Run the installer and choose default options : A small tip here, ensure there are no spaces in anaconda installation directory path, this would save tonnes of errors later.

3. Once installed you can quick test installation, go to start menu and search for Anaconda Prompt.

                    

4. Launch Anaconda Prompt and execute below command
    python --version

5. Its time to add it back to system path, so you can use python from other softwares like Windows command prompt, gitbash etc.

6. You can either do it through Control Panel, system variable way or you can change system path via windows command prompt.

7. Use command SETX PATH %PATH%;D:\ProgramFiles\Anaconda;D:\ProgramFiles\Anaconda\SCRIPTS"

8. If you are not sure of Python installation path, go back to Anaconda prompt and run command where python.

That's it, Python should now be installed on your system.

Wednesday, January 10, 2018

Handling Assertions in Automation related tools (TestNG)

As a developer assertions are used to red flag critical errors, errors from which programs can not recover. Its pretty convenient and lays out clearly the assumptions a developer has made on the flow of the program. On the flows which are in critical path of logic flow developers tend to use Assertions.

Assertions are equally popular in Testing community, specially with Automation developers. Automation developers use assertions to verify is system responded to a test case in the way it was expected to. Failure on system's part to respond in expected way causes an Assertion Exception.

Unlike in development, in Automation a tester may not want the entire testing module to be skipped if one of the test cases failed or led to Assertion Exception. At the same time he would still want to flag this error to underlying framework like TestNG. Welcome to the world of Soft Assertions which were introduced exactly to handle situation like above.

Its a developer's prerogative when to use Assertion and when to use SoftAssert classes. Typically at places where you do not want rest of test case to be executed on failure of a core module, for example login, since rest of the test cases would fail, you are more likely to use normal Assertion classes. However for testcases failure of which does not negatively impact other code in a test case, you can leverage SoftAssert classes.

 Example

import org.testng.asserts.SoftAssert;

public class TestCases { 
   
    @Test
    public void sampleFailure() {
      private SoftAssert softAssert = new SoftAssert();
      softAssert.assertTrue(false); 
      System.out.println("program still continues");
      softAssert.assertAll(); 
    }
}

Monday, January 1, 2018

Protected PDF Files, How to unprotect password protected pdf files.

Its that time of the year when you have to file your taxes. Most of the tax saving instruments/proofs in form of pdf unfortunately are password protected.


                                       


While there are ways of removing the passwords by uploading them to random sites, those can not be recommended without hesitation, specially since all these documents do contain private financial information.

You still do need to upload the unprotected documents to your organization portal to claim all tax benefits, so is there a simpler way out ?

Yes there is, just follow below easy steps.


1. Upload to Google Drive
2. Open the document, enter your password when prompted for.
3. Once document is open, click on print option.
4. From the print tab, either choose a local print software like Cutepdf or directly save the pdf to you local disk.

Thursday, December 21, 2017

Top Technology 2017 Trends and Surprises

 2017 was quite an interesting year for software industry. Mobile Industry grew up by leaps and bounds, cheap data connectivity improved in developing countries, Net neutrality wars got played out keeping everyone on the edge, AI and Automation became the new standard way of handling things rather than conventional software practices and many more.

With so much stuff moving around, the year also saw some major Snafus and below is the list I thought of sharing with you folks.


1. Crazy App Permissions : As mobile apps mushroomed in abundance, every app needed every single permission under the sky. How it uses them often was left to best of user guess. Case in Point being from the provider of Android platform itself, Google. 

                            

Google started needing access to Body Sensor before allowing you to send an email. Yes you read it right. Users of Gmail Android application started getting pop up alerts asking them to give Gmail app permission to access installed body sensors data. 

                              

This was later categorized as a defect and was fixed eventually. It does tinkle ones imagination though why would they need body sensors data for emailing .. hmm lets move on to next one.

2. Twitter Troubles : Many users reported of randomly getting locked out from Twitter in 2017. The new Withheld feature was blamed for most of such accidental lockouts. Worst part was that the software defect which caused this not only considered the new tweets for locking out users but also the tweet history.                        

Even the US president Donald Trump was not spared from these accidental lockouts. Surprisingly he responded to it in a positive way,  Response on Twitter


                  


3. Unleashing of Home Assistants : 2017 was undoubtedly year of home assistants, a device which would wake up on command of a voice command, remind you calendar events, answer your questions, order stuff online for you etc. Where it got creepy was when various users started reporting that these devices instead of using passive listening strategy (based on specific key words like Okay Google) was working in a always active listening mode, Google storing everything you speak.
Although companies have been nimble in fixing these issues, the security and privacy concerns seem too huge for most of the users to adopt these technologies in market.



4. Google Docs : Here is where ML and AI started showing the impact, obviously this was one of the cases for false positives. Many users around Halloween were locked out due to violation of terms of service, basically implying they could not access the content they own. The reason was the new ML algorithm, which went through the documents uploaded, and specific key words triggered account lock down. This also triggered off privacy debate, literally confirming Google reads through all the documents users upload to google drive.


5. Facial Scans : The super easy and convenient IR based mechanisms promised you would not need to remember another password for life.


                                             



Your face would be your password, how cool is that. Obviously the questions are lingering around how secure these new authentication mechanisms are, specially when users managed to break Windows security with low resolution images on device owners. Bypassing Windows 10 security with printout                            



6. Facebook Security Lapse: The example served as another reminder on how new feature releases can expose backdoor exploits to existing features on a platform. The new polling feature on Facebook provided sufficient information (picture ids in this case) for any one to go ahead and freely delete these pictures from other accounts. Newly Discovered Facebook Bug Allowed Anyone To Delete Your Photos With A Poll


What's the most astonishing thing you noticed in 2017 ?

Merging and Splitting PDF files

We all use and rely on PDF's. There are occasions though when you want to edit certain portions of a pdf and merge the edited version ba...