FLOSS Project Planets

Performance update for breeze icons

Planet KDE - Mon, 2016-04-25 17:27
Icons following colors

As breeze is a monochrome icon set the contrast is one of the biggest issues. With Plasma 5.6, the developers solved this problem by applying the system color scheme to the icons. Now the icons use the same color (and contrast) as the text. With this shiny new feature, users can define the colors of the icon set by themselves.

To bring this feature to the user, ALL icons have to have include a style component. Marco Martin added the style stuff with a script but we had a second issue, the file size. In the last release (KF 5.20), the breeze icons need 28 mb of disk size, the applet icons for the widget explorer therefore need way too long to render, … so it was time for a rework.

How does the style stuff work? It follows an SVG standard and you define in the header <defs> area the styled colors and in the body you use in style instead of fill:#f2f2f2 fill:currentColor and define the class=”ColorScheme-Text” which say use the defined Text color from the color scheme.

With the Qt app “SVG Cleaner”, the colored icons were optimized and all monochrome icons were optimized in this way:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22">  <defs id="defs3051">    <style type="text/css" id="current-color-scheme">      .ColorScheme-Text {        color:#f2f2f2      }      </style>  </defs>    <path       style="fill:currentColor;fill-opacity:1;stroke:none"       d="M 3 3 L 3 4 L 3 19 L 4 19 L 14 19 L 14 18 L 4 18 L 4 10 L 7 10 L 7 9.9921875 L 7.0078125 10 L 9.0078125 8 L 18 8 L 18 14 L 19 14 L 19 5 L 12.007812 5 L 10.007812 3 L 10 3.0078125 L 10 3 L 4 3 L 3 3 z M 16 14 L 16 16 L 14 16 L 14 17 L 16 17 L 16 19 L 17 19 L 17 17 L 19 17 L 19 16 L 17 16 L 17 14 L 16 14 z "       class="ColorScheme-Text" /> </svg> Remove ⅔ of the code

Make a template file with only the needed elements, SVG header, style element and the path section was removed with the individual file input. As I’m not a developer it was done by hand. So it took a while but now all monochrome icons can be styled according to the color scheme and the disk size is now 9,4 mb instead of 28,0 mb for the 6.183 breeze icons.

As the icons got rid of unnecessary code the rendering should now be way faster, and with the style stuff I hope to find users to play with it and will find nice solutions for our awesome Plasma desktop.

Open Issue

All in all there is one (big) issue: The style stuff works for now only for Plasma and QML apps, but I hope that in the future we can have this feature for the (QWidget) KDE applications, too.

So if you are an icon designer, bring this shiny new functionality to your icon set and the devs will bring the functionality to the KDE applications.


Categories: FLOSS Project Planets

Python Piedmont Triad User Group: PYPTUG Monthly meeting (Fraction, Statistics, Decorator)

Planet Python - Mon, 2016-04-25 16:12
Come join PYPTUG at out next monthly meeting (April 26th 2016) to learn more about the Python programming language, modules and tools. Python is the perfect language to learn if you've never programmed before, and at the other end, it is also the perfect tool that no expert would do without. Monthly meetings are in addition to our project nights.


WhatMeeting will start at 6:00pm.

We will open on an Intro to PYPTUG and on how to get started with Python, PYPTUG activities and members projects, then on to News from the community.

Then on to the main talk.


Main Talk: Python Fraction, Statistics modulesby Francois DionBio:Artist, Coder, Data Scientist, Entrepreneur, Hacker, Mentor, Musician, Polyglot, Photographer, Polymath
Abstract:Continuing where we left off last month and the Decimal module, we'll continue into Fraction. We'll then see how the Statistics module that is a part of the standard library of Python 3 support these different data types. You should come out of this talk ready to tackle more advanced modules like StatsModels
Lightning talks! 
We will have some time for extemporaneous "lightning talks" of 5-10 minute duration. If you'd like to do one, some suggestions of talks were provided here, if you are looking for inspiration. Or talk about a project you are working on.There are already 2 lightning talks that have been confirmed, with some security related part and one on decorators.
WhenTuesday, April 26th 2016
Meeting starts at 6:00PM

WhereWake Forest University, close to Polo Rd and University Parkway:
Manchester Hall
room: Manchester 241 Wake Forest University, Winston-Salem, NC 27109

 Map this

