Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dead PR now I believe] Exercises ported from other language examples. #4

Closed
wants to merge 44 commits into from
Closed

Conversation

rpottsoh
Copy link
Member

@rpottsoh rpottsoh commented Oct 3, 2016

Not really sure what files really needed to be included in this PR. uHelloWorld.pas contains the example CUT and uTestHelloWorld.pas contains the test framework.

Pascal example of Ruby hello-world exercise.
@kytrinyx
Copy link
Member

kytrinyx commented Oct 3, 2016

There are a couple of things this needs:

  1. The example solution needs to be named with example in the name (case insensitive), otherwise it will be served to people when they fetch the exercise.
  2. The config.json needs to have "hello-world" in the exercises list.

The exercises list format should look like the description in Step 1 of the launch checklist: #1

rpottsoh and others added 3 commits October 5, 2016 12:37
allergies: based on C# example
adding it in again.  I had some issues with branching and couldn't get
git to resolve some discrepancies, so I punted the branch; I copied my
code beforehand so nothing got lost.
@rpottsoh
Copy link
Member Author

rpottsoh commented Oct 5, 2016

Should I assume everything not having example in its name will be served up? Does this also apply to folder names?

* Delete TestHelloWorld.exe

* Delete AllergyTests.exe

* Delete BobTests.exe

* Delete BowlingTests.exe

* Delete Hamming.exe

* Delete LeapTest.exe
@rpottsoh rpottsoh changed the title Pascal hello-world exercise based on Ruby version. Exercises ported from other language examples. Oct 5, 2016
rpottsoh and others added 3 commits October 5, 2016 13:03
trying to exlude EXEs in Win32 sub-folders and __history sub-folders.
* Added uBankAccount.pas to .gitignore

* Created BankAccount Project

* added object code and xml output to .gitignore

* bank-account: based on C# example
The user should comment, or remove, each [Ignore] once the previous test has passed.
@rpottsoh
Copy link
Member Author

rpottsoh commented Oct 6, 2016

I am wondering if this is really going to be a Pascal track but really a Delphi track? I am implementing the exercises using Delphi XE5. Yes, it is Pascal, but it has Embarcadero's spin on the language. Students would be able to perform the exercises using Delphi and maybe could muddle through with Lazarus; any other form of Pascal compiler will likely not work.

Just thinking outloud.

rpottsoh and others added 6 commits October 6, 2016 11:13
* Added uBeerSong.pas to .gitignore

* Created BeerSong Project

* added object code and XML output to .gitignore

* beer-song: based on C# example
* Updated list of exercises.

8 exercises have been completed; 9th is in work.

* added uPhoneNumber.pas to .gitignore

* Created phone-number project

* added object code and xml output to .gitignore

* phone-number: based on C# example
* added uBinarySearch.pas to .gitignore

* added "binary-search" to "exercises"

* added object code and XML output to .gitignore

* binary-search: based on C# example
* Delete dunitx-results.xml

* Delete dunitx-results.xml

* Delete dunitx-results.xml

* Delete dunitx-results.xml

* Delete dunitx-results.xml

* Delete dunitx-results.xml
Realized that a truly empty generic array is an unintialized array,
don't call SetLength against it.
* added uHarryPotter.pas to .gitignore

* added object code and XML testrunner output to .gitignore

* harry-potter: My take on the kata from cyber-dojo

This example has not been ported from another language.
@rpottsoh
Copy link
Member Author

I'm seeing some error messages pertaining to Travis. Should I refrain from adding more exercises for the time being?

@kytrinyx
Copy link
Member

Should I assume everything not having example in its name will be served up? Does this also apply to folder names?

Yes, as long as it's in the path (under exercises/) it will be ignored when people fetch it.

I am wondering if this is really going to be a Pascal track but really a Delphi track?

That's a good question. We might want to rename this to Pascal Delphi or something like that. It is much easier to change it now than to do it later.

I'm seeing some error messages pertaining to Travis.

The error message is this:

Evaluating .
-> config.json is invalid. Try jsonlint.com

I have a script locally that validates json. It relies on the jq library. But jsonlint also works.

#!/usr/bin/env bash

STATUS=0
cat $1 | jq . > /dev/null 2>&1
if [ $? != 0 ]; then
    echo "Invalid json: $1"
    STATUS=1
fi
exit $STATUS

Ideally I would like to see each individual exercise in a separate commit, with no extra merge commits "fix X" commits. To make this easier I would recommend making separate pull requests for each exercise on different branches.

$ git branch -m backup
$ git fetch origin master
$ git checkout -t origin/master
$ git checkout -b hello-world # or beer-song or whatever

Then you can git log backup and find the SHA1 hashes of the commits for hello-world (or whatever), and then

$ git cherry-pick THE_SHA1_HASH

Finally, when you have cherrypicked all the relevant hashes, you can squash and push up to a branch to create a separate PR.

http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request

@rpottsoh
Copy link
Member Author

rpottsoh commented Oct 13, 2016

Katrina,

I’ll try to follow your directions in regards to having separate commits for each exercise. I only use GitHub sparingly, just for my personal stuff and have not delved into using actual git calls to make things happen, but instead relying on the GitHub Windows interface and the web interface.

I started out with a fork of the new Pascal track that you made available to me and cloned a copy of the fork to my computer. I didn’t start off creating branches but eventually started creating branches for each new exercise I started. I would have multiple branches going at once, which wasn’t a real problem until I started making commits to .gitignore while in each of the different branches; things seemed to get out of sync real quick. Once an exercise was completed I would create a PR back to my master (this was problematic early on when I had multiple branches going at once with .gitignore out of sync). In the web interface I got into the habit of doing a squash merge and then deleting the branch… Every time I did this a new commit was appended to the PR that I had made, after completing hello-world, to exercism/xpascal. As I progressed I decided to only create one branch at a time to avoid the issue I was having with .gitignore getting out of sync. Maybe you have noticed this as you scroll down the PR.

<90 minutes later>

I was not having much success following your git steps for creating individual PRs based on the commits I have made by cherry-picking SHAs. I essentially started over. I created branches for each exercise, made a commit for each exercise, and finally a PR for each commit. I think this is essentially what you were trying to achieve. All this should make the initial PR obsolete.

Thanks,

Ryan

@rpottsoh rpottsoh changed the title Exercises ported from other language examples. [Dead PR now I believe] Exercises ported from other language examples. Oct 13, 2016
@kytrinyx
Copy link
Member

@rpottsoh Yes, this is exactly what I was trying to achieve. I'll try to get this all reviewed this weekend.

@rpottsoh
Copy link
Member Author

Thanks @kytrinyx. I may work on another exercise this evening.

rpottsoh added a commit that referenced this pull request Dec 22, 2016
* Added clock exercise (#36) (#4)

* Updated Readme.md
@rpottsoh rpottsoh closed this Dec 29, 2016
rpottsoh added a commit that referenced this pull request Dec 29, 2016
* Added clock exercise (#36) (#4)

* Ignore *.dpr and *.dproj
rpottsoh added a commit that referenced this pull request Dec 29, 2016
* Added clock exercise (#36) (#4)

* Fixed json

binary-search was duplicated and circular-buffer was missing.
rpottsoh added a commit that referenced this pull request Dec 29, 2016
* Added clock exercise (#36) (#4)

* Fix config json (#40) (#6)

* Added clock exercise (#36) (#4)

* Fixed json

binary-search was duplicated and circular-buffer was missing.

* remove Hello-World

* add hello-world

config.json couldn't find hello-world because exercise was located at
Hello-World
rpottsoh added a commit that referenced this pull request Jan 16, 2017
* Exercise: saddle-points (#46)

* Config json (#48) (#2)

* Exercise: saddle-points (#46)

* Changed "Language" value

Changed it to Object Pascal from Pascal.  Curious to see if that affects
the language listing.

* implemented Ignores

* Resort config json (#52) (#4)

Resorted by difficulty

* Update Fork (#5)

* Resort config json (#52)

Resorted by difficulty

* Update saddle points (#51)

Removed unnecessary information

Only left a single hint that is pertinent to this exercise.

* Removed first [ignore]

First test shouldn't be ignored.
rpottsoh added a commit that referenced this pull request Jan 16, 2017
* Exercise: saddle-points (#46)

* Config json (#48) (#2)

* Exercise: saddle-points (#46)

* Changed "Language" value

Changed it to Object Pascal from Pascal.  Curious to see if that affects
the language listing.

* implemented Ignores

* Resort config json (#52) (#4)

Resorted by difficulty

* Update Fork (#5)

* Resort config json (#52)

Resorted by difficulty

* Update saddle points (#51)

Removed unnecessary information

Only left a single hint that is pertinent to this exercise.

* First test was ignored

First tests shouldn't be ignored.
kotp pushed a commit that referenced this pull request Jan 18, 2017
Resorted by difficulty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants