Planet dgplug

May 23, 2018

Jason Braganza (Doppelgänger)

Writing Day 30 – Experience as a Moat

I get both optimistic and a little lost and hopeless now a days.

What if I never do what I’m aiming to?
What if I can’t catch up with the young ones of DGPLUG?
What if the newer ones pass me right by as an old fogey?

And somewhile ago, I’d read this. And this.

And that got me thinking.

I’ve been working for 20 years now.
And when it comes to stuff I know, I know stuff.
It’ll take any johnny-come-lately tonnes of effort (not to mention, how many hours of their life) to know what I know.

And that got me thinking further.

Not everyone is an autodidact (like cough yours truly cough)
Not everyone loves to put in the work.

And that’s the meta skill I’m building right now.
To show up every day. To do the work.

If I do that, I will pick up skills.
And they will accrete.

And I will have my moat again.

Come to think of it, I have two moats now.

  • My experience (what I have and what I’m buiding)
  • My love of learning.

And that I think, will be the wind in my sails …

by Mario Jason Braganza at May 23, 2018 06:31 PM

May 22, 2018

Jason Braganza (Doppelgänger)

Writing Day 29 – Conspiracy


Started: 2018-03-18
Finished: 2018-03-19

I think most of my writing about books will be just short stabs like this.
Or I’ll never get to anything in time.

I was supposed to start with Perennial Seller and then this popped up and looked like less intensive, so I picked it up first.

Well, it’s an awesome, racy read.
And something only Ryan Holiday could have done justice to.
He writes almost objectively, never hiding his biases.

Sometime in late 2007, Gawker publication Valleywag, outed Peter Thiel as gay.
And nearly ten years and ten million dollars later, Peter Thiel burned Gawker Media to the ground by secretly backing another Gawker victim with his case against Gawker in court.

So what happened in between?
Well, that’s what the book is about.

The sheer amount of hopelessness, hubris, desspair, planning, plotting, conspiracy in the whole book is almost perversely delightful.

I don’t agree with Thiel on most of what he does. (Palantir … Trump … )
But when I put myself into his shoes, what would I have done, if I was violated and I had the means to strike back?
I know that feeling of despair when I have been wronged, and yet I couldn’t do anything about it
I would have done exactly what he did.

And while the book is about conspiracy, the part that I identified the most with, was the fact that Peter was the only one with the balls to call Gawker’s bluff.[1]
Gawker upset a lot of rich folk and large companies.
Yet, it was only Peter who did something about it.

And I identify with it, because I did exactly that after nearly 4 years of being bullied and blackmailed in high school.
Reading this brought back memories …
Driving an enemy into the ground, so completely that they’ll never do harm again, is exhilirating.
I’ve never let myself be helpless ever again.

And while I’ve taken Marcus Aurelius’ exhortation[2] to heart, there is also a bit of truth to this quote from the book …

I couldn’t stand it. I still can’t stand it.
I can’t stand the way things are. I cannot tolerate this age.
What is more, I won’t.
That was my discovery: that I didn’t have to.
—Walker Percy, Lancelot

  1. And the fact that revenge is a dish best served cold. ↩︎

  2. The best revenge, is not to be like that ↩︎

by Mario Jason Braganza at May 22, 2018 11:54 PM

May 21, 2018

Mario Jason Braganza

Python Day 1 - Daily Programming

OK, so soft start to learning to program daily.

Plan is to work at a problem for an hour and then write it up.

Really low bar for now, so simple problems and rushed writing.

Same goal as the writing project. 365 days of Python :)

Start slow, work at it daily and build discipline.

Except, somehow this feels like a lot of pressure, unlike writing or guitar.
I want this to be my livelihood and I somehow seem to not ever get a toehold on it.
I just hope my small successes in leveling up Maths and nearly a month of writing carry over to programming.

Deep breaths. Here we go. Again.

by Mario Jason Braganza at May 21, 2018 03:40 AM

May 11, 2018

Anwesha Das

Is PyCon 2018 your first PyCon?

Is PyCon 2018 your first PyCon? Then you must have had a sleepless night. You must be thinking “I will be lost in the gathering of 3500 people.” There should be a lot of mixed emotions and anticipation. Are you the only one who is thinking this way? Do not worry it is same with everyone. How can I assure that? I had my first PyCon US in 2017 and I too like you and everyone else had gone through the same feeling.



Once you enter the area the first thing you have to do is to register yourself. The people at the registration desk are really helpful so do not hesitate to ask your heart out. If there is a problem ever helpful Jackie will be there to guide you. (If you meet her please say her “hi” for me :) ). And if you are volunteering please welcome first timers specially, it really makes them feel at home.

The registration is done and you have the schedule now. Mark the talks you want to attend and their respective halls too. You might want to set an alarm for that, as you might tend to miss them being busy in the hallway tracks (trust me I have missed a few!).

So now what to do? What are the interesting things to do in PyCon?

Hallway tracks


Hallway tracks are the best place to find friends. For many people this is the core of the conference. Many people prefer to attend hallway tracks more than actual talks :). People gather on the hallway and discuss not only Python or programming but culture, politics, business, food several non connected topic. Choose a conversation you are comfortable with and join. You might get your next project idea there. The same rule applies to the lunch time also. Do not be shy to talk to the person next to you. You might find the person who wanted to meet. People are welcoming here. Ask them if you can join they would generally love the idea. If you are regular at PyCon please include a new PyCon attendee in your group :)

Booth visit

The sponsors are the people who makes the conference run. So visit them. You might find the new, interesting gig you are looking for. And yes do not forget to collect the cool swags.


5k Fun Run/Walk

If you love to run, you may like to join the 5K run. Ashley, is there at the 5K Fun Run/ Walk booth (turn to the right of registration booth) to help.Please pick up your bib, shirt, and information on getting to the park!

Board game night

Inquire about the board game night, if you are interested.

PyLadies Lunch

It is the lunch by and for the PyLadies. A gathering of women who love to code in Python. If you consider yourself a PyLady do attend it, talk about your local PyLadies chapter, your hardels and success. You never know one of your personal story might inspire another PyLady to grow and face her own struggle. You will find similar minded people over there. And never miss to give shout out for the PyLady who in anyway had inspired you. You may always take names instead of a name. If you are there please raise a toast on my behalf for Naomi, Lorena, Ewa, Carol, Betsy,Katie, Lynn,Jackie and yourself too :). So register now.

No photo please

PyCon gives you the space/right to be anonymous, not to be clicked. If you do not want to be clicked please get out of the frame and convey your wish. You can also ask the person to delete the photo which mistakenly has you.

The pronoun you prefer

While registering take the 'The pronoun I prefer' badge.

PyLadies Auction

Saturday night is the PyLadies auction. Be a part of this fun fair (with a good cause). Read about it here.

Quite room

If you want to work, want to be left alone, need some space in the gathering of 3500 people find the quite room.

First time speaker?

Are you speaking for the first time in PyCon? Nervous? Do not want to leave any room for mistake? Want to rehears your talk? There is a speakers room to practice. Another easy way to rehears is, grab someone (whose opinion you value) and give the talk to her. This will give you a proper third eye view and tentative response of the audience. Last year Naomi helped me to do this. She sat with me for hours and corrected me. Never had a chance to say, “Thank you Naomi”.

Poster Presentation and Open Spaces

Do not forget to visit Poster Presentation and Open Spaces and know what is happening at the current Python world.

Code of Conduct

PyCon as [Peter] says is the “holy gathering of the Python tribe”, we all are the part of a diverse community, please respect that. Follow the Code of Conduct. This is the rule book and at all time, you have to abide by. If you have any issue please do not hesitate to contact the staff. Be rest assured that they will take required measures. Lastly do not hold yourself back form saying “sorry” and “thank you”. These two magically words can solve many problems.

One thing for sure your life after these 3days will be completely different. You will be back wealthy with knowledge, lovely memory and friends.


PS: A huge shout out for the PyCon staff for working relentlessly over the year to put up this great PyCon to you. And thank you for coming a =nd attending PyCon and making it a great event it is.

by Anwesha Das at May 11, 2018 04:17 PM

PyLadies at PyCon

