#musicbrainz

/

      • djce
        one prints your request, and explains what all the HTTP headers mean.
      • 2003-04-15 10520, 2003

      • djce
        I got an email from someone asking if I'd care to add a new one which just showed the headers, and didn't have all the bumph.
      • 2003-04-15 10535, 2003

      • djce
        So in the course of doing that, I managed to overwrite (truncate) the existing script. Doh!
      • 2003-04-15 10546, 2003

      • ruaok
        Damn. :-(
      • 2003-04-15 10548, 2003

      • djce
        Luckily, 'cos I work at my ISP :-) I got root on that box.
      • 2003-04-15 10503, 2003

      • djce
        So one pseudo "grep /dev/sda text-in-the-script" later, I got it back!
      • 2003-04-15 10507, 2003

      • djce
        Gotta love root :-)
      • 2003-04-15 10513, 2003

      • ruaok
        heheheh.
      • 2003-04-15 10516, 2003

      • ruaok
        root == god
      • 2003-04-15 10531, 2003

      • ruaok
        Or at least any god I'll believe in. ;-)
      • 2003-04-15 10539, 2003

      • djce
        Then /after/ that, I took a backup to my box at home. Hindsight, eh?
      • 2003-04-15 10548, 2003

      • djce
        OK, work time. Catch you later.
      • 2003-04-15 10552, 2003

      • djce
        G'nite!
      • 2003-04-15 10553, 2003

      • ruaok
        later -- have a good one!
      • 2003-04-15 10500, 2003

      • djce has quit
      • 2003-04-15 10528, 2003

      • ruaok
        ruaok is now known as ruaok|zzz
      • 2003-04-15 10511, 2003

      • eikeon has quit
      • 2003-04-15 10531, 2003

      • jsimmons|out has quit
      • 2003-04-15 10540, 2003

      • eikeon
        eikeon (~eikeon@jungle.ne.client2.attbi.com) has joined #musicbrainz
      • 2003-04-15 10541, 2003

      • eikeon has quit
      • 2003-04-15 10551, 2003

      • eikeon
        eikeon (~eikeon@jungle.ne.client2.attbi.com) has joined #musicbrainz
      • 2003-04-15 10503, 2003

      • jsimmons|out
        jsimmons|out (~jsimmons@gryphon.punk.net) has joined #musicbrainz
      • 2003-04-15 10517, 2003

      • eikeon has quit
      • 2003-04-15 10527, 2003

      • eikeon
        eikeon (~eikeon@jungle.ne.client2.attbi.com) has joined #musicbrainz
      • 2003-04-15 10530, 2003

      • yalaforge
        yalaforge (~matthias@krl9-d9bb4dfb.pool.mediaWays.net) has joined #musicbrainz
      • 2003-04-15 10506, 2003

      • David_Swe
        David_Swe (David_Swe@62.100.151.186) has joined #Musicbrainz
      • 2003-04-15 10517, 2003

      • David_Swe
        Hello?
      • 2003-04-15 10542, 2003

      • yalaforge
        hi, what's up?
      • 2003-04-15 10553, 2003

      • David_Swe
        I got problems.....=)
      • 2003-04-15 10514, 2003

      • yalaforge
        perhaps I can help, but not if it's pascal again
      • 2003-04-15 10544, 2003

      • David_Swe
        ok
      • 2003-04-15 10548, 2003

      • David_Swe
        ascii_sig
      • 2003-04-15 10558, 2003

      • yalaforge
        ascii_sig?
      • 2003-04-15 10516, 2003

      • David_Swe
        in MP3_generateTRM
      • 2003-04-15 10548, 2003

      • David_Swe
        (trm.dll)
      • 2003-04-15 10507, 2003

      • yalaforge
        Sorry, I'm not competent with that. You could wait until ruouk shows up.
      • 2003-04-15 10522, 2003

      • yalaforge
        I heard, icepick is an expert, too.
      • 2003-04-15 10544, 2003

      • David_Swe
        ...
      • 2003-04-15 10501, 2003

      • David_Swe
        They live in USA?
      • 2003-04-15 10505, 2003

      • yalaforge
        ruoak is on PST, where it's in the middle of the night right now
      • 2003-04-15 10553, 2003

      • yalaforge
        yes, at least ruaok. You could try again in about 4-5 hours. Then your chances are much better.
      • 2003-04-15 10553, 2003

      • David_Swe
        I can wait 7 hours......=)
      • 2003-04-15 10516, 2003

      • yalaforge
        Sorry :-(
      • 2003-04-15 10533, 2003

      • David_Swe
        It wasn't a joke....thats my life
      • 2003-04-15 10543, 2003

      • David_Swe
        So.. You know C++
      • 2003-04-15 10544, 2003

      • David_Swe
        ?
      • 2003-04-15 10510, 2003

      • yalaforge
        No, I'm a C guy. Systems, not software engineering
      • 2003-04-15 10534, 2003

      • David_Swe
        your djce?
      • 2003-04-15 10552, 2003

      • yalaforge
        me? no
      • 2003-04-15 10501, 2003

      • David_Swe
        aha
      • 2003-04-15 10534, 2003

      • David_Swe
        Does char * exist in C?
      • 2003-04-15 10546, 2003

      • yalaforge
        sure
      • 2003-04-15 10536, 2003

      • David_Swe
        ok wait
      • 2003-04-15 10523, 2003

      • David_Swe
        char ascii_sig[100];
      • 2003-04-15 10535, 2003

      • David_Swe
        Is that null terminated?
      • 2003-04-15 10516, 2003

      • yalaforge
        It is un-initialized. In C++ as in C. You can't make any assumptions about ascii_sig after the declaration.
      • 2003-04-15 10502, 2003

      • David_Swe
        So how do you find out its length?
      • 2003-04-15 10540, 2003

      • yalaforge
        In the same function this is possible with sizeof.
      • 2003-04-15 10519, 2003

      • David_Swe
        Will you get 100 or 0?
      • 2003-04-15 10511, 2003

      • yalaforge
        char ascii_sig[100]; printf("%d\n", sizeof(ascii_sig)); /* prints 100 */
      • 2003-04-15 10512, 2003

      • yalaforge
        I'd use: #define SIG_SIZE 100
      • 2003-04-15 10516, 2003

      • yalaforge
        char ascii_sig[SIG_SIZE];
      • 2003-04-15 10549, 2003

      • David_Swe
        ok
      • 2003-04-15 10501, 2003

      • David_Swe
        MP3_generateTRM(fileName.c_str(), ascii_sig, &duration);
      • 2003-04-15 10538, 2003

      • David_Swe
        ascii_sig should be a pointer but it is a array....It doesn't make any sense
      • 2003-04-15 10511, 2003

      • yalaforge
        In C, the *name* of an array is the same as a pointer to it's first element.
      • 2003-04-15 10532, 2003

      • yalaforge
        The same applies for C++, of course.
      • 2003-04-15 10557, 2003

      • David_Swe
        MP3_generateTRM(fileName.c_str(), ascii_sig, &duration);
      • 2003-04-15 10506, 2003

      • yalaforge
        If it makes you feel better, you can write &(ascii_sig[0])
      • 2003-04-15 10523, 2003

      • yalaforge
        ;-)
      • 2003-04-15 10526, 2003

      • David_Swe
        ok =)
      • 2003-04-15 10544, 2003

      • yalaforge
        Where's the problem with the code snippet?
      • 2003-04-15 10557, 2003

      • David_Swe
        It's something with the returning of the chars and getting them to a string
      • 2003-04-15 10548, 2003

      • yalaforge
        From which library is this function? It seems it isn't from libmusicbrainz.
      • 2003-04-15 10501, 2003

      • yalaforge
        I could test it if you tell me :-)
      • 2003-04-15 10516, 2003

      • David_Swe
        =). I know that musicbrainz work...
      • 2003-04-15 10529, 2003

      • David_Swe
        It's from the TRM generator
      • 2003-04-15 10557, 2003

      • yalaforge
        Ah, got it. I'm there.
      • 2003-04-15 10558, 2003

      • David_Swe
        The example works...for C++ users.=)
      • 2003-04-15 10545, 2003

      • yalaforge
        There isn't much difference to C in this case.
      • 2003-04-15 10506, 2003

      • yalaforge
        You copied MP3_generateTRM() to your own code?
      • 2003-04-15 10528, 2003

      • David_Swe
        Hell no! I use the dll =)
      • 2003-04-15 10546, 2003

      • icepick
        morning
      • 2003-04-15 10559, 2003

      • yalaforge
        icepick: hi
      • 2003-04-15 10516, 2003

      • icepick tries to read with eye's sleep encrusted
      • 2003-04-15 10501, 2003

      • David_Swe
        america?
      • 2003-04-15 10506, 2003

      • yalaforge
        Looks like some basic C++ problems.
      • 2003-04-15 10519, 2003

      • yalaforge
        David_Swe: Can you put your source file online?
      • 2003-04-15 10535, 2003

      • David_Swe
        It's in pascal..=)
      • 2003-04-15 10541, 2003

      • icepick
        EST
      • 2003-04-15 10553, 2003

      • yalaforge
        pascal, oh dear.
      • 2003-04-15 10558, 2003

      • David_Swe
        =)
      • 2003-04-15 10512, 2003

      • icepick
        David_Swe: ascii_sig is going to be always ... uhh... 17 chars?
      • 2003-04-15 10530, 2003

      • icepick
        and it most likely won't be null term...
      • 2003-04-15 10539, 2003

      • icepick
        but i've not used trm.dll
      • 2003-04-15 10553, 2003

      • David_Swe
        Hmm..Il try
      • 2003-04-15 10559, 2003

      • yalaforge hasn't even heard of trm.dll
      • 2003-04-15 10512, 2003

      • icepick
        is that from tunepimp?
      • 2003-04-15 10534, 2003

      • yalaforge
        Don't think so. It's from mp3_trm.cpp
      • 2003-04-15 10542, 2003

      • yalaforge
        which is in trm-0.2.1
      • 2003-04-15 10538, 2003

      • icepick
        ok...
      • 2003-04-15 10543, 2003

      • David_Swe
        Im going mad
      • 2003-04-15 10528, 2003

      • yalaforge
        David_Swe: So you want to call a C++ function from trm.dll from pascal?
      • 2003-04-15 10546, 2003

      • David_Swe
        yes
      • 2003-04-15 10501, 2003

      • yalaforge isn't the brightest guy around
      • 2003-04-15 10545, 2003

      • yalaforge
        The second argument needs to be a pointer. That pointer should point to a buffer which is large enough.
      • 2003-04-15 10516, 2003

      • David_Swe
        100
      • 2003-04-15 10542, 2003

      • David_Swe
        array of ansichar
      • 2003-04-15 10559, 2003

      • icepick
        David_Swe: found it ... no it should be 37
      • 2003-04-15 10528, 2003

      • yalaforge
        So why not define an array of type ansichar, and a pointer that points to the first element of that array. Then pass the pointer as the second argument to the function.
      • 2003-04-15 10543, 2003

      • icepick
        and it is null terminated
      • 2003-04-15 10506, 2003

      • icepick
        the beginning of an array is a pointer in C
      • 2003-04-15 10531, 2003

      • icepick
        David_Swe: what pascal complier are you using?
      • 2003-04-15 10545, 2003

      • David_Swe
        Borland pascal 7
      • 2003-04-15 10513, 2003

      • David_Swe
        Is it ansi?
      • 2003-04-15 10551, 2003

      • yalaforge
        it should be ascii, which is a subset
      • 2003-04-15 10510, 2003

      • David_Swe
        ok
      • 2003-04-15 10534, 2003

      • yalaforge
        If your ansichar base type is 1 byte wide, it should be OK
      • 2003-04-15 10544, 2003

      • yalaforge
        VAR ascii_sig: ARRAY[0..37] OF ansichar;
      • 2003-04-15 10554, 2003

      • yalaforge
        Or something like that. Don't remember properly.
      • 2003-04-15 10534, 2003

      • David_Swe
        So why doesn't it work =)
      • 2003-04-15 10539, 2003

      • yalaforge
        It is certain, that MP3_generateTRM(..., ascii_sig[0], ...) won't work
      • 2003-04-15 10502, 2003

      • yalaforge
        you need the address of ascii_sig, don't know how that is done in pascal
      • 2003-04-15 10537, 2003

      • David_Swe
        @ascii_sig[0]
      • 2003-04-15 10552, 2003

      • icepick
        ascii_sig is a c string... does that help?
      • 2003-04-15 10512, 2003

      • yalaforge
        then try MP3_generateTRM(..., @ascii_sig[0], ...)
      • 2003-04-15 10523, 2003

      • David_Swe
        Well if I knew what a c string is.......=)
      • 2003-04-15 10548, 2003

      • yalaforge
        David_Swe: a C string is simply an array of char's. Terminated with ASCII NUL.
      • 2003-04-15 10524, 2003

      • icepick nods
      • 2003-04-15 10535, 2003

      • David_Swe
        Mmm..I wonder if its the same as shortstring in pascal
      • 2003-04-15 10548, 2003

      • yalaforge
        You can easily print it: i = 0; while ascii_sig[0] != 0 begin print ascii_sig[i]; i:=i+1; end.
      • 2003-04-15 10508, 2003

      • yalaforge
        oops: i = 0; while ascii_sig[i] != 0 begin print ascii_sig[i]; i:=i+1; end.
      • 2003-04-15 10558, 2003

      • yalaforge
        David_Swe: no, it's no shortstring. AFAIK in shortstring, the length is coded in the 0's element.
      • 2003-04-15 10527, 2003

      • David_Swe
        Aha...how=
      • 2003-04-15 10529, 2003

      • David_Swe
        ?
      • 2003-04-15 10558, 2003

      • yalaforge
        David_Swe: in shortstring, I thought. In C, a string works that way:
      • 2003-04-15 10526, 2003

      • yalaforge
        str[0]='H'; str[1]='i'; str[2]='!'; str[3] = 0;
      • 2003-04-15 10538, 2003

      • yalaforge
        Which is the string 'Hi!'
      • 2003-04-15 10520, 2003

      • David_Swe
        =)
      • 2003-04-15 10524, 2003

      • David_Swe
        Ill try
      • 2003-04-15 10535, 2003

      • yalaforge
        Ok, good luck
      • 2003-04-15 10530, 2003

      • yalaforge
        It's a messy thing to use pascal with libraries written for C. I tried that with Delphi, 5 years ago.
      • 2003-04-15 10548, 2003

      • yalaforge
        BTW: The first argument to MP3_generateTRM() has to be a C string, too.
      • 2003-04-15 10533, 2003

      • David_Swe
        You went over from delphi to c?
      • 2003-04-15 10512, 2003

      • yalaforge
        No, I just had a look at delphi for about half a year.
      • 2003-04-15 10528, 2003

      • yalaforge
        I used C before and after that.
      • 2003-04-15 10501, 2003

      • yalaforge
        Perhaps it would be a good idea to look for (or write) conversation functions for mapping between pascal and C strings.
      • 2003-04-15 10521, 2003

      • David_Swe
        Well there are a lot built in i pascal but they result in the same error
      • 2003-04-15 10512, 2003

      • David_Swe
        I think it's maybe the dll refusing to let go if the memory space........=/
      • 2003-04-15 10519, 2003

      • yalaforge
        Hm, that's bad. Probably you should ask someone on a pascal channel or newsgroup. I can't help very much due to lacking knowledge.