Planet PyLadies Pune

February 13, 2018

Anwesha Das

The danger of modern medical devices : Keynote by Karen Sandler at LCA 2018

Karen Sandler the cyborg lawyer (quite literally; she has a defibrillator in her heart) has always been a source of inspiration to me. Unfortunate me has missed three invaluable opportunities to meet her in person. But I never miss a chance to see if I can meet, or see her online. So whenever she is giving a talk, I eagerly wait for the videos to come online.

I’m a big fan if you can’t tell :)

This year she was one of the keynote speakers at LINUXCONFAU,2018 and I was (as usual) is at the mercy of the conference organizers to watch her talk as soon as possible. They were very efficient. The video was posted really quickly
Thank You, LCA!

The first time I encountered Karen was in 2016 when I watched her [2012 Keynote at LCA, Freedom in my heart and everywhere. The talk pointed me to the problems which were an integral part of our life, crucial to our existence. The proprietary software in our medical devices and the danger lies in them. The lawyer in me started looking at all medical devices with a suspicious eye. Doctors appeared to me like Agent Smith and us patients, like Neo having some bug tracker inside our body.
On another very personal note, she was the first person who actually talked about something that I could understand, connect with, though it was technical at the core.

This year her keynote at LCA was titled: “Six Years Later, or Hey, did you ever get the source code to that thing in your heart?”. This talk is, in essence, the epilogue, to her 2012 keynote. It involved the dangers of having proprietary, closed source software in medical devices and generating awareness around it.The talk to me was a story connecting her personal life and her passion, software freedom.

She started her story with a question, which she was often asked after she gave her talk in 2012, “Hey did you ever get your source code?” By definition, a cyborg is “a person whose physiological functioning is aided by or dependent upon a mechanical or electronic device.” Pacemakers, hearing aids, even our innocent looking glasses make us cyborgs. If not all, at least a vast number of us humans, are cyborgs. The distinction between who is a cyborg and who is not is becoming increasingly blurred.

We all are in the process of becoming or unbecoming cyborgs.

And so, she aims to create a world where we have a number of free and open source alternatives to proprietary software. Moreover, she raised another fundamental point on the ethics of such software in devices that our lives, literally, depend on.

Being well aware of our ignorance, she walked us through various aspects of the legal, technical, community, and the social aspects of having buggy software in medical devices.
In her own words these wifi enabled devices "have the worst of both the worlds”, running proprietary software inside them and no security at all.

In the next part of her talk, she discussed the DMCA, Digital Millennium Copyright Act, 1998. It forbids, criminalizes any act to bypass access controls for devices like these, even if it is permissible under the Copyright Act itself. Therefore the passwords which the copyright holder has put in place cannot be changed. No exceptions, no exemptions. So under any circumstance, no one could check the security/safety of their own device.
Then she broke the good news on how she got the exemption, citing her own scenario. She shared her personal stories to explain the situations and dangers that lay.
She also ran through various incidents showing vulnerabilities of various medical devices.

The best part of the talk came in the closing moments, where this free and open source advocate held forth on how can we implement and follow free software in our daily life.

To summarise,

The talk enlightened us about existing and emerging threats in the sphere of medical devices.
Why and how free and open source software has solutions to many of these situations.
Most importantly she emphasized that we as a community have a responsibility towards making the situation better.

You are a true superhero, when you have skin in the game (literally your heart in the game) and can actually stick to your beliefs and passions, even your life is at risk.

Thank you Karen, for being able to think differently and for your constant efforts to make the world a better place.
Looking forward to your next talk. See you sometime, somewhere, and until then will adore you online.

To read further about medical devices and tracking, go to this post.

by Anwesha Das at February 13, 2018 05:19 PM

December 10, 2017

Samridhi Agarwal

WebMaps with Python

After few months of busy schedule in college, Today I got the time to sit back and play with python applications. So I started learning WebMaps with python and folium.

As WebMaps the name only says that its the demonstration of Maps using browser. They can not be made using the default functions of Python because for the browser application we need CSS, HTML and JavaScript. So we need to convert the python code into the HTML code. Folium, a third party library does the same.

We need to pip install folium, after that we import it in the project. How folium works is – Everything spins around a map object, So we create a map object and store it in a variable.

import folium
map = folium.Map

Here folium.Map is the class that creates the object “map”. You can do dir (folium) to see different functions and you will find Map there. Then we can do help (folium.Map) to get the parameters and what we can give in that class.

Screenshot from 2017-12-10 22-29-19Screenshot from 2017-12-10 22-32-41

In the parameters we see the Location attribute to specify the coordinates on the world Map.Width- which means you can specify the width of map to be displayed on browser window, otherwise 100% by default means it uses full browser window to display.Tiles is background of map and so on.

So We can give the location attribute and see the location. In the location attribute the coordinates are given as [latitude, longitude].

import folium
map = folium.Map([-90 , 50])

Now we have a map object in python code but it is not converted to HTML. So we point the map object and use save method to save it in the html form, creating a new html file. Map will be created in HTML format, So html is containing all the elements that render on the browser.

import folium
map = folium.Map([-50 , 50])"Map1.html")

So I got a Map1.html file having the map of my latitude and longitude mentioned and as it is interactive mapping we can zoom in and out to see more details. Zoom parameter can also be added as (zoom_start = 6) and see changes with different zoom factors.


by samridhiagarwalblog at December 10, 2017 05:28 PM

November 28, 2017

Pooja Yadav

FAD i18n 2017

We had i18n FAD from 20-22nd Oct in Red Hat, Pune office. Developers and QE both participated in FAD(Fedora Activity Day). So we all were excited. All preparations were done, thanks to Parag. Sundeep, Pravin and other members for their efforts to make this happen.

Day 1:
We started at 9.30. There was a introductory session by Pravin and Jens, followed by some logistics information by Parag. After this we started with planned sessions as all of us were going to discuss on the topics which we have planned by giving a small presentation.
First was Akira Tagoh who shared information about fontconfig , guidelines for defaults fonts and the tasks planned for FAD. Then Peng Wu discussed about Pango. After this we had a small break.
Fujiwara, Peng, Mike, discussed about input method, ibus. I got a lot of input from this discussions as I was going to work on Input Method Automation. Then Mike and Rafal discussed about locales.
It was lunch time by this, so we had lunch in office.
After having lunch Sundeep, Parag, Sachin gave presentation and discussed about Transtats. Then Pravin discussed about Fonts. I gave a small presentation on Input method and tasks for Automation.
Then Satya and Bhushan discussed about the Fedora i18n QA Test cases. After this Vishal who was participating remotely in FAD gave presentation and share his idea web testing.
After a small break, everyone shares their plan for the projects on which they were going to work.

Day 2:
Second day we started at 9, as everything was set and planned. We started working on our projects. I and Ompragrash were working on the Input Method Automation. So first we planned to do automation for GNOME application as well as libreoffice. So first task was to open the application in specific locale. So I decided to do for gedit and Ompragash took libreoffice. We took Korean and Chinese input method. In the first half we were able to automate to open the application in the specific language.

Next task was to enable the input method for specific language which took a bit of research, as Fujiwara and Peng Wu were there, we discussed with them and finally got the solution how we can enable the input method.
So EOD we were able to input string in the application by enabling the input method for specific language.
Then it was the time for daily sharing, we all gave demos and shared what we have done or achieved so far. It was a fruitful day for all as everyone made success on their projects.
After this it was the party time, we went Amanora where we did bowling, everyone enjoyed alot. Then we had dinner at Barbeque Nation. It was a nice evening.

Day 3:
We started at 9:00 am in morning working on our pending tasks. We already had a session planned for Modularity, we had a good discussion about Modularity, got to know many new things. After Lunch we had Fedora 27 release party in RedHat office only. Many people join us for the party where had discussion about Fedora and modularity as this is the major change in Fedora. In evening we wrap with the demos and presentation of our project.

I found it very good as I got learn many new things and also got a chance to interact with people working on different technologies. After this FAD I know whom to contact if I have any issues related to i18n , this event was good to build connection. This will help us in future.

Looking forward for next year FAD.

by Pooja Yadav ( at November 28, 2017 05:34 AM

November 23, 2017

Pooja Yadav

Science Hack Day-2017,Belgaum

Finally it was the time to go the most awaited event "Science Hack Day" to meet and hack with the passionate people. This time also the venue was "Sankalp Bhoomi"  a resort built totally from discarded materials and salvaged waste.

Day 0:
We started here from Pune early morning for Belgaum and reached there by Lunch time. After reaching we were happy to meet people there, everyone was busy preparing for SHD Day-1. Then we had lunch. After lunch we put our stuffs in room and were told to take some rest but who wants to take rest when so much of interesting things were  going around. So after keeping the luggage in the room, we joined other people in the discussions. It was good to meet people whom we met last year, also good to meet new people . After the discussions we decided to do kayaking as I enjoyed it a lot last time. Also this time we had cycles in  Sankalp Bhoomi just to take a ride around it, so all of us enjoyed that. Then in the evening there was a introductory session where all of us gathered to introduce ourself and know each others hack idea .  This session was very good as we came to know about different projects and hacks which we can join .

Day 1:
After having breakfast, we started with Inaugural Function. Then Mentors shared their hack ideas, so that people can join any team according to their interest. Also,we had an aero modelling session followed by the practical where we can see the aircraft fying. After this people moved to the hacker space. Groups were formed and people started working on their ideas. 3D pens were the point of attraction which were brought by Nisha and Siddhesh, also 3D printer setup was a major task on which lot of people were working. 
There was a soldering workshop which was conducted by Jithin in which school students were having two projects. I helped in that work shop by helping students with soldering and troubleshooting as in the end some of the circuits were not working . So I just helped them to fix it.
After this we had lunch, then I moved to the hacker space and tried something with 3D pen. I was quite interested about the dome project after listening about in morning  introduction so went there to see how actually people are trying to implement it. It was good to see that they was able to make a base for their dome, they all were working very hard as it was very difficult task as it include so many skills, as some people were drilling holes in bamboo, some were doing calculations, some were tying the bamboo and many more. So hats off to their team effort. 

In evening after tea break again hackers started with the hacks. Then we had lightening talks and dinner. The day didn't finished here, after dinner there were a lot of discussion around technologies and many other things. I went to bed as I was tired and feeling a bit sleepy but the discussions were still going on and in the morning I came to people went to sleep at 4.30 am. 

Day 2:
In the morning as I stepped outside I can't stop myself to take a round around Sankalp Bhumi as it was so refreshing. Then breakfast was served and after that people started with their hack ideas. As by lunch they have to finish with their hack. After lunch we all gather in the ground for SHD Group Photo, also we did rocket launch made by the students in their workshop. After that hacker moved to main hall to present that ideas, they grabbed a table and set up the project there. Then all people moved to them to see what they have done in the last to days, they explained their projects. After that there was voting to award the best hack.After voting was completed, everyone was waiting curiously for the result in the mean time Hitesh was there to address the crowd. Then the result came and the winning team was awarded. It was great to to see the Team making the Dome won as they had put a lot of hard work as working without caring about the hot weather and also the ground was slippery due to rain last night. Then students went to their home. Discussion continued with Dinner and after.....

Session on Aero Modelling: This session taught about the basics of aircrafts and we get to know the functions of aircrafts parts. Also it was fun watching that aircraft in action as it take off touching the sky and returing back to the ground.

3D Pen: 3D pen the point of attraction for whole from kids to adults. They tried with writing their name to making some 3D images. I also tried some stuffs and make a model for the Dome which people were making.

3D Printer: 3D printer, everyone was excited to see that working. So people were trying to assemble it. It was also interesting

Dome Home: I find it quite interesting as people were quite involved in it starting from drilling, nailing the nails, measuring and tying the bamboos, maintaining the symmetry. Also I loved the chandelier made by the girls as a decorative item for the Dome Home.

Ping-pong Ball:  This was a nice project the students, it was nice to see the ball dancing on the top of water.

Mixture prepared by Praveen Patil:  It was a great effort by Praveen to prepare that liquid mixture on which we can walk. So he made it possible walking on liquid without getting into it. Nice experiment by him.

Interaction with SHD-San Francisco: In SF Science Hack Day was going on in parallel, so it was nice to connect with hackers across the globe.

So, attending Science Hack Day was one of the best part of this year for me. Thanks to all the organizers, sponsors, mentors, volunteers and participants for making this event successful . 
Looking forward to attend SHD-2018.

Keep Hacking........

by Pooja Yadav ( at November 23, 2017 11:57 AM

October 10, 2017

Pooja Yadav

Fedora Women Day-Pune Sept,2017

On Sept 28,2017 we celebrated Fedora Women Day in D.Y PATIL COLLEGE OF ENGINEERING, Pune. As decided we all(Amita, Satyajit, Madhuri and me) were in office at 8.30 to leave for the venue. Amita booked a cab and we headed towards the destination. When we reached the college we were welcomed by Suvarna mam. Lot of things were going on there as they were preparing for some event, some construction work was also going on. All this reminded me of my college days and my memories as a student refreshed after watching the college students busy in different tasks.
Then we had a short break as they have to shift the audience to another room due to more number of participants then expected. After the break we were ready to start the event. It was nice to see that a major part of audience were girls. Then they welcomed us with the sacred plant “Tulsi”, it was an honor to get that.
After that we started with Amita’s talk on the topic “ Women in Open Source”. She started with a motivational discussion about the facts and myths which people have about women and that boosted up the stamina of each and every girl sitting there.  Then she covered What is Fedora and how they can contribute to it. She also talked about Women in Open Source Award and shared stories of some great women. After her talk was over she asked students to come up to give their intro, tell us how they feel about it and in which part they think they can contribute according to their interest. As the students were shy, again she pushed them a bit and promised to give awesome Fedora Women Day stickers :) and Fedora Live CD’s which Praveen gave us, thanks to him for that. Then two girls came up and share their ideas. It was really a very motivating talk by Amita.

Next was Satyajit who was going to show how we can install Fedora in our laptop without messing up with the current OS or our data. As we have a discussion before with the faculty there that some student lost their whole data while installing Fedora, so here he come as a savior for those student. He very clearly explained and showed how they can safely install Fedora from an iso image without harming their data. He helped student to get started with Fedora as most of them were new to Fedora.

After Satyajit it was my turn to explain how they can install various packages and get started after installation of Fedora. So I introduced them to DNF. I gave a brief history of yum, dnf and about transition from yum to dnf. After this I showed them how they can install, update, remove packages using DNF. I gave them basic information about different commands and how they can see help or man pages. I asked some questions in the end and gave stickers to the audience. It was really a great experience with college students.

Then Madhuri came up with her talk on “Fedora loves Python” . She explained about Fedora and Python. She told them how they can contribute to Fedora and showed them different options available where they can contribute according to their interest. It was very informative.

This event was very useful, as most of the student had this in mind that they can contribute only if they know coding. But this cleared all their doubts by giving them a detailed information about the different options available where can contribute according to their interest.

After these session we gave remaining CD’s and Stickers to the students and finished the event with a thank you note. Then after lunch we were back to our office.

It was a great experience and awesome event :-)

by Pooja Yadav ( at October 10, 2017 10:22 AM

September 18, 2017

Rishika Goyal

Behave and Selenium installation steps.

Selenium is a simple API to write functional/acceptance tests using Selenium WebDriver. Through Selenium Python API we can access all functionalities of Selenium WebDriver.

Behave is a simple python module that allows us to write tests in simple natural language.The tests written using behave module are backed up by Python Code which generally uses functionality of selenium for testing the Web Application.

1)Ensure Python3 is installed because we will be using python3
in our example.

2)Setting up Virtual environment.

a) Install vitualenv

pip install virtualenv

b) Create a directory for the project

mkdir project_dir

c) Create a virtualenv inside the directory with python3 as the default interpreter.
cd project_dir

virtualenv -p /usr/bin/python3 my_project

d) Activate the virtual environment

source my_project/bin/activate

3)Installing Behave

Install the python module “behave” in the virtual environment “my_project”

$pip install behave

Check if behave installed properly or not by importing the module in the interpreter.

[rgoyal@localhost ~]$ python3
Python 3.5.3 (default, May 10 2017, 15:05:55)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import behave

The interpreter mustn’t give prompt saying No module named behave

4) Downloading, installing and configuring selenium.
a) Install Selenium in the virtualenv my_project

$pip install selenium

b) Download geckodriver from Downloads section in the link given below.
Geckodriver is Firefox’s web driver that helps in automating . Make sure to download the one that corresponds to your system’s architecture.

Note: The linux 64 bit geckodriver is 3rd in the list

c) After downloading geckodriver, extract the tar ball

$tar -xvf <path of geckodriver>

c) Copy the geckodriver executable to /usr/bin

mv <path to geckodriver> /usr/bin

d) Verify that selenium is correctly installed by running this sample python code

in a file named [You can find this code and it’s explanation here:]

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
assert “Python” in driver.title
elem = driver.find_element_by_name(“q”)
assert “No results found.” not in driver.page_source



The firefox browser must open and take you to the site.

With this you are all set to test your Web Applications.

Happy Coding!!

by PyRishika at September 18, 2017 07:04 AM

September 09, 2017

Samridhi Agarwal

Euler Problem no.30 with Python

This problem statement was quite interesting because that not only judged my coding skills but also my mathematical skills. So i tried to solve it in two different ways –

Problem Statement
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
1634 = 14 + 64 + 34 + 44
8208 = 84 + 24 + 04 + 84
9474 = 94 + 44 + 74 + 44

As 1 = 14 is not a sum it is not included.

The sum of these numbers is 1634 + 8208 + 9474 = 19316.

Find the sum of all the numbers that can be written as the sum of fifth powers of their digits.

Solution –

I first thought of getting the set of numbers (which meet the problem’s criteria) that are to be added, and then add them together to verify that the set is correct and complete.

Secondly, make a list of constraints which put restriction on the solution set. This problem excludes the value 1 from consideration. In fact, by intuitive extension, it is excluding all single digit values (numbers < 10) as they cannot form a sum of digits. This is a clue that our search range starts from at least 10.Now we have to think on the end range that’s the maximum limit till which our code should search. After just a moment of thought it becomes clear that the number of digits for the sum must have the same number of digits as a value.
Look at the table below to get the maximum limit.

Digits Maximum n Limit = 95 x n Comments
9 999,999,999 531,441 they need to have the same no. of digits
8 99,999,999 472,392 nope, still too many digits of n .
7 9,999,999 413,343 not quite there
6 999,999 354,294 a valid search limit

So we got the maximum limit as 354,294 . Now let’s write the code.

Python Code –

TotalSum = 0    
Value = []                             #values to be added

#Range we got and then comparing the values according to criteria
for i in range(10, 354294): 
    Sum = 0                       #This sum is for getting one single value 
    for x in str(i):
        Sum += int(x) ** 5        #checking for main condition with power 5 
    if Sum == i:                  #If the sum matches with the value 
        Value.append(i)           #The value we are in search for 

# We add those values stored in the list to get total Sum
for i in Value:
    TotalSum += i

print ("Values :" , Value)
print ("TotalSum :" , TotalSum)

Output ->

Values : [4150, 4151, 54748, 92727, 93084, 194979]
TotalSum : 443839

I also tried with other way by defining a function.

Python Code ->

def power_of_digits(n, exp = 5):
    Sum = 0
    while n > 0:
       Sum += (n % 10)**exp
       n //= 10
    return Sum

total = 0
for i in range(10, 10**6):
    if power_of_digits(i) == i:
        total += i

Output ->


Happy Coding! 🙂

by samridhiagarwalblog at September 09, 2017 02:55 PM

September 07, 2017

Samridhi Agarwal

Euler Problem no. 4 with Python

I Solved the 4th problem from the Euler’s problem set using python and found that it can be done in multiple ways. The problem is related to palindrome concept.

Problem Statement – 
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the product of two 3-digit numbers.

I first approached the problem statement by thinking that how many maximum digits will a number have so 2 three digits will have max 6 digits number when multiplied and that can be easily achieved by first multiplying the biggest numbers so I took a reverse loop. And then checked the condition of being a palindrome number and displayed the greatest one after comparison .

Python Code ->

palindrome = 0 
# 2 variables to find the biggest palindrome
for a in range(999, 100, -1):       #First factor

#second factor starts from a so that one multiplication does not repeat.  
    for b in range(a, 100, -1): 
        number = a * b  
        if number > palindrome: 

#To check if number is a palindrome. 
            x = str(a * b)   
            if x == x[::-1]:  
                palindrome = a * b  

Output ->


Trying More Euler’s Problem and the same code with C++. 🙂

by samridhiagarwalblog at September 07, 2017 02:50 PM

Back to Coding Life!

After all this long time I returned back to my hostel (after a lot more traveling and sad days). Everything seems stable now and I wish this remains for a longer time. So today as I returned back there were many things and many tasks to be completed – the internship work (mainly), I missed the dgplug sessions 😦 (reading the logs), Assignments and College.

So Completed with few things now and enjoyed the whole day with my laptop (after 7 days long holiday). First I did the tasks of the internship work (still left with much more). Read the previous 4 logs which i missed (dgplug). There was a session in dgplug where warthog9 was there for the guest session. He was the one who gave us the battle bunnies in the PyCon Pune 2017 and i also wanted to ask him few things about the bunnies but hard luck missed the chance! But the session was great i read the logs and got to learn many things about hardware. 

I think I will take one more day to return to the normal schedule where i can write atleast two codes a day and learn things. Still I tried to complete most of the things (satisfied by myself 😛 ).

by samridhiagarwalblog at September 07, 2017 02:26 PM

August 25, 2017

Samridhi Agarwal

Euler Prolem no. 2

I solved the second question from the euler’s problem set with python first then i tried to do the same with c++ and I realized that it just does the same thing and same logic to be applied just increasing number of lines to code in C++.

Problem Statement – By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

So I will start with how I first thought of writing a precise and simple code. As the last digit in the Fibonacci series is the sum of all the prior numbers so if we minus all the odd values from last digit that is 4 million, we will get sum of all even numbers. But i went with searching for all the even numbers one by one till 4 million and adding them.

Python Code ->

sum = 0               # Assign variable sum as 0
a, b = 0, 1                # Taking a and b as values in Fibonacci series
while b < 4000000:         # Last value should be 4 million
    if b % 2 == 0:         # Checking if even
        sum += b           # Adding up all even values
    a, b = b, a + b        # swapping first value with second
print(sum)                 # print the sum 

Output ->


C++ Code  ->

using namespace std;
int main()
	int sum = 0;
	//3 variables to create the Fibonacci sequence from 0 to 4000000
	int a = 0;
	int b = 1;
	int c = 0;
	while (b <= 4000000)
		c = a + b;
		if (b % 2 == 0)      //check for even number
			total += b;
		a = b;
		b = c;
	cout << sum <<endl;
	return 0;

Output ->


Practicing more Euler’s problem.

by samridhiagarwalblog at August 25, 2017 05:33 AM