FLOSS Project Planets

PyCharm: Webinar Preview: “Class Components With Props” tutorial step for React+TS+TDD

Planet Python - Sun, 2019-10-13 16:50

As a reminder… this Wednesday (Oct 16) I’m giving a webinar on React+TypeScript+TDD in PyCharm. I’m doing some blog posts about material that will be covered.

See the first blog post for some background on this webinar and its topic.

Spotlight: Class Components With Props

As we saw in the previous step, child components get props from the parent, and when using TypeScript, you can model that contract with an interface. In his Class Components With Props tutorial step, we switch from a stateless functional component to a class component.

We do this change, of course, by first writing a failing test. Then, as we do the change, we use IDE features to speed us up, both in the test writing as well as the code changes. At no time do we switch to the browser and disrupt our “flow”.

Here’s the full video that accompanies the writeup and code:

Categories: FLOSS Project Planets

Utkarsh Gupta: Joining Debian LTS!

Planet Debian - Sun, 2019-10-13 15:41


(DPL Style):
TL;DR: I joined Debian LTS as a trainee in July (during DebConf) and finally as a paid contributor from this month onward! :D

Here’s something interesting that happened last weekend!
Back during the good days of DebConf19, I finally got a chance to meet Holger! As amazing and inspiring a person he is, it was an absolute pleasure meeting him and also, I got a chance to talk about Debian LTS in more detail.

I was introduced to Debian LTS by Abhijith during his talk in MiniDebConf Delhi. And since then, I’ve been kinda interested in that project!
But finally it was here that things got a little “official” and after a couple of mail exchanges with Holger and Raphael, I joined in as a trainee!

I had almost no idea what to do next, so the next month I stayed silent, observing the workflow as people kept committing and announcing updates.
And finally in September, I started triaging and fixing the CVEs for Jessie and Stretch (mostly the former).

Thanks to Abhijith who explained the basics of what DLA is and how do we go about fixing bugs and then announcing them.

With that, I could fix a couple of CVEs and thanks to Holger (again) for reviewing and sponsoring the uploads! :D

I mostly worked (as a trainee) on:

  • CVE-2019-10751, affecting httpie, and
  • CVE-2019-16680, affecting file-roller.

And finally this happened:
(Though there’s a little hiccup that happened there, but that’s something we can ignore!)

So finally, I’ll be working with the team from this month on!
As Holger says, very much yay! :D

Until next time.
:wq for today.

Categories: FLOSS Project Planets

Iustin Pop: Actually fixing a bug

Planet Debian - Sun, 2019-10-13 14:43

One of the outcomes of my recent (last few years) sports ramp-up is that my opensource work is almost entirely left aside. Having an office job makes it very hard to spend more time sitting at the computer at home too…

So even my travis dashboard was red for a while now, but I didn’t look into it until today. Since I didn’t change anything recently, just travis builds started to fail, I was sure it’s just environment changes that need to be taken into account.

And indeed it was so, for two out of three projects. The third one… I actually got to fix a bug, introduced at the beginning of the year, but for which gcc (same gcc that originally passed) started to trip on a while back. I even had to read the man page of snprintf! Was fun ☺, too bad I don’t have enough time to do this more often…

My travis dashboard is green again, and “test suite” (if you can call it that) is expanded to explicitly catch this specific problem in the future.

Categories: FLOSS Project Planets

Contributor License Agreement and Developer Certificate of Origin references

Planet KDE - Sun, 2019-10-13 11:30

In the last few years I have come across the CLA topic several times. It is and will be a popular topic in automotive the coming years, like in any industry that moves from being an Open Source Producer towards becoming an Open Source Contributor.

In my experience, many organizations take the CLA as a given by looking at the google, microsoft or intels of the world and replicate their model. But more and more organizations are learning about alternatives, even if they do not adopt them.

What I find interesting about discussing the alternatives is that it brings to the discussion the contributor perspective and not just the company one. This enrichs the debate and, in some cases, leads to a more balanced framework between any organization behind a project and the contriibutor base, which benefits both.

Throughout these years I have read a lot about it but I have never written anything. It is one of those topics I do not feel comfortable enough to write about in public probably because I know lots of people more qualified than I am to do so. What I can do is to provide some articles and links that I like or that have been recommended to me in the past.

  • Why you probably shouldn’t add a CLA to your open source project“, written by Ben Alter back in 2018 is a must read. Ben is a United States-based lawyer who works for GitHub as their “evangelist” to government agencies.
    • CLAs are Not a Sham” by Kyle E. Mitchell, a lawyer, is a respond to the previous article.
  • “The trouble with Harmony: Part 1 and Part 2″ by Richard Fontana 2011, a Red Hat lawyer. He came back to the topic this year (2019) in his article “Why CLAs aren’t good for open source” summarising Red Hat’s position.
  • Why Your Project Doesn’t Need a Contributor Licensing Agreement” by by Bradley M. Kuhnon June 9, 2014. Bradley is a well known member of the Software Freedom Conservancy.
  • Contributor Agreements Considered Harmful” by Eric S. Raymond on July 8, 2019, represents a clear view from the individual contributors perspective on the CLA topic.
  • Community contributions and copyright assignment” By Jonathan Corbet, October 28, 2009. This article analyses from the contributor’s perspective the Canonical Ltd CLA which started a heated debate back then, leading to the Harmony project creation first and the initiative by the Mark Shuttleworth Foundation later on, two of the main attempts to standardise CLAs up to date.
  • Some thoughts on Copyright Assignment” by Michael Meeks, 2011, is still one of the most relevant articles on the topic, covering not just the theory but also putting examples of how harmful unbalanced relations with an entity that controls an Open Source project might be for contributors. Specially relevant has been over time the Recommendations section of this article.

It is impossible nowadays to talk about CLAs without talking about DCO (Developer Certificate of Origin). Here are some articles that I find interesting:

  1. Ben’s Cotton article “CLA vs DCO What’s the difference“, from 2018 is a good article to read because it does not favour one over the other one.
  2. I like the article “CLAs and using DCO clearly” from Hen written back in 2018 because it summarises well the costs associated to CLAs and how they (do not apply) apply to the DCO.
  3. It is worth reading the summary of James talk at Linux Foundation Collaboration Summit 2014, “The most powerful contributor agreement” done by Jonathan Corbet.
  4. Julien Ponge wrote “Developer Certificate of Origin versus Contributor License Agreements” back in 2016.

For companies that “do not buy into the anti-CLA” case, R. Fontana propose another two options:

  1. Eclipse Contributor Agreement
  2. The Software Freedom Conservancy’s Selenium CLA, which are not proper CLAs but DCOs in his view.

It is always interesting to learn about the Fiduciary License Agreement FLA, developed by the FSFE:

  1. Fiduciary Programme
  2. FLA FAQ
  3. FLA-2.0 announcement.
Inbound = outbound

A serious conversation about CLA requires to understand the concept of inbound=outbound:

GitHub explains inbound=outbound as:

  • outbound licensing”, refers to granting a licence to another party to use, copy, distribute…. (depending on the license) your intellectual property.
  • inbound licensing” means obtaining a licence from another party, to use, copy, distribute…. (depending on the license) its IP for your own consumption (distribution, etc. again depending on the license).

GitHub explains inbound=outbound as:

Whenever you make a contribution to a repository containing notice of a license, you license your contribution under the same terms, and you agree that you have the right to license your contribution under those terms.[…]

In the CLA discussion context, the general idea behind inbound=outbound is that the project should make evident to every contributor the contribution conditions, including those related with licenses rights and restriction. The contributor will then contributes her code with the same license, giving little room for later claims, either by the project, the contributor or third parties, based on those conditions being unclear or not easily reachable.

The project license and its description should be prominent and located at least where it is common practice in Open Source to find them. The same applies to all the assumptions and conditions affecting the contributors and the project in this area.

Common practice, many will claim, but sadly some projects are better than others on this.

Who is doing what?

In CLA discussions, it helps to know what others are doing. Here you have some links I have collected over the years and I still find relevant. I have to recognise that in a couple of cases cases I do not remember exactly why they called my attention at the time.

Company driven projects:

Consortium driven projects:

Community driven projects

Organizations with different agreements for individuals and entities:

Organizations with CLA:

Additional links

And finally, I have several links that I think are worth reading for different reasons:

  1. Project Harmony is worth investigating as an interesting attempt to standardize CLAs:

2. GitHub uses an Individual and an entity CLA. It is interesting their CLA-assistant.

3. James Bottomley’s ideas about the Corporate Contribution Pledge published back in 2016 as complement to the DCO are worth reading.

Additional suggestions from readers

I hope my effort triggers the contributor in you so you provide additional links or challenge the ones above. I will substitute this text for those links you provide, obviously giving you credit by default. It would be a great way to help others in the future. Thank you very much in advance.

Categories: FLOSS Project Planets

Rudimentary KBibTeX client using Kirigami2

Planet KDE - Sun, 2019-10-13 10:08

KBibTeX is a bibliography editor (BibTeX and somewhat BibLaTex) used in conjunction with LaTeX and friends. Based on this code base, a SailfishOS client called ‘BibSearch’ exists which allows to search for bibliographic data in various online sources (IEEE Xplore, Google Scholar, ACM Digital Library, …). BibSearch&aposs code makes use of KBibTeX&aposs C++ code, has its user interface implemented in SailfishOS&aposs Silica QML, and provides just two C++ files on its own to glue together everything.

It has long been my goal to provide a QML or Kirigami-based client of KBibTeX of similar functionality, either to be used as Plasma widget or for Plasma Mobile (thus equivalent to the SailfishOS implementation). Finally I have been able to put together an initial implementation using Kirigami2. There are several rough edges and bugs, and much of the intended functionality is missing, but at least one can search for bibliographic data. If you are familiar with Kirigami, it should be a low-hanging fruit to fix the obvious issues, especially given that there is already a Silica-based client as reference. Code contributions to branch feature/kirigami are welcome!

Categories: FLOSS Project Planets

Follow-up on ‘ASCII Transliteration without ICU or iconv’

Planet KDE - Sun, 2019-10-13 09:51

In a recent blog posting I presented some code on how to transliterate common Unicode characters into ASCII-only representations using a offline-generated lookup table to avoid dependencies on ICU which would normally do this job.

By an anonymous commenter, I got pointed to that Unicode (in Qt) is slightly more complicated than I had considered when writing the code: I missed to handle planes beyond the Basic Multilingual Plane (BMP) and the ‘surrogates’ between code points 0xD800 and 0xDFFF. In a series of recently pushed Git commits I addressed problem of surrogates and fixed some more issues. Some preparatory work has been done to support more planes in the future, but as of now, only the BMP is supported. For details, please have a look at the five commits posted on 2019-10-12.

Categories: FLOSS Project Planets

Mike Driscoll: Thousands of Scientific Papers May be Invalid Due to Misunderstanding Python

Planet Python - Sun, 2019-10-13 08:16

It was recently discovered that several thousand scientific articles could be invalid in their conclusions because scientists did not understand that Python’s glob.glob() does not return sorted results.

This is being reported on by Vice, Slashdot and there’s an interesting discussion going on over on Reddit as well.

Some are reporting this as a glitch in Python, but glob has never guaranteed that is results were returned sorted. As always, I would recommend reading the documentation closely to fully understand what your code does. It would also be a good idea if you can write tests around your code. Python includes a unittest module which makes this easier.

The post Thousands of Scientific Papers May be Invalid Due to Misunderstanding Python appeared first on The Mouse Vs. The Python.

Categories: FLOSS Project Planets

TechBeamers Python: How to Convert Python String to Int and Back to String

Planet Python - Sun, 2019-10-13 08:10

This tutorial describes various ways to convert Python string to int and from an integer to string. You may often need to perform such operations in day to day programming. Hence, you should know them to write better programs. Also, an integer can be represented in different bases, so we’ll explain that too in this post. And there happen to be scenarios where conversion fails. Hence, you should consider such cases as well and can find a full reference given here with examples. By the way, it will be useful if you have some elementary knowledge about the Python data

The post How to Convert Python String to Int and Back to String appeared first on Learn Programming and Software Testing.

Categories: FLOSS Project Planets

This week in KDE: Plasma 5.17 approaches

Planet KDE - Sun, 2019-10-13 02:01

Lots of great backend work happened this week which is very important, but not terribly flashy. And most of the in-progress work I alluded to last week hasn’t landed yet. So I’m afraid the user-visible changes will have to be a bit light this week. But fear not! For Plasma 5.17 is undergoing its last rounds of final polish and bugfixing before the release next week, and work churns along on lots of great stuff slated for Plasma 5.18 and the next apps versions!

Bugfixes & Performance Improvements User Interface Improvements How You Can Help

Check out https://community.kde.org/Get_Involved and find out ways to help be a part of something that really matters. You don’t have to already be a programmer. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!

Finally, consider making a tax-deductible donation to the KDE e.V. foundation.

Categories: FLOSS Project Planets

Shirish Agarwal: Social media, knowledge and some history of Banking

Planet Debian - Sat, 2019-10-12 18:58

First of all Happy Dusshera to everybody. While Dusshera is India is a symbol of many things, it is a symbol of forgiveness and new beginnings. While I don’t know about new beginnings I do feel there is still lot of baggage which needs to be left I would try to share some insights I uncovered over last few months and few realizations I came across.

