Elsewhere

Ritesh Raj Sarraf: Basis B1

Planet Debian - mar, 22/04/2014 - 21:32

 

Starting yesterday, I am a happy user of the Basis B1 (Carbon Edition) Smart Watch

The company recently announced being acquired by Intel. Overall I like the watch. The price is steep, but if you care of a watch like that, you may as well try Basis. In case you want to go through the details, there's a pretty comprehensive review here.

Since I've been wearing it for just over 24hrs, there's not much data to showcase a trend. But the device was impressively precise in monitoring my sleep.

 

Pain points - For now, sync is the core of the pains. You need either a Mac or a Windows PC. I have a Windows 7 VM with USB Passthru, but that doesn't work. There's also an option to sync over mobile (iOS and Android). That again does not work for my Chinese Mobile Handset running MIUI.

AddThis:  Categories: Keywords: 
Catégories: Elsewhere

Dcycle: Simpletest Turbo: how I almost quadrupled the speed of my tests

Planet Drupal - mar, 22/04/2014 - 21:15

My development team is using a site deployment module which, when enabled, deploys our entire website (with translations, views, content types, the default theme, etc.).

We defined about 30 tests (and counting) which are linked to Agile user stories and confirm that the site is doing what it's supposed to do. These tests are defined in Drupal's own Simpletest framework, and works as follows: for every test, our site deployment module is enabled on a new database (the database is never cloned), which can take about two minutes; the test is run, and then the temporary database is destroyed.

This created the following problem: because we were deploying our site 30 times during our test run, a single test run was taking over 90 minutes. Furthermore, we are halfway into the project, and we anticipate doubling, perhaps tripling our test coverage, which would mean our tests would take over four hours to run.

Now, we have a Jenkins server which performs all the tests every time a change is detected in Git, but even so, when several people are pushing to the git repo, test results which are 90 minutes old tend to be harder to debug, and developers tend to ignore, subvert and resent the whole testing process.

We could combine tests so the site would be deployed less often during the testing process, but this causes another problem: tests which are hundreds of lines long, and which validate unrelated functionality, are harder to debug than short tests, so it is not a satisfactory solution.

When we look at what is taking so long, we notice that a majority of the processing power goes to install (deploy) our testing environment for each test, which is then destroyed after a very short test.

Enter Simpletest Turbo, which provides very simple code to cache your database once the setUp() function is run, so the next test can simply reuse the same database starting point rather than recreate everything from scratch.

Although Simpletest Turbo is in early stages of development, I have used it to almost quadruple the speed of my tests, as you can see from this Jenkins trend chart:

I know: my tests are failing more than I would like them to, but now I'm getting feedback every 25 minutes instead of every 95 minutes, so failures are easier to pinpoint and fix.

Furthermore, fairly little time is spent deploying the site: this is done once, and the following tests use a cached deployment, so we are not merely speeding up our tests (as we would if we were adding hardware): we are streamlining duplicate effort. It thus becomes relatively cheap to add new independent tests, because they are using a cached site setup.

Tags: planetblog
Catégories: Elsewhere

C.J. Adams-Collier: AD Physical to Virtual conversion… Continued!

Planet Debian - mar, 22/04/2014 - 20:54

So I wasn’t able to complete the earlier attempt to boot the VM. Something to do with the SATA backplane not having enough juice to keep both my 6-disk array and the w2k8 disk online at the same time. I had to dd the contents off of the w2k8 disk and send it to the SAN via nc. And it wouldn’t write at more than 5.5MB/s, so it took all day.

Anyway, I’ve got a /dev/vg0/ad0 logical volume all set up now that I’m exporting to the guest as USB.

Here’s the libvirt xml file: win2k8.xml

No indication as to how long this will take. But I’ll be patient. It will be nice to have the AD server back online.

Catégories: Elsewhere

Axel Beckert: GNU Screen 4.2.0 in Debian Experimental

Planet Debian - mar, 22/04/2014 - 20:22
About a month ago, on 20th of March, GNU Screen had it’s 27th anniversary.

A few days ago, Amadeusz Sławiński, GNU Screen’s new primary upstream maintainer, released the status quo of Screen development as version 4.2.0 (probably to distinguish it from all those 4.1.0 labeled development snapshots floating around in most Linux distributions nowadays).

