26 May 2017

feedPlanet Python

Django Weekly: DjangoWeekly Issue 41 - Django Admin Customisation Video, Deployment, Pros and Cons of Django

Worthy Read

Django's admin is a great tool but it isn't always the easiest or friendliest to set up and customize. The ModelAdmin class has a lot of attributes and methods to understand and come to grips with. On top of these attributes, the admin's inlines, custom actions, custom media, and more mean that, really, you can do anything you need with the admin...if you can figure out how. The docs are good but leave a lot to experimentation and the code is notoriously dense. In this tutorial, you'll learn the basics of setting up the admin so you can get your job done. Then we'll dive deeper and see how advanced features like autocomplete, Markdown editors, image editors, and others would be added to make the admin really shine.
admin

We help companies like Airbnb, Pfizer, and Artsy find great developers. Let us find your next great hire. Get started today.
sponsor

In this tutorial, you will learn how to deploy a Django application with PostgreSQL, Nginx, Gunicorn on a Red Hat Enterprise Linux (RHEL) version 7.3. For testing purpose I'm using an Amazon EC2 instance running RHEL 7.3.
installation

It helps to have an understanding of why upgrading the backend should be considered a necessary part of any website upgrade project. We offer 3 reasons, focusing on our specialty of Django-based websites. Increases security, reduces development and maintenance costs, and ensures support for future growth.
core-django

Know when and why code breaks: Users finding bugs? Searching logs for errors? Find + fix broken code fast!
sponsor

core-django

The most commonly suggested solution for long running processes is to use Celery. I suspect that if you need scalabilty or high volume, etc… Celery is the best solution. That said, I have been down the Celery rabbit hole more than once. It has never been pleasant. Since my needs are more modest, maybe there is a better alternative?
redis

If you are using rate limiting with Django Rest Framework you probably already know that it provides some pretty simple methods for setting global rate limits using DEFAULT_THROTTLE_RATES. You can also set rate limits for specific views using the throttle_classes property on class-based views or the @throttle_classes decorator for function based views.
DRF

Django's postgres extensions support data types like DateRange which is super useful when you want to query your database against dates, however they have no form field to expose this into HTML. Handily Django 1.11 has made it super easy to write custom widgets with complex HTML.
postgres
,
DateRange

DRF


Projects

drf-swagger-customization - 4 Stars, 0 Fork
This is a django app which you can modify and improve your autogenerated swagger documentation from your drf API.

Django-REST-Boilerplate - 0 Stars, 0 Fork
Boilerplate for Django projects using Django REST Framework.

26 May 2017 9:00am GMT

Django Weekly: DjangoWeekly Issue 41 - Django Admin Customisation Video, Deployment, Pros and Cons of Django

Worthy Read

Django's admin is a great tool but it isn't always the easiest or friendliest to set up and customize. The ModelAdmin class has a lot of attributes and methods to understand and come to grips with. On top of these attributes, the admin's inlines, custom actions, custom media, and more mean that, really, you can do anything you need with the admin...if you can figure out how. The docs are good but leave a lot to experimentation and the code is notoriously dense. In this tutorial, you'll learn the basics of setting up the admin so you can get your job done. Then we'll dive deeper and see how advanced features like autocomplete, Markdown editors, image editors, and others would be added to make the admin really shine.
admin

We help companies like Airbnb, Pfizer, and Artsy find great developers. Let us find your next great hire. Get started today.
sponsor

In this tutorial, you will learn how to deploy a Django application with PostgreSQL, Nginx, Gunicorn on a Red Hat Enterprise Linux (RHEL) version 7.3. For testing purpose I'm using an Amazon EC2 instance running RHEL 7.3.
installation

It helps to have an understanding of why upgrading the backend should be considered a necessary part of any website upgrade project. We offer 3 reasons, focusing on our specialty of Django-based websites. Increases security, reduces development and maintenance costs, and ensures support for future growth.
core-django

Know when and why code breaks: Users finding bugs? Searching logs for errors? Find + fix broken code fast!
sponsor

core-django

The most commonly suggested solution for long running processes is to use Celery. I suspect that if you need scalabilty or high volume, etc… Celery is the best solution. That said, I have been down the Celery rabbit hole more than once. It has never been pleasant. Since my needs are more modest, maybe there is a better alternative?
redis

If you are using rate limiting with Django Rest Framework you probably already know that it provides some pretty simple methods for setting global rate limits using DEFAULT_THROTTLE_RATES. You can also set rate limits for specific views using the throttle_classes property on class-based views or the @throttle_classes decorator for function based views.
DRF

Django's postgres extensions support data types like DateRange which is super useful when you want to query your database against dates, however they have no form field to expose this into HTML. Handily Django 1.11 has made it super easy to write custom widgets with complex HTML.
postgres
,
DateRange

DRF


Projects

drf-swagger-customization - 4 Stars, 0 Fork
This is a django app which you can modify and improve your autogenerated swagger documentation from your drf API.

Django-REST-Boilerplate - 0 Stars, 0 Fork
Boilerplate for Django projects using Django REST Framework.

26 May 2017 9:00am GMT

Import Python: ImportPython Issue 126 - Pycon US Videos, PYPI, SQLAlchemy, Debugging, Mocking and more

Worthy Read

Videos of the just concluded Pycon US 2017.
pyconus
,
pycon

This is a short post on how to get download statistics about any package from PyPI. Though there have been efforts in that direction from sites like pypi ranking but this post finds a better solution. Google has been generous enough to donate it's Big Query capacity to the Python Software Foundation. You can access the pypi downloads table through the Big Query console. I ran a sample query to find out how my personal package arachne has been doing on PyPI.
bigquery
,
pipy

The breadth of SQLAlchemy's SQL rendering engine, DBAPI integration, transaction integration, and schema description services are documented here. In contrast to the ORM's domain-centric mode of usage, the SQL Expression Language provides a schema-centric usage paradigm.
SQLAlchemy

Users finding bugs? Searching logs for errors? Find + fix broken code fast!
sponsor

The various meanings and naming conventions around single and double underscores ("dunder") in Python, how name mangling works and how it affects your own Python classes.
core-python

In Python, all object types inherit from one master object, declared as PyObject . This master object has all of the information Python needs to process a pointer to an object as an actual object.
PyObject

So we had a production case for months together, where the python process was stuck for indefinitely long time (even days) with absolutely zero activity but the process was listed as active and running by linux. A restart would fix the problem (as always) and the job would be live and kicking. Finally after sometime, I have found the root cause, so I thought I would share it. For the purpose of the blog I'm going to simulate the behavior of my application in a sample python script.
debugging

We help companies like Airbnb, Pfizer, and Artsy find great developers. Let us find your next great hire. Get started today.
sponsor

Back in April, Google announced that it will be shipping Headless Chrome in Chrome 59. Since the respective flags are already available on Chrome Canary, the Duo Labs team thought it would be fun to test things out and also provide a brief introduction to driving Chrome using Selenium and Python.
chromium
,
headless

Elizabeth is a Python library, which helps generate mock data for various purposes. The library was written with the use of tools from the standard Python library, and therefore, it doesn't have any side dependencies. Currently the library supports 30 languages and 19 class providers, supplying various data.
mock

Python-boilerplate.com is a collection of Python boilerplates for getting started quickly and right-footed.
boilerplate

gensim

scraping

speech recognition

PyCon JP 2017 is Now Accepting Poster-Session Proposals! PyCon JP 2017 is a perfect opportunity to connect with a wide range of people. Poster sessions allow you to make the most of that opportunity.
pyconjp

pycon

idioms

Using Atom IDE.
atom

Python uses global to reference to module-global variables. There are no program-global variables in Python.
core-python
,
global

interview

Python's (pip's) requirements.txt file is the equivalent to package.json in the JavaScript / Node.js world. This requirements.txt file isn't as pretty as package.json but it not only defines a version but goes a step further, providing a sha hash to compare against to ensure package integrity:
pip
,
nodejs
,
requirement.txt


Jobs
Bangalore, Karnataka, India



Projects

baselines - 241 Stars, 28 Fork
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms

semilive - 92 Stars, 3 Fork
A Sublime Text plugin for "Live" coding

IPpy - 41 Stars, 3 Fork
Parallel testing of IP addresses and domains in python

content-downloader - 30 Stars, 10 Fork
Python package to download files on any topic in bulk.

v2ex-terminal - 27 Stars, 1 Fork
browse v2ex by a terminal

logging-spinner - 17 Stars, 0 Fork
Display spinners (in CLI) through Python standard logging.

aws-batch-genomics - 14 Stars, 4 Fork
Software sets up and runs an genome sequencing analysis workflow using AWS Batch and AWS Step Functions.

twitter-bot - 5 Stars, 0 Fork
Python Bot that Tweets quote and like Tweets.

jsonfeedvalidator - 4 Stars, 0 Fork
JSON Feed Validator

handcart - 3 Stars, 1 Fork
Command-line tools for project-oriented, human-sized Wikidata import

slacky - 0 Stars, 0 Fork
Slack client on the terminal with a GUI.This is a weekend project that started for me as a way to learn how to write old style command line interfaces. Slack is a tool a lot of programmers use today so I thought a lot of you would have interest in contributing to this effor.

26 May 2017 8:55am GMT

Import Python: ImportPython Issue 126 - Pycon US Videos, PYPI, SQLAlchemy, Debugging, Mocking and more

Worthy Read

Videos of the just concluded Pycon US 2017.
pyconus
,
pycon

This is a short post on how to get download statistics about any package from PyPI. Though there have been efforts in that direction from sites like pypi ranking but this post finds a better solution. Google has been generous enough to donate it's Big Query capacity to the Python Software Foundation. You can access the pypi downloads table through the Big Query console. I ran a sample query to find out how my personal package arachne has been doing on PyPI.
bigquery
,
pipy

The breadth of SQLAlchemy's SQL rendering engine, DBAPI integration, transaction integration, and schema description services are documented here. In contrast to the ORM's domain-centric mode of usage, the SQL Expression Language provides a schema-centric usage paradigm.
SQLAlchemy

Users finding bugs? Searching logs for errors? Find + fix broken code fast!
sponsor

The various meanings and naming conventions around single and double underscores ("dunder") in Python, how name mangling works and how it affects your own Python classes.
core-python

In Python, all object types inherit from one master object, declared as PyObject . This master object has all of the information Python needs to process a pointer to an object as an actual object.
PyObject

So we had a production case for months together, where the python process was stuck for indefinitely long time (even days) with absolutely zero activity but the process was listed as active and running by linux. A restart would fix the problem (as always) and the job would be live and kicking. Finally after sometime, I have found the root cause, so I thought I would share it. For the purpose of the blog I'm going to simulate the behavior of my application in a sample python script.
debugging

We help companies like Airbnb, Pfizer, and Artsy find great developers. Let us find your next great hire. Get started today.
sponsor

Back in April, Google announced that it will be shipping Headless Chrome in Chrome 59. Since the respective flags are already available on Chrome Canary, the Duo Labs team thought it would be fun to test things out and also provide a brief introduction to driving Chrome using Selenium and Python.
chromium
,
headless

Elizabeth is a Python library, which helps generate mock data for various purposes. The library was written with the use of tools from the standard Python library, and therefore, it doesn't have any side dependencies. Currently the library supports 30 languages and 19 class providers, supplying various data.
mock

Python-boilerplate.com is a collection of Python boilerplates for getting started quickly and right-footed.
boilerplate

gensim

scraping

speech recognition

PyCon JP 2017 is Now Accepting Poster-Session Proposals! PyCon JP 2017 is a perfect opportunity to connect with a wide range of people. Poster sessions allow you to make the most of that opportunity.
pyconjp

pycon

idioms

Using Atom IDE.
atom

Python uses global to reference to module-global variables. There are no program-global variables in Python.
core-python
,
global

interview

Python's (pip's) requirements.txt file is the equivalent to package.json in the JavaScript / Node.js world. This requirements.txt file isn't as pretty as package.json but it not only defines a version but goes a step further, providing a sha hash to compare against to ensure package integrity:
pip
,
nodejs
,
requirement.txt


Jobs
Bangalore, Karnataka, India



Projects

baselines - 241 Stars, 28 Fork
OpenAI Baselines: high-quality implementations of reinforcement learning algorithms

semilive - 92 Stars, 3 Fork
A Sublime Text plugin for "Live" coding

IPpy - 41 Stars, 3 Fork
Parallel testing of IP addresses and domains in python

content-downloader - 30 Stars, 10 Fork
Python package to download files on any topic in bulk.

v2ex-terminal - 27 Stars, 1 Fork
browse v2ex by a terminal

logging-spinner - 17 Stars, 0 Fork
Display spinners (in CLI) through Python standard logging.

aws-batch-genomics - 14 Stars, 4 Fork
Software sets up and runs an genome sequencing analysis workflow using AWS Batch and AWS Step Functions.

twitter-bot - 5 Stars, 0 Fork
Python Bot that Tweets quote and like Tweets.

jsonfeedvalidator - 4 Stars, 0 Fork
JSON Feed Validator

handcart - 3 Stars, 1 Fork
Command-line tools for project-oriented, human-sized Wikidata import

slacky - 0 Stars, 0 Fork
Slack client on the terminal with a GUI.This is a weekend project that started for me as a way to learn how to write old style command line interfaces. Slack is a tool a lot of programmers use today so I thought a lot of you would have interest in contributing to this effor.

26 May 2017 8:55am GMT

Robin Parmar: Arduino IDE: Best practices and gotchas

Programming for the Arduino is designed to be easy for beginners. The Integrated Development Environment (IDE) provides a safe place to write code, and handles the make and compiler steps that are required to create processor instructions from your C++ code.

This is fine for trivial applications and school exercises. But as soon as you try to use structured code (including classes and custom libraries) on a larger project, mysterious errors and roadblocks become the order of the day.

This article will consider best practices for working within the IDE. I will document a number of common errors and their workarounds. My perspective is of an experienced Python coder who finds C++ full of needless obfuscation. But we can make it work!

Why not switch?

On encountering limitations with the Arduino IDE, the natural thing to do is switch to a mature development environment. For example, you could use Microsoft Visual Studio by way of Visual Micro, a plugin that enables Arduino coding. Or, use Eclipse with one of several available plugins: Sloeber, PlatformIO, or AVR-eclipse.

But there are cases when it is advantageous to stick with the Arduino IDE. For example, I might be working on a team with other less-experienced developers. While I might wish to carry the cognitive burden of Eclipse plus plugins plus project management, they might not.

Or I could be in a teaching environment where my code must be developed with the same tools my students will be using.

Language features... and what's missing

The Arduino IDE gives you many basic C++ language features plus hardware-specific functions. Control structures, values, and data types are documented in the Reference.

But you don't get modern features such as the Standard Template Library (STL). If you want to use stacks, queues, lists, vectors, etc. you must install a library. Start with those by Marc Jacobi (last updated 2 years ago) and Andy Brown (updated 1 year ago). I am sure there are plenty of articles discussing the relative merits of these or other solutions.

You also don't get new and delete operators, and there's good reason. Dynamic memory management is discouraged on microprocessor boards, since RAM and other resources are limited. There are libraries that add these to your toolkit, but the IDE encourages us to use C++ as though it was little more than plain vanilla C. It can be frustrating, but my advice is to adapt.

Code structure

As you know, when using the Arduino IDE you start coding with a sketch that is your application's entry point. As an example, I'll use project.ino.

Inside this file are always two functions, setup() and loop(). These take no parameters and return no values. There's not much you can do with them... except populate them with your code. These functions are part of an implicit code structure that could be written as follows:

void main() {

// declaration section

setup(); // initialisation (runs once)

while (true) {
loop(); // process-oriented code (runs forever)
}
}


In the IDE you never see the main() function and neither can you manipulate it.

Declaration section

The declaration section comes at the top of your project.ino. It is effectively outside any code block. Yes, even though it is in an implicit main() function. This means that only declarations and initializations are valid here. You cannot call methods of a class, nor access properties. This is our first rule:

Rule 1. The declaration section should contain only includes, initialisations of variables, and instantiations of classes.

This restriction can result in subtle errors when using classes. The declaration section is naturally where you will be instantiating classes you wish to use throughout the sketch. This means that the same restrictions just stated must apply to each and every class constructor. For this reason, you cannot use instances or methods of other classes in a constructor. No, not even for built-in libraries like Serial or Wire. Because the order of instantiation of classes is non-deterministic. All instances must be constructed before any instances are used.

Rule 2. A class constructor should have no arguments and do nothing but set default values for any properties.

Follow the example of the library classes for your own custom classes. Provide a begin() method that does take needed parameters and performs any initialization tasks. In other words, begin() should do everything you might otherwise expect the constructor to do. Call this method in the setup() block.

By the way, this solves another problem. A class that might be passed to another class requires a constructor that takes no parameters. Normally you would provide this in addition to another constructor template. But if you follow the rule two, this condition is already met.

Care with instantiation

The next discussion will prevent a syntax error. When instantiating a class with a constructor, you would normally do something like the following, assuming class Foo is defined elsewhere.

const byte pin = 10;
Foo bar(pin);

void setup() {}

void loop() {
int result = bar.read();
}

But following our previous rule, constructors will never have arguments. You might quite naturally write this instead:

const byte pin = 10;
Foo bar();

void setup() {
bar.begin(pin);
}
void loop() {
int result = bar.read();
}

This generates the error "request for member 'read' in 'bar' which is of non-class type 'Foo'. That appears nonsensical, because Foo is most definitely a class. Spot the syntax error?

To the compiler, bar() looks like a function call. You need to rewrite that line as:

Foo bar;

Abandoning the sketch

Before you even get to this point of sophistication in your code, you will be seeing all sorts of mystifying compiler output. "Error: 'foo' has not been declared" for a foo that most certainly has been declared. "Error: 'foo' does not name a type" for a foo that is definitively a type. And so on.

These errors occur because the compiler is generating function prototypes for you, automatically, even if you don't need them. These prototypes will even over-ride your own perfectly good code. The only thing to do is abandon the sketch! Move to the lifeboats! Compiler error! Danger, Will Robinson!

Ahem.

Do the following:

1. Create a new .cpp file, ensuring it is not named the same as your sketch, and also not named main.cpp. These are both name conflicts. As an example, let's call it primary.cpp.

2. Copy all the code from project.ino to primary.cpp.

3. Add #include <Arduino.h> to the top of primary.cpp, before your other includes. This ensures that your code can access the standard prototypes.

4. In project.ino leave only your #include statements. Delete everything else.

This will solve all those mysterious issues. You can now prototype your own functions and classes without the IDE getting in your way. You will, however, need to remember that every time you add an #include to primary.cpp, you need to also add it to project.ino. But it's a small price to pay.

Rule 3. Use a top-level C++ file instead of a sketch file.

Simple includes

It's easy to get confused about include files. But all an include represents is a copy and paste operation. The referenced code is inserted at the point where the include directive is located.

Here are the rules.

1. You need a .h header file for each .cpp code file.

2. The .cpp should have only one include, that being its corresponding header (a file with the same name but different extension).

3. The header file must have all the includes necessary for the correct running of the .h and .cpp code. And, in the correct order, if there are dependencies.

4. A header guard is required for each .h file. This prevents the header from being included in your project multiple times. It doesn't matter what variable name you choose for the test, so long as it is unique.

#ifndef LIB_H
#define LIB_H

// everything else

#endif

5. If you have any sort of complex chaining, with circular pointer referencing, you may have to use forward referencing. But you should be avoiding this complexity in the sort of projects likely to run on an Arduino. So I won't count this rule in our next meta-rule.

Rule 4. Follow the four rules of correct header use.

Using libraries

The IDE limits how you use libraries to the very simplest case. Libraries get installed in one standard location across all your projects. You can put a library nowhere else. Why might you want to?

I am currently developing three modules as part of a single project. The code for each module is in its own folder. They have shared library code that I would like to put in a parallel folder, so I would have a folder hierarchy something like this:

/myproject
/module-1
/module-2
/module-3
/common

Then I could easily archive "myproject" into a ZIP file to share with the rest of the team.

Can I do this? No. It is not possible, since relative paths cannot be used in the IDE. And absolute paths are evil.

Rule 5. There is no rule to help manage libraries. Sorry.

Final Words

I have personally wasted dozens of hours before discovering these tips and working methods. It has been an enormous process of trial-and-error. If you are lucky enough to read this article first, you will never know the pain.

I have a donate button in the sidebar, in case you wish to thank me with a coffee.

In turn I'd like to thank Nick Gammon for an article I wish I'd read a bit sooner.

If there's interest, I might follow up with some words about general C++ syntax and issues that are not so Arduino-centric.

26 May 2017 4:17am GMT

Robin Parmar: Arduino IDE: Best practices and gotchas

Programming for the Arduino is designed to be easy for beginners. The Integrated Development Environment (IDE) provides a safe place to write code, and handles the make and compiler steps that are required to create processor instructions from your C++ code.

This is fine for trivial applications and school exercises. But as soon as you try to use structured code (including classes and custom libraries) on a larger project, mysterious errors and roadblocks become the order of the day.

This article will consider best practices for working within the IDE. I will document a number of common errors and their workarounds. My perspective is of an experienced Python coder who finds C++ full of needless obfuscation. But we can make it work!

Why not switch?

On encountering limitations with the Arduino IDE, the natural thing to do is switch to a mature development environment. For example, you could use Microsoft Visual Studio by way of Visual Micro, a plugin that enables Arduino coding. Or, use Eclipse with one of several available plugins: Sloeber, PlatformIO, or AVR-eclipse.

But there are cases when it is advantageous to stick with the Arduino IDE. For example, I might be working on a team with other less-experienced developers. While I might wish to carry the cognitive burden of Eclipse plus plugins plus project management, they might not.

Or I could be in a teaching environment where my code must be developed with the same tools my students will be using.

Language features... and what's missing

The Arduino IDE gives you many basic C++ language features plus hardware-specific functions. Control structures, values, and data types are documented in the Reference.

But you don't get modern features such as the Standard Template Library (STL). If you want to use stacks, queues, lists, vectors, etc. you must install a library. Start with those by Marc Jacobi (last updated 2 years ago) and Andy Brown (updated 1 year ago). I am sure there are plenty of articles discussing the relative merits of these or other solutions.

You also don't get new and delete operators, and there's good reason. Dynamic memory management is discouraged on microprocessor boards, since RAM and other resources are limited. There are libraries that add these to your toolkit, but the IDE encourages us to use C++ as though it was little more than plain vanilla C. It can be frustrating, but my advice is to adapt.

Code structure

As you know, when using the Arduino IDE you start coding with a sketch that is your application's entry point. As an example, I'll use project.ino.

Inside this file are always two functions, setup() and loop(). These take no parameters and return no values. There's not much you can do with them... except populate them with your code. These functions are part of an implicit code structure that could be written as follows:

void main() {

// declaration section

setup(); // initialisation (runs once)

while (true) {
loop(); // process-oriented code (runs forever)
}
}


In the IDE you never see the main() function and neither can you manipulate it.

Declaration section

The declaration section comes at the top of your project.ino. It is effectively outside any code block. Yes, even though it is in an implicit main() function. This means that only declarations and initializations are valid here. You cannot call methods of a class, nor access properties. This is our first rule:

Rule 1. The declaration section should contain only includes, initialisations of variables, and instantiations of classes.

This restriction can result in subtle errors when using classes. The declaration section is naturally where you will be instantiating classes you wish to use throughout the sketch. This means that the same restrictions just stated must apply to each and every class constructor. For this reason, you cannot use instances or methods of other classes in a constructor. No, not even for built-in libraries like Serial or Wire. Because the order of instantiation of classes is non-deterministic. All instances must be constructed before any instances are used.

Rule 2. A class constructor should have no arguments and do nothing but set default values for any properties.