First of all thank you to the Debian-gnome-team to keep working at new version of packages. While there are still a bunch of bugs which need to be fixed especially #895990 and #913978 among others, still kudos for working at it. Hopefully, those bugs and others will be fixed soon so we could install gnome without a hiccup. I have not been on IRC because my riot-web has been broken for several days now. Also most of the IRC and telegram channels at least related to Debian become mostly echo chambers one way or the other as you do not get any serious opposition. On twitter, while it’s highly toxic, you also get the urge to fight the good fight when either due to principles or for some other reason (usually paid trolls) people fight, While I follow my own rules on twitter apart from their TOS, I feel at least new people who are going on social media in India or perhaps elsewhere as well could use are –

  1. It is difficult to remain neutral and stick to the facts. If you just stick to the facts, you will be branded as urban naxal or some such names.
  2. I find many times, if you are calm and don’t react, many a times, they are curious and display ignorance of knowledge which you thought everyone knew is not there. Now whether that is due to either due to lack of education, lack of knowledge or pretensions, although if its pretentious, you are caught sooner or later.
  3. Be civil at all times, if somebody harassess you, calls you names, report them and block them, although twitter still needs to fix the reporting thing a whole lot more. Although, when even somebody like me (bit of understanding of law, technology, language etc.) had a hard time figuring out twitter’s reporting ways, I dunno how many people would be able to use it successfully ? Maybe they make it so unhelpful so the traffic flows no matter what. I do realize they still haven’t figured out their business model but that’s a question for another day. In short, they need to make it far more simpler than it is today.
  4. You always have an option to block people but it has its own consequences.
  5. Be passive-aggressive if the situation demands it.
  6. Most importantly though, if somebody starts making jokes about you or start abusing you, it is sure that the person on the other side doesn’t have any more arguments and you have won.

Before I start, let me share why I am putting a blog post on the topic. The reason is pretty simple. It seems a huge number of Indians don’t either know the history of how banking started, the various turns it took and so on and so forth. In fact, nowadays history is being so hotly contested and perhaps even being re-written. Hence for some things I would be sharing some sources but even within them, there is possibiity of contestations. One of the contestations for a long time is when ancient coinage and the technique of smelting, flattening came to India. Depending on whom you ask, you have different answers. Lot of people are waiting to get more insight from the Keezhadi excavation which may also give some insight to the topic as well. There are rumors that the funding is being stopped but hope that isn’t true and we gain some more insight in Indian history. In fact, in South India, there seems to be lot of curiousity and attraction towards the site. It is possible that the next time I get a chance to see South India, I may try to see if there is a chance to see this unique location if a museum gets built somewhere nearby. Sorry from deviating from the topic, but it seems that ancient coinage started anywhere between 1st millenium BCE to 6th century BCE so it could be anywhere between 1500 – 2000 years old in India. While we can’t say anything for sure, but it’s possible that there was barter before that. There has also been some history about sharing tokens in different parts of the world as well. The various timelines get all jumbled up hence I would suggest people to use the wikipedia page of History of Money as a starting point. While it may not be give a complete, it would probably broaden the understanding a little bit. One of the reasons why history is so hotly contested could also perhaps lie because of the destruction of the Ancient Library of Alexandria. Who knows what more we would have known of our ancients if it was not destroyed

Hundi (16th Centry)

I am jumping to 16th century as it is more closer to today’s modern banking otherwise the blog post would be too long. Now Hundi was a financial instrument which was used from 16th century onwards. This could be as either a forbearer of a cheque or a Traveller’s cheque. There doesn’t seem to be much in way of information, whether this was introduced by the Britishers or before by the Portugese when they came to India in via when the Portugese came when they came to India or was it in prevelance before. There is a fascinating in-depth study of Hundi though between 1858-1978 done by Marina Bernadette for London School of Economics as her dissertion paper.

Banias and Sarafs

As I had shared before, history in India is intertwined with mythology and history. While there is possibility of a lot of history behind this is documented somewhere I haven’t been able to find it. As I come from Bania , I had learnt lot of stories about both the migratory strain that Banias had as well as how banias used to split their children in adjoining states. Before the Britishers ruled over India, popular history tells us that it was Mughal emprire that ruled over us. What it doesn’t tell us though that both during the Mughal empire as well as Britishers, Banias and Sarafs who were moneylenders and bullion traders respectively hedged their bets. More so, if they were in royal service or bound to be close to the power of administration of the state/mini-kingdom/s . What they used to do is make sure that one of the sons would obey the king here while the other son may serve the muslim ruler. The idea behind that irrespective of whoever wins, the banias or sarafs would be able to continue their traditions and it was very much possible that the other brother would not be killed or even if he was, any or all wealth will pass to the victorious brother and the family name will live on. If I were to look at that, I’m sure I’ll find the same not only in Banias and Sarafs but perhaps other castes and communities as well. Modern history also tells of Rothschilds who did and continue to be an influence on the world today.

As to why did I share about how people acted in their self-interest because nowadays in the Indian social media, it is because many people chose to believe a very simplistic black and white narrative and they are being fed that by today’s dominant political party in power. What I’m trying to simply say is that history is much more complex than that. While you may choose to believe either of the beliefs, it might open a window in at least some Indian’s minds that there is possibility of another way things were done and ways in which people acted then what is being perceived today. It is also possible it may be contested today as lot of people would like to appear in the ‘right side’ of history as it seems today.

Banking in British Raj till nationalization

When the Britishers came, they bought the modern Banking system with them. These lead to creation of various banks like Bank of Bengal, Bank of Bombay and Bank of Madras which was later subsumed under Imperial Bank of India which later became State Bank of India in 1955. While I will not go into details, I do have curiousity so if life has, would surely want to visit either the Banca Monte dei Paschi di Siena S.p.A of Italy or the Berenberg Bank both of which probably has lot of history than what is written on their wikipedi pages. Soon, other banks. Soon there was whole clutch of banks which will continue to facilitate the British till independance and leak money overseas even afterwards till the Banks were nationalized in 1956 due to the ‘Gorwala Committee’ which recommended. Apart from the opaqueness of private banking and leakages, there was non provision of loans to priority sector i.e. farming in India, A.D. Gorawala recommended nationalization to weed out both issues in a single solution. One could debate efficacy of the same, but history has shown us that privatization in financial sector has many a times been costly to depositors. The financial Crisis of 2008 and the aftermath in many of the financial markets, more so private banks is a testament to it. Even the documentary Plenary’s Men gives whole lot of insight in the corruption that Private banks do today.

The plenary’s men on Youtube at least to my mind is evidence enough that at least India should be cautious in dealings with private banks.

Co-operative banks and their Rise

The Co-operative banks rise in India was largely in part due to rise of co-operative societies. While the co-operative Societies Act was started in 1904 itself. While there were quite a few co-operative societies and banks, arguably the real filip to Co-operative Banking was done by Amul when it started in 1946 and the milk credit society it started with it. I dunno how many people saw ‘Manthan‘ which chronicled the story and bought the story of both the co-operative societies and co-operative banks to millions of India. It is a classic movie which lot of today’s youth probably doesn’t know and even if he would would take time to identify with, although people of my generation the earlier generations do get it. One of the things that many people don’t get is that for lot of people even today, especially for marginal farmers and such in rural areas, co-operative banks are still the only solution. While in recent times, the Govt. of the day has tried something called Jan Dhan Yojana it hasn’t been as much a success as they were hoping to. While reams of paper have been written about it, like most policies it didn’t deliver to the last person which such inclusion programs try. Issues from design to implementation are many but perhaps some other time. I am sharing about Co-operative banks as a recent scam took place in one of the banks, probably one of the most respected and widely held co-operative banks. I would rather share sucheta dalal’s excellent analysis done on the PMC bank crisis which is 1unfolding and perhaps continue to unfold in days to come.


