FLOSS Project Planets

gnuzilla @ Savannah: IceCat 38.8.0 release

GNU Planet! - Fri, 2016-06-24 23:54

GNUzilla is the GNU version of the Mozilla suite, and GNU IceCat is the GNU version of the Firefox browser. Its main advantage is an ethical one: it is entirely free software. While the Firefox source code from the Mozilla project is free software, they distribute and recommend non-free software as plug-ins and addons. Also their trademark license restricts distribution in several ways incompatible with freedom 0.
https://www.gnu.org/software/gnuzilla/

The user manual pages are at http://libreplanet.org/wiki/Group:IceCat/
You can contribute by joining the wiki and editing the manuals.

Source tarballs, binaries for generic GNU/Linux systems and translations are available at http://ftp.gnu.org/gnu/gnuzilla/
GPG key ID:D7E04784 GNU IceCat releases
Fingerprint: A573 69A8 BABC 2542 B5A0 368C 3C76 EED7 D7E0 4784
https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=gnuzilla

Changes since v38.7.1
  • LibreJS updated to 6.0.13
  • HTTPS-Everywhere updated to 5.1.6
  • Updated ssl cypher settings
  • Spoof user-agent on Android as Firefox Mobile
Categories: FLOSS Project Planets

Akademy! and fundraising

Planet KDE - Fri, 2016-06-24 19:07
https://qtcon.org/

Akademy is approaching! And I can hardly wait. This spring has been personally difficult, and meeting with friends and colleagues is the perfect way to end the summer. This year will be special because it's in Berlin, and because it is part of Qt.con, with a lot of our freedom-loving friends, such as Qt, VideoLAN, Free Software Foundation Europe and KDAB. As usual, Kubuntu will also be having our annual meetup there.

Events are expensive! KDE needs money to support Akademy the event, support for those who need travel and lodging subsidy, support for other events such as our Randa Meetings, which just successfully ended. We're still raising money to support the sprints:

https://www.kde.org/fundraisers/randameetings2016/

Of course that money supports Akademy too, which is our largest annual meeting.

Ubuntu helps here too! The Ubuntu Community fund sends many of the Kubuntu team, and often funds a shared meal as well. Please support the Ubuntu Community Fund too if you can!

I'm going!

I can't seem to make the image a link, so go to https://qtcon.org/ for more information.
Categories: FLOSS Project Planets

Plasma 5.6 – Clean installation impression

Planet KDE - Fri, 2016-06-24 17:56

Hi,

I was wondering if i should just be silent, since this is a negative post about Plasma. On the other hand we should not be afraid negative critics, learn from them, improve and make a better product. With that in mind, I decided to write this post anyway in hopes that it will ultimately improve the situation where improvements would be nice.

Today i sat down to put some new life in my notebook. Freshly install Arch Linux with Plasma 5 to see how my experience would be. I hadn’t reinstalled it on any system in quite a while so had no real clue how good or bad the experience would be. In fact, the last time i did this was when there where more posts about Plasma’s not so good clean user experience from a couple years ago. Around that time the paper cut project (aimed to improve small but notable annoyances for a better user experience) was launched and lots of issues were fixed in that project.

One disclaimer about my setup. I’m using Arch Linux, this also means that i have to setup much myself so my user experience is undoubtedly quite different then when you install Kubuntu or a Plasma Fedora spin. In fact, i’m betting you won’t even see some of the issues that i’m going to describe when you use those distributions. Also, i’m trying to be constructive here. Pointing at issues, explaining how i worked around them (if i did) and what my suggestion would be to fix them. Don’t read it as if i’m a plasma hater, i’m not.

KWallet
I literally always have issues with KWallet when it’s running. No exceptions. If it’s enabled and not automatically opened using PAM (that means the wallet is unlocked after you logged in thus you basically won’t notice it anymore) then KWallet really comes across as a very annoying application that keeps spamming you. It’s so annoyingly persistent in asking your password every time again and again that you’re tempted to just remove it or give in and use it. I on the other hand never used KWallet and i certainly wasn’t about to start using it now. I was trying to connect to a password protected wifi network and was hitting cancel with every kwallet request. It simply doesn’t allow you to login then. You *must* enter a password to unlock your wifi, but it gives you no clue which password you need to give. And since i had set none, blank or closing the request was my option. None of that worked. It simply refuses to connect. Next thing i tried was disabling KWallet. Yes, that is (still) possible in the system settings. Thankfully. But since KWallet had already popped up once it also apparently had done *something* (and i honestly don’t know what). Since it didn’t help one bit in getting my wifi access to work. KWallet tries to outsmart me. Spoiler: ultimately i win!

I really wanted my wifi connection, but i certainly wasn’t about to give into the relentless persistence of KWallet to get me as a user. No way! I would try patching the NetworkManager applet before giving in. Thankfully i didn’t had to patch it. I logged out of my user, removed all config folders to start with a clean slate again (i didn’t know which file to delete…). Then started plasma and tried getting on my wifi. By this time i was really getting frustrated by kwallet. What i did this time is – instead of closing kwallet immediately – picking the blowfish option, then next and then close it as soon as possible. After that i disabled KWallet in the system settings. I’m happy to say that it finally understood my persistence to not use it. It hasn’t complained since and i can finally use my wifi connection without kwallet spamming me.

I have the following suggestions.

  1. Stop forcing the user into using something if the user clearly indicates he doesn’t want to have it. I would implicitly disable kwallet if the user cancels it’s first window where you have to choose an encryption method.
  2. Also, just add a third method in the first KWallet dialog: “I don’t want to use KWallet”, Upon clicking that, just disable kwallet and let the user do it’s thing.
  3. If you choose an encryption method (not blowfish, but the other option) then you must tell the user how to setup a key! Right now it only tells you that no key has been set and you need to install one, but it gives you 0 hints on how to do that. That is very user unfriendly and very counter intuitive. This will also frustrate your user greatly. Another point i like to make here is that this has been a publicly known issue for years! Why has nobody looked at this yet?

Note: i will remove any comments that start whining about “but then you’re passwords are in plaintext”.. I know, i accept it. I’m the only user on this computer and don’t care.

NetworkManager (applet)
Overall this works like a charm. It looks ok and is mostly intuitive. However, while i had the kwallet issue i found an issue here as well. If you have typed in your wifi credentials and you get kwallet blocking you from actually getting a connection then your wifi connection disappears from the list! I was scrolling through it a dozen times thinking: “where is it… where…”. After a couple minuted i opened the “Configure network connections” on the network manager which lists the connections that you have configured. There it was, found it! Deleting it from there made it forget the configuration and it appeared in the applet popup again. This is probably just a minor bug, a corner case.. But a quite annoying one when you encounter it.

Another issue i found with the applet once i had a wifi connection that it keeps trying to make a wired connection as well. Even if you have a working wifi connection and not having any wired connection plugged in. Mind you, just for clarity. No wired connection was plugged in or out. The port was left alone with nothing in it! The surprising thing here is that NetworkManager really tries to make a wired connection for about 10 minutes or so before finally giving up. I have no clue why it does this and during that time you keep being spammed with popups notifying you that wifi is active and wired isn’t…. My solution for this was to just disable wired for the moment… Not a real solution but fixed the notification spam.

Inverse mouse scrolling
If i use a notebook it’s often a macbook air. However, this new install is done on a couple years old samsung notebook. I immediately noticed the scroll direction was “reversed” compared to mac which i started to get used to. So i wanted to have the setting like it is on mac. That’s fine and possible in Plasma. Just tick the “reverse scroll direction” in your mouse settings (in the system settings under “Input Devices”). That did the trick, but not completely. It only seems to be applied for the Qt applications! Yay, we have a good old setting per UI Toolkit again… But that’s wrong., we have libinput now and we can set “natural sorting” there. Why isn’t the settings page doing that under the hood if libinput is being used? Anyway, the fix here (comes from this link) was to do:

xinput set-prop 11 282 1

You probably have to set something else specific to your hardware, so be sure to look at the link above. That fixes inverse scrolling for me which now works across GTK and Qt apps. Great, another problem solved.

Mount points not appearing in Dolphin
This one is weird.. I know it’s working on my desktop. When i mount anything in the /mnt folder, it shows up in dolphin. I added an entry in my fstab file to an ftp location. That is being automounted by systemd, but the folder exists (as an empty one) in /mnt. That should make it appear in the devices section of dolphin, but somehow it doesn’t. I have no clue what might be wrong on my notebook, in my settings or perhaps in the Plasma side. I also tried /media and putting it there, but no joy either. I can access the mount just fine when i go to the folder so i doubt it’s a permission issue. This issue needs further investigation.

PulseAudio and Plasma’s device manager
This one i just don’t understand why it exists in Plasma these days. Plasma has a device manager for sound. Fine, that was useful when there was no alternative in the plain alsa days. But we live in different times now. PulseAudio is doing a much better job at it. An example is a USB headset.
** assumption, in both cases the PulseAudio module “module-switch-on-connect” is loaded, which it isn’t by default **
Under Unity, this happens when you play your favorite song with pulseaudio managing your audio. Your audio will be redirected to the headphone you just plugged in. That’s in my opinion how it should work and is intuitive.
Under Plasma this doesn’t happen. Under plasma a “special” rule kicks in for loading PulseAudio (literally an if statement in the PulseAudio startup script). It loads the Plasma specific module (which is existing for years, perhaps even a decade, now) “module-device-manager”, that one basically disables/breaks “module-switch-on-connect” if it was loaded and lets Plasma handle new connections. In my opinion this is a remnant of past Plasma code and should either be removed or reworked to work with the current “module-switch-on-connect”. I requested this Plasma specific module to be kicked out of the PulseAudio startup script and also requested the current Plasma to share his opinion on why that Plasma specific module is still required. Well, he is apparently of the opinion that the module should stay. I really wonder what would be better. Good working hot switching of audio output devices (the module-switch-on-connect from PulseAudio) or the -what-i-think-is-rarely-used- fine grained control of Plasma’s “module-switch-on-connect” which doesn’t do automatic switching. I think the later argument is used by very few people and the first argument is what users probably expect when they plugin a usb headset. It’s what they get on Unity. The user friendly way would be to go for “module-switch-on-connect”.

Konsole (font)
This is obviously a “user preference”, but i think the default is wrong here. By default the konsole font is set at (Oxygen) Mono. It’s a monospce font, that’s fine. But it just doesn’t look good or sharp. You either have to increase the font 1 or 2 pixels in size to make it look better or you’d have to pick a different font. In the konsole case i’m a big fan of the “Fixed [Misc]” font. There is no hinting in that font. It’s a fixed (bitmap?) font with very sharp characters. It reads very pleasantly and should be the default. Other fonts are also looking much better then the Oxygen Mono font, so if you don’t like Fixed fonts then perhaps the Noto Mono font works better. It certainly looks better then Oxygen Mono. In all fairness, i guess this is a bug on the Konsole side. The Noto font is (much to my disliking) the font that Plasma forces upon you when installing and changed much defaults to Noto, i guess they forgot Konsole. You can freely remove Noto after installing plasma, but updates will pull it in again. The font is OK, but you should not pull in the “Arial, Courier New, and Times New Roman” versions of the Noto fonts, they are meant as “drop in replacements” for those styles, but instead severely break font rendering. The regular Noto fonts are fine though.

 

These are the most prominent and user noticeable issues i have seen when running plasma freshly. In conclusion, Plasma is in a much better shape then it used to be a couple years ago. The developers have done an outstanding job at making it good by default and powerful when needed. The issues compared to a couple of years ago are minor. Keep up the great work :)

Mark

Categories: FLOSS Project Planets

FSF Blogs: Tell Europe's regulators: Net neutrality isn't just for the US and India!

GNU Planet! - Fri, 2016-06-24 17:11

Free software activists and allies are fighting for net neutrality rules country by country, and we've had important victories in the US and India during the last year and a half.

Now Europeans are fighting for the same rights. The Body of European Regulators of Electronic Communications (BEREC) has followed the US and India by releasing draft net neutrality protections that would cover all countries in the EU. But they've left huge holes allowing some instances of neutrality-violating known as zero-rating (allowing access to certain sites or applications without affecting a customer's allotted data usage) and traffic throttling (intentionally slowing Internet service). Thankfully, we have a chance to fix this: BEREC has asked the public, along with industry leaders and entrepreneurs, to give feedback on its draft rules.

BEREC accepts comments from everyone, not just Europeans. Even if you don't live in Europe, it's important for the global free software community to take action in solidarity with Europeans; winning net neutrality there will set an important precedent.

Wherever you live, submit a comment now, demanding strong Net Neutrality protections for Europe. You can use the submission form created by our allies at savenetneutrality.eu. The form does not depend on proprietary JavaScript to work, but if you'd prefer to use email, you can send your comment to NN-Consultation@berec.europa.eu instead.

Do you administer a Web site or keep a blog? If so, we encourage you to join savenetneutrality.eu's symbolic "slowdown" by adding a loading icon that simulates an Internet slow lane in a future without net neutrality.*

Net neutrality is important to maintain free speech and a healthy economy on the Internet. But it's also crucial for free software's continued growth and success. Here's why:

Media distribution giants that use Digital Restrictions Management (DRM) and proprietary software to control what's on your computer have also been fighting to control the network. Without net neutrality, DRM-laden materials could be easier to access, while DRM-free competitors could be stuck in the slow lane. Web-based free software projects like GNU MediaGoblin could also suffer the slow treatment while competitors like YouTube shell out big bucks for speedier service. The bottom line -- an Internet where the most powerful interests can pay for speed advantages could push free software projects off the map and make it harder for decentralized projects to flourish. That's not good for free software, and it's not good for other innovative voices for change in the digital world.

Tell BEREC now: Europe needs real net neutrality.

* We recommend the animated gif version at the bottom of the page. As of the time of writing, the JavaScript version is freely licensed, but it does not work with LibreJS, so it is less friendly to those committed to preserving their freedom and security online. Don't know what we're talking about? Learn more about our Free JavaScript campaign and the LibreJS browser extension.

Categories: FLOSS Project Planets

Tell Europe's regulators: Net neutrality isn't just for the US and India!

FSF Blogs - Fri, 2016-06-24 17:11

Free software activists and allies are fighting for net neutrality rules country by country, and we've had important victories in the US and India during the last year and a half.

Now Europeans are fighting for the same rights. The Body of European Regulators of Electronic Communications (BEREC) has followed the US and India by releasing draft net neutrality protections that would cover all countries in the EU. But they've left huge holes allowing some instances of neutrality-violating known as zero-rating (allowing access to certain sites or applications without affecting a customer's allotted data usage) and traffic throttling (intentionally slowing Internet service). Thankfully, we have a chance to fix this: BEREC has asked the public, along with industry leaders and entrepreneurs, to give feedback on its draft rules.

BEREC accepts comments from everyone, not just Europeans. Even if you don't live in Europe, it's important for the global free software community to take action in solidarity with Europeans; winning net neutrality there will set an important precedent.

Wherever you live, submit a comment now, demanding strong Net Neutrality protections for Europe. You can use the submission form created by our allies at savenetneutrality.eu. The form does not depend on proprietary JavaScript to work, but if you'd prefer to use email, you can send your comment to NN-Consultation@berec.europa.eu instead.

Do you administer a Web site or keep a blog? If so, we encourage you to join savenetneutrality.eu's symbolic "slowdown" by adding a loading icon that simulates an Internet slow lane in a future without net neutrality.*

Net neutrality is important to maintain free speech and a healthy economy on the Internet. But it's also crucial for free software's continued growth and success. Here's why:

Media distribution giants that use Digital Restrictions Management (DRM) and proprietary software to control what's on your computer have also been fighting to control the network. Without net neutrality, DRM-laden materials could be easier to access, while DRM-free competitors could be stuck in the slow lane. Web-based free software projects like GNU MediaGoblin could also suffer the slow treatment while competitors like YouTube shell out big bucks for speedier service. The bottom line -- an Internet where the most powerful interests can pay for speed advantages could push free software projects off the map and make it harder for decentralized projects to flourish. That's not good for free software, and it's not good for other innovative voices for change in the digital world.

Tell BEREC now: Europe needs real net neutrality.

* We recommend the animated gif version at the bottom of the page. As of the time of writing, the JavaScript version is freely licensed, but it does not work with LibreJS, so it is less friendly to those committed to preserving their freedom and security online. Don't know what we're talking about? Learn more about our Free JavaScript campaign and the LibreJS browser extension.

Categories: FLOSS Project Planets

Remote searching [KRunner/Blade]

Planet KDE - Fri, 2016-06-24 15:26

Just a screen-shot this time.

The setup goes as follows:

  • GUI (in the screenshot) runs on my main computer
  • The runner that searches for applications with few less important ones is in a separate process on the same system
  • Baloo runner is on another computer (since I have Baloo running only on that system)
  • And the Recoll runner runs on yet another separate system

The result is in the screenshot:

Remote search

I have a lot of issues to tackle, and to make it all usable by normal people, but I had to share this milestone since it is quite cool. :)

p.s. Mind that the Recoll runner is even able to return the section of the file where the search item appears

p.p.s. Don’t mind the ugly UI, it is just for the testing purposes.


Read more...
Categories: FLOSS Project Planets

Control F'd: In fact you could've just used curl

Planet Python - Fri, 2016-06-24 14:21

I wanted to get some text data from the discussion forums on Project Euler about the problems I had solved (context: Once you solve a problem on Project Euler, you get access to a discussion forum where people share how they solved the problem. I wanted to see what other people had done on the same problems).

Categories: FLOSS Project Planets

Paul Wise: DebCamp16 day 1

Planet Debian - Fri, 2016-06-24 13:46

Hating jetlag based headache. Disturbed to see the Brexit result. Review wiki RecentChanges. Answer some questions about Launchpad on #debian-mentors. Whitelisted one user in the wiki anti-spam system. Reviewed and sponsored yamllint 1.2.2-1 upload. Noted OFSET repo is broken and updated Freeduc info. Noted the Epidemic-Linux website is having database issues. Noted that Facebook finally completely dropped their RSS feeds, dropped Facebook RSS feed URL generation from the Debian derivatives census scripts and notified the affected derivatives. Cleared up Tanglu hash sum mismatches again. Minor changes to Planet Debian derivatives. Enjoyed the photos from Valessio. Hazy city away from the mountain and tablecloth clouds flowing over the mountain on the way to a pub lunch. Jet lag headaches seem to be subsiding thankfully. Ping someone generating a bounce when changing their SSH key. Mention autorevision and other suggestions in an IRC discussion about mesa & reproducible builds. Review some DebConf16 announcements and add minor fix. Push out some TODO items to check-all-the-things. Ask for a dd-list for the GCC 6 transition. Usual spam reporting throughout the day via manual List-Archive copy-paste, feeding mboxen to my report-spam-debian-lists and report-spam-debian-bugs scripts and manual BTS clicks. Usual wondering why there isn't an RFC for MUA spam reporting. Disturbed by the sudden appearance of an astronautess in the orga room but placated by a plentiful supply of crisps. Ask x32 folks about debian-x32.org vs x32 on ports.d.o. Glad to just avoid the room shuffle dance. Finish mime support for check-all-the-things. Disappointed that piz.za does not actually resolve. Amused by pollito's virtual tour of UTC. Completely stuffed full of Butleritos.

Categories: FLOSS Project Planets

Mike Driscoll: Book Review: Python Projects for Kids

Planet Python - Fri, 2016-06-24 13:30

I get asked by publishers to review books from time to time. Last month, Packt asked me if I’d be willing to review for their book, Python Projects for Kids by Jessica Ingrassellino. Frankly I tend to avoid beginning Python books now because they tend to be very similar, but I thought this one might be interesting.

Quick Review
  • Why I picked it up: In this case, because Packt Publishing asked me to
  • Why I finished it: Mostly because Packt personnel badgered me to do so
  • I’d give it to: Not really sure. There are much better, more in-depth beginner books for Python out there
  • Book Formats

    You can get an eBook (PDF, EPUB or MOBI) version or a softcover.

    Book Contents

    This book only has 10 chapters and is 193 pages long.

    Full Review

    First off, I didn’t actually read every single word in this book. I call this the skimming review method. Personally I prefer to read a book at my own pace and review it accordingly, however I have been asked repeatedly to finish this review so this is what you get. My first impression was that this book would teach youngsters how to program in Python by creating mini-games. However we don’t really get into games until chapter 5. We don’t learn anything about pygame until chapter 8. Let’s go over each chapter and see what they’re about before I really dig in though

    Chapter one is your basic intro to what Python is and how to install it. The author chose to use Python 2.7 for this book over Python 3. The rest of the chapter is about creating a “Hello World” application and a work folder.

    Chapter two is about variables and functions. This chapter is pretty brief, but I thought it covered the topics well enough. The biggest thing it does is explaining to the reader how to create a function and save it to a file.

    For chapter three, we actually get to create a calculator of sorts. It’s text-based only and doesn’t really do anything to handle bad inputs from the user. In fact, one big knock against this book is that it doesn’t talk about exception handling at all. I also have a couple of problems with this chapter. I believe that page 34 is showing the wrong screenshot as the accompanying text is talking about casting from one type to another while the screenshot doesn’t show any kind of casting whatsoever. The other issue is that on page 41, the text states that you can run the script as written in the book. However I don’t see anything in the code that actually calls any of the functions, so if you run this code, you will get nothing outputted to the terminal.

    Chapter four is all about conditional statements and loops. The purpose of this chapter is to enhance the calculator application you wrote in the previous chapter such that it keeps running until the user asks it to quit.

    In chapter five, we learn how to create easy and hard levels for our game. The game is the “Higher or Lower” game. You will learn about what a Boolean is, how to import a library, and global variables.

    Chapter six dives into some of Python’s more interesting data types, the list and dictionary. The premise of this chapter is to teach the reader how to store data. While I agree that lists and dictionaries are a good format, I wonder if learning about pickle, json or yaml might have been good to learn about here too. Admittedly, I don’t think this book talks about File I/O, so those topics are probably considered to be out of scope.

    For chapter seven, the reader learns how to create a two player game that the author dubs “What’s in Your Backpack?” This chapter helps the reader layout a game that can keep score, restart the game or stop the game. You will also learn how to create a player profile, which is formatted as a dict. This seems like a good place to use a class to me, especially if we’re going to be using pygame in the next chapter, but I realize the target audience is supposed to be kids. Anyway, you will also get to add items to a virtual backpack, which is kind of fun to learn the author’s implementation.

    We finally reach pygame in chapter eight where you learn how to install pygame. You will also learn how to set up the screen size and color as well as create stationary and moving objects.

    Chapter nine builds on chapter eight by teaching the reader how to create a tennis game (i.e. pong). It introduces the reader to the concepts of game programming and how to outline your project before coding it. This chapter is actually split into four sections after this point. The first section basically creates all the pieces of the game that you will need. Section two will teach you how to move the paddles and section three will teach you how to move the ball. Section four is about how to run the game and keep score.

    The final chapter encourages the readers to keep coding! The text tells its readers where to go from here. For example, it talks about how they will need to learn about classes and objects to promote code reuse. It also mentions that you can add music and graphics with pygame. Then it talks about redesigning your game or trying to create your own versions of classic games. Finally it talks about other uses and libraries for Python, such as SciPy, iPython, and MatPlotLib.

    When I first heard about this book, I immediately thought of Jason Briggs’ book, Python for Kids and the Sande’s book, Hello World!: Computer Programming for Kids and Other Beginners. Both of these books are longer and contain a lot more information than “Python Projects for Kids” does. I personally think that of the three, I would choose the Sande book as the easiest for kids to get into. Briggs covers a lot more interesting topics, but he may go just a tad too fast depending on the child. As for “Python Projects for Kids”, I feel like there are too many items that aren’t covered (classes, exceptions, many Python data constructs, etc). It also feels like pygame itself isn’t really covered. There seemed to be a big build up to get to pygame and then there just wasn’t much content when we finally got there.

    If I were to lay out a strategy for learning Python for children, I would start with Sande and then if the child wanted to learn about games, I would move on to Sweigart’s books on creating games with Python (Invent Your Own Computer Games with Python and Making Games with Python & Pygame. Then I might move onto something else, like some of the Python for Minecraft books.

    As for this book, I just don’t know where it would fit. I believe it was written well but needed some additional polish to push to the top of the heap.

    Python Projects for Kids

    by Jessica Ingrassellino

    Amazon

    Other Book Reviews
    Categories: FLOSS Project Planets

    Zivtech: 8 Common Website Design Problems

    Planet Drupal - Fri, 2016-06-24 12:44
    Your time is limited. By the time you finish this sentence, someone will visit and abandon your website. Unless you give your visitors a reason to stick around, they're gone. High bounce rate is an indicator of visitors' lack of interest.

    It may be absolutely fine for a user to check out one page, especially if it's a press release or another event driven piece of content. But if your goal is to build a relationship with your visitors, one and done won't cut it.
    Here are some of the most common problems in website design:
    1. There's no clear path. You want to extend a warm welcome to your visitors. Give them an easy way in and through. Too much competition for attention is a turn off. When you provide too many options, the functional result is no options.
    2. Outdated design. Your site was state of the art in 2009. It's got a header, a couple of sidebars, and a big chunk of information running down the center. Guess what? It looks like it's nearly a decade old. Because it is. Time to refresh with current design thinking. The layout of a page has evolved over the past decade. These days the best sites break up content into smaller, digestible bits.
    3. Overused stock images and icons. If visitors see the same image on multiple sites, it erodes trust. That picture of people sitting around the conference table? They sure get around to a lot of offices!
    4. Too many textures and colors. You are trying to add interest, but you just add clutter. Limit colors and fonts. Maintain a thematic color scheme. For professional sites, try to limit the variety of fonts to three or fewer.
    5. Design for the wrong reasons. Always begin by identifying your target audience and customizing design and content. You may want your site to look "modern" or like another site you've seen, but if you haven't checked in with what your audience needs and wants, you can fail miserably.
    6. Cute that doesn't cut it. When your links have adorable, witty names, the experience gets tired fast. Links that don't make much sense are not user friendly and won't ingratiate you with your visitors. Be practical and basic when naming links. Make it easy for people. Design for multiple visits. A rotating banner is cool the first time, and maybe the second, but at some point it's just a stale eyesore. Monotonous calls to action.
    7. Your site isn't optimized for mobile. You shouldn't need to be reminded of this, but numbers don't lie. Mobile is overtaking desktop. It's increasingly likely that your visitors see your site on a tiny screen. If they have to pinch and stretch to read, they'll find a better source of information. Be sure to test your site on smartphone and tablet.
    8. You play hard to get. If you want customers to find you, make sure your address, phone number and hours of operation are easily accessible on your site. Too often, that information is hidden or completely absent.
    Thanks to Zivtech's UX/UI Designer Jen Rovner for co-writing this article.
    Categories: FLOSS Project Planets

    The Sego Blog: Drupal 8, Pantheon & GitKraken: Intro

    Planet Drupal - Fri, 2016-06-24 12:24
    06/24/2016Drupal 8, Pantheon & GitKraken: Intro

    For those of you who know me well, you know I do not like to play around with code all that much or even use command line tools if I can avoid it. There are many reasons for this but mostly I am just not that comfortable setting up, maintaining and using these type of tools.  That being said I do like to site build in Drupal….A LOT :). 

    Lately I have been creating and managing Drupal 8 sites with Pantheon and using a Git client called GitKraken to manage my version control workflow and I have to say the experience has been FANTASTIC!

    Categories: FLOSS Project Planets

    Evolving Web: Using Core Base Themes in Drupal 8

    Planet Drupal - Fri, 2016-06-24 11:07

    One of the first questions I get asked when teaching a Drupal theming class is which base theme to use. The answer has always starts with the unsatisfying: "It depends". Now that I'm teaching Drupal 8 theming, we have a couple new base themes in core added to the mix: classy and stable.

    You can learn the difference between the two and how to use them in this previous post.

    read more
    Categories: FLOSS Project Planets

    Mediacurrent: Friday 5: 5 Problems Large Enterprise Face in Their Digital Transformation

    Planet Drupal - Fri, 2016-06-24 11:06

    Give yourself a pat on the back for making it to the finish line of another busy work week!

    Categories: FLOSS Project Planets

    Lullabot: Replacing the Body Field in Drupal 8

    Planet Drupal - Fri, 2016-06-24 10:00

    The body field has been around since the beginning of Drupal time. Before you could create custom fields in core, and before custom entities were in core, there was a body field. As it exists now, the body field is a bit of a platypus. It's not exactly a text field like any other text field. It's two text fields in one (summary and body), with a lot of specialized behavior to allow you to show or hide it on the node form, and options to either create distinct summary text or deduce a summary by clipping off a certain number of characters from the beginning of the body.

    The oddity of this field can create problems. The summary has no format of its own, it shares a format with the body. So you can't have a simple format for the summary and a more complex one for the body. The link to expose and hide the summary on the edit form is a little non-intuitive, especially since no other field behaves this way, so it's easy to miss the fact that there is a summary field there at all. If you are relying on the truncated text for the summary, there's no easy way to see in the node form what the summary will end up looking like. You have to preview the node to tell.

    I wanted to move away from using the legacy body field in favor of separate body and summary fields that behave in a more normal way, where each is a distinct field, with its own format and no unexpected behavior. I like the benefits of having two fields, with the additional granularity that provides. This article describes how I made this switch on one of my legacy sites.

    Making the Switch

    The first step was to add the new fields to the content types where they will be used. I just did this in the UI by going to admin > structure > types. I created two fields, one called field_description for the full body text and one called field_summary for the summary. My plan was for the summary field to be a truncated, plain text excerpt of the body that I could use in metatags and in AMP metadata, as well as on teasers. I updated the Manage Display and Manage Form Display data on each content type to display my new fields instead of the old body field on the node form and in all my view modes.

    Once the new fields were created I wanted to get my old body/summary data copied over to my new fields. To do this I needed an update hook. I used Drupal.org as a guide for creating an update hook in Drupal 8.

    The instructions for update hooks recommend not using normal hooks, like $node->save(), inside update hooks, and instead updating the database directly with a SQL query. But that would require understanding all the tables that need to be updated. This is much more complicated in Drupal 8 than it was in Drupal 7. In Drupal 7 each field has exactly two tables, one for the active values of the field and one with revision values. In Drupal 8 there are numerous tables that might be used, depending on whether you are using revisions and/or translations. There could be up to four tables that need to be updated for each individual field that is altered. On top of that, if I had two fields in Drupal 7 that had the same name, they were always stored in the same tables, but in Drupal 8 if I have two fields with the same name they might be in different tables, with each field stored in up to four tables for each type of entity the field exists on.

    To avoid any chance of missing or misunderstanding which tables to update, I went ahead and used the $node->save() method in the update hook to ensure every table gets the right changes. That method is time-consuming and could easily time out for mass updates, so it was critical to run the updates in small batches. I then tested it to be sure the batches were small enough not to create a problem when the update ran.

    The update hook ended up looking like this:

    <?php /** * Update new summary and description fields from body values. */ function custom_update_8001(&$sandbox) { // The content types to update. $bundles = ['article', 'news', 'book']; // The new field for the summary. Must already exist on these content types. $summary_field = 'field_summary'; // The new field for the body. Must already exist on these content types. $body_field = 'field_description'; // The number of nodes to update at once. $range = 5; if (!isset($sandbox['progress'])) { // This must be the first run. Initialize the sandbox. $sandbox['progress'] = 0; $sandbox['current_pk'] = 0; $sandbox['max'] = Database::getConnection()->query("SELECT COUNT(nid) FROM {node} WHERE type IN (:bundles[])", array(':bundles[]' => $bundles))->fetchField(); } // Update in chunks of $range. $storage = Drupal::entityManager()->getStorage('node'); $records = Database::getConnection()->select('node', 'n') ->fields('n', array('nid')) ->condition('type', $bundles, 'IN') ->condition('nid', $sandbox['current_pk'], '>') ->range(0, $range) ->orderBy('nid', 'ASC') ->execute(); foreach ($records as $record) { $node = $storage->load($record->nid); // Get the body values if there is now a body field. if (isset($node->body)) { $body = $node->get('body')->value; $summary = $node->get('body')->summary; $format = $node->get('body')->format; // Copy the values to the new fields, being careful not to wipe out other values that might be there. if (empty($node->{$summary_field}->getValue()) && !empty($summary)) { $node->{$summary_field}->setValue(['value' => $summary, 'format' => $format]); } if (empty($node->{$body_field}->getValue()) && !empty($body)) { $node->{$body_field}->setValue(['value' => $body, 'format' => $format]); } if ($updated) { // Clear the body values. $node->body->setValue([]); } } // Force a node save even if there are no changes to force the pre_save hook to be executed. $node->save(); $sandbox['progress']++; $sandbox['current_pk'] = $record->nid; } $sandbox['#finished'] = empty($sandbox['max']) ? 1 : ($sandbox['progress'] / $sandbox['max']); return t('All content of the types: @bundles were updated with the new description and summary fields.', array('@bundles' => implode(', ', $bundles))); } ?> Creating the Summary

    That update would copy the existing body data to the new fields, but many of the new summary fields would be empty. As distinct fields, they won't automatically pick up content from the body field, and will just not display at all. The update needs something more to get the summary fields populated. What I wanted was to end up with something that would work similarly to the old body field. If the summary is empty I want to populate it with a value derived from the body field. But when doing that I also want to truncate it to a reasonable length for a summary, and in my case I also wanted to be sure that I ended up with plain text, not markup, in that field.

    I created a helper function in a custom module that would take text, like that which might be in the body field, and alter it appropriately to create the summaries I want. I have a lot of nodes with html data tables, and I needed to remove those tables before truncating the content to create a summary. My body fields also have a number of filters that need to do their replacements before I try creating a summary. I ended up with the following processing, which I put in a custom.module file:

    <?php use Drupal\Component\Render\PlainTextOutput; /** * Clean up and trim text or markup to create a plain text summary of $limit size. * * @param string $value * The text to use to create the summary. * @param string $limit * The maximum characters for the summary, zero means unlimited. * @param string $input_format * The format to use on filtered text to restore filter values before creating a summary. * @param string $output_format * The format to use for the resulting summary. * @param boolean $add_elipsis * Whether or not to add an elipsis to the summary. */ function custom_parse_summary($value, $limit = 150, $input_format = 'plain_text', $output_format = 'plain_text', $add_elipsis = TRUE) { // Allow filters to replace values so we have all the original markup. $value = check_markup($value, $input_format); // Completely strip tables out of summaries, they won't truncate well. // Stripping markup, done next, would leave the table contents, which may create odd results, so remove the tables entirely. $value = preg_replace('/(.*?)<\/table>/si', '', $value); // Strip out all markup. $value = PlainTextOutput::renderFromHtml(htmlspecialchars_decode($value)); // Strip out carriage returns and extra spaces to pack as much info as possible into the allotted space. $value = str_replace("\n", "", $value); $value = preg_replace('/\s+/', ' ', $value); $value = trim($value); // Trim the text to the $limit length. if (!empty($limit)) { $value = text_summary($value, $output_format, $limit); } // Add elipsis. if ($add_elipsis && !empty($value)) { $value .= '...'; } return $value; } ?> Adding a Presave Hook

    I could have used this helper function in my update hook to populate my summary fields, but I realized that I actually want automatic population of the summaries to be the default behavior. I don't want to have to copy, paste, and truncate content from the body to populate the summary field every time I edit a node, I'd like to just leave the summary field blank if I want a truncated version of the body in that field, and have it updated automatically when I save it.

    To do that I used the pre_save hook. The pre_save hook will update the summary field whenever I save the node, and it will also update the summary field when the above update hook does $node->save(), making sure that my legacy summaries also get this treatment.

    My pre_save hook, in the same custom.module file used above, ended up looking like the following:

    <?php use Drupal\Core\Entity\EntityInterface; /** * Implements hook_entity_presave(). * * Make sure summary and image are populated. */ function custom_entity_presave(EntityInterface $entity) { $entity_type = 'node'; $bundles = ['article', 'news', 'book']; // The new field for the summary. Must already exist on these content types. $summary_field = 'field_summary'; // The new field for the body. Must already exist on these content types. $body_field = 'field_description'; // The maximum length of any summary, set to zero for no limit. $summary_length = 300; // Everything is an entity in Drupal 8, and this hook is executed on all of them! // Make sure this only operates on nodes of a particular type. if ($entity->getEntityTypeId() != $entity_type || !in_array($entity->bundle(), $bundles)) { return; } // If we have a summary, run it through custom_parse_summary() to clean it up. $format = $entity->get($summary_field)->format; $summary = $entity->get($summary_field)->value; if (!empty($summary)) { $summary = custom_parse_summary($summary, $summary_length, $format, 'plain_text'); $entity->{$summary_field}->setValue(['value' => $summary, 'format' => 'plain_text']); } // The summary might be empty or could have been emptied by the cleanup in the previous step. If so, we need to pull it from description. $format = $entity->get($body_field)->format; $description = $entity->get($body_field)->value; if (empty($summary) && !empty($description)) { $summary = custom_parse_summary($description, $summary_length, $format, 'plain_text'); $entity->{$summary_field}->setValue(['value' => $summary, 'format' => 'plain_text']); } } ?>

    With this final bit of code I’m ready to actually run my update. Now whenever a node is saved, including when I run the update to move all my legacy body data to the new fields, empty summary fields will automatically be populated with a plain text, trimmed, excerpt from the full text.

    Going forward, when I edit a node, I can either type in a custom summary, or leave the summary field empty if I want to automatically extract its value from the body. The next time I edit the node the summary will already be populated from the previous save. I can leave that value, or alter it manually, and it won't be overridden by the pre_save process on the next save. Or I can wipe the field out if I want it populated automatically again when the node is re-saved.

    Javascript or Presave?

    Instead of a pre_save hook I could have used javascript to automatically update the summary field in the node form as the node is being edited. I would only want that behavior if I'm not adding a custom summary, so the javascript would have to be smart enough to leave the summary field alone if I already have text in it or if I start typing in it, while still picking up every change I make in the description field if I don’t. And it would be difficult to use javascript to do filter replacements on the description text or have it strip html as I'm updating the body. Thinking through all the implications of trying to make a javascript solution work, I preferred the idea of doing this as a pre_save hook.

    If I was using javascript to update my summaries, the javascript changes wouldn't be triggered by my update hook, and the update hook code above would have to be altered to do the summary clean up as well.

    Ta-dah

    And that's it. I ran the update hook and then the final step was to remove my now-empty body field from the content types that I switched, which I did using the UI on the Content Types management page.

    My site now has all its nodes updated to use my new fields, and summaries are getting updated automatically when I save nodes. And as a bonus this was a good exercise in seeing how to manipulate nodes and how to write update and pre_save hooks in Drupal 8.

    Categories: FLOSS Project Planets

    Joey Hess: twenty years of free software -- part 5 pristine-tar

    Planet Debian - Fri, 2016-06-24 09:38

    I've written retrospectively about pristine-tar before, when I stopped maintaining it. So, I'll quote part of that here:

    [...] a little bit about the reason I wrote pristine-tar in the first place. There were two reasons: 1. I was once in a talk where someone mentioned that Ubuntu had/was developing something that involved regenerating orig tarballs from version control. I asked the obvious question: How could that possibly be done technically? The (slightly hung over) presenter did not have a satesfactory response, so my curiosity was piqued to find a way to do it. (I later heard that Ubuntu has been using pristine-tar..) 2. Sometimes code can be subversive. It can change people's perspective on a topic, nudging discourse in a different direction. It can even point out absurdities in the way things are done. I may or may not have accomplished the subversive part of my goals with pristine-tar. Code can also escape its original intention. Many current uses of pristine-tar fall into that category. So it seems likely that some people will want it to continue to work even if it's met the two goals above already.

    For me, the best part of building pristine-tar was finding an answer to the question "How could that possibly be done technically?" It was also pretty cool to be able to use every tarball in Debian as the test suite for pristine-tar.

    I'm afraid I kind of left Debian in the lurch when I stopped maintaining pristine-tar.

    "Debian has probably hundreds, if not thousands of git repositories using pristine-tar. We all rely now on an unmaintained, orphaned, and buggy piece of software." -- Norbert Preining

    So I was relieved when it finally got a new maintainer just recently.

    Still, I don't expect I'll ever use pristine-tar again. It's the only software I've built in the past ten years that I can say that about.

    Next: ?twenty years of free software -- part 6 moreutils

    Categories: FLOSS Project Planets

    ownCloud Client 2.2.x

    Planet KDE - Fri, 2016-06-24 09:06

    A couple of weeks ago we released another significant milestone of the ownCloud Client, called version 2.2.0, followed by two small maintenance releases. (download). I’d like to highlight some of the new features and the changes that we have made to improve the user experience:

    Overlay Icons

    Overlay icons for the various file managers on our three platforms already exist for quite some time, but it has turned out that the performance was not up to the mark for big sync folders. The reason was mainly that too much communication between the file manager plugin and the client was happening. Once asked about the sync state of a single file, the client had to jump through quite some hoops in order to retrieve the required information. That involved not only database access to the sqlite-based sync journal, but also file system interaction to gather file information. Not a big deal if it’s only a few, but if the user syncs huge amounts, these efforts do sum up.

    This becomes especially tricky for the propagation of changes upwards the file tree. Imagine there is a sync error happening in the foo/bar/baz/myfile. What should happen is that a warning icon appears on the icon for foo in the file manager, telling that within this directory, a problem exists. The complexity of the existing implementation was already high and adding this extra functionality would have reduced the reliability of the code lower than it already was.

    Jocelyn was keen enough to do a refactoring of the underlying code which we call the SocketApi. Starting from the basic assumption that all files are in sync, and the code has just to care for these files that are new or changed, erroneous or ignored or similar, the amount of data to keep is very much reduced, which makes processing way faster.

    Server Notifications

    On the ownCloud server, there are situation where notifications are created which make the user aware of things that happened.

    An example are federated shares:

    If somebody shares a folder with you, you previously had to acknowledge it through the web interface. This explicit step is a safety net to avoid people sharing tons of Gigabytes of content, filling up your disk.

    With 2.2.x, you can acknowledge the share right from the client, saving you the round trip to the web interface to check for new shares.

    Keeping an Eye on Word & Friends

    Microsoft Word and other office tools are rather hard to deal with in syncing, because they do very strict file locking of the files that are worked on. So strict that the subsequent sync app is not even allowed to open the file, not even for reading. That would be required to be able to sync the file.

    As a result the sync client needs to wait until word unlocks the file, and then continue syncing.

    For previous version of the client, this was hard to detect and worked only if other changes happened in the same directory where the file in question resides.

    With 2.2.0 we added a special watcher that keeps an eye on the office docs Word and friends are blocking. And once the files are unlocked, the watcher starts a sync run to get the files to the server, or down from the server.

    Advances on Desktop Sharing

    The sharing has been further integrated and received several UX- and bugfixes. There is more feedback when performing actions so you know when your client is waiting for a response from the server. The client now also respect more data returned from the server if you have apps enabled on the server that for example
    limit the expiration date.

    Further more we better respect the share permissions granted. This means that if
    somebody shared a folder without create permissions with you and you want to reshare
    this folder in the client you won’t get the option to share with delete permissions. This avoids errors when sharing and is more in line with how the whole ownCloud platform handles re-sharing. We also adjusted the behavior for federated reshares with the server.

    Please note to take full advantage of all improvements you will need to run at least
    server version 9.0.

    Have fun!


    Categories: FLOSS Project Planets

    Diego Garcia: A armadilha do groupby do Python

    Planet Python - Fri, 2016-06-24 09:00

    O itertools é um módulo fantástico da bibliotéca padrão do python, para trabalhar com iteradores e estruturas complexas de dados. Porém, é recomendado um conhecimento mínimo sobre geradores para evitar possíveis armadilhas. Sim, eu cai em mais uma armadilha do Python, dessa vez foi o groupby do módulo itertools.

    O que é o groupby ?

    O groupby consiste em uma função que, baseado em um iterável, retorna uma estrutura de agrupamendo com um valor de chave e um grupo de valores, relacionados a essa chave. A função groupby possui a seguinte syntax:

    def groupby(iterable, key=None)

    Onde:

    • Iterable: Qualquer iterável (e.g. lista, tupla, gerador, dicionário, etc.).
    • key: Uma key function que será aplicada em cada elemento do iterável afim de retornar a chave para o agrupamento.

    O resultado da função groupby é um gerador onde cada iteração retorna o valor da chave e outro gerador com os valores que foram agrupados para essa chave, por exemplo:

    >>> from itertools import groupby >>> items = [('animal', 'dog'), ('animal', 'cat'), ('person', 'john')] >>> for thing, values in groupby(items, key=lambda x: x[0]): ... print('{}: {}'.format(thing, list(values))) ... animal: [('animal', 'dog'), ('animal', 'cat')] person: [('person', 'john')]

    Usei o list() no values para poder resolver o gerador e apresentar os valores no print (não a instancia do gerador).

    A armadilha

    Como você pode ver, o groupby é realmente muito útil e poderoso, porém, o que poderia acontecer caso o iterável não estivesse préviamente ordenado pelo mesmo critério a ser utilizado para o agrupamento? Vamos adaptar o exemplo anterior para realizar esse teste:

    >>> from itertools import groupby >>> items = [('animal', 'dog'), ('person', 'john'), ('animal', 'cat')] >>> for thing, values in groupby(items, key=lambda x: x[0]): ... print('{}: {}'.format(thing, list(values))) ... animal: [('animal', 'dog')] person: [('person', 'john')] animal: [('animal', 'cat')]

    Como você pode ver, o agrupamento falha, retornado a mesma chave mais de uma vez com um grupo de valores distintos.

    Por que isso acontece ?

    Isso acontece porque internamente, o groupby gera um novo grupo a cada novo valor de chave que for encontrado no iterável. Mesmo que uma chave se repita, o groupby não consegue "olhar para atrás" e verificar os grupos que já foram gerados.

    Como resolver?

    Simples, basta antes de agrupar, ordenar o iterável pela mesma chave que será utlizada no agrupamento do groupby, por exemplo:

    >>> from itertools import groupby >>> items = [('animal', 'dog'), ('person', 'john'), ('animal', 'cat')] >>> ordered_items = sorted(items, key=lambda x: x[0]) >>> for thing, values in groupby(ordered_items, key=lambda x: x[0]): ... print('{}: {}'.format(thing, list(values))) ... animal: [('animal', 'dog'), ('animal', 'cat')] person: [('person', 'john')] Como se prevenir?

    Simples, leia a documentação!!! Sim, meu vacilo foi ainda maior pois, a documentação oficial do python alerta sobre esse risco:

    The operation of groupby() is similar to the uniq filter in Unix. It generates a break or new group every time the value of the key function changes (which is why it is usually necessary to have sorted the data using the same key function). That behavior differs from SQL’s GROUP BY which aggregates common elements regardless of their input order.

    Tudo bem que poderia ter um destaque maior esse alerta ou até mesmo um exemplo, porém, não adianta reclamar que não está documentado =).

    Referências
    Documentação Oficial

    Categories: FLOSS Project Planets

    Kevin Avignon: Tech questions 10-17: FP questions

    Planet Debian - Fri, 2016-06-24 08:07
    Hey guys, Today’s post is to make you understand that even is oriented-object programming (OOP) feels now finally natural and exquisite, they are better ways to design and implement your solutions to make them better and of course, safer. My goal today is to make you want to adopt a functional mindset when creating software … Continue reading Tech questions 10-17: FP questions →
    Categories: FLOSS Project Planets

    OSTraining: Installing Drupal-VM on Windows

    Planet Drupal - Fri, 2016-06-24 06:52

    An OSTraining member asked how to use the Drupal VM environment on Windows.

    In this tutorial, we will install D8 in a few simple steps.

    Categories: FLOSS Project Planets

    Fabio Zadrozny: PyDev 5.1.2: pytest integration

    Planet Python - Fri, 2016-06-24 06:39
    PyDev 5.1.2 is now out. The major change is in the pytest integration.

    For those that don't know about it, pytest (http://pytest.org) is a Python test framework which requires less scaffolding to make tests (you don't need a hierarchy such as in PyUnit, just test methods in a module and asserts for checks suffice, it takes care of providing a reasonable error message -- also, it has an interesting fixture concept which allows structuring the test environment in a way more natural then through an inheritance hierarchy with unittest.TestCase.setUp/tearDown).

    If you want to use pytest, in PyDev, the runner in the preferences > PyDev > PyUnit has to be set as pytest.

    It's interesting to note that PyDev makes it trivial to just run a single test: you can select the test by using the method navigation (Ctrl+Shift+Up and Ctrl+Shift+Down) and press Ctrl+F9: this will open the outline for selecting which tests to run with only that test selected by default, then you can press Enter to run the test (or Shift+Enter to debug it) -- note that this works with the regular unittest too, not only with pytest.
    Categories: FLOSS Project Planets
    Syndicate content