Feed aggregator

Mediacurrent: Running Drupal on OpenShift from Red Hat

Planet Drupal - Tue, 08/04/2014 - 17:52

An interesting platform I came across recently for developing and deploying cloud applications is OpenShift by RedHat. OpenShift is a next generation application hosting platform. The software running this service is open-sourced under the name OpenShift Origin, and is available on GitHub. Developers use Git to deploy web applications in different languages to the platform.

Categories: Elsewhere

Acquia: Using Composer Manager to get off the Island Now

Planet Drupal - Tue, 08/04/2014 - 17:28

On the eve of 2013, prolific Drupal contributor Larry Garfield put forth a challenge to "get off the island", and judging by the adoption of non-Drupal projects in Drupal 8 core I would say the community has responded.

Categories: Elsewhere

Phase2: Say Goodbye To menu_get_object() @NYC Camp

Planet Drupal - Tue, 08/04/2014 - 13:30

Drupal 8 is bringing some great new features in addition to some fun DX changes. One of the ways I like to learn about these changes is to deconstruct the API.

The best way to deconstruct the API is to dive into code that has a certain purpose, like looking at the Breadcrumb API.

Since we know we’re focusing on Drupal 7 to Drupal 8 changes, we can also use the excellent documentation in the change records to help us.

In my upcoming NYCCamp presentation, I’ll review some of the common API functions we used in Drupal 7 and how they’ve changed in Drupal 8.

What Node Am I On?

A lot of custom blocks that show related content, connected taxonomy, or any other relationship to currently viewed page typically depend on menu_get_object(). I’m sad to say that our old friend is gone.

In Drupal 8, the way to get details about nodes are through the attributes of the request object in the global \Drupal namespace.

While the DX of this implementation is currently being discussed, as of this writing, to get details about the current node:

<?php $node = \Drupal::request()->attributes->get('node'); ?>

drupal_render() is EVERYTHING!

Consistency is a big theme (no pun intended) in Drupal 8. Render arrays are the main driver to staging content to be passed to the theme layer.

As such, the theme() function is now gone.

Instead, a new #theme array key is passed to build a piece of content programmatically.

For old core theme functions, like theme_table() or theme_link(), you can pass in the ‘table’ or ‘link’ keyword, respectively, to the #type array key.

As noted in the change record, to create a table of data with a pager, set the various keys, then pass it to drupal_render():

<?php // Theme is available as an element type (may have additional processing in rendering). $table = array( '#type' => 'table', '#header' => $header, '#rows' => $rows, '#attributes' => array( 'id' => 'my-module-table', ), ); $markup = drupal_render($table); // Pager is not an element type, use #theme directly. $pager = array('#theme' => 'pager'); $markup = drupal_render($pager); ?>

Want More?

If you can’t make it out to NYC, definitely look for me at either the upcoming Chicago Meetup or Drupalcon Austin!

I hope to you see in you in NYC this weekend!

Categories: Elsewhere

Bálint Réczey: Move friends from XP to Linux days

Planet Debian - Tue, 08/04/2014 - 12:38


Today Microsoft ends support for Windows XP.

To keep my friends’ PC-s currently running XP secure I announce the the “Move friends from XP to Linux days”.

If you are my friend feel free to contact me and we find some time to install Ubuntu on your machine keeping your Windows installation bootable as long as you want. Ubuntu is a Debian derivative Linux distribution which is easy to use.

Hungarian version

Categories: Elsewhere

Marek Sotak: Inline Manual 1.0 Drupal module released, show your clients how to use their site

Planet Drupal - Tue, 08/04/2014 - 12:03

After few betas, Inline Manual Drupal module has reached stable 1.0 version. Throw screenshots, screencasts and word documents away! Be interactive and agile. :)

"Inline Manual is a service to create interactive, reusable and easy to maintain step-by-step documentation for end-users of a website or application. Be it a tutorial "How to add a new user" within a CMS you've just built or a tutorial showing how to manage specific content."

The Drupal module allows you to:

