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: mtnviewmark, MtnViewJohn, chris

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

Contextfree examples wanted.

Post by pedro » Tue Mar 28, 2017 1:19 pm

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: 851
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Contextfree examples wanted.

Post by MtnViewJohn » Tue Mar 28, 2017 7:40 pm

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 » Wed Mar 29, 2017 9:48 am

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: 851
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Re: Contextfree examples wanted.

Post by MtnViewJohn » Wed Mar 29, 2017 1:35 pm

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 » Wed Mar 29, 2017 4:00 pm

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 » Tue May 02, 2017 12:14 pm

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 » Thu Dec 21, 2017 4:14 pm

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 » Wed Jan 03, 2018 5:27 pm

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 » Sun Mar 18, 2018 9:05 am

Hi Pedro, did you find this updated version work for you well so far?

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

Re: Contextfree examples wanted.

Post by pedro » Sat Jul 28, 2018 5:43 pm

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 » Mon Oct 01, 2018 4:59 am

Did you manage to do what you intended, Pedro? Can you post it here as another example?

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

Re: Contextfree examples wanted.

Post by pedro » Mon May 13, 2019 8:24 am

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests