March 04, 2005 Re: Attachments (was: Dynamic rectangular arrays) - | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin M | In article <d0a380$1hui$1@digitaldaemon.com>, Kevin M says... > >Derek, I used http://makcoder.sourceforge.net/demo/base64.php to decode the Base64. I've just installed 40tude, but how do I configure it for this forum? > >Kevin Looks like a handy tool. I added a link to it at Wiki4D (http://www.prowiki.org/wiki4d/wiki.cgi?NewsDmD). Here are some tools (written in D) that I've used: Base64, http://www.dsource.org/tutorials/index.php?show_example=81 UUDECODE, http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/4744 jcc7 |
March 04, 2005 Re: Attachments (was: Dynamic rectangular arrays) - | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin M | On Fri, 4 Mar 2005 16:43:45 +0000 (UTC), Kevin M wrote: > Derek, I used http://makcoder.sourceforge.net/demo/base64.php to decode the Base64. I've just installed 40tude, but how do I configure it for this forum? > (1) Define the new server. ** Select the menu item "Settings"/"Servers, Identities, Signatures..." ** Select "NewsServers" from the list, click the "New" button. ** Give it a name. I've called mine "DigitalMars", click "Ok" ** Type in the host name "news.digitalmars.com" and click "Ok". (2) Define an Identity ** Select the menu item "Settings"/"Servers, Identities, Signatures..." ** Select "Identities" from the list, click the "New" button. ** Give it a name, click the "Ok" button. ** Enter your name. This is the name that is displayed as the "From" name in postings. ** Enter in an email address for postings. This is usually a false one to fool spammers. ddparnell_at_@_bigpond_dot_._com ** Optionally enter in an email address for the Return To address when you send emails. ** Click on the POP3 tab and enter in your POP3 server details. ** Click on the SMTP tab and enter in your SMTP server details. ** Click "Ok" (3) Get a list of groups from the new News Server ** Select the menu item "Online"/"Get complete grouplist(s)"/"DigitalMars" ** After a while, this process will finish. ** Select the tab "New" which is in the "Subscribed", "All", and "Folders" tabbed pane. You will see all the groups in DigitalMars. ** Double click on the ones you wish to subscribe to. ** Select the menu "Online"/"Get new headers in subscribed groups" ** This will ask you the maximum number of headers to download. ** Next you will see in the Headers pane, all the downloaded headers. ** Either double click on any header to download its body, or press the SpaceBar to download the next unread one. Hope this helps. -- Derek Parnell Melbourne, Australia 5/03/2005 8:16:40 AM |
March 05, 2005 Re: Dynamic rectangular arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kevin M | There is no such thing like "dynamic rectangular arrays" in D, yet. You can have static rectangular arrays:
int[13][42] myarray;
but dynamic multidimensional arrays like
int[][] anotherarray;
are always 'ragged' arrays. I.e. each subarray may have another size. The implementation works on arrays of pointers to other arrays, which means that reshaping is generally not possible.
Ideas for real dynamic rectangular arrays are developed but will not go into D 1.0 anymore. Lets hope for future versions.
Ciao,
Norbert
Kevin M schrieb:
> Hello, can someone help me with the following issue regarding dynamic
> "rectangular arrays"? Thanks.
>
> -Porting some C code to D.
> -The C code allocates, deletes, and resizes a multi-dimensional character array
> using malloc/free.
> -Don't want to use malloc/free.
> -How do I create the array Buffer[][] as dynamic, and set its length?
> (ie. Buffer.length = cxBuffer; //obviously won't work)
> -If Buffer[][] needs to be deleted and resized, how is this done)? Will
> new/delete work, if so how?
> -cxBuffer, cyBuffer, and Buffer must be static. They must keep their values when
> the function exits.
>
> Kevin M
>
> ----------------------------
> some_function()
> {
> int x, y;
> static int cxBuffer, cyBuffer;
>
> //Initialize cxBuffer and cyBuffer
> ..
>
> //Create Buffer[][]
> static char Buffer[cxBuffer][cyBuffer];
>
> //Initialize Buffer
> for (y = 0 ; y < cyBuffer ; y++)
> for (x = 0 ; x < cxBuffer ; x++)
> Buffer[x][y] = ' ';
> }
> ----------------------------
>
>
|
March 05, 2005 Re: Dynamic rectangular arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Norbert Nemec | There's no reason why the techniques I describe in Chapter 33, Multidimensional Arrays, of Imperfect C++ cannot be
applied, either in library or built-in form, to D at some point. Given that slices+GC help us in so many ways, D's
arguably
a much better suited language that C++
--
Matthew Wilson
Author: "Imperfect C++", Addison-Wesley, 2004
(http://www.imperfectcplusplus.com)
Contributing editor, C/C++ Users Journal
(http://www.synesis.com.au/articles.html#columns)
Director, Synesis Software
(www.synesis.com.au)
STLSoft moderator
(http://www.stlsoft.org)
Synesis Software Pty Ltd
P.O.Box 125
Waverley
New South Wales, 2024
Australia
-----------------------------------------------------
"Norbert Nemec" <Norbert@Nemec-online.de> wrote in message news:d0d2gb$1b5t$1@digitaldaemon.com...
> There is no such thing like "dynamic rectangular arrays" in D, yet. You can have static rectangular arrays:
>
> int[13][42] myarray;
>
> but dynamic multidimensional arrays like
>
> int[][] anotherarray;
>
> are always 'ragged' arrays. I.e. each subarray may have another size. The implementation works on arrays of pointers to other arrays, which means that reshaping is generally not possible.
>
> Ideas for real dynamic rectangular arrays are developed but will not go into D 1.0 anymore. Lets hope for future versions.
>
> Ciao,
> Norbert
>
>
>
> Kevin M schrieb:
>> Hello, can someone help me with the following issue regarding dynamic "rectangular arrays"? Thanks.
>>
>> -Porting some C code to D.
>> -The C code allocates, deletes, and resizes a multi-dimensional character array
>> using malloc/free.
>> -Don't want to use malloc/free.
>> -How do I create the array Buffer[][] as dynamic, and set its length?
>> (ie. Buffer.length = cxBuffer; //obviously won't work)
>> -If Buffer[][] needs to be deleted and resized, how is this done)? Will
>> new/delete work, if so how?
>> -cxBuffer, cyBuffer, and Buffer must be static. They must keep their values when
>> the function exits.
>>
>> Kevin M
>>
>> ----------------------------
>> some_function()
>> {
>> int x, y;
>> static int cxBuffer, cyBuffer;
>>
>> //Initialize cxBuffer and cyBuffer
>> ..
>>
>> //Create Buffer[][]
>> static char Buffer[cxBuffer][cyBuffer];
>>
>> //Initialize Buffer
>> for (y = 0 ; y < cyBuffer ; y++)
>> for (x = 0 ; x < cxBuffer ; x++)
>> Buffer[x][y] = ' ';
>> }
>> ----------------------------
>>
|
Copyright © 1999-2021 by the D Language Foundation