Categories: Elsewhere

KnackForge: How we managed to send 75k emails per hour

Planet Drupal - Tue, 08/04/2014 - 10:42

Ardent team at KnackForge always loves to get hands dirty with challenging projects. In this connection we recently took an interesting newsletter sending project from one of our potential clients who is doing relatively big in Internet marketing.

In brief, we were asked for a custom system for sending out newsletter emails, based on Drupal. Tentatively 600k emails to be sent per month. A newsletter list shall have up to 80k users and limited to a couple of lists to begin with.

Categories: Elsewhere

Pronovix: Drupal Developer Days 2014 Szeged - behind the scenes

Planet Drupal - Tue, 08/04/2014 - 10:20

Drupal Dev Days Szeged was a great opportunity for me to realize and take part in one of Kristof’s crazy ideas (well, almost as crazy as Drupalcon 2008 was ;) with some great people from the community. While the event turned out to be a success, I’ve learnt a lot that I would like to share with all future organizers through this blog post and other channels.

Categories: Elsewhere

Andrew Pollock: [life] Day 70: Visiting relatives and home visiting doctors

Planet Debian - Tue, 08/04/2014 - 07:24

Zoe did indeed sleep in this morning, by a whole 30 minutes. It was nice. She seemed no worse for wear for her lip injury, and it was looking better this morning.

Wow, "bimonthly" is ambiguous. I had my "every two month" in person co-parenting sync up lunch with Sarah today. Phew, that was a mouthful. Anyway, I had that today, and normally that would fall on a Kindergarten day, but it's school holidays. So we paid grandma and grandpa a visit, and they looked after Zoe for me so I could make the meeting.

Mum and Dad have been away on a driving holiday, so Zoe hasn't seen them for a while, and it's been even longer since we've been to their house. She really loves going to their house because it's big, with a big back yard with a swing set. There's all sorts of exciting things like grandpa's worm farm, a sand pit, a china tea set, a piano, a tricycle and remote controlled cars. Zoe basically just works her way around the house entertaining herself. It's great. I usually get to put my feet up and read the newspaper.

After I got back from my lunch meeting, we headed over to Greenslopes Private Hospital to visit my cousin, who's just had major surgery. On the way, Zoe napped in the car. I made a brief side trip to clear my post office box along the way.

Amusingly, Zoe wakes up from short naps in the car way better than at Kindergarten. I don't know if it has anything to do with the quality of sleep she's getting or what it is, but I easily woke her up and extracted her from the car when we arrived at the hospital. No meltdowns. And that's pretty typical of car naps.

I've had a discomfort in my right ear for the last couple of days, and it grew into increasing pain throughout the day today. It got to the point where, while I was driving home, that I deciding to get it looked at by a doctor, ASAP. One of my favourite things about being back in Australia is the availability of home visiting doctors.

It was actually faster and cheaper for me to get a home doctor out to look at me tonight than it was to get an appointment with my regular doctor. I wouldn't have gotten an appointment until some time tomorrow at the earliest (assuming he had appointments available), because I made the decision to see a doctor after 5pm, when they'd closed. Instead, I had a doctor at my door in a little more than 2 hours of making the request. It also worked out cheaper, because the home doctor bulk bills Medicare, whereas my regular doctor does not.

Add in the massive convenience of not having to lug a small child anywhere while I get seen by a doctor, and it's a major convenience. I love socialised healthcare.

It turned out I have an outer ear infection. So all we had to do after the doctor came was find a pharmacy that was still open after 7pm to get my ear drop prescription filled.

All of that mucking around meant that Zoe got to bed a little later than usual. It's another cool night tonight, so I'm hoping she'll sleep well and have another sleep in.

Categories: Elsewhere

Russ Allbery: Review: With Charity for All

Planet Debian - Tue, 08/04/2014 - 06:04

Review: With Charity for All, by Ken Stern

Publisher: Anchor Copyright: November 2013 ISBN: 0-307-74381-0 Format: Trade paperback Pages: 244

