POV-Ray : Newsgroups : povray.general : Serializing a dictionary Server Time
13 Jul 2025 15:04:13 EDT (-0400)
  Serializing a dictionary (Message 11 to 17 of 17)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Josh English
Subject: Re: Serializing a dictionary
Date: 9 Jul 2025 00:43:09
Message: <686df35d$1@news.povray.org>
On 7/7/2025 8:40 AM, jr wrote:

> 
> very good practice/advice.  fwiw, a suitable editor helps, for instance using
> 'vim' makes jumping between opening and closing brace/parenthesis/bracket a
> single (shifted) key press.

I have tried to use vim, but I have fallen into the convenience of the 
Run button in the Windows UI. I have a Linux Mint machine but haven't 
found a nice workflow with POV-Ray and Vim.

Uncle Josh


Post a reply to this message

From: jr
Subject: Re: Serializing a dictionary
Date: 9 Jul 2025 03:30:00
Message: <web.686e1961e086e5d13ecaab5e6cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] freefr> wrote:
> ...
> A long time ago, I started doing the same thing (but in Perl). ...

way more ambitious though, line numbers ! :-).  I don't "speak" perl, and ran
into trouble when i tried the script (for which thanks) on a Debian VM; attached
a screenshot.


regards, jr.


Post a reply to this message


Attachments:
Download 'screenshot 2025-07-09 08.18.58.png' (42 KB)

Preview of image 'screenshot 2025-07-09 08.18.58.png'
screenshot 2025-07-09 08.18.58.png


 

From: jr
Subject: Re: Serializing a dictionary
Date: 9 Jul 2025 03:40:00
Message: <web.686e1bdce086e5d13ecaab5e6cde94f1@news.povray.org>
hi,

Josh English <Jos### [at] joshuarenglishcom> wrote:
> On 7/7/2025 8:40 AM, jr wrote:
> > ... 'vim' makes jumping ... a single (shifted) key press.
>
> I have tried to use vim, but I have fallen into the convenience of the
> Run button in the Windows UI. I have a Linux Mint machine but haven't
> found a nice workflow with POV-Ray and Vim.

looked but cannot, of course, now find the reference. :-)  LeForgeron (I think)
posted an image / chart depicting his setup.  I use the below in my '~/.vimrc',
which is based on / derived from that "tip".  my "workflow" when writing scene
code is to occasionally do a ":make" to confirm there are no typos etc, ie am at
that point only interested in the parsing; for that I have a dedicated
"one-liner" shell script, "povparse", also below.  workflows are v individual,
but LeForgeron's "method" works for me.


regards, jr.

-----<snip>-----
"
au Filetype pov setlocal makeprg=povparse\ +i%
au Filetype povini setlocal makeprg=povparse\ %
au BufRead,BufNewFile, *.ini set filetype=povini

-----<snip>-----
#!/bin/sh
/usr/bin/nice -n 19 /usr/local/bin/povray-3.8.0-beta.2 +w32 +h32 -d -f -p -gr
-gs $*


Post a reply to this message

From: jr
Subject: Re: Serializing a dictionary
Date: 9 Jul 2025 06:55:00
Message: <web.686e49cee086e5d13ecaab5e6cde94f1@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> kurtz le pirate <kur### [at] freefr> wrote:
> > ...
> > A long time ago, I started doing the same thing (but in Perl). ...
>
> way more ambitious though, line numbers ! :-).  I don't "speak" perl, and ran
> into trouble when i tried the script (for which thanks) on a Debian VM; attached
> a screenshot.

ignore.  the trouble was the 1st line, all good w/out that comment line.


regards, jr.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Serializing a dictionary
Date: 10 Jul 2025 10:45:04
Message: <686fd1f0$1@news.povray.org>
On 09/07/2025 09:25, jr wrote:
> hi,
> 
> kurtz le pirate <kur### [at] freefr> wrote:
>> ...
>> A long time ago, I started doing the same thing (but in Perl). ...
> 
> way more ambitious though, line numbers ! :-).  I don't "speak" perl, and ran
> into trouble when i tried the script (for which thanks) on a Debian VM; attached
> a screenshot.
> 
> 
> regards, jr.



A yes, the script uses the "File::Basename" module, which is not present 
in your system. I use cpan to install/manage modules. More infos here : 
<https://wiki.debian.org/PerlFAQ> :.

cpan
install File::Basename




more ambitious : yes, lines numbers, list of vars and where vars are 
used. but it's a wip...



-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

From: jr
Subject: Re: Serializing a dictionary
Date: 10 Jul 2025 14:35:00
Message: <web.687006aae086e5d13ecaab5e6cde94f1@news.povray.org>
hi,

kurtz le pirate <kur### [at] freefr> wrote:
> On 09/07/2025 09:25, jr wrote:
> > ...
> > way more ambitious though, line numbers ! :-). ...
> ...
> more ambitious : yes, lines numbers, list of vars and where vars are
> used. but it's a wip...

agree, a list of the variables and so on is very useful to have, in particular
when "playing" with unfamiliar (someone else's :-)) code.

I don't know MacOS, do you have/use the 'less' and 'vim' programs ?  both can
use  "tags" files created by 'ctags'.  that program, patched[*], can give you
variables, and usage; for instance below the first few lines output based on one
of your scenes (Oct 31st 2023):

$ ectags --sdl-kinds=v -ux pursuitcurve.pov
displayAxis      variable     33 pursuitcurve.pov #declare displayAxis = false;
displayPlane     variable     34 pursuitcurve.pov #declare displayPlane = false;
AxisLen          variable     37 pursuitcurve.pov #declare AxisLen = 16;
Scale            variable     39 pursuitcurve.pov #declare Scale =
AxisLen/image_width;
C                variable    115 pursuitcurve.pov #local C =
_Brightness*_Saturation;
X                variable    116 pursuitcurve.pov #local X = C - (1 -
abs(mod(_Hue/60,2) - 1));
m                variable    117 pursuitcurve.pov #local m = _Brightness-C;
....

only requesting variables, the '-ux' selects an unsorted cross-reference format
to console/terminal; when invoked without options, it'll write a "tags" file.

[*] <drive.google.com/file/d/10ikrIHkMopedFPlq6V4YhnnNn3sY59hC/view?usp=sharing>


regards, jr.


Post a reply to this message

From: kurtz le pirate
Subject: Re: Serializing a dictionary
Date: 11 Jul 2025 11:39:40
Message: <6871303c@news.povray.org>
On 10/07/2025 20:30, jr wrote:
> hi,
> 
> kurtz le pirate <kur### [at] freefr> wrote:
>> On 09/07/2025 09:25, jr wrote:
>>> ...
>>> way more ambitious though, line numbers ! :-). ...
>> ...
>> more ambitious : yes, lines numbers, list of vars and where vars are
>> used. but it's a wip...
> 
> agree, a list of the variables and so on is very useful to have, in particular
> when "playing" with unfamiliar (someone else's :-)) code.
> 
> I don't know MacOS, do you have/use the 'less' and 'vim' programs ?  both can
> use  "tags" files created by 'ctags'.  that program, patched[*], can give you
> variables, and usage; for instance below the first few lines output based on one
> of your scenes (Oct 31st 2023):

Yes, i have less and vim.
I'm not familiar with this type of tags/ctags



> $ ectags --sdl-kinds=v -ux pursuitcurve.pov
> displayAxis      variable     33 pursuitcurve.pov #declare displayAxis = false;
> displayPlane     variable     34 pursuitcurve.pov #declare displayPlane = false;
> AxisLen          variable     37 pursuitcurve.pov #declare AxisLen = 16;
> Scale            variable     39 pursuitcurve.pov #declare Scale =
> AxisLen/image_width;
> C                variable    115 pursuitcurve.pov #local C =
> _Brightness*_Saturation;
> X                variable    116 pursuitcurve.pov #local X = C - (1 -
> abs(mod(_Hue/60,2) - 1));
> m                variable    117 pursuitcurve.pov #local m = _Brightness-C;
> ....
> 
> only requesting variables, the '-ux' selects an unsorted cross-reference format
> to console/terminal; when invoked without options, it'll write a "tags" file.
> 
> [*] <drive.google.com/file/d/10ikrIHkMopedFPlq6V4YhnnNn3sY59hC/view?usp=sharing>



I'll take a look.


> regards, jr.

;)


-- 
kurtz le pirate
compagnie de la banquise


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.