In 2013, I was going through PyCon photos. The album was full of pictures of very serious looking geeks engrossed in their favorite back and green screen. Suddenly I saw the photos of people laughing, enjoying and joking . Many of them were women. Dazzled by the beautiful ladies, I asked my fortunate half(, “what is this place?”, “Who are these people?”

“This place is magic”, he replied. This was the night of the PyLadies Auction. Me, “What is PyLadies?”“PyLadies is a global mentorship group. It focus, helps women to take active part in Python open source community. They are group of women who love to code Python. And this is the night when PyLadies organizes this auction. The money collected here goes to PyLadies. So it fun, laughter, good time and a good cause all at the same place.” This, dear reader, was my first introduction to PyLadies.

And at that time I never (even in my wildest dreams) imagined that one day I would become a part of this beautiful group, and be fortunate enough to call these amazing ladies my friends.

From then on, every year I used to wait for these pictures to arrive. I was super excited when Kushal used to explain me the pictures,

“Heres Katie singing the ‘Let it go’ song to get a bigger bid for the Frozen poster.”
“This is Doug,he takes care of the auction."
“ Look at Brett, as Andrea is biding."
I got to know each one of them before meeting them in person.

I started collecting interesting things all through the year, for the auction. And eagerly wait to know the amount of money it brought to the PyLaides account.

In 2017 I finally had the opportunity to be a part of this fun fair. And what a night it was!. I still remember each moment vividly. We collected $21,275/-, the highest till date.

I also noticed that anything to do with Python, (the common love factor) would sell in higher price. When I was collecting things for this year’s auction I kept that in mind. As I travelled to various PyCons I kept collecting items, that I thought would relate.

The first two things I got were from PyCon UK.

The thing that I noticed once I reached PyCon UK were the name badges. They had the characters of famous British personaliies, like Alan Turing, Sherlock Holmes, Dr. Who and several more on them. Those awesome-cool badges were designed by - Steve Hawkes.

The second is a pair of cool Python socks.

The PyCon UK organizers were really kind to give me a pair of those socks and the whole set of name badges. They were also signed by the designer Steve.

Next stop was PyCon India.

The opening keynote by Noufal Ibrahim. It was titled as “Mentoring - What, Why and How.” He discussed about the various aspects of mentoring relating many of his personal experiences. It was so informative and helpful. The thing apart form his keynote that caught everyone’s attention were his beautiful slides. Being the awesome calligrapher that he is, these were a beautiful set of calligraphic sheets. And also being the truly nice person he is, had graciously donated the original slides to the PyLadies auction. So while people in the conference were all praising them, I was like “Yeah! These are ours”.

PyCon India Day 1, after lunch I took a little time off from the PSF and the PyLadies booth and went to check out the other booths.

Something caught my attention, and I froze (literally) it was pencil sketch of Noufal. It was made by a girl named Shiny Parashar. This amazing artist had made the sketches of the three keynote speakers (lucky them). I was awestruck by those. Then an idea struck me, ‘What if she’d paint something for us to auction?’ And Shiny readily agreed. She came up with a gorgeous sketch of Gudio Van Rossum. Bonanza! It is now signed by Gudio himself.


Apart from the above mentioned items there are other cool items too such as PyCon Guitar, painting by Lynn Root, stained glass Python logos sponsored by nnja and Microsoft! and a surprise pack by Kaite, famously known as the PyLadies Auction Queen along with many other awesome stuff.

Thank you everyone for your kind donations and gracious endeavor,it is truly appriciated.

People at PyCon, come one, come all and be a part of this great, fun cause and help us spread Pythonomania all over the globe.
See you on Saturday night.

PS: If the your budget is tight and you lost the fight in auction, you can always go and collect PyLadies swag from the PyLadies booth.

by Anwesha Das at May 11, 2018 01:37 PM

May 09, 2018

Kushal Das

SecureDrop development sprint in PyCon 2018

SecureDrop will take part in PyCon US development sprints (from 14th to 17th May). This will be first time for the SecureDrop project to present in the sprints.

If you never heard of the project before, SecureDrop is an open source whistleblower submission system that media organizations can install to securely accept documents from anonymous sources. Currently, dozens of news organizations including The Washington Post, The New York Times, The Associated Press, USA Today, and more, use SecureDrop to preserve the anonymous tipline in an era of mass surveillance. SecureDrop is installed on-premises in the news organizations, and journalists and source both use a web application to interact with the system. It was originally coded by the late Aaron Swartz and is now managed by Freedom of the Press Foundation.

How to prepare for the sprints

The source code of the project is hosted on Github.

The web applications, administration CLI tool, and a small Qt-based GUI are all written in Python. We use Ansible heavily for the orchestration. You can setup the development environment using Docker. This section of the documentation is a good place to start.

A good idea would be to create the initial Docker images for the development before the sprints. We have marked many issues for PyCon Sprints and also there are many documentation issues.

Another good place to look is the tests directorty. We use pytest for most of our test cases. We also have Selenium based functional tests.

Where to find the team?

Gitter is our primary communication platform. During the sprint days, we will in the same room of the CPython development (as I will be working on both).

So, if you are in PyCon sprints, please visit us to know more and maybe, start contributing to the project while in sprints.

by Kushal Das at May 09, 2018 05:55 PM

April 20, 2018

Farhaan Bukhsh

Writing Chuck – Joke As A Service

Recently I really got interested to learn Go, and to be honest I found it to be a beautiful language. I personally feel that it has that performance boost factor from a static language background and easy prototype and get things done philosophy from dynamic language background.

The real inspiration to learn Go was these amazing number of tools written and the ease with which these tools perform although they seem to be quite heavy. One of the good examples is Docker. So I thought I would write some utility for fun, I have been using fortune, this is a Linux utility which gives random quotes from a database. I thought let me write something similar but let me do something with jokes, keeping this mind I was actually searching for what can I do and I landed up on jokes about Chuck Norris or as we say it facts about him. I landed up on they have an API which can return different jokes about Chuck, and there it was my opportunity to put something up and I chose Go for it.


The initial version of the utility which I put together was way simple, it use to make a GET request stream the data in put in the given format and display the joke. But even with this implementation I learnt a lot of things, the most prominent one was how a variable is exported in Go i.e how can it be made available across scope and how to parse a JSON from a received response to store the beneficial information in a variable.

Now the mistake I was doing with the above code is I was declaring the fields of the struct with a small letters this caused a problem because although the value get stored in the struct I can’t use them outside the function I have declared it in. I actually took a while to figure it out and it was really nice to actually learn about this. I actually learnt about how to make a GET request and parse the JSON and use the given values.

Let’s walk through the code, the initial part is a struct and I have few fields inside it, the Category field is a slice of string, which can have as many elements as it receives the interesting part is the way you can specify the key from the received JSON how the value of received JSON is stored in the variable or the field of the struct. You can see the json:"categories" that is the way to do it.

With the rest of the code if you see I am making a GET request to the given URL and if the it returns a response it will be res and if it returns an error it will be handled by err. The key part here is how marshaling and unmarshaling of JSON takes place.

This is basically folding and un-folding JSON once that is done and the values are stored to retrieve the value we just use a dot notation and done. There is one more interesting part if you see we passed &joke which if you have a C background you will realize is passing the memory address, pass by reference, is what you are looking at.

This was working good and I was quite happy with it but there were two problems I faced:

  1. The response use to take a while to return the jokes
  2. It doesn’t work without internet

So I showed it to Sayan and he suggested why not to build a joke caching mechanism this would solve both the problems since jokes will be stored internally on the file system it will take less time to fetch and there is no dependency on the internet except the time you are caching jokes.

So I designed the utility in a way that you can cache as may number of jokes as you want you just have to run chuck --index=10 this will cache 10 jokes for you and will store it in a Database. Then from those jokes a random joke is selected and is shown to you.

I learnt to use flag in go and also how to integrate a sqlite3 database in the utility, the best learning was handling files, so my logic was anytime you are caching you should have a fresh set of jokes so when you cache I completely delete the database and create a new one for the user. To do this I need to check of the Database is already existing and if it is then remove it. I landed up looking for the answer on how to do that in Go, there are a bunch of inbuilt APIs which help you to do that but they were misleading for me. There is os.Stat, os.IsExist and os.IsNotExist. What I understood is os.Stat will give me the status of the file, while the other two can tell me if the file exists or it doesn’t, to my surprise things don’t work like that. The IsExist and IsNotExist are two different error wrapper and guess what not of IsExist is not IsNotExist, good luck wrapping your head around it. I eventually ended up answering this on stackoverflow.

After a few iteration of using it on my own and fixing few bugs the utility is ready except the fact that it is missing test cases which I will soon integrate, but this has helped me learn Go a lot and I have something fun to suggest to people. Well, I am open to contribution and hope you will enjoy this utility as much as I do.

Here is a link to chuck!

Give it a try and till then Happy Hacking and Write in GO! 

Featured Image:

by fardroid23 at April 20, 2018 07:42 AM

Mario Jason Braganza

MathJax on a Ghost Blog


Install this script into the footer in the Code Injection section

<script type="text/javascript" async

(that should autoupdate MathJax versions or if it all breaks and goes to hell, get the latest install instructions here)

If I’ve done this right, this little piece of LaTeX should give me the quadratic equation

$$ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} $$

$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} $$

Et voila!

by Mario Jason Braganza at April 20, 2018 05:56 AM

April 13, 2018

Kushal Das

Latest attempt to censor Internet and curb press freedom in India

A branch of the Indian government, the Ministry of Information and Broadcasting, is trying once again to censor Internet and Freedom of Speech. This time, it ordered to form a committee of 10 members who will frame regulations for online media/ news portals and online content.

This order includes these following Terms of Reference for the committee.

  • To delineate the sphere of online information dissemination which needs to be brought under regulation, on the lines applicable to print and electronic media.
  • To recommend appropriate policy formulation for online media / news portals and online content platforms including digital broadcasting which encompasses entertainment / infotainment and news/media aggregators keeping in mind the extant FDI norms, Programme & Advertising Code for TV Channels, norms circulated by PCI, code of ethics framed by NBA and norms prescribed by IBF; and
  • To analyze the international scenario on such existing regulatory mechanisms with a view to incorporate the best practices.

What are the immediate problems posed by this order?

If one reads carefully, one can see how vague are the terms, and specifically how they added the term online content into it.

online content means everything we can see/read/listen do over cyberspace. In the last few years, a number of new news organizations came up in India, whose fearless reporting have caused a lot of problems for the government and their friends. Even though they managed to censor publishing (sometimes self censored) news in the mainstream Indian media, but all of these new online media houses and individual bloggers and security researchers and activists kept informing the mass about the wrongdoings of the people in power.

With this latest attempt to restrict free speech over the internet, the government is trying to increase its reach even more. Broad terms like online content platforms or online media or news/media aggregators will include every person and websites under its watch. One of the impacts of mass indiscriminate surveillance like this is that people are shamed into reading and thinking only what is in line with the government, or popular thought .

How do you determine if some blog post or update in a social media platform is news or not? For me, most of things I read on the internet are news to me. I learn, I communicate my thoughts over these various platforms on cyberspace. To all those computer people reading this blog post, think about the moment when you will try to search about “how to do X in Y programming language?” on Internet, but, you can not see the result because that is blocked by this censorship.

India is also known for random blockades of different sites over the years. The Government also ordered to kill Internet for entire states for many days. For the majority of internet blockages, we, the citizens of India were neither informed the reasons nor given a chance to question the legality of those bans. India has been marked as acountry under surveillance by Reporters Without Borders back in 2012.

Also remember that this is the same Government, which was trying to fight at its best in the Supreme Court of India last year, to curb the privacy of every Indian citizen. They said that Indian citizens do not have any right to privacy. Thankfully the bench declared the following:

The right to privacy is protected as an intrinsic part of the right to life and personal liberty under Article 21 and as a part of the freedoms guaranteed by Part III of the Constitution.

Privacy is a fundamental right of every Indian citizen.

However, that fundamental right is still under attack in the name of another draconian law The Aadhaar act. A case is currently going on in the Supreme Court of India to determine the constitutional validity of Aadhaar. In the recent past, when journalists reported how the Aadhaar data can be breached, instead of fixing the problems, the government is criminally investigating the journalists.

A Declaration of the Independence of Cyberspace

Different governments across the world kept trying (and they will keep trying again and again) to curb free speech and press freedom. They are trying to draw borders and boundaries inside of cyberspace, and restrict the true nature of what is it referring to here?.

In 1996, late John Perry Barlow wrote A Declaration of the Independence of Cyberspace, and I think that fits in naturally in the current discussion.

Governments of the Industrial World, you weary giants of flesh and steel, I come from Cyberspace, the new home of Mind. On behalf of the future, I ask you of the past to leave us alone. You are not welcome among us. You have no sovereignty where we gather. -- John Perry Barlow

How can you help to fight back censorship?

Each and every one of us are affected by this, and we all can help to fight back and resist censorship. The simplest thing you can do is start talking about the problems. Discuss them with your neighbor, talk about it while commuting to the office. Explain the problem to your children or to your parents. Write about it, write blog posts, share across all the different social media platforms. Many of your friends (from other fields than computer technology) may be using Internet daily, but might not know about the destruction these laws can cause and the censorship imposed on the citizens of India.

Educate people, learn from others about the problems arising. If you are giving a talk about a FOSS technology, also talk about how a free and open Internet is helping all of us to stay connected. If that freedom goes away, we will lose everything. At any programming workshop you attend, share these knowledge with other participants.

In many cases, using tools to bypass censorship altogether is also very helpful (avoiding any direct confrontation). The Tor Project is a free software and open network which helps to keep freedom and privacy of the users. By circumventing surveillance and censorship, one can use it more for daily Internet browsing. The increase in Tor traffic will help all of the Tor network users together. This makes any attempt of tracking individuals even more expensive for any nation state actors. So, download the Tor Browser today and start using it for everything.

In this era of Public private partnership from hell, Cory Doctorow beautifully explained how internet is the nervous system of 21st century, and how we all can join together to save the freedom of internet. Listen to him, do your part.

Header image copyright: Peter Massas (CC-BY-SA)

by Kushal Das at April 13, 2018 04:01 AM

April 04, 2018

Saptak Sengupta

What's the preferred unit in CSS for responsive design?

Obviously, it's %. What a stupid question? Well, you can sometimes use em maybe. Or, maybe vh/vw.  Well, anything except for px for sure.

Sadly, the answer isn't as simple as that. In fact, there is no proper answer to that question and depends a lot on the design decisions taken rather than a fixed rule of making websites responsive. Funny thing is, many times you might actually want to use px instead of % because the later is going to mess things up. In this blog, I will try to describe some scenario's when each of the units work better in a responsive environment.

PS: All of this is mostly my personal opinion and working experience. Not to be mistaken as a rule book.

Where to use %?

Basically, anywhere you have certain kind of layout or grid involved. I use % whenever I feel that the screen needs to be divided into proportions rather than fixed sizes. Let's say I have a side navigations area and the remaining body in a website. I would use % in this case to measure the margins and the area of distribution. Since I definitely want to vary them on changing screen. Or a grid of rows and columns. I will want the width of the grid to be in percentage so that the number of columns allowed change with the width of the screen.

Another use of percentage is while determining the margin of an element. You might want to have much more margin on a wider screen than in a smaller screen. Hence, often the margin-left and margin-right are advisable to be in percentage.

Also, for fonts and typography elements, you should use % since px isn't compatible with W3C standards of accessibility.

PS: A lot many times, it is preferable to use flexbox and grid layout instead of trying to layout things via margins and floats.

Where to use px?

To be honest, yes, it is better to avoid px when you think of making things fluid in responsive. But having said that, there are some cases where even in a fluid design, you want things to have a fixed value. One of the most commonly used examples is top navigation height. You don't want to change the height of the top navigation bar's height with the change in screen size. You might want the width to change or show a hamburger button instead of showing the list of hyperlinks, but you most often want to keep the height of the navigation bar fixed. You can either do it by setting height attribute of CSS or maybe you want to do it with padding, but the unit mostly should be px.

Another use would be for margin of an element but this time the top and bottom margins instead of left and right. Mostly, when you have your website divided into sections, you would want the margin between the different sections to be of a fixed value and not to change with the screen width.

Where to use em?

em is mainly to be used while setting font-sizes and typography elements. By that I mean wherever I have a text involved it is often good to use em. The size of em basically depends on the font-size of the parent element. So if the parent element has 100% font-size (default browser font-size), then 1 em = 16px. But em is a compounded measure. So the more and more nested elements you have the idea or measure of em keeps changing. So it can often be very tricky to work with em. But this is also a feature that might sometimes help to get a compounded font size.

Where to use rem?

The main difference between em and rem is rem depends on the font-size of the root element of a website(basically root-em) or the <html> element. So whatever be the font-size of the root element, rem is always computed based on that and hence unlike em, the computed pixel value is more uniform throughout the website. So rem and em usability depend highly on the use case.

Where to use vh or vw?

vh and vw stand for viewport height and viewport width. The advantage of vh or vw over width is that you can control based on both the height and the width of the media screen that appears in the viewport. 1vh basically means 1% of viewport height. So if you want something to take the entire height of the screen, you would use 100vh. This has applications in both setting width and also setting font-sizes. You can mention the font-size of a typography will either change based on the height or on the width of the viewport instead of the font-size of your parent element. Similarly, you can also set line height based on viewport height instead of the parent element measures.

Where to use media queries?

Even after using all of the above strategically, you will almost necessarily need to use media queries. Media queries are a more definitive set of CSS codes based on the actual media screen width of the device. Mostly, we use it in a conditional way similar to other programming languages. So we can mention if media screen width less than 720px, make this 10% wide, else make it 25% wide. Well, but why do we need it? The main reason for this is the aspect ratio of screens. In a desktop, the width of the screen is much more than the height and hence 25% wide might not occupy a whole lot of screen. However, in a mobile screen where the width is much smaller than the height, 25% might actually occupy more area than you want it to. Hence media queries are needed so that when there is a transition from wide screens to narrow screens, even the percentage widths are changed.

As far as I feel, there are use-cases and scenarios where each of them might be useful. Yes, px is the least used unit if you are concerned about responsiveness, but there will definitely be some elements on your website to which you want to give a fixed width or height. All the other measures are changing, but the way they change is different from each other and hence depends a lot on the designer and the frontend. Also, CSS4 has added a lot of new features which at least make handling of layout lot easier than before.

