Skip to content

Software Development News: .NET, Java, PHP, Ruby, Agile, Databases, SOA, JavaScript, Open Source

Methods & Tools

Subscribe to Methods & Tools
if you are not afraid to read more than one page to be a smarter software developer, software tester or project manager!

Google Open Source Blog
Syndicate content
News about Google's Open Source projects and programs.
Updated: 3 hours 52 min ago

Roboto: Google’s signature font is now open source

Tue, 05/26/2015 - 18:00
The Roboto family of fonts, and the toolchain used in creating it, are now an open source project. Roboto is Google’s signature font, created by Google designer Christian Robertson. It is the default font used in Android and Chrome OS, and is the recommended font for Google’s visual language, Material Design.
The font files for the Roboto family of fonts were first released under the Apache license as part of Android 4.0 (Ice Cream Sandwich) in 2011. With this launch, we are making Roboto a true open source project, with a revamped font production toolchain that is completely based on open source software.
Another key improvement in the Roboto font family has been the vast expansion of its character coverage to include all Latin, Cyrillic and Greek characters in Unicode 7.0, as well as the currency symbol for the Georgian lari, to be published in Unicode 8.0. For the expansion, the number of glyphs provided in the fonts more than tripled in number, going from around 13,000 (1071 per font) to more than 40,000 (3350 per font). An earlier version of the expanded font family is included in Android 5.0 (Lollipop) and later.
This project involved close collaboration between various teams at Google: Material Design, Internationalization Engineering, Google Fonts and Android.
The Roboto open source project lives at https://github.com/google/roboto. Bug reports and other contributions are welcome.
By Roozbeh Pournader, Android Text team
Categories: Open Source

Google Summer of Code coding has begun!

Mon, 05/25/2015 - 18:00

GoogleSummer_2015logo_horizontal.jpg
Today is the first day of coding for our 11th year of the Google Summer of Code program. This year more than 1,046 students will spend the next 12 weeks writing code for 137 different open source organizations.
We are excited to see the contributions this year’s students will make to the open source community.
For more information on important dates for the program please visit our timeline. Stay tuned as we will highlight some of the new mentoring organizations over the next few months.
Have a great summer!
By Carol Smith, Open Source Programs
Categories: Open Source

Pie in your face — without the mess

Thu, 05/21/2015 - 23:00
Fun Propulsion Labs at Google is back with an exciting new release for game developers. We’ve updated Pie Noon (our open source Android game) to add support for Google Cardboard, letting you jump into the action directly using your Android phone as a virtual reality headset! Select your targets by looking at them and throw pies with a flick of the switch.
Look out for incoming pie!
We used the Cardboard SDK for Android, which helps simplify common virtual reality tasks like head tracking, rendering for Cardboard, and handling specialized input events. And you might remember us from before, bringing exciting game technologies like FlatBuffers, Pindrop, and Motive, all of which you can see in use in Pie Noon.
You can grab the latest version of Pie Noon on Google Play to try it out, or crack open the source code and take a look at how we brought an existing game into virtual reality.
By Anthony Maurice, Fun Propulsion Labs at Google
Categories: Open Source

GSoC 2015 Stats Part 2: Universities

Tue, 05/19/2015 - 23:10
For the second statistics post for Google Summer of Code (GSoC) 2015 we focus on the universities that our accepted students attend. With this being the 11th year of GSoC we have listed the top 11 schools with the highest number of accepted students for 2015. You’ll notice many familiar names on the list with a couple of new additions to the list. Congratulations to the International Institute of Information Technology - Hyderabad for claiming the top spot for the second consecutive year.
UniversityCountry# of Accepted Students in 2014# of Accepted Students in 2015International Institute of Information Technology - HyderabadIndia6962University of MoratuwaSri Lanka4444Birla Institute of Technology and Science, Pilani (BITS Pilani)India2618Birla Institute of Technology and Science Pilani, K.K.Birla Goa CampusIndia2515Budapest University of Technology and EconomicsHungary1214University POLITEHNICA Of BucharestRomania1714Bejing (Peking) UniversityChina513Indian Institute of Technology, BombayIndia1513Indian Institute of Technology (BHU) VaranasiIndia1312National University of SingaporeSingapore1411University of BueaCameroon310
As no surprise, the majority of this year’s students are enrolled in Computer Science, IT and other technical degree programs. GSoC is by no means only for those pursuing CS degrees though — in 2015 we have students pursuing degrees in fields including Astronomy, Geomatics, Law, Music, Oceanography and Philosophy.
A big thank you to all of the professors, schools and alumni who support the Google Summer of Code program. The goal of GSoC is to get students excited about open source development, help build their coding skills and gain real world experience working with open source software projects. We hope that the experience will help them in their careers regardless of the university they attend.
For more statistics on this year’s program check out our country post and be on the lookout for more GSoC 2015 statistics posts in the coming weeks.
By Stephanie Taylor, Open Source Programs
Categories: Open Source

Google Code-in 2014 wrap up with KDE

Thu, 05/07/2015 - 17:00
The KDE community was one of the twelve mentoring organizations which took part in Google Code-in 2014, our open source coding contest for 13 to 17 year old students. Mentor and co-administrator Heena Mahour wrote in to tell us about the students’ accomplishments with KDE.

KDE is an international free software community. We’re best known for the Plasma Desktop which is the default for several Linux distributions, but we produce an entire integrated set of cross-platform applications designed to run on Linux, FreeBSD, Solaris, Windows, and OS X systems. We’re also an umbrella project for many standalone applications based on our technology.
The KDE community participated in Google Code-in (GCI) to inspire young contributors and offer them an opportunity to get involved with KDE and open source. We created 277 tasks for students to choose from, and 29 mentors volunteered to help the students with their work. Of the many projects that are part of KDE, the team behind the Marble virtual globe created the most tasks for us with 50. We also provided 65 different beginner tasks to help students without any experience take their first step as an open source contributor before moving on to more challenging tasks.
Tasks in GCI come in several categories. We offered 190 coding tasks, 26 for documentation and training, and 41 for quality assurance. It was a joy for us to see students working with the mentors and learning how to become part of an open source community. At the end of the contest, 240 tasks had been completed!
Like every organization taking part, we were able to select two students as Grand Prize Winners. From the students who completed the most tasks successfully, we considered the creativity, thoroughness, and quality of their work. Mikhail Ivchenko from Russia and Ilya Kowalewski from Ukraine were selected as our winners and will soon be visiting Google’s headquarters along with the other GCI winners.
We’re all grateful for the opportunity GCI gave us to work with these enthusiastic young students and get them involved with KDE. We hope to continue seeing their names in the future -- keep it up, everyone!

by Heena Mahour, KDE mentor and co-administrator
Categories: Open Source

GSoC 2015 stats part 1: All about the countries

Tue, 05/05/2015 - 17:00
01_GSOC_header.jpg
As we gear up for the start of the 11th Google Summer of Code, we’ve been putting together some interesting numbers and stats for this year’s program.  Every year within minutes of the accepted students being announced, we are asked “how many students from my country were accepted?” and “how many students from my school were accepted?” We’ll be answering these kinds of questions with a few posts over the next few weeks, starting today.
Let’s start with our country-specific stats. Last year when we decided to list all of the countries with accepted students it was a huge hit, so why mess with success? The 73 countries represented by this year’s 1,051 GSoC accepted students are listed alphabetically below.
Argentina2
Kuwait1Armenia1
Lithuania1Australia4
Luxembourg2Austria8
Malaysia1Bangladesh1
Mexico5Belarus6
Moldavia2Belgium2
Morocco1Brazil15
Netherlands10Bulgaria2
New Zealand2Cameroon12
Nigeria1Canada23
Norway3Chile1
Pakistan2China49
Paraguay1Colombia2
Peru2Croatia4
Philippines2Czech Republic3
Poland33Denmark1
Portugal13Dominican Republic1
Romania19Ecuador1
Russian Federation38Egypt7
Singapore11Estonia1
Slovak Republic6Finland5
South Korea5France18
Spain30Germany50
Sri Lanka58Greece9
Sweden3Guatemala1
Switzerland5Honduras1
Taiwan2Hong Kong4
Tunisia2Hungary23
Turkey8India335
Uganda1Indonesia1
Ukraine8Ireland3
United Arab Emirates3Italy19
United Kingdom13Jamaica1
United States127Japan6
Uruguay1Kazakhstan1
Vietnam2Kenya4



We have two countries being represented by students for the first time this year: Kuwait and United Arab Emirates - welcome to the GSoC family! With these two additions, we now have 103 countries where students have been accepted into the GSoC program since 2005.
As you may have seen in recent posts, there are many students and mentors throughout Africa and all around the world working very hard to spread the word about GSoC to their communities. We are happy to announce that Cameroon quadrupled their number of accepted students in 2015 to 12!
In our upcoming posts, we will delve deeper into the stats by looking at the universities with the most accepted students, degrees sought by students, gender numbers, and mentor stats. If you have other questions that you’d like to ask, please leave a comment on this post and we will try to answer your question in an upcoming post.
By Stephanie Taylor, Open Source Programs
Categories: Open Source

Open Location Code: Addresses for everything, everywhere

