Advice NOT 4D

View: New views
20 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Advice NOT 4D

by Alexander Heintz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Folks,

for a little private pet project i would like to develop a little web  
application.
It will run on my linux server so no 4D or A4D.

I will use MySQL as database as it is already installed.

What are your recommendations to use as a script language?

My current choices would be, in that order:

PHP
RUBY on RAILS (though I still have to get it to run on my Suse 10.1  
with PLESK)
PERL
PYTHON
ASP.NET (via mono)

and for the flashy looks I will use one of the more current libraries  
like EXT, this has already been discussed here in length.

I have frequently heard that PHP is a "bad" and "ugly" language, what  
are your thoughts on this? Any personal favorites / recommendations?

TIA

Alex
_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Advice NOT 4D

by Bill Hutten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Nov 15, 2007, at 3:26 PM, Alexander Heintz wrote:

> I have frequently heard that PHP is a "bad" and "ugly" language,  
> what are your thoughts on this? Any personal favorites /  
> recommendations?

There are many "bad" and "ugly" programmers, but no such languages.  :)

I like PHP a lot - in terms of pure getting-it-done functionality it's  
extremely good.  For small-medium projects I almost always use it  
(usually with MySQL), unless forced to use something else.  Python is  
definitely a better designed, more consistent, language, but I don't  
have enough experience with any of the major Python web frameworks to  
know how they compare to PHP...



- bill
_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Advice NOT 4D

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> What are your recommendations to use as a script language?
>
> My current choices would be, in that order:
>
> PHP
> RUBY on RAILS (though I still have to get it to run on my Suse 10.1  
> with PLESK)

If you have the choice and the time, use Ruby on Rails.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Advice NOT 4D

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 15/11/2007, at 20:40, Bill Hutten wrote:

>
> On Nov 15, 2007, at 3:26 PM, Alexander Heintz wrote:
>
>> I have frequently heard that PHP is a "bad" and "ugly" language,  
>> what are your thoughts on this? Any personal favorites /  
>> recommendations?
>
> There are many "bad" and "ugly" programmers, but no such  
> languages.  :)
>
> I like PHP a lot - in terms of pure getting-it-done functionality  
> it's extremely good.  For small-medium projects I almost always use  
> it (usually with MySQL), unless forced to use something else.  
> Python is definitely a better designed, more consistent, language,  
> but I don't have enough experience with any of the major Python web  
> frameworks to know how they compare to PHP...

and any recomendation for a php framework ?

I'm trying CodeIgniter http://codeigniter.com/  and cake http://www.cakephp.org/

thanks,


raimon

_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

new to Batch ...

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

After more than one year working without Active4D, we have to add some  
new functionality to some of our existing web pages ...


Before using Batch, we simply issue a query and create a RowSet:

        $rs := RowSet.newFromSelection(->[FORMALITZACIO]; $map)


Now, after reading the docs, I see that I can create a Batch from an  
existing RowSet or from a Selection.

After creating the batch, we need another RowSet with the current  
calues of the batch,

And, in the final page, just loop through this new RowSet.

Is this the correct way ?

Because while I was playing, I'm having some errors, like:


/Macintosh HD/Users/Rai/Desktop/Web BS/Web/0081/list_batch.a4d [main] 19
/Macintosh HD/Users/Rai/Desktop/Web BS/Active4D/Batch.a4l  
batch.newFromSelection 1
/Macintosh HD/Users/Rai/Desktop/Web BS/Active4D/Batch.a4l batch._init 1
if (is a collection($inSize)) | (is an iterator($inSize))
Expecting a numeric expression.





What I'm doing wrong here ?

<%
        import("RowSet")
        import("Batch")
       
        $map := """
        id: [FORMALITZACIO]ID_Formalitzacio;
        oficina:[FORMALITZACIO]OFICINA_ID;
        sol_licitant:[FORMALITZACIO]INTERESSAT_PRAL;
        data_inici:[FORMALITZACIO]DATA_CREACIO;

        ultim_moviment:[FORMALITZACIO]DATA_CREACIO;
        estat:[FORMALITZACIO]Entitat_ID;


        """
        ALL RECORDS([FORMALITZACIO])
        REDUCE SELECTION([FORMALITZACIO];100) // testing purposes
       
        $rs := RowSet.newFromSelection(->[FORMALITZACIO]; $map)



// Make the batch using defaults
$attributes:=""
$batch := Batch.newFromSelection(->[FORMALITZACIO];$attributes) //  
here is where Active4D throughs the error
$batch.setDefaults

...


// Now make the RowSet from the subset of rows in the batch
$rs_batch := RowSet.newFromSelection(->[FORMALITZACIO];  
$map;'$batch{"start"}:$batch{"end"}')
// Setup the link info, make the links
c_text($prev; $batches; $next)
$needBatch := $batch->makePageLinks($prev; $batches; $next;$attributes)
if ($rs->rowCount > 0)
%>

....



I think I'm confused of default attributes for batch ...


thanks for your help,


regards,


raimon fernandez



_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: new to Batch ...

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> // Make the batch using defaults
> $attributes:=""
> $batch := Batch.newFromSelection(->[FORMALITZACIO];$attributes) //  
> here is where Active4D throughs the error

Looking at the documentation for Batch.newFromSelection, it says the  
second parameter is supposed to be a number which is the batch size.  
Take a look at the documentation again.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: new to Batch ...

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok, I copied this code from page 429 Iterating Through Rows, and I  
thought those $attributes were there only for changing the default  
ones when you create a batch.

I'll change and see ...

thanks,


raimon


On 29/01/2008, at 17:18, Aparajita Fishman wrote:

>> // Make the batch using defaults
>> $attributes:=""
>> $batch := Batch.newFromSelection(->[FORMALITZACIO];$attributes) //  
>> here is where Active4D throughs the error
>
> Looking at the documentation for Batch.newFromSelection, it says the  
> second parameter is supposed to be a number which is the batch size.  
> Take a look at the documentation again.
>
> Regards,
>
>   Aparajita
>   www.aparajitaworld.com
>
>   "If you dare to fail, you are bound to succeed."
>   - Sri Chinmoy   |   www.srichinmoy.org
>
>
> _______________________________________________
> Active4D-dev mailing list
> Active4D-dev@...
> http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
> Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
>


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Where is makePageLinks ?

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,


On page 427 I can read:

The makeFuseboxLinks method and its non-Fusebox cousin, makePageLinks,  
allow you to
customize everything necessary to format the page links exactly the  
way you want, so
you should never have to do it yourself.


I can't find the method makePageLinks ...

Even TextMate can't find it searching all the Active4d folder ...


thanks,

raimon

_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Where is makePageLinks ?

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I can't find the method makePageLinks ...

That's a documentation error, it should be makeLinks.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Where is makePageLinks ?

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok, now it's working as expected ...

thanks,

rai

On 29/01/2008, at 17:57, Aparajita Fishman wrote:

>> I can't find the method makePageLinks ...
>
> That's a documentation error, it should be makeLinks.
>
> Regards,
>
>   Aparajita
>   www.aparajitaworld.com
>
>   "If you dare to fail, you are bound to succeed."
>   - Sri Chinmoy   |   www.srichinmoy.org
>
>
> _______________________________________________
> Active4D-dev mailing list
> Active4D-dev@...
> http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
> Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/
>


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

batch: char separator and First ... End

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,


Any reason why I can't use the | as a batch separator ?

Batch.setDefaults(20;20;1;15;"<< previous";"  "+mac to html("|")
+"  ";mac to html("següent")+"  >>";"strong";"bst")

I've tried with & and works.

Also, I can't use any special accented char, like à à ü => següent


And, sometimes we get queries from 1000 rows, as I see, the Batch  
doesn't add the First and Last, so, if the user wants to see the very  
end (or the end), he or she will have to select some batch before  
going to the end.

What I'm trying to do is:

<< First < Previous 4 5 6 7 ... 45 46 47 48 Next > Last >>

I suppose I have to do all bymyself ...


thanks,

raimon
_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Limit of length constants

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,


What's the limit of a constant in Active4D ?

I'm using this code fine on 4D but Active4D doesn't recognize the  
constant:

QUERY([BS];[BS]status_id=bs iniciats documentacio penden)


It's 31 char length, if I use other shorter constants works.

Maybe it's a Bug in ACtive 4D when using 31 len constants ?


thanks,


Acitve4D 4.02 OS X 10.5.2 - 4D 2004.7

_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Encoding UTF-8, MacRoman, and Active4D ...

by Raimon Fernandez Sirera-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,


I'm getting an erroneous encoding when Active4D writes some text,  
using <%= %>

All the characters that are outside Active4D tags are viewd correctly.

What I see is that my pages are all UTF-8, and no matter if I use Mac  
to Html or something, the results are always wrong.

The Active4D default encoding is A4D Encoding HTML (8) : A synonym for  
A4D Encoding Extended. This is the default.  and I get the 8 when  
printing <%= get output encoding%>


Doing more experiments, if I change the encoding of my files to Mac  
Roman, Active4D displays correctly, but my normal text appears wrong,  
but if I adjust the html header into MacRoman   <meta http-
equiv="content-type" content="text/html;charset=MacRoman" /> all the  
text is ok.

So, before I re-encode all my pages from UTF-8 into MacRoman, there's  
a special encoding tag for Active4D to encoding from UTF-8 ?


thanks,


raimon


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Encoding UTF-8, MacRoman, and Active4D ...

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> So, before I re-encode all my pages from UTF-8 into MacRoman,  
> there's a special encoding tag for Active4D to encoding from UTF-8 ?

4D 2003/2004 does not have support for UTF-8, so Active4D does not  
either. If you look in the mailing list archive, there was a thread  
about a month ago about dealing with UTF-8 that might help.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Limit of length constants

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> What's the limit of a constant in Active4D ?
>
> I'm using this code fine on 4D but Active4D doesn't recognize the  
> constant:
>
> QUERY([BS];[BS]status_id=bs iniciats documentacio penden)
>
>
> It's 31 char length, if I use other shorter constants works.
>
> Maybe it's a Bug in ACtive 4D when using 31 len constants ?

It looks like a bug, if it is I'll fix it soon.

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Ajax Problem with escaped characters

by Oliver Brodwolf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

I created a plugin to convert utf 8 to mac and mac to utf 8. (only  
for os x)

After a lot's of tests, I think there is a mistake in Active4d.
When sending Ajax-Request with prototype it sends the data escaped.  
You can see this, when install HttpFox to Firefox.

But now I have problems with the ü (ü)
it is send from the browser as %C3BC which is correct.
But Active 4d convert this Post-Variable automatic and after this  
the "ü" is not converted correct.
In my test I simulate this converting-procedure.
I don't know if it is a mistake in my brain, ore a mistake in Active4d.

you can try out:
http://www.mountain.ch/test/ajaxtest.gos?test=%C3%A4%C3%B6%C3%BC

or try this.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
         "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Test Encode Decode</title>
</head>
<body>
<%
$cTest:=new collection

$cTest{"step01 textEscape"}:="%C3%A4%C3%B6%C3%BC"
$cTest{"step02 textDecode"}:=url decode($cTest{"step01 textEscape"})
$cTest{"step03 textEncode"}:=url encode($cTest{"step02 textDecode"})
$cTest{"step04 textDecodeIso2Mac"}:=iso to mac($cTest{"step02  
textDecode"})
$cTest{"step05 textDecodeMac2Iso"}:=mac to iso($cTest{"step04  
textDecodeIso2Mac"})
$cTest{"step06 textEncode"}:=url encode($cTest{"step05  
textDecodeMac2Iso"})
%>
<h3>Convert Steps</h3>
<%a4d.debug.dump collection($cTest)%>
<h3>Query</h3>
<p>Click the Link: <a href="?test=%C3%A4%C3%B6%C3%BC">test=%C3%A4%C3%
B6%C3%BC</a>  means "test=äöü"</p>
<p>Active4d get's %C3%A4%C3%B6%C3%BC</p>
<p>and convert it to </p>

<%a4d.debug.dump collection(_query)%>

<p>When escape this again then you can see the mistake</p>
<%writebr(url encode(mac to win(_query{"test"})))%>
correct is:<br />
%C3%A4%C3%B6%C3%BC
</body>
</html>

Regards, Oliver_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Re: Ajax Problem with escaped characters

by aparajita :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I created a plugin to convert utf 8 to mac and mac to utf 8. (only  
> for os x)
>
> After a lot's of tests, I think there is a mistake in Active4d.

Can you please post this in the issue tracker?

Regards,

    Aparajita
    www.aparajitaworld.com

    "If you dare to fail, you are bound to succeed."
    - Sri Chinmoy   |   www.srichinmoy.org


_______________________________________________
Active4D-dev mailing list
Active4D-dev@...
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Ajax with prototype.js but without utf-8

by Oliver Brodwolf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello

Now I found a way, to use Ajax with prototype.js but without the  
utf-8 problems under 4D and Active4D.
I don't send the form variables direct, which would create utf-8.
I use the postBody Option, and generate a escaped string from the  
form with the function getMyBody().
This creates a request, which is easy to handle with Active4D ore 4D.

<%
$c:=new collection
/*
prototype.js by
http://www.prototypejs.org/
ore a compressed version can be found in protopack_v2.19b.zip
http://groups.google.com/group/prototype-core/files
*/
$c{"prototypePath"}:="/js/lib/prototype.js" // your prototype js-file  
path
$c{"myPath"}:=current path(*)
$c{"act"}:=""
$c{"reqAct"}:=_form{"act"}
$c{"time"}:=current time
if($c{"reqAct"}="")
        // ------- Head Start----------
        %>
        <?xml version="1.0" encoding="iso-8859-1"?>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
                "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
                <meta http-equiv="content-type" content="text/html;  
charset=iso-8859-1" />
                <title>Ajax-Test</title>
                <script type="text/javascript" src="<%=$c{"prototypePath"}%>"> </
script>
                <script type="text/javascript">
                // <![CDATA[
                function ajaxReq(theform,theBlock){
                        $(theform).getMyBody=function(){
                                var objIn=this.serialize(true);
                                var valOut="";
                                  for (var s in objIn){
                                        valOut+=(valOut==""?"":"&")+s+"="+escape(objIn[s]);
                                  }
                                return(valOut);
                        };
               
                        $(theform).request({
                                encoding:'iso-8859-1',
                                postBody:$(theform).getMyBody(),
                                onComplete:function(transport){
                                        var myElm=$(theBlock);
                                        $(myElm).update(transport.responseText);
                                }
                        });
                }
                // ]]>
                </script>
        </head>
        <body>
                <h5>Ajax Test</h5>
                <div id="ajaxBlock">
        <%
        // ------- Head End----------
end if


$c{"usernameAsc"}:=""
$c{"act"}:="step1"
$c{"username"}:=_form{"username"}

$m:=length($c{"username"})
for($n;1;$m)
        $c{"usernameAsc"}+=(ascii($c{"username"}[[$n]])+" ")
end for
a4d.web.dump collection($c)
%>
<form name="form1" id="form1" method="post" action="<%=$c{"myPath"}%
 >" onsubmit="ajaxReq(this,'ajaxBlock');return false;">
        <input type="text" name="username" value="<%=$c{"username"}%>"  
style="width:240px" />
        <input type="hidden" name="act" value="<%=$c{"act"}%>" />
      &nb