Follow the example of the library classes for your own custom classes. Provide a begin() method that does take needed parameters and performs any initialization tasks. In other words, begin() should do everything you might otherwise expect the constructor to do. Call this method in the setup() block.

By the way, this solves another problem. A class that might be passed to another class requires a constructor that takes no parameters. Normally you would provide this in addition to another constructor template. But if you follow the rule two, this condition is already met.

Care with instantiation

The next discussion will prevent a syntax error. When instantiating a class with a constructor, you would normally do something like the following, assuming class Foo is defined elsewhere.

const byte pin = 10;
Foo bar(pin);

void setup() {}

void loop() {
int result = bar.read();
}

But following our previous rule, constructors will never have arguments. You might quite naturally write this instead:

const byte pin = 10;
Foo bar();

void setup() {
bar.begin(pin);
}
void loop() {
int result = bar.read();
}

This generates the error "request for member 'read' in 'bar' which is of non-class type 'Foo'. That appears nonsensical, because Foo is most definitely a class. Spot the syntax error?

To the compiler, bar() looks like a function call. You need to rewrite that line as:

Foo bar;

Abandoning the sketch

Before you even get to this point of sophistication in your code, you will be seeing all sorts of mystifying compiler output. "Error: 'foo' has not been declared" for a foo that most certainly has been declared. "Error: 'foo' does not name a type" for a foo that is definitively a type. And so on.

These errors occur because the compiler is generating function prototypes for you, automatically, even if you don't need them. These prototypes will even over-ride your own perfectly good code. The only thing to do is abandon the sketch! Move to the lifeboats! Compiler error! Danger, Will Robinson!

Ahem.

Do the following:

1. Create a new .cpp file, ensuring it is not named the same as your sketch, and also not named main.cpp. These are both name conflicts. As an example, let's call it primary.cpp.

2. Copy all the code from project.ino to primary.cpp.

3. Add #include <Arduino.h> to the top of primary.cpp, before your other includes. This ensures that your code can access the standard prototypes.

4. In project.ino leave only your #include statements. Delete everything else.

This will solve all those mysterious issues. You can now prototype your own functions and classes without the IDE getting in your way. You will, however, need to remember that every time you add an #include to primary.cpp, you need to also add it to project.ino. But it's a small price to pay.

Rule 3. Use a top-level C++ file instead of a sketch file.

Simple includes

It's easy to get confused about include files. But all an include represents is a copy and paste operation. The referenced code is inserted at the point where the include directive is located.

Here are the rules.

1. You need a .h header file for each .cpp code file.

2. The .cpp should have only one include, that being its corresponding header (a file with the same name but different extension).

3. The header file must have all the includes necessary for the correct running of the .h and .cpp code. And, in the correct order, if there are dependencies.

4. A header guard is required for each .h file. This prevents the header from being included in your project multiple times. It doesn't matter what variable name you choose for the test, so long as it is unique.

#ifndef LIB_H
#define LIB_H

// everything else

#endif

5. If you have any sort of complex chaining, with circular pointer referencing, you may have to use forward referencing. But you should be avoiding this complexity in the sort of projects likely to run on an Arduino. So I won't count this rule in our next meta-rule.

Rule 4. Follow the four rules of correct header use.

Using libraries

The IDE limits how you use libraries to the very simplest case. Libraries get installed in one standard location across all your projects. You can put a library nowhere else. Why might you want to?

I am currently developing three modules as part of a single project. The code for each module is in its own folder. They have shared library code that I would like to put in a parallel folder, so I would have a folder hierarchy something like this:

/myproject
/module-1
/module-2
/module-3
/common

Then I could easily archive "myproject" into a ZIP file to share with the rest of the team.

Can I do this? No. It is not possible, since relative paths cannot be used in the IDE. And absolute paths are evil.

Rule 5. There is no rule to help manage libraries. Sorry.

Final Words

I have personally wasted dozens of hours before discovering these tips and working methods. It has been an enormous process of trial-and-error. If you are lucky enough to read this article first, you will never know the pain.

I have a donate button in the sidebar, in case you wish to thank me with a coffee.

In turn I'd like to thank Nick Gammon for an article I wish I'd read a bit sooner.

If there's interest, I might follow up with some words about general C++ syntax and issues that are not so Arduino-centric.

26 May 2017 4:17am GMT

25 May 2017

feedPlanet Python

Programming Ideas With Jake: Lots of Programming Videos!

A whole bunch of videos have recently dropped from programmer conferences. Like, a LOT!

25 May 2017 9:53pm GMT

Programming Ideas With Jake: Lots of Programming Videos!

A whole bunch of videos have recently dropped from programmer conferences. Like, a LOT!

25 May 2017 9:53pm GMT

PyBites: How to Write a Python Class

In this post I cover learning Python classes by walking through one of our 100 days of code submissions.

25 May 2017 1:44pm GMT

PyBites: How to Write a Python Class

In this post I cover learning Python classes by walking through one of our 100 days of code submissions.

25 May 2017 1:44pm GMT

Python Bytes: #27 The PyCon 2017 recap and functional Python

<ul> <li>All videos available: <a href="https://www.youtube.com/channel/UCrJhliKNQ8g0qoE_zvL8eVg">https://www.youtube.com/channel/UCrJhliKNQ8g0qoE_zvL8eVg</a></li> <li>Lessons learned: <ul> <li>pick up swag on day one. vendors run out.</li> <li>take business cards with you and keep them on you</li> <li>Not your actual business cards unless you are representing your company.</li> <li>Cards that have your social media, github account, blog, or podcast or whatever on them.</li> <li>3x3 stickers are too big. 2x2 plenty big enough</li> <li>lightening talks are awesome, because they are a lot of ranges of speaking experience</li> <li>will definitely do that again</li> <li>try to go to the talks that are important to you, but don't over stress about it, since they are taped. However, it would be lame if all the rooms were empty, so don't everybody ditch.</li> <li>lastly: everyone knows Michael. </li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://www.fullstackpython.com/blog/aws-lambda-python-3-6.html"><strong>How to Create Your First Python 3.6 AWS Lambda Function</strong></a></p> <ul> <li>Tutorial from <a href="https://www.fullstackpython.com/">Full Stack Python</a></li> <li>Walks you through creating an account</li> <li>Select your Python version (3.6, yes!)</li> <li><code>def lambda_handler(event, context): …</code> # write this function, done!</li> <li>Set and read environment variables (could be connection strings and API keys)</li> </ul> <p><strong>Brian #3:</strong> <a href="https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/"><strong>How to Publish Your Package on PYPI</strong></a></p> <ul> <li>jetbrains article <ul> <li>structure of the package</li> <li>oops. doesn't include src, see https://pythonbytes.fm/22</li> <li>decent discussion of a the contents of the setup.py file (but interestingly absent is an example setup.py file)</li> <li>good discussion of .pypirc file and links to the test and production PyPi</li> <li>example of using twine to push to PyPI</li> <li>overall: good discussion, but you'll still need a decent example.</li> </ul></li> </ul> <p><strong>Michael #4:</strong> <a href="http://coconut-lang.org/"><strong>Coconut: Simple, elegant, Pythonic functional programming</strong></a></p> <ul> <li>Coconut is a functional programming language that compiles to Python. </li> <li>Since all valid Python is valid Coconut, using Coconut will only extend and enhance what you're already capable of in Python.</li> <li><code>pip install coconut</code> <ol> <li>Some of Coconut's major features include built-in, syntactic support for:</li> <li>Pattern-matching,</li> <li>Algebraic data-types,</li> <li>Tail call optimization,</li> <li>Partial application,</li> <li>Better lambdas,</li> <li>Parallelization primitives, and</li> <li>A whole lot more, all of which can be found in <a href="http://coconut.readthedocs.io/en/master/DOCS.html">Coconut's detailed documentation</a>.</li> </ol></li> <li>Talk Python episode coming in a week</li> </ul> <p><strong>Brian #5:</strong> <a href="https://choosealicense.com/"><strong>Choose a licence</strong></a></p> <ul> <li>MIT : simple and permissive</li> <li>Apache 2.0 : something extra about patents.</li> <li>GPL v3 : this is the contagious one that requires derivitive work to also be GPL v3</li> <li>Nice list with overviews of what they all mean with color coded bullet points: <a href="https://choosealicense.com/licenses/">https://choosealicense.com/licenses/</a></li> </ul> <p><strong>Michael #6:</strong> <a href="http://pythonforengineers.com/python-for-scientists-and-engineers/"><strong>Python for Scientists and Engineers</strong></a></p> <ul> <li><strong>Table of contents</strong>:</li> <li><strong>Beginners Start Here:</strong> <ul> <li><a href="http://pythonforengineers.com/create-a-word-counter-in-python/"><strong>Create a Word Counter in Python</strong></a></li> <li><a href="http://pythonforengineers.com/an-introduction-to-numpy-and-matplotlib/"><strong>An introduction to Numpy and Matplotlib</strong></a></li> <li><a href="http://pythonforengineers.com/introduction-to-pandas/"><strong>Introduction to Pandas with Practical Examples (New)</strong></a></li> </ul></li> <li><strong>Main Book</strong> <ul> <li><a href="http://pythonforengineers.com/image-and-video-processing-in-python/"><strong>Image and Video Processing in Python</strong></a></li> <li><a href="http://pythonforengineers.com/data-analysis-with-pandas/"><strong>Data Analysis with Pandas</strong></a></li> <li><a href="http://pythonforengineers.com/audio-and-digital-signal-processingdsp-in-python/"><strong>Audio and Digital Signal Processing (DSP)</strong></a></li> <li><a href="http://pythonforengineers.com/control-your-raspberry-pi-from-your-phone-tablet/"><strong>Control Your Raspberry Pi From Your Phone / Tablet</strong></a></li> </ul></li> <li><strong>Machine Learning Section</strong> <ul> <li><a href="http://pythonforengineers.com/machine-learning-with-an-amazon-like-recommendation-engine/"><strong>Machine Learning with an Amazon like Recommendation Engine</strong></a></li> <li><a href="http://pythonforengineers.com/machine-learning-for-complete-beginners/"><strong>Machine Learning For Complete Beginners:</strong></a> <em><em></em></em>Learn how to predict how many Titanic survivors using machine learning. No previous knowledge needed!</li> <li><a href="http://pythonforengineers.com/cross-validation-and-model-selection/"><strong>Cross Validation and Model Selection</strong></a>: In which we look at cross validation, and how to choose between different machine learning algorithms. Working with the Iris flower dataset and the Pima diabetes dataset.</li> </ul></li> <li><strong>Natural Language Processing</strong> <ul> <li><a href="http://pythonforengineers.com/natural-language-processing-and-sentiment-analysis-with-python/"><strong>Introduction to NLP and Sentiment Analysis</strong></a></li> <li><a href="http://pythonforengineers.com/introduction-to-nltk-natural-language-processing-with-python/"><strong>Natural Language Processing with NTLK</strong></a></li> <li><a href="http://pythonforengineers.com/intro-to-nltk-part-2/"><strong>Intro to NTLK, Part 2</strong></a></li> <li><a href="http://pythonforengineers.com/build-a-sentiment-analysis-app-with-movie-reviews/"><strong>Build a sentiment analysis program</strong></a></li> <li><a href="http://pythonforengineers.com/practice-session-sentiment-analysis-with-twitter/"><strong>Sentiment Analysis with Twitter</strong></a></li> <li><a href="http://pythonforengineers.com/analysing-the-enron-email-corpus/"><strong>Analysing the Enron Email Corpus</strong></a>: The Enron Email corpus has half a million files spread over 2.5 GB. When looking at data this size, the question is, where do you even start?</li> <li><a href="http://pythonforengineers.com/build-a-spam-filter/"><strong>Build a Spam Filter using the Enron Corpus</strong></a></li> </ul></li> </ul> <p><strong>In other news</strong>:</p> <ul> <li><a href="https://pragprog.com/book/bopytest/python-testing-with-pytest">Python Testing with pytest</a> Beta release and initial feedback is going very well.</li> </ul>

25 May 2017 8:00am GMT

Python Bytes: #27 The PyCon 2017 recap and functional Python

<ul> <li>All videos available: <a href="https://www.youtube.com/channel/UCrJhliKNQ8g0qoE_zvL8eVg">https://www.youtube.com/channel/UCrJhliKNQ8g0qoE_zvL8eVg</a></li> <li>Lessons learned: <ul> <li>pick up swag on day one. vendors run out.</li> <li>take business cards with you and keep them on you</li> <li>Not your actual business cards unless you are representing your company.</li> <li>Cards that have your social media, github account, blog, or podcast or whatever on them.</li> <li>3x3 stickers are too big. 2x2 plenty big enough</li> <li>lightening talks are awesome, because they are a lot of ranges of speaking experience</li> <li>will definitely do that again</li> <li>try to go to the talks that are important to you, but don't over stress about it, since they are taped. However, it would be lame if all the rooms were empty, so don't everybody ditch.</li> <li>lastly: everyone knows Michael. </li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://www.fullstackpython.com/blog/aws-lambda-python-3-6.html"><strong>How to Create Your First Python 3.6 AWS Lambda Function</strong></a></p> <ul> <li>Tutorial from <a href="https://www.fullstackpython.com/">Full Stack Python</a></li> <li>Walks you through creating an account</li> <li>Select your Python version (3.6, yes!)</li> <li><code>def lambda_handler(event, context): …</code> # write this function, done!</li> <li>Set and read environment variables (could be connection strings and API keys)</li> </ul> <p><strong>Brian #3:</strong> <a href="https://blog.jetbrains.com/pycharm/2017/05/how-to-publish-your-package-on-pypi/"><strong>How to Publish Your Package on PYPI</strong></a></p> <ul> <li>jetbrains article <ul> <li>structure of the package</li> <li>oops. doesn't include src, see https://pythonbytes.fm/22</li> <li>decent discussion of a the contents of the setup.py file (but interestingly absent is an example setup.py file)</li> <li>good discussion of .pypirc file and links to the test and production PyPi</li> <li>example of using twine to push to PyPI</li> <li>overall: good discussion, but you'll still need a decent example.</li> </ul></li> </ul> <p><strong>Michael #4:</strong> <a href="http://coconut-lang.org/"><strong>Coconut: Simple, elegant, Pythonic functional programming</strong></a></p> <ul> <li>Coconut is a functional programming language that compiles to Python. </li> <li>Since all valid Python is valid Coconut, using Coconut will only extend and enhance what you're already capable of in Python.</li> <li><code>pip install coconut</code> <ol> <li>Some of Coconut's major features include built-in, syntactic support for:</li> <li>Pattern-matching,</li> <li>Algebraic data-types,</li> <li>Tail call optimization,</li> <li>Partial application,</li> <li>Better lambdas,</li> <li>Parallelization primitives, and</li> <li>A whole lot more, all of which can be found in <a href="http://coconut.readthedocs.io/en/master/DOCS.html">Coconut's detailed documentation</a>.</li> </ol></li> <li>Talk Python episode coming in a week</li> </ul> <p><strong>Brian #5:</strong> <a href="https://choosealicense.com/"><strong>Choose a licence</strong></a></p> <ul> <li>MIT : simple and permissive</li> <li>Apache 2.0 : something extra about patents.</li> <li>GPL v3 : this is the contagious one that requires derivitive work to also be GPL v3</li> <li>Nice list with overviews of what they all mean with color coded bullet points: <a href="https://choosealicense.com/licenses/">https://choosealicense.com/licenses/</a></li> </ul> <p><strong>Michael #6:</strong> <a href="http://pythonforengineers.com/python-for-scientists-and-engineers/"><strong>Python for Scientists and Engineers</strong></a></p> <ul> <li><strong>Table of contents</strong>:</li> <li><strong>Beginners Start Here:</strong> <ul> <li><a href="http://pythonforengineers.com/create-a-word-counter-in-python/"><strong>Create a Word Counter in Python</strong></a></li> <li><a href="http://pythonforengineers.com/an-introduction-to-numpy-and-matplotlib/"><strong>An introduction to Numpy and Matplotlib</strong></a></li> <li><a href="http://pythonforengineers.com/introduction-to-pandas/"><strong>Introduction to Pandas with Practical Examples (New)</strong></a></li> </ul></li> <li><strong>Main Book</strong> <ul> <li><a href="http://pythonforengineers.com/image-and-video-processing-in-python/"><strong>Image and Video Processing in Python</strong></a></li> <li><a href="http://pythonforengineers.com/data-analysis-with-pandas/"><strong>Data Analysis with Pandas</strong></a></li> <li><a href="http://pythonforengineers.com/audio-and-digital-signal-processingdsp-in-python/"><strong>Audio and Digital Signal Processing (DSP)</strong></a></li> <li><a href="http://pythonforengineers.com/control-your-raspberry-pi-from-your-phone-tablet/"><strong>Control Your Raspberry Pi From Your Phone / Tablet</strong></a></li> </ul></li> <li><strong>Machine Learning Section</strong> <ul> <li><a href="http://pythonforengineers.com/machine-learning-with-an-amazon-like-recommendation-engine/"><strong>Machine Learning with an Amazon like Recommendation Engine</strong></a></li> <li><a href="http://pythonforengineers.com/machine-learning-for-complete-beginners/"><strong>Machine Learning For Complete Beginners:</strong></a> <em><em></em></em>Learn how to predict how many Titanic survivors using machine learning. No previous knowledge needed!</li> <li><a href="http://pythonforengineers.com/cross-validation-and-model-selection/"><strong>Cross Validation and Model Selection</strong></a>: In which we look at cross validation, and how to choose between different machine learning algorithms. Working with the Iris flower dataset and the Pima diabetes dataset.</li> </ul></li> <li><strong>Natural Language Processing</strong> <ul> <li><a href="http://pythonforengineers.com/natural-language-processing-and-sentiment-analysis-with-python/"><strong>Introduction to NLP and Sentiment Analysis</strong></a></li> <li><a href="http://pythonforengineers.com/introduction-to-nltk-natural-language-processing-with-python/"><strong>Natural Language Processing with NTLK</strong></a></li> <li><a href="http://pythonforengineers.com/intro-to-nltk-part-2/"><strong>Intro to NTLK, Part 2</strong></a></li> <li><a href="http://pythonforengineers.com/build-a-sentiment-analysis-app-with-movie-reviews/"><strong>Build a sentiment analysis program</strong></a></li> <li><a href="http://pythonforengineers.com/practice-session-sentiment-analysis-with-twitter/"><strong>Sentiment Analysis with Twitter</strong></a></li> <li><a href="http://pythonforengineers.com/analysing-the-enron-email-corpus/"><strong>Analysing the Enron Email Corpus</strong></a>: The Enron Email corpus has half a million files spread over 2.5 GB. When looking at data this size, the question is, where do you even start?</li> <li><a href="http://pythonforengineers.com/build-a-spam-filter/"><strong>Build a Spam Filter using the Enron Corpus</strong></a></li> </ul></li> </ul> <p><strong>In other news</strong>:</p> <ul> <li><a href="https://pragprog.com/book/bopytest/python-testing-with-pytest">Python Testing with pytest</a> Beta release and initial feedback is going very well.</li> </ul>

25 May 2017 8:00am GMT

Experienced Django: Return of pylint

Until last fall I was working in python 2 (due to some limitations at work) and was very happy to have the Syntastic module in my Vim configuration to flag error each time I save a python file. This was great, especially after writing in C/C++ for years where there is no official standard format and really poor tools to enforce coding standards.

Then, last fall when I started on Django, I made the decision to move to Python 3. I quickly discovered that pylint is very version-dependent and running the python2.7 version of pylint against Python3 code was not going to work.

I wasn't particularly familiar with virtualenv at the time, so I gave up and moved on with other things at the time. I finally got back to fixing this and thus getting pylint and flake8 running again on my code.

Syntastic

I won't cover the details of how to install Syntastic as it depends on how you manage your plugins in Vim and is well documented. I will only point out here that Syntastic isn't a checker by itself, it's merely a plugin to run various checkers for you directly in Vim. It run checkers for many languages, but I'm only using it for Python currently as the C code I use for work is so ugly that it will never pass.

Switching versions

The key to getting pylint to run against different versions of python is to not install pylint on a global level, but rather to install it in each virtualenv. This seems obvious now that I'm more familiar with virtualenv, but I'll admit it wasn't at the time I first ran into the problem.

The other key to getting this to work is to only initiate Vim from inside the virtualenv. This hampers my overall workflow a bit, as I tend to have gVim up and running for the long-term and just add files in new tabs as I go. To get pylint to work properly, I'll need to restart Vim when I switch python versions (at a minimum). This shouldn't be too much of a problem, however, as I'm doing less and less python2x coding these days.

Coding Style Thoughts

As I beat my head against horrible C code on a daily basis at work, I find myself appreciating more-and-more the idea of PEP-8 and having good tools for coding style enforcement. While I frequently find some of the rules odd (two spaces here, but only one space there?) I really find it comforting to have a tool which runs, and runs quickly, to keep the code looking consistent. Now if I could only get that kind of tool for C…….

25 May 2017 1:22am GMT

Experienced Django: Return of pylint

Until last fall I was working in python 2 (due to some limitations at work) and was very happy to have the Syntastic module in my Vim configuration to flag error each time I save a python file. This was great, especially after writing in C/C++ for years where there is no official standard format and really poor tools to enforce coding standards.

Then, last fall when I started on Django, I made the decision to move to Python 3. I quickly discovered that pylint is very version-dependent and running the python2.7 version of pylint against Python3 code was not going to work.

I wasn't particularly familiar with virtualenv at the time, so I gave up and moved on with other things at the time. I finally got back to fixing this and thus getting pylint and flake8 running again on my code.

Syntastic

I won't cover the details of how to install Syntastic as it depends on how you manage your plugins in Vim and is well documented. I will only point out here that Syntastic isn't a checker by itself, it's merely a plugin to run various checkers for you directly in Vim. It run checkers for many languages, but I'm only using it for Python currently as the C code I use for work is so ugly that it will never pass.

Switching versions

The key to getting pylint to run against different versions of python is to not install pylint on a global level, but rather to install it in each virtualenv. This seems obvious now that I'm more familiar with virtualenv, but I'll admit it wasn't at the time I first ran into the problem.

The other key to getting this to work is to only initiate Vim from inside the virtualenv. This hampers my overall workflow a bit, as I tend to have gVim up and running for the long-term and just add files in new tabs as I go. To get pylint to work properly, I'll need to restart Vim when I switch python versions (at a minimum). This shouldn't be too much of a problem, however, as I'm doing less and less python2x coding these days.

Coding Style Thoughts

As I beat my head against horrible C code on a daily basis at work, I find myself appreciating more-and-more the idea of PEP-8 and having good tools for coding style enforcement. While I frequently find some of the rules odd (two spaces here, but only one space there?) I really find it comforting to have a tool which runs, and runs quickly, to keep the code looking consistent. Now if I could only get that kind of tool for C…….

25 May 2017 1:22am GMT

Daniel Bader: In Love, War, and Open-Source: Never Give Up

In Love, War, and Open-Source: Never Give Up

I'll never forget launching my first open-source project and sharing it publicly on Reddit…

I had spent a couple of days at my parents' place over Christmas that year and decided to use some of my spare time to work on a Python library I christened schedule.

The idea behind schedule was very simple and had a narrow focus (I find that that that's always a good idea for libraries by the way):

Developers would use it like a timer to periodically call a function inside their Python programs.

The kicker was that schedule used a funky "natural sounding" syntax to specify the timer interval. For example, if you wanted to run a function every 10 minutes you'd do this:

schedule.every(10).minutes.do(myfunc)

Or, if you wanted to run a particular task every day at 10:30 in the morning, you'd do this:

schedule.every().day.at('10:30').do(mytask)

Because I was so frustrated with Cron's syntax I thought this approach was really cool. And so I decided this would be the first Python module I'd release as open-source.

I cleaned up the code and spent some time coming up with a nice README file-because that's really the first thing that your potential users will see when they check out your library.

Once I had my module available on PyPI and the source code on GitHub I decided to call some attention to the project. The same night I posted a link to the repository to Reddit and a couple of other sites.

I still remember that I had shaky hands when I clicked the "submit" button…

It's scary to put your work out there for the whole world to judge! Also, I didn't know what to expect.

Would people call me stupid for writing a "simple" library like that?

Would they think my code wasn't good enough?

Would they find all kinds of bugs and publicly shame me for them? I felt almost a physical sense of dread about pushing the "submit" button on Reddit that night!

The next morning I woke up and immediately checked my email. Were there any comments? Yes, about twenty or so!

I started reading through all of them, faster and faster-

And of course my still frightful mind immediately zoomed in on the negative ones, like

"Cool idea, but not particularly useful",

and

"The documentation is not enough",

or

"Not a big fan of the pseudo-english syntax. Way too clever and gimmicky."

At this point I was starting to feel a little discouraged… I'd never really shared my code publicly before and to be honest I my skin receiving criticism on it was paper thin. After all, this was just something I wrote in a couple of hours and gave away for free.

The comment that really made my stomach churn was one from a well known member of the Python community:

"And another library with global state :-( … Such an API should not even exist. It sets a bad example."

Ouch, that stung. I really looked up to that person and had used some of their libraries in other projects… It was almost like my worst fears we're confirmed and we're now playing out in front of me!

I'd never be able to get another job as a Python developer after this…

At the time I didn't see the positive and supportive comments in that discussion thread. I didn't see the almost 70 upvotes. I didn't see the valuable lessons hidden in the seemingly rude comments. I dwelled on the negative and felt terrible and depressed that whole day.

So how do you think this story ends?

Did I delete the schedule repo, switched careers and never looked at Reddit again?

Wrong!

schedule now has almost 3,000 stars on GitHub and is among the top 70 Python repositories (out of more than 215,000). When PyPI's download statistics we're still working I saw that it got several thousand downloads per month. I get emails every week from people asking questions about it or thanking me for writing it…

Isn't that crazy!? How's that possible after all of these disheartening comments?

My answer is "I don't know"-and I also don't think that schedule is a particularly great library that deserves all this attention, by the way.

But, it seems to solve a problem for some people. It also seems to have a polarizing effect on developers who see it-some love it, some hate it.

Today I'm glad I shipped schedule that night.

Glad because it was helpful to so many people over the years and glad because it helped me develop a thicker skin when it comes to sharing and launching things publicly.

I'm partly writing this meandering post because not very long ago I found this comment buried in my Reddit message history:

As someone who has posted a number of projects and blog posts in r/Python, just wanted to drop you a line and encourage that you don't let the comments in your thread get you down. You see all those upvotes?

Those are people that like your library, but don't really have a comment to make in the thread proper. My biggest issue with /r/Python is that it tends towards cynicism and sometimes cruelty rather than encouragement and constructive criticism.

Keep up the great work,

Rob

Wow! What a positive and encouraging comment!

Back when I felt discouraged by all of these negative comments I must've missed it. But reading it a few years later made me re-live that whole situation and it showed me how much I'd grown as a developer and as a person in the meantime.

If you find yourself in a similar situation, maybe feeling bogged down by the developer community who can be unfiltered and pretty rude sometimes, don't get discouraged.

Even if some people don't like what you did there can be thousands who love your work.

It's a big pond, and sometimes the best ideas are polarizing.

The only way to find out is to ship, ship, ship.

25 May 2017 12:00am GMT

Daniel Bader: In Love, War, and Open-Source: Never Give Up

In Love, War, and Open-Source: Never Give Up

I'll never forget launching my first open-source project and sharing it publicly on Reddit…

I had spent a couple of days at my parents' place over Christmas that year and decided to use some of my spare time to work on a Python library I christened schedule.

The idea behind schedule was very simple and had a narrow focus (I find that that that's always a good idea for libraries by the way):

Developers would use it like a timer to periodically call a function inside their Python programs.

The kicker was that schedule used a funky "natural sounding" syntax to specify the timer interval. For example, if you wanted to run a function every 10 minutes you'd do this:

schedule.every(10).minutes.do(myfunc)

Or, if you wanted to run a particular task every day at 10:30 in the morning, you'd do this:

schedule.every().day.at('10:30').do(mytask)

Because I was so frustrated with Cron's syntax I thought this approach was really cool. And so I decided this would be the first Python module I'd release as open-source.

I cleaned up the code and spent some time coming up with a nice README file-because that's really the first thing that your potential users will see when they check out your library.

Once I had my module available on PyPI and the source code on GitHub I decided to call some attention to the project. The same night I posted a link to the repository to Reddit and a couple of other sites.

I still remember that I had shaky hands when I clicked the "submit" button…

It's scary to put your work out there for the whole world to judge! Also, I didn't know what to expect.

Would people call me stupid for writing a "simple" library like that?

Would they think my code wasn't good enough?

Would they find all kinds of bugs and publicly shame me for them? I felt almost a physical sense of dread about pushing the "submit" button on Reddit that night!

The next morning I woke up and immediately checked my email. Were there any comments? Yes, about twenty or so!

I started reading through all of them, faster and faster-

And of course my still frightful mind immediately zoomed in on the negative ones, like

"Cool idea, but not particularly useful",

and

"The documentation is not enough",

or

"Not a big fan of the pseudo-english syntax. Way too clever and gimmicky."

At this point I was starting to feel a little discouraged… I'd never really shared my code publicly before and to be honest I my skin receiving criticism on it was paper thin. After all, this was just something I wrote in a couple of hours and gave away for free.

The comment that really made my stomach churn was one from a well known member of the Python community:

"And another library with global state :-( … Such an API should not even exist. It sets a bad example."

Ouch, that stung. I really looked up to that person and had used some of their libraries in other projects… It was almost like my worst fears we're confirmed and we're now playing out in front of me!

I'd never be able to get another job as a Python developer after this…

At the time I didn't see the positive and supportive comments in that discussion thread. I didn't see the almost 70 upvotes. I didn't see the valuable lessons hidden in the seemingly rude comments. I dwelled on the negative and felt terrible and depressed that whole day.

So how do you think this story ends?

Did I delete the schedule repo, switched careers and never looked at Reddit again?

Wrong!

schedule now has almost 3,000 stars on GitHub and is among the top 70 Python repositories (out of more than 215,000). When PyPI's download statistics we're still working I saw that it got several thousand downloads per month. I get emails every week from people asking questions about it or thanking me for writing it…

Isn't that crazy!? How's that possible after all of these disheartening comments?

My answer is "I don't know"-and I also don't think that schedule is a particularly great library that deserves all this attention, by the way.

But, it seems to solve a problem for some people. It also seems to have a polarizing effect on developers who see it-some love it, some hate it.

Today I'm glad I shipped schedule that night.

Glad because it was helpful to so many people over the years and glad because it helped me develop a thicker skin when it comes to sharing and launching things publicly.

I'm partly writing this meandering post because not very long ago I found this comment buried in my Reddit message history:

As someone who has posted a number of projects and blog posts in r/Python, just wanted to drop you a line and encourage that you don't let the comments in your thread get you down. You see all those upvotes?

Those are people that like your library, but don't really have a comment to make in the thread proper. My biggest issue with /r/Python is that it tends towards cynicism and sometimes cruelty rather than encouragement and constructive criticism.

Keep up the great work,

Rob

Wow! What a positive and encouraging comment!

Back when I felt discouraged by all of these negative comments I must've missed it. But reading it a few years later made me re-live that whole situation and it showed me how much I'd grown as a developer and as a person in the meantime.

If you find yourself in a similar situation, maybe feeling bogged down by the developer community who can be unfiltered and pretty rude sometimes, don't get discouraged.

Even if some people don't like what you did there can be thousands who love your work.

It's a big pond, and sometimes the best ideas are polarizing.

The only way to find out is to ship, ship, ship.

25 May 2017 12:00am GMT

24 May 2017

feedPlanet Python

Filipe Saraiva: LaKademy 2017

LaKademy 2017 group photo

Some weeks ago we had the fifth edition of the KDE Latin-America summit, LaKademy. Since the first edition, KDE community in Latin-America has grown up and now we has several developers, translators, artists, promoters, and more people from here involved in KDE activities.

This time LaKademy was held in Belo Horizonte, a nice city known for the amazing cachaça, cheese, home made beers, cheese, hills, and of course, cheese. The city is very cosmopolitan, with several options of activities and gastronomy, while the people is gentle. I would like to back to Belo Horizonte, maybe in my next vacation.

LaKademy activites were held in CEFET, an educational technological institute. During the days of LaKademy there were political demonstrations and a general strike in the country, consequence of the current political crisis here in Brazil. Despite I support the demonstrations, I was in Belo Horizonte for event. So I focused in the tasks while in my mind I was side-by-side with the workers on the streets.

Like in past editions I worked a lot with Cantor, the mathematical software I am the maintainer. This time the main tasks performed were an extensive set of reviews: revisions in pending patches, in the bug management system in order to close very old (and invalid) reports, and in the task management workboard, specially to ping developers with old tasks without any comment in the last year.

There were some work to implement new features as well. I finished a backends refactoring in order to provide a recommended version of the programming language for each backend in Cantor. How each programming language has its own planning and scheduling, it is common some programming language version not be correctly supported in a Cantor backend (Sage, I am thinking you). This feature presents a "recommended" version of the programming language supported for the Cantor backend, meaning that version was tested and it will work correctly with Cantor. It is more like a workaround in order to maintain the sanity of the developer while he try to support 11 different programming languages.

Other feature I worked but it is not finished is a option to select different LaTeX processors in Cantor. Currently there are several LaTeX processors available (like pdflatex, pdftex, luatex, xetex, …), some of them with several additional features. This option will increased the versatility of Cantor and will allow the use of moderns processors and their features in the software.

I addition to these tasks I fixed some bugs and helped Fernando Telles, my past SoK student, with some tasks in Cantor.

(Like in past editions)², in LaKademy 2017 I also worked in other set of tasks related to the management and promotion of KDE Brazil. I investigated how to bring back our unified feed with Brazilian blogs posts as in the old Planet KDE Português, utilized to send updates about KDE in Brazil to our social networks. Fred implemented the solution. So I updated this feed in social networks, updated our e-mail contact utilized in this networks, and started a bootstrap version of LaKademy website (but the team is migrating to WordPress, I think it will not be used). I also did a large revision in the tasks of KDE Brazil workboard, migrated past year from the TODO website. Besides all this we had the promo meeting to discuss our actions in Latin-America - all the tasks were documented in the workboard.

Of course, just as we worked intensely in those days, we also had a lot of fun between a push and other. LaKademy is also a opportunity to find old friends and make new ones. It is amazing see again the KDE fellows, and I invite the newcomers to stay with us and go to next LaKademy editions!

This year we had a problem that we must to address in next edition - all the participants were Brazilians. We need to think about how to integrate people from other Latin-America countries in LaKademy. It would be bad if the event become only an Akademy-BR.

Filipe and Chicão

So, I give my greetings to the community and put myself in the mission to continue to work in order to grown the Latin-America as an important player to the development and future of KDE.

24 May 2017 8:37pm GMT

Filipe Saraiva: LaKademy 2017

LaKademy 2017 group photo

Some weeks ago we had the fifth edition of the KDE Latin-America summit, LaKademy. Since the first edition, KDE community in Latin-America has grown up and now we has several developers, translators, artists, promoters, and more people from here involved in KDE activities.

This time LaKademy was held in Belo Horizonte, a nice city known for the amazing cachaça, cheese, home made beers, cheese, hills, and of course, cheese. The city is very cosmopolitan, with several options of activities and gastronomy, while the people is gentle. I would like to back to Belo Horizonte, maybe in my next vacation.

LaKademy activites were held in CEFET, an educational technological institute. During the days of LaKademy there were political demonstrations and a general strike in the country, consequence of the current political crisis here in Brazil. Despite I support the demonstrations, I was in Belo Horizonte for event. So I focused in the tasks while in my mind I was side-by-side with the workers on the streets.

Like in past editions I worked a lot with Cantor, the mathematical software I am the maintainer. This time the main tasks performed were an extensive set of reviews: revisions in pending patches, in the bug management system in order to close very old (and invalid) reports, and in the task management workboard, specially to ping developers with old tasks without any comment in the last year.

There were some work to implement new features as well. I finished a backends refactoring in order to provide a recommended version of the programming language for each backend in Cantor. How each programming language has its own planning and scheduling, it is common some programming language version not be correctly supported in a Cantor backend (Sage, I am thinking you). This feature presents a "recommended" version of the programming language supported for the Cantor backend, meaning that version was tested and it will work correctly with Cantor. It is more like a workaround in order to maintain the sanity of the developer while he try to support 11 different programming languages.

Other feature I worked but it is not finished is a option to select different LaTeX processors in Cantor. Currently there are several LaTeX processors available (like pdflatex, pdftex, luatex, xetex, …), some of them with several additional features. This option will increased the versatility of Cantor and will allow the use of moderns processors and their features in the software.

I addition to these tasks I fixed some bugs and helped Fernando Telles, my past SoK student, with some tasks in Cantor.

(Like in past editions)², in LaKademy 2017 I also worked in other set of tasks related to the management and promotion of KDE Brazil. I investigated how to bring back our unified feed with Brazilian blogs posts as in the old Planet KDE Português, utilized to send updates about KDE in Brazil to our social networks. Fred implemented the solution. So I updated this feed in social networks, updated our e-mail contact utilized in this networks, and started a bootstrap version of LaKademy website (but the team is migrating to WordPress, I think it will not be used). I also did a large revision in the tasks of KDE Brazil workboard, migrated past year from the TODO website. Besides all this we had the promo meeting to discuss our actions in Latin-America - all the tasks were documented in the workboard.

Of course, just as we worked intensely in those days, we also had a lot of fun between a push and other. LaKademy is also a opportunity to find old friends and make new ones. It is amazing see again the KDE fellows, and I invite the newcomers to stay with us and go to next LaKademy editions!

This year we had a problem that we must to address in next edition - all the participants were Brazilians. We need to think about how to integrate people from other Latin-America countries in LaKademy. It would be bad if the event become only an Akademy-BR.

Filipe and Chicão

So, I give my greetings to the community and put myself in the mission to continue to work in order to grown the Latin-America as an important player to the development and future of KDE.

24 May 2017 8:37pm GMT

EuroPython: EuroPython 2017: Social event tickets available

After trainings and talks, EuroPython is going (Coco)nuts! Join us for the EuroPython social event in Rimini, which will be held in the Coconuts Club on Thursday, July 13th.

Tickets for the social event are not included in the conference ticket. They are now available in our ticket store (listed under 'Goodies') for the price of 25 €. The social event ticket includes an aperitivo buffet of Italian specialties, a choice of two drinks and a reserved area in the club from 19:00 to 22:00. The club will open to the general public after that.


imageimage

Leave the conference tickets fields blank if you only want to purchase social event tickets.

Take this opportunity to network and socialize with other Python attendees and buy your social event ticket now on the registration page.

image

Enjoy,
-
EuroPython 2017 Team
EuroPython Society
EuroPython 2017 Conference

24 May 2017 2:43pm GMT

EuroPython: EuroPython 2017: Social event tickets available

After trainings and talks, EuroPython is going (Coco)nuts! Join us for the EuroPython social event in Rimini, which will be held in the Coconuts Club on Thursday, July 13th.

Tickets for the social event are not included in the conference ticket. They are now available in our ticket store (listed under 'Goodies') for the price of 25 €. The social event ticket includes an aperitivo buffet of Italian specialties, a choice of two drinks and a reserved area in the club from 19:00 to 22:00. The club will open to the general public after that.


imageimage

Leave the conference tickets fields blank if you only want to purchase social event tickets.

Take this opportunity to network and socialize with other Python attendees and buy your social event ticket now on the registration page.

image

Enjoy,
-
EuroPython 2017 Team
EuroPython Society
EuroPython 2017 Conference

24 May 2017 2:43pm GMT

Enthought: Enthought Receives 2017 Product of the Year Award From National Instruments LabVIEW Tools Network

Python Integration Toolkit for LabVIEW recognized for extending LabVIEW connectivity and bringing the power of Python to applications in Test, Measurement and the Industrial Internet of Things (IIoT)

AUSTIN, TX - May 24, 2017 - Enthought, a global leader in scientific and analytic computing solutions, was honored this week by National Instruments with the LabVIEW Tools Network Platform Connectivity 2017 Product of the Year Award for its Python Integration Toolkit for LabVIEW.

Python Integration Toolkit for LabVIEWFirst released at NIWeek 2016, the Python Integration Toolkit enables fast, two-way communication between LabVIEW and Python. With seamless access to the Python ecosystem of tools, LabVIEW users are able to do more with their data than ever before. For example, using the Toolkit, a user can acquire data from test and measurement tools with LabVIEW, perform signal processing or apply machine learning algorithms in Python, display it in LabVIEW, then share results using a Python-enabled web dashboard.

Enthought-Python-Integration-Toolkit-for-LabVIEW-Machine-Learning

Click to see the webinar "Using Python and LabVIEW to Rapidly Solve Engineering Problems" to learn more about adding capabilities such as machine learning by extending LabVIEW applications with Python.

"Python is ideally suited for scientists and engineers due to its simple, yet powerful syntax and the availability of an extensive array of open source tools contributed by a user community from industry and R&D," said Dr. Tim Diller, Director, IIoT Solutions Group at Enthought. "The Python Integration Toolkit for LabVIEW unites the best elements of two major tools in the science and engineering world and we are honored to receive this award."

Key benefits of the Python Integration Toolkit for LabVIEW from Enthought:

"Add-on software from our third-party developers is an integral part of the NI ecosystem, and we're excited to recognize Enthought for its achievement with the Python Integration Toolkit for LabVIEW," said Matthew Friedman, senior group manager of the LabVIEW Tools Network at NI.

The Python Integration Toolkit is available for download via the LabVIEW Tools Network, and also includes the Enthought Canopy analysis environment and Python distribution. Enthought's training, support and consulting resources are also available to help LabVIEW users maximize their value in leveraging Python.

For more information on Enthought's Python Integration Toolkit for LabVIEW, visit www.enthought.com/python-for-LabVIEW.

Additional Resources

Product Information

Python Integration Toolkit for LabVIEW product page

Download a free trial of the Python Integration Toolkit for LabVIEW

Webinars

Webinar: Using Python and LabVIEW to Rapidly Solve Engineering Problems | Enthought
April 2017

Webinar: Introducing the New Python Integration Toolkit for LabVIEW from Enthought
September 2016

About Enthought

Enthought is a global leader in scientific and analytic software, consulting, and training solutions serving a customer base comprised of some of the most respected names in the oil and gas, manufacturing, financial services, aerospace, military, government, biotechnology, consumer products and technology industries. The company was founded in 2001 and is headquartered in Austin, Texas, with additional offices in Cambridge, United Kingdom and Pune, India. For more information visit www.enthought.com and connect with Enthought on Twitter, LinkedIn, Google+, Facebook and YouTube.

About NI

Since 1976, NI (www.ni.com) has made it possible for engineers and scientists to solve the world's greatest engineering challenges with powerful platform-based systems that accelerate productivity and drive rapid innovation. Customers from a wide variety of industries - from healthcare to automotive and from consumer electronics to particle physics - use NI's integrated hardware and software platform to improve the world we live in.

About the LabVIEW Tools Network

The LabVIEW Tools Network is the NI app store equipping engineers and scientists with certified, third-party add-ons and apps to complete their systems. Developed by industry experts, these cutting-edge technologies expand the power of NI software and modular hardware. Each third-party product is reviewed to meet specific guidelines and ensure compatibility. With hundreds of products available, the LabVIEW Tools Network is part of a rich ecosystem extending the NI Platform to help customers positively impact our world. Learn more about the LabVIEW Tools Network at www.ni.com/labview-tools-network.

LabVIEW, National Instruments, NI and ni.com and NIWeek are trademarks of National Instruments. Enthought, Canopy and Python Integration Toolkit for LabVIEW are trademarks of Enthought, Inc.

Media Contact

Courtenay Godshall, VP, Marketing, +1.512.536.1057, cgodshall@enthought.com

The post Enthought Receives 2017 Product of the Year Award From National Instruments LabVIEW Tools Network appeared first on Enthought Blog.

24 May 2017 1:42pm GMT

Enthought: Enthought Receives 2017 Product of the Year Award From National Instruments LabVIEW Tools Network

Python Integration Toolkit for LabVIEW recognized for extending LabVIEW connectivity and bringing the power of Python to applications in Test, Measurement and the Industrial Internet of Things (IIoT)

AUSTIN, TX - May 24, 2017 - Enthought, a global leader in scientific and analytic computing solutions, was honored this week by National Instruments with the LabVIEW Tools Network Platform Connectivity 2017 Product of the Year Award for its Python Integration Toolkit for LabVIEW.

Python Integration Toolkit for LabVIEWFirst released at NIWeek 2016, the Python Integration Toolkit enables fast, two-way communication between LabVIEW and Python. With seamless access to the Python ecosystem of tools, LabVIEW users are able to do more with their data than ever before. For example, using the Toolkit, a user can acquire data from test and measurement tools with LabVIEW, perform signal processing or apply machine learning algorithms in Python, display it in LabVIEW, then share results using a Python-enabled web dashboard.

Enthought-Python-Integration-Toolkit-for-LabVIEW-Machine-Learning

Click to see the webinar "Using Python and LabVIEW to Rapidly Solve Engineering Problems" to learn more about adding capabilities such as machine learning by extending LabVIEW applications with Python.

"Python is ideally suited for scientists and engineers due to its simple, yet powerful syntax and the availability of an extensive array of open source tools contributed by a user community from industry and R&D," said Dr. Tim Diller, Director, IIoT Solutions Group at Enthought. "The Python Integration Toolkit for LabVIEW unites the best elements of two major tools in the science and engineering world and we are honored to receive this award."

Key benefits of the Python Integration Toolkit for LabVIEW from Enthought:

"Add-on software from our third-party developers is an integral part of the NI ecosystem, and we're excited to recognize Enthought for its achievement with the Python Integration Toolkit for LabVIEW," said Matthew Friedman, senior group manager of the LabVIEW Tools Network at NI.

The Python Integration Toolkit is available for download via the LabVIEW Tools Network, and also includes the Enthought Canopy analysis environment and Python distribution. Enthought's training, support and consulting resources are also available to help LabVIEW users maximize their value in leveraging Python.

For more information on Enthought's Python Integration Toolkit for LabVIEW, visit www.enthought.com/python-for-LabVIEW.

Additional Resources

Product Information

Python Integration Toolkit for LabVIEW product page

Download a free trial of the Python Integration Toolkit for LabVIEW

Webinars

Webinar: Using Python and LabVIEW to Rapidly Solve Engineering Problems | Enthought
April 2017

Webinar: Introducing the New Python Integration Toolkit for LabVIEW from Enthought
September 2016

About Enthought

Enthought is a global leader in scientific and analytic software, consulting, and training solutions serving a customer base comprised of some of the most respected names in the oil and gas, manufacturing, financial services, aerospace, military, government, biotechnology, consumer products and technology industries. The company was founded in 2001 and is headquartered in Austin, Texas, with additional offices in Cambridge, United Kingdom and Pune, India. For more information visit www.enthought.com and connect with Enthought on Twitter, LinkedIn, Google+, Facebook and YouTube.

About NI

Since 1976, NI (www.ni.com) has made it possible for engineers and scientists to solve the world's greatest engineering challenges with powerful platform-based systems that accelerate productivity and drive rapid innovation. Customers from a wide variety of industries - from healthcare to automotive and from consumer electronics to particle physics - use NI's integrated hardware and software platform to improve the world we live in.

About the LabVIEW Tools Network

The LabVIEW Tools Network is the NI app store equipping engineers and scientists with certified, third-party add-ons and apps to complete their systems. Developed by industry experts, these cutting-edge technologies expand the power of NI software and modular hardware. Each third-party product is reviewed to meet specific guidelines and ensure compatibility. With hundreds of products available, the LabVIEW Tools Network is part of a rich ecosystem extending the NI Platform to help customers positively impact our world. Learn more about the LabVIEW Tools Network at www.ni.com/labview-tools-network.

LabVIEW, National Instruments, NI and ni.com and NIWeek are trademarks of National Instruments. Enthought, Canopy and Python Integration Toolkit for LabVIEW are trademarks of Enthought, Inc.

Media Contact

Courtenay Godshall, VP, Marketing, +1.512.536.1057, cgodshall@enthought.com

The post Enthought Receives 2017 Product of the Year Award From National Instruments LabVIEW Tools Network appeared first on Enthought Blog.

24 May 2017 1:42pm GMT

Caktus Consulting Group: PyCon 2017 Recap

Caktus attended PyCon 2017 in Portland from May 18-21. It was the first PyCon for some, while others were PyCon veterans. All of us were looking forward to the opportunity to hear some great talks and make or renew connections in the Python community.

Getting Set Up

Right after arriving from the East Coast on Thursday it was time to set up for Day 1 of the expo. We eagerly prepared for the meet and greet opening night.

Some of the Caktus team at PyCon 2017

Our Ultimate Tic Tac Toe game made a comeback this year with a new AI feature. We only had 2 winners, although one of them beat the AI four times! (Our developers think it's time to turn the difficulty up to 11.)

Visitors to the Caktus booth playing Ultimate Tic Tac Toe

Meetings and Giveaways

As expected, booth time was busy. It was exciting to welcome so many members of the Python community. We enjoyed chatting about what we do at Caktus and our work building web apps with Django, as well as making connections or meeting with people we haven't seen in awhile. Mark was excited to catch up with Tom Christie of Django REST Framework.

Technical Director Mark Lavin with Tom Christie of Django REST Framework.

Best part of PyCon is being a shameless fanboy for those whose work makes my job easier ❤ https://t.co/s3sZQE8g9S

- Mark Lavin (@DrOhYes) May 20, 2017

In addition to Caktus swag, we had two prize giveaways on offer this year. The first one was a social contest on Twitter. Christine was our winner by random selection - congratulations!

Winner of the Caktus Twitter contest at PyCon 2017

The second giveaway was a random drawing of people who signed up for our newsletter. Congratulations to Mike for winning that drawing.

Winner of the prize draw at the Caktus booth

Lots to Talk About

Six Caktus developers attended a variety of talks and came out of each of them feeling inspired by fresh ideas.

Interesting idea from @_tomchristie: API mocking. Front End devs can get started immediately & this promotes API design first. #PyCon2017

- Erin Mullaney (@_erin_rachel) May 20, 2017

I'm feeling inspired to contribute to some #OpenScience projects after outstanding keynotes by @jakevdp and @katyhuff at #PyCon2017

- Jeff Bradberry (@jeff_bradberry) May 20, 2017

.@jsaryer demonstrating how mutation testing can prove that your "covered" code is actually being tested #pycon2017

- Charlotte Mays (@charlottecodes) May 19, 2017

We can't wait to see how they apply what they've learned to their work at Caktus.

After-hours Event

This year, Caktus hosted an exclusive, invite-only event at Fuse Bar. We were excited to welcome clients and special guests for sushi, nibbles, and refreshments.

Sushi ordered for the Caktus after-hours event.

Some of our clients are based across the country from us, so it was nice to have the opportunity to catch up in person and mingle.

Job Fair

We spoke to lots of interested developers at the PyCon job fair on May 21st. Some of the most common questions we received - and their answers - are below.

Question 1: Where is Caktus based?

Our office is in a lovely brick building in downtown Durham, North Carolina.

Question 2: What does Caktus do / What projects have you worked on?

Caktus is a consultancy and development agency. Work primarily focuses on building custom web and SMS apps in Python, using the Django framework. Some of our projects include building the world's first SMS-based voter registration system, a live event management app, and responsive, database-driven websites for clients in industries like food and beverage, travel and entertainment.

We also do team augmentation and offer discovery workshops to help our clients strategically plan out the user experience and technical development aspects of their projects. To find out more about our specialties at Caktus, visit our Services page.

Question 3: Do you have opportunities for remote work?

We hire remotely for some contract work, but full-time positions must be based out of our Durham office.

Question 4: Where can I find your current openings / How can I apply?

If you're interested in joining us at Caktus, check out our Careers page. We'll need a resume and cover letter, and encourage you to send a link to your GitHub, portfolio, or website as well.

Caktus is growing fast, and we're pleased to offer great benefits and a fair, equal-opportunity working environment. Why not grow with us?

Until next year!

As always, we had a great time meeting and mingling with our fellow Pythonistas. Thanks to the organizers for putting on another fantastic event, our fellow sponsors for supporting it, the volunteers who kept things moving, and of course, all the attendees for your energy and enthusiasm. See you next year!

24 May 2017 1:30pm GMT

Caktus Consulting Group: PyCon 2017 Recap

Caktus attended PyCon 2017 in Portland from May 18-21. It was the first PyCon for some, while others were PyCon veterans. All of us were looking forward to the opportunity to hear some great talks and make or renew connections in the Python community.

Getting Set Up

Right after arriving from the East Coast on Thursday it was time to set up for Day 1 of the expo. We eagerly prepared for the meet and greet opening night.

Some of the Caktus team at PyCon 2017

Our Ultimate Tic Tac Toe game made a comeback this year with a new AI feature. We only had 2 winners, although one of them beat the AI four times! (Our developers think it's time to turn the difficulty up to 11.)

Visitors to the Caktus booth playing Ultimate Tic Tac Toe

Meetings and Giveaways

As expected, booth time was busy. It was exciting to welcome so many members of the Python community. We enjoyed chatting about what we do at Caktus and our work building web apps with Django, as well as making connections or meeting with people we haven't seen in awhile. Mark was excited to catch up with Tom Christie of Django REST Framework.

Technical Director Mark Lavin with Tom Christie of Django REST Framework.

Best part of PyCon is being a shameless fanboy for those whose work makes my job easier ❤ https://t.co/s3sZQE8g9S

- Mark Lavin (@DrOhYes) May 20, 2017

In addition to Caktus swag, we had two prize giveaways on offer this year. The first one was a social contest on Twitter. Christine was our winner by random selection - congratulations!

Winner of the Caktus Twitter contest at PyCon 2017

The second giveaway was a random drawing of people who signed up for our newsletter. Congratulations to Mike for winning that drawing.

Winner of the prize draw at the Caktus booth

Lots to Talk About

Six Caktus developers attended a variety of talks and came out of each of them feeling inspired by fresh ideas.

Interesting idea from @_tomchristie: API mocking. Front End devs can get started immediately & this promotes API design first. #PyCon2017

- Erin Mullaney (@_erin_rachel) May 20, 2017

I'm feeling inspired to contribute to some #OpenScience projects after outstanding keynotes by @jakevdp and @katyhuff at #PyCon2017

- Jeff Bradberry (@jeff_bradberry) May 20, 2017

.@jsaryer demonstrating how mutation testing can prove that your "covered" code is actually being tested #pycon2017

- Charlotte Mays (@charlottecodes) May 19, 2017

We can't wait to see how they apply what they've learned to their work at Caktus.

After-hours Event

This year, Caktus hosted an exclusive, invite-only event at Fuse Bar. We were excited to welcome clients and special guests for sushi, nibbles, and refreshments.

Sushi ordered for the Caktus after-hours event.

Some of our clients are based across the country from us, so it was nice to have the opportunity to catch up in person and mingle.

Job Fair

We spoke to lots of interested developers at the PyCon job fair on May 21st. Some of the most common questions we received - and their answers - are below.

Question 1: Where is Caktus based?

Our office is in a lovely brick building in downtown Durham, North Carolina.

Question 2: What does Caktus do / What projects have you worked on?

Caktus is a consultancy and development agency. Work primarily focuses on building custom web and SMS apps in Python, using the Django framework. Some of our projects include building the world's first SMS-based voter registration system, a live event management app, and responsive, database-driven websites for clients in industries like food and beverage, travel and entertainment.

We also do team augmentation and offer discovery workshops to help our clients strategically plan out the user experience and technical development aspects of their projects. To find out more about our specialties at Caktus, visit our Services page.

Question 3: Do you have opportunities for remote work?

We hire remotely for some contract work, but full-time positions must be based out of our Durham office.

Question 4: Where can I find your current openings / How can I apply?

If you're interested in joining us at Caktus, check out our Careers page. We'll need a resume and cover letter, and encourage you to send a link to your GitHub, portfolio, or website as well.

Caktus is growing fast, and we're pleased to offer great benefits and a fair, equal-opportunity working environment. Why not grow with us?

Until next year!

As always, we had a great time meeting and mingling with our fellow Pythonistas. Thanks to the organizers for putting on another fantastic event, our fellow sponsors for supporting it, the volunteers who kept things moving, and of course, all the attendees for your energy and enthusiasm. See you next year!

24 May 2017 1:30pm GMT

PyBites: PyCon 2017 - Digest, Impressions, Reflection

PyCon 2017 was such a great conference, I made so many good connections, got to see many good things the community is working on. It was very inspiring. In this article a digest.

24 May 2017 10:00am GMT

PyBites: PyCon 2017 - Digest, Impressions, Reflection

PyCon 2017 was such a great conference, I made so many good connections, got to see many good things the community is working on. It was very inspiring. In this article a digest.

24 May 2017 10:00am GMT

23 May 2017

feedPlanet Python

NumFOCUS: Welcome Nancy Nguyen, the new NumFOCUS Events Coordinator!

NumFOCUS is pleased to announce Nancy Nguyen has been hired as our new Events Coordinator. Nancy has over five years of event management experience in the non-profit and higher education sectors. She graduated from The University of Texas at Austin in 2011 with a BA in History. Prior to joining NumFOCUS, Nancy worked in development and fundraising […]

23 May 2017 4:48pm GMT

NumFOCUS: Welcome Nancy Nguyen, the new NumFOCUS Events Coordinator!

NumFOCUS is pleased to announce Nancy Nguyen has been hired as our new Events Coordinator. Nancy has over five years of event management experience in the non-profit and higher education sectors. She graduated from The University of Texas at Austin in 2011 with a BA in History. Prior to joining NumFOCUS, Nancy worked in development and fundraising […]

23 May 2017 4:48pm GMT

PyCharm: PyCharm 2017.1.3 Out Now!

We're happy to announce that PyCharm 2017.1.3 is now available. You can get it now from our website, or using the updater in PyCharm.

Improvements since PyCharm 2017.1.2:

We'd like to thank the users who tried the EAP versions of this release for helping us make sure that this version of PyCharm is of the quality you expect from a JetBrains IDE.

If you'd like to see new PyCharm features before we release them, try out the EAP version of our next release.

PyCharm Team
-The Drive to Develop

23 May 2017 4:44pm GMT

PyCharm: PyCharm 2017.1.3 Out Now!

We're happy to announce that PyCharm 2017.1.3 is now available. You can get it now from our website, or using the updater in PyCharm.

Improvements since PyCharm 2017.1.2:

We'd like to thank the users who tried the EAP versions of this release for helping us make sure that this version of PyCharm is of the quality you expect from a JetBrains IDE.

If you'd like to see new PyCharm features before we release them, try out the EAP version of our next release.

PyCharm Team
-The Drive to Develop

23 May 2017 4:44pm GMT

codeboje: This Problem with PySide, Py2App and Brew drove me Nuts

I build several desktop applications using PySide. It works like a charm on Windows. However, I found a nasty bug in the Mac version which I could not reproduce on my local machine. This one drove me nuts. It was hard to analyze, I own just one Mac and do not have access to another machine. Luckily, with the help of some very long googling (guessing symptoms) and the help of a user of one of my applications, I could fix the issue. As a reminder for myself and help for you, I document it.

Problem

I build the application using PySide, Py2App and Python 3 on a Mac using a virtualenv. I used Brew for installing PySide and Python, and PySide was also installed inside my virutaenv.

The application builds and runs fine on my machine.

However, on a different Mac, the application crashed without any useful traces in the system logs.

My application also writes a separate log file, but this was empty. So it seemed like the application crashed before even reaching my code.

After some google and adjusting my log outputs, however, I found out that it started to execute my code and then crashed when initializing PySide.

First, I thought it was just a problem on this single users machine, but I got a similar bug report which gave me some hints it might be a general problem.

Now, better equipped I found the culprit after some additional googling.

The application could not load the QT binaries.

The problem is a combination of installing PySide and with Brew and using PySide inside a virtualenv. While building the application Py2App can't pick up the correct library path, and the generated application includes the libraries but with an incorrect path in the Mac specific descriptors.

otool -L <my-app>/Contents/Resources/lib/python3.4/lib-dynload/PySide/QtGui.so

It should list the file with @executable_path and not with an absolute path only valid for your machine.

In my case, the binaries were referenced by absolute paths which were of course not valid on someone else machine.

Solution

I do not know who exactly is causing this issue, but the following workaround did help me.

And then continue building the application as before. This time the lib references were fine in the application.

Guess what?

It worked now. Yippie.

23 May 2017 3:33pm GMT

codeboje: This Problem with PySide, Py2App and Brew drove me Nuts

I build several desktop applications using PySide. It works like a charm on Windows. However, I found a nasty bug in the Mac version which I could not reproduce on my local machine. This one drove me nuts. It was hard to analyze, I own just one Mac and do not have access to another machine. Luckily, with the help of some very long googling (guessing symptoms) and the help of a user of one of my applications, I could fix the issue. As a reminder for myself and help for you, I document it.

Problem

I build the application using PySide, Py2App and Python 3 on a Mac using a virtualenv. I used Brew for installing PySide and Python, and PySide was also installed inside my virutaenv.

The application builds and runs fine on my machine.

However, on a different Mac, the application crashed without any useful traces in the system logs.

My application also writes a separate log file, but this was empty. So it seemed like the application crashed before even reaching my code.

After some google and adjusting my log outputs, however, I found out that it started to execute my code and then crashed when initializing PySide.

First, I thought it was just a problem on this single users machine, but I got a similar bug report which gave me some hints it might be a general problem.

Now, better equipped I found the culprit after some additional googling.

The application could not load the QT binaries.

The problem is a combination of installing PySide and with Brew and using PySide inside a virtualenv. While building the application Py2App can't pick up the correct library path, and the generated application includes the libraries but with an incorrect path in the Mac specific descriptors.

otool -L <my-app>/Contents/Resources/lib/python3.4/lib-dynload/PySide/QtGui.so

It should list the file with @executable_path and not with an absolute path only valid for your machine.

In my case, the binaries were referenced by absolute paths which were of course not valid on someone else machine.

Solution

I do not know who exactly is causing this issue, but the following workaround did help me.

And then continue building the application as before. This time the lib references were fine in the application.

Guess what?

It worked now. Yippie.

23 May 2017 3:33pm GMT

10 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: King Willams Town Bahnhof

Gestern musste ich morgens zur Station nach KWT um unsere Rerservierten Bustickets für die Weihnachtsferien in Capetown abzuholen. Der Bahnhof selber ist seit Dezember aus kostengründen ohne Zugverbindung - aber Translux und co - die langdistanzbusse haben dort ihre Büros.


Größere Kartenansicht




© benste CC NC SA

10 Nov 2011 10:57am GMT

09 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein

Niemand ist besorgt um so was - mit dem Auto fährt man einfach durch, und in der City - nahe Gnobie- "ne das ist erst gefährlich wenn die Feuerwehr da ist" - 30min später auf dem Rückweg war die Feuerwehr da.




© benste CC NC SA

09 Nov 2011 8:25pm GMT

08 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Brai Party

Brai = Grillabend o.ä.

Die möchte gern Techniker beim Flicken ihrer SpeakOn / Klinke Stecker Verzweigungen...

Die Damen "Mamas" der Siedlung bei der offiziellen Eröffnungsrede

Auch wenn weniger Leute da waren als erwartet, Laute Musik und viele Leute ...

Und natürlich ein Feuer mit echtem Holz zum Grillen.

© benste CC NC SA

08 Nov 2011 2:30pm GMT

07 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Lumanyano Primary

One of our missions was bringing Katja's Linux Server back to her room. While doing that we saw her new decoration.

Björn, Simphiwe carried the PC to Katja's school


© benste CC NC SA

07 Nov 2011 2:00pm GMT

06 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Nelisa Haircut

Today I went with Björn to Needs Camp to Visit Katja's guest family for a special Party. First of all we visited some friends of Nelisa - yeah the one I'm working with in Quigney - Katja's guest fathers sister - who did her a haircut.

African Women usually get their hair done by arranging extensions and not like Europeans just cutting some hair.

In between she looked like this...

And then she was done - looks amazing considering the amount of hair she had last week - doesn't it ?

© benste CC NC SA

06 Nov 2011 7:45pm GMT

05 Nov 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Mein Samstag

Irgendwie viel mir heute auf das ich meine Blogposts mal ein bischen umstrukturieren muss - wenn ich immer nur von neuen Plätzen berichte, dann müsste ich ja eine Rundreise machen. Hier also mal ein paar Sachen aus meinem heutigen Alltag.

Erst einmal vorweg, Samstag zählt zumindest für uns Voluntäre zu den freien Tagen.

Dieses Wochenende sind nur Rommel und ich auf der Farm - Katja und Björn sind ja mittlerweile in ihren Einsatzstellen, und meine Mitbewohner Kyle und Jonathan sind zu Hause in Grahamstown - sowie auch Sipho der in Dimbaza wohnt.
Robin, die Frau von Rommel ist in Woodie Cape - schon seit Donnerstag um da ein paar Sachen zur erledigen.
Naja wie dem auch sei heute morgen haben wir uns erstmal ein gemeinsames Weetbix/Müsli Frühstück gegönnt und haben uns dann auf den Weg nach East London gemacht. 2 Sachen waren auf der Checkliste Vodacom, Ethienne (Imobilienmakler) außerdem auf dem Rückweg die fehlenden Dinge nach NeedsCamp bringen.

Nachdem wir gerade auf der Dirtroad losgefahren sind mussten wir feststellen das wir die Sachen für Needscamp und Ethienne nicht eingepackt hatten aber die Pumpe für die Wasserversorgung im Auto hatten.

Also sind wir in EastLondon ersteinmal nach Farmerama - nein nicht das onlinespiel farmville - sondern einen Laden mit ganz vielen Sachen für eine Farm - in Berea einem nördlichen Stadteil gefahren.

In Farmerama haben wir uns dann beraten lassen für einen Schnellverschluss der uns das leben mit der Pumpe leichter machen soll und außerdem eine leichtere Pumpe zur Reperatur gebracht, damit es nicht immer so ein großer Aufwand ist, wenn mal wieder das Wasser ausgegangen ist.

Fego Caffé ist in der Hemmingways Mall, dort mussten wir und PIN und PUK einer unserer Datensimcards geben lassen, da bei der PIN Abfrage leider ein zahlendreher unterlaufen ist. Naja auf jeden Fall speichern die Shops in Südafrika so sensible Daten wie eine PUK - die im Prinzip zugang zu einem gesperrten Phone verschafft.

Im Cafe hat Rommel dann ein paar online Transaktionen mit dem 3G Modem durchgeführt, welches ja jetzt wieder funktionierte - und übrigens mittlerweile in Ubuntu meinem Linuxsystem perfekt klappt.

Nebenbei bin ich nach 8ta gegangen um dort etwas über deren neue Deals zu erfahren, da wir in einigen von Hilltops Centern Internet anbieten wollen. Das Bild zeigt die Abdeckung UMTS in NeedsCamp Katjas Ort. 8ta ist ein neuer Telefonanbieter von Telkom, nachdem Vodafone sich Telkoms anteile an Vodacom gekauft hat müssen die komplett neu aufbauen.
Wir haben uns dazu entschieden mal eine kostenlose Prepaidkarte zu testen zu organisieren, denn wer weis wie genau die Karte oben ist ... Bevor man einen noch so billigen Deal für 24 Monate signed sollte man wissen obs geht.

Danach gings nach Checkers in Vincent, gesucht wurden zwei Hotplates für WoodyCape - R 129.00 eine - also ca. 12€ für eine zweigeteilte Kochplatte.
Wie man sieht im Hintergrund gibts schon Weihnachtsdeko - Anfang November und das in Südafrika bei sonnig warmen min- 25°C

Mittagessen haben wir uns bei einem Pakistanischen Curry Imbiss gegönnt - sehr empfehlenswert !
Naja und nachdem wir dann vor ner Stunde oder so zurück gekommen sind habe ich noch den Kühlschrank geputzt den ich heute morgen zum defrosten einfach nach draußen gestellt hatte. Jetzt ist der auch mal wieder sauber und ohne 3m dicke Eisschicht...

Morgen ... ja darüber werde ich gesondert berichten ... aber vermutlich erst am Montag, denn dann bin ich nochmal wieder in Quigney(East London) und habe kostenloses Internet.

© benste CC NC SA

05 Nov 2011 4:33pm GMT

31 Oct 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Sterkspruit Computer Center

Sterkspruit is one of Hilltops Computer Centres in the far north of Eastern Cape. On the trip to J'burg we've used the opportunity to take a look at the centre.

Pupils in the big classroom


The Trainer


School in Countryside


Adult Class in the Afternoon


"Town"


© benste CC NC SA

31 Oct 2011 4:58pm GMT

Benedict Stein: Technical Issues

What are you doing in an internet cafe if your ADSL and Faxline has been discontinued before months end. Well my idea was sitting outside and eating some ice cream.
At least it's sunny and not as rainy as on the weekend.


© benste CC NC SA

31 Oct 2011 3:11pm GMT

30 Oct 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Nellis Restaurant

For those who are traveling through Zastron - there is a very nice Restaurant which is serving delicious food at reasanable prices.
In addition they're selling home made juices jams and honey.




interior


home made specialities - the shop in the shop


the Bar


© benste CC NC SA

30 Oct 2011 4:47pm GMT

29 Oct 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: The way back from J'burg

Having the 10 - 12h trip from J'burg back to ELS I was able to take a lot of pcitures including these different roadsides

Plain Street


Orange River in its beginngings (near Lesotho)


Zastron Anglican Church


The Bridge in Between "Free State" and Eastern Cape next to Zastron


my new Background ;)


If you listen to GoogleMaps you'll end up traveling 50km of gravel road - as it was just renewed we didn't have that many problems and saved 1h compared to going the official way with all it's constructions sites




Freeway


getting dark


© benste CC NC SA

29 Oct 2011 4:23pm GMT

28 Oct 2011

feedPython Software Foundation | GSoC'11 Students

Benedict Stein: Wie funktioniert eigentlich eine Baustelle ?

Klar einiges mag anders sein, vieles aber gleich - aber ein in Deutschland täglich übliches Bild einer Straßenbaustelle - wie läuft das eigentlich in Südafrika ?

Ersteinmal vorweg - NEIN keine Ureinwohner die mit den Händen graben - auch wenn hier mehr Manpower genutzt wird - sind sie fleißig mit Technologie am arbeiten.

Eine ganz normale "Bundesstraße"


und wie sie erweitert wird


gaaaanz viele LKWs


denn hier wird eine Seite über einen langen Abschnitt komplett gesperrt, so das eine Ampelschaltung mit hier 45 Minuten Wartezeit entsteht


Aber wenigstens scheinen die ihren Spaß zu haben ;) - Wie auch wir denn gücklicher Weise mussten wir nie länger als 10 min. warten.

© benste CC NC SA

28 Oct 2011 4:20pm GMT