Thu, 04/30/2015 - 17:00
Accurate street addresses are taken for granted in much of the world. But in many areas, formal street names and addresses don't exist and the only real alternative is to use addresses of the form "behind the old bus stop". Without a street address, it's difficult to organise deliveries, to receive visitors or to find businesses. And street addresses only work where there are named and numbered streets - without these, there's no easy way to provide someone with a location.image03.pngArea with unknown street names in Indonesia. (Google Maps)Latitude and longitude coordinates can specify any location, but they’re long and cumbersome. What if they were more human-friendly, like a very accurate postcode that refers to just your home? We’re happy to share Open Location Code, a stand-alone open source library for this purpose.Open Location Codes are derived from latitude and longitude coordinates, so they already exist everywhere. They are similar in length to a telephone number -- 849VCWC8+R9, for example -- but can often be shortened to only four or six digits when combined with a locality (CWC8+R9, Mountain View).  Locations close to each other have similar codes. They can be encoded or decoded offline, and the character set was chosen to avoid spelling words in more than 30 different languages. We removed similar looking characters to reduce confusion and errors, and because they aren't case-sensitive, they can be easily exchanged over the phone.
image04.pngimage00.pngWorld's largest carrot,
H3+XG Ohakune, New Zealand.The big gumboot.
GV+8J Taihape, New Zealand.
Developers of websites that need location from users (such as delivery or taxi firms in locations where street addresses are poorly defined) could use these codes to get accurate locations from their users. Other services which map locations that don't have street addresses (such as water sources, mountain refuges, or nesting sites) could use these codes since they don't rely on street information.
image02.pngimage01.pngThe big trout.
2W+GW Gore, New Zealand.Kime Hut, in New Zealand's Tararua Ranges.
We have a sample implementation to find and use codes at plus.codes. You can download the latest release of the library from our GitHub page and join our discussion list to learn more.
by Doug Rinckes, Travel team
Categories: Open Source

Students announced for Google Summer of Code 2015

Mon, 04/27/2015 - 20:47
GoogleSummer_2015logo_horizontal.jpg

Congratulations to the 1,051 students accepted for our 2015 Google Summer of Code! It was tough for the 137 mentoring organizations to choose from the huge number of applications we received - 6,409 proposals from 4,425 students - and we want to thank everyone who applied.

Accepted students will now enter the community bonding period where they will get to know their mentors and prepare for the program by reading documentation, hanging out in their IRC channel and familiarizing themselves with their new community before beginning their actual coding in May.

If you are interested in learning more about the 137 organizations that the students will be working with during the summer or reviewing important dates, please visit the program website.

We look forward to an exciting and productive summer of coding.
By Carol Smith, Open Source Programs Office
Categories: Open Source

New projects in GSoC 2015

Thu, 04/23/2015 - 17:00
GoogleSummer_2015logo_horizontal.jpg
As the summer draws near, we’re getting ready to announce the students accepted into Google Summer of Code (GSoC) 2015. With guidance from mentors, those students will spend their summer coding for one of the 137 open source projects that are participating this year.
This is the 11th summer we’ve run the program and many of the projects have been part of GSoC in the past, but we also have 30 projects which are making their GSoC debut this year. Welcome to GSoC, we’re looking forward to seeing the students’ contributions to your work!
  • Africa Soil Information Service
  • Bika Open Source LIMS Collective
  • Boston University / XIA
  • CentOS Project
  • CloudCV
  • Department of Biomedical Informatics, Stony Brook University
  • Foundation for Learning Equality
  • GitHub
  • Global Alliance for Genomics & Health
  • Google Kubernetes
  • HPCC Systems
  • Liquid Galaxy Project, Interactive Spaces
  • IP-over-P2P Project
  • JdeRobot - Universidad Rey Juan Carlos
  • jQuery Foundation
  • lowRISC
  • MBDyn, Department of Aerospace Engineering at the Polytechnic University of Milan
  • MEDES-IMPS
  • MinnowBoard Project
  • NumFOCUS
  • OncoBlocks
  • P2PSP.org
  • Pencil Code Foundation
  • Portable Native Client
  • Red Hen Lab
  • RIOT
  • Rspamd spam filtering system
  • Saros
  • Sustainable Computing Research Group ( SCoRe )
  • University of Nebraska - Helikar Lab

You can learn more about all of this year’s participating organizations at the program website. Students, check back on Monday, April 27th to see if your application has been accepted.
by Ashleigh Rentz, Open Source Programs Office
Categories: Open Source

Jsonnet: a more elegant language for composing JSON

Mon, 04/20/2015 - 17:00
A few months ago, we quietly released Jsonnet: a simple yet rich configuration language (i.e., a programming language for specifying data). Many systems can be configured with JSON, but writing it by hand is troublesome. Jsonnet is packed with useful data-specification features that expand into JSON for other systems to act upon. Below is a trivial example of such expansion:

// Jsonnet Example
{
   person1: {
       name: "Alice",
       welcome: "Hello " + self.name + "!",
   },
   person2: self.person1 { name: "Bob" },
}
➡{
  "person1": {
     "name": "Alice",
     "welcome": "Hello Alice!"
  },
  "person2": {
     "name": "Bob",
     "welcome": "Hello Bob!"
  }
}
Jsonnet doesn’t just generate JSON: Jsonnet is also an extension of JSON. By adding new constructs between the gaps of existing JSON syntax, Jsonnet adds useful features without breaking backwards compatibility. Any valid JSON is also a valid Jsonnet program that simply emits that JSON unchanged, and existing systems that consume JSON (or its cousin YAML) can be easily modified to accept data in the full Jsonnet language. As such, Jsonnet is an example of a templating language, but one specifically designed for JSON data and less error-prone than other techniques.“Jsonnet” is a portmanteau of JSON and sonnet. We chose that name to convey that data expressed in Jsonnet is easier to write and maintain because it is more elegant and concise, like a poem. This is not just due to syntactic niceties like comments and permissive quotes/commas, but because Jsonnet has all the modern multi-paradigm programming language conveniences needed to manage complexity. One key benefit is the ability to use Jsonnet's mixin and import features to write modular configuration template libraries, allowing the creation of domain-specific configuration languages for particular applications.Most configuration languages are created ad-hoc for the needs of a given application, accruing features over time and becoming unwieldy. From day one, Jsonnet was designed as a coherent programming language, benefitting from both academic techniques and our experience implementing production languages. Unlike most configuration languages, Jsonnet has a full operational semantics, ensuring matching behavior from third party implementations as well as mathematical analysis. It is a very small and carefully chosen extension to JSON that can express both object-oriented and declarative styles. More importantly, unlike regular programming languages, Jsonnet is hermetic:  Its evaluation is independent of any implicit environmental factors, ensuring that high level configuration will resolve to the same thing every time.Jsonnet is open source. It’s currently available as a library with C and Python bindings, and also as a command line utility. A real-world example configuration can be found on the website, where 217 lines (9.7kB) of Jsonnet expand into 740 lines (25kB) of configuration for other tools. Learn more about Jsonnet by reading the tutorial and experimenting with our javascript demo!

by Dave Cunningham, New York Technical Infrastructure team
Categories: Open Source

Student ambassadors bring GSoC 2015 to more African students

Thu, 04/16/2015 - 14:00
Student applications for Google Summer of Code (GSoC) 2015 closed on March 27th and this year’s mentoring organizations are now busy reviewing student proposals. While we await the results of that process, we’ve been looking at some of the early statistics for this year’s program.
One thing we’re very excited to see is that we received nearly four times as many student applications from Sub-Saharan Africa compared to last year! The gain primarily came from four countries: Cameroon, Kenya, Nigeria, and Uganda. These countries combined had just 45 students apply in 2014, but that number jumped up to 183 this year. Why was the increase concentrated in these locations? There’s a common thread that seems to be responsible: they are places where students active in the Google Student Ambassador (GSA) program organized local GSoC meet-up events.
Cameroon
After lending a hand to a fellow student organizing a meetup in December, GSA Tekang Check brought 77 students together in March at the University of Buea to learn about GSoC and help students apply. Participants from past years shared their experiences and encouraged attendees to submit proposals for projects they felt passionate about.

Kenya
GSA John Muchiri welcomed over 100 students from St Paul’s University to a GSoC meet-up. The speakers talked about the characteristics good programmers develop and encouraged students to challenge themselves by applying to the program.
At Jomo Kenyatta University of Agriculture and Technology, GSAs Isaac Jumba and Dickson Marienga introduced students to GSoC as part of the local DevFest event which drew over 150 attendees. The session gave an overview of GSoC and encouraged students to sign up for a regional GSoC enthusiasts mailing list.

Nigeria
GSAs Ilo Calistus, Okwara Godswill, and Mgbemena Chike collaborated on a pair of events at the University of Nigeria in Nsukka. The first introduced students to the basics of programming for Android while the second taught students about using Git. Both events also introduced students to the world of open source and encouraged them to take part in GSoC.

At Ekiti State University, GSAs Sadiq Mary Oiza and Alabea Dare Micheal organized a GSoC meet-up for 35 students. After a discussion about current events at the university, the presenters gave an overview of the GSoC program and encouraged students to create profiles on the program website.

GSA James Uzoma organized a meet-up at the Federal University of Agriculture, Abeokuta where 40 students from 6 colleges enjoyed a series of talks featuring stories from fellow Nigerians who had participated in past years, an explanation of the requirements for participating, and some details about the different open source organizations students could apply to work with.
Uganda
GSA Kagimu Brian brought together 72 students for a GSoC meet-up at Mbarara University of Science and Technology. Attendees learned about the benefits and experiences that can come from taking part in GSoC, along with an introduction to Git.


Only a limited number of students can be accepted in GSoC each year, but we hope to welcome several of the students who attended these events into this year’s program. Accepted students will be notified via email by 19:00 UTC on April 27th, so keep watching your inbox.

By Ashleigh Rentz, Open Source team
Categories: Open Source

UIforETW: Windows Profiling Made Easier

Tue, 04/14/2015 - 17:00
Microsoft’s Event Tracing for Windows (ETW, aka xperf) is an amazing tool for understanding the performance of Windows computers. ETW offers an incredibly deep view into the entire system and allows investigations of complex problems that would otherwise be intractable. It can even be used to record traces on a customer’s machine for later analysis on a developer’s machine, to investigate performance problems that cannot be reproduced locally.

However, the process of recording ETW trace has always been challenging, so we’re pleased to share a new tool we’ve been developing:  UIforETW. This tool brings point-and-click simplicity to recording ETW traces, works around several trace recording bugs, and is a handy dashboard for managing and annotating traces. And since UIforETW is open source, you can add additional features for your own particular needs.



Tracing can be done to a file or to an in-memory circular buffer. Trace compression, high-speed sampling, heap tracing, and other options can be configured with the click of a button. UIforETW lists the recorded traces and lets users rename and annotate them. When you want to analyze a trace, you can launch Microsoft’s trace viewers from UIforETW, and UIforETW will configure improved viewer defaults for WPA.

UIforETW was written by a Chrome developer, so it has a few Chrome specific features. If the Chrome symbol server is enabled, then UIforETW downloads and strips the Chrome symbols in order to avoid a twenty five minute delay when WPA loads the symbols. UIforETW also preprocesses the traces in order to categorize the Chrome processes by type. These features can be turned off in the Settings dialog if you aren’t working on Chrome. While the Chrome specific features will not be needed by most developers, they demonstrate the potential value from custom processing of traces.

UIforETW is a new project but is already being used for production work. More technical details and information about UIforETW and ETW in general can be found in the author's blog post and discussions can be had at our discussion group. Information about contributing to UIforETW can be found in the CONTRIBUTING file in the GitHub repo.
by Bruce Dawson, Chrome team
Categories: Open Source

FlatBuffers 1.1: a memory-efficient serialization library

Mon, 04/13/2015 - 22:51
After months in development, the FlatBuffers 1.1 update is here. Originally released in June 2014, it’s a highly efficient open source cross-platform serialization library that allows you to read data without parsing/unpacking or allocating additional memory. It supports schema evolution (forwards/backwards compatibility) and optional JSON conversion. We primarily created it for games written in C++ where performance is critical, but it’s also useful more broadly. This update brings:

  • an extensive overhaul to the Java API
  • out-of-the-box support for C# and Go
  • an optional verifier to make FlatBuffers practical in untrusted scenarios
  • .proto parsing for easier migration from Protocol Buffers
  • optional manual assignment of field IDs
  • dictionary functionality through binary search on a key field
  • bug fixes and other improvements thanks to 200+ commits from 28 contributors -- thank you!


Download the latest release from our github page and join our discussion list for more details.
By Wouter van Oortmerssen, Fun Propulsion Labs at Google*
*Fun Propulsion Labs is a team within Google that's dedicated to advancing gaming on Android and other platforms.
Categories: Open Source

Google Code-in 2014 wrap up with Drupal

Fri, 04/10/2015 - 17:00
Drupal, one of the Google Code-in 2014 mentoring organizations, has been working toward the release of a new major version. Grand prize winner Getulio Valentin Sanchez contributed to the upcoming release during the contest and shared his story with us.

I was 13 years old the first time I got access to a computer. I had no idea how to connect it to the internet, but that didn’t stop me from experimenting. When I was 14, I saw a documentary about Google and discovered that “programming” and “coding” were completely different things than I’d thought. In that same documentary, I saw Google’s offices and I resolved to myself that I would try to visit them in person by the time I turned 18.
After participating in an OMAPA Computer Olympics event here in Paraguay, a Google Code-in (GCI) mentor from Sugar Labs contacted me to ask if I could help spread the word about GCI in my local community. During that conversation, the mentor encouraged me to enter GCI myself. He pointed out that Drupal was one of the mentoring organizations and they use a lot of PHP, the language I’m most familiar with.
Before GCI, I had never worked with an open source project, nor did I know how to create a patch or anything like that. But since it was a possible opportunity to achieve the dream I’d set for myself, I thought “why not learn something new?”
When the contest began, I got to work on my first task: porting the simple but useful Scroll To Top module to Drupal 8. It was astonishing to me when my patch was approved and committed. With that astonishment came an amazing sensation in knowing that somewhere in the world, someone will be using something that I made. Tasks like these were a little challenging, but I quickly fell in love with this type of work and created a series of blog posts and a video about the process.
I continued porting modules to Drupal 8 throughout the GCI contest. I think the most difficult task I faced was porting the Administer Users by Role module. This wasn’t because it’s a large module, but rather because I had to learn about access checking which I’d never heard about before. Although this wasn’t impossible, it took me about a week to get an initial version ready for the community’s consideration.
The seven weeks I spent participating in GCI taught me a lot. I learned about following coding standards, programming concepts like dependency injection and the Hollywood principle, some of the more powerful features of Git, and features of PHP that I hadn’t even known existed!
People say every end is a new beginning, and that’s been true for me. The end of GCI 2014 was also the beginning of my experience as a regular contributor to Drupal. I now spend my weekends working with this amazing platform and collaborating with the Drupal community. And soon, I’ll be beginning my journey to see Google’s offices in person like I’d dreamed of before -- I began with a humble “Hello World” and eventually became one of the GCI 2014 Grand Prize Winners.

by Getulio Valentin Sanchez, GCI grand prize winner
Categories: Open Source

How to format Python code without really trying

