Contextfree examples wanted.
Moderators: MtnViewJohn, chris, mtnviewmark
Contextfree examples wanted.
This is a copy of a forum post in http://pdscript.com/p/Apps/Community/ph ... /index.php.
category= computer generated image. forum= Context Free.
I wrote a bash script to run the contextfree examples in
debian 8.5 software repository /usr/share/doc/contextfree/examples/*.cfdg.
The result can be accessed from http://pdscript.com/p/debian/example/Computer/index.htm.
I would like more cfdg examples to run and post.
category= computer generated image. forum= Context Free.
I wrote a bash script to run the contextfree examples in
debian 8.5 software repository /usr/share/doc/contextfree/examples/*.cfdg.
The result can be accessed from http://pdscript.com/p/debian/example/Computer/index.htm.
I would like more cfdg examples to run and post.
- MtnViewJohn
- Site Admin
- Posts: 881
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Contextfree examples wanted.
Here is a bash script that I wrote for grabbing gallery designs and piping them into cfdg:
It always outputs to the same file because it is intended to test if changes to cfdg have broken previously running designs.
Code: Select all
#!/bin/bash
if [[ $# == 0 ]]; then
echo "usage: rungallery.sh list_of_batches";
echo " Where a batch is either a gallery id or a range id-id"
echo " Failure code 1 means that id is not in the gallery. The remaining codes are from cfdg."
exit 0;
fi
[ -d output ] || mkdir output
while [[ $# > 0 ]]; do
if [[ $1 =~ ([0-9]+)-([0-9]+) ]]; then
echo "From ${BASH_REMATCH[1]} to ${BASH_REMATCH[2]}"
for (( id = ${BASH_REMATCH[1]}; id <= ${BASH_REMATCH[2]}; ++id )); do
echo -n "$id";
curl -fGLs "http://www.contextfreeart.org/gallery/data.php?id=$id&type=cfdg" | ./cfdg -qP -m 999999 - output/test.png
if [[ $? == 0 ]]; then
echo ' pass';
else
echo " FAIL:$?";
fi
done
else
echo -n "$1";
curl -fGLs "http://www.contextfreeart.org/gallery/data.php?id=$1&type=cfdg" | ./cfdg -qP -m 999999 - output/test.png
if [[ $? == 0 ]]; then
echo ' pass';
else
echo " FAIL:$?";
fi
fi;
shift;
done
Re: Contextfree examples wanted.
Your script sounds nice for personal use. But I hesitate grabbing from the internet, because I would like to post the script along with my rendering of it. I would like author's permission. I would like someone to send me a zip file, containing a large collection of thier own work, for me to render and post.
- MtnViewJohn
- Site Admin
- Posts: 881
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Contextfree examples wanted.
Many people have contributed to the gallery using a Creative Commons license. If you look to the left side of the gallery page, under the gallery tools, you will see a checkbox called (CC) only. If you check this then the gallery will only display designs with some sort of Creative Commons license. If you want scriptable access to CC-licensed designs then I could add something to the data.php API.
Re: Contextfree examples wanted.
How many cfdg files are in the gallery with Creative Commons license?
Would it be easier to manually download them?
I am most familiar with zip file download.
Yes, you may write a script, and tell me how to run it.
You could also send me the files somehow.
I appreciate any help from you. Thank you.
Would it be easier to manually download them?
I am most familiar with zip file download.
Yes, you may write a script, and tell me how to run it.
You could also send me the files somehow.
I appreciate any help from you. Thank you.
All done for now. Thank you.
Thanks to John for sending to me file ccfiles.zip 1.0 mb.
It took my bash program two days to process it.
result is 112.3mb, posted at http://pdscript.com/p/debian/cfdg4_out/global.htm.
Later, with with updated software, I hope to do it again.
It took my bash program two days to process it.
result is 112.3mb, posted at http://pdscript.com/p/debian/cfdg4_out/global.htm.
Later, with with updated software, I hope to do it again.
Re: Contextfree examples wanted.
I am getting updated software, and I hope to improve my website. ccfiles.zip has some files that do not work. See https://contextfreeart.org/phpbb/viewto ... f=4&t=2084. Can John or someone please send me an updated collection?
Re: Contextfree examples wanted.
Thank you, I got the updated archive. My results are posted at
http://pdscript.com/p/debian/contextfre ... tfree2.htm
http://pdscript.com/p/debian/contextfre ... tfree2.htm
Re: Contextfree examples wanted.
Hi Pedro, did you find this updated version work for you well so far?pedro wrote: ↑Wed Mar 29, 2017 4:00 pmHow many cfdg files are in the gallery with Creative Commons license?
Would it be easier to checkout D-Bal Max here and manually download them?
I am most familiar with zip file download.
Yes, you may write a script, and tell me how to run it.
You could also send me the files somehow.
I appreciate any help from you. Thank you.
Last edited by Paffert on Wed Oct 20, 2021 3:49 am, edited 2 times in total.
Re: Contextfree examples wanted.
Yes. Thank you. As I recall, there are not as many errors in the new version. This is very helpful to me. If I want to draw a specific picture, I look in the repository for a similar picture, then see the code that drew the picture, then edit the code to draw the picture that I want. If there is a significant update in the cf repository, I would like to get it. I hope to someday clean up my site.
Re: Contextfree examples wanted.
Did you manage to do what you intended, Pedro? Can you post it here as another example?pedro wrote: ↑Sat Jul 28, 2018 5:43 pmYes. Thank you. As I recall, there are not as many errors in the new version. This best testosterone boosters article is very helpful to me. If I want to draw a specific picture, I look in the repository for a similar picture, then see the code that drew the picture, then edit the code to draw the picture that I want. If there is a significant update in the cf repository, I would like to get it. I hope to someday clean up my site.
Last edited by Domenech on Mon Jul 11, 2022 2:02 am, edited 2 times in total.
Re: Contextfree examples wanted.
Sorry for the delay. I wish this forum would send email to me when there is a reply. Yes, I managed to do what I intended. If I understand your other question correctly, no, I can not post it here due to the large size. It is on my website, pdscript.com. I rearranged my website, which broke some links. By browsing the site, you should find what you are looking for. I know my site is messy, does anyone have suggestions for it? Does anyone find it helpful? I do not wish to go back and redo old work with old operating system.
Re: Contextfree examples wanted.
Thank you, that is a great script! FYI, for some reason the JSON file for #213 is empty:MtnViewJohn wrote: ↑Tue Mar 28, 2017 7:40 pmHere is a bash script that I wrote for grabbing gallery designs and piping them into cfdg:
https://www.contextfreeart.org/gallery/ ... p/213/info
Best Regards, Pavel
- MtnViewJohn
- Site Admin
- Posts: 881
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Contextfree examples wanted.
The JSON encoding fails if the cfdg file is not valid utf-8 encoded text. It should probably succeed with invalid bytes replaced with the � character. I fixed the cfdg file and it now works.
Re: Contextfree examples wanted.
Personally I have collected 475 file so far. I did not include every .cfdg file
though - some .cfdg files are not so pretty, but the 475 I have gathered
are quite nice.
It may be useful if we could add some statistical information, though, e. g.
on the "Gallery" section to display how many .cfdg files there are; and
perhaps if wanted, to also show how many entries are added per month
on an average basis. (I know this depends on how active individual people
are; some add like +20 .cfdg files in one week, others only 1 .cfdg file and
then nothing anymore. But I think it would be interesting to know - also so
that I can check how many .cfdg files I missed.
I added most of them
many years ago, so I don't even know how many .cfdg files exist now. And
a few don't work anymore, not sure why not - perhaps the old ones were
written in a less stringent way or something, but about 98% or so still work
fine here. I also tried to add licences + author names + URL to each of them
but I started many years ago ... I do that for new local entries but some of the
old ones simply miss that.)
though - some .cfdg files are not so pretty, but the 475 I have gathered
are quite nice.
It may be useful if we could add some statistical information, though, e. g.
on the "Gallery" section to display how many .cfdg files there are; and
perhaps if wanted, to also show how many entries are added per month
on an average basis. (I know this depends on how active individual people
are; some add like +20 .cfdg files in one week, others only 1 .cfdg file and
then nothing anymore. But I think it would be interesting to know - also so
that I can check how many .cfdg files I missed.

many years ago, so I don't even know how many .cfdg files exist now. And
a few don't work anymore, not sure why not - perhaps the old ones were
written in a less stringent way or something, but about 98% or so still work
fine here. I also tried to add licences + author names + URL to each of them
but I started many years ago ... I do that for new local entries but some of the
old ones simply miss that.)