Contextfree examples wanted.

If you have a design you're proud of, share the cfdg file here. It's also a good place to ask for feedback and collaborate.

Moderators: MtnViewJohn, chris, mtnviewmark

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Contextfree examples wanted.

Post by pedro »

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.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Contextfree examples wanted.

Post by MtnViewJohn »

Here is a bash script that I wrote for grabbing gallery designs and piping them into cfdg:

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
It always outputs to the same file because it is intended to test if changes to cfdg have broken previously running designs.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

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.

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Contextfree examples wanted.

Post by MtnViewJohn »

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.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

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.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

All done for now. Thank you.

Post by pedro »

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.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

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?

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

Thank you, I got the updated archive. My results are posted at
http://pdscript.com/p/debian/contextfre ... tfree2.htm

Paffert
Posts: 1
Joined: Tue Mar 06, 2018 2:23 am

Re: Contextfree examples wanted.

Post by Paffert »

pedro wrote:
Wed Mar 29, 2017 4:00 pm
How 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.
Hi Pedro, did you find this updated version work for you well so far?
Last edited by Paffert on Wed Oct 20, 2021 3:49 am, edited 2 times in total.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

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.

Domenech
Posts: 1
Joined: Sat Sep 22, 2018 2:37 am

Re: Contextfree examples wanted.

Post by Domenech »

pedro wrote:
Sat Jul 28, 2018 5:43 pm
Yes. 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.
Did you manage to do what you intended, Pedro? Can you post it here as another example?
Last edited by Domenech on Mon Jul 11, 2022 2:02 am, edited 2 times in total.

pedro
Posts: 12
Joined: Tue Mar 28, 2017 1:14 pm

Re: Contextfree examples wanted.

Post by pedro »

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.

malipivo
Posts: 1
Joined: Wed Jan 06, 2021 8:32 pm

Re: Contextfree examples wanted.

Post by malipivo »

MtnViewJohn wrote:
Tue Mar 28, 2017 7:40 pm
Here is a bash script that I wrote for grabbing gallery designs and piping them into cfdg:
Thank you, that is a great script! FYI, for some reason the JSON file for #213 is empty:
https://www.contextfreeart.org/gallery/ ... p/213/info
Best Regards, Pavel

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Contextfree examples wanted.

Post by MtnViewJohn »

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.

shevy
Posts: 11
Joined: Thu Jan 02, 2014 11:59 am

Re: Contextfree examples wanted.

Post by shevy »

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. :D 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.)

Post Reply