Thu, 04/09/2015 - 21:54
Years of writing and maintaining Python code have taught us the value of automated tools for code formatting, but the existing ones didn’t quite do what we wanted. In the best traditions of the open source community, it was time to write yet another Python formatter.
YAPF takes a different approach to formatting Python code: it reformats the entire program, not just individual lines or constructs that violate a style guide rule. The ultimate goal is to let  engineers focus on the bigger picture and not worry about the formatting. The end result should look the same as if an engineer had worried about the formatting.
You can run YAPF on the entire program or just a part of the program. It’s also possible to flag certain parts of a program which YAPF shouldn’t alter, which is useful for generated files or sections with large literals.
Consider this horribly-formatted code:
x = {  'a':37,'b':42,
'c':927}
y = 'hello ''world'z = 'hello '+'world'a = 'hello {}'.format('world')class foo  (     object  ):  def f    (self   ):    return       \37*-+2  def g(self, x,y=42):      return ydef f  (   a ) :  return      37+-+a[42-x :  y**3]
YAPF reformats this into something much more consistent and readable:
x = {'a': 37, 'b': 42, 'c': 927}
y = 'hello ' 'world'z = 'hello ' + 'world'a = 'hello {}'.format('world')

class foo(object):    def f(self):        return 37 * -+2
   def g(self, x, y=42):        return y

def f(a):    return 37 + -+a[42 - x:y ** 3]
Head to YAPF's GitHub page for more information on how to use it, and take a look at YAPF’s own source code to see a much larger example of the output it produces.
by Bill Wendling, YouTube Code Health Team
Categories: Open Source

Google Summer of Code: Meet-up Round-up!

Thu, 04/09/2015 - 21:51
Over the past ten years, Google Summer of Code (GSoC) has given over 8,500 students a bridge into open source communities. GSoC alumni have played a large role in the program’s success by encouraging their fellow students to take part. Around the world, energetic students who have already participated in GSoC lead the way by hosting meet-up events that help others learn about the opportunities GSoC provides and get answers to their questions about the program. Who better than GSoC alumni to tell students what it’s really like spending the summer coding for open source projects?

Student applications for GSoC 2015 are open until March 27th, so the community has been spreading the word at school and beyond during the past few months. Here are just a few of the student-initiated events we’ve heard about recently.
Buea, Cameroon: 17 December 2014
Chris Nuvagda wanted to spread the word about GSoC after finishing his project, so he reached out to other GSoC alumni at the University of Buea to make it happen. Over 150 students attended the meet-up, with about 30% being women -- a number we’re happy to hear since only 10% of GSoC 2014 students were women and we’re trying to improve on that. The 5 presenters spoke about their experiences in GSoC and the benefits of it, gave advice on writing a great proposal, and shared what it’s like for women working in open source. Read more...


Delhi, India: 31 January 2015
Heena Mahour and Ayush Gupta hosted a meet-up for about 200 prospective students and open source enthusiasts. With help from others in their community, they organized a full-day event featuring 8 speakers. Students who previously participated with organizations like KDE, OWASP, and Mifos shared their experiences and answered questions from the audience. Technical topics were also discussed, including memory leaks and an introduction to version control systems. Read more...


Udine, Italy: 24 February 2015
Claudio Desideri spent GSoC 2014 coding for KDE and organized a meet-up for students at the University of Udine. With 80 attendees, there were just barely enough seats for everyone. Claudio shared his personal experiences but also learned that many students who might want to apply to GSoC fear being judged by potential mentors or failing out of the program. He helped reassure students that GSoC is an opportunity to grow and that they aren’t expected to already know everything. Read more...


Bangalore, India: 2 March 2015
With a desire to increase the participation of nearby colleges, especially among female students, Tejas Dharamsi and Rajath Kumar organized a GSoC meet-up at the Google Bangalore office. 102 students, including 44 women, from 11 colleges gathered to hear from the 6 speakers who shared details about the coding projects they worked on and gave practical advice for students applying to GSoC for the first time. The ending panel discussion gave attendees a chance to ask questions and offered students encouragement to apply for the program. Read more...


Kampala, Uganda: 12 March 2015
Organized by Kaweesi Joseph with help from OpenMRS, the organization he worked with during GSoC 2014, more than 110 students gathered for this meet-up. The 5 presenters discussed the benefits of contributing to open source, how students can participate in GSoC, and how OpenMRS is being used in Uganda. Read more...


We thank these GSoC alumni and many more who are spreading their enthusiasm for open source in their local communities. It’s because of local networking events like these that GSoC is able to have rich representation from all around the world. We look forward to welcoming some of these meet-up attendees into the upcoming Google Summer of Code 2015 -- don’t forget to apply before March 27th!

By Ashleigh Rentz, Open Source team, with thanks to everyone who allowed us to share their stories and photos here.
Categories: Open Source

We throw pie with a little help from our friends

Thu, 04/09/2015 - 21:32

(Cross-posted with the Google Developers Blog)

Fun Propulsion Labs at Google* is back today with some new releases for game developers. We’ve updated Pie Noon (our open source Android TV game) with networked multi-screen action, and we’ve also added some delicious new libraries we’ve been baking since the original release: the Pindrop audio library and the Motive animation system.

Pie Noon multi-screen action

Got an Android TV and up to 4 friends with Android phones or tablets? You’re ready for some strategic multi-player mayhem in this updated game mode. Plan your next move in secret on your Android phone: will you throw at an opponent, block an incoming attack, or take the risky approach and wait for a larger pie? Choose your target and action, then watch the Android TV to see what happens!

We used the NearbyConnections API from the most recent version of Google Play Games services to easily connect smartphones to your Android TV and turn our original Pie Noon party game into a game of turn-based strategy. You can grab the latest version of Pie Noon from Google Play to try it out, or crack open the source code and take a look at how we used FlatBuffers to encode data across the network in a fast, portable, bandwidth-efficient way.

Pindrop: an open source game audio library

Pindrop is a cross-platform C++ library for managing your in-game audio. It supports cross compilation to Android, Linux, iOS and OSX. An early version of this code was part of the first Pie Noon release, but it’s now available as a separate library that you can use in your own games. Pindrop handles loading and unloading sound banks, tracking sound locations and listeners, prioritization of your audio channels, and more.

Pindrop is built on top of several other pieces of open source technology:

  • SDL Mixer is used as a backend for actually playing the audio.
  • The loading of data and configuration files is handled by our serialization library, FlatBuffers.
  • Our own math library, MathFu, is used for a number of under-the-hood calculations.

You can download the latest open source release from our GitHub page. Documentation is available here and a sample project is included in the source tree. Please feel free to post any questions in our discussion list.

Motive: an open source animation system

The Motive animation system can breathe life into your static scenes. It does this by applying motion to simple variables. For example, if you’d like a flashlight to shine on a constantly-moving target, Motive can animate the flashlight so that it moves smoothly yet responsively.

Motive animates both spline-based motion and procedural motion. These types of motion are not technically difficult, but they are artistically subtle. It's easy to get the math wrong. It's easy to end up with something that moves as required but doesn't quite feel right. Motive does the math and lets you focus on the feeling.

Motive is scalable. It's designed to be extremely fast. It also has a tight memory footprint -- smaller than traditional animation compression -- that's based on Dual Cubic Splines. Our hope is that you might consider using Motive as a high-performance back-end to your existing full-featured animation systems.

This initial release of Motive is feature-light since we focused our early efforts on doing something simple very quickly. We support procedural and spline-based animation, but we don't yet support data export from animation packages like Blender or Maya. Motive 1.0 is suitable for props -- trees, cameras, extremities -- but not fully rigged character models.  Like all FPL technologies, Motive is open source and cross-platform. Please check out the discussion list, too.

What’s Fun Propulsion Labs at Google?

You might remember us from such Android games as Pie Noon, LiquidFun Paint, and VoltAir, and such cross-platform libraries as MathFu, LiquidFun, and FlatBuffers.

Want to learn more about our team? Check out this recent episode of Game On! with Todd Kerpelman for the scoop!

by Jon Simantov, Fun Propulsion Labs at Google

* Fun Propulsion Labs is a team within Google that's dedicated to advancing gaming on Android and other platforms.

Categories: Open Source

Introducing gRPC, a new open source HTTP/2 RPC Framework

Thu, 04/09/2015 - 19:37

(Cross-posted from the Google Developers Blog)

Today, we are open sourcing gRPC, a brand new framework for handling remote procedure calls. It’s BSD licensed, based on the recently finalized HTTP/2 standard, and enables easy creation of highly performant, scalable APIs and microservices in many popular programming languages and platforms. Internally at Google, we are starting to use gRPC to expose most of our public services through gRPC endpoints as part of our long term commitment to HTTP/2.

Over the years, Google has developed underlying systems and technologies to support the largest ecosystem of micro-services in the world; our servers make tens of billions of calls per second within our global datacenters. At this scale, nanoseconds matter. Efficiency, scalability and reliability are at the core of building Google’s APIs.

gRPC is based on many years of experience in building distributed systems. With the new framework, we want to bring to the developer community a modern, bandwidth and CPU efficient, low latency way to create massively distributed systems that span data centers, as well as power mobile apps, real-time communications, IoT devices and APIs.

Building on HTTP/2 standards brings many capabilities such as bidirectional streaming, flow control, header compression, multiplexing requests over a single TCP connection and more. These features save battery life and data usage on mobile while speeding up services and web applications running in the cloud.

Developers can write more responsive real-time applications, which scale more easily and make the web more efficient. Read more about the features and benefits in the FAQ.

Alongside gRPC, we are releasing a new version of Protocol Buffers, a high performance, open source binary serialization protocol that allows easy definition of services and automatic generation of client libraries. Proto 3 adds new features, is easier to use compared to previous versions, adds support for more languages and provides canonical mapping of Proto to JSON.

The project has support for C, C++, Java, Go, Node.js, Python, and Ruby. Libraries for Objective-C, PHP and C# are in development. To start contributing, please fork the Github repositories and start submitting pull requests. Also, be sure to check out the documentation, join us on the mailing list, visit the IRC #grpc channel on Freenode and tag StackOverflow questions with the “grpc” tag.

Google has been working closely with Square and other organizations on the gRPC project. We’re all excited for the potential of this technology to improve the web and look forward to further developing the project in the open with the help, direction and contributions of the community.


by Mugur Marculescu, Product Manager
Categories: Open Source

Classp: a “classier” way to parse

Thu, 04/09/2015 - 19:37
If you’ve worked on compilers, translators, or other tools that need to read a programming language, chances are you’ve spent many painful hours detailing that language’s grammar. Recently, we opened up the source code for Classp, a side-project a few of us have been working on that demonstrates it’s possible to have an automatic parser generator that is not based on formal grammars. Instead of grammar productions, you write classes similar to C++ or Java and you write class patterns to define the syntax. Although there are libraries like Boost.Spirit and Scala Parsers that give you a nice way to write a grammar in the programming language itself, in the end you are still writing a grammar. Even though Classp looks a lot like C++ or Java, it is not just a C-like way to write a grammar. It’s an entirely different way to specify syntax.
Grammars are great for diagramming a complex syntactic structure for human readers, but as a computer specification, they leave a lot to be desired. Four key problems with grammars inspired us to work on Classp as an alternative.
First, a grammar is intended to represent the actual syntactic structure of the language: all of the little details like what goes first and what goes second, where to put your commas and semicolons, where can you substitute one thing for another, etc... But this surface structure doesn’t really matter to the programmer who wants to process the language. It just gets in the way. What you really care about are the logical parts of the declaration: what is the type? What is the name? Is there an initializer and what is it?
Second, many common parser generators don’t actually specify any tree at all. They let the programmer write actions to build up a parse tree. But the actions in most systems tend to form an awkward fit with the grammar.
Next, when you write a grammar, you have to worry not just about the surface structure of the language, but also about how the language will be parsed. You have to write the grammar around ambiguities in the language and sometimes around other features. You can’t just write the rules as you would write them for a human reader:
Expr ::= Int | ( Expr ) | Expr + Expr | Expr - Expr | Expr * Expr | Expr / Expr
instead, you have to write them in a way that avoids ambiguity:
Expr ::= Expr + Term | Expr - Term;Term ::= Term * Factor | Term / FactorFactor ::=  Int | ( Expr )
Finally, grammar-based parsers are extremely verbose. For serious parsing tasks, it is common to write a grammar, design a parse tree, write actions in the grammar to create the parse tree, design an abstract syntax tree, and write code to translate the parse tree into an abstract syntax tree. There are many dependencies among these parts that all have to be kept consistent over the life of the program. It’s a complex and error-prone process.
Classp attempts to avoid these problems. The abstract syntax tree is what programmers typically want to work with. With class patterns, you only have two jobs: design the abstract syntax tree and write a formatter for it. (A formatter is the function that writes out the abstract syntax tree in the target language.)
Here’s an example class declaration for an abstract syntax tree. The class pattern is the part inside the parentheses of the syntax statement: “arg1 '+' arg2”.
class Plus: Expression {  Expression arg1;  Expression arg2;  syntax(arg1 '+' arg2);}
This class pattern says that to print a Plus node, you first print arg1, then you print a plus sign, then you print arg2. So it looks like a nice formatting language, but where do we specify the parser? The answer is that we don’t specify a parser; Classp will invert the formatter to generate a parser for us. Since formatters are typically much easier to write and maintain than parsers, it almost feels like magic.
Classp is still a work in progress. We still have to deal with ambiguity in languages, features that are only output in one way but may be input in several ways, and a few other issues. But it’s ready to play with now and we’d love to hear from others interested in this subject. To learn more, visit http://google.github.io/classp.

By David Gudeman, Classp team
Categories: Open Source

RE2/J: Linear-time regular-expression matching for Java

Thu, 04/09/2015 - 19:37
Today we’re announcing the public release of RE2/J: a pure-Java implementation of the popular RE2 regular expression library.
Although RE2/J is not always faster than java.util.regexp, its running time is always linear in the size of the input. Thus when matching larger inputs, especially against patterns containing a high degree of alternation, RE2/J may be dramatically faster. With a backtracking implementation such as java.util.regexp, it is not hard to construct a pathological pattern whose matcher would take years to run on some inputs, so RE2/J's performance guarantee makes it suitable for use in applications where the pattern is supplied by untrusted users, such as the clients of a web server.
If you are looking for a detailed technical discussion of the motivation for RE2 and RE2/J and the tradeoffs involved, please see “Regular Expression Matching Can Be Simple And Fast” and “Regular Expression Matching in the Wild”, both written by Russ Cox.
RE2/J is used widely by Java projects within Google. In many cases, it can be used as a drop-in replacement for java.util.regexp. We are pleased to be able to make this library available for public consumption.
Please head to RE2/J’s GitHub page to find out how to use it!
By James Ring, Google Engineering
Categories: Open Source