I've been reading a lot lately about how to measure charitable organizations and where best to give your money, which has already prompted a rethinking of which organizations I want to support. Most of that has been shorter, on-line blog posts, but I've been wanting a deeper analysis. This is the first of a couple of books I've found on the topic. (The second, an analysis of microfinance, is waiting for me to have more time to read.)

For this kind of book, the background of the author matters a lot. Stern was the former CEO of National Public Radio for eight and a half years, so he has practical experience in the business side of non-profits. He's credited with improving NPR's financial position and management and oversaw an era of rapid growth. In With Charity for All, he speaks frankly about his own personal experiences as well as his research. My impression is that he's typical of competent business managers of non-profits: not particularly radical, focused mostly on business issues, and the sort of person that a non-profit needs to turn a mission or cause into a sustainable organization.

It's worth noting in advance that With Charity for All is specifically about the United States charitable sector and US laws and approaches. Some of this may generalize to other countries, but non-profit and charity law is very different between different countries, and the US attitude towards government, non-profits, and the appropriate division of responsibilities between them often doesn't match the prevailing view elsewhere. This book may well be interesting to people outside the US, but only if they're curious about the US charitable sector.

The short summary of the message of this book is that we're not getting our money's worth out of charity, either as donors or as taxpayers who are indirectly subsidizing these organizations. This is not (usually) due to any outright fraud, although there certainly is some of that due to the almost total lack of oversight of charitable organizations. Rather, it's the result of a complex combination of history and institutional momentum, focus on the aspects of a charity that play well to potential donors, a concerted effort at feel-good marketing, well-intentioned but misguided donor dictates, adoption of approaches and business practices from the for-profit sector, and, above everything else, the almost complete absence of evidence-based evaluation of charities.

Evidence-based evaluation is currently a hot trend among charities. I heard about this book via one of the organizations that is focusing on this (GiveWell). This is not what sites like Charity Navigator do, and indeed Stern talks at some length about the serious limitations of the Charity Navigator approach. All that sites of that type can do is look at spending breakdowns. Stern makes a strong argument that a focus on reducing overhead, as measured by those financial forms, is misguided and leads to very ineffective and unorganized charities. Worse, all Charity Navigator can tell you is if the charity is spending money on something they declare to be in line with their goal, not whether that money did any good whatsoever.

The short and depressing news is that most of that money does little or no good, and worse, that most charities have no systematic way of measuring whether it does any good.

I'm particularly interested in how to ground charities in more concrete evidence, and Stern's discussion does not disappoint. But one of the things I liked about the book is that he doesn't stop there. Other topics include the dizzying variety of charities and the resulting confusion and dispersion of resources, the non-profits that are practically indistinguishable from for-profit companies except that they get huge tax breaks (sports organizations, as you might expect, are probably the worst offenders, but Stern has harsh commentary on the US hospital system), the mess of compensation in the non-profit sector, and the serious problems created by major donors who want to get directly involved and oversee how their money is spent. All of these topics are fascinating, if a bit depressing in the aggregate.

As is typical for a book of this sort, it's a lot easier to see the problems than to describe the solutions. Stern does try to offer his own prescriptions, most of which are variations on more oversight: more regulation, more effort put into measuring results, more concrete standards for success or failure, and a stronger culture of treating tax-exempt status as a privilege, not a right, that has to be defended by showing clear social benefit. I'm convinced those steps would be helpful, although less convinced that we're able to get there from here. One of his ideas I am already using on a small scale: pooling charitable donations with professional evaluators who can take the time to look deeper than financial breakdowns and do some independent measurement of results, or at least survey relevant studies done by others and possibly demand more be done. This model of a mutual fund for charitable giving has some promise, I think (more than a managed mutual fund, in fact), and is very similar to what GiveWell is doing.

This is an advocacy book, and one that's primarily focused on concrete, measurable deliverables and on the finances. There are a few places where I have reason to be dubious of the black-and-white conclusions Stern draws. For example, he makes much of the bill collecting practices of charitable hospitals, which I agree is a travesty, but doesn't mention that non-profit hospitals produce better health outcomes. I'm also not sure his analysis is as directly applicable to advocacy organizations, where measuring success is a much more challenging proposition. I think the Southern Poverty Law Center is one of the best charities in the United States (admittedly based largely on gut feeling and presentation), but the nature of their work is not amenable to the style of analysis that Stern is doing here. It's therefore worth taking this book with a grain of salt.

But, that said, Stern's conclusions are in line with things I've read elsewhere. I think he's pointing in the right direction, and I would recommend this book to anyone who gives regularly to charity. Hopefully it won't just cause you to stop. There are charities out there that are trying hard to measure their results and ensure they deliver social value for the money that we give them. Our system just doesn't support them very well, yet.

Rating: 8 out of 10

Categories: Elsewhere

Dirk Eddelbuettel: RcppArmadillo 0.4.200.0

Planet Debian - Tue, 08/04/2014 - 05:24
Conrad released a new upstream release 4.200 for Armadillo, his templated C++ library for linear algebra, earlier today.

As usual, this was rolled up in a new RcppArmadillo release 0.4.200.0; I had actually made two pre-releases leading up his 4.200 release and was hence not expecting any surprises. Prior to uploading to CRAN, I also tested against all 61 reverse dependencies of the package. Last but not least, I also updated the corresponding Debian package.

Changes in RcppArmadillo version 0.4.200.0 (2014-04-07)
  • Upgraded to Armadillo release Version 4.200 (Flintlock Swoop)

    • faster transpose of sparse matrices

    • more efficient handling of aliasing during matrix multiplication

    • faster inverse of matrices marked as diagonal

Courtesy of CRANberries, there is also a diffstat report for the most recent release As always, more detailed information is on the RcppArmadillo page. Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page.

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

Categories: Elsewhere

Yves-Alexis Perez: CVE-2014-0160 / heartbleed

Planet Debian - Mon, 07/04/2014 - 23:35

Short version:

  • yes we're affected;
  • we're currently working on it;
  • we didn't have an early warning so we're doing as fast as we can.

DSA should be in your INBOX in a few moments, and the updates on the mirror a moment later.

Categories: Elsewhere

Holger Levsen: 20140407-some-jenkins-activities

Planet Debian - Mon, 07/04/2014 - 22:53
Some jenkins.debian.net activities

Yesterday and today I've spent some time time on jenkins.debian.net, so that it's finally only available via https, or so I thought. I quickly learned that it's better still serving via http, but only when queried from localhost Second, I've moved the git repo to QA group namespace on alioth and set up IRC notifications using the wonderful KGB client. There is no mailinglist which receives commit diffs yet, but thats also because it's mostly still me working on this. Though since yesterday there are now seven committers in the git history, which is two more than before:

Niels Thykier submitted job configuratios for running the lintian testsuite on stable, testing and sid on every commit to the lintian git repo. The test suite passes nicely on testing and unstable but fails for stable as it needs backports and we need to make the job to install those.

Gabriele Giacone submitted several patches so that soon hurdwgnu/hurd can be tested too. Currently this fails for two reasons, both of which are very temporarily: the hurd .iso image which was here this morning is gone now, and secondly I haven't installed (the locally build packages for) qemu and qemu-kvm packages with the fixes for #742386 as that .iso ain't there so this is pointless atm

But I'm very happy to have a hopefully soon working job which will regularily test installation of Debian hurd and I do hope that some Debian kfreebsd enthusiasts will pick up and fix the existing jobs for kfreebsd tests. (Hint hint hint! I'm also totally happy to help with that!)

This reminds me to mention one last bit: Thanks to Paul Wise, jenkins.d.n bugs are now tracked in the BTS among other Debian QA group bugs!

Categories: Elsewhere

Morten.dk: Themer Survey 2014

Planet Drupal - Mon, 07/04/2014 - 18:25

Dear Themer we the Drupaltwig group need some answers & advice from all of our fellow Drupalistas - We want to make sure that we are creating a theme system that lives up to the wishes of all Drupal8 users - but especially us themers ;)

read more

Categories: Elsewhere

Vasudev Kamath: Loading Python modules/plug-ins at runtime

Planet Debian - Mon, 07/04/2014 - 18:25

Some times it is desired to load arbitrary python files or pre- installed python modules during application run time.I had encountered 2 such usecases, one is in SILPA application and other is dictionary-bot which I was refactoring recently.

Case 1: Loading installed python module

In case of SILPA I need to load pre-installed modules and here is the old code , that is a bit hacky code I copied from Active State Python recipies. I found a bit better way to do it using importlib module as shown below.

from __future__ import print_function import sys import importlib def load_module(modulename): mod = None try: mod = importlib.import_module(modulename) except ImportError: print("Failed to load {module}".format(module=modulename), file=sys.stderr) return mod

Here importlib itself takes care of checking if modulename is already loaded by checking sys.modules[modulename], if loaded it returns that value, otherwise it loads the module and sets it to sys.modules[modulename] before returning module itself.

Case 2: Loading python files from arbitrary location

In case of dictionary bot my requirement was bit different, I had some python files lying around in a directory, which I wanted to plug into the bot during run time and use them depending on some conditions. So basic structure which I was looking was as follows.

pluginloader.py plugins | |__ aplugin.py | |__ bplugin.py

pluginloader.py is the file which needs to load python files under plugins directory. This was again done using importlib module as shown below.

import os import sys import re import importlib def load_plugins(): pysearchre = re.compile('.py$', re.IGNORECASE) pluginfiles = filter(pysearchre.search, os.listdir(os.path.join(os.path.dirname(__file__), 'plugins'))) form_module = lambda fp: '.' + os.path.splitext(fp)[0] plugins = map(form_module, pluginfiles) # import parent module / namespace importlib.import_module('plugins') modules = [] for plugin in plugins: if not plugin.startswith('__'): modules.append(importlib.import_module(plugin, package="plugins")) return modules

Above code first searches for all python file under specified directory and creates a relative module name from it. For eg. file aplugin.py will become .aplugin. Before loading modules itself we will load the parent module in our case plugins, this is because relative imports in python expects parent module to be already loaded. Finally for relative imports to work with importlib.import_module we need to specify parent module name in package argument. Note that we ignore files begining with __, or specifically we don't want to import __init__.py, this will be done when we import parent module.

The above code was inspired from a answer on StackOverflow, which uses imp module, I avoided imp because its been deprecated from Python 3.4 in favor of importlib module.

Categories: Elsewhere

Olivier Berger: Tagged a first version of the TWiki to FusionForge’s MediaWiki converter

Planet Debian - Mon, 07/04/2014 - 18:23

As announced previously, I’ve been hacking on a migration tool allowing to import into the MediaWiki of a FusionForge project, a conversion of the contents of a TWiki wiki.

I’ve succesfully imported a first project (from PicoForge to FusionForge) using the tool, so I’ve decided to tag a first release and make the Git repo accessible.

More details at : https://fusionforge.int-evry.fr/projects/pytwiki2mediawi/

Feel free to ask here in the comments or by email, in case of need.

And, yes, my Python is most likely awful, but at least, this works, and much more featureful than existing tools I could test.

Categories: Elsewhere

Stanford Web Services Blog: Overriding Open Framework Styles: Block styles, Sidebar Menus, and Regions

Planet Drupal - Mon, 07/04/2014 - 18:06

In this post, I continue my series on how to override Open Framework's default styles to get a more custom look-and-feel on your site. Last time we looked at how to override our typography styles. Today, we'll look at a grab bag of other things, including block styles, sidebar menus, and region styles.

Categories: Elsewhere

Fred Parke | The Web Developer: Create your own tokens in Drupal 7

Planet Drupal - Mon, 07/04/2014 - 17:58

Tokens are a pretty powerful weapon to have in your arsenal, and they actually come in useful a lot if you remember that they're there.

If you haven't used them before, tokens are essentially text placeholders - they can be static text, variables, field values, whatever you want really.

The Token API is now part of Drupal 7 core and as it turns out, using it to create your own tokens is super easy - you just need a couple of hooks.

The first hook, hook_token_info(), is used to declare any custom tokens.

Categories: Elsewhere

Appnovation Technologies: Accessibility in the Real World: Top 6 Automation Misses

Planet Drupal - Mon, 07/04/2014 - 17:25
Making your work accessible shouldn’t be a optional deliverable; we have a duty of care to the real world of users to build this in as part of our work. No matter how good automated test tools are, they won't cover everything. Here are 6 points of consideration for accessibility. var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Categories: Elsewhere

Bryan Braun: Making Targeted Drupal Cache Clears using Drush

Planet Drupal - Mon, 07/04/2014 - 16:21

The standard Drush command for clearing Drupal's cache looks like this:

drush cache-clear all

(You can also use the shortened alias cc like this: drush cc all)

These commands give you the same result as when you click that cache clear button in the UI — it clears all of Drupal's internal caches.

But clearing all of Drupal's caches at once can be overkill. You usually don't need to clear everything, and doing so can put heavy load on your servers (especially if your site is large or gets a lot of traffic). Beneath the surface, Drupal's caching is actually pretty granular, and tools like Drush give us the ability to target and clear caches on the subsystem level.

Using Drush, you can see your caching options with:

# Using the shortened alias from this point on. drush cc

Which returns something like this:

[0] : cancel [1] : all [2] : drush [3] : theme registry [4] : menu [5] : css+js [6] : block [7] : module list [8] : theme list [9] : registry ...

Let's look at what each of these does (as a quick note, I'm specifically looking at Drush 6, which is the major version at this time):

drush cc all
Remember how I said that this does the same thing as the cache clear button in the UI? Well, that's technically false. Yes, drush cc all will clear all your Drupal caches (as long as it can bootstrap Drupal), but it will also clear its own internal Drush cache. That's why when Drush cannot bootstrap Drupal, you will still see a success command saying 'drush' cache was cleared.

drush cc drush
This only clears Drush's internal cache (the same one I just mentioned). You don't need a Drupal site available to clear this cache.

drush cc theme registry
This command simply calls drupal_theme_rebuild() to rebuild the theming system. This is needed whenever new ".tpl.php" files or theme hooks are added to the system. This specific cache clear only applies for Drupal 7 and up.

drush cc menu
This runs a menu rebuild, which refreshes the database tables used by various menu functions. For example, any new router items (like those defined in hook_menu) are added to the menu_links table, and stale ones are removed. This also clears the page and block caches, to prevent the display of stale menu links.

drush cc css+js
If you have CSS or JS aggregation enabled, this will rebuild the aggregated files. It also increments the query string on CSS & JS links, forcing clients that have cached an old copy to download a fresh one.

drush cc block
Block caching exists so Drupal doesn't have to look up the locations and visibility of blocks with each page load. This command refreshes that cache.

drush cc module list
This re-scans the module directories in your codebase and refreshes Drupal's internal list of which modules are available.

drush cc theme list
This re-scans the theme directories in your codebase and refreshes Drupal's internal list of which themes are available.

drush cc registry
Drupal maintains an internal registry of all functions or classes in the system, allowing it to lazy-load code files as needed (reducing the amount of code that must be parsed on each request). The list of these files is known as the "code registry" and it is stored in the system table in your Drupal database. This cache clear will look at this list of files and update the contents of any files that have been changed. Note: it will not rebuild the registry from scratch. For more information, see registry_update.

drush cc ?????
You may see other options in this list, because contributed modules (like views and advanced aggregation) can add their own kinds of cache clears. In each case, you'll see a file in the contrib module named something like mymodule.drush.inc that contains the code which defines what the cache clear does.

 

If you want to see what each of these options does on a code level, you can download Drush and inspect the file found at Drush/commands/core/cache.drush.inc.

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator