Welcome Guest, Not a member yet? Register   Sign In
Developing code in MAC from PC
#21

[eluser]Unknown[/eluser]
[quote author="tobben" date="1193650367"]- MAMP (pro or not)
- Transmit (FTP)
- TextMate (Editor)
- CocoaMySQL or NaviCat (SQL)[/quote]

same..
#22

[eluser]abmcr[/eluser]
[quote author="Don Pinkster" date="1196457680"]You don't have to setup anything, that is the best part Wink[/quote]
I have try this features and all work fine: but i need to TEST a newsletter script and i NOT want to send the email; as written in my previous post, in WINDOWS i use a C++ script for transform the email into txt file... This C++ file is
Code:
#include <stdio.h>
#include <string.h>

bool isFileExist(char* nomefile) {
    FILE *stream;
    if ((stream=fopen(nomefile,"r"))!=NULL) {
        return true;
    } else {
        return false;
    }
}

void num2str(int num, char* str) {
    if (num==0) strcpy(str,"0"); else strcpy(str,"");
    while (num) {
        switch (num % 10) {
            case 0:
                strcat(str,"0");
                break;
            case 1:
                strcat(str,"1");
                break;
            case 2:
                strcat(str,"2");
                break;
            case 3:
                strcat(str,"3");
                break;
            case 4:
                strcat(str,"4");
                break;
            case 5:
                strcat(str,"5");
                break;
            case 6:
                strcat(str,"6");
                break;
            case 7:
                strcat(str,"7");
                break;
            case 8:
                strcat(str,"8");
                break;
            case 9:
                strcat(str,"9");
                break;
        }
        num=(int) (num/10);
    }
    _strrev(str);
}

int main(int argc, char* argv[]) {
    /* sendmail path file
        Crea dei file al posto delle email.
        Path è il percorso assoluto della cartella dove mettere i file. Deve esistere. Se non specificato path="C:\".
        File è il nome del file in cui inviare l'output. I file vengono automaticamente numerati.
         Se non specificato file="email".
        p.e.
            sendmail c:\mails\ mail
            sendmail c:\mails\
    */
    // Inizializzo le variabili
    FILE *stream;
    char buffer[81];
    char nomefile[41];
    char stringa[10];
    int i=0,ch='a',j=0;
    bool leggi=true;
    // Inizializzo gli argomenti
    switch (argc) {
        case 1:
            argv[1]="c:\\";
        case 2:
            argv[2]="email";
    }
    //Preparo il nomefile di output
    do {
        strcpy(nomefile,"");
        strcat(nomefile,argv[1]);
        strcat(nomefile,argv[2]);
        num2str(j,stringa);
        strcat(nomefile,stringa);
        strcat(nomefile,".eml");
        j++;
    } while (isFileExist(nomefile));

    //Apro il file di output
    if ((stream=fopen(nomefile,"w"))!=NULL) {
        while (!(((buffer[0]=='.')&&(buffer[1]=='\n'))||(ch == EOF))) {
            // Prende massimo 80 byte alla volta
            for(i=0;(i<79)&&((ch = getchar()) != EOF)&&(ch != '\n');i++) {
                buffer[i] = (char) ch;
            }
            buffer[i++] = '\n'; // <= termine di riga
            // Mette la riga nel file.
            fwrite(buffer,sizeof(char),i,stream);
        }
        fclose(stream);
    } else {
        return 1;
    }

    return 0;
}

and it work with a little edit to the php.ini as
Code:
[mail function]
sendmail_path = c:\mail\sendmail.exe c:\mail\


But how compiling this C++ for MAC?
#23

[eluser]Tanque[/eluser]
my favorite.. CODA... just that... and if you don't wanna install php and mysql for your own, use XAMPP...
#24

[eluser]Mirage[/eluser]
Great to see so many Mac enthusiasts in this community. For completeness I'll throw in my toolset also:

IDE: Zend Studio for Eclipse

After using BBEdit for a while in the late 90's, I plunked down for the Zend Small Business license which gave me Zend Studio Professional. I haven't looked back since. Yes, it was java'ish and not at all Mac chrome - but boy did it ever make the development easier. The syntax checking, autocompletion and debugger are things that are difficult to live without, once you have used them. Last year then they came out with ZS for Eclipse and now it's even better and based on what probably the biggest dev platform out there. And it now has reliable built-in SVN. Excellent product, albeit not free.

Other tools in the IDE chest: TextMate, Coda

PHP stack: Entropy (http://www.entropy.ch/)
Marc has been great of keeping a great stack updated for many years as OS X progressed. It's been hit and miss sometimes and perhaps it's time to move on to a more consistently maintained project. I'll have to check out what are using...

MySQL management: MySQL GUI Tools
Very nicely done and .... free! Workbench isn't available for the Mac, but that's no problem with Parallels Desktop. I've used the workbench to convert a few ASP/Access websites to CI/MySQL sites. Easy as pie.

Version Control: svnX
Great little free tool to manage your subversion repositories. Since upgrading to ZSE with built-in svn, I use it much less but still keep it around for project I don't manage in ZS.

Also promising looks: Versions (http://www.versionsapp.com/)

And finally: Parallels Desktop. This thing is really what makes the Mac a rockstar [Web] development system. I put XP on there and run MultipleIE to test my websites in 'the other' browser. :-) Also maintain a CentOs image since I deploy mostly only that OS.

Cheerio,
-m
#25

[eluser]Nick Husher[/eluser]
[quote author="abmcr" date="1221231978"][quote author="Don Pinkster" date="1196457680"]But how compiling this C++ for MAC?[/quote]

You can use whatever C++ compiler that comes with OS X. You might have to install the dev tools from your OS X DVD to get ahold of it, but if you're familiar with compiling for Unix/Linux, it's not that much different.

For mail sending, you might need to dig into your sendmail.cf file to get the particular effect you want. It might also be in the domain of postfix (another mail-related daemon), I'm not really sure.




Theme © iAndrew 2016 - Forum software by © MyBB