I did something similar and uploaded the status quo of Debian’s screen package in git as 4.1.0~20120320gitdb59704-10 to Debian Sid shortly afterwards. That upload should hit Jessie soon, too, resolving the following two issues also in Testing:

  • #740301: proper systemd support – Thanks Josh Tripplett for his help!
  • #735554: fix for multiuser usage – Thanks Martin von Wittich for spotting this issue!

That way I could decouple these packaging fixes/features from the new upstream release which I uploaded to Debian Experimental for now. Testers for the 4.2.0-1 package are very welcome!

Oh, and by the way, that upstream comment (or ArchLinux’s according announcement) about broken backwards compatibility with attaching to running sessions started with older Screen releases doesn’t affected Debian since that has been fixed in Debian already with the package which is in Wheezy. (Thanks again Julien Cristau for the patch back then!)

While there are bigger long-term plans at upstream, Amadeusz is already working on the next 4.x release (probably named 4.2.1) which will likely incorporate some of the patches floating around in the Linux distributions’ packages. At least SuSE and Debian offered their patches explicitly for upstream inclusion.

So far already two patches found in the Debian packages have been obsoleted by upstream git commits after the 4.2.0 release. Yay!

Catégories: Elsewhere

AGLOBALWAY: Drupal & Bootstrap

Planet Drupal - mar, 22/04/2014 - 19:34
Here at AGLOBALWAY, we are constantly learning to take advantage of the myriad of tools available to us whether for communication, productivity, or development. As a company dedicated to all things open source, one of the tools we employ is Twitter’s Bootstrap framework. Thanks to the industriousness and generosity of companies like Twitter, (or Zurb for its own Foundation framework, among others), the web community has a tremendous amount of resources from which to draw upon.   Drupal has been a key content management framework for us ever since the inception of our company for its flexibility, power, and configurability. Bootstrap has made an excellent companion for Drupal in several of our projects so far, so I will highlight just a few of the many ways that a Bootstrap-based theme can compliment your Drupal website.   Bootstrapped Style   While some decry the design style and “look” that is quintessentially Bootstrap, there really is no need to. Yes, it has been a major influence on modern web design trends. Bootstrap has prepackaged layouts and default styles for nearly all UI elements, taking away the need to create styles for everything. But, building a unique site that doesn’t follow that typical Bootstrap style own doesn’t have to be difficult. The real undertaking is in learning the ins and outs of the preprocessor system employed by Bootstrap (Less, in this case), and how they have laid everything out.   Once familiar with the system, one will quickly realize that it’s relatively straightforward to take advantage of all of the mixins and variables already given in order to generate the styles you have designed. In one .less file, we can quickly define colours, sizes, and other default settings that will appear throughout your site. Again, like the JavaScript libraries above, this is not unique to Drupal. However, being able to take advantage of these tools helps immensely to speed up the development cycle of building Drupal sites.   JavaScript Libraries   Having access to a number of common functions used throughout the web is a huge time saver. Already bundled with jQuery, a Drupal Bootstrap-based theme allows for easy integration of accordions, image carousels and more, without having to write your own JavaScript. While these libraries are certainly not exclusive to Drupal, there can be unique ways of making use of them with Drupal. For example, rendering a block inside of a modal for a login form is a snap, and css is all you really need to customize it once you initialize it with the proper JavaScript.   Another example would be to pair Bootstrap with the popular CKEditor module to generate templates, using Bootstrap’s markup. Users may want to place an accordion inside their own managed content, so we can create a template with CKEditor’s default.js file (even better, create a separate file and use that one instead), following the pattern of the templates already given. Add the Bootstrap markup with the appropriate classes, and voila! Your users now have an accordion they can insert using only the WYSIWYG editor.   Bootstrap Views   This is a Drupal module I have yet to really play around with personally, but a cursory look tells me just how easy it can be to display content using Bootstrap elements without even getting into template files or writing code. While I generally prefer to separate markup from data output, I can see the potential here for a lot of time saving, while avoiding some head-scratching at the same time. This is the whole point of views in the first place - making it easy to display the content you want without having to dive too deep.   As we can see, integrating Drupal with Twitter Bootstrap has considerable advantages. While its heaviness is a fair criticism, I believe those advantages justify the use of Bootstrap, particularly in an Agile development environment. Besides, we can always eliminate the JavaScript or CSS we don’t use once we’re done developing our site. Whether it’s Bootstrap, Foundation, or your framework of choice, having such front-end tools to integrate with Drupal can only be a good thing. Many thanks to all who are dedicated to creating and maintaining these resources for the benefit of us all. Tags: drupal planetBootstrap
Catégories: Elsewhere

Propeople Blog: Propeople at Stanford Drupal Camp 2014

Planet Drupal - mar, 22/04/2014 - 19:26

This past weekend, some of our team had the pleasure of attending Stanford Drupal Camp, which Propeople supported as a Gold Sponsor. Stanford University is one of the biggest advocates of Drupal in higher-education, and is home to an active and passionate Drupal community. Hosted on the world famous (and too-gorgeous-to-put-into-words) Stanford campus, the Stanford Drupal Camp is an annual event focused on Drupal and the state of Drupal at the university (where thousands of websites are powered by the CMS). Propeople has participated in the event the past few years, and we've had the pleasure to work on a wide variety of Stanford projects in the same amount of time. These include the Stanford Graduate School of Business, SLAC National Accelerator Laboratory, Stanford Student Affairs, Riverwalk Jazz, and many others. 

Stanford Drupal Camp featured a great line-up of sessions and talks all day Friday and Saturday, ranging from the simple to the complex. The talks focused on a variety of topics, from site building to Agile and Scrum methodology to specific Drupal use cases in higher education. As you can expect at any Drupal camp, more casual BoFs and lightning talks were interspersed throughout the conference.

We were happy to have the packed schedule include two sessions presented by one of Propeople’s own Drupal experts, Yuriy Gerasimov, on Saturday. Yuriy’s first session was titled “CI and Other Tools for Feature Branch Development”, aimed at helping developers and organizations implement feature-branch workflow. The second was “Local Development with Vagrant”, which, as you might have guessed from the title, was all about the benefits of using Vagrant to spin up local virtual machines with the same settings on different platforms.

 

 

Overall, the many sessions, BoFs, and lightning talks provided Stanford staff, faculty, students, and developers (from the university and beyond) with plenty of great information.

In addition to the full session schedule, Stanford Drupal Camp featured plenty of opportunities for those at the event to enjoy each other’s company, catch up, and engage in some great conversation about every attendee’s favorite topic...Drupal! As a technology partner to more than a dozen Stanford departments and institutions, Propeople has learned first hand how great the Stanford community is, and it was a treat to have some of our team on campus to join in on the fun at Stanford Drupal Camp. We’ll be looking forward to next year!

Tags: DrupalDrupal campStanfordCheck this option to include this post in Planet Drupal aggregator: planetTopics: Community & Events
Catégories: Elsewhere

Phase2: Exploring Maps In Sass 3.3(Part 3): Calling Variables with Variables

Planet Drupal - mar, 22/04/2014 - 19:25

For this blog entry, the third in a series about Sass Maps, I am going to move away from niche application, and introduce some more practical uses of maps.

Living Style Guides

In my current project, a large Drupal media site,  I wanted to have a style guide, a single static page where we could see all of the site colors, along with the variable name. I collected all of my color variables, and created some static markup with empty divs. Below is the loop I started to write.

<!-- The HTML for our Style Guide --> <div class="styleguide"> <div class="primary-color"></div> <div class="secondary-color"></div> <div class="tertiary-color"></div> </div>

// Our site color variables $primary-color: #111111; $secondary-color: #222222; $tertiary-color: #333333; // Make a list of the colors to display $styleguide-colors: primary-color, secondary-color, tertiary-color; // Loop through each color name, create class name and styles @each $color in $styleguide-colors { .styleguide .#{$color} { background-color: $#{$color}; // Spoiler Alert: Does not work!! &:after { content: “variable name is #{$color}” } } }

This loop goes through each color in my $styleguide-colors list and creates a class name based on the color name. It then attempts to set the background-color by calling a variable that matches the name from the list. We also set the content of a pseudo element to the variable name, so that our styleguide automatically prints out the name of the color.

This is what we want the first loop to return:

.styleguide .primary-color {  background-color: $primary-color; // Nope, we won’t get this variable  &:after {      content: “variable name is primary-color”    } }

The problem is that we can’t interpolate one variable to call another variable! $#{$color}  doesn’t actually work in Sass. It won’t interpolate into $ + primary-color , and then yield #111111  in the final CSS. This 3 year old github issue points out this exact issue, and hints at how maps is going to be introduced in Sass 3.3 to solve this problem. https://github.com/nex3/sass/issues/132

Make it better with maps

So now that we have maps, how can we create this color styleguide? Lets take this a step at a time.

First we need to wrap all of our colors in a map. Remember, any of these colors can be accessed like this: map-get($site-colors, primary-color)

$site-colors: (  primary-color: #111111,  secondary-color: #222222,  tertiary-color: #333333, );

Now we can create a list of the colors we want to iterate through and loop through them just like we did before.

$styleguide-colors: primary-color, secondary-color, tertiary-color; @each $color in $styleguide-colors {  .styleguide .#{$color} {    background-color: map-get($site-colors, $color); // This DOES work!    &:after {      content: “variable name is #{$color}”    }  } }

This time when we loop through our colors we get the same class name and pseudo element content, but lets look at what happens with the background color. Here is the first pass through the loop, using primary-color as $color :

.styleguide .primary-color {   background-color: map-get($site-colors, primary-color);   &:after {      content: “variable name is primary-color”    } }

As you can see in this intermediate step, we are able to use map-get($site-colors, primary-color)  to programmatically pass our color name into a function, and get a returned value. Without maps we’d be stuck waiting for $#{$color} to be supported (which will probably never happen). Or in the case of my project, write all 20 site color classes out by hand!

Make it awesomer with maps

Astute readers might realize that I am still doing things the hard way. I created a map of colors, and then duplicated their names in a list called $styleguide-colors . We can skip that middle step and greatly simplify our code, if we are wanting to print out every single value in the map.

$site-colors: ( primary-color: #111111, secondary-color: #222222, tertiary-color: #333333, ); @each $color, $value in $site-colors { .styleguide .#{$color} { background-color: $value; &:after { content: “variable name is #{$color}” } } }

Now, instead of passing a list into the @each loop, we pass the entire map. We can do this with the following pattern: @each $key, $value in $map . Each iteration of the loop has access to both the key primary-color  AND the value #111111 , so we don’t even need the map-get function.

The ability to ‘call variables with variables’ is incredibly useful for creating these programmatic classes, and is a foundational process upon which we start to build more complex systems. Be sure to check out part 1 and 2 of my Sass Maps blog series!

Catégories: Elsewhere

Martin Pitt: Booting Ubuntu with systemd: Test packages available

Planet Debian - mar, 22/04/2014 - 18:54

On the last UDS we talked about migrating from upstart to systemd to boot Ubuntu, after Mark announced that Ubuntu will follow Debian in that regard. There’s a lot of work to do, but it parallelizes well once developers can run systemd on their workstations or in VMs easily and the system boots up enough to still be able to work with it.

So today I merged our systemd package with Debian again, dropped the systemd-services split (which wasn’t accepted by Debian and will be unnecessary now), and put it into my systemd PPA. Quite surprisingly, this booted a fresh 14.04 VM pretty much right away (of course there’s no Plymouth prettiness). The main two things which were missing were NetworkManager and lightdm, as these don’t have an init.d script at all (NM) or it isn’t enabled (lightdm). Thus the PPA also contains updated packages for these two which provide a proper systemd unit. With that, the desktop is pretty much fully working, except for some details like cron not running. I didn’t go through /etc/init/*.conf with a small comb yet to check which upstart jobs need to be ported, that’s now part of the TODO list.

So, if you want to help with that, or just test and tell us what’s wrong, take the plunge. In a 14.04 VM (or real machine if you feel adventurous), do

sudo add-apt-repository ppa:pitti/systemd sudo apt-get update sudo apt-get dist-upgrade

This will replace systemd-services with systemd, update network-manager and lightdm, and a few libraries. Up to now, when you reboot you’ll still get good old upstart. To actually boot with systemd, press Shift during boot to get the grub menu, edit the Ubuntu stanza, and append this to the linux line: init=/lib/systemd/systemd.

For the record, if pressing shift doesn’t work for you (too fast, VM, or similar), enable the grub menu with

sudo sed -i '/GRUB_HIDDEN_TIMEOUT/ s/^/#/' /etc/default/grub sudo update-grub

Once you are satisfied that your system boots well enough, you can make this permanent by adding the init= option to /etc/default/grub (and possibly remove the comment sign from the GRUB_HIDDEN_TIMEOUT lines) and run sudo update-grub again. To go back to upstart, just edit the file again, remove the init=sudo update-grub again.

I’ll be on the Debian systemd/GNOME sprint next weekend, so I feel reasonably well prepared now.

Catégories: Elsewhere

Gábor Hojtsy: Drupal Developer Days 2014 Organizers Report

Planet Drupal - mar, 22/04/2014 - 18:21


The organizer team is still energized after our experience putting together Drupal Dev Days Europe 2014 in Szeged, Hungary between 24 and 30 March.

Several people asked about details and we wanted to document the event for future event organizers to share what worked best for us. We prepared a report for you so if you experienced Drupal Dev Days Szeged, you can look behind the curtain a bit, or if you heard about it, you can see what we did to pull off an event like this. If you were not there and did not hear about it, we included several feedback references as well to give you an idea.

Do you want to see tweets and articles like those about your event? Read the report for our tips!

We definitely did not do everything right but we hope we can help people learn from the things we did right.

Excuse us if the report is a bit too long, we attempted to pack useful information to every single sentence to make reading it worth your time. Send questions and comments to the team.

Catégories: Elsewhere

Acquia: I’m Kris Vanderwater, Drupal Developer and Acquia’s Developer Evangelist.

Planet Drupal - mar, 22/04/2014 - 17:01

I’ve been working at Acquia for a little over two weeks now. The experience has been one I would characterize as “whirlwind” in nature. If you ask new Acquians about their on-boarding experience, the most common comparison is the age old “Drinking from a firehose” analogy. I honestly expected, as someone who already knew Drupal, that this might in some way lessen the stream of information to manageable levels. I was wrong. If anything the fire hose is a bit like sticking your toes into the shallow end of the pool, and knowing Drupal already was like “Oh you know how to swim?

Catégories: Elsewhere

Frederick Giasson: Configuring and Using OSF Ontology (Screencast)

Planet Drupal - mar, 22/04/2014 - 15:47

This screencast will quickly introduce you to ontologies, and will explain you what are their rules in the Open Semantic Framework (OSF).

You will see how you can manage ontologies in OSF using the OSF for Drupal web interface. You will be able to import, create, update, delete and export ontologies. You will see how you can search within imported ontologies, how you can manage their permissions.

Finally you will see how you can manage the ontologies themselves: how you can create, update and delete classes, properties and named individuals using the Web user interface.



Catégories: Elsewhere

Erich Schubert: Kernel-density based outlier detection and the need for customization

Planet Debian - mar, 22/04/2014 - 15:39
Outlier detection (also: anomaly detection, change detection) is an unsupervised data mining task that tries to identify the unexpected. Most outlier detection methods are based on some notion of density: in an appropriate data representation, "normal" data is expected to cluster, and outliers are expected to be further away from the normal data. This intuition can be quantified in different ways. Common heuristics include kNN outlier detection and the Local Outlier Factor (which uses a density quotient). One of the directions in my dissertation was to understand (also from a statistical point of view) how the output and the formal structure of these methods can be best understood. I will present two smaller results of this analysis at the SIAM Data Mining 2014 conference: instead of the very heuristic density estimation found in above methods, we design a method (using the same generalized pattern) that uses a best-practise from statistics: Kernel Density Estimation. We aren't the first to attempt this (c.f. LDF), but we actuall retain the properties of the kernel, whereas the authors of LDF tried to mimic the LOF method too closely, and this way damaged the kernel. The other result presented in this work is the need to customize. When working with real data, using "library algorithms" will more often than not fail. The reason is that real data isn't as nicely behaved - it's dirty, it seldom is normal distributed. And the problem that we're trying to solve is often much narrower. For best results, we need to integrate our preexisting knowledge of the data into the algorithm. Sometimes we can do so by preprocessing and feature transformation. But sometimes, we can also customize the algorithm easily. Outlier detection algorithms aren't black magic, or carefully adjusted. They follow a rather simple logic, and this means that we can easily take only parts of these methods, and adjust them as necessary for our problem at hand! The article persented at SDM will demonstrate such a use case: analyzing 1.2 million traffic accidents in the UK (from data.gov.uk) we are not interested in "classic" density based outliers - this would be a rare traffic accident on a small road somewhere in Scotland. Instead, we're interested in unusual concentrations of traffic accidents, i.e. blackspots. The generalized pattern can be easily customized for this task. While this data does not allow automatic evaluation, many outliers could be easily verified using Google Earth and search: often, historic imagery on Google Earth showed that the road layout was changed, or that there are many news reports about the dangerous road. The data can also be nicely visualized, and I'd like to share these examples with you. First, here is a screenshot from Google Earth for one of the hotspots (north of Heathrow airport):
Google Earth is best for exploring this result, because you can hide and show the density overlay to see the crossroad below; and you can go back in time to access historic imagery. Unfortunately, KML does not allow easy interactions. I have also put the KML file on Google Drive. It will automatically display it on Google Maps (nice feature of Drive, kudos to Google!), but it should also allow you to download it. I've also explored the data on an Android tablet (but I don't think you can hide elements there, or access historic imagery as in the desktop application). With a classic outlier detection method, this analysis would not have been possible. However, it was easy to customize the method; and the results are actually more meaningful: instead of relying on some heuristic to choose kernel bandwidth, I opted for choosing the bandwidth by physical arguments: 50 meters is a reasonable bandwidth for a crossroad / roundabout, and for comparison a radius of 2 kilometers is used to model the typical accident density in this region (there should other crossroads within 2 km in Europe). So end of the story: A) try to use more established statistics (such as KDE), and B) don't expect an off-the-shelf solution to do magic, but customize the method for your problem.
Catégories: Elsewhere

Vasily Yaremchuk: Don't forget to check Backup&Migrate settings after D6 to D7 upgrade!

Planet Drupal - mar, 22/04/2014 - 13:41

Several days ago we upgraded simple Drupal 6 site to Drupal 7. After core upgrade process was finished we turned on all necessary modules such as Admin menu and Backup & Migrate.

Some features required custom update by scripts and some manual work, we made backup before this activity.
... something went wrong and we go back by restoring DB via Backup&Migrate module and site wend down :-(

When we took a look on DB backup script we found that there was empty dump with the structure of some tables.
So as a result the data in several tables was killed.

When we repeated upgrade process again and took a look on Backup&Migrate advanced settings we were shocked

By some reason all tables was excluded from backup.

After we align B&M settings backup became works correctly :-)

The main idea of this post due to automatic upgrade process you should double check settings of contributed modules, upgrade can make them different according initial state.

And, of course, backups is necessary part of site development activity but you should be sure that your backups correct.

Blog tags:
Catégories: Elsewhere

Steve McIntyre: Linaro welcomes GSOC 2014 students

Planet Debian - mar, 22/04/2014 - 13:33

After several weeks of review and discussion, the application and selection period for the 2014 Google Summer of Code is over. 4,420 students proposed a total of 6,313 projects for this summer. From those, 1,307 students have been accepted (more details), and Linaro is one of the 190 Open Source projects that will be working with students this year.

In our first year as a GSOC mentoring organisation, we received 17 applications and Google allocated us 3 slots for student projects. It was quite a challenge to pick just 3 projects from the excellent field, and it's a shame that the limited number of slots meant we had no choice but to disappoint some people. Thanks to all those who applied!

I'm delighted to announce our 3 chosen interns for 2014:

  • Gaurav Minocha is a graduate student at the University of British Columbia, Vancouver, Canada. His project is Linux Flattened Device Tree Self-checking, mentored by Grant Likely from Linaro's Office of the CTO.
  • Ricardo de Freitas Gesuatto is a student at Federal University of São Carlos (UFSCar), Brazil. He will be working on a project entitled "Lightweight IP Stack on top of OpenDataPlane", mentored by Maxim Uvarov from the Linaro Networking Group.
  • Varad Gautam is a student at Birla Institute of Technology and Science, Pilani, India. He will be Porting UEFI to Low-Cost Embedded Platform (BeagleBoneBlack). Leif Lindholm from the Linaro Enterprise Group will be mentoring.

Please join me in welcoming these three new engineers to the Linaro team!

We have a GSOC wiki ready for our students to use at

https://gsoc.linaro.org/

and hopefully they will start adding content there soon about themselves and their projects (hint!). In the meantime, we have more information about our original proposals and the GSOC program in the main Linaro wiki.

Starting today, the next phase of the program is the so-called "bonding period". Students are encouraged to get to know people within Linaro (especially their mentors!) and prepare to start work on their projects, whatever is needed. The official start of the work period for GSOC is May 19th, and it runs through to August 18th. We will give updates on progress through the summer, and we're hoping to talk about our results at the next Linaro Connect in September.

Good luck, folks!

Catégories: Elsewhere

Open Source Training: Personalized Content Feeds in Drupal

Planet Drupal - mar, 22/04/2014 - 12:02

One of our members wanted to allow users to create customized information feeds in Drupal.

In this tutorial, we'll show you how to do that.

We'll show you how to allow users to choose only certain types of content to show. This could be useful for news sites, but also for many other types of site where users want personalized content.

In this example, we're going to create a list of movies that will only show genres that the user chooses.

Catégories: Elsewhere

Bits from Debian: Debian welcomes its 2014 GSoC students!

Planet Debian - mar, 22/04/2014 - 11:15

We're excited to announce that 19 students have been selected to work with Debian during the Google Summer of Code this year!

Here is the list of accepted students and projects:

As always, you will be able to follow their progress on the SoC coordination mailing-list

Congratulations to all the students and let's make sure we all have an amazing summer!

Catégories: Elsewhere

Simon Kainz: Valerie

Planet Debian - mar, 22/04/2014 - 11:05

This will be my one and only off-topic posting, but I just have to share all my joy and happiness with all of you!

On monday, April 14th 2014, our beautiful daughter Valerie was born. As we almost live next door to our midwife, we just grabbed our stuff and walked over to the midwife's house, as my wife told me "things are starting". My wife was very glad to be able to give birth in such a beautiful, cosy and comfortable place, with no hassle, no beeping machines and nervous hospital staff running around. This helped her to "let go", and she gave birth to our beautiful daughter after about 2 hours.

I took a 4 week break from work to support my wife and daughter. This is quite involving :-) , so please forgive me if I don't reply quickly to your mails.

Screenshot:

Catégories: Elsewhere

Bits from Debian: Debian welcomes its 2014 GSoC students!

Planet Debian - mar, 22/04/2014 - 11:00

We're excited to announce that 19 students have been selected to work with Debian during the Google Summer of Code this year!

Here is the list of accepted students and projects:

As always, you will be able to follow their progress on the SoC coordination mailing-list

Congratulations to all the students and let's make sure we all have an amazing summer!

Catégories: Elsewhere

blog.studio.gd: Create automatic URL alias in drupal

Planet Drupal - mar, 22/04/2014 - 10:22

Every time you create a site with drupal you may add a new contextual tab for a node or for a user. if you have used pathauto to create automatic (multilangual) aliasing of user and node url, so on, you got good urls for SEO ! But your custom module urls must also be optimised for search engines.

For the example we create a node type called article, and we add a two custom url : Poll and Photos.

/** * Implements hook_menu(). */ function module_name_menu() { $items = array(); $items['node/%node/poll'] = array( 'title' => 'Poll', 'page callback' => 'module_name_poll_page_view', 'page arguments' => array(1, 2), 'access callback' => 'node_access', 'access arguments' => array('view', 1), 'type' => MENU_LOCAL_TASK, ); $items['node/%node/photos'] = array( 'title' => 'Photos', 'page callback' => 'module_name_photos_page_view', 'page arguments' => array(1, 2), 'access callback' => 'node_access', 'access arguments' => array('view', 1), 'type' => MENU_LOCAL_TASK, ); return $items; }

With pathauto enabled, we have a customisable, translatable pattern url for the node page :
http://example.com/node/245
that became
http://example.com/content/article-title

BUT

http://example.com/node/245/poll and http://example.com/node/245/photos
stay
http://example.com/node/245/poll and http://example.com/node/245/photos

To fix that issue you can implement the pathauto api to create custom URL patterns :

/** * Implements hook_pathauto(). */ function module_name_pathauto($op) { switch ($op) { case 'settings': $settings = array(); $settings['module'] = 'module_name'; $settings['token_type'] = 'node'; $settings['groupheader'] = t('Module_name node paths'); $settings['patterndescr'] = t('Default pattern'); $settings['patterndefault'] = ''; $settings['batch_update_callback'] = 'module_name_pathauto_bulkupdate'; $path = array( 'module_name_node_poll' => 'Module_name poll path', 'module_name_node_photos' => 'Module_name photos path', ); $langs = array_keys(language_list()); foreach ($path as $k => $p) { foreach ($langs as $lang) { $path[$k . '_' . $lang] = $p . ' for language ' . $lang; } unset($path[$k]); } $settings['patternitems'] = $path; return (object) $settings; } }

The custom pattern are done. More example for the implementation of this hook

When a new node is created, updated or deleted the alias must be updated or deleted, to do that we use the hook provided by drupal :

/** * Implements hook_node_insert(). */ function module_name_node_insert($node) { module_name_create_alias($node, 'insert'); } /** * Implements hook_node_update(). */ function module_name_node_update($node) { module_name_create_alias($node, 'update'); } /** * Implements hook_node_delete(). */ function module_name_node_delete($node) { module_load_include('inc', 'pathauto'); pathauto_path_delete_all('node/' . $node->nid . '/poll'); pathauto_path_delete_all('node/' . $node->nid . '/photos'); } /** * Module_name create alias for a node custom urls. */ function module_name_create_alias($node, $op) { $langs = array_keys(language_list()); module_load_include('inc', 'pathauto'); foreach ($langs as $lang) { pathauto_create_alias('module_name', $op, 'node/' . $node->nid . '/poll' , array('node' => $node), 'module_name_node_poll_' . $lang, $lang); pathauto_create_alias('module_name', $op, 'node/' . $node->nid . '/photos' , array('node' => $node), 'module_name_node_photos_' . $lang, $lang); } }

To generate/update your urls alias with the bulk update interface or with drush there is callback defined in the hook_pathauto : "batch_update_callback" :

/** * Implements hook_pathauto_bulkupdate. */ function module_name_pathauto_bulkupdate() { if (!isset($context['sandbox']['current'])) { $context['sandbox']['count'] = 0; $context['sandbox']['current'] = 0; } $query = db_select('node', 'n'); $query->addField('n', 'nid'); $query->leftJoin('url_alias', 'ua', " ua.source LIKE CONCAT('node/', n.nid, '/%')"); $query->isNull('ua.source'); $query->condition('n.nid', $context['sandbox']['current'], '>'); $query->orderBy('n.nid'); $query->addTag('pathauto_bulk_update'); $query->addMetaData('entity', 'node'); // Get the total amount of items to process. if (!isset($context['sandbox']['total'])) { $context['sandbox']['total'] = $query->countQuery()->execute()->fetchField(); // If there are no nodes to update, the stop immediately. if (!$context['sandbox']['total']) { $context['finished'] = 1; return; } } $query->range(0, 25); $nids = $query->execute()->fetchCol(); $nodes = node_load_multiple($nids); foreach ($nodes as $node) { module_name_create_alias($node, 'bulkupdate'); } $context['sandbox']['count'] += count($nids); $context['sandbox']['current'] = max($nids); $context['message'] = t('Updated alias for node @nid.', array('@nid' => end($nids))); if ($context['sandbox']['count'] != $context['sandbox']['total']) { $context['finished'] = $context['sandbox']['count'] / $context['sandbox']['total']; } }

The code is over, you can fill the pattern in your site administration : admin/config/search/path/patterns
Let the default pattern blank and fill for each language and tabs the good patterns, example : "content/[node:title]/poll"

Catégories: Elsewhere

DrupalCon Amsterdam: Hallo from Amsterdam!

Planet Drupal - mar, 22/04/2014 - 08:10

DrupalCon Amsterdam is coming soon, and I can’t wait to welcome the Drupal community to this wonderful city. The conference is shaping up to be an absolutely incredible experience.

The local Dutch Drupal community has been hard at work coming up with a huge number of fun and cultural activities. From the Tour de Drupal bike ride from London to Amsterdam, to the Drupal bar crawl up and down the canals; DrupalCon Amsterdam is going to be a great place to learn more about Drupal, celebrate the community, and have a fantastic time.

Make sure you buy your ticket and reserve your hotel room as soon as possible, so you can get the best prices. In the coming weeks, we’ll be rolling out more information about the convention, sponsorship opportunities, and more.

The website is now live, so get your tickets here!

--
Baris Wanschers
Chairman, Stitching Drupal Nederland

Catégories: Elsewhere

Pages

Subscribe to jfhovinne agrégateur - Elsewhere