At the end I have to admit I took a lot of short-cuts to reach till here. There is possibility that there may be details people might want me to incorporate, if so please let me know and would try and add that. I did try to compress as much as possible while trying to be as exhaustive as possible. I also haven’t used any data as I wanted to keep the explanations as simple as possible and try not to have as little of politics as possible even though biases which are there, are there.

Categories: FLOSS Project Planets

Dirk Eddelbuettel: GitHub Streak: Round Six

Planet Debian - Sat, 2019-10-12 11:53

Five ago I referenced the Seinfeld Streak used in an earlier post of regular updates to to the Rcpp Gallery:

This is sometimes called Jerry Seinfeld’s secret to productivity: Just keep at it. Don’t break the streak.

and then showed the first chart of GitHub streaking

github activity october 2013 to october 2014

And four year ago a first follow-up appeared in this post:

github activity october 2014 to october 2015

And three years ago we had a followup

github activity october 2015 to october 2016

And two years ago we had another one

github activity october 2016 to october 2017

And last year another one

github activity october 2017 to october 2018

As today is October 12, here is the newest one from 2018 to 2019:

github activity october 2018 to october 2019

Again, special thanks go to Alessandro Pezzè for the Chrome add-on GithubOriginalStreak.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

Learn PyQt: Plotting in PyQt5 — Using PyQtGraph to create interactive plots in your apps

Planet Python - Sat, 2019-10-12 09:38

One of the major strengths of Python is in exploratory data science and visualization, using tools such as Pandas, numpy, sklearn for data analysis and matplotlib plotting. Buiding GUI applications with PyQt gives you access to all these Python tools directly from within your app, allowing you to build complex data-driven apps and interactive dashboards.

While it is possible to embed matplotlib plots in PyQt the experience does not feel entirely native. For simple and highly interactive plots you may want to consider using PyQtGraph instead. PyQtGraph is built on top of PyQ5 native QGraphicsScene giving better drawing performance, particularly for live data, as well as providing interactivity and the ability to easily customize plots with Qt graphics widgets.

In this tutorial we'll walk through the first steps of creating a plot widget with PyQtGraph and then demonstrate plot customization using line colours, line type, axis labels, background colour and plotting multiple lines.

Getting started

To be able to use PyQtGraph with PyQt you first need to install the package to your Python environment. You can do this as normal using pip.

bash pip install pyqtgraph

Once the installation is complete you should be able to import the module as normal.

Creating a PyQtGraph widget

In PyQtGraph all plots are created using the PlotWidget widget. This widget provides a contained canvas on which plots of any type can be added and configured. Under the hood, this plot widget uses Qt native QGraphicsScene meaning it fast and efficient yet simple to integrate with the rest of your app. You can create a PlotWidget as for any other widget.

The basic template app, with a single PlotWidget in a QMainWindow is shown below.

In the following examples we'll create the PyQtGraph widget in code. Want to know how to embed PyQtGraph when using Qt Designer? See Embedding custom widgets from Qt Designer

python from PyQt5 import QtWidgets, uic from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import sys # We need sys so that we can pass argv to QApplication import os class MainWindow(QtWidgets.QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.graphWidget = pg.PlotWidget() self.setCentralWidget(self.graphWidget) hour = [1,2,3,4,5,6,7,8,9,10] temperature = [30,32,34,32,33,31,29,32,35,45] # plot data: x, y values self.graphWidget.plot(hour, temperature) def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_()) if __name__ == '__main__': main()

In all our examples below we import PyQtGraph using import pyqtgraph as pg. This is a common convention in PyQtGraph examples to keep things tidy & reduce typing. You an import and use it as import pyqtgraph if you prefer.

The custom PyQtGraph widget showing dummy data.

The default plot style of PyQtGraph is quite bare — a black background with a thin (barely visible) white line. In the next section we'll look at what options we have available to us in PyQtGraph to improve the appearance and usability of our plots.

Styling plots

PyQtGraph uses Qt's QGraphicsScene to render the graphs. This gives us access to all the standard Qt line and shape styling options for use in plots. However, PyQtGraph provides an API for using these to draw plots and manage the plot canvas.

Below we'll go through the most common styling features you'll need to create and customize your own plots.

Background Colour

Beginning with the app skeleton above, we can change the background colour by calling .setBackground on our PlotWidget instance (in self.graphWidget). The code below will set the background to white, by passing in the string 'w'.


You can set (and update) the background colour of the plot at any time.

python from PyQt5 import QtWidgets, uic from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import sys # We need sys so that we can pass argv to QApplication import os class MainWindow(QtWidgets.QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.graphWidget = pg.PlotWidget() self.setCentralWidget(self.graphWidget) hour = [1,2,3,4,5,6,7,8,9,10] temperature = [30,32,34,32,33,31,29,32,35,45] self.graphWidget.setBackground('w') self.graphWidget.plot(hour, temperature) def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_()) if __name__ == '__main__': main() Change PyQtGraph Plot Background to White

There are a number of simple colours available using single letters, based on the standard colours used in matplotlib. They're pretty unsurprising, except that 'k' is used for black.

Colour Letter code blue b green g red r cyan (bright blue-green) c magenta (bright pink) m yellow y black k white w

In addition to these single letter codes, you can also set more complex colours using hex notation eg. #672922 as a string.

self.graphWidget.setBackground('#bbccaa') # hex

RGB and RGBA values can be passed in as a 3-tuple or 4-tuple respectively, using values 0-255.

self.graphWidget.setBackground((100,50,255)) # RGB each 0-255 self.graphWidget.setBackground((100,50,255,25)) # RGBA (A = alpha opacity)

Lastly, you can also specify colours using Qt's QColor type directly.

from PyQt5 import QtGui # Place this at the top of your file. self.graphWidget.setBackground(QtGui.QColor(100,50,254,25))

This can be useful if you're using specific QColor objects elsewhere in your application, or to set your plot background to the default GUI background colour.

color = self.palette().color(QtGui.QPalette.Window) # Get the default window background, self.graphWidget.setBackground(color) Line Colour, Width & Style

Lines in PyQtGraph are drawn using standard Qt QPen types. This gives you the same full control over line drawing as you would have in any other QGraphicsScene drawing. To use a pen to plot a line, you simply create a new QPen instance and pass it into the plot method.

Below we create a QPen object, passing in a 3-tuple of int values specifying an RGB value (of full red). We could also define this by passing 'r', or a QColor object. Then we pass this into plot with the pen parameter.

pen = pg.mkPen(color=(255, 0, 0)) self.graphWidget.plot(hour, temperature, pen=pen)

The complete code is shown below.

python from PyQt5 import QtWidgets, uic from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import sys # We need sys so that we can pass argv to QApplication import os class MainWindow(QtWidgets.QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.graphWidget = pg.PlotWidget() self.setCentralWidget(self.graphWidget) hour = [1,2,3,4,5,6,7,8,9,10] temperature = [30,32,34,32,33,31,29,32,35,45] self.graphWidget.setBackground('w') pen = pg.mkPen(color=(255, 0, 0)) self.graphWidget.plot(hour, temperature, pen=pen) def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_()) if __name__ == '__main__': main() Changing Line Colour

By changing the QPen object we can change the appearance of the line, including both line width in pixels and style (dashed, dotted, etc.) using standard Qt line styles. For example, the following example creates a 15px width dashed line in red.

pen = pg.mkPen(color=(255, 0, 0), width=15, style=QtCore.Qt.DashLine)

The result is shown below, giving a 15px dashed red line.

Changing Line Width and Style

The standard Qt line styles can all be used, including Qt.SolidLine, Qt.DashLine, Qt.DotLine, Qt.DashDotLine and Qt.DashDotDotLine. Examples of each of these lines are shown in the image below, and you can read more in the Qt Documentation.

Qt Line Types Line Markers

For many plots it can be helpful to place markers in addition or instead of lines on the plot. To draw a marker on the plot, pass the symbol to use as a marker when calling .plot as shown below.

self.graphWidget.plot(hour, temperature, symbol='+')

In addition to symbol you can also pass in symbolSize, symbolBrush and symbolPen parameters. The value passed as symbolBrush can be any colour, or QBrush type, while symbolPen can be passed any colour or a QPen instance. The pen is used to draw the outline of the shape, while brush is used for the fill.

For example the below code will give a blue cross marker of size 30, on a thick red line.

pen = pg.mkPen(color=(255, 0, 0), width=15, style=QtCore.Qt.DashLine) self.graphWidget.plot(hour, temperature, pen=pen, symbol='+', symbolSize=30, symbolBrush=('b')) Adding Symbols on Line

In addition to the + plot marker, PyQtGraph supports the following standard markers shown in the table below. These can all be used in the same way.

Variable Marker Type o Circular s Square t Triangular d Diamond + Cross

If you have more complex requirements you can also pass in any QPainterPath object, allowing you to draw completely custom marker shapes.

Plot Titles

Chart titles are important to provide context to what is shown on a given chart. In PyQtGraph you can add a main plot title using the setTitle() method on the PlotWidget, passing in your title string.

self.graphWidget.setTitle("Your Title Here")

You can apply text styles, including colours, font sizes and weights to your titles (and any other labels in PyQtGraph) by passing additional arguments. The available syle arguments are shown below.

Style Type color (str) e.g. 'CCFF00' size (str) e.g. '8pt' bold (bool) True or False italic (bool) True or False

The code below sets the color to blue with a font size of 30px.

self.graphWidget.setTitle("Your Title Here", color='blue', size=30)

You can also style your headers with HTML tag syntax if you prefer, although it's less readable.

self.graphWidget.setTitle("<span style=\"color:blue;font-size:30px\">Your Title Here</span>") Adding Chart Title Axis Labels

Similar to titles, we can use the setLabel() method to create our axis titles. This requires two parameters, position and text. The position can be any one of 'left,'right','top','bottom' which describe the position of the axis on which the text is placed. The 2nd parameter text is the text you want to use for the label.

self.graphWidget.setLabel('left', 'Temperature (°C)', color='red', size=30) self.graphWidget.setLabel('bottom', 'Hour (H)', color='red', size=30)

These take the same style parameters as setTitle and also support HTML syntax if you prefer.

self.graphWidget.setLabel('left', "<span style=\"color:red;font-size:30px\">Temperature (°C)</span>") self.graphWidget.setLabel('bottom', "<span style=\"color:red;font-size:30px\">Hour (H)</span>") Add Axis Labels Legends

In addition to the axis and plot titles you will often want to show a legend identifying what a given line represents. This is particularly important when you start adding multiple lines to a plot. Adding a legend to a plot can be accomplished by calling .addLegend on the PlotWidget, however before this will work you need to provide a name for each line when calling .plot().

The example below assigns a name "Sensor 1" to the line we are plotting with .plot(). This name will be used to identify the line in the legend.

self.graphWidget.plot(hour, temperature, name = "Sensor 1", pen = NewPen, symbol='+', symbolSize=30, symbolBrush=('b')) self.graphWidget.addLegend() Add Legend

The legend appears in the top left by default. If you would like to move it, you can easily drag and drop the legend elsewhere. You can also specify a default offset by passing a 2-tuple to the offset parameter when creating the legend.

Background Grid

Adding a background grid can make your plots easier to read, particularly when trying to compare relative x & y values against each other. You can turn on a background grid for your plot by calling .showGrid on your PlotWidget. You can toggle x and y grids independently.

The following with create the grid for both the X and Y axis.

self.graphWidget.showGrid(x=True, y=True) Add Grid Setting Axis Limits

Sometimes it can be useful to restrict the range of data which is visible on the plot, or to lock the axis to a consistent range regardless of the data input (e.g. a known min-max range). In PyQtGraph this can be done using the .setXRange() and .setYRange() methods. These force the plot to only show data within the specified ranges on each axis.

Below we set two ranges, one on each axis. The 1st argument is the minimum value and the 2nd is the maximum.

self.graphWidget.setXRange(5, 20, padding=0) self.graphWidget.setYRange(30, 40, padding=0)

A optional padding argument causes the range to be set larger than specified by the specified fraction (this between 0.02 and 0.1 by default, depending on the size of the ViewBox). If you want to remove this padding entirely, pass 0.

self.graphWidget.setXRange(5, 20, padding=0) self.graphWidget.setYRange(30, 40, padding=0)

The complete code so far is shown below:

python from PyQt5 import QtWidgets, uic, QtCore from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import sys # We need sys so that we can pass argv to QApplication import os class MainWindow(QtWidgets.QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.graphWidget = pg.PlotWidget() self.setCentralWidget(self.graphWidget) hour = [1,2,3,4,5,6,7,8,9,10] temperature = [30,32,34,32,33,31,29,32,35,45] #Add Background colour to white self.graphWidget.setBackground('w') #Add Title self.graphWidget.setTitle("Your Title Here", color='blue', size=30) #Add Axis Labels self.graphWidget.setLabel('left', 'Temperature (°C)', color='red', size=30) self.graphWidget.setLabel('bottom', 'Hour (H)', color='red', size=30) #Add legend self.graphWidget.addLegend() #Add grid self.graphWidget.showGrid(x=True, y=True) #Set Range self.graphWidget.setXRange(0, 10, padding=0) self.graphWidget.setYRange(20, 55, padding=0) pen = pg.mkPen(color=(255, 0, 0)) self.graphWidget.plot(hour, temperature, name="Sensor 1", pen=pen, symbol='+', symbolSize=30, symbolBrush=('b')) def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_()) if __name__ == '__main__': main() Set Axis Range Plotting multiple lines

It is common for plots to involve more than one line. In PyQtGraph this is as simple as calling .plot() multiple times on the same PlotWidget. In the following example we're going to plot two lines of similar data, using the same line styles, thicknesses etc. for each, but changing the line colour.

To simplify this we can create our own custom plot method on our MainWindow. This accepts x and y parameters to plot, the name of the line (for the legend) and a colour. We use the colour for both the line and marker colour.

def plot(self, x, y, plotname, color): pen = pg.mkPen(color=color) self.graphWidget.plot(x, y, name=plotname, pen=pen, symbol='+', symbolSize=30, symbolBrush=(color))

To plot separate lines we'll create a new array called temperature_2 and populate it with random numbers similar to temperature (now temperature_1). Plotting these alongside each other allows us to compare them together.

Now, you can call plot function twice and this will generate 2 lines on the plot.

self.plot(hour, temperature_1, "Sensor1", 'r') self.plot(hour, temperature_2, "Sensor2", 'b') python from PyQt5 import QtWidgets, uic, QtCore from pyqtgraph import PlotWidget, plot import pyqtgraph as pg import sys # We need sys so that we can pass argv to QApplication import os class MainWindow(QtWidgets.QMainWindow): def __init__(self, *args, **kwargs): super(MainWindow, self).__init__(*args, **kwargs) self.graphWidget = pg.PlotWidget() self.setCentralWidget(self.graphWidget) hour = [1,2,3,4,5,6,7,8,9,10] temperature_1 = [30,32,34,32,33,31,29,32,35,45] temperature_2 = [50,35,44,22,38,32,27,38,32,44] #Add Background colour to white self.graphWidget.setBackground('w') #Add Title self.graphWidget.setTitle("<h style=\"color:blue;font-size:30px\">Your Title Here</h>") #Add Axis Labels self.graphWidget.setLabel('left', "<h style=\"color:red;font-size:30px\">Temperature (°C)</h>") self.graphWidget.setLabel('bottom', "<h style=\"color:red;font-size:30px\">Hour (H)</h>") #Add legend self.graphWidget.addLegend() #Add grid self.graphWidget.showGrid(x=True, y=True) #Set Range self.graphWidget.setXRange(0, 10, padding=0) self.graphWidget.setYRange(20, 55, padding=0) self.plot(hour, temperature_1, "Sensor1", 'r') self.plot(hour, temperature_2, "Sensor2", 'b') def plot(self, x, y, plotname, color): pen = pg.mkPen(color=color) self.graphWidget.plot(x, y, name=plotname, pen=pen, symbol='+', symbolSize=30, symbolBrush=(color)) def main(): app = QtWidgets.QApplication(sys.argv) main = MainWindow() main.show() sys.exit(app.exec_()) if __name__ == '__main__': main() 2 Line Graph

Play around with this function, customising your markers, line widths, colours and other parameters.

Clearing the plot

Finally, sometimes you might want to clear and refresh the plot periodically. You can easily do that by calling .clear().


This will remove the lines from the plot but keep all other attributes the same.

Note that you don't need to clear and redraw lines to change the data on your plot. We'll cover updating existing plot lines on interactive plots in a future tutorial.


In this tutorial we've discovered how to draw simple plots with PyQtGraph and customize lines, markers and labels. For a complete overview of PyQtGraph methods and capabilities see the PyQtGraph Documentation & API Reference. The PyQtGraph repository on Github also has complete set of more complex example plots in Plotting.py (shown below).

PyQtGraph Repo Example (Plotting.py)
Categories: FLOSS Project Planets

PyCharm: Webinar Preview: “Sharing Props Using Type Information” tutorial step for React+TS+TDD

Planet Python - Sat, 2019-10-12 08:51

As a reminder… next Wednesday (Oct 16) I’m giving a webinar on React+TypeScript+TDD in PyCharm. I’m doing some blog posts about material that will be covered.

See the first blog post for some background on this webinar and its topic.

Spotlight: Sharing Props Using Type Information

Now we get to some fun stuff: Sharing Props Using Type Information.

When you have lots of small components, they share information from parent “smart” components to child “dumb” (or presentation) components. This information is shared via properties, which forms the contract.

How do you write down that contract? This is where doing your React projects in TypeScript really shines. You can make an interface for your property information and say that your component’s properties conform to that interface. You gain IDE autocomplete, warnings, and more.

This really shines in TDD. You “fail faster” with visual squiggles that indicate you broke the contract, rather than waiting for the test to run.

This tutorial step shows a React functional component with property information in an interface, along with showing how to allow a default value for a prop. All done from a test-first workflow:

Categories: FLOSS Project Planets

Akademy 2019 recap

Planet KDE - Sat, 2019-10-12 07:30

Akademy 2019 was hosted in the Milan, Italy. I had opportunity to attend the event and meet the other KDE developers, designers and users.


There were many interesting talks, including use of opensource in government, flying drones, virtual reality and several community related topics. Honestly it is impossible to list all the awesome talks I attended here, so go and check schedule for list of talks and slides. However I want to highlight the one talk which I gave,

Plasma on embedded devices

In Akademy 2018, I gave a talk about Plasma on mobile devices. Talk discussed why it is harder to run a Linux userland on the off-the-shelf mobile devices. This year I and Marco presented a slightly different topic, Plasma on embedded devices. Talk was about what solutions are offered by the KDE community for such embedded devices, and what efforts are being made.

Marco Martin also presented a new shell package, plasma-nano, which is a minimal shell you can extend to create a Plasma based user interfaces for embedded devices.

Birds of Feather sessions Gitlab community & Workflow

Gitlab developers Alessio Caiazza, Jacopo Beschi and Ray Paik hosted a BoF session about the Gitlab workflow, and how to contribute to Gitlab. It was interesting BoF to attend. Seeing as KDE is working on adoption of the Gitlab for it’s code-hosting. It was quite useful session to attend.

Plasma Mobile

On Tuesday, We hosted a Plasma Mobile BoF, where we discussed topics ranging from general shell user-interface to the applications, topics which were discussed includes,

  • File chooser implementation for Plasma Mobile: Currently it just shows the desktop based file dialog, which is not user friendly on mobile
  • Start-up speed improvements for shell and applications
  • Updating the information on Plasma Mobile website
  • Documentation and developer experience, and how to improve it
  • Various application specific issues
  • Hosting a Plasma Mobile sprint in 2020
  • Status of Packaging for Plasma Mobile in various distribution

Overall, it was quite productive BoF, even though we were constrained by the time!

Plasma on Devices

As a extension to our talk, Marco and I hosted a “Plasma on devices” BoF. Where we demostrated the Plasma Nano shell. Talked about the infrastructure we have currently in the Plasma, and also talked about how we can make this more interesting for hardware vendors.


As Plasma Mobile is making various improvements, one of the requirement is the personal information management applications like Calender, Email, Contacts will be needed, I attended the KDE PIM BoF to discuss how best these two teams (Plasma Mobile and KDE PIM) can work together, you can find out more details abut this in Volker Krause blog. In general we discussed following topics,

  • Moving of KCalendarCore and Kcontacts to KDE Frameworks
  • Moving of the KDAV protocol library to KDE Frameworks
  • Plugin Infrastructure in the KCalendarCore
  • KAccounts integration in the KDEPIM
KDE India

Indian KDE-ers (is it even word? I made it up) met together to discuss the possible location and dates for next conf.kde.in, and how better we can improve the conf.kde.in organization procedure. There were several possible venues and dates were suggested by the attendees.


Ben Cooksley hosted a KDE sysadmin BoF, where we discussed various topics related to our infrastructure, and scale of data/traffic we have to handle. We also agreed upon some internal todo items to work on in future.

Online Accounts Integration in KDE

As a follow-up to KDE PIM BoF, I and Daniel Vrátil hosted a Online Accounts integration BoF, where we discussed various topics,

  • Current state of kaccounts infrastructure
  • Possible API improvements for KAccounts
  • Where we can make use of the KAccounts in KDE
Student Programs

We hosted a BoF session to talk about the KDE Student Programs, Google summer of Code, Season of KDE, and GCI. We also discussed the timeline and structure of Season of KDE program. Short note that I will be attending Google Summer of Code 2019 Mentor summit in Munich later this week.

Closing thoughts

Overall quite exciting event, I would like to thank KDE e.V. for sponsoring the accomodation and travel. It is quite awesome to meet community in-person and share ideas, and learn new things!

Categories: FLOSS Project Planets

The Road to KDE Frameworks 6

Planet KDE - Sat, 2019-10-12 05:15

At Akademy Lars presented the plans for Qt 6 in his keynote. With Qt 6 planned for November 2020 we have to look at KDE Frameworks 6 within a two year horizon as well. We therefore need to get started with this as well, so we can help to shape Qt 6, and so we ensure a smooth as possible transition.

Planning Frameworks 6

I have previously briefly mentioned the discussions around this at Akademy here, and David has sent a more detailed report on this to the Frameworks mailing list. This topic deserves a few more details though, and things have evolved since Akademy.

The central hub for coordinating plans and work is the KF6 Workboard. The tasks we currently have there basically fall into three categories:

  • Ideas/proposals: that is things that still need to be discussed and decided upon, sometimes requiring a more detailed analysis on the impact, or a transition plan. If you have topics you would like to see addressed in KF6, that’s the place to start a discussion. That’s especially a call to Frameworks users.
  • Preparation tasks that can be done in KF5-based code already: This is mostly about removing the use of deprecated modules, classes or methods that are expected to go away with Qt 6 or KF6. If you want to get your hands dirty right now, that’s the best place to get started.
  • Tasks that depend on Qt 6 or require executing actual ABI breaks: That’s the minority of tasks at this point, and those of course need to wait until that phase of the development starts (I’d guess around H2 2020).

To make progress on the first category there’s the idea to have a KF6 sprint in the not too distant future. We did that for a week in Randa for planning KF5, and that was tremendously helpful in order to come up with a detailed plan on what we wanted to achieve. So I’d not only encourage everyone contributing to Frameworks development to participate there, but also those of you heavily using Frameworks. Feedback from application or workspace developers is immensely valuable, and this is the place to influence the platform you build your software on top. Same goes for the people working on different form factors or underrepresented platforms. Subscribe to T11535 and indicate your interest to participate there.

Planning the Transition

Besides planning what we want to achieve in KF6 I think it’s equally important to plan how we transition there, especially since those transitions haven’t been always exactly smooth in previous occasions. Lars presented Qt’s approach (only minor source incompatibilities if your code builds cleanly without using deprecated methods in the last Qt 5 release), and that’s a good starting point for KF6 too I think.

However, the situation for KDE is different to Qt’s in some aspects. KDE is not primarily producing Frameworks, but products build on top of those (Plasma and hundreds applications), which allows us to define additional criteria for what we are allowed to change or remove.

The current proposal is to define a set of modules that block a breaking change, that is those modules need to be adjusted (or at least need to be trivial adjustable) before a breaking change is allowed. This is less about things like a renamed but otherwise unchanged method but about the less straightforward changes. I would like to avoid things like “KHTML was dropped, just port to QWebEngine”. Yes, both can render an HTML document somehow, but that’s where the similarities end, the API and the capabilities of the APIs are vastly different, and not all use-cases can be easily mapped, if at all. The burden to sort this out should not solely fall on the application maintainers, as that will result in many things staying behind on Qt5/KF5 for years to come.

Which components are part of this set is still under discussion in T11563. This should contain all actively developed and released products, but ideally nothing on life support and still full of remains from the 4 era. The starting point is Plasma, Applications, Krita and Extragear. So this is also a good reason to promote actively developed things out of Playground, and to retire things from the other categories that we don’t want to carry forward.

Ongoing Work

It’s not all planning and discussion though, actually quite some work has happened since Akademy already:

  • Friedrich has been working on infrastructure to disable deprecated methods in KDE Frameworks at compile time in a similar way as Qt does support this, see his blog post for details as well as the corresponding task on how to help. This will ease long-term maintenance, and it will allow us to uncover remaining users of deprecated KF5 API.
  • Andreas has ported Step, Kalzium and Parley away from KHTML, and Sune has started to do the same for KHelpCenter. We also got rid of quite a few uses of KHTML in Konqueror, only the about screen is remaining there now.
  • Dan and Laurent have been porting KSieve, KSMTP and KIMAP away from KTcpSocket.
  • David, Laurent and others have been porting away from deprecated Qt methods all over the place, aiming at being able to build things with Qt 5.14 with deprecated methods disabled.

It’s a great time to get into KDE Frameworks development! In terms of development tasks there is something for everyone, ranging from simple porting jobs to redesigns of entire modules. It’s also a rare time window where we have more freedom to change things than usual, so it’s the best possible time to bring in your ideas and suggestions, via the KF6 workboard or by participating in the KF6 sprint, especially as a Frameworks user.

Categories: FLOSS Project Planets

Louis-Philippe Véronneau: Alpine MusicSafe Classic Hearing Protection Review

Planet Debian - Sat, 2019-10-12 00:00

Yesterday, I went to a punk rock show and had tons of fun. One of the bands playing (Jeunesse Apatride) hadn't played in 5 years and the crowd was wild. The other bands playing were also great. Here's a few links if you enjoy Oi! and Ska:

Sadly, those kind of concerts are always waaaaayyyyy too loud. I mostly go to small venue concerts and for some reason the sound technicians think it's a good idea to make everyone's ears bleed. You really don't need to amplify the drums when the whole concert venue is 50m²...

So I bough hearing protection. It was the first time I wore earplugs at a concert and it was great! I can't really compare the model I got (Alpine MusicSafe Classic earplugs) to other brands since it's the only one I tried out, but:

  • They were very comfortable. I wore them for about 5 hours and didn't feel any discomfort.

  • They came with two sets of plastic tips you insert in the silicone earbuds. I tried the -17db ones but I decided to go with the -18db inserts as it was still freaking loud.

  • They fitted very well in my ears even tough I was in the roughest mosh pit I've ever experienced (and I've seen quite a few). I was sweating profusely from all the heavy moshing and never once I feared loosing them.

  • My ears weren't ringing when I came back home so I guess they work.

  • The earplugs didn't distort sound, only reduce the volume.

  • They came with a handy aluminium carrying case that's really durable. You can put it on your keychain and carry them around safely.

  • They only cost me ~25 CAD with taxes.

The only thing I disliked was that I found it pretty much impossible to sing while wearing them. as I couldn't really hear myself. With a bit of practice, I was able to sing true but it wasn't great :(

All in all, I'm really happy with my purchase and I don't think I'll ever go to another concert without earplugs.

Categories: FLOSS Project Planets

Molly de Blanc: Conferences

Planet Debian - Fri, 2019-10-11 19:23

I think there are too many conferences.

Are there too many FLOSS conferences?

— Molly dBoo (@mmillions) October 7, 2019

I conducted this very scientific Twitter poll and out of 52 respondants, only 23% agreed with me. Some people who disagreed with me pointed out specifically what they think is lacking:  more regional events, more in specific countries, and more “generic” FLOSS events.

Many projects have a conference, and then there are “generic” conferences, like FOSDEM, LibrePlanet, LinuxConfAU, and FOSSAsia. Some are more corporate (OSCON), while others more community focused (e.g. SeaGL).

There are just a lot of conferences.

I average a conference a month, with most of them being more general sorts of events, and a few being project specific, like DebConf and GUADEC.

So far in 2019, I went to: FOSDEM, CopyLeft Conf, LibrePlanet, FOSS North, Linux Fest Northwest, OSCON, FrOSCon, GUADEC, and GitLab Commit. I’m going to All Things Open next week. In November I have COSCon scheduled. I’m skipping SeaGL this year. I am not planning on attending 36C3 unless my talk is accepted. I canceled my trip to DebConf19. I did not go to Camp this year. I also had a board meeting in NY, an upcoming one in Berlin, and a Debian meeting in the other Cambridge. I’m skipping LAS and likely going to SFSCon for GNOME.

So 9 so far this year,  and somewhere between 1-4 more, depending on some details.

There are also conferences that don’t happen every year, like HOPE and CubaConf. There are some that I haven’t been to yet, like PyCon, and more regional events like Ohio Linux Fest, SCALE, and FOSSCon in Philadelphia.

I think I travel too much, and plenty of people travel more than I do. This is one of the reasons why we have too many events: the same people are traveling so much.

When you’re nose deep in it, when you think that you’re doing is important, you keep going to them as long as you’re invited. I really believe in the messages I share during my talks, and I know by speaking I am reaching audiences I wouldn’t otherwise. As long as I keep getting invited places, I’ll probably keep going.

Finding sponsors is hard(er).

It is becoming increasingly difficult to find sponsors for conferences. This is my experience, and what I’ve heard from speaking with others about it. Lower response rates to requests and people choosing lower sponsorship levels than they have in past years.

CFP responses are not increasing.

I’m yet to hear of any established community-run tech conferences who’ve had growth in their CFP response rate this year.

Peak conference?

— Christopher Neugebauer (@chrisjrn) October 3, 2019

I sort of think the Tweet says it all. Some conferences aren’t having this experiences. Ones I’ve been involved with, or spoken to the organizers of, are needing to extend their deadlines and generally having lower response rates.

Do I think we need fewer conferences?

Yes and no. I think smaller, regional conferences are really important to reaching communities and individuals who don’t have the resources to travel. I think it gives new speakers opportunities to share what they have to say, which is important for the growth and robustness of FOSS.

Project specific conferences are useful for those projects. It gives us a time to have meetings and sprints, to work and plan, and to learn specifically about our project and feel more connected to out collaborators.

On the other hand, I do think we have more conferences than even a global movement can actively support in terms of speakers, organizer energy, and sponsorship dollars.

What do I think we can do?

Not all of these are great ideas, and not all of them would work for every event. However, I think some combination of them might make a difference for the ecosystem of conferences.

More single-track or two-track conferences. All Things Open has 27 sessions occurring concurrently. Twenty-seven! It’s a huge event that caters to many people, but seriously, that’s too much going on at once. More 3-4 track conferences should consider dropping to 1-2 tracks, and conferences with more should consider dropping their numbers down as well. This means fewer speakers at a time.

Stop trying to grow your conference. Growth feels like a sign of success, but it’s not. It’s a sign of getting more people to show up. It helps you make arguments to sponsors, because more attendees means more people being reached when a company sponsors.

Decrease sponsorship levels. I’ve seen conferences increasing their sponsorship levels. I think we should all agree to decrease those numbers. While we’ll all have to try harder to get more sponsors, companies will be able to sponsor more events.

Stop serving meals. I appreciate a free meal. It makes it easier to attend events, but meals are expensive and difficult to logisticate. I know meals make it easier for some people, especially students, to attend. Consider offering special RSVP lunches for students, recent grads, and people looking for work.

Ditch the fancy parties. Okay, I also love a good conference party. They’re loads of fun and can be quite expensive. They also encourage drinking, which I think is bad for the culture.

Ditch the speaker dinners. Okay, I also love a good speaker dinner. It’s fun to relax, see my friends, and have a nice meal that isn’t too loud of overwhelming. These are really expensive. I’ve been trying to donate to local food banks/food insecurity charities an equal amount of the cost of dinner per person, but people are rarely willing to share that information! Paying for a nice dinner out of pocket — with multiple bottles of wine — usually runs $50-80 with tip. I know one dinner I went to was $150 a person. I think the community would be better served if we spent that money on travel grants. If you want to be nice to speakers, I enjoy a box of chocolates I can take home and share with my roommates.

 Give preference to local speakers. One of the things conferences do is bring in speakers from around the world to share their ideas with your community, or with an equally global community. This is cool. By giving preference to local speakers, you’re building expertise in your geography.

Consider combining your community conferences. Rather than having many conferences for smaller communities, consider co-locating conferences and sharing resources (and attendees). This requires even more coordination to organize, but could work out well.

Volunteer for your favorite non-profit or project. A lot of us have booths at conferences, and send people around the world in order to let you know about the work we’re doing. Consider volunteering to staff a booth, so that your favorite non-profits and projects have to send fewer people.

While most of those things are not “have fewer conferences,” I think they would help solve the problems conference saturation is causing: it’s expensive for sponsors, it’s expensive for speakers, it creates a large carbon footprint, and it increases burnout among organizers and speakers.

I must enjoy traveling because I do it so much. I enjoy talking about FOSS, user rights, and digital rights. I like meeting people and sharing with them and learning from them. I think what I have to say is important. At the same time, I think I am part of an unhealthy culture in FOSS, that encourages burnout, excessive travel, and unnecessary spending of money, that could be used for better things.

One last thing you can do, to help me, is submit talks to your local conference(s). This will help with some of these problems as well, can be a great experience, and is good for your conference and your community!

Categories: FLOSS Project Planets

PyCharm: Webinar Preview: “Functional React Components in TypeScript” tutorial step for React+TS+TDD

Planet Python - Fri, 2019-10-11 16:03

As a reminder… next Wednesday (Oct 16) I’m giving a webinar on React+TypeScript+TDD in PyCharm. I’m doing some blog posts about material that will be covered.

See the first blog post for some background on this webinar and its topic.

Spotlight: Functional React Components in TypeScript

Note: I’m skipping over a blog post for the tutorial step TSX and ES6 tutorial step. Should have started these spotlight blog posts sooner!

One thing is for sure about the React Zen: they promote lots and lots of tiny components. Which fits in very well with this tutorial’s TDD approach. Uncle Bob refers to this as the Single Responsibility Principle and SRP is mentioned frequently in React.

In the Functional React Components in TypeScript tutorial step we extract some markup and logic from the component into a Heading subcomponent. In this first step we don’t extract state or logic. We do, though, write tests first and learn a little more about the ways to interact with the DOM of a React component from within a test.

Here’s the narrated video for this step:

Categories: FLOSS Project Planets