See also this campus map (PDF) and also the Parking Map (PDF) (Manchester hall is #20A on the parking map)

And speaking of parking:  Parking after 5pm is on a first-come, first-serve basis.  The official parking policy is:
"Visitors can park in any general parking lot on campus. Visitors should avoid reserved spaces, faculty/staff lots, fire lanes or other restricted area on campus. Frequent visitors should contact Parking and Transportation to register for a parking permit."Mailing List
Don't forget to sign up to our user group mailing list:

https://groups.google.com/d/forum/pyptug?hl=en

It is the only step required to become a PYPTUG member.

RSVP on meetup:
http://www.meetup.com/PYthon-Piedmont-Triad-User-Group-PYPTUG/events/230509439/
Categories: FLOSS Project Planets

groups.drupal.org frontpage posts: Google Summer of Code 2016 - Selected Projects

Planet Drupal - Mon, 2016-04-25 16:12

Did you know Drupal was accepted into Google Summer of Code 2016 and that 11 Drupal projects were accepted? In other words, Google is funding 11 people to contribute to Drupal for 10 weeks worth a total of $60,500 USD (thank you Google!). Congratulations to selected students who are collectively credited on more than 100 issues fixed in the past 3 months on drupal.org. Coding starts May 23rd and ends August 23rd.

Majority of projects are focused on work related to Drupal 8 contributed modules. Drupal's students are from 4 different continents and we currently have 26 mentors from 12 countries with over 150 years of experience on drupal.org. As always, we're excited about this summer and we hope community members will provide an extra helping hand if you see students in queues. Learn more about our projects below.

Project: Social API
Student: Getulio Sánchez "gvso" (Paraguay).
Mentors dahacouk (UK), e0ipso (Spain), pcambra (Spain).

Project: Solving content conflicts with merge algorithms in Drupal 8
Student: Rakesh Verma "rakesh_verma" (India).
Mentors: dixon (Sweden), timmillwood (UK), jeqq (Moldova).

Project: Port Mailhandler to Drupal 8
Student: Milos Bovan "mbovan" (Serbia).
Mentors: miro_dietiker (Switzerland), Primsi (Slovenia).

Project: CKEditor plugins for TMGMT
Student: Saša Nikolič "sasanikolic" (Slovenia)
Mentors: miro_dietiker (Switzerland), Berdir (Switzerland).

Project: Port search configuration module to Drupal 8
Student: Joyce George "joyceg" (India)
Mentors: naveenvalech (India), heykarthikwithu (India), neetu (India).

Project: Integrate Google Cloud Vision API to Drupal 8
Student: Arpit Jalan "ajalan065" (India)
Mentors: naveenvalech (India), penyaskito (Spain).

Project: Port Google Login Authenticator To Drupal 8
Student: Mehul Gupta "therealssj" (India)
Mentors: nerdstein (USA), attiks (Belgium).

Project: Media Solution Module
Student: Vijay Nandwani "royal121" (India)
Mentors: slashrsm (Slovenia), paranojik (Slovenia).

Project: Web Component-ize Drupal 8
Student: Tianlei Zheng "ztl8702" (Australia)
Mentors: skyredwang (China), Wimleers (Belgium).

Project: Add Password-based Public-key Encryption to Drupal 8
Student: Talha Paracha "talhaparacha" (Pakistan)
Mentors: nerdstein (USA), colan (Canada), jibran (Pakistan).

Project: Porting Comment alter module to Drupal 8
Student: Anchal Pandey "anchal29" (India)
Mentors: Boobaa (Hungary), czigor (Hungary).

Final call for mentors. Are you interested in helping any of the projects above? Contact Slurpee on drupal.org, find us in #drupal-google on Freenode, and join us at https://groups.drupal.org/google-summer-code.

A special "Thank you" goes out to Drupalize.me for providing all of our students a free account.

Categories: FLOSS Project Planets

FSF News: GNU releases ethical evaluations of code-hosting services

GNU Planet! - Mon, 2016-04-25 15:55

The completed evaluations can be viewed on the evaluation page, while the criteria page offers more information on the evaluation process, as well as the criteria themselves.

Repositories are used not only by software developers but also by software users, and they have a large impact on the free software community. The evaluations promote and honor good ethical practices on the part of repositories, and make it easy for users to find services that respect them.

Version 1.0 of the criteria ranks sites on a score from F (unacceptable) to A+ (extra credit). No site has yet received extra credit, but Savannah achieved an A grade. An F grade shows the service has not met even the minimum ethical standards expected for the hosting of a GNU package. GNU's Repo Criteria Discussion list is happy to offer assistance to repository-hosting organizations seeking to improve their service's score.

One service which has passed the criteria is GitLab. "We want to allow everyone to contribute to software. We recognize that many people have a need for free software to do this," said GitLab's CEO Sytse Sijbrandij, adding that "as a former developer myself, I think it is natural that you can contribute to the software you use to collaborate." Many repository sites require the user to run proprietary JavaScript to access their full functionality, but GitLab has addressed this by relicensing its JavaScript as free software.

Savannah, which has also passed these criteria, "host[s] projects for the sake of the ideals of freedom and community that the free software movement stands for," according to its Web site, which also makes clear that "[t]he space given to you on this server is given for the expressed purpose of advancing free software." Savannah is hosted by the FSF but run almost entirely by a dedicated team of volunteers.

Andrew Ferguson, a community member who played a leadership role in the evaluation project, said "More volunteers with coding ability are needed to aid the development of existing repository services to help them meet these criteria. All community members are encouraged to write the administrators of code-hosting services, to build awareness and a motivation to improve their ethical evaluations. GitHub has responded to some requests from the free software community and has recently updated its license chooser to include the GPLv3 license. However more community advocacy is required, as GitHub still fails to meet the criteria."

General discussion regarding the criteria or evaluations can be directed to the libreplanet-discuss mailing list. If you'd like to lend your help evaluating repositories, please join the repo-criteria-discuss list.

About the Free Software Foundation

The Free Software Foundation, founded in 1985, is dedicated to promoting computer users' right to use, study, copy, modify, and redistribute computer programs. The FSF promotes the development and use of free (as in freedom) software -- particularly the GNU operating system and its GNU/Linux variants -- and free documentation for free software. The FSF also helps to spread awareness of the ethical and political issues of freedom in the use of software, and its Web sites, located at fsf.org and gnu.org, are an important source of information about GNU/Linux. Donations to support the FSF's work can be made at https://donate.fsf.org. Its headquarters are in Boston, MA, USA.

More information about the FSF, as well as important information for journalists and publishers, is at https://www.fsf.org/press.

Media Contacts

Zak Rogoff
Campaigns Manager
Free Software Foundation
+1 (617) 542 5942 x31
campaigns@fsf.org

Categories: FLOSS Project Planets

DrupalCon News: Training Spotlight: Project Management & Team Building

Planet Drupal - Mon, 2016-04-25 15:19

Not a developer? Not a problem! Each year, we see an increased number of project managers and professionals in non-technical roles such as business development, sales, marketing and HR at DrupalCon. We have training opportunities for you, too!

Categories: FLOSS Project Planets

Dries Buytaert: Video: Can we save the open web?

Planet Drupal - Mon, 2016-04-25 14:50

In March, I did a presentation at SxSW that asked the audience a question I've been thinking about a lot lately: "Can we save the open web?".

The web is centralizing around a handful of large companies that control what we see, limit creative freedom, and capture a lot of information about us. I worry that we risk losing the serendipity, creativity and decentralization that made the open web great.


While there are no easy answers to this question, the presentation started a good discussion about the future of the open web, the role of algorithms in society, and how we might be able to take back control of our personal information.

I'm going to use my blog to continue the conversation about the open web, since it impacts the future of Drupal. I'm including the video and slides (PDF, 76 MB) of my SxSW presentation below, as well as an overview of what I discussed.

Here are the key ideas I discussed in my presentation, along with a few questions to discuss in the comments.

Idea 1: An FDA-like organization to provide oversight for algorithms. While an "FDA" in and of itself may not be the most ideal solution, algorithms are nearly everywhere in society and are beginning to impact life-or-death decisions. I gave the example of an algorithm for a self-driving car having to decide whether to save the driver or hit a pedestrian crossing the street. There are many other life-or-death examples of how unregulated technology could impact people in the future, and I believe this is an issue we need to begin thinking about now. What do you suggest we do to make the use of algorithms fair and trustworthy?

Idea 2: Open standards that will allow for information-sharing across sites and applications. Closed platforms like Facebook and Google are winning because they're able to deliver a superior user experience driven by massive amounts of data and compute power. For the vast majority of people, ease-of-use will trump most concerns around privacy and control. I believe we need to create a set of open standards that enable drastically better information-sharing and integration between websites and applications so independent websites can offer user experiences that meet or exceeds that of the large platforms. How can the Drupal community help solve this problem?

Idea 3: A personal information broker that allows people more control over their data. In the past, I've written about the idea for a personal information broker that will give people control over how, where and for how long their data is used, across every single interaction on the web. This is no small feat. An audience member asked an interesting question about who will build this personal information broker -- whether it will be a private company, a government, an NGO, or a non-profit organization? I'm not really sure I have the answer, but I am optimistic that we can figure that out. I wish I had the resources to build this myself as I believe this will be a critical building block for the web. What do you think is the best way forward?

Ultimately, we should be building the web that we want to use, and that we want our children to be using for decades to come. It's time to start to rethink the foundations, before it's too late. If we can move any of these ideas forward in a meaningful way, they will impact billions of people, and billions more in the future.

Categories: FLOSS Project Planets

Anarcat: My free software activities, April 2016

Planet Python - Mon, 2016-04-25 14:23
Debian Long Term Support (LTS)

This is my 5th month working on Debian LTS, started by Raphael Hertzog at Freexian. This is my largest month so far, in which I worked on completing the Xen and NSS packages updates from last month, but also spent a significant amount of time working on phpMyAdmin and libidn.

Updates to NSS and Xen completed

This basically consisted on following up on the reviews from other security people. I basically continued building up on Brian's work and tested the package on a test server at Koumbit, which seems to have survived well the upgrade. The details are in this post to the debian-lts mailing list.

As for NSS, the package was mostly complete, but I forgot to ship the tests for some reason, so I added them back. I also wrote the release team to see if it was possible to update NSS to the same version in all suites. Unfortunately, this issue is still pending, but I still hope we can find better ways of managing that package in the long term.

IDN and phpMyAdmin

Most of my time this month was spent working on IDN and phpMyAdmin. Unfortunately, it turns out that someone else had worked on the libidn package. This is partly my fault: I forgot to check in the dsa-needed.txt file for assignment before working on the package. But considering how in flux the workflow currently is with the switch between the main security team and the LTS team for the wheezy maintenance, I don't feel too bad. Still, I prepared a package which was a bit more painful than it should have been because of GNUlib. I didn't even know about GNUlib before, oddly enough, and after that experience, I feel that it should just not exist at all anymore. I have filed a bug to remove that dependency at the very least, but I do not clearly see how such a tool is necessary on Debian at this point in time.

But phpMyAdmin, no one had worked on that. And I understand why: even though it's a very popular package, there were quite a few outstanding issues (8!) in Wheezy, with 10-15 patches to be ported. Plus, it's ... well, PHP. And old PHP at that, with parts of it with modern autoloader classes, and other with mixed HTML and PHP content, require (and not require_once) and all sorts of nasty things you still find in the PHP universe. I nevertheless managed to produce a new Debian package for wheezy and test it on Koumbit's test servers. Hopefully, that can land into Wheezy soon.

Long term software support

I am a little worried that we are, both in Jessie and Wheezy sitting in between stable releases for phpMyAdmin, something that is a recurring issue for a lot of packages in Debian stable or LTS. Sometimes, it just happens that the version that happens to be in Debian testing when it is released as stable is just not a supported release upstream. It's the case for phpMyAdmin in Jessie (4.3, whereas 4.0 and 4.4 are supported) and Wheezy (3.4, although it's unclear how long that was supported upstream). But even if the next Debian stable (Stretch), would pick a stable release upstream, there is actually no phpMyAdmin release that has a support window as long as Debian stable (roughly 3 years), let alone as long as Debian LTS (5 years).

This is a similar problem with NSS: upstream is simply not supporting their product in the long term, or at least not in the terms we are used to in the Debian community (ie. only security fixes or regressions). This is, in my opinion, a real concern for the reliability and sustainability of the computing infrastructure we are creating. While some developers are of the opinion that software older than 18 months is too old, here we are shipping hardware and software in space or we have Solaris, which is supported for 16 years! Now that is a serious commitment and something we can rely on. 18 months is really, really, a tiny short time in the history of our civilization. I know computer programmers and engineers like to think of themselves in elitist terms, that they are changing the world every other year. But the truth is that things have not changed much in the last 4 decades where computing has existed, both in terms of security or functionality. Two quotes from my little quotes collection come to mind here:

Software gets slower faster than hardware gets faster. - Wirth's law

The future is already here – it's just not very evenly distributed. - William Gibson

Because of course, the response to my claims that computing is not really advancing is "but look! we have supercomputers in our pockets now!" Yes, of course, we do have those fancy phones and they are super-connected, but they are a threat to our fundamental rights and freedom. And those glittering advances always pale in comparison to what could be done if we wouldn't be wasting our time rewriting the same software over and over again on different, often proprietary, platforms, simply because of the megalomaniac fantasies of egoistic programmers.

It would be great to build something that lasts, for a while. Software that does not need to be updated every 16 months. You'd think that something as basic as a screensaver release could survive what is basically the range of human infancy. Yet it seems we like to run mindlessly in the minefield of software development, one generation following the other without questioning the underlying assumption of infinite growth that permeates our dying civilization.

I have talked about this before of course, but working with the LTS project just unnerves me so bad that I just needed to let out another rant.

(For the record, I really have a lot of respect for JWZ and all the work he has done in the free software world. I frequently refer to his "no-bullshit" backup guide and use Xscreensaver daily. But I do think he was wrong in this case: asking Debian to remove Xscreensaver is just too much. The response from the maintainer was exemplary of how to handle such issues in the future. I restarted Xscreensaver after the stable update, and the message is gone, and things are still all fine. Thanks JWZ and Tormod for keeping things rolling.)

Other free software work

With that in mind, I obviously didn't stop doing other computing work this month. In fact, I did a lot of work to try to generally fix the internet, that endless and not-quite-gratifying hobby so many of us are destroying our bodies to accomplish.

Build tools

I have experimented a bit more with different build tools. I got worried because at some point cowbuilder got orphaned and I figured I could refresh the way I build packages for LTS. I looked into sbuild, but that ended up not bringing much improvements over my current cowbuilder setup (which I really need to document better). I was asked by the new maintainer to open a bug report to make such setups easier by guessing the basepath better, so we'll see how that goes.

I did enjoy the simplicity of gitpkg and discovered cowpoke which made it about 2 times faster to build packages because I could use another server to build larger packages. I also found that gitpkg doesn't use -n by default when calling gzip, which makes it harder to reproduce tarballs when they are themselves built reproducibly, which is the case for Github tarballs (really nice of them). So I filed bug #820842 about that.

It would be pretty awesome if such buildds would be available for Debian Developers to do their daily tasks. It could simply be a machine that would spin up a chroot with cowbuilder or it could even be a full, temporary VM although that would take way more resources than a simple VM with a cowbuilder setup.

In the meantime, I should probably look at whalebuilder as an alternative to cowbuilder. It is a tool that supports building packages within a Docker chroot, which means that packages are built from a clean environment like pbuilder, and using COW optimisations but also without privileges or network access, which is a huge plus especially when you build untrusted packages.

Ikiwiki admonitions

I have done some work to implement Moinmoin-like admonitions in Ikiwiki, something I am quite happy about since it's something I was really missing about Moinmoin. Admonitions bring a really nice way to outline certain blocks with varying severity levels and distinct styles. For example:

Admonitions are great!

This was done with a macro, but basically, since Markdown allows more or less arbitrary HTML, this can also be done with the <div> tag. I like that we don't have a new weird markup here. Yet, I still liked the sub-parser feature of MoinMoin, something that can be implemented in Ikiwiki, but it's a little more clunky. Normally, you'd probably do this with the inline macro and subpages, but it's certainly less intuitive that directly inlined content.

Ereader

I got a new e-reader! I was hesitant between the Kobo Aura H20 and the Kobo Glo HD, which were the ones available at Bestbuy. So I bought both and figured I would return the other. That was a painful decision! In the end, both machines are pretty nice:

  • Aura H2O
    • Pros:
      • waterproof
      • larger screen (makes it easier to see web pages and better for the eyes)
      • naturally drawn to it
    • Cons:
      • heavier
      • larger (fits in outside pocket though)
      • port cover finicky
      • more expensive (180$) - prices may go down in future
  • Aura Glo HD
    • Pros
      • smaller (fits in inside pocket of both coats)
      • better resolution in theory (can't notice in practice)
      • cheaper (100$)
      • may be less common on the future (larger models more common? just a guess)
    • Cons
      • no SD card
      • smaller screen
      • power button in the middle

... but in the end, I ended up settling down on the Glo, mostly for the price. Heck, I saved around 100$, so for that amount, I could have gotten two machines so that if one breaks I would still have the other. I have ordered a cover for it on Deal Extreme about two weeks ago, and it still hasn't arrived. I suspect it's going to take a few more months to get there, by which point I may have changed e-reader again.

Note that both e-readers needed an update to calibre, so I started working on a calibre backport (#818309) which I will complete soon.

So anyways, I looked into better ways of transferring articles from the web to the e-reader, something which I do quite a bit to avoid spending too much time on the computer. Since the bookmark manager I use (Bookie) is pretty much dead, I started looking at other alternatives. And partly inspired by Framasoft's choice of Wallabag for their bookmarking service (Framabag), I started to look into that software, especially since my friend who currently runs the Bookie instance is thinking of switching to Wallabag as well.

It seems the simplest way to browse articles remotely through a standard protocol is by implementing OPDS support in Wallabag. OPDS is a standard developed in part by the Internet Archive and it allows for browsing book collections and downloading them. Articles and bookmarks would then be presented as individual books that would be accessible from any OPDS-compatible device.

Unfortunately, the Kobo e-readers don't support OPDS out of the box: you need to setup some OPDS-compatible reader like Koreader. And that I found nearly impossible to do: I was able to setup KSM (the "start menu", not to be confused with that KSM), but not Koreader in KSM. Besides, I do not want a separate OS running here on the tablet: I just want to start Koreader every once in a while. KSM just starts another system when you reboot the e-reader, something which is not really convenient on the Kobo.

Basically, I just want to add Koreader as a tile in the home screen on the e-reader. I found the documentation on that topic to be sparse and hard to follow. It is often dispersed across multiple forum threads and involves uploading random binaries, often proprietary, to the e-reader. It had been a long time since I was asked to "register my software" frenetically, and I hadn't missed that one bit. So I decided to stay away from this until that solution and its documentation matures a bit.

Streaming re-established

I have worked a bit on my home radio stream. I simply turned the Liquidsoap stream back online, and did a few tweaks to the documentation that I had built back then. All that experimenting led me to do two NMUs. One was for gmpc-plugins to fix a FTBFS (bug #807735) and to properly kill the shout streamer when completing the playback (bug #820908).

The other was to fix the ezstream manpage (bug #573928), a patch that had been sitting there for 5 years! This was to try to find an easy way to stream random audio (say from a microphone) to the Icecast server, something which is surprisingly difficult, consider how basic that functionality is. I was surprised to see that Darkice just completely fails to start (bug #821040) and I had to fallback to the simplest ices2 software to stream the audio.

I am still having issues with Liquidsoap: it's really unstable! As a server, I would expect it to keep running for days if not years. Unfortunately, there's always something that makes it crash. I had assertion failed (bug #821112) and I keep seeing it crash after 2-3 days fairly reliably, a bug I reported 3 years ago and that is still not fixed (bug #727307).

Switching back the stream to Vorbis (because I was having problems with the commandline mp3 players and ogg123 is much more lightweight) created another set of problems too, this time with the phone. It seems that Android cannot stream Vorbis at all, something that is even worse in Cyanogenmod... I also had to tweak my MPD config to make the Android client be able to load the larger playlists (see dmix buffer is full).

Android apps

So I have also done quite a bit of work again on my phone. I finally was told how to access from Termux from adb shell which is pretty cool because now I can start a screen on my phone and then, when I'm tired of tapping to type, I can just reconnect to it when I plug in a USB cable on my laptop. I sent a pull request to fix the documentation regarding that.

I also tried to see how my SMS and Signal situation could be improved. Right now, I have two different apps to do SMS on my phone: I use both Signal and the VoIP.ms SMS client, because I do not have a contract or SIM card in my phone. Both work well independently, but it's somewhat annoying to have to switch between the two.

(In fact, I feel that Signal itself has an issue with how it depends on the network to send encrypted messages: I often have to "ping" people in clear text (and therefore in the other app) so that they connect to their data plan to fetch my "secure" signal messages...)

Anyways, I figured it would be nice if at least there would be a SMS fallback in Signal that would allow me to send regular text messages from signal through Voip.MS. That was dismissed really fast. Moxie even closed the conversation completely, something I had never experienced before, and doesn't feel exactly pleasant. The Voip.MS side was of course not impressed and basically shrugged it off because Signal was not receptive.

I also tried to clear up the Libresignal confusion: there are 3 different projects named "Libresignal", and I am not sure I figured out the right thing, even though the issue is now closed and there's a FAQ that is supposed to make all that clear. Nevertheless, I opened two distinct feature requests to try to steer the conversation into a more productive direction: GCM-less calls and GCM support. But I'm not sure neither will go anywhere.

In the meantime, I am using the official signal client, which I downloaded using gplaycli and which I keep up to date with Aptoide. Even though the reliability of that site is definitely questionable, it seems that once you have a trusted version, it is safe to upgrade, regardless of the source because there is a trust path between you and the developer.

I also filed a few issues with varying levels of success/response from the community:

Random background radiation

And then there's of course the monthly background noise of all the projects I happened to not only stumble on, but also file bugs or patches against:

Categories: FLOSS Project Planets

Chapter Three: Cache API in Drupal

Planet Drupal - Mon, 2016-04-25 13:30
Cache API in Drupal

This is a very simple tutorial that could help you with the performance of your custom modules. I will show you how to use Cache API in Drupal 8 and Drupal 7.

Minnur Yunusov April 25, 2016
Categories: FLOSS Project Planets

Chapter Three: Cache API in Drupal

Planet Drupal - Mon, 2016-04-25 13:30

This is a very simple tutorial that could help you with the performance of your custom modules. I will show you how to use Cache API in Drupal 8 and Drupal 7.

You don't have to perform heavy caluclations every time you need to pull data either from third-party API or from database. Instead run it once and cache it. I personally use caching when I need to run complex SQL queries and third-party integrations (Example: get a list of available forms from Hubspot, or available campaign lists from Mailchimp etc).

In Drupal 8 use the following code structure:

Categories: FLOSS Project Planets

Bhishan Bhandari: What are the must know features of python programming language

Planet Python - Mon, 2016-04-25 13:10

List comprehensions One of the major features of python is list comprehension. It is a natural way of creating a new list where each element is the result of some operations applied to each member of another sequence of an iterable. The construct of a list comprehension is such that it consists of brackets containing […]

The post What are the must know features of python programming language appeared first on The Tara Nights.

Categories: FLOSS Project Planets

Gunnar Wolf: Passover / Pesaj, a secular viewpoint, a different viewpoint... And slowly becoming history!

Planet Debian - Mon, 2016-04-25 12:51

As many of you know (where "you" is "people reading this who actually know who I am), I come from a secular Jewish family. Although we have some religious (even very religious) relatives, neither my parents nor my grandparents were religious ever. Not that spirituality wasn't important to them — My grandparents both went deep into understanding by and for themselves the different spiritual issues that came to their mind, and that's one of the traits I most remember about them while I was growing up. But formal, organized religion was never much welcome in the family; again, each of us had their own ways to concile our needs and fears with what we thought, read and understood.

This week is the Jewish celebration of Passover, or Pesaj as we call it (for which Passover is a direct translation, as Pesaj refers to the act of the angel of death passing over the houses of the sons of Israel during the tenth plague in Egypt; in Spanish, the name would be Pascua, which rather refers to the ritual sacrifice of a lamb that was done in the days of the great temple)... Anyway, I like giving context to what I write, but it always takes me off the main topic I want to share. Back to my family.

I am a third-generation member of the Hashomer Hatzair zionist socialist youth movement; my grandmother was among the early Hashomer Hatzair members in Poland in the 1920s, both my parents were active in the Mexico ken in the 1950s-1960s (in fact, they met and first interacted there), and I was a member from 1984 until 1996. It was also thanks to Hashomer that my wife and I met, and if my children get to have any kind of Jewish contact in their lifes, I hope it will be through Hashomer as well.

Hashomer is a secular, nationalist movement. A youth movement with over a century of history might seem like a contradiction. Over the years, of course, it has changed many details, but as far as I know, the essence is still there, and I hope it will continue to be so for good: Helping shape integral people, with identification with Judaism as a nation and not as a religion; keeping our cultural traits, but interpreting them liberally, and aligned with a view towards the common good — Socialism, no matter how the concept seems passé nowadays. Colectivism. Inclusion. Peaceful coexistence with our neighbours. Acceptance of the different. I could write pages on how I learnt about each of them during my years in Hashomer, how such concepts striked me as completely different as what the broader Jewish community I grew up in understood and related to them... But again, I am steering off the topic I want to pursue.

Every year, we used to have a third Seder (that is, a third Passover ceremony) at Hashomer. A third one, because as tradition mandates two ceremonies to be held outside Israel, and a movement comprised of people aged between 7 and 21, having a seder competing with the familiar one would not be too successful, we held a celebration on a following day. But it would never be the same as the "formal" Pesaj: For the Seder, the Jewish tradition mandates following the Hagada — The Seder always follows a predetermined order (literally, Seder means order), and the Hagadá (which means both legend and a story that is spoken; you can find full Hagadot online if you want to see what rites are followed; I found a seemingly well done, modern, Hebrew and English version, a more traditional one, in Hebrew and Spanish, and Wikipedia has a description including its parts and rites) is, quite understandably, full with religious words, praises for God, and... Well, many things that are not in line with Hashomer's values. How could we be a secular movement and have a big celebration full with praises for God? How could we yearn for life in the kibbutz distance from the true agricultural meaning of the celebration?

The members of Hashomer Hatzair repeatedly took on the task (or, as many would see it, the heresy) of adapting the Hagada to follow their worldview, updated it for the twentieth century, had it more palatable for our peculiarities. Yesterday, when we had our Seder, I saw my father still has –together with the other, more traditional Hagadot we use– two copies of the Hagadá he used at Hashomer Hatzair's third Seder. And they are not only beautiful works showing what they, as very young activists thought and made solemn, but over time, they are becoming historic items by themselves (one when my parents were still young janijim, in 1956, and one when they were starting to have responsabilities and were non-formal teachers or path-showers, madrijim, in 1959). He also had a copy of the Hagadá we used in the 1980s when I was at Hashomer; this last one was (sadly?) not done by us as members of Hashomer, but prepared by a larger group between Hashomer Hatzair and the Mexican friends of Israeli's associated left wing party, Mapam. This last one, I don't know which year it was prepared and published on, but I remember following it in our ceremony.

So, I asked him to borrow me the three little books, almost leaflets, and scanned them to be put online. Of course, there is no formal licensing information in them, much less explicit authorship information, but they are meant to be shared — So I took the liberty of uploading them to the Internet Archive, tagging them as CC-0 licensed. And if you are interested in them, flowing over and back between Spanish and Hebrew, with many beautiful texts adapted for them from various sources, illustrated by our own with the usual heroic, socialist-inspired style, and lovingly hand-reproduced using the adequate technology for their day... Here they are:

I really enjoyed the time I took scanning and forming them, reading some passages, imagining ourselves and my parents as youngsters, remembering the beautiful work we did at such a great organization. I hope this brings this joy to others like it did to me.

פעם שומר, תמיד שומר. Once shomer, always shomer.

Categories: FLOSS Project Planets

DrupalEasy: Demystifying Drupal 8's breakpoints.yml file

Planet Drupal - Mon, 2016-04-25 12:36

While working through a couple of Drupal 8 projects involving a custom theme, I've been curious about the themename.breakpoints.yml file. I've dutifully updated it with the proper breakpoint values, but I've been a bit mystified with its actual purpose. There's nothing in either of the base themes I've used (Neato and Bootstrap) that actually appears to utilize the data in the breakpoints.yml files. While the breakpoints are defined in this file, they are also defined in the theme's source Sass and LESS files, for use in the processed CSS. 

I decided to dig into the issue a bit more over the past few days in an effort to figure out exactly what the purpose of the breakpoints.yml file is. It turns out that the any module or theme can create a themename.breakpoints.yml or modulename.breakpoints.yml file. The Breakpoint module (included as part of Drupal 8 core) then reads these files and adds them to the site's configuration. At this point, other installed modules and themes can access this configuration and utilize it in their own functionality. This is exactly how the Responsive Image module (also part of Drupal 8 core) works. It accesses the installed theme's breakpoints configuration (via the themename.breakpoints.yml file) and serves up proper responsive images based on that configuration.

But, at this time, there is nothing in Drupal core that automatically allows breakpoints defined in the themename.breakpoints.yml file to be easily used in the theme's CSS. So, when a theme's breakpoints.yml file is modified, nothing will change on the site until the site's CSS is also modified. In effect, most theme's breakpoints will need to be defined in two places - the themename.breakpoints.yml file and the theme's CSS. 

There are methods available (and still being developed) to "link" breakpoints defined in the breakpoints.yml file with the theme's CSS - usually as part of a pre-processing task when working with LESS or Sass. 

Resources
Categories: FLOSS Project Planets

DrupalEasy: DrupalEasy Podcast 167 - Ted Spoils Star Wars (2015 Year in Review)

Planet Drupal - Mon, 2016-04-25 12:36

Direct .mp3 file download.

In this very special holiday episode of the DrupalEasy Podcast, (most of) the co-hosts pick our favorite Drupaly things from 2015, including our favorite Drupal moments as well as our favorite things about Drupal 8. Ted teaches us about the spirit of Christmas, Andrew talks about his favorite podcast episode, Ryan makes a surprise appearance, and we meet Kelley Curry (BrightBold), our newest co-host.

Our Favorite Things Drupal moment of the year
  • Mike - DrupalCon Barcelona community keynotes.
  • Ryan - adding new hosts to DrupalEasy Podcast / recording the April Fool's Day Episode / singing the Drupal Oddity song at DrupalCon Karaoke in Los Angeles and watching Mike H freak out.
  • Andrew - Being at work and having my boss ask what happened to the DrupalEasy Podcast. It was the April Fools Day episode. He was afraid we all lost our minds.
  • Kelley - DrupalCon LA prenote / release of D8 with my first 4 core commits / getting asked to join the podcast.
  • Ted - Acquia U, Drupalcon LA Hallway Track.
Drupal 8
  • Mike - View modes being a first-class “thing”.
  • Ryan - that I got to learn Dependency Injection, Services, OOP.
  • Andrew - Namespacing (more PHP but hey, we can now use it). Or more meta, we now fit into the rest of the PHP world.
  • Kelley - Theming improvements: Classy, Stable, Twig debugging.
  • Ted - OOP - CMI - Death to Features.
DrupalEasy News
  • The next session of the 12-week Drupal Career Online course starts in March, 2016 - visit DrupalEasy.com/dco for all the details.
Drupal Association Sponsors Upcoming Events Follow us on Twitter Five Questions (answers only)
  1. Started a 501(c)(3) to support a bilingual public school. Hurley K-8 and Neighborhood Parents for the Hurley School.
  2. Gathered Table iPhone app.
  3. Speak at DrupalCon.
  4. Cheetah.
  5. DrupalCon San Francisco help from Benjamin Doherty (bangpound).
Intro Music

One Christmas at a Time by Jonathan Coulton and John Roderick.

Subscribe

Subscribe to our podcast on iTunes or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

Categories: FLOSS Project Planets

Trey Hunner: How to Loop With Indexes in Python

Planet Python - Mon, 2016-04-25 12:00

If you’re moving to Python from C or Java, you might be confused by Python’s for loops. Python doesn’t actually have for loops… at least not the same kind of for loop that C-based languages have. Python’s for loops are actually foreach loops.

In this article I’ll compare Python’s for loops to those of other languages and discuss the usual ways we solve common problems with for loops in Python.

For loops in other languages

Before we look at Python’s loops, let’s take a look at a for loop in JavaScript:

1 2 3 4 var colors = ["red", "green", "blue", "purple"]; for (var i = 0; i < colors.length; i++) { console.log(colors[i]); }

This JavaScript loop looks nearly identical in C/C++ and Java.

In this loop we:

  1. Set a counter variable i to 0
  2. Check if the counter is less than the array length
  3. Execute the code in the loop or exit the loop if the counter is too high
  4. Increment the counter variable by 1
Looping in Python

Now let’s talk about loops in Python. First we’ll look at two slightly more familiar looping methods and then we’ll look at the idiomatic way to loop in Python.

while

If we wanted to mimic the behavior of our traditional C-style for loop in Python, we could use a while loop:

1 2 3 4 5 colors = ["red", "green", "blue", "purple"] i = 0 while i < len(colors): print(colors[i]) i += 1

This involves the same 4 steps as the for loops in other languages (note that we’re setting, checking, and incrementing i) but it’s not quite as compact.

This method of looping in Python is very uncommon.

range of length

I often see new Python programmers attempt to recreate traditional for loops in a slightly more creative fashion in Python:

1 2 3 colors = ["red", "green", "blue", "purple"] for i in range(len(colors)): print(colors[i])

This first creates a range corresponding to the indexes in our list (0 to len(colors) - 1). We can loop over this range using Python’s for-in loop (really a foreach).

This provides us with the index of each item in our colors list, which is the same way that C-style for loops work. To get the actual color, we use colors[i].

for-in: the usual way

Both the while loop and range-of-len methods rely on looping over indexes. But we don’t actually care about the indexes: we’re only using these indexes for the purpose of retrieving elements from our list.

Because we don’t actually care about the indexes in our loop, there is a much simpler method of looping we can use:

1 2 3 colors = ["red", "green", "blue", "purple"] for color in colors: print(color)

So instead of retrieving the item indexes and looking up each element, we can just loop over our list using a plain for-in loop.

The other two methods we discussed are sometimes referred to as anti-patterns because they are programming patterns which are widely considered unidiomatic.

What if we need indexes?

What if we actually need the indexes? For example, let’s say we’re printing out president names along with their numbers (based on list indexes).

range of length

We could use range(len(our_list)) and then lookup the index like before:

1 2 3 presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"] for i in range(len(presidents)): print("President {}: {}".format(i + 1, presidents[i]))

But there’s a more idiomatic way to accomplish this task: use the enumerate function.

enumerate

Python’s built-in enumerate function allows us to loop over a list and retrieve both the index and the value of each item in the list:

1 2 3 presidents = ["Washington", "Adams", "Jefferson", "Madison", "Monroe", "Adams", "Jackson"] for num, name in enumerate(presidents, start=1): print("President {}: {}".format(num, name))

The enumerate function gives us an iterable where each element is a tuple that contains the index of the item and the original item value.

This function is meant for solving the task of:

  1. Accessing each item in a list (or another iterable)
  2. Also getting the index of each item accessed

So whenever we need item indexes while looping, we should think of enumerate.

Note: the start=1 option to enumerate here is optional. If we didn’t specify this, we’d start counting at 0 by default.

What if we need to loop over multiple things?

Often when we use list indexes, it’s to look something up in another list.

enumerate

For example, here we’re looping over two lists at the same time using indexes to look up corresponding elements:

1 2 3 4 5 colors = ["red", "green", "blue", "purple"] ratios = [0.2, 0.3, 0.1, 0.4] for i, color in enumerate(colors): ratio = ratios[i] print("{}% {}".format(ratio * 100, color))

Note that we only need the index in this scenario because we’re using it to lookup elements at the same index in our second list. What we really want is to loop over two lists simultaneously: the indexes just provide a means to do that.

zip

We don’t actually care about the index when looping here. Our real goal is to loop over two lists at once. This need is common enough that there’s a special built-in function just for this.

Python’s zip function allows us to loop over multiple lists at the same time:

1 2 3 4 colors = ["red", "green", "blue", "purple"] ratios = [0.2, 0.3, 0.1, 0.4] for color, ratio in zip(colors, ratios): print("{}% {}".format(ratio * 100, color))

The zip function takes multiple lists and returns an iterable that provides a tuple of the corresponding elements of each list as we loop over it.

Note that zip with different size lists will stop after the shortest list runs out of items. You may want to look into itertools.zip_longest if you need different behavior. Also note that zip in Python 2 returns a list but zip in Python 3 returns a lazy iterable. In Python 2, itertools.izip is equivalent to the newer Python 3 zip function.

Looping cheat sheet

Here’s a very short looping cheat sheet that might help you remember the preferred construct for each of these three looping scenarios.

Loop over a single list with a regular for-in:

1 2 for n in numbers: print(n)

Loop over multiple lists at the same time with zip:

1 2 for header, rows in zip(headers, columns): print("{}: {}".format(header, ", ".join(rows)))

Loop over a list while keeping track of indexes with enumerate:

1 2 for num, line in enumerate(lines): print("{0:03d}: {}".format(num, line)) In Summary

If you find yourself tempted to use range(len(my_list)) or a loop counter, think about whether you can reframe your problem to allow usage of zip or enumerate (or a combination of the two).

In fact, if you find yourself reaching for enumerate, think about whether you actually need indexes at all. It’s quite rare to need indexes in Python.

  1. If you need to loop over multiple lists at the same time, use zip
  2. If you only need to loop over a single list just use a for-in loop
  3. If you need to loop over a list and you need item indexes, use enumerate

If you find yourself struggling to figure out the best way to loop, try using the cheat sheet above.

For more a more detailed explanation of the fundamentals of looping in Python, see Ned Batchelder’s Loop Like a Native presentation.

Thanks Steven Kryskalla and Diane Chen for proof-reading this post.

Happy looping!

Categories: FLOSS Project Planets

A Usability Guy’s Journey to Creating his First KDE Tool – Part 2: A Vision

Planet KDE - Mon, 2016-04-25 11:38

As already suggested in the first article of this series, fixing a bug was just the start of my journey. What I now want to do is help KDE improve our AppStream metadata. Why is this so important to me?

I first got in contact with AppStream as part of my interaction design work on Discover. The fact that all I had for linking the word Discover to was a not very informative quickgit project page perfectly exemplifies one of two big problems that I want to help solve: That only a minority of KDE projects have a proper representation on the web. The other issue is that the default software centers for Plasma (Discover) as well as GNOME and Unity (both use GNOME Software) both draw the information they present on applications from AppStream data, but far from all of KDE’s applications provide these data.

The nice thing is that we can reuse the information for AppStream to automatically create a website for each application which is at least a lot more informative for end users than what quickgit provides. Of course, those projects who have the manpower and motivation to create gorgeous websites like that for Minuet or Krita should still do that, but the others would still get at least something useful.

Of course I am aware that AppStream metadata do not grow on trees. Someone has to write them. AppStream database builders read metadata about an application from an appdata.xml file provided with the application’s source code. Now I know that just seeing the extension “.xml” is enough to raise many developers’ neck hair. The fact that developers have to write an xml file by hand may be one of the reasons why not everyone does it.

It may not be the only reason, though. Maybe people need to be reminded that they should check before release whether their AppStream data is up-to-date? Maybe they need AppData generation and maintenance to be better integrated into their workflow?

I want to help developers to create and update their applications’ AppData more easily, and I want to create a tool for that. For now I’ll call that tool AppData Helper.

This is its product vision:

AppData Helper is a tool that makes it easy for application maintainers and developers to create and maintain an AppData file for their application. It takes as much of the “bureaucracy” out of the process as possible, allowing them to focus solely on the actual information they have to provide.

Now I have two questions for you, dear potential users. First of all: Do you think such a tool may make it more likely that you provide AppData for your application? Please answer that question in the poll below. The second question is: What specifically would such a tool need to do in order to be of help to you? Would it have to be a GUI application, a command-line tool/script, a KDevelop plugin, or something else? Please provide input for that in the comments!

Thank you,

Thomas

Take Our Poll
Filed under: KDE
Categories: FLOSS Project Planets

OpenStack Summit Austin - Start

Planet KDE - Mon, 2016-04-25 10:28
Today the OpenStack Summit starts in Austin, TX. Sitting right now in the keynote hall with live music and wait for the keynotes to begin. This time my talk wasn't selected. Nevertheless I expect a great summit with numerous interesting sessions and locking forward to meet with other fellows and partners from the OpenStack and Ceph communities.
Categories: FLOSS Project Planets

Continuum Analytics News: Accelerate 2.2 Released!

Planet Python - Mon, 2016-04-25 10:27
Developer Blog Posted Monday, April 25, 2016 Stan Seibert

We're happy to announce the latest update to Accelerate with the release of version 2.2. This version of Accelerate adds compatibility with the recently released Numba 0.25, and also expands the Anaconda Platform in two new directions:

  • Data profiling
  • MKL-accelerated ufuncs

 I'll discuss each of these in detail below.

Data Profiling

We've built up quite a bit of experience over the years optimizing numerical Python code for our customers, and these projects follow some common patterns. First, the most important step in the optimization process is profiling a realistic test case. You can't improve what you can't measure, and profiling is critical to identify the true bottlenecks in an application. Even experienced developers are often surprised by profiling results when they see which functions are consuming the most time. Ensuring the test case is realistic (but not necessarily long) is also very important, as unit and functional tests for applications tend to use smaller, or differently shaped, input data sets. The scaling behavior of many algorithms is non-linear, so profiling with a very small input can give misleading results.

The second step in optimization is to consider alternative implementations for the critical functions identified in the first step, possibly adopting a different algorithm, parallelizing the calculation to make use of multiple cores or a GPU, or moving up a level to eliminate or batch unnecessary calls to the function. In this step of the process, we often found ourselves lacking a critical piece of information: what data types and sizes were being passed to this function? The best approach often depends on this information. Are these NumPy arrays or custom classes? Are the arrays large or small? 32-bit or 64-bit float? What dimensionality? Large arrays might benefit from GPU acceleration, but small arrays often require moving up the call stack in order to see if calculations can be batched.

Rather than having to manually modify the code to collect this data type information in an ad-hoc way, we've added a new profiling tool to Accelerate that can record this type information as a part of normal profiling. For lack of a better term, we're calling this "data profiling."

We collect this extra information using a modified version of the built-in Python profiling mechanism, and can display it using the standard pstats-style table:

ncalls  tottime percall cumtime percall filename:lineno(function) 300/100 0.01313 0.0001313 0.03036 0.0003036  linalg.py:532(cholesky(a:ndarray(dtype=float64, shape=(3, 3)))) 200/100 0.004237 4.237e-05 0.007189 7.189e-05 linalg.py:139(_commonType()) 200/100 0.003431 3.431e-05 0.005312 5.312e-05 linalg.py:106(_makearray(a:ndarray(dtype=float64, shape=(3, 3)))) 400/200 0.002663 1.332e-05 0.002663 1.332e-05 linalg.py:111(isComplexType(t:type)) 300/100 0.002185 2.185e-05 0.002185 2.185e-05 linalg.py:209(_assertNdSquareness()) 200/100 0.001592 1.592e-05 0.001592 1.592e-05 linalg.py:124(_realType(t:type, default:NoneType)) 200/100 0.00107 1.07e-05 0.00107 1.07e-05 linalg.py:198(_assertRankAtLeast2()) 100 0.000162 1.62e-06 0.000162 1.62e-06 linalg.py:101(get_linalg_error_extobj(callback:function))

The recorded function signatures now include data types, and NumPy arrays also have dtype and shape information. In the above example, we've selected only the linear algebra calls from the execution of a PyMC model. Here we can clearly see the Cholesky decomposition is being done on 3x3 matrices, which would dictate our optimization strategy if cholesky was the bottleneck in the code (in this case, it is not).

We've also integrated the SnakeViz profile visualization tool into the Accelerate profiler, so you can easily collect and view profile information right inside your Jupyter notebooks:

profiling.png

All it takes to profile a function and view it in a notebook is a few lines:

from accelerate import profiler

p = profiler.Profile()

p.run('my_function_to_profile()')

profiler.plot(p)

MKL-Accelerated Ufuncs

MKL is perhaps best known for high performance, multi-threaded linear algebra functionality, but MKL also provides highly optimized math functions, like sin() and cos() for arrays. Anaconda already ships with the numexpr library, which is linked against MKL to provide fast array math support. However, we have future plans for Accelerate that go beyond what numexpr can provide, so in the latest release of Accelerate, we've exposed the MKL array math functions as NumPy ufuncs you can call directly.

For code that makes extensive use of special math functions on arrays with many thousands of elements, the performance speedup is quite amazing:

import numpy as np

from accelerate.mkl import ufuncs as mkl_ufuncs

 

def spherical_to_cartesian_numpy(r, theta, phi):

    cos_theta = np.cos(theta)

    sin_theta = np.sin(theta)

    cos_phi = np.cos(phi)

    sin_phi = np.sin(phi)

 

    x = r * sin_theta * cos_phi

    y = r * sin_theta * sin_phi

    z = r * cos_theta

 

def spherical_to_cartesian_mkl(r, theta, phi):

    cos_theta = mkl_ufuncs.cos(theta)

    sin_theta = mkl_ufuncs.sin(theta)

    cos_phi = mkl_ufuncs.cos(phi)

    sin_phi = mkl_ufuncs.sin(phi)

        x = r * sin_theta * cos_phi

    y = r * sin_theta * sin_phi

    z = r, cos_theta

        return x, y, z

 n = 100000

r, theta, phi = np.random.uniform(1, 10, n), np.random.uniform(0, np.pi, n), np.random.uniform(-np.pi, np.pi, n)

%timeit spherical_to_cartesian_numpy(r, theta, phi)

%timeit spherical_to_cartesian_mkl(r, theta, phi)

 

    100 loops, best of 3: 7.01 ms per loop

    1000 loops, best of 3: 978 µs per loop

A speedup of 7x is not bad for a 2.3 GHz quad core laptop CPU from 2012. In future releases, we are looking to expand and integrate this functionality further into the Anaconda Platform, so stay tuned!

Summary

For more information about these new features, take a look at the Accelerate manual:

You can install Accelerate with conda and use it free for 30 days:

conda install accelerate

Try it out, and let us know what you think. Academic users can get a free subscription to Anaconda (including several useful tools, like Accelerate) by following these instructions. Contact sales@continuum.io to find out how to get a subscription to Anaconda at your organization.

 

Categories: FLOSS Project Planets

Mediacurrent: Resource Guide: Version Controlled Drupal Development Using Git, Bitbucket &amp; Pantheon

Planet Drupal - Mon, 2016-04-25 10:24

As a veteran web developer of nearly 20 years, one of the more difficult things I ran into when I started with Mediacurrent, a Drupal agency, was working within the constraints of a version control system.

Categories: FLOSS Project Planets

Doug Hellmann: select — Wait for I/O Efficiently — PyMOTW 3

Planet Python - Mon, 2016-04-25 09:00
The select module provides access to platform-specific I/O monitoring functions. The most portable interface is the POSIX function select(), which is available on UNIX and Windows. The module also includes poll(), a UNIX-only API, and several options that only work with specific variants of UNIX. Read more… This post is part of the Python Module … Continue reading select — Wait for I/O Efficiently — PyMOTW 3
Categories: FLOSS Project Planets
Syndicate content