Re: Practical Uses

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 49107
interpreted = N
texte = I suspect that most users will prefer using the [table] context over the [array] simply because most of the problems that WebDNA programmers will need to code a solution for, will not require a data structure with more than two dimensions. And the fact that you can apply several of the exiting WebDNA contexts to a WebDNA table. However, a multi-dimensional array is a pretty standard data type in most languages, and a few WebDNA programmers may make use of an algorithm that requires a data structure that goes beyond two dimensions.In developing the CMS application, we needed a way to detect if two versions of the 'same' file, binary or text, differed in content. Calculating the CRC32 value of two files is a fast and easy way to determine if the content of the two files differ. If the CRC32 values are different, then the file contents to not match. Since we went to the trouble of adding a CRC32 lib to the WebDNA engine, It just made sense to expose that functionality as a new WebDNA tag. I am sure someone will find a use for it, as we have.> -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of > Nitai @ ComputerOil > Sent: Tuesday, April 01, 2003 11:56 PM > To: WebDNA Talk > Subject: Re: Practical Uses > > > On 2.4.2003 9:47 Uhr, Stuart Tremain > wrote: > > > Would some one please tell me some practical uses for the > new WebDNA: > > > > [array] > > This is from David Taniguchi from SMSI. He posted this on the > beta list some > time ago: > > > I told Scott that I would work on the Array Tutorial after > I finish up some > > pending projects. In the meantime, here is example. > > > > > > > ============================================================== > ============= > > Lets say you have a company that sells widgets with a price > break. For > > every widget, you could set up a one dimensional array to > store the prices > > for 'Gold' (=1), 'Silver' (=2) and 'Bronze' (=3) > membership levels. Your > > array may look something like this: > > > > [Widget(1)]=50 > > [Widget(2)]=75 > > [Widget(3)]=100 > > > > For description purposes, I will show the names instead of > the numbers. > > This will make it easier to understand the code. > > > > [Widget(gold)]=50 > > [Widget(silver)]=75 > > [Widget(bronze)]=100 > > > > Your boss tells you that we are going international and we > need to handle > > prices for different currencies. We need to display > prices in 'dollars', > > 'euros', sterling 'pounds' and 'yen'. Our array may look > something like > > this: > > > > [Widget(gold,dollars)]=50 > > [Widget(silver,dollars)]=75 > > [Widget(bronze,dollars)]=100 > > [Widget(gold,euros)]=60 > > [Widget(silver,euros)]=85 > > [Widget(bronze,euros)]=115 > > [Widget(gold,pounds)]=25 > > [Widget(silver,pounds)]=37 > > [Widget(bronze,pounds)]=50 > > [Widget(gold,yen)]=55 > > [Widget(silver,yen)]=82 > > [Widget(bronze,yen)]=110 > > > > Now we can display the information based on membership and currency: > > > > dollars euros pounds yen > > gold 50 60 25 55 > > silver 75 85 37 82 > > bronze 100 115 50 110 > > > > Okay, now your boss tells you that the price will change based on > > shiptocountry location. He gave you this complicated > chart that shows the > > price for each membership/currency/shiptocountry > combination. No problem. > > We will just add another dimension to our array to show > > [Widget(membership,currency,shiptocountry)]. > > > > Now our array looks like: > > > > [Widget(gold,dollar,europe)]=55 > > [Widget(gold,dollar,us)]=50 > > ... > > > > I think you get the idea. If your boss gives you another > complicated chart, > > then it might be as easy as adding another dimension to your array. > > > ============================================================== > ============== > > ======= > > > > Another use for arrays is for game programming. You can > reference (x,y,z) > > coordinates and store information about what is contained > at that location. > > Who knows? Maybe you will design a WebDNA version of Quake. > > > > If anyone can think of other examples, please let me know. > Your examples > > may be a better fit for the tutorial. > > HTH. > > Sincerely, > Nitai Aventaggiato > CEO > > -- > Tools to energize your business > Content Management & eBusiness Systems > > ComputerOil GmbH http://computeroil.com/ > Unionstrasse 4 info@computeroil.com > 8032 Zürich/Switzerland > Tel: +41 (0)43 333 1 555 > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Practical Uses (Alain Russell 2003)
  2. Re: Practical Uses (Brian Fries 2003)
  3. Re: Practical Uses (Charles Kline 2003)
  4. Re: Practical Uses (Alain Russell 2003)
  5. Re: Practical Uses (Nitai @ ComputerOil 2003)
  6. Re: Practical Uses (Alain Russell 2003)
  7. Re: Practical Uses (Nitai @ ComputerOil 2003)
  8. Re: Practical Uses (Scott Anderson 2003)
  9. Re: Practical Uses (Nitai @ ComputerOil 2003)
  10. Practical Uses (Stuart Tremain 2003)
I suspect that most users will prefer using the [table] context over the [array] simply because most of the problems that WebDNA programmers will need to code a solution for, will not require a data structure with more than two dimensions. And the fact that you can apply several of the exiting WebDNA contexts to a WebDNA table. However, a multi-dimensional array is a pretty standard data type in most languages, and a few WebDNA programmers may make use of an algorithm that requires a data structure that goes beyond two dimensions.In developing the CMS application, we needed a way to detect if two versions of the 'same' file, binary or text, differed in content. Calculating the CRC32 value of two files is a fast and easy way to determine if the content of the two files differ. If the CRC32 values are different, then the file contents to not match. Since we went to the trouble of adding a CRC32 lib to the WebDNA engine, It just made sense to expose that functionality as a new WebDNA tag. I am sure someone will find a use for it, as we have.> -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com]On Behalf Of > Nitai @ ComputerOil > Sent: Tuesday, April 01, 2003 11:56 PM > To: WebDNA Talk > Subject: Re: Practical Uses > > > On 2.4.2003 9:47 Uhr, Stuart Tremain > wrote: > > > Would some one please tell me some practical uses for the > new WebDNA: > > > > [array] > > This is from David Taniguchi from SMSI. He posted this on the > beta list some > time ago: > > > I told Scott that I would work on the Array Tutorial after > I finish up some > > pending projects. In the meantime, here is example. > > > > > > > ============================================================== > ============= > > Lets say you have a company that sells widgets with a price > break. For > > every widget, you could set up a one dimensional array to > store the prices > > for 'Gold' (=1), 'Silver' (=2) and 'Bronze' (=3) > membership levels. Your > > array may look something like this: > > > > [Widget(1)]=50 > > [Widget(2)]=75 > > [Widget(3)]=100 > > > > For description purposes, I will show the names instead of > the numbers. > > This will make it easier to understand the code. > > > > [Widget(gold)]=50 > > [Widget(silver)]=75 > > [Widget(bronze)]=100 > > > > Your boss tells you that we are going international and we > need to handle > > prices for different currencies. We need to display > prices in 'dollars', > > 'euros', sterling 'pounds' and 'yen'. Our array may look > something like > > this: > > > > [Widget(gold,dollars)]=50 > > [Widget(silver,dollars)]=75 > > [Widget(bronze,dollars)]=100 > > [Widget(gold,euros)]=60 > > [Widget(silver,euros)]=85 > > [Widget(bronze,euros)]=115 > > [Widget(gold,pounds)]=25 > > [Widget(silver,pounds)]=37 > > [Widget(bronze,pounds)]=50 > > [Widget(gold,yen)]=55 > > [Widget(silver,yen)]=82 > > [Widget(bronze,yen)]=110 > > > > Now we can display the information based on membership and currency: > > > > dollars euros pounds yen > > gold 50 60 25 55 > > silver 75 85 37 82 > > bronze 100 115 50 110 > > > > Okay, now your boss tells you that the price will change based on > > shiptocountry location. He gave you this complicated > chart that shows the > > price for each membership/currency/shiptocountry > combination. No problem. > > We will just add another dimension to our array to show > > [Widget(membership,currency,shiptocountry)]. > > > > Now our array looks like: > > > > [Widget(gold,dollar,europe)]=55 > > [Widget(gold,dollar,us)]=50 > > ... > > > > I think you get the idea. If your boss gives you another > complicated chart, > > then it might be as easy as adding another dimension to your array. > > > ============================================================== > ============== > > ======= > > > > Another use for arrays is for game programming. You can > reference (x,y,z) > > coordinates and store information about what is contained > at that location. > > Who knows? Maybe you will design a WebDNA version of Quake. > > > > If anyone can think of other examples, please let me know. > Your examples > > may be a better fit for the tutorial. > > HTH. > > Sincerely, > Nitai Aventaggiato > CEO > > -- > Tools to energize your business > Content Management & eBusiness Systems > > ComputerOil GmbH http://computeroil.com/ > Unionstrasse 4 info@computeroil.com > 8032 Zürich/Switzerland > Tel: +41 (0)43 333 1 555 > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to > > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Scott Anderson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Live server problems (1999) Date search - yes or no (1997) add line item context and showitems (1998) Providing hard copy of database to client (1997) WebDNA-generated email headers (2003) Robert Minor duplicate mail (1997) spell check site (2005) grep for search, not replace (2002) problems with 2 tags (1997) RE: Signal Raised (1997) Just Testing (1997) greater than or equal to (1997) rounding onlu UP (2002) [Q] Novice's question (1997) info (1997) Security Hole - NetCloak Update (1998) Redirect in 4.0 (2000) [WebDNA] configuring 5.1 with apache 2? (2008) WebCat2.0b15-to many nested [xx] tags (1997) New public beta available (1997)