Re: Templating Systems
by bart (Canon) on Jul 15, 2003 at 10:43 UTC
|
| [reply] |
Re: Templating Systems
by tomhukins (Curate) on Jul 15, 2003 at 11:04 UTC
|
| [reply] |
Re: Templating Systems
by adrianh (Chancellor) on Jul 15, 2003 at 10:41 UTC
|
| [reply] |
(OT) Re: Templating Systems
by rob_au (Abbot) on Jul 15, 2003 at 13:00 UTC
|
Your signature ...
10POKE53280,A:POKE53281,A
20?"C64 RULES ";
30A=A+1:IFA=16THENA=0:GOTO10
Tragically, I remember too much from my time on the Commodore 64 - These memory locations on the Commodore 64 controlled the background and border screen colours. Although there is no need to roll the value of A back to zero when you hit 16 as only the low nibble of these registers are interpreted (although you would still need to do so when the value of A hit 256) - The colour of the text and cursor could similarly be controlled by poke-ing similar values into memory location 646 (the memory is a little rusty on this one).
And of course, the ? is simply shorthand for the PRINT key word - Note however that this differs from the shorthand for PRINT# for printing to output channels which is P<shift-R> - This is because PRINT# is interpreted as a separate and unique token by the interpreter. Entering the combination of ?# generates a syntax error ...
Shoot me now ... please ... :-)
perl -le 'print+unpack"N",pack"B32","00000000000000000000001001110001"' | [reply] [d/l] [select] |
|
Ahh yes, I use VICE regularly (not for programming of course! For games silly.). 646 is the correct location for changing the cursor colour, although this doesn't work as desired when you poke character codes directly to screen memory, but it does work when you use the print statement, so you could use it here. Yes yes, you can roll it back at 256, hehee, and sometimes you would just put 64 or 128 for the hell of it. Talk about tragic... Ok... I still have all the old manuals and the basic programming manual. Never did learn assembly for it though, my parents wouldn't buy the book for me. Do you like how I spent time to get the colours looking semi sort of authentic like... Yes, it is time to shoot me now too.
10POKE53280,A:POKE53281,A
20?"C64 RULES ";
30A=A+1:IFA=16THENA=0:GOTO10
|
| [reply] |
Re: Templating Systems
by gellyfish (Monsignor) on Jul 15, 2003 at 11:06 UTC
|
/J\
| [reply] |
|
THANK YOU to all who replied. I did try searching, but I forgot about super search. $gratitude->print('Thanks' x 1000).
10POKE53280,A:POKE53281,A
20?"C64 RULES ";
30A=A+1:IFA=16THENA=0:GOTO10
|
| [reply] |
Re: Templating Systems
by dws (Chancellor) on Jul 15, 2003 at 15:59 UTC
|
I want to use an HTML templating system... for more than just a photo album home page, so it needs to be extensible and flexible.
If you're doing all of the work yourself, Template-Toolkit is quite powerful.
If there's any chance that non-programmers will be working on your templates, you might want to consider HTML::Template. It's less flexible, but quite adequate, and the templates are easy (or at least relatively more easy) for non-programmers to work within.
| [reply] |
Re: Templating Systems
by nite_man (Deacon) on Jul 15, 2003 at 11:09 UTC
|
I use Embperl instead of some template system. It's simply and flexible tool.
Also, I work sometimes with Mason. In my opinion, it's the best choise for building web applications. There are many features in the Mason. Just try to look at documentation. My favorite pure Perl software - Request Tracker has web interface which was developed on Mason.
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
| [reply] |
|
Thanks for your input. I did consider this, and I always think about it, but it really comes down to design philosophy. There are numerous ways to accomplish anything. The reason I don't want to use Mason is that I really really like the idea of separating code and HTML, although, in a sense, template placeholders are code also. I havn't really looked that closely at the documentation for Mason, and I know I should. Thanks for your opinion.
10POKE53280,A:POKE53281,A
20?"C64 RULES ";
30A=A+1:IFA=16THENA=0:GOTO10
|
| [reply] |
|
I'm agree with you. It's right conseption to separate code and HTML. But, I think, generally, it's the same to use operators of pseudo-language of template or Perl. In both cases you have code in your html page.
Implement all logic of your application in the Modules (Classes) and just call methods for retriving some data and display in specified place.
I don't agitate for Mason or Embperl. I'd like to tell you that those tools useful, power and flexible. You should just
look at them more intent. ;-)
Update: How about performance? In case with template system, you will have two processes of your data for building HTML page: preparetion template data and processing your template.
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
| [reply] |
|
| [reply] |
|
<html>
<head><title><% $title %></title</head>
<body>
<h1>Welcome to <% $sitename %>!</h1>
<p>Our product of the day is <% $daily_product %>.</p>
</body>
</html>
<%init>
my $sitename = "Spuds.com";
my $title = "Spuds Home Page";
my $daily_product = get_daily_product();
</%init>
This doesn't seem to be significantly more confusing than an HTML::Template would be, even for the "pretty picture designer guy" -- they just stay away from the %init block.
Although you may not need them at first, Mason also has a bunch of additional features that might prove useful at some time in the future... It's powerful enough to support large public sites. | [reply] [d/l] |