by SaptakS ( at April 04, 2018 11:47 AM

April 02, 2018

Saptak Sengupta

FOSSASIA 2018: Conference Report

FOSSASIA 2018 was my 2nd FOSSASIA conference and this year it was at a new venue (Lifelong Learning Institute), and for a longer time. As always, there were a lot of speakers and a lot of really exciting sessions. Last year I was a little confused, so this year I planned earlier which all talks to attend and what all to do.

22nd March (1st Day)

The opening ceremony was kicked off by Harish Pillay and Damini Satya, both of whom did an incredible job on hosting the entire day. The opening ceremony was followed by the keynote talks and a panel discussion which lent a great insight into how open source, AI, blockchain and all other modern day technologies are working hand in hand with each other. Harish Pillay also shared his view how he thinks AI won't take over the human beings but rather human beings will evolve to become something which is a combination of human beings and AI and hopefully have a good future. I do agree with him to some extent.

Hong addressed the audience stating the primary focus of FOSSASIA in the next few years and how it involves helping more developers get involved in open source and making new cool things. Codeheat winners were awarded next for their wonderful contributions in different FOSSASIA projects. The mentors of the projects were also honored with medals, which was kind of something I wasn't expecting. Then, it was time for the track overviews to help people understand and know what the different tracks were all about. We told what the tracks were and why the audience should be interested. With that, it was time for the most important track - The Hallway Track. So people talked and networked in the exhibition area for the rest of the day.

23rd March (2nd Day)

I was the moderator of the Google Training Day and also the cloud track in one of the rooms. Which meant getting up early, and reaching there on time. Fortunately, I made it on time (I still don't know how). Being the moderator, I was there almost the entire day. Which meant a lot of Google Cloud learning for me. So the talks ranged from using BigQuery to handle queries in big data to using Cloud ML to do Machine Learning Stuff. The Google Training Day talks were followed by a talk on serverless computing and tutorial on kubernetes. After that, it was again time to hang out in the exhibition area and talk with people.

24th March (3rd Day)

Today was the day of my talk. I was pretty worried the night before whether I would be able to make it to my own talk since it was at 9.30 in the morning. I did make it to my talk. But what was more surprising was, there were actually more people than I expected at 9.30 in the morning which was great. Apart from few technical glitches in the middle of my talk, everything went pretty smoothly. I talked about how we at Open Event decoupled the architecture to have a separate backend and frontend now and how it's really helpful for development and maintenance. I also gave a brief overview of the various architectures involved and the code and file structures.

After finishing my talk, I attended the SELinux talk by Jason Zaman. SELinux is a very confusing and mystified topic for most people and there was no way I was missing this talk. He gave a hands-on about setting up SELinux policy and how to use audit logs. Next was the all-women panel about open source and tech. After this was the necessary group photo where the number of participants made it a little too difficult for the photographer.

The remaining of the day was pretty involving where I mentored in the UNESCO hackathon, helped with video recording and so on.

25th March (4th Day)

The final day of the event. I was really interested in attending the talk about Open Source Design by Victoria and hence reached the venue by 10 am in the morning. It was a great insight as to how Open Source Design is involving and bringing in more and more designers into open-source which is really great. The last session I was eagerly waiting for was the GPG/PGP key signing event. Had a lot of fun helping people create their first GPG/PGP keys and signing. Met and interacted with some really awesome people there.

At last, it was time for the conference closing ceremony. But it wasn't over yet. We all met over at hackerspace where I had some great discussions with people about the different projects I work on and was really great to have their views.

All in all, it was really great meeting old friends, making new friends and meeting people whom I actually knew only by their nick. More than the talks in itself what makes a great conference is the people in it and the chance to meet them once in a year. At least that's how I see them. And FOSSASIA 2018 met that purpose wonderfully.

by SaptakS ( at April 02, 2018 05:14 AM

March 14, 2018

Sanyam Khurana

International Women's Day with WoMoz in Delhi

We all know that every year, 8th March is celebrated as International Women's Day. It is a focal point in the movement for women's rights. On this occasion, all the Open Source communities in and around Delhi came forward to hold a mega-meetup to encourage more women to take active part in Open Source & Tech on March 10, 2018.

We were astonished to see the huge turn around of 180 people including 150+ women participants.

Group photo of all attendees

Mozilla Delhi, PyDelhi, PyLadies Delhi, LinuxChix India, Women Who Code Delhi, Women Who Go Delhi, Women Techmakers Delhi, and Women in Machine Learning and Data Science were the communities helped up in shaping the event.

Here are some of the volunteers who helped to make the event possible

Group photo of volunteers

We had 3 main technical talks which were all presented by Women having a decade of experience working in the technical field. Apart from that, we had several other lightening talks and community talks.

Group photo of volunteers

Kanika gave a lightening talk on "WoMoz" & encouraged students to contribute to Mozilla.

Group photo of volunteers

Later, I got a chance to give a lightening talk on "Why you should contribute to Open Source", to help & encourage folks to contribute to Open Source projects.

Group photo of volunteers

I want to thank everyone who helped with the event & Adobe for sponsoring the venue. Don't forget to join the Open Source groups in & around Delhi that you're interested in. As always, if you need any help on contributing, drop me a mail at Sanyam [at] SanyamKhurana [dot] com.

You can check out more photos of the event from here

by Sanyam Khurana at March 14, 2018 09:21 PM

March 01, 2018

Sanyam Khurana

MozAMU: Mozilla Addons Development at AMU

It all started with PyCon India. I met a few students of Aligarh Muslim University who were trying to teach about FOSS in their college. A few them were already contributing to Coala. We talked a bit and they were discussing problems they were facing to run that community. I already started a Mozilla community at my college in the earlier days. Since I brought up a lot of folks from my college community in the event, we together discussed How to nurture FOSS communities in college as part of PyCon India Open Spaces. Here is a glimpse of the same:

PyCon India Open Spaces on how to nurture FOSS communities in college

Later, these folks were excited and invited me as a speaker at their college. A lot of planning happened for the event and we were in touch almost daily for different things. We planned the event one and a half month in advance. Finally, on 24th Feb 2018, we decided to have a full-day event around FOSS at Aligarh Muslim University.

We left from Delhi at around 6:30 AM in the morning. We then halted at a cafe known as Break Point around Aligarh to have breakfast. We reached the university at around 10:20 AM.

We took some time to test the entire set-up and the event began at around 11:30 AM. I took the first session on Why you should contribute to Open Source. We discussed the question that somehow pops up sooner or later into everyone's mind while contributing to Open Source: What's in it for me?.

We discussed various pathways one can begin contributing to Open Source Projects like coding, writing docs, managing team, advocacy, documentation, translation, bug triaging, reviews, organization skills, soft skills & tons of other things that come as a by-product.

Curious & enthusiastic attendees learning about different contribution pathways in FOSS

You can find the slides here: Why you should contribute to Open Source?.

Curious & enthusiastic attendees at Mozilla AMU

We had a break for sometime and then started with the much awaited Add-ons session. Everyone was very excited to start learning to develop add-ons. I began with explaining the initial setup details & discussed JSON briefly to bring everyone on the same page. To make most out of the event, We also organized a few events previously to teach basics of JavaScript & JSON so that students so that they do not feel overwhelmed with the add-ons development.

Curious & enthusiastic attendees learning from Sanyam Khurana (CuriousLearner)

Then Shashank (@realslimshanky) took over and discussed manifest.json and it's importance. Later we developed a simple addon -- borderify, which displays a border on every site the user visits. Some students also modified their scripts to make their add-ons do different things and posted them on twitter. Shashank, me and Shivam Singhal (@championshuttler) helped everyone with their problems during the development phase.

Curious & enthusiastic attendees learning from Sanyam Khurana (CuriousLearner)

Since all of us are devs, we were able to quickly resolve queries of students. One of the most important things I noticed is that often people misspell either the name of their manifest file or some key in their manifest people resulting their add-on to not load during the debugging phase.

A lot of them then created addons on their own and modified their previously created borderify addon to do more stuff. I've tried to collect some of them here. For a more verbose list you can visit Twitter and search tweets tagging me (@ErSanyamKhurana with #MozAMU.

Imaginations ran wild and one of the attendee created an addon that replaces the word Google with Mozilla on every web page. You can see his hack here

To make the session more interesting we gave add-ons stickers to anyone who answers the question about what we were just telling them. A lot of folks praised and tweeted about the addons they were generating. We were able to generate 10,000+ impressions with more than 4,000+ accounts reached on Twitter for #MozAMU.

Twitter Outreach report on no of impressions created for #MozAMU Twitter Outreach report on top contributors created for #MozAMU

You can read the full report here.

Till this time, I never introduced to anyone about who am I and most importantly not listed any of my contributions in any of the projects. I don't want them to feel overwhelmed and assume that we people have some sort of superpowers that we're able to patch bugs in any FOSS project. I always make it a point to encourage them and help them land their first patch.

And my introduction summed that up in just one line I'm one of you -- a part of the community.

Sanyam Khurana (CuriousLearner) teaching about essential things to learn while contributing to FOSS projects

We then hopped on to discuss How do I start contributing to Open Source? where we specifically discussed How to find bugs on different projects through Bugzilla & Bugsahoy.

Enthusiastic folks learning about contributions for Sanyam Khurana (CuriousLearner)

You can find the slides here. Then I discussed other Open Source projects I've contributed to like CPython, Django, Oppia, Mozilla's Devtools, Gecko-Engine & tried to find out similarities in various bug trackers. We then had a group photo with some of the attendees.

Group photo at Mozilla AMU

It was already 5 PM and we didn't go for Lunch since students kept us busy with their questions during the lunch break too :P

Curious & enthusiastic students asking questions in break

So, we decided to hop-on to a restaurant nearby with the core-team of students that helped in organizing the event with so much enthusiasm.

Curious & enthusiastic attendees at Mozilla AMU

Then we clicked one last photo before leaving Aligarh at around 7:00 PM with the core-volunteers of the event who helped in all the preparations for the event.

Group photo Mozilla AMU

In the end, I would like to congratulate the students for making so wonderful arrangements and pushing up the FOSS community in their college. I hope they will now start landing patches in different FOSS projects & we'll all meet again soon.

by Sanyam Khurana at March 01, 2018 11:41 AM

February 28, 2018

Farhaan Bukhsh

The Open Organization

I was recently going through few of the Farnam Street articles, and I landed on the article on how to read a book, where they basically describe how to read a book;  the fact that there are types of books, and the fact that books can, in the words of Francis Bacon “be gulped, some books chewed and others digested.”

This basically signifies the intensity and the level of awareness to have when you are reading a book. I have gulped lots of books, but The Open Organization is one of those, that I wanted to chew on.

I wanted to learn about how you can build an ecosystem where people are free to voice their opinions, where failure is be worn as a badge of honor for trying. This book filled me with thoughts of how would it be like, if an organization is really an Open Organization.

There are a lots of beautiful anecdotes that I came across, and a lot of values that were given in the book to think on.

The book talks about Purpose and Passion. People specially us Millenials,have been spoiled to an extent that we actually don’t run after money but after a purpose, after a problem. We don’t mind working crazy hours and being paid peanuts, but we do care about people, we care about how are we treated, we care about the problem we are after. One of the quotes in the book says Basis of loyalty is a common purpose and not economic dependency. A lot of people I know believe in this. When you unite with an organization which is after the same problem as you, it’s a match made in heaven.

The book talks about Passion, the passion about doing good, making a dent in the universe, but sometimes you realize Universe doesn’t give a damn .

One of the most amazing analogies, is when the book compares a structure of an organization with web architecture which is end to end and not center to end. Where there is no central point of control but there should be a central point of co-ordination. The organization is lead by leaders it selects, where Meritocracy is the idea behind every decision.

The other idea that was completely new to me was the difference between Crowd-sourcing and Open-sourcing.To be honest I had not thought open source to be a business model until the recent past. The thing with the wisdom of the crowd is that it works amazingly well when the work can be easily disagregated and individuals can work in relative isolation. I love the point in the book that says members of the organization should be inspired by the leader and not motivated. Motivation is something they already have and that is the reason they are joining your organization. I love this idea a lot because I have seen people complaining about their employees not being motivated enough. I think that this (lack of inspired leadership) is a reason.

“Great companies don’t hire skilled people and motivate them, they hire already motivated people and inspire them.” – Simon Sinek

I really enjoyed the way the power of purpose is laid out in the book. The other idea was the idea of Meritocracy.  I think of  merit as having an amazing idea and idea being the sole reason for doing a certain action. Better ideas win, they are questioned and deliberated upon and that is how innovation happens in the organization. People debate over it, question it, trash it. People just don’t settle for something to avoid conflict. That very same complacency however is what has creeped into organizations where people don’t debate ideas just to avoid conflict so that everyone remains happy. It was so amazing to read stories where someone thought out of the box and wanted to bring in a new way of doing things and how he convinced everyone that this is the right way of doing things, we ought to give it a try.

This book pushes back on the belief in hierarchy and brings to limelight lateral structure, letting people know that the conventional ways of running an organization might have to change, upgrade as it were, to a newer version.

I got a lot of amazing ideas and to be honest I got to know how a person in an organization should be treated. I was awestruck with the insights in the book. Wish someday I could mould an organization in this way. Theories are always romantic, hope the execution and implementation is beautiful as well.

by fardroid23 at February 28, 2018 04:30 AM