codethesaur.us icon indicating copy to clipboard operation
codethesaur.us copied to clipboard

[COBOL] Language request to add COBOL

Open INeedAUniqueUsername opened this issue 4 years ago • 22 comments

Language you would like added

COBOL a.k.a. Common Business Oriented Language

Information on the language

COBOL is a 60 year old domain-specific language designed for business computing and data processing (e.g. huge databases and financial transactions). It may be useful to learn.

Disclaimer

I'd like to maybe get started on the COBOL thesaurus for Hacktoberfest. I don't have direct experience with COBOL at this time (I'm more of an expert at C# and Lisp) but I've been reading through Michael Coughlan's book, Beginning COBOL for Programmers.

Requirements:

  • Copy any JSON file within web/thesauruses/_meta/ to a new cobol directory in web/thesauruses/
  • Edit the JSON file to accurately reflect the latest major version of COBOL
  • Delete the "name": fields before your PR
  • Add in "comment": if you wish to explain something in the code
  • Add in "not-implemented": "true" if the concept doesn't exist in the language. You can then delete the "code" line.

Need Help?

Leave a comment on here with your question, or feel free to ask @geekygirlsarah on Twitter. You can also email [email protected] too.

Thanks!

We really value and appreciate the additions people make to Code Thesaurus, no matter how large or small. So thank you for taking the time to work on this!

INeedAUniqueUsername avatar Oct 18 '21 01:10 INeedAUniqueUsername

I updated this a bit to change and add a few things.

I'll assign it to you! For Hacktoberfest, I tend to make one issue (or request one PR) per concept per language. You can make as many as you want, but I'll be happy if you do one PR per concept if you're participating.

geekygirlsarah avatar Oct 18 '21 02:10 geekygirlsarah

So I got the project running on my local machine but none of my changes are showing up. I'm looking at localhost:8000 on incognito. I'm not sure what's happening here.

INeedAUniqueUsername avatar Oct 18 '21 05:10 INeedAUniqueUsername

Hey @INeedAUniqueUsername, What is it saying or showing when you try to go there? Is it like "server can't be found", or "error with the server", or something else? If you're running the Docker image, is there an error? If you're running the Python app directly, is there an error reported there?

geekygirlsarah avatar Oct 18 '21 22:10 geekygirlsarah

@geekygirlsarah The app starts up with no problems. But nothing happens if I modify the json files.

image

image

INeedAUniqueUsername avatar Oct 18 '21 22:10 INeedAUniqueUsername

Hmm... to the best of my knowledge that should work. Have you tried restarting the Docker container? It should automatically pull in changes to the code and Python/Django should just rerender new stuff on new page visits, but just in case it's not going in for some reason you could try that.

Also are you running it directly (like a docker run -it code-thesaurus) or are you using docker-compose up? The docker-compose will automatically patch in the latest code changes without having to restart the container.

Or if you're running the container directly, you could try to add in like -v .:/code/ to make it automatically pull in changes.

geekygirlsarah avatar Oct 18 '21 22:10 geekygirlsarah

@geekygirlsarah I'm running the container with this command docker run --name ct-container -ti -p 8000:8000 -v `pwd`:/code ct-image

INeedAUniqueUsername avatar Oct 18 '21 23:10 INeedAUniqueUsername

oh wait, maybe I replace pwd with something else. I did not notice that earlier.

INeedAUniqueUsername avatar Oct 18 '21 23:10 INeedAUniqueUsername

I'm not experienced with Docker so I took the most obvious action and copypasted that command into VS Code

INeedAUniqueUsername avatar Oct 18 '21 23:10 INeedAUniqueUsername

Oh! If you leave the backticks in (so leave in -v `pwd`:/code ct-image), it should put the current directory in for you and Docker should pick it up. It should work on Mac, Windows, and Linux.

geekygirlsarah avatar Oct 18 '21 23:10 geekygirlsarah

though also running docker-compose up should do more of that wrangling on its own.

I should probably update the docs with that, since I think docker-compose was added and the instructions didn't get updated yet.

geekygirlsarah avatar Oct 18 '21 23:10 geekygirlsarah

The Installation page is NOT HELPFUL

Sorry, let me retrace my steps

  1. I run docker build -t ct-image .
  2. I run the command docker run --name ct-container -ti -p 8000:8000 -v `pwd`:/code ct-image
  3. I copy the json files for COBOL
  4. I modify meta-info.json to include COBOL
  5. I don't see any change in the app.

I haven't had my patience tested this intensely since the first time I learned C++

INeedAUniqueUsername avatar Oct 18 '21 23:10 INeedAUniqueUsername

From the screenshots, it looks like it should be working, but I get that it is not. And from the command you're running, it seems like it should be.

You could replace `pwd ` with your local directory (so it looks like from your screenshots you could do ``-v /Users/alexm/source/repos/codethesaur.us:/code `) and see if that works.

Or kill the container, then run docker-compose up.

I made issue 15 on the docs to update these instructions. If no one jumps on it in a few days, I should have time to update them myself.

geekygirlsarah avatar Oct 19 '21 00:10 geekygirlsarah

docker-compose up leads to the following error message:

[+] Building 0.1s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                         0.0s 
 => => transferring dockerfile: 32B                                                          0.0s 
 => [internal] load .dockerignore                                                            0.0s 
 => => transferring context: 2B                                                              0.0s 
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: target stage cthesaurus-img could not be found

INeedAUniqueUsername avatar Oct 19 '21 00:10 INeedAUniqueUsername

I'll test more on this tomorrow. I'm not sure what's going on but I can try to debug it and see what's going on.

geekygirlsarah avatar Oct 19 '21 04:10 geekygirlsarah

Okay, I got docker-compose to work. I modified docker-compose.yml to look like this:

version: "3"

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: codethesaurus-container
    ports:
      - "8000:8000"
    volumes:
      - ".:/code"

Source: https://stackoverflow.com/a/63479416

INeedAUniqueUsername avatar Oct 22 '21 19:10 INeedAUniqueUsername

Yeah, that looks about right. I did get it working on my computer, I just didn't push up changes yet. I'll try to get that done tonight or tomorrow. Thanks!

geekygirlsarah avatar Oct 23 '21 03:10 geekygirlsarah

I pushed up a new Dockerfile/docker-compose.yml if that helps! They should be smaller and spin up faster too.

geekygirlsarah avatar Oct 25 '21 22:10 geekygirlsarah

Hey @INeedAUniqueUsername, I figured I'd check in to see how this issue is coming along for you. No rush, but if you're doing Hacktoberfest, it ends in a little over a day, so I figured I'd just remind you.

geekygirlsarah avatar Oct 30 '21 20:10 geekygirlsarah

Oops, I forgot I was going to work on this

INeedAUniqueUsername avatar Oct 30 '21 22:10 INeedAUniqueUsername

lol, that's fine! Do you still want it, or want to unassign? Or just want to keep it just will have to work on it a bit later?

geekygirlsarah avatar Oct 31 '21 03:10 geekygirlsarah

Hey @INeedAUniqueUsername, figured I'd double-check again to see if you're interested in this. If yes, let me know, otherwise I'll probably unassign in the next day or two. And if you have any more questions, let me know!

geekygirlsarah avatar Nov 25 '21 02:11 geekygirlsarah

Haven't heard back so I'm removing them. (If you still want it, let me know and I'll add you back.)

geekygirlsarah avatar Nov 29 '21 19:11 geekygirlsarah