exercism / groovy Goto Github PK
View Code? Open in Web Editor NEWExercism exercises in Groovy.
Home Page: https://exercism.org/tracks/groovy
License: MIT License
Exercism exercises in Groovy.
Home Page: https://exercism.org/tracks/groovy
License: MIT License
Web page for the Hello World exercise test suite does not show the tests.
Note: the launch checklist was woefully outdated, since this got created over two years ago, so I deleted it.
Let's use the launch guide as a starting point for discussions about what to do next: https://github.com/exercism/docs/blob/master/language-tracks/launch/README.md
Spock tests should be indented within the given/when/then
The where tables should use || to split inputs from expectations.
Automation script was introduced in #95 for Travis CI.
This should be documented.
I've used Sarah Sharp's FOSS Heartbeat project to generate stats for each of the language track repositories, as well as the x-common repository.
The Exercism heartbeat data is published here: https://exercism.github.io/heartbeat/
When looking at the data, please disregard any activity from me (kytrinyx
), as I would like to get the language tracks to a point where they are entirely maintained by the community.
Please take a look at the heartbeat data for this track, and answer the following questions:
I've made up the following scale:
It would also be useful to know if there a lot of activity on the track, or just the occasional issue or comment.
Please report the current status of the track, including your best guess on the above scale, back to the top-level issue in the discussions repository: exercism/discussions#97
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
Some suites are Spec
s:
@Grab('org.spockframework:spock-core:1.0-groovy-2.4')
import spock.lang.*
class HelloWorldSpec extends Specification {
}
Whereas others are Test
s:
import org.junit.Test
import static org.junit.Assert.assertEquals
class GrainsTest {
}
Once this is consistent, update the test_pattern
in the config.json
.
There are some exercises which have auto-generated README file and require 'Run tests' section update
List of all affected exercises:
In correct version of README file exercise specific test Spec file should be mentioned (example)
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
There are a number of things we're going to want to check before the v2 site goes live. There are notes below that flesh out all the checklist items.
TODO
)core
auto_approve: true
The v2 site has a landing page for each track, which should make people want to join it. If the track page is missing, ping @kytrinyx
to get it added.
If the header of the page starts with TODO
, then submit a pull request to https://github.com/exercism/groovy/blob/master/config.json with a blurb
key. Remember to get configlet and run configlet fmt .
from the root of the track before submitting.
If the "About" section feels a bit dry, then submit a pull request to https://github.com/exercism/groovy/blob/master/docs/ABOUT.md with suggested tweaks.
In order to work well with the design of the new site, we're restricting the formatting of the ABOUT.md
. It can use:
Additionally:
<br/>
can be used to split a paragraph into lines without spacing between them, however this is discouraged.If the code example is too short or too wide or too long or too uninteresting, submit a pull request to https://github.com/exercism/ocaml/blob/master/docs/SNIPPET.txt with a suggested replacement.
Where the v1 site has a long, linear list of exercises, the v2 site has organized exercises into a small set of required exercises ("core").
If you update the track config, remember to get configlet and run configlet fmt .
from the root of the track before submitting.
Core exercises unlock optional additional exercises, which can be filtered by topic an difficulty, however that will only work if we add topics and difficulties to the exercises in the track config, which is in https://github.com/exercism/groovy/blob/master/config.json
We've currently made any hello-world exercises auto-approved in the backend of v2. This means that you don't need mentor approval in order to move forward when you've completed that exercise.
Not all tracks have a hello-world, and some tracks might want to auto approve other (or additional) exercises.
There are no bullet points for this one :)
As we move towards the launch of the new version of Exercism we are going to be ramping up on actively recruiting people to help provide feedback. Our goal is to get to 100%: everyone who submits a solution and wants feedback should get feedback. Good feedback.
If you're interested in helping mentor the track, check out http://mentoring.exercism.io/
When all of the boxes are ticked off, please close the issue.
Tracking progress in exercism/meta#104
A duration of a gigasecond should be measured in seconds, not
days.
The gigasecond
problem has been implemented in a number of languages,
and this issue has been generated for each of these language tracks.
This may already be fixed in this track, if so, please make a note of it
and close the issue.
There has been some discussion about whether or not gigaseconds should
take daylight savings time into account, and the conclusion was "no", since
not all locations observe daylight savings time.
During my work on automation script for Travis CI I've encountered an issue with failing tests for gigasecond
exercise as stated here in #95 (comment)
I was able to write a fast fix for that issue in b80fcbf, but, to be honest, I am not sure that tests work correctly for this exercise. This requires further investigation
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
Currently the linked-list
exercise expects users, according to the naming convention, to create a class called LinkedList
; however, this will conflict with the java.util.LinkedList
class and the exercise will not work.
Thus, the whole exercise should be renamed to double-linked-list
.
As we move towards the launch of the new version of Exercism we are going to be ramping up on actively recruiting people to help provide feedback.
Our goal is to get to 100%: everyone who submits a solution and wants feedback should get feedback. Good feedback. You can read more about this aspect of the new site here: http://mentoring.exercism.io/
To do this, we're going to need a lot more information about where we can find language enthusiasts.
In other words: where do people care a lot and/or know a lot about Groovy?
This is part of the project being tracked in exercism/meta#103
The contents of the SETUP.md file gets included in
the README.md that gets delivered when a user runs the exercism fetch
command from their terminal.
At the very minimum, it should contain a link to the relevant
language-specific documentation on
help.exercism.io.
It would also be useful to explain in a generic way how to run the tests.
Remember that this file will be included with all the problems, so it gets
confusing if we refer to specific problems or files.
Some languages have very particular needs in terms of the solution: nested
directories, specific files, etc. If this is the case here, then it would be
useful to explain what is expected.
Thanks, @tejasbubane for suggesting that we add this documentation everywhere.
See exercism.io#2198.
We're about to start a big push towards version 3 (v3) of Exercism. This is going to be a really exciting step forward for Exercism, with in-browser coding, new Concept Exercises with automated feedback, improved mentoring and much more.
This to be a big community effort, with the work spread out among hundreds of volunteers across Exercism. One key thing is going to be each track having enough maintainers who have the time to manage that community effort. We are therefore putting out a call for new maintainers to bolster our numbers. We're hoping that our existing maintainers will be able to act as mentors to the newer maintainers we add, and take on a parental role in the tracks.
If you are an existing maintainer, could you please reply to this letting us know that you think you'll have time (2-3hrs/week) to help with this over the next 6 months. If you won't have that time, but still want to be a maintainer and just help where you can instead, please tell us that too. If you have come to the end of the road as a maintainer, then we totally understand that and appreciate all your effort, so just let us know.
For anyone new who's interested in becoming a maintainer, thanks for your interest! Being an Exercism maintainer is also a great opportunity to work with some other smart people, learn more about your language of choice, and gain useful skills and experience that are useful for growing your career in the technical leadership direction. Please write a comment below introducing yourself along with your Exercism handle, and telling us why you're interested in becoming a maintainer, and any relevant experience. We will then evaluate every application and contact you using your exercism email address once we have finished the evaluation process.
Thank you!
See also exercism/exercism#5161
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
Currently, our track does not have any script which will run all tests to make sure everything is Ok.
We should implement one
More information - https://github.com/exercism/docs/blob/master/language-tracks/launch/tooling-and-ci.md
Per the discussion in exercism/discussions#128 we
will be installing the probot/stale integration on the Exercism organization on
April 10th, 2017.
By default, probot will comment on issues that are older than 60 days, warning
that they are stale. If there is no movement in 7 days, the bot will close the issue.
By default, anything with the labels security
or pinned
will not be closed by
probot.
If you wish to override these settings, create a .github/stale.yml file as described
in https://github.com/probot/stale#usage, and make sure that it is merged
before April 10th.
If the defaults are fine for this repository, then there is nothing further to do.
You may close this issue.
The old help site was deprecated in December 2015. We now have content that is displayed on the main exercism.io website, under each individual language on http://exercism.io/languages.
The content itself is maintained along with the language track itself, under the docs/
directory.
We decided on this approach since the maintainers of each individual language track are in the best position to review documentation about the language itself or the language track on Exercism.
Please verify that nothing in docs/
refers to the help.exercism.io site. It should instead point to http://exercism.io/languages/:track_id (at the moment the various tabs are not linkable, unfortunately, we may need to reorganize the pages in order to fix that).
Also, some language tracks reference help.exercism.io
in the SETUP.md file, which gets included into the README of every single exercise in the track.
We may also have referenced non-track-specific content that lived on help.exercism.io. This content has probably been migrated to the Contributing Guide of the x-common repository. If it has not been migrated, it would be a great help if you opened an issue in x-common so that we can remedy the situation. If possible, please link to the old article in the deprecated help repository.
If nothing in this repository references help.exercism.io, then this can safely be closed.
Action items from https://github.com/exercism/v2-feedback/blob/master/README.md
The two most important things are:
For a track to be included in the new site, it must have:
We would also really love it if each core exercise unlocks at least one optional exercise.
It seems like significant amount of work
Looks like some of existing exercises don't have placeholder class file for user to start working on the exercise.
Here is the full list of all affected exercises:
To solve this issue create respective placeholder class files (check test Spec to see what is expected) in exercise root directory (example)
We’ve recently started a project to find the best way to design our tracks, in order to optimize the learning experience of students.
As a first step, we’ll be examining the ways in which languages are unique and the ways in which they are similar. For this, we’d really like to use the knowledge of everyone involved in the Exercism community (students, mentors, maintainers) to answer the following questions:
Could you spare 5 minutes to help us by answering these questions? It would greatly help us improve the experience students have learning Groovy :)
Note: this issue is not meant as a discussion, just as a place for people to post their own, personal experiences.
Want to keep your thoughts private but still help? Feel free to email me at [email protected]
Thank you!
I am very new to Groovy and thought about learning it with Exercism.io. I have set-up an environment and did the first two exercises. The third one however seems not working.
I thought it was an error on my side or a bug in the groovy.time.TimeCategory
module. So I looked at the example solution. Well, it is not working either:
Test Failure: gigasecondFromDateWithHoursAndMinutes(GigasecondTest) java.lang.AssertionError: expected:<Wed Mar 27 13:17:40 CET 1991> but was:<Wed Mar 27 14:17:40 CET 1991>
Test Failure: gigasecondFromDateWithHoursAndMinutesAndSeconds(GigasecondTest) java.lang.AssertionError: expected:<Thu Feb 19 03:02:25 CET 2009> but was:<Thu Feb 19 04:02:25 CET 2009>
There is one hour difference in these two tests. The third test works.
I run the tests on Groovy Version: 2.4.5 JVM: 1.8.0_05 Vendor: Oracle Corporation OS: Windows 7
.
Can anyone verify the error or tell me what I do wrong?
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
The problems api (x-api) now supports having exercises collected in a subdirectory
named exercises
.
That is to say that instead of having a mix of bin
, docs
, and individual exercises,
we can have bin
, docs
, and exercises
in the root of the repository, and all
the exercises collected in a subdirectory.
In other words, instead of this:
x{TRACK_ID}/
├── LICENSE
├── README.md
├── bin
│ └── fetch-configlet
├── bowling
│ ├── bowling_test.ext
│ └── example.ext
├── clock
│ ├── clock_test.ext
│ └── example.ext
├── config.json
└── docs
│ ├── ABOUT.md
│ └── img
... etc
we can have something like this:
x{TRACK_ID}/
├── LICENSE
├── README.md
├── bin
│ └── fetch-configlet
├── config.json
├── docs
│ ├── ABOUT.md
│ └── img
├── exercises
│ ├── bowling
│ │ ├── bowling_test.ext
│ │ └── example.ext
│ └── clock
│ ├── clock_test.ext
│ └── example.ext
... etc
This has already been deployed to production, so it's safe to make this change whenever you have time.
We have a number of exercises that have names that do not match the exercise name.
E.g. the exercise word-count
has the file names Phrase.groovy
and PhraseSpec.groovy
. This means that we cannot generate the correct command to run automatically.
In order to make it possible to generate this, the filenames should be based on the exercise name. So word-count
should have the filenames WordCount.groovy
and WordCountSpec.groovy
.
It would also make sense to update the class names in the exercises to match the filenames.
These are the exercises in question.
#64 should probably be merged before this issue gets addressed, since it adds more files that need to be renamed to address this issue.
See issue exercism/exercism#2092 for an overview of operation welcome contributors.
Provide instructions on how to contribute patches to the exercism test suites
and examples: dependencies, running the tests, what gets tested on Travis-CI,
etc.
The contributing document
in the x-api repository describes how all the language tracks are put
together, as well as details about the common metadata, and high-level
information about contributing to existing problems, or adding new problems.
The README here should be language-specific, and can point to the contributing
guide for more context.
From the OpenHatch guide:
Here are common elements of setting up a development environment you’ll want your guide to address:
Preparing their computer
Make sure they’re familiar with their operating system’s tools, such as the terminal/command prompt. You can do this by linking to a tutorial and asking contributors to make sure they understand it. There are usually great tutorials already out there - OpenHatch’s command line tutorial can be found here.
If contributors need to set up a virtual environment, access a virtual machine, or download a specific development kit, give them instructions on how to do so.
List any dependencies needed to run your project, and how to install them. If there are good installation guides for those dependencies, link to them.Downloading the source
Give detailed instructions on how to download the source of the project, including common missteps or obstacles.How to view/test changes
Give instructions on how to view and test the changes they’ve made. This may vary depending on what they’ve changed, but do your best to cover common changes. This can be as simple as viewing an html document in a browser, but may be more complicated.Installation will often differ depending on the operating system of the contributor. You will probably need to create separate instructions in various parts of your guide for Windows, Mac and Linux users. If you only want to support development on a single operating system, make sure that is clear to users, ideally in the top-level documentation.
Each language track has documentation in the docs/
directory, which gets included on the site
on each track-specific set of pages under /languages.
We've added some general guidelines about how we'd like the track to be documented in exercism/exercism#3315
which can be found at https://github.com/exercism/exercism.io/blob/master/docs/writing-track-documentation.md
Please take a moment to look through the documentation about documentation, and make sure that
the track is following these guidelines. Pay particularly close attention to how to use images
in the markdown files.
Lastly, if you find that the guidelines are confusing or missing important details, then a pull request
would be greatly appreciated.
Some exercise README templates contain links to pages which no longer exist in v2 Exercism.
For example, C++'s README template had a link to /languages/cpp for instructions on running tests. The correct URLs to use can be found in the 'Still stuck?' sidebar of exercise pages on the live site. You'll need to join the track and go to the first exercise to see them.
Please update any broken links in the 'config/exercise_readme.go.tmpl' file, and run 'configlet generate .' to generate new exercise READMEs with the fixes.
Instructions for generating READMEs with configlet can be found at:
https://github.com/exercism/docs/blob/master/language-tracks/exercises/anatomy/readmes.md#generating-a-readme
Instructions for installing configlet can be found at:
https://github.com/exercism/docs/blob/bc29a1884da6c401de6f3f211d03aabe53894318/language-tracks/launch/first-exercise.md#the-configlet-tool
Tracking exercism/exercism#4102
For the past three years, the ordering of exercises has been done based on gut feelings and wild guesses. As a result, the progression of the exercises has been somewhat haphazard.
In the past few months maintainers of several tracks have invested a great deal of time in analyzing what concepts various exercises require, and then reordering the tracks as a result of that analysis.
It would be useful to bake this data into the track configuration so that we can adjust it over time as we learn more about each exercise.
To this end, we've decided to add a new key exercises in the config.json file, and deprecate the problems
key.
See exercism/discussions#60 for details about this decision.
Note that we will not be removing the problems
key at this time, as this would break the website and a number of tools.
The process for deprecating the old problems
array will be:
In the new format, each exercise is a JSON object with three properties:
The difficulty rating can be a very rough estimate.
The topics array can be empty if this analysis has not yet been done.
Example:
"exercises": [
{
"slug": "hello-world" ,
"difficulty": 1,
"topics": [
"control-flow (if-statements)",
"optional values",
"text formatting"
]
},
{
"difficulty": 3,
"slug": "anagram",
"topics": [
"strings",
"filtering"
]
},
{
"difficulty": 10,
"slug": "forth",
"topics": [
"parsing",
"transforming",
"stacks"
]
}
]
I see most solutions for high-scores doing something like this:
this.scores.sort { -it }.take(3)
This mutates the instance variable in-place, breaking the validity of the latest()
method. What is needed is http://docs.groovy-lang.org/latest/html/groovy-jdk/java/lang/Iterable.html#sort(boolean,%20groovy.lang.Closure)
this.scores.sort(false) { -it }.take(3)
I propose to add a new test that: creates an instance, does the top 3 then asks for the latest:
def "Personal top three does not mutate"() {
given:
def hs = new HighScores(scores)
def top3 = hs.personalTopThree()
expect:
hs.latest() == expected
where:
scores || expected
[40, 20, 10, 30] || 30
}
If there is interest in this, I'll submit a pull request.
Java track maintainers have established core exercises for the language some of which have been already implemented in Groovy.
I propose to add the rest:
two-fer
scrabble-score
secret-handshake
matrix
triangle
rotational-cipher
saddle-points
flatten-array
linked-list
binary-search
bank-account
It would be better to add separate PR for each exercise. And don't forget about a list of exercise topics and its difficulty score
Right now all of the icons used for the language tracks (which can be seen at http://exercism.io/languages) are stored in the exercism/exercism.io repository in public/img/tracks/
. It would make a lot more sense to keep these images along with all of the other language-specific stuff in each individual language track repository.
There's a pull request that is adding support for serving up the track icon from the x-api, which deals with language-specific stuff.
In order to support this change, each track will need to
img/
at the root of this repository if it doesn't already exist, thenimg/
directory, and importantlyicon.png
In other words, at the end of it you should have the following file:
./img/icon.png
See exercism/exercism#2925 for more details.
I can't remember the history of this, but we ended up with a weird non-biological thing in the RNA transcription exercise, where some test suites also have tests for transcribing from RNA back to DNA. This makes no sense.
If this track does have tests for the reverse transcription, we should remove them, and also simplify the reference solution to match.
If this track doesn't have any tests for RNA->DNA transcription, then this issue can be closed.
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
Judging by logs for Build #194 https://travis-ci.org/exercism/groovy/builds/322106184 no tests were executed for linked-list
exercise.
Looks like Spec
file is broken right now as well.
This should be investigated
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
Issue exercism/java#759 is also related this track:
In config.json we need to have a blurb which explains a bit about Java in ~30 words. See the Go track's config.json for an example.
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
We have decided to require all file-based tracks to provide stubs for their exercises.
The lack of stub file generates an unnecessary pain point within Exercism, contributing a significant proportion of support requests, making things more complex for our students, and hindering our ability to automatically run test-suites and provide automated analysis of solutions.
We believe that it’s essential to understand error messages, know how to use an IDE, and create files. However, getting this right as you’re just getting used to a language can be a frustrating distraction, as it can often require a lot of knowledge that tends to seep in over time. At the start, it can be challenging to google for all of these details: what file extension to use, what needs to be included, etc. Getting people up to speed with these things are not Exercism’s focus, and we’ve decided that we are better served by removing this source of confusion, letting people get on with actually solving the exercises.
The original discussion for this is at exercism/discussions#238.
Therefore, we’d like this track to provide a stub file for each exercise.
In the README.md
for phone-number
, there is the following:
The format is usually represented as
(NXX)-NXX-XXXX
where N is any digit from 2 through 9 and X is any digit from 0 through 9.
However, there are multiple tests in which N
is 1
, in clear contradiction to the statement above, yet the phone number is considered valid.
It seems to me that the test cases should be corrected to adhere to the format described above, and that perhaps additional cases should be added to fail when N
is 1
in either of the indicated positions.
I'd be glad to contribute if there's consensus that this is an issue, although perhaps this is prevalent across all of the languages. I know this problem in Python suffers similarly (although the test cases differ).
Some tracks have added assertions to the exercise test suites that ensure that the solution has a hard-coded version in it.
In the old version of the site, this was useful, as it let commenters see what version of the test suite the code had been written against, and they wouldn't accidentally tell people that their code was wrong, when really the world had just moved on since it was submitted.
If this track does not have any assertions that track versions in the exercise tests, please close this issue.
If this track does have this bookkeeping code, then please remove it from all the exercises.
See exercism/exercism#4266 for the full explanation of this change.
To launch Groovy track on Exercism we would love you to help us implement a number of core exercises mentioned in #70.
This guide can be helpful - Porting an Exercise to Another Language Track
And don't hesitate to ask any questions
README.md mentions the MIT license but there is no LICENSE file
We should decide on track curriculum and change config.json
accordingly. By that I mean we should decide on the following things (can be converted to separate issues):
List of language topics I think we should cover to give a learner a good sense of the language (feel free to extend):
It would be a good idea to create a separate .md
file describing what exercise is suitable for practicing particular topic above assuming it has good hints explaining Groovy specific features and giving other hints.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.