├── CNAME
├── images
├── 404.jpg
├── hex.png
├── josh.jpg
├── jra.jpg
├── kim.jpg
├── luke.jpg
├── xiao.jpg
├── zac.jpg
├── andrew.jpg
├── config.png
├── craig.jpg
├── david.jpg
├── gopher.png
├── jeremy.jpg
├── martin.jpg
├── step1.gif
├── update.jpg
├── winner.png
├── measure.png
├── sausheong.jpg
├── skinner.jpg
├── aaron-cruz.png
├── first-post.png
├── james-scott.jpg
├── m_aimonetti.jpg
├── dominik-honnef.png
├── fatih_arslan.jpg
├── piano-octave.png
├── robert_horvath.jpg
├── steve-francia.jpg
├── guillaume-j-charmes.jpg
├── michael_alexander.jpg
├── francesc-campoy-flores.png
└── jekyll-now-theme-screenshot.jpg
├── data
├── ch4
│ └── gc4.zip
└── ch1
│ └── golang-challenge-1-drum_machine.zip
├── .gitignore
├── _layouts
├── page.html
├── post.html
└── default.html
├── _posts
├── 2015-12-01-go-challenge.md
├── 2015-06-27-go-challenge.md
├── 2014-3-3-Hello-World.md
├── 2015-03-20-evaluator-feedback.md
├── 2016-07-01-go-challenge9.md
├── 2015-10-01-go-challenge7.md
├── 2015-11-01-go-challenge8.md
├── 2015-02-01-Golang-Challenge-FAQ.md
├── 2015-08-01-go-challenge5.md
├── 2015-09-01-go-challenge6.md
├── 2015-03-01-go-challenge1.md
└── 2015-05-25-go-challenge4.md
├── 404.md
├── index.html
├── _scss
├── _variables.scss
├── _reset.scss
└── _highlights.scss
├── _includes
├── analytics.html
├── disqus.html
└── svg-icons.html
├── participants
├── index.html
├── oct15
│ └── index.html
├── aug15
│ └── index.html
├── sep15
│ └── index.html
├── may15
│ └── index.html
├── june15
│ └── index.html
├── april15
│ └── index.html
└── march15
│ └── index.html
├── about.md
├── feed.xml
├── LICENSE
├── sponsors
└── index.html
├── _config.yml
├── evaluators
└── index.html
├── style.scss
├── README.md
└── faq
└── index.html
/CNAME:
--------------------------------------------------------------------------------
1 | golang-challenge.org
2 |
--------------------------------------------------------------------------------
/images/404.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/404.jpg
--------------------------------------------------------------------------------
/images/hex.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/hex.png
--------------------------------------------------------------------------------
/images/josh.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/josh.jpg
--------------------------------------------------------------------------------
/images/jra.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/jra.jpg
--------------------------------------------------------------------------------
/images/kim.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/kim.jpg
--------------------------------------------------------------------------------
/images/luke.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/luke.jpg
--------------------------------------------------------------------------------
/images/xiao.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/xiao.jpg
--------------------------------------------------------------------------------
/images/zac.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/zac.jpg
--------------------------------------------------------------------------------
/data/ch4/gc4.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/data/ch4/gc4.zip
--------------------------------------------------------------------------------
/images/andrew.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/andrew.jpg
--------------------------------------------------------------------------------
/images/config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/config.png
--------------------------------------------------------------------------------
/images/craig.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/craig.jpg
--------------------------------------------------------------------------------
/images/david.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/david.jpg
--------------------------------------------------------------------------------
/images/gopher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/gopher.png
--------------------------------------------------------------------------------
/images/jeremy.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/jeremy.jpg
--------------------------------------------------------------------------------
/images/martin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/martin.jpg
--------------------------------------------------------------------------------
/images/step1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/step1.gif
--------------------------------------------------------------------------------
/images/update.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/update.jpg
--------------------------------------------------------------------------------
/images/winner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/winner.png
--------------------------------------------------------------------------------
/images/measure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/measure.png
--------------------------------------------------------------------------------
/images/sausheong.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/sausheong.jpg
--------------------------------------------------------------------------------
/images/skinner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/skinner.jpg
--------------------------------------------------------------------------------
/images/aaron-cruz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/aaron-cruz.png
--------------------------------------------------------------------------------
/images/first-post.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/first-post.png
--------------------------------------------------------------------------------
/images/james-scott.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/james-scott.jpg
--------------------------------------------------------------------------------
/images/m_aimonetti.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/m_aimonetti.jpg
--------------------------------------------------------------------------------
/images/dominik-honnef.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/dominik-honnef.png
--------------------------------------------------------------------------------
/images/fatih_arslan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/fatih_arslan.jpg
--------------------------------------------------------------------------------
/images/piano-octave.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/piano-octave.png
--------------------------------------------------------------------------------
/images/robert_horvath.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/robert_horvath.jpg
--------------------------------------------------------------------------------
/images/steve-francia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/steve-francia.jpg
--------------------------------------------------------------------------------
/images/guillaume-j-charmes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/guillaume-j-charmes.jpg
--------------------------------------------------------------------------------
/images/michael_alexander.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/michael_alexander.jpg
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | _site
2 | .DS_Store
3 | .jekyll
4 | .bundle
5 | .sass-cache
6 | Gemfile
7 | Gemfile.lock
8 | node_modules
9 | package.json
--------------------------------------------------------------------------------
/images/francesc-campoy-flores.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/francesc-campoy-flores.png
--------------------------------------------------------------------------------
/images/jekyll-now-theme-screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/images/jekyll-now-theme-screenshot.jpg
--------------------------------------------------------------------------------
/data/ch1/golang-challenge-1-drum_machine.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/golangchallenge/golang-challenge/HEAD/data/ch1/golang-challenge-1-drum_machine.zip
--------------------------------------------------------------------------------
/_layouts/page.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | {{ page.title }}
8 |
9 |
]({{ site.baseurl }}/)
--------------------------------------------------------------------------------
/_layouts/post.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | ---
4 |
5 | {{ page.title }}
7 |
8 |
Canada
12 | 13 |Japan
18 | 19 |Sri Lanka
24 | 25 |USA
30 | 31 |There were two categories of participants. Most just participated in the challenge and some added more steps.
10 | 11 |Austria
14 | 15 |Turkey
20 | 21 |USA
27 | 28 |Australia
34 | 35 |Colombia
40 | 41 |Finland
46 | 47 |Germany
52 | 53 |Norway
58 | 59 |Australia
12 | 13 |France
18 | 19 |Germany
24 | 25 |Ireland
32 | 33 |Japan
38 | 39 |Norway
44 | 45 |Singapore
50 | 51 |Spain
56 | 57 |USA
62 | 63 |More sponsors are expected.
39 |There were three categories of participants. Most just participated in the challenge; some added more steps and some participated "Just for Fun".
10 | 11 |France
14 | 15 |Russia
20 |Singapore
25 | 26 |UK
31 | 32 |USA
37 | 38 |Belarus
45 | 46 |Brazil
51 | 52 |Germany
57 | 58 |India
63 | 64 |Nepal
69 | 70 |USA
75 | 76 |Costa Rica
85 | 86 |{{ site.description }}
32 |Nathan Youngman had set the guidelines for evaluation for the first Go Challenge. Subsequently Dominik Honnef modified the guidelines based on his experience as an evaluator for the first challenge.
11 |The following evaluators went through all the submitted solutions of the challenge. They commented and ranked these solutions.
12 | 13 |There were three categories of participants. Most just participated in the challenge; some added more steps and some participated "Just for Fun".
10 | 11 |Australia
14 | 15 |Belarus
20 | 21 |Canada
26 | 27 |Germany
31 | 32 |Mongolia
37 | 38 |Nepal
43 | 44 |Slovakia
49 | 50 |Switzerland
55 | 56 |U.K.
61 | 62 |USA
67 | 68 |Germany
82 | 83 |Germany
89 | 90 |
10 | I've been programming for half my life, ever since my childhood. Having started in VB6 and PHP, I quickly worked my way towards Ruby and then finally Go. Along the way, I've always tried to contribute to open source in one way or another, but Go finally spawned the kind of down to earth, no nonsense community I feel comfortable in.
11 |
12 | #### Dominik's feedback to the Go Challenge 1 participants
13 |
14 | Reviewing almost 90 different solutions to the same problem revealed a lot of very common mistakes.
15 |
16 | I think the most important mistake was that people didn't keep it simple.
17 |
18 | Don't split your solution into 10 files. Not counting tests, this challenge took about 200 lines to solve. Then why would we need for example a file `track.go`, that only contains the definition of the `Track` struct? Java programmers are used to the rule of "one class per file", and so are Ruby programmers. But in Go, we prefer grouping code by their purpose. A pattern and a track belong to the same semantic unit, and can go in the same file. Decoding those Splice files is a semantic unit, thus decoding can go into a file, too. It doesn't need to be split into files for decoding the header, the track, and a utility for finding a null byte. If I want to read how the decoding works, I want to read it top to bottom; I don't want to jump between files constantly, especially if I first have to find out which file is the next file to read.
19 |
20 | On that note, however: Do use multiple files when it makes sense. The template for the challenge came with two files: `decoder.go` and `drum.go` – and almost nobody even touched `drum.go`. Now, if all you wanted to do was decode Splice files, fine, you could've deleted `drum.go` – but we also wanted to print those patterns, and the challenge hinted at the fact that people would also want to encode those files, or play them. At that point it is natural to have code that is common between the different units in a separate file. As such, the `Pattern` and `Track` types, as well as their `String` methods, should've gone into the `drum.go` file, so that `decoder.go` could focus on the actual decoding.
21 |
22 | Don't add extra types if you don't need them – a `type Step bool` has no benefit over a plain `bool` if your type doesn't at least have a method on it. It just adds complexity for no gain.
23 |
24 | Streaming is a beautiful concept. Go embraces the `io.Reader` and `io.Writer` interfaces, and a lot of code is built on those. That includes `encoding/binary`, which everybody used. The `encoding/binary` package makes it incredibly easy to read bytes from an `io.Reader` and turn them into meaningful data, such as floats, or structs. It is quite unfortunate, then, that a lot of people first read the whole file into memory. Most people did this so they could operate on a `[]byte`, but they didn't save anything in terms of complexity. Some people, after reading the file into memory, realised that `encoding/binary` works best with an `io.Reader`, so what did they do? They wrapped their `[]byte` in a `bytes.Reader`… Instead of just using the file they opened as what it is: an `io.Reader`. I strongly suggest that people read ["Crossing Streams: a Love Letter to
25 | io.Reader" by Jason Moiron](http://jmoiron.net/blog/crossing-streams-a-love-letter-to-ioreader/) to understand the beauty of `io.Reader`.
26 |
27 | Get to know your standard library. Splice files encode their length in the header, and may contain trailing data. That's why you must abort reading after N bytes. Most people solved that by manually counting bytes. When they read a float32, they added 4 to an int. When they read 16 steps, they added 16 to an int, and so on. But there's a way simpler solution to this: using `io.LimitedReader` – a reader that has a maximum length and wraps an existing reader. Together with the earlier advice of using the `io.Reader` directly, this would've eliminated a lot of code.
28 |
29 | Errors are values. Those of you who did use the `io.Reader`, instead of reading everything into a `[]byte`, had a lot of error checking. Everytime they read something, they had to check for an error. That's a lot of noise. It can be avoided though, for example by using a sticky error – wrap the reader in a custom reader that remembers the last error it encountered. You can then just parse the entire file, pretending errors don't happen, and at the end you check a single struct field, which contains the first error that occured, if any. Here I strongly suggest you read ["Errors are values" by Rob Pike](http://blog.golang.org/errors-are-values).
30 |
31 | Don't leak implementation details. A track has a name, and 16 beats that might be on or off. What type do we use for storing binary states? Booleans. How were beats stored in the file? One byte per beat. What type do we use for storing binary states? Still booleans. Just because the file contains 16 bytes, doesn't mean that our `Track` type should contain a `[16]byte` – It should be a `[16]bool`. Or maybe even a `[]bool`. The user of a `Track` doesn't care about the raw bytes in a file. He might not even have read the track from a file. He cares about beats and their on/off state. (And yes, you could've used a uint16 to encode 16 beats more efficiently, but now your API is going to be more complex, too. Did you really need the extra space
32 | efficiency?)
33 |
34 | Don't write code to pass tests, write code to solve the problem. Pattern 5 had extra data at the end of the file that you weren't supposed to parse (it looked kind of like a second Splice file). Of course, the correct solution was to use the encoded file length. However, a lot of people didn't find the length, and that's fine, there's still ways to work around it. What is not fine, however, is to read a track and check if its ID is "SPLI" and abort the loop. Of course it passed the tests, but was it correct? Of course not. There could've been any other kind of data in that file, too. It could've even looked like a valid track. Or maybe our Splice file wasn't supposed to end there and it was corrupted instead. Solve the problem, not the tests. Tests are rarely complete. Any test can be passed by hard-coding the expected inputs and outputs.
35 |
36 | I'll end this with a short list of other issues I encountered that don't deserve their own lengthy prose:
37 |
38 | - The "SPLICE" bytes aren't useless – check for them to see if your file really is a Splice file.
39 | - My name is Dominik. It's not DominikWhoHasAFatherAndAMother. Variables shouldn't be named like that, either. Go read
40 | [Notes on Programming in C](http://doc.cat-v.org/bell_labs/pikestyle).
41 | - No byte was useless, every byte had a meaning. Only the version was padded.
42 | - `fmt.Sprintf` worked well, you didn't need text/template.
43 | - Simple code is good. Don't add extra features that have nothing to do with the problem.
44 | - Readability is key. `gofmt` is a thing. So are `golint` and `go vet`.
45 | - There's a thing called "short reads". `Read` is allowed to return less bytes than fit in the buffer, without it being an error. You probably wanted `io.ReadFull`.
46 |
47 | #### Discussion
48 |
49 | Please join the [golang-challenge channel](http://t.co/n6EesY9Mmv) on slack if you want to discuss this blog post. This is a room for people who are going to participate / have participated in the Go Challenge.
50 |
51 |
--------------------------------------------------------------------------------
/faq/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Go Challenge FAQ
4 | tags: [go challenge, golang]
5 | ---
6 |
7 |
JoshSoftware Pvt. Ltd. is India's leading company in building innovative web applications working exclusively in Ruby On Rails since 2007. Josh have been using Go in some of their Web applications along side Rails (especially for some heavy lifting). Back in 2009, Josh had been actively involved in organizing Ruby programming challenges and decided that Go too needs such challenges. Hence the monthly Go Challenge.
The Go Challenge:
25 |By participating in this challenge, you agree to be bound by the Challenge Rules below:
33 |Entries will be anonymized and evaluated by the challenge author and a team of evaluators.
51 |Nathan Youngman had set the guidelines for evaluation for the first Go Challenge. Subsequently Dominik Honnef modified the guidelines based on his experience as an evaluator for the first challenge.
63 | 64 |Every month the team of evaluators could remain the same or could change. The team will go through all the submitted solutions of a challenge. They will comment and rank these solutions.
65 | 66 |More evaluators are welcome.
67 | 68 |The author of the Go Challenge for the particular month will decide the two or more best solutions. This author shall have the sole authority and discretion to select the award recipients.
71 | 72 |The winning entries will be announced on the blog here. The winners will be sent their prizes by email / postal mail.
75 | 76 | 80 |Any individual or companies interested in sponsoring the monthly event are welcome. Please contact Satish Talim.
83 | 84 |No responsibility can be accepted for entries not received for whatever reason. The administrator reserves the right to cancel or amend the competition and these terms and conditions without notice in the event of a catastrophe, war, civil or military disturbance, act of God or any actual or anticipated breach of any applicable law or regulation or any other event outside of the administrator’s control. Any changes to the competition will be notified to entrants as soon as possible by the administrator. Administrators assume no responsibility for any error, omission, interruption, deletion, defect, delay in operation or transmission, communications line failure, theft or destruction or unauthorized access to, or alteration of, entries. Any attempt to tamper with or damage the competition, especially with regards to voting, is unlawful and may result in legal action. Additionally, if the administrators determine, in their sole discretion, that there has been tampering or rigging of the competition, they may invalidate any relevant entries or the competition as a whole. In such case, competitors will be notified as soon as possibly on the Go Challenge website.
94 | 95 | 96 |
18 | The 9th Go Challenge author, Aaron Cruz, is a food lover who speaks about Go and other programming languages at conferences around the world. For his real job, he helps marketplaces start making revenue faster by integrating with Stripe Connect to simplify buyer/seller (rider/driver, freelancer/client) payments.
19 |
20 | Aaron has this to say about the challenge:
21 |
22 | > "I am interested in a pragmatic approach and I want the entrant to have fun. It doesn’t need to be exact, just as accurate as you can get. Cut corners and break rules if you need to :)"
23 |
24 | ---
25 |
26 | #### The Go Challenge 9
27 |
28 | ##### Nothin' But a Go Thang
29 |
30 | ##### Preamble
31 |
32 | I grew up with Hip Hop. It connected me with a culture that seemed very alien, having grown up in the suburb of a suburb in Northwestern USA. Hip Hop changed dramatically over the years but one thing that stayed constant was story telling.
33 |
34 | Here are some samples of some of my favorites over the decades starting from my youth to the present.
35 |
36 | 80s Eric B. & Rakim - I Ain't No Joke
37 |
38 | 90s The Notorious B.I.G. - "Juicy"
39 |
40 | 00s Talib Kweli - Get By
41 |
42 | 10s Open Mike Eagle - Ziggy Starfish
43 |
44 | It has always been one of my dreams to be a rapper. Unfortunately I spend way too much time on Twitter. I don’t have nearly the amount of time and energy necessary to write rhymes and practice my flow.
45 |
46 | **The Goal of the challenge**
47 |
48 | The goal of this challenge is to create a tweet to rap converter. It will take a twitter user as input and return rap versions of the tweets in their timeline.
49 |
50 | **Requirements of the challenge**
51 |
52 | For example, let’s take Brad Fitz tweet:
53 |
54 | > I've never used Plan 9, but I watch it install occasionally.
55 | > And today I learned that "myriad" can mean 4. pic.twitter.com/sIkvgEBMEF
56 | >
57 | > — Brad Fitzpatrick (@bradfitz) May 10, 2016
58 |
59 | One possible output could be...
60 |
61 | Leave you, I never mean toThere were three categories of participants. Most just participated in the challenge; some added more steps and some participated "Just for Fun".
10 | 11 |Australia
14 | 15 |Brazil
22 |Canada
29 |China
37 |Costa Rica
42 | 43 |Czech Republic
48 | 49 |Denmark
54 |Estonia
62 | 63 |France
68 | 69 |Germany
79 | 80 |Greece
91 | 92 |India
97 | 98 |Indonesia
105 | 106 |Ireland
115 | 116 |Italy
121 | 122 |Netherlands
128 | 129 |Nigeria
135 | 136 |Norway
141 | 142 |Romania
147 | 148 |Russia
153 | 154 |Slovenia
159 |Spain
164 | 165 |Switzerland
170 | 171 |UK
177 | 178 |Ukraine
190 | 191 |USA
197 | 198 |Vietnam
234 | 235 |Germany
244 | 245 |Mexico
250 | 251 |USA
256 | 257 |India
265 |Liberia
270 | 271 |Slovakia
276 | 277 |
22 | The 7th Go Challenge author is Francesc Campoy Flores who joined the Go team in 2012 as Developer Advocate after several years as a Python and C++ developer. His mission is to make Go useful and fun.
23 |
24 | Francesc has this to say about the challenge:
25 |
26 | > "Preparing this challenge got me so excited about the support for OpenGL and simple audio primitives that I had to concentrate on writing the description rather than hacking on my own virtual piano.
27 |
28 | > Event based applications are easily modeled using goroutines and channels, and I expect this project will be a chance for everyone to experiment with them."
29 |
30 | ---
31 |
32 | #### The Go Challenge 7
33 |
34 | ##### A piano on your phone
35 |
36 | ##### Preamble
37 |
38 | The latest version of Go 1.5 released last month includes, among many other cool things, experimental support for mobile platforms such as Android and iOS.
39 |
40 | I have personally played around with the the golang.org/x/mobile packages and thought this challenge would be a great opportunity to see what great projects people could come up.
41 |
42 |
43 | **Goals of the challenge**
44 |
45 | The goal is simple: build a virtual piano for mobile devices.
46 |
47 | The piano should display a set of keys (some white, some black) as in real traditional pianos (see image below). When the user presses a key a sound should be played. How and what exactly the key sounds is left to your choice and artistic freedom.
48 |
49 | 
50 |
51 | **Requirements of the challenge**
52 |
53 | The resulting application should:
54 |
55 | * run on Android (at least),
56 | * uses the [golang.org/x/mobile/gl](https://godoc.org/golang.org/x/mobile/gl) to display a set of keys,
57 | * use the [golang.org/x/mobile/exp/audio](https://godoc.org/golang.org/x/mobile/exp/audio) package to generate sounds
58 | * have some way for the user to act on what sound is generated
59 |
60 | **Bonus features**:
61 |
62 | * use complex interactions other than simple taps
63 | * allow the user to save/export the music generated
64 | * create a web page where users can show their skills
65 | * provide a way for different musicians to colaborate/compete
66 |
67 | **Hints**
68 |
69 | There's multiple ways to generate audio. You can use audio files quite easily, but it would be much more creative to provide a way to generate sounds "from scratch" with [https://godoc.org/golang.org/x/mobile/exp/audio/al](https://godoc.org/golang.org/x/mobile/exp/audio/al).
70 |
71 | ---
72 |
73 | #### Challenge Rules and how to enter the Go Challenge?
74 |
75 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
76 |
77 | * The Challenge is open to individuals.
78 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
79 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
80 | * Odds of winning depend on the number and quality of entries received.
81 | * All taxes, including income taxes, are the sole responsibility of the winners.
82 | * No prize substitution is permitted.
83 | * Create a zip of your Go source code and test cases and send the zip file to **golangchallenge [at] gmail.com before 27th of October 2015 (6 am IST). Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=10&d=27&h=6&mn=0) to find the equivalent time in your city/country**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, twitter or GitHub id (if any) and participating under which category - Just participating | Participating and exploring further | Just for Fun | Anonymous entry**. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes.
84 | * We shall be publishing on this blog, a list of participant names. If you don't want your name to appear kindly mention the same in your email.
85 | * You are allowed to re-submit your code if you feel it is necessary.
86 | * After the challenge is over, all submissions will be made available [online on GitHub](https://github.com/golangchallenge/GCSolutions) under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) or the [GNU General Public License, version 3 - GPL-3.0](http://opensource.org/licenses/GPL-3.0) unless a participant has indicated that his/her solution should not be made public before the challenge ends.
87 |
88 | #### How will the challenge be evaluated?
89 |
90 | Entries will be evaluated by the challenge author and a team of evaluators.
91 |
92 | #### Questions?
93 |
94 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) and ask your questions. This is a room for people who are going to participate in the Go Challenge. You can also send us an email at golangchallenge [at] gmail.com
95 |
96 | #### Evaluators
97 |
98 | [Nathan Youngman](https://twitter.com/nathany) had set the guidelines for evaluation for the first Go Challenge. Subsequently [Dominik Honnef](https://twitter.com/dominikhonnef) modified the guidelines based on his experience as an evaluator for the first challenge. [Austin Riendeau](https://github.com/apriendeau), [Cory LaNou](https://twitter.com/corylanou), [Edd Robinson](https://github.com/e-dard), [Gautam Dey](https://github.com/gdey), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Kevin Gillette](https://twitter.com/kevingillette) and [Pravin Mishra](https://twitter.com/pravinmishra88) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
99 |
100 | #### Best Solution
101 |
102 | The author of the Go Challenge will decide the best five solutions. The author shall have the sole authority and discretion to select the award recipients.
103 |
104 | #### Notification
105 |
106 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
107 |
108 | #### Prizes
109 |
110 | The author of the challenge will select 2 winners and prizes will be awarded to them.
111 |
112 | Here are some great prizes provided by our sponsors for the event.
113 |
114 | _Winner 1_:
115 |
116 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
117 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
118 | * [Docker](https://www.docker.com/) - 1 ticket to DockerCon Europe in November.
119 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
120 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
121 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
122 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
123 |
124 | _Winner 2_:
125 |
126 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
127 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
128 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
129 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go Web Programming](http://www.manning.com/chang/)
130 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
131 |
132 | #### Challenge Solutions
133 |
134 | All the solutions submitted by the participants will be available **[here](https://github.com/golangchallenge/GCSolutions)** after the challenge ends.
135 |
136 | #### The Winners
137 |
138 | 
139 |
140 |
141 |
142 | **Winner #1 - James Scott** works at [18F](https://18f.gsa.gov/) as an Innovation Specialist in Washington, D.C. where he is currently working on the [cloud.gov](https://cloud.gov/) project.
143 |
144 | Throughout his career, he programmed in C++, Java, and Python. In early 2013, James first encountered Go and instantly fell in love. His passion for Go motivated him to integrate it not only into his personal projects but his professional projects as well. He is very excited about Go and looks forward to the language's future.
145 |
146 | His [solution](https://bitbucket.org/jcscottiii/amadeus).
147 |
148 | ---
149 |
150 |
151 |
152 | **Winner #2 - Daniel Skinner** is currently working at [The Smyth Group](http://thesmythgroup.com/) primarily as a lead android developer. He has been writing Go since mid-2012 and uses it for nearly all of his personal projects. Back when he was a budding engineer, picking a project to develop his skills was always problematic until he came across Victor Lazzarini's [SndObj Library](http://sndobj.sourceforge.net/). This challenge was a chance to get back to what he enjoys while SndObj served as an inspiration to provide something similar for Go.
153 |
154 | His [solution](https://github.com/dskinner/snd/tree/master/example/piano).
155 |
156 | ---
157 |
158 | #### Sponsors
159 |
160 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Apcera](https://www.apcera.com/), [Cube Root Software](http://cuberoot.in/), [Docker](https://www.docker.com/), [InfluxDB](http://influxdb.com/), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [Packt Publishing](https://www.packtpub.com/) and [Qwinix Technologies](http://www.qwinixtech.com/).
161 |
162 | #### Credit
163 |
164 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
165 | * [GitHub](https://github.com/) for the yearly sponsorship of a [GitHub Bronze Organisation plan](https://github.com/pricing) for the Go Challenge.
166 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
167 |
--------------------------------------------------------------------------------
/_posts/2015-11-01-go-challenge8.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Go Challenge - 8
4 | tags: [go challenge, golang]
5 | ---
6 |
7 | 
8 |
9 | **Winners have been declared by Andrew Gerrand**
10 |
11 | Winner #1 - **Jakub Rozanski** - A readable dancing links implementation.
12 |
13 | Winner #2 - **Jan Mercl** - I enjoyed reading this clean solution.
14 |
15 | **Special mentions**
16 |
17 | **Dan McCandless** - "Las Vegas" algorithm gave me pause, and then a good laugh.
18 |
19 | **Robert Ortega** - "suGOku" web app is nicely done.
20 |
21 | ---
22 |
23 |
24 | #### The November 2015 Go Challenge for developers (newbies included)
25 |
26 | #### Andrew Gerrand: Author of the 8th Go Challenge
27 |
28 |
29 | The 8th Go Challenge author, Andrew Gerrand, is from Melbourne, Australia and now lives in Sydney working at Google Australia on the Go project. He has been writing code since he was a little kid, and has been working in the industry since he was a teenager. Before Google he worked for various Internet companies using most of the common languages in that sphere (Perl, PHP, Python, JS, etc). At the same time he spent most of his personal hacking time writing assembly for 8-bit systems from the 80s. He also has a Bachelors degree in Fine Arts (his major was photography).
30 |
31 | Andrew has this to say about the challenge:
32 |
33 | > "I set this puzzle because it suits a range of skill and knowledge levels. It's tractable for a novice to implement the brute force approach, while an expert can go all-out with a more creative approach. I look forward to seeing what the gophers can come up with!"
34 |
35 | ---
36 |
37 | #### The Go Challenge 8
38 |
39 | ##### A Sudoku Solver
40 |
41 | ##### Preamble
42 |
43 | The game of [Sudoku](http://www.wikiwand.com/en/Sudoku) is simple to understand but it can be challenging to play. The same can be said for the "metagame" of writing a Sudoku solver: the algorithm can be easy to imagine, but when you set about implementing it things can get interesting. And it clearly is interesting: Donald Knuth used Sudoku to demonstrate his "[dancing links](https://en.wikipedia.org/wiki/Dancing_Links)" technique, the Prime Minister of Singapore [released the source code](http://arstechnica.com/information-technology/2015/05/prime-minister-of-singapore-shares-his-c-code-for-sudoku-solver/) for his Sudoku solver to demonstrate his IT credentials, and many years ago I explored the problem as a novel application of Go's concurrency primitives.
44 |
45 | It was back in 2010, when we were all still learning Go, that I wrote a [Sudoku](https://en.wikipedia.org/wiki/Sudoku) solver using goroutines and channels. I wrote it up on my blog ([part 1](http://nf.id.au/posts/2010/07/expressive-concurrency-a-go-sudoku-solver-pt.html), [part 2](http://nf.id.au/posts/2010/07/expresive-concurrency-a-go-sudoku-solver-pt-2.html)), but it was only ever able to solve puzzles that require no backtracking (guessing). All challenging Sudoku puzzles do require some guesswork, so I couldn't say my solver was ever finished. Indeed, I don't believe it is even possible to finish my solver without abandoning its fundamental design.
46 |
47 | **The Goal of the challenge**
48 |
49 | The goal of this challenge is to implement a Sudoku solver.
50 |
51 | **Requirements of the challenge**
52 |
53 | Your program should read a puzzle of this form from standard input:
54 |
55 | ```
56 | 1 _ 3 _ _ 6 _ 8 _
57 | _ 5 _ _ 8 _ 1 2 _
58 | 7 _ 9 1 _ 3 _ 5 6
59 | _ 3 _ _ 6 7 _ 9 _
60 | 5 _ 7 8 _ _ _ 3 _
61 | 8 _ 1 _ 3 _ 5 _ 7
62 | _ 4 _ _ 7 8 _ 1 _
63 | 6 _ 8 _ _ 2 _ 4 _
64 | _ 1 2 _ 4 5 _ 7 8
65 | ```
66 |
67 | And it should write the solution to standard output:
68 |
69 | ```
70 | 1 2 3 4 5 6 7 8 9
71 | 4 5 6 7 8 9 1 2 3
72 | 7 8 9 1 2 3 4 5 6
73 | 2 3 4 5 6 7 8 9 1
74 | 5 6 7 8 9 1 2 3 4
75 | 8 9 1 2 3 4 5 6 7
76 | 3 4 5 6 7 8 9 1 2
77 | 6 7 8 9 1 2 3 4 5
78 | 9 1 2 3 4 5 6 7 8
79 | ```
80 |
81 | It should reject malformed or invalid inputs and recognize and report puzzles that cannot be solved.
82 |
83 | (Incidentally, the puzzle above makes a nice test case, because the solution is easy to validate by sight.)
84 |
85 | **Bonus features**:
86 |
87 | * Print a rating of the puzzle's difficulty (easy, medium, hard). This rating should roughly coincide with the ratings of shown by sites like [Web Sudoku](http://www.websudoku.com/).
88 | * Implement a puzzle generator that produces a puzzle of the given difficulty rating.
89 | * Maximize the efficiency of your program. ([Write a benchmark](http://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go).)
90 | * Write test cases, and use the [cover tool](https://blog.golang.org/cover) to make sure your tests are thorough.
91 | (I found a bug in both my implementation and a test case when I checked the coverage.)
92 | * Use a non-obvious technique, like Knuth's "Dancing Links" or something of your own invention.
93 |
94 | **Hints**
95 |
96 | * For an elegant and efficient representation of the puzzle, try using an array (not a slice).
97 | * Recursion can dramatically simplify your implementation.
98 |
99 | ---
100 |
101 | #### Challenge Rules and how to enter the Go Challenge?
102 |
103 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
104 |
105 | * The Challenge is open to individuals.
106 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
107 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
108 | * Odds of winning depend on the number and quality of entries received.
109 | * All taxes, including income taxes, are the sole responsibility of the winners.
110 | * No prize substitution is permitted.
111 | * Create a zip of your Go source code and test cases and send the zip file to **golangchallenge [at] gmail.com before 24th of November 2015 (6 am IST)**. Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=11&d=24&h=6&mn=0) to find the equivalent time in your city/country. No new solutions will be accepted after that. In the email mention **your full name, country of residence, twitter or GitHub id (if any) and participating under which category - Just participating or Participating and exploring further or Just for Fun or Anonymous entry**. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes.
112 | * We shall be publishing on this blog, a list of participant names. If you don't want your name to appear kindly mention the same in your email.
113 | * You are allowed to re-submit your code if you feel it is necessary.
114 | * After the challenge is over, all submissions will be made available [online on GitHub](https://github.com/golangchallenge/GCSolutions) under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) or the [GNU General Public License, version 3 - GPL-3.0](http://opensource.org/licenses/GPL-3.0) unless a participant has indicated that his/her solution should not be made public before the challenge ends.
115 |
116 | #### How will the challenge be evaluated?
117 |
118 | Entries will be evaluated by the challenge author and a team of evaluators.
119 |
120 | #### Questions?
121 |
122 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) and ask your questions. This is a room for people who are going to participate in the Go Challenge. You can also send us an email at golangchallenge [at] gmail.com
123 |
124 | #### Evaluators
125 |
126 | [Nathan Youngman](https://twitter.com/nathany) had set the guidelines for evaluation for the first Go Challenge. Subsequently [Dominik Honnef](https://twitter.com/dominikhonnef) modified the guidelines based on his experience as an evaluator for the first challenge. [Austin Riendeau](https://github.com/apriendeau), [Cory LaNou](https://twitter.com/corylanou), [Edd Robinson](https://github.com/e-dard), [Gautam Dey](https://github.com/gdey), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Kevin Gillette](https://twitter.com/kevingillette) and [Pravin Mishra](https://twitter.com/pravinmishra88) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
127 |
128 | #### Best Solution
129 |
130 | The author of the Go Challenge will decide the best five solutions. The author shall have the sole authority and discretion to select the award recipients.
131 |
132 | #### Notification
133 |
134 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
135 |
136 | #### Prizes
137 |
138 | The author of the challenge will select 2 winners and prizes will be awarded to them.
139 |
140 | Here are some great prizes provided by our sponsors for the event.
141 |
142 | _Winner 1_:
143 |
144 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
145 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Functional Programming for the Object-Oriented Programmer](https://leanpub.com/fp-oo)
146 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
147 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
148 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
149 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
150 |
151 | _Winner 2_:
152 |
153 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
154 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
155 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
156 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go Web Programming](http://www.manning.com/chang/)
157 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
158 |
159 | #### Challenge Solutions
160 |
161 | All the solutions submitted by the participants will be available **[here](https://github.com/golangchallenge/GCSolutions)** after the challenge ends.
162 |
163 | #### Sponsors
164 |
165 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Apcera](https://www.apcera.com/), [Cube Root Software](http://cuberoot.in/), [InfluxDB](http://influxdb.com/), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [Packt Publishing](https://www.packtpub.com/) and [Qwinix Technologies](http://www.qwinixtech.com/).
166 |
167 | #### Credit
168 |
169 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
170 | * [GitHub](https://github.com/) for the yearly sponsorship of a [GitHub Bronze Organisation plan](https://github.com/pricing) for the Go Challenge.
171 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
172 |
--------------------------------------------------------------------------------
/participants/march15/index.html:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Our Awesome March 2015 Challenge Participants
4 | tags: [go challenge, golang]
5 | ---
6 |
7 | There were three categories of participants. Most just participated in the challenge; some added more steps to the cowbell track and some participated "Just for Fun".
10 | 11 |Algeria
13 |Australia
18 |Brazil
29 |Canada
36 |Chile
44 |China
49 |Colombia
56 |Costa Rica
61 |Czech Republic
66 |Denmark
71 |Finland
78 |France
83 |Germany
96 |Greece
111 |India
116 |Indonesia
128 |Iran
135 |Ireland
140 |Jamaica
146 |Japan
151 |Netherlands
156 |Nigeria
168 |Norway
173 |Poland
179 |Portugal
185 |Russia
190 |Singapore
196 |Slovakia
201 |Slovenia
209 |South Africa
214 |Spain
219 |Sri Lanka
225 |Sweden
230 |Switzerland
236 |Taiwan
245 |Turkey
250 |UK
255 |United Arab Emirates
267 |Ukraine
272 |USA
277 |Vietnam
330 |Australia
336 |Canada
341 |Egypt
346 |France
351 |India
356 |Slovenia
361 |UK
366 |USA
371 |Slovakia
385 |390 |
11 | [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) is India's leading company in building innovative web applications working exclusively in Ruby On Rails since 2007. Josh have been using Go in some of their Web applications along side Rails (especially for some heavy lifting). Back in 2009, Josh had been actively involved in organizing Ruby programming challenges and decided that Go too needs such challenges. Hence the monthly Go Challenge.
12 |
13 | **What is the Go Challenge ?**
14 |
15 | * The Go Challenge is the world's first monthly programming challenge for Go developers (newbies included).
16 | * **The Go Challenge is free and registration is not required**.
17 | * A new Go Challenge will be posted here on the **first day of each month** starting March 2015.
18 | * The challenge is open to individuals only.
19 | * You are invited to post your queries / doubts on our **[forum](https://groups.google.com/d/forum/go-challenge)**.
20 |
21 | **How does the Go Challenge benefit you ?**
22 |
23 | The Go Challenge:
24 |
25 | * is a good idea as reading books and documentation can only take you so far when learning a new language. To really learn, you need to use the language.
26 | * provides a fabulous forum for using Go in the form of regular, engaging (but not arcanely difficult) challenges. Better yet, it provides feedback on how to use Go well, as each month the best solution to a challenge is chosen.
27 | * is a wonderful introduction to the Go language and to the Go community.
28 |
29 | **First Challenge**
30 |
31 | The First Go Challenge, related to music and binary encoding, is being set by Matt Aimonetti.
32 |
33 | Matt is [Splice CTO & Co-Founder](https://splice.com/), an experienced technologist, entrepreneur, technical writer and active open-source contributor based in Santa Monica, CA. Prior to Splice, Matt worked as a Tech manager/R&D developer at LivingSocial, on video game development at Sony PlayStation, as a sound engineer and on many other things.
34 |
35 | **Other Months**
36 |
37 | So far, the following Gophers have agreed to set up the challenge for:
38 |
39 | * August 2015 - [Josh Bleecher Snyder](http://www.gophercon.in/blog/2015/02/13/josh/)
40 | * September 2015 - [Steve Francia](https://www.linkedin.com/in/stevefrancia)
41 | * October 2015 - [Francesc Campoy Flores](https://www.linkedin.com/in/campoy)
42 | * November 2015 - [Andrew Gerrand](https://plus.google.com/+AndrewGerrand/about) - remind him from August
43 | * December 2015 - [Cory LaNou](https://www.linkedin.com/in/corylanou)
44 |
45 | Other interested Gophers: Blake Mizerany, [Jeremy Saenz](https://github.com/codegangsta), [Jessica Frazelle](https://github.com/jfrazelle), Karan Misra, Mike Gehard, Niket Patel, Piyush Verma, Verónica López and William Kennedy.
46 |
47 | **Sponsors**
48 |
49 | Any individual or companies interested in sponsoring the monthly event are welcome. Please contact Satish Talim at **gochallenge [at] joshsoftware.com**
50 |
51 | So far, [Anand D N](https://twitter.com/Wanderer140), [Apcera](https://www.apcera.com/), [CoreOS](https://coreos.com/), [Cube Root Software](http://cuberoot.in/), [DigitalOcean](https://www.digitalocean.com/), [Docker](https://www.docker.com/), [GopherCasts](https://gophercasts.io/), [Helpshift](http://www.helpshift.com/), [InfluxDB](http://influxdb.com/), [John Sonmez](https://twitter.com/jsonmez), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [NodePrime](http://www.nodeprime.com/), [O'Reilly](http://www.oreilly.com/), [Packt Publishing](https://www.packtpub.com/), [Qwinix Technologies](http://www.qwinixtech.com/), [RainingClouds](http://rainingclouds.com/#!/) and [Sourcegraph](https://sourcegraph.com/) have agreed to support the challenge. More to follow soon.
52 |
53 | **How to enter the Go Challenge?**
54 |
55 | * Read the **Challenge Rules** below. By participating in this challenge, you agree to be bound by the Challenge Rules.
56 | * Create a zip of your Go source code and send the zip file to **gochallenge [at] joshsoftware.com by the 13th of the month (midnight IST, 11:30 AM PDT)**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, and twitter id**. We will give your zip file to the evaluation team. **Note**: Avoid sharing your code with anyone else; if your solution becomes available to the general public it might impact evaluation of your submission.
57 |
58 | **How will the challenge be evaluated?**
59 |
60 | Entries will be anonymized and evaluated by the challenge author and a team of evaluators.
61 |
62 | * Functioning code and a test suite that passes.
63 | * Code hygiene. Use [gofmt](https://golang.org/cmd/gofmt/), [vet](https://godoc.org/golang.org/x/tools/cmd/vet) and [lint](https://github.com/golang/lint). Review [CodeReviewComments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).
64 | * Readability. How easy is it for another programmer to grasp what your entry is doing?
65 | * Code structure. Do types and files have good names?
66 | * Reliability. Are errors properly handled?
67 | * Appropriate consideration given to memory and performance (nothing is unnecessarily expensive).
68 |
69 | **Challenge Rules**
70 |
71 | * The Challenge is open to individuals.
72 | * You maintain ownership of all code you submit and can release it under an open source license or keep it private after the challenge.
73 | * Evaluators cannot enter the challenge.
74 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
75 | * Odds of winning depend on the number and quality of entries received.
76 | * All taxes, including income taxes, are the sole responsibility of winners.
77 | * No prize substitution is permitted.
78 |
79 | **Evaluators**
80 |
81 | [Nathan Youngman](https://twitter.com/nathany) has agreed to set guidelines for evaluation. [Akshay Deo](https://twitter.com/akshay_deo), [Jacques Fuentes](https://twitter.com/jpfuentes2), [Jiahua Chen](https://twitter.com/joe2010xtmf), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Niket Patel](https://twitter.com/nexneo), [Nishant Modak](https://www.linkedin.com/in/modak), [Piyush Verma](https://twitter.com/meson10), [Pravin Mishra](https://twitter.com/pravinmishra88), [Sanat Gersappa](https://twitter.com/sanatgersappa) and [Søren Mathiasen](https://twitter.com/sorenmat) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions. More evaluators are welcome.
82 |
83 | **Best Solution**
84 |
85 | The author of the Go Challenge for the particular month will decide the best solution, with some help from the Go community. This author shall have the sole authority and discretion to select the award recipient(s).
86 |
87 | **Notification**
88 |
89 | The winning entries will be announced here. The winners will be sent their prizes by email/postal mail.
90 |
91 | **Prizes**
92 |
93 | There will normally be two prizes (though we reserve the right to change this for each challenge). One prize will be awarded for the best solution selected by the author and the other (in later chalenges) will be for the best popular voted solution by the community. Prizes can range from small cash rewards to free PDFs, Screencasts – whatever the sponsors of the challenge have offered.
94 |
95 | Here are some great prizes provided by our sponsors for the event.
96 |
97 | _Winner (selected by the author)_:
98 |
99 | * [Anand D N](https://twitter.com/Wanderer140) - [Essential-Go screencast](https://www.kajabinext.com/marketplace/courses/1-essential-go)
100 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
101 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
102 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
103 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
104 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
105 | * [Koding](https://koding.com/) - [A free 3 months Hobbyist Koding plan](https://koding.com/Pricing)
106 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
107 | * [O'Reilly](http://www.oreilly.com/) - An eBook [Go:Up and Running](http://shop.oreilly.com/product/0636920030638.do)
108 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
109 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
110 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
111 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
112 |
113 | _Winner (selected by the Go community)_:
114 |
115 | * [Anand D N](https://twitter.com/Wanderer140) - [Essential-Go screencast](https://www.kajabinext.com/marketplace/courses/1-essential-go)
116 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
117 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
118 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
119 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
120 | * [Koding](https://koding.com/) - [A free 3 months Hobbyist Koding plan](https://koding.com/Pricing)
121 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
122 | * [Packt Publishing](https://www.packtpub.com/) - An eBook [Building Your First Application with Go-Video](https://www.packtpub.com/application-development/building-your-first-application-go-video)
123 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
124 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
125 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
126 |
127 | Anyone can a get 42% off on the price of the following eBooks from [Manning Publications Co.](http://manning.com/):
128 |
129 | * [Go Web Programming](http://www.manning.com/chang/) - Use discount code: **cftw15go**
130 | * [Go in Action](http://www.manning.com/ketelsen/) - Use discount code: **cftw15go**
131 |
132 | Also, anyone can a get 20% off on the price of the following print and / or eBooks from [Packt Publishing](https://www.packtpub.com/):
133 |
134 | * [Building Your First Application with Go-Video](https://www.packtpub.com/application-development/building-your-first-application-go-video) - Use discount code: **20%byfag20**
135 | * [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go) - Use discount code: **20%mcig20**
136 | * [Go Programming Blueprints](https://www.packtpub.com/application-development/go-programming-blueprints) - Use discount code: **20%gpbs20**
137 |
138 | **Winner Interviews**
139 |
140 | After a winner wins the monthly challenge, he/she would be interviewed by [Sourcegraph](https://sourcegraph.com/) and the interview will be published on their [blog](https://sourcegraph.com/blog).
141 |
142 | **Credit**
143 |
144 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
145 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
146 |
--------------------------------------------------------------------------------
/_posts/2015-08-01-go-challenge5.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Go Challenge - 5
4 | tags: [go challenge, golang]
5 | ---
6 |
7 | 
8 |
9 | **Winners have been declared**
10 |
11 | Winner #1 - **Robert Horvath**
12 |
13 | Winner #2 - **Fatih Arslan**
14 |
15 | ---
16 |
17 | #### The August 2015 Go Challenge for developers (newbies included)
18 |
19 | #### Josh Bleecher Snyder: Author of the 5th Go Challenge
20 |
21 |
22 | The 5th Go Challenge author is Josh Bleecher Snyder an active contributor to the Go project. He's an engineer at [Braintree](https://www.braintreepayments.com/) and previously co-founded [card.io](https://www.card.io/).
23 |
24 | Josh has this to say about the challenge:
25 |
26 | > "I love writing tools to work with Go. It gives you a much deeper appreciation for the language and places incredible (and delightfully dangerous) power at your fingertips."
27 |
28 | ---
29 |
30 | #### The Go Challenge 5
31 |
32 | ##### unexport
33 |
34 | ##### Preamble
35 |
36 | [Go 1.5rc1](https://golang.org/dl/#go1.5rc1) is out! The gc compiler is now written in Go, and the [go/types package](https://tip.golang.org/pkg/go/types/) is now part of the standard library.
37 |
38 | Time for some fun. :)
39 |
40 | The compiler was converted from C to Go mechanically. This helped avoid bugs, but it means that the code is still very C-ish. The Go team has been slowly and carefully doing cleanup to make the compiler more idiomatic. It is preferable to use type-safe tools (such as [eg](http://godoc.org/golang.org/x/tools/cmd/eg) and [gorename](http://godoc.org/golang.org/x/tools/cmd/gorename)) to do large-scale cleanup, because they make fewer mistakes than humans.
41 |
42 | But sometimes, [the tool you need doesn't exist](https://go-review.googlesource.com/#/c/7593/). Fortunately, the standard library gives us [amazing tools to build tools](https://talks.golang.org/2014/hammers.slide#1). So you build one.
43 |
44 | Let's build one.
45 |
46 | **Goals of the challenge**
47 |
48 | At a high level, the goal of this challenge is to write a tool that will find unnecessarily exported identifiers in a package and help unexport them.
49 |
50 | This is inspired by the fact that the cmd/compile/internal/gc exports much more than it needs to. (This is ok insofar as it is an [internal package](https://golang.org/s/go14internal), but it'd be better for the API to be more precise.)
51 |
52 |
53 | **Requirements of the challenge**
54 |
55 | Solutions should:
56 |
57 | * Be general purpose. That is, the tool should accept a package as an argument.
58 | * Cover all exported identifiers, including functions, constants, variables, types, field names in structs, etc. If godoc shows it, it qualifies.
59 | * Allow the user to decide which identifiers should be unexported. There may be good reasons to keep an identified exported even if it is not used by any packages. One simple way to do this is to have unexport generate a series of [gorename](http://godoc.org/golang.org/x/tools/cmd/gorename) commands. The user could then decide which renamings to apply. It is up to you to design the interface as you please.
60 | * Use only packages found in the standard library and the [golang.org/x/tools repo](http://godoc.org/golang.org/x/tools). Note that there are two copies of the go/types package, [one in the standard library](htts://golang.org/pkg/go/types/) and one in [golang.org/x/tools](http://godoc.org/golang.org/x/tools/go/types). It is ok to use either one. All else being equal, the standard library version is preferable, but the useful [go/loader package](http://godoc.org/golang.org/x/tools/go/loader) in golang.org/x/tools is not (yet?) part of the standard library.
61 | * Use Go 1.5.
62 |
63 |
64 | Bonus features:
65 |
66 | * Provide flag (-safe?) that restricts the use of unexport to internal packages. Only with an internal package can you know definitively that no one is using an exported identifier.
67 | * Provide a mode that shows the number of uses of each exported identifier, and perhaps by which packages they are used.
68 | * Warn if unexporting an identifier will cause a naming collision.
69 | * Whatever else you can think of that would be useful in such a tool. However, please keep the tool focused. If you think building such tools is fun and want ideas for other tools that would be helpful, just ask. :)
70 | * Concise, tone-neutral notes about places where you got stuck or confused and about places where the documentation or examples could be improved. This will help all future gophers. Super bonus points for writing blog posts or making other introductory materials to help others.
71 |
72 |
73 | **Hints**
74 |
75 | unexport might sound complicated to build. It's actually not, thanks to the amazing packages you can build on. The hard part is getting up to speed on the tools at your disposal; the learning curve can be steep. Be patient, build incrementally, and make toys as you go.
76 |
77 | In addition to the packages mentioned so far, you might also find the standard library's [go/* packages](http://golang.org/pkg/go/) useful, particularly go/ast.
78 |
79 | Examples of programs that use go/ast, go/types, and related packages include:
80 |
81 | * [Tools in golang.org/x/tools/cmd](http://godoc.org/golang.org/x/tools/cmd) such as eg, fiximports, goimports, gorename, gotype, and stringer.
82 | * [Tools in the standard library](http://golang.org/cmd/) such as cover, doc, go, gofmt, and vet.
83 | * Other tools, such as [lint](https://github.com/golang/lint), [impl](https://github.com/josharian/impl), and [grind](http://godoc.org/rsc.io/grind).
84 |
85 | I recommend using little test packages during development rather than tackling cmd/compile/internal/gc, because package gc is large and complex.
86 |
87 |
88 | **Special note for the evaluators**
89 |
90 | Good entries will be small and obviously correct.
91 |
92 | My personal goal in setting this challenge is to inspire more gophers to know about these tools and to solve programming/refactoring problems they face by writing tools. The Go team has laid the groundwork for an ecosystem of awesome tools and seeded it with powerful programs. I hope that this will encourage its growth.
93 |
94 | ---
95 |
96 | #### Challenge Rules and how to enter the Go Challenge?
97 |
98 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
99 |
100 | * The Challenge is open to individuals.
101 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
102 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
103 | * Odds of winning depend on the number and quality of entries received.
104 | * All taxes, including income taxes, are the sole responsibility of the winners.
105 | * No prize substitution is permitted.
106 | * Create a zip of your Go source code and test cases and send the zip file to **golangchallenge [at] gmail.com before 25th of August 2015 (6 am IST). Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=8&d=25&h=6&mn=0) to find the equivalent time in your city/country**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, twitter or GitHub id (if any) and participating under which category - Just participating | Participating and exploring further | Just for Fun | Anonymous entry**. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes.
107 | * We will give your zip file to the evaluation team.
108 | * We shall be publishing on this blog, a list of participant names. If you don't want your name to appear kindly mention the same in your email.
109 | * You are allowed to re-submit your code if you feel it is necessary.
110 | * **Note**: Avoid sharing your code with anyone else; if your solution becomes available to the general public it might impact evaluation of your submission.
111 | * After the challenge is over, all submissions will be made available [online on GitHub](https://github.com/golangchallenge/GCSolutions) under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) or the [GNU General Public License, version 3 - GPL-3.0](http://opensource.org/licenses/GPL-3.0) unless a participant has indicated that his/her solution should not be made public before the challenge ends.
112 |
113 | #### How will the challenge be evaluated?
114 |
115 | Entries will be anonymized and evaluated by the challenge author and a team of evaluators.
116 |
117 | * Functioning code and a test suite that passes.
118 | * Code hygiene. Use [gofmt](https://golang.org/cmd/gofmt/), [vet](https://godoc.org/golang.org/x/tools/cmd/vet) and [lint](https://github.com/golang/lint). Review [CodeReviewComments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).
119 | * Readability. How easy is it for another programmer to grasp what your entry is doing?
120 | * Code structure. Do types and files have good names?
121 | * Reliability. Are errors properly handled?
122 | * Appropriate consideration given to memory and performance (nothing is unnecessarily expensive).
123 |
124 | #### Questions?
125 |
126 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) and ask your questions with the tag @josharian so that the challenge author is aware of your question(s) and can reply to the same (the author is totally unavailable from midday Fri 31st July until Monday morning 3rd Aug, Pacific time. Other than that, he will be available). This is a room for people who are going to participate in the Go Challenge. You can also send us an email at golangchallenge [at] gmail.com
127 |
128 | #### Evaluators
129 |
130 | [Nathan Youngman](https://twitter.com/nathany) had set the guidelines for evaluation for the first Go Challenge. Subsequently [Dominik Honnef](https://twitter.com/dominikhonnef) modified the guidelines based on his experience as an evaluator for the first challenge. [Austin Riendeau](https://github.com/apriendeau), [Cory LaNou](https://twitter.com/corylanou), [Edd Robinson](https://github.com/e-dard), [Gautam Dey](https://github.com/gdey), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Kevin Gillette](https://twitter.com/kevingillette) and [Pravin Mishra](https://twitter.com/pravinmishra88) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
131 |
132 | #### Best Solution
133 |
134 | The author of the Go Challenge will decide the best five solutions. The author shall have the sole authority and discretion to select the award recipients.
135 |
136 | #### Notification
137 |
138 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
139 |
140 | #### Prizes
141 |
142 | The author of the challenge will select 5 winners but prizes will be awarded to the top 2 winners.
143 |
144 | Here are some great prizes provided by our sponsors for the event.
145 |
146 | _Winner 1_:
147 |
148 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
149 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
150 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing).
151 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
152 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
153 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
154 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
155 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
156 |
157 | _Winner 2_:
158 |
159 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
160 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
161 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
162 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go Web Programming](http://www.manning.com/chang/)
163 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
164 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
165 |
166 | #### Winner Interviews
167 |
168 | After a winner wins the monthly challenge, he/she would be interviewed by [Sourcegraph](https://sourcegraph.com/) and the interview will be published on their [blog](https://sourcegraph.com/blog).
169 |
170 | #### Challenge Solutions
171 |
172 | All the solutions submitted by the participants will be available **[here](https://github.com/golangchallenge/GCSolutions)** after the challenge ends.
173 |
174 | #### The Winners
175 |
176 | 
177 |
178 |
179 |
180 | **Winner #1 - Robert Horvath** is a software developer from Austria, currently working at [Catalysts](http://www.catalysts.cc) while pursuing a master's degree in computer science at the Vienna University of Technology. He started programming at an early age and has been writing code ever since. Over the years he used many different programming languages, most importantly PHP, Java, C, Ruby and JavaScript. He only recently started dabbling in Go, but likes it and plans on using it for more projects soon.
181 |
182 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/aug15/normal/robert-horvath).
183 |
184 | ---
185 |
186 |
187 |
188 | **Winner #2 - Fatih Arslan** is a software engineer at Koding.com. He is working on the backend team and is responsible for managing and scaling user VMs. He is the creator of vim-go, the most popular editor plugin in Go. He also wrote several widely used Go packages, such as [structs](https://github.com/fatih/structs), [color](https://github.com/fatih/color), [kite](https://github.com/koding/kite), tunnel, pool, set, etc.. Check his [GitHub id](https://github.com/fatih). He is an avid Go developer and has contributed to several open source projects.
189 |
190 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/aug15/normal/fatih-arslan).
191 |
192 | ---
193 |
194 | #### Sponsors
195 |
196 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Cube Root Software](http://cuberoot.in/), [Docker](https://www.docker.com/), [GitHub](https://github.com/), [InfluxDB](http://influxdb.com/), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [Packt Publishing](https://www.packtpub.com/), [Qwinix Technologies](http://www.qwinixtech.com/), [SoStronk](https://www.sostronk.com/) and [Sourcegraph](https://sourcegraph.com/).
197 |
198 | #### Credit
199 |
200 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
201 | * [GitHub](https://github.com/) for the yearly sponsorship of a [GitHub Bronze Organisation plan](https://github.com/pricing) for the Go Challenge.
202 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
203 |
204 |
205 |
--------------------------------------------------------------------------------
/_posts/2015-09-01-go-challenge6.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Go Challenge - 6
4 | tags: [go challenge, golang]
5 | ---
6 |
7 | 
8 |
9 | **Winners have been declared**
10 |
11 | Winner #1 - **Xiao Jiang**
12 |
13 | Winner #2 - **Kim Eik**
14 |
15 | ---
16 |
17 | #### The September 2015 Go Challenge for developers (newbies included)
18 |
19 | #### Steve Francia: Author of the 6th Go Challenge
20 |
21 |
22 | The 6th Go Challenge author is Steve Francia who is responsible for two of the largest projects in Go (and open source); He's the Chief Operator of the [Docker](https://www.docker.com/) project and the creator of [Hugo](http://gohugo.io/), the most contributed-to community project in Go. He loves open source and is thrilled to be able to work on it full time, and then some. He has also created some of the most widely-used Go libraries, including [cobra](https://github.com/spf13/cobra), [viper](https://github.com/spf13/viper) and [nitro](https://github.com/spf13/nitro). In writing, Steve tweets as [@spf13](https://twitter.com/spf13), blogs at [spf13.com](http://spf13.com/) and has written a few books for O'Reilly. In person, he enjoys giving talks and workshops and spending time with the Go community around the world. When not coding, he is usually having fun outdoors with his wife and four children.
23 |
24 | Steve has this to say about the challenge:
25 |
26 | > "I thought it would be fun to play with Mazes. I don't really have any prior experiences with programming mazes and I learned a lot through this exercise. I hope you will enjoy it as well."
27 |
28 | ---
29 |
30 | #### The Go Challenge 6
31 |
32 | ##### Daedalus & Icarus
33 |
34 | ##### Preamble
35 |
36 | In Greek mythology, Daedalus was a skillful craftsman and artist. He is the father of Icarus, and the creator of the Labyrinth. This Go challenge will be unlike any previous one. You will be creating two bots which will compete head to head with all of the other participants.
37 |
38 | **Bot 1. Daedalus**
39 |
40 | 
41 |
42 | Daedalus's job is to create a challenging Labyrinth for his opponent (shadow Icarus) to solve. The Labyrinth must be 15 cells by 10 cells. Icarus will be place in a random location which will be accessible to the goal which is a set of wings. The Labyrinth must be fully enclosed and there must be a possible solution. Icarus must be located in a random location accessible to the treasure. The treasure (wings) must also be in a random location that is accessible to Icarus.
43 |
44 | **Bot 2. Icarus**
45 |
46 | 
47 |
48 | Icarus wakes up to find himself inside of a dark Labyrinth. Due to the darkness of the Labyrinth he can only see his immediate room and if there is a wall or not to the top, right, bottom and left. He takes one step and then can discover if his new cell has walls on each of the four sides.
49 |
50 | **Goals of the challenge**
51 |
52 | Your goal is to write a maze generator and a maze solver to go head to head against other bots.
53 |
54 | The goal is to have your Icarus solve your opponents Labyrinth the fastest (lowest number of steps). Victory will require a cleverly crafted maze as well as a intelligent solver.
55 |
56 | We will run a big tournament to determine who has created the best pair of Bots. Each round will consist of two entrants going head to head.
57 |
58 | We will run 500 simulations between opponents and take the average number of steps taken to solve the labyrinth. The competitor with the lower average steps will win and go onto the next round.
59 |
60 | **Ground Rules**:
61 |
62 | * Every maze generated must be solvable.
63 | * Both Icarus and the treasure must be randomly placed.
64 | * Mazes must be fully enclosed. The only way out is the treasure.
65 | * Dynamic (shifting) mazes are not allowed. Once icarus wakes up the walls and treasure must be fixed.
66 | * A wall needs to be set on both sides of neighboring cells. No one way walls.
67 | * Mazes may have more than one correct solution.
68 | * No cheating. Don't miscount steps or anything like that.
69 |
70 | This is meant to be fun. The hope for this challenge is to get you thinking about how to write code in Go. We will be exposing you to some of the basic libraries you would use to write both command line applications and web services.
71 |
72 | **Requirements of the challenge**
73 |
74 |
75 |
76 | You will be given incomplete source code for application which you must complete. The structure and scaffolding of the application is there for you already done, but the critical logic is missing.
77 |
78 | You will communicate with your opponent bot over a REST API. A complete skeleton for the app structure will be provided to you to ensure every bot has the same flags & endpoints.
79 |
80 | This challenge makes use of 3 libraries outside the standard library:
81 |
82 | * [gin](https://github.com/gin-gonic/gin) : One of the many web frameworks available for Go. I particularly like the speed and interface Gin provides.
83 | * [cobra](https://github.com/spf13/cobra) : A Commander for modern Go CLI interactions. Used by Google’s Kubernetes, RedHat’s Project Atomic, Docker, OpenShift, CoreOS’s Rocket, Parse, GiantSwarm & GopherJS
84 | * [viper](https://github.com/spf13/viper) : A complete configuration solution for Go applications. It is designed to work within an application, and can handle all types of configuration needs and formats.
85 |
86 | There are 4 different operations already defined for the program.
87 |
88 | * a bare `labyrinth` will run a server and connect your client to it to solve it
89 | * `labyrinth daedalus` will run a server
90 | * `labyrinth icarus` will run a client
91 | * `labyrinth author` will output your given name
92 | * `labyrinth help` will output help for these commands and the flags they take.
93 |
94 | You will need to make changes to at least 3 files to complete your task.
95 |
96 | You will need to:
97 |
98 | * Put your name in the `var AuthorName = "spf13"` line in commands/labyrinth.go file
99 | * Write the `createMaze()` function in the commands/daedalus.go file
100 | * Write the `solveMaze()` function in the commands/icarus.go file
101 |
102 | You may (and likely will want to) make other changes to these files but keep the integrity of the API intact.
103 |
104 | **Bonus features**:
105 |
106 | The default behavior of the `labyrinth` program is to run a server and connect to it with a client thus creating and solving a maze. This is really helpful for testing.
107 |
108 | There is an additional library provided that will do nice things like providing a few interfaces and a `printMaze(Maze)` function that will print the maze to the terminal in ascii.
109 |
110 | **Hints**
111 |
112 | [This site](http://www.astrolog.org/labyrnth/algrithm.htm) is a pretty good resource explaining different types of Mazes.
113 |
114 | [Mazes for Programmers](http://www.amazon.com/Mazes-Programmers-Twisty-Little-Passages-ebook/dp/B013HA1UY4/ref=mt_kindle?_encoding=UTF8&me=) is also a helpful book.
115 |
116 | **Special note for the evaluators**
117 |
118 | Running `labyrinth daedalus` from competitor A and `labyrinth icarus --times 500` from competitor B is all that is needed for running a simulation.
119 |
120 | ---
121 |
122 | #### Challenge Rules and how to enter the Go Challenge?
123 |
124 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
125 |
126 | * The Challenge is open to individuals.
127 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
128 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
129 | * Odds of winning depend on the number and quality of entries received.
130 | * All taxes, including income taxes, are the sole responsibility of the winners.
131 | * No prize substitution is permitted.
132 | * Git clone this [repo](https://github.com/golangchallenge/gc6). The cloned repo should be private, only accessible to you till the end of the challenge. You could use any of these [Free GitHub Alternatives for Private Repositories](http://toppersworld.com/top-10-free-github-alternatives-for-private-repositories/). You can keep pushing your code to this cloned private repo of yours.
133 | * At the end of the challenge make your repo public and send us the URL to **golangchallenge [at] gmail.com on 15th of Sept 2015 (6 am IST). Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=9&d=15&h=6&mn=0) to find the equivalent time in your city/country**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, twitter or GitHub id (if any) and participating under which category - Just participating | Participating and exploring further | Just for Fun | Anonymous entry**. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes.
134 | * We shall be publishing on this blog, a list of participant names. If you don't want your name to appear kindly mention the same in your email.
135 | * You are allowed to re-submit your code if you feel it is necessary.
136 | * **Note**: Avoid making your private repo public till the end of the challenge; if your solution becomes available to the general public it might impact evaluation of your submission.
137 | * After the challenge is over, all submissions will be made available [online on GitHub](https://github.com/golangchallenge/GCSolutions) under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) or the [GNU General Public License, version 3 - GPL-3.0](http://opensource.org/licenses/GPL-3.0) unless a participant has indicated that his/her solution should not be made public before the challenge ends.
138 |
139 | #### How will the challenge be evaluated?
140 |
141 | Entries will be evaluated by the challenge author and a team of evaluators.
142 |
143 | #### Questions?
144 |
145 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) and ask your questions with the tag @spf13 so that the challenge author is aware of your question(s) and can reply to the same. This is a room for people who are going to participate in the Go Challenge. You can also send us an email at golangchallenge [at] gmail.com
146 |
147 | #### Evaluators
148 |
149 | [Nathan Youngman](https://twitter.com/nathany) had set the guidelines for evaluation for the first Go Challenge. Subsequently [Dominik Honnef](https://twitter.com/dominikhonnef) modified the guidelines based on his experience as an evaluator for the first challenge. [Austin Riendeau](https://github.com/apriendeau), [Cory LaNou](https://twitter.com/corylanou), [Edd Robinson](https://github.com/e-dard), [Gautam Dey](https://github.com/gdey), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Kevin Gillette](https://twitter.com/kevingillette) and [Pravin Mishra](https://twitter.com/pravinmishra88) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
150 |
151 | #### Best Solution
152 |
153 | The author of the Go Challenge will decide the best five solutions. The author shall have the sole authority and discretion to select the award recipients.
154 |
155 | #### Notification
156 |
157 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
158 |
159 | #### Prizes
160 |
161 | The author of the challenge will select 5 winners but prizes will be awarded to the top 2 winners.
162 |
163 | Here are some great prizes provided by our sponsors for the event.
164 |
165 | _Winner 1_:
166 |
167 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
168 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
169 | * [Docker](https://www.docker.com/) - 1 ticket to DockerCon Europe in November.
170 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing).
171 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
172 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
173 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
174 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
175 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
176 |
177 | _Winner 2_:
178 |
179 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
180 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
181 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
182 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go Web Programming](http://www.manning.com/chang/)
183 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
184 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
185 |
186 | #### Winner Interviews
187 |
188 | After a winner wins the monthly challenge, he/she would be interviewed by [Sourcegraph](https://sourcegraph.com/) and the interview will be published on their [blog](https://sourcegraph.com/blog).
189 |
190 | #### Challenge Solutions
191 |
192 | All the solutions submitted by the participants will be available **[here](https://github.com/golangchallenge/GCSolutions)** after the challenge ends.
193 |
194 | #### The Winners
195 |
196 | 
197 |
198 |
199 |
200 | **Winner #1 - Xiao Jiang** is a software engineer working for Facebook in California, U.S. He studied Computer Science in Shanghai Jiao Tong University in China before joining the company. For the last two and half years, he mostly deals with Hack, which is the Facebook fork of PHP. He recently switched to the Parse team, which is also part of Facebook, and started to use Go fulltime. He likes the language a lot and hopes he could make some contribution to the community in the not too distant future.
201 |
202 | His [solution](https://github.com/showbufire/gc6).
203 |
204 | ---
205 |
206 |
207 |
208 | Winner #2 - **Kim Eik** is 30 years of age and lives in Norway. He's a senior developer at Bouvet which is a Norwegian IT consulting firm. He considers himself to be a full-stack devop, mainly in the Java ecosystem. He has been following the development of golang since it's debut, but especially after it's 1.0 release. He really enjoys the language and tools and hopes that one day he gets the opportunity to be part of a development team working with golang full-time.
209 |
210 | His [solution](https://github.com/netbrain/gc6).
211 |
212 | ---
213 |
214 | #### Sponsors
215 |
216 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Cube Root Software](http://cuberoot.in/), [Docker](https://www.docker.com/), [GitHub](https://github.com/), [InfluxDB](http://influxdb.com/), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [Packt Publishing](https://www.packtpub.com/), [Qwinix Technologies](http://www.qwinixtech.com/), [SoStronk](https://www.sostronk.com/) and [Sourcegraph](https://sourcegraph.com/).
217 |
218 | #### Credit
219 |
220 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
221 | * [GitHub](https://github.com/) for the yearly sponsorship of a [GitHub Bronze Organisation plan](https://github.com/pricing) for the Go Challenge.
222 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
223 |
--------------------------------------------------------------------------------
/_posts/2015-03-01-go-challenge1.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Go Challenge - 1
4 | tags: [go challenge, golang]
5 | ---
6 |
7 | #### The world's first monthly Go Challenge for developers (newbies included)
8 |
9 | ---
10 |
11 | 
12 |
13 | * This first Go challenge is now closed.
14 | * There were 173 entries from 41 countries.
15 | * The winners of the first Go Challenge are: [Luke Champine](https://twitter.com/NebulousLabs) (his [solution](https://github.com/golangchallenge/GCSolutions/tree/master/march15/normal/luke-champine)) and [Jeremy Jay](https://github.com/pbnjay) (his [solution](https://github.com/golangchallenge/GCSolutions/tree/master/march15/extra/jeremy-jay/stridatum-go-challenge-1-8f32f9a76497)).
16 | * [Sourcegraph](https://sourcegraph.com) interviewed our winners: [Luke Champine](https://sourcegraph.com/blog/go-challenge-luke-champine) and [Jeremy Jay](https://sourcegraph.com/blog/go-challenge-jeremyjay).
17 | * Some of the participants blogged about their Go challenge experience: [Christopher Saunders](http://learningtolearn.sndrs.ca/blog/2015-03-20-what-i-learned-during-the-march-go-challenge/), [Doug Cichon](http://www.codeforthought.net/approaching-golang-challenge-one), [Herrick Shen](http://www.cnblogs.com/journeyonmyway/p/4358608.html), [Jason Gade](http://bravetinsoldier.blogspot.in/2015/03/lessons-learned-from-first-go-challenge.html) and [Tobias Schoknecht](https://www.sysorchestra.com/2015/03/24/the-go-challenge-a-fun-way-to-learn-and-improve/).
18 |
19 | **Feedback from the Evaluators**
20 |
21 | > Difficult to give generalized comments, but here are some suggestions.
22 | >
23 | > 1. Running `go vet` and `golint` should be a no-brainer. I found that a few entries failed this test.
24 | > 2. Use the `defer` statement to free up resources after use - for example, on file open.
25 | > 3. Do not over-engineer. Types are easy to define, but sometimes, all you need is a func.
26 | > 4. Comment your code well. What may seem obvious to you may not be so obvious to someone reading your code.
27 |
28 | A more detailed feedback is available [here](http://golang-challenge.com/evaluator-feedback/).
29 |
30 | ---
31 |
32 | #### Matt Aimonetti: Author of the first Go Challenge
33 |
34 |
35 | The first Go Challenge author is [Matt Aimonetti](http://matt.aimonetti.net/), CTO and co-founder of [Splice](https://splice.com/), a technology platform for music creators. Splice streamlines the fragmented process of creating and sharing music, freeing musicians to spend their time and energy on the creative process.
36 |
37 | Long before Splice, Matt was a former sound engineer who tried his hand as an artist before transitioning to full time programming, working for companies such as Sony PlayStation and LivingSocial. Matt has been active in the Open Source community for many years, developing or contributing to many projects (Merb, Rails, MacRuby and many more). He also wrote a [free book about Go](http://www.golangbootcamp.com/) and is a [published tech author](http://www.oreilly.com/pub/au/4385) for O'Reilly. Matt is based in Santa Monica, California.
38 |
39 | Matt has this to say about the challenge:
40 |
41 | > "Very often developers just need an excuse to learn a new language or develop their own skills. The Go challenge is a great opportunity to work on a low-pressure, isolated, fun challenge and hopefully learn a lot. Getting out of the day to day programmer routine is an awesome way to challenge your brain and become a better developer."
42 |
43 | ---
44 |
45 | #### The Go Challenge 1
46 |
47 | This morning I took my daughter Giana to my secret lab to show her the various inventions I built over the years. That's when I realized that the awesome drum machine prototype I designed in the 90s had disappeared!!! The only related things I could find were printouts of the patterns I had created on the device as well as backups saved on floppy disks. Here are the printed patterns:
48 |
49 | ```
50 | pattern_1.splice
51 | Saved with HW Version: 0.808-alpha
52 | Tempo: 120
53 | (0) kick |x---|x---|x---|x---|
54 | (1) snare |----|x---|----|x---|
55 | (2) clap |----|x-x-|----|----|
56 | (3) hh-open |--x-|--x-|x-x-|--x-|
57 | (4) hh-close |x---|x---|----|x--x|
58 | (5) cowbell |----|----|--x-|----|
59 | ```
60 |
61 | ```
62 | pattern_2.splice
63 | Saved with HW Version: 0.808-alpha
64 | Tempo: 98.4
65 | (0) kick |x---|----|x---|----|
66 | (1) snare |----|x---|----|x---|
67 | (3) hh-open |--x-|--x-|x-x-|--x-|
68 | (5) cowbell |----|----|x---|----|
69 | ```
70 |
71 | ```
72 | pattern_3.splice
73 | Saved with HW Version: 0.808-alpha
74 | Tempo: 118
75 | (40) kick |x---|----|x---|----|
76 | (1) clap |----|x---|----|x---|
77 | (3) hh-open |--x-|--x-|x-x-|--x-|
78 | (5) low-tom |----|---x|----|----|
79 | (12) mid-tom |----|----|x---|----|
80 | (9) hi-tom |----|----|-x--|----|
81 | ```
82 |
83 | ```
84 | pattern_4.splice
85 | Saved with HW Version: 0.909
86 | Tempo: 240
87 | (0) SubKick |----|----|----|----|
88 | (1) Kick |x---|----|x---|----|
89 | (99) Maracas |x-x-|x-x-|x-x-|x-x-|
90 | (255) Low Conga |----|x---|----|x---|
91 | ```
92 |
93 | ```
94 | pattern_5.splice
95 | Saved with HW Version: 0.708-alpha
96 | Tempo: 999
97 | (1) Kick |x---|----|x---|----|
98 | (2) HiHat |x-x-|x-x-|x-x-|x-x-|
99 | ```
100 |
101 | I need your help to reverse engineer the binary format used by my drum machine and write a decoder so I will be able to implement a new drum machine, using Go this time!
102 |
103 | #### To get started
104 |
105 | You will find [attached a zip file](http://golang-challenge.com/data/ch1/golang-challenge-1-drum_machine.zip) containing the starting point for this challenge.
106 | Your goal is to implement the `drum` package and make it pass the
107 | provided tests.
108 |
109 | #### Some information about my legacy drum machine
110 |
111 | My drum machine loads an audio sample per track, allowing the programmer to schedule the playback of the sound. The scheduling of the playback is done using the concept of steps. A step is one of the parts of the measure that is being programmed (the programmed measure is known as a pattern). The measure (also called a bar) is divided in steps.
112 |
113 | 
114 |
115 | My drum machine only supports 16 step measure patterns played in 4/4 time. The measure is comprised of 4 quarter notes, each quarter note is comprised of 4 sixteenth notes and each sixteenth note corresponds to a step.
116 | If all these music terms are confusing, don't worry, just know that the drum machine uses grid of 16 parts to let you trigger a sound. We have one sound per track and each track can be programmed independently. Each part is called a step. The speed of the playback is based on the tempo (aka bpm).
117 |
118 | Taking an example from the printouts above:
119 | ```
120 | (40) kick |x---|----|x---|----|
121 | ```
122 |
123 | means that we have a track called "kick" (id 40) with the sound output being triggered on the first and ninth steps.
124 |
125 | #### Goal
126 |
127 | The goal of this challenge is to write a binary decoder that given a binary backup, outputs the same printouts as shown above. To do that you need to implement the `DecodeFile(path string) (*Pattern, error)` function inside the drum package. Note that `*Pattern` needs to be printable so it can be compared to the printouts. To help you, a test is provided. To run the test suite, use your terminal to navigate to the location of the unzip file and run `go test -v`. You should see an output similar to this:
128 |
129 | ```
130 | go test -v
131 | === RUN TestDecodeFile
132 | --- FAIL: TestDecodeFile (0.00s)
133 | decoder_test.go:69: decoded:
134 | "&{}"
135 | decoder_test.go:70: expected:
136 | "Saved with HW Version: 0.808-alpha\nTempo: 120\n(0) kick\t|x---|x---|x---|x---|\n(1) snare\t|----|x---|----|x---|\n(2) clap\t|----|x-x-|----|----|\n(3) hh-open\t|--x-|--x-|x-x-|--x-|\n(4) hh-close\t|x---|x---|----|x--x|\n(5) cowbell\t|----|----|--x-|----|\n"
137 | decoder_test.go:72: pattern_1.splice wasn't decoded as expect.
138 | Got:
139 | &{}
140 | Expected:
141 | Saved with HW Version: 0.808-alpha
142 | Tempo: 120
143 | (0) kick |x---|x---|x---|x---|
144 | (1) snare |----|x---|----|x---|
145 | (2) clap |----|x-x-|----|----|
146 | (3) hh-open |--x-|--x-|x-x-|--x-|
147 | (4) hh-close |x---|x---|----|x--x|
148 | (5) cowbell |----|----|--x-|----|
149 | FAIL
150 | exit status 1
151 | ```
152 |
153 | #### Requirements
154 |
155 | * Only use Go standard library. No third-party libraries may be imported.
156 | * You are welcome to modify (improve) the included test suite or move the binaries, but the `DecodeFile` API must remain and the original test suite must still pass.
157 |
158 | #### Hints
159 |
160 | * Look around to see how data is usually [serialized/encoded](http://golang.org/pkg/encoding/json/).
161 | * Become familiar with [encoding/binary package](http://golang.org/pkg/encoding/binary/), especially [binary.Read](http://golang.org/pkg/encoding/binary/#Read).
162 | * [hex.Dump](http://golang.org/pkg/encoding/hex/#Dump) can very useful when debugging binary data (read more about [hex dump](http://en.wikipedia.org/wiki/Hex_dump))
163 |
164 | #### I don't know where to start :(
165 |
166 |
167 |
168 | The first step is to reverse engineer the binary file format. Look at the hex values to see if you can detect patterns. Binary data usually contains some sort of headers, then the encoded data. You should expect to find the data described in the printouts:
169 |
170 | * version
171 | * tempo
172 | * tracks with each track containing
173 | * id
174 | * name
175 | * 16 steps
176 |
177 | Then you need to write a decoder that takes one of the provided binary files and extracts/prints the data.
178 |
179 | #### Go further (optional, not evaluated for the challenge)
180 |
181 | This advanced section is not for the faint of heart, in case you were about to complain about how easy this challenge was, or if you just want to push things further, here is some more!
182 |
183 | How about editing the cowbell track to add more steps? Reading the binary format is one thing, being able to generate/modify the data is even more fun. Take a pattern of your choosing and add more cowbell! For instance convert `pattern_2.splice` from:
184 |
185 | ```
186 | pattern_2.splice
187 | Saved with HW Version: 0.808-alpha
188 | Tempo: 98.4
189 | (0) kick |x---|----|x---|----|
190 | (1) snare |----|x---|----|x---|
191 | (3) hh-open |--x-|--x-|x-x-|--x-|
192 | (5) cowbell |----|----|x---|----|
193 | ```
194 |
195 | to:
196 |
197 | ```
198 | pattern_2-morebells.splice
199 | Saved with HW Version: 0.808-alpha
200 | Tempo: 98.4
201 | (0) kick |x---|----|x---|----|
202 | (1) snare |----|x---|----|x---|
203 | (3) hh-open |--x-|--x-|x-x-|--x-|
204 | (5) cowbell |x---|x-x-|x---|x-x-|
205 | ```
206 |
207 | Still not enough? Why not implementing the playback of the patterns
208 | using something like [portaudio](https://godoc.org/code.google.com/p/portaudio-go/portaudio)?
209 |
210 | ---
211 |
212 | #### Challenge Rules and how to enter the Go Challenge?
213 |
214 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
215 |
216 | * The Challenge is open to individuals.
217 | * After the challenge, all submissions will be made available online on GitHub under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause).
218 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
219 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
220 | * Odds of winning depend on the number and quality of entries received.
221 | * All taxes, including income taxes, are the sole responsibility of winners.
222 | * No prize substitution is permitted.
223 | * Create a zip of your Go source code and send the zip file to **gochallenge [at] joshsoftware.com by the 13th of March 2015 (6 am IST). Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=3&d=13&h=6&mn=0) to find the equivalent time in your city/country**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, and twitter id (if any)**. We shall be publishing on this blog, a list of participant names. If you don't want you name to appear kindly mention the same in your email. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes. We will give your zip file to the evaluation team. **Note**: Avoid sharing your code with anyone else; if your solution becomes available to the general public it might impact evaluation of your submission.
224 |
225 | #### How will the challenge be evaluated?
226 |
227 | Entries will be anonymized and evaluated by the challenge author and a team of evaluators.
228 |
229 | * Functioning code and a test suite that passes.
230 | * Code hygiene. Use [gofmt](https://golang.org/cmd/gofmt/), [vet](https://godoc.org/golang.org/x/tools/cmd/vet) and [lint](https://github.com/golang/lint). Review [CodeReviewComments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).
231 | * Readability. How easy is it for another programmer to grasp what your entry is doing?
232 | * Code structure. Do types and files have good names?
233 | * Reliability. Are errors properly handled?
234 | * Appropriate consideration given to memory and performance (nothing is unnecessarily expensive).
235 |
236 | #### Questions?
237 |
238 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) which is a room for people who are going to participate in the Go Challenge.
239 |
240 | #### Evaluators
241 |
242 | [Nathan Youngman](https://twitter.com/nathany) has agreed to set the guidelines for evaluation. [Dominik Honnef](http://dominik.honnef.co/), [Guillaume J. Charmes](https://twitter.com/charme_g), [Jiahua Chen](https://twitter.com/joe2010xtmf), [Niket Patel](https://twitter.com/nexneo), [Pravin Mishra](https://twitter.com/pravinmishra88) and [Sanat Gersappa](https://twitter.com/sanatgersappa) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
243 |
244 | #### Best Solution
245 |
246 | The author of the Go Challenge will decide the best two solutions. The author shall have the sole authority and discretion to select the award recipients.
247 |
248 | #### Notification
249 |
250 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
251 |
252 | #### Prizes
253 |
254 | Two prizes will be awarded for the best solution as selected by the author.
255 |
256 | Here are some great prizes provided by our sponsors for the event.
257 |
258 | _Winner 1_:
259 |
260 | * [Anand D N](https://twitter.com/Wanderer140) - [Essential-Go screencast](https://www.kajabinext.com/marketplace/courses/1-essential-go)
261 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
262 | * [CoreOS](https://coreos.com/) - Company T-Shirt and stickers and a free ticket to the [CoreOS Fest](https://coreos.com/fest/) in SFO.
263 | * [Crowd Interactive](http://www.crowdint.com/) - [GitHub Micro Personal Plan](https://github.com/pricing) for three months
264 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
265 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
266 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
267 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
268 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
269 | * [Koding](https://koding.com/Pricing) - A free Hobbyist plan for 3 months
270 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
271 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
272 | * [O'Reilly](http://www.oreilly.com/) - An eBook [Introduction to Go Programming](http://shop.oreilly.com/product/0636920035305.do)
273 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
274 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
275 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
276 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
277 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
278 |
279 | _Winner 2_:
280 |
281 | * [Anand D N](https://twitter.com/Wanderer140) - [Essential-Go screencast](https://www.kajabinext.com/marketplace/courses/1-essential-go)
282 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
283 | * [CoreOS](https://coreos.com/) - Company T-Shirt and stickers and a free ticket to the [CoreOS Fest](https://coreos.com/fest/) in SFO.
284 | * [Crowd Interactive](http://www.crowdint.com/) - [GitHub Micro Personal Plan](https://github.com/pricing) for three months
285 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
286 | * [Docker](https://www.docker.com/) - A ticket to [DockerCon 2015](http://www.dockercon.com/) in SFO, USA OR to DockerCon Europe (to be announced but probably in Dec. 2015).
287 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
288 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
289 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
290 | * [Koding](https://koding.com/Pricing) - A free Hobbyist plan for 3 months
291 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
292 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
293 | * [Packt Publishing](https://www.packtpub.com/) - An eBook [Building Your First Application with Go-Video](https://www.packtpub.com/application-development/building-your-first-application-go-video)
294 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
295 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
296 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
297 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
298 |
299 | Anyone can a get 42% off on the price of the following eBooks from [Manning Publications Co.](http://manning.com/):
300 |
301 | * [Go Web Programming](http://www.manning.com/chang/) - Use discount code: **cftw15go**
302 | * [Go in Action](http://www.manning.com/ketelsen/) - Use discount code: **cftw15go**
303 |
304 | Also, anyone can a get 25% off on the price (valid till 31st March 2015) of the following print and / or eBooks from [Packt Publishing](https://www.packtpub.com/):
305 |
306 | * [Building Your First Application with Go-Video](https://www.packtpub.com/application-development/building-your-first-application-go-video) - Use discount code: **byfag25**
307 | * [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go) - Use discount code: **giccm25**
308 | * [Go Programming Blueprints](https://www.packtpub.com/application-development/go-programming-blueprints) - Use discount code: **bgpg25**
309 |
310 | #### Winner Interviews
311 |
312 | After a winner wins the monthly challenge, he/she would be interviewed by [Sourcegraph](https://sourcegraph.com/) and the interview will be published on their [blog](https://sourcegraph.com/blog).
313 |
314 | #### The Participants
315 |
316 | You can check out the list of participants for this challenge i.e. for March 2015.
317 | 318 | #### Challenge Solutions 319 | 320 | All the solutions submitted by the participants are available **[here](https://github.com/golangchallenge/GCSolutions)**. 321 | 322 | #### The Winners 323 | 324 |  325 | 326 | Matt Aimonetti has selected the winners of this challenge. They are: 327 | 328 |
329 | **Winner #1 Luke Champine** never expected to wind up as a programmer; in college he first studied electrical engineering, and then computer engineering. But he got involved in his school's open source community, which sparked his love of programming and introduced him to Go. He left school without graduating and moved to Boston to co-found [Nebulous](https://twitter.com/NebulousLabs), a cryptocurrency startup.
330 |
331 | Outside of programming, his interests include linguistics, Buddhism, and chess.
332 |
333 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/march15/normal/luke-champine) to the challenge.
334 |
335 | ---
336 |
337 |
338 | **Winner # 2 Jeremy Jay** has been a developer for almost 20 years now. He earned his PhD in Computer Science in 2013, and runs a freelance [software development company](http://stridatum.com/) specializing in mobile apps and complex data integration projects (which often go together!). He has developed applications for all 5 major Operating Systems (Linux, OSX, Windows, iOS, Android), some smaller/embedded ones, using the myriad languages he had picked up along his career. Go is by far his favorite, and has become his daily driver, even for things he used to write short python scripts for. Go's brevity and expressiveness makes it extremely versatile for his daily work.
339 |
340 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/march15/extra/jeremy-jay/stridatum-go-challenge-1-8f32f9a76497) to the challenge.
341 |
342 | ---
343 |
344 | Matt also mentioned that **Doug Cichon** was a very close #2.
345 |
346 | #### Sponsors
347 |
348 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Apcera](https://www.apcera.com/), [CoreOS](https://coreos.com/), [Crowd Interactive](http://www.crowdint.com/), [Cube Root Software](http://cuberoot.in/), [DigitalOcean](https://www.digitalocean.com/), [Docker](https://www.docker.com/), [GopherCasts](https://gophercasts.io/), [Helpshift](http://www.helpshift.com/), [InfluxDB](http://influxdb.com/), [John Sonmez](https://twitter.com/jsonmez), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [NodePrime](http://www.nodeprime.com/), [O'Reilly](http://www.oreilly.com/), [Packt Publishing](https://www.packtpub.com/), [Qwinix Technologies](http://www.qwinixtech.com/), [RainingClouds](http://rainingclouds.com/#!/), [SoStronk](https://www.sostronk.com/) and [Sourcegraph](https://sourcegraph.com/).
349 |
350 | #### Credit
351 |
352 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
353 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
354 |
--------------------------------------------------------------------------------
/_posts/2015-05-25-go-challenge4.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: Go Challenge - 4
4 | tags: [go challenge, golang]
5 |
6 | ---
7 | 
8 |
9 | **Winners have been declared**
10 |
11 | The challenge author had this to say:
12 |
13 | > My preference was for idiomatic code, enough docs that I could take over the code if I had to without crying, parallelization, and memory efficiency. Martin Treusch von Buttlar nailed all of those, other ones were lacking in one or more of each of the things I was looking for.
14 |
15 | Winner #1 - **Martin Treusch von Buttlar**
16 |
17 | Winner #2 - **Zac Bergquist**
18 |
19 | Winner #3 - **Craig Peterson**
20 |
21 | ---
22 |
23 | **The challenge author has added this on 26th May 2015:**
24 |
25 | **Additional Hint**: The challenge as presented might have bottlenecks. Your job is to do the best you can with the input you are given. You might find it interesting to measure where bottlenecks are and experiment with how to remove them by modifying the driver program (but your final submitted solution should still follow the instructions given earlier, using the unmodified driver).
26 |
27 | ---
28 |
29 | #### The June 2015 Go Challenge for developers (newbies included)
30 |
31 | #### Jeff R. Allen: Author of the 4th Go Challenge
32 |
33 |
34 | The 4th Go Challenge author is [Jeff R. Allen](http://blog.nella.org/). Jeff R. Allen is just another Go hacker in Lausanne, Switzerland. He's been using Go since 2010, and remembers using `gofix` every week to fix his programs. He's interested in performance tuning the standard library (but only once it is correct, and only if the result is [clearer than it was before](https://github.com/golang/go/commit/6d248cec56dd56f3ddb92bd587b5c4ac2f9919b1)).
35 |
36 | When he is not busy hacking Go, he likes to cut his grass with a scythe and give the clippings to the alpacas who live next door.
37 |
38 | Jeff has this to say about the challenge:
39 |
40 | > "This challenge is a version of a [packing problem](http://en.wikipedia.org/wiki/Packing_problems)."
41 |
42 | > With problems of this type, there are often a range of solutions available from "trivial but not very good", through to "perfect, but too expensive". It is my hope that this range of possible solutions gives the range of programmers that the Golang Challenge attracts a range of different experiences solving it.
43 |
44 | > The previous challenges have attracted a huge amount of interest. For this we are thankful. But it also means evaluating all of them is hard for our volunteer evaluators. This challenge has been structured to allow us to evaluate the solutions for performance automatically. An unfortunate side effect of making a challenge easier to grade is that we need to take away some of the wide open possibility by constraining the format of the solutions. We hope you can understand the tradeoff and have fun anyway.
45 |
46 | ---
47 |
48 | #### The Go Challenge 4
49 |
50 | ##### Parker & Packer Unpacking & Repacking, Limited
51 |
52 | ##### Preamble
53 |
54 | A few years ago, Bob Parker and his partner Bob Packer found an unexploited niche in the global logistics industry. They realized that poorly packed boxes were wasting space, and worse, tying up pallets that could be resold for a profit. They founded a company and business is booming!
55 |
56 | Now they've got a problem. They've got more boxes to repack than they can mange with their staff. They've invested in robots to help them increase their capacity, and you're in charge of programming them.
57 |
58 | ##### Goals of the challenge
59 |
60 | Your task is to implement an algorithm that, given a trucks full of a pallets with boxes on them that may or may not be correctly packed, packs boxes onto the pallets correctly. A correctly packed pallet is one where none of the boxes on it overlap, and none of the boxes hang over the edge of the pallet. Pallets are packed in only two dimensions, with a single layer of boxes which have an arbitrary height. All of the trucks are going the same place anyway, so it doesn't matter which truck a box goes in, as long as it is packed correctly on a pallet.
61 |
62 | Empty pallets left over after repacking are pure profit. More empties = more better! And if a truck leaves the warehouse with more pallets on it than it came with, it comes out of your profit. So pack carefully!
63 |
64 | ##### Requirements of the challenge
65 |
66 | Download a [zip file](http://golang-challenge.com/data/ch4/gc4.zip) where you'll find a driver program made up of a parser that reads trucks full of pallets from an input file, passes them through the repacker, and evaluates the results.
67 |
68 | Your job is to replace the current `repack.go` file with your own. You may not modify the other provided Go files. You may add additional files.
69 |
70 | Your `repack.go` file will be evaluated on an input file with enough trucks in it to keep your algorithm busy for more than 2 seconds. The better the performance of your algorithm is, the more trucks you'll manage to process in the given time, and thus the more pallets you'll be able to empty, and the more profit you'll make for your client.
71 |
72 | * Use only the standard library.
73 | * Submit a replacement `repack.go`, and any other files needed to make it compile with the provided files (for example, maybe `repack_test.go`).
74 | * All of your code should be in `package main`. Showing that you know how to structure code into packages is not part of this challenge.
75 |
76 | **Note**: Only 30% of your overall score is based on the runtime behavior (the reliability and performance) of your entry. Faster is better, but only if it remains readable and idiomatic Go code. Remember that your colleagues at Parker & Packer have to maintain your code next month when you are working on Golang Challenge #5!
77 |
78 | ##### Hints
79 |
80 | You can use the file `testdata/100trucks.txt` to develop your algorithm.
81 |
82 | You can also use the `-generate` and `-seed` flags to generate your own test files if you'd like. The input file used for evaluating all entries will be generated using `-generate` with a huge number of trucks, and a different seed from the default.
83 |
84 | Your solution will be evaluated on a multi-core system (for example, MacOS X 10.9.5 on a 2.4 GHz Intel Core i7). Note that `GOMAXPROCS` is already set to 4 in `main.go`. If you choose to use multiple goroutines in your repacker, you might be able to process more boxes in the given time, thereby freeing up more pallets and more profit.
85 |
86 | The challenge as presented might have bottlenecks. Your job is to do the best you can with the input you are given. You might find it interesting to measure where bottlenecks are and experiment with how to remove them by modifying the driver program (but your final submitted solution should still follow the instructions given earlier, using the unmodified driver).
87 |
88 | ---
89 |
90 | #### Challenge Rules and how to enter the Go Challenge?
91 |
92 | By participating in this challenge, you agree to be bound by the Challenge Rules below:
93 |
94 | * The Challenge is open to individuals.
95 | * Evaluators cannot enter the challenge except under the "Just for Fun" category.
96 | * Each entrant shall indemnify, defend, and hold JoshSoftware Pvt. Ltd. (who has sponsored the domain and is the organizer of these challenges) harmless from any third party claims arising from or related to that entrant's participation in the Challenge. In no event shall JoshSoftware Pvt. Ltd. be liable to an entrant for acts or omissions arising out of or related to the Challenge or that entrant's participation in the Challenge.
97 | * Odds of winning depend on the number and quality of entries received.
98 | * All taxes, including income taxes, are the sole responsibility of the winners.
99 | * No prize substitution is permitted.
100 | * Create a zip of your Go source code and test cases and send the zip file to **golangchallenge [at] gmail.com before 23rd of June 2015 (6 am IST). Use [this link](http://www.worldtimeserver.com/convert_time_in_IN.aspx?y=2015&mo=6&d=23&h=6&mn=0) to find the equivalent time in your city/country**. No new solutions will be accepted after that. In the email mention **your full name, country of residence, twitter or GitHub id (if any) and participating under which category - Just participating | Participating and exploring further | Just for Fun | Anonymous entry**. We are accepting anonymous submissions and will evaluate them too but then these participants are not eligible for the prizes.
101 | * We will give your zip file to the evaluation team.
102 | * We shall be publishing on this blog, a list of participant names. If you don't want your name to appear kindly mention the same in your email.
103 | * You are allowed to re-submit your code if you feel it is necessary.
104 | * **Note**: Avoid sharing your code with anyone else; if your solution becomes available to the general public it might impact evaluation of your submission.
105 | * After the challenge is over, all submissions will be made available [online on GitHub](https://github.com/golangchallenge/GCSolutions) under the [BSD 3-Clause License](http://opensource.org/licenses/BSD-3-Clause) or the [GNU General Public License, version 3 - GPL-3.0](http://opensource.org/licenses/GPL-3.0) unless a participant has indicated that his/her solution should not be made public before the challenge ends.
106 |
107 | #### How will the challenge be evaluated?
108 |
109 | Entries will be anonymized and evaluated by the challenge author and a team of evaluators.
110 |
111 | * Functioning code and a test suite that passes.
112 | * Code hygiene. Use [gofmt](https://golang.org/cmd/gofmt/), [vet](https://godoc.org/golang.org/x/tools/cmd/vet) and [lint](https://github.com/golang/lint). Review [CodeReviewComments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments).
113 | * Readability. How easy is it for another programmer to grasp what your entry is doing?
114 | * Code structure. Do types and files have good names?
115 | * Reliability. Are errors properly handled?
116 | * Appropriate consideration given to memory and performance (nothing is unnecessarily expensive).
117 |
118 | #### Questions?
119 |
120 | If you have any questions about this challenge, please join the [golang-challenge channel on slack](http://t.co/n6EesY9Mmv) and ask your questions with the tag @jeff_allen so that the challenge author is aware of your question(s) and can reply to the same. This is a room for people who are going to participate in the Go Challenge. You can also send us an email at golangchallenge [at] gmail.com
121 |
122 | #### Evaluators
123 |
124 | [Nathan Youngman](https://twitter.com/nathany) had set the guidelines for evaluation for the first Go Challenge. Subsequently [Dominik Honnef](https://twitter.com/dominikhonnef) modified the guidelines based on his experience as an evaluator for the first challenge. [Austin Riendeau](https://github.com/apriendeau), [Cory LaNou](https://twitter.com/corylanou), [Edd Robinson](https://github.com/e-dard), [Gautam Dey](https://github.com/gdey), [Jyotiska NK](https://twitter.com/jyotiska_nk), [Kevin Gillette](https://twitter.com/kevingillette) and [Pravin Mishra](https://twitter.com/pravinmishra88) have agreed to go through all the submitted solutions of a challenge. They will comment and rank these solutions.
125 |
126 | #### Best Solution
127 |
128 | The author of the Go Challenge will decide the best five solutions. The author shall have the sole authority and discretion to select the award recipients.
129 |
130 | #### Notification
131 |
132 | The winning entries will be announced here on this blog. The winners will be sent their prizes by email/postal mail.
133 |
134 | #### Prizes
135 |
136 | The author of the challenge will select 5 winners.
137 |
138 | Here are some great prizes provided by our sponsors for the event.
139 |
140 | _Winner 1_:
141 |
142 | * [Apcera](https://www.apcera.com/) - [Go Gopher Messenger Bag](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
143 | * [Crowd Interactive](http://www.crowdint.com/) - A US$ 25 Amazon digital gift card.
144 | * [Cube Root Software](http://cuberoot.in/) - An eBook [Go-The Standard Library](https://leanpub.com/go-thestdlib)
145 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
146 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing) and a [T-Shirt](http://github.myshopify.com/) of your choice.
147 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
148 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
149 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
150 | * [Koding](https://koding.com/Pricing) - A free Hobbyist plan for 3 months
151 | * [Manning Publications Co.](http://manning.com/) - Two eBooks [Go Web Programming](http://www.manning.com/chang/) and [Go in Action](http://www.manning.com/ketelsen/)
152 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
153 | * [O'Reilly](http://www.oreilly.com/) - An eBook [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
154 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
155 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
156 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
157 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
158 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
159 |
160 | _Winner 2_:
161 |
162 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
163 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
164 | * [Crowd Interactive](http://www.crowdint.com/) - A US$ 25 Amazon digital gift card.
165 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
166 | * [Docker](https://www.docker.com/) - A ticket to DockerCon Europe (to be announced but probably in Dec. 2015).
167 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing) and a [T-Shirt](http://github.myshopify.com/) of your choice.
168 | * [Helpshift](http://www.helpshift.com/) - An eBook [A Go Developer's Notebook](https://leanpub.com/GoNotebook)
169 | * [InfluxDB](http://influxdb.com/) - A US$ 50 Amazon digital gift card.
170 | * [John Sonmez](https://twitter.com/jsonmez) - An eBook [Soft Skills: The software developer's life manual](http://www.amazon.com/gp/product/1617292397/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1617292397&linkCode=as2&tag=satishtalimsw-20&linkId=WGSAUMHIF2SVWJ7D)
171 | * [Koding](https://koding.com/Pricing) - A free Hobbyist plan for 3 months
172 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go Web Programming](http://www.manning.com/chang/)
173 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
174 | * [Packt Publishing](https://www.packtpub.com/) - A print book [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
175 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
176 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
177 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
178 | * [Sourcegraph](https://sourcegraph.com/) - [Interview with the winner on their blog and will get their shirt, stickers](https://sourcegraph.com/blog)
179 |
180 | _Winner 3_:
181 |
182 | * [Anand D N](https://twitter.com/Wanderer140) - An eBook: [Mastering Go Web Services](http://shop.oreilly.com/product/9781783981304.do)
183 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
184 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
185 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing) and a [T-Shirt](http://github.myshopify.com/) of your choice.
186 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go in Action](http://www.manning.com/ketelsen/)
187 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
188 | * [Packt Publishing](https://www.packtpub.com/) - An eBook [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
189 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
190 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
191 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
192 |
193 | _Winner 4_:
194 |
195 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
196 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
197 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing) and a [T-Shirt](http://github.myshopify.com/) of your choice.
198 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go in Practice](http://www.manning.com/butcher/)
199 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
200 | * [Packt Publishing](https://www.packtpub.com/) - An eBook [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
201 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
202 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
203 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
204 |
205 | _Winner 5_:
206 |
207 | * [Apcera](https://www.apcera.com/) - [Go Gopher Squishable](https://www.googlemerchandisestore.com/shop.axd/Search?keywords=gopher)
208 | * [DigitalOcean](https://www.digitalocean.com/) - US$ 50 Amex Gift Card
209 | * [GitHub](https://github.com/) - Free 1 year of a [Personal Micro Plan](https://github.com/pricing) and a [T-Shirt](http://github.myshopify.com/) of your choice.
210 | * [Manning Publications Co.](http://manning.com/) - One eBook [Go in Practice](http://www.manning.com/butcher/)
211 | * [NodePrime](http://www.nodeprime.com/) - An eBook [The Go Programming Language Phrasebook (Developer's Library)](http://goo.gl/mTwIOS)
212 | * [Packt Publishing](https://www.packtpub.com/) - An eBook [Mastering Concurrency in Go](https://www.packtpub.com/application-development/mastering-concurrency-go)
213 | * [Qwinix Technologies](http://www.qwinixtech.com/) - An eBook [The Docker Book: Containerization is the new virtualization](http://goo.gl/6sJJTy)
214 | * [RainingClouds](http://rainingclouds.com/#!/) - An eBook [Level Up Your Web Apps With Go](http://shop.oreilly.com/product/9780992461294.do)
215 | * [SoStronk](https://www.sostronk.com/) - [Counter-Strike: Global Offensive](http://store.steampowered.com/app/730/) game. You will need to have a free [Steam account](https://store.steampowered.com/join/?) to receive this gift.
216 |
217 | Anyone can a get 42% off on the price of the following eBooks from [Manning Publications Co.](http://manning.com/):
218 |
219 | * [Go Web Programming](http://www.manning.com/chang/) - Use discount code: **cftw15go**
220 | * [Go in Action](http://www.manning.com/ketelsen/) - Use discount code: **cftw15go**
221 | * [Go in Practice](http://www.manning.com/butcher/) - Use discount code: **cftw15go**
222 |
223 | #### Winner Interviews
224 |
225 | After a winner wins the monthly challenge, he/she would be interviewed by [Sourcegraph](https://sourcegraph.com/) and the interview will be published on their [blog](https://sourcegraph.com/blog).
226 |
227 | #### Challenge Solutions
228 |
229 | All the solutions submitted by the participants will be available **[here](https://github.com/golangchallenge/GCSolutions)** after the challenge ends.
230 |
231 | #### The Winners
232 |
233 | 
234 |
235 | Since we had only 20 submissions, the author selected only the top 3 winners. They are:
236 |
237 |
238 |
239 | **Winner #1 - Martin Treusch von Buttlar** is the CTO of [Vitraum](http://vitraum.de) and lives in Hamburg, Germany.
240 |
241 | Martin has used many different programming languages since the early 90's, ranging from C++, Java, Perl, Python to Rails and JavaScript, mostly for web projects. Go was only recently added to this list and used to implement a RESTful API and multiple web crawlers.
242 |
243 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/june15/normal/martin-treusch-von-buttlar).
244 |
245 | ---
246 |
247 |
248 |
249 | **Winner #2 - Zac Bergquist** is a software engineer working mostly in C++, Java, and .NET. He discovered Go 3 or 4 years ago, and was surprised at how easy it was to pick up. He remembers finishing the Tour of Go, and then digging up one of his old school projects (that he wrote in C) and rewriting it in Go. He finished it up in a weekend and was hooked.
250 |
251 | At this point, Go is still just a hobby for him, but he hopes to someday work with Go for a living.
252 |
253 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/june15/normal/zac-bergquist/gc4).
254 |
255 | ---
256 |
257 |
258 |
259 | **Winner #3 - Craig Peterson** is a Developer for Stack Exchange working remotely from Utah. He works on the site reliability team, mostly on the [bosun](http://github.com/bosun-monitor/bosun) open source monitoring system, written in Go.
260 |
261 | Craig has been a programmer since 2004, working mostly in .Net and Java environments. He stumbled into Go about a year and a half ago, and has been hooked ever since.
262 |
263 | His [solution](https://github.com/golangchallenge/GCSolutions/tree/master/june15/normal/craig-peterson).
264 |
265 | ---
266 |
267 | #### Sponsors
268 |
269 | This challenge's sponsors are: [Anand D N](https://twitter.com/Wanderer140), [Apcera](https://www.apcera.com/), [CoreOS](https://coreos.com/), [Crowd Interactive](http://www.crowdint.com/), [Cube Root Software](http://cuberoot.in/), [DigitalOcean](https://www.digitalocean.com/), [Docker](https://www.docker.com/), [GitHub](https://github.com/), [GopherCasts](https://gophercasts.io/), [Helpshift](http://www.helpshift.com/), [InfluxDB](http://influxdb.com/), [John Sonmez](https://twitter.com/jsonmez), [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/), [Manning Publications Co.](http://manning.com/), [NodePrime](http://www.nodeprime.com/), [O'Reilly](http://www.oreilly.com/), [Packt Publishing](https://www.packtpub.com/), [Qwinix Technologies](http://www.qwinixtech.com/), [RainingClouds](http://rainingclouds.com/#!/), [SoStronk](https://www.sostronk.com/) and [Sourcegraph](https://sourcegraph.com/).
270 |
271 | #### Credit
272 |
273 | * The Gopher character is based on the Go mascot designed by Renée French and copyrighted under the Creative Commons Attribution 3.0 license.
274 | * [GitHub](https://github.com/) for the yearly sponsorship of a [GitHub Bronze Organisation plan](https://github.com/pricing) for the Go Challenge.
275 | * The Go Challenge is being organized by [JoshSoftware Pvt. Ltd.](http://www.joshsoftware.com/) with help from the Go community.
276 |
--------------------------------------------------------------------------------